/* ============================================================
   题王的光辉岁月 · t1
   纸感、留白、细线；刷题按钮是唯一的视觉重心。
   ============================================================ */

@font-face {
  font-family: "T2Traditional";
  src: url("./font/ChenYuluoyan-2.0-Thin.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "T2Simplified";
  src: url("./font/MaokenYingBiKaiShuJ_0.10.ttf") format("truetype");
  font-display: swap;
}

:root {
  --paper: #f5f2eb;
  --paper-2: #efe9dd;
  --surface: rgba(255, 253, 248, 0.86);
  --surface-solid: #fbf9f4;
  --ink: #1c1b18;
  --ink-soft: #4b4841;
  --muted: #8b8578;
  --line: #ddd6c8;
  --line-strong: #c9c0af;
  --red: #c5342b;
  --red-bright: #e03a2f;
  --green: #2f9e6e;
  --green-deep: #1f7a55;
  --blue: #2f6fed;
  --orange: #d98621;
  --purple: #8e44ad;
  --gold: #b8860b;
  --gold-bright: #e7c25a;
  --shadow: 0 12px 34px rgba(53, 42, 22, 0.07);
  --shadow-soft: 0 4px 18px rgba(53, 42, 22, 0.05);
  --radius: 18px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", "Source Han Serif SC", serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --font-t2-trad: "T2Traditional", "Songti SC", "STSong", "SimSun", serif;
  --font-t2-simp: "T2Simplified", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-t2: var(--font-t2-trad);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body.game-active {
  overflow: hidden;
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--font-sans);
  background:
    radial-gradient(1200px 700px at 12% -8%, rgba(231, 194, 90, 0.12), transparent 60%),
    radial-gradient(900px 600px at 104% 20%, rgba(47, 111, 237, 0.045), transparent 55%),
    linear-gradient(180deg, #f8f5ef 0%, var(--paper) 45%, #f1ede4 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.38;
  background-image:
    linear-gradient(rgba(80, 65, 40, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 65, 40, 0.028) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at 50% 48%, #000 0%, transparent 78%);
}

body.t2-mode {
  --paper: #f3f3f3;
  --paper-2: #e8e8e8;
  --surface: rgba(252, 252, 252, 0.9);
  --surface-solid: #f7f7f7;
  --ink: #111111;
  --ink-soft: #333333;
  --muted: #666666;
  --line: #c5c5c5;
  --line-strong: #aaaaaa;
  --red: #4a4a4a;
  --red-bright: #4a4a4a;
  --green: #555555;
  --blue: #555555;
  --orange: #555555;
  --purple: #555555;
  --gold: #555555;
  --gold-bright: #888888;
  background: #ffffff;
}

body.t2-mode::before {
  opacity: 0.1;
}

body.t2-mode .gold-text {
  color: #555555;
}

body.t2-font-simp {
  --font-t2: var(--font-t2-simp);
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  touch-action: manipulation;
}

button:disabled {
  cursor: default;
}

h1,
h2,
h3,
p {
  margin: 0;
}

::selection {
  background: rgba(231, 194, 90, 0.4);
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
}

.view {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
}

.view.active {
  display: flex;
  flex-direction: column;
}

.gold-text {
  background: linear-gradient(180deg, #f9edb8 0%, #e9c65f 36%, #c69722 66%, #8f6808 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 10px rgba(184, 134, 11, 0.22));
}

/* ============================================================
   开场
   ============================================================ */

.view-splash {
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(700px 500px at 50% 38%, rgba(231, 194, 90, 0.16), transparent 65%),
    linear-gradient(180deg, #fdfcf9, #f5f2eb);
}

.splash-inner {
  text-align: center;
  padding: 28px;
  animation: splashIn 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.splash-title {
  font-family: var(--font-serif);
  font-size: clamp(38px, 7vw, 76px);
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.1;
}

.splash-sub {
  margin-top: 20px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.22em;
}

.splash-warning {
  margin-top: 26px;
  color: rgba(150, 46, 38, 0.72);
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1.8;
}

@keyframes splashIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   起名 / 登录
   ============================================================ */

.view-login {
  align-items: center;
  justify-content: center;
  padding: 30px 18px;
}

.login-inner {
  width: min(470px, 100%);
  animation: fadeUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.login-brand {
  text-align: center;
  margin-bottom: 38px;
}

.login-title {
  font-family: var(--font-serif);
  font-size: clamp(30px, 6vw, 44px);
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.login-tagline {
  margin-top: 14px;
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: 0.08em;
}

.login-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.login-form label {
  display: block;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.name-row {
  display: flex;
  gap: 10px;
}

#name-input {
  min-width: 0;
  flex: 1;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 19px;
  letter-spacing: 0.16em;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

#name-input::placeholder {
  color: #b6afa2;
  font-size: 14px;
  letter-spacing: 0.06em;
}

#name-input:focus {
  border-color: rgba(184, 134, 11, 0.72);
  background: #fffdf8;
  box-shadow: 0 0 0 4px rgba(231, 194, 90, 0.16);
}

.login-hint {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.login-footnote {
  margin-top: 24px;
  color: #a39b8c;
  font-size: 11px;
  line-height: 1.8;
  text-align: center;
}

.form-error {
  min-height: 18px;
  margin-top: 10px;
  color: var(--red);
  font-size: 12px;
  line-height: 1.5;
}

.primary-btn {
  min-height: 48px;
  padding: 0 28px;
  border-radius: 12px;
  color: #1f1a0d;
  background: linear-gradient(180deg, #f3dc93, #dec06b 55%, #c9a44a);
  box-shadow:
    0 6px 18px rgba(184, 134, 11, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  font-weight: 700;
  letter-spacing: 0.12em;
  transition: transform 0.16s, box-shadow 0.2s, filter 0.2s;
}

.primary-btn:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.primary-btn:active {
  transform: translateY(1px) scale(0.99);
}

.primary-btn:disabled {
  opacity: 0.56;
  transform: none;
  filter: grayscale(0.4);
}

.primary-btn.danger-btn {
  color: #fff;
  background: linear-gradient(180deg, #d9534a, #c5342b 58%, #a72620);
  box-shadow:
    0 6px 18px rgba(197, 52, 43, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.outline-btn {
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 0.04em;
  transition: border-color 0.2s, background 0.2s, transform 0.16s;
}

.outline-btn:hover {
  border-color: rgba(184, 134, 11, 0.6);
  background: #fffdf7;
}

.outline-btn:active {
  transform: scale(0.99);
}

.ghost-btn {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 0.03em;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.ghost-btn:hover {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--ink);
}

.ghost-btn.danger {
  color: var(--red);
}

.ghost-btn.danger:hover {
  border-color: rgba(197, 52, 43, 0.5);
  background: rgba(197, 52, 43, 0.06);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   序幕
   ============================================================ */

.view-intro {
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(800px 500px at 50% 50%, rgba(231, 194, 90, 0.06), transparent 70%),
    #fcfbf8;
  overflow: hidden;
}

.intro-stage {
  position: relative;
  width: min(820px, calc(100% - 48px));
  min-height: 180px;
  display: grid;
  place-items: center;
  text-align: center;
}

.intro-line {
  font-family: var(--font-serif);
  font-size: clamp(18px, 3.4vw, 27px);
  line-height: 1.9;
  letter-spacing: 0.06em;
  color: #292721;
  transition: opacity 0.38s ease, transform 0.38s ease, filter 0.38s ease;
  max-width: 100%;
}

.intro-line.typing::after {
  content: "▌";
  display: inline-block;
  margin-left: 2px;
  color: var(--gold);
  animation: cursorBlink 0.8s steps(2) infinite;
}

.intro-line.fade {
  opacity: 0;
  transform: translateY(-8px);
  filter: blur(2px);
}

.intro-title {
  position: absolute;
  opacity: 0;
  transform: scale(0.92);
  font-family: var(--font-serif);
  font-size: clamp(42px, 8vw, 88px);
  font-weight: 900;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.intro-title.show {
  animation: titleReveal 1.5s cubic-bezier(0.18, 0.84, 0.24, 1) forwards;
}

.intro-skip {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 5;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.intro-skip:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

@keyframes cursorBlink {
  50% {
    opacity: 0;
  }
}

@keyframes titleReveal {
  0% {
    opacity: 0;
    transform: scale(0.9);
    filter: blur(8px);
  }
  40% {
    opacity: 1;
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ============================================================
   主页面
   ============================================================ */

.view-game {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.topbar {
  flex: 0 0 auto;
  border-bottom: 1px solid rgba(201, 192, 175, 0.6);
  background: rgba(250, 248, 242, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.topbar-inner {
  width: min(1180px, 100%);
  min-height: 54px;
  margin: 0 auto;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.brand-user {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.next-exam {
  margin-left: auto;
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.next-exam b {
  color: var(--red);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.top-actions {
  display: flex;
  gap: 7px;
}

/* 日志 */

.log-strip {
  flex: 0 0 auto;
  border-bottom: 1px solid rgba(221, 214, 200, 0.65);
  background: rgba(255, 253, 248, 0.6);
}

.log-strip-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 6px 20px 8px;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.log-heading {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  padding: 2px 0;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.log-heading .link-btn {
  justify-content: flex-start;
  font-size: 10px;
}

.log-stream {
  height: 76px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1px;
  padding: 2px 0;
  mask-image: linear-gradient(to bottom, transparent 0, #000 14%);
}

.log-line {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-height: 14px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.36;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: logIn 0.28s ease both;
}

.log-line.line-story {
  color: #5a5142;
  font-family: var(--font-sans);
  font-style: italic;
}

.log-line.line-exam-school {
  color: var(--green-deep);
  font-weight: 700;
}

.log-line.line-exam-city,
.log-line.line-exam-multi {
  color: var(--blue);
  font-weight: 700;
}

.log-line.line-exam-mock1 {
  color: var(--orange);
  font-weight: 700;
}

.log-line.line-exam-mock2,
.log-line.line-exam-gaokao {
  color: var(--red);
  font-weight: 700;
}

.log-line.line-achievement,
.log-line.line-milestone {
  color: var(--gold);
  font-weight: 700;
}

.log-line.line-level {
  color: var(--green-deep);
  font-weight: 700;
}

.log-line.line-burst {
  color: #9a6a12;
}

.log-tag {
  flex: none;
  font-weight: 700;
  letter-spacing: -0.02em;
}

@keyframes logIn {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.link-btn {
  display: inline-flex;
  align-items: center;
  padding: 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  transition: color 0.18s;
}

.link-btn:hover {
  color: var(--gold);
}

/* 中间滚动区 */

.game-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 20px 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 133, 120, 0.28) transparent;
}

.game-scroll::-webkit-scrollbar,
.exam-list::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.game-scroll::-webkit-scrollbar-thumb,
.exam-list::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
  background: rgba(139, 133, 120, 0.26);
  border-radius: 999px;
}

.game-scroll > * {
  width: min(1180px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.completion-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 12px 16px;
  border: 1px solid rgba(184, 134, 11, 0.32);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(231, 194, 90, 0.16), rgba(255, 253, 248, 0.7));
}

.completion-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-soft);
}

.completion-copy b {
  font-family: var(--font-serif);
  color: var(--gold);
  font-size: 15px;
}

.completion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.board {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(320px, 1.08fr);
  gap: 12px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* 左侧信息 */

.info-panel {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.calendar-card {
  padding: 12px 14px;
  border-radius: 13px;
  background:
    radial-gradient(320px 120px at 100% 0%, rgba(231, 194, 90, 0.16), transparent 70%),
    linear-gradient(135deg, #fffdf7, #f6f1e5);
  border: 1px solid rgba(201, 192, 175, 0.6);
}

.cal-eyebrow {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cal-main {
  margin-top: 3px;
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.28;
}

.cal-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.calendar-card.mode-holiday .cal-main {
  color: var(--gold);
}

.calendar-card.mode-vacation .cal-main {
  color: var(--green-deep);
}

.calendar-card.mode-countdown {
  background:
    radial-gradient(320px 120px at 100% 0%, rgba(197, 52, 43, 0.12), transparent 70%),
    linear-gradient(135deg, #fffaf7, #f7ece6);
  border-color: rgba(197, 52, 43, 0.28);
}

.calendar-card.mode-countdown .cal-main {
  color: var(--red);
  font-size: 27px;
  font-variant-numeric: tabular-nums;
}

.calendar-card.mode-countdown .cal-eyebrow {
  color: var(--red);
}

.calendar-card.mode-done .cal-main {
  color: var(--gold);
}

.stat-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  border: 1px solid transparent;
}

.level-badge.lv1 {
  background: #fff;
  color: #4b4841;
  border-color: var(--line-strong);
}

.level-badge.lv2 {
  background: var(--green);
}

.level-badge.lv3 {
  background: var(--blue);
}

.level-badge.lv4 {
  background: var(--purple);
}

.level-badge.lv5 {
  background: var(--gold-bright);
  color: #3b2c04;
}

.level-badge.lv6 {
  background: linear-gradient(90deg, #e05252, #e0a13b, #78b84b, #3b9fd9, #7d63d6, #d05cae);
}

.exp-line {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-height: 34px;
}

.exp-value {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: color 0.25s;
}

.exp-value.lv1 {
  color: #fff;
  -webkit-text-stroke: 1px #b4ab9b;
  text-shadow: 0 1px 1px rgba(80, 65, 40, 0.18);
}

.exp-value.lv2 {
  color: var(--green);
}

.exp-value.lv3 {
  color: var(--blue);
}

.exp-value.lv4 {
  color: var(--purple);
}

.exp-value.lv5 {
  color: #c9971f;
}

.exp-value.lv6 {
  background: linear-gradient(90deg, #e05252, #e0a13b, #78b84b, #3b9fd9, #7d63d6, #d05cae);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbowSlide 3.4s linear infinite;
}

.exp-unit {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.exp-bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(139, 133, 120, 0.16);
  overflow: hidden;
}

.exp-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: #fff;
  transition: width 0.35s ease, background 0.25s;
}

.exp-bar span.lv1 {
  background: #d8d1c4;
}

.exp-bar span.lv2 {
  background: var(--green);
}

.exp-bar span.lv3 {
  background: var(--blue);
}

.exp-bar span.lv4 {
  background: var(--purple);
}

.exp-bar span.lv5 {
  background: var(--gold-bright);
}

.exp-bar span.lv6 {
  background: linear-gradient(90deg, #e05252, #e0a13b, #78b84b, #3b9fd9, #7d63d6, #d05cae);
  background-size: 220% 100%;
  animation: rainbowSlide 3.4s linear infinite;
}

.next-level {
  color: #9b9385;
  font-size: 10px;
  letter-spacing: 0.02em;
}

.stat-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(201, 192, 175, 0.62);
}

.rank-value {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.questions-row {
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.q-value {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 27px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transform-origin: right center;
}

.q-value.bump {
  animation: numberBump 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes numberBump {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.18) translateY(-2px);
    color: var(--red);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes rainbowSlide {
  to {
    background-position: 220% 0;
  }
}

/* 右侧考试列表 */

.exam-panel {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  min-height: 230px;
}

.panel-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-height: 22px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.panel-title .micro {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.exam-list {
  flex: 1;
  min-height: 0;
  max-height: 196px;
  margin-top: 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 3px;
}

.exam-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 7px 9px;
  border-radius: 9px;
  border-left: 3px solid transparent;
  color: var(--ink-soft);
  font-size: 11px;
  transition: background 0.18s;
}

.exam-item:hover {
  background: rgba(231, 194, 90, 0.07);
}

.exam-item.latest {
  background: linear-gradient(90deg, rgba(231, 194, 90, 0.18), rgba(231, 194, 90, 0.02));
  border-left-color: var(--gold-bright);
}

.exam-meta {
  min-width: 0;
}

.exam-name {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--ink-soft);
  font-weight: 600;
}

.exam-sub {
  margin-top: 1px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.02em;
}

.latest-tag {
  flex: none;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--gold-bright);
  color: #3b2c04;
  font-size: 8px;
  letter-spacing: 0.04em;
}

.exam-score {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.exam-rank {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.score-low {
  color: #8b8578;
}

.score-mid {
  color: var(--blue);
}

.score-high {
  color: #b07d10;
}

.score-top {
  color: var(--red);
}

.score-perfect {
  background: linear-gradient(90deg, #e05252, #e0a13b, #78b84b, #3b9fd9, #7d63d6, #d05cae);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.empty-note {
  padding: 18px 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  text-align: center;
  white-space: pre-line;
}

/* 资料 */

.materials-panel {
  margin-top: 12px;
  padding: 12px 16px 10px;
}

.material-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}

.material-btn {
  position: relative;
  min-height: 48px;
  padding: 6px 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: border-color 0.18s, background 0.18s, transform 0.14s, box-shadow 0.18s;
}

.material-btn:hover {
  border-color: rgba(184, 134, 11, 0.42);
  background: #fffdf8;
}

.material-btn:active {
  transform: scale(0.98);
}

.material-btn.selected {
  border-color: rgba(184, 134, 11, 0.8);
  background: linear-gradient(180deg, #fff9e6, #f7edce);
  box-shadow: 0 0 0 2px rgba(231, 194, 90, 0.15);
}

.mat-lv {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.mat-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  color: var(--ink-soft);
}

.material-info {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 20px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.material-info b {
  color: var(--ink-soft);
  font-weight: 700;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  background: var(--muted);
}

.dot.green {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 158, 110, 0.12);
}

.dot.yellow {
  background: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(231, 194, 90, 0.15);
}

.dot.gray {
  background: #a9a397;
  box-shadow: 0 0 0 3px rgba(139, 133, 120, 0.1);
}

/* ============================================================
   操作区
   ============================================================ */

.action-panel {
  flex: 0 0 auto;
  border-top: 1px solid rgba(201, 192, 175, 0.62);
  background:
    linear-gradient(180deg, rgba(250, 248, 242, 0.78), rgba(245, 242, 235, 0.96));
  padding: 10px 20px calc(10px + env(safe-area-inset-bottom, 0px));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.action-panel > * {
  width: min(1180px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.action-panel {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(260px, 1.8fr) minmax(150px, 0.8fr);
  gap: 14px;
  align-items: center;
}

.combo-box,
.error-book {
  align-self: stretch;
  min-height: 92px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 253, 248, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  position: relative;
  overflow: hidden;
}

.combo-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.combo-main span:last-child {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.combo-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(139, 133, 120, 0.16);
  overflow: hidden;
}

.combo-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-bright), #c9971f);
  transition: width 0.16s linear;
}

.combo-hint {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.02em;
}

.crit-badge {
  position: absolute;
  right: 9px;
  top: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(-4px) scale(0.9);
  transition: opacity 0.18s, transform 0.18s;
}

.crit-badge.show {
  opacity: 1;
  transform: none;
}

.brush-zone {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 2px 0;
}

.brush-zone::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(520px, 92%);
  height: 110px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--brush-glow, rgba(47, 158, 110, 0.18)), transparent 68%);
  filter: blur(8px);
  pointer-events: none;
  transition: background 0.3s;
}

.brush-btn {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  min-height: 98px;
  padding: 12px 24px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #fff;
  box-shadow:
    0 16px 34px var(--brush-shadow, rgba(31, 122, 85, 0.28)),
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    inset 0 -10px 24px rgba(0, 0, 0, 0.12);
  transition: transform 0.12s ease, filter 0.2s, box-shadow 0.25s, background 0.25s;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.brush-btn::after {
  content: "";
  position: absolute;
  inset: -40% -20%;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.22) 48%, transparent 60%);
  transform: translateX(-70%);
  animation: brushShine 4.6s ease-in-out infinite;
  pointer-events: none;
}

.brush-btn:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.brush-btn:active {
  transform: scale(0.978) translateY(1px);
}

.brush-btn.tone-green {
  --brush-glow: rgba(47, 158, 110, 0.22);
  --brush-shadow: rgba(31, 122, 85, 0.28);
  background: linear-gradient(150deg, #1e8b68 0%, #2fae7c 52%, #1c7a5b 100%);
}

.brush-btn.tone-yellow {
  --brush-glow: rgba(231, 194, 90, 0.26);
  --brush-shadow: rgba(180, 130, 16, 0.25);
  background: linear-gradient(150deg, #c9971f 0%, #e6c45d 52%, #b98613 100%);
  color: #2c2105;
}

.brush-btn.tone-gray {
  --brush-glow: rgba(139, 133, 120, 0.14);
  --brush-shadow: rgba(90, 87, 80, 0.2);
  background: linear-gradient(150deg, #929086 0%, #b6b2a8 52%, #858277 100%);
}

.brush-btn.paused,
.brush-btn.completed {
  --brush-glow: rgba(139, 133, 120, 0.1);
  --brush-shadow: rgba(90, 87, 80, 0.12);
  background: linear-gradient(150deg, #b9b5ab, #cfcbc2);
  color: #56534b;
}

.brush-btn.paused::after,
.brush-btn.completed::after {
  display: none;
}

.brush-text {
  font-family: var(--font-serif);
  font-size: 31px;
  font-weight: 900;
  letter-spacing: 0.2em;
  line-height: 1.1;
  text-indent: 0.2em;
}

.brush-sub {
  font-size: 10px;
  letter-spacing: 0.08em;
  opacity: 0.86;
}

.brush-floats {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 3;
}

.brush-float {
  position: absolute;
  left: 50%;
  top: 2px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
  color: var(--green-deep);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
  animation: brushFloat 1s ease-out forwards;
  pointer-events: none;
}

.brush-float.crit {
  color: var(--red-bright);
  font-weight: 900;
  font-size: 14px;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.9);
}

.brush-float.question {
  color: var(--ink-soft);
  animation-delay: 0.04s;
}

.brush-float.burst {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 900;
  animation-duration: 1.15s;
}

@keyframes brushFloat {
  0% {
    opacity: 0;
    transform: translate(-50%, 8px) scale(0.9);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -46px) scale(1.04);
  }
}

@keyframes brushShine {
  0%,
  55% {
    transform: translateX(-80%);
  }
  75%,
  100% {
    transform: translateX(80%);
  }
}

.error-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.error-head b {
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}

.error-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
}

.error-meta b {
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 11px;
}

.clear-btn {
  min-height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.65);
  color: var(--ink-soft);
  font-size: 10px;
  letter-spacing: 0.08em;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
}

.clear-btn:hover:not(:disabled) {
  border-color: rgba(197, 52, 43, 0.5);
  color: var(--red);
  background: #fff7f5;
}

.clear-btn:disabled {
  opacity: 0.45;
}

.error-book.danger {
  border-color: rgba(197, 52, 43, 0.7);
  animation: dangerBlink 1.1s ease-in-out infinite;
}

.error-book.danger .clear-btn {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
  animation: dangerButton 1.1s ease-in-out infinite;
}

@keyframes dangerBlink {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(197, 52, 43, 0);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(197, 52, 43, 0.13);
  }
}

@keyframes dangerButton {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.18);
  }
}

/* ============================================================
   浮动字幕 / 考试浮层 / Toast
   ============================================================ */

#float-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  overflow: hidden;
}

.subtitle-float {
  position: absolute;
  color: var(--red-bright);
  font-family: var(--font-serif);
  font-size: clamp(20px, 3.2vw, 40px);
  font-weight: 900;
  letter-spacing: 0.05em;
  white-space: nowrap;
  text-shadow:
    0 0 1px #fff,
    0 0 8px rgba(255, 255, 255, 0.88),
    0 2px 14px rgba(197, 52, 43, 0.22);
  animation: subtitleFloat 1.35s cubic-bezier(0.18, 0.8, 0.3, 1) forwards;
  will-change: transform, opacity;
}

.subtitle-float.crit {
  color: #e0261c;
  font-size: clamp(26px, 4vw, 50px);
}

@keyframes subtitleFloat {
  0% {
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.82) rotate(var(--rot, 0deg));
  }
  16% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1.04) rotate(var(--rot, 0deg));
  }
  72% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -54px) scale(1.14) rotate(var(--rot, 0deg));
  }
}

#overlay-root {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  display: grid;
  place-items: center;
  padding: 20px;
}

.exam-flash {
  text-align: center;
  padding: 22px 34px;
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.94);
  border: 2px solid var(--tone, var(--green));
  box-shadow:
    0 20px 60px rgba(30, 25, 15, 0.16),
    0 0 0 8px color-mix(in srgb, var(--tone, var(--green)) 10%, transparent);
  animation: examFlash 3.1s ease forwards;
  backdrop-filter: blur(8px);
}

.exam-flash .flash-kicker {
  color: var(--tone, var(--green));
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
}

.exam-flash .flash-name {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 14px;
  letter-spacing: 0.08em;
}

.exam-flash .flash-score {
  margin-top: 4px;
  color: var(--tone, var(--green));
  font-family: var(--font-serif);
  font-size: clamp(38px, 7vw, 64px);
  font-weight: 900;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.exam-flash .flash-rank {
  margin-top: 4px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.exam-flash .flash-milestone {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(231, 194, 90, 0.2);
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.exam-flash.tone-school {
  --tone: #2f9e5f;
}

.exam-flash.tone-city {
  --tone: #2f6fed;
}

.exam-flash.tone-mock1 {
  --tone: #e08a1e;
}

.exam-flash.tone-mock2 {
  --tone: #d0342c;
}

@keyframes examFlash {
  0% {
    opacity: 0;
    transform: scale(0.82) translateY(14px);
  }
  12% {
    opacity: 1;
    transform: scale(1.02);
  }
  18% {
    transform: scale(1);
  }
  78% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.96) translateY(-10px);
  }
}

#toast-root {
  position: fixed;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, calc(100% - 24px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold-bright);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 10px 30px rgba(40, 32, 18, 0.12);
  animation: toastIn 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  backdrop-filter: blur(10px);
}

.toast.fade-out {
  animation: toastOut 0.35s ease forwards;
}

.toast-icon {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: rgba(231, 194, 90, 0.22);
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 900;
}

.toast-copy {
  min-width: 0;
}

.toast-title {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.toast-desc {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.toast.tone-error {
  border-left-color: var(--red);
}

.toast.tone-error .toast-icon {
  background: rgba(197, 52, 43, 0.1);
  color: var(--red);
}

/* 墓志铭提示走灰色，和 t2 的黑白气质一致。 */
.toast.tone-memorial {
  border-color: rgba(0, 0, 0, 0.18);
  border-left-color: rgba(0, 0, 0, 0.5);
  background: rgba(226, 226, 224, 0.97);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
}

.toast.tone-memorial .toast-icon {
  background: rgba(0, 0, 0, 0.08);
  color: #555;
}

.toast.tone-memorial .toast-title {
  color: #2f2f2f;
}

.toast.tone-memorial .toast-desc {
  color: #6b6b6b;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

/* ============================================================
   Modal
   ============================================================ */

#modal-root {
  position: relative;
  z-index: 110;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(28, 23, 14, 0.34);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: backdropIn 0.2s ease both;
}

.modal {
  width: min(700px, 100%);
  max-height: min(84dvh, 760px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-solid);
  box-shadow: 0 30px 80px rgba(25, 20, 10, 0.24);
  animation: modalIn 0.26s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  overflow: hidden;
}

.modal.wide {
  width: min(920px, 100%);
}

.modal-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(221, 214, 200, 0.7);
}

.modal-title {
  min-width: 0;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.modal-sub {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.modal-close {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background 0.18s, color 0.18s;
}

.modal-close:hover {
  background: var(--paper);
  color: var(--ink);
}

.modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 20px;
  scrollbar-width: thin;
}

.modal-body p {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.8;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid rgba(221, 214, 200, 0.7);
}

@keyframes backdropIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* 设置 */

.settings-section {
  padding: 4px 0 16px;
  border-bottom: 1px dashed rgba(201, 192, 175, 0.65);
}

.settings-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.settings-section h3 {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.auto-save-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(231, 194, 90, 0.09);
  color: var(--ink-soft);
  font-size: 11px;
}

.auto-save-row b {
  color: var(--gold);
}

.save-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.save-slot {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.45);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.save-slot-title {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.save-slot-summary {
  min-height: 30px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  word-break: break-all;
}

.save-slot-time {
  color: #a39b8c;
  font-family: var(--font-mono);
  font-size: 9px;
}

.save-slot-actions {
  display: flex;
  gap: 5px;
}

.save-slot-actions button {
  flex: 1;
  min-height: 27px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.6);
  font-size: 10px;
}

.save-slot-actions button:hover:not(:disabled) {
  border-color: rgba(184, 134, 11, 0.55);
  color: var(--gold);
}

.save-slot-actions button:disabled {
  opacity: 0.4;
}

.settings-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ending-archive-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ending-archive-row {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.42);
}

.archive-title {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.archive-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.archive-quote {
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 10px;
  line-height: 1.6;
}

/* 成就 */

.achievement-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 11px;
}

.achievement-summary b {
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 900;
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.achievement-item {
  display: flex;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.5);
}

.achievement-medal {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(139, 133, 120, 0.1);
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 900;
}

.achievement-item.unlocked {
  border-color: rgba(184, 134, 11, 0.36);
  background: linear-gradient(135deg, rgba(231, 194, 90, 0.14), rgba(255, 255, 255, 0.55));
}

.achievement-item.unlocked .achievement-medal {
  background: linear-gradient(180deg, #f3dc93, #c9a44a);
  color: #3b2c04;
}

.achievement-copy {
  min-width: 0;
}

.achievement-name {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.achievement-date {
  color: #a39b8c;
  font-family: var(--font-mono);
  font-size: 8px;
}

.achievement-desc {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.achievement-hint {
  margin-top: 4px;
  color: #a39b8c;
  font-size: 9px;
}

.achievement-item:not(.unlocked) .achievement-desc,
.achievement-item:not(.unlocked) .achievement-hint {
  opacity: 0.72;
}

/* 日志历史 / 考试全部 */

.history-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-line {
  display: flex;
  gap: 8px;
  padding: 5px 7px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.history-line:nth-child(odd) {
  background: rgba(139, 133, 120, 0.04);
}

.history-date {
  flex: none;
  width: 66px;
  color: #a39b8c;
  font-family: var(--font-mono);
  font-size: 9px;
  padding-top: 2px;
}

.history-text {
  min-width: 0;
  word-break: break-word;
}

.history-line.highlight {
  background: rgba(231, 194, 90, 0.14);
}

.exam-table {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.exam-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 52px 84px;
  gap: 8px;
  align-items: center;
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 11px;
  color: var(--ink-soft);
}

.exam-row:nth-child(odd) {
  background: rgba(139, 133, 120, 0.04);
}

.exam-row .row-date {
  color: #a39b8c;
  font-family: var(--font-mono);
  font-size: 9px;
}

.exam-row .row-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.exam-row .row-score {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 900;
  text-align: right;
}

.exam-row .row-rank {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  text-align: right;
}

/* 一分一段表 */

.score-table-wrap {
  max-height: 56dvh;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: auto;
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.score-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 10px;
  background: #f3eee4;
  color: var(--muted);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-align: right;
  border-bottom: 1px solid var(--line);
}

.score-table th:first-child,
.score-table td:first-child {
  text-align: left;
}

.score-table td {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(221, 214, 200, 0.45);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.score-table tr.player-row td {
  background: rgba(231, 194, 90, 0.2);
  color: var(--ink);
  font-weight: 700;
}

.table-note {
  margin-top: 10px;
  color: #a39b8c;
  font-size: 10px;
  line-height: 1.7;
}

.player-note {
  margin: 0 0 8px;
  color: var(--gold-deep, #8a6a12);
  font-weight: 600;
}

/* ============================================================
   高考结算
   ============================================================ */

.view-settlement {
  position: relative;
  height: 100vh;
  height: 100dvh;
  padding: 14px 18px calc(16px + env(safe-area-inset-bottom, 0px));
  color: #eee9df;
  background:
    radial-gradient(900px 520px at 50% 8%, rgba(231, 194, 90, 0.12), transparent 65%),
    radial-gradient(700px 500px at 50% 100%, rgba(197, 52, 43, 0.09), transparent 60%),
    #0a0a0c;
  overflow: hidden;
}

.view-settlement::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 50%, #000, transparent 75%);
}

.settle-head {
  position: relative;
  z-index: 1;
  flex: none;
  text-align: center;
  padding: 4px 0 2px;
}

.settle-kicker {
  color: rgba(231, 194, 90, 0.72);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.gaokao-score {
  font-family: var(--font-serif);
  font-size: clamp(62px, 12vw, 112px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 40px rgba(231, 194, 90, 0.18);
}

.gaokao-score.tone-gray {
  color: #a9a49a;
}

.gaokao-score.tone-blue {
  color: #6b9aff;
}

.gaokao-score.tone-gold {
  background: linear-gradient(180deg, #f9edb8, #e9c65f 46%, #b8860b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.gaokao-score.tone-red {
  color: #ff6257;
  text-shadow: 0 4px 44px rgba(255, 70, 60, 0.3);
}

.gaokao-score.tone-rainbow {
  background: linear-gradient(90deg, #ff6b6b, #ffd166, #8ee36b, #5bc0eb, #a78bfa, #ff8fd8);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbowSlide 3s linear infinite;
}

.settle-total {
  margin-top: 2px;
  color: rgba(238, 233, 223, 0.42);
  font-size: 10px;
  letter-spacing: 0.18em;
}

.kill-stage {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  margin: 6px 0 2px;
}

#kill-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.kill-hint {
  position: absolute;
  right: 6px;
  top: 35%;
  transform: translateY(-50%) rotate(90deg);
  transform-origin: right center;
  color: rgba(255, 90, 78, 0.58);
  font-size: 9px;
  letter-spacing: 0.4em;
  pointer-events: none;
}

.settle-rank {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translate(-50%, -50%);
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 14px 26px;
  border-radius: 14px;
  background: rgba(10, 10, 12, 0.86);
  border: 1px solid rgba(231, 194, 90, 0.44);
  color: #eee9df;
  font-size: clamp(18px, 3.4vw, 30px);
  letter-spacing: 0.06em;
  white-space: nowrap;
  text-align: center;
  box-shadow: 0 0 50px rgba(231, 194, 90, 0.12);
  animation: rankReveal 0.7s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.settle-rank b {
  color: var(--gold-bright);
  font-family: var(--font-serif);
  font-size: 1.35em;
  margin: 0 4px;
}

.settle-rank-sub {
  margin-top: 5px;
  color: rgba(238, 233, 223, 0.5);
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.03em;
  text-align: center;
  white-space: nowrap;
}

@keyframes rankReveal {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.82);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    filter: none;
  }
}

.ending-block {
  position: relative;
  z-index: 1;
  flex: none;
  text-align: center;
  min-height: 92px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.ending-block.show {
  opacity: 1;
  transform: none;
}

.ending-kicker {
  color: rgba(238, 233, 223, 0.38);
  font-size: 9px;
  letter-spacing: 0.32em;
  margin-bottom: 4px;
}

.ending-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  text-shadow: 0 0 30px rgba(231, 194, 90, 0.2);
}

.ending-quote {
  margin-top: 4px;
  color: rgba(238, 233, 223, 0.58);
  font-family: var(--font-serif);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.settle-actions {
  position: relative;
  z-index: 1;
  flex: none;
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

.settle-continue {
  min-width: 150px;
}

.settle-skip {
  position: absolute;
  top: max(12px, env(safe-area-inset-top, 0px));
  right: 14px;
  z-index: 3;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: rgba(238, 233, 223, 0.46);
  font-size: 10px;
  letter-spacing: 0.08em;
  transition: color 0.2s, border-color 0.2s;
}

.settle-skip:hover {
  color: rgba(238, 233, 223, 0.8);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ============================================================
   分数线 / t2
   ============================================================ */

.view-lines {
  align-items: center;
  padding: 40px 18px;
  overflow-y: auto;
}

.lines-inner {
  width: min(700px, 100%);
  margin: auto;
  animation: fadeUp 0.6s ease both;
}

.lines-head {
  text-align: center;
  margin-bottom: 24px;
}

.lines-head h2 {
  margin-top: 6px;
  font-family: var(--font-serif);
  font-size: clamp(30px, 5vw, 44px);
  letter-spacing: 0.1em;
}

.lines-head p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.lines-head p b {
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 21px;
}

.score-lines {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.score-line {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.7);
  transition: border-color 0.2s, background 0.2s;
}

.score-line.reached {
  border-color: rgba(184, 134, 11, 0.44);
  background: linear-gradient(90deg, rgba(231, 194, 90, 0.16), rgba(255, 253, 248, 0.7));
}

.score-line .line-name {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.score-line .line-note {
  color: var(--muted);
  font-size: 10px;
}

.score-line .line-score {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.score-line.reached .line-score {
  color: var(--gold);
}

.lines-disclaimer {
  margin-top: 10px;
  color: #a39b8c;
  font-size: 10px;
  letter-spacing: 0.02em;
  text-align: center;
}

.lines-tools {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.lines-actions {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

/* ============================================================
   t1 收尾 · 文字分页
   ============================================================ */

.view-interlude {
  position: relative;
  align-items: center;
  justify-content: center;
  padding: 44px 24px 90px;
  color: #242424;
  background: var(--paper);
  transition: background 0.9s ease, color 0.9s ease;
  --font-page: var(--font-t2-trad);
  /* t1 收尾：文字逐字、逐行浮现，节奏由 js/t2.js 的 msPerChar 决定。 */
  --char-fade: 0.42s;
  --text-out: 1.9s;
}

.interlude-stage {
  width: min(920px, 100%);
  text-align: center;
}

.text-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.text-page-line {
  max-width: 100%;
  color: #242424;
  font-family: var(--font-page, var(--font-t2));
  font-size: clamp(22px, 3.2vw, 40px);
  line-height: 2.05;
  letter-spacing: 0.08em;
  white-space: pre-wrap;
  opacity: 0;
  clip-path: inset(0 100% 0 0);
  transition:
    clip-path var(--line-reveal, var(--text-reveal, 2.3s)) var(--text-reveal-ease, cubic-bezier(0.22, 0.8, 0.25, 1)),
    opacity var(--line-fade, var(--text-fade, 0.7s)) ease;
}

.text-page-line.in {
  opacity: 1;
  clip-path: inset(0 0 0 0);
}

/* 逐字淡入：用于 t1 收尾，按「秒 / 字」的节奏一行一行浮现。 */
.text-page-line .text-char {
  opacity: 0;
  transition: opacity var(--char-fade, 0.42s) ease;
}

.text-page-line .text-char.in {
  opacity: 1;
}

.text-page-line.out {
  opacity: 0;
  clip-path: inset(0 0 0 100%);
  transition:
    clip-path var(--text-out, 0.96s) ease,
    opacity var(--text-out, 0.96s) ease;
}

.text-page-hint {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.18em;
  animation: hintPulse 1.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes hintPulse {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 0.85;
  }
}

.rename-stage {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--paper);
  transition: background 1s ease;
}

.rename-title {
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: clamp(42px, 8vw, 88px);
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.1;
  white-space: nowrap;
  transition: color 0.9s ease;
}

.rename-title span {
  display: inline-block;
}

.rename-title .shake {
  animation: charShake 0.7s cubic-bezier(0.3, 0.9, 0.3, 1) both;
}

.rename-title.morphed {
  color: #555;
}

body.t2-mode .rename-title,
.rename-title.morphed {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: #555555;
  color: #555555;
  filter: none;
}

body.t2-mode .view-interlude {
  background: #ededed;
}

@keyframes charShake {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  18% {
    transform: translate(-8px, 2px) rotate(-3deg);
  }
  36% {
    transform: translate(8px, -3px) rotate(3deg);
  }
  54% {
    transform: translate(-5px, 1px) rotate(-2deg);
  }
  72% {
    transform: translate(4px, -1px) rotate(1deg);
  }
}

/* ============================================================
   t2 · 命运
   ============================================================ */

.view-t2-game {
  flex-direction: column;
  overflow: hidden;
  color: #111;
  font-family: var(--font-t2);
  background: var(--t2-bg, #ffffff);
  transition: background 1s linear;
}

.view-t2-game.shake {
  animation: t2Shake 0.46s ease;
}

@keyframes t2Shake {
  0%,
  100% {
    transform: translate(0, 0);
  }
  18% {
    transform: translate(-7px, 2px);
  }
  36% {
    transform: translate(7px, -2px);
  }
  54% {
    transform: translate(-4px, 1px);
  }
  72% {
    transform: translate(4px, -1px);
  }
}

.t2-topbar {
  flex: 0 0 auto;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.t2-topbar-inner {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 8px 20px;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.t2-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.t2-brand-title {
  color: #222;
  font-family: var(--font-t2);
  font-size: 26px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.t2-user {
  overflow: hidden;
  color: #666;
  font-family: var(--font-t2);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.t2-top-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
}

.t2-ghost-btn {
  padding: 8px 14px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  color: #333;
  font-size: 17px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.t2-ghost-btn:hover {
  background: #fff;
}

.t2-log-strip {
  flex: 0 0 auto;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.32);
}

.t2-log-inner {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 8px 20px 9px;
}

.t2-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  color: #666;
  font-size: 13px;
  letter-spacing: 0.14em;
}

.t2-link-btn {
  color: #555;
  font-size: 13px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.t2-log-stream {
  height: 104px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  overflow: hidden;
  font-family: var(--font-t2);
  font-size: 14px;
  line-height: 1.55;
}

.t2-log-line {
  overflow: hidden;
  color: #555;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.t2-log-line.type-exam {
  color: #222;
}

.t2-log-line.type-memorial {
  color: #333;
  font-weight: 700;
}

.t2-log-line.type-gaokao {
  color: #111;
}

.t2-body {
  flex: 1 1 auto;
  min-height: 0;
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 20px 20px 10px;
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.9fr);
  gap: 22px;
}

.t2-calendar-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.t2-calendar {
  padding: 20px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.28);
}

.t2-cal-eyebrow {
  color: #666;
  font-family: var(--font-t2);
  font-size: 14px;
  letter-spacing: 0.16em;
}

.t2-cal-main {
  margin-top: 8px;
  color: #111;
  font-family: var(--font-t2);
  font-size: clamp(34px, 4.5vw, 54px);
  line-height: 1.2;
}

.t2-cal-sub {
  margin-top: 8px;
  color: #555;
  font-size: 16px;
  letter-spacing: 0.08em;
  line-height: 1.7;
}

.view-t2-game.urgent-countdown .t2-cal-eyebrow,
.view-t2-game.urgent-countdown .t2-cal-main {
  color: #5a0d0d;
}

.t2-question-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  color: #555;
  font-size: 14px;
  letter-spacing: 0.08em;
}

.t2-question-row b {
  color: #111;
  font-family: var(--font-t2);
  font-size: 28px;
  letter-spacing: 0;
}

.t2-story-panel {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 26px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.16);
}

.t2-story {
  width: 100%;
}

.t2-story-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
  animation: t2StoryIn 0.9s ease both;
}

.t2-story-line {
  color: #1a1a1a;
  font-family: var(--font-t2);
  font-size: clamp(23px, 3.1vw, 38px);
  line-height: 1.9;
  letter-spacing: 0.05em;
}

@keyframes t2StoryIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.t2-action {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px 26px;
}

.t2-brush-btn {
  width: min(520px, 86vw);
  min-height: 92px;
  border-radius: 18px;
  background: var(--t2-btn-bg, #999);
  color: #fff;
  font-family: var(--font-t2);
  font-size: clamp(30px, 4.3vw, 48px);
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  transition: background 0.8s linear, transform 0.12s ease, filter 0.2s ease;
}

.t2-brush-btn:hover {
  filter: brightness(1.06);
}

.t2-brush-btn.pressed {
  transform: scale(0.985);
}

.view-t2-game.auto-clicking .t2-brush-btn {
  animation: t2AutoPulse 0.5s ease-in-out infinite;
}

@keyframes t2AutoPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.982);
  }
}

.t2-float-root {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.t2-subtitle {
  position: absolute;
  transform: translate(-50%, -50%) rotate(var(--rot, 0deg));
  color: #111;
  font-family: var(--font-t2);
  font-size: clamp(18px, 2.6vw, 32px);
  white-space: nowrap;
  text-shadow:
    0 0 1px #fff,
    0 0 10px rgba(255, 255, 255, 0.9),
    0 5px 20px rgba(0, 0, 0, 0.08);
  animation: t2Float 1.3s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
  pointer-events: none;
}

@keyframes t2Float {
  0% {
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.88) rotate(var(--rot, 0deg));
  }
  18% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1.03) rotate(var(--rot, 0deg));
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -54px) scale(1.1) rotate(var(--rot, 0deg));
  }
}

.t2-intro-line {
  position: fixed;
  left: 50%;
  top: 46%;
  z-index: 10;
  transform: translate(-50%, -50%);
  opacity: 0;
  color: #222;
  font-family: var(--font-t2);
  font-size: clamp(22px, 3vw, 38px);
  letter-spacing: 0.08em;
  white-space: nowrap;
  pointer-events: none;
}

.t2-intro-line.show {
  animation: t2IntroLine 2.8s ease forwards;
}

@keyframes t2IntroLine {
  0% {
    opacity: 0;
    filter: blur(3px);
  }
  20% {
    opacity: 1;
    filter: blur(0);
  }
  62% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    filter: blur(2px);
  }
}

/* t2 结局文字页 */

.view-t2-end {
  align-items: center;
  justify-content: center;
  padding: 44px 24px 110px;
  color: #1a1a1a;
  background: #eeeeee;
  --font-page: var(--font-t2);
  font-family: var(--font-t2);
}

.t2-end-stage {
  width: min(920px, 100%);
  text-align: center;
}

.t2-end-actions {
  position: fixed;
  left: 50%;
  bottom: 42px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  width: min(620px, calc(100% - 32px));
  transform: translateX(-50%);
}

.t2-choice-prompt {
  width: 100%;
  margin-bottom: 6px;
  color: #333;
  font-family: var(--font-t2);
  font-size: 24px;
  letter-spacing: 0.08em;
  text-align: center;
}

.t2-choice-btn {
  min-width: 150px;
  padding: 14px 30px;
  font-family: var(--font-t2);
  font-size: 26px;
  letter-spacing: 0.12em;
}

body.t2-mode .primary-btn {
  background: #222;
  color: #fff;
  border-color: #222;
  box-shadow: none;
}

body.t2-mode .primary-btn:hover {
  background: #000;
  color: #fff;
}

body.t2-mode .outline-btn {
  border-color: #777;
  color: #222;
  background: rgba(255, 255, 255, 0.55);
}

body.t2-mode .outline-btn:hover {
  border-color: #222;
  color: #000;
  background: #fff;
}

/* t2 后续阶段占位 */

.view-t2-next {
  align-items: center;
  justify-content: center;
  padding: 30px 18px;
  color: #222;
  background: #e9e9e9;
  font-family: var(--font-t2);
}

.t2-next-inner {
  width: min(600px, 100%);
  text-align: center;
}

.t2-mark {
  margin-bottom: 18px;
  color: #666;
  font-family: var(--font-t2);
  font-size: 10px;
  letter-spacing: 0.24em;
}

.t2-next-inner h2 {
  color: #222;
  font-family: var(--font-t2);
  font-size: clamp(26px, 4.4vw, 42px);
  font-weight: 400;
  letter-spacing: 0.08em;
}

.t2-next-inner p {
  margin-top: 14px;
  color: #666;
  font-family: var(--font-t2);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.06em;
}

.t2-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 32px;
}

/* t2 设置 / 墓志铭 */

.t2-settings h3.settings-subtitle {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.t2-settings .settings-row {
  margin-bottom: 14px;
}

.memorial-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.memorial-item {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.45);
}

.memorial-item.locked {
  opacity: 0.6;
}

.memorial-medal {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  font-size: 11px;
}

.memorial-item.unlocked .memorial-medal {
  color: var(--ink);
  border-color: var(--ink-soft);
}

.memorial-copy {
  min-width: 0;
}

.memorial-name {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.memorial-desc {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.memorial-date {
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.memorial-permanent {
  margin-top: 3px;
  color: #6d6d6d;
  font-size: 10px;
  letter-spacing: 0.04em;
}

/* 墓志铭总览：按阶段分栏 */
.memorial-book {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.memorial-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 6px;
  border-bottom: 1px solid var(--line);
}

.memorial-section-title {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.memorial-section-count {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.memorial-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 700px) {
  .memorial-section {
    grid-template-columns: 1fr;
  }
}

body.t2-mode .memorial-section-title {
  font-size: 20px;
}

body.t2-mode .memorial-section-count {
  font-size: 14px;
}

.history-line.type-memorial .history-text,
.t2-log-line.type-memorial {
  font-weight: 700;
}

.t2-calendar-panel {
  overflow-y: auto;
  scrollbar-width: thin;
}

.t2-exam-panel {
  padding: 12px 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
}

.t2-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #555;
  font-size: 15px;
  letter-spacing: 0.08em;
}

.t2-exam-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.t2-exam-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.t2-exam-row:first-child {
  border-top: 0;
}

.t2-exam-meta {
  min-width: 0;
}

.t2-exam-date {
  color: #777;
  font-family: var(--font-t2);
  font-size: 12.5px;
  letter-spacing: 0.06em;
}

.t2-exam-name {
  overflow: hidden;
  color: #333;
  font-family: var(--font-t2);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.t2-exam-score {
  color: #111;
  font-family: var(--font-t2);
  font-size: 21px;
}

.t2-exam-rank {
  color: #777;
  font-family: var(--font-t2);
  font-size: 12.5px;
  text-align: right;
}

.t2-exam-empty {
  padding: 8px 0;
  color: #888;
  font-family: var(--font-t2);
  font-size: 13.5px;
}

.t2-exam-history {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.t2-exam-history-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 54px 92px;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  border-top: 1px solid var(--line);
}

.t2-exam-history-row:first-child {
  border-top: 0;
}

.t2-modal,
.t2-modal * {
  font-family: var(--font-t2) !important;
}

body.t2-mode .modal,
body.t2-mode .modal *,
body.t2-mode .toast,
body.t2-mode .toast * {
  font-family: var(--font-t2) !important;
}

/* t2 弹窗与浮层整体放大一档，避免字太小。 */
body.t2-mode .modal-title {
  font-size: 23px;
}

body.t2-mode .modal-sub {
  font-size: 12px;
}

body.t2-mode .modal-body p,
body.t2-mode .history-text,
body.t2-mode .ghost-btn,
body.t2-mode .save-slot-title {
  font-size: 14px;
}

body.t2-mode .settings-subtitle,
body.t2-mode .t2-settings h3.settings-subtitle {
  font-size: 13px;
}

body.t2-mode .save-slot-summary {
  font-size: 12px;
}

body.t2-mode .save-slot-time,
body.t2-mode .history-date,
body.t2-mode .memorial-date {
  font-size: 10.5px;
}

body.t2-mode .memorial-name,
body.t2-mode .t1-achievement-name {
  font-size: 15px;
}

body.t2-mode .memorial-desc {
  font-size: 12.5px;
}

body.t2-mode .t1-achievement-desc {
  font-size: 11.5px;
}

body.t2-mode .t2-link-btn,
body.t2-mode .t2-panel-title {
  font-size: 15px;
}

body.t2-mode .toast-title {
  font-size: 14px;
}

body.t2-mode .toast-desc {
  font-size: 12.5px;
}

.view-interlude .text-page-hint {
  font-family: var(--font-t2-trad);
}

.view-t2-end .text-page-hint {
  font-family: var(--font-t2);
}

.view-t2-game.paused .t2-brush-btn {
  opacity: 0.45;
}

.t1-data-summary {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.4);
}

.t1-data-score {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.t1-data-ending {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.t1-data-count {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
}

.t1-achievement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.t1-achievement {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.35);
}

.t1-achievement.locked {
  opacity: 0.55;
}

.t1-achievement-name {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.t1-achievement-desc {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.5;
}

.t1-data-logs {
  max-height: 240px;
  overflow-y: auto;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.3);
}

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 900px) {
  .action-panel {
    grid-template-columns: 118px minmax(0, 1fr) 132px;
    gap: 10px;
  }

  .brush-text {
    font-size: 27px;
  }

  .brush-btn {
    min-height: 88px;
  }

  .combo-box,
  .error-book {
    min-height: 84px;
  }

  .topbar-inner {
    padding: 8px 14px;
  }

  .log-strip-inner {
    padding-left: 14px;
    padding-right: 14px;
  }

  .game-scroll {
    padding: 12px 14px 16px;
  }

  .action-panel {
    padding-left: 14px;
    padding-right: 14px;
  }
}

@media (max-width: 720px) {
  .topbar-inner {
    min-height: 50px;
    gap: 8px;
    padding: 7px 12px;
  }

  .brand-title {
    font-size: 13px;
  }

  .brand-user {
    display: none;
  }

  .next-exam {
    font-size: 11px;
  }

  .next-exam b {
    font-size: 13px;
  }

  .top-actions {
    gap: 4px;
  }

  .top-actions .ghost-btn {
    min-height: 30px;
    padding: 0 9px;
    font-size: 10px;
  }

  .log-strip-inner {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 6px;
    padding: 5px 12px 7px;
  }

  .log-heading {
    font-size: 9px;
    letter-spacing: 0.08em;
  }

  .log-heading .link-btn {
    font-size: 9px;
  }

  .log-stream {
    height: 68px;
  }

  .log-line {
    font-size: 9.5px;
    min-height: 12px;
  }

  .game-scroll {
    padding: 9px 10px 12px;
  }

  .board {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .info-panel {
    padding: 11px 12px;
    gap: 8px;
  }

  .calendar-card {
    padding: 9px 11px;
  }

  .cal-main {
    font-size: 19px;
  }

  .exp-value {
    font-size: 25px;
  }

  .q-value {
    font-size: 23px;
  }

  .exam-panel {
    min-height: 150px;
    padding: 11px 12px;
  }

  .exam-list {
    max-height: 154px;
  }

  .material-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .materials-panel {
    padding: 10px 12px 9px;
    margin-top: 8px;
  }

  .material-btn {
    min-height: 42px;
  }

  .mat-name {
    font-size: 9.5px;
  }

  .material-info {
    font-size: 9.5px;
  }

  .action-panel {
    grid-template-columns: minmax(72px, 0.8fr) minmax(0, 1.8fr) minmax(84px, 0.8fr);
    gap: 6px;
    padding: 7px 9px calc(7px + env(safe-area-inset-bottom, 0px));
  }

  .combo-box,
  .error-book {
    min-height: 78px;
    padding: 7px 8px;
    border-radius: 11px;
  }

  .combo-main {
    font-size: 9px;
  }

  .combo-main span:last-child {
    font-size: 19px;
  }

  .combo-hint {
    font-size: 8px;
  }

  .brush-btn {
    min-height: 82px;
    border-radius: 18px;
    padding: 8px 10px;
  }

  .brush-text {
    font-size: 24px;
  }

  .brush-sub {
    font-size: 8.5px;
  }

  .error-head {
    font-size: 9px;
  }

  .error-head b {
    font-size: 18px;
  }

  .error-meta {
    font-size: 8px;
  }

  .error-meta b {
    font-size: 9px;
  }

  .clear-btn {
    min-height: 25px;
    font-size: 8.5px;
  }

  .crit-badge {
    font-size: 8px;
    padding: 1px 4px;
  }

  .completion-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
  }

  .completion-copy {
    font-size: 11px;
  }

  .completion-actions {
    width: 100%;
  }

  .completion-actions .ghost-btn {
    flex: 1;
  }

  #toast-root {
    top: 54px;
  }

  .modal-backdrop {
    padding: 0;
    align-items: end;
  }

  .modal {
    width: 100%;
    max-height: 92dvh;
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
  }

  .modal-head {
    padding: 14px 16px 10px;
  }

  .modal-body {
    padding: 14px 16px 18px;
  }

  .modal-actions {
    padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .save-slots {
    grid-template-columns: 1fr;
  }

  .achievement-grid {
    grid-template-columns: 1fr;
  }

  .exam-row {
    grid-template-columns: 54px minmax(0, 1fr) 42px 68px;
    gap: 5px;
    padding: 6px;
  }

  .history-date {
    width: 52px;
    font-size: 8px;
  }

  .view-settlement {
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .ending-block {
    min-height: 84px;
  }

  .ending-quote {
    font-size: 10.5px;
  }

  .settle-rank {
    padding: 11px 16px;
    font-size: 20px;
    max-width: calc(100% - 20px);
  }

  .settle-rank-sub {
    font-size: 9px;
  }

  .score-line {
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 11px 12px;
  }

  .score-line .line-score {
    font-size: 21px;
  }

  .score-line .line-note {
    font-size: 9px;
  }

  .view-lines {
    padding: 28px 12px;
  }

  .login-form {
    padding: 18px;
  }

  #name-input {
    height: 48px;
  }
}

@media (max-width: 380px) {
  .action-panel {
    grid-template-columns: 66px minmax(0, 1fr) 76px;
  }

  .brush-text {
    font-size: 21px;
  }

  .combo-hint {
    display: none;
  }

  .material-btn {
    min-height: 40px;
  }
}

@media (max-width: 900px) {
  .t2-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    align-content: start;
    padding: 14px 14px 8px;
    gap: 10px;
    overflow-y: auto;
  }

  .t2-calendar-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 10px;
  }

  .t2-exam-panel {
    grid-column: 1 / -1;
  }

  .t2-calendar {
    flex: 1;
    padding: 14px;
  }

  .t2-cal-main {
    font-size: clamp(28px, 5.4vw, 42px);
  }

  .t2-question-row {
    min-width: 112px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
  }

  .t2-story-panel {
    min-height: 150px;
    padding: 18px;
  }

  .t2-story-line {
    font-size: clamp(21px, 3.9vw, 30px);
  }

  .t2-action {
    padding: 8px 14px 18px;
  }

  .t2-brush-btn {
    min-height: 78px;
  }

  .t2-topbar-inner {
    padding: 7px 14px;
  }

  .t2-log-inner {
    padding: 7px 14px 8px;
  }

  .t2-log-stream {
    height: 78px;
  }

  .text-page-line {
    font-size: clamp(20px, 4vw, 30px);
    line-height: 1.9;
  }

  .memorial-list {
    grid-template-columns: 1fr;
  }

  .view-t2-end {
    padding: 30px 16px 120px;
  }

  .t2-end-actions {
    bottom: 28px;
  }
}

@media (max-width: 520px) {
  .t2-brand-title {
    font-size: 18px;
  }

  .t2-brand {
    gap: 6px;
  }

  .t2-user {
    font-size: 12px;
  }

  .t2-top-actions {
    gap: 4px;
  }

  .t2-ghost-btn {
    padding: 6px 9px;
    font-size: 14px;
  }

  .t2-log-stream {
    height: 82px;
    font-size: 12.5px;
  }

  .t2-body {
    padding: 10px 10px 6px;
  }

  .t2-calendar-panel {
    display: flex;
    flex-direction: column;
  }

  .t2-calendar {
    flex: 0 0 auto;
  }

  .t2-question-row {
    min-width: 0;
    flex-direction: row;
    align-items: baseline;
  }

  .t2-story-panel {
    min-height: 140px;
    padding: 14px;
  }

  .t2-brush-btn {
    width: 100%;
    min-height: 74px;
    font-size: 29px;
  }

  .t2-intro-line {
    font-size: 22px;
  }

  .t2-subtitle {
    max-width: 80vw;
    font-size: 20px;
    white-space: normal;
    text-align: center;
  }

  .view-interlude {
    padding: 30px 16px 80px;
  }

  .text-page-line {
    font-size: 20px;
    line-height: 1.85;
  }

  .rename-title {
    font-size: 38px;
  }

  .view-t2-end {
    padding: 24px 16px 130px;
  }

  .t2-choice-btn {
    min-width: 120px;
    padding: 12px 20px;
    font-size: 20px;
  }

  .t2-end-actions {
    bottom: 22px;
  }
}

@media (max-height: 660px) and (min-width: 721px) {
  .log-stream {
    height: 58px;
  }

  .action-panel {
    padding-top: 7px;
    padding-bottom: 7px;
  }

  .combo-box,
  .error-book {
    min-height: 78px;
  }

  .brush-btn {
    min-height: 82px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   t2 · 陨落
   ============================================================ */

.view-fall {
  flex-direction: column;
  overflow: hidden;
  color: #111;
  font-family: var(--font-t2);
  background: #ededed;
}

.view-fall.paused .fall-story {
  opacity: 0.55;
}

.fall-score-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  color: #555;
  font-size: 14px;
  letter-spacing: 0.08em;
}

.fall-score-row b {
  color: #111;
  font-family: var(--font-t2);
  font-size: 28px;
  letter-spacing: 0;
}

.fall-story {
  width: 100%;
}

.fall-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 6px 0;
}

.fall-line {
  max-width: 100%;
  color: #1a1a1a;
  font-family: var(--font-t2);
  font-size: clamp(23px, 3vw, 36px);
  line-height: 1.95;
  letter-spacing: 0.05em;
  text-align: center;
  white-space: pre-wrap;
  animation: fallWipeIn 0.8s cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

.fall-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(680px, 100%);
}

.fall-option {
  padding: 14px 18px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.42);
  color: #333;
  font-family: var(--font-t2);
  font-size: clamp(17px, 2.2vw, 22px);
  line-height: 1.65;
  text-align: left;
  letter-spacing: 0.03em;
  animation: fallWipeIn 0.7s cubic-bezier(0.2, 0.8, 0.25, 1) both;
  animation-delay: 0.18s;
}

.fall-options > .fall-option:nth-child(2) {
  animation-delay: 0.34s;
}

.fall-option:hover {
  background: #fff;
}

.fall-continue {
  color: #8a8a8a;
  font-family: var(--font-t2);
  font-size: 13px;
  letter-spacing: 0.16em;
  animation: fallWipeIn 0.6s ease both;
  animation-delay: 0.28s;
}

.fall-line.out,
.fall-option.out,
.fall-continue.out {
  animation: none;
  opacity: 0;
  clip-path: inset(0 0 0 100%);
  transition: clip-path 0.38s ease, opacity 0.38s ease;
}

@keyframes fallWipeIn {
  from {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
  }
  to {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }
}

@keyframes fallIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.view-fall-end {
  align-items: center;
  justify-content: center;
  padding: 44px 24px 110px;
  color: #1a1a1a;
  background: #ececec;
  --font-page: var(--font-t2);
  font-family: var(--font-t2);
}

.view-fall-warn {
  align-items: center;
  justify-content: center;
  padding: 40px 22px 60px;
  background: #1c1b19;
  color: #e8e6e1;
  font-family: var(--font-t2);
}

.fall-warn-stage {
  width: min(720px, 100%);
  text-align: center;
}

.fall-warn p {
  margin: 0 0 14px;
  font-size: clamp(17px, 2.6vw, 26px);
  line-height: 1.9;
  letter-spacing: 0.08em;
  animation: fallIn 1s ease both;
}

.fall-warn-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 34px;
}

@media (max-width: 900px) {
  .fall-line {
    font-size: clamp(22px, 4vw, 30px);
  }

  .fall-option {
    font-size: clamp(17px, 3.4vw, 20px);
  }

  .view-fall-end {
    padding: 30px 16px 120px;
  }
}

.view-fall-warn .outline-btn {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.06);
  color: #dedbd4;
}

.view-fall-warn .outline-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.fall-end-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.fall-end-kicker {
  color: #888;
  font-family: var(--font-t2);
  font-size: 12px;
  letter-spacing: 0.32em;
}

.fall-end-title {
  color: #1a1a1a;
  font-family: var(--font-t2);
  font-size: clamp(28px, 3.6vw, 42px);
  letter-spacing: 0.1em;
  line-height: 1.5;
}

.fall-end-memorial {
  margin-top: 22px;
  color: #3d3d3d;
  font-family: var(--font-t2);
  font-size: clamp(17px, 2.1vw, 23px);
  letter-spacing: 0.08em;
}

.fall-end-memorial-desc {
  color: #777;
  font-family: var(--font-t2);
  font-size: clamp(13px, 1.6vw, 16px);
  line-height: 1.8;
  letter-spacing: 0.05em;
}

/* 设置 / 墓志铭等 t2 弹窗字号放大一档 */
body.t2-mode .modal-title {
  font-size: 34px;
}

body.t2-mode .modal-sub {
  font-size: 16px;
}

body.t2-mode .t2-settings h3.settings-subtitle {
  font-size: 20px;
  margin: 10px 0 12px;
}

body.t2-mode .t2-settings .ghost-btn {
  padding: 10px 16px;
  font-size: 20px;
}

body.t2-mode .t2-settings .auto-save-row {
  padding: 14px 16px;
  font-size: 16px;
}

body.t2-mode .t2-settings .save-slot {
  padding: 14px;
  gap: 10px;
}

body.t2-mode .t2-settings .save-slot-title {
  font-size: 18px;
}

body.t2-mode .t2-settings .save-slot-summary {
  min-height: 40px;
  font-size: 16px;
  line-height: 1.6;
}

body.t2-mode .t2-settings .save-slot-time {
  font-size: 14px;
}

body.t2-mode .t2-settings .save-slot-actions button {
  min-height: 36px;
  font-size: 15px;
}

body.t2-mode .modal-actions button {
  font-size: 18px;
  padding: 10px 20px;
}

@media (max-width: 520px) {
  body.t2-mode .modal-title {
    font-size: 26px;
  }

  body.t2-mode .t2-settings h3.settings-subtitle {
    font-size: 17px;
  }

  body.t2-mode .t2-settings .ghost-btn {
    font-size: 17px;
    padding: 8px 12px;
  }

  body.t2-mode .t2-settings .save-slot-summary {
    font-size: 14px;
  }
}

body.t2-mode .t2-settings .ghost-btn.selected {
  border-color: rgba(184, 134, 11, 0.65);
  background: rgba(231, 194, 90, 0.2);
  color: #6f5310;
}

/* 墓志铭弹窗字号放大 */
body.t2-mode .memorial-item {
  gap: 12px;
  padding: 14px 16px;
}

body.t2-mode .memorial-medal {
  width: 34px;
  height: 34px;
  font-size: 18px;
}

body.t2-mode .memorial-name {
  font-size: 22px;
}

body.t2-mode .memorial-desc {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.7;
}

body.t2-mode .memorial-date {
  margin-top: 5px;
  font-size: 12px;
}

body.t2-mode .memorial-permanent {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 520px) {
  body.t2-mode .memorial-medal {
    width: 28px;
    height: 28px;
    font-size: 15px;
  }

  body.t2-mode .memorial-name {
    font-size: 18px;
  }

  body.t2-mode .memorial-desc {
    font-size: 13.5px;
  }
}

/* ============================================================
   t2 · 蝶
   ============================================================ */

.view-butterfly {
  flex-direction: column;
  overflow: hidden;
  color: #111;
  font-family: var(--font-t2);
  background: #ededed;
}

.butterfly-body {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 30px 24px 70px;
  overflow-y: auto;
}

.butterfly-story-panel {
  width: min(1020px, 100%);
}

.butterfly-story {
  width: 100%;
}

.butterfly-node {
  position: relative;
  padding: 30px 44px 38px;
}

.butterfly-deco {
  position: absolute;
  width: 76px;
  height: auto;
  opacity: 0.78;
  pointer-events: none;
  user-select: none;
  transition: opacity 0.38s ease;
}

.butterfly-deco.deco-top {
  top: -22px;
  left: -18px;
  transform: rotate(-12deg);
}

.butterfly-deco.deco-bottom {
  right: -20px;
  bottom: -30px;
  transform: rotate(10deg) scaleX(-1);
}

.butterfly-deco.out {
  opacity: 0;
}

.butterfly-options {
  width: min(760px, 100%);
}

.butterfly-end-summary {
  max-width: 780px;
}

.fall-end-desc {
  margin-top: 14px;
  max-width: 720px;
  color: #555;
  font-family: var(--font-t2);
  font-size: clamp(15px, 1.9vw, 19px);
  line-height: 1.9;
  letter-spacing: 0.05em;
}

.view-butterfly-end {
  align-items: center;
  justify-content: center;
  padding: 44px 24px 110px;
  color: #1a1a1a;
  background: #ececec;
  --font-page: var(--font-t2);
  font-family: var(--font-t2);
}

/* 陨落结局后的暗红引文 */
.view-fall-end.fall-coda {
  background: #f1eaea;
}

.view-fall-end.fall-coda .text-page {
  max-width: 900px;
}

.view-fall-end.fall-coda .text-page-line {
  color: #7c1d1d;
  font-size: clamp(20px, 2.4vw, 27px);
  line-height: 1.95;
  letter-spacing: 0.06em;
}

@media (max-width: 900px) {
  .butterfly-node {
    padding: 22px 18px 30px;
  }

  .butterfly-deco {
    width: 52px;
  }

  .butterfly-deco.deco-top {
    top: -16px;
    left: -8px;
  }

  .butterfly-deco.deco-bottom {
    right: -8px;
    bottom: -22px;
  }

  .butterfly-body {
    padding: 18px 14px 50px;
  }
}

/* ============================================================
   发泄墙
   ============================================================ */

.view-venting {
  position: relative;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.venting-canvas {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  cursor: crosshair;
  user-select: none;
}

.venting-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(0, 0, 0, 0.26);
  font-size: 14px;
  letter-spacing: 0.14em;
  pointer-events: none;
}

.venting-barrage {
  position: absolute;
  width: max-content;
  max-width: calc(100% - 12px);
  transform: translate(-50%, -50%) rotate(var(--rot, 0deg));
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: center;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  pointer-events: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
  animation: venting-life var(--life, 4.5s) ease-out forwards;
}

@keyframes venting-life {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(0.72);
  }
  8% {
    opacity: 0.95;
    transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(1);
  }
  78% {
    opacity: 0.95;
    transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(0.94);
  }
}

.venting-toolbar {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(6px);
  font-size: 12px;
  color: #444;
}

.venting-color-label {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.venting-color-label input[type='color'] {
  width: 26px;
  height: 22px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.venting-btn {
  padding: 5px 12px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: #333;
  font-size: 12px;
  cursor: pointer;
}

.venting-btn:hover {
  background: #fff;
}

.venting-count {
  color: #666;
  font-family: var(--font-mono);
}

body.t2-mode .view-venting {
  font-family: var(--font-t2);
}

body.t2-mode .venting-toolbar {
  font-size: 15px;
}

body.t2-mode .venting-btn,
body.t2-mode .venting-count {
  font-size: 15px;
}

.venting-editor-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 56vh;
  overflow: auto;
  padding-right: 4px;
}

.venting-editor-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.venting-editor-input {
  flex: 1;
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font: inherit;
  resize: vertical;
}

.venting-remove-btn {
  flex: 0 0 auto;
}

.venting-editor-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.venting-editor-count {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

@media (max-width: 520px) {
  .venting-toolbar {
    bottom: 10px;
    gap: 6px;
    padding: 6px 10px;
  }

  .venting-hint {
    font-size: 12px;
  }

  .venting-barrage {
    max-width: calc(100% - 16px);
    line-height: 1.2;
    letter-spacing: 0;
  }
}

@media (max-width: 520px) {
  .view-fall .t2-brand-title {
    font-size: 16px;
  }

  .view-fall .t2-top-actions {
    gap: 3px;
  }

  .view-fall .t2-ghost-btn {
    padding: 5px 7px;
    font-size: 13px;
  }

  .view-fall .t2-user {
    font-size: 11px;
  }
}

/* ============================================================
   4 · 兽医
   ============================================================ */

.view-vet {
  flex-direction: column;
  overflow: hidden;
  background: #111;
  color: #1c1c1c;
  font-family: var(--font-t2);
}

.view-vet button,
.view-vet input,
.view-vet textarea {
  font-family: var(--font-t2);
}

.vet-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* ---------- 主画面 ---------- */

.vet-scene,
.vet-desk,
.vet-files,
.vet-reader,
.vet-history {
  position: absolute;
  inset: 0;
}

.vet-scene {
  background: #050505;
}

.vet-scene-scroll {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.vet-scene-inner {
  position: relative;
  width: 100%;
}

.vet-scene-img {
  display: block;
  width: 100%;
  height: auto;
  transition: filter 0.6s ease;
}

.vet-hit {
  position: absolute;
  z-index: 2;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.vet-hit:focus-visible {
  outline: 2px dashed rgba(255, 255, 255, 0.6);
  outline-offset: -2px;
}

.vet-graduation {
  position: absolute;
  left: 1.6%;
  bottom: 5%;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.55);
  color: #f3ead6;
  font-size: 15px;
  letter-spacing: 0.08em;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.vet-graduation-arrow {
  font-size: 18px;
}

.vet-graduation:hover {
  background: rgba(20, 20, 20, 0.78);
}

.vet-float {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 4;
  transform: translate(-50%, -50%);
  padding: 12px 22px;
  border-radius: 8px;
  background: rgba(12, 12, 12, 0.62);
  color: #f4ecda;
  font-size: clamp(15px, 1.4vw, 20px);
  letter-spacing: 0.06em;
  white-space: nowrap;
  opacity: 0;
  animation: vet-float-in 0.8s ease forwards;
  pointer-events: none;
}

.vet-float.out {
  animation: vet-float-out 0.8s ease forwards;
}

@keyframes vet-float-in {
  from { opacity: 0; transform: translate(-50%, -46%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

@keyframes vet-float-out {
  to { opacity: 0; transform: translate(-50%, -54%); }
}

/* ---------- 开场 ---------- */

.view-vet.vet-mono {
  background: #ffffff;
}

.vet-intro-stage,
.vet-intro-text,
.vet-ending-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 28px;
}

.vet-intro-stage .text-page,
.vet-ending-text .text-page {
  max-width: 860px;
}

.vet-intro-stage .text-page-line {
  color: #111;
  text-align: center;
  font-size: clamp(26px, 3.4vw, 42px);
  letter-spacing: 0.14em;
}

.vet-intro-hint {
  color: #666;
}

.vet-intro-bg {
  position: absolute;
  inset: 0;
  background: #000;
}

.vet-intro-bg-img,
.vet-ending-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(7px) brightness(0.72) saturate(0.7);
  transform: scale(1.04);
}

.vet-intro-text::before,
.vet-ending-text::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.68));
  pointer-events: none;
}

.vet-intro-text .text-page,
.vet-ending-text .text-page {
  position: relative;
  z-index: 1;
}

.vet-intro-text .text-page-line,
.vet-ending-text .text-page-line {
  color: #f5efe1;
  line-height: 1.95;
  font-size: clamp(15px, 1.55vw, 21px);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
}

.vet-intro-text .text-page-hint,
.vet-ending .text-page-hint {
  color: rgba(245, 239, 225, 0.7);
}

/* ---------- 桌面 ---------- */

.vet-desk {
  display: grid;
  place-items: center;
  background: #0d0d0d;
  overflow: hidden;
}

.vet-desk-inner {
  position: relative;
  width: 100%;
}

.vet-desk-img {
  display: block;
  width: 100%;
  height: auto;
  transition: filter 0.6s ease;
}

.vet-back {
  position: absolute;
  left: 18px;
  top: 18px;
  z-index: 6;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.55);
  color: #f2ead8;
  font-size: 20px;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.vet-back:hover {
  background: rgba(10, 10, 10, 0.8);
}

/* ---------- 纸张 ---------- */

.vet-paper {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.5), transparent 45%),
    linear-gradient(150deg, #efe6d2, #e5d9c2 55%, #ddd0b6);
  overflow: hidden;
}

.vet-paper-dark {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.12), transparent 60%),
    linear-gradient(160deg, #201816, #120d0c 70%);
}

.vet-paper-scroll {
  height: 100%;
  overflow-y: auto;
  padding: 46px 22px 110px;
}

.vet-paper-scroll > * {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.vet-paper-title {
  margin: 0 0 24px;
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: center;
}

.vet-paper-body {
  font-size: clamp(17px, 1.55vw, 21px);
  line-height: 2;
}

.vet-paper-line {
  margin: 0 0 16px;
  white-space: pre-wrap;
}

.vet-paper-dark .vet-paper-title,
.vet-paper-dark .vet-paper-line {
  color: #e9dfcd;
}

.vet-note-divider {
  margin: 22px 0;
  border-top: 1px solid rgba(110, 80, 50, 0.3);
}

/* ---------- 档案墙 ---------- */

.vet-files {
  display: grid;
  place-items: center;
  background: #1a1a1a;
  overflow: hidden;
}

.vet-files-inner {
  position: relative;
  max-width: 100%;
  max-height: 100%;
}

.vet-files-img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 52px);
  width: auto;
  height: auto;
  transition: filter 0.6s ease;
}

.vet-file-slot {
  position: absolute;
  cursor: default;
}

.vet-file-slot.available {
  cursor: pointer;
}

.vet-file-slot.completed {
  background: rgba(90, 90, 90, 0.32);
}

.vet-file-name {
  position: absolute;
  left: 24%;
  right: 20%;
  top: 70.5%;
  height: 14%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2b2b2b;
  font-size: clamp(8px, 1.15vw, 15px);
  text-align: center;
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vet-file-slot.bottom .vet-file-name {
  top: 74.5%;
}

.vet-file-stamp {
  position: absolute;
  left: 50%;
  top: 36%;
  width: clamp(20px, 3.6vw, 44px);
  height: clamp(20px, 3.6vw, 44px);
  background-color: var(--seal-color, #a02c22);
  transform: translate(-50%, -50%) rotate(-10deg);
  opacity: 0.9;
  pointer-events: none;
}

.vet-file-stamp::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.3) 0 2px, transparent 2px 7px);
  opacity: 0.75;
}

.vet-file-slot.completed .vet-file-stamp {
  filter: grayscale(1);
  opacity: 0.55;
}

.vet-file-slash {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.vet-file-slash::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(161, 29, 29, 0.92);
  clip-path: polygon(94% 3%, 100% 9%, 9% 100%, 3% 94%);
}

.vet-file-slot.just-completed .vet-file-slash::before {
  animation: vet-slash 0.55s ease-out both;
}

@keyframes vet-slash {
  from {
    opacity: 0;
    transform: translate(5%, -5%);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 阅读页 ---------- */

.vet-reader {
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 8%, rgba(255, 255, 255, 0.4), transparent 52%),
    linear-gradient(160deg, #f2ead8, #e6dac4 72%);
}

.vet-reader-scroll {
  position: relative;
  height: 100%;
  overflow-y: auto;
  padding: 42px 24px 120px;
}

.vet-reader-inner {
  max-width: 760px;
  margin: 0 auto;
}

.vet-reader-title {
  margin: 0 0 22px;
  font-size: clamp(23px, 2.8vw, 38px);
  letter-spacing: 0.12em;
  text-align: center;
}

.vet-reader-body {
  font-size: clamp(17px, 1.55vw, 21px);
  line-height: 2.05;
}

.vet-reader-line {
  margin: 0 0 18px;
  white-space: pre-wrap;
}

.vet-reader-verdict {
  margin: 34px 0 24px;
  padding-top: 14px;
  border-top: 1px dashed rgba(100, 70, 40, 0.35);
  font-size: clamp(19px, 1.7vw, 23px);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
}

.vet-seal {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(72px, 8vw, 96px);
  height: clamp(72px, 8vw, 96px);
  margin: 0 auto 24px;
  padding: 0;
  border: none;
  border-radius: 0;
  background-color: var(--seal-color, #a02c22);
  cursor: pointer;
  transform: rotate(-8deg);
  opacity: 0.92;
  transition: transform 0.2s ease, opacity 0.3s ease, filter 0.3s ease;
}

.vet-seal::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.28) 0 2px, transparent 2px 7px);
  mix-blend-mode: screen;
  opacity: 0.8;
}

.vet-seal:hover {
  transform: rotate(-8deg) scale(1.04);
}

.vet-seal.done {
  filter: grayscale(1);
  opacity: 0.4;
  cursor: default;
}

/* 十种印章形状（阅读页的印章与档案袋上的小印章共用） */
.vet-seal.seal-1,
.vet-file-stamp.seal-1 {
  clip-path: polygon(50% 0, 66% 25%, 98% 25%, 82% 50%, 98% 75%, 66% 75%, 50% 100%, 34% 75%, 2% 75%, 18% 50%, 2% 25%, 34% 25%);
}

.vet-seal.seal-2,
.vet-file-stamp.seal-2 {
  clip-path: polygon(50% 0%, 61% 18%, 80% 8%, 82% 28%, 100% 42%, 84% 55%, 93% 75%, 71% 77%, 64% 97%, 50% 84%, 36% 97%, 29% 77%, 7% 75%, 16% 55%, 0% 42%, 18% 28%, 20% 8%, 39% 18%);
}

.vet-seal.seal-3,
.vet-file-stamp.seal-3 {
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.vet-seal.seal-4,
.vet-file-stamp.seal-4 {
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}

.vet-seal.seal-5,
.vet-file-stamp.seal-5 {
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.vet-seal.seal-6,
.vet-file-stamp.seal-6 {
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.vet-seal.seal-7,
.vet-file-stamp.seal-7 {
  clip-path: polygon(50% 0, 58% 20%, 79% 13%, 82% 35%, 100% 50%, 82% 65%, 79% 87%, 58% 80%, 50% 100%, 42% 80%, 21% 87%, 18% 65%, 0 50%, 18% 35%, 21% 13%, 42% 20%);
}

.vet-seal.seal-8,
.vet-file-stamp.seal-8 {
  clip-path: polygon(35% 0, 65% 0, 65% 35%, 100% 35%, 100% 65%, 65% 65%, 65% 100%, 35% 100%, 35% 65%, 0 65%, 0 35%, 35% 35%);
}

.vet-seal.seal-9,
.vet-file-stamp.seal-9 {
  clip-path: polygon(50% 0, 54% 24%, 68% 8%, 73% 30%, 91% 21%, 83% 43%, 100% 50%, 83% 57%, 91% 79%, 73% 70%, 68% 92%, 54% 76%, 50% 100%, 46% 76%, 32% 92%, 27% 70%, 9% 79%, 17% 57%, 0 50%, 17% 43%, 9% 21%, 27% 30%, 32% 8%, 46% 24%);
}

.vet-seal.seal-10,
.vet-file-stamp.seal-10 {
  clip-path: polygon(6% 0, 94% 0, 100% 6%, 100% 94%, 94% 100%, 6% 100%, 0 94%, 0 6%);
}

/* 十种印章纹理 */
.vet-seal.seal-1::before,
.vet-file-stamp.seal-1::before {
  background-image: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.35) 0 14%, transparent 15%), radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.18) 0 32%, transparent 33%);
}

.vet-seal.seal-2::before,
.vet-file-stamp.seal-2::before {
  background-image: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.45) 0 12%, transparent 13%), conic-gradient(from 0deg, rgba(255, 255, 255, 0.16) 0 36deg, transparent 36deg 72deg);
}

.vet-seal.seal-3::before,
.vet-file-stamp.seal-3::before {
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.3) 0 2px, transparent 2px 7px);
}

.vet-seal.seal-4::before,
.vet-file-stamp.seal-4::before {
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.28) 0 3px, transparent 3px 9px);
}

.vet-seal.seal-5::before,
.vet-file-stamp.seal-5::before {
  background-image: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.3) 0 2px, transparent 2px 7px);
}

.vet-seal.seal-6::before,
.vet-file-stamp.seal-6::before {
  background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.3) 0 2px, transparent 2px 8px);
}

.vet-seal.seal-7::before,
.vet-file-stamp.seal-7::before {
  background-image: radial-gradient(circle at 50% 50%, transparent 40%, rgba(255, 255, 255, 0.3) 41% 46%, transparent 47%);
}

.vet-seal.seal-8::before,
.vet-file-stamp.seal-8::before {
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.24) 0 2px, transparent 2px 6px), repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.24) 0 2px, transparent 2px 6px);
}

.vet-seal.seal-9::before,
.vet-file-stamp.seal-9::before {
  background-image: conic-gradient(from 0deg, rgba(255, 255, 255, 0.22) 0 15deg, transparent 15deg 30deg);
}

.vet-seal.seal-10::before,
.vet-file-stamp.seal-10::before {
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 2px, transparent 2px 7px), repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.22) 0 2px, transparent 2px 7px);
}

/* ---------- 校史 ---------- */

.vet-history {
  background:
    radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.45), transparent 55%),
    linear-gradient(160deg, #f3ecdc, #e7dcc6);
  overflow: hidden;
}

.vet-history-scroll {
  height: 100%;
  overflow: auto;
  padding: 40px 18px 110px;
  touch-action: pan-y;
}

.vet-history-inner {
  max-width: 860px;
  margin: 0 auto;
}

.vet-history-title {
  margin: 0 0 22px;
  font-size: clamp(24px, 2.6vw, 34px);
  letter-spacing: 0.1em;
  text-align: center;
}

.vet-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(12.5px, 1.3vw, 17px);
  background: rgba(255, 255, 255, 0.35);
}

.vet-history-table th,
.vet-history-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(110, 80, 50, 0.25);
  text-align: center;
  white-space: nowrap;
}

.vet-history-table th {
  font-weight: 700;
  background: rgba(140, 105, 60, 0.12);
}

.vet-history-subtitle {
  margin: 0 0 18px;
  font-size: clamp(22px, 2.3vw, 30px);
  letter-spacing: 0.1em;
  text-align: center;
}

.vet-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vet-history-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 10px;
  border-bottom: 1px dashed rgba(110, 80, 50, 0.22);
  font-size: clamp(15px, 1.45vw, 19px);
}

.vet-history-name {
  line-height: 1.5;
}

.vet-history-count {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: clamp(16px, 1.55vw, 20px);
}

.vet-history-note {
  margin-top: 18px;
  color: #7a6a54;
  font-size: 13.5px;
  text-align: right;
}

/* ---------- 收藏品 ---------- */

.vet-collection {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  font-family: var(--font-t2);
}

.vet-collectible {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.45);
}

.vet-collectible-img {
  width: 100%;
  max-height: 130px;
  object-fit: contain;
}

.vet-collectible-glyph {
  display: grid;
  place-items: center;
  width: 90px;
  height: 90px;
  color: #8f1d1d;
  font-size: 52px;
  font-weight: 700;
}

.vet-collectible-name {
  font-size: 15px;
  font-weight: 700;
}

.vet-collectible-desc {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
  text-align: center;
}

/* ---------- 终章 ---------- */

.vet-ending {
  position: absolute;
  inset: 0;
  background: #000;
}

.vet-final {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #101010;
  color: #efe7d5;
}

.vet-final-kicker {
  font-size: 14px;
  letter-spacing: 0.3em;
  opacity: 0.6;
}

.vet-final-title {
  font-size: clamp(30px, 3.4vw, 46px);
  letter-spacing: 0.2em;
}

.vet-final-actions {
  display: flex;
  gap: 14px;
  margin-top: 26px;
}

/* ---------- 手机 ---------- */

@media (max-width: 700px) {
  .vet-scene-scroll {
    justify-content: flex-start;
    align-items: stretch;
  }

  .vet-scene-inner {
    width: auto;
    height: 100%;
    flex: 0 0 auto;
  }

  .vet-scene-img {
    width: auto;
    height: 100%;
    max-width: none;
  }

  .vet-desk-inner {
    width: 100%;
  }

  .vet-files-img {
    max-height: calc(100dvh - 52px);
  }

  .vet-paper-scroll,
  .vet-reader-scroll {
    padding: 30px 16px 100px;
  }

  .vet-paper-line,
  .vet-reader-line {
    line-height: 1.95;
    font-size: 16px;
  }

  .vet-history-scroll {
    padding: 26px 10px 100px;
  }

  .vet-history-table th,
  .vet-history-table td {
    padding: 5px 6px;
    font-size: 11.5px;
  }

  .vet-collection {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vet-graduation {
    left: 12px;
    bottom: 12px;
    padding: 6px 10px;
    font-size: 13px;
  }

  .vet-back {
    left: 10px;
    top: 10px;
    width: 36px;
    height: 36px;
    font-size: 17px;
  }
}

@media (max-width: 520px) {
  .vet-file-name {
    font-size: 8px;
  }

  .vet-file-stamp {
    width: 20px;
    height: 20px;
    border-width: 1px;
  }
}

/* ============================================================
   5 · 火种
   ============================================================ */

.view-fire {
  position: relative;
}

/* 屏幕边缘的红色进度条 */
.fire-ring {
  position: absolute;
  inset: 0;
  z-index: 40;
  padding: 5px;
  pointer-events: none;
  background:
    conic-gradient(
      from 0deg,
      #c01d1d calc(var(--fire-progress, 0) * 1turn),
      rgba(192, 29, 29, 0.14) 0
    );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  transition: background 0.5s ease;
}

.fire-ring.complete {
  padding: 7px;
  filter: drop-shadow(0 0 6px rgba(192, 29, 29, 0.55));
}

/* 火种结局：全屏淡出与图片淡入 */
.fire-finale-layer {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: none;
  background: #000;
}

.view-fire.fire-finale .fire-finale-layer {
  display: block;
  animation: fire-fade-in 1.4s ease forwards;
}

.view-fire.fire-finale .t2-topbar,
.view-fire.fire-finale .t2-log-strip,
.view-fire.fire-finale .t2-body,
.view-fire.fire-finale .t2-action {
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
}

@keyframes fire-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fire-finale-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.62) saturate(1.05);
}

.fire-finale-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
}

.fire-finale-text .text-page {
  max-width: 900px;
}

.fire-finale-text .text-page-line {
  color: #f7ece0;
  text-align: center;
  font-size: clamp(18px, 2vw, 30px);
  letter-spacing: 0.1em;
  line-height: 2;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7);
}

.fire-finale-hint {
  transform: translateX(-50%);
  color: rgba(247, 236, 224, 0.78);
  font-size: 13px;
  letter-spacing: 0.18em;
}

.view-fire-end {
  position: relative;
  overflow: hidden;
}

.fire-end-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.fire-end-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.6) saturate(1.05);
}

.view-fire-end .t2-end-stage,
.view-fire-end .t2-end-actions,
.view-fire-end .text-page-hint {
  z-index: 2;
}

.view-fire-end.fire-has-bg .fall-end-kicker,
.view-fire-end.fire-has-bg .fall-end-title,
.view-fire-end.fire-has-bg .fall-end-desc,
.view-fire-end.fire-has-bg .fall-end-memorial,
.view-fire-end.fire-has-bg .fall-end-memorial-desc {
  color: #f6e9d8;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7);
}

html body.t2-mode .view-fire .fall-line,
html body.t2-mode .view-fire .fall-option {
  font-size: clamp(19px, 1.9vw, 26px);
}

@media (max-width: 700px) {
  .fire-finale-text .text-page-line {
    font-size: 17px;
  }

  .view-fire .t2-top-actions {
    gap: 4px;
  }

  .view-fire .t2-ghost-btn {
    padding: 6px 8px;
    font-size: 13px;
  }
}

/* ---------- 兽医收尾 ---------- */

.vet-ending-skip {
  position: absolute;
  right: 20px;
  bottom: 22px;
  z-index: 5;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.55);
  color: #f2ead8;
  font-size: 14px;
  letter-spacing: 0.08em;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.vet-ending-skip:hover {
  background: rgba(10, 10, 10, 0.8);
}

.vet-coda {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 8vw;
  background: #ffffff;
}

.vet-coda .text-page {
  max-width: 900px;
}

.vet-coda .text-page-line {
  color: #1b1b1b;
  font-size: clamp(18px, 1.9vw, 26px);
  line-height: 2;
  letter-spacing: 0.06em;
}

.vet-coda-hint {
  color: #777;
}

/* ---------- 主菜单 ---------- */

.view-menu {
  flex-direction: column;
  overflow: hidden;
  color: #111;
  font-family: var(--font-t2);
  background: #ededed;
}

.menu-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 30px clamp(16px, 4vw, 48px) 80px;
}

.menu-header {
  max-width: 1080px;
  margin: 0 auto 26px;
}

.menu-heading {
  margin: 0 0 8px;
  font-size: clamp(28px, 3.6vw, 42px);
  font-weight: 600;
  letter-spacing: 0.14em;
}

.menu-subheading {
  margin: 0;
  color: #777;
  font-size: 15px;
  letter-spacing: 0.1em;
}

.menu-font-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.menu-font-label {
  color: #888;
  font-size: 13px;
  letter-spacing: 0.12em;
}

.menu-font-btn {
  padding: 5px 14px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: #555;
  font-family: var(--font-t2);
  font-size: 13px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.menu-font-btn.active {
  border-color: rgba(154, 47, 47, 0.55);
  background: rgba(154, 47, 47, 0.08);
  color: #9a2f2f;
}

.menu-section {
  max-width: 1080px;
  margin: 0 auto 26px;
  padding: 22px 24px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.menu-section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.menu-section-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.menu-section-sub {
  color: #8a8a8a;
  font-size: 14px;
  letter-spacing: 0.08em;
}

.menu-section-action {
  margin-left: auto;
  padding: 6px 14px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: #333;
  font-family: var(--font-t2);
  font-size: 13px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.menu-section-action:hover {
  background: #fff;
}

.menu-stage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.menu-stage-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 14px;
  background: #fff;
  color: #222;
  font-family: var(--font-t2);
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.menu-stage-card:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(154, 47, 47, 0.4);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.menu-stage-card:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.menu-stage-card.current {
  border-color: rgba(154, 47, 47, 0.55);
  box-shadow: inset 0 0 0 1px rgba(154, 47, 47, 0.3);
}

.menu-stage-index {
  color: #b08a3e;
  font-size: 12px;
  letter-spacing: 0.24em;
}

.menu-stage-title {
  font-size: 22px;
  letter-spacing: 0.18em;
}

.menu-stage-note {
  color: #777;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.menu-stage-tag {
  position: absolute;
  top: 10px;
  right: 12px;
  color: #9a2f2f;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.menu-collect {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-collect-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu-collect-row {
  display: grid;
  grid-template-columns: 140px 1fr 80px;
  align-items: center;
  gap: 14px;
}

.menu-collect-name {
  font-size: 16px;
  letter-spacing: 0.12em;
}

.menu-collect-bar {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.09);
  overflow: hidden;
}

.menu-collect-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #9a2f2f;
  transition: width 0.4s ease;
}

.menu-collect-count {
  color: #666;
  font-size: 14px;
  text-align: right;
}

.menu-collect-hint {
  margin: 0;
  color: #888;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.menu-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.menu-chip {
  padding: 6px 12px;
  border: 1px dashed rgba(0, 0, 0, 0.18);
  border-radius: 999px;
  color: #999;
  font-size: 14px;
  letter-spacing: 0.08em;
}

.menu-chip.got {
  border-style: solid;
  border-color: rgba(154, 47, 47, 0.5);
  background: rgba(154, 47, 47, 0.06);
  color: #9a2f2f;
}

.menu-save-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.menu-save-card {
  padding: 14px 16px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  background: #fff;
}

.menu-save-card.empty {
  background: rgba(255, 255, 255, 0.4);
}

.menu-save-title {
  color: #666;
  font-size: 14px;
  letter-spacing: 0.12em;
}

.menu-save-summary {
  margin: 8px 0 4px;
  font-size: 15px;
  line-height: 1.5;
}

.menu-save-time {
  color: #999;
  font-size: 12px;
}

.menu-save-load {
  margin-top: 10px;
  padding: 6px 14px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: #333;
  font-family: var(--font-t2);
  font-size: 13px;
  cursor: pointer;
}

@media (max-width: 700px) {
  .t2-top-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    row-gap: 4px;
  }

  .view-fire .t2-topbar-inner {
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .view-fire .t2-brand {
    flex: 1 1 100%;
  }

  .view-fire .t2-top-actions {
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  .view-fire .t2-brand-title {
    font-size: 18px;
  }

  .view-fire .t2-user {
    display: none;
  }

  .menu-scroll {
    padding: 20px 14px 60px;
  }

  .menu-section {
    padding: 16px 14px;
    border-radius: 14px;
  }

  .menu-stage-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .menu-stage-title {
    font-size: 19px;
  }

  .menu-collect-row {
    grid-template-columns: 100px 1fr 62px;
    gap: 8px;
  }

  .menu-collect-name {
    font-size: 14px;
  }

  .menu-save-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- 陨落收尾跳过 ---------- */

.fall-coda-skip {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 6;
  padding: 8px 16px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: #7c1d1d;
  font-family: var(--font-t2);
  font-size: 14px;
  letter-spacing: 0.08em;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.fall-coda-skip:hover {
  background: #fff;
}

@media (max-width: 700px) {
  .fall-coda-skip {
    top: 14px;
    right: 14px;
    padding: 7px 13px;
    font-size: 13px;
  }
}