/* ============ Tokens ============ */
:root {
  --fs: 18px;
  --paper: #f6f3ec;
  --paper-2: #efeae0;
  --ink: #23201b;
  --ink-2: #5e5850;
  --ink-3: #958d81;
  --line: #e2dccf;
  --accent: #b4432d;          /* 朱砂 */
  --accent-soft: rgba(180, 67, 45, .09);
  --ins: rgba(64, 128, 72, .14);
  --ins-ink: #2f6b38;
  --del: rgba(180, 67, 45, .10);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
  --measure: 36em;
  --radius: 10px;
  color-scheme: light;
}
:root[data-theme="sepia"] {
  --paper: #f1e7d0; --paper-2: #e8dcc0; --ink: #3b2f22; --ink-2: #6d5c48; --ink-3: #9a8770; --line: #ddcfb1;
  --accent: #a2482e;
}
:root[data-theme="dark"] {
  --paper: #161513; --paper-2: #1e1c19; --ink: #d9d3c7; --ink-2: #a39c90; --ink-3: #6f695f; --line: #2c2925;
  --accent: #e07a5f; --accent-soft: rgba(224, 122, 95, .12);
  --ins: rgba(110, 180, 120, .16); --ins-ink: #8fcf98; --del: rgba(224, 122, 95, .12);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="sepia"]) {
    --paper: #161513; --paper-2: #1e1c19; --ink: #d9d3c7; --ink-2: #a39c90; --ink-3: #6f695f; --line: #2c2925;
    --accent: #e07a5f; --accent-soft: rgba(224, 122, 95, .12);
    --ins: rgba(110, 180, 120, .16); --ins-ink: #8fcf98; --del: rgba(224, 122, 95, .12);
    color-scheme: dark;
  }
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: background-color .25s, color .25s;
}
main { flex: 1; width: 100%; max-width: calc(var(--measure) + 32px); margin: 0 auto; padding: 0 16px 64px; }
a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.35; letter-spacing: .02em; }
code { font: .85em ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink-3); }
button { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }

/* ============ Header / Footer ============ */
.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: transform .3s ease, border-color .25s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header.hidden { transform: translateY(-100%); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--serif); font-size: 17px; letter-spacing: .12em; }
.mark { width: 9px; height: 9px; background: var(--accent); transform: rotate(45deg); flex: none; margin: 0 2px; }
.tools { display: flex; gap: 2px; }
.tool {
  min-width: 36px; height: 36px; padding: 0 8px; border: 0; background: none; border-radius: 8px;
  color: var(--ink-2); cursor: pointer; font-family: var(--serif); font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center;
}
.tool sup { font-size: .65em; line-height: 0; vertical-align: 0; margin-left: 1px; position: relative; top: -.45em; }
.tool:hover { background: var(--paper-2); color: var(--ink); }
.site-footer { text-align: center; color: var(--ink-3); font-size: 13px; padding: 32px 16px calc(32px + env(safe-area-inset-bottom)); }
.progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--accent); z-index: 20; transition: width .1s linear; }

/* ============ Common ============ */
.crumbs { font-size: 13px; color: var(--ink-3); margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumbs a { text-decoration: none; }
.crumbs i { font-style: normal; opacity: .5; }
.crumbs span { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 14em; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--ink-3); align-items: center; }
.meta a { color: var(--accent); text-decoration: none; }
.tag {
  display: inline-block; font-size: 12px; line-height: 1; padding: 4px 7px; border-radius: 999px;
  color: var(--accent); background: var(--accent-soft); margin-left: 6px; vertical-align: 2px; font-family: var(--sans); font-weight: 400;
}
.meta .tag { margin-left: 0; }
.tag.warn { color: #9a6a00; background: rgba(200, 150, 0, .12); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; height: 42px; padding: 0 20px;
  border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-size: 15px; color: var(--ink);
  transition: border-color .2s, background .2s, color .2s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff8f2; }
.btn.primary:hover { filter: brightness(1.08); color: #fff8f2; }
.empty { color: var(--ink-3); text-align: center; padding: 32px 0; }
.section-title { font-size: 13px; font-family: var(--sans); font-weight: 500; letter-spacing: .3em; color: var(--ink-3); margin: 0 0 12px; display: flex; align-items: center; gap: 12px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ============ Home ============ */
.hero { padding: 13vh 0 9vh; text-align: center; }
.hero h1 { font-size: clamp(32px, 9vw, 46px); margin: 0 0 14px; letter-spacing: .25em; text-indent: .25em; }
.hero .hero-sub { font: italic 17px Georgia, var(--serif); letter-spacing: .12em; color: var(--ink-3); margin: -2px 0 22px; }
.hero p { color: var(--ink-2); font-family: var(--serif); margin: 0 0 24px; }
.book {
  display: flex; gap: 18px; padding: 20px 0; text-decoration: none; border-bottom: 1px solid var(--line);
}
.book:hover h3 { color: var(--accent); }
.book-spine {
  flex: none; width: 64px; height: 96px; border-radius: 3px 7px 7px 3px;
  background: linear-gradient(90deg, rgba(0,0,0,.16) 0 5px, transparent 5px), var(--accent);
  color: #fff7ee; font-family: var(--serif);
  box-shadow: 0 1px 0 rgba(0,0,0,.05), 0 8px 18px -10px rgba(80, 30, 10, .45);
  transition: transform .25s ease; padding-left: 5px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
}
.book-spine i { font-style: normal; font-size: 14px; line-height: 1.15; }
.book:nth-of-type(3n+2) .book-spine { background: linear-gradient(90deg, rgba(0,0,0,.16) 0 5px, transparent 5px), #3d4f5c; }
.book:nth-of-type(3n) .book-spine { background: linear-gradient(90deg, rgba(0,0,0,.16) 0 5px, transparent 5px), #5b4a3a; }
.book:hover .book-spine { transform: translateY(-3px) rotate(-1.5deg); }
.book-info { min-width: 0; }
.book-ord { margin: 0 0 2px !important; font-size: 12px !important; letter-spacing: .15em; color: var(--ink-3) !important; }
.book h3 { margin: 0 0 6px; font-size: 20px; transition: color .2s; }
.book p { margin: 0 0 10px; color: var(--ink-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.collection-head { display: flex; align-items: baseline; gap: 12px; text-decoration: none; border-bottom: 1px solid var(--ink); padding-bottom: 10px; margin-top: 8px; }
.collection-head h2 { margin: 0; font-size: 26px; letter-spacing: .3em; }
.collection-head .sub { font: italic 14px Georgia, var(--serif); color: var(--ink-3); letter-spacing: .05em; }
.collection-head .more { margin-left: auto; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.collection-head:hover .more { color: var(--accent); }
.collection-desc { color: var(--ink-2); font-family: var(--serif); margin: 14px 0 0; }
.shelf + .shelf { margin-top: 56px; }

/* ============ Novel ============ */
.novel-head { padding: 48px 0 28px; text-align: center; }
.novel-head .kicker { margin: 0 0 10px; font-size: 13px; letter-spacing: .3em; color: var(--accent); }
.novel-head .kicker a { text-decoration: none; }
.novel-head h1 { font-size: clamp(28px, 7.5vw, 38px); margin: 0 0 8px; letter-spacing: .12em; }
.novel-head .subtitle { margin: 0 0 12px; color: var(--ink-2); font-family: var(--serif); }
.novel-head .meta { justify-content: center; }
.novel-head .desc { color: var(--ink-2); font-family: var(--serif); text-align: left; margin: 22px auto 0; max-width: 30em; line-height: 1.9; }
.epigraph { margin: 28px auto 0; max-width: 26em; text-align: left; --fs: 15.5px; color: var(--ink-2); }
.epigraph blockquote { border-left: 0; padding: 0; margin: 0; }
.epigraph blockquote p { text-indent: 0; margin: 0 0 .1em; }
.epigraph blockquote p:empty { display: none; }
.chapter .epigraph { margin-bottom: 2em; }
.extras { margin: 8px 0 32px; }
.extras ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.extras a { display: inline-block; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-family: var(--serif); font-size: 15px; }
.extras a:hover { border-color: var(--accent); }
.toc-part { font-size: 15px; letter-spacing: .2em; color: var(--accent); margin: 28px 0 0; padding-bottom: 8px; }
.toc + .toc { margin-top: 0; border-top: 0; }
.actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.toc { list-style: none; padding: 0; margin: 12px 0 0; border-top: 1px solid var(--line); }
.toc a { display: flex; align-items: baseline; gap: 14px; padding: 15px 4px; border-bottom: 1px solid var(--line); text-decoration: none; }
.toc a:hover .t { color: var(--accent); }
.toc .no { font: 13px ui-monospace, Menlo, monospace; color: var(--ink-3); flex: none; }
.toc .t { flex: 1; font-family: var(--serif); font-size: 16.5px; min-width: 0; transition: color .2s; }
.toc .w { font-size: 12px; color: var(--ink-3); flex: none; display: flex; gap: 8px; }
.toc .w em { font-style: normal; color: var(--accent); }
.toc a.last-read .t::after { content: "上次读到"; font: 11px var(--sans); color: var(--accent); margin-left: 8px; }

/* ============ Reading ============ */
.chapter-head { text-align: center; padding: 44px 0 26px; }
.chapter-head .kicker { margin: 0 0 6px; font-size: 13px; letter-spacing: .3em; color: var(--accent); }
.chapter-head h1 { font-size: clamp(24px, 6.5vw, 32px); margin: 0 0 12px; }
.chapter-head .meta { justify-content: center; }
.prose { font-family: var(--serif); font-size: var(--fs); line-height: 1.95; letter-spacing: .02em; text-align: justify; hanging-punctuation: allow-end; word-break: break-word; }
.prose p { margin: 0 0 .9em; text-indent: 2em; }
.prose h2, .prose h3 { text-align: center; margin: 2em 0 1em; font-size: 1.1em; }
.prose hr { border: 0; text-align: center; margin: 2.2em 0; }
.prose hr::before { content: "◇ ◇ ◇"; color: var(--ink-3); letter-spacing: .6em; font-size: .8em; }
.prose blockquote { margin: 1.2em 0; padding: .2em 0 .2em 1.2em; border-left: 2px solid var(--accent); color: var(--ink-2); }
.prose blockquote { font-size: .9em; line-height: 1.8; }
.prose blockquote p { text-indent: 0; margin: 0 0 .35em; }
.prose em { font-style: normal; text-emphasis: dot; -webkit-text-emphasis: dot; text-emphasis-position: under right; }
.prose img { max-width: 100%; height: auto; border-radius: 6px; }
.pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: stretch; margin-top: 48px; border-top: 1px solid var(--line); padding-top: 20px; }
.pager a { text-decoration: none; padding: 10px 12px; border-radius: var(--radius); font-family: var(--serif); font-size: 15px; line-height: 1.5; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pager a:hover { background: var(--paper-2); }
.pager small { display: block; font: 12px var(--sans); color: var(--ink-3); margin-bottom: 2px; }
.pager a[rel="next"] { text-align: right; }
.pager .pager-toc { align-self: center; font-family: var(--sans); font-size: 14px; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px; }

/* ============ History ============ */
.page-head { padding: 40px 0 20px; }
.page-head h1 { font-size: clamp(24px, 6.5vw, 30px); margin: 0 0 8px; }
.page-head p { margin: 4px 0; color: var(--ink-2); font-size: 14px; }
.page-head p a { color: var(--accent); text-decoration: none; }
.commit-msg { font-family: var(--serif); padding: 10px 14px; background: var(--paper-2); border-radius: 8px; margin-top: 12px !important; }
.banner {
  margin: 20px 0 0; padding: 14px 16px; border-radius: var(--radius);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  font-size: 14px; color: var(--ink-2);
}
.banner p { margin: 0; }
.banner b { color: var(--ink); font-weight: 600; }
.banner-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px !important; }
.banner-links a { color: var(--accent); text-decoration: none; font-weight: 500; }
.timeline { list-style: none; margin: 8px 0 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 10px; bottom: 10px; width: 1px; background: var(--line); }
.timeline > li { position: relative; display: flex; gap: 18px; padding: 12px 0; }
.tl-dot { flex: none; width: 11px; height: 11px; margin-top: 8px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink-3); position: relative; }
.timeline > li:first-child .tl-dot { border-color: var(--accent); background: var(--accent); }
.tl-body { min-width: 0; flex: 1; }
.tl-title { font-family: var(--serif); font-size: 17px; text-decoration: none; font-weight: 600; }
.tl-msg { margin: 4px 0 0; font-family: var(--serif); color: var(--ink-2); }
.tl-note { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); white-space: pre-line; border-left: 2px solid var(--line); padding-left: 10px; }
.tl-meta { margin: 4px 0 0; font-size: 13px; color: var(--ink-3); }
.tl-meta a { color: var(--accent); text-decoration: none; }
.tl-changes { list-style: none; padding: 0; margin: 8px 0 0; font-size: 14px; display: grid; gap: 4px; }
.tl-changes a { text-decoration: none; font-family: var(--serif); }
.op { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 4px; margin-right: 8px; background: var(--paper-2); color: var(--ink-2); }
.op-A { color: var(--ins-ink); background: var(--ins); }
.op-D { color: var(--accent); background: var(--del); }
.diff-stat { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px !important; }
.plus { color: var(--ins-ink); }
.minus { color: var(--accent); }
.diff > div { padding: .35em .6em; margin: 0 -.6em .5em; border-radius: 6px; }
.diff > div > :first-child { margin-top: 0; }
.diff > div > :last-child { margin-bottom: 0; }
.diff > div > hr { margin: .6em 0; }
.diff-ins { background: var(--ins); box-shadow: inset 3px 0 0 var(--ins-ink); }
.diff-del { background: var(--del); color: var(--ink-2); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.diff-eq { color: var(--ink-2); }
.diff .diff-skip { text-align: center; text-indent: 0; font: 12px var(--sans); color: var(--ink-3); letter-spacing: .1em; }

@media (min-width: 720px) {
  :root { --fs: 19px; }
  .site-header { padding-left: 28px; padding-right: 28px; }
  .hero { padding: 18vh 0 10vh; }
  .chapter-head { padding: 72px 0 40px; }
  .book-spine { width: 72px; height: 100px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .site-header, .site-footer, .pager, .progress, .banner-links { display: none; } body { background: #fff; } }

/* ============ Diff sections ============ */
.diff-index { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 14px; font-size: 13px; }
.diff-index a { color: var(--accent); text-decoration: none; font-family: var(--serif); }
.diff-section { margin-top: 36px; }
.diff-ch { font-size: 19px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin: 0 0 16px; scroll-margin-top: 72px; }
.diff-ch small { font: 13px var(--sans); color: var(--ink-3); display: inline-flex; gap: 8px; }
.removed { font-family: var(--serif); }
.diff .diff-skip a { color: var(--accent); }

/* ============ 整本连续阅读 ============ */
.toc-box { margin: 8px 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.toc-box summary { cursor: pointer; list-style: none; padding: 14px 4px; font-size: 14px; color: var(--ink-2); display: flex; justify-content: space-between; }
.toc-box summary::-webkit-details-marker { display: none; }
.toc-box summary::after { content: "展开"; color: var(--accent); font-size: 13px; }
.toc-box[open] summary::after { content: "收起"; }
.toc-box .toc:first-of-type { border-top: 1px solid var(--line); }
.toc-box .toc li:last-child a { border-bottom: 0; }
.fulltext .part-head { text-align: center; padding: 72px 0 8px; }
.fulltext .part-head h2 { font-size: clamp(22px, 6vw, 28px); letter-spacing: .3em; margin: 0; }
.fulltext .part-head h2::before, .fulltext .part-head h2::after { content: "◇"; font-size: .45em; color: var(--accent); vertical-align: middle; margin: 0 .9em; letter-spacing: 0; }
.fulltext .chapter-head { padding: 56px 0 22px; }
.fulltext .chapter-head h2 { font-size: clamp(21px, 5.6vw, 26px); margin: 0 0 10px; }
.fulltext section.chapter { scroll-margin-top: 8px; }
.fulltext section.chapter + section.chapter .chapter-head::before,
.fulltext section.chapter + .part-head::before { content: ""; display: block; width: 36px; height: 1px; background: var(--line); margin: 0 auto 48px; }
.the-end { text-align: center; color: var(--accent); margin: 48px 0 0; }
.fab {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 15;
  max-width: 55vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
  background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font: 14px var(--serif); color: var(--ink-2); box-shadow: 0 6px 20px -8px rgba(0,0,0,.25);
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .25s, transform .25s;
}
.fab.show { opacity: 1; transform: none; pointer-events: auto; }
.drawer {
  margin: 0 0 0 auto; height: 100%; max-height: 100%; width: min(380px, 88vw); border: 0; padding: 0 16px 24px;
  background: var(--paper); color: var(--ink); overflow-y: auto; box-shadow: -10px 0 30px -12px rgba(0,0,0,.3);
}
.drawer::backdrop { background: rgba(20, 16, 12, .35); }
.drawer-head { position: sticky; top: 0; background: var(--paper); display: flex; justify-content: space-between; align-items: center; padding: max(14px, env(safe-area-inset-top)) 0 10px; font-family: var(--serif); z-index: 1; }
.drawer .toc-part { margin-top: 18px; }
.drawer .toc a { padding: 12px 4px; }
.drawer .toc a.current .t { color: var(--accent); }
.drawer .toc a.current .t::before { content: "◆ "; font-size: .7em; vertical-align: 2px; }
.fulltext .prelude { padding: 64px 0 8px; max-width: 24em; margin: 0 auto; }
.fulltext .prelude blockquote { border-left: 0; padding: 0; margin: 0; color: var(--ink-2); }
.fulltext .prelude blockquote p { text-indent: 0; margin: 0 0 .25em; }
.fulltext .prelude + .part-head, .fulltext .prelude + section.chapter .chapter-head { padding-top: 56px; }

/* ============ 封面 ============ */
.book-cover { flex: none; width: 84px; height: 126px; object-fit: cover; border-radius: 3px; background: var(--paper-2);
  box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 10px 22px -12px rgba(40, 20, 10, .55); transition: transform .25s ease; }
.book:hover .book-cover { transform: translateY(-3px); }
.novel-cover { display: block; width: min(240px, 62vw); height: auto; aspect-ratio: 2 / 3; margin: 0 auto 28px; border-radius: 4px; background: var(--paper-2);
  box-shadow: 0 2px 0 rgba(0,0,0,.05), 0 24px 48px -22px rgba(40, 20, 10, .6); }
@media (min-width: 720px) { .book-cover { width: 104px; height: 156px; } .novel-cover { width: 260px; } }

/* 正文中的章节与分部标题居左 */
.fulltext .chapter-head, .fulltext .part-head { text-align: left; }
.fulltext .chapter-head .meta { justify-content: flex-start; }
.fulltext .part-head h2::after { content: none; }
.fulltext .part-head h2::before { margin: 0 .6em 0 0; }
.fulltext section.chapter + section.chapter .chapter-head::before,
.fulltext section.chapter + .part-head::before { margin: 0 0 48px; }
.fulltext .part-head + section.chapter .chapter-head { padding-top: 32px; }

/* ============ 详情页 ============ */
.detail-sec { margin-top: 40px; }
.detail-sec .section-title { margin-bottom: 4px; }
.detail-sec .intro { --fs: 16.5px; color: var(--ink-2); }
.opening { margin: 12px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); font-family: var(--serif); color: var(--ink-2); line-height: 1.9; }
.note { border-bottom: 1px solid var(--line); }
.note summary { cursor: pointer; list-style: none; padding: 15px 4px; font-family: var(--serif); font-size: 16.5px; display: flex; justify-content: space-between; align-items: center; }
.note summary::-webkit-details-marker { display: none; }
.note summary::after { content: "+"; color: var(--accent); font: 20px var(--sans); line-height: 1; }
.note[open] summary::after { content: "−"; }
.note .prose { --fs: 16.5px; padding: 0 4px 18px; }
.detail-sec .toc { margin-top: 8px; }

/* ============ 阅读页（沉浸式） ============ */
.immersive .crumbs { display: none; }
.read-head { margin: 18px 0 0; font-size: 14px; }
.read-head a { color: var(--ink-3); text-decoration: none; }
.read-head a:hover { color: var(--accent); }
.read-title { text-align: center; font-size: clamp(26px, 7vw, 34px); letter-spacing: .15em; margin: 48px 0 0; }
.immersive .pager { margin-top: 64px; }

/* ============ 账号 ============ */
.acct { font-size: 14px; color: var(--ink-2); text-decoration: none; padding: 6px 10px; border-radius: 999px; max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct:hover { background: var(--paper-2); color: var(--ink); }
.acct.in { color: var(--accent); }
.tools { align-items: center; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; margin: 16px 0; }
.card h2 { font-size: 17px; margin: 0 0 12px; }
.field { display: block; margin: 0 0 14px; }
.field > span:first-child { display: block; font-size: 13px; color: var(--ink-3); margin-bottom: 6px; }
.field input { width: 100%; font: 16px var(--sans); color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.field input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
.row { display: flex; gap: 8px; }
.row input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .08em; }
button.btn { font: inherit; cursor: pointer; background: none; }
button.btn.primary { background: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.busy { opacity: .6; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.more { margin-top: 14px; }
.more summary { cursor: pointer; font-size: 14px; color: var(--accent); margin-bottom: 12px; }
.fine { font-size: 13px; color: var(--ink-3); line-height: 1.7; }
.acct-msg { margin: 16px 0 0; padding: 10px 14px; border-radius: 8px; background: var(--accent-soft); color: var(--ink); font-size: 14px; }
.acct-msg.bad { background: rgba(200, 60, 40, .12); color: var(--accent); }
.acct-warn { font-size: 14px; color: var(--accent); }
.keys { list-style: none; padding: 0; margin: 0 0 14px; }
.keys li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.keys li small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--accent); cursor: pointer; }
.link-btn.danger { margin-top: 16px; font-size: 13px; }
.pair-show { margin-top: 14px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pair-show code { font: 600 26px ui-monospace, Menlo, monospace; color: var(--ink); letter-spacing: .12em; }
.pair-show small { color: var(--ink-3); }
.codes-box { position: fixed; inset: 0; z-index: 40; background: rgba(20, 16, 12, .5); display: grid; place-items: center; padding: 16px; }
.codes-card { background: var(--paper); border-radius: 14px; padding: 22px 18px; max-width: 420px; width: 100%; max-height: 90vh; overflow: auto; }
.codes-card h2 { margin: 0 0 8px; font-size: 19px; }
.codes-card p { font-size: 14px; color: var(--ink-2); }
.codes-card ol { padding-left: 1.6em; margin: 14px 0 18px; }
.codes-card li { margin: 2px 0; }
@media (min-width: 520px) { .codes-card ol { columns: 2; column-gap: 28px; } }
.codes-card code { font: 15px ui-monospace, Menlo, monospace; color: var(--ink); letter-spacing: .05em; }

/* ============ 读完 ============ */
.finish-box { text-align: center; margin: 56px 0 0; padding: 28px 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.finish-box p { font-size: 13px; color: var(--ink-3); margin: 14px 0 0; }
.finish-box p a { color: var(--accent); }
.finish-box .btn.on { background: none; color: var(--accent); border-color: var(--accent); }
.gate-note { font-size: 14px; color: var(--ink-3); padding: 12px 4px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }

/* ============ 布局修正（2026-11-11 通篇检查） ============ */
/* 上一篇 / 下一篇：去掉与目录底线重复的分隔线；下一篇靠右 */
.pager { border-top: 0; padding-top: 8px; margin-top: 32px; }
.pager a[rel="next"] { text-align: right; justify-self: end; }
.pager a[rel="prev"] { justify-self: start; }
.immersive .pager { margin-top: 40px; }
/* 悬浮目录按钮：到书末隐藏 */
.fab.at-end { opacity: 0; transform: translateY(12px); pointer-events: none; }
/* 阅读页：书名与第一部之间不要留大片空白；分部标题字距收紧 */
.read-title { margin: 40px 0 8px; }
.fulltext > .part-head:first-child, .fulltext > .prelude + .part-head { padding-top: 40px; }
.fulltext .part-head h2 { letter-spacing: .12em; }
/* 文集页副题与首页一致 */
.novel-head .subtitle { font: italic 17px Georgia, var(--serif); letter-spacing: .08em; color: var(--ink-3); }
.row input.plain { text-transform: none; letter-spacing: normal; }
.card .row { margin-top: 4px; }
.card .row input { width: auto; flex: 1; font: 16px var(--sans); color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-width: 0; }
.field .row input { text-transform: uppercase; }

/* ============ 评分 ============ */
.score { color: var(--accent); }
.score small { color: var(--ink-3); font-size: 1em; }
.rating-sum { display: grid; grid-template-columns: auto 1fr; gap: 16px 28px; align-items: center; margin-top: 14px; }
.rating-big { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 96px; }
.rating-big b { font: 600 40px/1 Georgia, var(--serif); color: var(--ink); }
.rating-big small { font-size: 12px; color: var(--ink-3); }
.stars { display: inline-flex; gap: 1px; font-size: 15px; }
.st::before { content: "★"; background: linear-gradient(90deg, var(--accent) calc(var(--f) * 100%), var(--line) 0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rating-dims { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.rating-dims li { display: grid; grid-template-columns: 2.6em 1fr 2em; gap: 10px; align-items: center; font-size: 13px; color: var(--ink-2); }
.rating-dims i { height: 6px; border-radius: 3px; background: var(--paper-2); overflow: hidden; }
.rating-dims em { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .4s ease; }
.rating-dims b { font-weight: 500; text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rating-me { margin-top: 18px; }
.rating-me h3 { font-size: 16px; margin: 0 0 6px; }
.r-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.r-row b { display: block; font-size: 15px; font-family: var(--serif); }
.r-row b small { font: 11px var(--sans); color: var(--ink-3); margin-left: 6px; font-weight: 400; }
.r-row span { font-size: 12px; color: var(--ink-3); }
.r-row.main b { font-size: 16px; }
.r-stars { display: flex; flex: none; }
.rs { background: none; border: 0; padding: 2px 3px; font-size: 22px; line-height: 1; color: var(--line); cursor: pointer; }
.r-row.main .rs { font-size: 26px; }
.rs.on { color: var(--accent); }
.rating-me .btn-row { margin-top: 14px; align-items: center; gap: 16px; }
.r-msg { margin-top: 10px; }
@media (max-width: 380px) { .rating-sum { grid-template-columns: 1fr; } .rs { font-size: 20px; padding: 2px; } }

/* 登录 / 注册切换 */
.seg { display: flex; gap: 4px; padding: 4px; margin: 8px 0 0; background: var(--paper-2); border-radius: 999px; }
.seg button { flex: 1; border: 0; background: none; padding: 9px 0; border-radius: 999px; font: 15px var(--sans); color: var(--ink-2); cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
#acct-out .card { margin-top: 12px; }
.score.empty { color: var(--ink-3); }
.rating.empty .rating-big b { color: var(--ink-3); }
.hint { display: block; margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.hint.bad { color: var(--accent); }
.hint.ok { color: var(--ins-ink); }
