/* 听音室：暗色、暖光、像一台放在书桌上的收音机。
 * 视觉重心只有一个：屏幕中间的播放器。位置信息一行（说话人 · 段标题 · 第几句），
 * 进度条一条：当前这段，每一小段是一句话，颜色区分说话人。
 * 字体放在本地（web/fonts），国内访问外网字体不稳定。 */

@font-face {
  font-family: "Literata";
  src: url("fonts/literata-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("fonts/literata-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("fonts/dm-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("fonts/dm-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
/* 音标：Literata 和 DM Mono 都没有 ə、ʊ、ˈ 这些符号，缺了浏览器会东拼西凑换字体。
 * 这是 Noto Serif 裁到只剩英文字母和音标符号的一份（34KB，OFL 许可） */
@font-face {
  font-family: "Noto Serif IPA";
  src: url("fonts/noto-serif-ipa-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --ink: #111318;
  --ink-2: #171a21;
  --surface: rgba(255, 246, 230, 0.035);
  --surface-2: rgba(255, 246, 230, 0.06);
  --line: rgba(255, 240, 215, 0.09);
  --line-2: rgba(255, 240, 215, 0.16);
  --cream: #f1e8d8;
  --cream-2: #c9bfae;
  --muted: #8b857a;
  --amber: #f2a94e;
  --amber-2: #ffcf8a;
  --amber-ink: #2a1a06;
  --spk-a: #ef8b73;       /* 第一个说话人 */
  --spk-b: #62c1b9;       /* 第二个说话人 */
  --spk-o: #484c57;       /* 片头片尾 */
  --radius: 26px;
  --cn: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --en: "Literata", "Palatino Linotype", Georgia, serif;
  --mono: "DM Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font: 15px/1.6 var(--cn);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
kbd {
  font: 500 10.5px/1 var(--mono);
  color: var(--muted);
  border: 1px solid var(--line-2);
  border-radius: 5px;
  padding: 3px 5px;
  letter-spacing: .02em;
}
[hidden] { display: none !important; }

/* ---------- 背景：一盏暖灯 + 颗粒 ---------- */

.glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(60vw 45vh at 50% 18%, rgba(242, 169, 78, 0.13), transparent 70%),
    radial-gradient(40vw 40vh at 8% 95%, rgba(98, 193, 185, 0.07), transparent 70%),
    radial-gradient(40vw 40vh at 95% 90%, rgba(239, 139, 115, 0.06), transparent 70%);
}
.grain {
  position: fixed; inset: -50%; pointer-events: none; z-index: 1; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 顶栏 ---------- */

.top {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 44px);
  animation: rise .6s ease both;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(145deg, #2a2d36, #1b1d24);
  border: 1px solid var(--line-2);
  display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding: 8px;
}
.brand-mark i { width: 4px; border-radius: 2px; background: var(--amber); }
.brand-mark i:nth-child(1) { height: 40%; }
.brand-mark i:nth-child(2) { height: 100%; }
.brand-mark i:nth-child(3) { height: 65%; }
h1 { margin: 0; font: 600 20px/1.2 var(--en); letter-spacing: .01em; }
.source { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

.top-actions { position: relative; display: flex; align-items: center; gap: 10px; }
.ghost-btn {
  background: transparent; border: 1px solid var(--line); color: var(--cream-2);
  border-radius: 999px; padding: 8px 16px; font-size: 13.5px;
  transition: border-color .2s, color .2s;
}
.ghost-btn:hover, .ghost-btn.on { border-color: var(--line-2); color: var(--cream); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  display: grid; place-items: center;
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--cream-2); stroke-width: 1.7; stroke-linecap: round; }
.icon-btn:hover svg, .icon-btn[aria-expanded="true"] svg { stroke: var(--amber); }

.settings {
  position: absolute; right: 0; top: 52px; width: 300px;
  background: #1c1f27; border: 1px solid var(--line-2); border-radius: 18px;
  padding: 8px; box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  animation: pop .18s ease both;
}
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 12px; border-radius: 12px; cursor: pointer; font-size: 14px;
}
.switch-row:hover { background: var(--surface); }
.switch-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row i {
  flex: none; width: 38px; height: 22px; border-radius: 999px; position: relative;
  background: #343844; transition: background .2s;
}
.switch-row i::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--cream-2); transition: transform .2s, background .2s;
}
.switch-row input:checked + i { background: var(--amber); }
.switch-row input:checked + i::after { transform: translateX(16px); background: var(--amber-ink); }
.switch-row input:focus-visible + i { outline: 2px solid var(--amber-2); outline-offset: 2px; }
.text-btn {
  width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line);
  margin-top: 4px; padding: 12px; color: var(--cream-2); font-size: 14px; border-radius: 0 0 12px 12px;
}
.text-btn:hover { color: var(--amber-2); }

/* ---------- 中间的播放器 ---------- */

.stage {
  position: relative; z-index: 2; flex: 1;
  width: 100%; max-width: 980px; margin: 0 auto;
  padding: clamp(8px, 2vh, 28px) clamp(16px, 4vw, 40px) 40px;
  display: flex; flex-direction: column; justify-content: center; gap: clamp(18px, 3vh, 34px);
}

.now { animation: rise .6s .08s ease both; }
/* 位置一行（owner 2026-09-26，两轮）：左边谁在说 + 状态牌；右边在哪一段（段号+标题+第几句），
   两侧是 ‹ › 段导航——导航的就是「第几段」这个东西 */
.who { display: flex; align-items: center; gap: 12px; margin: 0 6px 14px; min-width: 0; }
.avatar {
  flex: none;
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  font: 600 19px/1 var(--en); color: var(--ink);
  background: var(--spk-o);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .04);
  transition: background .35s, transform .35s;
}
.avatar.a { background: var(--spk-a); }
.avatar.b { background: var(--spk-b); }
.avatar.o { background: var(--spk-o); color: var(--cream-2); }
.speaker-name { flex: none; font: 600 18px/1.25 var(--en); }
.state-tag {
  flex: none;
  font-size: 12.5px; color: var(--cream-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px;
  background: var(--surface);
}
.state-tag.stop { color: var(--amber-2); border-color: rgba(242, 169, 78, .35); }
.where { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.counter {
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 14.5px; color: var(--cream-2); font-variant-numeric: tabular-nums;
}
.who-sent { flex: none; font: 400 13px/1.4 var(--cn); color: var(--muted); font-variant-numeric: tabular-nums; }
.who-sent[hidden] { display: none; }
.part-nav {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line);
  display: grid; place-items: center;
  transition: border-color .2s, background .2s, opacity .2s;
}
.part-nav svg { width: 18px; height: 18px; fill: none; stroke: var(--cream-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.part-nav:hover:not(:disabled) { border-color: var(--line-2); background: var(--surface-2); }
.part-nav:hover:not(:disabled) svg { stroke: var(--amber-2); }
.part-nav:disabled { opacity: .25; cursor: default; }

.card {
  position: relative;
  min-height: clamp(200px, 30vh, 280px);
  padding: clamp(22px, 3.2vw, 38px) clamp(22px, 3.6vw, 44px) 22px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .04);
  display: flex; flex-direction: column;
}
.hint { margin: auto 0; text-align: center; color: var(--muted); }

/* 不给文字时，声浪是卡片的待机画面（owner 2026-09-26：做大做长，它是主角）：
 * 播放时跳动，暂停时高低不等地伏着，像一段安静的波形 */
.bars { display: flex; justify-content: center; align-items: center; gap: 12px; height: 120px; padding: 0 8%; }
.bars i {
  flex: 1; max-width: 14px; border-radius: 7px; background: var(--amber);
  opacity: .32; transition: height .3s, opacity .3s;
}
.bars i:nth-child(1) { height: 18px; }
.bars i:nth-child(2) { height: 42px; }
.bars i:nth-child(3) { height: 26px; }
.bars i:nth-child(4) { height: 56px; }
.bars i:nth-child(5) { height: 32px; }
.bars i:nth-child(6) { height: 50px; }
.bars i:nth-child(7) { height: 20px; }
.bars i:nth-child(8) { height: 44px; }
.bars i:nth-child(9) { height: 28px; }
.bars i:nth-child(10) { height: 54px; }
.bars i:nth-child(11) { height: 24px; }
body.playing .bars i { opacity: .9; animation: wave 1.05s ease-in-out infinite; }
.bars i:nth-child(2) { animation-delay: -.2s !important; }
.bars i:nth-child(3) { animation-delay: -.55s !important; }
.bars i:nth-child(4) { animation-delay: -.1s !important; }
.bars i:nth-child(5) { animation-delay: -.7s !important; }
.bars i:nth-child(6) { animation-delay: -.35s !important; }
.bars i:nth-child(7) { animation-delay: -.85s !important; }
.bars i:nth-child(8) { animation-delay: -.3s !important; }
.bars i:nth-child(9) { animation-delay: -.6s !important; }
.bars i:nth-child(10) { animation-delay: -.15s !important; }
.bars i:nth-child(11) { animation-delay: -.75s !important; }

.sentence {
  margin: 0; font: 400 clamp(22px, 2.6vw, 31px)/1.62 var(--en);
  letter-spacing: .005em; color: var(--cream);
  animation: fade .3s ease both;
}
.sentence w {
  cursor: pointer; border-radius: 6px; padding: 1px 2px; margin: 0 -2px;
  transition: background .15s, color .15s;
}
.sentence w:hover { background: rgba(242, 169, 78, .14); }
.sentence w.hard { text-decoration: underline dotted rgba(242, 169, 78, .8); text-underline-offset: 6px; text-decoration-thickness: 2px; }
.sentence w.speaking { color: var(--amber-2); }
.sentence w.picked { background: rgba(242, 169, 78, .22); }
.zh {
  margin: 14px 0 0; font-size: clamp(16px, 1.5vw, 19px); color: var(--cream-2);
  padding-top: 14px; border-top: 1px dashed var(--line-2);
  animation: fade .3s ease both;
}
.card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--cream);
  border-radius: 999px; padding: 9px 16px; font-size: 14px; min-height: 42px;
  transition: background .2s, border-color .2s, transform .1s;
}
.pill:hover { background: rgba(255, 246, 230, .09); }
.pill:active { transform: scale(.97); }
.pill.accent { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); font-weight: 600; }
.pill.accent:hover { background: var(--amber-2); }
.pill.accent.nudge { animation: nudge 1.6s ease-in-out 2; }
.pill.big { min-height: 50px; padding: 12px 24px; font-size: 15.5px; }

/* 一段听完：卡片上换成两个选择 */
.section-end { margin: auto 0; text-align: center; animation: rise .4s ease both; }
.end-mark {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(242, 169, 78, .14); border: 1px solid rgba(242, 169, 78, .45);
}
.end-mark svg { width: 26px; height: 26px; fill: none; stroke: var(--amber-2); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.end-title { margin: 0; font: 600 clamp(20px, 2.2vw, 24px)/1.3 var(--cn); color: var(--cream); }
.end-next { margin: 8px 0 0; font-size: 14.5px; color: var(--cream-2); }
.end-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* ---------- 进度：当前这段，每一小段是一句 ---------- */

.deck { animation: rise .6s .16s ease both; }

/* 时间读数：右下角一行「当前 / 这段总长」（如 1:00 / 1:57），拖着进度时变琥珀色、数字跟着走 */
.times {
  text-align: right;
  font: 400 12.5px/1 var(--mono); color: var(--muted); margin: 0 2px 10px;
  font-variant-numeric: tabular-nums;
}
#timeNow { color: var(--cream-2); }
body.scrubbing .times, body.scrubbing .times #timeNow { color: var(--amber-2); }
.timeline {
  position: relative; height: 40px; cursor: pointer;
  border-radius: 12px; touch-action: none;
}
.timeline::before { content: ""; position: absolute; left: -10px; right: -10px; top: -14px; bottom: -6px; }
.segments { position: absolute; inset: 8px 0; }
.segments.swap { animation: fade .35s ease both; }
.seg {
  position: absolute; top: 0; bottom: 0; border-radius: 3px;
  background: var(--spk-o); opacity: .32;
  transition: opacity .2s, transform .25s, box-shadow .25s;
  transform-origin: center;
}
.seg.a { background: var(--spk-a); }
.seg.b { background: var(--spk-b); }
.seg.past { opacity: .72; }
.seg.current { opacity: 1; transform: scaleY(1.55); box-shadow: 0 0 18px rgba(242, 169, 78, .35); z-index: 1; }
.seg.flash { animation: flash .55s ease; }
.seg.stuck::after {
  content: ""; position: absolute; left: 50%; top: -9px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--amber-2); transform: translateX(-50%);
}
.timeline:hover .seg:not(.current) { opacity: .55; }
.timeline:hover .seg.past:not(.current) { opacity: .8; }
.seg.hover { opacity: 1 !important; }
.playhead {
  position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px;
  background: var(--cream); border-radius: 2px; pointer-events: none; z-index: 2;
  box-shadow: 0 0 10px rgba(255, 240, 215, .5);
}
.playhead i {
  position: absolute; left: 50%; top: -6px; width: 12px; height: 12px; margin-left: -6px;
  border-radius: 50%; background: var(--cream); transition: transform .15s;
}
/* 拖进度（SPEC-001 R23）：指到条上，竖线顶上的圆点放大一点，看得出能拖；拖着时竖线更亮 */
.timeline:hover .playhead i { transform: scale(1.3); }
body.scrubbing, body.scrubbing * { cursor: grabbing !important; user-select: none; }
body.scrubbing .playhead { width: 3px; margin-left: -1.5px; box-shadow: 0 0 16px rgba(255, 240, 215, .85); }
body.scrubbing .playhead i { transform: scale(1.45); }
.tip {
  position: absolute; bottom: 48px; transform: translateX(-50%);
  background: #22252e; border: 1px solid var(--line-2); border-radius: 10px;
  padding: 6px 10px; font-size: 12.5px; white-space: nowrap; pointer-events: none;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .4);
}
.tip b { font-weight: 600; color: var(--amber-2); margin-right: 6px; font-variant-numeric: tabular-nums; }

.legend {
  display: flex; flex-wrap: wrap; gap: 18px; margin: 10px 2px 0;
  font-size: 12.5px; color: var(--muted);
}
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 14px; height: 6px; border-radius: 2px; display: inline-block; }
.legend .stuck-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--amber-2); }

/* ---------- 播放键 ---------- */

.transport {
  display: flex; justify-content: center; align-items: flex-start;
  gap: clamp(14px, 3.6vw, 42px); margin-top: clamp(22px, 3.5vh, 36px);
}
.t-btn {
  background: none; border: 0; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  width: 92px;
}
.t-icon {
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line-2);
  transition: transform .12s, background .2s, border-color .2s;
}
.t-icon svg { width: 26px; height: 26px; fill: none; stroke: var(--cream); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.t-btn:hover .t-icon { background: rgba(255, 246, 230, .1); border-color: rgba(255, 240, 215, .28); }
.t-btn:active .t-icon { transform: scale(.94); }
.t-label { font-size: 14px; color: var(--cream-2); }
.t-btn kbd { margin-top: -2px; }
/* 看过文字后亮起「重听本句」，提醒回听（R6；原速再听一遍按钮并进来了，owner 2026-09-26） */
.t-btn.nudge .t-icon {
  border-color: rgba(242, 169, 78, .8);
  box-shadow: 0 0 0 3px rgba(242, 169, 78, .12);
  animation: nudge 1.6s ease-in-out 2;
}
.t-btn.nudge .t-label { color: var(--amber-2); }

.t-btn.play { width: 110px; }
.t-btn.play .t-icon {
  width: 86px; height: 86px; margin-top: -11px;
  background: radial-gradient(circle at 35% 30%, var(--amber-2), var(--amber) 60%);
  border: 0;
  box-shadow: 0 14px 40px rgba(242, 169, 78, .35), inset 0 -3px 0 rgba(0, 0, 0, .12);
}
.t-btn.play .t-icon svg { width: 32px; height: 32px; stroke: var(--amber-ink); fill: var(--amber-ink); stroke-width: 2.4; }
#iconPause { fill: none; }
.t-btn.play .t-label { color: var(--cream); font-weight: 600; }
body.playing .t-btn.play .t-icon { animation: breathe 2.4s ease-in-out infinite; }

.speed {
  display: flex; justify-content: center; align-items: center; gap: 6px;
  margin-top: 24px;
}
.speed-label { font-size: 13px; color: var(--muted); margin-right: 6px; }
.speed-btn {
  font: 500 13px/1 var(--mono); padding: 8px 14px; border-radius: 999px;
  background: transparent; border: 1px solid var(--line); color: var(--cream-2);
}
.speed-btn:hover { border-color: var(--line-2); }
.speed-btn.on { background: var(--cream); color: var(--ink); border-color: var(--cream); }

/* ---------- 单词卡 ---------- */

.wordbox {
  position: fixed; z-index: 20; width: min(380px, calc(100vw - 32px));
  background: #1f222b; border: 1px solid var(--line-2); border-radius: 20px;
  padding: 16px 18px 18px; box-shadow: 0 30px 70px rgba(0, 0, 0, .55);
  animation: pop .16s ease both;
  /* 位置只在点开词时定一次；展开不挪窝（owner 2026-09-26），放不下时里面滚动、maxHeight 由 js 定 */
  display: flex; flex-direction: column; overflow: hidden;
}
.wordbox-head { display: flex; align-items: center; gap: 10px; }
.word-title { font: 600 26px/1.2 var(--en); }
.badge {
  font-size: 12px; color: var(--amber-2); background: rgba(242, 169, 78, .14);
  border-radius: 999px; padding: 3px 10px;
}
.close-btn {
  margin-left: auto; width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--cream-2);
  font-size: 18px; line-height: 1;
}
/* 一行，像词典的词条：词性（斜体、琥珀色）· 英式音标 · 这句里的意思 */
.word-line {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
  margin: 8px 0 16px; line-height: 1.5;
}
.word-pos { font: italic 500 16px/1.4 var(--en); color: var(--amber-2); }
.word-pos.cn {  /* 词组、名字、缩写：中文不能斜体，做成小标签 */
  font: 400 12px/1 var(--cn); padding: 4px 8px; border-radius: 6px;
  background: rgba(242, 169, 78, .12); align-self: center;
}
.word-ipa { font: 400 16.5px/1.4 "Noto Serif IPA", var(--en); color: var(--cream-2); letter-spacing: .01em; }
.word-zh { font-size: 17px; color: var(--cream); }
.word-pos[hidden], .word-ipa[hidden] { display: none; }
/* 展开：常见意思、搭配、例句。卡片高过屏幕时这部分滚动，卡片位置不动 */
.word-more {
  margin: -2px 0 14px; padding-top: 12px; border-top: 1px dashed var(--line-2);
  flex: 1 1 auto; min-height: 0; overflow-y: auto; animation: fade .2s ease both;
}
.word-more h4 { margin: 0 0 6px; font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: .08em; }
.word-more ol, .word-more ul { margin: 0 0 12px; padding: 0; list-style: none; }
.word-more ol { counter-reset: sense; }
.word-more ol li { counter-increment: sense; position: relative; padding: 3px 0 3px 24px; color: var(--cream-2); font-size: 14.5px; }
.word-more ol li::before {
  content: counter(sense); position: absolute; left: 0; top: 5px; width: 17px; height: 17px; border-radius: 50%;
  display: grid; place-items: center; font: 500 10.5px/1 var(--mono); color: var(--muted); border: 1px solid var(--line-2);
}
.word-more ol li.used { color: var(--cream); }
.word-more ol li.used::before { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.word-more ol li em { font-style: normal; font-size: 11.5px; color: var(--amber-2); margin-left: 8px; }
.word-more ul li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 3px 0; }
.word-more b, .more-ex b { font: 500 15px/1.4 var(--en); color: var(--cream); }
.word-more ul li span, .more-ex span { font-size: 13.5px; color: var(--cream-2); }
.more-ex { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.more-ex b { font-style: italic; }
.more-wait { margin: 0 0 4px; font-size: 14.5px; }
.word-zh.loading, .more-wait.loading { color: var(--muted); animation: waiting 1.1s ease-in-out infinite; }
.word-zh.retry, .more-wait.retry { color: var(--amber-2); cursor: pointer; text-decoration: underline dotted; text-underline-offset: 4px; }
.word-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pill.ghost { background: transparent; }
.pill.busy { opacity: .55; pointer-events: none; }
@keyframes waiting { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }

/* ---------- 全文 ---------- */

.drawer {
  position: fixed; z-index: 30; top: 0; right: 0; bottom: 0; width: min(460px, 100vw);
  background: #181a21; border-left: 1px solid var(--line-2);
  box-shadow: -30px 0 80px rgba(0, 0, 0, .5);
  display: flex; flex-direction: column;
  animation: slide .22s ease both;
}
.drawer-head { display: flex; align-items: center; padding: 18px 20px 6px; }
.drawer-head h2 { margin: 0; font-size: 17px; }
.drawer-note { margin: 0; padding: 4px 20px 12px; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--line); }
#fullList { list-style: none; margin: 0; padding: 0 10px 30px; overflow-y: auto; }
#fullList li.group {
  position: sticky; top: 0; z-index: 1; background: #181a21;
  display: flex; align-items: baseline; gap: 10px; padding: 16px 10px 8px;
}
#fullList .g-no { flex: none; font: 600 12.5px/1.4 var(--cn); color: var(--amber-2); }
#fullList .g-title { font-size: 13.5px; color: var(--cream); }
#fullList li.group.intro .g-no, #fullList li.group.outro .g-no { color: var(--muted); }
#fullList li.line {
  display: grid; grid-template-columns: 50px 1fr; gap: 10px; align-items: baseline;
  padding: 9px 10px; border-radius: 10px; cursor: pointer; font-size: 13.5px;
}
#fullList li.line:hover { background: var(--surface-2); }
#fullList li.line.current { background: rgba(242, 169, 78, .12); }
#fullList .t { font: 400 12px/1 var(--mono); color: var(--muted); white-space: nowrap; }
#fullList li.stuck .t::after {
  content: ""; display: inline-block; width: 5px; height: 5px; margin-left: 6px;
  border-radius: 50%; background: var(--amber-2); vertical-align: middle;
}
#fullList .s { color: var(--cream-2); }
#fullList .s b { font-weight: 600; margin-right: 6px; }
#fullList .s b.a { color: var(--spk-a); }
#fullList .s b.b { color: var(--spk-b); }
#fullList li.outside { opacity: .5; }

@media (min-width: 1200px) {
  .stage { transition: transform .25s ease; }
  body.drawer-open .stage { transform: translateX(-230px); }
}

/* ---------- 换版本（SPEC-008） ----------
 * 都不抢播放器的戏：「更新」平时根本不在，出现时像收音机面板上亮起的一盏小指示灯；
 * 两条提示浮在顶上正中，不推开下面的东西；「正在更新」像换台时指针划过刻度。 */

.update-btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: rgba(242, 169, 78, .1); border: 1px solid rgba(242, 169, 78, .42); color: var(--amber-2);
  border-radius: 999px; padding: 8px 16px 8px 14px; font-size: 13.5px; font-weight: 600;
  animation: rise .5s ease both; transition: background .2s, color .2s, border-color .2s;
}
.update-btn:hover { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.update-btn:hover .lamp { background: var(--amber-ink); animation: none; }
.update-btn:disabled { opacity: .5; pointer-events: none; }
.lamp {
  width: 7px; height: 7px; border-radius: 50%; background: var(--amber); flex: none;
  animation: lamp 2.2s ease-out infinite;
}

.notices {
  position: fixed; z-index: 70; top: 14px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: max-content; max-width: calc(100vw - 32px); pointer-events: none;
}
.notice {
  pointer-events: auto; display: flex; align-items: center; gap: 12px;
  padding: 7px 7px 7px 16px; border-radius: 999px; font-size: 13.5px;
  background: #221d16; border: 1px solid rgba(242, 169, 78, .38); color: var(--amber-2);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .5); animation: drop .35s ease both;
}
.notice-btn {
  background: var(--amber); border: 0; color: var(--amber-ink); font-weight: 600; font-size: 13px;
  border-radius: 999px; padding: 6px 16px; min-height: 32px;
}
.notice-btn:hover { background: var(--amber-2); }
.notice.bad { background: #241a19; border-color: rgba(239, 139, 115, .45); color: #f3b8a8; padding-left: 18px; }
.notice.bad .close-btn { width: 30px; height: 30px; font-size: 16px; }

.retune {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(12, 13, 17, .74); backdrop-filter: blur(6px); animation: fade .25s ease both;
}
.retune-card {
  width: min(420px, 100%); text-align: center; padding: 30px 36px 32px;
  background: #1c1f27; border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: 0 40px 90px rgba(0, 0, 0, .55); animation: pop .3s ease both;
}
.retune-dial { display: flex; justify-content: center; align-items: center; gap: 6px; height: 54px; }
.retune-dial i { width: 6px; height: 10px; border-radius: 3px; background: var(--amber); animation: eq 1.1s ease-in-out infinite; }
.retune-dial i:nth-child(2) { animation-delay: -.25s; }
.retune-dial i:nth-child(3) { animation-delay: -.6s; }
.retune-dial i:nth-child(4) { animation-delay: -.1s; }
.retune-dial i:nth-child(5) { animation-delay: -.8s; }
.retune h2 { margin: 16px 0 6px; font: 600 21px/1.3 var(--cn); color: var(--cream); letter-spacing: .04em; }
.retune p { margin: 0; font-size: 14.5px; color: var(--cream-2); text-wrap: balance; }

/* ---------- 动效 ---------- */

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes eq { 0%, 100% { height: 10px; } 50% { height: 46px; } }
/* 声浪（卡片的待机画面，做大后的跳动幅度） */
@keyframes wave { 0%, 100% { height: 18px; } 50% { height: 104px; } }
@keyframes breathe { 0%, 100% { box-shadow: 0 14px 40px rgba(242, 169, 78, .3); } 50% { box-shadow: 0 14px 60px rgba(242, 169, 78, .55); } }
@keyframes flash { 0% { box-shadow: 0 0 0 rgba(255, 207, 138, 0); } 30% { box-shadow: 0 0 26px rgba(255, 207, 138, .9); } 100% { box-shadow: 0 0 18px rgba(242, 169, 78, .35); } }
@keyframes nudge { 0%, 100% { transform: none; } 50% { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(242, 169, 78, .4); } }
@keyframes lamp { 0% { box-shadow: 0 0 0 0 rgba(242, 169, 78, .6); } 70%, 100% { box-shadow: 0 0 0 6px rgba(242, 169, 78, 0); } }
@keyframes drop { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- 窄屏（平板竖放、手机） ---------- */

@media (max-width: 640px) {
  .top { padding: 14px 16px; }
  .source { display: none; }
  .ghost-btn { padding: 7px 12px; font-size: 12.5px; }
  .t-btn { width: 70px; }
  .t-btn.play { width: 88px; }
  .t-icon { width: 54px; height: 54px; }
  .t-btn.play .t-icon { width: 74px; height: 74px; margin-top: -10px; }
  .t-btn kbd { display: none; }
  .transport { gap: 8px; }
  .card-actions .pill kbd, .end-actions .pill kbd { display: none; }
}

/* ---------- 资料库侧边栏（SPEC-009 R8，对外模式专用；web/library.js） ----------
 * 浮层从左滑出、带遮罩，不挤压主卡片；两区：我的课（按系列分组）／已上传的材料（四状态）。
 * 样式跟着全文抽屉（.drawer）一家的语言走，只是住在左边。 */

.top-left { display: flex; align-items: center; gap: 14px; }
.lib-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.lib-mask {
  position: fixed; inset: 0; z-index: 60;   /* 压过空库待机的遮罩：空库里也点得动侧边栏 */
  background: rgba(12, 13, 17, .5); backdrop-filter: blur(3px);
  animation: fade .2s ease both;
}
.lib {
  position: fixed; z-index: 61; top: 0; left: 0; bottom: 0;
  width: min(300px, 86vw);
  background: #181a21; border-right: 1px solid var(--line-2);
  box-shadow: 30px 0 80px rgba(0, 0, 0, .5);
  display: flex; flex-direction: column;
  animation: libIn .22s ease both;
}
.lib-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 14px 8px 18px; }
.lib-head h2 { margin: 0; font-size: 17px; }
.lib-body { flex: 1; overflow-y: auto; padding: 0 10px 12px; }
.lib-sec h3 {
  margin: 14px 10px 6px; font-size: 12px; font-weight: 500;
  color: var(--muted); letter-spacing: .08em;
}
.lib-group { margin: 10px 10px 2px; font-size: 12.5px; color: var(--cream-2); }
.lib-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px; font-size: 13.5px;
}
.lib-row.lesson { cursor: pointer; }
.lib-row.lesson:hover { background: var(--surface-2); }
.lib-row.lesson.current { background: rgba(242, 169, 78, .12); }
.lib-row.fresh { animation: fresh 2.4s ease both; }
.lib-title {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lib-meta { flex: none; font: 400 11.5px/1 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
/* 进度点：空心没开始 / 半满进行中 / 实心听完（localStorage，app.js 写） */
.dot { flex: none; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--muted); }
.dot.half { border-color: var(--amber); background: linear-gradient(90deg, var(--amber) 50%, transparent 50%); }
.dot.full { border-color: var(--amber); background: var(--amber); }
/* 正在听的那集：小声浪 */
.now-bars { flex: none; display: inline-flex; align-items: flex-end; gap: 2px; height: 13px; }
.now-bars i { width: 3px; border-radius: 1px; background: var(--amber); }
.now-bars i:nth-child(1) { height: 40%; }
.now-bars i:nth-child(2) { height: 100%; }
.now-bars i:nth-child(3) { height: 65%; }
/* 材料行的四状态 */
.lib-row.mat .spin {
  flex: none; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--line-2); border-top-color: var(--amber);
  animation: spin 1s linear infinite;
}
.mat-warn {
  flex: none; width: 18px; height: 18px; border-radius: 50%; text-align: center;
  font: 600 12px/18px var(--cn); color: #f3b8a8;
  background: rgba(239, 139, 115, .14); border: 1px solid rgba(239, 139, 115, .4);
}
.mat-icon { flex: none; color: var(--muted); font-size: 13px; }
.lib-main { flex: 1; min-width: 0; }
.lib-main b {
  display: block; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lib-sub { display: block; margin-top: 1px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.lib-row.failed .lib-sub { color: #f3b8a8; }
.mini-btn {
  flex: none; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--cream);
  border-radius: 999px; padding: 5px 13px; font-size: 12.5px;
  transition: border-color .2s, color .2s;
}
.mini-btn:hover { border-color: rgba(242, 169, 78, .55); color: var(--amber-2); }
.x-btn {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  font-size: 15px; line-height: 1;
}
.x-btn:hover { color: #f3b8a8; border-color: rgba(239, 139, 115, .45); }
.lib-empty { margin: 28px 16px; text-align: center; color: var(--muted); font-size: 13.5px; }
.lib-foot { padding: 12px 14px 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.lib-upload { width: 100%; justify-content: center; }
.lib-out {
  background: none; border: 0; color: var(--muted); font-size: 12.5px;
  text-decoration: underline dotted; text-underline-offset: 4px;
}
.lib-out:hover { color: var(--amber-2); }

/* ---------- 上传面板（SPEC-009 v6 重设计：选音频是主角，别让人找） ---------- */

.upload-wrap {
  position: fixed; inset: 0; z-index: 65;
  display: grid; place-items: center; padding: 16px;
  background: rgba(12, 13, 17, .74); backdrop-filter: blur(6px);
  animation: fade .2s ease both;
}
.upload-card {
  width: min(480px, 100%); max-height: calc(100vh - 48px); overflow-y: auto;
  background: #1c1f27; border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 22px 24px 24px; box-shadow: 0 40px 90px rgba(0, 0, 0, .55);
  display: flex; flex-direction: column; gap: 14px;
  animation: pop .25s ease both;
}
.upload-head { display: flex; align-items: center; justify-content: space-between; }
.upload-head h2 { margin: 0; font-size: 17px; }

/* 拖放区：面板里最大最亮的一块，拖进去或点一下都算选文件；选好了就地变成一张「票」 */
.drop-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 132px; padding: 18px 20px;
  background: rgba(242, 169, 78, .05);
  border: 1.5px dashed rgba(242, 169, 78, .45); border-radius: 18px;
  transition: border-color .2s, background .2s;
}
.drop-zone svg { width: 26px; height: 26px; fill: none; stroke: var(--amber); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.drop-zone:hover, .drop-zone.drag { border-color: var(--amber); background: rgba(242, 169, 78, .1); }
.drop-zone.picked { border-style: solid; border-color: rgba(242, 169, 78, .6); background: rgba(242, 169, 78, .07); }
.dz-title { font-size: 15px; color: var(--cream); font-weight: 600; }
.dz-title.bad { color: #f3b8a8; font-weight: 400; }
.drop-zone.picked .dz-title { font: 500 14.5px/1.4 var(--mono); word-break: break-all; }
.dz-sub { font-size: 12.5px; color: var(--muted); }
.dz-sub a, .dz-sub span.again { color: var(--amber-2); text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }

.upload-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-label { flex: none; font-size: 13px; color: var(--cream-2); }
.pill.sm { padding: 7px 14px; font-size: 13px; min-height: 36px; }
.upload-file { font-size: 12.5px; color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.upload-file.picked { color: var(--cream-2); }
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.upload-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--cream-2); }
.upload-card input {
  background: #14161c; border: 1px solid var(--line-2); border-radius: 10px;
  padding: 9px 12px; color: var(--cream); font: inherit; font-size: 13.5px; outline: none;
  transition: border-color .2s; width: 100%;
}
.upload-card input:focus { border-color: rgba(242, 169, 78, .55); }
.upload-err { margin: 0; font-size: 13px; color: #f3b8a8; }
.upload-phase { margin: 0; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.upload-bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.upload-bar i { display: block; height: 100%; width: 0; background: var(--amber); transition: width .2s; }
.upload-send { width: 100%; justify-content: center; }

/* ---------- 空库不挡路（v6）：播放器照常进场，卡片里给一句邀请 ---------- */

body.no-lesson .who, body.no-lesson .deck, body.no-lesson #cardActions { display: none; }
body.no-lesson #hint { opacity: .35; }   /* 声浪压暗当底纹，别抢空状态的话 */
.empty-hint { margin: auto 0; text-align: center; animation: rise .5s ease both; }
.empty-hint h2 { margin: 0 0 8px; font: 600 clamp(20px, 2.2vw, 24px)/1.3 var(--cn); color: var(--cream); }
.empty-hint p { margin: 0 auto 22px; max-width: 34em; font-size: 14.5px; color: var(--cream-2); text-wrap: balance; }

@keyframes libIn { from { transform: translateX(-30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
/* 材料变课的那一刻：轻微高亮一下（SPEC-009：这是用户等的时刻） */
@keyframes fresh {
  0% { background: rgba(242, 169, 78, .25); box-shadow: 0 0 24px rgba(242, 169, 78, .35); }
  100% { background: transparent; box-shadow: none; }
}
.lib-row.lesson.fresh { animation: fresh 2.4s ease both; }
