/* ============================================================
   官方教材（新版）· 课文与单词 —— 页面样式
   视觉规范完全对齐 /ipa/assets/ipa.css（音标学习）：
   蓝紫渐变主色 / #101828 文字 / #e4e7ec 边框 / 14px 圆角 / 1140px 容器。
   变量名统一加 tb- 前缀，避免与主站注入的深色样式（--bg/--text/--border）
   以及 .btn / .word-card 等同名规则冲突。
   ============================================================ */
:root {
  --tb-brand: #3b82f6;
  --tb-brand-2: #8b5cf6;
  --tb-grad: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --tb-grad-soft: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);

  --tb-ink: #101828;
  --tb-ink-2: #344054;
  --tb-ink-3: #667085;
  --tb-ink-4: #98a2b3;

  --tb-line: #e4e7ec;
  --tb-line-2: #f2f4f7;
  --tb-bg: #f9fafb;
  --tb-surface: #ffffff;

  /* ipa.css 中硬编码的语义色，这里改成变量以便深色完整覆盖 */
  --tb-active-bg: #eef2ff;
  --tb-active-ink: #4f46e5;
  --tb-soft: #eff6ff;
  --tb-soft-ink: #1d4ed8;
  --tb-hover-line: #c7d2fe;
  --tb-soft-line: #e0e7ff;
  --tb-blue-wash: rgba(59, 130, 246, .10);
  --tb-grad-shadow: rgba(99, 102, 241, .8);

  --tb-ok: #12b76a;   --tb-ok-bg: #ecfdf3;
  --tb-warn: #f79009; --tb-warn-bg: #fffaeb;
  --tb-bad: #f04438;  --tb-bad-bg: #fef3f2;

  --tb-r-sm: 10px; --tb-r: 14px; --tb-r-lg: 20px;
  --tb-sh-1: 0 1px 2px rgba(16, 24, 40, .05);
  --tb-sh-2: 0 4px 12px -2px rgba(16, 24, 40, .08), 0 2px 6px -2px rgba(16, 24, 40, .04);
  --tb-sh-3: 0 20px 44px -18px rgba(16, 24, 40, .22);

  --tb-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --tb-ipa: "Segoe UI", "Microsoft YaHei", "Charis SIL", "Doulos SIL", "Gentium Plus", "Lucida Sans Unicode", "DejaVu Sans", "Arial Unicode MS", Arial, sans-serif;
  --tb-max: 1140px;
}

/* 深色：跟随主站右下角开关（postMessage darkModeSync）+ 本地记忆 */
html.dark {
  --tb-bg: #0f172a;
  --tb-surface: #1e293b;
  --tb-line: #334155;
  --tb-line-2: #263449;
  --tb-ink: #f1f5f9;
  --tb-ink-2: #cbd5e1;
  --tb-ink-3: #94a3b8;
  --tb-ink-4: #64748b;
  --tb-active-bg: #312e81;
  --tb-active-ink: #a5b4fc;
  --tb-soft: #1e3a5f;
  --tb-soft-ink: #93c5fd;
  --tb-hover-line: #4c51bf;
  --tb-soft-line: #3730a3;
  --tb-blue-wash: rgba(96, 165, 250, .16);
  --tb-grad-soft: linear-gradient(135deg, #172554 0%, #2e1065 100%);
  --tb-ok-bg: #052e1b; --tb-warn-bg: #3a2605; --tb-bad-bg: #3b1210;
  --tb-sh-1: 0 1px 2px rgba(0, 0, 0, .3);
  --tb-sh-2: 0 4px 12px -2px rgba(0, 0, 0, .4);
  --tb-sh-3: 0 20px 44px -18px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--tb-font); font-size: 15px; line-height: 1.65;
  color: var(--tb-ink-2); background: var(--tb-bg); -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font-family: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { color: var(--tb-ink); }
:focus-visible, .tbtn:focus-visible, .tbtn-ghost:focus-visible, .unit-card:focus-visible,
.tts-voice:focus-visible, .word:focus-visible, .w:focus-visible {
  outline: 2px solid #818cf8; outline-offset: 2px;
}
.skip { position: absolute; left: -9999px; }
[hidden] { display: none !important; }

/* ---------------- 顶部栏（与 ipa 完全一致） ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--tb-line);
}
html.dark .site-header { background: rgba(30, 41, 59, .9); }
.nav-wrap {
  max-width: var(--tb-max); margin: 0 auto; padding: 0 22px; height: 64px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px; background: var(--tb-grad);
  color: #fff; display: grid; place-items: center; font-family: Georgia, serif;
  font-size: 15px; font-weight: 700; box-shadow: 0 4px 12px -3px var(--tb-grad-shadow);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 15.5px; font-weight: 700; letter-spacing: -.2px; color: var(--tb-ink); }
.brand-text i { font-size: 11px; font-style: normal; color: var(--tb-ink-4); }
.nav-links { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav-links a { padding: 7px 13px; border-radius: 9px; font-size: 14px; color: var(--tb-ink-3); white-space: nowrap; }
.nav-links a:hover { background: var(--tb-line-2); color: var(--tb-ink); }
.nav-links a.active { background: var(--tb-active-bg); color: var(--tb-active-ink); font-weight: 600; }
.nav-toggle { display: none; margin-left: 4px; border: 1px solid var(--tb-line); background: var(--tb-surface); color: var(--tb-ink-2); border-radius: 9px; padding: 6px 10px; font-size: 16px; }
.view { min-height: 72vh; }
.wrap { max-width: var(--tb-max); margin: 0 auto; padding: 0 22px; }
.section { padding-top: 52px; padding-bottom: 52px; }
.section.tight { padding-top: 34px; padding-bottom: 34px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.section-head h2 { margin: 0 0 5px; font-size: 23px; font-weight: 700; letter-spacing: -.4px; }
.section-head > p { margin: 0; font-size: 13px; color: var(--tb-ink-4); }
.eyebrow { margin: 0 0 8px; font-size: 12.5px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--tb-active-ink); }

/* ---------------- 按钮 ---------------- */
.tbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 22px; border-radius: 11px; border: 1px solid transparent;
  font-size: 14.5px; font-weight: 600; color: var(--tb-ink-2); background: var(--tb-surface);
  transition: transform .15s, box-shadow .2s, background .2s, border-color .2s;
}
.tbtn-primary { background: var(--tb-grad); color: #fff; box-shadow: 0 8px 20px -8px var(--tb-grad-shadow); }
.tbtn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -10px rgba(99, 102, 241, .9); }
.tbtn-ghost { background: var(--tb-surface); border-color: var(--tb-line); color: var(--tb-ink-2); box-shadow: var(--tb-sh-1); }
.tbtn-ghost:hover { border-color: var(--tb-hover-line); color: var(--tb-active-ink); }
.tbtn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }
.tbtn-sm { padding: 7px 14px; font-size: 13px; border-radius: 9px; }

/* ---------------- 顶部搜索 ---------------- */
.search { position: relative; display: flex; align-items: center; gap: 8px; flex: 0 1 260px; min-width: 150px;
  background: var(--tb-line-2); border: 1px solid var(--tb-line); border-radius: 10px; padding: 0 10px; height: 36px; }
.search:focus-within { border-color: var(--tb-hover-line); background: var(--tb-surface); }
.search-icon { width: 16px; height: 16px; flex: none; color: var(--tb-ink-4); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--tb-ink); font-size: 13.5px; }
.search input::placeholder { color: var(--tb-ink-4); }
.search kbd { font-size: 11px; color: var(--tb-ink-4); border: 1px solid var(--tb-line); border-radius: 5px; padding: 0 5px; background: var(--tb-surface); }
.search-panel { position: absolute; top: calc(100% + 8px); left: 0; right: 0; width: 340px; max-height: 60vh; overflow-y: auto;
  background: var(--tb-surface); border: 1px solid var(--tb-line); border-radius: var(--tb-r); box-shadow: var(--tb-sh-3); padding: 8px; z-index: 90; }
.sp-title { margin: 8px 10px 5px; font-size: 11px; font-weight: 700; letter-spacing: .5px; color: var(--tb-ink-4); text-transform: uppercase; }
.sp-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 8px 10px; border-radius: 9px; color: var(--tb-ink-2); font-size: 13.5px; }
.sp-item:hover { background: var(--tb-active-bg); }
.sp-badge { flex: none; font-family: var(--tb-ipa); font-size: 11px; font-weight: 700; color: var(--tb-active-ink);
  background: var(--tb-soft); border-radius: 6px; padding: 2px 7px; }
.sp-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sp-main b { color: var(--tb-ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-main small { color: var(--tb-ink-4); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-go { color: var(--tb-ink-4); }
.sp-phon { font-family: var(--tb-ipa); font-size: 11.5px; color: var(--tb-ink-4); }
.sp-empty { padding: 16px 10px; color: var(--tb-ink-4); font-size: 13px; }

/* ---------------- 发音设置（复刻 ipa 的 tts-ctl） ---------------- */
.tts-ctl { position: relative; flex: none; }
.tts-trigger { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 11px;
  border: 1px solid var(--tb-line); border-radius: 10px; background: var(--tb-surface);
  color: var(--tb-ink-2); font-size: 13px; font-weight: 600; box-shadow: var(--tb-sh-1); }
.tts-trigger:hover { border-color: var(--tb-hover-line); color: var(--tb-active-ink); }
.tts-wave { display: inline-flex; align-items: center; gap: 2px; height: 14px; }
.tts-wave i { width: 2.5px; border-radius: 2px; background: var(--tb-grad); height: 6px; }
.tts-wave i:nth-child(2) { height: 13px; }
.tts-wave i:nth-child(3) { height: 9px; }
.tts-ctl.is-playing .tts-wave i { animation: tbWave .7s ease-in-out infinite alternate; }
.tts-ctl.is-playing .tts-wave i:nth-child(2) { animation-delay: .18s; }
.tts-ctl.is-playing .tts-wave i:nth-child(3) { animation-delay: .36s; }
@keyframes tbWave { from { height: 4px; } to { height: 14px; } }
.tts-trigger-caret { color: var(--tb-ink-4); font-size: 10px; }
.tts-pop {
  position: absolute; right: 0; top: calc(100% + 10px); width: 336px;
  background: var(--tb-surface); border: 1px solid var(--tb-line); border-radius: var(--tb-r);
  box-shadow: var(--tb-sh-3); padding: 14px; z-index: 80;
  max-height: min(82vh, 760px); overflow-y: auto; overscroll-behavior: contain;
}
.tts-pop-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.tts-pop-head b { display: block; font-size: 15px; color: var(--tb-ink); }
.tts-pop-head small { display: block; font-size: 11.5px; color: var(--tb-ink-4); }
.tts-pop-close { border: 0; background: transparent; color: var(--tb-ink-4); font-size: 14px; padding: 2px 6px; }
.tts-pop-sub { font-size: 11.5px; font-weight: 700; letter-spacing: .4px; color: var(--tb-ink-4);
  text-transform: uppercase; margin: 14px 0 8px; }
.tts-vgroup { font-size: 11px; color: var(--tb-ink-4); margin: 10px 2px 5px; font-weight: 700; }
.tts-voice { display: flex; align-items: center; gap: 8px; padding: 8px 9px; border-radius: 9px;
  border: 1px solid transparent; cursor: pointer; }
.tts-voice:hover { background: var(--tb-line-2); }
.tts-voice.on { background: var(--tb-active-bg); border-color: var(--tb-soft-line); }
.tts-voice-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tts-voice-name { font-size: 13.5px; font-weight: 600; color: var(--tb-ink); }
.tts-voice-name em { font-style: normal; font-size: 11px; font-weight: 500; color: var(--tb-ink-4); margin-left: 6px; }
.tts-voice-note { font-size: 11px; color: var(--tb-ink-4); }
.tts-voice-play { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--tb-line);
  background: var(--tb-surface); color: var(--tb-active-ink); font-size: 10px; }
.tts-voice-play:hover { border-color: var(--tb-hover-line); background: var(--tb-soft); }
.tts-speeds, .tts-accents { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tts-accents { grid-template-columns: repeat(2, 1fr); }
.tts-speed { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 4px;
  border: 1px solid var(--tb-line); border-radius: 9px; background: var(--tb-surface);
  color: var(--tb-ink-2); font-size: 12.5px; font-weight: 600; }
.tts-speed small { font-size: 10px; font-weight: 400; color: var(--tb-ink-4); }
.tts-speed.on { background: var(--tb-grad); border-color: transparent; color: #fff; }
.tts-speed.on small { color: rgba(255, 255, 255, .82); }
.tts-check { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 12.5px; color: var(--tb-ink-3); cursor: pointer; }
.tts-check input { accent-color: #6366f1; width: 15px; height: 15px; }
.tts-pop-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--tb-line); }
.tts-preview { padding: 7px 14px; border-radius: 9px; border: 1px solid var(--tb-line);
  background: var(--tb-soft); color: var(--tb-soft-ink); font-size: 12.5px; font-weight: 600; }
.tts-preview:hover { border-color: var(--tb-hover-line); }
#ttsCacheInfo { font-size: 11px; color: var(--tb-ink-4); }
.tts-mask { position: fixed; inset: 0; background: rgba(16, 24, 40, .34); z-index: 75; }
.tts-pop.is-sheet { position: fixed; left: 10px; right: 10px; top: auto; bottom: 10px;
  width: auto; max-height: 80vh; z-index: 80; animation: tbSlideUp .22s cubic-bezier(.32, .72, 0, 1); }
@keyframes tbSlideUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------- 首页 Hero ---------------- */
.hero { display: grid; grid-template-columns: 1fr 268px; gap: 34px; align-items: center; padding: 18px 0 46px; }
.hero h1 { margin: 0 0 16px; font-size: clamp(29px, 4.6vw, 46px); font-weight: 800; letter-spacing: -1.2px; line-height: 1.2; }
.hero h1 span { background: var(--tb-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { max-width: 620px; margin: 0 0 24px; color: var(--tb-ink-3); font-size: 15px; line-height: 1.85; }
.hero-lead b { color: var(--tb-ink-2); font-weight: 600; }
.hero-stats { display: flex; gap: 30px; }
.stat { display: flex; flex-direction: column; }
.stat strong { font-size: 26px; font-weight: 700; color: var(--tb-ink); font-family: var(--tb-ipa); line-height: 1.1; }
.stat span { font-size: 12px; color: var(--tb-ink-4); }
.progress-card { background: var(--tb-surface); border: 1px solid var(--tb-line); border-radius: var(--tb-r-lg);
  box-shadow: var(--tb-sh-2); padding: 24px 20px; text-align: center; }
.ring { --p: 0; width: 108px; height: 108px; margin: 0 auto 12px; border-radius: 50%;
  background: conic-gradient(#3b82f6 calc(var(--p) * 1%), var(--tb-line-2) 0);
  display: grid; place-items: center; transition: background .4s; }
.ring-in { width: 88px; height: 88px; border-radius: 50%; background: var(--tb-surface); display: grid; place-items: center; align-content: center; }
.ring-in strong { font-size: 27px; font-weight: 700; color: var(--tb-ink); line-height: 1; }
.ring-in span { font-size: 12px; color: var(--tb-ink-4); }
.pc-label { margin: 0 0 2px; font-size: 13.5px; font-weight: 600; color: var(--tb-ink); }
.pc-sub { margin: 0 0 14px; font-size: 12px; color: var(--tb-ink-4); }
.progress-card .tbtn { width: 100%; }

/* ---------------- 单元卡片 ---------------- */
.unit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.unit-card { display: flex; flex-direction: column; min-height: 178px; padding: 20px;
  background: var(--tb-surface); border: 1px solid var(--tb-line); border-radius: var(--tb-r);
  box-shadow: var(--tb-sh-1); transition: transform .2s, box-shadow .2s, border-color .2s; }
.unit-card:hover { transform: translateY(-3px); box-shadow: var(--tb-sh-3); border-color: var(--tb-soft-line); }
.unit-card.is-done { border-color: var(--tb-ok); }
.uc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.uc-no { font-family: var(--tb-ipa); font-size: 12px; font-weight: 700; letter-spacing: .4px;
  color: var(--tb-active-ink); background: var(--tb-soft); padding: 3px 9px; border-radius: 7px; }
.done-badge { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--tb-ok); background: var(--tb-ok-bg); padding: 2px 8px; border-radius: 999px; }
.uc-arrow { margin-left: auto; color: var(--tb-ink-4); font-size: 15px; }
.done-badge:not([hidden]) + .uc-arrow { margin-left: 0; }
.unit-card h2 { margin: 0 0 10px; font-size: 15.5px; font-weight: 700; line-height: 1.45; }
.uc-texts { list-style: none; margin: 0 0 14px; padding: 0; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.uc-texts li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--tb-ink-3); min-width: 0; }
.uc-texts .ab { flex: none; width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center;
  background: var(--tb-line-2); color: var(--tb-ink-3); font-size: 10.5px; font-weight: 700; }
.uc-texts .tt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-top: 11px; border-top: 1px solid var(--tb-line-2); font-size: 11.5px; color: var(--tb-ink-4); }
.uc-foot .go { color: var(--tb-active-ink); font-weight: 600; }
.site-footer { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--tb-line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--tb-ink-4); }
.footer-beian a:hover { color: var(--tb-active-ink); }

/* ---------------- 单元页 ---------------- */
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--tb-ink-4); margin-bottom: 20px; }
.crumbs a:hover { color: var(--tb-active-ink); }
.unit-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.unit-head h1 { margin: 0 0 6px; font-size: 27px; font-weight: 700; letter-spacing: -.6px; }
.unit-sub { margin: 0; font-size: 13px; color: var(--tb-ink-3); }
.us-item b { color: var(--tb-active-ink); font-weight: 600; }
.us-sep { margin: 0 8px; color: var(--tb-ink-4); }
.btn-done { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px;
  border: 1px solid var(--tb-line); border-radius: 10px; background: var(--tb-surface);
  color: var(--tb-ink-2); font-size: 13px; font-weight: 600; }
.btn-done:hover { border-color: var(--tb-hover-line); color: var(--tb-active-ink); }
.btn-done .check { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  background: var(--tb-line-2); color: var(--tb-ink-3); font-size: 12px; }
.btn-done.is-done { border-color: var(--tb-ok); color: var(--tb-ok); }
.btn-done.is-done .check { background: var(--tb-ok); color: #fff; }

/* Text A / B 切换（沿用 ipa 的 .qz-tab.is-on 风格） */
.text-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 4px;
  background: var(--tb-surface); border: 1px solid var(--tb-line); border-radius: var(--tb-r); margin-bottom: 20px; }
.text-tabs button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 10px 16px;
  border: 0; border-radius: 10px; background: transparent; color: var(--tb-ink-3); text-align: left; }
.text-tabs button:hover { background: var(--tb-line-2); }
.text-tabs button.active { background: var(--tb-soft); color: var(--tb-soft-ink); font-weight: 700; }
.text-tabs button b { font-size: 13.5px; }
.text-tabs button span { font-size: 12px; font-weight: 400; opacity: .85; }

.text-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.th-label { margin: 0 0 3px; font-size: 12px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--tb-active-ink); }
.text-head h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.4px; }
.th-meta { font-size: 12px; color: var(--tb-ink-4); white-space: nowrap; }

/* 阅读工具栏 */
.reader-hint { margin: 0 0 12px; padding: 9px 13px; border-radius: var(--tb-r-sm);
  background: var(--tb-grad-soft); border: 1px solid var(--tb-soft-line);
  font-size: 12.5px; color: var(--tb-ink-3); }
.reader-hint b { color: var(--tb-active-ink); font-weight: 600; }
.reader-hint u { text-decoration-style: dashed; text-underline-offset: 3px; }
.reader-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tool-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 9px;
  border: 1px solid var(--tb-line); background: var(--tb-surface); color: var(--tb-ink-2);
  font-size: 13px; font-weight: 600; box-shadow: var(--tb-sh-1); }
.tool-btn svg { width: 15px; height: 15px; flex: none; }
.tool-btn:hover { border-color: var(--tb-hover-line); color: var(--tb-active-ink); }
.tool-btn.primary { background: var(--tb-grad); border-color: transparent; color: #fff; }
.tool-btn.primary:hover { color: #fff; }
.tool-btn.is-on { background: var(--tb-soft); border-color: var(--tb-soft-line); color: var(--tb-soft-ink); }
.tool-btn:disabled { opacity: .45; cursor: not-allowed; }
.reader-tools .spacer { flex: 1; }
.fontctl { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--tb-line);
  border-radius: 9px; background: var(--tb-surface); padding: 2px; }
.fontctl button { border: 0; background: transparent; color: var(--tb-ink-2); font-size: 12.5px; font-weight: 600; padding: 5px 9px; border-radius: 7px; }
.fontctl button:hover { background: var(--tb-line-2); }
.fontctl span { min-width: 24px; text-align: center; font-size: 12.5px; color: var(--tb-ink-3); }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--tb-ink-3); cursor: pointer; }
.switch input { accent-color: #6366f1; width: 15px; height: 15px; }

/* ---------------- 课文正文 ---------------- */
.prose {
  --read-size: 18px;
  background: var(--tb-surface); border: 1px solid var(--tb-line); border-radius: var(--tb-r);
  box-shadow: var(--tb-sh-1); padding: 26px 30px; margin-bottom: 26px;
}
.prose p.para { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 16px; font-size: var(--read-size);
  line-height: 1.95; color: var(--tb-ink); font-family: Georgia, "Times New Roman", var(--tb-ipa), serif; }
.prose p.para:last-child { margin-bottom: 0; }
.pnum { flex: none; width: 25px; height: 25px; margin-top: 5px; border-radius: 7px; border: 1px solid var(--tb-line);
  background: var(--tb-line-2); color: var(--tb-ink-3); font-size: 11.5px; font-weight: 700; font-family: var(--tb-ipa); }
.pnum:hover { background: var(--tb-soft); color: var(--tb-soft-ink); border-color: var(--tb-soft-line); }
.ptext { flex: 1; min-width: 0; }
.section-heading { margin: 22px 0 10px; font-size: 16px; font-weight: 700; color: var(--tb-ink); }
.prose blockquote.quote { margin: 0 0 16px; padding: 14px 18px; border-left: 3px solid var(--tb-brand);
  background: var(--tb-line-2); border-radius: 0 var(--tb-r-sm) var(--tb-r-sm) 0;
  font-size: var(--read-size); line-height: 1.9; color: var(--tb-ink); }

/* 逐词点读：课文里每个英文单词都可点 */
.prose .word { cursor: pointer; border-radius: 4px; padding: 0 1px; transition: background .12s, box-shadow .12s; }
.prose .word:hover { background: var(--tb-blue-wash); box-shadow: 0 0 0 2px var(--tb-blue-wash); }
.prose .word.is-current { background: var(--tb-soft); color: var(--tb-soft-ink); box-shadow: 0 0 0 2px var(--tb-soft-line); }
/* 本课生词：额外虚线下划线提示（保留新教材原功能） */
.prose .word.w { border-bottom: 1px dashed var(--tb-brand-2); }
.prose.no-hl .word.w { border-bottom: 0; }
.prose .para.speaking, .prose .quote.speaking { background: var(--tb-soft); border-radius: 8px; }
.prose em { font-style: italic; }

/* 逐段对照翻译 */
.para-zh { display: flex; align-items: flex-start; gap: 9px; margin: -8px 0 18px 37px; padding: 10px 14px;
  background: var(--tb-line-2); border-radius: var(--tb-r-sm); font-size: 13.5px; line-height: 1.8;
  color: var(--tb-ink-3); }
.prose:not(.show-zh) .para-zh { display: none; }
.zh-badge { flex: none; font-size: 10.5px; font-weight: 700; color: var(--tb-active-ink);
  background: var(--tb-soft); border-radius: 5px; padding: 1px 6px; margin-top: 2px; }
.quote-zh { margin-left: 0; }

/* ---------------- 本课单词表 ---------------- */
.vocab-block { background: var(--tb-surface); border: 1px solid var(--tb-line); border-radius: var(--tb-r);
  box-shadow: var(--tb-sh-1); padding: 22px; }
.vocab-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.vocab-head h3 { margin: 0; font-size: 17px; font-weight: 700; }
.vocab-head .cn { font-size: 12.5px; font-weight: 400; color: var(--tb-ink-4); margin-left: 7px; }
.vocab-head .count { display: inline-block; margin-left: 8px; font-size: 11.5px; font-weight: 600;
  color: var(--tb-active-ink); background: var(--tb-soft); padding: 2px 8px; border-radius: 999px; vertical-align: 2px; }
.vocab-tools { display: flex; align-items: center; gap: 8px; }
.mini-input, .mini-field input { border: 1px solid var(--tb-line); border-radius: 9px; background: var(--tb-surface);
  color: var(--tb-ink); font-size: 13px; padding: 7px 11px; outline: 0; }
.mini-input:focus, .mini-field input:focus { border-color: var(--tb-hover-line); }
.vocab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 10px; }
.vocab-card { padding: 12px 14px; border: 1px solid var(--tb-line); border-radius: var(--tb-r-sm);
  background: var(--tb-surface); transition: border-color .2s, box-shadow .2s; }
.vocab-card:hover { border-color: var(--tb-soft-line); box-shadow: var(--tb-sh-1); }
.vocab-card.flash { border-color: var(--tb-brand); box-shadow: 0 0 0 3px var(--tb-blue-wash); }
.vc-top { display: flex; align-items: center; gap: 8px; }
.vc-word { font-family: var(--tb-ipa); font-size: 15px; font-weight: 700; color: var(--tb-ink); }
.vc-pos { font-size: 11px; color: var(--tb-ink-4); font-style: italic; }
.vc-speak { margin-left: auto; border: 0; background: transparent; color: var(--tb-ink-4); padding: 3px; line-height: 0; }
.vc-speak svg { width: 17px; height: 17px; }
.vc-speak:hover { color: var(--tb-active-ink); }
.vc-phon { font-family: var(--tb-ipa); font-size: 12px; color: var(--tb-ink-4); margin: 2px 0 4px; }
.vc-meaning { font-size: 13px; color: var(--tb-ink-2); }
.vocab-grid.covered .vc-meaning { color: transparent; background: var(--tb-line-2); border-radius: 5px; cursor: pointer; user-select: none; }
.vocab-grid.covered .vocab-card.revealed .vc-meaning { color: var(--tb-ink-2); background: transparent; }

/* 单元翻页 */
.unit-pager { display: flex; justify-content: space-between; gap: 14px; margin-top: 26px; }
.pager-link { display: flex; flex-direction: column; gap: 2px; flex: 1; max-width: 48%; padding: 14px 16px;
  border: 1px solid var(--tb-line); border-radius: var(--tb-r); background: var(--tb-surface); }
.pager-link:hover { border-color: var(--tb-soft-line); box-shadow: var(--tb-sh-2); }
.pager-link small { font-size: 11.5px; color: var(--tb-ink-4); }
.pager-link span { font-size: 13.5px; font-weight: 600; color: var(--tb-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager-link.next { text-align: right; align-items: flex-end; }

/* ---------------- 词汇总表 ---------------- */
.page-head { margin-bottom: 22px; }
.page-head h1 { margin: 0 0 8px; font-size: 30px; font-weight: 700; letter-spacing: -.7px; }
.page-head > p:last-child { margin: 0; font-size: 13.5px; color: var(--tb-ink-3); }
.gloss-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.mini-field { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 220px; padding: 0 11px;
  border: 1px solid var(--tb-line); border-radius: 10px; background: var(--tb-surface); }
.mini-field svg { width: 16px; height: 16px; color: var(--tb-ink-4); flex: none; }
.mini-field input { flex: 1; min-width: 0; border: 0; padding: 9px 0; }
.gloss-tools select { border: 1px solid var(--tb-line); border-radius: 10px; background: var(--tb-surface);
  color: var(--tb-ink-2); font-size: 13px; padding: 9px 11px; outline: 0; }
.gloss-count { margin: 0 0 18px; font-size: 12.5px; color: var(--tb-ink-4); }
.gloss-group { margin-bottom: 28px; }
.gg-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--tb-line); }
.gg-no { font-family: var(--tb-ipa); font-size: 12px; font-weight: 700; color: var(--tb-active-ink);
  background: var(--tb-soft); padding: 3px 9px; border-radius: 7px; }
.gg-head h2 { margin: 0; font-size: 16px; font-weight: 700; flex: 1; }
.gg-count { font-size: 12px; color: var(--tb-ink-4); }
.empty { padding: 40px; text-align: center; color: var(--tb-ink-4); background: var(--tb-surface);
  border: 1px dashed var(--tb-line); border-radius: var(--tb-r); }

/* ---------------- 生词快速气泡 ---------------- */
.popover { position: fixed; z-index: 120; width: 250px; max-width: calc(100vw - 24px);
  background: var(--tb-surface); border: 1px solid var(--tb-line); border-radius: var(--tb-r);
  box-shadow: var(--tb-sh-3); padding: 14px 16px; }
.pop-head { display: flex; align-items: baseline; gap: 8px; }
.pop-word { font-family: var(--tb-ipa); font-size: 17px; font-weight: 700; color: var(--tb-ink); }
.pop-pos { font-size: 11.5px; font-style: italic; color: var(--tb-ink-4); }
.pop-phon { font-family: var(--tb-ipa); font-size: 12px; color: var(--tb-ink-4); margin: 2px 0 6px; }
.pop-meaning { font-size: 13.5px; color: var(--tb-ink-2); line-height: 1.6; }
.pop-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--tb-line-2); }
.pop-foot .tool-btn { padding: 5px 10px; font-size: 12px; }
.pop-foot span { font-size: 11px; color: var(--tb-ink-4); }
.pop-dict { border: 0; background: transparent; color: var(--tb-active-ink); font-size: 11.5px; font-weight: 600; padding: 4px 0; }

/* ---------------- 单词点读词典卡片（对齐 zhenti/exam.php） ---------------- */
.wd-overlay { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(0, 0, 0, .4); backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
.wd-overlay.show { opacity: 1; visibility: visible; }
.wd-card { position: relative; display: flex; flex-direction: column; width: 90%; max-width: 390px; max-height: 85vh;
  overflow-y: auto; background: var(--tb-surface); border: 1px solid var(--tb-line);
  border-radius: var(--tb-r-lg); box-shadow: var(--tb-sh-3); padding: 24px 20px 20px; }
.wd-close { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--tb-line); background: var(--tb-surface); color: var(--tb-ink-3); font-size: 13px; }
.wd-close:hover { color: var(--tb-active-ink); border-color: var(--tb-hover-line); }
.wd-header { text-align: center; margin-bottom: 16px; }
.wd-word { font-family: var(--tb-ipa); font-size: 30px; font-weight: 700; color: var(--tb-active-ink); line-height: 1.3; word-break: break-word; }
.wd-phon { font-family: var(--tb-ipa); font-size: 13.5px; color: var(--tb-ink-4); font-style: italic; margin: 4px 0; }
.wd-pos { display: inline-block; font-size: 11.5px; color: var(--tb-active-ink); background: var(--tb-soft);
  border-radius: 999px; padding: 2px 10px; }
.wd-source { display: block; margin-top: 5px; font-size: 11px; color: var(--tb-ink-4); }
.wd-body { display: flex; flex-direction: column; gap: 10px; }
.wd-section { background: var(--tb-line-2); border-radius: var(--tb-r-sm); padding: 12px 14px; }
.wd-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; color: var(--tb-active-ink); margin-bottom: 6px; }
.wd-def { font-size: 13.5px; line-height: 1.75; color: var(--tb-ink-2); white-space: pre-line; }
.wd-loading { color: var(--tb-ink-4); }
.wd-examples { display: flex; flex-direction: column; gap: 8px; }
.example-item { background: var(--tb-line-2); border-radius: var(--tb-r-sm); padding: 10px 12px; border-left: 3px solid var(--tb-brand); }
.example-en { font-size: 13px; color: var(--tb-active-ink); font-weight: 600; line-height: 1.55; }
.example-zh { font-size: 12.5px; color: var(--tb-ink-3); margin-top: 3px; line-height: 1.6; }
.wd-actions { display: flex; gap: 10px; align-items: stretch; }
.wd-actions .tbtn { flex: 1; border-radius: 999px; padding: 9px 12px; font-size: 13px; }
.wd-actions #btnFavWord { background: linear-gradient(135deg, #f59e0b, #f97316); border: 0; color: #fff; }
.wd-actions #btnFavWord:disabled { opacity: .6; cursor: default; }
/* 「收藏到小程序」：静态内置按钮 + js/danci-collect.js 注入的按钮共用同一套视觉，
   两者任一存在都会与「收藏到我的闪卡」并排成一行 */
.wd-favrow { display: flex; gap: 10px; align-items: stretch; }
.wd-fav { flex: 1; display: flex; }
.wd-fav .tbtn { flex: 1; }
.wd-favrow .dcx-mrow, .wd-actions .dcx-mrow { display: flex; flex: 1; margin-top: 0 !important; align-items: stretch; }
.wd-favrow .dcx-mbtn, .wd-actions .dcx-mbtn {
  flex: 1; height: 100%; padding: 9px 12px; border: 0; border-radius: 999px;
  background: linear-gradient(135deg, #1d9e75, #0f9d8a); color: #fff;
  font-size: 12.5px !important; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: filter .15s, opacity .15s;
}
.wd-favrow .dcx-mbtn:hover, .wd-actions .dcx-mbtn:hover { filter: brightness(1.06); }
.wd-favrow .dcx-mbtn:disabled, .wd-actions .dcx-mbtn:disabled { opacity: .65; cursor: default; }
.wd-favrow .dcx-mbtn.is-done, .wd-actions .dcx-mbtn.is-done {
  background: var(--tb-line-2); color: var(--tb-ink-4); cursor: default;
}
@media (max-width: 480px) {
  .wd-favrow { gap: 7px; }
  .wd-favrow .dcx-mbtn { padding: 9px 6px; font-size: 11.5px !important; }
}

/* ---------------- Toast（对齐 ipa） ---------------- */
.toast-wrap { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 10px 18px; border-radius: 999px; background: rgba(16, 24, 40, .92); color: #fff;
  font-size: 13.5px; box-shadow: var(--tb-sh-3); animation: tbToastIn .25s ease; }
@keyframes tbToastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------- 响应式（保持 900 / 720 / 560 / 480 四档） ---------------- */
@media (max-width: 900px) {
  .unit-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr 240px; gap: 22px; }
  .nav-toggle { display: block; }
  .nav-links { position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--tb-surface); border-bottom: 1px solid var(--tb-line); padding: 8px 22px 14px; display: none; box-shadow: var(--tb-sh-2); }
  .nav-links.open { display: flex; }
  .search { margin-left: auto; }
}
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .nav-wrap { padding: 0 14px; gap: 10px; height: 60px; }
  .nav-links { top: 60px; }
  .brand-text i { display: none; }
  .search { flex: 1 1 120px; min-width: 0; }
  .search kbd { display: none; }
  .search-panel { width: min(340px, calc(100vw - 28px)); right: auto; }
  .tts-trigger-label, .tts-trigger-caret { display: none; }
  .tts-trigger { padding: 0 10px; }
  .tts-pop.is-sheet { left: 10px; right: 10px; bottom: 10px; }
  .section { padding-top: 36px; padding-bottom: 36px; }
  .section.tight { padding-top: 26px; padding-bottom: 26px; }
  .wrap { padding: 0 16px; }
  .section-head h2 { font-size: 19px; }
  .hero { grid-template-columns: 1fr; gap: 22px; padding: 6px 0 32px; }
  .progress-card { max-width: 320px; }
  .hero-stats { gap: 22px; }
  .unit-grid { grid-template-columns: 1fr; }
  .unit-card { min-height: 0; }
  .prose { padding: 20px 16px; }
  .prose p.para { gap: 9px; font-size: var(--read-size); }
  .para-zh { margin-left: 0; }
  .vocab-block { padding: 16px; }
  .vocab-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .text-head h2 { font-size: 19px; }
  .unit-head { flex-direction: column; gap: 12px; }
  .unit-head h1 { font-size: 22px; }
  .reader-tools { gap: 6px; }
  .reader-tools .spacer { flex-basis: 100%; height: 0; }
  .pager-link { padding: 11px 12px; }
}
@media (max-width: 560px) {
  .hero h1 { font-size: 29px; }
  .hero-stats { gap: 16px; }
  .stat strong { font-size: 21px; }
  .page-head h1 { font-size: 25px; }
  .tts-speeds { grid-template-columns: repeat(2, 1fr); }
  .vocab-grid { grid-template-columns: 1fr 1fr; }
  .unit-pager { flex-direction: column; }
  .pager-link { max-width: 100%; }
  .pager-link.next { text-align: left; align-items: flex-start; }
  .search { order: 3; flex-basis: 100%; }
  .nav-wrap { flex-wrap: wrap; height: auto; min-height: 60px; padding: 8px 14px; }
  .nav-links { top: 100%; }
}
@media (max-width: 480px) {
  .vocab-grid { grid-template-columns: 1fr; }
  .text-tabs { grid-template-columns: 1fr; }
}

/* 打印 */
/* ---------------- 课文配图 ---------------- */
.text-figure { margin: 22px 0 26px; }
.text-figure .tf-img {
  position: relative; overflow: hidden; border-radius: var(--tb-r);
  background: var(--tb-grad-soft); border: 1px solid var(--tb-line);
  box-shadow: var(--tb-sh-2);
}
.text-figure .tf-img::after {
  content: ''; display: block; padding-top: 66.667%;   /* 3:2 横图比例 */
}
.text-figure .tf-img img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.text-figure figcaption {
  margin-top: 9px; padding: 0 4px; text-align: center;
  font-family: var(--tb-font);
}
.text-figure figcaption b {
  display: block; font-size: 13px; font-weight: 600; color: var(--tb-ink-2); line-height: 1.6;
}
.text-figure figcaption span {
  display: block; margin-top: 2px; font-size: 11.5px; font-style: italic; color: var(--tb-ink-4);
}
html.dark .text-figure .tf-img { border-color: var(--tb-line); }

@media (max-width: 720px) {
  .text-figure { margin: 18px -6px 22px; }
  .text-figure figcaption b { font-size: 12.5px; }
  .text-figure figcaption span { font-size: 11px; }
}

@media print {
  .text-figure .tf-img { box-shadow: none; break-inside: avoid; }
  .site-header, .reader-tools, .unit-pager, .crumbs, .btn-done, .toast-wrap, .popover, .wd-overlay, .site-footer { display: none !important; }
  body { background: #fff; }
  .prose, .vocab-block { box-shadow: none; border-color: #ddd; }
  .prose:not(.show-zh) .para-zh { display: flex; }
}

/* ============================================================
   手机端精简版式（2026-11-20）
   目标：去掉营销性文案与讲解提示，压缩纵向留白，
        让「单元列表 / 课文正文」尽早进入首屏。
   只作用于窄屏，桌面端仍保留完整 Hero 与说明。
   ============================================================ */
@media (max-width: 720px) {
  /* 通用留白 */
  .wrap { padding: 0 14px; }
  .section { padding-top: 18px; padding-bottom: 18px; }
  .section.tight { padding-top: 14px; padding-bottom: 20px; }
  .section-head { margin-bottom: 12px; }
  .section-head h2 { margin-bottom: 0; font-size: 18px; }
  .section-head > p { font-size: 11.5px; }
  .eyebrow { margin-bottom: 5px; font-size: 11px; }

  /* 首页：隐藏营销 Hero，进度卡改为单行紧凑条 */
  .hero { display: block; gap: 0; padding: 0 0 14px; }
  .hero-copy { display: none !important; }
  .progress-card {
    display: grid; max-width: none; text-align: left;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    grid-template-areas: "ring label btn" "ring sub btn";
    align-items: center; column-gap: 12px; row-gap: 2px;
    padding: 11px 12px; border-radius: var(--tb-r);
  }
  .progress-card .ring { grid-area: ring; width: 54px; height: 54px; margin: 0; }
  .progress-card .ring-in { width: 44px; height: 44px; }
  .progress-card .ring-in strong { font-size: 17px; }
  .progress-card .ring-in span { font-size: 10px; }
  .pc-label { grid-area: label; margin: 0; font-size: 13px; }
  .pc-sub { grid-area: sub; margin: 0; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .progress-card .tbtn { grid-area: btn; width: auto; margin: 0; padding: 9px 13px; font-size: 12.5px; white-space: nowrap; }

  /* 单元页：去掉与 Tab 重复的副标题和「讲解」提示 */
  .crumbs { margin-bottom: 10px; font-size: 12px; }
  .unit-head { margin-bottom: 12px; gap: 10px; }
  .unit-head h1 { margin: 0; font-size: 20px; letter-spacing: -.4px; }
  .unit-sub { display: none; }
  .btn-done { padding: 7px 11px; font-size: 12px; }
  .text-tabs { margin-bottom: 12px; padding: 3px; }
  .text-tabs button { padding: 8px 12px; }
  .text-tabs button b { font-size: 12.5px; }
  .text-tabs button span { font-size: 11px; }
  .text-head { margin-bottom: 10px; }
  .text-head h2 { font-size: 18px; }
  .th-label { margin-bottom: 2px; font-size: 11px; }
  .th-meta { font-size: 11px; }
  .reader-hint { display: none !important; }
  .reader-tools { margin-bottom: 12px; gap: 6px; }
  .tool-btn { padding: 7px 11px; font-size: 12.5px; }
  .fontctl button { padding: 4px 8px; }
  .switch { font-size: 11.5px; }

  /* 课文正文：行距 / 段距收紧，减少翻屏 */
  .prose { padding: 14px; margin-bottom: 18px; }
  .prose p.para { gap: 8px; margin-bottom: 14px; line-height: 1.72; }
  .pnum { width: 22px; height: 22px; margin-top: 3px; font-size: 10.5px; }
  .section-heading { margin: 16px 0 8px; font-size: 15px; }
  .prose blockquote.quote { margin-bottom: 14px; padding: 11px 13px; line-height: 1.72; }
  .para-zh { margin: -4px 0 14px 30px; padding: 9px 11px; font-size: 12.5px; line-height: 1.7; }
  .zh-badge { font-size: 10px; padding: 1px 5px; }
  .text-figure { margin: 12px -4px 16px; }

  /* 单词表 / 翻页 / 页脚 */
  .vocab-block { padding: 14px; }
  .vocab-head { margin-bottom: 12px; }
  .vocab-grid { gap: 8px; }
  .unit-pager { margin-top: 16px; }
  .site-footer { margin-top: 22px; padding-top: 14px; font-size: 11px; }

  /* 词汇总表 */
  .page-head { margin-bottom: 14px; }
  .gloss-count { margin-bottom: 12px; }
  .gloss-group { margin-bottom: 18px; }
  .gg-head { margin-bottom: 10px; padding-bottom: 8px; }
}

@media (max-width: 560px) {
  .nav-wrap { padding: 6px 12px; gap: 8px; min-height: 0; }
  .search { height: 34px; }
}

@media (max-width: 400px) {
  .progress-card {
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-areas: "ring label" "ring sub" "btn btn";
    row-gap: 4px;
  }
  .progress-card .ring { width: 48px; height: 48px; }
  .progress-card .ring-in { width: 40px; height: 40px; }
  .progress-card .tbtn { width: 100%; padding: 8px 12px; }
}
