/* ============================================================
   无声课堂 · 交互演示
   设计语言：安静的阅读仪器 / 纸张、墨色、钴蓝、琥珀标记
   PC 优先，平板兼容；所有核心状态均有高对比适配
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --ui: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", "Source Han Serif SC", "STSong", serif;

  --ink: #101828;
  --ink-2: #475467;
  --ink-3: #667085;
  --paper: #F3F1EC;
  --panel: #FFFFFF;
  --panel-2: #FAF9F6;
  --line: #E4E0D8;
  --line-strong: #CFC9BD;

  --cobalt: #1D4ED8;
  --cobalt-dark: #1E40AF;
  --cobalt-soft: #E8EDFC;
  --amber: #B45309;
  --amber-soft: #FFF1C2;
  --amber-line: #E9B949;
  --green: #067647;
  --green-soft: #E7F6EF;
  --red: #B42318;
  --red-soft: #FDECEA;

  --rail: #0C1424;
  --rail-2: #131E33;
  --rail-text: #E6EAF0;
  --rail-muted: #93A1B8;

  --focus: #1D4ED8;
  --caption-size: 28px;
  --caption-line: 1.7;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 30px rgba(16, 24, 40, .055);
  --shadow-lg: 0 24px 70px rgba(9, 14, 24, .24);
}

html { height: 100%; }

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--ui);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1100px 620px at 6% -12%, rgba(29, 78, 216, .065), transparent 60%),
    radial-gradient(900px 520px at 102% -4%, rgba(180, 83, 9, .07), transparent 58%);
}

[hidden] { display: none !important; }
body.modal-open { overflow: hidden; }

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
p, h1, h2, h3, h4 { margin: 0; }
a { color: var(--cobalt); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.rail :focus-visible { outline-color: #7CDFFF; }
button:focus:not(:focus-visible) { outline: none; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 18px; height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.icon-xs { width: 13px; height: 13px; stroke-width: 2.2; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; left: 16px; top: -80px; z-index: 1000;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px;
  font-size: 13px; text-decoration: none; transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

/* ============================================================
   应用壳层
   ============================================================ */
.app {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
}

/* ---------- 左侧导航 ---------- */
.rail {
  background: var(--rail);
  color: var(--rail-text);
  display: flex;
  flex-direction: column;
  padding: 24px 14px 16px;
  position: relative;
  z-index: 4;
  min-height: 0;
}
.rail::after {
  content: "";
  position: absolute; top: 0; right: 0; bottom: 0; width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .12), transparent);
}

.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; }
.brand-mark { width: 42px; height: 42px; flex: none; }
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-mark.large { width: 64px; height: 64px; }
.brand-name {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: .1em;
  line-height: 1.2;
  color: #fff;
}
.brand-sub {
  margin-top: 4px;
  font-size: 8.5px;
  letter-spacing: .22em;
  color: var(--rail-muted);
  font-weight: 600;
}

.rail-nav { margin-top: 38px; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  width: 100%; height: 46px; padding: 0 12px;
  border: 0; border-radius: 10px;
  background: transparent; color: var(--rail-muted);
  font-size: 13.5px; letter-spacing: .02em; text-align: left;
  transition: background .15s ease, color .15s ease;
}
.nav-item:hover { background: rgba(255, 255, 255, .055); color: #fff; }
.nav-item.is-active { background: rgba(255, 255, 255, .075); color: #fff; }
.nav-item.is-active::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px;
  width: 3px; border-radius: 2px; background: #FFD400;
}
.nav-icon { display: inline-flex; color: inherit; }
.nav-icon .icon { width: 19px; height: 19px; }
.nav-label { flex: 1; }
.nav-kbd {
  font-family: var(--ui); font-size: 9.5px; color: rgba(230, 234, 240, .55);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .14); border-radius: 4px;
  padding: 1px 5px; line-height: 1.4;
}
.nav-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #FFD400; color: #101828; font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

.rail-foot { margin-top: auto; padding: 0 2px; }
.command-btn {
  width: 100%; height: 38px; padding: 0 10px;
  display: flex; align-items: center; gap: 9px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 9px; background: transparent;
  color: var(--rail-muted); font-size: 11.5px; text-align: left;
  transition: color .15s ease, border-color .15s ease;
}
.command-btn:hover { color: #fff; border-color: rgba(255, 255, 255, .3); }
.command-btn .icon { width: 15px; height: 15px; }
.command-btn span { flex: 1; }
.command-btn kbd {
  font-family: var(--ui); font-size: 9px; color: rgba(255, 255, 255, .6);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 4px; padding: 1px 4px;
}
.rail-note {
  display: flex; align-items: flex-start; gap: 9px;
  margin: 18px 6px 0; color: rgba(147, 161, 184, .72);
  font-size: 9.5px; line-height: 1.8; letter-spacing: .04em;
}
.rail-note-line {
  width: 18px; height: 2px; margin-top: 8px; flex: none;
  background: linear-gradient(90deg, #FFD400 0 50%, #7CDFFF 50% 100%);
  border-radius: 2px;
}

/* ---------- 主区域 ---------- */
.main {
  display: flex; flex-direction: column;
  min-width: 0; min-height: 0; height: 100vh;
  overflow: hidden;
}

/* ---------- 顶部状态条 ---------- */
.topbar {
  flex: 0 0 64px;
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 20;
}
.class-meta { display: flex; align-items: center; gap: 10px; min-width: 0; }
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none;
  box-shadow: 0 0 0 0 rgba(6, 118, 71, .35);
  animation: livePulse 2.4s ease-out infinite;
}
.live-dot.is-off { background: var(--amber); animation: none; }
.class-meta-text { min-width: 0; }
.class-title {
  font-size: 13.5px; font-weight: 700; letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.meta-sep { color: var(--line-strong); margin: 0 2px; }
.class-sub {
  margin-top: 2px; font-size: 10.5px; color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.status-cluster { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 27px; padding: 0 10px; border-radius: 999px;
  background: var(--green-soft); color: var(--green);
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.status-dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none;
}
.status-dot.online { background: var(--green); }
.status-dot.offline { background: var(--amber); }
.status-pill.is-idle { background: #EFEDE7; color: var(--ink-2); }
.status-pill.is-paused { background: var(--amber-soft); color: #5B3A00; }
.status-pill.is-reconnecting { background: var(--amber-soft); color: #5B3A00; }
.status-pill.is-offline { background: #EFEDE7; color: var(--ink-2); }
.status-pill.is-error { background: var(--red-soft); color: var(--red); }
.metric {
  font-size: 11px; color: var(--ink-3); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.engine-tag {
  font-size: 10px; color: var(--ink-3); white-space: nowrap;
  border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px;
  background: rgba(255, 255, 255, .5);
}
.top-actions { display: flex; align-items: center; gap: 5px; }

.icon-btn {
  width: 36px; height: 36px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 9px;
  background: transparent; color: var(--ink-2);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.icon-btn:hover { background: #EEEBE4; color: var(--ink); }
.icon-btn[aria-pressed="true"] { background: var(--cobalt); color: #fff; }
.icon-btn.tiny { width: 28px; height: 28px; }
.ghost-btn {
  height: 34px; padding: 0 11px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); color: var(--ink-2);
  font-size: 12px; white-space: nowrap;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.ghost-btn:hover { border-color: var(--line-strong); color: var(--ink); background: var(--panel-2); }
.ghost-btn.compact { height: 32px; padding: 0 9px; font-size: 11.5px; }
.ghost-btn.small { height: 30px; padding: 0 9px; font-size: 11px; }
.has-badge { position: relative; }
.icon-badge {
  position: absolute; top: -2px; right: -3px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--red); color: #fff;
  font-size: 9.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--panel);
}

.offline-banner {
  flex: 0 0 38px;
  display: flex; align-items: center; gap: 9px;
  padding: 0 20px;
  background: var(--amber-soft); color: #5B3A00;
  border-bottom: 1px solid #F0DCA0;
  font-size: 12px; position: relative; z-index: 15;
}
.offline-banner .icon { width: 15px; height: 15px; }
.offline-banner strong { font-size: 12px; }
.offline-banner span { color: #7A5A18; }
.offline-banner .text-btn { margin-left: auto; color: #5B3A00; font-size: 11.5px; }

/* ============================================================
   三栏工作区
   ============================================================ */
.workspace {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr) 356px;
  gap: 14px;
  padding: 14px 18px 18px;
}
.context-col {
  display: flex; flex-direction: column; gap: 12px;
  min-height: 0; overflow-y: auto; padding-right: 2px;
  scrollbar-width: thin;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 15px;
}
.panel-label {
  font-size: 10px; font-weight: 700; letter-spacing: .15em;
  text-transform: uppercase; color: var(--ink-3);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.count-chip {
  min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--panel-2);
  border: 1px solid var(--line); font-size: 10px; color: var(--ink-2);
}
.text-btn {
  border: 0; background: none; padding: 0;
  color: var(--cobalt); font-size: 11.5px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: rgba(29, 78, 216, .3);
}
.text-btn:hover { text-decoration-color: currentColor; }

.class-card {
  background:
    linear-gradient(155deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .55)),
    radial-gradient(220px 150px at 100% 0%, rgba(255, 212, 0, .22), transparent 70%),
    var(--panel);
}
.class-card-title {
  font-family: var(--serif);
  font-size: 27px; font-weight: 700; letter-spacing: .04em;
  margin-top: 9px; line-height: 1.2;
}
.class-card-sub { margin-top: 4px; font-size: 12.5px; color: var(--ink-2); }
.class-facts { margin-top: 15px; display: flex; flex-direction: column; gap: 9px; }
.fact { display: flex; align-items: center; gap: 8px; font-size: 11.8px; color: var(--ink-2); }
.fact .icon { width: 14px; height: 14px; color: var(--ink-3); }
.fact-auth { color: var(--green); }
.fact-auth .icon { color: var(--green); }
.subtle-link {
  margin-top: 14px; padding: 0; border: 0; background: none;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--cobalt); font-size: 11.5px; font-weight: 600;
}
.subtle-link .icon { width: 14px; height: 14px; }

.speakers-panel .panel-head { margin-bottom: 8px; }
.speaker-list { display: flex; flex-direction: column; gap: 3px; }
.speaker-row {
  width: 100%; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center; gap: 9px;
  padding: 7px; border: 1px solid transparent; border-radius: 9px;
  background: transparent; text-align: left;
  transition: background .15s ease, border-color .15s ease;
}
.speaker-row:hover { background: var(--panel-2); border-color: var(--line); }
.speaker-row.is-active { background: #FBFAF6; border-color: var(--line); }
.speaker-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 800; letter-spacing: .02em;
  color: var(--sp, var(--cobalt));
  background: #F1F3F9;
  border: 1px solid var(--line);
}
.speaker-main { min-width: 0; }
.speaker-name { display: block; font-size: 12.5px; font-weight: 600; }
.speaker-role { display: block; margin-top: 1px; font-size: 9.5px; color: var(--ink-3); }
.speaker-state { font-size: 9.5px; color: var(--ink-3); white-space: nowrap; }
.speaker-row.is-active .speaker-state { color: var(--amber); font-weight: 600; }
.speaker-row.is-active .speaker-state::before {
  content: ""; display: inline-block; width: 5px; height: 5px;
  border-radius: 50%; background: var(--amber); margin-right: 4px; vertical-align: 1px;
}
.mini-empty { padding: 10px 4px; font-size: 11px; line-height: 1.6; color: var(--ink-3); }

.events-panel .panel-head { margin-bottom: 8px; }
.event-mini-list { display: flex; flex-direction: column; gap: 2px; }
.event-mini {
  display: grid; grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 8px; align-items: center;
  padding: 6px 4px; border: 0; background: none; text-align: left;
  border-radius: 6px;
}
.event-mini:hover { background: var(--panel-2); }
.event-mini-title { font-size: 11.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-mini time { font-size: 9.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.level-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.level-dot.info { background: var(--cobalt); }
.level-dot.important { background: var(--amber); }
.level-dot.critical { background: var(--red); }

.privacy-card {
  display: flex; gap: 11px; align-items: flex-start;
  background: var(--rail); color: #fff; border-color: var(--rail);
}
.privacy-icon {
  width: 30px; height: 30px; flex: none; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 212, 0, .12); color: #FFD400;
}
.privacy-icon .icon { width: 15px; height: 15px; }
.privacy-card strong { font-size: 11.5px; letter-spacing: .04em; }
.privacy-card p { margin-top: 5px; font-size: 10px; line-height: 1.65; color: rgba(230, 234, 240, .65); }

/* ============================================================
   字幕舞台
   ============================================================ */
.stage {
  position: relative;
  display: flex; flex-direction: column;
  min-height: 0; overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stage-head {
  flex: 0 0 54px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px; border-bottom: 1px solid var(--line);
}
.stage-title {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; font-weight: 700; letter-spacing: .03em;
  white-space: nowrap;
}
.channel-mark { width: 17px; height: 13px; position: relative; display: inline-block; }
.channel-mark::before, .channel-mark::after {
  content: ""; position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px;
}
.channel-mark::before { top: 1px; background: var(--cobalt); }
.channel-mark::after { bottom: 1px; background: repeating-linear-gradient(90deg, var(--amber) 0 4px, transparent 4px 7px); }
.live-chip {
  font-size: 8.5px; font-weight: 800; letter-spacing: .15em;
  color: #5B3A00; background: #FFE58F; border-radius: 4px; padding: 2px 5px;
}
.stage-actions { margin-left: auto; display: flex; align-items: center; gap: 5px; }
.font-controls {
  height: 32px; display: flex; align-items: center;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel-2); overflow: hidden;
}
.font-btn {
  width: 31px; height: 30px; border: 0; background: transparent;
  font-size: 12px; color: var(--ink-2);
}
.font-btn:hover { background: #EEEBE4; color: var(--ink); }
.font-value {
  width: 32px; text-align: center; font-size: 11px; font-weight: 700;
  color: var(--ink-2); border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.stage-sub {
  flex: 0 0 34px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 18px;
  border-bottom: 1px dashed var(--line);
  font-size: 10.5px; color: var(--ink-3);
}
.audio-badge { display: inline-flex; align-items: center; gap: 5px; color: var(--green); font-weight: 600; }
.audio-badge .icon { width: 13px; height: 13px; }
.sub-hint { margin-left: auto; }

.caption-scroll {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 8px 42px 30px;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  position: relative;
}
.caption-scroll:focus-visible { outline-offset: -3px; }
.caption-stream { max-width: 820px; margin: 0 auto; }

.caption {
  display: grid; grid-template-columns: 48px minmax(0, 1fr);
  gap: 13px;
  padding: 16px 0 17px;
  border-bottom: 1px dashed var(--line);
  animation: captionIn .24s ease both;
}
.caption:last-child { border-bottom: 0; }
.caption-gutter { display: flex; flex-direction: column; align-items: center; }
.caption-gutter .speaker-avatar { width: 36px; height: 36px; font-size: 11.5px; }
.caption-time {
  margin-top: 6px; font-size: 9px; color: var(--ink-3);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.caption-main { min-width: 0; }
.caption-byline { display: flex; align-items: baseline; gap: 8px; min-height: 16px; }
.caption-byline .speaker-name { font-size: 11.5px; letter-spacing: .02em; }
.caption-tag {
  font-size: 8.5px; letter-spacing: .08em; color: var(--ink-3);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 4px;
  text-transform: uppercase;
}
.caption-tag.is-local { color: #5B3A00; background: var(--amber-soft); border-color: #F0DCA0; }
.caption-tag.is-backfill { color: var(--cobalt); background: var(--cobalt-soft); border-color: #C9D6F7; }
.caption-text {
  margin-top: 6px;
  font-size: var(--caption-size);
  line-height: var(--caption-line);
  font-weight: 500;
  letter-spacing: .012em;
  color: var(--ink);
  max-width: 26em;
  overflow-wrap: anywhere;
}
.caption.is-target .caption-text { background: #FFFBEA; box-shadow: 0 0 0 6px #FFFBEA; border-radius: 2px; }

/* 低置信度词 */
.low-word {
  display: inline;
  font: inherit;
  font-weight: 500;
  line-height: inherit;
  color: #5B3A00;
  background: var(--amber-soft);
  border: 0;
  border-bottom: 2px dashed var(--amber);
  border-radius: 4px;
  padding: 0 3px;
  margin: 0 1px;
  cursor: pointer;
  text-align: left;
  white-space: normal;
  transition: background .15s ease;
}
.low-word:hover { background: #FFE58F; }
.low-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; margin-left: 3px; vertical-align: 2px;
  border-radius: 50%; background: var(--amber); color: #fff;
  font-size: 9px; font-weight: 800; line-height: 1;
}
.corrected-word {
  background: var(--green-soft);
  border-bottom: 2px solid var(--green);
  border-radius: 3px;
  padding: 0 3px;
  color: var(--ink);
  white-space: nowrap;
}
.corrected-word .icon-xs { margin-left: 2px; color: var(--green); vertical-align: 0; }

/* 中间结果 */
.interim {
  max-width: 820px; margin: 0 auto;
  display: flex; align-items: center; gap: 7px;
  padding: 2px 0 18px 61px;
  font-size: 13px; color: var(--ink-3);
}
.interim-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--cobalt);
  animation: blink 1.2s ease-in-out infinite;
}
.dots { display: inline-flex; gap: 2px; }
.dots i { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); animation: dot 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }

/* 空状态 */
.empty-state {
  min-height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center; padding: 30px 20px 50px;
  color: var(--ink-2);
}
.empty-state p { font-size: 15px; font-weight: 600; color: var(--ink); }
.empty-sub { font-size: 11px; color: var(--ink-3); }
.wave { display: flex; align-items: center; gap: 4px; height: 42px; margin-bottom: 8px; }
.wave span {
  width: 4px; border-radius: 4px; background: var(--cobalt);
  animation: wave 1.5s ease-in-out infinite;
  opacity: .55;
}
.wave span:nth-child(1) { height: 12px; animation-delay: 0s; }
.wave span:nth-child(2) { height: 24px; animation-delay: .12s; }
.wave span:nth-child(3) { height: 36px; animation-delay: .24s; }
.wave span:nth-child(4) { height: 20px; animation-delay: .36s; }
.wave span:nth-child(5) { height: 32px; animation-delay: .48s; }
.wave span:nth-child(6) { height: 15px; animation-delay: .6s; }
.wave span:nth-child(7) { height: 8px; animation-delay: .72s; }
.primary-btn {
  height: 40px; padding: 0 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--cobalt);
  border-radius: 9px;
  background: var(--cobalt); color: #fff;
  font-size: 12.5px; font-weight: 600;
  transition: background .15s ease, border-color .15s ease;
}
.primary-btn:hover { background: var(--cobalt-dark); border-color: var(--cobalt-dark); }
.primary-btn:disabled { opacity: .45; }
.primary-btn.small { height: 34px; padding: 0 12px; font-size: 11.5px; }
.primary-btn.wide { width: 100%; height: 44px; margin-top: 14px; }
.empty-state .primary-btn { margin-top: 12px; }

.jump-live {
  position: absolute; left: 50%; bottom: 52px; transform: translateX(-50%);
  height: 34px; padding: 0 14px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .15);
  background: var(--rail); color: #fff;
  font-size: 11.5px; box-shadow: 0 8px 24px rgba(9, 14, 24, .28);
  z-index: 6;
}
.jump-live:hover { background: var(--rail-2); }
#jumpCount { color: #FFD400; font-weight: 700; }

.stage-foot {
  flex: 0 0 38px;
  display: flex; align-items: center; gap: 18px;
  padding: 0 18px; border-top: 1px solid var(--line);
  font-size: 10px; color: var(--ink-3);
}
.foot-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.foot-item .icon { width: 12px; height: 12px; }
.foot-item:last-child { margin-left: auto; }

/* ============================================================
   工具坞
   ============================================================ */
.dock {
  display: flex; flex-direction: column;
  min-height: 0; overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.dock-tabs {
  flex: 0 0 46px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
}
.dock-tab {
  border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--ink-3);
  font-size: 12px; font-weight: 500;
  transition: color .15s ease, background .15s ease;
}
.dock-tab:hover { background: var(--panel-2); color: var(--ink); }
.dock-tab.is-active { color: var(--cobalt); border-bottom-color: var(--cobalt); font-weight: 700; }
.dock-body { flex: 1; min-height: 0; overflow-y: auto; padding: 15px; scrollbar-width: thin; }
.dock-panel { animation: fadeIn .16s ease both; }
.dock-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dock-head h3 { font-size: 13px; letter-spacing: .02em; }
.dock-chip {
  font-size: 9px; color: var(--ink-3); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 7px; white-space: nowrap;
}
.live-mini { display: inline-flex; align-items: center; gap: 5px; font-size: 9.5px; color: var(--green); font-weight: 600; }
.live-mini i { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.dock-note { margin: 7px 0 12px; font-size: 10.5px; line-height: 1.65; color: var(--ink-3); }
.range {
  width: 100%; height: 24px; margin: 2px 0;
  accent-color: var(--cobalt); cursor: pointer;
}
.range-labels { display: flex; justify-content: space-between; font-size: 9px; color: var(--ink-3); margin-top: -3px; }
.replay-list { display: flex; flex-direction: column; gap: 5px; margin: 12px 0; }
.replay-item {
  width: 100%; display: grid; grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px; text-align: left;
  padding: 8px 9px;
  border: 1px solid transparent; border-left: 3px solid transparent;
  border-radius: 8px; background: var(--panel-2);
  transition: background .15s ease, border-color .15s ease;
}
.replay-item:hover { border-color: var(--line); background: #F7F5EF; }
.replay-item.is-active { border-left-color: var(--cobalt); background: var(--cobalt-soft); }
.replay-time { font-size: 9px; color: var(--ink-3); font-variant-numeric: tabular-nums; padding-top: 2px; }
.replay-text {
  font-size: 11.5px; line-height: 1.5; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.replay-speaker { font-weight: 700; color: var(--ink); margin-right: 4px; }
.wide-btn {
  width: 100%; min-height: 36px; margin-top: 8px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); color: var(--ink-2);
  font-size: 11.5px; font-weight: 500;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.wide-btn:hover { border-color: var(--cobalt); color: var(--cobalt); background: var(--cobalt-soft); }
.wide-btn.ghost { background: var(--panel-2); }
.wide-btn .icon { width: 14px; height: 14px; }

.control-group { margin: 14px 0; }
.control-label {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  font-size: 11px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px;
}
.control-label output { font-size: 10px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.segmented {
  display: flex; gap: 3px; padding: 3px;
  background: #F1EFE9; border: 1px solid var(--line); border-radius: 9px;
}
.segmented button {
  flex: 1; height: 27px; border: 0; border-radius: 6px;
  background: transparent; color: var(--ink-2);
  font-size: 10.5px; white-space: nowrap;
}
.segmented button:hover { color: var(--ink); }
.segmented button.is-active {
  background: var(--panel); color: var(--cobalt); font-weight: 700;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .1);
}
.segmented.small { padding: 2px; }
.segmented.small button { height: 24px; font-size: 9.5px; }
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 38px; border-bottom: 1px dashed var(--line);
  font-size: 11.5px; color: var(--ink-2);
}
.switch-row:last-child { border-bottom: 0; }
.switch {
  width: 40px; height: 22px; flex: none; padding: 2px;
  border: 0; border-radius: 999px; background: #CFC9BD;
  transition: background .18s ease;
}
.switch span {
  display: block; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: transform .18s ease;
}
.switch[aria-checked="true"] { background: var(--cobalt); }
.switch[aria-checked="true"] span { transform: translateX(18px); }
.switch:disabled { opacity: .5; cursor: not-allowed; }

.notes-area {
  width: 100%; min-height: 250px; resize: vertical;
  border: 1px solid var(--line); border-radius: 10px;
  background: #FCFBF8; padding: 11px 12px;
  font-size: 12.5px; line-height: 1.7; color: var(--ink);
}
.notes-area::placeholder { color: #98A2B3; }
.notes-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 10px; color: var(--ink-3); }
.save-state { font-size: 9.5px; color: var(--green); }

.express-tabs { display: flex; gap: 3px; padding: 3px; background: #F1EFE9; border-radius: 9px; margin: 10px 0 12px; }
.express-tabs button {
  flex: 1; height: 27px; border: 0; border-radius: 6px;
  background: transparent; color: var(--ink-2); font-size: 10.5px;
}
.express-tabs button.is-active { background: var(--panel); color: var(--cobalt); font-weight: 700; box-shadow: 0 1px 3px rgba(16,24,40,.1); }
.chip-row { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 10px; }
.chip {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink-2);
  border-radius: 999px; padding: 4px 9px; font-size: 9.5px;
}
.chip:hover { border-color: var(--line-strong); }
.chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.phrase-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.phrase-card {
  min-height: 58px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #FCFBF8; text-align: left;
  font-size: 12.5px; font-weight: 600; line-height: 1.4; color: var(--ink);
  transition: border-color .15s ease, background .15s ease;
}
.phrase-card:hover { border-color: var(--cobalt); background: var(--cobalt-soft); }
.send-preview {
  margin: 12px 0; padding: 12px; border-radius: 12px;
  background: var(--rail); color: #fff;
  display: flex; flex-direction: column; gap: 9px;
  animation: fadeIn .18s ease both;
}
.send-preview-text .mini-label { display: block; color: #FFD400; margin-bottom: 4px; }
.send-preview-text strong { font-size: 14px; line-height: 1.45; }
.send-preview .segmented { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); }
.send-preview .segmented button { color: rgba(255, 255, 255, .72); }
.send-preview .segmented button.is-active { background: #fff; color: var(--ink); }
.send-preview .primary-btn { align-self: flex-end; }
.message-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.message {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px;
  padding: 8px 9px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); font-size: 11.5px;
}
.message-text { line-height: 1.45; }
.message-meta { margin-top: 3px; font-size: 9px; color: var(--ink-3); }
.message-action { align-self: center; }
.message-status {
  font-size: 9px; padding: 2px 6px; border-radius: 999px;
  background: var(--panel-2); color: var(--ink-3); white-space: nowrap;
}
.message-status.is-read { background: var(--green-soft); color: var(--green); }
.message-status.is-sent { background: var(--cobalt-soft); color: var(--cobalt); }
.mini-label { font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.tts-area {
  width: 100%; min-height: 76px; resize: vertical;
  border: 1px solid var(--line); border-radius: 10px;
  background: #FCFBF8; padding: 9px 10px; font-size: 12.5px; line-height: 1.6;
  margin: 6px 0 10px;
}
.tts-player { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.tts-state { font-size: 9.5px; color: var(--ink-3); }
.tts-wave { display: flex; align-items: center; gap: 3px; height: 22px; }
.tts-wave i { width: 3px; height: 7px; border-radius: 3px; background: var(--cobalt); animation: wave 1s ease-in-out infinite; }
.tts-wave i:nth-child(2) { animation-delay: .1s; height: 14px; }
.tts-wave i:nth-child(3) { animation-delay: .2s; height: 20px; }
.tts-wave i:nth-child(4) { animation-delay: .3s; height: 12px; }
.tts-wave i:nth-child(5) { animation-delay: .4s; height: 6px; }
.integration-note {
  margin-top: 12px; padding-top: 9px; border-top: 1px dashed var(--line);
  font-size: 9.5px; line-height: 1.65; color: var(--ink-3);
}
.integration-note code { background: #F1EFE9; border-radius: 3px; padding: 1px 4px; font-size: 9px; }
.sign-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.sign-card {
  min-height: 92px; padding: 9px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #FCFBF8; text-align: left;
  transition: border-color .15s ease, background .15s ease;
}
.sign-card:hover { border-color: var(--amber); background: #FFF9E8; }
.sign-card .icon { width: 23px; height: 23px; color: var(--amber); stroke-width: 1.5; }
.sign-card strong { font-size: 12px; }
.sign-card span { font-size: 9px; color: var(--ink-3); line-height: 1.4; }

/* ============================================================
   提示弹层
   ============================================================ */
.popover {
  position: fixed; top: 72px; right: 20px; width: 344px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 13px; box-shadow: var(--shadow-lg);
  padding: 12px; z-index: 120;
  animation: popIn .16s ease both;
}
.pop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 3px 9px; }
.pop-head strong { font-size: 12px; letter-spacing: .03em; }
.alert-pop-list { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; }
.alert-row {
  width: 100%; display: grid; grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 8px; align-items: start;
  padding: 8px 6px; border: 0; border-radius: 7px;
  background: transparent; text-align: left;
}
.alert-row:hover { background: var(--panel-2); }
.alert-row.is-unread { background: #FBF8EF; }
.alert-row .level-dot { margin-top: 4px; }
.alert-row-title { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink); }
.alert-row-detail { display: block; margin-top: 2px; font-size: 10px; line-height: 1.45; color: var(--ink-3); }
.alert-row time { font-size: 9px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ============================================================
   通用弹层
   ============================================================ */
.modal-layer {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 22px;
  background: rgba(9, 14, 24, .56);
  backdrop-filter: blur(7px);
}
.modal {
  position: relative;
  width: min(720px, 94vw); max-height: 88vh; overflow-y: auto;
  padding: 26px;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  animation: modalIn .2s ease both;
}
.modal.small { width: min(540px, 94vw); padding: 24px; }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-3);
}
.modal-close:hover { background: var(--panel-2); color: var(--ink); }
.eyebrow {
  font-size: 9.5px; font-weight: 800; letter-spacing: .16em;
  text-transform: uppercase; color: var(--amber);
}
.modal h2 { font-family: var(--serif); font-size: 28px; line-height: 1.25; letter-spacing: .03em; margin-top: 7px; }
.lede { margin-top: 12px; font-size: 13px; line-height: 1.8; color: var(--ink-2); }
.lede.small { font-size: 12px; line-height: 1.7; }
.modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 18px; }
.modal-actions.wrap { flex-wrap: wrap; }
.bullet-list { margin: 12px 0 0; padding-left: 18px; font-size: 12px; line-height: 1.9; color: var(--ink-2); }
.bullet-list li::marker { color: var(--amber); }

/* ---------- 开课 ---------- */
.onboarding { width: min(760px, 94vw); padding: 30px; }
.onboard-brand { display: flex; align-items: center; gap: 16px; }
.onboard-brand h2 { margin-top: 2px; font-size: 36px; }
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.role-card {
  position: relative; min-height: 150px; padding: 18px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 5px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel-2); text-align: left;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.role-card:hover { border-color: var(--cobalt); background: var(--cobalt-soft); transform: translateY(-2px); }
.role-icon {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--panel); border: 1px solid var(--line); color: var(--cobalt);
  margin-bottom: 5px;
}
.role-icon .icon { width: 20px; height: 20px; }
.role-card strong { font-size: 14.5px; }
.role-card span:not(.role-icon) { font-size: 11.5px; color: var(--ink-3); }
.role-card em {
  position: absolute; top: 14px; right: 14px;
  font-style: normal; font-size: 8.5px; font-weight: 700; letter-spacing: .06em;
  background: #FFE58F; color: #5B3A00; border-radius: 4px; padding: 2px 6px;
}
.onboard-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; }
.onboard-meta { font-size: 9.5px; color: var(--ink-3); }
.onboard-step h2 { font-size: 30px; }
.check-list { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.check-item {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 10px; align-items: center;
  padding: 11px 13px; border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.check-item:last-child { border-bottom: 0; }
.check-icon {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong);
  position: relative;
}
.check-item.is-done .check-icon { background: var(--green); border-color: var(--green); }
.check-item.is-done .check-icon::after {
  content: ""; position: absolute; left: 5px; top: 2px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.check-item strong { display: block; font-size: 12px; }
.check-item span:not(.check-icon):not(.check-state) { display: block; margin-top: 1px; font-size: 10px; color: var(--ink-3); }
.check-state { font-size: 9.5px; color: var(--ink-3); }
.check-item.is-done .check-state { color: var(--green); }
.audio-source-card {
  display: flex; align-items: center; gap: 11px;
  margin-top: 14px; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 12px; background: #FBFAF6;
}
.audio-source-icon {
  width: 34px; height: 34px; flex: none; display: flex; align-items: center; justify-content: center;
  border-radius: 9px; background: var(--amber-soft); color: #5B3A00;
}
.audio-source-icon .icon { width: 17px; height: 17px; }
.audio-source-card div { min-width: 0; }
.audio-source-card strong { display: block; font-size: 12px; }
.audio-source-card span:not(.audio-source-icon):not(.ok-chip) { display: block; margin-top: 2px; font-size: 10px; color: var(--ink-3); }
.ok-chip {
  margin-left: auto; font-size: 9px; font-weight: 700; color: var(--green);
  background: var(--green-soft); border-radius: 999px; padding: 3px 7px; white-space: nowrap;
}
.back-btn { display: block; margin: 12px auto 0; }
.radio-cards { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.radio-card {
  position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr);
  gap: 2px 9px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.radio-card:hover { border-color: var(--line-strong); }
.radio-card:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.radio-card.is-selected { border-color: var(--cobalt); background: var(--cobalt-soft); }
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-dot {
  width: 16px; height: 16px; margin-top: 1px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); background: #fff; position: relative;
}
.radio-card.is-selected .radio-dot { border-color: var(--cobalt); }
.radio-card.is-selected .radio-dot::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--cobalt);
}
.radio-card strong { font-size: 12.5px; }
.radio-card span:not(.radio-dot) { grid-column: 2; font-size: 10.5px; color: var(--ink-3); line-height: 1.5; }
.check-line {
  display: flex; align-items: flex-start; gap: 9px;
  margin: 14px 0; font-size: 11px; line-height: 1.65; color: var(--ink-2);
}
.check-line input { margin-top: 2px; accent-color: var(--cobalt); width: 15px; height: 15px; }
.class-code-box {
  margin-top: 14px; padding: 15px;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center;
  background: var(--rail); color: #fff; border-radius: 14px;
}
.class-code-box .mini-label { color: #FFD400; display: block; }
.class-code-box strong { font-family: var(--serif); font-size: 26px; color: #FFD400; letter-spacing: .06em; }
.class-code-meta { font-size: 10px; line-height: 1.7; color: rgba(230, 234, 240, .7); }
.class-code-meta span { color: #fff; }

/* ---------- 配置中心 ---------- */
.modal.settings {
  width: min(960px, 95vw); height: min(720px, 90vh);
  padding: 0; overflow: hidden;
  display: flex; flex-direction: column;
}
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 20px 24px; border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 24px; margin-top: 3px; }
.settings-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 172px minmax(0, 1fr); }
.settings-nav {
  padding: 14px 12px; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 3px; background: var(--panel-2);
}
.settings-nav button {
  height: 38px; padding: 0 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-2); text-align: left; font-size: 12px;
}
.settings-nav button:hover { background: #F1EFE9; }
.settings-nav button.is-active { background: var(--panel); color: var(--cobalt); font-weight: 700; box-shadow: 0 1px 3px rgba(16,24,40,.08); }
.settings-panels { overflow-y: auto; padding: 20px 24px 30px; }
.settings-panel { animation: fadeIn .16s ease both; }
.settings-section { margin-bottom: 22px; }
.settings-section h3 { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 9px; }
.settings-section.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.preset-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.preset-btn {
  min-height: 64px; padding: 10px 11px; text-align: left;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2);
}
.preset-btn strong { display: block; font-size: 12px; }
.preset-btn span { display: block; margin-top: 3px; font-size: 9.5px; color: var(--ink-3); }
.preset-btn:hover { border-color: var(--line-strong); }
.preset-btn.is-active { border-color: var(--cobalt); background: var(--cobalt-soft); }
.preview-card {
  border-radius: 12px; padding: 16px;
  background: var(--rail); color: #fff; overflow: hidden;
}
.preview-meta { display: flex; align-items: center; gap: 7px; font-size: 11px; color: rgba(255,255,255,.75); }
.preview-time { margin-left: auto; font-size: 9px; color: rgba(255,255,255,.45); font-variant-numeric: tabular-nums; }
.preview-text {
  margin-top: 8px;
  font-size: clamp(18px, var(--caption-size), 32px);
  line-height: var(--caption-line);
  font-weight: 500; letter-spacing: .01em;
}
.settings-hint { margin-top: 7px; font-size: 10px; line-height: 1.65; color: var(--ink-3); }
.shortcut-table { width: 100%; border-collapse: collapse; }
.shortcut-table td { padding: 9px 8px; border-bottom: 1px dashed var(--line); font-size: 11.5px; color: var(--ink-2); }
.shortcut-table td:last-child { text-align: right; }
.shortcut-table tr:last-child td { border-bottom: 0; }
kbd {
  display: inline-block; font-family: var(--ui); font-size: 9.5px;
  border: 1px solid var(--line-strong); border-bottom-width: 2px;
  border-radius: 4px; padding: 1px 5px; background: var(--panel-2);
  color: var(--ink-2); line-height: 1.5;
}
.sync-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2);
}
.sync-account { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sync-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--rail); color: #FFD400; font-size: 11px; font-weight: 800;
}
.sync-account strong { display: block; font-size: 11.5px; }
.sync-account span:not(.sync-avatar) { display: block; margin-top: 2px; font-size: 9.5px; color: var(--ink-3); }
.sync-status { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--green); white-space: nowrap; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.device-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.device-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 11px;
}
.device-row:last-child { border-bottom: 0; }
.device-row .icon { color: var(--ink-3); }
.device-row div { flex: 1; min-width: 0; }
.device-row strong { display: block; font-size: 11.5px; }
.device-row span:not(.device-current) { display: block; margin-top: 1px; font-size: 9.5px; color: var(--ink-3); }
.device-current { font-size: 9px; color: var(--green); background: var(--green-soft); border-radius: 999px; padding: 2px 7px; }
.danger-text { color: var(--red); border-color: #F0C9C4; }
.danger-text:hover { color: var(--red); border-color: var(--red); background: var(--red-soft); }

/* ---------- 提示中心 ---------- */
.modal.alert-center { width: min(960px, 95vw); height: min(680px, 88vh); padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.alert-center-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 330px; }
.alert-feed { padding: 16px 20px; overflow-y: auto; }
.alert-feed-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.alert-feed-head h3 { font-size: 12px; letter-spacing: .05em; }
.alert-list { display: flex; flex-direction: column; }
.alert-item {
  width: 100%;
  display: grid; grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 10px; align-items: start;
  padding: 12px 6px;
  border: 0; border-bottom: 1px dashed var(--line);
  background: transparent; color: inherit; font: inherit; text-align: left;
  cursor: pointer;
}
.alert-item:hover { background: var(--panel-2); }
.alert-item.is-unread { background: #FBF8EF; }
.alert-item .level-dot { margin-top: 5px; }
.alert-item-body { display: block; min-width: 0; }
.alert-item-title { display: block; font-size: 12px; font-weight: 600; }
.alert-item-detail { display: block; margin-top: 2px; font-size: 10.5px; line-height: 1.55; color: var(--ink-3); }
.alert-item-meta { display: block; margin-top: 4px; font-size: 9px; color: var(--ink-3); }
.alert-item time { font-size: 9px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.alert-rules { padding: 16px 18px; border-left: 1px solid var(--line); background: var(--panel-2); overflow-y: auto; }
.alert-rules h3 { font-size: 12px; letter-spacing: .05em; }
.rule-list { margin: 12px 0; border-top: 1px solid var(--line); }
.rule-list .switch-row span { display: inline-flex; align-items: center; gap: 7px; }
.rule-important { margin-top: 10px; border-top: 1px solid var(--line); border-bottom: 0; font-weight: 600; color: var(--ink); }
.alert-rules .wide-btn { margin-top: 14px; }

/* ---------- 火警 ---------- */
.fire-layer { background: rgba(0, 0, 0, .88); backdrop-filter: blur(4px); }
.fire-card {
  width: min(620px, 92vw); padding: 38px 34px; text-align: center;
  background: #150B0B; color: #fff;
  border: 2px solid #FF6B6B; border-radius: 20px;
  box-shadow: 0 0 0 1px rgba(255, 107, 107, .2), 0 30px 90px rgba(0, 0, 0, .55);
  animation: firePulse 2.2s ease-in-out infinite;
}
.fire-icon {
  width: 64px; height: 64px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(255, 107, 107, .12); color: #FF6B6B;
}
.fire-icon .icon { width: 32px; height: 32px; stroke-width: 2; }
.fire-card .eyebrow { color: #FF9B9B; }
.fire-card h2 { font-family: var(--serif); font-size: 42px; margin-top: 8px; letter-spacing: .06em; color: #fff; }
.fire-card p:not(.eyebrow) { margin-top: 12px; font-size: 14px; line-height: 1.8; color: rgba(255, 255, 255, .82); }
.fire-meta { margin-top: 14px; font-size: 10px; color: rgba(255, 255, 255, .45); }
.fire-btn {
  margin-top: 24px; width: 100%; height: 48px;
  border: 0; border-radius: 10px; background: #FF6B6B; color: #1A0505;
  font-size: 14px; font-weight: 800; letter-spacing: .03em;
}
.fire-btn:hover { background: #FF8A8A; }

/* ---------- 音源说明 ---------- */
.audio-tier-list { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; }
.audio-tier {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 10px; align-items: center;
  padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel-2);
}
.audio-tier.is-current { border-color: var(--cobalt); background: var(--cobalt-soft); }
.tier-num {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel); border: 1px solid var(--line); font-size: 10px; font-weight: 800;
}
.audio-tier strong { display: block; font-size: 11.5px; }
.audio-tier span:not(.tier-num):not(.ok-chip):not(.tier-tag) { display: block; margin-top: 1px; font-size: 9.5px; color: var(--ink-3); }
.tier-tag { font-size: 9px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 999px; padding: 2px 6px; }
.tier-tag.warn { color: #5B3A00; background: var(--amber-soft); border-color: #F0DCA0; }
.auth-note {
  display: flex; gap: 9px; align-items: flex-start;
  margin-top: 14px; padding: 10px 11px;
  background: var(--green-soft); border: 1px solid #C6E8D6; border-radius: 10px;
  font-size: 10px; line-height: 1.6; color: #075E3A;
}
.auth-note .icon { width: 14px; height: 14px; margin-top: 1px; flex: none; }

/* ---------- 投影 ---------- */
.projector-layer { padding: 0; background: #000; backdrop-filter: none; }
.projector {
  width: 100vw; height: 100vh; padding: 3.2vh 4vw;
  display: flex; flex-direction: column;
  background:
    radial-gradient(900px 500px at 50% -20%, rgba(255, 212, 0, .07), transparent 60%),
    #000;
  color: #fff;
}
.projector-top {
  display: flex; align-items: center; gap: 18px;
  font-size: 12px; letter-spacing: .08em; color: rgba(255, 255, 255, .55);
}
.proj-live { display: inline-flex; align-items: center; gap: 6px; color: #FFD400; font-weight: 800; letter-spacing: .15em; font-size: 10px; }
.proj-live i { width: 6px; height: 6px; border-radius: 50%; background: #FFD400; animation: blink 1.6s infinite; }
#projClock { margin-left: auto; font-variant-numeric: tabular-nums; }
.projector-lines { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 2.4vh; padding: 2vh 0; }
.proj-line { display: grid; grid-template-columns: 6.5vw minmax(0, 1fr); gap: 2vw; align-items: baseline; animation: captionIn .3s ease both; }
.proj-speaker {
  font-size: clamp(16px, 1.6vw, 26px); font-weight: 800; letter-spacing: .08em;
  color: #FFD400; text-align: right;
}
.proj-text {
  font-size: clamp(44px, 5.6vw, 104px); line-height: 1.24; font-weight: 600;
  letter-spacing: .01em; color: #fff; overflow-wrap: anywhere;
}
.proj-empty { font-size: clamp(36px, 4vw, 70px); color: rgba(255, 255, 255, .35); text-align: center; }
.projector-alert {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 1.6vh; padding: 10px 16px;
  background: #FFD400; color: #000; border-radius: 8px;
  font-size: 14px; font-weight: 700;
}
.projector-alert .icon { width: 18px; height: 18px; }
.projector-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  font-size: 11px; color: rgba(255, 255, 255, .4);
  border-top: 1px solid rgba(255, 255, 255, .14); padding-top: 1.4vh;
}
.projector-actions { display: flex; gap: 8px; opacity: .55; transition: opacity .15s ease; }
.projector:hover .projector-actions, .projector:focus-within .projector-actions { opacity: 1; }
.proj-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .3); border-radius: 7px;
  background: transparent; color: #fff; font-size: 11px;
}
.proj-btn:hover { background: rgba(255, 255, 255, .1); }
.proj-btn .icon { width: 13px; height: 13px; }

/* ---------- 手语卡 ---------- */
.sign-modal { width: min(600px, 94vw); }
.sign-hero { display: flex; gap: 20px; align-items: center; margin-top: 16px; }
.sign-hand {
  width: 104px; height: 104px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--amber-soft); color: var(--amber);
  border: 1px solid #F0DCA0;
}
.sign-hand .icon { width: 52px; height: 52px; stroke-width: 1.4; }
.sign-hand.is-playing { animation: signPlay 1.4s ease-in-out infinite; }
.sign-hero h2 { font-size: 30px; }
.sign-hero p { margin-top: 6px; font-size: 12px; line-height: 1.7; color: var(--ink-2); }
.sign-meta { display: flex; gap: 6px; margin-top: 14px; }

/* ---------- 冲突 ---------- */
.conflict-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.conflict-card {
  padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2);
}
.conflict-card .mini-label { display: block; margin-bottom: 7px; }
.conflict-card strong { display: block; font-size: 17px; font-family: var(--serif); }
.conflict-card span:not(.mini-label) { display: block; margin-top: 3px; font-size: 10px; color: var(--ink-3); }

/* ---------- 同步 ---------- */
.sync-layer { background: rgba(9, 14, 24, .7); }
.sync-card {
  width: min(380px, 88vw); padding: 30px; text-align: center;
  background: var(--rail); color: #fff; border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .12);
}
.sync-card h2 { font-size: 20px; font-family: var(--serif); margin-top: 16px; }
.sync-card p { margin-top: 7px; font-size: 11px; color: rgba(255, 255, 255, .55); line-height: 1.6; }
.spinner {
  width: 36px; height: 36px; margin: 0 auto; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .16); border-top-color: #FFD400;
  animation: spin .8s linear infinite;
}

/* ---------- 校对浮层 ---------- */
.correction-pop {
  position: fixed; z-index: 320; width: min(360px, 92vw);
  padding: 14px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg);
  animation: popIn .14s ease both;
}
.correction-head { display: flex; align-items: center; justify-content: space-between; }
.correction-original { margin-top: 9px; font-size: 12px; color: var(--ink-2); }
.correction-original strong { font-size: 16px; color: var(--ink); margin: 0 4px; }
.conf-chip { font-size: 9px; color: #5B3A00; background: var(--amber-soft); border-radius: 999px; padding: 2px 6px; margin-left: 4px; }
.candidate-row { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0 8px; }
.candidate {
  border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2);
  padding: 5px 9px; font-size: 11px;
}
.candidate:hover { border-color: var(--cobalt); color: var(--cobalt); }
.text-input {
  width: 100%; height: 36px; margin-top: 5px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #FCFBF8;
  font-size: 12.5px;
}
.correction-note { margin-top: 8px; font-size: 9.5px; line-height: 1.5; color: var(--ink-3); }
.correction-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 12px; }

/* ---------- 命令面板 ---------- */
#commandModal { align-items: flex-start; padding-top: 12vh; background: rgba(9, 14, 24, .42); }
.command-palette {
  width: min(620px, 92vw); overflow: hidden;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-lg);
  animation: modalIn .18s ease both;
}
.command-input {
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px; height: 54px; border-bottom: 1px solid var(--line);
}
.command-input .icon { color: var(--ink-3); }
.command-input input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 14px; }
.command-input kbd { font-size: 9px; }
.command-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.command-item {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 0; border-radius: 8px;
  background: transparent; text-align: left; font-size: 12.5px; color: var(--ink-2);
}
.command-item:hover, .command-item.is-active { background: var(--cobalt-soft); color: var(--ink); }
.command-item .cmd-hint { font-size: 9.5px; color: var(--ink-3); }
.command-foot { padding: 9px 16px; border-top: 1px solid var(--line); font-size: 9.5px; color: var(--ink-3); }

/* ---------- Toast ---------- */
body.projector-open .toast-stack,
body.critical-alert .toast-stack { display: none; }
body.projector-open .demo-fab,
body.projector-open .demo-panel,
body.projector-open .demo-mini { display: none !important; }
.toast-stack {
  position: fixed; right: 20px; bottom: 20px; z-index: 500;
  display: flex; flex-direction: column; gap: 7px;
  width: min(380px, 90vw); pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--rail); color: #fff;
  box-shadow: 0 12px 32px rgba(9, 14, 24, .3);
  animation: toastIn .22s ease both;
  pointer-events: auto;
}
.toast.is-out { opacity: 0; transform: translateY(6px); transition: opacity .2s ease, transform .2s ease; }
.toast .icon { width: 16px; height: 16px; margin-top: 1px; color: #FFD400; }
.toast-body strong { display: block; font-size: 11.5px; line-height: 1.45; }
.toast-body span { display: block; margin-top: 2px; font-size: 10px; line-height: 1.5; color: rgba(255, 255, 255, .6); }
.toast.toast-success .icon { color: #7CFFB2; }
.toast.toast-error .icon { color: #FF8A80; }

/* ============================================================
   演示控制
   ============================================================ */
.demo-fab {
  position: fixed; left: 20px; bottom: 20px; z-index: 150;
  height: 34px; padding: 0 12px;
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px dashed rgba(255, 212, 0, .6); border-radius: 999px;
  background: var(--rail); color: #fff; font-size: 10.5px; letter-spacing: .04em;
  box-shadow: 0 8px 24px rgba(9, 14, 24, .25);
}
.demo-fab span, .demo-badge {
  font-size: 8px; font-weight: 800; letter-spacing: .12em;
  background: #FFD400; color: #101828; border-radius: 3px; padding: 2px 5px;
}
.demo-panel {
  position: fixed; left: 20px; bottom: 20px; z-index: 151;
  width: 350px; max-height: 72vh; overflow-y: auto;
  padding: 14px;
  background: #0B1220; color: #fff;
  border: 1px dashed rgba(255, 212, 0, .5); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
  animation: popIn .16s ease both;
}
.demo-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.demo-head > div { display: flex; align-items: center; gap: 7px; }
.demo-head strong { font-size: 11.5px; }
.demo-head .icon-btn { color: rgba(255, 255, 255, .6); }
.demo-head .icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.demo-note { margin: 8px 0 10px; font-size: 9.5px; line-height: 1.6; color: rgba(255, 255, 255, .5); }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.demo-grid button {
  min-height: 34px; padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, .14); border-radius: 7px;
  background: rgba(255, 255, 255, .04); color: rgba(255, 255, 255, .82);
  font-size: 10px; text-align: left;
}
.demo-grid button:hover { background: rgba(255, 212, 0, .1); border-color: rgba(255, 212, 0, .45); color: #fff; }
.demo-grid button.danger { color: #FF8A80; }
.demo-mini {
  position: fixed; left: 20px; bottom: 20px; z-index: 150;
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px dashed rgba(255, 212, 0, .5); background: var(--rail);
  color: #FFD400; font-size: 7px; font-weight: 800; letter-spacing: .04em;
}

/* ============================================================
   高对比模式
   ============================================================ */
body.high-contrast {
  --ink: #FFFFFF;
  --ink-2: #FFFFFF;
  --ink-3: #FFFFFF;
  --paper: #000000;
  --panel: #000000;
  --panel-2: #000000;
  --line: #FFFFFF;
  --line-strong: #FFFFFF;
  --cobalt: #FFD400;
  --cobalt-dark: #FFD400;
  --cobalt-soft: #000000;
  --amber: #FFD400;
  --amber-soft: #000000;
  --amber-line: #FFD400;
  --green: #7CFFB2;
  --green-soft: #000000;
  --red: #FF6B6B;
  --red-soft: #000000;
  --rail: #000000;
  --rail-2: #000000;
  --rail-text: #FFFFFF;
  --rail-muted: #FFFFFF;
  --focus: #FFD400;
  --shadow: none;
  --shadow-lg: none;
}
body.high-contrast::before { display: none; }
body.high-contrast .panel,
body.high-contrast .stage,
body.high-contrast .dock,
body.high-contrast .modal,
body.high-contrast .popover,
body.high-contrast .toast,
body.high-contrast .correction-pop,
body.high-contrast .demo-panel,
body.high-contrast .command-palette {
  border: 2px solid #FFFFFF;
  box-shadow: none;
}
body.high-contrast .topbar { background: #000; border-bottom: 2px solid #fff; }
body.high-contrast .status-pill { border: 1px solid currentColor; }
body.high-contrast .low-word {
  background: transparent;
  color: #FFD400;
  border-bottom: 2px dashed #FFD400;
}
body.high-contrast .low-word:hover { background: #1A1A1A; }
body.high-contrast .low-mark { background: #FFD400; color: #000; }
body.high-contrast .corrected-word { background: transparent; border-bottom-color: #7CFFB2; }
body.high-contrast .caption.is-target .caption-text { background: #1A1A1A; box-shadow: 0 0 0 6px #1A1A1A; }
body.high-contrast .speaker-avatar { background: #000; border: 1px solid currentColor; }
body.high-contrast .class-card { background: #000; }
body.high-contrast .preview-card,
body.high-contrast .send-preview,
body.high-contrast .sync-card,
body.high-contrast .class-code-box { border: 2px solid #fff; }
body.high-contrast .segmented { background: #000; border: 1px solid #fff; }
body.high-contrast .segmented button.is-active { background: #FFD400; color: #000; }
body.high-contrast .switch { background: transparent; border: 2px solid #fff; }
body.high-contrast .switch span { background: #fff; }
body.high-contrast .switch[aria-checked="true"] { background: #FFD400; border-color: #FFD400; }
body.high-contrast .switch[aria-checked="true"] span { background: #000; }
body.high-contrast .offline-banner { background: #000; color: #FFD400; border-bottom: 2px solid #FFD400; }
body.high-contrast .offline-banner span,
body.high-contrast .offline-banner .text-btn { color: #FFD400; }
body.high-contrast .notes-area,
body.high-contrast .tts-area,
body.high-contrast .text-input { background: #000; border: 1px solid #fff; color: #fff; }
body.high-contrast .icon-btn[aria-pressed="true"] { background: #FFD400; color: #000; }
body.high-contrast .primary-btn { background: #FFD400; border-color: #FFD400; color: #000; }
body.high-contrast .primary-btn:hover { background: #FFE58F; }
body.high-contrast .ghost-btn,
body.high-contrast .wide-btn,
body.high-contrast .chip,
body.high-contrast .replay-item,
body.high-contrast .phrase-card,
body.high-contrast .sign-card,
body.high-contrast .radio-card,
body.high-contrast .preset-btn,
body.high-contrast .audio-tier,
body.high-contrast .check-list,
body.high-contrast .check-item { background: #000; border: 1px solid #fff; }
body.high-contrast .radio-card.is-selected,
body.high-contrast .preset-btn.is-active,
body.high-contrast .chip.is-active { background: #1A1A1A; border-color: #FFD400; color: #FFD400; }
body.high-contrast .alert-item.is-unread,
body.high-contrast .alert-row.is-unread { background: #000; border-left: 3px solid #FFD400; }
body.high-contrast .modal-layer { background: rgba(0, 0, 0, .9); }
body.high-contrast .toast { background: #000; border: 2px solid #fff; }
body.high-contrast .demo-panel { background: #000; }
body.high-contrast .preview-meta,
body.high-contrast .preview-time { color: #fff; }
body.high-contrast .fire-card { border-width: 3px; }

/* 专注模式 */
body.focus-mode .context-col,
body.focus-mode .dock { display: none; }
body.focus-mode .workspace { grid-template-columns: minmax(0, 1fr); }
body.focus-mode .stage { width: 100%; max-width: 1180px; margin: 0 auto; }
body.focus-mode .caption-stream { max-width: 900px; }
body.focus-mode .caption-text { max-width: 30em; }

/* 隐藏说话人姓名 */
body.hide-speaker .caption-byline .speaker-name,
body.hide-speaker .speaker-name { display: none; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1380px) {
  .workspace { grid-template-columns: 268px minmax(0, 1fr) 330px; gap: 12px; }
  .caption-scroll { padding-left: 30px; padding-right: 30px; }
}

@media (max-width: 1240px) {
  .app { grid-template-columns: 76px minmax(0, 1fr); }
  .rail { padding: 20px 9px 14px; align-items: center; }
  .brand { padding: 0; justify-content: center; }
  .brand-text, .nav-label, .nav-kbd, .rail-note, .command-btn span, .command-btn kbd { display: none; }
  .nav-item { justify-content: center; padding: 0; height: 46px; }
  .nav-badge { position: absolute; top: 6px; right: 6px; min-width: 15px; height: 15px; font-size: 8.5px; }
  .rail-nav { margin-top: 30px; width: 100%; }
  .rail-foot { width: 100%; }
  .command-btn { justify-content: center; padding: 0; }
  .workspace { grid-template-columns: minmax(0, 1fr) 330px; }
  .context-col { display: none; }
  .engine-tag { display: none; }
}

@media (max-width: 1040px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 316px; }
  .status-cluster .metric { display: none; }
  .topbar { gap: 10px; padding: 0 14px; }
  .class-sub { max-width: 300px; }
  .stage-actions .ghost-btn span { display: none; }
  .stage-actions .ghost-btn { width: 32px; padding: 0; }
}

@media (max-width: 920px) {
  body { overflow-y: auto; }
  .main { height: auto; min-height: 100vh; overflow: visible; }
  .workspace {
    grid-template-columns: 1fr;
    overflow: visible;
    padding: 12px;
  }
  .stage { min-height: 62vh; }
  .dock { min-height: 340px; max-height: 70vh; }
  .caption-scroll { padding-left: 22px; padding-right: 22px; }
  .class-sub { max-width: 220px; }
  .status-cluster { display: none; }
  .modal.settings { height: 92vh; }
  .settings-body { grid-template-columns: 132px minmax(0, 1fr); }
  .alert-center-body { grid-template-columns: 1fr; }
  .alert-rules { border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; height: auto; min-height: 100vh; padding-bottom: 64px; }
  .rail {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    height: 62px; padding: 5px 8px;
    flex-direction: row; align-items: center;
    border-top: 1px solid rgba(255, 255, 255, .12);
    z-index: 90;
  }
  .rail::after { display: none; }
  .brand, .rail-foot { display: none; }
  .rail-nav { margin: 0; flex: 1; flex-direction: row; justify-content: space-around; gap: 0; }
  .nav-item { flex: 1; height: 52px; flex-direction: column; gap: 2px; justify-content: center; font-size: 9.5px; }
  .nav-label { display: block; }
  .nav-icon .icon { width: 19px; height: 19px; }
  .nav-item.is-active::before { left: 18%; right: 18%; top: auto; bottom: 0; width: auto; height: 2px; }
  .nav-badge { top: 3px; right: calc(50% - 20px); }
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 12px; gap: 8px; }
  .class-meta { width: 100%; }
  .class-sub { max-width: none; }
  .top-actions { margin-left: auto; }
  .workspace { padding: 10px; gap: 10px; }
  .stage { min-height: 72vh; }
  .caption { grid-template-columns: 34px minmax(0, 1fr); gap: 9px; }
  .caption-gutter .speaker-avatar { width: 30px; height: 30px; font-size: 10px; }
  .caption-text { font-size: calc(var(--caption-size) * .82); }
  .stage-head { padding: 0 10px; gap: 6px; }
  .stage-title { font-size: 12px; }
  .font-controls { display: none; }
  .stage-actions .ghost-btn { display: none; }
  .stage-sub { padding: 0 12px; }
  .sub-hint { display: none; }
  .caption-scroll { padding: 6px 14px 28px; }
  .stage-foot { padding: 0 12px; gap: 10px; }
  .stage-foot .foot-item:nth-child(2) { display: none; }
  .interim { padding-left: 43px; }
  .modal-layer { padding: 10px; align-items: flex-end; }
  .modal { width: 100%; max-height: 92vh; border-radius: 16px; padding: 20px; }
  .onboarding { padding: 22px; }
  .role-grid { grid-template-columns: 1fr; }
  .onboard-brand h2 { font-size: 30px; }
  .onboard-brand .brand-mark.large { width: 52px; height: 52px; }
  .settings-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .settings-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .settings-nav button { height: 34px; white-space: nowrap; }
  .settings-panels { padding: 16px; }
  .settings-section.two-col { grid-template-columns: 1fr; gap: 0; }
  .preset-row { grid-template-columns: 1fr; }
  .conflict-grid { grid-template-columns: 1fr; }
  .fire-card { padding: 26px 20px; }
  .fire-card h2 { font-size: 34px; }
  .class-code-box { grid-template-columns: 1fr; }
  .alert-center-body { display: block; overflow-y: auto; }
  .alert-rules { border-left: 0; border-top: 1px solid var(--line); }
  .popover { top: 62px; right: 10px; left: 10px; width: auto; }
  .toast-stack { right: 10px; bottom: 74px; left: 10px; width: auto; }
  .demo-fab, .demo-panel, .demo-mini { bottom: 74px; }
  .demo-panel { width: min(350px, calc(100vw - 20px)); left: 10px; }
  .demo-fab { left: 10px; }
  .demo-mini { left: 10px; }
  .projector { padding: 24px 18px; }
  .proj-line { grid-template-columns: 1fr; gap: 6px; }
  .proj-speaker { text-align: left; }
  .projector-actions { opacity: 1; }
}

/* ============================================================
   动效
   ============================================================ */
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(6, 118, 71, .32); }
  70% { box-shadow: 0 0 0 7px rgba(6, 118, 71, 0); }
  100% { box-shadow: 0 0 0 0 rgba(6, 118, 71, 0); }
}
@keyframes captionIn {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes dot { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }
@keyframes wave { 0%, 100% { transform: scaleY(.45); opacity: .45; } 50% { transform: scaleY(1); opacity: .85; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes firePulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255, 107, 107, .2), 0 30px 90px rgba(0, 0, 0, .55); }
  50% { box-shadow: 0 0 0 10px rgba(255, 107, 107, .08), 0 30px 90px rgba(0, 0, 0, .55); }
}
@keyframes signPlay {
  0%, 100% { transform: rotate(0) translateY(0); }
  25% { transform: rotate(-8deg) translateY(-3px); }
  75% { transform: rotate(8deg) translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .live-dot, .wave span, .dots i, .tts-wave i, .spinner { animation: none !important; }
}
