@charset "UTF-8";
:root {
  color-scheme: light;
  --paper: #f6f2e9;
  --surface: #fcf9f2;
  --ink: #302e29;
  --muted: #767064;
  --line: #dcd5c7;
  --accent: #8b4030;
  --wash: #eee8dc;
  --shade: rgb(64 46 23 / 12%);
  --font-size: 20px;
  --serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
:root[data-theme="night"] {
  color-scheme: dark;
  --paper: #1d211f;
  --surface: #252a27;
  --ink: #d9d6cc;
  --muted: #a5aa9f;
  --line: #40463f;
  --accent: #d5a48a;
  --wash: #2b312c;
  --shade: rgb(0 0 0 / 30%);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 90px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .35; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
a { color: inherit; }
button { border: 0; background: transparent; }
::selection { background: var(--line); }
.skip-link { position: fixed; top: -100px; left: 20px; z-index: 20; padding: 12px; background: var(--surface); }
.skip-link:focus { top: 12px; }
.site-header { height: 86px; max-width: 1160px; margin: auto; padding: 0 48px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; font-family: var(--serif); font-size: 21px; letter-spacing: .15em; }
.seal { width: 32px; height: 36px; display: grid; place-items: center; background: var(--accent); color: var(--paper); font-size: 23px; border-radius: 2px; letter-spacing: 0; }
.brand-note { color: var(--muted); margin-left: 14px; font-family: var(--sans); font-size: 11px; letter-spacing: .2em; }
.header-actions { display: flex; gap: 20px; align-items: center; }
.quiet-button { display: inline-flex; gap: 9px; align-items: center; min-height: 44px; padding: 6px 4px; font-size: 13px; }
.quiet-button > span:first-child:not(.menu-icon) { font-family: Georgia, serif; font-size: 20px; }
.quiet-button:hover, .text-button:hover, .close-button:hover { color: var(--accent); }
.menu-icon { width: 15px; height: 11px; border-top: 1px solid; border-bottom: 1px solid; position: relative; }
.menu-icon::after { content: ""; position: absolute; top: 4px; width: 10px; border-top: 1px solid; }
main { max-width: 744px; margin: 0 auto; padding: 0 28px; }
.book-intro { display: flex; gap: 34px; padding: 66px 0 48px; align-items: flex-start; }
.book-mark { flex: 0 0 58px; min-height: 110px; margin-top: 4px; padding: 15px 7px; border: 1px solid var(--line); outline: 1px solid var(--line); outline-offset: -5px; display: flex; justify-content: center; gap: 5px; font: 14px/1.65 var(--serif); color: var(--muted); }
.book-mark span { writing-mode: vertical-rl; letter-spacing: .25em; }
.intro-copy { min-width: 0; flex: 1; }
.eyebrow { margin: 0 0 15px; color: var(--muted); font-size: 11px; font-weight: 400; letter-spacing: .22em; }
h1, h2, p { overflow-wrap: anywhere; }
h1 { font: 500 clamp(34px, 6vw, 44px)/1.45 var(--serif); letter-spacing: .14em; margin: 0 0 13px; }
.book-meta { color: var(--muted); font-size: 12px; letter-spacing: .04em; line-height: 1.8; margin: 10px 0 0; }
.book-idea { color: var(--muted); font: 16px/1.85 var(--serif); max-width: 34em; white-space: pre-line; }
.back-to-shelf { display: inline-flex; align-items: center; min-height: 44px; margin-top: 10px; font-size: 12px; color: var(--accent); text-decoration: none; }
.back-to-shelf:hover, .site-footer a:hover { text-decoration: underline; text-underline-offset: 4px; }
.site-footer a { text-decoration: none; }
.resume-button { display: flex; align-items: center; gap: 10px; background: var(--wash); border: 1px solid var(--line); padding: 11px 15px; margin: 21px 0 0; max-width: 100%; color: var(--accent); font-size: 12px; min-height: 44px; }
#resume-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); flex: 1; max-width: 22em; }
.chapter-rule { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 15px; font-size: 11px; color: var(--muted); letter-spacing: .1em; gap: 16px; }
.chapter-header { padding: 54px 0 42px; }
.chapter-header .eyebrow { color: var(--accent); }
.chapter-header h2 { margin: 0; font: 500 clamp(25px, 5vw, 32px)/1.6 var(--serif); letter-spacing: .06em; outline: none; }
.chapter-meta { font-size: 11px; color: var(--muted); letter-spacing: .06em; margin: 18px 0 0; }
.prose { font: 400 var(--font-size)/2.05 var(--serif); letter-spacing: .035em; text-align: justify; line-break: strict; overflow-wrap: break-word; }
.prose p { text-indent: 2em; margin: 0 0 1.15em; white-space: pre-wrap; overflow-wrap: anywhere; }
.chapter-end { display: flex; align-items: center; justify-content: center; gap: 18px; color: var(--muted); font: 12px var(--serif); letter-spacing: .24em; margin: 62px 0 46px; }
.chapter-end span { width: 34px; border-top: 1px solid var(--line); }
.chapter-nav { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; }
.chapter-link { padding: 24px 12px 24px 0; text-align: left; min-width: 0; }
.chapter-link.next { border-left: 1px solid var(--line); padding: 24px 0 24px 20px; text-align: right; }
.chapter-link > span { font-size: 12px; color: var(--muted); }
.chapter-link strong { display: block; font: 16px/1.6 var(--serif); margin-top: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chapter-link:not(:disabled):hover strong { color: var(--accent); }
.end-note { text-align: center; color: var(--muted); font: 14px/1.8 var(--serif); margin: 25px 0; }
.site-footer { max-width: 744px; padding: 46px 28px 140px; margin: auto; display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 10px; line-height: 1.8; letter-spacing: .04em; }
.reading-dock { position: fixed; bottom: max(20px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; align-items: stretch; width: min(320px, calc(100% - 48px)); border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: 0 8px 30px var(--shade); z-index: 3; overflow: hidden; }
.reading-dock > button { min-width: 52px; min-height: 51px; }
#dock-toc { flex: 1; display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 12px; }
#reading-progress { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.progress-track { height: 2px; position: absolute; bottom: 0; left: 0; right: 0; background: var(--line); }
#progress-fill { height: 100%; width: 0; background: var(--accent); }
dialog { color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 5px; box-shadow: 0 20px 100px rgb(0 0 0 / 15%); padding: 30px; width: min(460px, calc(100vw - 32px)); max-height: min(80vh, 760px); max-height: min(80dvh, 760px); overscroll-behavior: contain; }
dialog::backdrop { background: rgb(15 20 15 / 40%); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.dialog-heading .eyebrow { margin-bottom: 9px; }
.dialog-heading h2 { font: 500 28px/1.5 var(--serif); margin: 0; }
.close-button { font-size: 26px; min-width: 44px; min-height: 44px; margin-right: -10px; }
.dialog-subtitle { color: var(--muted); font-size: 12px; line-height: 1.8; margin: 15px 0 20px; }
.toc-dialog { padding-bottom: 12px; }
.toc-list { list-style: none; padding: 0; margin: 0; }
.toc-list li { border-top: 1px solid var(--line); }
.toc-list a { display: grid; grid-template-columns: 32px 1fr; column-gap: 12px; padding: 19px 4px; text-decoration: none; align-items: baseline; }
.toc-index { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.toc-name { font: 17px/1.7 var(--serif); overflow-wrap: anywhere; }
.toc-detail { grid-column: 2; color: var(--muted); font-size: 10px; margin-top: 6px; }
.toc-list a[aria-current="page"] { color: var(--accent); background: var(--wash); }
.toc-list a:hover { background: var(--wash); }
.setting-row { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; font-size: 14px; }
#font-value { color: var(--muted); font-size: 12px; }
#font-size { width: 100%; height: 36px; margin: 14px 0 0; accent-color: var(--accent); cursor: pointer; }
.range-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.theme-picker { border: 0; padding: 0; margin: 30px 0 0; }
.theme-picker legend { font-size: 14px; margin-bottom: 16px; }
.theme-picker > div { display: flex; gap: 12px; }
.theme-picker button { flex: 1; min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--line); font-size: 13px; border-radius: 3px; }
.theme-picker button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--wash); }
.theme-swatch { width: 20px; height: 20px; border: 1px solid #8b887d; border-radius: 50%; }
.paper-swatch { background: #f6f2e9; }
.night-swatch { background: #1d211f; }
.settings-note { font-size: 11px; color: var(--muted); line-height: 1.8; margin: 24px 0 0; }
.empty-state { text-align: center; padding: 50px 15px 70px; border-top: 1px solid var(--line); }
.ornament { color: var(--accent); font-size: 30px; }
.empty-state h2 { font: 500 26px/1.7 var(--serif); }
.empty-state p { color: var(--muted); font-size: 14px; line-height: 1.9; }
.text-button { text-decoration: underline; text-underline-offset: 5px; padding: 12px; min-height: 44px; }
.notice { padding: 14px 16px; margin-bottom: 24px; border-left: 2px solid var(--accent); background: var(--wash); font-size: 12px; line-height: 1.8; color: var(--muted); }
.noscript-message { position: fixed; inset: 30% 20px auto; background: var(--surface); border: 1px solid var(--line); padding: 30px; text-align: center; z-index: 5; }
@media (max-width: 600px) {
  .site-header { height: 72px; padding: 0 22px; }
  .brand { font-size: 19px; gap: 10px; }
  .brand-note { margin-left: 10px; font-size: 10px; }
  .header-actions { gap: 15px; }
  .control-label { display: none; }
  main { padding: 0 24px; }
  .book-intro { padding: 40px 0 34px; gap: 24px; }
  .book-mark { flex-basis: 47px; min-height: 95px; font-size: 12px; }
  .book-meta { font-size: 11px; }
  h1 { font-size: 36px; margin-bottom: 8px; }
  .chapter-header { padding: 38px 0 29px; }
  .chapter-header h2 { font-size: 26px; }
  .prose { line-height: 2; letter-spacing: .02em; }
  .site-footer { flex-direction: column; align-items: center; gap: 7px; padding: 32px 24px 120px; }
  .chapter-end { margin: 46px 0 32px; }
  .resume-button { padding: 10px 11px; flex-wrap: wrap; row-gap: 5px; }
  #resume-label { flex-basis: 60%; max-width: 16em; }
}
@media (prefers-reduced-motion: no-preference) {
  button, a { transition: color .15s, background-color .15s; }
}
@media print {
  .site-header, .reading-dock, .chapter-nav, .resume-button, dialog, .skip-link { display: none !important; }
  body { background: white; color: black; }
  .book-intro { padding-top: 0; }
  .prose { font-size: 12pt; }
  .site-footer { padding-bottom: 0; }
}
