:root {
  color-scheme: light;
  --paper: #fbf7ef;
  --cream: #f5ebdc;
  --line: #e0d1be;
  --ink: #281e19;
  --muted: #66564b;
  --red: #862d25;
  --wine: #561d19;
  --gold: #e9c595;
  --serif: "Songti SC", "Noto Serif SC", SimSun, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.65 var(--sans); }
body:has(dialog[open]) { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .38; cursor: default; }
:focus-visible { outline: 3px solid #b65c2b; outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
.shell { width: min(100% - 3rem, 1120px); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner {
  width: min(100% - 3rem, 1120px);
  min-height: 68px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
}
.brand, nav { display: flex; align-items: center; }
.brand { gap: .65rem; font: 700 1.28rem/1.1 var(--serif); letter-spacing: .08em; white-space: nowrap; }
.brand img { display: block; border-radius: 4px; }
nav { gap: clamp(.35rem, 2vw, 1.4rem); font-size: .94rem; }
nav a, .subtle { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: .5rem .55rem; }
nav a[aria-current] { color: var(--red); text-decoration: underline; text-underline-offset: .42rem; }
.subtle { border: 0; background: transparent; color: inherit; }
.count { margin-left: .25rem; color: var(--red); font-size: .78rem; }
.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  align-items: center;
  min-height: 490px;
  margin-top: 2rem;
  padding: clamp(2.1rem, 6vw, 5rem) clamp(2.1rem, 7vw, 6rem);
  overflow: hidden;
  color: #fff4e3;
  background:
    radial-gradient(ellipse at 83% 49%, #8e3d2f 0, transparent 55%),
    linear-gradient(135deg, #421814, #681f1f);
}
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: -10%;
  top: -34%;
  width: 65%;
  aspect-ratio: 1;
  border: 1px solid #e9c59538;
  border-radius: 50%;
  box-shadow: 0 0 0 26px #561d1900, 0 0 0 27px #e9c59526, 0 0 0 55px #561d1900, 0 0 0 56px #e9c59523;
}
.edition { font-size: .91rem; color: var(--gold); letter-spacing: .22em; }
.hero h1 { font: 700 clamp(3rem, 6.2vw, 5.6rem)/1.12 var(--serif); letter-spacing: .035em; margin: .45em 0 .29em; }
.hero-note { color: #eed4bd; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: .6rem 1rem;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: .94rem;
  white-space: nowrap;
}
.button.primary { background: var(--red); color: white; border-color: var(--red); }
.hero-button {
  padding-inline: 1.7rem;
  margin-top: 1.6rem;
  background: #fae5c7;
  border-color: #fae5c7;
  color: #541c16;
  font-weight: 650;
}
.book {
  display: block;
  align-self: center;
  justify-self: center;
  width: min(100%, 306px);
  transform: rotate(-5deg);
  background: #f6ecd9;
  box-shadow: 5px 4px 0 #daccb4, 8px 7px 0 #b9a48d, 25px 27px 55px #1c0709a8;
  transition: transform 180ms ease;
}
.book img { display: block; width: 100%; height: auto; }
@media (hover: hover) {
  .book:hover { transform: rotate(-3deg) translateY(-3px); }
  .button:not(:disabled):hover, .subtle:hover, .text-link:hover { filter: brightness(.92); }
}
.chapter-section { padding-top: 2.4rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; margin-bottom: .7rem; }
.section-head h1, .section-head h2 { font: 700 clamp(1.7rem, 3.5vw, 2.4rem)/1.25 var(--serif); }
.text-link { color: var(--red); font-size: .94rem; min-height: 44px; display: inline-flex; align-items: center; }
.chapters { display: grid; grid-template-columns: 1fr 1fr; column-gap: 2rem; }
.chapter { display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: center; min-height: 68px; border-top: 1px solid var(--line); }
.chapter:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
.chapter:hover, .tile:hover { background: var(--cream); }
.chapter strong { font: 700 1.22rem var(--serif); }
.chapter span { color: var(--muted); font-size: .9rem; }
.chapter .range, .page-position { font-size: .87rem; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.footer { padding-block: 2rem 1.4rem; color: var(--muted); text-align: center; font-size: .83rem; }
.footer span { margin-inline: .33rem; }
.reader { width: min(100% - 2rem, 680px); }
.reader-heading { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .6rem; margin-block: .7rem .35rem; }
.reader-heading h1 { font: 700 clamp(1.2rem, 3.5vw, 1.65rem)/1.35 var(--serif); text-align: center; }
.reader-heading .page-position { justify-self: end; }
.sheet {
  position: relative;
  display: block;
  width: min(100%, 600px, calc((100svh - 210px) * .8077));
  min-width: min(100%, 350px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  background: #fffaf1;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px #52291813;
  touch-action: pan-y pinch-zoom;
}
.sheet img { display: block; width: 100%; height: auto; aspect-ratio: 21 / 26; }
.zoom-label { position: absolute; bottom: .55rem; right: .55rem; padding: .3rem .7rem; color: #fff9ec; background: #433126e8; border-radius: 3px; font-size: .86rem; }
.reader-controls {
  position: sticky;
  z-index: 2;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .4rem;
  padding: .75rem 0 max(.55rem, env(safe-area-inset-bottom));
  background: var(--paper);
}
.reader-controls .button { padding-inline: .25rem; }
.reader .button[aria-pressed="true"] { color: var(--red); background: var(--cream); border-color: #b67863; }
.reader-options { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .35rem .8rem; }
.reader-tip { color: var(--muted); text-align: center; font-size: .88rem; }
.continuous { width: min(100%, 600px); margin-inline: auto; }
.continuous-page { scroll-margin-top: .75rem; margin: 0 0 1.35rem; }
.continuous-page .sheet { width: 100%; min-width: 0; }
.continuous-page figcaption { padding: .35rem .05rem; color: var(--muted); font-size: .86rem; }
.is-continuous .reader-panel {
  position: fixed;
  z-index: 2;
  inset: auto 0 0;
  padding: 0 max(.75rem, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(.75rem, env(safe-area-inset-left));
  background: var(--paper);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 18px #52291814;
}
.is-continuous .reader-controls, .is-continuous .reader-options { width: min(100%, 680px); margin-inline: auto; }
.is-continuous .reader-controls { position: static; padding: .45rem 0 0; }
.is-continuous .reader-options { justify-content: space-between; gap: .35rem; }
.is-continuous .reader-options .button { min-height: 44px; padding-block: .35rem; border-color: transparent; }
body:has(.is-continuous) .footer { padding-bottom: calc(7.5rem + env(safe-area-inset-bottom)); }
body:has(.is-continuous) .notice { bottom: calc(7rem + env(safe-area-inset-bottom)); }
.collection { padding-top: 1.8rem; }
.catalog-group { border-top: 1px solid var(--line); padding-top: .7rem; margin-top: 1.6rem; }
.catalog-group h2 { font: 700 1.35rem var(--serif); margin: .25rem 0 .7rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: .8rem; }
.tile { display: flex; gap: .45rem; flex-direction: column; border: 1px solid var(--line); padding: .5rem; line-height: 1.35; }
.tile img { display: block; width: 100%; aspect-ratio: 21 / 26; height: auto; border: 1px solid #eae0d2; background: var(--cream); }
.tile small { color: var(--muted); }
.empty { border-top: 1px solid var(--line); padding-top: 1rem; color: var(--muted); }
dialog { color: var(--ink); border: 1px solid var(--line); background: var(--paper); }
dialog::backdrop { background: #251710b3; }
.modal { width: min(440px, 100% - 2rem); padding: 1rem 1.3rem; border-radius: 6px; }
.modal-head, .zoom-toolbar { display: flex; align-items: center; justify-content: space-between; gap: .55rem; }
.modal h2, .zoom-toolbar h2 { font: 700 1.4rem var(--serif); }
.modal p, .link-label { color: var(--muted); font-size: .91rem; }
#share-qr { display: block; margin: .8rem auto; border: 1px solid var(--line); }
.link-label { display: block; margin-top: .75rem; }
#share-url { width: 100%; padding: .5rem; border: 1px solid var(--line); background: white; color: var(--ink); }
.share-actions { display: flex; gap: .5rem; margin-top: .8rem; }
.copy-status { min-height: 1.5em; margin-top: .25rem; }
.zoom-dialog { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; }
.zoom-dialog[open] { display: flex; flex-direction: column; }
.zoom-toolbar { padding: .2rem max(.7rem, env(safe-area-inset-right)) .2rem max(.7rem, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); }
.zoom-toolbar h2 { margin-right: auto; }
.zoom-scroller { flex: 1; overflow: auto; background: #e6dac9; }
.zoom-scroller img { display: block; width: max(880px, 100%); max-width: 1555px; margin-inline: auto; }
.zoom-scroller.fit img { width: 100%; max-width: 960px; }
.notice { position: fixed; z-index: 4; bottom: max(75px, calc(env(safe-area-inset-bottom) + 60px)); left: 50%; transform: translateX(-50%); color: white; background: #39241d; padding: .5rem .85rem; border-radius: 4px; font-size: .9rem; text-align: center; width: max-content; max-width: calc(100% - 2rem); }
@media (max-width: 660px) {
  .shell, .header-inner { width: calc(100% - 1.5rem); }
  .header-inner { min-height: 58px; }
  .brand { font-size: 1.13rem; gap: .45rem; }
  .brand img { width: 30px; height: 30px; }
  nav a, .subtle { padding-inline: .35rem; }
  .hero { grid-template-columns: 1fr; justify-items: center; min-height: 0; gap: 1.35rem; margin-top: .75rem; padding: 1.55rem 1.3rem 1.75rem; text-align: center; }
  .hero::before { width: 127%; top: 24%; right: -44%; }
  .hero h1 { font-size: clamp(2rem, 8.3vw, 3.25rem); margin: .38em 0 .23em; }
  .hero-note { font-size: .95rem; }
  .hero-button { margin-top: .9rem; min-height: 43px; }
  .book { width: min(54%, 230px); }
  .chapter-section { padding-top: 1.3rem; }
  .chapters { grid-template-columns: 1fr; }
  .chapter { min-height: 56px; gap: .55rem; }
  .chapter:nth-last-child(2) { border-bottom: 0; }
  .chapter strong { font-size: 1.12rem; }
  .chapter span { font-size: .84rem; }
  .reader-heading { grid-template-columns: auto 1fr auto; margin-top: .2rem; }
  .reader-heading .text-link, .reader-heading .page-position { font-size: .8rem; }
  .sheet { width: 100%; }
  .reader:not(.is-continuous) .reader-tip { flex-basis: 100%; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; }
  .tile { padding: .35rem; font-size: .88rem; }
}
@media (max-width: 355px) {
  .brand { font-size: 1rem; letter-spacing: 0; }
  nav { font-size: .87rem; gap: .15rem; }
  .chapter { grid-template-columns: auto 1fr; padding-block: .65rem; }
  .chapter .range { display: none; }
  .reader-controls .button { font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
