:root {
  --bg: #f4efe4;
  --surface: #fbf7ee;
  --surface-2: #eee6d4;
  --text: #1a2230;
  --text-muted: #5a6270;
  --accent: #1f4e68;
  --accent-ink: #f7f1e4;
  --border: #d4c9b0;
  --ring: #1f4e68;
  --ok: #2f6b4f;
  --warn: #8a5a1a;
  --danger: #8b2e2e;
  --info: #1f4e68;
  --cta: #163a52;
  --cta-wash: rgba(232, 214, 176, 0.28);
  --cta-line: rgba(232, 214, 176, 0.55);
  --font-display: "KaiTi", "STKaiti", "楷体", "STSong", serif;
  --font-song: "SimSun", "Songti SC", "宋体", serif;
  --font-body: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  --fs-h1: 34px;
  --fs-h2: 24px;
  --fs-h3: 18px;
  --fs-body: 16px;
  --fs-small: 13px;
  --lh-body: 1.7;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-1: 0 1px 0 rgba(26, 34, 48, 0.06);
  --container: 720px;
  --container-wide: 1180px;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --dur: 180ms;
  --cta-loop: 2.9s;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  font-size: var(--fs-body);
  line-height: 1.7;
  line-height: var(--lh-body);
  text-align: left;
  overflow-wrap: anywhere;
  padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: #163a52;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
}

.skip:focus {
  left: 12px;
  background: var(--surface);
  padding: 8px 12px;
  z-index: 90;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.header-inner {
  width: min(100% - 32px, var(--container-wide));
  margin: 0 auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.2;
}

.brand img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 50%;
}

.nav-toggle {
  display: none;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 16px;
  border-radius: var(--radius-sm);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.site-nav a[aria-current="page"] {
  color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.wrap {
  width: min(100% - 32px, var(--container-wide));
  margin: 0 auto;
}

.narrow {
  width: min(100% - 32px, var(--container));
  margin: 0 auto;
}

.section {
  padding-block: var(--space-7);
}

.section-tight {
  padding-block: var(--space-6);
}

.playbill {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: var(--space-6);
  align-items: start;
  padding-block: var(--space-7);
  border-bottom: 1px solid var(--border);
}

.kicker {
  font-family: var(--font-song);
  font-size: var(--fs-small);
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin: 0 0 var(--space-3);
}

h1 {
  font-family: var(--font-display);
  font-size: 34px;
  font-size: var(--fs-h1);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 var(--space-4);
}

h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-size: var(--fs-h2);
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 var(--space-4);
}

h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 var(--space-3);
}

p,
li {
  margin: 0 0 var(--space-4);
}

.lead {
  font-size: 17px;
}

.acts {
  background: var(--surface-2);
  padding: var(--space-5);
  border: 1px solid var(--border);
}

.acts ol {
  margin: 0;
  padding-left: 1.2em;
}

.acts a {
  color: var(--text);
}

.scene-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-5);
}

.scene-chip {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  border-radius: var(--radius-sm);
}

.scene-chip.is-on,
.scene-chip[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.entry-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border);
}

.entry {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
}

.entry h3 {
  margin-bottom: 6px;
}

.entry p {
  margin: 0;
  color: var(--text);
}

.nums {
  display: grid;
  gap: var(--space-5);
  counter-reset: act;
}

.num {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: var(--space-4);
}

.num::before {
  counter-increment: act;
  content: counter(act, cjk-ideographic);
  font-family: var(--font-song);
  font-size: 22px;
  color: var(--accent);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--surface-2);
  font-weight: 600;
}

.quotes {
  display: grid;
  gap: var(--space-5);
}

.quote {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: var(--space-5);
}

.quote p {
  margin: 0;
}

.quote cite {
  display: block;
  margin-top: var(--space-3);
  font-style: normal;
  color: var(--text-muted);
  font-size: var(--fs-small);
}

.split {
  display: grid;
  grid-template-columns: 1.6fr 0.8fr;
  gap: var(--space-6);
}

.note {
  background: var(--surface-2);
  padding: var(--space-5);
  border: 1px solid var(--border);
}

.figure {
  margin: 0 0 var(--space-5);
}

.figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--surface-2);
}

.figure figcaption {
  margin-top: var(--space-2);
  color: var(--text-muted);
  font-size: var(--fs-small);
}

.faq details {
  border-bottom: 1px solid var(--border);
  padding: var(--space-3) 0;
}

.faq summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 600;
}

.crumbs {
  font-size: var(--fs-small);
  color: var(--text-muted);
  margin: var(--space-5) 0 0;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: var(--space-6) 0 var(--space-5);
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: var(--space-6);
}

.site-footer h2 {
  font-size: 18px;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li {
  margin: 0 0 8px;
}

.foot-brand a {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 20px;
  text-decoration: none;
}

.foot-mark {
  color: var(--text-muted);
  margin: 8px 0 0;
}

.site-cta {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 80;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(520px, 36vw);
  min-width: 400px;
  min-height: 56px;
  padding: 12px 20px;
  background: var(--cta);
  color: var(--accent-ink);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.3;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.site-cta:hover,
.site-cta:focus-visible {
  color: #fff8e8;
}

.site-cta::before,
.site-cta::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.site-cta::before {
  inset: 0;
  background: radial-gradient(120% 140% at 28% 50%, var(--cta-wash) 0%, transparent 72%);
  opacity: 0;
  transform: scale(0.97);
  animation: libretto-ink-bloom var(--cta-loop) var(--ease) infinite;
}

.site-cta::after {
  left: 22px;
  right: 22px;
  bottom: 9px;
  height: 3px;
  background: var(--cta-line);
  opacity: 0;
  transform: scaleY(0.96);
  transform-origin: center bottom;
  animation: libretto-crease-press var(--cta-loop) var(--ease) infinite;
}

.site-cta span {
  position: relative;
  z-index: 1;
}

@keyframes libretto-ink-bloom {
  0%,
  58% {
    opacity: 0;
    transform: scale(0.97);
  }
  70% {
    opacity: 0.28;
    transform: scale(1);
  }
  86%,
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

@keyframes libretto-crease-press {
  0%,
  58% {
    opacity: 0;
    transform: scaleY(0.96);
  }
  72% {
    opacity: 0.55;
    transform: scaleY(1);
  }
  88%,
  100% {
    opacity: 0;
    transform: scaleY(1);
  }
}

@media (max-width: 900px) {
  .playbill,
  .split,
  .foot-grid {
    grid-template-columns: 1fr;
  }

  :root {
    --fs-h1: 28px;
    --fs-h2: 22px;
  }

  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 22px;
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    display: none;
    position: absolute;
    left: 16px;
    right: 16px;
    top: 68px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 8px 12px;
    flex-direction: column;
    z-index: 40;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-header {
    position: relative;
  }

  .site-cta {
    left: 12px;
    right: 12px;
    width: auto;
    min-width: 0;
    transform: none;
  }

  .num {
    grid-template-columns: 32px 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-cta::before,
  .site-cta::after {
    animation: none;
  }

  .site-cta::before {
    opacity: 0.16;
    transform: scale(1);
  }

  .site-cta::after {
    opacity: 0.4;
    transform: scaleY(1);
  }
}
