/* =========================================================
   守灯人 · Lumen English
   Warm paper, forest ink, lantern amber.
   ========================================================= */

:root {
  --paper: #f4efe4;
  --paper-deep: #ebe2d1;
  --card: #fffdf8;
  --card-warm: #fbf6eb;
  --ink: #1e2a24;
  --ink-soft: #5e6a61;
  --ink-faint: #8a938b;
  --forest: #173b32;
  --forest-mid: #285044;
  --forest-soft: #dce7df;
  --amber: #c57d32;
  --amber-deep: #9b5b1d;
  --amber-soft: #f3dfb9;
  --amber-glow: #fbefd6;
  --rust: #b25338;
  --line: rgba(30, 42, 36, 0.13);
  --line-strong: rgba(30, 42, 36, 0.24);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Songti SC", "STSong", "SimSun", serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", monospace;
  --shadow-sm: 0 2px 0 rgba(30, 42, 36, 0.03), 0 10px 30px rgba(30, 42, 36, 0.06);
  --shadow-md: 0 18px 60px rgba(23, 59, 50, 0.13);
  --shadow-lg: 0 38px 100px rgba(12, 35, 28, 0.28);
  --radius: 22px;
  --radius-sm: 14px;
  --header-h: 74px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  -webkit-tap-highlight-color: transparent;
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 8% -8%, rgba(243, 223, 185, 0.5), transparent 60%),
    radial-gradient(1000px 600px at 100% 18%, rgba(220, 231, 223, 0.55), transparent 58%),
    var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

::selection { background: var(--amber-soft); color: var(--forest); }

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -100px;
  z-index: 2000;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--forest);
  color: var(--card);
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 0 clamp(20px, 4vw, 56px);
  border-bottom: 1px solid transparent;
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.site-header.is-scrolled,
body.reader-mode .site-header {
  background: rgba(244, 239, 228, 0.88);
  backdrop-filter: blur(16px);
  border-color: var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--forest);
  background: rgba(255, 253, 248, 0.55);
}
.brand-mark svg { width: 27px; height: 27px; }
.brand-mark.small { width: 34px; height: 34px; border-radius: 10px; }
.brand-mark.small svg { width: 24px; height: 24px; }

.brand-text { display: flex; flex-direction: column; line-height: 1; gap: 5px; }
.brand-text strong {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.brand-text small {
  font-size: 8.5px;
  letter-spacing: 0.22em;
  color: var(--ink-faint);
  font-weight: 600;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.main-nav a {
  position: relative;
  padding: 9px 14px;
  font-size: 13.5px;
  color: var(--ink-soft);
  border-radius: 999px;
  transition: color 0.18s, background 0.18s;
}
.main-nav a:hover { color: var(--forest); background: rgba(23, 59, 50, 0.055); }
.main-nav a.is-active { color: var(--forest); font-weight: 600; }
.main-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 16px;
  height: 2px;
  margin-left: -8px;
  border-radius: 2px;
  background: var(--amber);
}

.header-tools { display: flex; align-items: center; gap: 8px; }

.wordbook-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.5);
  transition: 0.18s;
}
.wordbook-link:hover { border-color: var(--line-strong); color: var(--forest); background: var(--card); }
.wordbook-link svg { width: 17px; height: 17px; }
.wordbook-link b {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: var(--amber);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: transparent;
  color: var(--ink);
  transition: 0.18s;
}
.icon-button:hover { background: var(--card); border-color: var(--line-strong); }
.icon-button svg { width: 20px; height: 20px; }
.menu-toggle { display: none; }

.mobile-menu {
  position: fixed;
  z-index: 99;
  top: var(--header-h);
  left: 0;
  right: 0;
  padding: 10px 20px 18px;
  background: rgba(244, 239, 228, 0.97);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 40px rgba(23, 59, 50, 0.08);
}
.mobile-menu a {
  display: block;
  padding: 13px 6px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.mobile-menu a:last-child { border-bottom: 0; }

/* ---------- shared layout ---------- */

main { flex: 1; outline: none; }

.wrap {
  width: min(1240px, calc(100% - clamp(36px, 8vw, 112px)));
  margin-inline: auto;
}

.page { padding: 54px 0 90px; animation: pageIn 0.45s ease both; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--amber-deep);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}
.section-head h2 {
  margin: 9px 0 0;
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.section-head p { max-width: 480px; margin: 0; color: var(--ink-soft); font-size: 14px; }
.section-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--forest);
  white-space: nowrap;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 3px;
}
.section-link svg { width: 15px; height: 15px; transition: transform 0.2s; }
.section-link:hover svg { transform: translateX(3px); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.18s, background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--forest); color: #f8f3e7; box-shadow: 0 10px 28px rgba(23, 59, 50, 0.22); }
.btn-primary:hover { background: var(--forest-mid); transform: translateY(-1px); box-shadow: 0 14px 34px rgba(23, 59, 50, 0.26); }
.btn-ghost { border-color: var(--line-strong); color: var(--forest); background: rgba(255, 253, 248, 0.45); }
.btn-ghost:hover { background: var(--card); border-color: var(--forest); transform: translateY(-1px); }
.btn-soft { background: var(--amber-soft); color: var(--amber-deep); }
.btn-soft:hover { background: #efd3a4; }
.btn-sm { min-height: 37px; padding: 0 15px; font-size: 12px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.65);
}
.pill.amber { border-color: rgba(197, 125, 50, 0.3); color: var(--amber-deep); background: var(--amber-glow); }
.pill.green { border-color: rgba(23, 59, 50, 0.2); color: var(--forest); background: var(--forest-soft); }

/* ---------- home hero ---------- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.82fr);
  align-items: center;
  gap: clamp(30px, 6vw, 90px);
  min-height: 650px;
  max-height: 770px;
  padding: 34px 0 52px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  right: -18%;
  top: 6%;
  width: 700px;
  height: 700px;
  border: 1px solid rgba(23, 59, 50, 0.08);
  border-radius: 50%;
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  right: 4%;
  top: 15%;
  width: 500px;
  height: 500px;
  border: 1px dashed rgba(197, 125, 50, 0.16);
  border-radius: 50%;
  pointer-events: none;
}

.hero-copy { position: relative; z-index: 2; }
.hero-copy .eyebrow { margin-bottom: 24px; }

.hero-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(48px, 6.4vw, 84px);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.045em;
  color: var(--forest);
}
.hero-title .accent {
  position: relative;
  display: inline-block;
  color: var(--amber-deep);
  font-style: normal;
}
.hero-title .accent::after {
  content: "";
  position: absolute;
  left: 1%;
  right: 0;
  bottom: 3px;
  height: 9px;
  border-radius: 50%;
  background: rgba(197, 125, 50, 0.2);
  transform: rotate(-1.5deg);
}

.hero-lede {
  max-width: 550px;
  margin: 26px 0 0;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.9;
}
.hero-lede strong { color: var(--ink); font-weight: 600; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  max-width: 540px;
}
.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--ink-soft);
}
.hero-meta i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
}

.hero-art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 560px;
  z-index: 1;
}

.book-stage {
  position: relative;
  width: min(360px, 85%);
  transform: rotate(2.2deg);
  animation: bookIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.book-stage::before {
  content: "";
  position: absolute;
  left: 6%;
  right: -4%;
  bottom: -18px;
  height: 55px;
  background: rgba(23, 59, 50, 0.22);
  filter: blur(22px);
  border-radius: 50%;
  transform: rotate(-2deg);
}
.hero-book {
  position: relative;
  width: 100%;
  aspect-ratio: 600 / 840;
  border-radius: 5px 14px 14px 5px;
  overflow: hidden;
  box-shadow:
    -14px 18px 0 rgba(23, 59, 50, 0.1),
    -22px 30px 50px rgba(23, 59, 50, 0.28),
    0 0 0 1px rgba(23, 59, 50, 0.16);
  transform-style: preserve-3d;
}
.hero-book::before {
  content: "";
  position: absolute;
  z-index: 3;
  left: 0;
  top: 0;
  bottom: 0;
  width: 16px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.35), rgba(255, 255, 255, 0.09) 55%, rgba(0, 0, 0, 0.08));
  mix-blend-mode: multiply;
}
.hero-book::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.12), transparent 30%, transparent 80%, rgba(255, 255, 255, 0.04));
  pointer-events: none;
}
.hero-book img { width: 100%; height: 100%; object-fit: cover; }

.book-tag {
  position: absolute;
  z-index: 5;
  top: auto;
  bottom: 25%;
  right: -14%;
  padding: 12px 16px;
  width: 158px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  transform: rotate(-3deg);
  animation: floatA 7s ease-in-out infinite;
}
.book-tag small { display: block; font-size: 8.5px; letter-spacing: 0.16em; color: var(--ink-faint); text-transform: uppercase; }
.book-tag strong { display: block; margin-top: 2px; font-family: var(--serif); font-size: 16px; color: var(--forest); }
.book-tag em { display: block; margin-top: 3px; font-style: normal; font-size: 10px; color: var(--amber-deep); }

.book-note {
  position: absolute;
  z-index: 5;
  left: -15%;
  bottom: 13%;
  width: 196px;
  padding: 14px 16px;
  border-radius: 13px;
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  transform: rotate(-2deg);
  animation: floatB 8s ease-in-out infinite;
}
.book-note .note-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.book-note b { font-family: var(--serif); font-size: 19px; color: var(--forest); font-weight: 600; }
.book-note span { font-size: 9px; letter-spacing: 0.1em; color: var(--amber-deep); }
.book-note p { margin: 0; font-size: 10.5px; line-height: 1.55; color: var(--ink-soft); }
.book-note .mini-wave { display: flex; gap: 2px; align-items: center; height: 13px; margin-top: 7px; }
.book-note .mini-wave i { display: block; width: 2px; border-radius: 2px; background: var(--amber); opacity: 0.8; }
.book-note .mini-wave i:nth-child(1) { height: 5px; }
.book-note .mini-wave i:nth-child(2) { height: 10px; }
.book-note .mini-wave i:nth-child(3) { height: 7px; }
.book-note .mini-wave i:nth-child(4) { height: 12px; }
.book-note .mini-wave i:nth-child(5) { height: 4px; }
.book-note .mini-wave i:nth-child(6) { height: 8px; }

.hero-stamp {
  position: absolute;
  right: 1%;
  bottom: 2%;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(197, 125, 50, 0.35);
  color: var(--amber-deep);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-align: center;
  line-height: 1.7;
  transform: rotate(8deg);
  background: rgba(251, 239, 214, 0.35);
}

/* ---------- home stats ---------- */

.stat-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  margin: 32px 0 90px;
}
.stat {
  padding: 28px 26px 26px;
  border-right: 1px solid var(--line);
  position: relative;
}
.stat:last-child { border-right: 0; }
.stat-num {
  font-family: var(--serif);
  font-size: clamp(32px, 3.4vw, 44px);
  font-weight: 500;
  line-height: 1;
  color: var(--forest);
  letter-spacing: -0.03em;
}
.stat-num small { font-size: 14px; color: var(--amber-deep); margin-left: 3px; letter-spacing: 0; }
.stat-label { margin-top: 10px; font-size: 12px; color: var(--ink-soft); letter-spacing: 0.03em; }
.stat-en { position: absolute; right: 20px; top: 22px; font-size: 8px; letter-spacing: 0.14em; color: var(--ink-faint); text-transform: uppercase; }

/* ---------- method ---------- */

.method { margin-bottom: 96px; }
.method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.method-card {
  position: relative;
  padding: 28px 26px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 253, 248, 0.9), rgba(251, 246, 235, 0.62));
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.method-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(197, 125, 50, 0.3); }
.method-card::after {
  content: "";
  position: absolute;
  right: -36px;
  bottom: -44px;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(23, 59, 50, 0.07);
  border-radius: 50%;
}
.step-num {
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--amber-deep);
}
.method-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  margin: 24px 0 18px;
  display: grid;
  place-items: center;
  background: var(--forest);
  color: var(--amber-soft);
}
.method-icon svg { width: 24px; height: 24px; }
.method-card h3 { margin: 0 0 10px; font-family: var(--serif); font-size: 23px; font-weight: 500; }
.method-card p { margin: 0; font-size: 13px; line-height: 1.8; color: var(--ink-soft); }
.method-card .mini-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }

/* ---------- continue ---------- */

.continue { margin-bottom: 96px; }
.continue-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 18px;
}
.continue-card {
  position: relative;
  display: grid;
  grid-template-columns: 152px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 26px;
  background: var(--forest);
  color: #f4ead4;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.continue-card::before {
  content: "";
  position: absolute;
  right: -80px;
  top: -120px;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(243, 223, 185, 0.18), transparent 68%);
}
.continue-cover {
  position: relative;
  width: 152px;
  aspect-ratio: 600 / 840;
  border-radius: 4px 9px 9px 4px;
  overflow: hidden;
  box-shadow: -7px 10px 0 rgba(0, 0, 0, 0.16), 0 18px 34px rgba(0, 0, 0, 0.26);
  transform: rotate(-1.4deg);
}
.continue-cover img { width: 100%; height: 100%; object-fit: cover; }
.continue-body { position: relative; z-index: 1; }
.continue-body .eyebrow { color: var(--amber-soft); }
.continue-body h3 { margin: 10px 0 4px; font-family: var(--serif); font-size: clamp(27px, 3vw, 38px); font-weight: 500; line-height: 1.1; }
.continue-body .cn-title { color: #c9d8cd; font-size: 13px; }
.continue-body .excerpt {
  margin: 17px 0 20px;
  font-family: var(--serif);
  font-size: 14.5px;
  line-height: 1.75;
  color: #e7ddc7;
  max-width: 430px;
}
.continue-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.continue-actions .btn-primary { background: var(--amber-soft); color: var(--forest); box-shadow: none; }
.continue-actions .btn-primary:hover { background: #f7e8c9; }
.continue-actions .quiet { font-size: 11.5px; color: #b9c9bf; }
.continue-actions .quiet b { color: #f1e6d0; }

.trail-card {
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.trail-top { display: flex; align-items: center; justify-content: space-between; }
.trail-title { font-family: var(--serif); font-size: 20px; }
.trail-sub { margin: 3px 0 0; font-size: 11px; color: var(--ink-faint); }
.progress-ring { position: relative; width: 84px; height: 84px; flex-shrink: 0; }
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring circle { fill: none; stroke-width: 5; }
.progress-ring .track { stroke: var(--paper-deep); }
.progress-ring .value { stroke: var(--amber); stroke-linecap: round; transition: stroke-dashoffset 0.8s ease; }
.progress-ring b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--forest);
}
.trail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.trail-stats div { text-align: center; }
.trail-stats b { display: block; font-family: var(--serif); font-size: 25px; font-weight: 500; color: var(--forest); line-height: 1.1; }
.trail-stats span { display: block; margin-top: 4px; font-size: 10px; color: var(--ink-faint); }
.trail-foot { margin-top: auto; padding-top: 20px; }
.trail-foot a { display: flex; align-items: center; justify-content: space-between; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--forest); font-weight: 600; }
.trail-foot svg { width: 15px; height: 15px; }

/* ---------- shelf ---------- */

.shelf { margin-bottom: 96px; }
.shelf-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.shelf-book {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 250px;
  padding: 22px 20px 18px;
  border-radius: 16px;
  border: 1px solid rgba(23, 59, 50, 0.14);
  background: var(--book-color, var(--forest));
  color: #f7eedb;
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
}
.shelf-book:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.shelf-book::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 11px;
  pointer-events: none;
}
.shelf-book::after {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -52px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
}
.shelf-book .sb-grade { font-size: 9px; letter-spacing: 0.18em; opacity: 0.68; }
.shelf-book h3 { margin: 22px 0 4px; font-family: var(--serif); font-size: 26px; font-weight: 500; line-height: 1.05; }
.shelf-book .sb-en { font-size: 9px; letter-spacing: 0.1em; opacity: 0.62; }
.shelf-book .sb-bottom { margin-top: auto; padding-top: 28px; display: flex; justify-content: space-between; align-items: flex-end; }
.shelf-book .sb-count { font-family: var(--serif); font-size: 25px; line-height: 1; }
.shelf-book .sb-count small { font-family: var(--sans); font-size: 9px; opacity: 0.7; margin-left: 2px; }
.shelf-book .sb-arrow { width: 28px; height: 28px; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 50%; display: grid; place-items: center; }
.shelf-book .sb-arrow svg { width: 13px; height: 13px; }
.shelf-book .sb-rule { height: 1px; background: rgba(255, 255, 255, 0.16); margin: 12px 0 12px; }

.quote-band {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 40px;
  padding: 42px 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.55);
  overflow: hidden;
}
.quote-band::before {
  content: "“";
  position: absolute;
  left: 18px;
  top: -34px;
  font-family: var(--serif);
  font-size: 160px;
  color: rgba(197, 125, 50, 0.13);
  line-height: 1;
}
.quote-band blockquote { margin: 0; position: relative; z-index: 1; }
.quote-band blockquote p { margin: 0; font-family: var(--serif); font-size: clamp(20px, 2.4vw, 29px); line-height: 1.5; color: var(--forest); }
.quote-band blockquote cite { display: block; margin-top: 12px; font-style: normal; font-size: 10px; letter-spacing: 0.13em; color: var(--ink-faint); text-transform: uppercase; }
.quote-band .quote-mark { font-family: var(--serif); font-size: 13px; color: var(--amber-deep); text-align: right; line-height: 1.8; }

/* ---------- page headers ---------- */

.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 40px;
  align-items: end;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line-strong);
  margin-bottom: 30px;
}
.page-title {
  margin: 16px 0 0;
  font-family: var(--serif);
  font-size: clamp(38px, 5vw, 62px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.08;
  color: var(--forest);
}
.page-lede { max-width: 620px; margin: 16px 0 0; font-size: 14px; line-height: 1.85; color: var(--ink-soft); }
.data-note { max-width: 620px; margin: 10px 0 0; font-size: 10px; line-height: 1.7; color: var(--ink-faint); }
.page-side { display: grid; grid-template-columns: repeat(2, minmax(92px, 1fr)); gap: 8px; justify-content: end; }
.page-side.three { grid-template-columns: repeat(3, minmax(88px, 1fr)); }
.mini-stat {
  min-width: 92px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 253, 248, 0.6);
}
.mini-stat b { display: block; font-family: var(--serif); font-size: 23px; font-weight: 500; line-height: 1.1; color: var(--forest); }
.mini-stat span { display: block; margin-top: 2px; font-size: 9.5px; color: var(--ink-faint); }

/* ---------- curriculum ---------- */

.curriculum-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.book-tabs { display: flex; flex-wrap: wrap; gap: 5px; }
.book-tab {
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  font-size: 12px;
  color: var(--ink-soft);
  transition: 0.18s;
}
.book-tab:hover { border-color: var(--line); color: var(--forest); }
.book-tab.is-active { background: var(--forest); color: #f7f0df; border-color: var(--forest); }
.book-tab span { opacity: 0.55; margin-left: 3px; font-size: 10px; }

.search-box {
  position: relative;
  width: min(320px, 100%);
}
.search-box svg { position: absolute; left: 13px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--ink-faint); pointer-events: none; }
.search-box input {
  width: 100%;
  height: 42px;
  padding: 0 38px 0 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.7);
  font-size: 12.5px;
  color: var(--ink);
  outline: none;
  transition: 0.2s;
}
.search-box input::placeholder { color: var(--ink-faint); }
.search-box input:focus { border-color: var(--amber); background: var(--card); box-shadow: 0 0 0 3px rgba(197, 125, 50, 0.1); }
.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-faint);
  display: grid;
  place-items: center;
}
.search-clear:hover { background: var(--paper-deep); }

.unit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.unit-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 212px;
  padding: 22px 22px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.7);
  text-align: left;
  transition: transform 0.22s, box-shadow 0.22s, border-color 0.22s, background 0.22s;
  overflow: hidden;
}
.unit-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
  border-color: rgba(197, 125, 50, 0.32);
  background: var(--card);
}
.unit-card::after {
  content: "";
  position: absolute;
  right: -22px;
  top: -22px;
  width: 90px;
  height: 90px;
  border: 1px solid rgba(23, 59, 50, 0.06);
  border-radius: 50%;
}
.unit-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.unit-no { font-size: 9px; letter-spacing: 0.17em; color: var(--amber-deep); font-weight: 700; }
.unit-book { font-size: 9.5px; color: var(--ink-faint); }
.unit-card h3 {
  margin: 18px 0 3px;
  font-family: var(--serif);
  font-size: clamp(20px, 1.9vw, 25px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.unit-card .unit-cn { font-size: 12px; color: var(--ink-soft); }
.unit-card .unit-theme { margin-top: 12px; font-size: 10.5px; color: var(--ink-faint); }
.unit-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.unit-counts { display: flex; gap: 10px; font-size: 9.5px; color: var(--ink-faint); }
.unit-counts b { color: var(--ink-soft); font-weight: 600; }
.unit-go { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; color: var(--forest); }
.unit-go svg { width: 12px; height: 12px; }
.unit-card:hover .unit-go { background: var(--forest); color: var(--amber-soft); border-color: var(--forest); }

.unit-group-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 36px 0 15px;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.unit-group-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.search-summary { margin: 10px 0 24px; font-size: 12px; color: var(--ink-soft); }
.search-summary b { color: var(--forest); }
.result-list { display: flex; flex-direction: column; gap: 8px; }
.result-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.6);
  transition: 0.18s;
  text-align: left;
}
.result-row:hover { border-color: var(--amber); background: var(--card); }
.result-main { flex: 1; min-width: 0; }
.result-main b { font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--forest); }
.result-main span { display: block; font-size: 11px; color: var(--ink-soft); }
.result-tag { font-size: 9px; padding: 3px 8px; border-radius: 999px; background: var(--paper-deep); color: var(--ink-soft); }
.result-unit { font-size: 10px; color: var(--ink-faint); white-space: nowrap; }

.empty-state {
  padding: 70px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
  background: rgba(255, 253, 248, 0.35);
}
.empty-state .empty-icon { width: 54px; height: 54px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-deep); color: var(--amber-deep); }
.empty-state .empty-icon svg { width: 24px; height: 24px; }
.empty-state h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 23px; font-weight: 500; }
.empty-state p { margin: 0 auto 20px; max-width: 380px; font-size: 12.5px; color: var(--ink-soft); }



/* ---------- 2000 word bank ---------- */

.vocab-banner {
  display: flex;
  align-items: center;
  gap: 26px;
  margin: 0 0 24px;
  padding: 20px 24px;
  border: 1px solid rgba(197, 125, 50, 0.24);
  border-radius: 16px;
  background: linear-gradient(120deg, rgba(251, 239, 214, 0.8), rgba(255, 253, 248, 0.65));
}
.vocab-banner > div { flex-shrink: 0; display: flex; align-items: baseline; gap: 8px; }
.vocab-banner b { font-family: var(--serif); font-size: 36px; font-weight: 500; line-height: 1; color: var(--amber-deep); }
.vocab-banner span { font-size: 10.5px; color: var(--ink-soft); }
.vocab-banner p { margin: 0; font-size: 11.5px; line-height: 1.8; color: var(--ink-soft); }

.letter-tabs { display: flex; flex-wrap: wrap; gap: 3px; max-width: 720px; }
.vocab-tools { flex-direction: column; align-items: stretch; gap: 12px; }
.vocab-tools .letter-tabs { display: grid; grid-template-columns: 44px repeat(26, minmax(0, 1fr)); max-width: none; gap: 3px; }
.vocab-tools .letter-tab:first-child { width: 44px; }
.vocab-tools .letter-tab { width: auto; }
.vocab-tools .search-box { width: min(360px, 100%); align-self: flex-end; }
.letter-tab {
  width: 31px;
  padding: 0;
  white-space: nowrap;
  height: 31px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-soft);
  transition: 0.15s;
}
.letter-tab:hover { border-color: var(--line); background: var(--card); color: var(--forest); }
.letter-tab.is-active { background: var(--forest); border-color: var(--forest); color: #f6eedc; }

.vocab-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 14px; }
.vocab-summary p { margin: 0; font-size: 11.5px; color: var(--ink-soft); }
.vocab-summary p b { color: var(--forest); }
.vocab-summary > span { font-size: 10px; color: var(--ink-faint); }

.bank-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bank-card {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.65);
  cursor: pointer;
  transition: 0.16s;
}
.bank-card:hover { border-color: rgba(197, 125, 50, 0.4); background: var(--card); box-shadow: 0 4px 14px rgba(23, 59, 50, 0.04); }
.bank-card:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.bank-card .word-play { width: 30px; height: 30px; }
.bank-main { min-width: 0; }
.bank-main > div { display: flex; align-items: baseline; gap: 6px; }
.bank-main b { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--forest); line-height: 1.2; }
.bank-main .pos { font-size: 8.5px; color: var(--amber-deep); }
.bank-main p { margin: 2px 0 0; font-size: 10.5px; line-height: 1.55; color: var(--ink-soft); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bank-side { display: flex; align-items: center; gap: 8px; }
.bank-source { font-size: 8px; letter-spacing: 0.04em; color: var(--ink-faint); white-space: nowrap; }
.bank-source.extra { color: var(--amber-deep); }
.bank-side .word-add { width: 26px; height: 26px; flex-shrink: 0; }
.vocab-more { display: flex; justify-content: center; padding: 24px 0 6px; }

/* ---------- grammar ---------- */

.grammar-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 30px; }
.grammar-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.grammar-card {
  position: relative;
  padding: 24px 24px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.7);
  transition: 0.2s;
}
.grammar-card:hover { border-color: rgba(197, 125, 50, 0.3); box-shadow: var(--shadow-sm); }
.grammar-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grammar-cat { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber-deep); }
.grammar-card h3 { margin: 14px 0 10px; font-family: var(--serif); font-size: 22px; font-weight: 500; line-height: 1.3; }
.formula {
  display: inline-block;
  padding: 5px 10px;
  margin-bottom: 12px;
  border-radius: 7px;
  background: var(--forest-soft);
  color: var(--forest);
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.6;
}
.grammar-card p { margin: 0; font-size: 12px; line-height: 1.8; color: var(--ink-soft); }
.grammar-card-foot { margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.grammar-source { font-size: 10px; color: var(--ink-faint); }
.grammar-link { font-size: 10.5px; color: var(--forest); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; padding: 0; cursor: pointer; }
.grammar-link svg { width: 12px; height: 12px; }

/* ---------- reader ---------- */

body.reader-mode { background: #f6f1e7; }

.reader-layout {
  display: grid;
  min-width: 0;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  padding: 34px 0 90px;
}
.reader-side {
  min-width: 0;
  position: sticky;
  top: calc(var(--header-h) + 24px);
  max-height: calc(100vh - var(--header-h) - 48px);
  display: flex;
  flex-direction: column;
}
.side-book {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.side-cover { width: 56px; aspect-ratio: 600/840; border-radius: 3px 6px 6px 3px; overflow: hidden; box-shadow: 0 8px 18px rgba(23, 59, 50, 0.22); flex-shrink: 0; }
.side-cover img { width: 100%; height: 100%; object-fit: cover; }
.side-book h2 { margin: 0; font-family: var(--serif); font-size: 16px; font-weight: 600; line-height: 1.2; }
.side-book p { margin: 4px 0 0; font-size: 9.5px; color: var(--ink-faint); letter-spacing: 0.04em; }
.side-progress { margin-top: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.side-progress-top { display: flex; justify-content: space-between; font-size: 9.5px; color: var(--ink-faint); margin-bottom: 7px; }
.side-progress-top b { color: var(--forest); font-weight: 600; }
.side-bar { height: 3px; border-radius: 3px; background: var(--paper-deep); overflow: hidden; }
.side-bar i { display: block; height: 100%; border-radius: 3px; background: var(--amber); transition: width 0.4s; }
.chapter-nav { min-width: 0; margin-top: 16px; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
.chapter-nav-title { font-size: 8.5px; letter-spacing: 0.16em; color: var(--ink-faint); text-transform: uppercase; margin: 0 0 8px 10px; }
.chapter-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--ink-soft);
  transition: 0.15s;
}
.chapter-link:hover { background: rgba(255, 253, 248, 0.7); color: var(--forest); }
.chapter-link.is-active { background: var(--card); color: var(--forest); box-shadow: 0 2px 12px rgba(23, 59, 50, 0.06); }
.chapter-link.is-active .cl-no { background: var(--forest); color: var(--amber-soft); border-color: var(--forest); }
.cl-no {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 10px;
  flex-shrink: 0;
  transition: 0.18s;
}
.cl-text { min-width: 0; }
.cl-text b { display: block; font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-text span { display: block; font-size: 8.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chapter-link.is-done .cl-no::after { content: ""; position: absolute; }
.chapter-link.is-done .cl-no { border-color: var(--amber); color: var(--amber-deep); background: var(--amber-glow); }
.side-tools { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.side-tool { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 8px 9px; border-radius: 9px; border: 1px solid var(--line); background: transparent; text-align: left; }
.side-tool:hover { background: var(--card); }
.side-tool b { font-family: var(--serif); font-size: 18px; font-weight: 500; line-height: 1; color: var(--forest); }
.side-tool span { font-size: 8px; color: var(--ink-faint); }

.reader-main { width: 100%; max-width: 820px; min-width: 0; }

.chapter-hero { margin-bottom: 22px; }
.chapter-kicker { display: flex; align-items: center; gap: 10px; font-size: 9.5px; letter-spacing: 0.18em; color: var(--amber-deep); text-transform: uppercase; }
.chapter-kicker .line { width: 30px; height: 1px; background: var(--amber); opacity: 0.5; }
.chapter-title {
  margin: 16px 0 2px;
  font-family: var(--serif);
  font-size: clamp(36px, 4.6vw, 58px);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.035em;
  color: var(--forest);
}
.chapter-cn { font-size: 13px; color: var(--ink-soft); letter-spacing: 0.05em; }
.epigraph {
  margin: 22px 0 0;
  padding: 14px 0 14px 18px;
  border-left: 2px solid var(--amber-soft);
  font-family: var(--serif);
  font-size: 14px;
  font-style: italic;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 600px;
}
.epigraph span { display: block; margin-top: 5px; font-family: var(--sans); font-style: normal; font-size: 10.5px; color: var(--ink-faint); }
.chapter-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; align-items: center; }
.chapter-meta .meta-item { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; color: var(--ink-faint); }
.chapter-meta .meta-item svg { width: 13px; height: 13px; }
.chapter-meta .divider { width: 1px; height: 12px; background: var(--line-strong); margin: 0 4px; }
.focus-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

.reader-toolbar {
  position: sticky;
  top: var(--header-h);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  margin: 24px 0 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(246, 241, 231, 0.9);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgba(23, 59, 50, 0.05);
  flex-wrap: wrap;
}
.toolbar-group { display: flex; align-items: center; gap: 5px; }
.toolbar-label { font-size: 8.5px; letter-spacing: 0.12em; color: var(--ink-faint); text-transform: uppercase; margin: 0 4px 0 7px; }
.tool-btn {
  height: 31px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font-size: 10.5px;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: 0.16s;
}
.tool-btn:hover { background: var(--card); color: var(--forest); }
.tool-btn.is-active { background: var(--forest); color: #f4ead4; }
.tool-btn svg { width: 13px; height: 13px; }
.speed-group { display: inline-flex; gap: 2px; padding: 2px; background: var(--paper-deep); border-radius: 8px; }
.speed-btn { height: 27px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; font-size: 9.5px; color: var(--ink-soft); }
.speed-btn.is-active { background: var(--card); color: var(--forest); box-shadow: 0 1px 4px rgba(0,0,0,0.08); font-weight: 600; }

.reader-body {
  position: relative;
  margin-top: 10px;
  padding: 6px 0;
}
.chapter-text { margin: 0; }
.paragraph { margin: 0 0 18px; }
.sentence {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
  padding: 13px 14px 13px 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background 0.22s, border-color 0.22s, box-shadow 0.22s;
}
.sentence + .sentence { margin-top: 2px; }
.sentence::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 2px;
  border-radius: 2px;
  background: transparent;
  transition: background 0.2s;
}
.sentence:hover { background: rgba(255, 253, 248, 0.62); }
.sentence.is-playing {
  background: var(--amber-glow);
  border-color: rgba(197, 125, 50, 0.24);
  box-shadow: 0 5px 18px rgba(197, 125, 50, 0.09);
}
.sentence.is-playing::before { background: var(--amber); }
.listen-btn {
  position: relative;
  width: 34px;
  height: 34px;
  margin-top: 3px;
  border: 1px solid rgba(23, 59, 50, 0.18);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.85);
  color: var(--forest);
  display: grid;
  place-items: center;
  transition: 0.18s;
  flex-shrink: 0;
}
.listen-btn, .tool-btn, .speed-btn, .chapter-link, .unit-card, .word-add, .word-play, .btn { touch-action: manipulation; }

.listen-btn:hover { background: var(--forest); color: var(--amber-soft); border-color: var(--forest); transform: scale(1.04); }
.listen-btn svg { width: 15px; height: 15px; }
.listen-btn .icon-pause { display: none; }
.sentence.is-playing .listen-btn { background: var(--forest); border-color: var(--forest); color: var(--amber-soft); }
.sentence.is-playing .listen-btn .icon-play { display: none; }
.sentence.is-playing .listen-btn .icon-pause { display: block; }
.listen-btn::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid var(--amber);
  opacity: 0;
  transform: scale(0.85);
}
.sentence.is-playing .listen-btn::after { animation: soundRing 1.8s ease-out infinite; }

.sentence-body { min-width: 0; }
.sentence-en {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(17.5px, 1.55vw, 20.5px);
  line-height: 2.05;
  color: var(--ink);
  letter-spacing: 0.004em;
}
.sentence-en ruby {
  ruby-position: over;
  ruby-align: center;
  padding: 0 1px;
  border-bottom: 1px dotted rgba(197, 125, 50, 0.5);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.sentence-en ruby:hover { color: var(--amber-deep); background: rgba(243, 223, 185, 0.32); }
.sentence-en rt {
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--amber-deep);
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0.92;
  position: relative;
  top: 2px;
}
.sentence-cn {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
  transition: opacity 0.2s;
}
.sentence-index {
  position: absolute;
  right: 14px;
  top: 15px;
  font-family: var(--mono);
  font-size: 8px;
  color: var(--ink-faint);
  opacity: 0;
  transition: opacity 0.2s;
}
.sentence:hover .sentence-index { opacity: 0.65; }
body.hide-translation .sentence-cn { display: none; }
body.hide-gloss rt { display: none; }
body.hide-gloss .sentence-en ruby { border-bottom-color: transparent; }

.chapter-end {
  margin-top: 38px;
  padding-top: 28px;
  border-top: 1px solid var(--line-strong);
}
.chapter-end-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.chapter-end-head h3 { margin: 0; font-family: var(--serif); font-size: 24px; font-weight: 500; }
.chapter-end-head p { margin: 4px 0 0; font-size: 10.5px; color: var(--ink-faint); }
.vocab-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.vocab-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.6);
  font-size: 10.5px;
  color: var(--ink-soft);
  transition: 0.16s;
}
.vocab-chip:hover { border-color: var(--amber); background: var(--amber-glow); color: var(--amber-deep); }
.vocab-chip b { font-weight: 600; color: var(--forest); }
.reading-note {
  margin-top: 24px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.5);
}
.reading-note .note-label { font-size: 8.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber-deep); }
.reading-note p { margin: 8px 0 0; font-family: var(--serif); font-size: 16px; line-height: 1.65; color: var(--forest); }
.reading-note span { display: block; margin-top: 5px; font-family: var(--sans); font-size: 10.5px; color: var(--ink-soft); }
.chapter-finish { display: flex; align-items: center; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.chapter-finish .done-note { font-size: 10.5px; color: var(--ink-faint); }

.next-chapter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 34px;
  padding: 24px 26px;
  border-radius: 16px;
  background: var(--forest);
  color: #f4ead4;
  transition: transform 0.2s, box-shadow 0.2s;
}
.next-chapter:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.next-chapter small { display: block; font-size: 8.5px; letter-spacing: 0.15em; color: #b9c9bf; }
.next-chapter b { display: block; margin-top: 5px; font-family: var(--serif); font-size: 22px; font-weight: 500; }
.next-chapter span { display: block; margin-top: 2px; font-size: 10px; color: #a9bdb1; }
.next-chapter .next-arrow { width: 38px; height: 38px; border: 1px solid rgba(244, 234, 212, 0.3); border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.next-chapter svg { width: 16px; height: 16px; }

/* ---------- wordbook ---------- */

.wordbook-list { display: flex; flex-direction: column; gap: 10px; }
.wordbook-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 17px 19px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.65);
}
.wordbook-item .wb-play { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; color: var(--forest); }
.wordbook-item .wb-play:hover { background: var(--forest); color: var(--amber-soft); }
.wordbook-item .wb-play svg { width: 15px; height: 15px; }
.wb-word { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--forest); line-height: 1.1; }
.wb-cn { margin-top: 3px; font-size: 12px; color: var(--ink-soft); }
.wb-source { margin-top: 4px; font-size: 9.5px; color: var(--ink-faint); font-style: italic; }
.wb-remove { width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-faint); display: grid; place-items: center; }
.wb-remove:hover { background: #f6e4de; color: var(--rust); }
.wb-remove svg { width: 15px; height: 15px; }
.wordbook-actions { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.wordbook-actions p { margin: 0; font-size: 11.5px; color: var(--ink-faint); }

/* ---------- drawer / overlay ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(12, 30, 25, 0.38);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.25s;
}
.overlay.is-open { opacity: 1; }
.drawer {
  position: fixed;
  z-index: 510;
  top: 0;
  right: 0;
  width: min(590px, 100%);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  transform: translateX(102%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.drawer.is-open { transform: translateX(0); }
.drawer-head {
  padding: 26px 26px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255, 253, 248, 0.9), rgba(244, 239, 228, 0.8));
}
.drawer-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.drawer-close { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: transparent; display: grid; place-items: center; }
.drawer-close:hover { background: var(--card); }
.drawer-close svg { width: 16px; height: 16px; }
.drawer-head .unit-no { font-size: 9.5px; }
.drawer-head h2 { margin: 12px 0 2px; font-family: var(--serif); font-size: 32px; font-weight: 500; line-height: 1.12; letter-spacing: -0.02em; }
.drawer-head .drawer-cn { font-size: 12px; color: var(--ink-soft); }
.drawer-head .drawer-theme { margin-top: 8px; font-size: 10.5px; color: var(--ink-faint); }
.drawer-head .drawer-focus { margin-top: 14px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 253, 248, 0.6); font-size: 10.5px; color: var(--ink-soft); line-height: 1.7; }
.drawer-head .drawer-focus b { color: var(--amber-deep); }
.drawer-tabs { display: flex; gap: 3px; padding: 0 26px; border-bottom: 1px solid var(--line); background: rgba(255, 253, 248, 0.45); }
.drawer-tab { padding: 13px 12px 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; font-size: 11.5px; color: var(--ink-faint); }
.drawer-tab:hover { color: var(--forest); }
.drawer-tab.is-active { color: var(--forest); border-bottom-color: var(--amber); font-weight: 600; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 26px 40px; }
.drawer-section-note { margin: 0 0 14px; font-size: 10.5px; color: var(--ink-faint); line-height: 1.6; }

.word-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.word-row:last-child { border-bottom: 0; }
.word-play { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--forest); display: grid; place-items: center; }
.word-play:hover { background: var(--forest); color: var(--amber-soft); }
.word-play svg { width: 12px; height: 12px; }
.word-main b { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--ink); }
.word-main .pos { font-size: 9px; color: var(--amber-deep); margin-left: 6px; }
.word-main p { margin: 1px 0 0; font-size: 11.5px; color: var(--ink-soft); }
.word-add { width: 27px; height: 27px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink-faint); display: grid; place-items: center; }
.word-add:hover { border-color: var(--amber); color: var(--amber-deep); background: var(--amber-glow); }
.word-add.is-saved { background: var(--amber-soft); border-color: var(--amber); color: var(--amber-deep); }
.word-add svg { width: 12px; height: 12px; }

.phrase-row, .pattern-row { padding: 13px 0; border-bottom: 1px solid var(--line); }
.phrase-row:last-child, .pattern-row:last-child { border-bottom: 0; }
.phrase-row b { font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--forest); }
.phrase-row p { margin: 3px 0 0; font-size: 11.5px; color: var(--ink-soft); }
.pattern-row .pattern-en { font-family: var(--serif); font-size: 15.5px; line-height: 1.6; color: var(--ink); }
.pattern-row .pattern-cn { margin-top: 5px; font-size: 11.5px; color: var(--ink-soft); }

.grammar-panel h3 { margin: 0 0 10px; font-family: var(--serif); font-size: 22px; font-weight: 500; }
.grammar-panel .formula { font-size: 11px; }
.grammar-panel p { font-size: 12.5px; line-height: 1.9; color: var(--ink-soft); }
.grammar-panel .grammar-example { margin-top: 16px; padding: 13px 15px; border-left: 2px solid var(--amber); background: rgba(255, 253, 248, 0.7); font-family: var(--serif); font-size: 14px; color: var(--forest); }

/* ---------- word popover ---------- */

.word-popover {
  position: fixed;
  z-index: 1000;
  width: 278px;
  padding: 17px 18px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 24px 60px rgba(12, 35, 28, 0.22);
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  transition: opacity 0.16s, transform 0.16s;
}
.word-popover.is-open { opacity: 1; transform: translateY(0) scale(1); }
.pop-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pop-word { font-family: var(--serif); font-size: 25px; font-weight: 600; line-height: 1.1; color: var(--forest); }
.pop-pos { font-size: 9px; color: var(--amber-deep); letter-spacing: 0.04em; margin-top: 3px; }
.pop-close { border: 0; background: transparent; color: var(--ink-faint); width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; }
.pop-close:hover { background: var(--paper-deep); }
.pop-cn { margin: 10px 0 0; font-size: 13px; color: var(--ink); }
.pop-source { margin: 8px 0 0; padding-top: 9px; border-top: 1px solid var(--line); font-size: 9.5px; color: var(--ink-faint); line-height: 1.6; }
.pop-actions { display: flex; gap: 7px; margin-top: 12px; }
.pop-btn { flex: 1; height: 33px; border: 1px solid var(--line); border-radius: 8px; background: transparent; font-size: 10.5px; color: var(--ink-soft); display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.pop-btn:hover { border-color: var(--amber); color: var(--amber-deep); background: var(--amber-glow); }
.pop-btn.is-saved { background: var(--amber-soft); border-color: var(--amber); color: var(--amber-deep); }
.pop-btn svg { width: 12px; height: 12px; }

/* ---------- toast / footer ---------- */

.toast {
  position: fixed;
  z-index: 2000;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 16px);
  padding: 11px 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: var(--forest);
  color: #f8f1e2;
  font-size: 12px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
  max-width: calc(100vw - 40px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.site-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  padding: 36px clamp(20px, 4vw, 56px) 42px;
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.35);
}
.footer-brand { display: flex; gap: 12px; align-items: center; }
.footer-brand strong { font-family: var(--serif); font-size: 15px; font-weight: 600; color: var(--forest); }
.footer-brand p { margin: 3px 0 0; font-size: 10.5px; color: var(--ink-faint); }
.footer-meta { text-align: right; }
.footer-meta p { margin: 0 0 3px; font-size: 9.5px; color: var(--ink-faint); }

/* ---------- entry animations ---------- */

@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes bookIn {
  from { opacity: 0; transform: rotate(2.2deg) translateY(24px); }
  to { opacity: 1; transform: rotate(2.2deg) translateY(0); }
}
@keyframes floatA {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50% { transform: rotate(-2deg) translateY(-9px); }
}
@keyframes floatB {
  0%, 100% { transform: rotate(-2deg) translateY(0); }
  50% { transform: rotate(-1deg) translateY(8px); }
}
@keyframes soundRing {
  0% { opacity: 0.6; transform: scale(0.84); }
  100% { opacity: 0; transform: scale(1.35); }
}

/* ---------- responsive ---------- */

@media (max-width: 1120px) {
  .main-nav a { padding: 9px 10px; }
  .hero { grid-template-columns: 1.1fr 0.9fr; gap: 30px; }
  .book-tag { right: -6%; }
  .book-note { left: -6%; }
  .shelf-grid { grid-template-columns: repeat(5, 1fr); }
  .shelf-book { padding: 18px 16px 15px; }
  .shelf-book h3 { font-size: 22px; }
  .unit-grid { grid-template-columns: repeat(2, 1fr); }
  .reader-layout { grid-template-columns: 236px minmax(0, 1fr); gap: 34px; }
}

@media (max-width: 980px) {
  .main-nav { display: none; }
  .menu-toggle { display: inline-grid; }
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    max-height: none;
    padding: 34px 0 50px;
    gap: 20px;
  }
  .hero-copy { max-width: 680px; }
  .hero-art { min-height: 490px; margin-top: 4px; }
  .book-stage { width: 300px; }
  .book-tag { right: 1%; top: 2%; bottom: auto; }
  .book-note { left: 0; bottom: 7%; }
  .hero-stamp { right: 8%; }
  .stat-band { margin-bottom: 66px; }
  .method-grid { grid-template-columns: 1fr 1fr; }
  .method-card:last-child { grid-column: 1 / -1; }
  .continue-grid { grid-template-columns: 1fr; }
  .shelf-grid { grid-template-columns: repeat(3, 1fr); }
  .shelf-book { min-height: 210px; }
  .page-head { grid-template-columns: 1fr; gap: 22px; }
  .page-side { justify-content: flex-start; }
  .reader-layout { grid-template-columns: 1fr; gap: 26px; padding-top: 24px; }
  .reader-side { position: static; max-height: none; }
  .chapter-nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 6px; }
  .chapter-nav-title { display: none; }
  .chapter-link { flex: 0 0 auto; min-width: 180px; border: 1px solid var(--line); }
  .side-tools { display: none; }
  .side-book, .side-progress { max-width: 560px; }
  .reader-main { max-width: none; }
  .reader-toolbar { top: var(--header-h); }
}

@media (max-width: 760px) {
  :root { --header-h: 64px; }
  .site-header { padding: 0 18px; }
  .brand-text small { display: none; }
  .brand-text strong { font-size: 18px; }
  .wordbook-link span { display: none; }
  .wordbook-link { padding: 0 11px; }
  .wrap { width: calc(100% - 36px); }
  .page { padding: 34px 0 64px; }
  .hero-title { font-size: clamp(43px, 12vw, 64px); }
  .hero-lede { font-size: 14px; }
  .hero-meta { gap: 12px; }
  .hero-art { min-height: 430px; }
  .book-stage { width: 260px; }
  .book-tag { width: 132px; padding: 9px 11px; right: -2%; top: 1%; bottom: auto; }
  .book-tag strong { font-size: 14px; }
  .book-note { width: 168px; padding: 11px 12px; bottom: 1%; left: -2%; }
  .book-note b { font-size: 16px; }
  .hero-stamp { display: none; }
  .stat-band { grid-template-columns: repeat(2, 1fr); margin: 20px 0 60px; }
  .stat { padding: 20px 16px; border-bottom: 1px solid var(--line); }
  .stat:nth-child(2n) { border-right: 0; }
  .stat:nth-child(n+3) { border-bottom: 0; }
  .stat-en { display: none; }
  .method-grid { grid-template-columns: 1fr; }
  .method-card:last-child { grid-column: auto; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .continue-card { grid-template-columns: 100px 1fr; gap: 18px; padding: 20px; }
  .continue-cover { width: 100px; }
  .continue-body .excerpt { font-size: 12.5px; margin: 12px 0 16px; }
  .shelf-grid { grid-template-columns: repeat(2, 1fr); }
  .shelf-book:last-child { grid-column: 1 / -1; min-height: 140px; }
  .shelf-book:last-child .sb-bottom { padding-top: 12px; }
  .quote-band { grid-template-columns: 1fr; padding: 28px 24px; gap: 16px; }
  .quote-band .quote-mark { text-align: left; }
  .curriculum-tools { flex-direction: column; align-items: stretch; }
  .search-box { width: 100%; }
  .unit-grid { grid-template-columns: 1fr; }
  .unit-card { min-height: 190px; }
  .grammar-grid { grid-template-columns: 1fr; }
  .chapter-title { font-size: clamp(32px, 9vw, 42px); }
  .sentence { grid-template-columns: 32px minmax(0, 1fr); gap: 10px; padding: 11px 8px 11px 4px; }
  .listen-btn { width: 31px; height: 31px; }
  .sentence-en { font-size: 16.5px; line-height: 2.1; }
  .sentence-cn { font-size: 11.5px; }
  .reader-toolbar { padding: 8px; gap: 6px; }
  .toolbar-label { display: none; }
  .reader-toolbar .tool-btn { font-size: 9.5px; padding: 0 8px; }
  .continue-actions .quiet { width: 100%; }
  .site-footer { flex-direction: column; align-items: flex-start; gap: 20px; padding: 28px 20px 32px; }
  .footer-meta { text-align: left; }
  .chapter-link { min-width: 160px; }
  .drawer { width: 100%; }
  .drawer-head { padding: 20px 20px 16px; }
  .drawer-tabs { padding: 0 20px; }
  .drawer-body { padding: 16px 20px 32px; }
  .drawer-head h2 { font-size: 27px; }
  .toast { bottom: 18px; }
  .word-popover {
    left: 12px !important;
    right: 12px;
    top: auto !important;
    bottom: 12px;
    width: auto;
    transform: translateY(10px);
  }
  .word-popover.is-open { transform: translateY(0); }
}

@media (max-width: 460px) {
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .brand-text strong { font-size: 16px; }
  .header-tools { gap: 5px; }
  .hero-title { font-size: 40px; letter-spacing: -0.05em; }
  .hero-lede { font-size: 13.5px; }
  .hero-actions .btn { flex: 1; min-width: 130px; padding: 0 14px; }
  .hero-art { min-height: 380px; }
  .book-stage { width: 224px; }
  .book-tag { display: none; }
  .book-note { width: 150px; }
  .stat-num { font-size: 31px; }
  .continue-card { grid-template-columns: 1fr; }
  .continue-cover { width: 86px; }
  .trail-stats b { font-size: 21px; }
  .shelf-grid { grid-template-columns: 1fr; }
  .shelf-book { min-height: 150px; }
  .shelf-book .sb-bottom { padding-top: 14px; }
  .page-title { font-size: 38px; }
  .mini-stat { min-width: 78px; padding: 10px 11px; }
  .chapter-hero { margin-bottom: 14px; }
  .epigraph { font-size: 12.5px; }
  .sentence-en { font-size: 15.5px; line-height: 2.05; }
  .sentence-en rt { font-size: 8px; }
  .sentence-cn { font-size: 11px; }
  .listen-btn { width: 29px; height: 29px; }
}





/* ---------- tablet / touch refinements ---------- */

@media (max-width: 980px) {
  .header-tools .wordbook-link,
  .header-tools .icon-button { height: 40px; min-height: 40px; }
  .header-tools .icon-button { width: 40px; }
  .listen-btn { width: 38px; height: 38px; }
  .sentence { grid-template-columns: 40px minmax(0, 1fr); }
  .chapter-link { min-height: 44px; }
  .reader-toolbar .tool-btn { min-height: 38px; }
  .drawer-close { width: 40px; height: 40px; }
  .word-play, .word-add { width: 34px; height: 34px; }
  .chapter-nav {
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent 100%);
  }
}

/* ---------- mobile reading comfort ---------- */

@media (max-width: 760px) {
  .page-side.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vocab-tools .letter-tabs { display: flex; flex-wrap: wrap; }
  .vocab-tools .letter-tab { width: 34px; }
  .vocab-tools .letter-tab:first-child { width: 44px; }
  .vocab-tools .search-box { width: 100%; align-self: stretch; }
  .vocab-banner { flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px 18px; }
  .vocab-banner b { font-size: 30px; }
  .letter-tabs { max-width: none; gap: 2px; }
  .letter-tab { width: 34px; height: 34px; }
  .bank-grid { grid-template-columns: 1fr; }
  .bank-card { grid-template-columns: 32px minmax(0, 1fr) auto; padding: 12px 11px; }
  .bank-side .word-add { width: 32px; height: 32px; }
  .vocab-summary { align-items: flex-start; }
  :root { --header-h: calc(64px + env(safe-area-inset-top)); }
  .site-header { height: var(--header-h); padding-top: env(safe-area-inset-top); }
  .mobile-menu { top: var(--header-h); }
  .header-tools .wordbook-link,
  .header-tools .icon-button { height: 40px; min-height: 40px; }
  .header-tools .icon-button { width: 40px; }
  .site-footer { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }

  .reader-layout { gap: 14px; padding-top: 14px; }
  .reader-side { max-width: none; }
  .side-book, .side-progress { display: none; }
  .chapter-nav { margin-top: 0; padding-bottom: 6px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
  .chapter-link { min-width: 150px; min-height: 44px; scroll-snap-align: start; }
  .reader-toolbar { top: var(--header-h); padding: 8px; row-gap: 6px; }
  .reader-toolbar .tool-btn { min-height: 38px; }
  .speed-btn { min-height: 32px; }
  .sentence { grid-template-columns: 40px minmax(0, 1fr); gap: 10px; padding: 12px 6px 12px 2px; }
  .listen-btn { width: 38px; height: 38px; }
  .sentence-en { font-size: 16px; line-height: 2.05; }
  .sentence-en rt { font-size: 9px; }
  .sentence-cn { font-size: 12.5px; line-height: 1.75; }
  .chapter-hero { margin-bottom: 16px; }
  .chapter-title { font-size: clamp(31px, 9vw, 40px); }
  .epigraph { font-size: 13px; }
  .drawer { height: 100vh; height: 100dvh; }
  .drawer-close { width: 40px; height: 40px; }
  .drawer-head { padding-top: calc(20px + env(safe-area-inset-top)); }
  .drawer-body { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
  .drawer-tabs { overflow-x: auto; }
  .word-play, .word-add { width: 34px; height: 34px; }
  .pop-btn { min-height: 38px; }
  .word-popover { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(18px + env(safe-area-inset-bottom)); }
}

@media (max-width: 460px) {
  .sentence-en { font-size: 16px; line-height: 2.0; }
  .sentence-en rt { font-size: 9px; }
  .sentence-cn { font-size: 12px; }
  .listen-btn { width: 38px; height: 38px; }
  .chapter-title { font-size: 31px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.boot-screen { min-height: 62vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--ink-faint); font-size: 11px; letter-spacing: 0.06em; }
.boot-mark { width: 30px; height: 30px; border: 1px solid var(--line-strong); border-top-color: var(--amber); border-radius: 50%; animation: bootSpin 0.9s linear infinite; }
@keyframes bootSpin { to { transform: rotate(360deg); } }

.boot-error { max-width: 620px; margin: 12vh auto; padding: 0 24px; }
.boot-error h1 { margin: 18px 0 12px; font-family: var(--serif); font-size: 40px; font-weight: 500; color: var(--forest); }
.boot-error p { margin: 0 0 12px; font-size: 13px; line-height: 1.8; color: var(--ink-soft); }
.boot-error .boot-error-note { font-size: 10.5px; color: var(--ink-faint); }
.boot-error code { padding: 1px 5px; border-radius: 4px; background: var(--paper-deep); font-family: var(--mono); font-size: 0.9em; }
