:root {
  color-scheme: light;
  --paper: #faf7f0;
  --card: #fffdf8;
  --ink: #2d2526;
  --muted: #625655;
  --wine: #792a40;
  --wine-dark: #57182a;
  --line: #e4d8cc;
  --pink: #f4e8e9;
  --serif: Georgia, "Noto Serif TC", "Songti TC", "Noto Serif CJK TC", serif;
  --sans: system-ui, "PingFang TC", "Microsoft JhengHei", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 5.5rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.65 var(--sans); }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--wine); outline-offset: 4px; }
h1, h2, h3, p, figure { margin: 0; }
.shell { width: min(1120px, calc(100% - 5rem)); margin-inline: auto; }
.skip-link { position: fixed; left: 1rem; top: -5rem; background: var(--card); padding: .5rem 1rem; z-index: 5; }
.skip-link:focus { top: 1rem; }
.masthead { border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; background: var(--paper); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1.25rem; min-height: 4.3rem; }
.brand { display: inline-flex; gap: .75rem; align-items: center; font: 700 1.08rem/1.4 var(--serif); letter-spacing: .07em; }
.brand-mark { display: grid; place-items: center; width: 2.05rem; height: 2.05rem; border-radius: 50%; background: var(--wine); color: #fffaf1; font: italic 1.36rem/1 Georgia, serif; }
.topbar nav { display: flex; gap: 2rem; align-items: center; }
.topbar nav a, .footer a { color: var(--muted); font-size: .9375rem; }
.topbar nav a:hover, .footer a:hover { color: var(--wine); text-decoration: underline; text-underline-offset: .3em; }
.hero { display: grid; grid-template-columns: .87fr 1.13fr; align-items: center; gap: clamp(2rem, 5vw, 5.5rem); padding-block: clamp(2rem, 5vw, 4.25rem); }
.eyebrow { color: var(--wine); font-size: .875rem; font-weight: 700; letter-spacing: .15em; }
.hero h1 { margin-top: .65rem; font: 500 clamp(3.2rem, 5.45vw, 5.6rem)/1.02 Georgia, serif; letter-spacing: -.055em; }
.hero h1 em { color: var(--wine); font-weight: inherit; }
.subtitle { margin-top: .7rem; font: 700 clamp(1.65rem, 2.55vw, 2.35rem)/1.4 var(--serif); letter-spacing: .12em; }
.intro { color: var(--muted); max-width: 23rem; margin-top: .95rem; }
.hero-photo { height: clamp(260px, 30vw, 390px); overflow: hidden; border-radius: 1.1rem; background: #e8d8cb; }
.hero-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: .56rem 1.1rem; border: 1px solid transparent; border-radius: .45rem; cursor: pointer; font-size: .9375rem; font-weight: 650; white-space: nowrap; }
.primary { margin-top: 1.45rem; background: var(--wine); color: #fff; }
.primary:hover { background: var(--wine-dark); }
.outline { border-color: var(--line); background: var(--card); color: var(--wine); }
.outline:hover, .outline[aria-pressed="true"] { border-color: var(--wine); background: var(--pink); }
.study { padding: 2.2rem 0 4.25rem; border-top: 1px solid var(--line); }
.section-heading, .scene-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
h2 { margin-top: .3rem; font: 700 clamp(1.9rem, 3.8vw, 2.65rem)/1.28 var(--serif); letter-spacing: .035em; }
.section-copy { margin-top: .65rem; color: var(--muted); }
.count { padding-bottom: .1rem; color: var(--wine); font-size: .875rem; white-space: nowrap; }
.scene-index { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; margin-top: 1.4rem; }
.scene-link { display: flex; align-items: center; gap: .65rem; min-height: 4rem; padding: .58rem .7rem; border: 1px solid var(--line); border-radius: .55rem; background: var(--card); font-size: .9rem; line-height: 1.42; }
.scene-link:hover { border-color: var(--wine); }
.scene-link[aria-current="true"] { background: var(--pink); border-color: var(--wine); color: var(--wine-dark); font-weight: 700; }
.scene-number { display: grid; place-items: center; min-width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--paper); color: var(--wine); font-size: .875rem; font-variant-numeric: tabular-nums; }
.scene-link[aria-current="true"] .scene-number { background: var(--wine); color: white; }
#scene-panel { margin-top: 2.7rem; }
.scene-heading { margin-bottom: 1rem; }
.scene-heading h3 { margin-top: .25rem; font: 700 clamp(1.4rem, 3vw, 1.9rem)/1.4 var(--serif); }
.scene-heading h3:focus { outline: none; }
#dialogues, .phrase-list { display: grid; gap: .7rem; }
.dialogue, .phrase { background: var(--card); border: 1px solid var(--line); border-radius: .6rem; overflow: hidden; }
summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; cursor: pointer; list-style: none; padding: .93rem 1.15rem; color: var(--ink); }
summary::-webkit-details-marker { display: none; }
summary:focus-visible { outline-offset: -4px; }
summary:hover { color: var(--wine); }
summary::after { content: "+"; flex: 0 0 1.3rem; text-align: center; font: 1.4rem/1 var(--sans); color: var(--wine); }
details[open] > summary::after { content: "−"; }
.summary-text { min-width: 0; overflow-wrap: anywhere; }
.line-label { display: block; color: var(--wine); font-size: .875rem; font-weight: 650; }
.snippet, .phrase-title { display: block; font: 1.15rem/1.4 Georgia, serif; }
.dialogue-body, .phrase-body { padding: 0 1.15rem 1.15rem; }
.reading-block { padding-top: .85rem; margin-top: .65rem; border-top: 1px solid var(--line); }
.reading-label { margin-bottom: .3rem; font-size: .875rem; color: var(--wine); font-weight: 700; }
.reading-block strong { color: var(--wine-dark); }
.original { font: 1.16rem/1.65 Georgia, serif; }
.zh-hidden .translation, .zh-hidden .usage { display: none; }
.scene-controls { display: flex; justify-content: flex-end; gap: .7rem; margin-top: 1.2rem; }
.phrase-wrap { background: #f1e8df; border-block: 1px solid var(--line); }
.phrase-section { padding-block: 3rem 3.5rem; }
.phrase-list { margin-top: 1.3rem; max-width: 760px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; min-height: 5rem; color: var(--muted); }
@media (max-width: 880px) {
  .shell { width: calc(100% - 3rem); }
  .hero { gap: 1.75rem; }
  .scene-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .shell { width: calc(100% - 2rem); }
  .hero { grid-template-columns: 1fr; padding-top: 2rem; gap: 1.5rem; }
  .hero-photo { height: clamp(190px, 57vw, 320px); }
  .topbar { min-height: 3.8rem; gap: .55rem; }
  .brand { gap: .45rem; font-size: .95rem; }
  .brand-mark { width: 1.65rem; height: 1.65rem; font-size: 1.08rem; }
  .topbar nav { gap: .75rem; }
  .topbar nav a { font-size: .875rem; }
  .section-heading { display: block; }
  .count { margin-top: .65rem; }
  .scene-heading { align-items: start; }
  .scene-link { padding-inline: .5rem; gap: .4rem; }
  .scene-number { min-width: 1.55rem; height: 1.55rem; }
}

.chapter-picker { padding: 1.5rem 0 1.8rem; border-top: 1px solid var(--line); }
.chapter-picker h2 { margin-top: 0; font-size: 1.5rem; }
.chapter-index { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .65rem; margin-top: .85rem; }
.chapter-link { display: flex; align-items: center; min-height: 3rem; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: .55rem; background: var(--card); font-size: .9375rem; line-height: 1.4; }
.chapter-link:hover { border-color: var(--wine); }
.chapter-link[aria-current="page"] { background: var(--wine); border-color: var(--wine); color: white; font-weight: 700; }
@media (max-width: 880px) {
  .chapter-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .topbar { flex-wrap: wrap; padding-block: .55rem; }
}

.episode-title { margin-top: .3rem; color: var(--wine); font: italic 1.15rem/1.4 Georgia, serif; }
