/* 生成文件 —— 勿手改。源:crates/app/ui/styles.css @ ec7b30361371。改样式请改源,然后跑 bash web/build.sh */
/* manabi · Notion 风浅色:扁平 / 留白 / 克制用色 / 无渐变光晕 / 发丝线 */
:root {
  /* 告诉 WebView 原生控件(select 下拉、滚动条、range 滑块)用哪套配色 —— 缺它则 select 在深色下渲染成白底。 */
  color-scheme: light;
  --bg: #ffffff;
  --surface: #fbfbfa;
  --text: #37352f;       /* 暖近黑 */
  --muted: #787774;
  --faint: #9b9a97;
  --line: #ebebea;       /* 发丝灰 */
  --line2: #e3e3e1;
  --hover: rgba(55, 53, 47, 0.055);
  --accent: #2f76d6;     /* 蓝:说/链接/主操作,只用在极小处 */
  --accent-soft: #eaf1fb;
  --good: #2f7a52;       /* 念对(低饱和绿) */
  --good-soft: #e9f3ec;
  --recast: #b8741a;     /* 就差一点 / recast(低饱和橙) */
  --recast-soft: #faf0e1;
  --bad: #bf5149;        /* 忘记 / 错(低饱和红) */
  --adv: #8a5fd6;        /* 副词(低饱和紫;语法结构着色用) */
  --tag-bg: #f1f0ef;     /* 默认标签底 */
  --r: 8px;
  --r-sm: 6px;
  --sans: system-ui, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  --jp: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", var(--sans);
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace;
}

/* 深色:扁平 Notion dark(深灰非纯黑,无渐变光晕)*/
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #191919;
  --surface: #202020;
  --text: #e6e6e3;
  --muted: #9b9a97;
  --faint: #6f6f6c;
  --line: #2e2e2c;
  --line2: #3a3a37;
  --hover: rgba(255, 255, 255, 0.06);
  --accent: #5b9bf0;
  --accent-soft: #1e2c44;
  --good: #5cb389;
  --good-soft: #17271f;
  --recast: #d6a04a;
  --recast-soft: #2c2618;
  --bad: #d98a82;
  --adv: #b18ff0;
  --tag-bg: #2a2a28;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* 覆盖 .wb-batch/.step-ctl 等 display:flex,让 hidden 真生效 */

/* 首启下载条:默认收起(高度 0),.show 时滑出。进度用底部细线表示。 */
.dl-bar { position: relative; height: 0; overflow: hidden; background: var(--accent-soft); color: var(--muted);
  font-size: 12px; transition: height 0.2s ease; }
.dl-bar.show { height: 30px; }
.dl-bar .dl-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.dl-bar .dl-fill { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--accent); transition: width 0.3s ease; }
.dl-bar.err { background: var(--recast-soft); color: var(--recast); }
.dl-bar.err .dl-fill { background: var(--recast); }

/* 更新提示条:细、克制,顶部一行 + 两个按钮 */
.up-bar { display: flex; align-items: center; gap: 10px; padding: 6px 14px; background: var(--accent-soft);
  color: var(--fg); font-size: 12.5px; border-bottom: 1px solid var(--line); }
.up-bar .up-text { flex: 1; }
.up-bar .up-go, .up-bar .up-x { font-size: 12px; padding: 3px 12px; border-radius: 5px; cursor: pointer;
  border: 1px solid var(--line2); background: var(--bg); color: var(--fg); }
.up-bar .up-go { background: var(--accent); color: #fff; border-color: var(--accent); }
.up-bar .up-go:disabled { opacity: 0.6; cursor: default; }
.up-bar .up-x { background: transparent; color: var(--muted); border-color: transparent; }
/* 细腻交互过渡(Notion 风:克制、快)*/
nav.tabs button, .btn, .iconbtn, .fchip, .achip, .tagchip, .ia, button.primary, .tok, .wbrow, .theme-toggle {
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
html, body { margin: 0; background: var(--bg); }
body {
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* 外壳 */
.app { max-width: 720px; margin: 0 auto; min-height: 100vh; }
.topbar { display: flex; align-items: center; padding: 22px 24px 6px; }
.brand { font-weight: 680; font-size: 18px; letter-spacing: -0.2px; }
.badge {
  margin-left: auto; font-size: 11.5px; color: var(--good);
  background: var(--good-soft); border-radius: 4px; padding: 2px 8px;
}

/* 顶部导航:文字 + 细图标,选中=深字 + 细下划线 */
nav.tabs { display: flex; gap: 2px; padding: 4px 16px 0; border-bottom: 1px solid var(--line); }
nav.tabs button {
  display: flex; align-items: center; gap: 7px; background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 8px 14px 12px; font-size: 14px; font-family: var(--sans);
  border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 6px 6px 0 0;
}
nav.tabs button .ic { width: 16px; height: 16px; opacity: 0.85; }
nav.tabs button:hover { background: var(--hover); color: var(--text); }
nav.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
nav.tabs button[aria-selected="true"] .ic { opacity: 1; }

/* 底部留白给足 —— 内容贴着窗口底边看着憋屈(用户原话「不要贴底」)。 */
main { padding: 26px 24px 64px; }
.screen { display: none; }
.screen.active { display: block; }

/* 排版 */
.h { font-size: 19px; font-weight: 640; margin: 0 0 2px; letter-spacing: -0.2px; }
.sub { color: var(--muted); font-size: 13.5px; margin: 0 0 20px; }
.eyebrow { font-size: 12px; color: var(--faint); font-weight: 600; letter-spacing: 0.3px; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.anchor { font-size: 12.5px; color: var(--faint); margin-top: 14px; line-height: 1.6; }
.anchor b { color: var(--recast); font-weight: 600; }

.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }

.row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.row:last-child { border-bottom: none; }
/* 今日进度条:分子=今天已复现次数,分母=已练+还剩(自洽,不需另存「今天计划几个」)。 */
.today-progress { height: 4px; border-radius: 999px; background: var(--line); margin: 0 0 18px; transition: background .25s ease; }

/* 今天页 = 发射台:主 CTA 在最上,词表是预览(chip),不是任务清单。 */
.today-sub { display: flex; justify-content: center; margin-top: 8px; }
.linkbtn { background: none; border: none; color: var(--muted); font-size: 12.5px; cursor: pointer;
  padding: 4px 6px; border-radius: 5px; }
.linkbtn:hover { color: var(--text); background: var(--hover); }
.wordchips { display: flex; flex-wrap: wrap; gap: 8px; }
.wordchip { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 10px; border-radius: 7px;
  background: var(--surface); border: 1px solid var(--line); font-size: 14px; white-space: nowrap; }
.wordchip.new { border-color: var(--accent-soft); }
.wordchip.due { border-color: var(--recast-soft); }

.today-row { padding: 11px 0; border-bottom: 1px solid var(--line); }
.today-row:last-child { border-bottom: none; }
.today-word { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; }
.rating-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.rating { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 4px;
  border: 1px solid var(--line2); border-radius: 7px; background: var(--surface); color: var(--muted);
  font-size: 12.5px; font-weight: 500; cursor: pointer; transition: background .12s, color .12s; }
.rating:hover { color: var(--text); background: var(--hover); }
/* 掌握度四级递进(忘记→困难→记得→简单),各一色、且随主题变(旧版硬编码浅色 hex 在深色下失真,
   且「记得 / 简单」同为绿=看不出区别)。红→橙→绿→蓝,对齐通行 SRS 配色。 */
.rating.again { color: var(--bad); border-color: var(--bad); }
.rating.hard { color: var(--recast); border-color: var(--recast); }
.rating.good { color: var(--good); border-color: var(--good); }
.rating.easy { color: var(--accent); border-color: var(--accent); }
.rating:disabled { cursor: wait; opacity: 0.55; }
.review-rating { width: min(420px, 100%); margin: 18px auto 0; }
.jp { font-family: var(--jp); font-weight: 600; }
.gloss { color: var(--faint); font-size: 12.5px; }

/* 标签:Notion 低饱和软标签 */
.chip { font-size: 11.5px; padding: 2px 8px; border-radius: 4px; margin-left: auto; white-space: nowrap; background: var(--tag-bg); color: var(--muted); }
.chip.due { background: var(--recast-soft); color: var(--recast); }
.chip.new { background: var(--accent-soft); color: var(--accent); }
.chip.done { background: var(--good-soft); color: var(--good); }

/* 按钮 */
button.primary {
  display: block; width: 100%; margin-top: 18px; text-align: center; cursor: pointer;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 14.5px;
  border: none; border-radius: var(--r-sm); padding: 11px; font-family: var(--sans);
}
button.primary:hover { background: #2a6ac6; }
/* 今天的都练完了 → 主 CTA 降级(还能再练,但不该再抢注意力)。 */
button.primary.secondary { background: var(--surface); color: var(--muted); border: 1px solid var(--line2); }
button.primary.secondary:hover { background: var(--hover); color: var(--text); }
button.primary:disabled, .btn:disabled { opacity: 0.5; cursor: default; }
button.primary:disabled:hover { background: var(--accent); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line2); border-radius: var(--r-sm); padding: 6px 12px; font-size: 13px;
  background: var(--bg); color: var(--text); cursor: pointer; font-family: var(--sans);
}
.btn svg { flex: none; }
.btn:hover { background: var(--surface); }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.go { color: var(--good); border-color: #cfe6d8; }
.btn.amber { color: var(--recast); border-color: #ecd9b8; }
.iconbtn { background: var(--bg); border: 1px solid var(--line2); border-radius: var(--r-sm); padding: 8px 10px; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.iconbtn:hover { background: var(--surface); color: var(--text); }
.iconbtn.playing { color: var(--accent); border-color: var(--accent); } /* 整句播放中 = 停止态 */
.theme-toggle { margin-left: 10px; padding: 7px 9px; }

input, select {
  width: 100%; padding: 9px 11px; background: var(--bg); border: 1px solid var(--line2);
  border-radius: var(--r-sm); color: var(--text); font-size: 14px; font-family: var(--sans);
}
input::placeholder { color: var(--faint); }
label { display: block; font-size: 12.5px; color: var(--muted); margin: 12px 0 4px; }
/* 原生 select 在 WebKitGTK 下自绘控件(浅灰底 + 系统三角),深色主题里格外扎眼,
   而且它的内边距不受控,文字容易被自己的三角压掉。整块关掉外观,箭头自己画。 */
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23787774' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 14px;
  cursor: pointer;
}
[data-theme="dark"] select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239b9a97' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
}
select:hover { border-color: var(--muted); }
select:disabled { opacity: 0.5; cursor: default; }
/* 下拉展开的列表仍是原生的(改不了),但 color-scheme 已让它跟着主题走。 */

label select, label input { margin-top: 4px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

/* 图标:细线 */
svg.ic, .mic svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.play .tri, .iconbtn svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }
/* 主题切换是 line icon(月/日),需描边而非填充,否则太阳的圆心变实心点、射线消失 */
.theme-toggle svg.ic { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.play .tri { color: var(--accent); }
kbd { font-family: var(--mono); font-size: 11px; background: var(--surface); border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 4px; padding: 1px 6px; color: var(--muted); }

/* 查 · 解析 */
.inputline { display: flex; gap: 8px; align-items: center; margin-bottom: 18px; }
.inputline input { flex: 1; }
/* 行高 2.4 不是排版洁癖:振假名(rt)长在行盒上沿之外,2.05 时第二行的
   读音会怼进上一行 token 的下划线里(实机截图抓到)。视频屏两行预留 135px,
   2 × 50.4 + 卡片内边距 ≈ 133,仍装得下 —— 再调这里记得一起看 .vparse 的 height。 */
.parse { font-family: var(--jp); font-size: 21px; line-height: 2.4; min-height: 52px; }
/* nowrap:CJK 默认可在任意两字间断行,不锁住的话「亡くなり」这类多字 token 会被劈到两行。
   token 是最小可点/可读单位,必须整体换行。 */
.tok { cursor: pointer; padding: 1px 3px; border-radius: 5px; white-space: nowrap; }
.tok:hover { outline: 1px solid var(--line2); }
.tok ruby rt { font-size: 10px; color: var(--faint); font-weight: 400; }
/* 语法结构靠颜色:词性 = 文字色 */
.tok.pos-noun, .tok.pos-pron { color: var(--accent); }
.tok.pos-verb { color: var(--good); }
.tok.pos-adj { color: var(--recast); }
.tok.pos-adv { color: var(--adv); }
.tok.pos-particle, .tok.pos-aux { color: var(--faint); }
.tok.pos-symbol, .tok.pos-other { color: var(--muted); }
/* 生疏度 = 下划线(只标陌生 / 学习中;已掌握不标)*/
.tok.st-new { border-bottom: 2px solid var(--accent); }
.tok.st-learning { border-bottom: 2px solid var(--recast); }
/* 跟读高亮:正在读的 token(盖过其色,指示「读到哪」)*/
.tok rt .rt-acc { margin-left: 3px; color: var(--muted); font-weight: 400; }
sup.rt-acc { font-size: 9px; color: var(--faint); margin-left: 1px; vertical-align: super; }
.tok.speaking { background: var(--accent); color: #fff; border-radius: 5px; border-bottom-color: transparent; }
.tok.speaking rt .rt-acc, .tok.speaking sup.rt-acc { color: #fff; opacity: 0.85; }
.parse-wait { color: var(--faint); font-size: 13px; padding: 6px 2px; }

/* 语速滑块 */
.speedrow { display: flex; align-items: center; gap: 10px; margin: 10px 0 2px; font-size: 12px; }
.speedrow input[type="range"] { flex: 1; max-width: 220px; accent-color: var(--accent); }
.speedrow #tts-speed-val { font-variant-numeric: tabular-nums; min-width: 38px; }
.legend { display: flex; gap: 16px; margin-top: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
/* 色块两处图例共用:掌握分布用 .stack-legend,查页配色说明用 .legend。
   只写 .legend i 会让前者的色块没有宽高 —— 背景色无处可画,图例等于没有。 */
.legend i, .stack-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.sw.new { background: var(--accent); } .sw.learning { background: var(--recast); }
.sw.known { background: var(--good); } .sw.grammar { background: transparent; border: 1px dashed var(--accent); }
/* 查页词性图例色 */
.sw.pn { background: var(--accent); } .sw.pv { background: var(--good); }
.sw.pa { background: var(--recast); } .sw.pd { background: var(--adv); } .sw.pp { background: var(--faint); }
.lookup { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; background: var(--surface); }
.lookup .w { font-family: var(--jp); font-size: 21px; font-weight: 640; }
.lookup .rd { color: var(--muted); font-size: 13px; margin-left: 8px; }
.lookup .tag { font-size: 11px; background: var(--tag-bg); border-radius: 4px; padding: 1px 7px; color: var(--muted); margin-left: 8px; }
.lookup .def { margin: 11px 0; font-size: 14px; }
.lookup .senses { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 3px; }
.lookup .senses li { font-size: 14px; line-height: 1.5; }
.lookup .senses li::marker { color: var(--faint); font-size: 12px; }
.lookup .lex-entry + .lex-entry { margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); }
.lookup .lex-head { margin-bottom: 5px; color: var(--muted); font-family: var(--jp); font-size: 12px; }
.lookup .acts { display: flex; gap: 8px; margin-top: 14px; }
/* 用 CSS 定图标尺寸(与导航图标同机制)—— 仅靠内联 style 在部分 WebView 下会退回 svg 默认 300×150,
   把「收藏 / 发音」撑成巨型按钮。这里显式约束,按钮回到正常大小的紧凑药丸。 */
.lookup .acts .btn { flex: 0 0 auto; }
.lookup .acts .btn svg { width: 14px; height: 14px; }
.lookup .acts .btn svg.tri { fill: currentColor; stroke: none; }
.lk-accent { display: flex; align-items: center; gap: 10px; margin: 10px 0 2px; }
.lk-accent .pitch-strip { margin-top: 0; }

/* 练 · 说的那一刻 */
.crumb { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--muted); margin-bottom: 22px; }
.center { display: flex; flex-direction: column; align-items: center; }
.cue { font-size: 12.5px; color: var(--muted); text-align: center; }
.cue b { color: var(--recast); font-weight: 600; }
.prompt { font-family: var(--jp); font-size: 30px; font-weight: 600; text-align: center; margin: 10px 0 2px; letter-spacing: 0.5px; }
.ruby { font-family: var(--jp); color: var(--faint); font-size: 13px; text-align: center; }
.play { display: inline-flex; align-items: center; gap: 7px; margin: 16px auto 0; background: var(--bg); border: 1px solid var(--line2); color: var(--text); border-radius: 999px; padding: 7px 15px; font-size: 13px; cursor: pointer; }
.play:hover { background: var(--surface); }
.micwrap { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 30px; }
.mic { width: 76px; height: 76px; border-radius: 50%; border: none; cursor: pointer; background: var(--accent); color: #fff; display: grid; place-items: center; }
.mic:hover { background: #2a6ac6; }
.mic svg { width: 28px; height: 28px; stroke: #fff; stroke-width: 2; }
.mic.live { box-shadow: 0 0 0 5px var(--accent-soft); }
.miccap { font-size: 13px; color: var(--muted); }
.miccap b { color: var(--text); }

/* 反馈三态:浅色软底 + 左细边 */
.feedback { margin-top: 24px; }
.fb { border: 1px solid var(--line); border-left-width: 3px; border-radius: var(--r-sm); overflow: hidden; }
.fb .head { padding: 9px 14px; font-size: 12.5px; font-weight: 640; }
.fb .body { padding: 0 14px 14px; }
.fb.ok { border-left-color: var(--good); } .fb.ok .head { color: var(--good); }
.fb.recast { border-left-color: var(--recast); } .fb.recast .head { color: var(--recast); }
.fb.confirm { border-left-color: var(--accent); } .fb.confirm .head { color: var(--accent); }
.heard { font-family: var(--jp); font-size: 18px; margin: 2px 0 8px; }
.heard .wrong { color: var(--recast); text-decoration: line-through; text-decoration-color: #d9b98a; }
.heard .right { color: var(--good); font-weight: 640; }
.btnrow { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* 我的词 / 翻页 */
.rowhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.tools { display: flex; gap: 8px; }

/* 下拉菜单(导出格式)。用自绘菜单而不是 <select>:每种格式都需要一句说明,
   而 <option> 放不下说明 —— 「完整备份」和「词本 JSON」光看名字分不出差别,选错了是丢进度。 */
.menuwrap { position: relative; }
.menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 40;
  width: 272px; padding: 4px;
  background: var(--bg); border: 1px solid var(--line2); border-radius: var(--r);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
  display: flex; flex-direction: column;
}
[data-theme="dark"] .menu { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45); }
.menu button {
  display: block; width: 100%; text-align: left;
  padding: 7px 10px; border: 0; border-radius: var(--r-sm);
  background: none; color: var(--text); cursor: pointer; font-family: var(--sans);
}
.menu button:hover { background: var(--hover); }
.menu button b { display: block; font-size: 13px; font-weight: 560; }
.menu button span { display: block; font-size: 11.5px; color: var(--faint); margin-top: 1px; }
@media (max-width: 620px) {
  .rowhead { align-items: flex-start; gap: 10px; }
  .tools { justify-content: flex-end; flex-wrap: wrap; }
}
.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; }

/* 统计 */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 540px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; text-align: center; }
.tile .num { font-size: 25px; font-weight: 680; font-variant-numeric: tabular-nums; letter-spacing: -0.5px; }
.tile .lab { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* 快捷键表 */
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 20px; font-size: 13px; }
.keys > div { display: flex; align-items: center; gap: 6px; }
.keys span { color: var(--muted); }

/* ---- 我的词:工具栏 / 筛选 / 词条 ---- */
.ic.mini { width: 14px; height: 14px; }
.wb-toolbar { display: flex; gap: 10px; margin-bottom: 12px; }
.search { flex: 1; position: relative; display: flex; align-items: center; }
.search .ic.mini { position: absolute; left: 11px; color: var(--faint); pointer-events: none; }
.search input { padding-left: 33px; }
#wb-sort { width: auto; flex: none; color: var(--muted); }
.wb-filters { display: flex; gap: 7px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.fchip { font-size: 12.5px; padding: 4px 11px; border: 1px solid var(--line2); border-radius: 999px; background: var(--bg); color: var(--muted); cursor: pointer; font-family: var(--sans); }
.fchip:hover { background: var(--surface); color: var(--text); }
.fchip.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.vsep { width: 1px; height: 18px; background: var(--line2); margin: 0 4px; }
.wb-count { font-size: 12px; color: var(--faint); margin-bottom: 8px; }
.wb-batch { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding: 8px 12px; background: var(--accent-soft); border-radius: var(--r-sm); font-size: 12.5px; flex-wrap: wrap; }
.wb-batch #wb-sel-count { color: var(--accent); font-weight: 600; margin-right: auto; }
.wb-sel { width: 16px; height: 16px; margin-top: 3px; flex: none; accent-color: var(--accent); cursor: pointer; }
.wbrow.selected { background: var(--accent-soft); }
.wb-list { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }

/* 标记点选面板 */
.modal-ov { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); display: grid; place-items: center; z-index: 60; }
.modal { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; width: min(420px, 90vw); }
.modal-h { font-weight: 640; font-size: 15px; margin-bottom: 12px; }
.pchips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; max-height: 200px; overflow: auto; }
.pchip { font-size: 12.5px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line2); background: var(--bg); color: var(--muted); cursor: pointer; font-family: var(--sans); }
.pchip.on { background: var(--accent); color: #fff; border-color: transparent; }
.modal-row { margin-bottom: 12px; }
.modal-acts { display: flex; gap: 8px; align-items: center; }
.wb-empty { padding: 28px; text-align: center; color: var(--faint); font-size: 13px; }
.wbrow { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.wbrow:last-child { border-bottom: none; }
.wbrow:hover { background: var(--surface); }
.wb-main { flex: 1; min-width: 0; }
.wb-t { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 3px; }
.wb-t .jp { font-size: 15px; } .wb-t .rd { color: var(--muted); font-size: 12.5px; margin-left: 4px; }
.wb-t .mtag { font-size: 11px; padding: 1px 7px; border-radius: 4px; background: var(--tag-bg); color: var(--muted); margin-left: 4px; }
.wb-s { color: var(--faint); font-size: 12px; margin-top: 3px; }
.wb-ex { color: var(--muted); font-size: 12px; margin-top: 4px; font-family: var(--jp); }
.tag-add { font-size: 11px; padding: 1px 8px; border-radius: 4px; border: 1px dashed var(--line2); background: none; color: var(--faint); cursor: pointer; font-family: var(--sans); }
.tag-add:hover { color: var(--text); border-color: var(--muted); }
/* 「会复现 / 不复现」是**开关**,不是状态徽章。
   旧版它写着「学习中」,和上面那个 SRS 状态徽章一字不差地并排出现(一橙一绿),
   而两者说的根本是两件事:一个是掌握程度,一个是要不要排进「今天」。
   现在换成「复现」这套词(全应用一致),并加一个圆点让它一眼就是可切换的控件。 */
.learn-toggle { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; padding: 2px 9px 2px 7px;
  border-radius: 999px; border: 1px dashed var(--line2); background: var(--bg); color: var(--faint);
  cursor: pointer; white-space: nowrap; font-family: var(--sans); }
.learn-toggle i { width: 6px; height: 6px; border-radius: 50%; border: 1px solid currentColor; }
.learn-toggle.on { background: var(--good-soft); color: var(--good); border: 1px solid transparent; }
.learn-toggle.on i { background: currentColor; }
.learn-toggle:hover { border-color: var(--muted); color: var(--text); }
.learn-toggle.on:hover { color: var(--good); border-color: var(--good); }
.wb-tags { margin-top: 7px; display: flex; gap: 5px; flex-wrap: wrap; }
.tagchip { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; padding: 1px 6px 1px 8px; border-radius: 4px; background: var(--tag-bg); color: var(--muted); cursor: pointer; }
.tagchip:hover { color: var(--text); outline: 1px solid var(--line2); }
.tagx { border: none; background: none; color: var(--faint); cursor: pointer; font-size: 13px; line-height: 1; padding: 0; }
.tagx:hover { color: var(--recast); }
.wb-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.pill { font-size: 11px; padding: 2px 9px; border-radius: 4px; background: var(--tag-bg); color: var(--muted); white-space: nowrap; }
.pill.new { background: var(--accent-soft); color: var(--accent); }
.pill.learning { background: var(--recast-soft); color: var(--recast); }
.pill.known { background: var(--good-soft); color: var(--good); }
.jlpt { font-size: 11px; color: var(--faint); }
.rowacts { display: flex; gap: 4px; opacity: 0; transition: opacity 0.12s; }
.wbrow:hover .rowacts { opacity: 1; }
.ia { border: 1px solid var(--line2); background: var(--bg); border-radius: 5px; padding: 4px 6px; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.ia:hover { color: var(--text); background: var(--surface); }
.ia svg { width: 13px; height: 13px; }
@media (prefers-reduced-motion: reduce) { .rowacts { transition: none; } }

/* ---- 统计:图表 ---- */
.num .unit { font-size: 13px; color: var(--muted); margin-left: 1px; font-weight: 500; }
.statcard { margin-top: 14px; }
.ch { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.sm { font-size: 11px; }
.stack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--surface); }
.seg { height: 100%; }
.seg.new { background: var(--accent); } .seg.learning { background: var(--recast); } .seg.known { background: var(--good); }
.stack-legend { display: flex; gap: 18px; margin-top: 11px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 66px; }
.chart .bar { flex: 1; background: var(--accent-soft); border-radius: 3px 3px 0 0; min-height: 3px; }
.chart .bar.today { background: var(--accent); }
.chart-empty { font-size: 12.5px; color: var(--faint); margin: 0; align-self: center; }
.due-row { display: flex; gap: 28px; }
.due-row span { color: var(--muted); font-size: 13px; }
.due-row b { display: block; font-size: 21px; font-weight: 680; color: var(--text); font-variant-numeric: tabular-nums; }
.session-history { margin-top: 20px; }
.session-history .ch { margin-bottom: 6px; }
.session-history-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.session-history-row:last-child { border-bottom: 0; }
.session-history-target { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--jp); }
.session-history-row .faint { flex: none; font-variant-numeric: tabular-nums; }

/* 对话(阶梯④)*/
.dlg { display: flex; flex-direction: column; gap: 8px; min-height: 260px; max-height: 52vh; overflow-y: auto; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); margin: 12px 0; }
.dlg-empty { margin: auto; font-size: 13px; text-align: center; max-width: 70%; line-height: 1.6; }
.bubble { max-width: 80%; padding: 8px 12px; border-radius: 13px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; font-family: var(--jp); }
.bubble.assistant { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.bubble.pending { color: var(--faint); }
/* recast 提示条:挂在 AI 气泡下,轻标「错→对」,不打断对话流。 */
.recast-note { align-self: flex-start; max-width: 80%; margin: -2px 0 2px; padding: 5px 10px; font-size: 12px;
  line-height: 1.5; font-family: var(--jp); color: var(--muted); background: var(--accent-soft);
  border-radius: 9px; border-bottom-left-radius: 4px; }
.recast-note b { color: var(--accent); font-weight: 600; }
/* 脚手架对话进度条:从「练」过桥进来,标目标结构 + 轮次,末尾判「用出来了没」(不判对错)。 */
.scaffold-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin: 8px 0 0; padding: 8px 12px; font-size: 13px; line-height: 1.5; border-radius: 9px;
  font-family: var(--jp); background: var(--accent-soft); color: var(--text); border: 1px solid var(--line); }
.scaffold-bar.ok { border-color: var(--accent); }
.scaffold-bar .sc-tag { font-size: 11px; font-weight: 600; color: #fff; background: var(--accent); padding: 1px 7px; border-radius: 6px; margin-right: 4px; }
.scaffold-bar b { color: var(--accent); font-weight: 600; }
.scaffold-bar .sc-acts { display: flex; gap: 6px; flex: none; }
.dlg-input { display: flex; gap: 8px; align-items: stretch; margin-top: 10px; }
.dlg-input input { flex: 1; min-width: 0; font-family: var(--jp); }
/* 发送钮在行内:不撑满、不顶高(覆盖 .primary 的 width:100%/margin-top)*/
.dlg-input .primary { width: auto; margin-top: 0; flex: none; padding: 9px 24px; }
.dlg-anchors { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 0; font-size: 12px; }
.achip { font-size: 12px; padding: 3px 10px; border: 1px solid var(--line2); border-radius: 999px; background: var(--bg); color: var(--accent); cursor: pointer; font-family: var(--jp); }
.achip:hover { background: var(--accent-soft); border-color: transparent; }

/* 逐拍声调可视化 */
.pitch-lbl { font-size: 11px; margin-top: 8px; }
.pitch-strip { display: flex; gap: 6px; align-items: flex-end; margin-top: 4px; flex-wrap: wrap; }
.pm { position: relative; width: 22px; height: 48px; text-align: center; }
/* 点在上半区(高/中/低三档),假名固定在下方独立带 → 低音点不再压到假名上 */
.pm i { position: absolute; left: 50%; transform: translateX(-50%); width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.pm.h i { top: 2px; } .pm.m i { top: 12px; } .pm.l i { top: 22px; }
.pm.u i { top: 12px; background: var(--line2); }
.pm b { position: absolute; bottom: 0; left: 0; right: 0; height: 16px; line-height: 16px; font-size: 12px; font-weight: 500; font-family: var(--jp); }

.mic-note { font-size: 12px; text-align: center; margin: 16px 0 0; line-height: 1.5; }
.step-ctl { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 16px; }
.step-ctl #produce-in { flex: 1; font-family: var(--jp); }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 12px); opacity: 0; background: var(--text); color: var(--bg); font-size: 13px; padding: 9px 16px; border-radius: 7px; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: opacity 0.2s; } }

/* 开口练加载态:vocab-cloud 要等 DeepSeek 造句几秒,先转个圈,别让用户以为卡住了。 */
.spinner { display: inline-block; width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--line2); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

/* TTS「生成发音…」浮条:底部居中深色胶囊,合成时显、就绪即隐(与 toast 同风,内嵌小 spinner)。 */
.tts-loading { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 12px); opacity: 0;
  display: flex; align-items: center; gap: 8px; background: var(--text); color: var(--bg);
  font-size: 13px; padding: 8px 16px; border-radius: 7px; pointer-events: none; z-index: 50;
  transition: opacity 0.2s, transform 0.2s; }
.tts-loading.show { opacity: 1; transform: translate(-50%, 0); }
.tts-loading .spinner { width: 14px; height: 14px; border-width: 2px;
  border-color: rgba(150, 150, 150, 0.4); border-top-color: currentColor; }

/* 查 · 这句里还没掌握的词(快捷入口)。长句里逐个点太慢,收藏效率决定 SRS 喂不喂得饱。 */
.unknowns { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.unk-head { display: flex; align-items: center; gap: 10px; }
.unk-head .btn.sm { margin-left: auto; }
.unk-list { display: flex; flex-wrap: wrap; gap: 6px; }
.unkchip { font-family: var(--jp); font-size: 14px; padding: 3px 9px; border-radius: 6px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line2); color: var(--text); }
.unkchip:hover { background: var(--hover); border-color: var(--accent); }
/* 选中态要一眼可辨(批量收藏的前提是看得清选了哪些)。 */
.unkchip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* 对话页无 key 时的引导块:说清「为什么要 key」「其余功能不受影响」「去哪拿」。 */
.nokey { border: 1px solid var(--line2); border-radius: var(--r); padding: 14px 16px; margin-bottom: 14px;
  background: var(--surface); font-size: 13px; line-height: 1.6; }
.nokey b { color: var(--text); }
.nokey p { margin: 6px 0 0; color: var(--muted); }
.nokey .btn { margin-top: 10px; }

/* 语速 / 图例:二级信息收进 <details>,不常驻占行。 */
.speeddet, .legenddet { margin: 10px 0 2px; font-size: 12px; }
.speeddet > summary, .legenddet > summary { cursor: pointer; list-style: none; padding: 2px 0; }
.speeddet > summary::-webkit-details-marker, .legenddet > summary::-webkit-details-marker { display: none; }
.speeddet > summary::before, .legenddet > summary::before { content: "▸ "; }
.speeddet[open] > summary::before, .legenddet[open] > summary::before { content: "▾ "; }
.speeddet input[type="range"] { width: min(240px, 100%); margin-top: 6px; accent-color: var(--accent); }
.legenddet .legend { margin-top: 6px; }

.wb-count-row { display: flex; align-items: center; gap: 10px; }
.wb-count-row .wb-count { flex: 1; }

/* ---- 原先写在 style="…" 里的样式 -------------------------------------------
   Tauri 会往 CSP 注入 style nonce,而 CSP3 规定一旦出现 nonce,'unsafe-inline'
   就作废 —— 于是所有 style 属性(静态 HTML 里的也算)被整个丢掉,静默退回默认值。
   全部搬到这里。**别再往模板字符串里写 style=**,它在这个 WebView 里永远不生效。 */

.icon-defs { position: absolute; }
input[type="checkbox"], input[type="radio"] { width: auto; }
.rowhead .h { margin: 0; }
.tools { align-items: center; }

/* 设置页:字段下方的补充说明 */
.field-note { font-size: 12px; margin: 2px 0 0; }
/* 设置页的卡片是竖着堆的,靠相邻兄弟拉开距离(统计页的 .statcard 同理) */
#screen-settings .card + .card { margin-top: 14px; }
#screen-settings .card > p.eyebrow { margin: 0 0 10px; }

/* 同步卡片 */
.note-before { font-size: 12px; margin: 0 0 10px; }
.note-after { font-size: 12px; margin: 10px 0 0; }
.sync-who-line { font-size: 13px; margin: 0 0 8px; }
#sync-card .row { gap: 8px; margin-top: 10px; }
#sync-card .row-check { margin-top: 0; }

/* 查:声调条 / 逐拍图例 */
.lk-accent-lbl { font-size: 11px; }
#pitch-host { margin-top: 10px; }
.pitch-note { font-size: 11px; margin-top: 6px; }

/* 练:反馈条正文 + 回显确认的输入框 */
.fb-line { font-size: 13px; }
.fb.confirm #v-type { flex: 1; }

/* 弹窗主按钮:不吃 input/select 那条 width:100% */
.modal-acts .primary { width: auto; margin: 0; padding: 8px 20px; }

/* 标记选择器 */
.tagpick-empty { font-size: 12px; }
.tagpick-hint { font-size: 11px; margin-top: 8px; }

/* 今天 */
.today-empty { padding: 6px 0; }
#today-list .eyebrow { margin: 0 0 8px; }
#today-expand { margin-top: 8px; }

/* 我的词:状态徽章挪进词条行(右栏两个徽章竖排会挖出一个 L 形空洞),
   声调并进读音 —— 它此前是个和「名词」同重量的独立 chip,而且绝大多数是 ⓪。 */
.wb-t .pill { margin-left: 2px; }
.wb-t .rd .acc { margin-left: 3px; color: var(--faint); font-size: 0.85em; }
.wb-side { justify-content: flex-start; }

/* 练:「退出这一组」是操作,不是面包屑的一节 —— 推到最右并给它自己的形 */
.crumb .quit { margin-left: auto; border: 1px solid var(--line2); border-radius: var(--r-sm); padding: 3px 10px; }
.crumb .quit:hover { border-color: var(--muted); }
#step-progress { margin: -8px 0 20px; }
.micwrap { margin-top: 24px; }

/* 查的空态:首屏不该只有一句提示 */
.parse-idle { text-align: center; padding: 18px 0 8px; }
.parse-idle .idle-h { font-size: 15px; margin: 0 0 4px; color: var(--text); }
.parse-idle .idle-h b { color: var(--accent); }
.parse-idle .idle-s { font-size: 12.5px; color: var(--muted); margin: 0 0 14px; }

/* 今天:词条 chip 的图例 —— 蓝框 = 新词、灰橙框 = 复现,此前只有颜色没有说明 */
.chip-legend { margin-top: 10px; font-size: 11.5px; }
.sw.wc-new { background: var(--accent-soft); border: 1px solid var(--accent); }
.sw.wc-due { background: var(--surface); border: 1px solid var(--line2); }

/* 今天:主 CTA 通栏实心蓝会压过页面上其他一切;收成内容宽度即可 */
#today-start { width: auto; min-width: 260px; margin-left: auto; margin-right: auto; padding: 11px 32px; }

/* ---- 看 · 视频跟读 ---------------------------------------------------------
   几何是量过的(见 docs/video-study.md):窗口内高 680、导航 46、标题行 31,
   可用约 583px。控制条 44 + 进度 24 + 动作行 44 + 解析区 135 → 视频封顶 48vh。
   **解析常显**,所以解析区高度必须固定 —— 字幕一句 1 行一句 2 行,
   不固定的话视频会随字幕长短上下弹,整个界面看起来就是坏的。 */

/* 还没开片:拖放区 */
.vdrop { border: 1.5px dashed var(--line2); border-radius: var(--r); padding: 34px 20px;
  text-align: center; color: var(--muted); transition: border-color 0.15s, background 0.15s; }
.vdrop.over { border-color: var(--accent); background: var(--accent-soft); }
.vdrop-main { font-size: 15px; color: var(--text); margin: 0 0 8px; }
.vdrop code { font-family: var(--mono); font-size: 12px; background: var(--tag-bg);
  padding: 1px 4px; border-radius: 3px; }
.vrecent { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.vrecent button { background: none; border: none; color: var(--accent); cursor: pointer;
  font: inherit; font-size: 13px; padding: 2px 6px; border-radius: var(--r-sm); }
.vrecent button:hover { background: var(--hover); }
/* 单删 × 平时安静,悬停才显眼;清空是最末一行的小灰字 */
.vrecent .ritem { display: flex; align-items: center; gap: 2px; }
.vrecent .rdel { color: var(--faint); font-size: 12px; padding: 2px 5px; }
.vrecent .rdel:hover { color: var(--text); }
.vrecent .rclear { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* 视频本体。position:relative 是给字幕列表当定位父级用的 */
.vwrap { position: relative; background: #000; border-radius: var(--r); overflow: hidden;
  display: grid; place-items: center; }
.vwrap video { display: block; width: 100%; object-fit: contain; background: #000; }

/* **视频高度不写 vh,让它吃掉剩下的空间。**
   初版写 `max-height: 48vh`,按「可用 583px」算的 —— 那笔账错了:
   实测视频上方的 chrome 是 **206px**(我漏了 tabs 之上那 85px 的标题栏),
   于是 900x680 的默认窗口纵向溢出 170px、还顺带逼出一条竖滚动条
   (那 28px 的「横向溢出」就是它,不是内容真的太宽)。
   固定 vh 治不了这个 —— 换个窗口高度就又错一遍。
   flex 填充是对的解法:视频拿走剩余空间,**任何窗口尺寸都不溢出**,
   而且窗口越大视频越大,不用调任何数字。 */
.app.app-video { height: 100vh; display: flex; flex-direction: column; }
/* `.app` 平时是 block —— 只设 height 不设 display:flex 的话子元素照样溢出到页面外
   (第一次改完实测:视频反而长到 378px,纵向溢出 360px)。flex 链必须从 .app 起。 */
.app.app-video main,
.app.app-video #screen-video,
.app.app-video #vd-stage { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
/* 视频屏是 100vh 定高排版:底部留白单独给一档小的 —— 64px 会从视频高度里扣 */
.app.app-video main { padding-bottom: 18px; }
.app.app-video .vwrap { flex: 1 1 auto; min-height: 120px; }
/* 视频**绝对定位铺满** wrap,靠 object-fit 加黑边。
   原来写的是 `height: 100%` —— 在 `display:grid` + auto 行高里那是空转
   (百分比高度撑不住不确定的包含块),于是 <video> 按自身尺寸居中浮着:
   wrap 一变高矮,画面就上下漂。绝对定位之后画面框永远等于 wrap。 */
.app.app-video .vwrap video { position: absolute; inset: 0; width: 100%; height: 100%; }

/* 进度条:窄、无手柄光晕,和应用其它 range 一致 */
/* 自绘进度条。原生 range(哪怕给了 accent-color)会把轨道按滑块半径**往里缩**,
   于是「0% 的填充」并不在容器左边缘 —— 和上面视频的左边对不齐。
   轨道用渐变自己画,填充比例走 CSS 变量 --p(由 CSSOM 写,不是 style 属性)。 */
.vseek { -webkit-appearance: none; appearance: none; width: 100%; height: 14px;
  margin: 6px 0 0; background: transparent; flex: none; cursor: pointer; }
.vseek::-webkit-slider-runnable-track { height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--accent) calc(var(--p, 0) * 100%), var(--line2) 0); }
.vseek::-webkit-slider-thumb { -webkit-appearance: none; appearance: none;
  width: 12px; height: 12px; border-radius: 50%; background: var(--accent);
  border: 2px solid var(--bg); margin-top: -5px; }
.vseek:hover::-webkit-slider-thumb { transform: scale(1.15); }

/* 「看」屏自己的查词卡 —— 「查」屏那个 #lookup 在别的 section 里,用不了 */
.vlookup { flex: none; margin-top: 10px; }

/* 和上面的进度条隔开一点 —— 贴着的话拖动进度条容易误触下面的按钮 */
.vctl { display: flex; align-items: center; gap: 6px; flex: none; margin-top: 8px; }
/* **不要 flex-wrap** —— 里面有个 `flex: 1` 的间隔件,一开 wrap 它就吃掉整行,
   把后面的控件全挤到新行:实测工具条从 32px 撑到 146px。
   当初加 wrap 是为了治「横向溢出 28px」,而那 28px 其实是竖滚动条,不是工具条太宽
   (实测内容宽 672 = 可见宽 672,本来正好放得下)。治错了病。 */
.vctl .vspacer { flex: 1; }
.vtime { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.vsel { font: inherit; font-size: 12px; padding: 5px 22px 5px 8px; color: var(--muted);
  /* 全局有一条 `input, select { width: 100% }` —— 不覆盖的话这两个下拉框
     会把控制条撑满(实机截图里 1.0× 和「全解析」各占三百多像素)。 */
  width: auto; flex: none; background-size: 12px; background-position: right 6px center; }
/* 自动暂停开着时按钮呈按下态 —— 它是个开关,得看得出来 */
.vctl .iconbtn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent);
  border-color: var(--accent); }

/* 解析区:固定预留两行文本,短句留白不动布局。
   140 = 2 行 × (21px × 行高 2.4) + 卡片上下内边距 36px,向上取整 ——
   给少了翻页会退化成一行一页(行高在 .parse,两处联动)。 */
.vparse { height: 140px; margin-top: 10px; flex: none; }
/* **是 height 不是 min-height。** min-height 只是下限 —— 长句照样把框撑高
   (实测撑到 180px),于是视频被顶上去,而且「装不下」这个条件永远不成立、
   翻页永远不出现。固定高度 + overflow:hidden,装不下的翻页。 */
/* **不要 display:flex。** token 是 inline span,靠正常的行内流换行;
   一旦父级变成 flex,它们就成了 flex item 排成一行,长句直接溢出到屏外
   (实机截图里「セブン-イレブンは…」被切掉了右半句)。
   垂直居中不值得用它换 —— 顶对齐反而让第一行位置固定。 */
/* 只振假名 / 只原文 两档 —— 降密度靠隐藏,不重新渲染 */
.vparse.dense-ruby .tok { text-decoration: none; color: var(--text); }
.vparse.dense-ruby .rt-acc { display: none; }
.vparse.dense-plain rt { display: none; }
.vparse.dense-plain .tok { text-decoration: none; color: var(--text); }
.vnote { margin: 8px 0 0; }
/* ── 视频下方所有「会出现/消失」的行:只隐内容,不塌高度 ─────────────────
   视频是 flex:1(吃掉剩余空间),下面任何一行塌掉,视频就会变大变小;
   而 WebKitGTK 在视频元素尺寸变化时会留**重影**(两帧不同尺寸叠在一起,
   实机截图抓到过)。主犯恰恰是「正在解码…」那行提示 —— waiting 900ms 后
   出现、playing 时消失,每次起播/seek 视频都要跳两次。 */
.app-video .vnote { height: 24px; line-height: 24px; margin: 6px 0 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* **height 不是 min-height** —— min-height 时可见态比预留高 2px,
   视频还是会 160↔158 地跳(实测抓到)。定死一行,超长省略号。 */
.app-video .vnote[hidden] { display: block !important; visibility: hidden; }

/* 草稿条同理:draft 模式下按句出现/消失 → 改成 ghost(占位不可见)。
   min-height 钉住「确认按钮行」和「改一下的输入行」的高度差。 */
.vdraft { min-height: 46px; }
.vdraft.ghost { visibility: hidden; }
/* 收起态(默认):占位、高度都不变,但琥珀框整个安静下来 ——
   每句都顶着一个亮框问「对吗?」太吵,收起后只剩一行小字。 */
.vdraft.quiet { border-color: transparent; background: none; }

/* 「重新识别」只在草稿模式出现 —— 和「机器听写」同一层琥珀色语义,
   别混进旁边收藏/换片那排中性按钮里 */
#vd-redo { color: var(--recast); border-color: var(--recast); }

/* 「收藏这句」的已收藏态 —— 看得出这句已经在单词本里,再点是取消 */
#vd-save.saved { color: var(--accent); border-color: var(--accent); }

/* 听写进度条(在没字幕的空态盒子里):出现时别把盒子撑高 */
#vd-asr-prog { min-height: 30px; display: block; }
#vd-asr-prog[hidden] { display: block !important; visibility: hidden; }

.vact { display: flex; gap: 8px; margin-top: 10px; flex: none; }

/* 陌生词行:**定高**,不是 min-height。
   实测短句 63px、长句 97px(chip 换行)—— 高度一变,`flex:1` 的视频就跟着
   缩放,换一句画面大小就变一次,比一条滚动条难受得多。
   定高 + chip 横向滚(而不是换行),高度就钉死了。 */
.app-video #vd-unknowns { height: 66px; margin-top: 8px; flex: none; overflow: hidden; }
.app-video #vd-unknowns .unk-head { margin-bottom: 4px; }
.app-video #vd-unknowns .unk-list { display: flex; flex-wrap: nowrap; gap: 6px;
  overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; }
.app-video #vd-unknowns .unkchip { flex: none; }
.app-video #vd-unknowns[hidden] { display: block !important; visibility: hidden; }

/* 字幕列表:不常驻,点开盖在视频上。滚动容器自己滚,页面不横向滚。 */
.vlist { position: relative; margin-top: 10px; max-height: 30vh; overflow-y: auto; flex: none;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.vlist-row { display: flex; gap: 10px; padding: 7px 12px; cursor: pointer;
  border-bottom: 1px solid var(--line); font-size: 13px; }
.vlist-row:last-child { border-bottom: none; }
.vlist-row:hover { background: var(--hover); }
.vlist-row.on { background: var(--accent-soft); }
.vlist-row .at { font-family: var(--mono); color: var(--faint); font-size: 12px;
  white-space: nowrap; flex: none; }
.vlist-row .tx { font-family: var(--jp); color: var(--text); }
.vlist-row .who { color: var(--faint); }

/* 很矮的窗口:解析区也让一点(两行变一行半),否则视频会被压到 min-height 之下 */
@media (max-height: 560px) {
  .vparse { height: 92px; }
}

/* 跟读区:点「跟读这句」才出现。声调对照两行(标准 / 你的发音)—— 只对照不判分 */
.vshadow { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: var(--r); background: var(--surface); }
.vsh-head { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.vsh-row { display: flex; gap: 8px; flex-wrap: wrap; }
#vd-pitch { margin-top: 10px; }

/* 「跳回那一刻」—— 只有视频来源的词才有,而且确认过文件还在才露出来 */
.jumpbtn { margin-left: 8px; background: none; border: 1px solid var(--line2);
  border-radius: var(--r-sm); color: var(--accent); cursor: pointer;
  font: inherit; font-size: 11px; padding: 1px 7px; }
.jumpbtn:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent); }
.jumpbtn:disabled { color: var(--faint); cursor: default; }
.app-video .vsub { margin-bottom: 8px; flex: none; }
.app-video #screen-video .h { flex: none; }

/* 控制条里少数几个线条稿图标(重听 / 字幕列表)。
   `.iconbtn svg` 默认是 fill-only,线条稿在那套规则下画不出来。 */
.iconbtn svg.ln { fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }

/* 没有字幕时的空态。**不是装饰** —— 没字幕这一屏一多半功能是死的,
   得把「为什么」和「怎么办」摆在视线正中,而不是空框 + 底部小灰字。 */
.vnosub { margin-top: 10px; padding: 14px 16px; border: 1px dashed var(--line2);
  border-radius: var(--r); background: var(--surface); flex: none; }
.vnosub.over { border-color: var(--accent); background: var(--accent-soft); }
.vnosub .h2 { font-size: 14px; color: var(--text); margin: 0 0 6px; }
.vnosub p { margin: 0 0 4px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.vnosub code { font-family: var(--mono); font-size: 11.5px; background: var(--tag-bg);
  padding: 1px 4px; border-radius: 3px; }

/* 没字幕 → 依赖句子的控件一律禁用。**看得出来是禁用的** ——
   一个能点却什么都不发生的按钮,比一个灰掉的按钮糟得多。 */
.vctl .iconbtn:disabled, .vact .btn:disabled { opacity: 0.4; cursor: not-allowed; }
.vctl .iconbtn:disabled:hover { background: var(--bg); color: var(--muted); }

/* 机器听写的进度条 */
.asr-bar { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; margin: 8px 0 4px; }
.asr-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.25s ease; }
.vasr-row { margin-top: 12px; align-items: center; }

/* 草稿条:机器听写的句子在确认之前顶着它。
   用 recast 的琥珀色(和「就差一点」同一层语义:不是错,但还没定)。 */
.vdraft { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: none;
  margin-top: 10px; padding: 7px 10px; border: 1px solid var(--recast);
  border-radius: var(--r-sm); background: var(--recast-soft); }
.vdraft .dtag { font-size: 11px; color: var(--recast); border: 1px solid var(--recast);
  border-radius: 3px; padding: 0 5px; white-space: nowrap; }
.vdraft .dtxt { font-size: 12.5px; color: var(--text); flex: 1; }
.vdraft .dinput { flex: 1; min-width: 200px; font-family: var(--jp); font-size: 14px;
  padding: 5px 8px; width: auto; }

/* 字幕列表里没确认的草稿条:左边一道琥珀色标记 */
.vlist-row.draft { border-left: 2px solid var(--recast); }

/* 解析区翻页:长句装不下时翻,不裁掉也不撑高(撑高会把视频顶上去)。 */
.vparse-wrap { position: relative; flex: none; }
.vparse { overflow: hidden; }
.vparse-inner { will-change: transform; }
.vpager { position: absolute; right: 8px; bottom: 6px; display: flex; align-items: center; gap: 4px; }
.vpager .iconbtn { padding: 3px 5px; }
.vpager .iconbtn svg { width: 11px; height: 11px; }
.vpager #vd-pgup svg { transform: rotate(180deg); }
.vpager span { font-family: var(--mono); font-size: 11px; }

/* 卡拉OK:正在读的那个词。只用底色不动文字色 —— 词性配色还得能看见 */
.vparse .tok.speaking { background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }

/* ── 视频大小:拖柄 ─────────────────────────────────────────────────────────
   此前视频高度只能靠拖整个窗口来变(flex:1 吃剩余空间)。拖柄直接换算:
   **往上拖 = 视频小、解析区多出几行**(空间不是凭空消失,是换给了解析 ——
   这正是想缩小视频的人要的东西)。双击恢复自动。 */
.vresize { height: 12px; margin: 2px 0 0; cursor: ns-resize; flex: none;
  display: flex; align-items: center; justify-content: center; touch-action: none; }
.vresize i { width: 44px; height: 3px; border-radius: 2px; background: var(--line2);
  transition: background 0.15s; }
.vresize:hover i, .vresize.on i { background: var(--accent); }

/* 自定义高度模式:视频定高,解析区吃掉剩余空间 */
#vd-stage.vsized .vwrap { flex: 0 0 auto; }
#vd-stage.vsized .vparse-wrap { flex: 1 1 auto; min-height: 140px;
  display: flex; flex-direction: column; }
#vd-stage.vsized .vparse { height: auto; flex: 1 1 auto; }

/* ── 句尾自动暂停:要看得出是「停在句尾等你」,不是卡死 ──
   播放键呼吸,提示行写明下一步。 */
@keyframes vpulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(91, 155, 240, 0); }
  50% { box-shadow: 0 0 0 4px var(--accent-soft); }
}
.vctl #vd-play.pulse { color: var(--accent); border-color: var(--accent);
  animation: vpulse 1.6s ease-in-out infinite; }

/* ── 纯音频模式(mp3 / m4a / wav…)─────────────────────────────────────────
   没有画面就别供着一块黑框:视频区塌成一条窄条(图标 + 文件名),
   省下的空间全给解析区 —— 音频学习恰恰更依赖文本。拖柄也没意义,藏掉。 */
#vd-stage.audio-mode .vwrap { flex: 0 0 56px; min-height: 56px;
  background: var(--surface); border: 1px solid var(--line); }
#vd-stage.audio-mode .vwrap video { display: none; }
#vd-stage.audio-mode .vresize { display: none; }
#vd-stage.audio-mode .vparse-wrap { flex: 1 1 auto; min-height: 140px;
  display: flex; flex-direction: column; }
#vd-stage.audio-mode .vparse { height: auto; flex: 1 1 auto; }
.vaudio { display: flex; align-items: center; justify-content: center; gap: 10px;
  height: 100%; color: var(--muted); font-size: 13px; }
.vaudio svg { width: 18px; height: 18px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.vaudio span { max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
