/* 浦漫英语 — 浦漫编辑部 · 纸感样式 */
:root {
  --paper: #F6F1E8;
  --sheet: #FFFDF8;
  --sheet-2: #EFE8DC;
  --ink: #1C1917;
  --muted: #78716C;
  --line: #E7E5E4;
  --line-strong: #D6D3D1;
  --verm: #C2410C;
  --verm-deep: #9A3412;
  --teal: #0F766E;
  --apricot: #F5E6D3;
  --apricot-ink: #9A3412;
  --moss: #E4EDE4;
  --moss-ink: #166534;
  --ok: #15803D;
  --warn: #B45309;
  --radius: 14px;
  --shadow: 0 1px 0 rgba(28, 25, 23, .04);
  --nav-h: 68px;
  --max: 1120px;
  --read-max: 720px;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", "PingFang SC", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(194, 65, 12, .05), transparent 55%),
    radial-gradient(900px 400px at 100% 0%, rgba(15, 118, 110, .04), transparent 50%),
    var(--paper);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font-family: inherit; }
img { max-width: 100%; display: block; }

.container {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}
.container-narrow {
  width: min(var(--read-max), calc(100% - 40px));
  margin: 0 auto;
}

/* 纸纹细线工具 */
.hairline {
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), transparent);
  border: 0;
  margin: 0;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--verm);
}
.kicker::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--verm);
}

/* Nav */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(246, 241, 232, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-nav .inner {
  height: 100%;
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: .04em;
}
.brand span {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--muted);
}
.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  border: 1px solid transparent;
}
.nav-link:hover { background: var(--sheet); }
.nav-link.ghost {
  border-color: var(--line-strong);
  background: var(--sheet);
}
.nav-link.primary {
  background: var(--ink);
  color: var(--sheet);
  border-color: var(--ink);
}
.nav-link.primary:hover { background: #000; }

/* —— 账号 / 激活码 —— */
.auth-slot {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.auth-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--moss);
  color: var(--moss-ink);
  border: 1px solid #BBF7D0;
  white-space: nowrap;
}
.auth-badge.warn {
  background: var(--apricot);
  color: var(--apricot-ink);
  border-color: #FED7AA;
}
.auth-badge-slot { display: inline-flex; }
.auth-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 160px;
  background: var(--sheet);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(28,25,23,.12);
  padding: 6px;
  z-index: 60;
  display: flex;
  flex-direction: column;
}
/* 必须压过 display:flex，否则 hidden 属性无效，菜单关不掉 */
.auth-menu[hidden] { display: none !important; }
.auth-menu button {
  border: none;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
}
.auth-menu button:hover { background: var(--sheet-2); }

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(28,25,23,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-overlay[hidden] { display: none !important; }
.auth-modal {
  width: min(420px, 100%);
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 24px 60px rgba(28,25,23,.22);
}
.auth-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
}
.auth-tabs { margin-bottom: 16px; }
.auth-tabs button { flex: 1; padding: 8px 10px; font-size: 13px; }
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .04em;
  margin-bottom: 12px;
}
.auth-field input {
  border: 1px solid var(--line-strong);
  background: var(--paper);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 14px;
  color: var(--ink);
  outline: none;
}
.auth-field input:focus { border-color: var(--verm); }
.auth-actions { display: flex; gap: 8px; margin-top: 4px; }
.auth-actions .btn { flex: 1; }
.auth-hint {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.auth-user { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.auth-user strong { color: var(--ink); }
.auth-empty { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.auth-demo {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.demo-chip {
  border: 1px dashed var(--line-strong);
  background: var(--paper);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  font-family: var(--mono);
  cursor: pointer;
  text-align: left;
  color: var(--ink);
}
.demo-chip:hover { border-color: var(--verm); color: var(--verm); }

.book-gate { position: relative; }
.book-gate.is-locked .nc-body,
.book-gate.is-locked .nc-art { filter: grayscale(.35); opacity: .55; }
.book-lock {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(28,25,23,.42);
  border-radius: 14px;
  color: #FFF7ED;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  z-index: 3;
  text-align: center;
  padding: 12px;
  backdrop-filter: blur(2px);
}
.book-lock .lock-ico { font-size: 22px; line-height: 1; }
.book-lock:hover { background: rgba(28,25,23,.55); }
.access-wall {
  margin: 28px auto;
  max-width: 480px;
  text-align: center;
  padding: 32px 24px;
}
.access-wall h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 24px;
}
.access-wall p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}
.access-wall .wall-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid transparent;
  cursor: pointer;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 20px;
  transition: background .18s ease, transform .12s ease, border-color .18s ease, color .18s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary {
  background: var(--verm);
  color: #FFF7ED;
  border-color: var(--verm-deep);
}
.btn-primary:hover { background: var(--verm-deep); }
.btn-secondary {
  background: var(--sheet);
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-secondary:hover { background: var(--sheet-2); }
.btn-dark {
  background: var(--ink);
  color: var(--sheet);
  border-color: var(--ink);
}
.btn-dark:hover { background: #000; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* Cards */
.card {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  background: var(--sheet-2);
  color: #44403C;
  border: 1px solid transparent;
}
.tag-blue { background: #ECFDF5; color: var(--teal); border-color: #CCFBF1; }
.tag-green { background: var(--moss); color: var(--moss-ink); border-color: #BBF7D0; }
.tag-violet { background: #F5F3FF; color: #6D28D9; border-color: #DDD6FE; }
.tag-pink { background: var(--apricot); color: var(--apricot-ink); border-color: #FED7AA; }

/* Segmented */
.seg {
  display: inline-flex;
  background: var(--sheet);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
  box-shadow: var(--shadow);
}
.seg button {
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: .18s ease;
}
.seg button:hover { color: var(--ink); }
.seg button.active {
  background: var(--ink);
  color: var(--sheet);
}

/* Progress */
.progress {
  height: 6px;
  background: var(--sheet-2);
  border-radius: 999px;
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--verm), #EA580C);
  border-radius: inherit;
  transition: width .35s ease;
}

/* Cover — 书脊海报感 */
.cover {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  color: #FFF7ED;
  aspect-ratio: 3 / 4;
  box-shadow:
    0 14px 28px rgba(28, 25, 23, .18),
    inset 0 0 0 1px rgba(255, 255, 255, .08);
  flex-shrink: 0;
  isolation: isolate;
}
.cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(255,255,255,.12), transparent 35%),
    linear-gradient(0deg, rgba(0,0,0,.45), transparent 55%);
  z-index: 1;
  pointer-events: none;
}
.cover::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  background: linear-gradient(90deg, rgba(0,0,0,.35), transparent);
  z-index: 2;
  pointer-events: none;
}
.cover .cover-inner {
  position: absolute;
  inset: 0;
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 3;
}
.cover .cover-badge {
  align-self: flex-start;
  background: rgba(28, 25, 23, .55);
  border: 1px solid rgba(255, 247, 237, .35);
  backdrop-filter: blur(6px);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
}
.cover .cover-title {
  font-family: var(--serif);
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .02em;
}
.cover .cover-sub {
  font-size: 11px;
  opacity: .8;
  margin-top: 8px;
  letter-spacing: .08em;
}
.cover .cover-orb {
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  right: -40px;
  bottom: 50px;
  background: radial-gradient(circle, rgba(255, 247, 237, .28), transparent 70%);
  z-index: 1;
  pointer-events: none;
}
.cover .cover-band {
  position: absolute;
  left: -10%;
  right: -10%;
  height: 48px;
  top: 42%;
  transform: rotate(-8deg);
  background: linear-gradient(90deg, transparent, rgba(194, 65, 12, .55), transparent);
  z-index: 1;
  pointer-events: none;
}

/* Footer */
.site-footer {
  margin-top: 72px;
  padding: 28px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.site-footer a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.site-footer a:hover {
  color: var(--ink, #1c1917);
}
.site-footer .footer-note {
  margin-top: 8px;
  font-size: 11px;
  opacity: 0.75;
  line-height: 1.7;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* ========== Dashboard ========== */
.hero {
  padding: 48px 0 8px;
}
.hero .kicker { margin-bottom: 12px; }
.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.2;
}
.hero .lede {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  max-width: 36em;
}

/* 编辑精选横幅 */
.feature-banner {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 28px;
  align-items: center;
  padding: 28px;
  background:
    linear-gradient(135deg, #1C1917 0%, #292524 55%, #44403C 100%);
  color: #FAF5EF;
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  border: 1px solid #292524;
}
.feature-banner::before {
  content: "EDITOR'S PICK";
  position: absolute;
  top: 18px;
  right: 22px;
  font-size: 10px;
  letter-spacing: .2em;
  color: rgba(250, 245, 239, .45);
  font-weight: 700;
}
.feature-banner::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -60px;
  bottom: -80px;
  background: radial-gradient(circle, rgba(194, 65, 12, .45), transparent 70%);
  pointer-events: none;
}
.feature-banner .mini-cover {
  width: 160px;
  height: auto;
  box-shadow: 0 18px 36px rgba(0, 0, 0, .35);
}
.feature-banner .label {
  font-size: 11px;
  letter-spacing: .18em;
  color: #FDBA74;
  font-weight: 800;
}
.feature-banner .title {
  font-family: var(--serif);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  margin-top: 8px;
  line-height: 1.3;
}
.feature-banner .sub {
  color: rgba(250, 245, 239, .7);
  font-size: 13px;
  margin-top: 8px;
}
.feature-banner .actions {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 140px;
}
.feature-banner .btn-primary {
  background: #FFF7ED;
  color: var(--ink);
  border-color: #FFF7ED;
}
.feature-banner .btn-primary:hover {
  background: var(--apricot);
}
.feature-banner .btn-ghost {
  background: transparent;
  color: #FAF5EF;
  border-color: rgba(250, 245, 239, .35);
}
.feature-banner .btn-ghost:hover {
  background: rgba(250, 245, 239, .1);
}

/* 进度环 */
.ring-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}
.ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-wrap .ring-bg { fill: none; stroke: rgba(250,245,239,.15); stroke-width: 6; }
.ring-wrap .ring-fg {
  fill: none;
  stroke: #FB923C;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset .6s ease;
}
.ring-wrap .ring-txt {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  color: #FAF5EF;
  font-family: var(--mono);
}

/* Section */
.section {
  margin-top: 64px;
}
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(26px, 3.2vw, 34px);
  font-weight: 700;
  letter-spacing: .03em;
}
.section-head .hint {
  color: var(--muted);
  font-size: 13px;
}
.section-rule {
  height: 1px;
  background: var(--line-strong);
  margin: 14px 0 22px;
  position: relative;
}
.section-rule::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 48px;
  height: 3px;
  background: var(--verm);
}

/* 横向书架 */
.shelf-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 340px);
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.shelf-track::-webkit-scrollbar { height: 6px; }
.shelf-track::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 999px;
}
.shelf-card {
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  padding: 18px;
  align-items: start;
  transition: border-color .15s ease, transform .15s ease;
}
.shelf-card:hover {
  border-color: #FDBA74;
  transform: translateY(-2px);
}
.shelf-card h3 {
  margin: 6px 0 8px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}
.shelf-card .meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.shelf-card .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* Category tabs */
.cat-tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
}
.cat-tabs .seg { width: min(640px, 100%); }
.cat-tabs .seg button { flex: 1; }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.cat-book {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 16px;
  padding: 18px;
  align-items: start;
}
.cat-book h4 {
  margin: 6px 0 8px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}
.cat-book .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
/* 「可学 N 词」改放右侧白区标签里，封面上不再重复显示。
   小尺寸封面（分类卡 / 书架卡）：去掉徽标占位，书名整体居中上移并缩小字号，
   让长书名（最长 13 字）连同行内「考研版」完整落在封皮内，不被底边裁掉。 */
.cat-book .cover .cover-badge,
.shelf-card .cover .cover-badge { display: none; }
.cat-book .cover .cover-sub,
.shelf-card .cover .cover-sub { display: none; }
.cat-book .cover .cover-inner,
.shelf-card .cover .cover-inner {
  justify-content: center;
  padding: 12px 10px;
}
.cat-book .cover .cover-title,
.shelf-card .cover .cover-title {
  font-size: clamp(15px, 1.5vw, 17px);
  line-height: 1.3;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .5);
}

/* ========== Book detail ========== */
.book-hero {
  margin-top: 32px;
  padding: 40px;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  position: relative;
  overflow: hidden;
}
.book-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(245, 230, 211, .55), transparent 45%);
  pointer-events: none;
}
.book-hero > * { position: relative; z-index: 1; }
.book-hero .stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.stat-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
.stat-box .num {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.1;
}
.stat-box .lbl {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  letter-spacing: .04em;
}
.book-hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(28px, 3.6vw, 38px);
  font-weight: 700;
  line-height: 1.25;
}
.book-hero .desc {
  color: #44403C;
  font-size: 15px;
  line-height: 1.75;
}
.book-hero .cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}
.last-read {
  margin-top: 16px;
  background: rgba(255, 253, 248, .8);
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  flex-wrap: wrap;
}
.last-read strong { color: var(--verm); }

.toc-filters {
  display: flex;
  justify-content: center;
  margin: 18px 0 22px;
}
.toc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.toc-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  transition: border-color .15s ease, background .15s ease;
}
.toc-item:hover {
  border-color: #FDBA74;
  background: #FFFCF5;
}
.toc-item.current {
  border-color: var(--verm);
  background: #FFF7ED;
}
.toc-num {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--sheet);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 15px;
}
.toc-item.current .toc-num { background: var(--verm); }
.toc-item.done .toc-num { background: var(--ok); }
.toc-body .t {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.35;
}
.toc-body .s {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
.toc-action {
  color: var(--verm);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.toc-item.locked { opacity: .72; }
.toc-item.locked .toc-action { color: var(--muted); }

/* ========== Reader ========== */
.reader-top {
  background:
    linear-gradient(180deg, rgba(255, 253, 248, .96), rgba(246, 241, 232, .96));
  border-bottom: 1px solid var(--line);
  padding: 20px 0 16px;
}
.reader-title-row {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  flex-wrap: wrap;
}
.reader-title-row h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  line-height: 1.3;
}
.reader-title-row .mode-label {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--verm);
  margin-top: 6px;
  letter-spacing: .04em;
}
.reader-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.tool-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tool-btn {
  border: 1px solid var(--line-strong);
  background: var(--sheet);
  border-radius: 999px;
  min-height: 36px;
  min-width: 36px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tool-btn:hover { background: var(--sheet-2); }
.tool-btn.active-dark {
  background: var(--ink);
  color: var(--sheet);
  border-color: var(--ink);
}
.more-toggle { display: none; }
.toolbar-extra {
  gap: 12px;
}
.font-size-label {
  font-size: 13px;
  color: var(--muted);
  min-width: 48px;
  text-align: center;
}

.chapter-head {
  margin-top: 28px;
  padding: 22px 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}
.chapter-head .ghost-no {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--serif);
  font-size: 72px;
  font-weight: 700;
  color: rgba(194, 65, 12, .08);
  line-height: 1;
  pointer-events: none;
  letter-spacing: -.04em;
}
.chapter-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 700;
  position: relative;
}
.chapter-head .meta {
  color: var(--muted);
  font-size: 13px;
  position: relative;
}

.practice-bar {
  margin-top: 12px;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
  border-style: dashed;
}
.practice-bar .right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.reader-body {
  margin-top: 14px;
  padding: 40px 44px 56px;
  min-height: 40vh;
  background:
    linear-gradient(180deg, rgba(255,253,248,1), rgba(255,252,245,1));
  position: relative;
}
.reader-body::before {
  content: "";
  position: absolute;
  left: 28px;
  top: 36px;
  bottom: 36px;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--line), transparent);
  pointer-events: none;
}
.reader-body p {
  margin: 0 0 1.2em;
  font-family: var(--serif);
  font-size: var(--read-size, 19px);
  line-height: 1.95;
  color: #292524;
  text-indent: 2em;
  position: relative;
}
.reader-body p:last-child { margin-bottom: 0; }
.reader-body p:has(> .w:first-child),
.reader-body p.no-indent { text-indent: 0; }

/* Word chips — 杏仁/苔绿，非粉胶囊塑料感 */
.w {
  display: inline;
  cursor: pointer;
  border-radius: 4px;
  padding: 0 3px;
  margin: 0 1px;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
  border: none;
  font: inherit;
  color: var(--apricot-ink);
  background: linear-gradient(180deg, transparent 58%, var(--apricot) 58%);
  font-weight: 700;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.w:hover, .w.active {
  background: var(--apricot);
  box-shadow: 0 1px 0 var(--apricot-ink);
}
.mode-hide-zh .w {
  color: var(--moss-ink);
  background: linear-gradient(180deg, transparent 58%, var(--moss) 58%);
}
.mode-hide-zh .w:hover, .mode-hide-zh .w.active {
  background: var(--moss);
  box-shadow: 0 1px 0 var(--moss-ink);
}

.blank {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: baseline;
  text-indent: 0;
}
.blank input {
  width: 7.5em;
  border: none;
  border-bottom: 1.5px solid var(--line-strong);
  background: transparent;
  font-size: .95em;
  padding: 0 4px 1px;
  color: inherit;
  outline: none;
  border-radius: 0;
  font-family: var(--serif);
}
.mode-hide-en .blank input {
  background: var(--apricot);
  color: var(--apricot-ink);
  border-bottom-color: transparent;
  border-radius: 6px;
  padding: 2px 8px;
  width: 8.5em;
}
.mode-hide-zh .blank input {
  background: var(--moss);
  color: var(--moss-ink);
  border-bottom-color: transparent;
  border-radius: 6px;
  padding: 2px 8px;
  width: 7em;
}
.blank input.ok {
  outline: 2px solid rgba(21, 128, 61, .4);
  background: #D1FAE5 !important;
}
.blank input.bad {
  outline: 2px solid rgba(180, 83, 9, .45);
  background: #FEF3C7 !important;
}
.eye-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  padding: 0 2px;
  opacity: .7;
}
.eye-btn:hover { opacity: 1; color: var(--verm); }

/* 底部悬浮工具条（阅读） */
.dock {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom, 0px) + 12px);
  transform: translateX(-50%);
  z-index: 55;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  background: rgba(28, 25, 23, .94);
  color: #FAF5EF;
  border: 1px solid rgba(250, 245, 239, .12);
  border-radius: 999px;
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 40px rgba(28, 25, 23, .28);
  max-width: calc(100vw - 20px);
  overflow: hidden;
}
.dock button, .dock a {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 700;
  min-height: 40px;
  min-width: 40px;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}
.dock button:hover, .dock a:hover { background: rgba(250, 245, 239, .12); }
.dock button.active {
  background: var(--verm);
  color: #FFF7ED;
}
.dock .dock-sep {
  width: 1px;
  height: 18px;
  background: rgba(250, 245, 239, .18);
  flex: 0 0 auto;
}

/* Word popover — 纸片 / 手机底部抽屉 */
.word-pop {
  position: fixed;
  z-index: 80;
  width: min(320px, calc(100vw - 24px));
  background: var(--sheet);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(28, 25, 23, .18);
  padding: 18px;
  display: none;
}
.word-pop.show { display: block; animation: popIn .16s ease; }
.word-pop .pop-handle {
  display: none;
}
.word-pop.as-sheet {
  left: 0 !important;
  right: 0;
  top: auto !important;
  bottom: 0;
  width: 100%;
  max-width: none;
  max-height: min(72vh, 520px);
  border-radius: 20px 20px 0 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
  padding: 10px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  overflow: auto;
  transform: translateY(105%);
  transition: transform .28s cubic-bezier(.22, 1, .36, 1);
  box-shadow: 0 -18px 50px rgba(28, 25, 23, .22);
}
.word-pop.as-sheet.show {
  animation: none;
}
.word-pop.as-sheet.sheet-up {
  transform: translateY(0);
}
.word-pop.as-sheet .pop-handle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.word-pop.as-sheet .pop-handle span {
  display: block;
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: var(--line-strong);
  margin: 0 auto;
}
.word-pop.as-sheet .pop-handle button {
  border: none;
  background: var(--sheet-2);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  color: var(--ink);
  line-height: 1;
}
.word-pop.as-sheet .master-btn {
  min-height: 48px;
}
body:has(.word-pop.as-sheet.show) {
  overflow: hidden;
}
body:has(.word-pop.as-sheet.show)::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, .4);
  z-index: 75;
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(8px) rotate(-.4deg); }
  to { opacity: 1; transform: none; }
}
.word-pop .top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 8px;
}
.word-pop .en {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .01em;
}
.word-pop .ipa {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}
.word-pop .row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}
.word-pop .zh {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
}
.speak-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--verm-deep);
  background: var(--verm);
  color: #FFF7ED;
  cursor: pointer;
  display: grid;
  place-items: center;
  position: relative;
  flex-shrink: 0;
}
.speak-btn:hover { background: var(--verm-deep); }
.speak-btn.playing { animation: pulse 1s ease infinite; }
.speak-btn.playing::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(194, 65, 12, .45);
  animation: ring 1s ease infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes ring {
  from { transform: scale(.85); opacity: 1; }
  to { transform: scale(1.25); opacity: 0; }
}
.master-btn { margin-top: 14px; width: 100%; }

/* Side floating */
.float-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--ink);
  color: var(--sheet);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(28, 25, 23, .2);
  display: grid;
  place-items: center;
  line-height: 1.2;
  text-align: center;
}
.float-btn:hover { background: var(--verm); border-color: var(--verm-deep); }
.float-toc { left: 18px; }
.float-vocab { right: 18px; }

/* Drawer */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(380px, 100vw);
  height: 100vh;
  background: var(--sheet);
  border-left: 1px solid var(--line);
  z-index: 70;
  transform: translateX(100%);
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -16px 0 40px rgba(28, 25, 23, .1);
}
.drawer.open { transform: none; }
.drawer.left {
  right: auto;
  left: 0;
  transform: translateX(-100%);
  border-left: none;
  border-right: 1px solid var(--line);
}
.drawer.left.open { transform: none; }
.drawer-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 18px;
}
.drawer-body {
  overflow: auto;
  padding: 12px;
  flex: 1;
}
.close-x {
  border: 1px solid var(--line-strong);
  background: var(--paper);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  color: var(--ink);
}
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, .32);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.overlay.show { opacity: 1; pointer-events: auto; }

/* Vocab rows */
.vocab-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 8px;
  background: var(--paper);
}
.vocab-row .en {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 16px;
}
.vocab-row .meta {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
}
.vocab-row .zh { font-size: 14px; margin-top: 2px; }
.vocab-row.mastered {
  background: #F0FDF4;
  border-color: #BBF7D0;
}
.mini-speak {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--sheet);
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
}
.mini-speak:hover {
  background: var(--verm);
  color: #FFF7ED;
  border-color: var(--verm-deep);
}

/* Chapter vocab */
.chapter-vocab {
  margin-top: 32px;
  padding: 28px;
}
.chapter-vocab h3 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
}
.chapter-vocab .sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
}
.vocab-table {
  width: 100%;
  border-collapse: collapse;
}
.vocab-table th,
.vocab-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  vertical-align: middle;
}
.vocab-table th {
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .06em;
}
.vocab-table tr:last-child td { border-bottom: none; }
.vocab-table td:first-child {
  font-family: var(--serif);
  font-weight: 700;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--sheet);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: .25s ease;
  z-index: 100;
  border: 1px solid rgba(250, 245, 239, .1);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========== 首页双轨 ========== */
.dual-track {
  display: grid;
  grid-template-columns: minmax(240px, 300px) 1fr;
  gap: 16px;
  margin-top: 28px;
  align-items: stretch;
}
.dual-track > * { min-height: 560px; }
.track-continue {
  padding: 22px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(165deg, #1C1917 0%, #292524 55%, #3F3A36 100%);
  color: #FAF5EF;
  border-color: #292524;
}
.track-continue[hidden] { display: none; }
.track-continue::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -56px;
  top: -48px;
  background: radial-gradient(circle, rgba(194, 65, 12, .45), transparent 70%);
  pointer-events: none;
}
.track-continue::before {
  content: "";
  position: absolute;
  left: -30px;
  bottom: 80px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(15, 118, 110, .28), transparent 70%);
  pointer-events: none;
}
.track-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  color: #FDBA74;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}
.track-label.accent { color: var(--verm); }
.track-hero {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  align-items: start;
  position: relative;
  z-index: 1;
  margin-bottom: 12px;
}
.track-cover {
  width: 110px;
  position: relative;
  z-index: 1;
}
.track-cover .cover { width: 100%; }
.track-hero-meta { min-width: 0; }
.track-book {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  color: #FDBA74;
  letter-spacing: .04em;
  margin-bottom: 8px;
}
.track-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.track-chip {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(250, 245, 239, .1);
  border: 1px solid rgba(250, 245, 239, .18);
  color: rgba(250, 245, 239, .88);
}
.track-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  position: relative;
  z-index: 1;
}
.track-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  position: relative;
  z-index: 1;
}
.ts-item {
  background: rgba(250, 245, 239, .07);
  border: 1px solid rgba(250, 245, 239, .1);
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
}
.ts-item strong {
  display: block;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: #FFF7ED;
  line-height: 1.2;
}
.ts-item span {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: .08em;
  color: rgba(250, 245, 239, .55);
}
.track-ring-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 12px;
  position: relative;
  z-index: 1;
}
.track-ring-note {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.track-ring-note strong {
  font-size: 11px;
  letter-spacing: .1em;
  color: #FDBA74;
}
.track-ring-note span {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  color: #FAF5EF;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.track-continue .progress {
  background: rgba(250, 245, 239, .15);
  position: relative;
  z-index: 1;
}
.track-continue .progress > i {
  background: linear-gradient(90deg, #FB923C, #FDBA74);
}
.track-pct {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(250, 245, 239, .65);
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}
.track-pct strong { color: #FDBA74; font-family: var(--mono); }
.track-continue .ring-wrap {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.track-continue .ring-wrap .ring-bg { stroke: rgba(250, 245, 239, .15); }
.track-continue .ring-wrap .ring-fg { stroke: #FB923C; }
.track-continue .ring-wrap .ring-txt { color: #FAF5EF; }
.track-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
  margin-top: auto;
}
.track-continue .btn-primary {
  background: #FFF7ED;
  color: var(--ink);
  border-color: #FFF7ED;
}
.track-continue .btn-secondary {
  background: transparent;
  color: #FAF5EF;
  border-color: rgba(250, 245, 239, .3);
}
.track-continue .track-actions + .quick-boards {
  margin-top: 10px;
}
.track-continue .quick-boards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
  z-index: 1;
}
.track-continue .quick-boards .btn {
  min-height: 36px;
  padding: 8px 14px;
  font-size: 13px;
}

/* 封面艺术图 */
.cover.has-art .cover-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.cover.has-art .cover-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(0,0,0,.15) 0%, transparent 35%, rgba(0,0,0,.62) 100%),
    linear-gradient(90deg, rgba(0,0,0,.35), transparent 28%);
  pointer-events: none;
}
.cover.has-art::after { z-index: 2; }
.cover.has-art .cover-inner { z-index: 3; }
.cover.has-art .cover-orb,
.cover.has-art .cover-band { display: none; }
.cover.has-art .cover-title {
  text-shadow: 0 2px 10px rgba(0,0,0,.45);
}

.track-drill {
  padding: 26px 28px 24px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.drill-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
  gap: 12px;
}
.drill-tip {
  font-size: 12px;
  color: var(--verm);
  font-weight: 600;
}
.drill-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  flex: 1;
  align-content: stretch;
}
.drill-card {
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(180deg, #FFFDF8 0%, #F7F1E6 100%);
  border-radius: 14px;
  padding: 16px 10px 14px;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
  min-height: 128px;
  box-shadow: 0 1px 0 rgba(28, 25, 23, .04);
  transition: border-color .15s ease, transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.drill-card:hover {
  border-color: var(--verm);
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(194, 65, 12, .1);
}
.drill-card.on {
  background: linear-gradient(180deg, #F0FDF4, #E4EDE4);
  border-color: #86EFAC;
}
.dc-en {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.2;
  color: var(--ink);
}
.dc-level {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--verm);
  background: var(--apricot);
  padding: 2px 8px;
  border-radius: 999px;
}
.dc-ipa {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.dc-zh {
  font-size: 14px;
  color: #44403C;
  line-height: 1.45;
  min-height: 2.4em;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding-top: 4px;
  border-top: 1px dashed var(--line-strong);
  margin-top: 2px;
}
.dc-zh.is-hidden {
  color: var(--muted);
  letter-spacing: .2em;
  font-weight: 700;
  opacity: .75;
}
.drill-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.drill-hint {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}

.track-catalog {
  padding: 22px 20px 18px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.novel-catalog {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-content: stretch;
  flex: 1;
}
.novel-card {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(160deg, #FFFDF8 0%, #F7F1E6 100%);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
  min-width: 0;
  min-height: 100%;
  align-self: stretch;
}
.novel-card:hover {
  border-color: #FDBA74;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(194, 65, 12, .08);
}
.novel-card.hot {
  border-color: rgba(194, 65, 12, .28);
  background: linear-gradient(135deg, rgba(194, 65, 12, .07), #FFFDF8 55%);
}
.nc-art { display: block; }
.nc-cover-box {
  width: 88px;
  height: 117px;
  border-radius: 8px;
}
.nc-cover-box .cover-inner { padding: 8px; }
.nc-cover-box .cover-title {
  font-size: 11px;
  line-height: 1.25;
}
.nc-cover-box .cover-sub,
.nc-cover-box .cover-badge { display: none; }
.nc-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.nc-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.nc-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.nc-title:hover { color: var(--verm); }
.nc-hot {
  font-size: 10px;
  font-weight: 800;
  color: #FFF7ED;
  background: var(--verm);
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: .04em;
}
.nc-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}
.nc-meta span::before {
  content: "·";
  margin-right: 6px;
  opacity: .5;
}
.nc-meta span:first-child::before { content: ""; margin: 0; }
.nc-act {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}
.nc-act .btn { min-width: 64px; }

/* ========== 章节头像化目录 ========== */
.toc-item {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  transition: border-color .15s ease, background .15s ease;
  overflow: hidden;
}
.toc-still {
  width: 88px;
  height: 64px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.toc-still::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255,255,255,.15), transparent 50%),
    repeating-linear-gradient(
      -18deg,
      transparent,
      transparent 6px,
      rgba(0,0,0,.08) 6px,
      rgba(0,0,0,.08) 7px
    );
}
.toc-still .still-no {
  position: relative;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 700;
  color: rgba(255, 247, 237, .95);
  text-shadow: 0 2px 8px rgba(0,0,0,.35);
  letter-spacing: -.04em;
  line-height: 1;
}
.toc-still .still-tag {
  position: absolute;
  left: 6px;
  bottom: 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  background: rgba(28, 25, 23, .55);
  color: #FFF7ED;
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 1;
}
.toc-item .toc-num { display: none; }
.toc-item.current { border-color: var(--verm); background: #FFF7ED; }
.toc-item.done .toc-still { box-shadow: inset 0 0 0 2px rgba(22, 163, 77, .5); }

/* ========== 阅读三栏 ========== */
.reader-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  width: min(1360px, calc(100% - 28px));
  margin: 0 auto;
  padding-bottom: 120px;
  align-items: start;
}
.reader-layout .rail {
  display: none;
  min-width: 0;
}
.reader-layout .center-col {
  width: min(100%, var(--read-max));
  margin: 0 auto;
  min-width: 0;
}
/* 开启三栏：三列铺满，减少两侧空旷 */
.reader-layout.layout-on {
  grid-template-columns: 210px minmax(0, 1fr) 240px;
}
.reader-layout.layout-on .rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.reader-layout.layout-on .center-col {
  width: 100%;
  max-width: none;
}
@media (max-width: 1100px) {
  .reader-layout.layout-on {
    grid-template-columns: 180px minmax(0, 1fr);
  }
  .reader-layout.layout-on .rail-right {
    display: none;
  }
}
@media (max-width: 860px) {
  .reader-layout.layout-on {
    grid-template-columns: 1fr;
  }
  .reader-layout.layout-on .rail {
    display: none !important;
  }
}

.rail-left, .rail-right {
  position: sticky;
  top: calc(var(--nav-h) + 10px);
  max-height: calc(100vh - var(--nav-h) - 28px);
  overflow: auto;
  padding: 14px;
}
.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.rail-left h4, .rail-right h4 {
  margin: 0;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
}
.rail-chip {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  background: var(--apricot);
  color: var(--verm-deep);
  padding: 2px 8px;
  border-radius: 999px;
}
.rail-block {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.rail-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 8px;
}
.rail-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.rail-tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rail-tools .tool-btn { width: 100%; }
.rail-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.65;
}
.level-bars { display: flex; flex-direction: column; gap: 8px; }
.lb-row {
  display: grid;
  grid-template-columns: 42px 1fr 24px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.lb-row em {
  font-style: normal;
  font-family: var(--mono);
  text-align: right;
  color: var(--ink);
  font-weight: 700;
}
.lb-track {
  height: 6px;
  background: var(--sheet-2);
  border-radius: 999px;
  overflow: hidden;
}
.lb-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #EA580C, var(--verm));
  border-radius: inherit;
}
.thin-toc {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.thin-toc a {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  border: 1px solid transparent;
}
.thin-toc a:hover { background: var(--paper); color: var(--ink); }
.thin-toc a.active {
  background: #FFF7ED;
  border-color: var(--verm);
  color: var(--verm-deep);
  font-weight: 700;
}
.thin-toc .n {
  font-family: var(--mono);
  font-size: 11px;
  opacity: .7;
}
.word-stream {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ws-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  animation: popIn .2s ease;
}
.ws-item .en {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 14px;
}
.ws-item .zh {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--muted);
}
.ws-empty {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

/* 章节头更饱满 */
.chapter-head {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 18px;
}
.chapter-head-main { flex: 1; min-width: 0; position: relative; z-index: 1; }
.chapter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.chapter-side-stats {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding-left: 18px;
  border-left: 1px dashed var(--line-strong);
  min-width: 110px;
  position: relative;
  z-index: 1;
}
.ss-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ss-item strong {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
}
.ss-item span {
  font-size: 11px;
  color: var(--muted);
}
@media (max-width: 640px) {
  .chapter-side-stats {
    flex-direction: row;
    flex-wrap: wrap;
    border-left: none;
    border-top: 1px dashed var(--line-strong);
    padding: 12px 0 0;
    min-width: 0;
    gap: 16px;
  }
}

/* 单栏时加宽正文，减少空旷 */
body:not(.layout3) .center-col {
  width: min(100%, 860px);
}
body:not(.layout3) .reader-body {
  padding-left: 48px;
  padding-right: 48px;
}
body:not(.layout3) .reader-layout {
  width: min(960px, calc(100% - 28px));
}

/* ========== 对比学习页 ========== */
.compare-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 100px;
}
.compare-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.compare-head h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
}
.compare-panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}
.pane {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sheet);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.pane-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  font-weight: 700;
  font-size: 14px;
}
.pane-head .badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  padding: 3px 8px;
  border-radius: 999px;
}
.pane-study .badge { background: var(--apricot); color: var(--apricot-ink); }
.pane-dict .badge { background: var(--moss); color: var(--moss-ink); }
.pane-body {
  padding: 24px 22px 32px;
  max-height: min(70vh, 720px);
  overflow: auto;
}
.pane-body p {
  margin: 0 0 1.1em;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.9;
  color: #292524;
  text-indent: 2em;
}
.pane-body p:last-child { margin-bottom: 0; }
.compare-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--muted);
  background: var(--sheet);
}
@media (max-width: 900px) {
  .dual-track { grid-template-columns: 1fr; }
  .dual-track > * { min-height: 0; }
  .novel-catalog { grid-template-columns: 1fr; }
  .compare-panes { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .drill-hint { margin-left: 0; width: 100%; }
  .toc-still { width: 72px; height: 56px; }
  .toc-item { grid-template-columns: auto 1fr; }
  .toc-item .toc-action { grid-column: 1 / -1; }
  .track-hero { grid-template-columns: 92px 1fr; }
  .track-cover { width: 92px; }
  .track-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nc-desc { -webkit-line-clamp: 1; }
}

/* ========== 新板块：报表 / 人物 / 词图 ========== */
/* 阅读报表（日/周/月/总） */
.report-board { display: flex; flex-direction: column; gap: 14px; }
.report-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.report-tabs { width: auto; }
.report-tabs button { padding: 8px 18px; }
.rank-line {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .02em;
}
.rank-line strong {
  color: var(--verm);
  font-family: var(--mono);
  font-weight: 700;
}
.rank-line.hot strong { color: var(--ok); }
.rank-line.muted { color: var(--muted); opacity: .85; }
.kpi-box { min-height: 100%; }

/* 左栏引导卡（未登录/未激活） */
.track-guide[hidden],
.track-full[hidden] { display: none !important; }
.track-guide {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.track-guide-text {
  margin: 4px 0 18px;
  font-size: 13px;
  line-height: 1.65;
  color: rgba(250, 245, 239, .72);
  position: relative;
  z-index: 1;
}
.track-guide .track-actions { margin-top: auto; }
.track-full {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.chart-empty {
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 24px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 8px,
    rgba(28, 25, 23, .02) 8px,
    rgba(28, 25, 23, .02) 16px
  );
}
.chart-empty-title {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.chart-empty-sub {
  font-size: 13px;
  color: var(--muted);
  max-width: 28em;
  line-height: 1.55;
}

.week-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.week-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.week-bar-col.is-today .week-bar {
  background: linear-gradient(180deg, #FB923C, var(--verm-deep));
  box-shadow: 0 0 0 2px rgba(194, 65, 12, .15);
}
.week-bar-col.is-today span { color: var(--verm); font-weight: 700; }
.week-chart, .week-wrong {
  padding: 20px;
}
.week-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 14px;
}
.week-chart-head span { color: var(--muted); font-size: 13px; }
.week-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  align-items: end;
  height: 140px;
}
.week-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}
.week-bar {
  width: 100%;
  max-width: 36px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #EA580C, var(--verm));
  min-height: 4px;
  transition: height .4s ease;
}
.wrong-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.wrong-row:last-child { border-bottom: none; }
.wrong-en { font-family: var(--serif); font-weight: 700; }
.wrong-zh { color: var(--muted); font-size: 13px; }
.wrong-n {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--verm);
}
.week-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

/* 人物名片 */
.char-track {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.char-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 12px;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s ease, transform .15s ease;
}
.char-card:hover, .char-card.active {
  border-color: var(--verm);
  transform: translateY(-2px);
}
.char-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: #FFF7ED;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25);
}
.char-avatar.lg {
  width: 64px;
  height: 64px;
  font-size: 26px;
}
.char-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 16px;
}
.char-role { font-size: 12px; color: var(--muted); }
.char-first { font-size: 11px; color: var(--verm); font-weight: 700; }
.char-drawer {
  margin-top: 14px;
  padding: 22px;
  position: relative;
  animation: popIn .18s ease;
}
.char-drawer[hidden] { display: none; }
.char-drawer .close-x {
  position: absolute;
  top: 14px;
  right: 14px;
}
.char-drawer-head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}
.char-drawer-name {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
}
.char-drawer-role { color: var(--muted); font-size: 13px; }
.char-blurb {
  margin: 0 0 12px;
  line-height: 1.75;
  color: #44403C;
}
.char-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.char-rel {
  margin: 0 0 16px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

/* 词汇地图 */
.vmap-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.vmap-score {
  display: flex;
  gap: 14px;
  align-items: center;
}
.vmap-ring {
  --p: 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background:
    conic-gradient(var(--verm) calc(var(--p) * 1%), var(--sheet-2) 0);
  display: grid;
  place-items: center;
  position: relative;
}
.vmap-ring::before {
  content: "";
  position: absolute;
  inset: 8px;
  background: var(--sheet);
  border-radius: 50%;
}
.vmap-ring span {
  position: relative;
  font-family: var(--mono);
  font-weight: 800;
  font-size: 14px;
}
.vmap-score .muted { color: var(--muted); font-size: 13px; }
.vmap-legend { display: flex; gap: 8px; flex-wrap: wrap; }
.lg {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.lg.cet4 { background: #ECFDF5; color: #0F766E; }
.lg.cet6 { background: var(--apricot); color: var(--apricot-ink); }
.lg.ky { background: #EFF6FF; color: #1D4ED8; }
.lg.other { background: var(--sheet-2); color: var(--muted); }
.vmap-layers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.vmap-layer { padding: 16px; }
.vmap-layer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
}
.vmap-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.vmap-chip {
  border: 1px solid var(--line-strong);
  background: var(--paper);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--serif);
  cursor: pointer;
  color: var(--ink);
  min-height: 32px;
}
.vmap-chip:hover { border-color: var(--verm); color: var(--verm); }
.vmap-chip.on {
  background: var(--moss);
  border-color: #86EFAC;
  color: var(--moss-ink);
}
.vmap-more {
  font-size: 12px;
  color: var(--muted);
  align-self: center;
}

/* Responsive */
@media (max-width: 900px) {
  .week-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-toolbar { flex-direction: column; align-items: flex-start; }
  .vmap-layers { grid-template-columns: 1fr; }
  .book-hero { grid-template-columns: 140px 1fr; padding: 24px; gap: 20px; }
  .toc-grid { grid-template-columns: 1fr; }
  .reader-body { padding: 28px 20px 120px 28px; }
  .reader-body::before { display: none; }
  .float-btn { display: none; }
}

/* 平板竖屏 / 小笔记本 */
@media (max-width: 768px) {
  .more-toggle { display: inline-flex; }
  .toolbar-extra {
    display: none;
    width: 100%;
    padding-top: 4px;
  }
  .toolbar-extra.open {
    display: flex;
  }
  .reader-toolbar {
    gap: 10px;
  }
  .reader-title-row .tool-group .tool-btn {
    min-height: 40px;
  }
  .cat-tabs .seg button {
    padding: 10px 8px;
    font-size: 13px;
  }
  .section { margin-top: 48px; }
  .shelf-track {
    grid-auto-columns: minmax(260px, 78vw);
  }
  .chapter-vocab { padding: 20px 16px; }
  .dock button, .dock a {
    padding: 8px 10px;
    font-size: 12px;
  }
}

@media (pointer: coarse) {
  .nav-link,
  .btn,
  .tool-btn,
  .dock button,
  .mini-speak,
  .eye-btn,
  .char-card,
  .vmap-chip {
    min-height: 44px;
  }
  .btn-sm,
  .tool-btn {
    min-width: 44px;
  }
  .mini-speak { min-width: 44px; }
  .eye-btn { padding: 8px; }
}

@media (max-width: 640px) {
  .week-kpis { grid-template-columns: 1fr 1fr; }
  .wrong-row { grid-template-columns: 1fr auto; }
  .wrong-zh { display: none; }
  .book-hero { grid-template-columns: 1fr; }
  .book-hero .cover { width: 140px; }
  .book-hero .stats { grid-template-columns: 1fr; }
  .nav-actions .hide-sm { display: none; }
  .reader-body p { font-size: max(17px, calc(var(--read-size, 19px) - 1px)); text-indent: 1.5em; }
  .dock {
    width: calc(100% - 16px);
    max-width: none;
    justify-content: space-between;
    bottom: max(12px, env(safe-area-inset-bottom, 0px) + 8px);
    padding: 6px 8px;
    gap: 2px;
  }
  .dock button, .dock a {
    padding: 8px 7px;
    font-size: 11px;
    min-height: 44px;
  }
  .dock .dock-sep { display: none; }
  .chapter-head .ghost-no { font-size: 52px; opacity: .7; }
  .reader-top { padding: 14px 0 12px; }
  .reader-title-row h1 { font-size: 20px; }
  .reader-title-row .mode-label { font-size: 16px; margin-top: 4px; }
  .chapter-head { padding: 16px 18px; }
  .main, main.container-narrow { padding-bottom: 140px !important; }
  .practice-bar { flex-direction: column; align-items: flex-start; }
  .cat-tabs .seg {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }
  .cat-tabs .seg button {
    flex: 0 0 auto;
    min-width: 64px;
  }
  .section-head { flex-wrap: wrap; }
}

/* 大屏手机横过来 / 小平板补充 */
@media (min-width: 641px) and (max-width: 768px) {
  .toc-grid {
    grid-template-columns: 1fr;
  }
  .book-hero {
    grid-template-columns: 160px 1fr;
  }
  .cat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 手机横屏：压低顶栏，给正文更多空间 */
@media (max-height: 480px) and (orientation: landscape) {
  .site-nav { height: 56px; }
  .reader-top { padding: 8px 0; }
  .reader-title-row .kicker { display: none; }
  .reader-body { padding-top: 18px; }
  .dock { bottom: max(8px, env(safe-area-inset-bottom, 0px)); }
}
