  :root {
    color-scheme: dark;
    --ink: #080e16;
    --paper: #f2eae0;
    --muted: #c5bbae;
    --gold: #e7bd81;
    --serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", Georgia, serif;
    --sans: "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  }
  html[lang="zh-Hans"] { --serif: "Songti SC", "Noto Serif SC", SimSun, Georgia, serif; --sans: "PingFang SC", system-ui, sans-serif; }
  html[lang="zh-Hant"] { --serif: "Songti TC", "Noto Serif TC", PMingLiU, Georgia, serif; --sans: "PingFang TC", system-ui, sans-serif; }
  html[lang="ko"] { --serif: AppleMyungjo, "Noto Serif KR", Batang, Georgia, serif; --sans: "Apple SD Gothic Neo", system-ui, sans-serif; }
  html[lang="en"] { --serif: Georgia, serif; --sans: system-ui, sans-serif; }

  * { box-sizing: border-box; }
  body { margin: 0; background: var(--ink); color: var(--paper); font-family: var(--sans); }
  button, select { font: inherit; }
  a { color: inherit; text-decoration: none; }
  button { color: inherit; }
  button:not(:disabled), select { cursor: pointer; }
  :focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
  body:has(dialog[open]) { overflow: hidden; }

  .footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.6rem;
  }

  .hall {
    position: relative;
    isolation: isolate;
    display: grid;
    align-items: center;
    min-height: min(44.25rem, calc(100svh - 7.5rem));
    border-bottom: 1px solid #c8ab7a33;
  }
  .hall > .room, .hall::before {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
  }
  .hall > .room { object-fit: cover; object-position: right 49%; }
  .hall::before {
    content: "";
    z-index: 0;
    background: linear-gradient(90deg, #060c17b8 0%, #080e1757 39%, #080e1700 66%),
      linear-gradient(0deg, #080e16d6 0%, #080e1609 42%);
  }
  .hall-inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(13rem, .72fr) minmax(0, 1.9fr);
    align-items: center;
    gap: clamp(2rem, 4vw, 4rem);
    padding-block: clamp(4rem, 8vw, 7.75rem);
  }
  .intro { padding-bottom: 1.35rem; min-width: 0; }
  .preview {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    color: var(--gold);
    font-size: .73rem;
    letter-spacing: .17em;
  }
  .preview::before { content: ""; width: 1.45rem; height: 1px; background: #b8814a; }
  h1 {
    margin: .92rem 0 1.35rem;
    font: 500 clamp(3.5rem, 7.7vw, 7rem)/1.03 var(--serif);
    letter-spacing: .095em;
    text-shadow: 0 8px 35px #000a;
  }
  html[lang="en"] h1 { font-size: clamp(3.05rem, 6.4vw, 6.15rem); letter-spacing: -.045em; }
  html[lang="en"] .hall h1 { font-size: clamp(2.95rem, 5.3vw, 5.75rem); }
  .intro-copy {
    margin: 0;
    max-width: 29rem;
    color: #f1e6d8;
    font: 500 clamp(1.04rem, 1.65vw, 1.35rem)/1.94 var(--serif);
    text-wrap: pretty;
  }
  .app-copy {
    margin: 1.35rem 0 0;
    max-width: 27rem;
    color: var(--muted);
    font-size: .83rem;
    line-height: 1.7;
    text-wrap: pretty;
  }

  .cabinet {
    width: 100%;
    min-width: 0;
    padding: clamp(.95rem, 2.25vw, 1.8rem);
    border: 1px solid #cd9b625c;
    border-radius: 4px;
    background: linear-gradient(135deg, #2a1d14ed, #15151af0 64%, #2a1c14f2);
    box-shadow: 0 22px 70px #0009, inset 0 0 0 3px #090b1038;
  }
  .cabinet-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .55rem;
    margin-bottom: 1.02rem;
  }
  .cabinet-heading h2 {
    margin: 0;
    font: 500 1.5rem/1.25 var(--serif);
    letter-spacing: .095em;
  }
  .cabinet-heading > span { color: #dfc8ab; font-size: .73rem; letter-spacing: .07em; }
  .shelf { position: relative; }
  .volumes {
    position: relative;
    --book-columns: 5;
    --book-gap: clamp(.8rem, 1.6vw, 1.4rem);
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: center;
    gap: clamp(1.55rem, 2.75vw, 2.4rem) var(--book-gap);
    border-radius: 2px 2px 0 0;
    border: 1px solid #7b5433a1;
    border-bottom: 0;
    padding: clamp(1.15rem, 2.2vw, 1.8rem) clamp(.75rem, 1.8vw, 1.5rem) 1.15rem;
    background:
      radial-gradient(ellipse at center bottom, #7f4d2e3d, transparent 72%),
      linear-gradient(100deg, #21160f, #131011 54%, #261710);
    box-shadow: inset 0 10px 26px #000b, inset 0 0 0 2px #09090a3d;
  }
  .shelf-edge {
    height: .85rem;
    border: 1px solid #926439b0;
    background:
      repeating-linear-gradient(0deg, #b7895027 0 1px, #4e2d18a3 1px 3px),
      linear-gradient(#895b35, #503019);
    box-shadow: 0 5px 13px #0007, inset 0 1px #d6ad7559;
  }
  .volume {
    appearance: none;
    width: min(100%, 8.05rem);
    padding: 0;
    border: 0;
    border-radius: 2px;
    background: none;
  }
  .volumes > .volume {
    flex: 0 1 calc((100% - (var(--book-columns) - 1) * var(--book-gap)) / var(--book-columns));
    width: auto;
    min-width: 0;
    max-width: 8.05rem;
  }
  .cover {
    position: relative;
    display: grid;
    place-items: start center;
    width: 100%;
    aspect-ratio: .687;
    padding: .67rem .52rem .62rem .75rem;
    overflow: hidden;
    border: 1px solid var(--cover-edge);
    border-radius: 3px 3px 2px 3px;
    background:
      repeating-linear-gradient(0deg, #ffffff0b 0 1px, transparent 1px 3px),
      repeating-linear-gradient(90deg, #ffffff09 0 1px, transparent 1px 2px),
      linear-gradient(130deg, var(--cloth-light), var(--cloth) 61%, var(--cloth-dark));
    box-shadow: .23rem .27rem 0 -.08rem #c9b184, .35rem .27rem 0 -.07rem #3e3126, .32rem .45rem 1.1rem #000a;
    transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
  }
  [data-cloth="indigo"] { --cloth-light: #3c526e; --cloth: #1c2e46; --cloth-dark: #142131; --cover-edge: #607185; }
  [data-cloth="vermilion"] { --cloth-light: #754638; --cloth: #533126; --cloth-dark: #35201e; --cover-edge: #986a54; }
  .cover::before {
    position: absolute;
    content: "";
    inset: 0 auto 0 0;
    width: .34rem;
    background: linear-gradient(90deg, #ffffff25, #04070b65 70%, transparent);
    box-shadow: 1px 0 #ffffff36;
  }
  .cover::after {
    position: absolute;
    content: "";
    inset: .37rem;
    border: 1px solid #edc88f52;
    pointer-events: none;
  }
  .cover-title {
    display: grid;
    place-items: center;
    min-width: 2.05rem;
    min-height: 72%;
    padding: .44rem .28rem;
    margin-top: .38rem;
    border: 1px solid #ba9567;
    background: linear-gradient(135deg, #eee0b8, #c9b58e);
    color: #2c211a;
    writing-mode: vertical-rl;
    font: 600 clamp(.78rem, 1.35vw, 1.02rem)/1.1 var(--serif);
    letter-spacing: .075em;
    box-shadow: inset 0 0 0 2px #f8e8c377, 0 2px 5px #0005;
  }
  html[lang="en"] .cover-title {
    writing-mode: horizontal-tb;
    min-height: 64%;
    font-size: .86rem;
    line-height: 1.3;
    padding-inline: .32rem;
    letter-spacing: 0;
    text-align: center;
  }
  .cover-number {
    position: absolute;
    right: .72rem;
    bottom: .59rem;
    color: #fff0d4;
    font-size: .55rem;
    letter-spacing: .1em;
  }
  .volume:hover .cover, .volume:focus-visible .cover {
    transform: translateY(-.32rem);
    filter: brightness(1.16);
    box-shadow: .23rem .27rem 0 -.08rem #e8c99c, .35rem .27rem 0 -.07rem #574237, .35rem .75rem 1.2rem #0009;
  }
  footer { background: var(--ink); color: #b8aa98; }
  .footer-inner { min-height: 5.2rem; font-size: .72rem; letter-spacing: .055em; }
  .footer-inner a { padding: .35rem 0; color: #e4c7a1; }
  .footer-inner a:hover { color: var(--paper); }

  .reader {
    --reader-gutter: 2rem;
    position: fixed;
    inset: 0;
    width: min(calc(100% - 2rem), 66rem);
    max-width: none;
    max-height: calc(100dvh - var(--reader-gutter));
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 1px solid #9f784d;
    border-radius: .5rem;
    background: #191911;
    color: var(--paper);
    box-shadow: 0 22px 100px #000c;
  }
  .reader[open] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: min(calc(100dvh - var(--reader-gutter)), 47rem);
  }
  .reader::backdrop { background: #04070ad6; backdrop-filter: blur(6px); }
  .reader-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 1.42rem;
    border-bottom: 1px solid #98744b48;
    background: #211a16;
  }
  .reader-meta {
    display: block;
    margin-bottom: .26rem;
    color: #dabb91;
    font-size: .67rem;
    letter-spacing: .095em;
  }
  .reader-top h2 { margin: 0; font: 500 1.27rem/1.32 var(--serif); text-wrap: pretty; }
  .reader-transcript { color: #e7c692; font-size: .75rem; text-decoration: underline; text-underline-offset: .18em; }
  .reader-close, .page-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    border: 1px solid #ba93635c;
    border-radius: 4px;
    min-height: 2.65rem;
    padding: .4rem .7rem;
    background: #2b241e;
    color: #f4e8d5;
    font-size: .83rem;
  }
  .reader-close { flex: none; min-width: 2.65rem; font: 400 1.55rem/1 var(--sans); }
  .reader-close:hover, .page-button:not(:disabled):hover { background: #514030; border-color: #c59159; }
  .reader-close:focus:not(:focus-visible) { outline: none; }
  .reader-stage {
    container-type: size;
    display: grid;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    place-items: center;
    min-height: 0;
    overflow: hidden;
    padding: clamp(1rem, 3.3vw, 2rem);
    background:
      repeating-linear-gradient(90deg, #5a382621 0 1px, transparent 1px 6px),
      radial-gradient(ellipse at top, #6c4c30, #30231a);
  }
  .book-slot {
    --book-height: min(100cqh, 32rem);
    position: relative;
    width: min(100%, calc(var(--book-height) * 1.5));
    height: var(--book-height);
    margin-inline: auto;
    background: #9a774f;
    box-shadow: -3px 2px #ae926b, 3px 2px #b19b7a, -5px 5px #594029, 5px 5px #594029, 0 11px 22px #170f0cb3;
  }
  .book-slot[data-layout="single"] {
    width: min(100%, calc(var(--book-height) * .72));
    height: min(var(--book-height), 152cqw);
  }
  .book-slot:is([data-view="front"], [data-view="back"]) {
    background: transparent;
    box-shadow: none;
  }
  .page-measure {
    position: absolute;
    inset: 0 auto auto 0;
    visibility: hidden;
    pointer-events: none;
  }
  .page-measure > .leaf { width: 100%; height: 100%; }
  .flip-book { width: 100%; cursor: grab; touch-action: pan-y pinch-zoom; }
  .flip-book:active { cursor: grabbing; }
  .leaf {
    --folio-height: 2rem;
    border: 1px solid #d2b68a;
    background: linear-gradient(90deg, #e7d5b8 0, #f4e8d1 3%, #f7ecd9 87%, #e9d7b5 96%, #c6a781 100%);
    color: #2d231b;
    font-family: "Songti TC", "Noto Serif TC", PMingLiU, "Hiragino Mincho ProN", Georgia, serif;
  }
  .leaf[data-side="right"] {
    background: linear-gradient(90deg, #c6a781 0, #e9d7b5 4%, #f7ecd9 13%, #f4e8d1 97%, #e7d5b8 100%);
  }
  .book-slot[data-layout="single"] .leaf:not(.leaf-binding) {
    background: linear-gradient(90deg, #e9dac0, #f7ecd9 9%, #f7ecd9 96%, #ebd9b8);
  }
  .leaf.leaf-binding {
    border-color: var(--cover-edge);
    background: var(--cloth-dark);
  }
  .leaf-binding .cover {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    aspect-ratio: auto;
    padding: clamp(.8rem, 2.7vw, 2rem);
    border: 0;
    box-shadow: none;
  }
  .leaf-binding .cover::after { inset: 4% 5%; }
  .leaf-binding .cover-title {
    flex: none;
    width: clamp(2.65rem, 16%, 4rem);
    min-height: 60%;
    margin-top: 0;
    padding: .75rem .35rem;
    font-size: clamp(.94rem, 2vw, 1.65rem);
    text-align: center;
    text-wrap: balance;
  }
  html[lang="en"] .leaf-binding .cover-title {
    width: min(78%, 11rem);
    min-height: 42%;
    padding-inline: .75rem;
  }
  .cover-byline {
    max-width: 100%;
    margin-top: clamp(.65rem, 1.4vw, 1.15rem);
    color: #f4e6cc;
    font: 500 clamp(.72rem, 1.3vw, .94rem)/1.5 "Songti TC", "Hiragino Mincho ProN", Georgia, serif;
    text-align: center;
    text-wrap: balance;
  }
  .leaf-binding[data-binding="back"] .cover::before { inset: 0 0 0 auto; }
  .leaf-content {
    height: calc(100% - var(--folio-height));
    padding: 2rem clamp(.85rem, 4.15vw, 2.75rem) .65rem;
    overflow-y: auto;
    touch-action: pan-y pinch-zoom;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #8e7253 transparent;
  }
  .leaf-content:focus-visible { outline-color: #826544; outline-offset: -4px; }
  .leaf-folio {
    position: absolute;
    inset: auto 0 0;
    display: grid;
    place-items: center;
    height: var(--folio-height);
    color: #503727;
    font: 600 .91rem/1 var(--sans);
    font-variant-numeric: tabular-nums;
    pointer-events: none;
  }
  .leaf-heading { margin-bottom: 1.25rem; text-align: center; }
  .leaf-heading h3 { margin: 0; font-size: clamp(1.17rem, 3.3vw, 1.65rem); font-weight: 600; line-height: 1.4; letter-spacing: .06em; }
  .leaf-heading p { margin: .52rem 0 0; color: #594637; font-size: .8rem; line-height: 1.6; }
  .passage { font-size: clamp(.96rem, 2vw, 1.15rem); line-height: 1.94; letter-spacing: .055em; line-break: strict; }
  .passage p { margin: 0 0 .62rem; overflow-wrap: anywhere; }
  .passage p:last-child { margin-bottom: 0; }
  .reader-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: .6rem;
    padding: .86rem 1.42rem;
    border-top: 1px solid #98744b48;
    background: #211a16;
  }
  .page-button:first-child { justify-self: start; }
  .page-button:last-child { justify-self: end; }
  .page-button:disabled { opacity: .49; }
  .page-arrow { color: var(--gold); font: 500 1.22rem/1 Georgia, serif; }
  .reader-progress { display: grid; gap: .2rem; text-align: center; }
  .page-count { color: #f4e6cc; font-size: .98rem; font-weight: 600; font-variant-numeric: tabular-nums; }
  .turn-hint { color: #c2aa89; font-size: .68rem; line-height: 1.3; }

  @media (max-width: 960px) {
    .hall { min-height: auto; }
    .hall-inner { grid-template-columns: 1fr; gap: 2rem; padding-block: 3.5rem 3rem; }
    .hall > .room { object-position: 63% center; }
    .hall::before { background: linear-gradient(0deg, #080e16ef 0%, #080e164c 47%, #080e16c9 100%); }
    .intro { padding: 0; }
    h1 { margin-top: .67rem; margin-bottom: 1rem; }
    .app-copy { margin-top: .85rem; }
  }
  @media (max-width: 680px) {
    .volumes { --book-columns: 3; }
  }
  @media (max-width: 540px) {
    .volumes { --book-columns: 2; }
  }
  @media (max-width: 780px) {
    .footer-inner { gap: .95rem; }
    .leaf-content { padding-inline: clamp(.65rem, 2.75vw, 1.65rem); }
  }
  @media (max-width: 470px) {
    .hall-inner { padding-block: 2.7rem 2.2rem; gap: 1.8rem; }
    .cabinet { padding: 1rem .9rem .92rem; }
    .cabinet-heading h2 { font-size: 1.28rem; }
    .cover-title { min-width: 1.8rem; margin-top: .1rem; font-size: .82rem; }
    .reader { --reader-gutter: 1.1rem; width: calc(100% - 1rem); }
    .reader-top, .reader-nav { padding: .73rem .68rem; }
    .reader-top h2 { font-size: 1.06rem; }
    .reader-stage { padding: .71rem .44rem .86rem; }
    .book-slot { --book-height: min(100cqh, 34rem); }
    .leaf-content { padding: 1.2rem .51rem .55rem; }
    .leaf-heading { margin-bottom: .83rem; }
    .leaf-heading h3 { font-size: 1rem; letter-spacing: .02em; }
    .leaf-heading p { font-size: .65rem; }
    .passage { font-size: .84rem; line-height: 1.76; letter-spacing: .032em; }
    .page-button { font-size: .73rem; padding-inline: .48rem; }
    .page-count { font-size: .83rem; }
    .turn-hint { font-size: .62rem; }
  }
  .book-slot[data-layout="single"] .leaf-content { padding-inline: clamp(1.05rem, 5.2vw, 2rem); }
  .book-slot[data-layout="single"] .passage { font-size: clamp(.94rem, 3.5vw, 1.05rem); }
  @media (max-height: 480px) {
    .reader { --reader-gutter: 1rem; }
    .reader-top, .reader-nav { padding-block: .55rem; }
    .reader-stage { padding-block: .72rem; }
    .book-slot { width: min(100%, max(37rem, calc(var(--book-height) * 1.5))); }
    .book-slot[data-layout="single"] { width: min(100%, max(20rem, calc(var(--book-height) * .72))); }
    .leaf-content { padding-block: .85rem .6rem; }
    .leaf-heading { margin-bottom: .6rem; }
    .leaf-heading h3 { font-size: 1rem; line-height: 1.28; }
    .leaf-heading p { margin-top: .32rem; font-size: .72rem; line-height: 1.4; }
    .leaf-content .pronunciation-guide { margin: .4rem 0 .5rem; font-size: .8rem; }
  }
  @media (prefers-reduced-motion: reduce) { .cover { transition: none; } }

  a.volume { display: inline-flex; text-decoration: none; color: inherit; }
  .passage:lang(en) { letter-spacing: normal; }
  :is(.passage, .transcript-body) :is(p, h2, h4):has(ruby) { line-height: 2.45; }
  :is(.passage, .transcript-body, .pronunciation-guide) ruby {
    ruby-position: over;
    ruby-align: center;
    white-space: nowrap;
  }
  :is(.passage, .transcript-body, .pronunciation-guide) rt {
    color: #614927;
    font: .56em/1.15 var(--sans);
    letter-spacing: 0;
  }
  .passage h4 { margin: 0 0 .45rem; font-weight: 650; }
  .transcript { max-width: 58rem; margin: 0 auto; padding: clamp(1.2rem, 5vw, 3.8rem); color: #372819; background: #f2e7d5; min-height: 76vh; }
  .transcript h1 { color: #362716; margin: .55em 0 .35em; }
  .transcript .back-link { color: #59441e; }
  .edition-detail, .edition-sources { color: #684c2b; font-family: var(--sans); }
  .edition-detail { font-size: .95rem; }
  .transcript-body { line-height: 2.15; overflow-wrap: break-word; }
  .transcript-body p { margin: .7em 0; }
  .transcript-body h2 { margin: 1.5em 0 .3em; font-size: 1.18em; }
  .chapter-list { display: flex; flex-wrap: wrap; gap: .5rem .9rem; margin: 1.1rem 0; padding: .8rem 0; border-top: 1px solid #c3a985; border-bottom: 1px solid #c3a985; }
  .chapter-list a, .edition-sources a { color: #543e21; text-decoration: underline; }
  .inline-reader { display: none; }
  .library-script .inline-reader { display: inline-flex; margin: .9rem 0; }
  .inline-reader a.volume { width: auto; min-width: auto; height: auto; display: inline-block; padding: .38rem .8rem; border: 1px solid #a98b61; border-radius: .25rem; }
  .inline-reader .cover { display: none; }
  .inline-reader a.volume::after { content: attr(data-read-label); }
  .pronunciation-guide { margin: .65rem 0 1rem; color: #614927; }
  .pronunciation-guide summary { width: fit-content; cursor: pointer; }
  .pronunciation-terms {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1rem;
    margin: .6rem 0 0;
    padding: 0;
    list-style: none;
    line-height: 2.2;
  }
  .pronunciation-terms li { max-width: 100%; }
