:root {
  --paper: #eee9dc;
  --paper-light: #faf7ee;
  --ink: #252620;
  --muted: #707269;
  --blue: #285d67;
  --blue-deep: #193d43;
  --line: rgba(37, 38, 32, .17);
  --type-scale: 1;
  color-scheme: light;
  font-family: "Songti SC", STSong, SimSun, serif;
  scroll-behavior: smooth;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 62px; }
body { margin: 0; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
img { display: block; max-width: 100%; }
a { color: inherit; }
.site-view[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 9px 13px; background: white; transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: 8px clamp(20px, 4.6vw, 72px);
  border-bottom: 1px solid rgba(37,38,32,.12);
  background: rgba(238,233,220,.94);
  backdrop-filter: blur(18px) saturate(110%);
}
.brand { font-size: 18px; font-weight: 600; letter-spacing: .24em; text-decoration: none; }
.site-header nav { display: flex; gap: clamp(20px, 3vw, 38px); }
.site-header nav a { position: relative; padding: 7px 0; color: #5f625b; font: 12px/1.2 system-ui, sans-serif; letter-spacing: .08em; text-decoration: none; }
.site-header nav a::after { position: absolute; right: 50%; bottom: 1px; left: 50%; height: 1px; background: var(--blue); content: ""; transition: left .2s ease, right .2s ease; }
.site-header nav a:hover, .site-header nav a:focus-visible, .site-header nav a[aria-current="page"] { color: var(--blue-deep); }
.site-header nav a[aria-current="page"]::after { right: 0; left: 0; }

.reader-section { min-height: calc(100svh - 62px); padding: 0 clamp(8px, 2vw, 28px); color: #eeeae0; background: #18201d; }
.reader-section.cover-mode { padding: 0; color: var(--ink); background: radial-gradient(circle at 50% 38%, #fbf8ef 0, #eee9dc 58%, #e5dfd2 100%); }
.reader-app { position: relative; max-width: 1320px; margin: 0 auto; background: transparent; }
.reader-app.cover-mode { max-width: none; border: 0; background: transparent; box-shadow: none; }
.reader-app.cover-mode .reader-toolbar,
.reader-app.cover-mode .reader-bottom,
.reader-app.cover-mode .progress-track { display: none; }
.reader-toolbar, .reader-bottom {
  position: absolute;
  z-index: 12;
  right: auto;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: max-content;
  max-width: min(92%, 940px);
  margin: 0;
  padding: 8px 9px 8px 15px;
  color: #27302c;
  border: 1px solid rgba(255,255,255,.58);
  border-radius: 999px;
  background: rgba(244,241,232,.78);
  box-shadow: 0 12px 38px rgba(4,10,8,.16), inset 0 1px rgba(255,255,255,.54);
  backdrop-filter: blur(24px) saturate(118%);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px) scale(.985);
  transition: opacity .2s ease, transform .26s cubic-bezier(.2,.8,.2,1);
}
.reader-toolbar { top: 15px; }
.reader-bottom { bottom: 16px; padding-left: 12px; transform: translate(-50%, 8px) scale(.985); }
.reader-app.controls-visible .reader-toolbar,
.reader-app.controls-visible .reader-bottom { opacity: 1; pointer-events: auto; transform: translate(-50%, 0) scale(1); }
@media (hover: hover) and (pointer: fine) {
  .reader-app:not(.cover-mode):has(.book-spread:hover) .reader-toolbar,
  .reader-app:not(.cover-mode):has(.book-spread:hover) .reader-bottom,
  .reader-toolbar:hover,
  .reader-bottom:hover,
  .reader-toolbar:focus-within,
  .reader-bottom:focus-within { opacity: 1; pointer-events: auto; transform: translate(-50%, 0) scale(1); }
}
.reader-location strong, .reader-location span { display: block; }
.reader-location strong { font-size: 15px; font-weight: 500; letter-spacing: .08em; }
.reader-location span { margin-top: 2px; color: #77807b; font: 10px/1.3 system-ui, sans-serif; }
.toolbar-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 7px; }
.toolbar-actions button, .reader-bottom button, .original-controls button {
  padding: 7px 11px;
  color: #33403a;
  border: 1px solid rgba(39,55,48,.12);
  border-radius: 999px;
  background: rgba(255,255,255,.34);
  cursor: pointer;
  font: 12px/1.3 system-ui, sans-serif;
}
.toolbar-actions button:hover, .reader-bottom button:hover { color: #173e43; border-color: rgba(40,93,103,.35); background: rgba(255,255,255,.72); }
.original-controls button:hover { color: white; border-color: #86aeb4; }
.book-stage {
  position: relative;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) 50px;
  align-items: center;
  min-height: calc(100svh - 62px);
  padding: clamp(18px, 2.6vh, 30px) 0;
  background: radial-gradient(circle at 50% 42%, #3c4742, #18201d 72%);
  overflow: hidden;
  perspective: 1800px;
}
.reader-app.cover-mode .book-stage { min-height: calc(100svh - 62px); padding: clamp(22px, 4vh, 46px) 0; background: transparent; }
.book-spread { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(100%, 1050px, calc((100svh - 102px) * 1.3333)); margin: auto; filter: drop-shadow(0 21px 34px rgba(0,0,0,.38)); transform-style: preserve-3d; will-change: transform, opacity; }
.book-spread.is-solo { grid-template-columns: minmax(0, 510px); width: min(100%, 510px, calc((100svh - 102px) * .6667)); justify-content: center; }
.reader-app.cover-mode .book-spread.is-cover { grid-template-columns: minmax(0, 468px); width: min(70vw, 468px, calc((100svh - 112px) * .739)); filter: drop-shadow(16px 30px 38px rgba(43,37,26,.24)); perspective: 1500px; }
.page-turn-ghost { position: absolute; z-index: 6; margin: 0; pointer-events: none; transform-origin: center; }
.book-page {
  position: relative;
  width: 100%;
  min-width: 0;
  aspect-ratio: 2 / 3;
  color: #171812;
  background: linear-gradient(90deg, rgba(80,67,44,.045), transparent 7%), radial-gradient(circle at 1px 1px, rgba(70,62,49,.035) 1px, transparent 1.1px) 0 0 / 18px 18px, #f8f4ea;
  container-type: size;
  overflow: hidden;
}
.book-page + .book-page { border-left: 1px solid rgba(58,52,42,.2); background: linear-gradient(270deg, rgba(80,67,44,.045), transparent 7%), #f8f4ea; }
.book-page.cover-page { --book-depth: 12px; z-index: 1; aspect-ratio: 105 / 142; border: 0; border-radius: 1px 3px 3px 1px; background: transparent; box-shadow: none; cursor: e-resize; overflow: visible; transform: rotateY(-3.6deg) rotateX(.35deg); transform-style: preserve-3d; transition: transform .32s cubic-bezier(.2,.8,.2,1); }
.book-page.cover-page .page-content { z-index: 4; border: 2px solid rgba(35,46,43,.28); border-radius: 1px 3px 3px 1px; background: #eee8d9; box-shadow: 0 18px 32px rgba(52,43,28,.16), inset -2px 0 rgba(255,255,255,.22); transform: translateZ(var(--book-depth)); }
.cover-back { position: absolute; z-index: 0; inset: 3px -14px -7px 6px; border: 1.5px solid rgba(31,42,39,.5); border-radius: 1px 4px 5px 1px; background: #506b6d; box-shadow: 11px 17px 24px rgba(55,44,26,.2); transform: translateZ(-2px); }
.cover-page-block { position: absolute; z-index: 2; display: block; overflow: hidden; background-color: #eee5d2; box-shadow: inset 0 0 7px rgba(71,58,36,.18); }
.cover-page-block::after { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(91,76,50,.18) 2px 3px); content: ""; opacity: .62; }
.cover-page-block-right { top: 5px; right: calc(-1 * var(--book-depth)); bottom: -2px; width: calc(var(--book-depth) + 2px); border-radius: 0 3px 4px 0; background: linear-gradient(90deg, #c8bda6, #f5eddb 34%, #d2c6ae 90%); transform: skewY(-.55deg); transform-origin: left center; }
.cover-page-block-bottom { right: -5px; bottom: -7px; left: 6px; height: 8px; border-radius: 0 0 3px 2px; background: linear-gradient(180deg, #f8f0dd, #cec2aa); transform: skewX(-12deg); transform-origin: left top; }
.cover-page-block-bottom::after { background: repeating-linear-gradient(90deg, transparent 0 3px, rgba(91,76,50,.15) 3px 4px); }
.book-page.cover-page:hover { transform: rotateY(-2.4deg) rotateX(.25deg) translateY(-3px); }
.book-page.cover-page:focus-visible { outline: 3px solid var(--blue); outline-offset: 5px; }
.page-content { position: absolute; inset: 0; overflow: hidden; }

/* Every normal book page now shares one typographic grid. OCR box height never controls type size. */
.page-flow { position: absolute; top: 6.5cqh; right: 9.5%; bottom: 6.8cqh; left: 9.5%; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.page-flow.has-notes { bottom: calc(15.2cqh + var(--note-count) * 2.35cqh); }
.flow-unit { flex: 0 0 auto; }
.flow-stanza { width: max-content; max-width: 100%; margin: .62cqh auto 0; }
.flow-line { margin: 0; font-size: calc(2.16cqh * var(--type-scale)); font-weight: 400; line-height: 1.38; white-space: nowrap; }
.flow-line.flow-title { font-family: "Heiti SC", STHeiti, "Noto Sans CJK SC", sans-serif; font-size: calc(2.48cqh * var(--type-scale)); font-weight: 600; letter-spacing: .045em; text-align: center; }
.flow-line.flow-subtitle { font-family: "Songti SC", STSong, SimSun, serif; font-size: calc(2.24cqh * var(--type-scale)); font-weight: 500; letter-spacing: .035em; }
.flow-line.flow-title-continuation { margin-top: .28cqh; }
.flow-line.flow-part { font-family: "Songti SC", STSong, SimSun, serif; font-size: calc(2.16cqh * var(--type-scale)); font-weight: 400; letter-spacing: .03em; }
.flow-part-unit { width: 100%; margin-top: .9cqh; }
.flow-line.flow-part { display: block; width: 100%; text-align: center; }
.flow-line.flow-section-title { font-family: "Kaiti SC", STKaiti, KaiTi, serif; font-size: calc(2.78cqh * var(--type-scale)); font-weight: 700; letter-spacing: .42em; }
.flow-line.section-start { margin-top: 1.1cqh; }
.verse-flow .flow-body { text-align: left; }
.ci-flow .flow-stanza { width: 100%; margin-top: .45cqh; }
.ci-flow .flow-line.flow-body { line-height: 1.48; white-space: normal; }
.couplet-flow .flow-unit { width: 100%; }
.couplet-flow .flow-stanza { width: 100%; margin: .72cqh 0 0; }
.couplet-flow .flow-line.flow-title:not(.flow-section-title) {
  font-family: "Heiti SC", STHeiti, "Noto Sans CJK SC", sans-serif;
  font-weight: 700;
  text-align: left;
}
.couplet-flow .flow-line.flow-section-title {
  font-family: "Heiti SC", STHeiti, "Noto Sans CJK SC", sans-serif;
  font-size: calc(3.18cqh * var(--type-scale));
  font-weight: 700;
  letter-spacing: .9em;
  text-indent: .9em;
  text-align: center;
}
.couplet-flow .flow-body { line-height: 1.45; text-align: left; }
.couplet-flow .flow-pair-start { margin-top: 2.4cqh; }
.prose-flow { display: block; }
.prose-flow .flow-line { font-size: calc(1.94cqh * var(--type-scale)); line-height: 1.5; text-align: left; white-space: normal; }
.prose-flow .flow-title { font-family: "Heiti SC", STHeiti, "Noto Sans CJK SC", sans-serif; font-size: calc(2.22cqh * var(--type-scale)); text-align: center; }
.grammar-flow { font-size: calc(1.43cqh * var(--type-scale)); line-height: 1.42; }
.grammar-flow .flow-title { margin-bottom: .65cqh; }
.grammar-paragraph { margin: 0 0 .72cqh; text-indent: 2em; }
.grammar-examples { margin: .35cqh 0 .78cqh; }
.grammar-row { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.grammar-words span { text-decoration: underline; text-underline-offset: .28em; }
.grammar-roles { margin: .2cqh 0 .42cqh; font-size: .78em; }
.page-notes { position: absolute; right: 9.5%; bottom: 5.2cqh; left: 9.5%; padding-top: .9cqh; border-top: 1.6px solid rgba(22,23,19,.88); font-size: calc(1.32cqh * var(--type-scale)); line-height: 1.38; }
.page-notes p { margin: 0 0 .26em; text-align: left; }
.note-marker { margin-left: .08em; font-size: .55em; line-height: 0; vertical-align: .65em; }
.book-page[data-printed-page="6"] .page-flow,
.book-page[data-printed-page="11"] .page-flow,
.book-page[data-printed-page="13"] .page-flow,
.book-page[data-printed-page="14"] .page-flow { justify-content: flex-start; }
.book-page[data-printed-page="6"] .flow-unit + .flow-unit,
.book-page[data-printed-page="11"] .flow-unit + .flow-unit,
.book-page[data-printed-page="13"] .flow-unit + .flow-unit,
.book-page[data-printed-page="14"] .flow-unit + .flow-unit { margin-top: 2.15cqh; }
.book-page[data-printed-page="6"] .flow-stanza,
.book-page[data-printed-page="11"] .flow-stanza,
.book-page[data-printed-page="13"] .flow-stanza,
.book-page[data-printed-page="14"] .flow-stanza { margin-top: .88cqh; }
.book-page[data-printed-page="6"] .flow-line,
.book-page[data-printed-page="11"] .flow-line,
.book-page[data-printed-page="13"] .flow-line,
.book-page[data-printed-page="14"] .flow-line { line-height: 1.5; }

/* Page 44 opens the couplet section with three deliberately separated levels. */
.book-page[data-printed-page="44"] .page-flow { top: 6.8cqh; right: 13%; bottom: 16.8cqh; left: 13%; justify-content: flex-start; }
.book-page[data-printed-page="44"] .flow-unit { width: 100%; }
.book-page[data-printed-page="44"] .flow-unit:nth-child(1) .flow-title {
  font-family: "Heiti SC", STHeiti, "Noto Sans CJK SC", sans-serif;
  font-size: calc(4.05cqh * var(--type-scale));
  font-weight: 700;
  letter-spacing: 2em;
  text-indent: 2em;
}
.book-page[data-printed-page="44"] .flow-unit:nth-child(2) { margin-top: 9.2cqh; }
.book-page[data-printed-page="44"] .flow-unit:nth-child(2) .flow-title {
  font-size: calc(3.35cqh * var(--type-scale));
  font-weight: 700;
  letter-spacing: 1.5em;
  text-indent: 1.5em;
}
.book-page[data-printed-page="44"] .flow-unit:nth-child(3) { margin-top: 6.3cqh; }
.book-page[data-printed-page="44"] .flow-unit:nth-child(3) .flow-title {
  font-size: calc(2.85cqh * var(--type-scale));
  font-weight: 700;
  letter-spacing: .09em;
}
.book-page[data-printed-page="44"] .flow-stanza { width: 72%; margin: 3.7cqh 0 0 5%; }
.book-page[data-printed-page="44"] .flow-body { font-size: calc(2.52cqh * var(--type-scale)); line-height: 1.45; }
.book-page[data-printed-page="44"] .flow-stanza .flow-body:nth-child(2n + 3) { margin-top: 2.15cqh; }
.book-page[data-printed-page="44"] .page-notes { right: 13%; left: 13%; }

/* Page 57 is a continuous run of couplets: only the section name is a heading. */
.book-page[data-printed-page="57"] .page-flow { top: 6.8cqh; right: 12.5%; bottom: 7.2cqh; left: 12.5%; justify-content: flex-start; }
.book-page[data-printed-page="57"] .flow-unit { width: 100%; }
.book-page[data-printed-page="57"] .flow-section-title {
  font-family: "Heiti SC", STHeiti, "Noto Sans CJK SC", sans-serif;
  font-size: calc(3.3cqh * var(--type-scale));
  font-weight: 700;
  letter-spacing: 1.18em;
  text-indent: 1.18em;
}
.book-page[data-printed-page="57"] .flow-stanza { width: 100%; margin: 7.4cqh 0 0; }
.book-page[data-printed-page="57"] .flow-body {
  font-family: "Songti SC", STSong, SimSun, serif;
  font-size: calc(2.43cqh * var(--type-scale));
  font-weight: 400;
  line-height: 1.42;
  text-align: left;
}
.book-page[data-printed-page="57"] .flow-body:nth-child(2n + 3) { margin-top: 2.15cqh; }
.printed-page-number { position: absolute; z-index: 2; bottom: 3.2%; left: 0; width: 100%; color: #33342d; font-size: 1.45cqh; letter-spacing: .3em; text-align: center; }

.page-art { position: absolute; inset: 5%; display: grid; place-items: center; }
.page-art img { width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.page-art.cover-art { inset: 0; }
.page-art.cover-art img { position: relative; z-index: 1; height: 100%; object-fit: cover; mix-blend-mode: normal; }
.cover-page .page-art.cover-art img { filter: brightness(1.18) contrast(.96) saturate(1.04); }
.cover-corner-repair {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  width: 7.62%;
  height: 7.61%;
  background: url("./images/cover-restored-v2.jpg") no-repeat 68.04% 0 / 1312.5% 1314.8%;
  filter: brightness(1.18) contrast(.96) saturate(1.04);
  pointer-events: none;
}
.title-page { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; }
.title-calligraphy { width: 68%; height: 19cqh; margin-top: 22cqh; object-fit: contain; }
.title-subtitle { margin: 2.2cqh 0 0; color: #000; font: 600 2.28cqh/1.2 "Heiti SC", STHeiti, "Noto Sans CJK SC", sans-serif; letter-spacing: .13em; }
.title-publisher { width: auto; height: auto; margin: auto 0 10cqh; color: #000; font: 600 1.9cqh/1.2 "Kaiti SC", STKaiti, KaiTi, serif; letter-spacing: .19em; white-space: nowrap; }
.calligraphy-page { position: absolute; inset: 6.2%; display: grid; padding: 3.8%; border: 2.2px solid #111; place-items: center; }
.calligraphy-page img { width: 100%; height: 100%; object-fit: contain; }

.frontmatter-page { position: absolute; inset: 0; padding: 7.4cqh 11.5% 6.8%; }
.frontmatter-title { margin: 0 0 4.4cqh; font: 700 2.52cqh/1.2 "Heiti SC", STHeiti, "Noto Sans CJK SC", sans-serif; letter-spacing: .44em; text-align: center; }
.preface-copy, .foreword-copy { font-size: calc(2.05cqh * var(--type-scale)); line-height: 1.61; text-align: justify; }
.preface-copy p, .foreword-copy p { margin: 0 0 .72em; text-indent: 2em; }
.preface-copy .preface-thanks { margin-bottom: .72em; }
.preface-signature { margin-top: .35em; padding-right: 2%; font-size: 1.52cqh; text-align: right; }
.foreword-page { padding-top: 7.4cqh; }
.foreword-page.foreword-1 .frontmatter-title { margin-bottom: 5.7cqh; }
.foreword-byline { margin: 0 0 3.5cqh; font: 600 1.72cqh/1.4 "Heiti SC", STHeiti, "Noto Sans CJK SC", sans-serif; text-align: center; }
.foreword-page:not(.foreword-1) { padding-top: 7.8cqh; }
.contents-page { padding: 7.4cqh 12.5% 7%; }
.contents-page .frontmatter-title { margin-bottom: 3.5cqh; }
.contents-list { display: grid; gap: .48cqh; margin: 0; padding: 0; font-size: 2.08cqh; line-height: 1.35; list-style: none; }
.contents-row { display: grid; grid-template-columns: max-content 1fr max-content; align-items: end; gap: .45em; }
.contents-row::after { grid-column: 2; grid-row: 1; margin-bottom: .27em; border-bottom: .14em dotted currentColor; content: ""; opacity: .7; }
.contents-row .contents-name { grid-column: 1; }
.contents-row .contents-page-number, .contents-row .contents-author { grid-column: 3; }
.contents-row .contents-author { font-weight: 600; }
.page-art.author-art { inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4.3cqh; padding: 7.8cqh 13% 7%; }
.page-art.author-art img { width: 49%; height: 35cqh; border: 1px solid rgba(38,34,27,.28); object-fit: cover; object-position: 50% 30%; mix-blend-mode: normal; }
.page-art.author-art p { margin: 0; font-size: 1.86cqh; line-height: 1.82; text-align: justify; text-indent: 2em; }
.page-art.blank-art { color: #a29e92; font-size: 2.1cqh; letter-spacing: .2em; }
.empty-page-text { position: absolute; top: 48%; width: 100%; margin: 0; color: #8f8c83; text-align: center; }

.turn-button { z-index: 4; width: 36px; height: 62px; margin: auto; padding: 0; color: #e0e5e1; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; background: rgba(0,0,0,.1); cursor: pointer; font: 29px/1 system-ui, sans-serif; }
.turn-button:hover:not(:disabled) { border-color: #8cb1b6; background: rgba(64,105,112,.28); }
.turn-button:active:not(:disabled) { transform: scale(.93); }
.turn-button:disabled { opacity: .17; cursor: default; }
.mobile-tap-zone { display: none; }
.reader-app.cover-mode .turn-button { color: #44534d; border-color: rgba(37,38,32,.21); background: rgba(255,255,255,.28); }
.reader-app.cover-mode .turn-button:hover:not(:disabled) { color: var(--blue-deep); border-color: rgba(40,93,103,.5); background: rgba(255,255,255,.7); }
.reader-app.cover-mode .turn-button.previous { visibility: hidden; }
.reader-bottom { color: #67716c; font: 11px/1.4 system-ui, sans-serif; }
.page-jump { display: flex; align-items: center; gap: 7px; }
.page-jump input { width: 68px; padding: 7px 9px; color: #26312c; border: 1px solid rgba(39,55,48,.15); border-radius: 999px; background: rgba(255,255,255,.5); }
.original-controls button { color: #dce1dd; border-color: rgba(255,255,255,.18); border-radius: 2px; background: transparent; }
.original-controls .page-jump input { color: white; border-color: rgba(255,255,255,.18); border-radius: 2px; background: #252c29; }
.progress-track { position: absolute; z-index: 13; right: 0; bottom: 0; left: 0; height: 2px; background: rgba(255,255,255,.06); }
.progress-track span { display: block; width: 0; height: 100%; background: #739ba2; transition: width .2s ease; }

.section-title-row { display: flex; align-items: end; justify-content: space-between; gap: 20px; max-width: 1240px; margin: 0 auto 24px; }
.section-title-row h2 { margin: 0; font-size: clamp(28px, 4vw, 44px); font-weight: 400; letter-spacing: .08em; }
.section-title-row > span { color: var(--muted); font: 12px/1.4 system-ui, sans-serif; }
.original-section { min-height: calc(100svh - 62px); padding: clamp(38px, 6vw, 74px) clamp(14px, 5vw, 76px); background: var(--paper); }
.original-viewer { max-width: 1240px; margin: 0 auto; color: #e8ece9; background: #171b1a; box-shadow: 0 24px 66px rgba(41,37,28,.18); }
.original-stage { display: grid; grid-template-columns: 50px minmax(0, 1fr) 50px; align-items: center; min-height: min(76svh, 880px); background: #101312; }
.original-stage > button { width: 36px; height: 62px; margin: auto; color: white; border: 1px solid rgba(255,255,255,.17); border-radius: 999px; background: transparent; cursor: pointer; font-size: 28px; }
.original-stage > button:disabled { opacity: .2; }
.original-image-wrap { --original-inset: 16px; position: relative; height: min(71svh, 820px); overflow: hidden; overscroll-behavior: contain; }
.original-image-wrap img { position: absolute; inset: var(--original-inset); display: block; width: calc(100% - 2 * var(--original-inset)); max-width: none; height: calc(100% - 2 * var(--original-inset)); max-height: none; object-fit: contain; cursor: zoom-in; }
.original-image-wrap.is-zoomed { display: block; overflow: auto; }
.original-image-wrap.is-zoomed img { position: static; width: max(140%, 1180px); max-width: none; height: auto; max-height: none; margin: var(--original-inset); cursor: zoom-out; }
.original-image-wrap p { color: #aeb7b2; }
.original-controls { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 17px; border-top: 1px solid rgba(255,255,255,.09); color: #9fa9a3; font: 11px/1.4 system-ui, sans-serif; }
.original-actions { display: flex; gap: 8px; }

.origin-section { display: grid; min-height: calc(100svh - 62px); padding: 80px 24px; color: #f0eee5; background: var(--blue-deep); place-content: center; text-align: center; }
.origin-section h2 { margin: 0 0 32px; color: #b9cfd0; font-size: 14px; font-weight: 400; letter-spacing: .35em; }
.origin-section blockquote { margin: 0 auto 27px; font: 400 clamp(38px, 6vw, 76px)/1.25 "Kaiti SC", STKaiti, KaiTi, serif; }
.origin-section p { max-width: 650px; margin: 0 auto; color: #c9d5d4; font-size: 15px; line-height: 1.9; }
body > footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px clamp(18px, 5vw, 72px); color: #939b96; background: #171b1a; font: 11px/1.5 system-ui, sans-serif; }
body[data-view="reader"] > footer, body[data-view="original"] > footer { display: none; }

dialog { color: var(--ink); }
dialog::backdrop { background: rgba(14,18,17,.72); backdrop-filter: blur(5px); }
.panel-dialog { width: min(680px, calc(100vw - 28px)); max-height: 82svh; padding: 0; border: 0; background: var(--paper-light); box-shadow: 0 28px 80px rgba(0,0,0,.35); }
.dialog-head { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 20px 23px 14px; border-bottom: 1px solid var(--line); background: rgba(250,247,238,.95); }
.dialog-head h2 { margin: 0; font-size: 28px; font-weight: 500; }
.dialog-head button { padding: 8px 12px; border: 1px solid var(--line); background: transparent; cursor: pointer; }
#toc-list { padding: 7px 23px 26px; }
.toc-item { display: grid; grid-template-columns: 1fr auto; gap: 18px; width: 100%; padding: 16px 2px; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; text-align: left; }
.toc-item span { color: var(--muted); font: 12px/1.5 system-ui, sans-serif; }
.search-field { display: block; padding: 20px 23px 12px; }
.search-field input { width: 100%; padding: 13px 15px; border: 1px solid var(--line); background: white; font-size: 17px; }
.search-results { max-height: 52svh; padding: 0 23px 23px; overflow: auto; }
.search-result { display: block; width: 100%; padding: 15px 0; border: 0; border-top: 1px solid var(--line); background: transparent; cursor: pointer; text-align: left; }
.search-result strong, .search-result span { display: block; }
.search-result strong { margin-bottom: 6px; color: var(--blue-deep); }
.search-result span { color: #565a52; line-height: 1.6; }
.search-empty { padding: 28px 0; color: var(--muted); text-align: center; }

@media (max-width: 920px) {
  .book-spread, .book-spread.is-solo { grid-template-columns: minmax(0, 510px); width: min(100%, 510px, calc((100svh - 92px) * .6667)); justify-content: center; }
  .book-page:nth-child(2) { display: none; }
  .flow-line { font-size: max(calc(11.8px * var(--type-scale)), calc(2.16cqh * var(--type-scale))); }
  .flow-line.flow-title { font-size: max(calc(13px * var(--type-scale)), calc(2.48cqh * var(--type-scale))); }
  .flow-line.flow-section-title { font-size: max(calc(14px * var(--type-scale)), calc(2.78cqh * var(--type-scale))); }
  .prose-flow .flow-line { font-size: max(calc(10.8px * var(--type-scale)), calc(1.94cqh * var(--type-scale))); }
  .prose-flow .flow-title { font-size: max(calc(12px * var(--type-scale)), calc(2.22cqh * var(--type-scale))); }
  .preface-copy, .foreword-copy { font-size: max(calc(11.6px * var(--type-scale)), calc(2.05cqh * var(--type-scale))); }
  .contents-list { font-size: max(11.7px, 2.08cqh); }
  .page-notes { font-size: max(calc(7.8px * var(--type-scale)), calc(1.32cqh * var(--type-scale))); }
}

@media (max-width: 720px) {
  html { scroll-padding-top: 48px; }
  .site-header { min-height: 48px; padding: 4px 12px; }
  .brand { font-size: 15px; }
  .site-header nav { gap: 14px; }
  .site-header nav a { padding-block: 6px; font-size: 10.5px; }
  .reader-section { min-height: calc(100svh - 48px); padding-inline: 0; }
  .reader-toolbar, .reader-bottom { right: auto; left: 50%; width: calc(100% - 18px); max-width: none; }
  .reader-toolbar { top: 6px; align-items: start; padding-inline: 12px 8px; }
  .reader-bottom { bottom: 7px; }
  .toolbar-actions { max-width: 60%; }
  .toolbar-actions button { padding: 7px 8px; font-size: 11px; }
  .book-stage { grid-template-columns: minmax(0, 1fr); align-items: start; min-height: calc(100svh - 48px); padding: 4px 2px 0; touch-action: pan-y; }
  .book-spread, .book-spread.is-solo { width: min(calc(100% - 4px), 510px, calc((100svh - 54px) * .6667)); margin: 0 auto; }
  .reader-app.cover-mode .book-stage { align-items: center; min-height: calc(100svh - 48px); padding-block: 8px; }
  .reader-app.cover-mode .book-spread.is-cover { width: min(90vw, calc((100svh - 68px) * .739)); margin: auto; }
  .book-page.cover-page { --book-depth: 8px; transform: rotateY(-2.8deg) rotateX(.25deg); }
  .book-page.cover-page .cover-page-block-bottom { bottom: -5px; height: 6px; }
  .book-stage > .turn-button { display: none; }
  .mobile-tap-zone { position: absolute; z-index: 7; top: 0; bottom: 0; display: block; width: 20%; padding: 0; border: 0; background: transparent; opacity: 0; touch-action: pan-y; }
  .mobile-tap-zone-previous { left: 0; }
  .mobile-tap-zone-next { right: 0; }
  .reader-bottom { display: block; }
  .reader-bottom > span { display: none; }
  .page-jump { justify-content: end; }
  .original-section { min-height: calc(100svh - 48px); padding-inline: 0; }
  .original-section > .section-title-row { padding-inline: 16px; }
  .original-stage { grid-template-columns: 29px minmax(0, 1fr) 29px; min-height: 68svh; }
  .original-stage > button { width: 25px; height: 46px; font-size: 21px; }
  .original-image-wrap { --original-inset: 8px; height: 68svh; }
  .original-controls { display: block; }
  .original-actions { margin-bottom: 12px; }
  .original-controls .page-jump { justify-content: start; }
  body > footer { display: block; }
  body > footer span { display: block; }
  body > footer span + span { margin-top: 5px; }
}

@media (max-width: 430px) {
  .site-header nav { gap: 13px; }
  .site-header nav a { font-size: 10px; letter-spacing: .03em; }
  .reader-location span { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .book-spread { width: 100%; }
  .book-page[data-printed-page="30"] .flow-line { font-size: calc(2.02cqh * var(--type-scale)); }
  .book-page[data-printed-page="41"] .flow-line,
  .book-page[data-printed-page="42"] .flow-line,
  .book-page[data-printed-page="43"] .flow-line { font-size: calc(1.78cqh * var(--type-scale)); line-height: 1.4; }
  .book-page[data-printed-page="41"] .flow-title,
  .book-page[data-printed-page="42"] .flow-title,
  .book-page[data-printed-page="43"] .flow-title { font-size: calc(2.1cqh * var(--type-scale)); }
  .book-page[data-printed-page="108"] .prose-flow .flow-line { font-size: calc(1.84cqh * var(--type-scale)); line-height: 1.3; }
  .book-page[data-printed-page="108"] .prose-flow .flow-title { font-size: calc(1.98cqh * var(--type-scale)); }
}

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