/* ==========================================================================
   AiTeacher 样式
   ========================================================================== */

:root {
  --bg-deep: #0b1020;
  --bg-soft: #141a2e;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);

  --text: #eef2ff;
  --text-dim: #9aa6c4;
  --text-faint: #667091;

  --accent: #ffb26b;
  --accent-2: #ff8a5c;
  --teacher: #7c9cff;
  --student: #4fd1c5;
  --danger: #ff6b81;
  --ok: #5eead4;

  --radius: 16px;
  --radius-sm: 10px;

  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);

  --font: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 600px at 12% -10%, rgba(124, 156, 255, 0.16), transparent 60%),
    radial-gradient(800px 600px at 92% 8%, rgba(255, 138, 92, 0.13), transparent 62%),
    radial-gradient(700px 700px at 50% 115%, rgba(79, 209, 197, 0.1), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

#app { position: relative; z-index: 1; height: 100%; }

.hidden { display: none !important; }

.screen { height: 100%; }

/* ==========================================================================
   开始前
   ========================================================================== */
#setup-screen {
  overflow-y: auto;
  display: flex;
  justify-content: center;
  padding: 5vh 20px 8vh;
}

.setup-inner { width: min(880px, 100%); }

.setup-head { margin-bottom: 40px; }

.brand { display: flex; align-items: center; gap: 16px; }

.brand-mark {
  font-size: 34px;
  width: 64px; height: 64px;
  display: grid; place-items: center;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255, 178, 107, 0.22), rgba(255, 138, 92, 0.1));
  border: 1px solid rgba(255, 178, 107, 0.3);
}

.brand h1 { margin: 0; font-size: 27px; letter-spacing: -0.02em; }
.brand p { margin: 4px 0 0; color: var(--text-dim); font-size: 14px; }

.warn-box {
  border: 1px solid rgba(255, 178, 107, 0.35);
  background: rgba(255, 178, 107, 0.08);
  color: #ffd9b0;
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-size: 13.5px;
  line-height: 1.65;
  margin-bottom: 28px;
}

.warn-box + .warn-box { margin-top: -18px; }

.field { margin-bottom: 34px; }

.field-head {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 15px;
}

.field-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.field-sub { color: var(--text-faint); font-size: 13px; }

/* 教学模式：两张并排的大卡片，因为要写清楚区别 */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.mode-card {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  text-align: left;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.mode-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.mode-card.selected {
  border-color: rgba(124, 156, 255, 0.7);
  background: linear-gradient(150deg, rgba(124, 156, 255, 0.18), rgba(124, 156, 255, 0.04));
  box-shadow: 0 0 0 1px rgba(124, 156, 255, 0.25), 0 10px 30px rgba(124, 156, 255, 0.12);
}

.mode-emoji { font-size: 24px; line-height: 1.2; }
.mode-card strong { display: block; font-size: 14.5px; margin-bottom: 3px; }
.mode-card .mode-blurb {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-dim);
}
.mode-card .mode-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 1px 8px;
  border-radius: 999px;
  margin-bottom: 5px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  color: var(--text-faint);
}
.mode-card.selected .mode-tag {
  background: rgba(124, 156, 255, 0.16);
  border-color: rgba(124, 156, 255, 0.35);
  color: #bdcaff;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 12px;
}

.scenario-card {
  text-align: left;
  padding: 15px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
  font-family: inherit;
}

.scenario-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.scenario-card.selected {
  border-color: rgba(255, 178, 107, 0.65);
  background: linear-gradient(150deg, rgba(255, 178, 107, 0.16), rgba(255, 178, 107, 0.04));
  box-shadow: 0 0 0 1px rgba(255, 178, 107, 0.25), 0 10px 30px rgba(255, 138, 92, 0.12);
}

.scenario-emoji { font-size: 21px; }
.scenario-card h3 { margin: 9px 0 3px; font-size: 14.5px; font-weight: 600; }
.scenario-card .sc-zh { color: var(--text-dim); font-size: 12.5px; margin: 0 0 6px; }
.scenario-card .sc-blurb { color: var(--text-faint); font-size: 12px; margin: 0; line-height: 1.5; }

.level-chips { display: flex; gap: 10px; flex-wrap: wrap; }

.level-chip {
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  transition: all 0.16s ease;
}

.level-chip strong { color: var(--text); font-size: 14px; }
.level-chip span { font-size: 11px; }

.level-chip:hover { border-color: var(--border-strong); }

.level-chip.selected {
  border-color: rgba(124, 156, 255, 0.7);
  background: linear-gradient(150deg, rgba(124, 156, 255, 0.2), rgba(124, 156, 255, 0.05));
}

.primary-btn {
  width: 100%;
  padding: 17px;
  border-radius: var(--radius);
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a1006;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
  box-shadow: 0 14px 34px rgba(255, 138, 92, 0.26);
}

.primary-btn .btn-hint { font-size: 11.5px; font-weight: 500; opacity: 0.72; }
.primary-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(255, 138, 92, 0.34); }
.primary-btn:disabled { opacity: 0.38; cursor: not-allowed; box-shadow: none; }

/* ==========================================================================
   上课中
   ========================================================================== */
#lesson-screen { display: flex; flex-direction: column; }

.lesson-head {
  display: flex; align-items: center; gap: 16px;
  padding: 13px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 16, 32, 0.7);
  backdrop-filter: blur(14px);
  flex-shrink: 0;
}

.lesson-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.lesson-emoji { font-size: 21px; }
.lesson-title strong { font-size: 15px; display: block; }
.lesson-level {
  display: inline-block;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--teacher);
  background: rgba(124, 156, 255, 0.14);
  border: 1px solid rgba(124, 156, 255, 0.3);
  border-radius: 999px;
  padding: 1px 8px;
  margin-top: 3px;
}

.lesson-mode {
  display: inline-block;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--ok);
  background: rgba(94, 234, 212, 0.12);
  border: 1px solid rgba(94, 234, 212, 0.28);
  border-radius: 999px;
  padding: 1px 8px;
  margin-top: 3px;
  margin-left: 5px;
}

.status-pill {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--text-dim);
  white-space: nowrap;
}

.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-faint);
  transition: background 0.2s ease;
}

.status-pill[data-state="listening"] { border-color: rgba(79, 209, 197, 0.4); color: #9ff0e6; }
.status-pill[data-state="listening"] .status-dot { background: var(--student); animation: pulse 1.5s infinite; }
.status-pill[data-state="speaking"] { border-color: rgba(255, 178, 107, 0.4); color: #ffd9b0; }
.status-pill[data-state="speaking"] .status-dot { background: var(--accent); animation: pulse 0.9s infinite; }
.status-pill[data-state="thinking"] .status-dot,
.status-pill[data-state="transcribing"] .status-dot { background: var(--teacher); animation: pulse 0.7s infinite; }
.status-pill[data-state="error"] { border-color: rgba(255, 107, 129, 0.45); color: #ffb3bf; }
.status-pill[data-state="error"] .status-dot { background: var(--danger); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

.head-actions { display: flex; gap: 8px; }

.ghost-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.ghost-btn:hover:not(:disabled) { border-color: var(--border-strong); color: var(--text); background: var(--surface); }
.ghost-btn:disabled { opacity: 0.35; cursor: not-allowed; }
#interrupt-btn:not(:disabled) { border-color: rgba(255, 107, 129, 0.4); color: #ffb3bf; }

/* ---------------- 主体 ---------------- */
.lesson-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 372px;
  min-height: 0;
}

.stage {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 0;
}

#avatar-canvas { width: 100%; height: 100%; display: block; }

.subtitle-wrap {
  position: absolute;
  left: 0; right: 0; bottom: 22px;
  display: flex; justify-content: center;
  padding: 0 26px;
  pointer-events: none;
}

.subtitle {
  max-width: 760px;
  background: rgba(8, 12, 26, 0.82);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 20px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  animation: rise 0.24s ease;
}

.subtitle p {
  margin: 0;
  font-size: 17px;
  line-height: 1.62;
  letter-spacing: 0.005em;
}

.subtitle .w {
  color: var(--text-dim);
  transition: color 0.12s ease;
}
.subtitle .w.on { color: var(--accent); font-weight: 600; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.stage-hint {
  position: absolute;
  top: 22px; left: 50%;
  transform: translateX(-50%);
  background: rgba(8, 12, 26, 0.86);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 12.5px;
  color: var(--text-dim);
  backdrop-filter: blur(10px);
  animation: rise 0.24s ease;
}

/* ---------------- 侧栏 ---------------- */
.panel {
  border-left: 1px solid var(--border);
  background: rgba(8, 12, 26, 0.42);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-block { padding: 18px 20px; }
.goal-block { border-bottom: 1px solid var(--border); flex-shrink: 0; }

.panel-block h3 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.goal-block p {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-dim);
}

.key-phrases { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.key-phrases span {
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(124, 156, 255, 0.1);
  border: 1px solid rgba(124, 156, 255, 0.22);
  color: #bdcaff;
}

.transcript-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-bottom: 10px;
}

.transcript {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding-right: 5px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

.transcript::-webkit-scrollbar { width: 5px; }
.transcript::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 3px; }

.turn { display: flex; flex-direction: column; gap: 5px; animation: rise 0.26s ease; }

.turn-who {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.turn.student .turn-who { color: var(--student); }
.turn.teacher .turn-who { color: var(--teacher); }

.turn-text {
  font-size: 13.5px;
  line-height: 1.62;
  padding: 11px 14px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.turn.student .turn-text {
  background: rgba(79, 209, 197, 0.08);
  border-color: rgba(79, 209, 197, 0.2);
}

.turn.student .turn-text.zh { color: #ffd9b0; border-color: rgba(255, 178, 107, 0.28); background: rgba(255, 178, 107, 0.07); }

.turn-text .caret {
  display: inline-block;
  width: 2px; height: 13px;
  background: var(--accent);
  vertical-align: -2px;
  animation: blink 1s steps(2) infinite;
}

/* 卡壳的那个词 */
.turn-text .hesitant {
  color: var(--accent);
  border-bottom: 1px dashed rgba(255, 178, 107, 0.6);
  cursor: help;
}

/* 学生每轮的口语数据（语速 / 停顿） */
.turn-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.turn-metrics span {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-faint);
  white-space: nowrap;
}

.turn-metrics span.warn {
  color: #ffd9b0;
  border-color: rgba(255, 178, 107, 0.35);
  background: rgba(255, 178, 107, 0.08);
}

@keyframes blink { 50% { opacity: 0; } }

/* ---------------- 实时字幕条（学生边说边出字） ---------------- */
.partial-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 22px;
  border-top: 1px solid rgba(79, 209, 197, 0.22);
  background: rgba(79, 209, 197, 0.06);
  font-size: 13.5px;
  line-height: 1.55;
  color: #9ff0e6;
  min-height: 38px;
  animation: rise 0.18s ease;
}

.partial-bar.empty { color: var(--text-faint); font-style: italic; }

.pulse-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--student);
  flex-shrink: 0;
  animation: pulse 1.1s infinite;
}

/* ---------------- 底部控制 ---------------- */
.controls {
  display: flex; align-items: center; gap: 20px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: rgba(11, 16, 32, 0.75);
  backdrop-filter: blur(14px);
  flex-shrink: 0;
}

.mic-zone { display: flex; align-items: center; gap: 13px; }

.mic-btn {
  position: relative;
  width: 54px; height: 54px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  display: grid; place-items: center;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.mic-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); transform: scale(1.05); }
.mic-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.mic-btn.recording {
  background: linear-gradient(140deg, var(--danger), #ff8a9c);
  border-color: transparent;
  color: #2b0710;
}

.mic-ring {
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--student);
  opacity: 0;
  pointer-events: none;
}

.mic-btn.recording .mic-ring { animation: ripple 1.5s ease-out infinite; }

@keyframes ripple {
  0% { opacity: 0.7; transform: scale(0.9); }
  100% { opacity: 0; transform: scale(1.45); }
}

.mic-meta { display: flex; flex-direction: column; gap: 7px; min-width: 148px; }
#mic-label { font-size: 12.5px; color: var(--text-dim); }

.meter {
  height: 4px;
  width: 148px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.meter-fill {
  height: 100%; width: 0%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--student), var(--accent));
  transition: width 0.06s linear;
}

.text-fallback {
  flex: 1;
  display: flex; gap: 9px;
  max-width: 620px;
}

.text-fallback input {
  flex: 1;
  padding: 12px 17px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.16s ease;
}

.text-fallback input::placeholder { color: var(--text-faint); }
.text-fallback input:focus { border-color: rgba(124, 156, 255, 0.5); }

.send-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  display: grid; place-items: center;
  transition: all 0.16s ease;
  flex-shrink: 0;
}

.send-btn:hover { color: var(--accent); border-color: rgba(255, 178, 107, 0.5); }

/* ==========================================================================
   报告弹窗
   ========================================================================== */
.modal {
  position: fixed; inset: 0;
  background: rgba(5, 8, 18, 0.78);
  backdrop-filter: blur(7px);
  display: grid; place-items: center;
  z-index: 100;
  padding: 28px;
  animation: fade 0.2s ease;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  position: relative;
  width: min(760px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  background: linear-gradient(165deg, #161d34, #0f1424);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 32px 34px;
  animation: rise 0.3s ease;
  scrollbar-width: thin;
}

.modal-card::-webkit-scrollbar { width: 6px; }
.modal-card::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 3px; }

.modal-close {
  position: absolute; top: 16px; right: 18px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.16s ease;
}

.modal-close:hover { color: var(--text); border-color: var(--border-strong); }

.report-body h2 {
  margin: 0 0 8px;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.report-summary { color: var(--text-dim); font-size: 14px; line-height: 1.75; margin: 0 0 26px; }

.report-section { margin-bottom: 26px; }

.report-section h4 {
  margin: 0 0 12px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.report-list { margin: 0; padding-left: 19px; }
.report-list li { font-size: 13.5px; line-height: 1.78; color: var(--text-dim); margin-bottom: 6px; }
.report-list li::marker { color: var(--accent); }

.err-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  margin-bottom: 10px;
  background: var(--surface);
}

.err-line { font-size: 13.5px; line-height: 1.6; margin-bottom: 6px; }
.err-line .said { color: #ffb3bf; text-decoration: line-through; text-decoration-color: rgba(255, 107, 129, 0.5); }
.err-line .good { color: var(--ok); font-weight: 600; }
.err-why { font-size: 12.5px; color: var(--text-faint); line-height: 1.65; margin: 0; }

/* 报告里标出卡壳的那个词 */
.err-line .hs-word {
  color: var(--text);
  background: rgba(255, 178, 107, 0.14);
  border-bottom: 1px dashed rgba(255, 178, 107, 0.55);
  padding: 1px 6px;
  border-radius: 5px;
}

.err-tag {
  display: inline-block;
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  padding: 2px 7px; border-radius: 5px;
  background: rgba(124, 156, 255, 0.15);
  color: #bdcaff;
  margin-right: 7px;
  vertical-align: 1px;
}

.vocab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 10px; }

.vocab-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--surface);
}

.vocab-card strong { color: var(--accent); font-size: 14px; display: block; margin-bottom: 3px; }
.vocab-card .vc-mean { font-size: 12.5px; color: var(--text-dim); margin-bottom: 5px; }
.vocab-card .vc-ex { font-size: 12px; color: var(--text-faint); font-style: italic; line-height: 1.6; }

.report-stat-row {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 26px;
}

.stat-chip {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 15px;
  background: var(--surface);
  text-align: center;
  min-width: 92px;
}

.stat-chip b { display: block; font-size: 19px; color: var(--text); }
.stat-chip span { font-size: 11px; color: var(--text-faint); }

/* ==========================================================================
   Toast
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 100px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 9px;
  z-index: 200;
  pointer-events: none;
  width: min(560px, calc(100% - 40px));
}

.toast {
  background: rgba(20, 26, 46, 0.96);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 17px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  box-shadow: var(--shadow);
  animation: rise 0.24s ease;
}

.toast.error { border-color: rgba(255, 107, 129, 0.5); color: #ffc9d2; }
.toast.ok { border-color: rgba(94, 234, 212, 0.4); color: #b6f5ea; }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 980px) {
  .lesson-body { grid-template-columns: 1fr; }
  .panel {
    display: none;
  }
  .panel.mobile-open {
    display: flex;
    position: fixed; inset: 0;
    z-index: 50;
    background: rgba(8, 12, 26, 0.98);
    backdrop-filter: blur(10px);
  }
}

@media (max-width: 640px) {
  .lesson-head { padding: 11px 14px; gap: 10px; flex-wrap: wrap; }
  .status-pill { margin-left: 0; order: 3; width: 100%; justify-content: center; }
  .controls { padding: 11px 14px; gap: 12px; flex-wrap: wrap; }
  .mic-meta { display: none; }
  .text-fallback { max-width: none; }
  .subtitle p { font-size: 15px; }
  .modal-card { padding: 24px 20px; }
}
