/* ==========================================================================
   Teacher Console Styles - Ultra-Focused Lecture Cockpit & Modern Cyber Glass
   ========================================================================== */

/* --------------------------------------------------------------------------
   極簡緊湊 Header (高度約 42px，投影代碼以 Icon 置於此，連線狀態僅用 Icon 燈號)
   -------------------------------------------------------------------------- */
.topbar-slim {
  position: sticky; top: 0; z-index: 50;
  height: 44px;
  background: rgba(13, 14, 21, 0.92);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.topbar-container {
  max-width: 1380px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; gap: 8px; padding: 0 10px;
}
.topbar-brand {
  display: flex; align-items: center; gap: 6px; flex: 0 1 auto; min-width: 0;
}
.topbar-brand .brand-ico { font-size: 1.15rem; line-height: 1; flex: none; }
.topbar-brand .brand-name {
  font-family: var(--font-display); font-size: 0.9rem; font-weight: 700;
  letter-spacing: .02em; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar-brand .room-pill {
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 800;
  letter-spacing: .08em; padding: 2px 6px; border-radius: 6px;
  background: rgba(124, 58, 237, 0.22); border: 1px solid rgba(124, 58, 237, 0.45);
  color: #c4b5fd; flex: none;
}

/* 連線狀態：移除文字，僅保留高質感 Wi-Fi 網路狀態 Icon */
.topbar-status {
  display: flex; align-items: center; flex: none;
}
.net-status-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: default; transition: all .25s ease;
  color: #94a3b8;
}
.net-status-icon .net-svg {
  display: block; transition: all .25s ease; width: 15px; height: 15px;
}
.net-status-icon.ok {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
}
.net-status-icon.warn {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
  animation: netPulse 1.2s infinite;
}
.net-status-icon.danger {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.25);
}
@keyframes netPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.96); }
}

.topbar-actions {
  display: flex; align-items: center; gap: 4px; flex: none; margin-left: auto;
}
.top-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 4px 6px; border-radius: 8px;
  font-size: 0.8rem; font-weight: 600; color: var(--text-2);
  text-decoration: none; border: 1px solid transparent;
  background: transparent; cursor: pointer;
  transition: all .15s ease;
}
.top-link:hover {
  color: var(--text); background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}
.top-link.btn-icon-only {
  font-size: 1rem; padding: 4px 6px; min-width: 28px; height: 28px;
}
/* 投影代碼 Header 按鈕 */
#btn-project-qr {
  color: #c4b5fd;
  background: rgba(124, 58, 237, 0.14);
  border: 1px solid rgba(124, 58, 237, 0.35);
}
#btn-project-qr:hover {
  background: rgba(124, 58, 237, 0.28);
  border-color: rgba(124, 58, 237, 0.55);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.35);
  color: #ffffff;
}
.top-link.btn-logout:hover {
  color: var(--danger); background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.25);
}

.teacher-main {
  padding: 12px 14px 60px;
  max-width: 1380px; margin: 0 auto;
}

/* --------------------------------------------------------------------------
   操作控制列 (Control Bar)
   -------------------------------------------------------------------------- */
.ctrl-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border-hi);
  box-shadow: var(--shadow); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.btn-record-hero {
  --bh: 50px;
  flex: 1 1 200px;
  min-height: var(--bh);
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: .02em;
  border-radius: 14px;
  background: var(--grad);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 6px 20px -3px rgba(124, 58, 237, 0.5), 0 0 0 1px rgba(124, 58, 237, 0.25);
  cursor: pointer;
  transition: all .2s var(--ease);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn-record-hero:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 10px 28px -3px rgba(124, 58, 237, 0.65);
}
.btn-record-hero:active {
  transform: translateY(0) scale(0.98);
}
.btn-record-hero.is-live {
  background: var(--grad-warm);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 6px 25px -2px rgba(244, 63, 94, 0.65), 0 0 0 2px rgba(244, 63, 94, 0.35);
  animation: heroPulse 2s ease-in-out infinite;
}
@keyframes heroPulse {
  0%, 100% { box-shadow: 0 6px 25px -2px rgba(244, 63, 94, 0.65), 0 0 0 2px rgba(244, 63, 94, 0.35); }
  50% { box-shadow: 0 8px 36px 2px rgba(244, 63, 94, 0.85), 0 0 0 5px rgba(244, 63, 94, 0.2); }
}

.ctrl-tools {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1 1 auto;
}
.mic-select-field {
  min-width: 150px; flex: 1 1 150px; margin: 0;
}

.ctrl-hero-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
}

/* 學員語音發言開關按鈕 (以 Icon 形式與開始上課並列在其左側) */
.btn-student-mic-hero {
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all .2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn-student-mic-hero .mic-ico {
  font-size: 1.35rem;
  line-height: 1;
}
.btn-student-mic-hero .mic-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
  transition: all .2s;
}
.btn-student-mic-hero:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}
.btn-student-mic-hero:active {
  transform: translateY(0);
}
.btn-student-mic-hero.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.28), rgba(99, 102, 241, 0.35));
  border-color: rgba(56, 189, 248, 0.6);
  color: #38bdf8;
  box-shadow: 0 0 18px -2px rgba(56, 189, 248, 0.45), 0 0 0 1px rgba(56, 189, 248, 0.3);
}
.btn-student-mic-hero.active .mic-dot {
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  animation: dotBlink 1.2s infinite;
}
@keyframes dotBlink { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.3; transform: scale(0.8); } }

/* 一鍵清空危險按鈕 */
.danger-btn {
  color: #f87171; border-color: rgba(239, 68, 68, 0.25);
}
.danger-btn:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
  color: #fca5a5 !important;
}

/* --------------------------------------------------------------------------
   上課核心佈局 (Lecture Deck)
   -------------------------------------------------------------------------- */
.classroom-layout-stack {
  display: flex; flex-direction: column; gap: 14px;
}

.lecture-deck {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr);
  gap: 16px;
  align-items: start;
}

.deck-primary {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 預設位置順序：① 最新發話 → ② 學員語音回答 → ③ 課堂歷史逐字稿 */
#live-spotlight-card {
  order: 1;
  transition: transform .25s ease, box-shadow .25s ease;
}
#student-voice-card {
  order: 2;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
#transcript-card {
  order: 3;
}

/* 當學員語音回饋打開時，學員語音回答的介面位置就跟最新發話互換，關閉時再切換回來 */
.deck-primary.student-voice-active #student-voice-card {
  order: 1;
  border-color: rgba(14, 165, 233, 0.55);
  box-shadow: 0 0 24px -4px rgba(14, 165, 233, 0.35);
}
.deck-primary.student-voice-active #live-spotlight-card {
  order: 2;
}

@media (max-width: 959px) {
  .lecture-deck {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
}

@media (max-width: 768px) {
  .topbar-brand .brand-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .ctrl-bar {
    padding: 10px 12px;
    gap: 8px;
  }
  /* 行動裝置上英雄操作群組：左側學員語音Icon + 右側開始上課按鈕並列 */
  .ctrl-hero-group {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .btn-student-mic-hero {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
  }
  .btn-record-hero {
    flex: 1 1 auto;
    width: calc(100% - 56px);
    min-height: 48px;
    font-size: 1.02rem;
  }
  .ctrl-tools {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .mic-select-field {
    flex: 1 1 100%;
    margin: 0;
  }
  /* 行動裝置上開始上課按鈕下面依序為：最新發話 (或開啟回饋時互換置頂的學員回答)、課堂歷史逐字稿記錄 */
  .deck-primary {
    order: 1;
    width: 100%;
  }
  .deck-secondary {
    order: 2;
    width: 100%;
  }
  .teacher-bottom-bar {
    margin-top: 18px;
    padding: 14px 0 20px;
  }
  .live-spotlight-card {
    padding: 12px 12px;
    border-radius: 14px;
  }
  .spotlight-slim-header {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 6px;
    padding-bottom: 2px;
  }
  .spotlight-slim-header::-webkit-scrollbar { display: none; }
  .spotlight-zh {
    font-size: 1.25rem;
    margin-bottom: 8px;
  }
}

.cockpit-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px;
}
.cockpit-card-head .head-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.96rem; font-weight: 700; color: var(--text);
}
.cockpit-card-head .head-badges, .cockpit-card-head .head-stats {
  display: flex; align-items: center; gap: 6px;
}
.stat-chip {
  font-size: 0.8rem; color: var(--text-2); background: rgba(255,255,255,0.06);
  padding: 2px 8px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.08);
}
.stat-chip b { color: var(--accent); }

/* 語音狀態儀表 */
.voice-status-card {
  padding: 16px;
}
.voice-meter-wrap {
  display: flex; flex-direction: column; gap: 12px;
}
.waveform-box {
  width: 100%; height: 56px; border-radius: 12px;
  background: rgba(0, 0, 0, 0.55); border: 1px solid var(--border);
  overflow: hidden; position: relative;
}
.waveform-box canvas { width: 100%; height: 100%; display: block; }
.voice-indicators {
  display: flex; align-items: center; justify-content: space-around;
  padding: 8px 12px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.06);
}
.db-meter, .vad-meter {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.db-num {
  font-family: var(--font-mono); font-size: 1.15rem; font-weight: 700; color: #38bdf8;
}
.db-lbl, .vad-lbl {
  font-size: 0.72rem; color: var(--text-3);
}

/* 學生即時反應儀表 */
.student-reactions-card {
  padding: 16px;
}
.pace-alert {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 8px; margin-bottom: 12px;
  background: rgba(245, 158, 11, 0.16); border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24; font-size: 0.85rem; font-weight: 600;
  animation: shakeAlert .4s ease;
}
@keyframes shakeAlert {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.reactions-matrix {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px; margin-bottom: 12px;
}
.rx-counter-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 8px 4px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all .2s ease;
}
.rx-counter-box .rx-emo { font-size: 1.25rem; line-height: 1; }
.rx-counter-box .rx-name { font-size: 0.7rem; color: var(--text-3); }
.rx-counter-box .rx-val { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.rx-counter-box.alert-warn.active {
  background: rgba(245, 158, 11, 0.18); border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}
.rx-counter-box.alert-warn.active .rx-val { color: #fbbf24; }
.rx-counter-box.alert-danger.active {
  background: rgba(244, 63, 94, 0.18); border-color: rgba(244, 63, 94, 0.5);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.2);
}
.rx-counter-box.alert-danger.active .rx-val { color: #f43f5e; }

/* --------------------------------------------------------------------------
   即席多語翻譯聚光燈 (Spotlight - 目光核心焦點)
   -------------------------------------------------------------------------- */
.live-spotlight-card {
  position: relative;
  background: linear-gradient(145deg, rgba(30, 27, 54, 0.92) 0%, rgba(18, 20, 34, 0.95) 100%);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: 0 12px 36px -8px rgba(0, 0, 0, 0.65), 0 0 28px -6px rgba(124, 58, 237, 0.3);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.spotlight-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.spotlight-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 99px;
  font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}
.spotlight-badge.pending {
  background: rgba(245, 158, 11, 0.15); border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}
.spotlight-ms {
  font-size: 0.76rem; color: #94a3b8; font-family: var(--font-mono);
}
/* 扁平化單行標頭列：釋放手機寶貴垂直空間 */
.spotlight-slim-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.spotlight-title-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.spotlight-time {
  margin-left: auto;
  font-size: 0.78rem;
  flex: none;
}
.spotlight-target-bar {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0;
}
.spotlight-target-bar::-webkit-scrollbar { display: none; }
.lang-slim-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 99px;
  font-size: 0.74rem;
  font-weight: 650;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.2;
}
.lang-slim-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.22);
}
.lang-slim-chip.active {
  background: rgba(14, 165, 233, 0.18);
  border-color: rgba(56, 189, 248, 0.6);
  color: #38bdf8;
  box-shadow: 0 0 10px -2px rgba(56, 189, 248, 0.35);
}
.lang-slim-chip.active.speed {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.65);
  color: #34d399;
  box-shadow: 0 0 10px -2px rgba(16, 185, 129, 0.4);
}
.lang-slim-chip .chip-flag {
  font-size: 0.85rem;
  line-height: 1;
}
.lang-slim-chip .chip-speed {
  font-size: 0.7rem;
  color: #fbbf24;
  margin-left: 1px;
}
.spotlight-zh {
  font-size: clamp(1.35rem, 2.8vw, 1.75rem);
  font-weight: 700;
  line-height: 1.45;
  color: #ffffff;
  word-break: break-word;
  margin-bottom: 14px;
}
.spotlight-zh.idle {
  color: var(--text-3); font-weight: 500; font-size: 1.05rem;
}
.spotlight-tr-grid {
  display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  padding-top: 14px; border-top: 1px dashed rgba(255, 255, 255, 0.12);
}
.spotlight-tr-item {
  display: flex; gap: 8px; align-items: baseline; font-size: 1rem; line-height: 1.5; color: #cbd5e1;
  background: rgba(255, 255, 255, 0.03); padding: 8px 12px; border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.spotlight-tr-item .flag { font-size: 1.25rem; flex: none; }
.spotlight-tr-item .text { word-break: break-word; }

/* --------------------------------------------------------------------------
   學員語音發言回饋專區 (Student Voice Responses - 口譯頻道)
   -------------------------------------------------------------------------- */
.student-voice-card {
  padding: 16px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.8) 0%, rgba(13, 14, 21, 0.9) 100%);
}
.student-feedback-feed {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 280px; overflow-y: auto;
}
.empty-voice-tip {
  display: flex; align-items: center; gap: 10px;
  padding: 14px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.02); border: 1px dashed rgba(255, 255, 255, 0.1);
  color: var(--text-3); font-size: 0.88rem; line-height: 1.5;
}
.empty-voice-tip .ico { font-size: 1.5rem; flex: none; }

.feedback-item {
  padding: 12px 14px; border-radius: 12px;
  background: rgba(30, 41, 59, 0.6); border: 1px solid rgba(56, 189, 248, 0.3);
  animation: slideInDown .3s ease both;
}
.feedback-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
  font-size: 0.82rem; color: var(--text-2);
}
.feedback-head .fb-name { font-weight: 700; color: #38bdf8; }
.feedback-head .fb-lang {
  padding: 1px 6px; border-radius: 4px; font-size: 0.72rem;
  background: rgba(56, 189, 248, 0.15); color: #7dd3fc;
}
.feedback-orig {
  font-size: 0.92rem; color: var(--text-2); font-style: italic; margin-bottom: 6px;
}
.feedback-zh-bubble {
  display: flex; gap: 8px; align-items: baseline;
  padding: 8px 12px; border-radius: 8px;
  background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.35);
  color: #a7f3d0; font-size: 1.05rem; font-weight: 650; line-height: 1.45;
}
.feedback-zh-bubble .ico { font-size: 1.15rem; flex: none; }
.feedback-audio-btn {
  margin-top: 6px; display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 6px; font-size: 0.76rem;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-2); cursor: pointer; transition: all .15s;
}
.feedback-audio-btn:hover {
  background: rgba(255, 255, 255, 0.15); color: #ffffff;
}

/* --------------------------------------------------------------------------
   歷史逐字稿記錄 (Transcript Card)
   -------------------------------------------------------------------------- */
.transcript-card {
  min-height: 280px; display: flex; flex-direction: column;
}
.transcript-feed {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px;
  padding: 4px 2px; max-height: 420px;
}
.feed-item {
  padding: 12px 14px; border-radius: var(--r);
  background: var(--surface-hi); border: 1px solid var(--border);
  animation: slideInDown .3s var(--ease) both;
  transition: border-color .2s, opacity .3s;
}
@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.feed-item.translating {
  border-left: 4px solid #06b6d4;
  box-shadow: 0 0 16px -4px rgba(6, 182, 212, 0.25);
}
.feed-item.done {
  border-left: 4px solid #10b981;
}
.feed-item.failed {
  border-left: 4px solid var(--danger);
}
.feed-item .zh-line {
  font-size: 1.02rem; font-weight: 650; line-height: 1.45; color: var(--text);
}
.feed-item .tr-group {
  margin-top: 6px; display: grid; gap: 4px;
}
.feed-item .tr-sub {
  font-size: .86rem; color: var(--text-2); display: flex; gap: 8px; align-items: baseline;
}
.feed-item .tr-sub span.flag { flex: none; font-size: 1rem; }
.feed-item .meta-line {
  margin-top: 6px; font-size: .72rem; color: var(--text-3); display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}

/* 學生即時反饋膠囊 */
.reactions-pill-box {
  display: flex; gap: 5px; align-items: center; flex-wrap: wrap;
}
.rx-pill {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 7px; border-radius: 99px; font-size: .75rem; font-weight: 700;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0; animation: pillPop .2s var(--ease) both;
}
@keyframes pillPop { from { transform: scale(0.7); } to { transform: scale(1); } }
.rx-pill.attention {
  background: rgba(245, 158, 11, 0.2); border-color: rgba(245, 158, 11, 0.5); color: #fbbf24;
}

/* 焦點卡片浮動動畫 */
.floating-rx-bubble {
  position: absolute; bottom: 10px; font-size: 1.8rem;
  pointer-events: none; animation: floatUpBubble 1.5s ease-out forwards;
}
@keyframes floatUpBubble {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  25% { opacity: 1; transform: translateY(-20px) scale(1.2); }
  100% { opacity: 0; transform: translateY(-70px) scale(1); }
}

/* QR Code 卡片 */
.qr-compact-card {
  text-align: center; display: flex; flex-direction: column; align-items: center; padding: 18px;
}
.qr-frame {
  padding: 12px; border-radius: 16px; background: white;
  box-shadow: 0 10px 30px rgba(0,0,0,.45); margin: 10px 0;
  display: inline-block; line-height: 0;
}
.qr-frame svg, .qr-frame img { display: block; max-width: 100%; height: auto; }
.qr-code-lg {
  font-family: var(--font-mono); font-size: 2rem; font-weight: 800;
  letter-spacing: .2em; color: var(--accent); margin-bottom: 2px;
}
.qr-link-copy {
  display: flex; gap: 6px; width: 100%; max-width: 300px; margin-top: 4px;
}

/* --------------------------------------------------------------------------
   最底部的操作列 (下載按鈕與切換課堂置於此)
   -------------------------------------------------------------------------- */
.teacher-bottom-bar {
  margin-top: 28px;
  padding: 18px 0 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: center;
  width: 100%;
}
.bottom-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.bottom-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-2);
  text-decoration: none;
  transition: all .15s ease;
}
.bottom-actions .btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.25);
}

/* 全螢幕 QR 投影視窗 */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(9, 10, 16, 0.94); backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .2s ease both;
}
.modal-content {
  width: min(640px, 100%); text-align: center;
  background: #121422; border: 1px solid rgba(255,255,255,0.14);
  border-radius: 24px; padding: 36px 20px; box-shadow: var(--shadow);
  position: relative;
}
.modal-close { position: absolute; top: 16px; right: 16px; }
.proj-title { font-size: clamp(1.4rem, 3.5vw, 1.8rem); font-weight: 700; margin-bottom: 6px; }
.proj-qr-frame {
  padding: 18px; border-radius: 20px; background: white;
  display: inline-block; margin: 16px 0;
  box-shadow: 0 16px 48px rgba(0,0,0,.5);
}

/* 教師端重點筆記操作按鈕與視窗 */
.btn-notes-hero {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.22), rgba(202, 138, 4, 0.32)) !important;
  border: 1px solid rgba(250, 204, 21, 0.5) !important;
  color: #fef08a !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 16px rgba(234, 179, 8, 0.22);
}
.btn-notes-hero:hover {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.35), rgba(202, 138, 4, 0.48)) !important;
  border-color: rgba(250, 204, 21, 0.8) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
}
.btn-notes-hero .btn-notes-icon {
  font-size: 1.1rem;
  animation: pulseLight 1.8s infinite ease-in-out;
}
.notes-modal-content {
  background: #0f1322 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 18px !important;
  padding: 22px 24px !important;
}
.notes-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
@keyframes pulseLight {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(250, 204, 21, 0.4)); }
  50% { transform: scale(1.15); filter: drop-shadow(0 0 12px rgba(250, 204, 21, 0.9)); }
}
