/* ============================================================
   书阁 — reading-first design system
   Paper-inspired palette, generous typography, calm interactions.
   ============================================================ */

:root {
  /* paper */
  --bg: #f7f4ef;
  --bg-elev: #fffdfa;
  --bg-sunken: #efe9e0;
  --ink: #2c2621;
  --ink-soft: #5c534a;
  --ink-faint: #8b8073;
  --line: #e2d9cc;
  --line-strong: #d3c7b6;

  /* accent — warm ink blue */
  --accent: #3d5a80;
  --accent-hover: #2f4767;
  --accent-soft: #e8eef6;
  --gold: #b98a4b;

  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(60, 45, 30, .06), 0 2px 8px rgba(60, 45, 30, .04);
  --shadow-md: 0 4px 12px rgba(60, 45, 30, .08), 0 12px 32px rgba(60, 45, 30, .06);
  --shadow-lg: 0 12px 40px rgba(60, 45, 30, .16);

  --maxw: 1120px;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-read: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", Georgia, serif;
}

/* --- reader themes (applied to <html data-theme>) --- */
html[data-theme="paper"] {
  --bg: #f7f4ef; --bg-elev: #fffdfa; --bg-sunken: #efe9e0;
  --ink: #2c2621; --ink-soft: #5c534a; --ink-faint: #8b8073;
  --line: #e2d9cc; --line-strong: #d3c7b6;
  --accent: #3d5a80; --accent-hover: #2f4767; --accent-soft: #e8eef6;
}
html[data-theme="sepia"] {
  --bg: #f2e7d3; --bg-elev: #f8f0e0; --bg-sunken: #e9dcc3;
  --ink: #4a3b2a; --ink-soft: #6b5a45; --ink-faint: #92805f;
  --line: #ddcdb0; --line-strong: #c9b795;
  --accent: #8a5e2c; --accent-hover: #6f4a20; --accent-soft: #ead9c0;
}
html[data-theme="dark"] {
  --bg: #16181c; --bg-elev: #1e2126; --bg-sunken: #101216;
  --ink: #d7d3cb; --ink-soft: #a49e94; --ink-faint: #6f6a62;
  --line: #2c3038; --line-strong: #3a3f49;
  --accent: #7ea2cc; --accent-hover: #9ab8dc; --accent-soft: #232a35;
}
html[data-theme="green"] {
  --bg: #e8f0e4; --bg-elev: #eff6ec; --bg-sunken: #dce8d7;
  --ink: #26332a; --ink-soft: #455347; --ink-faint: #6d7d6f;
  --line: #cfdcc9; --line-strong: #b9cbaf;
  --accent: #3f6b4a; --accent-hover: #305539; --accent-soft: #d9e8d4;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

::selection { background: var(--accent-soft); }

/* ============ top bar ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  /* NOTE: color-mix() interacted badly with our theme variables (computed
     background drifted), so use an explicit solid/semi-transparent layer. */
  background: var(--bg);
  background: rgba(247, 244, 239, .86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
html[data-theme="sepia"] .topbar { background: rgba(242, 231, 211, .86); }
html[data-theme="dark"] .topbar { background: rgba(22, 24, 28, .86); }
html[data-theme="green"] .topbar { background: rgba(232, 240, 228, .86); }
.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 9px; flex: none; }
.brand-mark {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--accent), var(--accent-hover));
  color: #fff;
  border-radius: 9px;
  font-family: var(--font-read);
  font-size: 17px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.brand-text {
  font-family: var(--font-read);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .08em;
}

.searchbar {
  flex: 1;
  max-width: 460px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color .2s, box-shadow .2s;
}
.searchbar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.searchbar input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 9px 4px 9px 18px;
  font-size: 15px;
  color: var(--ink);
}
.searchbar input::placeholder { color: var(--ink-faint); }
.searchbar input::-webkit-search-cancel-button { display: none; }
.searchbar button {
  flex: none;
  display: grid; place-items: center;
  width: 36px; height: 36px;
  margin-right: 3px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-faint);
  transition: color .18s, background .18s;
}
.searchbar button:hover { color: var(--accent); background: var(--accent-soft); }

.topnav { display: flex; gap: 4px; flex: none; }
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13.5px;
  transition: background .18s, color .18s, border-color .18s;
}
.nav-btn:hover { background: var(--bg-sunken); color: var(--ink); }
.nav-btn.active { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-soft); }

/* ============ layout ============ */
.view {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 20px 72px;
  min-height: calc(100vh - 190px);
}

.footer {
  border-top: 1px solid var(--line);
  padding: 22px 20px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 12.5px;
}
.footer .dot { margin: 0 8px; opacity: .5; }

/* ============ hero / empty state ============ */
.hero {
  text-align: center;
  padding: 48px 20px 20px;
  animation: rise .5s ease both;
}
.hero-mark {
  font-family: var(--font-read);
  font-size: 54px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .1em;
  opacity: .9;
}
.hero h1 {
  font-family: var(--font-read);
  font-size: 26px;
  font-weight: 700;
  margin: 14px 0 8px;
}
.hero p { color: var(--ink-faint); margin: 0; font-size: 14.5px; }

.suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: center;
  margin-top: 26px;
}
.suggest button {
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--ink-soft);
  font-size: 13.5px;
  transition: all .18s;
}
.suggest button:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ============ search progress ============ */
.progress-wrap { margin: 8px 0 24px; }
.progress-line {
  height: 3px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.progress-line::after {
  content: "";
  display: block;
  height: 100%;
  width: 40%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: slide 1.3s ease-in-out infinite;
}
@keyframes slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* ============ search results ============ */
.result-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 18px;
  flex-wrap: wrap;
}
.result-head h2 {
  font-family: var(--font-read);
  font-size: 19px;
  margin: 0;
  font-weight: 700;
}
.result-head .meta { color: var(--ink-faint); font-size: 13px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.book-card {
  display: flex;
  gap: 13px;
  padding: 13px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
  animation: rise .35s ease both;
}
.book-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

.cover {
  flex: none;
  width: 62px;
  height: 84px;
  border-radius: 7px;
  overflow: hidden;
  background: var(--bg-sunken);
  display: grid;
  place-items: center;
  color: var(--ink-faint);
  font-family: var(--font-read);
  font-size: 22px;
  position: relative;
}
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.book-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.book-title {
  font-weight: 650;
  font-size: 14.5px;
  line-height: 1.35;
  margin: 1px 0 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.book-author { color: var(--ink-faint); font-size: 12.5px; margin-bottom: 6px; }
.book-source-pill {
  align-self: flex-start;
  margin-top: auto;
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-sunken);
  color: var(--ink-soft);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============ book detail (sheet) ============ */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(25, 20, 14, .42);
  backdrop-filter: blur(2px);
  z-index: 90;
  animation: fade .22s ease both;
}
.sheet {
  position: fixed;
  z-index: 100;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(680px, calc(100vw - 32px));
  max-height: min(86vh, 900px);
  overflow: auto;
  background: var(--bg-elev);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: pop .24s cubic-bezier(.2, .9, .3, 1.1) both;
  overscroll-behavior: contain;
}
.sheet-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 0; border-radius: 999px;
  background: var(--bg-sunken);
  color: var(--ink-soft);
  z-index: 2;
  transition: background .18s;
}
.sheet-close:hover { background: var(--line-strong); }

.detail-hero {
  display: flex;
  gap: 20px;
  padding: 28px 28px 20px;
  border-bottom: 1px solid var(--line);
}
.detail-hero .cover { width: 104px; height: 142px; font-size: 34px; border-radius: 10px; box-shadow: var(--shadow-md); }
.detail-info { min-width: 0; flex: 1; padding-right: 24px; }
.detail-info h2 {
  font-family: var(--font-read);
  font-size: 23px;
  margin: 0 0 6px;
  line-height: 1.3;
}
.detail-author { color: var(--ink-soft); font-size: 14px; margin-bottom: 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}
.tag.plain { background: var(--bg-sunken); color: var(--ink-soft); }

.detail-body { padding: 20px 28px 26px; }

.detail-actions { display: flex; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--ink);
  font-size: 14px;
  font-weight: 550;
  transition: all .18s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn:disabled { opacity: .5; cursor: default; transform: none; }

.intro-text {
  font-family: var(--font-read);
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink-soft);
  white-space: pre-wrap;
  margin: 0 0 8px;
  max-height: 220px;
  overflow: hidden;
  position: relative;
}
.intro-text.expanded { max-height: none; }
.intro-toggle {
  border: 0; background: none; color: var(--accent); font-size: 13px;
  padding: 0; margin-bottom: 16px;
}

.section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-faint);
  margin: 20px 0 10px;
  font-weight: 650;
}

/* ============ chapter list ============ */
.toc-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46%, 1fr));
  gap: 2px;
  max-height: 300px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px;
  background: var(--bg);
}
.toc-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background .14s, color .14s;
}
.toc-item:hover { background: var(--accent-soft); color: var(--accent); }

/* ============ reader ============ */
.reader {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 0 40px;
}
.reader-top {
  position: sticky;
  top: 57px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  background: var(--bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.reader-top .chapter-title {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.icon-btn {
  flex: none;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-elev);
  color: var(--ink-soft);
  transition: all .18s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn:disabled { opacity: .35; }

.reader-body {
  font-family: var(--font-read);
  font-size: var(--read-size, 19px);
  line-height: var(--read-height, 1.95);
  color: var(--ink);
  letter-spacing: var(--read-spacing, .01em);
}
.reader-body h1 {
  font-size: 1.35em;
  margin: 0 0 1.4em;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
}
.reader-body p {
  margin: 0 0 .85em;
  text-indent: 2em;
  text-align: justify;
}
.reader-body p:empty { display: none; }

.reader-nav {
  display: flex;
  gap: 10px;
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.reader-nav .btn { flex: 1; justify-content: center; }

/* reader settings panel */
.settings-panel {
  position: fixed;
  z-index: 110;
  right: 20px;
  bottom: 20px;
  width: min(330px, calc(100vw - 40px));
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 18px;
  animation: rise .22s ease both;
}
.setting-row { margin-bottom: 16px; }
.setting-row:last-child { margin-bottom: 0; }
.setting-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-faint);
  margin-bottom: 8px;
  font-weight: 600;
}
.theme-swatches { display: flex; gap: 9px; }
.swatch {
  flex: 1;
  height: 40px;
  border-radius: 9px;
  border: 2px solid transparent;
  position: relative;
  transition: border-color .18s, transform .18s;
}
.swatch:hover { transform: translateY(-1px); }
.swatch.active { border-color: var(--accent); }
.swatch[data-theme="paper"] { background: #f7f4ef; }
.swatch[data-theme="sepia"] { background: #f2e7d3; }
.swatch[data-theme="green"] { background: #e8f0e4; }
.swatch[data-theme="dark"] { background: #16181c; }

.range-row { display: flex; align-items: center; gap: 10px; }
input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 999px;
  background: var(--line-strong);
  outline: 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-elev);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-elev);
  cursor: pointer;
}

/* ============ shelf ============ */
.shelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.shelf-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform .18s, box-shadow .18s;
}
.shelf-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.shelf-card .cover { width: 58px; height: 80px; }
.shelf-actions { margin-top: auto; display: flex; gap: 8px; }
.mini-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-faint);
  border-radius: 7px;
  padding: 3px 9px;
  font-size: 11.5px;
  transition: all .16s;
}
.mini-btn:hover { color: var(--accent); border-color: var(--accent); }
.mini-btn.danger:hover { color: #b4483a; border-color: #b4483a; }

.progress-badge {
  font-size: 11.5px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 999px;
  align-self: flex-start;
}

/* ============ sources panel ============ */
.panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 18px;
}
.panel h3 {
  font-family: var(--font-read);
  font-size: 17px;
  margin: 0 0 6px;
}
.panel p.hint { color: var(--ink-faint); font-size: 13px; margin: 0 0 16px; }
.panel p.hint code,
.empty .panel code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  background: var(--bg-sunken);
  color: var(--ink-soft);
  padding: 1px 6px;
  border-radius: 5px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.stat {
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bg-sunken);
  text-align: center;
}
.stat-num {
  font-family: var(--font-read);
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}
.stat-label { font-size: 11.5px; color: var(--ink-faint); margin-top: 2px; }

textarea.source-input {
  width: 100%;
  min-height: 130px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12.5px;
  resize: vertical;
  outline: 0;
}
textarea.source-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.source-group { margin-bottom: 14px; }
.source-group-title {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-soft);
  margin-bottom: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.source-group-title .count {
  color: var(--ink-faint);
  font-weight: 400;
  font-size: 11.5px;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-sunken);
  color: var(--ink-soft);
  border: 1px solid transparent;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============ states ============ */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-faint);
  animation: rise .4s ease both;
}
.empty-icon { font-size: 40px; opacity: .55; margin-bottom: 12px; }
.empty h3 { font-family: var(--font-read); color: var(--ink-soft); margin: 0 0 6px; font-size: 17px; }
.empty p { margin: 0; font-size: 13.5px; }

.skeleton {
  background: linear-gradient(90deg, var(--bg-sunken) 25%, var(--line) 37%, var(--bg-sunken) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius);
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}
.skeleton-card { height: 110px; }

.reader-loading {
  font-family: var(--font-read);
  color: var(--ink-faint);
  text-align: center;
  padding: 60px 0;
  font-size: 15px;
}

/* ============ toast ============ */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  z-index: 200;
  background: var(--ink);
  color: var(--bg);
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity .22s, transform .22s;
  max-width: calc(100vw - 40px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #9d3b30; color: #fff; }

/* ============ animations ============ */
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop {
  from { opacity: 0; transform: translate(-50%, -48%) scale(.97); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ============ responsive ============ */
@media (max-width: 720px) {
  .topbar-inner { padding: 8px 14px; gap: 10px; flex-wrap: wrap; }
  .brand-text { display: none; }
  .searchbar { order: 3; flex-basis: 100%; max-width: none; margin: 2px 0 0; }
  .topnav { margin-left: auto; }
  .nav-label { display: none; }
  .nav-btn { padding: 8px; }
  .view { padding: 20px 14px 60px; }
  .grid { grid-template-columns: 1fr; }
  .hero { padding: 30px 10px 12px; }
  .hero-mark { font-size: 42px; }
  .detail-hero { padding: 22px 18px 16px; gap: 14px; }
  .detail-hero .cover { width: 82px; height: 112px; }
  .detail-info { padding-right: 28px; }
  .detail-info h2 { font-size: 19px; }
  .detail-body { padding: 16px 18px 22px; }
  .toc-list { grid-template-columns: 1fr; }
  .reader-top { top: 105px; }
  .settings-panel { right: 10px; left: 10px; bottom: 10px; width: auto; }
  .reader-body { font-size: 18px; }
}

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

/* print: chapters only */
@media print {
  .topbar, .footer, .reader-top, .reader-nav, .settings-panel { display: none !important; }
  .reader-body { font-size: 12pt; color: #000; }
  body { background: #fff; }
}
