/* ==========================================================================
   三册成人实用英语 · 网站设计系统
   颜色取自书的封面：米色纸面 #f8f4ea、深青色标题、赭黄色册号。
   三册各有一个识别色（只用在细节：册号、细边、标签），整站保持同一套。
   只做浅色：页面要和书的米色纸面一致（不跟系统深色模式切换）。
   手机优先：先写 375px，再用 min-width 往大屏幕加。所有颜色、间距都是变量。
   ========================================================================== */

@font-face { font-family: "Lora"; src: url("../fonts/lora-regular.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/instrument-sans-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/instrument-sans-bold.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
/* 书中标题用的衬线中文（BookSerif，基于 Noto Serif SC，SIL OFL 1.1）。只含本站标题用到的字，
   由 独立站/素材制作/subset_fonts.py 生成；缺的字自动落到系统宋体，不会出现方块。 */
@font-face { font-family: "Book Serif"; src: url("../fonts/book-serif-subset.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --paper: #f8f4ea;
  --paper-2: #f0e9d8;
  --surface: #fffdf8;
  --surface-2: #f4efe3;
  --ink: #1c2a28;
  --muted: #4d5957;
  --line: #e2dac6;
  --line-strong: #c9bea4;

  --teal-950: #0f2e2b;
  --teal-900: #163f3b;
  --teal-800: #1d4f49;
  --teal-700: #245f57;
  --teal-100: #dfece7;
  --teal-50: #eef5f1;
  --ochre: #d3a23c;
  --ochre-text: #865b0b;

  --b1: #8a5d08;  --b1-soft: #f5ead2;
  --b2: #2b6c84;  --b2-soft: #dfecf1;
  --b3: #a14f3a;  --b3-soft: #f4e2dc;

  --primary: var(--teal-800);
  --primary-hover: var(--teal-950);
  --on-primary: #ffffff;
  --link: var(--teal-700);
  --ring: 0 0 0 3px rgb(211 162 60 / 0.55);

  --success-bg: #e8f3ec; --success-text: #1e5a37; --success-line: #b5d8c1;
  --error-bg: #fbeceb;   --error-text: #8c2a20;   --error-line: #efc4be;
  --info-bg: #eaf1f5;    --info-text: #1f4f66;    --info-line: #bcd3df;
  --warn-bg: #fdf3d9;    --warn-text: #6d4a06;    --warn-line: #ecd292;
  --danger: #a3332a;     --danger-hover: #82261f;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgb(28 42 40 / 0.06), 0 6px 20px rgb(28 42 40 / 0.07);
  --shadow-book: 0 2px 4px rgb(28 42 40 / 0.10), 0 14px 32px rgb(28 42 40 / 0.16);
  --container: 1120px;
  --header-h: 64px;

  --font: "Instrument Sans", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, sans-serif;
  --font-serif: "Lora", "Book Serif", "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --leading: 1.75;

  /* 脚手架后台（admin.css）用的旧变量名，指到本站颜色 */
  --bg: var(--paper);
  --text: var(--ink);
  --brand-50: var(--teal-50);
  --brand-500: var(--teal-700);
  --brand-700: var(--teal-700);
  --brand-800: var(--teal-800);

  color-scheme: light;
}

/* 缅文（脚手架规矩，本站目前只开中文，语言包留着）：叠加的元音符号要行高 ≥ 2，不能加字距、不能转大小写 */
html[lang="my"] { --leading: 2; }
html[lang="my"] :is(h1, h2, h3, h4, .btn, .badge, .eyebrow) { line-height: 1.8; letter-spacing: normal; text-transform: none; }

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: var(--leading);
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-wrap: anywhere;
}
@media (min-width: 900px) { body { font-size: 1.0625rem; } }
img, svg { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; line-height: 1.3; margin: 0 0 0.6em; color: var(--teal-950); text-wrap: balance; }
h1 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 1.15rem + 0.9vw, 1.8rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.25em; margin: 0 0 1em; }
li + li { margin-top: 0.35em; }
code, pre { font-family: var(--font-mono); font-size: 0.9em; }
:focus-visible { outline: 2px solid var(--teal-900); outline-offset: 2px; box-shadow: var(--ring); border-radius: var(--radius-sm); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.skip-link { position: absolute; left: -999px; top: 0.5rem; background: var(--surface); padding: 0.5rem 1rem; z-index: 100; }
.skip-link:focus { left: 0.5rem; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.inline { display: inline; margin: 0; }
.mono { font-family: var(--font-mono); font-size: 0.85em; overflow-wrap: anywhere; }

/* ---------- 布局 ---------- */
.container { width: min(var(--container), 100% - 2rem); margin-inline: auto; }
.main { flex: 1; }
.section { padding-block: 2.75rem; }
.section-tight { padding-block: 1.75rem; }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { max-width: 44rem; margin-bottom: 1.75rem; }
.section-head p { color: var(--muted); }
@media (min-width: 900px) { .section { padding-block: 4rem; } }
.narrow { max-width: 30rem; margin-inline: auto; }
.prose { max-width: 44rem; }
.prose h2 { margin-top: 2rem; font-size: 1.35rem; }
.prose h3 { margin-top: 1.5rem; }
.stack { display: grid; gap: 1rem; }
.grid-3 { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
.grid-2 { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.eyebrow { font-size: 0.85rem; font-weight: 600; color: var(--ochre-text); margin-bottom: 0.5rem; }

/* ---------- 测试/模拟提示条 ---------- */
.mode-bar { background: var(--warn-bg); color: var(--warn-text); border-bottom: 1px solid var(--warn-line); font-size: 0.88rem; line-height: 1.65; }
.mode-bar .container { padding-block: 0.5rem; }
.mode-bar.is-sim { background: #3b2a5a; color: #f3eefe; border-color: #2a1d42; }

/* ---------- 头部导航 ---------- */
.site-header { background: rgb(248 244 234 / 0.95); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-row { display: flex; align-items: center; gap: 0.75rem; min-height: var(--header-h); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--teal-950); text-decoration: none; margin-right: auto; min-height: 44px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--teal-800); color: #fff; font-family: "Book Serif", "Songti SC", serif; font-size: 1.05rem; font-weight: 600; flex: none; letter-spacing: 0; }
.brand-name { font-family: var(--font-serif); font-weight: 600; font-size: 1.05rem; line-height: 1.2; }
.site-nav { display: none; width: 100%; flex-direction: column; gap: 0.1rem; padding-bottom: 1rem; }
.site-nav.is-open { display: flex; }
.site-nav a { color: var(--ink); text-decoration: none; padding: 0.6rem 0.25rem; border-radius: var(--radius-sm); min-height: 44px; display: flex; align-items: center; }
.site-nav a:hover { color: var(--teal-700); }
.site-nav a[aria-current="page"] { color: var(--teal-800); font-weight: 600; }
.site-nav a.btn { color: var(--on-primary); justify-content: center; margin-top: 0.5rem; }
.nav-spacer { display: none; }
.nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: transparent; color: var(--ink); cursor: pointer; }
.burger, .burger::before, .burger::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; }
.burger::before, .burger::after { content: ""; position: absolute; left: 0; }
.burger::before { top: -6px; }
.burger::after { top: 6px; }
@media (min-width: 1000px) {
  .nav-toggle { display: none; }
  .site-nav { display: flex; flex-direction: row; align-items: center; width: auto; flex: 1; padding: 0; gap: 0.1rem; }
  .site-nav a { padding: 0.4rem 0.6rem; font-size: 0.95rem; }
  .site-nav a.btn { margin: 0 0 0 0.5rem; min-height: 40px; padding: 0.4rem 1.1rem; }
  .nav-spacer { display: block; flex: 1; }
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  min-height: 48px; padding: 0.6rem 1.35rem;
  font: inherit; font-weight: 600; line-height: 1.25; text-align: center;
  color: var(--on-primary); background: var(--primary);
  border: 1px solid transparent; border-radius: 999px;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn-outline { background: transparent; color: var(--teal-900); border-color: var(--teal-800); }
.btn-outline:hover { background: var(--teal-50); color: var(--teal-950); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-small { min-height: 44px; padding: 0.35rem 0.95rem; font-size: 0.92rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--line); color: var(--muted); border-color: var(--line); cursor: not-allowed; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--link); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; }
.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }

/* ---------- 首页大标题 ---------- */
.hero { padding-block: 2.25rem 2.75rem; }
.hero-grid { display: grid; gap: 2.25rem; align-items: center; }
.hero h1 { font-size: clamp(2rem, 1.4rem + 3vw, 3.2rem); line-height: 1.25; margin-bottom: 0.5em; }
.hero-tag { font-family: var(--font-serif); color: var(--ochre-text); font-size: 1.05rem; margin-bottom: 0.75rem; }
.hero-lead { font-size: 1.1rem; color: var(--muted); max-width: 34rem; }
.hero-covers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; align-items: end; max-width: 520px; margin-inline: auto; width: 100%; padding-top: 14px; }
.hero-covers a { display: block; border-radius: 6px; box-shadow: var(--shadow-book); transition: transform 0.2s ease; }
.hero-covers a:nth-child(2) { transform: translateY(-14px); }
.hero-covers a:hover { transform: translateY(-4px); }
.hero-covers a:nth-child(2):hover { transform: translateY(-18px); }
.hero-covers img { display: block; border-radius: 6px; width: 100%; height: auto; aspect-ratio: 961 / 1240; }
.hero-meta { font-size: 0.9rem; color: var(--muted); margin-top: 1rem; }
@media (min-width: 900px) { .hero { padding-block: 4rem 4.5rem; } .hero-grid { grid-template-columns: 1.1fr 1fr; gap: 3rem; } }
@media (prefers-reduced-motion: reduce) { .hero-covers a { transition: none; } }

/* ---------- 卡点（首页）---------- */
.pain { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.25rem 1.1rem 1.5rem; position: relative; }
.pain::before { content: ""; position: absolute; left: 0; top: 1.25rem; bottom: 1.25rem; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent, var(--ochre)); }
.pain p { margin: 0; }
.pain .pain-q { text-wrap: pretty; font-family: var(--font-serif); font-size: 1.1rem; color: var(--teal-950); margin-bottom: 0.5rem; }
.pain .pain-book { font-size: 0.9rem; color: var(--muted); margin-top: 0.75rem; }
.pain .pain-book a { font-weight: 600; }

.acc-b1 { --accent: var(--b1); --accent-soft: var(--b1-soft); }
.acc-b2 { --accent: var(--b2); --accent-soft: var(--b2-soft); }
.acc-b3 { --accent: var(--b3); --accent-soft: var(--b3-soft); }
.acc-bundle { --accent: var(--teal-700); --accent-soft: var(--teal-50); }

/* ---------- 递进 ---------- */
.ladder { display: grid; gap: 1rem; }
.ladder-item { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.ladder-num { font-family: "Lora", var(--font-serif); font-size: 2.2rem; line-height: 1; color: var(--accent); min-width: 2.6rem; }
.ladder-item h3 { margin-bottom: 0.25rem; }
.ladder-item h3 a { color: inherit; text-decoration: none; }
.ladder-item h3 a:hover { color: var(--teal-700); text-decoration: underline; }
.ladder-en { font-family: "Lora", serif; color: var(--muted); font-size: 0.95rem; margin-bottom: 0.5rem; }
.ladder-item p { margin-bottom: 0.5rem; }
@media (min-width: 900px) { .ladder { grid-template-columns: repeat(3, 1fr); } .ladder-item { grid-template-columns: 1fr; } }

/* ---------- 书卡 ---------- */
.book-card { display: grid; grid-template-columns: 88px 1fr; grid-template-areas: "cover head" "body body"; gap: 0.9rem 1rem; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--radius); padding: 1.1rem; }
.book-card .cover-link { grid-area: cover; display: block; align-self: start; }
.book-card-head { grid-area: head; align-self: center; min-width: 0; }
.book-card-body { grid-area: body; }
.book-card-body .actions { margin-top: 0.6rem; }
.book-card img { display: block; width: 100%; height: auto; aspect-ratio: 961 / 1240; border-radius: 4px; box-shadow: var(--shadow); }
.book-card h3 { margin-bottom: 0.15rem; font-size: 1.25rem; }
.book-card h3 a { color: inherit; text-decoration: none; display: inline-block; padding-block: 0.5rem; }
.book-card h3 a:hover { text-decoration: underline; }
.book-card .vol { font-size: 0.85rem; font-weight: 600; color: var(--accent); }
.book-card .vol-en { display: block; font-weight: 400; font-family: "Lora", serif; color: var(--muted); font-size: 0.9rem; }
.book-card .line { color: var(--muted); font-size: 0.95rem; margin-bottom: 0.75rem; }
.book-card-body { display: flex; flex-direction: column; min-width: 0; }
.book-card-body .actions { margin-top: 0.75rem; }
@media (min-width: 900px) { .book-card { grid-template-columns: 1fr; grid-template-areas: "cover" "head" "body"; } .book-card .cover-link { max-width: 200px; } }

/* ---------- 价格与购买 ---------- */
.price { font-family: "Lora", var(--font-serif); font-size: 1.6rem; color: var(--teal-950); line-height: 1.2; }
.price-sm { font-size: 1.2rem; }
.price-note { display: inline-block; font-family: var(--font); font-size: 0.78rem; font-weight: 600; color: var(--warn-text); background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 999px; padding: 0.05rem 0.6rem; margin-left: 0.35rem; vertical-align: middle; line-height: 1.6; }
.price-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.25rem; margin-bottom: 0.75rem; }
.buy-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.buy-box h2 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.buy-box ul { font-size: 0.93rem; color: var(--muted); margin: 0.75rem 0 1rem; }
.buy-box form { margin: 0; }
.buy-box .fine { font-size: 0.85rem; color: var(--muted); margin: 0.75rem 0 0; }
.buy-box .btn + .btn { margin-top: 0.6rem; }
.consent { display: flex; gap: 0.55rem; font-weight: 400; align-items: flex-start; font-size: 0.86rem; line-height: 1.6; color: var(--muted); margin: 0 0 0.75rem; cursor: pointer; }
.consent input { flex: none; width: 1.15rem; height: 1.15rem; margin-top: 0.2rem; accent-color: var(--teal-700); }
.consent a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.unavailable { font-size: 0.92rem; color: var(--warn-text); background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; margin: 0; }

/* ---------- 详情页 ---------- */
.book-hero { display: grid; gap: 1.75rem; padding-block: 2rem 2.5rem; }
.book-hero .cover { max-width: 280px; width: 52%; margin-inline: auto; }
.book-hero .cover a { display: block; border-radius: 6px; box-shadow: var(--shadow-book); }
.book-hero .cover img { display: block; width: 100%; height: auto; aspect-ratio: 961 / 1240; border-radius: 6px; }
.book-hero .cover-hint { font-size: 0.82rem; color: var(--muted); text-align: center; margin-top: 0.5rem; }
.book-hero .vol { color: var(--accent); font-weight: 600; font-size: 0.9rem; margin-bottom: 0.25rem; }
.book-hero h1 { margin-bottom: 0.2em; }
.book-hero .en { font-family: "Lora", serif; color: var(--teal-700); font-size: 1.15rem; margin-bottom: 0.75rem; }
.book-hero .line { font-size: 1.1rem; }
@media (min-width: 720px) and (max-width: 999px) {
  .book-hero { grid-template-columns: 220px 1fr; }
  .book-hero .cover { width: 100%; }
  .book-hero .buy-box { grid-column: 1 / -1; }
}
@media (min-width: 1000px) {
  .book-hero { grid-template-columns: 260px 1fr 320px; align-items: start; gap: 2.5rem; padding-block: 3rem; }
  .book-hero .cover { width: 100%; margin: 0; }
  .book-hero .buy-box { position: sticky; top: calc(var(--header-h) + 16px); }
}

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: 0.75rem; margin: 1.25rem 0; padding: 0; list-style: none; }
.facts li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; margin: 0; }
.facts b { display: block; font-family: "Lora", var(--font-serif); font-size: 1.25rem; color: var(--teal-900); font-weight: 600; line-height: 1.3; }
.facts span { font-size: 0.85rem; color: var(--muted); }

.ticks { list-style: none; padding: 0; }
.ticks li { position: relative; padding-left: 1.6rem; }
.ticks li::before { content: ""; position: absolute; left: 0.15rem; top: 0.6em; width: 0.7rem; height: 0.38rem; border-left: 2px solid var(--accent, var(--teal-700)); border-bottom: 2px solid var(--accent, var(--teal-700)); transform: rotate(-45deg); }
.plain-list { list-style: none; padding: 0; }
.plain-list li { padding-left: 1rem; position: relative; }
.plain-list li::before { content: "·"; position: absolute; left: 0.2rem; color: var(--muted); }

.steps-row { display: grid; gap: 0.75rem; grid-template-columns: 1fr; counter-reset: s; padding: 0; list-style: none; }
.steps-row li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.9rem 1rem 0.9rem 3.1rem; position: relative; margin: 0; counter-increment: s; }
.steps-row li::before { content: counter(s); position: absolute; left: 1rem; top: 0.95rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; background: var(--teal-800); color: #fff; font-size: 0.85rem; font-weight: 600; line-height: 1; }
.steps-row h3 { font-size: 1rem; margin-bottom: 0.2rem; font-family: var(--font); color: var(--ink); }
.steps-row p { margin: 0; font-size: 0.92rem; color: var(--muted); }
@media (min-width: 720px) { .steps-row { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .steps-row { grid-template-columns: repeat(4, 1fr); } }

.toc { display: grid; gap: 0.6rem; }
.toc details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.toc summary { cursor: pointer; padding: 0.8rem 1rem; display: flex; gap: 0.75rem; align-items: baseline; list-style: none; min-height: 48px; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "+"; margin-left: auto; color: var(--muted); font-size: 1.2rem; line-height: 1; }
.toc details[open] summary::after { content: "−"; }
.toc .u-label { font-size: 0.85rem; color: var(--accent, var(--ochre-text)); font-weight: 600; white-space: nowrap; }
.toc .u-name { font-family: var(--font-serif); font-weight: 600; color: var(--teal-950); }
.toc ol { margin: 0; padding: 0 1rem 0.9rem 2.6rem; }
.toc .is-sample { font-size: 0.78rem; font-weight: 600; color: var(--teal-800); background: var(--teal-100); border-radius: 999px; padding: 0.05rem 0.5rem; margin-left: 0.35rem; white-space: nowrap; }
.toc-extra { margin-top: 0.75rem; font-size: 0.93rem; color: var(--muted); }

.phrases { display: grid; gap: 0.6rem; padding: 0; list-style: none; }
.phrases li { background: var(--surface); border-left: 3px solid var(--accent, var(--teal-700)); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 0.6rem 0.9rem; margin: 0; }
.phrases .en { display: block; font-family: "Instrument Sans", system-ui, sans-serif; font-size: 1.05rem; color: var(--teal-950); }
.phrases .zh { display: block; font-size: 0.9rem; color: var(--muted); }
@media (min-width: 720px) { .phrases { grid-template-columns: 1fr 1fr; } }

/* ---------- 样页图库 + 放大查看 ---------- */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem; padding: 0; list-style: none; margin: 0; }
.gallery li { margin: 0; }
.gallery figure { margin: 0; }
.gallery a { display: block; text-decoration: none; }
.gallery img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; border-radius: 4px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
.gallery a:hover img { border-color: var(--teal-700); }
.gallery figcaption { font-size: 0.82rem; margin-top: 0.4rem; line-height: 1.45; color: var(--muted); }
@media (min-width: 720px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .gallery { grid-template-columns: repeat(6, 1fr); } }

.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; margin: 0; }
.lightbox::backdrop { background: rgb(12 24 22 / 0.9); }
.lightbox-inner { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3.75rem 0.5rem 1rem; }
.lightbox-scroll { overflow: auto; max-width: 100%; max-height: calc(100vh - 6.5rem); -webkit-overflow-scrolling: touch; border-radius: 4px; }
.lightbox img { display: block; max-width: min(94vw, 880px); max-height: calc(100vh - 7rem); width: auto; height: auto; background: #fff; }
.lightbox.is-zoomed img { max-width: none; max-height: none; width: 1400px; }
.lightbox-caption { color: #f4efe3; font-size: 0.9rem; margin: 0.6rem 0 0; text-align: center; }
.lightbox-bar { position: absolute; top: 0.6rem; left: 0.6rem; right: 0.6rem; display: flex; gap: 0.5rem; justify-content: flex-end; }
.lightbox-bar button { min-width: 44px; min-height: 44px; border-radius: 999px; border: 1px solid rgb(255 255 255 / 0.4); background: rgb(0 0 0 / 0.4); color: #fff; font: inherit; font-size: 0.9rem; padding: 0 0.9rem; cursor: pointer; }
.lightbox-bar .lb-prev { margin-right: auto; }

/* ---------- 试读卡 ---------- */
.sample-card { display: grid; grid-template-columns: 92px 1fr; gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--radius); padding: 1.1rem; }
.sample-card img { display: block; width: 100%; height: auto; aspect-ratio: 961 / 1240; border-radius: 4px; box-shadow: var(--shadow); }
.sample-card h3 { font-size: 1.15rem; margin-bottom: 0.25rem; }
.sample-card p { font-size: 0.93rem; color: var(--muted); margin-bottom: 0.75rem; }

/* ---------- 套装 ---------- */
.bundle-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; max-width: 420px; }
.bundle-row a { display: block; border-radius: 4px; box-shadow: var(--shadow-book); }
.bundle-row img { display: block; width: 100%; height: auto; aspect-ratio: 961 / 1240; border-radius: 4px; }
.compare { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 0.95rem; }
.compare th, .compare td { text-align: left; vertical-align: top; padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); }
.compare tr:last-child td { border-bottom: 0; }
.compare th { background: var(--surface-2); font-weight: 600; color: var(--teal-950); }
.compare td:first-child { font-family: var(--font-serif); font-weight: 600; color: var(--teal-950); }
.compare td:first-child a { color: inherit; }
.compare .vol { display: block; font-family: var(--font); font-size: 0.8rem; color: var(--accent); }
@media (max-width: 719px) {
  .compare, .compare tbody, .compare tr, .compare td { display: block; }
  .compare thead { display: none; }
  .compare tr { border-bottom: 1px solid var(--line); padding: 0.75rem 1rem; }
  .compare tr:last-child { border-bottom: 0; }
  .compare td { border: 0; padding: 0.25rem 0; }
  .compare td[data-label]::before { content: attr(data-label); display: block; font-size: 0.8rem; color: var(--muted); font-weight: 600; font-family: var(--font); }
}

/* ---------- 信息块 ---------- */
.note { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; font-size: 0.95rem; }
.note h3 { font-size: 1rem; margin-bottom: 0.35rem; font-family: var(--font); color: var(--ink); }
.note p:last-child, .note ul:last-child { margin-bottom: 0; }
.note-warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-text); }
.note-draft { background: var(--warn-bg); border: 1px dashed var(--warn-line); color: var(--warn-text); border-radius: var(--radius-sm); padding: 0.75rem 1rem; margin-bottom: 1.5rem; font-size: 0.92rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0; font-size: 0.95rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }
.page-head { padding-block: 2.25rem 1rem; }
.page-head p { color: var(--muted); max-width: 40rem; }

.faq { display: grid; gap: 0.6rem; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.faq summary { cursor: pointer; padding: 0.9rem 1rem; font-weight: 600; list-style: none; display: flex; gap: 0.75rem; min-height: 48px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-left: auto; color: var(--muted); font-weight: 400; font-size: 1.2rem; }
.faq details[open] summary::after { content: "−"; }
.faq .answer { padding: 0 1rem 1rem; }
.faq .answer p:last-child, .faq .answer ul:last-child { margin-bottom: 0; }
.faq-group + .faq-group { margin-top: 2rem; }

/* ---------- 状态页（付款结果、下载页）---------- */
.state-wrap { padding-block: 2.5rem 3rem; }
.state-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); max-width: 40rem; margin-inline: auto; }
.state-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem; margin-bottom: 0.75rem; font-weight: 700; }
.state-ok .state-icon { background: var(--success-bg); color: var(--success-text); }
.state-wait .state-icon { background: var(--info-bg); color: var(--info-text); }
.state-bad .state-icon { background: var(--error-bg); color: var(--error-text); }
.state-card h1 { font-size: 1.6rem; }
.order-no { font-family: var(--font-mono); letter-spacing: 0.04em; overflow-wrap: anywhere; }

.lib-order { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; }
.lib-order h2 { font-size: 1.2rem; margin-bottom: 0.25rem; }
.lib-items { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 0.75rem; }
.lib-item { display: grid; grid-template-columns: 64px 1fr; gap: 0.9rem; align-items: start; border-top: 1px solid var(--line); padding-top: 0.9rem; margin: 0; }
.lib-item img { width: 64px; height: auto; aspect-ratio: 961 / 1240; border-radius: 3px; box-shadow: var(--shadow); }
.lib-item h3 { font-size: 1.05rem; margin-bottom: 0.15rem; }
.lib-item .meta { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.6rem; }
.lib-item .sha { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); overflow-wrap: anywhere; }

/* ---------- 表单 ---------- */
label { display: grid; gap: 0.35rem; font-weight: 600; font-size: 0.95rem; }
label.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--ink); width: 100%; min-height: 48px; padding: 0.6rem 0.8rem; background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
input[type="checkbox"], input[type="radio"] { width: 1.15rem; min-height: 0; height: 1.15rem; accent-color: var(--primary); }
textarea { resize: vertical; line-height: var(--leading); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal-700); box-shadow: var(--ring); }
.hint { font-weight: 400; color: var(--muted); font-size: 0.88rem; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.form-card h1 { font-size: 1.5rem; }
.form-links { margin: 1rem 0 0; text-align: center; font-size: 0.95rem; }
.row-form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.row-form input { flex: 1 1 10rem; }
.code-input { font-family: var(--font-mono); letter-spacing: 0.15em; max-width: 14rem; }
.divider { display: flex; align-items: center; gap: 0.75rem; color: var(--muted); margin: 1rem 0; font-size: 0.9rem; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.auth-wrap { padding-block: 2.5rem 3rem; }

/* ---------- 提示、徽章、表格（脚手架组件，换成本站颜色）---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.alert { display: flex; align-items: flex-start; gap: 0.75rem; justify-content: space-between; padding: 0.75rem 1rem; margin-bottom: 1rem; border-radius: var(--radius-sm); border: 1px solid; }
.alert-success { background: var(--success-bg); color: var(--success-text); border-color: var(--success-line); }
.alert-error { background: var(--error-bg); color: var(--error-text); border-color: var(--error-line); }
.alert-info { background: var(--info-bg); color: var(--info-text); border-color: var(--info-line); }
.alert-close { background: none; border: 0; font-size: 1.25rem; line-height: 1; color: inherit; cursor: pointer; padding: 0 0.25rem; min-width: 44px; min-height: 44px; }
.flash-wrap:not(:empty) { padding-top: 1rem; }
.badge { display: inline-block; white-space: nowrap; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.badge-success { background: var(--success-bg); color: var(--success-text); border-color: var(--success-line); }
.badge-danger { background: var(--error-bg); color: var(--error-text); border-color: var(--error-line); }
.badge-warn { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-line); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { text-align: left; padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.pagination { display: flex; gap: 1rem; align-items: center; justify-content: center; margin: 1.5rem 0; }
.error-page { padding-block: 3rem; }
.error-code { font-size: 3.5rem; font-weight: 800; color: var(--line-strong); margin: 0; }
.debug { text-align: left; font-size: 0.8rem; max-height: 50vh; overflow: auto; }

.steps { display: grid; gap: 1.25rem; padding-left: 1.25rem; margin: 0; }
.qr { background: #fff; display: inline-block; padding: 0.5rem; border-radius: var(--radius-sm); margin: 0.75rem 0; }
.qr svg { display: block; width: 200px; height: 200px; }
.secret { font-size: 1.05rem; letter-spacing: 0.08em; word-break: break-all; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; padding: 0; list-style: none; }
.codes code { display: block; padding: 0.4rem 0.6rem; background: var(--surface-2); border-radius: var(--radius-sm); text-align: center; font-size: 1rem; }

/* ---------- 页脚 ---------- */
.site-footer { background: var(--teal-950); color: #d8e4df; padding-block: 2.5rem 2rem; font-size: 0.92rem; margin-top: 2rem; }
.site-footer a { color: #f3eedf; }
.footer-grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr 1fr; }
.footer-grid h2 { font-family: var(--font); font-size: 0.85rem; color: #b5c9c2; margin-bottom: 0.6rem; font-weight: 600; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin: 0; }
.footer-grid li a { display: inline-flex; min-height: 44px; align-items: center; text-decoration: none; }
.footer-grid li a:hover { text-decoration: underline; }
.footer-brand { grid-column: 1 / -1; }
.footer-brand .brand-name { color: #fff; font-size: 1.15rem; display: block; margin-bottom: 0.4rem; }
.footer-brand p { margin: 0 0 0.4rem; color: #c3d4ce; }
.footer-meta { border-top: 1px solid rgb(255 255 255 / 0.14); margin-top: 2rem; padding-top: 1rem; color: #b5c9c2; font-size: 0.85rem; }
.footer-meta p { margin: 0 0 0.35rem; }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } .footer-brand { grid-column: auto; } }

/* ---------- 手机底部导航栏（脚手架规范：窄屏显示，≥1000px 隐藏）---------- */
:root { --tab-bar-h: 60px; }
body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
body.has-tab-bar { padding-bottom: calc(var(--tab-bar-h) + env(safe-area-inset-bottom)); }
.tab-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; min-height: calc(var(--tab-bar-h) + env(safe-area-inset-bottom)); padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); background: var(--surface); border-top: 1px solid var(--line); }
.tab-bar a { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--tab-bar-h); padding: 4px 2px; color: var(--muted); text-decoration: none; font-size: 0.75rem; line-height: 1.3; }
.tab-bar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-bar svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab-bar a[aria-current="page"] { color: var(--teal-800); font-weight: 600; }
.tab-bar a[aria-current="page"] svg { stroke-width: 2.2; }
@media (min-width: 1000px) { .tab-bar { display: none; } body.has-tab-bar { padding-bottom: 0; } }

@media print {
  .site-header, .tab-bar, .site-footer, .mode-bar, .btn { display: none !important; }
  body { background: #fff; }
}

/* 间距小工具 */
.mt { margin-top: 1.5rem; }
.mt-sm { margin-top: 0.75rem; }
.bundle-teaser { margin-top: 1.25rem; display: grid; gap: 0.5rem; }
.bundle-teaser h3 { margin: 0; }
.bundle-teaser p { margin: 0; }
.state-wrap > .prose { margin-inline: auto; }

/* 后台小修：表头和短词不要一字一行 */
.page-admin .table th { white-space: nowrap; }
.page-admin a.stat { color: inherit; text-decoration: none; }
.page-admin a.stat:hover { border-color: var(--teal-700); }
.page-admin .table td:nth-child(2) { min-width: 6em; }
.page-admin .stack > .btn { justify-self: start; }
.page-admin code { white-space: nowrap; }
.page-admin .table td { overflow-wrap: normal; }
.page-admin .table td.mono, .page-admin .table .mono { overflow-wrap: anywhere; }
p, li, dd, figcaption { text-wrap: pretty; }
@media (min-width: 1000px) { .book-hero .facts { grid-template-columns: repeat(4, 1fr); } }
/* 文字链接也要够大的点击区（设计审查 2026-10-04：手机上 18–24px 高） */
.ladder-item h3 a, .pain-book a, .plain-list a, .compare td a, .sample-card p a, .note > a, .toc-extra a { display: inline-block; padding-block: 0.65rem; }
.book-card h3 a { padding-block: 0.6rem; }
.note h2 { font-size: 1rem; margin-bottom: 0.35rem; font-family: var(--font); color: var(--ink); }
.page-admin .stack > .btn, .page-admin .stack > button { align-self: start; min-height: 44px; height: auto; }

/* ── 2026-10-04 线上视觉审查后的修正 ─────────────────────────────── */
/* 吸顶页头不透明：半透明时滚动内容透出来像叠影 */
.site-header { background: var(--paper); }
/* 中文书名大标题：书名号「《」自带左半格空白，整行看起来右移 */
.cn-book-title { text-indent: -0.5em; }
/* 试读页卡片：书名不再按全站 h2 的大字号挤在窄栏里折行 */
.sample-card .vol-tag { font-size: 0.85rem; font-weight: 600; color: var(--accent); margin: 0 0 0.1rem; }
.sample-card .sample-title { font-size: 1.15rem; margin: 0 0 0.35rem; word-break: keep-all; }
@media (max-width: 479px) {
  .sample-card { grid-template-columns: 72px 1fr; }
  .sample-card > div { display: contents; }
  .sample-card > img { grid-row: span 2; }
  .sample-card { grid-template-rows: auto 1fr; align-items: start; }
  .sample-card .vol-tag, .sample-card .sample-title { grid-column: 2; }
  .sample-card .vol-tag { margin-top: 0.25rem; }
  .sample-card > div > :not(.vol-tag):not(.sample-title) { grid-column: 1 / -1; }
}
/* 页脚书名：书名号连同书名整体换行（见 nowrap_title()） */
.nowrap { white-space: nowrap; }
/* 联系页等卡片：第一个元素不要继承正文 h2 的上外边距 */
.note > :first-child { margin-top: 0; }
/* 标题段和第一节之间的空白减半 */
.page-head + .section { padding-top: 0.75rem; }
/* 书页数据格 768 宽时 4 格一行，不要 3+1 */
@media (min-width: 600px) { .book-hero .facts { grid-template-columns: repeat(4, 1fr); } }
/* 首页书卡大屏：封面居中，不在右边空出一大块 */
@media (min-width: 900px) { .book-card .cover-link { margin-inline: auto; } }
/* 手机：「三册怎样递进」数字放到上面，正文不被挤成每行十几个字 */
@media (max-width: 899px) { .ladder-item { grid-template-columns: 1fr; gap: 0.25rem; } }
/* 卡片彩色顶边：原来的粗上边框跟着圆角弯成月牙形；改成两端留出圆角的直线色条 */
.book-card, .sample-card { position: relative; border-top-width: 1px; border-top-color: var(--line); }
.book-card::before, .sample-card::before { content: ""; position: absolute; top: -1px; left: 14px; right: 14px; height: 4px; background: var(--accent); border-radius: 0 0 3px 3px; }
/* 列表项目符号太淡 */
.plain-list li::before { content: "•"; color: var(--teal-700); }
/* 购买框：同意项整行可点到 44px，购买按钮和税费说明拉开 */
.consent { padding-block: 0.55rem; margin: 0; min-height: 44px; }
.buy-box form .btn-block { margin-top: 0.75rem; }
.buy-box form + .fine, .buy-box .fine { margin-top: 0.75rem; }
.buy-box p.fine a { display: inline-block; padding-block: 0.65rem; }
/* 重点句英文两行不要继承正文 1.75 的行高 */
.phrases [lang="en"], .phrases .en { line-height: 1.4; }
/* 中文界面以外的书名下面显示中文原名 */
.title-zh { color: var(--muted); font-size: 1rem; margin: -0.2rem 0 0.4rem; }
/* 页头语言切换 */
.lang-link { font-size: 0.92rem; }
/* 最后一节和深色页脚之间不再夹一条米色带 */
.site-footer { margin-top: 0; }

/* 灯箱打开时背景不跟着滚 */
html.lb-open { overflow: hidden; }
