:root {
  color-scheme: light;
  --reader-page: #f7f7f3;
  --reader-surface: #fffefa;
  --reader-text: #292e34;
  --reader-muted: #626b74;
  --reader-line: #dedfd9;
  --reader-accent: #28685c;
  --reader-soft: #eaf0eb;
  --reader-code: #eff0ec;
  --reader-keyword: #73579d;
  --reader-string: #28685c;
  --reader-number: #955028;
  --reader-size: 18px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --reader-page: #1c1f24;
  --reader-surface: #22262c;
  --reader-text: #d7dce2;
  --reader-muted: #a0a8b3;
  --reader-line: #3b414a;
  --reader-accent: #91c5b5;
  --reader-soft: #2b3835;
  --reader-code: #282d34;
  --reader-keyword: #c6afe8;
  --reader-string: #a4c6a0;
  --reader-number: #dfb385;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 90px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--reader-page); color: var(--reader-text); font: 16px/1.8 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--reader-accent); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
button, input { font: inherit; }
button, .download { min-height: 44px; }
button { background: var(--reader-surface); color: var(--reader-text); border: 1px solid var(--reader-line); border-radius: 7px; padding: 7px 12px; cursor: pointer; }
button:hover { border-color: var(--reader-accent); }
:focus-visible { outline: 2px solid var(--reader-accent); outline-offset: 4px; }
::selection { background: var(--reader-accent); color: var(--reader-page); }
.skip { position: fixed; z-index: 20; top: -80px; left: 12px; background: var(--reader-surface); padding: 10px 16px; }
.skip:focus { top: 8px; }
.site-header { position: fixed; inset: 0 0 auto; z-index: 10; min-height: 70px; background: var(--reader-page); border-bottom: 1px solid var(--reader-line); display: flex; align-items: center; gap: 14px; padding: 10px 28px; }
.brand { min-width: 0; margin-right: auto; color: var(--reader-text); font-size: 17px; font-weight: 650; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; text-decoration: none; }
.download { display: flex; align-items: center; white-space: nowrap; font-size: 14px; }
#theme { flex-shrink: 0; font-size: 14px; }
#sidebar { position: fixed; inset: 70px auto 0 0; width: 292px; background: var(--reader-surface); border-right: 1px solid var(--reader-line); overflow-y: auto; padding: 26px 22px 36px; }
#contents > summary { list-style: none; font-size: 17px; font-weight: 650; margin-bottom: 16px; cursor: pointer; min-height: 44px; padding-top: 6px; }
#contents > summary::-webkit-details-marker { display: none; }
#contents > summary::after { content: " −"; color: var(--reader-muted); }
#contents:not([open]) > summary::after { content: " ＋"; }
.edition { color: var(--reader-muted); font-size: 13px; margin: 0 0 22px; }
#search-form label { display: block; color: var(--reader-muted); font-size: 14px; margin-bottom: 7px; }
.search-row { display: flex; gap: 6px; }
.search-row input { min-width: 0; width: 100%; border: 1px solid var(--reader-line); background: var(--reader-page); color: var(--reader-text); border-radius: 7px; padding: 8px; font-size: 15px; }
.search-row button { flex-shrink: 0; font-size: 14px; padding-inline: 10px; }
#search-status { font-size: 14px; color: var(--reader-muted); }
#search-results a { display: block; padding: 10px 0; border-bottom: 1px solid var(--reader-line); font-size: 14px; overflow-wrap: anywhere; }
#search-results small { display: block; color: var(--reader-muted); font-size: 12px; }
#sidebar nav { margin-top: 24px; }
#sidebar nav a { display: block; padding: 9px 10px; margin-inline: -10px; color: var(--reader-muted); font-size: 14px; line-height: 1.75; border-radius: 6px; text-decoration: none; overflow-wrap: anywhere; }
#sidebar nav a:hover, #sidebar nav a[aria-current="page"] { color: var(--reader-accent); background: var(--reader-soft); }
#sidebar nav a[aria-current="page"] { font-weight: 650; }
main { min-width: 0; margin: 70px 0 0 292px; padding: 30px clamp(26px, 4.5vw, 76px) 50px; }
.reading-tools, article, .pager, .site-footer { max-width: 820px; margin-inline: auto; }
.reading-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 32px; font-size: 14px; }
.reading-tools > span { margin-right: auto; color: var(--reader-muted); }
.reading-tools button { min-width: 44px; }
.reading-tools a { font-size: 14px; }
article { min-width: 0; font-size: var(--reader-size); line-height: 1.95; overflow-wrap: break-word; }
article h1, article h2, article h3, article h4 { line-height: 1.5; font-weight: 650; scroll-margin-top: 90px; }
article h1 { font-size: clamp(30px, 3.4vw, 43px); margin: 0 0 32px; letter-spacing: -.025em; }
article h2 { font-size: 1.3em; margin-top: 2.2em; }
article h3 { font-size: 1.1em; margin-top: 1.8em; }
article p { margin: 1.2em 0; }
article a, article :not(pre) > code { overflow-wrap: anywhere; }
article li { margin-block: .45em; }
article ul, article ol { padding-left: 1.5em; }
article img, article svg { max-width: 100%; height: auto; }
article code { font: .86em/1.7 "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-variant-ligatures: none; }
article :not(pre) > code { padding: .1em .3em; border-radius: 4px; background: var(--reader-code); }
article pre { max-width: 100%; overflow-x: auto; background: var(--reader-code); border: 1px solid var(--reader-line); border-radius: 8px; padding: 18px; font-size: 16px; line-height: 1.7; white-space: pre; overflow-wrap: normal; tab-size: 4; }
article pre code { color: var(--reader-text); white-space: pre; overflow-wrap: normal; }
article .sourceCode { max-width: 100%; }
.sourceCode .kw, .sourceCode .cf, .sourceCode .dt, .sourceCode .bu, .sourceCode .fu { color: var(--reader-keyword); }
.sourceCode .st, .sourceCode .ch, .sourceCode .vs { color: var(--reader-string); }
.sourceCode .dv, .sourceCode .bn, .sourceCode .fl { color: var(--reader-number); }
.sourceCode .co { color: var(--reader-muted); }
article blockquote { margin-inline: 0; padding: .3em 1em; border-left: 3px solid var(--reader-accent); background: var(--reader-soft); }
.table-wrap { width: 100%; overflow-x: auto; margin-block: 24px; }
table { border-collapse: collapse; min-width: 100%; font-size: .88em; line-height: 1.7; }
th, td { border: 1px solid var(--reader-line); padding: 10px 12px; text-align: left; vertical-align: top; min-width: 100px; overflow-wrap: anywhere; }
th { background: var(--reader-code); }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 28px; align-items: center; }
.eyebrow { font-size: 12px; color: var(--reader-accent); letter-spacing: .12em; }
.hero .subtitle { font-size: 21px; }
.hero .book-stats { color: var(--reader-muted); font-size: 14px; }
.cover { display: block; box-shadow: 8px 14px 28px #1727201a; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.primary, .secondary { display: inline-block; border: 1px solid var(--reader-accent); border-radius: 6px; padding: 10px 16px; min-height: 48px; font-size: 16px; text-decoration: none; }
.primary { background: var(--reader-accent); color: var(--reader-page); }
.chapter-list { margin-block: 24px; }
.chapter-list li { border-bottom: 1px solid var(--reader-line); padding-block: 10px; }
.chapter-list a { text-decoration: none; }
.evidence-links { display: flex; flex-wrap: wrap; gap: 12px; font-size: 14px; }
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; border-top: 1px solid var(--reader-line); padding-top: 24px; margin-top: 56px; font-size: 15px; }
.pager a { min-height: 48px; overflow-wrap: anywhere; }
.pager a:last-child { text-align: right; }
.site-footer { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 44px; padding-top: 20px; color: var(--reader-muted); font-size: 13px; }
.site-footer a { color: var(--reader-muted); }
@media (max-width: 960px) {
  .site-header { padding-inline: 18px; gap: 12px; }
  #sidebar { position: static; width: auto; margin-top: 70px; padding: 12px 20px 0; border-right: 0; border-bottom: 1px solid var(--reader-line); }
  #contents > summary { margin-bottom: 8px; }
  .contents-body { max-height: 65vh; overflow-y: auto; padding: 4px 10px 24px; }
  main { margin: 0; padding: 26px 22px 40px; }
}
@media (max-width: 620px) {
  .site-header { padding-inline: 14px; gap: 10px; }
  .brand { font-size: 15px; }
  .download, #theme { font-size: 13px; }
  #theme { padding-inline: 9px; }
  main { padding-inline: 18px; }
  .hero { grid-template-columns: 1fr; }
  .hero > .cover { width: 150px; grid-row: 1; justify-self: center; }
  .hero h1 { font-size: 32px; }
  .hero .subtitle { font-size: 20px; }
  article pre { padding: 14px; }
  .pager { gap: 18px; }
}
@media print {
  .site-header, #sidebar, .reading-tools, .pager, .site-footer { display: none; }
  main { margin: 0; padding: 0; }
  body { background: white; color: black; }
  article { max-width: none; font-size: 11pt; }
  article pre { white-space: pre-wrap; overflow-wrap: anywhere; }
}
