:root {
  --bg: #f6f5f2;
  --panel: #ffffff;
  --panel-2: #f0eeea;
  --text: #1f1d1a;
  --muted: #77726b;
  --line: #e2ded7;
  --accent: #c2410c;
  --accent-soft: #fde7da;
  --active: #fff4d6;
  --active-line: #e8b931;
  --good: #15803d;
  --warn: #b45309;
  --star: #e8a400;
  --particle: #2563eb;
  --aux: #0f766e;
  --tk-line: #cfc8bc;
  --miss: #fde2e2;
  --miss-text: #b91c1c;
  --radius: 10px;
  --jp: "Yu Gothic UI", "Yu Gothic", "Meiryo", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --zh: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161514;
    --panel: #1f1e1c;
    --panel-2: #2a2826;
    --text: #ece9e4;
    --muted: #9b958c;
    --line: #34312d;
    --accent: #fb923c;
    --accent-soft: #3a2518;
    --active: #2f2a1a;
    --active-line: #d4a72c;
    --good: #4ade80;
    --warn: #fbbf24;
    --particle: #7cb2ff;
    --aux: #3fcfbf;
    --tk-line: #4f4a43;
    --miss: #4a1f1f;
    --miss-text: #fca5a5;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--zh);
  font-size: 15px;
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
button {
  font: inherit;
  color: inherit;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
}
button:hover { border-color: var(--muted); }
button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
[lang="ja"], .jp { font-family: var(--jp); }

/* ---------- 导航：电脑左侧栏 / 手机底栏 ---------- */
:root { --sb-w: 188px; --sb-mini: 60px; --tabbar-h: 56px; }
.sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sb-w); z-index: 20;
  display: flex; flex-direction: column; background: var(--panel); border-right: 1px solid var(--line);
  padding: 14px 10px; overflow-y: auto; transition: width .15s; }
.brand { font-weight: 700; color: var(--text); font-size: 17px; padding: 2px 8px 10px; white-space: nowrap; }
.brand .b-mini { display: none; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sb-group { font-size: 12px; color: var(--muted); padding: 12px 10px 4px; white-space: nowrap; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px;
  color: var(--text); white-space: nowrap; position: relative; }
.sidebar nav a i { font-style: normal; width: 22px; text-align: center; flex: none; font-size: 16px; }
.sidebar nav a:hover { background: var(--panel-2); }
.sidebar nav a.cur { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sidebar .nav-due { margin-left: auto; }
.sidebar .user-menu { margin-top: auto; padding-top: 10px; }
.sidebar .um-pop { right: auto; left: 0; top: auto; bottom: 100%; margin: 0 0 6px; }
main { max-width: 1400px; margin: 0 auto; padding: 16px; }
body:not(.logged-out) { padding-left: var(--sb-w); }
/* 学习页：侧栏收成图标栏 */
body.sb-mini .sidebar { width: var(--sb-mini); padding: 14px 6px; }
body.sb-mini .sidebar .brand .b-full, body.sb-mini .sidebar nav a span, body.sb-mini .sb-group, body.sb-mini .um-name { display: none; }
body.sb-mini .sidebar .brand .b-mini { display: inline; }
body.sb-mini .sidebar nav a { justify-content: center; padding: 9px 0; }
body.sb-mini .sidebar .nav-due { position: absolute; top: 0; right: 2px; margin: 0; font-size: 10px; min-width: 16px; }
body.sb-mini .sb-group { display: block; font-size: 0; height: 1px; padding: 0; margin: 8px 10px; background: var(--line); }
body.sb-mini:not(.logged-out) { padding-left: var(--sb-mini); }
body.logged-out .sidebar, body.logged-out .tabbar, body.logged-out .subtabs { display: none; }
.tabbar, .subtabs { display: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
code { background: var(--panel-2); padding: 1px 6px; border-radius: 4px; font-size: 13px; }
pre { background: var(--panel-2); padding: 12px; border-radius: 8px; overflow-x: auto; }

/* ---------- 视频列表 ---------- */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.video-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; color: var(--text); display: block;
}
.video-card:hover { border-color: var(--accent); }
.video-card .thumb { aspect-ratio: 16/9; background: var(--panel-2) center/cover; position: relative; }
.vstar { background: rgba(0,0,0,.45); color: #fff; border: 0; border-radius: 50%; width: 34px; height: 34px;
  padding: 0; font-size: 18px; line-height: 34px; position: absolute; top: 8px; right: 8px; }
.vstar.on { color: var(--star); background: rgba(0,0,0,.55); }
.tabs-right { margin-left: auto; display: flex; align-items: center; padding-right: 8px; }
.tabs-right .vstar { position: static; width: auto; height: auto; border-radius: 8px; padding: 3px 10px;
  font-size: 13px; line-height: 1.5; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.tabs-right .vstar.on { color: var(--star); }
.tabs-right .vdone { border-radius: 8px; padding: 3px 10px; margin-right: 6px; font-size: 13px; line-height: 1.5;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); cursor: pointer; }
.tabs-right .vdone.on { color: var(--good); border-color: var(--good); font-weight: 600; }
.diff-tag { position: absolute; right: 8px; bottom: 8px; color: #fff; font-size: 11px; font-weight: 700;
  padding: 1px 7px; border-radius: 4px; line-height: 18px; background: rgba(0,0,0,.6); }   /* 压在缩略图上，不随主题变 */
.diff-tag.lv-N5 { background: #15803d; } .diff-tag.lv-N4 { background: #2563eb; }
.diff-tag.lv-N3 { background: #b45309; } .diff-tag.lv-N2 { background: #b91c1c; }
.sort-tabs { margin-left: auto; display: flex; gap: 4px; }
.sort-tabs button { font-size: 13px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel); color: var(--muted); cursor: pointer; }
.sort-tabs button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.done-tag { position: absolute; left: 8px; bottom: 8px; background: #15803d; color: #fff; font-size: 11px;
  font-weight: 700; padding: 1px 7px; border-radius: 4px; line-height: 18px; }
.video-card .mine { margin-top: 2px; color: var(--accent); }
.video-card .body { padding: 10px 12px; }
.video-card .title { font-weight: 600; font-family: var(--jp); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.new-tag { position: absolute; top: 8px; left: 8px; background: var(--accent); color: #fff; font-size: 11px;
  font-weight: 700; letter-spacing: .5px; padding: 1px 7px; border-radius: 4px; line-height: 18px; }
.ch-link { cursor: pointer; }
.ch-link:hover { color: var(--accent); text-decoration: underline; }

/* ---------- 首页分区 / 博主 ---------- */
.home-sec + .home-sec { margin-top: 26px; }
.sec-h { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 12px; }
.sec-h h2 { font-size: 18px; margin: 0; }
.sec-h .more { margin-left: auto; font-size: 14px; }
.back { font-size: 14px; }
.crumb { margin: 0 0 10px; }
.channel-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.channel-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.channel-card:hover { border-color: var(--accent); }
.cc-body { min-width: 0; flex: 1; }
.cc-name { font-weight: 700; font-family: var(--jp); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-name + .small .lv { color: var(--accent); }
.cc-intro { margin-top: 4px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.avatar { --s: 56px; width: var(--s); height: var(--s); flex: none; border-radius: 50%; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft);
  color: var(--accent); font-weight: 700; font-size: calc(var(--s) * .42); border: 1px solid var(--line); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.channel-head { display: flex; gap: 18px; align-items: flex-start; padding: 18px; margin-bottom: 22px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.ch-info { min-width: 0; flex: 1; }
.ch-info h1 { margin: 0 0 2px; font-size: 22px; font-family: var(--jp); overflow-wrap: anywhere; }
.ch-level { display: inline-block; margin-top: 8px; font-size: 13px; padding: 1px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); }
.ch-intro { margin: 10px 0 0; max-width: 760px; }
.ch-desc { margin-top: 8px; }
.ch-desc summary { cursor: pointer; }
.ch-desc p { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); max-width: 760px; }

.progress { height: 4px; background: var(--panel-2); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--good); }
.progress > i.seen { background: var(--accent); }
.video-card .seen { color: var(--accent); }

/* ---------- 观看记录 ---------- */
.hist-clear { margin-left: auto; font-size: 13px; }
.hist-day { margin: 18px 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.hist-day:first-child { margin-top: 0; }
.hist-item { display: flex; gap: 12px; align-items: center; padding: 8px; margin-bottom: 8px; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.hist-item:hover { border-color: var(--accent); }
.hist-thumb { flex: none; width: 168px; aspect-ratio: 16/9; border-radius: 6px; background: var(--panel-2) center/cover; position: relative; }
.hist-thumb span.done { background: #15803d; }   /* 压在缩略图上，不随主题变 */
.hist-thumb span { position: absolute; right: 4px; bottom: 4px; background: rgba(0,0,0,.65); color: #fff; font-size: 11px;
  padding: 0 5px; border-radius: 3px; line-height: 17px; }
.hist-body { flex: 1; min-width: 0; }
.hist-body .title { font-weight: 600; font-family: var(--jp); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-body .progress { margin-top: 6px; max-width: 420px; }
.hist-del { flex: none; background: none; border: 0; color: var(--muted); font-size: 15px; padding: 6px 8px; }
.hist-del:hover { color: var(--accent); }

.badge { display: inline-block; font-size: 12px; padding: 0 6px; border-radius: 4px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); line-height: 18px; }
.badge.N5 { color: #2563eb; } .badge.N4 { color: #0d9488; } .badge.N3 { color: #ca8a04; }
.badge.N2 { color: #ea580c; } .badge.N1 { color: #dc2626; }
.badge.口语, .badge.俚语 { color: #9333ea; }

/* ---------- 学习页 ---------- */
/* 电脑端：学习页占满一屏，各区域内部滚动。左：视频 + 控制条；右：上 逐句列表 / 下 本句讲解（中间可拖动） */
.study { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px;
  height: calc(100vh - 32px); height: calc(100dvh - 32px); }
main:has(.study) { max-width: 1920px; }      /* 学习页用满宽屏 */
.left { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; }
.player-box { background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9; position: relative;
  flex: none; width: min(100%, calc((100vh - 180px) * 16 / 9)); align-self: center; }   /* 屏幕矮时缩小，给控制条留位置 */
.player-box video, .player-box iframe, #yt-holder, .media-slot { width: 100%; height: 100%; display: block; border: 0; }
.audio-only { height: 100%; background: #111 center/cover; position: relative; display: flex; flex-direction: column;
  justify-content: flex-end; }
.audio-only::before { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.audio-only .ao-label { position: absolute; top: 12px; left: 14px; color: #fff; font-size: 14px; opacity: .9; }
.audio-only audio { position: relative; width: 100%; display: block; }

/* 画面字幕遮挡条 */
.sub-mask {
  position: absolute; z-index: 3; touch-action: none; cursor: move; user-select: none;
  background: #161616;
  border-radius: 6px; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.sub-mask[hidden] { display: none; }
.sub-mask.peek { background: rgba(16, 16, 16, .12); outline: 1px dashed rgba(255,255,255,.5); }
.sub-mask.peek .mask-hint { visibility: hidden; }
.mask-hint { color: rgba(255, 255, 255, .4); font-size: 12px; white-space: nowrap; pointer-events: none; }
.mask-handle {
  position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize;
  border-right: 3px solid rgba(255,255,255,.55); border-bottom: 3px solid rgba(255,255,255,.55); border-radius: 0 0 6px 0;
}

.vhead { flex: none; display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 14px; }
.vh-ch { display: flex; align-items: center; gap: 6px; flex: none; color: inherit; text-decoration: none; font-weight: 600; max-width: 45%; }
.vh-ch:hover .vh-name { color: var(--accent); text-decoration: underline; }
.vh-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vh-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.vh-more { flex: none; font-size: 13px; color: var(--accent); text-decoration: none; white-space: nowrap; }
.vh-more:hover { text-decoration: underline; }
.controls { flex: none; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.controls .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.controls .grp { display: flex; gap: 4px; }
.controls kbd { font-size: 11px; opacity: .6; margin-left: 3px; }

.detail { background: var(--panel); padding: 12px 14px; overflow-y: auto; flex: 1 1 0; min-height: 60px; }
.detail h4 { margin: 12px 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.detail h4:first-child { margin-top: 0; }
.detail .cur-jp { font-size: 22px; line-height: 2.1; }
.detail .cur-zh { color: var(--muted); }
.word-row { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 4px; padding: 5px 0; border-top: 1px dashed var(--line); }
.word-row:first-of-type { border-top: 0; }
.word-row .w { font-family: var(--jp); font-weight: 600; }
.word-row .r { color: var(--muted); font-family: var(--jp); font-size: 13px; }
.star { background: none; border: 0; padding: 0; font-size: 18px; line-height: 1; color: var(--muted); }
.star.on { color: var(--star); background: none; }
.gram { padding: 6px 0; border-top: 1px dashed var(--line); }
.gram:first-of-type { border-top: 0; }
.gram .p { font-family: var(--jp); font-weight: 700; color: var(--accent); }
.listen { background: var(--accent-soft); border-radius: 8px; padding: 8px 10px; white-space: pre-wrap; }

#right { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; min-height: 0;
  display: flex; flex-direction: column; overflow: hidden; }
.tabs { display: flex; flex: none; border-bottom: 1px solid var(--line); background: var(--panel); z-index: 2; border-radius: var(--radius) var(--radius) 0 0; }
.tabs button { border: 0; border-radius: 0; background: none; padding: 10px 16px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.cur { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab-body { padding: 6px; flex: 0 0 55%; min-height: 60px; overflow-y: auto; }
.splitter { flex: none; height: 10px; cursor: row-resize; background: var(--panel-2); border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: center; touch-action: none; }
.splitter i { width: 40px; height: 3px; border-radius: 2px; background: var(--muted); opacity: .45; }
.splitter:hover i, .splitter.dragging i { opacity: .9; background: var(--accent); }

.sent { padding: 8px 10px 8px 12px; border-left: 3px solid transparent; border-radius: 6px; cursor: pointer; scroll-margin: 120px; }
.sent:hover { background: var(--panel-2); }
.sent.active { background: var(--active); border-left-color: var(--active-line); }
.sent .meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.sent .jp { font-size: 18px; line-height: 2; }
.sent .zh { color: var(--muted); font-size: 14px; }
.reveal { font-size: 12px; padding: 0 6px; margin-left: auto; }

/* 分词 */
.tk { margin: 0 .14em; border-radius: 3px; }
.tk.w { border-bottom: 2px solid var(--tk-line); }
.tk.w:hover { border-bottom-color: var(--accent); background: var(--panel-2); }
.detail .tk { cursor: pointer; }   /* iOS 只给 cursor:pointer 的元素生成 click（点词看意思靠 document 上的委托） */
.tk.p { color: var(--particle); font-weight: 600; }
.tk.a { color: var(--aux); }
.tk.p, .tk.a { white-space: nowrap; }
.tk:first-child { margin-left: 0; }

body.no-furi rt { visibility: hidden; }
body.no-trans .sent .zh, body.no-trans .detail .cur-zh { display: none; }
.hidden-text { filter: blur(7px); user-select: none; }
.hidden-text:hover { filter: blur(5px); }

.sum-table { width: 100%; border-collapse: collapse; }
.sum-table td, .sum-table th { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.sum-table th { font-size: 12px; color: var(--muted); font-weight: 600; }
.idx-link { font-size: 12px; margin-right: 4px; cursor: pointer; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 4px; }
.gram-card { padding: 10px; border-bottom: 1px solid var(--line); }
.gram-card .ex { font-family: var(--jp); padding: 2px 0 2px 10px; border-left: 2px solid var(--line); margin-top: 4px; cursor: pointer; }
.gram-card .ex:hover { border-left-color: var(--accent); }

/* ---------- 句子收藏 ---------- */
.save-btn { background: none; border: 0; padding: 0 4px; color: var(--muted); font-size: 16px; line-height: 1; }
.save-btn.on { color: var(--star); background: none; }
.sent .meta .save-btn { margin-left: auto; }
.sent .meta .reveal + .save-btn { margin-left: 4px; }
.detail-head { display: flex; align-items: center; gap: 8px; }
.detail-head .save-btn { margin-left: auto; font-size: 13px; border: 1px solid var(--line); border-radius: 8px; padding: 2px 8px; }

.saved-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px; margin-bottom: 8px; }
.saved-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.saved-item { padding: 10px 14px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; scroll-margin: 80px; }
.saved-item.playing { background: var(--active); border-left-color: var(--active-line); }
.saved-item .meta { display: flex; align-items: center; gap: 8px; }
.saved-item .src { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-item .ops { display: flex; align-items: center; gap: 6px; flex: none; }
.saved-item .jp { font-size: 19px; line-height: 2; margin-top: 4px; }
.saved-item .zh { color: var(--muted); }
.saved-item .listen { margin-top: 6px; padding: 6px 10px; }
.play-one { width: 34px; height: 34px; border-radius: 50%; padding: 0; flex: none; font-size: 13px; }
button:disabled { opacity: .4; cursor: default; }

/* ---------- 账号 / 后台 ---------- */
.user-menu { margin-left: auto; position: relative; flex: none; }
.um-btn { background: none; border: 0; color: var(--muted); padding: 4px 6px; }
.um-pop { position: absolute; right: 0; top: 100%; margin-top: 6px; min-width: 140px; z-index: 30;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.12);
  display: flex; flex-direction: column; padding: 4px; }
.um-pop[hidden] { display: none; }
.um-pop a, .um-pop button { padding: 8px 10px; text-align: left; border: 0; background: none; color: var(--text); border-radius: 6px; }
.um-pop a:hover, .um-pop button:hover { background: var(--panel-2); }
.acct-links { display: flex; gap: 12px; align-items: center; }

.auth-box { max-width: 380px; margin: 40px auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px; }
.auth-box h2 { margin: 0 0 12px; text-align: center; }
.auth-box form { display: flex; flex-direction: column; gap: 12px; }
.auth-box label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.auth-box label.check { flex-direction: row; align-items: center; gap: 6px; }
.auth-box hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.auth-tabs { justify-content: center; }
.hint { background: var(--accent-soft); padding: 8px 10px; border-radius: 8px; }
input { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; padding: 9px 14px; }
.form-err { color: #dc2626; font-size: 13px; min-height: 1em; }

.admin .tab-link { padding: 4px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: var(--panel-2); }
.admin .tab-link.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .n { font-size: 30px; font-weight: 700; }
.stat .label { color: var(--muted); }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
.admin-table th { font-size: 12px; color: var(--muted); font-weight: 600; }
.admin-table td:first-child { white-space: normal; min-width: 160px; }
.admin-table tr.dim td { opacity: .55; }
.admin-table .ops button { font-size: 12px; padding: 2px 8px; margin-right: 4px; }
.admin-table .progress { width: 80px; }
.mono { font-family: Consolas, "SFMono-Regular", monospace; letter-spacing: .5px; }
.badge.warn { color: #dc2626; }
.ok { color: var(--good); }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 8px; }
.inline-form input { padding: 5px 8px; }

/* ---------- 复习 ---------- */
.nav-due { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 3px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 11px; line-height: 18px; text-align: center; vertical-align: 2px; }
.nav-due[hidden] { display: none; }
.review-banner { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 14px;
  background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius); color: var(--text); }
.review-banner .go { margin-left: auto; color: var(--accent); font-weight: 600; }
.srs-badge { display: inline-block; font-size: 12px; padding: 0 6px; border-radius: 4px; line-height: 18px;
  color: var(--good); border: 1px solid currentColor; opacity: .85; flex: none; }

.review { max-width: 760px; margin: 0 auto; }
.review .cnt { font-size: 12px; opacity: .8; margin-left: 2px; }
.rv-counts { display: flex; justify-content: center; gap: 18px; margin: 6px 0 10px; font-weight: 600; }
.n-new { color: #2563eb; } .n-learn { color: #dc2626; } .n-rev { color: var(--good); }
.rv-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; min-height: 220px; }
.rv-card hr { border: 0; border-top: 1px dashed var(--line); margin: 16px 0; }
.rv-head { display: flex; gap: 6px; margin-bottom: 8px; }
.rv-kind.word { color: #2563eb; } .rv-kind.grammar { color: var(--accent); } .rv-kind.sentence { color: #9333ea; }
.rv-q { font-family: var(--jp); font-size: 36px; font-weight: 700; text-align: center; margin: 10px 0 14px; }
.rv-ex { display: flex; gap: 10px; align-items: center; justify-content: center; }
.rv-ex .jp { font-size: 19px; line-height: 2; }
.rv-ex .hl, .rv-ex-full .hl { color: var(--accent); }
.rv-hint { text-align: center; color: var(--muted); font-size: 13px; margin-top: 10px; }
.rv-listen { text-align: center; padding: 30px 0 10px; }
.play-one.big { width: 84px; height: 84px; font-size: 30px; }
.rv-a { text-align: center; margin-bottom: 12px; }
.rv-reading { font-family: var(--jp); font-size: 20px; }
.rv-meaning { font-size: 20px; font-weight: 600; margin: 4px 0; }
.rv-ex-full .jp { font-size: 19px; line-height: 2; }
.rv-ex-full .zh { color: var(--muted); }
.rv-ex-full .listen { margin-top: 8px; }
.rv-src { margin-top: 8px; }
.rv-done { font-size: 18px; line-height: 2; }
.rv-more { margin: 18px auto 0; max-width: 460px; font-size: 14px; line-height: 1.7; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.rv-more-btns { display: flex; gap: 8px; justify-content: center; margin: 10px 0 6px; flex-wrap: wrap; }
.srs-limit { display: flex; align-items: center; gap: 10px; }
.srs-limit select { width: auto; }
.rv-actions { display: flex; gap: 8px; margin-top: 12px; }
.rv-show { flex: 1; padding: 12px; font-size: 16px; }
.rv-actions kbd { font-size: 11px; opacity: .55; margin-left: 6px; font-family: inherit; }
.grade kbd { margin-left: 0; }
.grade { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 8px 4px; gap: 2px; }
.grade .ivl { font-size: 12px; color: var(--muted); }
.grade b { font-size: 16px; }
.grade.again b { color: #dc2626; } .grade.hard b { color: #d97706; } .grade.good b { color: var(--good); } .grade.easy b { color: #2563eb; }
.gram .star, .gram-card .star { margin-right: 4px; vertical-align: -1px; }

/* ---------- 生词本 ---------- */
.vocab-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.vocab-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.vocab-item .lemma { font-family: var(--jp); font-size: 20px; font-weight: 600; }
.vocab-item .ex-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.vocab-item .ex { font-family: var(--jp); font-size: 14px; color: var(--muted); }
.vocab-item .ex .hl { color: var(--text); font-weight: 600; }
.vocab-item .play-one { width: 30px; height: 30px; font-size: 12px; }
.vocab-item .ops { display: flex; gap: 4px; align-items: start; flex-wrap: wrap; justify-content: end; }
body.quiz .vocab-item .answer { visibility: hidden; }
body.quiz .vocab-item:hover .answer { visibility: visible; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 6px 14px; border-radius: 8px; font-size: 14px; z-index: 50; }

.m-only { display: none !important; }
/* 禁用双击放大（连点句子时页面会被放大），保留双指缩放 */
html, body, button { touch-action: manipulation; }

/* ---------- 手机 ---------- */
@media (max-width: 900px) {
  .m-only { display: revert !important; }
  .d-only { display: none; }
  kbd { display: none; }

  .sidebar { display: none; }
  body:not(.logged-out), body.sb-mini:not(.logged-out) { padding-left: 0; }
  main { padding: 10px; }
  body:not(.logged-out) main { padding-bottom: calc(var(--tabbar-h) + 10px + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--panel);
    border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: var(--tabbar-h); font-size: 11px; color: var(--muted); }
  .tabbar a i { font-style: normal; font-size: 20px; line-height: 1.2; position: relative; }
  .tabbar a.cur { color: var(--accent); font-weight: 600; }
  .tabbar .nav-due { position: absolute; top: -2px; left: 60%; font-size: 10px; line-height: 15px; min-width: 15px; padding: 0 4px; }
  .subtabs:not([hidden]) { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 8px 10px 2px;
    background: var(--bg); position: sticky; top: 0; z-index: 15; }
  .subtabs::-webkit-scrollbar { display: none; }
  .subtabs a { flex: none; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
    font-size: 14px; background: var(--panel); }
  .subtabs a.cur { background: var(--accent); border-color: var(--accent); color: #fff; }
  .hist-thumb { width: 112px; }
  .hist-body .title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  /* 博主横向滑动 */
  .channel-row { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px;
    margin: 0 -10px; padding: 0 10px 4px; scrollbar-width: none; }
  .channel-row::-webkit-scrollbar { display: none; }
  .channel-card { flex: 0 0 min(84%, 320px); scroll-snap-align: start; }
  .channel-row:has(.channel-card:only-child) .channel-card { flex-basis: 100%; }
  .channel-head { flex-direction: column; align-items: center; text-align: center; padding: 16px 14px; gap: 10px; }
  .ch-intro { text-align: left; }
  .home-sec + .home-sec { margin-top: 20px; }
  .sec-h h2 { font-size: 17px; }
  main:has(.study) { padding: 0 !important; }

  /* 学习页：视频+控制条固定在上，下面的列表单独滚动 */
  .study {
    display: flex; flex-direction: column; gap: 0;
    height: calc(100vh - var(--tabbar-h)); height: calc(100dvh - var(--tabbar-h) - env(safe-area-inset-bottom));
  }
  .left { position: static; flex: none; max-height: none; gap: 0; min-width: 0; max-width: 100%; }
  .left > *, .controls .grp { min-width: 0; max-width: 100%; }
  #right > .detail, .splitter { display: none !important; }
  .player-box { width: 100%; }
  .player-box { border-radius: 0; max-height: 34vh; max-height: 34dvh; }
  .player-box video { object-fit: contain; }
  .mask-handle { width: 26px; height: 26px; }
  .mask-hint { font-size: 11px; }

  .vhead { padding: 5px 10px; gap: 8px; font-size: 13px; border-bottom: 1px solid var(--line); background: var(--panel); }
  .vh-ch .avatar { --s: 22px !important; }
  .vh-title { display: none; }
  .vh-ch { max-width: none; flex: 1; min-width: 0; }
  .controls { border-radius: 0; border-width: 0 0 1px; padding: 6px 8px; gap: 6px; flex-direction: column; align-items: stretch; }
  .controls .sep, .controls .rates { display: none; }
  .controls .nav { gap: 6px; }
  .controls .nav button { flex: 1; padding: 7px 0; font-size: 17px; }
  .controls .nav .rate-cycle { flex: 0 0 56px; font-size: 14px; }
  .controls .toggles { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .controls .toggles::-webkit-scrollbar { display: none; }
  .controls .toggles button { flex: none; white-space: nowrap; font-size: 13px; padding: 4px 10px; }

  #right { flex: 1; min-height: 0; display: flex; flex-direction: column; border-radius: 0; border-width: 0; }
  .tabs { position: static; flex: none; border-radius: 0; }
  .tabs button { flex: 1; padding: 9px 4px; }
  .tab-body { flex: 1 1 auto !important; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 4px 24px; }

  .sent { padding: 8px 8px 8px 10px; scroll-margin: 40px; }
  .sent .jp { font-size: 17px; }
  .goto-detail { font-size: 12px; padding: 0 8px; margin-left: auto; }
  .reveal + .goto-detail { margin-left: 4px; }
  .save-btn + .goto-detail { margin-left: 4px; }
  .sent:not(.active) .goto-detail { display: none !important; }

  .detail-tab { border: 0; border-radius: 0; min-height: 0; overflow: visible; }
  .detail-tab .cur-jp { font-size: 20px; }
  .detail-nav { display: flex !important; gap: 6px; margin-top: 16px; }
  .detail-nav button { flex: 1; padding: 8px 0; }

  .sum-table td, .sum-table th { padding: 6px 4px; }
  .vocab-item { grid-template-columns: 1fr; }
  .saved-item { padding: 10px; }
  .saved-item .meta { gap: 6px; }
  .saved-item .ops { gap: 4px; }
  .saved-item .ops button { padding: 3px 8px; font-size: 13px; }
  .saved-item .jp { font-size: 17px; }
  .vocab-item .ops { justify-content: start; }
  .rv-card { padding: 14px; min-height: 0; }
  .rv-q { font-size: 30px; }
  .rv-actions { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); background: var(--bg);
    padding: 8px 0 12px; margin-top: 8px; }
  .um-name { display: none; }
  .auth-box { margin: 16px auto; padding: 18px 16px; }
  .toast { bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); text-align: center; }
}

/* ---------- 听写 ---------- */
.dict-box { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 6px 0 12px; }
.dict-chips { font-size: 22px; line-height: 2.3; margin: 4px 0 8px; }
.dict-chips .dk { font: inherit; font-family: var(--jp); padding: 0 .2em; margin: 0 .08em; border: 1px dashed var(--tk-line);
  border-radius: 6px; background: var(--panel); color: var(--text); cursor: pointer; line-height: 1.6; }
.dict-chips .dk.p { color: var(--particle); }
.dict-chips .dk.a { color: var(--aux); }
.dict-chips .dk:hover { border-color: var(--accent); }
.dict-chips .dk.miss { background: var(--miss); color: var(--miss-text); border: 1px solid var(--miss-text); }
.dict-chips .dk-x { margin: 0 .05em; }
.dict-acts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dict-acts kbd, .dict-ask kbd { font-size: 11px; opacity: .7; margin-left: 4px; font-family: inherit; }
.dict-tag { font-size: 11px; padding: 0 5px; border-radius: 4px; line-height: 17px; }
.dict-tag.bad { background: var(--miss); color: var(--miss-text); }
.dict-tag.ok { color: var(--good); }
.dict-tab { padding: 12px; }
.dict-intro { color: var(--muted); margin-bottom: 10px; }
.dict-stats { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.dict-stats button { margin-left: auto; }
.dict-tab h4 { display: flex; gap: 8px; align-items: center; }
.dict-basic { display: flex; flex-wrap: wrap; gap: 6px; }
.dict-basic span { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 8px; font-family: var(--jp); }
.dict-basic small { color: var(--muted); margin-left: 3px; }
.dict-sent { border-top: 1px solid var(--line); padding: 8px 0; }
.dict-sent .meta { display: flex; gap: 8px; align-items: center; }
.dict-sent .jp { font-size: 17px; line-height: 2; font-family: var(--jp); }
.dict-sent mark { background: var(--miss); color: var(--miss-text); border-radius: 3px; padding: 0 1px; }
@media (max-width: 900px) { .dict-chips { font-size: 19px; line-height: 2.2; } }

/* ---------- 假名 ---------- */
:root { --k-good: #dcfce7; --k-mid: #fef3c7; --k-bad: #fde2e2; }
@media (prefers-color-scheme: dark) { :root { --k-good: #14361f; --k-mid: #3b3015; --k-bad: #4a1f1f; } }
.kana-bar { margin: 4px 0 6px; }
.kana-bar .sort-tabs { margin-left: 0; }
.kana-legend { margin-bottom: 8px; }
.kana-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin: 0 3px 0 8px; border: 1px solid var(--line); }
.kana-legend i.good, .kana-cell.good { background: var(--k-good); }
.kana-legend i.mid, .kana-cell.mid { background: var(--k-mid); }
.kana-legend i.bad, .kana-cell.bad { background: var(--k-bad); }
.kana-grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 6px; max-width: 560px; }
.kana-cell { display: flex; flex-direction: column; align-items: center; padding: 6px 0; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel); color: var(--text); cursor: pointer; min-width: 0; }
.kana-cell b { font-family: var(--jp); font-size: 26px; font-weight: 500; line-height: 1.3; }
.kana-cell small { font-size: 11px; color: var(--muted); line-height: 1.3; }
.kana-cell.empty { border: 0; background: none; cursor: default; }
.kana-setup { max-width: 560px; }
.kana-row { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 10px 0; }
.kana-row > span { width: 40px; color: var(--muted); font-size: 14px; }
.kana-opt { font-size: 15px; display: inline-flex; gap: 4px; align-items: center; }
.kana-q { max-width: 460px; margin: 10px auto; text-align: center; }
.kana-play { font-size: 40px; width: 96px; height: 96px; border-radius: 50%; margin: 14px auto; display: block; }
.kana-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kana-opts button { font-family: var(--jp); font-size: 38px; padding: 14px 0; border-radius: 12px; background: var(--panel);
  border: 1px solid var(--line); color: var(--text); }
.kana-opts button.right { background: var(--k-good); border-color: var(--good); }
.kana-opts button.wrong { background: var(--k-bad); border-color: #dc2626; }
.kana-fb { min-height: 48px; margin-top: 12px; line-height: 2; }
.kana-fb a { cursor: pointer; color: var(--accent); }
.kana-wrong { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 8px 0 14px; }
.kana-wrong button { font-family: var(--jp); font-size: 24px; display: flex; flex-direction: column; align-items: center; padding: 4px 12px; }
.kana-wrong small { font-size: 11px; color: var(--muted); }
.kana-acts { display: flex; gap: 10px; justify-content: center; align-items: center; }

/* 复习卡答案面：例句上下文 */
.rv-ctx { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 8px; text-align: left; }
.ctx-line { padding: 4px 8px; border-left: 3px solid transparent; border-radius: 4px; }
.ctx-line > div[lang] { font-family: var(--jp); line-height: 1.9; }
.ctx-line.cur { border-left-color: var(--accent); background: var(--accent-soft); }

/* ---------- 打字练习 ---------- */
.type-q { max-width: 560px; margin: 16px auto; text-align: center; }
.type-word { font-size: 40px; font-weight: 600; margin-top: 6px; }
.type-kana { font-family: var(--jp); font-size: 28px; letter-spacing: 2px; min-height: 42px; }
.type-kana span { color: var(--muted); }
.type-kana span.done { color: var(--good); }
.type-kana span.cur { color: var(--text); border-bottom: 3px solid var(--accent); }
.type-kana.shake { animation: tshake .25s; }
@keyframes tshake { 25% { transform: translateX(-6px); color: #dc2626; } 75% { transform: translateX(6px); } }
.type-roma { font-family: ui-monospace, Consolas, monospace; font-size: 20px; color: var(--muted); min-height: 30px; letter-spacing: 1px; }
.type-roma b { color: var(--accent); }
.type-mean { color: var(--muted); margin: 2px 0 12px; font-size: 16px; }
.type-in { width: 100%; max-width: 320px; font-size: 20px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 10px;
  background: var(--panel); color: var(--text); text-align: center; font-family: ui-monospace, Consolas, monospace; }
.type-in:focus { outline: none; border-color: var(--accent); }
.type-q a { cursor: pointer; }
.type-bad { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 8px 0 14px; }
.type-bad span { display: flex; flex-direction: column; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-size: 18px; }
.type-bad small { font-size: 11px; color: var(--muted); }
.type-roma span { color: var(--muted); }
.type-roma span.ok { color: var(--good); }
.type-hint-btn { font-size: 13px; padding: 3px 12px; border-radius: 999px; margin-bottom: 4px; }
.type-hint-btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.type-btns { display: flex; gap: 8px; justify-content: center; margin-bottom: 6px; }

/* 复习页：单词卡打字（罗马字打出读音） */
.rv-type { margin-top: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.rv-type .type-kana { font-size: 26px; }
.rv-type .type-in { max-width: 320px; }
.rv-typeres { font-weight: 600; margin-bottom: 8px; }
.rv-typeres.ok { color: var(--good); }
.rv-typeres.bad { color: #dc2626; }

/* 复习页：语法卡选意思 */
.rv-quiz { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; max-width: 560px; margin-left: auto; margin-right: auto; }
.rv-quiz button { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 14px; font-size: 15px; line-height: 1.4; }
.rv-quiz button kbd { flex: none; font-size: 12px; opacity: .6; }
.rv-quiz button.right { background: var(--k-good); border-color: var(--good); opacity: 1; }
.rv-quiz button.wrong { background: var(--k-bad); border-color: #dc2626; opacity: 1; }
.rv-quiz button:disabled:not(.right):not(.wrong) { opacity: .55; }

/* 复习页：句子卡听写 */
.rv-dq-box { margin: 14px auto 0; max-width: 640px; text-align: left; }
.rv-dq-box .dk:disabled { opacity: 1; cursor: default; }

/* 复习页：单词卡先听后认（例句挖空） */
.rv-cloze { justify-content: center; margin-top: 10px; }
.rv-cloze .cloze { display: inline-block; min-width: 2.6em; margin: 0 3px; border-bottom: 2px solid var(--accent); color: var(--accent); text-align: center; font-weight: 700; }

/* ---------- JLPT 真题 ---------- */
.rv-kind.question { color: #0d9488; }
a.btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: inherit; text-decoration: none; font-size: 14px; }
a.btn:hover { border-color: var(--muted); }
a.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.ex-sec { font-size: 14px; color: var(--muted); margin: 14px 0 8px; font-weight: 600; }
.ex-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.ex-type { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: inherit; text-decoration: none; }
.ex-type:hover { border-color: var(--accent); }
.ex-type b { color: var(--accent); font-size: 13px; }
.ex-list { display: flex; flex-direction: column; gap: 8px; }
.ex-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.ex-item-btns { display: flex; gap: 6px; }
.ex-att { color: #dc2626; } .ex-att.ok { color: var(--good); }

.ex-single { max-width: 760px; margin: 0 auto; }
.ex-split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ex-left { position: sticky; top: 8px; max-height: calc(100vh - 24px); overflow-y: auto; }
.ex-pd { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 8px 12px; margin-bottom: 8px; }
.ex-pd > summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.ex-passage { font-family: var(--jp); font-size: 16px; line-height: 2; }
.ex-passage p { margin: 0 0 .6em; }
.ex-passage h4 { margin: 4px 0 8px; }
.ex-notes { color: var(--muted); line-height: 1.6; border-top: 1px dashed var(--line); padding-top: 6px; }
.ex-table { border-collapse: collapse; margin: 8px 0; font-size: 14px; line-height: 1.5; }
.ex-table th, .ex-table td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: top; }
.ex-table th { background: var(--panel-2); }
.ex-u { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.ex-slot { display: inline-block; width: 3.2em; border-bottom: 1.5px solid currentColor; margin: 0 3px; text-align: center; }
.ex-slot.star { color: var(--accent); font-weight: 700; }
.ex-blank { display: inline-block; min-width: 2.4em; padding: 0 4px; margin: 0 2px; border: 1.5px solid var(--line); border-radius: 4px;
  text-align: center; font-size: 13px; line-height: 1.6; color: var(--muted); }
.ex-blank.cur { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.ex-q { display: flex; flex-direction: column; gap: 10px; }
.ex-stem { font-family: var(--jp); font-size: 19px; line-height: 2; }
.ex-word { font-size: 24px; }
.ex-opts { display: flex; flex-direction: column; gap: 8px; }
.ex-opt { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 14px; font-size: 16px; line-height: 1.7; }
.ex-opt kbd { flex: none; font-size: 12px; opacity: .6; }
.ex-opt.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.ex-opt.right { background: var(--k-good); border-color: var(--good); opacity: 1; }
.ex-opt.wrong { background: var(--k-bad); border-color: #dc2626; opacity: 1; }
.ex-opt:disabled:not(.right):not(.wrong) { opacity: .6; }
.ex-exp { border-top: 1px dashed var(--line); padding-top: 10px; }
.ex-exp .zh { margin-bottom: 6px; }
.ex-expl { font-size: 14px; line-height: 1.75; }
.ex-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.ex-nav button.on { border-color: #dc2626; color: #dc2626; }
.ex-start { max-width: 640px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.mock-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.mock-bar .mock-clock { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 18px; margin-left: auto; }
.mock-clock.warn { color: #dc2626; }
.mk-grid { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.mk-n { width: 38px; padding: 4px 0; font-size: 13px; }
.mk-n.done { background: var(--panel-2); color: var(--muted); }
.mk-n.flag { border-color: #dc2626; }
.mk-n.cur { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.mk-scores { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0 12px; }
.mk-score { display: flex; flex-direction: column; padding: 12px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); min-width: 200px; }
.mk-score b { font-size: 34px; } .mk-score.ok b { color: var(--good); } .mk-score.bad b { color: #dc2626; }
.mk-table { width: 100%; max-width: 560px; }
.mk-item { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin-bottom: 6px; background: var(--panel); }
.mk-item > summary { cursor: pointer; }
.mk-item.bad > summary b { color: #dc2626; } .mk-item.ok > summary b { color: var(--good); }
.mk-item[open] > summary { margin-bottom: 8px; }
.rv-qp { text-align: left; max-height: 50vh; overflow-y: auto; }
.rv-qstem { text-align: left; margin: 10px auto 0; max-width: 640px; }
@media (max-width: 900px) {
  .ex-split { display: block; }
  .ex-left { position: static; max-height: none; }
  .ex-stem { font-size: 17px; }
  .ex-passage { font-size: 15px; }
  .mock-bar { top: 0; border-radius: 0; margin: 0 -12px 10px; }
  .ex-types { grid-template-columns: 1fr 1fr; }
}

/* 真题：听力题 */
.ex-listen { display: flex; align-items: center; gap: 14px; padding: 6px 0; }
.ex-opt.num { justify-content: center; font-size: 18px; font-weight: 600; }
.ex-opt.num kbd { opacity: 1; font-size: 18px; }
.ex-lines { margin-top: 10px; }
.ex-lines .ctx-line { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.mk-part { display: flex; gap: 8px; align-items: baseline; margin: 6px 0; flex-wrap: wrap; }

/* ---------- 数字听力 ---------- */
.num-q .type-in { text-align: center; font-size: 26px; letter-spacing: 1px; margin: 6px auto; display: block; }
.num-q .type-in.ok { border-color: var(--good); background: var(--k-good); }
.num-q .type-in.bad { border-color: #dc2626; background: var(--k-bad); }
.num-unit { font-family: var(--jp); font-size: 20px; color: var(--muted); margin: 4px 0 8px; }
.num-sent { font-size: 20px; line-height: 1.9; margin: 4px 0 10px; text-align: left; }
.num-sent .cloze { display: inline-block; min-width: 2.4em; margin: 0 3px; border-bottom: 2px solid var(--accent); color: var(--accent); text-align: center; font-weight: 700; }
.num-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.num-week button { font-family: var(--jp); font-size: 24px; padding: 8px 0; border-radius: 10px; background: var(--panel);
  border: 1px solid var(--line); color: var(--text); display: flex; flex-direction: column; align-items: center; }
.num-week button kbd { font-size: 10px; color: var(--muted); }
.num-week button.right { background: var(--k-good); border-color: var(--good); }
.num-week button.wrong { background: var(--k-bad); border-color: #dc2626; }
.num-ok { color: var(--good); font-weight: 700; }
.num-bad { color: #dc2626; }
.num-real-ans { text-align: left; margin: 6px 0 10px; }
.num-real-ans .jp { font-size: 18px; line-height: 2.1; }
.num-real-ans a { cursor: pointer; color: var(--accent); }
.num-wrong { display: flex; flex-direction: column; gap: 6px; text-align: left; margin: 8px 0 14px; }
.num-wrong > div { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); line-height: 1.9; }
.num-wrong small { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; }
.num-q .kana-fb button { margin-top: 8px; }

.num-goal-tip { font-size: 14px; background: var(--accent-soft); border-radius: 8px; padding: 6px 10px; }
.num-lv.fast { color: var(--good); font-weight: 700; }
.num-lv.goal { color: #2563eb; font-weight: 700; }
.num-lv.slow { color: #d97706; font-weight: 700; }
.num-goal-sum { margin: 4px 0 8px; }
.num-tbl { width: 100%; border-collapse: collapse; font-size: 14px; margin: 0 0 12px; }
.num-tbl th, .num-tbl td { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.num-tbl th { color: var(--muted); font-weight: 500; }
.num-tbl td:first-child { text-align: left; }
.num-tbl tr:last-child td { border-bottom: 0; }
.num-bar { display: inline-block; width: 60px; height: 6px; border-radius: 3px; background: var(--line); vertical-align: middle; margin-right: 6px; overflow: hidden; }
.num-bar i { display: block; height: 100%; background: var(--good); }

.type-flag { color: #dc2626; }

.type-hard { margin-top: 18px; }
.type-hard .type-bad { justify-content: flex-start; }

.grade .tip { font-size: 11px; color: var(--muted); line-height: 1.2; white-space: nowrap; }

.grade.saving { outline: 2px solid var(--accent); }
.grade:disabled:not(.saving) { opacity: .5; }

.type-lvs { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.type-lv { font-size: 13px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.type-lv.weak { color: #dc2626; border-color: #dc2626; }
.type-lv.mid { color: #d97706; border-color: #d97706; }
.type-lv.good { color: var(--good); border-color: var(--good); }
.kana-row > .type-lvs { width: auto; }

.bank-dots { color: #d97706; letter-spacing: 1px; font-weight: 400; }
.type-bad span.due { border-color: #d97706; }

/* ---------- 阅读训练 ---------- */
.rd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.rd-card { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--text); text-decoration: none; }
.rd-card:hover { border-color: var(--accent); }
.rd-ct { font-family: var(--jp); font-size: 17px; font-weight: 600; }
.rd-cm { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.rd-res.ok { color: var(--good); font-weight: 600; }
.rd-page { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; max-width: 1180px; }
.rd-main { min-width: 0; }
.rd-top { display: flex; gap: 10px; align-items: center; }
.rd-title { font-family: var(--jp); font-size: 26px; margin: 10px 0 2px; }
.rd-sub { margin-bottom: 12px; }
.rd-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.rd-bar .tog.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.rd-text { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px;
  font-family: var(--jp); font-size: 19px; line-height: 2.3; }
.rd-text p { margin: 0; text-indent: 1em; }
.rd-para + .rd-para { margin-top: 12px; }
.rd-text.no-rt rt { visibility: hidden; }
.rd-s { cursor: pointer; border-radius: 4px; padding: 2px 0; transition: background .15s; }
.rd-s:hover { background: var(--panel-2); }
.rd-s.on { background: var(--active); box-shadow: 0 2px 0 var(--active-line); }
.rd-pzh { font-family: var(--zh); font-size: 14px; line-height: 1.8; color: var(--muted); text-indent: 0 !important; margin-top: 4px !important; }
.rd-tip { margin: 8px 2px 0; }
.rd-side { position: sticky; top: 12px; }
.rd-side-in { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); max-height: calc(100vh - 24px);
  overflow-y: auto; }
.rd-side .detail { background: none; }
.rd-dh { display: flex; align-items: center; gap: 8px; padding: 10px 14px 0; }
.rd-dh span { margin-right: auto; }
.rd-close { border: none; background: none; font-size: 16px; padding: 2px 6px; color: var(--muted); }
.rd-dnav { display: flex; justify-content: space-between; margin-top: 14px; }
.rd-quiz { margin-top: 22px; }
.rd-quiz h3 { font-size: 17px; margin: 0 0 10px; }
.rd-q { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.rd-q .ex-stem { font-family: var(--jp); font-size: 17px; line-height: 2; }
.rd-qbar { display: flex; gap: 10px; align-items: center; margin: 6px 0 30px; }
@media (max-width: 900px) {
  .rd-page { display: block; }
  .rd-title { font-size: 22px; }
  .rd-text { padding: 14px 14px; font-size: 18px; line-height: 2.2; }
  .rd-side { position: fixed; left: 0; right: 0; top: auto; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 30; display: none;
    padding: 0 8px; }
  .rd-side.open { display: block; }
  .rd-side-in { max-height: 52vh; box-shadow: 0 -6px 24px rgba(0, 0, 0, .18); }
  .rd-side .cur-jp { font-size: 19px; }
  .rd-page.sheet .rd-main { padding-bottom: 52vh; }
}

/* 阅读：收藏的句子 / 词 */
:root { --rd-saved: #e3f1e7; --rd-saved-line: #6fbf8a; --rd-word: #6d28d9; --rd-word-bg: #efe7ff; }
@media (prefers-color-scheme: dark) { :root { --rd-saved: #1c3325; --rd-saved-line: #3f8f5c; --rd-word: #c4b5fd; --rd-word-bg: #2e2448; } }
.rd-s.saved { background: var(--rd-saved); box-shadow: 0 2px 0 var(--rd-saved-line); }
.rd-s.saved.on { background: var(--active); box-shadow: 0 2px 0 var(--active-line); }
mark.rd-w { background: var(--rd-word-bg); color: var(--rd-word); border-radius: 3px; font-weight: 600; padding: 0 1px; }
mark.rd-w rt { color: var(--rd-word); }
.rd-legend { margin-right: 10px; white-space: nowrap; }
.rd-legend .rd-s { cursor: default; padding: 0 3px; }

/* 打字：错字库今天待测（侧栏数字用紫色，和复习的橙色区分） */
.nav-due.type { background: #7c3aed; }
.subtabs .nav-due { margin-left: 3px; font-size: 10px; line-height: 15px; min-width: 15px; padding: 0 4px; }
.type-duebar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 12px; border-radius: var(--radius); background: color-mix(in srgb, #7c3aed 10%, var(--panel));
  border: 1px solid color-mix(in srgb, #7c3aed 35%, var(--line)); }
.type-duebar b { color: #7c3aed; font-size: 18px; }
.type-duebar.ok { background: var(--panel); border-color: var(--line); }
@media (prefers-color-scheme: dark) { .type-duebar b { color: #c4b5fd; } }

.type-word.zh { font-family: var(--zh); font-size: 30px; line-height: 1.4; }

/* 打字：答案 + 例句 */
.type-ans { margin: 4px 0 14px; font-size: 16px; }
.type-ans .ok { color: var(--good); } .type-ans .bad { color: #dc2626; }
.type-ex { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 14px; margin: 0 auto 16px; }
.type-ex-jp { display: flex; gap: 8px; align-items: flex-start; font-size: 18px; line-height: 2; }
.type-ex-jp .play-one { margin-top: 6px; }
.type-ex-src { margin-top: 4px; }
#t-next kbd { font-size: 11px; opacity: .7; margin-left: 4px; }

/* 视频重听 */
.relisten-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 12px; margin: 0 0 8px;
  border-radius: var(--radius); background: color-mix(in srgb, #0d9488 10%, var(--panel)); border: 1px solid color-mix(in srgb, #0d9488 35%, var(--line));
  font-size: 14px; }
.relisten-btns { display: inline-flex; gap: 8px; align-items: center; margin-left: auto; }

.nav-due.rl { background: #0d9488; }
.rl-list { display: flex; flex-direction: column; gap: 6px; }
.rl-item { display: flex; gap: 12px; align-items: baseline; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--text); text-decoration: none; }
.rl-when { flex: none; width: 64px; color: #0d9488; font-weight: 600; }
.rl-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.type-next-row { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }

.rv-mk { margin-top: 12px; font-size: 1.05em; font-weight: 600; text-align: center; }
.rv-actions .mk-no { opacity: .85; }

.rv-hide.on { filter: blur(7px); cursor: pointer; user-select: none; }

.play-one.blocked { animation: rvpulse 1.1s ease-in-out infinite; }
@keyframes rvpulse { 50% { box-shadow: 0 0 0 6px var(--accent); } }

.kt-kana { font-size: 72px; font-weight: 700; margin: 14px 0 6px; line-height: 1.2; }

/* 学习统计（类别颜色 = 数据可视化参考色板第 1~6 槽，按这个顺序堆叠，相邻两色色盲下也分得清） */
:root { --st-review: #2a78d6; --st-typing: #eb6834; --st-video: #1baf7a; --st-reading: #eda100; --st-exam: #e87ba4; --st-other: #008300; }
@media (prefers-color-scheme: dark) { :root { --st-review: #3987e5; --st-typing: #d95926; --st-video: #199e70; --st-reading: #c98500; --st-exam: #d55181; --st-other: #008300; } }
.st-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0; }
.st-tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.st-tile b { font-size: 1.35em; }
.st-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0; font-size: 13px; color: var(--muted); }
.st-legend i, .st-tip i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.st-chart { position: relative; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 8px 4px; }
.st-chart svg { width: 100%; height: auto; display: block; }
.st-chart path, .st-chart rect:not(.st-hit) { stroke: none; }
.st-grid { stroke: var(--line); stroke-width: 1; }
.st-ax { fill: var(--muted); font-size: 11px; }
.st-hit { cursor: pointer; }
.st-hit:hover { fill: var(--text); fill-opacity: .05; }
.st-tip { position: absolute; top: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  font-size: 13px; line-height: 1.7; box-shadow: 0 4px 14px rgba(0,0,0,.12); pointer-events: none; min-width: 150px;
  max-width: calc(100% - 8px); }
.st-table-wrap { overflow-x: auto; margin-top: 10px; }
.st-table { border-collapse: collapse; width: 100%; font-size: 13px; white-space: nowrap; }
.st-table th, .st-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.st-table th:first-child, .st-table td:first-child { text-align: left; }
.st-table th { color: var(--muted); font-weight: normal; }
@media (max-width: 900px) { .st-tiles { grid-template-columns: repeat(2, 1fr); } }
.stats-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; padding: 8px 12px; font-size: 14px;
  color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.stats-line .go { margin-left: auto; color: var(--accent); }
.type-ans .type-pos { font-size: 13px; color: var(--muted); }
