:root {
  color-scheme: dark;
  --bg: #080a0e;
  --bg-soft: #0e1117;
  --panel: rgba(20, 24, 31, 0.82);
  --panel-strong: #141820;
  --line: rgba(214, 183, 106, 0.28);
  --line-bright: rgba(214, 183, 106, 0.72);
  --gold: #d6b76a;
  --gold-pale: #f0dfb2;
  --silver: #d9dee8;
  --text: #e8e9ed;
  --muted: #9ca3af;
  --reader-scale: 1;
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -10%, rgba(122, 136, 164, 0.17), transparent 34rem),
    linear-gradient(rgba(214, 183, 106, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(214, 183, 106, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 42px 42px, 42px 42px, auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 140px rgba(0, 0, 0, 0.72);
}

a { color: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  color: #080a0e;
  background: var(--gold-pale);
  transform: translateY(-160%);
  transition: transform 150ms ease;
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1120px, calc(100% - 2rem));
  min-height: 76px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: 0.7rem;
  align-items: center;
  color: var(--silver);
  font-family: "Noto Serif SC", "Songti SC", SimSun, serif;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-decoration: none;
}

.brand-mark { color: var(--gold); }

.site-header nav { display: flex; gap: 1.5rem; }

.nav-link {
  padding: 0.5rem 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.nav-link:hover, .nav-link:focus-visible, .nav-link.active {
  color: var(--gold-pale);
  border-color: var(--gold);
}

main {
  position: relative;
  z-index: 1;
  width: min(1040px, calc(100% - 2rem));
  margin: 0 auto;
}

.title-panel {
  min-height: 440px;
  padding: 6.5rem 1rem 5rem;
  text-align: center;
}

.eyebrow, .section-kicker {
  margin: 0 0 1.2rem;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.28em;
}

.crest {
  display: grid;
  width: 58px;
  height: 68px;
  margin: 0 auto 1.65rem;
  place-items: center;
  color: var(--gold-pale);
  font-size: 1.4rem;
  background: linear-gradient(145deg, rgba(214,183,106,.14), rgba(217,222,232,.03));
  clip-path: polygon(50% 0, 92% 20%, 82% 76%, 50% 100%, 18% 76%, 8% 20%);
  border: 1px solid var(--gold);
}

.title-panel h1 {
  margin: 0;
  color: #f1f2f5;
  font-family: "Noto Serif SC", "Songti SC", SimSun, serif;
  font-size: clamp(2.6rem, 8vw, 5.5rem);
  font-weight: 600;
  letter-spacing: 0.13em;
  line-height: 1.18;
  text-shadow: 0 0 32px rgba(217, 222, 232, 0.14);
}

.english-title {
  margin: 1.15rem 0 0;
  color: #abb1bd;
  font-family: Georgia, serif;
  font-size: clamp(0.9rem, 2vw, 1.08rem);
  font-style: italic;
  letter-spacing: 0.08em;
}

.author-name {
  margin: 1.15rem 0 0;
  color: var(--gold-pale);
  font-family: "Noto Serif SC", "Songti SC", SimSun, serif;
  font-size: .98rem;
  letter-spacing: .18em;
}

.work-tags {
  display: flex;
  gap: .55rem;
  justify-content: center;
  margin-top: 1rem;
}

.work-tags span {
  padding: .3rem .75rem;
  color: #c9ced8;
  font-family: Georgia, serif;
  font-size: .76rem;
  letter-spacing: .08em;
  background: rgba(217,222,232,.045);
  border: 1px solid rgba(217,222,232,.18);
}

.rule {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  justify-content: center;
  max-width: 300px;
  margin: 2.5rem auto 1.4rem;
  color: var(--gold);
  font-size: 0.58rem;
}

.rule span { width: 110px; height: 1px; background: linear-gradient(90deg, transparent, var(--line-bright)); }
.rule span:last-child { background: linear-gradient(90deg, var(--line-bright), transparent); }

.work-summary {
  margin: 0 0 .85rem;
  color: var(--silver);
  font-family: "Noto Serif SC", "Songti SC", SimSun, serif;
  font-size: 1.03rem;
  letter-spacing: .08em;
}

.status { margin: 0; color: var(--muted); font-size: 0.92rem; letter-spacing: 0.1em; }

.catalogue {
  padding: 2.5rem 0 6rem;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.section-heading .section-kicker { margin-bottom: 0.55rem; }

.section-heading h2 {
  margin: 0;
  color: var(--silver);
  font-family: "Noto Serif SC", "Songti SC", SimSun, serif;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  letter-spacing: 0.12em;
}

.chapter-count { color: var(--muted); font-size: 0.88rem; }

.volume-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 1.2rem 1.35rem;
  color: var(--gold-pale);
  background: linear-gradient(90deg, rgba(214,183,106,.1), transparent);
  border: 1px solid var(--line);
  border-bottom: 0;
}

.volume-heading span {
  font-family: "Noto Serif SC", "Songti SC", SimSun, serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .18em;
}

.volume-heading p { margin: 0; color: var(--muted); font-size: .86rem; }

.chapter-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); }
.chapter-list li + li { border-top: 1px solid rgba(214,183,106,.16); }
.chapter-list a {
  display: grid;
  grid-template-columns: 3.5rem 1fr auto;
  gap: 1rem;
  align-items: center;
  min-height: 72px;
  padding: .9rem 1.35rem;
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease;
}
.chapter-list a:hover, .chapter-list a:focus-visible { background: rgba(214,183,106,.075); }
.chapter-number { color: var(--gold); font-family: Georgia, serif; font-size: .88rem; letter-spacing: .08em; }
.chapter-title { color: var(--silver); font-family: "Noto Serif SC", "Songti SC", SimSun, serif; font-size: 1.05rem; letter-spacing: .06em; }
.chapter-open { color: var(--muted); font-size: .82rem; }

.empty-state {
  padding: 5rem 1.5rem;
  text-align: center;
  background: linear-gradient(145deg, rgba(214,183,106,.045), rgba(217,222,232,.018));
  border: 1px solid var(--line);
  box-shadow: inset 0 0 40px rgba(0,0,0,.22);
}

.empty-symbol { color: var(--gold); font-size: 1.8rem; }
.empty-state h3 { margin: 1rem 0 0.65rem; font-family: "Noto Serif SC", "Songti SC", serif; font-size: 1.2rem; letter-spacing: .08em; }
.empty-state p { margin: 0; color: var(--muted); line-height: 1.8; }

footer {
  position: relative;
  z-index: 1;
  width: min(1040px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.8rem 0 2.2rem;
  color: #727986;
  font-size: 0.78rem;
  text-align: center;
  border-top: 1px solid rgba(214,183,106,.12);
}

.reader-shell { width: min(820px, calc(100% - 2rem)); }

.chapter-card {
  min-height: 70vh;
  margin: 4rem 0 6rem;
  padding: clamp(2rem, 7vw, 5rem) clamp(1.25rem, 8vw, 5.5rem);
  background: rgba(15, 18, 24, 0.92);
  border: 1px solid var(--line);
  box-shadow: 0 28px 80px rgba(0,0,0,.34), inset 0 0 70px rgba(214,183,106,.025);
}

.chapter-heading { padding-bottom: 2.3rem; text-align: center; border-bottom: 1px solid var(--line); }
.chapter-heading .section-kicker { margin-bottom: 1rem; }
.chapter-heading h1 { margin: 0; color: var(--silver); font-family: "Noto Serif SC", "Songti SC", SimSun, serif; font-size: clamp(1.8rem, 6vw, 2.8rem); letter-spacing: .1em; }
.chapter-subtitle { margin: .9rem 0 0; color: var(--muted); }

.reader-controls { display: flex; justify-content: flex-end; padding: 1.25rem 0; }
.reader-controls button {
  min-width: 60px;
  padding: .55rem .7rem;
  color: var(--gold-pale);
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
}
.reader-controls button + button { border-left: 0; }
.reader-controls button:hover, .reader-controls button:focus-visible { background: rgba(214,183,106,.1); border-color: var(--line-bright); }

.chapter-diary {
  margin: .2rem 0 2.5rem;
  padding: 1.4rem 1.5rem;
  color: #bfc4ce;
  font-family: "Noto Serif SC", "Songti SC", SimSun, serif;
  font-size: calc(.98rem * var(--reader-scale));
  line-height: 1.9;
  background: rgba(214,183,106,.045);
  border-left: 2px solid var(--gold);
}
.chapter-diary p { margin: 0 0 .9em; }
.chapter-diary p:last-child { margin-bottom: 0; }

.prose {
  color: #d6d8de;
  font-family: "Noto Serif SC", "Songti SC", SimSun, serif;
  font-size: calc(1.08rem * var(--reader-scale));
  line-height: 2.05;
  letter-spacing: .035em;
}

.prose p {
  margin: 0 0 1.45em;
  text-indent: 2em;
}

.chapter-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  margin-top: 4rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}

.chapter-nav a, .chapter-nav span { padding: .65rem .25rem; font-size: .92rem; text-decoration: none; }
.chapter-nav a { color: var(--gold-pale); text-align: center; }
.chapter-nav span:last-child { text-align: right; }
.chapter-nav-disabled { color: #5e6470; }

@media (max-width: 640px) {
  .site-header { min-height: 64px; }
  .site-header nav { gap: .85rem; }
  .site-header .nav-link:first-child:not(:only-child) { display: none; }
  .brand { font-size: .9rem; letter-spacing: .08em; }
  .nav-link { font-size: .84rem; }
  .title-panel { min-height: 400px; padding: 5rem .5rem 4rem; }
  .title-panel h1 { letter-spacing: .08em; }
  .catalogue { padding-bottom: 4rem; }
  .volume-heading { align-items: flex-start; flex-direction: column; gap: .45rem; }
  .chapter-list a { grid-template-columns: 2.4rem 1fr; gap: .65rem; padding-inline: 1rem; }
  .chapter-open { display: none; }
  .chapter-card { margin: 1.8rem 0 3rem; padding: 2.5rem 1.25rem 3rem; }
  .reader-controls { justify-content: center; }
  .prose { line-height: 1.95; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
