:root {
  --bg: #08070a;
  --surface: rgba(20, 14, 18, 0.72);
  --surface-strong: rgba(22, 13, 18, 0.92);
  --border: rgba(255, 255, 255, 0.09);
  --border-accent: rgba(255, 42, 79, 0.42);
  --text: #f6f1f3;
  --text-muted: rgba(246, 241, 243, 0.62);
  --crimson: #ff2a4f;
  --crimson-deep: #a50d2a;
  --crimson-glow: rgba(255, 42, 79, 0.45);
  --ice: #62b6ff;
  --ice-glow: rgba(98, 182, 255, 0.42);
  --gold: #ffbe5c;
  --gold-glow: rgba(255, 190, 92, 0.48);
  --radius: 20px;
  --safe-top: env(safe-area-inset-top, 14px);
  --safe-bottom: env(safe-area-inset-bottom, 16px);
  --beat-ms: 660ms;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #040306;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  overflow: hidden;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-shell {
  position: relative;
  width: 100%;
  height: 100dvh;
  max-width: 440px;
  max-height: 940px;
  background: var(--bg);
  overflow: hidden;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

@media (min-width: 500px) {
  .app-shell {
    border-radius: 36px;
    height: min(92dvh, 880px);
  }
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.985);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.hidden {
  display: none !important;
}

/* ==================== 通用按钮 & 玻璃态 ==================== */
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(18, 14, 18, 0.55);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform 0.14s ease, border-color 0.2s ease, background 0.2s ease;
}

.icon-btn:active {
  transform: scale(0.92);
}

.icon-btn.subtle {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.55);
}

.glass {
  background: rgba(16, 12, 16, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.11);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}

/* ==================== 1. 伪装层：番茄钟 ==================== */
.disguise-screen {
  background: radial-gradient(circle at 50% 20%, #17181d 0%, #0b0c10 70%);
  padding: calc(var(--safe-top) + 12px) 22px calc(var(--safe-bottom) + 20px);
  justify-content: space-between;
}

.disguise-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.disguise-brand {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  cursor: pointer;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e14b62;
  box-shadow: 0 0 10px rgba(225, 75, 98, 0.6);
}

.disguise-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
}

.pomodoro-ring {
  position: relative;
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 6;
}

.ring-fill {
  fill: none;
  stroke: #e14b62;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 666;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.5s linear;
}

.pomodoro-time-wrap {
  position: absolute;
  text-align: center;
}

.pomodoro-time {
  font-size: 48px;
  font-weight: 300;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.pomodoro-label {
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.42);
}

.disguise-actions {
  display: flex;
  gap: 12px;
}

.pomo-btn {
  padding: 12px 26px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.14s ease, opacity 0.2s ease;
}

.pomo-btn:active { transform: scale(0.95); }
.pomo-btn.primary {
  background: #e14b62;
  color: #fff;
}
.pomo-btn.ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}
.pomo-btn.small { padding: 10px 14px; font-size: 12px; }
.pomo-btn.full { width: 100%; }

.disguise-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.28);
  text-align: center;
  max-width: 260px;
  line-height: 1.5;
  margin: 0;
}

/* ==================== PIN 弹窗 & 设置弹窗 ==================== */
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 4, 8, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 20px;
}

.pin-card, .settings-card {
  width: 100%;
  max-width: 320px;
  background: #141016;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 24px 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.pin-title {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
}

.pin-subtitle {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 22px 0;
}

.pin-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  transition: all 0.15s ease;
}

.pin-dots span.filled {
  background: var(--crimson);
  border-color: var(--crimson);
  box-shadow: 0 0 12px var(--crimson-glow);
}

.pin-dots.shake {
  animation: shake 0.35s ease;
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.pin-pad button {
  height: 52px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 19px;
  font-weight: 500;
  cursor: pointer;
}

.pin-pad button:active {
  background: rgba(255, 42, 79, 0.25);
}

.pin-pad button.pad-muted {
  font-size: 13px;
  color: var(--text-muted);
}

/* ==================== 2. 主菜单 / 设定页 ==================== */
.setup-screen {
  justify-content: space-between;
  padding: calc(var(--safe-top) + 10px) 18px calc(var(--safe-bottom) + 14px);
}

.setup-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  transform: scale(1.04);
  filter: saturate(1.08) contrast(1.05);
}

.setup-vignette {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(8, 6, 10, 0.58) 0%,
    rgba(10, 6, 10, 0.35) 28%,
    rgba(9, 6, 10, 0.88) 58%,
    rgba(7, 5, 8, 0.98) 100%
  );
}

.setup-topbar, .setup-content {
  position: relative;
  z-index: 2;
}

.setup-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.14em;
  background: rgba(16, 10, 14, 0.65);
  border: 1px solid rgba(255, 42, 79, 0.35);
  backdrop-filter: blur(12px);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--crimson);
  box-shadow: 0 0 10px var(--crimson);
  animation: pulseDot 1.6s infinite;
}

.setup-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-copy {
  padding: 0 4px;
}

.hero-jp {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: rgba(255, 168, 184, 0.78);
  margin-bottom: 4px;
}

.hero-title {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #ffffff 10%, #ff9eb0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-quote {
  margin: 6px 0 0;
  font-size: 13px;
  color: rgba(246, 241, 243, 0.75);
  line-height: 1.45;
}

.config-panel {
  background: rgba(16, 11, 15, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  padding: 14px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.config-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.config-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding-left: 2px;
}

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

.segmented.three {
  grid-template-columns: repeat(3, 1fr);
}

.seg-btn {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 9px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.seg-btn .seg-title {
  font-size: 13px;
  font-weight: 600;
}

.seg-btn .seg-sub {
  font-size: 10px;
  color: var(--text-muted);
}

.seg-btn.active {
  background: linear-gradient(145deg, rgba(255, 42, 79, 0.28), rgba(165, 13, 42, 0.18));
  border-color: var(--border-accent);
  box-shadow: 0 0 18px rgba(255, 42, 79, 0.18);
}

.seg-btn.active .seg-sub {
  color: rgba(255, 200, 210, 0.9);
}

.config-row-toggles {
  display: flex;
  gap: 8px;
}

.chip-toggle {
  flex: 1;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  padding: 9px 10px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.chip-toggle.active {
  border-color: rgba(255, 42, 79, 0.4);
  color: var(--text);
  background: rgba(255, 42, 79, 0.14);
}

.chip-toggle.active .chip-dot {
  background: var(--crimson);
  box-shadow: 0 0 8px var(--crimson);
}

.setup-cta-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cta-start {
  position: relative;
  width: 100%;
  height: 54px;
  border: none;
  border-radius: 18px;
  background: linear-gradient(135deg, #ff2a4f 0%, #b80d30 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(255, 42, 79, 0.38);
  transition: transform 0.14s ease, box-shadow 0.2s ease;
}

.cta-start.compact {
  height: 46px;
  font-size: 14px;
}

.cta-start:active {
  transform: scale(0.97);
}

/* ==================== 3. 核心沉浸舞台 ==================== */
.stage-screen {
  background: #060508;
  justify-content: space-between;
}

.ambient-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 12;
  box-shadow: inset 0 0 42px rgba(255, 42, 79, 0.25);
  transition: box-shadow 0.35s ease;
}

.stage-screen[data-state="stroke"].beat-hit .ambient-frame {
  box-shadow: inset 0 0 72px rgba(255, 42, 79, 0.55);
}

.stage-screen[data-state="overdrive"] .ambient-frame {
  box-shadow: inset 0 0 65px rgba(255, 18, 92, 0.52);
}

.stage-screen[data-state="overdrive"].beat-hit .ambient-frame {
  box-shadow: inset 0 0 98px rgba(255, 18, 92, 0.82);
}

.stage-screen[data-state="hold"] .ambient-frame {
  box-shadow: inset 0 0 85px rgba(98, 182, 255, 0.52);
}

.stage-screen[data-state="story"] .ambient-frame,
.stage-screen[data-state="choice"] .ambient-frame {
  box-shadow: inset 0 0 28px rgba(255, 42, 79, 0.14);
}

.stage-screen[data-state="story"] .comic-bottom-fade,
.stage-screen[data-state="choice"] .comic-bottom-fade {
  height: 220px;
}

.comic-viewport {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #060508;
  overflow: hidden;
}

.comic-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.28s ease, transform 0.18s ease, filter 0.35s ease;
}

.fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 13;
}

.fx-heart {
  position: absolute;
  bottom: 22%;
  color: #ff476f;
  font-size: 16px;
  text-shadow: 0 0 14px rgba(255, 42, 79, 0.85);
  animation: floatHeart 1.9s ease-out forwards;
  opacity: 0;
}

.stage-screen[data-state="tease"] .ambient-frame {
  box-shadow: inset 0 0 88px rgba(255, 178, 72, 0.56);
}

.stage-screen[data-state="overdrive"] .comic-img {
  filter: saturate(1.16) contrast(1.06);
}

.stage-screen[data-state="hold"] .comic-img {
  filter: saturate(0.32) brightness(0.58) blur(1.5px);
}

.stage-screen.beat-hit[data-state="stroke"] .comic-img,
.stage-screen.beat-hit[data-state="overdrive"] .comic-img {
  transform: scale(1.012);
}

.comic-top-fade {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 140px;
  background: linear-gradient(180deg, rgba(6, 5, 8, 0.82) 0%, rgba(6, 5, 8, 0) 100%);
  pointer-events: none;
}

.comic-bottom-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 310px;
  background: linear-gradient(0deg, rgba(6, 5, 8, 0.96) 24%, rgba(6, 5, 8, 0.65) 68%, rgba(6, 5, 8, 0) 100%);
  pointer-events: none;
}

.stage-screen.clean-view .hud-element {
  opacity: 0.08;
  pointer-events: none;
}

.hud-element {
  position: relative;
  z-index: 15;
  transition: opacity 0.25s ease;
}

.stage-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 8px) 14px 6px;
}

.chapter-pill {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.chapter-pill .divider {
  opacity: 0.4;
}

.chapter-pill .page-num {
  color: #ff9cb0;
  font-variant-numeric: tabular-nums;
}

.stage-metrics {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
}

.metric-chip, .state-chip {
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(14, 10, 14, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}

.metric-label {
  color: var(--text-muted);
}

.sub-accent {
  color: #ff8ea6;
  font-weight: 600;
}

.state-chip.story,
.state-chip.choice {
  border-color: rgba(255, 190, 92, 0.42);
  background: rgba(255, 190, 92, 0.12);
  color: #ffe0ad;
}

.state-chip.stroke {
  border-color: rgba(255, 42, 79, 0.45);
  color: #ffb3c1;
}

.state-chip.overdrive {
  border-color: rgba(255, 30, 110, 0.75);
  background: rgba(255, 20, 82, 0.24);
  color: #fff;
}

.state-chip.hold {
  border-color: rgba(98, 182, 255, 0.6);
  background: rgba(50, 120, 210, 0.22);
  color: #cfe8ff;
}

.state-chip.tease {
  border-color: rgba(255, 190, 92, 0.72);
  background: rgba(255, 155, 40, 0.22);
  color: #ffe3b0;
}

.state-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* 中央停手遮罩 */
.center-overlay {
  position: absolute;
  inset: 0;
  z-index: 14;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  padding-bottom: 120px;
}

.overlay-ring {
  width: 196px;
  height: 196px;
  border-radius: 50%;
  background: rgba(8, 12, 22, 0.78);
  border: 2px solid var(--ice);
  box-shadow: 0 0 48px var(--ice-glow), inset 0 0 28px rgba(98, 182, 255, 0.2);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  animation: breatheRing 1.4s ease-in-out infinite;
}

.overlay-tag {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: #9dd1ff;
  font-weight: 700;
}

.overlay-seconds {
  font-size: 56px;
  font-weight: 700;
  line-height: 1.05;
  margin: 4px 0;
  font-variant-numeric: tabular-nums;
}

.overlay-sub {
  font-size: 12px;
  color: rgba(230, 243, 255, 0.85);
}

/* 底部控制区 */
.stage-dock {
  margin-top: auto;
  padding: 0 14px calc(var(--safe-bottom) + 12px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dialogue-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: 18px;
  background: rgba(16, 10, 14, 0.86);
  border: 1px solid rgba(255, 42, 79, 0.3);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  transition: transform 0.22s ease, border-color 0.25s ease;
}

.dialogue-card.pop {
  transform: scale(1.018);
  border-color: rgba(255, 72, 108, 0.68);
}

.dialogue-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid rgba(255, 42, 79, 0.6);
  flex-shrink: 0;
}

.dialogue-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 14%;
}

.dialogue-body {
  flex: 1;
  min-width: 0;
}

.dialogue-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.dialogue-name {
  font-size: 12px;
  font-weight: 700;
  color: #ff9cb0;
}

.dialogue-mood {
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 42, 79, 0.18);
  color: rgba(255, 210, 220, 0.9);
}

.dialogue-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.42;
  color: #fff;
}

.play-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 纯剧情极简翻页栏 */
.story-bar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.story-prev {
  width: 78px;
  height: 46px;
  flex-shrink: 0;
}

.story-next {
  flex: 1;
}

/* 剧情互动抉择区 */
.choice-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choice-btn {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 42, 79, 0.36);
  background: linear-gradient(135deg, rgba(32, 14, 22, 0.9), rgba(20, 11, 16, 0.92));
  color: #fff;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.12s ease, border-color 0.2s ease, background 0.2s ease;
}

.choice-btn:active {
  transform: scale(0.98);
  background: linear-gradient(135deg, rgba(255, 42, 79, 0.32), rgba(140, 12, 38, 0.35));
}

.choice-btn-main {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.choice-btn-sub {
  font-size: 11px;
  color: rgba(255, 188, 202, 0.78);
}

.tile-type {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 5px;
  color: #fff;
}

.tile-type.story { background: rgba(120, 125, 145, 0.85); }
.tile-type.choice { background: rgba(235, 158, 45, 0.9); color: #1a1004; }
.tile-type.play { background: rgba(255, 42, 79, 0.9); }

/* 节拍可视化 */
.beat-visualizer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 2px 2px;
}

.beat-track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.guide-end {
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-50%);
  z-index: 1;
}

.guide-end.left { left: 8px; }
.guide-end.right { right: 8px; }

.beat-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 42, 79, 0.12), rgba(255, 42, 79, 0.72), rgba(255, 42, 79, 0.12));
  opacity: 0.3;
  transition: opacity 0.14s ease;
}

.stage-screen.beat-hit .beat-fill {
  opacity: 0.95;
}

.stage-screen[data-state="hold"] .beat-fill {
  background: linear-gradient(90deg, rgba(98, 182, 255, 0.12), rgba(98, 182, 255, 0.75), rgba(98, 182, 255, 0.12));
}

.stage-screen[data-state="tease"] .beat-fill {
  background: linear-gradient(90deg, rgba(255, 190, 92, 0.15), rgba(255, 190, 92, 0.85), rgba(255, 190, 92, 0.15));
}

.beat-orb {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 28px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff708c, #ffffff, #ff708c);
  box-shadow: 0 0 18px #ff2a4f, 0 0 6px #fff;
  transform: translateY(-50%);
  transition: left var(--beat-ms) cubic-bezier(0.45, 0.05, 0.55, 0.95), transform 0.12s ease;
  z-index: 2;
}

.beat-orb.at-right {
  left: calc(100% - 40px);
}

.stage-screen.beat-hit .beat-orb {
  transform: translateY(-50%) scale(1.18);
}

.beat-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* 核心 EDGE 按钮 */
.edge-btn {
  position: relative;
  width: 100%;
  padding: 13px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 70, 105, 0.55);
  background: linear-gradient(135deg, rgba(255, 42, 79, 0.92), rgba(152, 12, 42, 0.92));
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(255, 42, 79, 0.32);
  transition: transform 0.12s ease, opacity 0.2s ease;
}

.edge-btn:active {
  transform: scale(0.97);
}

.edge-btn:disabled {
  opacity: 0.45;
  background: rgba(60, 75, 100, 0.55);
  border-color: rgba(98, 182, 255, 0.35);
  box-shadow: none;
}

.edge-btn-main {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.edge-btn-sub {
  font-size: 11px;
  color: rgba(255, 228, 234, 0.86);
}

/* 次级控制栏 */
.dock-controls {
  display: grid;
  grid-template-columns: 1fr 0.9fr 1fr 0.9fr 1.2fr;
  gap: 7px;
}

.ctrl-btn {
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(22, 16, 20, 0.78);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s ease;
}

.ctrl-btn:active { transform: scale(0.94); }

.ctrl-btn.primary {
  background: rgba(255, 42, 79, 0.22);
  border-color: rgba(255, 42, 79, 0.45);
  color: #ffd3dc;
}

.ctrl-btn.primary.ready {
  background: var(--crimson);
  color: #fff;
  box-shadow: 0 0 16px rgba(255, 42, 79, 0.45);
}

.ctrl-btn:disabled {
  opacity: 0.35;
}

/* ==================== 章节选页抽屉 ==================== */
.drawer-backdrop {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(5, 4, 8, 0.72);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: flex-end;
}

.drawer-sheet {
  width: 100%;
  max-height: 78%;
  background: #130e14;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 26px 26px 0 0;
  padding: 18px 16px calc(var(--safe-bottom) + 14px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title {
  font-size: 15px;
  font-weight: 700;
}

.drawer-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.page-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  overflow-y: auto;
  padding: 2px 0;
}

.page-tile {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  background: #1d151d;
  cursor: pointer;
  padding: 0;
}

.page-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-tile.locked img {
  filter: blur(6px) brightness(0.4);
}

.page-tile.current {
  border-color: var(--crimson);
  box-shadow: 0 0 12px var(--crimson-glow);
}

.page-tile .tile-num {
  position: absolute;
  bottom: 4px;
  right: 5px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.68);
  padding: 1px 5px;
  border-radius: 6px;
  color: #fff;
}

.drawer-footer {
  display: flex;
  gap: 10px;
}

.drawer-footer button {
  flex: 1;
}

/* ==================== 4. 终局裁决页 ==================== */
.verdict-screen {
  justify-content: flex-end;
  padding: calc(var(--safe-top) + 20px) 20px calc(var(--safe-bottom) + 20px);
}

.verdict-vignette {
  background: linear-gradient(180deg, rgba(8, 5, 10, 0.45) 0%, rgba(8, 5, 10, 0.92) 48%, rgba(6, 4, 8, 0.99) 100%);
}

.verdict-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.verdict-badge {
  font-size: 11px;
  letter-spacing: 0.24em;
  color: #ff9cb0;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 42, 79, 0.4);
  background: rgba(255, 42, 79, 0.14);
}

.verdict-title {
  margin: 0;
  font-size: 32px;
  font-weight: 800;
}

.verdict-quote {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(246, 241, 243, 0.85);
  max-width: 310px;
}

.verdict-countdown-box {
  width: 100%;
  padding: 16px;
  border-radius: 20px;
  background: rgba(22, 12, 18, 0.82);
  border: 1px solid rgba(255, 42, 79, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.verdict-timer {
  font-size: 52px;
  font-weight: 800;
  color: var(--crimson);
  text-shadow: 0 0 26px var(--crimson-glow);
  font-variant-numeric: tabular-nums;
}

.verdict-timer-label {
  font-size: 12px;
  color: var(--text-muted);
}

.stats-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 12px 8px;
}

.stat-val {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.stat-lbl {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-muted);
}

.verdict-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.verdict-sub-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@keyframes floatHeart {
  0% { transform: translateY(0) scale(0.7); opacity: 0; }
  20% { opacity: 0.92; }
  100% { transform: translateY(-220px) scale(1.25); opacity: 0; }
}

/* ==================== 设置项开关 ==================== */
.settings-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 18px 0 20px;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.setting-name {
  font-size: 13.5px;
  font-weight: 600;
}

.setting-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.pin-input {
  width: 72px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  text-align: center;
  font-size: 15px;
  letter-spacing: 0.2em;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  transition: 0.25s;
  cursor: pointer;
}

.slider:before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.25s;
}

.switch input:checked + .slider {
  background: var(--crimson);
}

.switch input:checked + .slider:before {
  transform: translateX(18px);
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
