:root {
  color-scheme: dark;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "SFMono-Regular", Consolas, monospace;
  --serif: "Noto Serif CJK SC", "Songti SC", SimSun, serif;
  --paper: #f8f2e9;
  --ink: #132a31;
  --muted: #b3cac7;
  --accent: #a7dbc8;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 12% 0%, #274745 0%, #12262a 48%, #101f24 100%);
  color: var(--paper);
  font: 16px/1.65 var(--sans);
}

button { cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible { outline: 3px solid #e7b676; outline-offset: 4px; }
.site-wrap { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }

.story-cover {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  align-items: stretch;
  min-height: 350px;
  overflow: hidden;
  margin: clamp(24px, 5vh, 60px) 0 24px;
  border: 1px solid #71908854;
  border-radius: 26px;
  background: #182e32;
  box-shadow: 0 24px 60px #0b171c5e;
}
.cover-copy { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: clamp(26px, 5vw, 58px); }
.edition { margin: 0 0 13px; color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: .13em; }
.story-cover h1 { margin: 0; color: var(--paper); font: 700 clamp(34px, 5.2vw, 66px)/1.15 var(--serif); letter-spacing: -.035em; }
.intro { max-width: 340px; margin: 17px 0 24px; color: #cbdad5; font-size: 15px; }
.cover-art { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: cover; object-position: 51% 49%; }
.cover-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.cover-actions p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.story-entry {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding-inline: 19px;
  border-radius: 9px;
  background: #c1ebd9;
  color: #163a34;
  font-size: 15px;
  font-weight: 750;
  text-decoration: none;
  transition: background-color .15s ease;
}
.story-entry:hover { background: #d9f7e9; }
.reader-intro { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1px 20px; padding: 1px 3px 12px; }
.reader-intro h2 { margin: 0; color: var(--ink); font: 700 23px/1.35 var(--serif); }
.reader-intro p { margin: 0; color: #45606a; font-size: 13px; }
.script-note { color: var(--ink); }
.vn-context { margin: 0; }
.vn-card#high-school-game {
  --vn-nav-clearance: 0px;
  color-scheme: light;
  margin: 0;
  padding: clamp(10px, 2vw, 20px);
  border: 1px solid #d2e4de;
  border-radius: 19px;
  background: #f1f6f0;
}
.vn-card#high-school-game:focus { outline: none; }
.vn-card .vn-shell { max-width: none; }
.site-footer { display: flex; justify-content: flex-end; padding-block: 17px max(20px, env(safe-area-inset-bottom)); }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration-thickness: 1px; text-underline-offset: 4px; font-size: 13px; }

.missing-page { width: min(520px, calc(100% - 40px)); margin: 12vh auto; }
.missing-page h1 { font: 700 clamp(29px, 6vw, 46px)/1.2 var(--serif); }
.missing-page p { color: var(--muted); margin-block: 16px 24px; }

@media (max-width: 760px) {
  .site-wrap { width: calc(100% - 28px); }
  .story-cover { min-height: 0; grid-template-columns: minmax(0, 1fr); margin-block: 16px; border-radius: 17px; }
  .cover-art { width: 100%; height: auto; aspect-ratio: 16 / 9; grid-row: 1; }
  .cover-copy { padding: 21px 21px 22px; }
  .edition { margin-bottom: 7px; }
  .intro { margin-block: 11px 16px; }
  .reader-intro { padding-bottom: 10px; }
  .reader-intro h2 { font-size: 20px; }
  .reader-intro p { font-size: 12px; }
  .vn-card#high-school-game { border-radius: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .story-entry { transition: none; }
}
