/* ==========================================================================
   墨子教育 · GEO 白皮书 电子书阅读器样式
   设计取向：纸感排版 + 双侧栏阅读 + 三套主题（纸白/米黄/夜读）
   ========================================================================== */

:root {
  --paper: #ffffff;
  --paper-2: #f7f5f0;
  --ink: #1b1a17;
  --ink-2: #3a3833;
  --muted: #726c60;
  --line: #e6e1d6;
  --line-2: #efeae0;
  --accent: #0f766e;
  --accent-soft: #e6f4f1;
  --gold: #a8803f;
  --gold-soft: #f6efe2;
  --card: #ffffff;
  --code-bg: #f3f1ec;
  --shadow: 0 10px 30px rgba(27, 26, 23, .07);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --read: 1;
  --sidebar-w: 306px;
}

html[data-theme="sepia"] {
  --paper: #f7f2e7;
  --paper-2: #f1ebdd;
  --ink: #2a251c;
  --ink-2: #453e32;
  --muted: #7a7264;
  --line: #e0d6c2;
  --line-2: #ece3d1;
  --accent: #0d6b62;
  --accent-soft: #e3efe9;
  --gold: #9c7737;
  --gold-soft: #efe4cd;
  --card: #fbf7ee;
  --code-bg: #efe8d8;
  --shadow: 0 10px 30px rgba(80, 66, 40, .08);
}

html[data-theme="dark"] {
  --paper: #14161a;
  --paper-2: #191c21;
  --ink: #e7e3db;
  --ink-2: #cfcabf;
  --muted: #9b958a;
  --line: #2a2e35;
  --line-2: #23272d;
  --accent: #58c9bc;
  --accent-soft: rgba(88, 201, 188, .12);
  --gold: #d3ab68;
  --gold-soft: rgba(211, 171, 104, .12);
  --card: #1a1d22;
  --code-bg: #20242a;
  --shadow: 0 10px 30px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.75;
  transition: background .25s ease, color .25s ease;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { max-width: 100%; }

/* ---------- 顶部工具条 ---------- */
.book-bar {
  position: fixed; inset: 0 0 auto 0; height: 56px; z-index: 60;
  display: flex; align-items: center; gap: 12px;
  padding: 0 18px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.book-bar .bb-brand { display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; }
.book-bar .bb-brand > span:last-child { min-width: 0; overflow: hidden; }
.book-bar .bb-mark {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  color: #fff; font-size: 13px; font-weight: 700;
  display: grid; place-items: center; letter-spacing: .5px;
}
.book-bar .bb-title {
  display: block;
  font-family: var(--serif); font-size: 15px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.book-bar .bb-sub { color: var(--muted); font-size: 12px; white-space: nowrap; }
.book-bar .bb-spacer { flex: 1; }
.book-bar .bb-link { color: var(--muted); font-size: 13px; white-space: nowrap; }
.book-bar .bb-link:hover { color: var(--accent); text-decoration: none; }

.bb-btn {
  appearance: none; border: 1px solid var(--line); background: var(--card);
  color: var(--ink-2); font-size: 13px; line-height: 1;
  padding: 7px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap;
}
.bb-btn:hover { border-color: var(--accent); color: var(--accent); }
.bb-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.bb-group { display: flex; align-items: center; gap: 6px; }
.bb-menu { display: none; }

/* ---------- 阅读进度 ---------- */
.progress {
  position: fixed; top: 56px; left: 0; height: 2px; width: 100%;
  background: transparent; z-index: 61; pointer-events: none;
}
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--gold)); }

/* ---------- 左栏目录 ---------- */
.sidebar {
  position: fixed; top: 56px; left: 0; bottom: 0; width: var(--sidebar-w);
  padding: 20px 8px 40px 20px; overflow-y: auto;
  border-right: 1px solid var(--line); background: var(--paper-2);
  overscroll-behavior: contain;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }

.sb-book { padding: 0 12px 14px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.sb-book a { color: var(--ink); }
.sb-book .sb-kicker { font-size: 11px; letter-spacing: .18em; color: var(--gold); text-transform: uppercase; }
.sb-book .sb-name { font-family: var(--serif); font-size: 17px; font-weight: 700; line-height: 1.45; margin-top: 4px; }
.sb-book .sb-author { font-size: 12px; color: var(--muted); margin-top: 4px; }

.sb-part { margin: 2px 0 6px; }
.sb-part > summary {
  list-style: none; cursor: pointer; padding: 7px 10px; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  display: flex; align-items: center; gap: 6px;
}
.sb-part > summary::-webkit-details-marker { display: none; }
.sb-part > summary:hover { background: var(--accent-soft); color: var(--accent); }
.sb-part > summary .sb-no { color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .04em; flex: none; }
.sb-part[open] > summary { color: var(--accent); }
.sb-part ol { list-style: none; margin: 2px 0 8px; padding: 0 0 0 8px; }
.sb-part ol a {
  display: flex; gap: 8px; padding: 5px 10px; border-radius: 7px;
  color: var(--muted); font-size: 12.5px; line-height: 1.55;
}
.sb-part ol a:hover { background: var(--card); color: var(--ink); text-decoration: none; }
.sb-part ol a .n { color: var(--gold); font-variant-numeric: tabular-nums; flex: none; opacity: .85; }
.sb-part ol a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sb-part ol a.on .n { color: var(--accent); }
.sb-foot { padding: 16px 12px 0; border-top: 1px solid var(--line); margin-top: 8px; font-size: 12px; color: var(--muted); line-height: 1.8; }

/* ---------- 主内容 ---------- */
.book-main { margin-left: var(--sidebar-w); padding: 56px 0 0; }
.book-page { max-width: 780px; margin: 0 auto; padding: 40px 30px 90px; }

.part-head { padding: 26px 0 30px; border-bottom: 2px solid var(--line); margin-bottom: 34px; }
.part-head .ph-no { font-size: 12px; letter-spacing: .24em; color: var(--gold); font-weight: 700; }
.part-head h1 {
  font-family: var(--serif); font-size: calc(30px * var(--read)); line-height: 1.4;
  margin: 10px 0 14px; letter-spacing: .01em;
}
.part-head p { color: var(--muted); font-size: 15px; margin: 0; line-height: 1.9; }

.chapter { margin: 0 0 60px; }
.chapter + .chapter { padding-top: 8px; }

.ch-no {
  display: inline-block; font-family: var(--mono); font-size: 11.5px; letter-spacing: .16em;
  color: var(--accent); background: var(--accent-soft);
  padding: 3px 9px; border-radius: 999px; margin-bottom: 14px;
}
.chapter h2 {
  font-family: var(--serif); font-size: calc(25px * var(--read)); line-height: 1.45;
  margin: 0 0 20px; letter-spacing: .01em;
}
.chapter h2 .h2-num { color: var(--gold); font-weight: 400; margin-right: 8px; font-size: .78em; }

.chapter h3 {
  font-family: var(--serif); font-size: calc(18.5px * var(--read)); line-height: 1.6;
  margin: 34px 0 12px; padding-left: 12px; border-left: 3px solid var(--gold);
}
.chapter h4 { font-size: calc(16px * var(--read)); margin: 24px 0 8px; color: var(--ink-2); }

.chapter p {
  font-family: var(--serif); font-size: calc(16.5px * var(--read)); line-height: 1.98;
  color: var(--ink-2); margin: 0 0 18px; text-align: justify; letter-spacing: .015em;
}
.chapter p.lead {
  font-size: calc(17.5px * var(--read)); color: var(--ink);
  border-left: 3px solid var(--accent); padding-left: 16px; background: linear-gradient(90deg, var(--accent-soft), transparent 70%);
  padding-top: 8px; padding-bottom: 8px; border-radius: 0 8px 8px 0;
}
.chapter p.lead::first-letter { font-size: 1.6em; font-weight: 700; color: var(--accent); }

.chapter strong { color: var(--ink); font-weight: 700; }
.chapter em { font-style: normal; background: linear-gradient(transparent 62%, var(--gold-soft) 62%); }

.chapter ul, .chapter ol {
  font-family: var(--serif); font-size: calc(16px * var(--read)); line-height: 1.95;
  color: var(--ink-2); margin: 0 0 20px; padding-left: 1.4em;
}
.chapter li { margin-bottom: 8px; }
.chapter li::marker { color: var(--gold); }

.chapter blockquote {
  margin: 24px 0; padding: 18px 22px; border-radius: 10px;
  background: var(--gold-soft); border: 1px solid var(--line);
  font-family: var(--serif); font-size: calc(15.5px * var(--read)); line-height: 1.9; color: var(--ink-2);
}
.chapter blockquote p { margin: 0 0 10px; font-size: inherit; }
.chapter blockquote p:last-child { margin-bottom: 0; }
.chapter blockquote cite { display: block; margin-top: 8px; font-size: 12.5px; color: var(--muted); font-style: normal; }

.callout {
  margin: 26px 0; padding: 16px 18px 16px 20px; border-radius: 10px;
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  font-size: 14.5px; line-height: 1.85; color: var(--ink-2);
}
.callout .co-t { display: block; font-weight: 700; color: var(--accent); font-size: 13px; letter-spacing: .04em; margin-bottom: 6px; }
.callout p { font-family: var(--sans); font-size: inherit; margin: 0; line-height: 1.85; }
.callout.warn { background: var(--gold-soft); border-left-color: var(--gold); }
.callout.warn .co-t { color: var(--gold); }

.table-wrap { margin: 26px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.chapter table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.7; }
.chapter th, .chapter td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-2); }
.chapter th { background: var(--paper-2); color: var(--ink); font-weight: 600; font-size: 13px; white-space: nowrap; }
.chapter tr:last-child td { border-bottom: none; }
.chapter td { color: var(--ink-2); }

.figure { margin: 28px 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.figure svg { display: block; width: 100%; height: auto; }
.figure figcaption { margin-top: 10px; font-size: 12.5px; color: var(--muted); text-align: center; }

.qa { margin: 18px 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.qa .q { font-weight: 700; color: var(--ink); font-size: 15px; margin-bottom: 6px; }
.qa .a { font-family: var(--serif); font-size: 15px; line-height: 1.9; color: var(--ink-2); }
.qa .q::before { content: "Q"; color: var(--accent); font-family: var(--mono); margin-right: 8px; }
.qa .a::before { content: "A"; color: var(--gold); font-family: var(--mono); margin-right: 8px; }

.ch-end { display: flex; align-items: center; gap: 10px; margin: 30px 0 0; color: var(--muted); font-size: 12px; }
.ch-end::before, .ch-end::after { content: ""; height: 1px; background: var(--line); flex: 1; }

/* ---------- 翻页 ---------- */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.pager a {
  display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink); transition: border-color .2s, transform .2s;
}
.pager a:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.pager .pg-k { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; letter-spacing: .06em; }
.pager .pg-t { font-family: var(--serif); font-size: 14.5px; font-weight: 600; line-height: 1.5; }
.pager a.next { text-align: right; }
.pager a.disabled { opacity: .4; pointer-events: none; }
.pager .back-toc { text-align: center; }

.book-foot { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; line-height: 1.9; }
.book-foot a { color: var(--muted); }

/* ---------- 封面 / 目录页 ---------- */
.cover {
  position: relative; overflow: hidden; color: #f3efe6;
  background:
    radial-gradient(900px 420px at 82% -10%, rgba(168, 128, 63, .5), transparent 62%),
    radial-gradient(700px 500px at 6% 8%, rgba(15, 118, 110, .55), transparent 60%),
    linear-gradient(160deg, #101a24 0%, #131f2b 52%, #0d151d 100%);
  padding: 74px 0 64px;
}
.cover::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 46px 46px; mask-image: linear-gradient(180deg, rgba(0,0,0,.55), transparent 78%);
  pointer-events: none;
}
.cover .cv-inner { position: relative; z-index: 1; max-width: 980px; margin: 0 auto; padding: 0 30px; }
.cover .cv-brand { display: flex; align-items: center; gap: 10px; font-size: 13px; letter-spacing: .18em; color: #cfc6b4; }
.cover .cv-brand .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(168,128,63,.22); }
.cover h1 {
  font-family: var(--serif); font-size: clamp(34px, 5.4vw, 58px); line-height: 1.22;
  margin: 22px 0 10px; letter-spacing: .01em; color: #fff;
}
.cover .cv-sub { font-family: var(--serif); font-size: clamp(15px, 2vw, 20px); color: #d8d0c0; max-width: 720px; line-height: 1.8; }
.cover .cv-meta { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 30px; font-size: 13px; color: #b9b1a2; }
.cover .cv-meta b { color: #efe8da; font-weight: 600; }
.cover .cv-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.cv-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px; font-size: 14.5px; font-weight: 600;
  background: linear-gradient(135deg, #d9b478, #b0842f); color: #20180c;
  border: 1px solid rgba(255,255,255,.16);
}
.cv-btn:hover { text-decoration: none; filter: brightness(1.06); }
.cv-btn.ghost { background: rgba(255,255,255,.06); color: #efe8da; border-color: rgba(255,255,255,.28); }
.cv-note { margin-top: 26px; font-size: 12.5px; color: #9c9484; max-width: 760px; line-height: 1.8; }

.front { max-width: 950px; margin: 0 auto; padding: 46px 30px 90px; }
.front h2 { font-family: var(--serif); font-size: 24px; margin: 0 0 16px; }
.front h2 .fx { color: var(--gold); font-size: 13px; letter-spacing: .2em; display: block; margin-bottom: 6px; font-weight: 400; }
.front p, .front li { font-family: var(--serif); font-size: 16px; line-height: 1.95; color: var(--ink-2); }
.front p { margin: 0 0 16px; text-align: justify; }

.abstract { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 26px 0 40px; }
.ab-card { border: 1px solid var(--line); border-radius: 12px; padding: 18px; background: var(--card); }
.ab-card .ab-n { font-family: var(--mono); font-size: 12px; color: var(--gold); letter-spacing: .1em; }
.ab-card h3 { font-family: var(--serif); font-size: 16px; margin: 6px 0 8px; }
.ab-card p { font-size: 13.5px; font-family: var(--sans); line-height: 1.8; color: var(--muted); margin: 0; }

.toc-block { margin-top: 10px; }
.toc-part { border-top: 1px solid var(--line); padding: 22px 0 8px; display: grid; grid-template-columns: 210px 1fr; gap: 24px; }
.toc-part:last-child { border-bottom: 1px solid var(--line); }
.toc-part .tp-l { position: sticky; top: 70px; align-self: start; }
.toc-part .tp-no { font-size: 11.5px; letter-spacing: .2em; color: var(--gold); font-weight: 700; }
.toc-part .tp-t { font-family: var(--serif); font-size: 17px; font-weight: 700; line-height: 1.5; margin-top: 4px; }
.toc-part .tp-t a { color: var(--ink); }
.toc-part ol { list-style: none; margin: 0; padding: 0; counter-reset: ch; }
.toc-part ol li { border-bottom: 1px dashed var(--line-2); }
.toc-part ol li:last-child { border-bottom: none; }
.toc-part ol a { display: flex; gap: 14px; padding: 8px 0; color: var(--ink-2); font-family: var(--serif); font-size: 15px; line-height: 1.7; }
.toc-part ol a:hover { color: var(--accent); text-decoration: none; }
.toc-part ol a .tn { color: var(--gold); font-variant-numeric: tabular-nums; flex: none; width: 58px; font-family: var(--sans); font-size: 12.5px; padding-top: 3px; }

.front-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin: 30px 0; }
.front-card { border: 1px solid var(--line); border-radius: 12px; padding: 22px; background: var(--card); }
.front-card h3 { font-family: var(--serif); font-size: 16.5px; margin: 0 0 10px; }
.front-card p, .front-card li { font-size: 14px; font-family: var(--sans); line-height: 1.85; color: var(--muted); }
.front-card ol, .front-card ul { margin: 0; padding-left: 1.2em; }

.cite-box { border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2); padding: 20px 22px; font-size: 13.5px; line-height: 1.9; color: var(--ink-2); }
.cite-box code { font-family: var(--mono); font-size: 12.5px; background: var(--code-bg); padding: 2px 6px; border-radius: 5px; }

.to-top {
  position: fixed; right: 22px; bottom: 26px; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); z-index: 50;
  opacity: 0; visibility: hidden; transition: opacity .2s;
}
.to-top.show { opacity: 1; visibility: visible; }

/* ---------- 翻页阅读：一屏一页 ---------- */
body.wp-paged { overflow: hidden; }
body.wp-paged .book-page,
body.wp-paged .to-top { display: none; }

.wr {
  position: fixed; top: 56px; left: var(--sidebar-w); right: 0; bottom: 0; z-index: 30;
  display: none; flex-direction: column; background: var(--paper);
}
body.wp-paged .wr { display: flex; }

.wr-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }

.wr-page {
  position: absolute; inset: 0; padding: 26px 34px 12px;
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch;
}
.wr-page::-webkit-scrollbar { width: 0; height: 0; }
.wr-col { max-width: 780px; margin: 0 auto; }
.wr-page .chapter { margin: 0; padding-top: 0; }
/* 篇头单独占一页，比连续滚动时更紧凑，低矮视口也不会溢出去 */
.wr-page .part-head { padding: 10px 0 22px; margin-bottom: 26px; }
/* 超页表格按行拆成多块，块与块之间共用一道边框 */
.wr-page .wr-tpart { margin: 0; border-radius: 0; }
.wr-page .wr-tpart + .wr-tpart { margin-top: -1px; }
.wr-page .wr-tpart:first-child { border-radius: 10px 10px 0 0; }
.wr-page .wr-tpart:last-child { border-radius: 0 0 10px 10px; }
/* 超页列表按条目拆开后拼回一整列，不重复留白 */
.wr-page .wr-lpart { margin: 0; }

.wr-page.fwd { animation: wrIn .24s ease-out both; }
.wr-page.bwd { animation: wrBack .24s ease-out both; }
@keyframes wrIn { from { opacity: .35; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes wrBack { from { opacity: .35; transform: translateX(-26px); } to { opacity: 1; transform: none; } }

.wr-zone { position: absolute; top: 0; bottom: 34px; width: 24%; z-index: 2; cursor: pointer; }
.wr-zone.l { left: 0; }
.wr-zone.r { right: 0; }
.wr-zone::after {
  content: ""; position: absolute; top: 50%; width: 7px; height: 7px;
  border-top: 2px solid var(--muted); border-right: 2px solid var(--muted);
  opacity: 0; transition: opacity .18s;
}
.wr-zone.l::after { left: 12px; transform: translateY(-50%) rotate(-135deg); }
.wr-zone.r::after { right: 12px; transform: translateY(-50%) rotate(45deg); }
.wr-zone:hover::after { opacity: .5; }

.wr-foot {
  flex: none; height: 34px; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 0 16px; border-top: 1px solid var(--line-2);
  font-size: 12px; color: var(--muted); background: var(--paper);
}
.wr-ch { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wr-tools { display: flex; align-items: center; flex: none; }
.wr-btn {
  appearance: none; border: 0; background: transparent; color: var(--muted);
  font-size: 17px; line-height: 1; padding: 4px 9px; cursor: pointer; border-radius: 6px;
}
.wr-btn:hover { color: var(--accent); background: var(--accent-soft); }
.wr-n { min-width: 62px; text-align: center; font-variant-numeric: tabular-nums; }

.wr-toggle {
  position: fixed; left: calc(var(--sidebar-w) + 16px); bottom: 50px; z-index: 58;
  appearance: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  font-size: 12.5px; line-height: 1; box-shadow: var(--shadow); cursor: pointer;
}
.wr-toggle:hover { border-color: var(--accent); color: var(--accent); }

.wr-hint { margin-top: 30px; font-size: 12.5px; color: var(--muted); letter-spacing: .04em; }

.chapter.wr-meas {
  position: absolute; left: -99999px; top: 0;
  visibility: hidden; pointer-events: none;
  margin: 0; padding: 0; display: flow-root;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  :root { --sidebar-w: 268px; }
  .book-page { padding: 32px 24px 80px; }
}

@media (max-width: 860px) {
  .book-bar .bb-sub, .book-bar .bb-link { display: none; }
  .bb-menu { display: inline-flex; }
  .sidebar {
    transform: translateX(-102%); transition: transform .25s ease;
    width: 300px; z-index: 70; box-shadow: 24px 0 40px rgba(0,0,0,.16);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open::after {
    content: ""; position: fixed; inset: 56px 0 0 0; background: rgba(0,0,0,.32); z-index: 65;
  }
  .book-main { margin-left: 0; }
  .book-page { padding: 24px 18px 80px; }
  .chapter p { font-size: calc(16px * var(--read)); }
  .abstract, .front-grid { grid-template-columns: 1fr; }
  .toc-part { grid-template-columns: 1fr; gap: 8px; }
  .toc-part .tp-l { position: static; }
  .pager { grid-template-columns: 1fr; }
  .cover { padding: 56px 0 46px; }
  .wr { left: 0; }
  .wr-page { padding: 18px 20px 10px; }
  /* 手机上的工具条原本挤到只剩「GE」，收紧按钮给书名让出位置 */
  .book-bar { gap: 8px; padding: 0 10px; }
  .bb-btn { padding: 6px 7px; font-size: 12px; flex: none; }
  .book-bar .bb-title { font-size: 13px; }
  .book-bar .bb-mark { width: 22px; height: 22px; font-size: 12px; }
  .wr-zone { width: 28%; }
  .wr-toggle { left: 12px; bottom: 46px; }
}

@media print {
  .book-bar, .sidebar, .pager, .to-top, .progress, .wr, .wr-toggle { display: none !important; }
  body.wp-paged { overflow: visible; }
  body.wp-paged .book-page { display: block !important; }
  .book-main { margin: 0; padding: 0; }
  .book-page { max-width: none; padding: 0; }
  body { background: #fff; color: #000; }
  .chapter { break-inside: auto; page-break-after: always; }
  .chapter h2 { break-after: avoid; }
}
