/* 残落四班 · 样式
   纸、墨、校服蓝与一枚印章红。所有插画均由 CSS / SVG 绘制，无外部图片。 */

@font-face {
  font-family: "Rong Sans";
  src: url("assets/fonts/outfit-core.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: "Rong Numerals";
  src: url("assets/fonts/numerals-core.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

:root {
  --paper: #f3eee4;
  --paper-2: #fbf7ee;
  --paper-3: #fffaf0;
  --ink: #1f2b3f;
  --ink-2: #38465b;
  --muted: #7d7a70;
  --muted-2: #999588;
  --line: rgba(31, 43, 63, .14);
  --line-strong: rgba(31, 43, 63, .3);
  --red: #b4463c;
  --red-dark: #93362e;
  --blue: #2f5d8a;
  --green: #4f7a5f;
  --gold: #b8862f;
  --purple: #7a5c9e;
  --teal: #3f7b83;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  --sans: "Rong Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --num: "Rong Numerals", "Rong Sans", "Outfit", sans-serif;
  --shadow: 0 18px 50px rgba(45, 38, 26, .09);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(1100px 620px at 12% -8%, #fff9ea 0, rgba(255, 249, 234, 0) 62%),
    radial-gradient(900px 560px at 92% 104%, #dde6e1 0, rgba(221, 230, 225, 0) 62%),
    #e9e3d6;
  font: 14px/1.8 var(--sans);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .4;
  background-image:
    linear-gradient(rgba(31, 43, 63, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 43, 63, .045) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 72%);
}
body.modal-open { overflow: hidden; }
button, input { font: inherit; }
button { cursor: pointer; color: inherit; border: 0; background: none; }
button:disabled { cursor: not-allowed; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 400; }
svg { display: block; }
::selection { background: rgba(180, 70, 60, .18); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

.skip {
  position: fixed;
  top: -80px;
  left: 14px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--paper-2);
  border: 1px solid var(--line);
}
.skip:focus { top: 12px; }

.screen {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 30px 42px 56px;
  animation: fadeUp .45s ease both;
}

/* ───────── 通用 ───────── */
.kicker {
  font-size: 10px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--muted);
}
.kicker.light { color: rgba(243, 238, 228, .62); }
.eyebrow {
  font-size: 10px;
  letter-spacing: .3em;
  color: var(--muted);
  text-transform: uppercase;
}
.title-mark {
  font-size: 10px;
  letter-spacing: .24em;
  color: var(--muted);
}
.fineprint {
  font-size: 10px;
  color: var(--muted-2);
  line-height: 1.8;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 26px;
  border-radius: 3px;
  border: 1px solid transparent;
  font-size: 12px;
  letter-spacing: .12em;
  transition: transform .18s, background .18s, border-color .18s, box-shadow .18s, color .18s;
}
.btn.primary {
  background: var(--red);
  color: #fdf8ef;
  box-shadow: 0 8px 20px rgba(180, 70, 60, .22);
}
.btn.primary:hover { background: var(--red-dark); transform: translateY(-1px); }
.btn.ghost { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn.ghost:hover { background: rgba(255, 255, 255, .5); border-color: var(--ink); }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: 11px; }
.btn.wide { width: 100%; max-width: 300px; }
.btn:disabled { opacity: .35; box-shadow: none; transform: none; }
.link-btn {
  padding: 2px 0;
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color .18s, border-color .18s;
}
.link-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.link-btn.danger:hover { color: var(--red); border-color: var(--red); }

.bar {
  height: 4px;
  background: rgba(31, 43, 63, .1);
  border-radius: 99px;
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
  transition: width .5s ease;
}
.bar.thin { height: 3px; }

.panel {
  background: rgba(255, 252, 244, .72);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 12px 34px rgba(45, 38, 26, .05);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.deltas {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.delta {
  font-size: 9.5px;
  line-height: 1.6;
  padding: 1px 7px;
  border-radius: 2px;
  letter-spacing: .02em;
}
.delta.up { color: #2f6748; background: rgba(79, 122, 95, .11); }
.delta.down { color: #a03c33; background: rgba(180, 70, 60, .1); }

/* ───────── 封面 ───────── */
.title-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 26px;
  position: relative;
}
.title-screen::before {
  content: "四";
  position: fixed;
  right: 1vw;
  top: 8vh;
  z-index: -1;
  font-family: var(--serif);
  font-size: 42vw;
  line-height: 1;
  color: rgba(180, 70, 60, .05);
  pointer-events: none;
}
.title-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-strong);
}
.title-hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: 64px;
  align-items: center;
  padding: 52px 0 42px;
}
.title-copy .kicker { margin-bottom: 22px; }
.title-name {
  display: block;
  white-space: nowrap;
  font-family: var(--serif);
  font-size: clamp(72px, 9.4vw, 128px);
  line-height: 1.02;
  letter-spacing: .04em;
  color: var(--ink);
  font-synthesis: none;
}
.title-name span { display: inline; }
.title-name span + span { margin-left: .12em; }
.title-name span:last-child { color: var(--red); }
.title-en {
  margin-top: 18px;
  font-family: var(--num);
  font-size: 10px;
  letter-spacing: .52em;
  color: var(--muted);
}
.lede {
  margin-top: 34px;
  max-width: 540px;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 2.05;
  color: var(--ink-2);
}
.title-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}
.save-hint {
  margin-top: 14px;
  min-height: 18px;
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--muted);
}
.admission-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.admission {
  position: relative;
  width: min(370px, 100%);
  padding: 24px 24px 34px;
  background:
    repeating-linear-gradient(transparent 0 27px, rgba(47, 93, 138, .13) 27px 28px),
    var(--paper-2);
  border: 1px solid rgba(31, 43, 63, .2);
  box-shadow: 0 22px 55px rgba(45, 38, 26, .16);
  transform: rotate(-2deg);
  line-height: 28px;
}
.admission::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(180, 70, 60, .22);
}
.admission-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line-strong);
  font-size: 12px;
  letter-spacing: .24em;
}
.admission-head small { font-family: var(--num); font-size: 8px; letter-spacing: .12em; color: var(--muted); }
.admission-body { padding-left: 10px; font-family: var(--serif); font-size: 12.5px; color: var(--ink-2); }
.admission-line { font-size: 13px; letter-spacing: .18em; }
.admission-line b { color: var(--red); }
.admission-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 4px;
  font-size: 10.5px;
  color: var(--muted);
}
.seal {
  position: absolute;
  right: 22px;
  bottom: 26px;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 2px solid var(--red);
  border-radius: 50%;
  color: var(--red);
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: .06em;
  transform: rotate(-13deg);
  opacity: .82;
  box-shadow: inset 0 0 0 3px var(--paper-2), inset 0 0 0 4px var(--red);
}
.admission-tape {
  position: absolute;
  top: -13px;
  left: 50%;
  width: 86px;
  height: 24px;
  transform: translateX(-50%) rotate(2deg);
  background: rgba(214, 194, 143, .55);
  border-left: 1px solid rgba(255, 255, 255, .35);
  border-right: 1px solid rgba(255, 255, 255, .35);
}
.admission-note { font-size: 9px; letter-spacing: .2em; color: var(--muted-2); }
.title-foot {
  display: flex;
  align-items: flex-end;
  gap: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--line-strong);
}
.fact { display: flex; align-items: baseline; gap: 6px; }
.fact b { font-family: var(--num); font-size: 26px; font-weight: 300; color: var(--ink); }
.fact span { font-size: 10px; color: var(--muted); letter-spacing: .1em; }
.disclaimer { margin-left: auto; max-width: 360px; font-size: 9.5px; color: var(--muted-2); text-align: right; }
.title-fineprint { margin-top: 18px; font-size: 9px; color: var(--muted-2); text-align: center; letter-spacing: .08em; }

/* ───────── 建档 ───────── */
.sub-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-strong);
}
.setup-wrap { max-width: 980px; margin: 34px auto 0; }
.setup-head { text-align: center; }
.setup-head h1 {
  margin-top: 14px;
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 44px);
  letter-spacing: .06em;
}
.setup-sub { margin-top: 10px; font-family: var(--serif); font-size: 14px; color: var(--muted); }
.setup-form {
  display: grid;
  gap: 32px;
  margin-top: 40px;
  padding: 34px 36px;
  background: rgba(255, 252, 244, .58);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}
.field .label,
.field label {
  display: block;
  margin-bottom: 10px;
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--muted);
}
.name-row { display: flex; align-items: flex-end; gap: 14px; }
.name-row input {
  flex: 1;
  min-width: 0;
  padding: 8px 4px;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: .08em;
}
.name-row input::placeholder { color: var(--muted-2); font-size: 18px; }
.name-row input:focus { outline: none; border-bottom-color: var(--red); }
.seg { display: flex; gap: 8px; }
.seg-btn {
  min-width: 88px;
  padding: 7px 18px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, .3);
  transition: all .18s;
}
.seg-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.seg-btn.on { border-color: var(--ink); color: var(--paper-2); background: var(--ink); }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.option-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 16px 17px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, .28);
  transition: border-color .18s, background .18s, transform .18s, box-shadow .18s;
}
.option-card:hover { border-color: var(--line-strong); transform: translateY(-1px); background: rgba(255, 255, 255, .5); }
.option-card.on {
  border-color: var(--ink);
  background: var(--paper-3);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.option-top { display: flex; align-items: baseline; gap: 8px; }
.option-top b { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.option-top em { font-style: normal; font-size: 9px; letter-spacing: .08em; color: var(--red); }
.option-desc { font-size: 11px; line-height: 1.75; color: var(--muted); }
.option-meta { font-size: 9.5px; letter-spacing: .05em; color: var(--muted-2); }
.talent-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.talent-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px 10px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, .25);
  transition: all .18s;
}
.talent-card:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, .5); }
.talent-card.on { border-color: var(--red); background: #fff5ea; box-shadow: inset 0 0 0 1px var(--red); }
.talent-card b { font-family: var(--serif); font-size: 14px; }
.talent-card span { font-size: 9.5px; line-height: 1.6; color: var(--muted); }
.setup-submit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.lottery-ticket {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 42px;
  border: 1px dashed var(--line-strong);
  background: rgba(255, 252, 244, .6);
}
.lottery-ticket span { font-size: 9px; letter-spacing: .26em; color: var(--muted); }
.lottery-ticket b { font-family: var(--num); font-size: 30px; font-weight: 300; letter-spacing: .12em; }
.lottery-ticket small { font-size: 8.5px; color: var(--muted-2); }

/* 角色卡与四班名单 */
.character-card {
  position: relative;
  margin-top: 30px;
  padding: 30px 34px 26px;
  background:
    repeating-linear-gradient(transparent 0 30px, rgba(47, 93, 138, .07) 30px 31px),
    var(--paper-2);
  border: 1px solid rgba(31, 43, 63, .2);
  box-shadow: var(--shadow);
}
.character-card::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(180, 70, 60, .18);
}
.character-top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-strong);
}
.student-avatar.big {
  width: 70px;
  height: 70px;
  font-size: 30px;
  background: var(--ink);
}
.character-id b {
  display: block;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: .12em;
  line-height: 1.2;
}
.character-id small { display: block; margin-top: 2px; font-size: 10px; letter-spacing: .08em; color: var(--muted); }
.character-id em { display: block; margin-top: 4px; font-style: normal; font-size: 10px; letter-spacing: .08em; color: var(--red); }
.character-no {
  margin-left: auto;
  align-self: flex-start;
  font-family: var(--num);
  font-size: 9px;
  letter-spacing: .08em;
  color: var(--muted-2);
  writing-mode: vertical-rl;
}
.character-bio { margin-top: 18px; font-family: var(--serif); font-size: 13.5px; line-height: 2; color: var(--ink-2); }
.character-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.character-tags span {
  padding: 2px 9px;
  border: 1px solid var(--line-strong);
  font-size: 9px;
  letter-spacing: .08em;
  color: var(--muted);
}
.character-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 22px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px dashed var(--line);
}
.character-stat { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 10px; color: var(--muted); }
.character-stat b { font-family: var(--num); font-size: 12px; font-weight: 500; color: var(--ink); }
.character-stat i { grid-column: 1 / -1; display: block; height: 3px; border-radius: 99px; background: rgba(31, 43, 63, .09); overflow: hidden; }
.character-stat i em { display: block; height: 100%; border-radius: inherit; }
.cast { margin-top: 30px; }
.cast-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-strong);
}
.cast-sub { font-size: 10px; color: var(--muted); }
.cast-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.cast-card {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .28);
}
.cast-card .npc-avatar { width: 32px; height: 32px; font-size: 14px; }
.cast-card b { font-family: var(--serif); font-size: 14px; }
.cast-card small { display: block; font-size: 8.5px; color: var(--muted); }
.cast-card p { margin-top: 4px; font-size: 9.5px; line-height: 1.7; color: var(--muted); }
.cast-card:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* ───────── 抽签 ───────── */
.lottery-screen {
  min-height: 100vh;
  max-width: none;
  display: grid;
  place-items: center;
  padding: 40px 24px;
  color: var(--paper);
  background:
    radial-gradient(900px 600px at 50% 30%, rgba(80, 117, 158, .22), transparent 65%),
    linear-gradient(180deg, #15202f 0%, #101a27 100%);
  position: relative;
  overflow: hidden;
}
.lottery-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  border: 1px solid rgba(232, 196, 106, .14);
  box-shadow: 0 0 120px rgba(232, 196, 106, .08), inset 0 0 120px rgba(232, 196, 106, .04);
  pointer-events: none;
}
.lottery-box { position: relative; z-index: 1; width: min(520px, 100%); text-align: center; }
.lottery-box h1 {
  margin-top: 12px;
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 46px);
  letter-spacing: .12em;
}
.lottery-sub { margin-top: 10px; font-size: 11px; color: rgba(243, 238, 228, .55); letter-spacing: .1em; }
.lottery-panel {
  margin-top: 34px;
  padding: 32px 26px 28px;
  border: 1px solid rgba(243, 238, 228, .22);
  background: rgba(243, 238, 228, .04);
  position: relative;
}
.lottery-panel::before,
.lottery-panel::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(232, 196, 106, .55);
}
.lottery-panel::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.lottery-panel::after { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }
.lottery-label { font-size: 9px; letter-spacing: .34em; color: rgba(243, 238, 228, .5); }
.lottery-number {
  margin: 14px 0 8px;
  font-family: var(--num);
  font-size: clamp(56px, 12vw, 82px);
  font-weight: 300;
  letter-spacing: .18em;
  color: #e8c46a;
  line-height: 1.1;
  text-indent: .18em;
  transition: color .4s, transform .4s;
}
.lottery-panel.is-done .lottery-number { color: var(--paper); transform: scale(1.02); }
.lottery-status { font-family: var(--serif); font-size: 12px; letter-spacing: .16em; color: rgba(243, 238, 228, .62); }
.lottery-next { display: none; margin-top: 22px; }
.lottery-panel.is-done .lottery-next { display: inline-flex; animation: fadeUp .5s ease both; }
.lottery-sync {
  margin-top: 16px;
  padding: 14px 18px 15px;
  border: 1px dashed rgba(232, 196, 106, .4);
  background: rgba(232, 196, 106, .05);
  animation: fadeUp .6s ease both;
}
.lottery-sync[hidden] { display: none; }
.lottery-sync-label { font-size: 9px; letter-spacing: .3em; color: rgba(232, 196, 106, .7); }
.lottery-sync-tip { margin-top: 4px; font-size: 9.5px; line-height: 1.9; color: rgba(243, 238, 228, .45); }
.lottery-fine { margin-top: 24px; font-size: 9.5px; line-height: 2; color: rgba(243, 238, 228, .34); }

/* ───────── 分班 ───────── */
.class-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 24px;
}
.class-paper {
  position: relative;
  width: min(620px, 100%);
  padding: 52px 54px 46px;
  background:
    repeating-linear-gradient(transparent 0 31px, rgba(47, 93, 138, .1) 31px 32px),
    var(--paper-2);
  border: 1px solid rgba(31, 43, 63, .2);
  box-shadow: 0 30px 80px rgba(45, 38, 26, .16);
  text-align: center;
}
.class-paper h1 {
  margin: 14px 0 6px;
  font-family: var(--serif);
  font-size: clamp(44px, 7vw, 68px);
  letter-spacing: .1em;
}
.class-sub { font-size: 11px; letter-spacing: .08em; color: var(--muted); }
.msg-stack {
  display: grid;
  gap: 8px;
  margin: 32px 0 24px;
  text-align: left;
}
.msg {
  max-width: 88%;
  padding: 10px 14px;
  background: #efe9dd;
  border-radius: 2px 10px 10px 10px;
  border: 1px solid var(--line);
}
.msg.mine { margin-left: auto; background: #e6efe2; border-radius: 10px 2px 10px 10px; }
.msg span { display: block; font-size: 9px; color: var(--muted-2); letter-spacing: .06em; }
.msg p { margin-top: 2px; font-size: 12px; line-height: 1.7; color: var(--ink-2); }
.class-stamp {
  position: absolute;
  right: 34px;
  bottom: 42px;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(180, 70, 60, .55);
  border-radius: 50%;
  color: rgba(180, 70, 60, .68);
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: .08em;
  transform: rotate(-14deg);
  box-shadow: inset 0 0 0 3px var(--paper-2), inset 0 0 0 4px rgba(180, 70, 60, .4);
  pointer-events: none;
}
.class-paper .btn { margin-top: 10px; }

/* ───────── 主游戏 ───────── */
.game-screen { max-width: 1360px; padding-top: 20px; }
.game-top {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-strong);
}
.school-id { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.school-badge {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #fcf6ec;
  font-family: var(--serif);
  font-size: 19px;
  border-radius: 2px;
  box-shadow: inset 0 0 0 2px rgba(252, 246, 236, .25);
}
.school-id b { display: block; font-family: var(--serif); font-size: 15px; letter-spacing: .06em; }
.school-id small { display: block; font-size: 9.5px; color: var(--muted); letter-spacing: .08em; }
.top-progress { flex: 1; max-width: 380px; }
.top-progress-label { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 9.5px; color: var(--muted); letter-spacing: .08em; }
.top-tools { display: flex; gap: 16px; margin-left: auto; }

.game-grid {
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr) 294px;
  gap: 18px;
  align-items: start;
  margin-top: 22px;
}
.profile-panel { padding: 18px 18px 16px; }
.student-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}
.student-avatar {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper-2);
  font-family: var(--serif);
  font-size: 21px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .18);
}
.student-info { min-width: 0; }
.student-info b { display: block; font-family: var(--serif); font-size: 19px; letter-spacing: .06em; line-height: 1.3; }
.student-info small { display: block; font-size: 9px; color: var(--muted); }
.student-info em { display: inline-block; margin-top: 3px; font-style: normal; font-size: 9px; color: var(--red); letter-spacing: .08em; }
.student-no { margin-left: auto; align-self: flex-start; font-family: var(--num); font-size: 8px; color: var(--muted-2); letter-spacing: .08em; writing-mode: vertical-rl; }
.stats { display: grid; gap: 9px; margin-top: 16px; }
.stat-row { display: flex; align-items: center; gap: 8px; }
.stat-glyph {
  width: 23px;
  height: 23px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--c);
  font-family: var(--serif);
  font-size: 11px;
}
.stat-main { flex: 1; min-width: 0; }
.stat-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 10px; color: var(--muted); }
.stat-top b { font-family: var(--num); font-size: 12px; font-weight: 500; color: var(--ink); }
.stat-main .bar { height: 3px; margin-top: 2px; }
.profile-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.profile-foot span { display: block; font-size: 9px; color: var(--muted); letter-spacing: .06em; }
.profile-foot b { font-family: var(--num); font-size: 16px; font-weight: 400; }
.profile-tip { margin-top: 10px; font-size: 8.5px; line-height: 1.6; color: var(--muted-2); }
.life-rows {
  display: grid;
  gap: 5px;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px dashed var(--line);
}
.life-rows > div { display: flex; justify-content: space-between; gap: 8px; font-size: 9.5px; color: var(--muted); }
.life-rows b { font-weight: 400; color: var(--ink-2); }
.life-rows b.on { color: var(--red); }

.stage-panel { padding: 22px 24px 20px; min-height: 560px; }
.month-card {
  display: flex;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.month-date {
  width: 76px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-right: 16px;
  border-right: 1px solid var(--line);
}
.month-date span { font-family: var(--num); font-size: 10px; letter-spacing: .2em; color: var(--muted); }
.month-date b { font-family: var(--num); font-size: 46px; font-weight: 300; line-height: 1; letter-spacing: .02em; }
.month-main { flex: 1; min-width: 0; }
.month-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: 9px;
  letter-spacing: .04em;
  color: var(--muted);
  white-space: nowrap;
}
.chip svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.chip.solid { background: var(--ink); border-color: var(--ink); color: var(--paper-2); }
.chip.hot { border-color: rgba(180, 70, 60, .4); color: var(--red); background: rgba(180, 70, 60, .06); }
.month-note { margin: 9px 0 8px; font-family: var(--serif); font-size: 14px; line-height: 1.8; color: var(--ink-2); }
.bar.year { height: 3px; }
.countdown { margin-top: 5px; font-size: 9px; letter-spacing: .08em; color: var(--muted-2); text-align: right; }
.stage-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.stage-head h2 { margin-top: 3px; font-family: var(--serif); font-size: 25px; letter-spacing: .04em; }
.slots { font-size: 10px; color: var(--muted); letter-spacing: .08em; }
.slots b { font-family: var(--num); font-size: 15px; font-weight: 500; color: var(--red); }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.action-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, .28);
  transition: border-color .18s, background .18s, transform .18s, box-shadow .18s;
}
.action-card:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, .55);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(45, 38, 26, .06);
}
.action-card.on {
  border-color: var(--red);
  background: #fff6ea;
  box-shadow: inset 0 0 0 1px var(--red);
}
.action-card.locked { opacity: .42; }
.action-glyph {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--paper-3);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
  border-radius: 2px;
}
.action-card.on .action-glyph { border-color: var(--red); color: var(--red); background: #fff; }
.action-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.action-title { display: flex; align-items: baseline; gap: 6px; }
.action-title b { font-size: 12.5px; font-weight: 600; letter-spacing: .02em; }
.action-title small { padding-left: 6px; border-left: 1px solid var(--line); font-size: 8.5px; color: var(--muted-2); }
.action-desc { font-size: 10px; line-height: 1.55; color: var(--muted); }
.action-effects { display: flex; flex-wrap: wrap; gap: 3px 6px; margin-top: 4px; }
.action-effects span { font-size: 8.5px; letter-spacing: .02em; }
.action-effects .pos { color: #3f6f52; }
.action-effects .neg { color: #a85046; }
.action-lock { margin-top: 3px; font-size: 8.5px; color: var(--red); }
.action-check {
  align-self: center;
  font-size: 9px;
  color: var(--muted-2);
  letter-spacing: .06em;
}
.action-card.on .action-check { color: var(--red); }
.confirm-bar {
  position: sticky;
  bottom: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 17px -24px 0;
  padding: 14px 24px 10px;
  border-top: 1px solid var(--line);
  background: rgba(251, 247, 238, .95);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 -8px 20px rgba(45, 38, 26, .045);
}
.confirm-bar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -20px;
  height: 20px;
  background: linear-gradient(transparent, rgba(251, 247, 238, .95));
  pointer-events: none;
}
.slot-dots { display: flex; flex-wrap: wrap; gap: 5px; }
.slot {
  min-width: 54px;
  padding: 3px 8px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 2px;
  font-size: 8.5px;
  color: var(--muted-2);
}
.slot.filled { border-style: solid; border-color: var(--line-strong); color: var(--ink); background: rgba(255, 248, 236, .9); }
.stage-foot-note { margin-top: 7px; font-size: 9px; color: var(--muted-2); text-align: right; letter-spacing: .04em; }

.aside-panel { padding: 16px 16px 14px; }
.aside-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.aside-head h3 { font-family: var(--serif); font-size: 14px; letter-spacing: .1em; }
.aside-head small { font-size: 8px; color: var(--muted-2); letter-spacing: .08em; }
.npc-list { margin-top: 8px; }
.npc-row { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.npc-row:last-child { border-bottom: 0; }
.npc-avatar {
  width: 29px;
  height: 29px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fffaf2;
  font-family: var(--serif);
  font-size: 13px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
}
.npc-main { flex: 1; min-width: 0; }
.npc-top { display: flex; justify-content: space-between; align-items: baseline; }
.npc-top b { font-size: 11.5px; font-weight: 600; }
.npc-top span { font-family: var(--num); font-size: 10px; color: var(--muted); }
.rel-bar { height: 2px; margin: 3px 0 2px; background: rgba(31, 43, 63, .09); border-radius: 99px; overflow: hidden; }
.rel-bar i { display: block; height: 100%; border-radius: inherit; transition: width .4s; }
.npc-main small { font-size: 8.5px; color: var(--muted-2); }
.teacher-row { margin-top: 4px; padding-top: 11px; border-top: 1px solid var(--line); }
.journal { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.journal-list { margin-top: 8px; display: grid; gap: 9px; }
.journal-row { padding-left: 9px; border-left: 2px solid transparent; }
.journal-row.major { border-left-color: var(--red); }
.journal-row span { display: block; font-family: var(--num); font-size: 8px; color: var(--muted-2); letter-spacing: .06em; }
.journal-row p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 9.5px;
  line-height: 1.65;
  color: var(--muted);
}
.journal-row.major p { color: var(--ink-2); }
.empty-journal { font-size: 9.5px; color: var(--muted-2); }

/* ───────── 本月手账 ───────── */
.resolution { min-height: 500px; display: flex; flex-direction: column; }
.resolution-head h2 { margin-top: 4px; font-family: var(--serif); font-size: 24px; }
.ledger { margin-top: 16px; flex: 1; }
.ledger-row { display: flex; gap: 13px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.ledger-row:first-child { padding-top: 4px; }
.ledger-glyph {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-family: var(--serif);
  font-size: 14px;
  color: var(--ink);
  background: var(--paper-3);
}
.ledger-body { flex: 1; min-width: 0; }
.ledger-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.ledger-title b { font-size: 12.5px; }
.ledger-title .deltas { margin-top: 0; }
.ledger-body > p { margin-top: 4px; font-family: var(--serif); font-size: 12.5px; line-height: 1.85; color: var(--ink-2); }
.ledger-body > p.micro { margin-top: 5px; padding-left: 9px; border-left: 2px solid rgba(184, 134, 47, .35); font-family: var(--sans); font-size: 10px; color: var(--muted); }
.ledger-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  font-size: 9.5px;
  color: var(--muted);
}
.ledger-foot b { color: var(--ink); }
.life-note {
  display: flex;
  gap: 10px;
  margin-top: 13px;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, .34);
}
.life-note > span { flex: none; padding-top: 2px; font-size: 9px; letter-spacing: .2em; color: var(--muted-2); }
.life-note p { font-family: var(--serif); font-size: 11.5px; line-height: 1.85; color: var(--ink-2); }
.life-note .deltas { margin-top: 4px; }
.resolution > .btn { align-self: flex-end; margin-top: 18px; }

/* ───────── 弹窗 ───────── */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 35, .62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  overflow-y: auto;
  animation: fadeIn .2s ease both;
}
.modal {
  width: min(600px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--paper-2);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 5px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, .38);
  animation: modalIn .32s cubic-bezier(.2, .8, .25, 1) both;
}
.event-banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 26px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, .06), transparent 55%),
    #1f2b3f;
  color: var(--paper-2);
  overflow: hidden;
}
.event-banner::after {
  content: "";
  position: absolute;
  right: -30px;
  top: 50%;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(243, 238, 228, .1);
  border-radius: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.event-glyph {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(243, 238, 228, .35);
  border-radius: 2px;
  font-family: var(--serif);
  font-size: 23px;
  color: #e8c46a;
}
.event-banner .kicker { color: rgba(243, 238, 228, .55); }
.event-banner h2 { margin-top: 3px; font-family: var(--serif); font-size: 25px; letter-spacing: .06em; }
.event-text { padding: 22px 26px 4px; }
.event-text p { margin-bottom: 11px; font-family: var(--serif); font-size: 13.5px; line-height: 2; color: var(--ink-2); }
.event-text p:last-child { margin-bottom: 0; }
.choices { display: grid; gap: 7px; padding: 12px 22px 6px; }
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 13px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 255, 255, .38);
  transition: border-color .18s, background .18s, transform .18s;
}
.choice:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--paper-3);
  transform: translateX(2px);
}
.choice:disabled { opacity: .42; }
.choice-num { font-family: var(--num); font-size: 9px; letter-spacing: .1em; color: var(--muted-2); }
.choice-main { flex: 1; min-width: 0; }
.choice-main b { display: block; font-size: 13px; font-weight: 600; }
.choice-main small { display: block; margin-top: 1px; font-size: 9.5px; color: var(--muted); }
.choice-main small.warn { color: var(--red); }
.choice-arrow { font-size: 12px; color: var(--muted-2); }
.modal-fine { padding: 4px 22px 18px; text-align: center; font-size: 8.5px; color: var(--muted-2); letter-spacing: .08em; }
.result-text { padding-top: 20px; }
.modal > .deltas { padding: 0 26px 4px; }
.modal > .btn { margin: 12px 26px 22px; display: inline-flex; }

/* 成绩单 */
.exam-modal { width: min(560px, 100%); }
.exam-paper { padding: 24px 28px 26px; position: relative; }
.exam-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.exam-head h2 { margin-top: 3px; font-family: var(--serif); font-size: 30px; letter-spacing: .1em; }
.exam-stamp {
  margin-top: 6px;
  padding: 3px 10px;
  border: 1.5px solid rgba(180, 70, 60, .6);
  color: var(--red);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: .14em;
  transform: rotate(-6deg);
}
.exam-total { display: flex; align-items: baseline; gap: 6px; margin: 14px 0 4px; }
.exam-total b { font-family: var(--num); font-size: 74px; font-weight: 300; line-height: 1; letter-spacing: .01em; }
.exam-total span { font-family: var(--num); font-size: 13px; color: var(--muted); }
.exam-total small { margin-left: auto; font-size: 9px; letter-spacing: .2em; color: var(--muted); }
.exam-subjects {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  row-gap: 10px;
  margin: 14px 0 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.exam-subject { text-align: center; border-right: 1px solid var(--line); }
.exam-subject:nth-child(5n) { border-right: 0; }
.exam-subject span { display: block; font-size: 9px; color: var(--muted); letter-spacing: .08em; }
.exam-subject b { font-family: var(--num); font-size: 21px; font-weight: 400; }
.exam-subject small { font-size: 8px; color: var(--muted-2); }
.exam-subject .exam-counted { display: block; font-style: normal; font-size: 8px; letter-spacing: .04em; color: var(--muted-2); }
.exam-note { margin: 0 0 12px; font-size: 9px; line-height: 1.8; color: var(--muted-2); }
.exam-peers { margin: -2px 0 12px; font-size: 9px; line-height: 1.8; color: var(--muted); }
.exam-ranks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 13px 8px;
  background: rgba(31, 43, 63, .055);
}
.exam-ranks > div { text-align: center; }
.exam-ranks span { display: block; font-size: 8.5px; color: var(--muted); letter-spacing: .08em; }
.exam-ranks b { font-family: var(--num); font-size: 20px; font-weight: 400; }
.exam-ranks small { font-size: 8px; color: var(--muted-2); }
.exam-ranks .rank-delta b { font-family: var(--sans); font-size: 12px; letter-spacing: .02em; }
.rank-delta.up b { color: #3f6f52; }
.rank-delta.down b { color: var(--red); }
.exam-comments { display: grid; gap: 9px; margin-top: 14px; }
.exam-comments > div { padding-left: 11px; border-left: 2px solid var(--line); }
.exam-comments span { display: block; font-size: 8.5px; letter-spacing: .12em; color: var(--muted); }
.exam-comments p { margin-top: 2px; font-family: var(--serif); font-size: 12px; line-height: 1.8; color: var(--ink-2); }
.exam-paper > .deltas { margin-top: 12px; }
.exam-paper > .btn { margin-top: 18px; }

/* 确认 */
.confirm-modal { width: min(420px, 100%); padding: 28px 28px 24px; }
.confirm-modal h2 { margin-top: 8px; font-family: var(--serif); font-size: 23px; }
.confirm-modal > p { margin-top: 9px; font-size: 12px; line-height: 1.9; color: var(--muted); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }

/* ───────── 结局 ───────── */
.ending-screen { max-width: 1100px; padding-top: 36px; }
.ending-hero { position: relative; padding-bottom: 30px; border-bottom: 1px solid var(--line-strong); }
.ending-hero::after {
  content: "毕业";
  position: absolute;
  right: 0;
  top: 30px;
  font-family: var(--serif);
  font-size: 100px;
  line-height: 1;
  letter-spacing: .08em;
  color: rgba(180, 70, 60, .07);
  pointer-events: none;
}
.ending-top { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 40px; }
.ending-hero h1 {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: clamp(38px, 5.2vw, 62px);
  letter-spacing: .05em;
  line-height: 1.25;
}
.ending-lede { margin-top: 16px; max-width: 640px; font-family: var(--serif); font-size: 15px; line-height: 2; color: var(--ink-2); }
.ending-score {
  display: flex;
  align-items: flex-end;
  gap: 30px;
  margin: 28px 0 16px;
}
.score-block span, .school-block span { display: block; font-size: 9px; letter-spacing: .24em; color: var(--muted); }
.score-block b { font-family: var(--num); font-size: 74px; font-weight: 300; line-height: 1; color: var(--red); }
.score-block small { font-family: var(--num); font-size: 10px; color: var(--muted); margin-left: 4px; }
.score-arrow { padding-bottom: 18px; font-size: 18px; color: var(--muted-2); }
.school-block b { display: block; font-family: var(--serif); font-size: 27px; line-height: 1.45; letter-spacing: .04em; }
.school-block small { display: block; margin-top: 2px; font-size: 9px; letter-spacing: .14em; color: var(--muted); }
.ending-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.ending-tags span {
  padding: 3px 11px;
  border: 1px solid var(--line-strong);
  font-size: 9.5px;
  letter-spacing: .08em;
  color: var(--ink-2);
}
.ending-tags span:first-child { border-color: var(--red); color: var(--red); }
.ending-line {
  margin-top: 22px;
  max-width: 760px;
  padding-left: 16px;
  border-left: 2px solid rgba(180, 70, 60, .55);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 2;
  color: var(--ink-2);
}
.ending-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 26px; }
.ending-body { display: grid; gap: 18px; margin-top: 26px; }
.ending-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.radar-panel, .comment-panel { padding: 18px 20px; }
.radar { width: 100%; height: auto; max-width: 360px; margin: 4px auto 0; }
.radar-grid { fill: none; stroke: rgba(31, 43, 63, .11); stroke-width: 1; }
.radar-axis { stroke: rgba(31, 43, 63, .1); stroke-width: 1; }
.radar-data { fill: rgba(180, 70, 60, .16); stroke: var(--red); stroke-width: 1.5; stroke-linejoin: round; }
.radar-label { font-family: var(--serif); font-size: 9px; fill: var(--muted); }
.comment-block { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.comment-block:last-child { border-bottom: 0; padding-bottom: 0; }
.comment-block span { font-size: 8.5px; letter-spacing: .16em; color: var(--muted); }
.comment-block p { margin-top: 4px; font-family: var(--serif); font-size: 13px; line-height: 1.95; color: var(--ink-2); }
.timeline-panel, .classmates-panel { padding: 18px 20px 20px; }
.choices-panel { padding: 18px 20px 20px; }
.choice-log { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; margin-top: 12px; }
.choice-log-row { padding-left: 12px; border-left: 1px solid var(--line-strong); }
.choice-log-row span { display: block; font-family: var(--num); font-size: 8px; color: var(--red); letter-spacing: .08em; }
.choice-log-row p { margin-top: 2px; font-size: 10.5px; line-height: 1.7; color: var(--muted); }
.choice-log-row b { font-weight: 600; color: var(--ink-2); }
.timeline-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 22px; margin-top: 14px; }
.timeline-item { padding-left: 12px; border-left: 1px solid var(--line-strong); }
.timeline-item span { display: block; font-family: var(--num); font-size: 8px; letter-spacing: .1em; color: var(--red); }
.timeline-item p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
  font-size: 10.5px;
  line-height: 1.75;
  color: var(--muted);
}
.classmate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.classmate-card { padding: 13px 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .28); }
.classmate-top { display: flex; align-items: center; gap: 9px; }
.classmate-top b { display: block; font-family: var(--serif); font-size: 14px; }
.classmate-top small { display: block; font-size: 8px; color: var(--muted); }
.classmate-top em { margin-left: auto; font-family: var(--num); font-style: normal; font-size: 11px; color: var(--red); }
.classmate-card p { margin-top: 8px; font-size: 10px; line-height: 1.8; color: var(--muted); }
.ending-fine { margin-top: 8px; text-align: center; font-size: 9px; color: var(--muted-2); letter-spacing: .08em; }

/* ───────── 页脚 / 提示 ───────── */
.game-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 8.5px;
  letter-spacing: .08em;
  color: var(--muted-2);
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 300;
  transform: translate(-50%, 16px);
  max-width: calc(100% - 32px);
  padding: 10px 20px;
  background: #1f2b3f;
  color: var(--paper-2);
  border-radius: 3px;
  font-size: 11px;
  letter-spacing: .04em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.noscript {
  max-width: 560px;
  margin: 80px auto;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  font-size: 13px;
  text-align: center;
}

/* ───────── 动效 ───────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ───────── 阅读字号与首行高度 ───────── */
body { font-size: 15px; line-height: 1.85; }
.kicker, .eyebrow, .title-mark, .link-btn { font-size: 11px; }
.save-hint, .admission-note, .disclaimer { font-size: 10.5px; }
.title-fineprint { font-size: 10px; }
.btn { font-size: 13px; }
.btn.small { font-size: 12px; }
.lede { font-size: 18px; }
.admission-body { font-size: 13.5px; }
.admission-head { font-size: 13px; }
.admission-meta { font-size: 11.5px; }
.setup-sub { font-size: 15px; }
.character-bio { font-size: 15px; line-height: 2; }
.character-tags span { font-size: 10px; }
.character-stat { font-size: 11px; }
.cast-card b { font-size: 15px; }
.cast-card small { font-size: 9.5px; }
.cast-card p { font-size: 11px; line-height: 1.75; }
.lottery-sub { font-size: 12px; }
.lottery-status { font-size: 13px; }
.lottery-sync-tip { font-size: 10.5px; }
.lottery-fine { font-size: 10.5px; }
.class-sub { font-size: 12px; }
.msg span { font-size: 10px; }
.msg p { font-size: 13px; }
.school-id b { font-size: 16px; }
.school-id small { font-size: 10.5px; }
.top-progress-label { font-size: 10.5px; }
.chip { font-size: 10px; }
.month-note { font-size: 15.5px; }
.countdown { font-size: 10px; }
.stage-head h2 { font-size: 27px; }
.slots { font-size: 11px; }
.action-title b { font-size: 13.5px; }
.action-title small { font-size: 9.5px; }
.action-desc { font-size: 11.5px; }
.action-effects span { font-size: 9.5px; }
.action-lock { font-size: 9.5px; }
.stage-foot-note { font-size: 10px; }
.stat-top { font-size: 11px; }
.stat-top b { font-size: 13px; }
.profile-foot span { font-size: 10px; }
.profile-foot b { font-size: 17px; }
.profile-tip { font-size: 9.5px; }
.life-rows > div { font-size: 10.5px; }
.life-note p { font-size: 12.5px; }
.npc-top b { font-size: 12.5px; }
.npc-top span { font-size: 11px; }
.npc-main small { font-size: 9.5px; }
.npc-group-label { margin: 11px 0 4px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 9px; letter-spacing: .18em; color: var(--muted-2); }
.teacher-row { border-top: 0; padding-top: 7px; }
.journal-row span { font-size: 9px; }
.journal-row p { font-size: 10.5px; }
.aside-head h3 { font-size: 15px; }
.aside-head small { font-size: 9px; }
.event-text p { font-size: 15px; line-height: 1.95; }
.ledger-body > p { font-size: 13.5px; line-height: 1.9; }
.ledger-title b { font-size: 13.5px; }
.ledger-foot { font-size: 10.5px; }
.choice-main b { font-size: 14px; }
.choice-main small { font-size: 10.5px; }
.modal-fine { font-size: 9.5px; }
.event-banner h2 { font-size: 27px; }
.exam-head h2 { font-size: 32px; }
.exam-subject span { font-size: 10px; }
.exam-subject small { font-size: 9px; }
.exam-ranks span { font-size: 9.5px; }
.exam-ranks small { font-size: 9px; }
.exam-comments span { font-size: 9.5px; }
.exam-comments p { font-size: 13.5px; }
.ending-lede { font-size: 16px; }
.ending-tags span { font-size: 10.5px; }
.comment-block span { font-size: 9.5px; }
.comment-block p { font-size: 14.5px; }
.timeline-item span { font-size: 9px; }
.timeline-item p { font-size: 11.5px; }
.classmate-card p { font-size: 11px; }
.ending-fine { font-size: 10px; }
.game-foot { font-size: 9.5px; }
.toast { font-size: 12px; }

/* 中英混排时把首行与末行的字面高度裁齐，避免数字/引号把第一行顶高 */
.event-text p,
.lede,
.ending-lede,
.month-note,
.character-bio,
.ledger-body > p,
.comment-block p,
.sem-month p,
.sem-memory p,
.exam-comments p,
.msg p {
  text-box-trim: trim-both;
  text-box-edge: cap alphabetic;
}

/* ───────── 时间轴 / 快进 ───────── */
.timeline-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 14px;
  padding: 10px 14px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 252, 244, .55);
}
.sem-track { position: relative; flex: 1; min-width: 0; display: flex; align-items: flex-start; }
.sem-track::before {
  content: "";
  position: absolute;
  left: 7%;
  right: 7%;
  top: 4px;
  height: 1px;
  background: var(--line-strong);
}
.sem-node {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0;
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: .06em;
  transition: color .18s;
}
.sem-node i {
  width: 8px;
  height: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--paper-2);
  transition: background .18s, border-color .18s, box-shadow .18s;
}
.sem-node span { white-space: nowrap; }
.sem-node.past { color: var(--muted); }
.sem-node.past i { background: var(--ink-2); border-color: var(--ink-2); }
.sem-node.now { color: var(--red); }
.sem-node.now i { background: var(--red); border-color: var(--red); box-shadow: 0 0 0 4px rgba(180, 70, 60, .12); }
.sem-node:disabled { opacity: .5; cursor: default; }
.sem-node:not(:disabled):hover { color: var(--ink); }
.ff-box { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ff-label { font-size: 9px; letter-spacing: .16em; color: var(--muted-2); }
.ff-toggle {
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--muted);
  background: transparent;
  transition: all .18s;
}
.ff-toggle:hover { border-color: var(--ink); color: var(--ink); }
.ff-toggle.on { background: var(--red); border-color: var(--red); color: var(--paper-2); }
.ff-speeds { display: flex; gap: 3px; }
.ff-speed {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--num);
  font-size: 9px;
  color: var(--muted-2);
}
.ff-speed.on { background: var(--ink); border-color: var(--ink); color: var(--paper-2); }
.ff-live { font-size: 8.5px; letter-spacing: .06em; color: var(--red); white-space: nowrap; }
.auto-pause { margin-left: 10px; font-size: 9.5px; color: var(--red); border-bottom: 1px dotted currentColor; }
.timeline-modal { width: min(760px, 100%); }
.timeline-modal-head {
  padding: 22px 26px 16px;
  border-bottom: 1px solid var(--line);
  background: #1f2b3f;
  color: var(--paper-2);
}
.timeline-modal-head .kicker { color: rgba(243, 238, 228, .55); }
.timeline-modal-head h2 { margin-top: 4px; font-family: var(--serif); font-size: 30px; letter-spacing: .08em; }
.timeline-modal-head > span { display: block; margin-top: 4px; font-family: var(--num); font-size: 9px; letter-spacing: .12em; color: rgba(243, 238, 228, .5); }
.timeline-modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  padding: 18px 26px 8px;
  max-height: 58vh;
  overflow-y: auto;
}
.sem-months { display: grid; gap: 8px; align-content: start; }
.sem-month { display: flex; gap: 10px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.sem-month > span { flex-shrink: 0; font-family: var(--num); font-size: 9px; color: var(--red); letter-spacing: .06em; }
.sem-month p { font-family: var(--serif); font-size: 11.5px; line-height: 1.8; color: var(--ink-2); }
.sem-month em { display: inline-block; margin-left: 5px; font-style: normal; font-size: 8px; letter-spacing: .06em; color: var(--red); }
.sem-memories { display: grid; gap: 10px; align-content: start; }
.sem-memory { padding-left: 10px; border-left: 2px solid rgba(180, 70, 60, .35); }
.sem-memory span { display: block; font-family: var(--num); font-size: 8px; color: var(--muted-2); letter-spacing: .08em; }
.sem-memory p {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--muted);
}
.sem-empty { padding: 10px 0; font-size: 10.5px; color: var(--muted-2); }
.timeline-close { margin: 10px 26px 22px; }

/* ───────── 分支回顾 ───────── */
.routes-modal { width: min(760px, 100%); }
.routes-head {
  padding: 22px 26px 16px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, .06), transparent 55%),
    #1f2b3f;
  color: var(--paper-2);
}
.routes-head .kicker { color: rgba(243, 238, 228, .55); }
.routes-head h2 { margin-top: 4px; font-family: var(--serif); font-size: 30px; letter-spacing: .08em; }
.routes-head > p:last-child { margin-top: 4px; font-size: 9px; letter-spacing: .1em; color: rgba(243, 238, 228, .5); }
.routes-body { padding: 16px 26px 4px; max-height: 60vh; overflow-y: auto; }
.routes-save { margin-bottom: 12px; }
.routes-section { margin-top: 18px; }
.routes-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line-strong); }
.routes-section-head h3 { font-family: var(--serif); font-size: 16px; letter-spacing: .08em; }
.routes-section-head small { font-size: 8.5px; color: var(--muted-2); letter-spacing: .06em; }
.routes-hint { margin: 8px 0 2px; font-size: 9px; line-height: 1.8; color: var(--muted-2); }
.route-ending, .route-cp { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.route-main { flex: 1; min-width: 0; }
.route-main b { display: block; font-size: 12.5px; font-weight: 600; }
.route-main span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.7;
  color: var(--muted);
}
.route-btn {
  flex-shrink: 0;
  padding: 5px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  font-size: 9.5px;
  letter-spacing: .04em;
  color: var(--muted);
  background: transparent;
  transition: all .18s;
}
.route-btn:hover { background: var(--ink); border-color: var(--ink); color: var(--paper-2); }
.routes-empty { padding: 12px 0; font-size: 10px; color: var(--muted-2); }
.routes-close { margin: 10px 26px 22px; }

/* ───────── 云端同步 ───────── */
.cloud-link::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 6px;
  border-radius: 50%;
  background: #7d9b7a;
  vertical-align: 1px;
}
.cloud-modal { width: min(620px, 100%); }
.cloud-head {
  padding: 22px 26px 16px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, .06), transparent 55%),
    #1f2b3f;
  color: var(--paper-2);
}
.cloud-head .kicker { color: rgba(243, 238, 228, .55); }
.cloud-head h2 { margin-top: 4px; font-family: var(--serif); font-size: 28px; letter-spacing: .06em; }
.cloud-status-line { margin-top: 6px; font-size: 9.5px; line-height: 1.8; color: rgba(243, 238, 228, .58); }
.cloud-body { padding: 18px 26px 4px; max-height: 62vh; overflow-y: auto; }
.cloud-local-note {
  margin-bottom: 14px;
  padding: 9px 11px;
  border: 1px dashed var(--line-strong);
  font-size: 9.5px;
  line-height: 1.8;
  color: var(--muted);
  background: rgba(255, 255, 255, .28);
}
.cloud-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.cloud-row b { display: block; font-size: 12.5px; font-weight: 600; }
.cloud-row small { display: block; margin-top: 3px; font-size: 9px; color: var(--muted-2); }
.cloud-toggle, .cloud-mini-btn {
  flex-shrink: 0;
  padding: 6px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  font-size: 9.5px;
  color: var(--ink-2);
  background: transparent;
}
.cloud-toggle:hover, .cloud-mini-btn:hover { background: var(--ink); border-color: var(--ink); color: var(--paper-2); }
.cloud-code { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 15px; padding: 11px 12px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .3); }
.cloud-code small { display: block; margin-bottom: 5px; font-size: 8.5px; letter-spacing: .1em; color: var(--muted-2); }
.cloud-code code { display: block; font-family: var(--mono); font-size: 19px; line-height: 1.4; letter-spacing: .18em; color: var(--ink-2); word-break: break-all; user-select: all; }
.cloud-bind { display: block; margin-top: 15px; font-size: 9px; letter-spacing: .06em; color: var(--muted); }
.cloud-bind input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: rgba(255, 255, 255, .45);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
  outline: none;
}
.cloud-bind input:focus { border-color: var(--ink-3); background: #fffdf8; }
.cloud-bind-btn { margin-top: 8px; }
.cloud-actions { display: flex; gap: 10px; margin-top: 16px; }
.cloud-actions .btn { flex: 1; }
.cloud-delete {
  display: block;
  margin-top: 18px;
  padding: 7px 0;
  border: 0;
  border-top: 1px dashed var(--line);
  width: 100%;
  font-size: 9px;
  letter-spacing: .08em;
  color: var(--muted-2);
  background: transparent;
}
.cloud-delete:hover { color: var(--red); }
.cloud-note { margin-top: 13px; font-size: 9px; line-height: 1.9; color: var(--muted-2); }
.cloud-close { margin: 10px 26px 22px; }

/* ───────── 响应式 ───────── */
@media (max-width: 1180px) {
  .game-grid { grid-template-columns: 236px minmax(0, 1fr) 268px; gap: 14px; }
  .screen { padding-inline: 30px; }
  .title-hero { gap: 42px; }
}
@media (max-width: 1020px) {
  .game-grid { grid-template-columns: 220px minmax(0, 1fr); }
  .aside-panel { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .aside-panel .journal { margin-top: 0; padding-top: 0; border-top: 0; }
  .title-hero { grid-template-columns: 1fr; gap: 42px; padding-top: 40px; }
  .admission-wrap { align-items: flex-start; max-width: 390px; }
  .title-foot { flex-wrap: wrap; gap: 24px 36px; }
  .disclaimer { margin-left: 0; text-align: left; max-width: 100%; }
}
@media (max-width: 820px) {
  .screen { padding: 20px 20px 40px; }
  .title-name { font-size: clamp(58px, 14vw, 92px); }
  .title-hero { padding: 30px 0; }
  .lede { margin-top: 26px; font-size: 16px; }
  .setup-form { padding: 24px 20px; }
  .talent-grid { grid-template-columns: repeat(3, 1fr); }
  .game-top { flex-wrap: wrap; gap: 12px 20px; }
  .top-progress { order: 3; flex-basis: 100%; max-width: none; }
  .top-tools { gap: 12px; }
  .timeline-bar { flex-wrap: wrap; gap: 8px; }
  .sem-track { order: 2; flex-basis: 100%; }
  .ff-box { order: 1; margin-left: auto; }
  .game-grid { grid-template-columns: 1fr; }
  .profile-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; align-items: start; }
  .student-card { grid-column: 1 / -1; }
  .stats { grid-template-columns: 1fr 1fr; gap: 8px 16px; }
  .profile-foot { margin-top: 12px; padding-top: 10px; }
  .profile-tip { display: none; }
  .aside-panel { grid-column: auto; grid-template-columns: 1fr 1fr; }
  .stage-panel { min-height: 0; }
  .actions { grid-template-columns: 1fr 1fr; }
  .ending-grid { grid-template-columns: 1fr; }
  .ending-hero::after { font-size: 70px; opacity: .6; }
  .timeline-list { grid-template-columns: 1fr; }
  .choice-log { grid-template-columns: 1fr; }
}
@media (max-width: 580px) {
  body { font-size: 13px; }
  .screen { padding: 16px 14px 34px; }
  .title-top { justify-content: space-between; gap: 12px; }
  .title-top .title-mark { font-size: 9px; letter-spacing: .14em; }
  .title-name { font-size: clamp(54px, 17vw, 76px); }
  .title-en { font-size: 8px; letter-spacing: .36em; }
  .title-actions { flex-direction: column; align-items: stretch; }
  .title-actions .btn { width: 100%; }
  .admission { transform: none; width: 100%; }
  .title-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
  .fact b { font-size: 22px; }
  .setup-form { gap: 26px; margin-top: 28px; }
  .setup-head h1 { font-size: 27px; letter-spacing: .04em; }
  .character-card { padding: 20px 18px 18px; }
  .character-top { gap: 12px; }
  .student-avatar.big { width: 58px; height: 58px; font-size: 24px; }
  .character-id b { font-size: 26px; }
  .character-stats { grid-template-columns: 1fr 1fr; gap: 9px 16px; }
  .cast-head { flex-direction: column; align-items: flex-start; gap: 2px; }
  .cast-grid { grid-template-columns: 1fr; }
  .choice-grid { grid-template-columns: 1fr; }
  .talent-grid { grid-template-columns: 1fr 1fr; }
  .name-row { flex-wrap: wrap; }
  .setup-submit { margin-top: 26px; }
  .class-paper { padding: 36px 22px 70px; }
  .msg { max-width: 96%; }
  .class-stamp { right: 20px; bottom: 22px; width: 70px; height: 70px; font-size: 20px; }
  .game-top { gap: 10px 14px; }
  .school-badge { width: 34px; height: 34px; font-size: 17px; }
  .top-tools { gap: 10px; }
  .timeline-bar { padding: 8px 10px; }
  .sem-node { font-size: 9px; }
  .ff-live { display: none; }
  .timeline-modal-head { padding: 18px 18px 14px; }
  .timeline-modal-head h2 { font-size: 26px; }
  .timeline-modal-body { grid-template-columns: 1fr; gap: 16px; padding: 16px 18px 6px; max-height: 62vh; }
  .timeline-close { margin: 8px 18px 18px; }
  .routes-head { padding: 18px 18px 14px; }
  .routes-head h2 { font-size: 26px; }
  .routes-body { padding: 12px 16px 2px; max-height: 62vh; }
  .routes-close { margin: 8px 18px 18px; }
  .route-ending, .route-cp { gap: 8px; }
  .route-btn { font-size: 9px; padding: 5px 7px; }
  .cloud-head { padding: 18px 18px 14px; }
  .cloud-head h2 { font-size: 24px; }
  .cloud-body { padding: 14px 16px 2px; max-height: 64vh; }
  .cloud-close { margin: 8px 18px 18px; }
  .cloud-code code { font-size: 17px; }
  .cloud-actions .btn { font-size: 11px; }
  .profile-panel { display: block; padding: 15px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stage-panel { padding: 16px 15px 16px; }
  .confirm-bar { margin-inline: -15px; padding-inline: 15px; }
  .month-date { width: 58px; padding-right: 10px; }
  .month-date b { font-size: 36px; }
  .month-note { font-size: 13.5px; }
  .actions { grid-template-columns: 1fr; }
  .action-desc { font-size: 11px; }
  .stage-head h2 { font-size: 22px; }
  .confirm-bar { flex-direction: row; align-items: center; }
  .confirm-bar .btn { width: auto; flex: 1; max-width: 220px; min-height: 38px; }
  .slot-dots { display: none; }
  .stage-foot-note { text-align: center; }
  .aside-panel { display: block; }
  .aside-panel .journal { margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line); }
  .ledger-row { gap: 10px; }
  .ledger-foot { flex-direction: column; gap: 4px; }
  .resolution > .btn { align-self: stretch; }
  .modal-mask { padding: 10px; }
  .modal { max-height: calc(100vh - 20px); }
  .event-banner { padding: 16px 18px; gap: 12px; }
  .event-glyph { width: 42px; height: 42px; font-size: 19px; }
  .event-banner h2 { font-size: 23px; }
  .event-text { padding: 18px 18px 2px; }
  .event-text p { font-size: 14px; }
  .choices { padding: 10px 14px 4px; }
  .choice { padding: 11px; gap: 9px; }
  .choice-main b { font-size: 13.5px; }
  .choice-main small { font-size: 10.5px; }
  .modal-fine { padding-bottom: 14px; }
  .exam-paper { padding: 20px 16px 20px; }
  .exam-total b { font-size: 58px; }
  .exam-subjects { grid-template-columns: 1fr 1fr; row-gap: 8px; }
  .exam-subject:nth-child(5n) { border-right: 1px solid var(--line); }
  .exam-subject:nth-child(2n) { border-right: 0; }
  .exam-ranks { gap: 2px; }
  .exam-ranks b { font-size: 17px; }
  .exam-ranks .rank-delta b { font-size: 10.5px; }
  .ending-top { margin-bottom: 24px; }
  .ending-top .title-mark { font-size: 9px; letter-spacing: .14em; }
  .ending-score { flex-direction: column; align-items: flex-start; gap: 14px; }
  .score-arrow { display: none; }
  .score-block b { font-size: 62px; }
  .school-block b { font-size: 24px; }
  .ending-actions { flex-direction: column; align-items: stretch; }
  .ending-actions .btn { width: 100%; }
  .radar-panel, .comment-panel, .timeline-panel, .classmates-panel { padding: 15px; }
  .classmate-grid { grid-template-columns: 1fr; }
  .game-foot { flex-direction: column; gap: 3px; text-align: center; }
}

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

@media print {
  @page { margin: 14mm; }
  body { background: #fff; }
  body::before, .ending-actions, .toast, .skip, .game-top, .game-foot { display: none !important; }
  .screen { max-width: none; padding: 0; animation: none; }
  .ending-hero { break-inside: avoid; }
  .ending-body { gap: 12px; }
  .panel { box-shadow: none; background: #fff; break-inside: avoid; }
  .ending-hero::after { color: rgba(180, 70, 60, .1); }
  .ending-tags span { border-color: #999; }
}

/* 2026.10 · 手账里的持续支线与行动预算 */
.story-panel { margin: 0 0 22px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 8px; background: #eae8dc; }
.story-panel .aside-head { margin-bottom: 12px; }
.story-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.story-card { padding: 14px 16px; background: #faf7ee; border-left: 3px solid #557968; box-shadow: 0 2px 7px #453d2a06; }
.story-card:nth-child(2) { border-color: #ac8150; }
.story-card:nth-child(3) { border-color: #8d6675; }
.story-card > div:first-child { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.story-card b { font-family: var(--serif); font-size: 17px; font-weight: 500; }
.story-card span { color: #736b5d; font-size: 11px; white-space: nowrap; }
.story-card p { color: #655f54; font-size: 12px; line-height: 1.8; margin: 8px 0 12px; }
.story-steps { display: flex; gap: 5px; }
.story-steps i { display: block; height: 3px; flex: 1; background: #ded8c9; border-radius: 3px; }
.story-steps .done { background: #557968; }
.planning-note { padding: 12px 15px; border-left: 2px solid #ac8150; background: #ede8da80; margin: 0 0 18px; }
.planning-note b { font-size: 12px; color: #685533; }
.planning-note p, .maintenance-note p { font-size: 11px; color: #756c5b; line-height: 1.8; margin: 5px 0 0; }
.budget-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px; padding: 16px 0 8px; color: #625b4e; font-size: 12px; }
.budget-line b { color: #304f46; font-size: 15px; }
.budget-line span { margin-left: auto; font-size: 10px; color: #817563; }
.maintenance-note { border-top: 1px dashed var(--line); padding: 15px 0; }
.maintenance-note b { font-size: 12px; }
.maintenance-note .deltas { margin-top: 8px; }
button:focus-visible, input:focus-visible { outline: 3px solid #3f786e; outline-offset: 3px; }
.choice:disabled { opacity: .65; }
.story-ending { margin: 0; }
@media (max-width:700px) {
  .story-panel { padding: 13px; margin-bottom: 15px; }
  .story-grid { grid-template-columns: 1fr; gap: 8px; }
  .story-card { padding: 10px 13px; }
  .story-card p { margin: 4px 0 8px; font-size: 11px; }
  .story-card b { font-size: 15px; }
  .budget-line span { width: 100%; margin-left: 0; }
  .action-card { min-height: 100px; }
  .choice { min-height: 58px; }
}
@media print { .story-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } .story-panel { break-inside: avoid; } }
.action-filters { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 15px; }
.action-filters button { min-height: 36px; padding: 6px 13px; border: 1px solid var(--line); border-radius: 4px; background: transparent; color: #736959; font: inherit; font-size: 12px; cursor: pointer; }
.action-filters [aria-pressed="true"] { color: #fffaf1; background: #436b61; border-color: #436b61; }
.confirm-bar { position: static; }
.confirm-bar::before { display: none; }
