:root {
  --ink: #13161c;
  --ink-soft: #252a34;
  --crayon: #2f5148;
  --charcoal: #181c23;
  --white: #fafbfc;
  --surface: rgba(250, 251, 252, 0.95);
  --surface-strong: rgba(250, 251, 252, 0.98);
  --silver-100: #eceff4;
  --silver-200: #d5dce6;
  --silver-300: #bcc5d3;
  --silver-400: #667082;
  --silver-600: #4a5363;
  --koi-red: #e0452c;
  --koi-red-hover: #c93922;
  --amber: #f28c28;
  --teal: #3fab84;
  --ok: #1b7f4b;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --shadow-panel: 0 18px 44px rgba(17, 20, 27, 0.18), 0 2px 8px rgba(17, 20, 27, 0.08);
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --font-num: "SF Pro Rounded", ui-rounded, "Hiragino Maru Gothic ProN", "Arial Rounded MT Bold", "PingFang SC", sans-serif;
}

/* 统一圆润粗体蜡笔风等宽数字（零外部字体文件） */
.num-game {
  font-family: var(--font-num);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: 0.02em;
  display: inline-block;
  paint-order: stroke fill;
  -webkit-text-stroke: 0.45px rgba(47, 81, 72, 0.34);
  text-shadow: 0 1.5px 0 rgba(47, 81, 72, 0.16);
}

.num-game-inline {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.num-hero-sm {
  -webkit-text-stroke: 0.9px rgba(47, 81, 72, 0.55);
  text-shadow: 0 2px 0 rgba(47, 81, 72, 0.22);
}

.num-hero-lg {
  -webkit-text-stroke: 1.5px var(--crayon);
  text-shadow: 0 3px 0 rgba(47, 81, 72, 0.24), 0 6px 14px rgba(19, 22, 28, 0.10);
}

@keyframes numPopA {
  0% { transform: scale(1); }
  40% { transform: scale(1.16); }
  100% { transform: scale(1); }
}

@keyframes numPopB {
  0% { transform: scale(1); }
  40% { transform: scale(1.16); }
  100% { transform: scale(1); }
}

@keyframes comboPopA {
  0% { box-shadow: 0 2px 8px rgba(19, 22, 28, 0.08); }
  42% { box-shadow: 0 0 0 2.5px rgba(242, 140, 40, 0.65), 0 4px 12px rgba(224, 69, 44, 0.28); }
  100% { box-shadow: 0 2px 8px rgba(19, 22, 28, 0.08); }
}

@keyframes comboPopB {
  0% { box-shadow: 0 2px 8px rgba(19, 22, 28, 0.08); }
  42% { box-shadow: 0 0 0 2.5px rgba(242, 140, 40, 0.65), 0 4px 12px rgba(224, 69, 44, 0.28); }
  100% { box-shadow: 0 2px 8px rgba(19, 22, 28, 0.08); }
}

@keyframes comboNumPopA {
  0% { transform: scale(1); }
  42% { transform: scale(1.16); }
  100% { transform: scale(1); }
}

@keyframes comboNumPopB {
  0% { transform: scale(1); }
  42% { transform: scale(1.16); }
  100% { transform: scale(1); }
}

@keyframes recordFlashA {
  0% { transform: scale(1); color: var(--ink); }
  35% { transform: scale(1.15); color: var(--koi-red); text-shadow: 0 0 10px rgba(242, 140, 40, 0.55); }
  70% { transform: scale(1.05); color: var(--amber); }
  100% { transform: scale(1); color: var(--ink); }
}

@keyframes recordFlashB {
  0% { transform: scale(1); color: var(--ink); }
  35% { transform: scale(1.15); color: var(--koi-red); text-shadow: 0 0 10px rgba(242, 140, 40, 0.55); }
  70% { transform: scale(1.05); color: var(--amber); }
  100% { transform: scale(1); color: var(--ink); }
}

.num-pop-a { animation: numPopA 0.20s cubic-bezier(0.22, 1, 0.36, 1); }
.num-pop-b { animation: numPopB 0.20s cubic-bezier(0.22, 1, 0.36, 1); }
.combo-pop-a { animation: comboPopA 0.24s cubic-bezier(0.22, 1, 0.36, 1); }
.combo-pop-b { animation: comboPopB 0.24s cubic-bezier(0.22, 1, 0.36, 1); }
.combo-pop-a .combo-num,
.combo-pop-a .rhythm-num { animation: comboNumPopA 0.24s cubic-bezier(0.22, 1, 0.36, 1); }
.combo-pop-b .combo-num,
.combo-pop-b .rhythm-num { animation: comboNumPopB 0.24s cubic-bezier(0.22, 1, 0.36, 1); }
.record-flash-a { animation: recordFlashA 0.62s ease-out; }
.record-flash-b { animation: recordFlashB 0.62s ease-out; }

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--charcoal);
  color: var(--ink);
  font-family: var(--font-sans);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}

.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #eff1f5;
  touch-action: none;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.hidden {
  display: none !important;
}

/* ==================== 顶部横屏三区 HUD（安全区适配） ==================== */
.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: max(10px, calc(var(--safe-t, env(safe-area-inset-top, 0px)) + 4px)) max(12px, calc(var(--safe-r, env(safe-area-inset-right, 0px)) + 8px)) 6px max(12px, calc(var(--safe-l, env(safe-area-inset-left, 0px)) + 8px));
  pointer-events: none;
}

.hud-left,
.hud-center,
.hud-right {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.hud-left {
  flex: 0 0 auto;
}

.hud-center {
  flex: 1 1 auto;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 8px;
  overflow: visible;
}

.hud-right {
  flex: 0 0 auto;
  justify-content: flex-end;
}

.score-group {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: rgba(250, 251, 252, 0.94);
  border: 1.5px solid rgba(47, 81, 72, 0.24);
  box-shadow: 0 2px 8px rgba(19, 22, 28, 0.08);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.score-group.is-fever {
  border-color: var(--amber);
  background: #fff9eb;
  box-shadow: 0 3px 12px rgba(242, 140, 40, 0.28);
}

.groove-track {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 2px;
  height: 3px;
  border-radius: 3px;
  background: rgba(19, 22, 28, 0.09);
  overflow: hidden;
  pointer-events: none;
}

.groove-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, #f28c28, #e0452c);
  transition: width 0.14s ease;
}

.fever-inline-tag {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 99px;
  background: var(--amber);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.25;
}

.score-group.record-glow {
  border-color: var(--koi-red);
  background: #fff7f2;
}

.score-now {
  font-size: 20px;
  min-width: 3.1ch;
  text-align: right;
  color: var(--ink);
  line-height: 1;
}

.score-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  border-left: 1px solid rgba(47, 81, 72, 0.18);
  padding-left: 8px;
}

.score-dist {
  font-size: 13px;
  color: var(--ink-soft);
  min-width: 3.4ch;
  -webkit-text-stroke: 0;
  text-shadow: none;
}

.score-hi {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-size: 12px;
  font-weight: 700;
  color: var(--silver-600);
}

.score-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--silver-600);
}

.score-best-num {
  font-size: 12.5px;
  color: var(--silver-600);
  -webkit-text-stroke: 0;
  text-shadow: none;
}

.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: rgba(250, 251, 252, 0.94);
  border: 1.5px solid rgba(47, 81, 72, 0.22);
  box-shadow: 0 2px 8px rgba(19, 22, 28, 0.08);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.icon-banana {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.hud-value {
  font-size: 15px;
  color: var(--ink);
  min-width: 1.6ch;
  text-align: right;
}

.hud-combo {
  background: #ffda8a;
  border-color: var(--crayon);
  color: var(--ink);
  overflow: hidden;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.hud-combo.combo-warm {
  background: #f28c28;
  color: #13161c;
}

.hud-combo.combo-hot {
  background: var(--koi-red);
  border-color: #ffffff;
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(224, 69, 44, 0.36);
}

.combo-text,
.rhythm-text,
.daily-text {
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.combo-num,
.rhythm-num {
  font-size: 15px;
  line-height: 1;
  min-width: 2.0ch;
  text-align: center;
}

.hud-combo.combo-hot .combo-num {
  color: #fff6d6;
  -webkit-text-stroke: 0.7px rgba(21, 24, 30, 0.45);
}

.hud-rhythm {
  background: #1b2029;
  border-color: var(--amber);
  color: #ffe2a8;
}

.hud-rhythm .rhythm-num {
  color: #ffb84d;
  -webkit-text-stroke: 0;
  text-shadow: none;
}

.hud-daily {
  background: var(--ink);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.18);
  padding: 0 9px;
}

.hud-koi {
  background: rgba(224, 69, 44, 0.96);
  border-color: rgba(19, 22, 28, 0.18);
  color: var(--white);
  gap: 5px;
  animation: koiPulse 1.1s ease-in-out infinite;
}

.koi-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffd399;
  flex-shrink: 0;
}

.koi-text,
.koi-sec {
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.hud-koi.warning {
  animation: koiWarnFlash 0.28s ease-in-out infinite alternate;
  border-color: #ffffff;
}

@keyframes koiWarnFlash {
  0% {
    background: rgba(224, 69, 44, 0.96);
    color: #ffffff;
    box-shadow: 0 0 0 2px rgba(224, 69, 44, 0.4);
  }
  100% {
    background: rgba(255, 245, 242, 0.98);
    color: #c22e18;
    box-shadow: 0 0 0 3px rgba(224, 69, 44, 0.72);
  }
}

.koi-bar-track {
  width: 36px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.3);
  overflow: hidden;
}

.koi-bar-fill {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-pill);
  background: #ffffff;
  transform-origin: left center;
}

@keyframes koiPulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(224, 69, 44, 0.34); }
  50% { box-shadow: 0 4px 20px rgba(242, 140, 40, 0.48); }
}

.hud-buff {
  background: #eaf8f2;
  border-color: var(--teal);
  color: #164e3b;
}

.hud-buff.buff-magnet {
  background: #fff6e5;
  border-color: var(--amber);
  color: #7c3f05;
}

.buff-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
}

.hud-buff.buff-magnet .buff-dot {
  background: var(--amber);
}

.buff-text {
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.audio-toggles {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-audio {
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(19, 22, 28, 0.16);
  background: rgba(250, 251, 252, 0.94);
  color: #363e4c;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.btn-audio.on {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

.btn-icon {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(19, 22, 28, 0.18);
  background: rgba(250, 251, 252, 0.95);
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
}

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

/* ==================== 轻量提示条与底部触控引导 ==================== */
.milestone-toast,
.ach-toast {
  position: absolute;
  left: 50%;
  z-index: 12;
  transform: translate(-50%, -10px);
  opacity: 0;
  pointer-events: none;
  padding: 6px 15px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.milestone-toast {
  top: max(56px, calc(var(--safe-t, env(safe-area-inset-top, 0px)) + 48px));
  background: rgba(19, 22, 28, 0.92);
  color: var(--white);
}

.ach-toast {
  top: max(90px, calc(var(--safe-t, env(safe-area-inset-top, 0px)) + 82px));
  background: rgba(224, 69, 44, 0.96);
  color: var(--white);
  box-shadow: 0 6px 18px rgba(224, 69, 44, 0.34);
}

.milestone-toast.show,
.ach-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.touch-guide {
  position: absolute;
  bottom: max(10px, var(--safe-b, env(safe-area-inset-bottom, 0px)));
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  background: rgba(15, 18, 23, 0.80);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e6ebf2;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.touch-guide.visible { opacity: 1; }
.touch-guide .sep { color: #f28c28; }

/* ==================== 竖屏转屏提示（vw < vh） ==================== */
.overlay-rotate {
  z-index: 40;
  background: #141820;
}

.rotate-card {
  width: min(336px, calc(100vw - 36px));
  padding: 26px 22px 24px;
  border-radius: 22px;
  background: #fafbfc;
  border: 2px solid var(--crayon);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.45);
  text-align: center;
}

#rotateCanvas {
  display: block;
  width: 220px;
  height: 156px;
  margin: 0 auto 10px;
}

.rotate-title {
  font-size: 22px;
  font-weight: 850;
  color: var(--ink);
  margin-bottom: 8px;
}

.rotate-desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.rotate-sub {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: #fff3ee;
  color: #b82c16;
  font-size: 12.5px;
  font-weight: 700;
}

/* ==================== 覆盖层与面板基础 ==================== */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: max(10px, var(--safe-t, env(safe-area-inset-top, 0px))) max(14px, var(--safe-r, env(safe-area-inset-right, 0px))) max(10px, var(--safe-b, env(safe-area-inset-bottom, 0px))) max(14px, var(--safe-l, env(safe-area-inset-left, 0px)));
  pointer-events: auto;
}

.overlay.overlay-rotate {
  z-index: 90;
  background: #141820;
}

.overlay-start {
  background: linear-gradient(180deg, rgba(242, 244, 248, 0.24) 0%, rgba(19, 22, 28, 0.08) 100%);
}

@media (min-height: 580px) {
  .overlay-start {
    padding-bottom: 92px;
  }
}

.overlay-pause,
.overlay-gameover {
  background: rgba(19, 22, 28, 0.52);
}

.overlay-modal {
  z-index: 30;
  background: rgba(19, 22, 28, 0.52);
}

.panel {
  max-width: 100%;
  max-height: 100%;
  overflow-y: auto;
  padding: 18px 20px 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #ffffff 0%, #fbfaf7 100%);
  border: 1.5px solid rgba(47, 81, 72, 0.22);
  box-shadow: 0 20px 48px rgba(16, 20, 30, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  text-align: left;
}

/* ==================== 横屏主页双栏 ==================== */
.panel-start {
  width: min(740px, 100%);
}

.start-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 18px;
  align-items: center;
}

.badge-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.tag-brand,
.tag-version {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
}

.tag-brand {
  background: var(--ink);
  color: var(--white);
}

.tag-version {
  background: var(--silver-100);
  color: var(--silver-600);
  border: 1px solid var(--silver-200);
}

.game-title {
  font-size: clamp(24px, 3.2vw, 32px);
  font-weight: 850;
  letter-spacing: 0.04em;
  color: var(--ink);
  line-height: 1.12;
  margin-bottom: 6px;
}

.game-subtitle {
  font-size: 13px;
  line-height: 1.48;
  color: var(--silver-600);
  margin-bottom: 10px;
}

.snake-prompt-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: #f2f8f1;
  border: 1.5px solid rgba(47, 81, 72, 0.24);
  margin-bottom: 8px;
}

.snake-mini-canvas {
  width: 58px;
  height: 48px;
  flex-shrink: 0;
  display: block;
}

.snake-prompt-body {
  min-width: 0;
}

.snake-prompt-tag {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--crayon);
  margin-bottom: 2px;
}

.snake-prompt-text {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink-soft);
}

.start-col-right {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.start-actions {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 8px;
}

.btn-primary,
.btn-secondary,
.btn-daily {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  border: none;
  transition: transform 0.12s ease, background-color 0.15s ease;
}

.btn-primary {
  background: var(--ink);
  color: var(--white);
  box-shadow: 0 8px 20px rgba(19, 22, 28, 0.22);
}

.btn-primary:active,
.btn-daily:active,
.btn-secondary:active,
.btn-wardrobe:active,
.btn-chip:active {
  transform: scale(0.98);
}

.btn-daily {
  flex-direction: column;
  gap: 1px;
  background: #fff4ef;
  color: #b82c16;
  border: 1.5px solid rgba(224, 69, 44, 0.45);
}

.btn-daily small {
  font-size: 12px;
  font-weight: 600;
  color: #6f352a;
}

.btn-restart {
  background: var(--koi-red);
  box-shadow: 0 8px 18px rgba(224, 69, 44, 0.3);
}

.btn-secondary {
  background: var(--silver-100);
  color: var(--ink);
  border: 1px solid var(--silver-200);
}

.start-wardrobe-row {
  display: grid;
  grid-template-columns: 1fr 1.12fr;
  gap: 8px;
}

.btn-wardrobe {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  border: 1.5px solid rgba(19, 22, 28, 0.18);
  background: var(--white);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-wardrobe-shop {
  border-color: rgba(224, 69, 44, 0.48);
  background: #fff6f1;
  color: #962814;
}

.wallet-chip {
  font-style: normal;
  font-size: 12px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: #ffe0a8;
  color: #6b3805;
  -webkit-text-stroke: 0;
  text-shadow: none;
}

.start-util-row,
.pause-audio-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.btn-chip {
  flex: 1;
  min-height: 44px;
  padding: 0 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--silver-200);
  background: var(--silver-100);
  color: #2f3745;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.btn-chip.on {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

.btn-ach-entry {
  border-color: rgba(242, 140, 40, 0.48);
  background: #fff7ec;
  color: #7c4308;
}

.hint-line {
  font-size: 12px;
  color: var(--silver-600);
}

/* ==================== 模态框（造型衣橱 / 茶壶咕咕商店 / 成就） ==================== */
.panel-modal {
  width: min(860px, 100%);
  text-align: left;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.modal-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--silver-600);
  margin-bottom: 2px;
}

.panel-title {
  font-size: 19px;
  font-weight: 850;
  color: var(--ink);
}

.wallet-pill {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: #fff4df;
  border: 1.5px solid rgba(242, 140, 40, 0.55);
  color: #7c4308;
  font-size: 13px;
  font-weight: 800;
}

.btn-chip-inline {
  min-height: 44px;
  padding: 0 13px;
  border-radius: var(--radius-pill);
  border: 1.5px solid rgba(224, 69, 44, 0.45);
  background: #fff4ef;
  color: #b82c16;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.btn-close {
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 44px;
  min-width: 68px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--silver-200);
  background: var(--silver-100);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.modal-note {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--silver-600);
  margin-bottom: 10px;
}

/* 9 套造型工整 3×3 网格（1280×800 一屏完整呈现，严控 minmax(0,1fr) 防横向撑破） */
.skin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.skin-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #f8f9fb 0%, #f1f3f8 100%);
  border: 1.5px solid #d9dfe9;
  box-shadow: 0 2px 6px rgba(19, 24, 36, 0.04);
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.skin-card.unlocked {
  cursor: pointer;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfe 100%);
}

.skin-card.active {
  background: linear-gradient(180deg, #fffaf7 0%, #fff2ec 100%);
  border-color: var(--koi-red);
  box-shadow: 0 4px 12px rgba(224, 69, 44, 0.14);
}

.preview-stage {
  width: 100%;
  height: 58px;
  border-radius: 9px;
  background:
    radial-gradient(ellipse at 50% 24%, rgba(255, 250, 238, 0.85) 0%, rgba(255, 250, 238, 0) 64%),
    linear-gradient(180deg, #f7f4ee 0%, #e8eef5 82%, #d5dde8 82%, #d5dde8 85%, #232a38 85%, #171c26 100%);
  border: 1px solid rgba(47, 81, 72, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.preview-canvas {
  display: block;
  width: 82px;
  height: 58px;
}

.skin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  margin-bottom: 3px;
}

.skin-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

.status-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-active {
  background: var(--koi-red);
  color: var(--white);
}

.status-unlocked {
  background: #e5f5ec;
  color: var(--ok);
}

.status-locked {
  background: #e1e5ed;
  color: var(--silver-600);
}

.skin-highlight {
  font-size: 11px;
  line-height: 1.32;
  color: var(--ink-soft);
  margin-bottom: 4px;
  white-space: normal;
  overflow: visible;
}

.skin-cond {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--silver-600);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-bottom: 3px;
  min-width: 0;
}

.skin-cond span {
  white-space: normal;
  overflow: visible;
  min-width: 0;
}

.skin-cond span:last-child {
  flex-shrink: 0;
}

.skin-bar {
  width: 100%;
  height: 4px;
  border-radius: var(--radius-pill);
  background: #dce1ea;
  overflow: hidden;
  margin-bottom: 5px;
}

.skin-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--amber);
}

.skin-card.unlocked .skin-bar-fill { background: var(--ok); }
.skin-card.active .skin-bar-fill { background: var(--koi-red); }

.skin-btn,
.shop-buy-btn {
  width: 100%;
  min-height: 44px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid var(--silver-200);
  background: var(--silver-100);
  color: var(--silver-600);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: default;
}

.skin-card.unlocked .skin-btn,
.shop-buy-btn.can-equip {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
  cursor: pointer;
}

.skin-card.active .skin-btn,
.shop-buy-btn.is-active {
  background: var(--koi-red);
  color: var(--white);
  border-color: var(--koi-red);
  cursor: pointer;
}

.shop-buy-btn.can-buy {
  background: var(--amber);
  color: var(--ink);
  border-color: #d97706;
  cursor: pointer;
}

/* ==================== 茶壶咕咕商店 ==================== */
.shop-layout {
  display: grid;
  grid-template-columns: 205px 1fr;
  gap: 14px;
  align-items: stretch;
}

.shop-keeper-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 12px 10px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fff9f2 0%, #fff2e8 100%);
  border: 1.5px solid rgba(224, 69, 44, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  text-align: center;
}

.gugu-canvas {
  display: block;
  width: 168px;
  height: 136px;
}

.gugu-bubble {
  width: 100%;
  padding: 8px 9px;
  border-radius: 10px;
  background: #ffffff;
  border: 1.5px solid rgba(47, 81, 72, 0.24);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink);
  font-weight: 700;
  margin: 6px 0;
}

.gugu-policy {
  font-size: 12px;
  color: var(--silver-600);
}

.shop-items-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.shop-card {
  display: flex;
  flex-direction: column;
  padding: 8px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1.5px solid var(--silver-200);
}

.shop-card.active {
  border-color: var(--koi-red);
  background: #fff8f5;
}

.shop-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #8c4a08;
}

.shop-alt-hint {
  font-size: 12px;
  color: var(--silver-600);
  margin-bottom: 7px;
  line-height: 1.35;
}

/* ==================== 成就列表（3 列横屏） ==================== */
.ach-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.ach-card {
  padding: 9px 10px;
  border-radius: var(--radius-md);
  background: var(--silver-100);
  border: 1px solid var(--silver-200);
}

.ach-card.unlocked {
  background: #fff7f4;
  border-color: rgba(224, 69, 44, 0.36);
}

.ach-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
}

.ach-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.ach-state {
  font-size: 12px;
  font-weight: 700;
  color: var(--silver-600);
}

.ach-card.unlocked .ach-state {
  color: var(--koi-red);
}

.ach-desc {
  font-size: 12px;
  color: var(--silver-600);
  line-height: 1.38;
}

/* ==================== 横屏暂停覆盖层 ==================== */
.panel-pause {
  width: min(580px, calc(100vw - 28px));
}

.pause-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 16px;
  align-items: center;
}

.pause-col-right {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.btn-pause-shop {
  width: 100%;
}

.btn-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ==================== 每局小目标卡片 ==================== */
.mission-box {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--silver-100);
  border: 1px solid rgba(19, 22, 28, 0.08);
  text-align: left;
}

.mission-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 4px;
}

.mission-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #353d4b;
  padding: 2px 0;
}

.mission-item.done {
  color: var(--ok);
  font-weight: 700;
}

/* ==================== 横屏双栏结算卡片 ==================== */
.panel-result {
  width: min(760px, calc(100vw - 28px));
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 16px;
  align-items: center;
}

.result-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.result-mode,
.result-reason {
  display: inline-block;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--silver-100);
  border: 1px solid var(--silver-200);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.new-record {
  display: inline-block;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--koi-red);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.new-record.record-flash-a,
.new-record.record-flash-b {
  animation: numPopA 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  color: #ffffff;
}

.result-score-wrap {
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: 14px;
  background: #f6f7fa;
  border: 1.5px solid rgba(47, 81, 72, 0.16);
  text-align: center;
}

.result-score-wrap.is-record {
  background: #fff7f3;
  border-color: rgba(224, 69, 44, 0.46);
}

.result-score-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--silver-600);
}

.result-score {
  display: block;
  font-size: 40px;
  line-height: 1.06;
  color: var(--ink);
}

.result-score-wrap.is-record .result-score {
  color: var(--koi-red);
}

.result-compare {
  font-size: 12px;
  font-weight: 700;
  color: var(--koi-red);
  margin-top: 2px;
}

.stat-tier-primary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.stat-primary {
  padding: 7px 10px;
  border-radius: var(--radius-md);
  border: 1.5px solid rgba(47, 81, 72, 0.22);
  background: #ffffff;
  text-align: center;
}

.stat-primary-dist { background: #f4f7fb; }
.stat-primary-banana {
  background: #fff8ee;
  border-color: rgba(242, 140, 40, 0.42);
}

.stat-val-lg {
  font-size: 20px;
  line-height: 1.2;
  color: var(--ink);
}

.stat-primary-banana .stat-val-lg {
  color: #b45309;
}

.stat-tier-secondary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  margin-bottom: 8px;
}

.stat-box {
  padding: 7px 8px;
  border-radius: var(--radius-md);
  background: var(--silver-100);
  border: 1px solid rgba(19, 22, 28, 0.08);
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 12px;
  color: var(--silver-600);
}

.stat-val {
  display: block;
  font-size: 15px;
  color: var(--ink);
}

.stat-val-sm {
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.25;
  margin-top: 2px;
}

.result-quip {
  font-size: 12px;
  line-height: 1.42;
  color: #2f3745;
  background: #fff7f4;
  border: 1px solid rgba(224, 69, 44, 0.22);
  border-radius: 10px;
  padding: 6px 10px;
}

.result-actions {
  display: grid;
  grid-template-columns: 1.55fr 0.85fr;
  gap: 8px;
  margin-top: 9px;
}

.result-col-right .hint-line {
  margin-top: 6px;
  text-align: center;
}

/* ==================== 窄横屏响应式（844×390 / 932×430） ==================== */
.tag-rank {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 99px;
  background: #fff6e6;
  border: 1px solid rgba(242, 140, 40, 0.42);
  color: #8b4604;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.result-highlights {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  background: #e9f7f1;
  border: 1px solid rgba(63, 171, 132, 0.42);
  color: #165942;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.result-grade {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  background: #f2f4f8;
  border: 1px solid rgba(47, 81, 72, 0.25);
  color: #394457;
}
.result-grade.tier-silver { background: #eef3fa; border-color: rgba(74, 108, 158, 0.42); color: #274878; }
.result-grade.tier-gold   { background: #fff6e3; border-color: rgba(242, 140, 40, 0.50); color: #8c4804; }
.result-grade.tier-legend { background: #fff0ec; border-color: rgba(224, 69, 44, 0.56); color: #b82914; }

.btn-guide-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  margin-top: 7px;
  padding: 6px 12px;
  border-radius: 12px;
  border: 1.5px solid rgba(47, 81, 72, 0.24);
  background: #f8fafc;
  color: #24303e;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.btn-guide-strip:hover {
  background: #eef6f3;
  border-color: rgba(63, 171, 132, 0.52);
}
.guide-pill-good,
.guide-pill-bad {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.guide-pill-good { color: #165e44; }
.guide-pill-bad  { color: #a82414; }
.gdot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.gdot-good { background: #2e9e75; }
.gdot-bad  { background: #e0452c; }
.guide-cta {
  color: #16202a;
  font-weight: 800;
  white-space: nowrap;
}

.guide-sections {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 10px;
  margin-top: 8px;
}
.guide-col {
  border-radius: 14px;
  padding: 9px 10px;
  border: 1.5px solid rgba(47, 81, 72, 0.16);
}
.guide-col-good {
  background: #f2fbf7;
  border-color: rgba(63, 171, 132, 0.36);
}
.guide-col-bad {
  background: #fff6f4;
  border-color: rgba(224, 69, 44, 0.34);
}
.guide-col-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 7px;
}
.guide-title-good { color: #135a41; }
.guide-title-bad  { color: #a62212; }
.guide-card-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.guide-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(19, 22, 28, 0.08);
}
.guide-thumb {
  width: 46px;
  height: 44px;
  flex: 0 0 46px;
  border-radius: 8px;
  background: #f5f7fa;
}
.guide-item-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.guide-item-head {
  display: flex;
  align-items: center;
  gap: 5px;
}
.guide-item-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
}
.guide-item-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 99px;
}
.guide-item-tag.is-good { background: #e5f8f0; color: #146346; }
.guide-item-tag.is-bad  { background: #fdebe8; color: #b22414; }
.guide-item-desc {
  font-size: 11px;
  line-height: 1.32;
  color: #465063;
}

.start-secondary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.btn-sec-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 54px;
  padding: 7px 6px;
  border-radius: 13px;
  border: 1.5px solid rgba(47, 81, 72, 0.22);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.14s ease, background 0.14s ease;
}
.btn-sec-card:hover {
  transform: translateY(-1px);
  border-color: rgba(47, 81, 72, 0.45);
  background: #f8fafc;
}
.btn-sec-shop {
  background: #fff9f5;
  border-color: rgba(224, 69, 44, 0.34);
}
.btn-sec-guide {
  background: #f4fbf7;
  border-color: rgba(63, 171, 132, 0.38);
}
.btn-sec-more {
  background: #f5f7fb;
  border-color: rgba(74, 108, 158, 0.28);
}
.sec-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}
.sec-sub,
.sec-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  color: #546072;
  white-space: nowrap;
}

.panel-more {
  max-width: 640px;
}
.more-entry-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin: 10px 0 12px;
}
.btn-more-tile {
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid rgba(47, 81, 72, 0.22);
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 2px 5px rgba(19, 24, 36, 0.04);
}
.btn-more-tile:hover {
  background: #f4f7fb;
  border-color: rgba(47, 81, 72, 0.44);
}
.btn-more-postcard { background: #fff9ee; border-color: rgba(242, 140, 40, 0.42); color: #8c4804; }
.btn-more-ach { background: #f3f6fc; border-color: rgba(74, 108, 158, 0.36); color: #274878; }
.btn-more-guide { background: #f2fbf7; border-color: rgba(63, 171, 132, 0.42); color: #145a41; }

.more-toggle-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

/* v1.5 三档独立音量调节（总音量 / 音乐音量 / 音效音量）+ 五区段配乐试听条 */
.more-volume-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.vol-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 11px;
  background: #f6f8fb;
  border: 1.5px solid #dde3ee;
  cursor: pointer;
}

.vol-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
}

.vol-head strong {
  color: #b8321b;
  font-size: 12px;
}

.vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-height: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  cursor: pointer;
  margin: 0;
}

.vol-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 99px;
  background: #cfd7e6;
}

.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--koi-red);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 5px rgba(19, 22, 28, 0.28);
}

.vol-slider::-moz-range-track {
  height: 6px;
  border-radius: 99px;
  background: #cfd7e6;
}

.vol-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--koi-red);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 5px rgba(19, 22, 28, 0.28);
}

.more-audition-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding: 7px 10px;
  border-radius: 12px;
  background: #fbf8f3;
  border: 1.5px solid rgba(242, 140, 40, 0.30);
}

.audition-label {
  font-size: 12px;
  font-weight: 800;
  color: #6b4318;
  white-space: nowrap;
}

.audition-pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  flex: 1;
  justify-content: flex-end;
}

.btn-audition {
  flex: 1;
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  border-radius: 99px;
  border: 1.5px solid #d5dce8;
  background: #ffffff;
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.btn-audition:hover {
  border-color: var(--amber);
  background: #fff8ed;
}

.btn-audition.playing {
  background: var(--koi-red);
  border-color: var(--koi-red);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(224, 69, 44, 0.30);
}

.about-version-line {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--silver-600);
  text-align: right;
  letter-spacing: 0.02em;
}

.sw-update-banner {
  position: absolute;
  left: 50%;
  top: max(4px, calc(var(--safe-t, env(safe-area-inset-top, 0px)) + 4px));
  bottom: auto;
  transform: translateX(-50%);
  z-index: 42;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  border: 1.5px solid #ffd54f;
  background: #13161c;
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 22px rgba(17, 20, 27, 0.34);
  cursor: pointer;
  white-space: nowrap;
}

.sw-update-banner:active {
  transform: translateX(-50%) scale(0.98);
}

/* v1.7 更新提示条展示时，为结算/暂停/首页覆盖层预留顶部安全距离，彻底杜绝压卡片或遮挡按钮 */
body.has-sw-update .overlay-gameover,
body.has-sw-update .overlay-pause,
body.has-sw-update .overlay-start {
  padding-top: max(54px, calc(var(--safe-t, env(safe-area-inset-top, 0px)) + 52px));
}

@media (max-width: 960px) {
  .btn-guide-strip {
    min-height: 32px;
    padding: 4px 10px;
    font-size: 11px;
  }
  .start-secondary-row {
    gap: 6px;
    margin-top: 8px;
  }
  .btn-sec-card {
    min-height: 46px;
    padding: 5px 4px;
  }
  .sec-title {
    font-size: 11.5px;
  }
  .sec-sub,
  .sec-dots {
    font-size: 10px;
  }
}

@media (max-width: 960px) {
  .audio-toggles {
    display: none;
  }

  .hud {
    gap: 5px;
    padding: max(8px, calc(var(--safe-t, env(safe-area-inset-top, 0px)) + 3px)) max(10px, calc(var(--safe-r, env(safe-area-inset-right, 0px)) + 6px)) 4px max(10px, calc(var(--safe-l, env(safe-area-inset-left, 0px)) + 6px));
  }

  .score-group {
    height: 36px;
    padding: 0 9px;
    gap: 6px;
  }

  .score-now {
    font-size: 17px;
    min-width: 2.8ch;
  }

  .score-meta {
    padding-left: 6px;
    gap: 5px;
  }

  .hud-pill {
    height: 32px;
    padding: 0 8px;
    gap: 4px;
  }

  .koi-bar-track {
    width: 26px;
  }

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

@media (max-height: 450px) {
  .overlay {
    padding: max(6px, var(--safe-t, env(safe-area-inset-top, 0px))) max(10px, var(--safe-r, env(safe-area-inset-right, 0px))) max(6px, var(--safe-b, env(safe-area-inset-bottom, 0px))) max(10px, var(--safe-l, env(safe-area-inset-left, 0px)));
  }

  .panel {
    padding: 10px 12px 9px;
  }

  .panel-modal {
    padding: 8px 10px 8px;
  }

  .modal-head {
    margin-bottom: 5px;
    gap: 6px;
  }

  .panel-modal .eyebrow {
    display: none;
  }

  .panel-title {
    font-size: 15px;
  }

  #skinOverlay .modal-note {
    display: none;
  }

  .wallet-pill {
    height: 30px;
    padding: 0 9px;
    font-size: 11.5px;
  }

  .start-grid {
    gap: 12px;
  }

  .game-title {
    font-size: 23px;
    margin-bottom: 4px;
  }

  .game-subtitle {
    font-size: 12px;
    margin-bottom: 7px;
  }

  .snake-prompt-card {
    padding: 6px 8px;
    margin-bottom: 6px;
  }

  .snake-mini-canvas {
    width: 48px;
    height: 40px;
  }

  .btn-primary,
  .btn-secondary,
  .btn-daily {
    min-height: 44px;
    font-size: 14px;
    padding: 6px 10px;
  }

  .result-score {
    font-size: 32px;
  }

  .result-score-wrap {
    padding: 6px 10px;
    margin-bottom: 6px;
  }

  .stat-primary {
    padding: 5px 8px;
  }

  .stat-val-lg {
    font-size: 18px;
  }

  .stat-tier-secondary {
    gap: 5px;
    margin-bottom: 6px;
  }

  .stat-box {
    padding: 5px 6px;
  }

  .mission-box {
    margin-top: 5px;
    padding: 6px 8px;
  }

  /* v1.4 844×390 / 932×430 手机横屏衣橱：5列×2行一屏看全全部 9 套造型（含墨韵书生），零滚动且按钮>=44px */
  .skin-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
  }

  .skin-card {
    padding: 4px 5px;
    border-radius: 10px;
  }

  #skinOverlay .preview-stage {
    height: 44px;
    margin-bottom: 3px;
  }

  #skinOverlay .preview-canvas {
    width: 60px;
    height: 44px;
  }

  #skinOverlay .skin-top {
    margin-bottom: 2px;
    gap: 3px;
  }

  #skinOverlay .skin-name {
    font-size: 11.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #skinOverlay .status-pill {
    padding: 1px 5px;
    font-size: 10px;
  }

  #skinOverlay .skin-highlight {
    display: none;
  }

  #skinOverlay .skin-cond {
    font-size: 10px;
    margin-bottom: 2px;
  }

  #skinOverlay .skin-cond span:first-child {
    display: none;
  }

  #skinOverlay .skin-cond span:last-child {
    flex-shrink: 1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #skinOverlay .skin-bar {
    height: 3px;
    margin-bottom: 4px;
  }

  #skinOverlay .skin-btn {
    min-height: 44px;
    font-size: 11.5px;
    padding: 0 4px;
    border-radius: 8px;
  }

  /* v1.4 844×390 / 932×430 手机横屏茶壶咕咕商店：左店长+右3列×2行一屏看全 5 套造型，零滚动且按钮>=44px */
  .shop-layout {
    grid-template-columns: 126px 1fr;
    gap: 8px;
  }

  .shop-keeper-col {
    padding: 6px 6px;
  }

  .gugu-canvas {
    width: 96px;
    height: 76px;
  }

  .gugu-bubble {
    padding: 5px 6px;
    font-size: 10.5px;
    line-height: 1.32;
    margin: 4px 0;
  }

  .gugu-policy {
    font-size: 10px;
    line-height: 1.28;
  }

  .shop-items-col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .shop-card {
    padding: 5px 6px;
    border-radius: 10px;
  }

  #shopOverlay .preview-stage {
    height: 44px;
    margin-bottom: 3px;
  }

  #shopOverlay .preview-canvas {
    width: 60px;
    height: 44px;
  }

  #shopOverlay .skin-top {
    margin-bottom: 2px;
  }

  #shopOverlay .skin-name {
    font-size: 12px;
  }

  #shopOverlay .status-pill {
    padding: 1px 5px;
    font-size: 10px;
  }

  #shopOverlay .skin-highlight,
  #shopOverlay .shop-alt-hint {
    display: none;
  }

  #shopOverlay .shop-price-row {
    font-size: 10.5px;
    margin-bottom: 4px;
  }

  #shopOverlay .shop-buy-btn {
    min-height: 44px;
    font-size: 11.5px;
    padding: 0 5px;
    border-radius: 8px;
  }

  .result-journey {
    margin: 4px 0 5px;
    padding: 3px 6px;
  }

  .rj-step {
    font-size: 10px;
    padding: 1px 5px;
  }

  /* v1.5 844×390 / 932×430 手机横屏「收集·声音」弹层：一屏完整装下四入口+三开关+三档音量+五区段试听，零滚动！ */
  .panel-more {
    max-width: min(760px, 100%);
  }

  .more-entry-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin: 4px 0 6px;
  }

  .btn-more-tile {
    min-height: 44px;
    padding: 4px 6px;
    font-size: 11.5px;
    line-height: 1.25;
  }

  .more-toggle-row {
    gap: 6px;
  }

  .more-toggle-row .btn-chip {
    min-height: 44px;
    font-size: 12px;
  }

  .more-volume-grid {
    gap: 6px;
    margin-top: 6px;
  }

  .vol-item {
    padding: 5px 8px;
    gap: 3px;
  }

  .vol-head,
  .vol-head strong {
    font-size: 11px;
  }

  .more-audition-row {
    margin-top: 6px;
    padding: 5px 8px;
    gap: 6px;
  }

  .audition-label {
    font-size: 11px;
  }

  .btn-audition {
    min-height: 44px;
    font-size: 11.5px;
    padding: 0 6px;
  }

  .about-version-line {
    margin-top: 4px;
    font-size: 10.5px;
    line-height: 1.2;
  }
}

/* v0.8 蛇之赌约开关、旅拍明信片图鉴与结算差一点钩子 */
.snake-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.btn-wager-pill {
  padding: 0 10px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 99px;
  border: 1px solid rgba(47, 81, 72, 0.28);
  background: #ffffff;
  color: #2f5148;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.btn-wager-pill.active {
  background: var(--koi-red);
  border-color: var(--koi-red);
  color: #ffffff;
}

.btn-postcard-entry {
  border-color: rgba(242, 140, 40, 0.42);
  background: #fff9ef;
  color: #8a4606;
}

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

.postcard-card {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 1.5px solid #dce1ea;
  background: linear-gradient(180deg, #ffffff 0%, #fcfbf8 100%);
  box-shadow: 0 3px 10px rgba(19, 24, 36, 0.05);
  overflow: hidden;
}

.postcard-card.unlocked {
  border-color: rgba(224, 69, 44, 0.45);
  box-shadow: 0 4px 12px rgba(224, 69, 44, 0.10);
}

.postcard-thumb {
  width: 100%;
  height: 92px;
  display: block;
  background: #eef1f6;
}

.postcard-body {
  padding: 8px 10px 9px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.postcard-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.postcard-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.postcard-status {
  font-size: 10.5px;
  font-weight: 700;
  color: #687387;
  white-space: nowrap;
}

.postcard-card.unlocked .postcard-status {
  color: var(--koi-red);
}

.postcard-meta {
  font-size: 11px;
  font-weight: 600;
  color: #5b6577;
}

.postcard-fact {
  font-size: 11px;
  line-height: 1.42;
  color: #363e4c;
}

.result-quip.is-nearmiss {
  background: #fff7eb;
  border: 1px solid rgba(242, 140, 40, 0.36);
  color: #7c3b04;
  padding: 5px 9px;
  border-radius: 10px;
  font-weight: 700;
}

/* v1.3 结算页五区段旅程进度条 */
.result-journey {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin: 5px 0 6px;
  padding: 4px 8px;
  border-radius: 10px;
  background: var(--silver-100);
  border: 1px solid var(--silver-200);
}

.rj-step {
  font-size: 11px;
  font-weight: 800;
  color: var(--silver-500);
  padding: 2px 6px;
  border-radius: 99px;
  white-space: nowrap;
}

.rj-step.reached {
  color: #2f5148;
  background: rgba(63, 171, 132, 0.14);
}

.rj-step.current {
  color: #ffffff;
  background: var(--koi-red);
}

.rj-line {
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: var(--silver-200);
}

.rj-line.reached {
  background: #3fab84;
}

@media (max-width: 960px) {
  .postcard-grid:not(.is-spread) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ==================== v1.7 分页底栏、内屏对开手账、实验双段布局与 594×368 极限紧凑适配 ==================== */
.modal-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

.btn-pager {
  min-height: 44px;
  min-width: 92px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid rgba(47, 81, 72, 0.24);
  background: #ffffff;
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.btn-pager:disabled {
  opacity: 0.42;
  cursor: default;
}

.pager-info {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--silver-600);
  min-width: 88px;
  text-align: center;
}

.guide-tab-row {
  display: none;
  gap: 8px;
  margin-bottom: 6px;
}

.btn-guide-tab {
  flex: 1;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1.5px solid var(--silver-200);
  background: var(--silver-100);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.btn-guide-tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}

/* 内屏「左右对开两页」手账容器（用于明信片图鉴与衣橱；API 可用时自动对齐物理折痕） */
.postcard-grid.is-spread,
.skin-grid.is-spread {
  display: grid;
  grid-template-columns: var(--spread-left-w, minmax(0, 1fr)) var(--spread-seam-w, 16px) var(--spread-right-w, minmax(0, 1fr));
  gap: 0;
  align-items: stretch;
}

.book-page {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffdf8 0%, #f9f6ee 100%);
  border: 1.5px solid rgba(47, 81, 72, 0.20);
}

.book-page-left {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
  box-shadow: inset -8px 0 14px rgba(24, 30, 42, 0.06);
}

.book-page-right {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
  box-shadow: inset 8px 0 14px rgba(24, 30, 42, 0.06);
}

.book-spine {
  position: relative;
  min-width: 10px;
  background: linear-gradient(90deg, rgba(47, 81, 72, 0.14) 0%, rgba(250, 248, 242, 0.9) 50%, rgba(47, 81, 72, 0.14) 100%);
  border-radius: 4px;
}

.book-spine::after {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: repeating-linear-gradient(180deg, rgba(47, 81, 72, 0.28) 0 6px, transparent 6px 12px);
}

.book-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px dashed rgba(47, 81, 72, 0.18);
  font-size: 11.5px;
  font-weight: 800;
  color: var(--crayon);
}

.book-pc-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.postcard-grid.is-spread .postcard-card {
  flex-direction: row;
  align-items: stretch;
  border-radius: 11px;
  min-height: 92px;
}

.postcard-grid.is-spread .postcard-thumb {
  width: 132px;
  height: 68px;
  min-height: 0;
  align-self: center;
  margin-left: 6px;
  border-radius: 8px;
  flex-shrink: 0;
  object-fit: fill;
}

.postcard-grid.is-spread .postcard-body {
  padding: 6px 8px;
  flex: 1;
  min-width: 0;
  justify-content: center;
}

.postcard-grid.is-spread .postcard-name {
  font-size: 12.5px;
}

.postcard-grid.is-spread .postcard-fact {
  font-size: 10.5px;
  line-height: 1.34;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.postcard-stamp-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 92px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1.5px dashed rgba(224, 69, 44, 0.36);
  background: #fff9f2;
  text-align: center;
}

.postcard-stamp-title {
  font-size: 13px;
  font-weight: 850;
  color: #b82c16;
}

.postcard-stamp-sub {
  font-size: 11px;
  font-weight: 700;
  color: var(--silver-600);
}

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

.book-skin-grid-right {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.skin-grid.is-spread .skin-card {
  padding: 5px 6px;
  border-radius: 10px;
}

.skin-grid.is-spread .preview-stage {
  height: 46px;
  margin-bottom: 3px;
}

.skin-grid.is-spread .preview-canvas {
  width: 64px;
  height: 46px;
}

.skin-grid.is-spread .skin-highlight {
  display: none;
}

.skin-grid.is-spread .skin-name {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skin-grid.is-spread .status-pill {
  padding: 1px 5px;
  font-size: 10px;
}

.skin-grid.is-spread .skin-cond {
  font-size: 10px;
  margin-bottom: 3px;
}

.skin-grid.is-spread .skin-cond span:first-child {
  display: none;
}

.skin-grid.is-spread .skin-cond span:last-child {
  flex-shrink: 1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skin-grid.is-spread .skin-btn {
  min-height: 44px;
  font-size: 11.5px;
  padding: 0 4px;
}

/* 宽屏展开（951×585 / 951×620 / 1280×800）面板宽度 */
.panel-modal.is-spread-panel {
  width: min(920px, 100%);
}

/* ==================== v1.7 展开 / 合上 0.8s 旅行手账过场彩蛋 ==================== */
.overlay-fold-transition {
  z-index: 88;
  background: rgba(18, 22, 30, 0.72);
  cursor: pointer;
}

.fold-transition-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: min(560px, calc(100vw - 28px));
}

#foldTransitionCanvas {
  display: block;
  width: min(520px, calc(100vw - 32px));
  height: auto;
  max-height: calc(100vh - 70px);
  border-radius: 18px;
  border: 2px solid rgba(255, 245, 224, 0.55);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
  background: #f8f2e4;
}

.fold-skip-hint {
  font-size: 12px;
  font-weight: 700;
  color: rgba(250, 251, 252, 0.88);
  letter-spacing: 0.03em;
}

/* ==================== v1.7 实验双段布局（仅当折叠分段 API 可用时生效） ==================== */
.stage.duo-seg-vertical #gameCanvas,
.stage.duo-seg-horizontal #gameCanvas {
  position: absolute;
  top: var(--seg-stage-top, 0px);
  left: var(--seg-stage-left, 0px);
  width: var(--seg-stage-w, 100%);
  height: var(--seg-stage-h, 100%);
}

.stage.duo-seg-vertical .hud,
.stage.duo-seg-horizontal .hud {
  top: var(--seg-stage-top, 0px);
  left: var(--seg-stage-left, 0px);
  right: auto;
  width: var(--seg-stage-w, 100%);
}

.stage.duo-seg-vertical .touch-guide {
  display: none;
}

.stage.duo-seg-horizontal .touch-guide {
  left: calc(var(--seg-stage-left, 0px) + var(--seg-stage-w, 100%) * 0.5);
}

.stage.duo-seg-horizontal .milestone-toast,
.stage.duo-seg-horizontal .ach-toast {
  left: calc(var(--seg-stage-left, 0px) + var(--seg-stage-w, 100%) * 0.5);
  max-width: calc(var(--seg-stage-w, 100%) - 24px);
}

.stage.duo-seg-horizontal .milestone-toast {
  top: max(88px, calc(var(--safe-t, env(safe-area-inset-top, 0px)) + 86px));
}

.stage.duo-seg-horizontal .ach-toast {
  top: max(124px, calc(var(--safe-t, env(safe-area-inset-top, 0px)) + 122px));
}

.duo-touch-deck {
  position: absolute;
  top: var(--seg-deck-top, 52%);
  left: var(--seg-deck-left, 0px);
  width: var(--seg-deck-w, 100%);
  height: var(--seg-deck-h, 48%);
  z-index: 14;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 12px max(14px, var(--safe-r, env(safe-area-inset-right, 0px))) max(12px, var(--safe-b, env(safe-area-inset-bottom, 0px))) max(14px, var(--safe-l, env(safe-area-inset-left, 0px)));
  background: linear-gradient(180deg, #1a202c 0%, #141923 100%);
  border-top: 2px solid rgba(255, 213, 128, 0.28);
  touch-action: none;
}

.duo-deck-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.duo-deck-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(250, 251, 252, 0.12);
  border: 1px solid rgba(250, 251, 252, 0.18);
  color: #f4f6fa;
  font-size: 12px;
  font-weight: 800;
}

.duo-deck-pc {
  background: rgba(242, 140, 40, 0.22);
  border-color: rgba(242, 140, 40, 0.55);
  color: #ffd996;
}

.duo-deck-pad {
  flex: 1;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 18px;
  background: linear-gradient(180deg, #273041 0%, #1f2736 100%);
  border: 2px dashed rgba(242, 140, 40, 0.58);
  color: #ffffff;
  cursor: pointer;
  touch-action: none;
}

.duo-deck-pad.pressed {
  background: linear-gradient(180deg, #344157 0%, #273144 100%);
  border-color: #ffd54f;
  transform: scale(0.99);
}

.duo-pad-title {
  font-size: 18px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.duo-pad-sub {
  font-size: 12px;
  font-weight: 600;
  color: #c5cedd;
}

.duo-deck-npc {
  font-size: 12px;
  font-weight: 700;
  color: #d7e2ec;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.duo-journal-pane {
  position: absolute;
  top: var(--seg-journal-top, 0px);
  left: var(--seg-journal-left, 52%);
  width: var(--seg-journal-w, 48%);
  height: var(--seg-journal-h, 100%);
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, var(--safe-t, env(safe-area-inset-top, 0px))) max(14px, var(--safe-r, env(safe-area-inset-right, 0px))) max(12px, var(--safe-b, env(safe-area-inset-bottom, 0px))) 16px;
  background: linear-gradient(180deg, #f6f1e6 0%, #ece4d4 100%);
  border-left: 2px solid rgba(47, 81, 72, 0.22);
  pointer-events: none;
}

.duo-journal-card {
  width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fffdf8;
  border: 1.5px solid rgba(47, 81, 72, 0.22);
  box-shadow: 0 10px 24px rgba(19, 22, 28, 0.08);
}

.duo-j-eyebrow {
  font-size: 11px;
  font-weight: 800;
  color: var(--crayon);
  letter-spacing: 0.06em;
}

.duo-j-zone {
  font-size: 18px;
  font-weight: 850;
  color: var(--ink);
}

.duo-j-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.duo-j-stat {
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--silver-100);
  border: 1px solid var(--silver-200);
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink-soft);
}

.duo-j-next-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #faf6ed;
  border: 1px solid rgba(242, 140, 40, 0.34);
}

.duo-j-next-label {
  font-size: 10.5px;
  font-weight: 800;
  color: #8c4804;
}

.duo-j-thumb {
  width: 100%;
  height: 82px;
  border-radius: 8px;
  display: block;
  background: #eef1f6;
}

.duo-j-next-name {
  font-size: 14px;
  font-weight: 850;
  color: var(--ink);
}

.duo-j-next-hint {
  font-size: 11px;
  line-height: 1.35;
  color: var(--silver-600);
}

.duo-j-npc {
  font-size: 11.5px;
  line-height: 1.4;
  font-weight: 700;
  color: var(--crayon);
  padding: 6px 8px;
  border-radius: 10px;
  background: #f2f8f1;
  border: 1px solid rgba(47, 81, 72, 0.18);
}

/* ==================== 短横屏（<= 450px 高）补充一屏零滚动优化（含明信片/成就/更新条/874×382） ==================== */
@media (max-height: 450px) {
  #postcardsOverlay .modal-note {
    display: none;
  }

  .postcard-grid:not(.is-spread) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .postcard-grid:not(.is-spread) .postcard-thumb {
    height: 76px;
  }

  .postcard-grid:not(.is-spread) .postcard-body {
    padding: 5px 7px 6px;
    gap: 2px;
  }

  .postcard-grid:not(.is-spread) .postcard-name {
    font-size: 12px;
  }

  .postcard-grid:not(.is-spread) .postcard-meta {
    font-size: 10px;
  }

  .postcard-grid:not(.is-spread) .postcard-fact {
    font-size: 10px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .ach-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .ach-card {
    padding: 6px 8px;
  }

  .ach-name {
    font-size: 12px;
  }

  .ach-state {
    font-size: 10.5px;
  }

  .ach-desc {
    font-size: 10.5px;
    line-height: 1.28;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .modal-pager {
    margin-top: 5px;
  }

  .guide-sections {
    grid-template-columns: 1.08fr 0.92fr;
    gap: 7px;
    margin-top: 4px;
  }

  .guide-col {
    padding: 6px 7px;
  }

  .guide-col-title {
    font-size: 11px;
    margin-bottom: 4px;
  }

  .guide-card-list {
    gap: 4px;
  }

  .guide-item {
    padding: 3px 6px;
    gap: 6px;
  }

  .guide-thumb {
    width: 34px;
    height: 32px;
    flex: 0 0 34px;
  }

  .guide-item-name {
    font-size: 11px;
  }

  .guide-item-desc {
    font-size: 10px;
    line-height: 1.22;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* 当顶部有更新提示条时，进一步微缩结算卡纵向间距，确保 844×390 / 874×382 / 874×402 / 594×368 全部 0 压卡、0 滚动 */
  body.has-sw-update .panel-result {
    padding: 7px 11px 6px;
  }

  body.has-sw-update .result-grid {
    gap: 10px;
  }

  body.has-sw-update .result-top {
    margin-bottom: 4px;
    gap: 4px;
  }

  body.has-sw-update .result-score-wrap {
    padding: 4px 8px;
    margin-bottom: 4px;
  }

  body.has-sw-update .result-score {
    font-size: 27px;
  }

  body.has-sw-update .stat-tier-primary {
    gap: 6px;
    margin-bottom: 4px;
  }

  body.has-sw-update .stat-primary {
    padding: 3px 6px;
  }

  body.has-sw-update .stat-val-lg {
    font-size: 16px;
  }

  body.has-sw-update .result-journey {
    margin: 3px 0 4px;
    padding: 2px 5px;
  }

  body.has-sw-update .result-quip {
    padding: 4px 7px;
    font-size: 10.5px;
    line-height: 1.28;
  }

  body.has-sw-update .stat-tier-secondary {
    gap: 4px;
    margin-bottom: 4px;
  }

  body.has-sw-update .stat-box {
    padding: 3px 5px;
  }

  body.has-sw-update .stat-label {
    font-size: 10.5px;
  }

  body.has-sw-update .stat-val {
    font-size: 13.5px;
  }

  body.has-sw-update .mission-box {
    margin-top: 3px;
    padding: 4px 7px;
  }

  body.has-sw-update .mission-title {
    font-size: 11px;
    margin-bottom: 2px;
  }

  body.has-sw-update .mission-item {
    font-size: 10.5px;
    padding: 1px 0;
  }

  body.has-sw-update .result-actions {
    margin-top: 5px;
    gap: 6px;
  }

  body.has-sw-update .result-col-right .hint-line {
    margin-top: 3px;
    font-size: 10.5px;
  }
}

/* ==================== v1.7 极窄横屏专优：iPhone Duo 外屏 594×368 / 594×406 ==================== */
@media (max-width: 680px) {
  .hud {
    padding: max(4px, calc(var(--safe-t, env(safe-area-inset-top, 0px)) + 2px)) max(8px, calc(var(--safe-r, env(safe-area-inset-right, 0px)) + 4px)) 2px max(8px, calc(var(--safe-l, env(safe-area-inset-left, 0px)) + 4px));
    gap: 6px;
  }

  .hud-left,
  .hud-center,
  .hud-right {
    gap: 6px;
  }

  #hudBestWrap,
  .hud-koi:not(.hidden) ~ .hud-buff {
    display: none !important;
  }

  .hud-combo:not(.hidden) ~ .hud-rhythm {
    display: none !important;
  }

  .score-group {
    height: 30px;
    padding: 0 7px;
    gap: 4px;
  }

  .score-now {
    font-size: 15px;
    min-width: 2.4ch;
  }

  .score-dist,
  .score-tag,
  .score-best-num {
    font-size: 11px;
  }

  .hud-pill {
    height: 28px;
    padding: 0 6px;
    gap: 3px;
  }

  .hud-combo {
    padding: 0 8px;
  }

  .koi-bar-track {
    width: 20px;
  }

  .hud-value {
    font-size: 13px;
  }

  .combo-text,
  .rhythm-text,
  .koi-text,
  .koi-sec,
  .buff-text {
    font-size: 11px;
  }

  .milestone-toast {
    top: max(42px, calc(var(--safe-t, env(safe-area-inset-top, 0px)) + 38px));
    font-size: 11.5px;
    padding: 4px 12px;
  }

  .ach-toast {
    top: max(82px, calc(var(--safe-t, env(safe-area-inset-top, 0px)) + 78px));
    font-size: 11.5px;
    padding: 4px 12px;
  }

  .overlay {
    padding: max(4px, var(--safe-t, env(safe-area-inset-top, 0px))) max(8px, var(--safe-r, env(safe-area-inset-right, 0px))) max(4px, var(--safe-b, env(safe-area-inset-bottom, 0px))) max(8px, var(--safe-l, env(safe-area-inset-left, 0px)));
  }

  .panel {
    padding: 8px 10px 7px;
    border-radius: 14px;
  }

  .panel-start {
    width: 100%;
  }

  .start-grid {
    grid-template-columns: 1.06fr 1fr;
    gap: 9px;
  }

  .badge-row {
    gap: 5px;
    margin-bottom: 4px;
  }

  .tag-brand,
  .tag-rank {
    font-size: 10.5px;
    padding: 2px 7px;
  }

  .game-title {
    font-size: 20px;
    margin-bottom: 4px;
  }

  .snake-prompt-card {
    padding: 5px 7px;
    gap: 6px;
    margin-bottom: 5px;
  }

  .snake-mini-canvas {
    width: 40px;
    height: 34px;
  }

  .snake-prompt-tag {
    font-size: 10.5px;
  }

  .btn-wager-pill {
    font-size: 10px;
    padding: 2px 7px;
  }

  .snake-prompt-text {
    font-size: 11px;
    line-height: 1.32;
  }

  .hint-line {
    font-size: 10.5px;
  }

  .start-col-right {
    gap: 6px;
  }

  .start-actions {
    gap: 6px;
  }

  .btn-primary,
  .btn-secondary,
  .btn-daily {
    min-height: 44px;
    font-size: 13px;
    padding: 5px 8px;
  }

  .btn-daily small {
    font-size: 10px;
  }

  .start-secondary-row {
    gap: 5px;
    margin-top: 2px;
  }

  .btn-sec-card {
    min-height: 44px;
    padding: 4px 3px;
  }

  .sec-title {
    font-size: 11px;
  }

  .sec-sub,
  .sec-dots {
    font-size: 10px;
  }

  /* 594×368 结算页紧凑双栏（即使顶部挂 swUpdateBanner 亦 0 压卡、0 滚动、按钮>=44px） */
  .panel-result {
    width: 100%;
    padding: 7px 9px 6px;
  }

  .result-grid {
    gap: 9px;
    grid-template-columns: 1fr 1.04fr;
  }

  .result-top {
    gap: 4px;
    margin-bottom: 4px;
  }

  .result-mode,
  .result-reason,
  .result-grade,
  .new-record {
    font-size: 10px;
    padding: 2px 6px;
  }

  .result-score-wrap {
    padding: 4px 8px;
    margin-bottom: 4px;
  }

  .result-score {
    font-size: 26px;
  }

  .result-score-label,
  .result-compare {
    font-size: 10.5px;
  }

  .stat-tier-primary {
    gap: 5px;
    margin-bottom: 4px;
  }

  .stat-primary {
    padding: 4px 6px;
  }

  .stat-val-lg {
    font-size: 15.5px;
  }

  .result-journey {
    margin: 3px 0 4px;
    padding: 2px 4px;
    gap: 2px;
  }

  .rj-step {
    font-size: 10px;
    padding: 1px 3px;
  }

  .result-quip {
    padding: 4px 7px;
    font-size: 10.5px;
    line-height: 1.28;
  }

  .stat-tier-secondary {
    gap: 4px;
    margin-bottom: 4px;
  }

  .stat-box {
    padding: 4px 5px;
  }

  .stat-label {
    font-size: 10px;
  }

  .stat-val {
    font-size: 13px;
  }

  .stat-val-sm {
    font-size: 11px;
  }

  .mission-box {
    margin-top: 4px;
    padding: 4px 7px;
  }

  .mission-title {
    font-size: 10.5px;
    margin-bottom: 2px;
  }

  .mission-item {
    font-size: 10.5px;
    padding: 1px 0;
  }

  .result-actions {
    margin-top: 5px;
    gap: 6px;
    grid-template-columns: 1.45fr 0.85fr;
  }

  .result-col-right .hint-line {
    margin-top: 3px;
    font-size: 10px;
  }

  /* 594×368 衣橱：5×2 一屏全览 9 套，零滚动且所有按钮>=44px */
  #skinOverlay .panel-modal {
    padding: 6px 8px;
  }

  #skinOverlay .modal-head {
    margin-bottom: 4px;
    gap: 4px;
  }

  #skinOverlay .panel-title {
    font-size: 13.5px;
  }

  #skinOverlay .wallet-pill {
    height: 28px;
    padding: 0 7px;
    font-size: 10.5px;
  }

  #skinOverlay .btn-chip-inline,
  #skinOverlay .btn-close {
    padding: 0 10px;
    font-size: 11.5px;
  }

  #skinOverlay .skin-grid:not(.is-spread) {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
  }

  #skinOverlay .skin-card {
    padding: 3px 4px;
  }

  #skinOverlay .preview-stage {
    height: 36px;
    margin-bottom: 2px;
  }

  #skinOverlay .preview-canvas {
    width: 50px;
    height: 36px;
  }

  #skinOverlay .status-pill {
    display: none;
  }

  #skinOverlay .skin-name {
    font-size: 10.5px;
  }

  #skinOverlay .skin-cond {
    font-size: 10px;
    margin-bottom: 2px;
  }

  #skinOverlay .skin-bar {
    margin-bottom: 3px;
  }

  #skinOverlay .skin-btn {
    min-height: 44px;
    font-size: 10.5px;
    padding: 0 2px;
  }

  /* 594×368 商店：左店长 96px + 右 3×2 一屏 5 套，零滚动 */
  #shopOverlay .panel-modal {
    padding: 6px 8px;
  }

  #shopOverlay .panel-title {
    font-size: 13.5px;
  }

  #shopOverlay .btn-chip-inline,
  #shopOverlay .btn-close {
    padding: 0 10px;
    font-size: 11.5px;
  }

  #shopOverlay .shop-layout {
    grid-template-columns: 96px 1fr;
    gap: 6px;
  }

  #shopOverlay .shop-keeper-col {
    padding: 5px 5px;
  }

  #shopOverlay .gugu-canvas {
    width: 72px;
    height: 58px;
  }

  #shopOverlay .gugu-bubble {
    padding: 5px 5px;
    font-size: 10px;
    line-height: 1.32;
    margin: 4px 0;
  }

  #shopOverlay .gugu-policy {
    display: none;
  }

  #shopOverlay .shop-items-col {
    gap: 4px;
  }

  #shopOverlay .shop-card {
    padding: 4px 5px;
  }

  #shopOverlay .preview-stage {
    height: 36px;
    margin-bottom: 2px;
  }

  #shopOverlay .preview-canvas {
    width: 50px;
    height: 36px;
  }

  #shopOverlay .skin-name {
    font-size: 11px;
  }

  #shopOverlay .status-pill {
    display: none;
  }

  #shopOverlay .shop-price-row {
    font-size: 10px;
    margin-bottom: 3px;
  }

  #shopOverlay .shop-buy-btn {
    min-height: 44px;
    font-size: 10.5px;
    padding: 0 3px;
  }

  /* 594×368 收集与声音弹层：零滚动且所有按钮>=44px */
  #moreOverlay .panel-modal {
    padding: 6px 8px;
  }

  #moreOverlay .more-entry-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    margin: 3px 0 4px;
  }

  #moreOverlay .btn-more-tile {
    min-height: 44px;
    padding: 3px 4px;
    font-size: 10.5px;
    line-height: 1.2;
  }

  #moreOverlay .more-toggle-row {
    gap: 4px;
  }

  #moreOverlay .more-toggle-row .btn-chip {
    min-height: 44px;
    font-size: 11px;
    padding: 0 4px;
  }

  #moreOverlay .more-volume-grid {
    gap: 4px;
    margin-top: 4px;
  }

  #moreOverlay .vol-item {
    padding: 4px 6px;
    gap: 2px;
  }

  #moreOverlay .vol-slider {
    min-height: 44px;
    height: 44px;
  }

  #moreOverlay .more-audition-row {
    margin-top: 4px;
    padding: 4px 6px;
    gap: 4px;
  }

  #moreOverlay .audition-label {
    font-size: 10px;
  }

  #moreOverlay .audition-pills {
    gap: 4px;
  }

  #moreOverlay .btn-audition {
    min-height: 44px;
    font-size: 10.5px;
    padding: 0 4px;
  }

  /* 594×368 明信片册（每页 2 张，零滚动）与成就页（每页 6 项，2×3，零滚动） */
  .postcard-grid:not(.is-spread) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .postcard-grid:not(.is-spread) .postcard-thumb {
    height: 74px;
  }

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

  .ach-card {
    padding: 5px 7px;
  }

  /* 594×368 3秒图鉴：顶部双切换标签，零滚动 */
  .guide-tab-row {
    display: flex;
  }

  .guide-sections {
    grid-template-columns: 1fr;
    margin-top: 0;
  }

  .guide-sections[data-active-tab="good"] .guide-col-bad,
  .guide-sections[data-active-tab="bad"] .guide-col-good {
    display: none;
  }

  .guide-col-title {
    display: none;
  }

  /* 594×368 暂停弹层 */
  .panel-pause {
    width: 100%;
    padding: 8px 10px;
  }

  .pause-grid {
    gap: 10px;
  }

  .pause-audio-row {
    gap: 4px;
  }

  .pause-audio-row .btn-chip {
    font-size: 10.5px;
    padding: 0 4px;
  }
}

/* 951×585 / 951×620 / 1280×800 对开模式与中等高度一屏无滚动优化 */
@media (min-width: 900px) and (min-height: 500px) {
  .ach-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .ach-card {
    padding: 7px 9px;
  }

  .ach-desc {
    font-size: 11px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

@media (max-height: 640px) and (min-height: 451px) {
  #shopOverlay .panel-modal,
  #guideOverlay .panel-modal {
    padding: 12px 16px 11px;
  }

  #shopOverlay .modal-head,
  #guideOverlay .modal-head {
    margin-bottom: 6px;
  }

  #shopOverlay .preview-stage {
    height: 48px;
    margin-bottom: 3px;
  }

  #shopOverlay .preview-canvas {
    width: 68px;
    height: 48px;
  }

  #shopOverlay .shop-card {
    padding: 6px 7px;
  }

  #shopOverlay .skin-highlight {
    font-size: 10.5px;
    line-height: 1.28;
    margin-bottom: 3px;
    white-space: normal;
    overflow: visible;
  }

  #shopOverlay .shop-price-row {
    margin-bottom: 3px;
    font-size: 11.5px;
  }

  #shopOverlay .shop-alt-hint {
    font-size: 10.5px;
    margin-bottom: 5px;
    line-height: 1.25;
  }

  #guideOverlay .guide-sections {
    gap: 8px;
    margin-top: 4px;
  }

  #guideOverlay .guide-col {
    padding: 7px 8px;
  }

  #guideOverlay .guide-card-list {
    gap: 5px;
  }

  #guideOverlay .guide-item {
    padding: 4px 7px;
  }

  #guideOverlay .guide-thumb {
    width: 40px;
    height: 38px;
    flex: 0 0 40px;
  }
}

/* ==================== v1.8 Duo A 左右分屏 HUD 防挤、蛇的路碑小题与回程邮戳 ==================== */
.combo-inline {
  display: none;
  padding: 1px 6px;
  border-radius: 99px;
  background: #ffda8a;
  border: 1px solid var(--crayon);
  color: var(--ink);
  font-size: 11px;
  line-height: 1.25;
  -webkit-text-stroke: 0;
  text-shadow: none;
}

.combo-inline.combo-warm {
  background: #f28c28;
  color: #13161c;
}

.combo-inline.combo-hot {
  background: var(--koi-red);
  border-color: #ffffff;
  color: #ffffff;
}

/* Duo A 左右双段模式：左段收回 463px 宽不跨折痕，所有可见 HUD（含蛇题进度标）两两间距 >= 8px（不碰不挤），连击收进分数框 */
.stage.duo-seg-horizontal .hud {
  padding: max(6px, calc(var(--safe-t, env(safe-area-inset-top, 0px)) + 4px)) 8px 4px max(8px, calc(var(--safe-l, env(safe-area-inset-left, 0px)) + 6px));
  gap: 7px;
}

.stage.duo-seg-horizontal .hud-left,
.stage.duo-seg-horizontal .hud-center,
.stage.duo-seg-horizontal .hud-right {
  gap: 7px;
}

.stage.duo-seg-horizontal #hudBestWrap,
.stage.duo-seg-horizontal #hudDailyPill,
.stage.duo-seg-horizontal #hudComboPill,
.stage.duo-seg-horizontal #hudRhythmPill,
.stage.duo-seg-horizontal .audio-toggles {
  display: none !important;
}

.stage.duo-seg-horizontal .combo-inline:not(.hidden) {
  display: inline-block;
}

.stage.duo-seg-horizontal .hud-koi:not(.hidden) ~ .hud-buff {
  display: none !important;
}

.stage.duo-seg-horizontal .score-group {
  height: 34px;
  padding: 0 8px;
  gap: 5px;
}

.stage.duo-seg-horizontal .score-now {
  font-size: 16px;
  min-width: 2.5ch;
}

.stage.duo-seg-horizontal .score-meta {
  padding-left: 5px;
  gap: 4px;
}

.stage.duo-seg-horizontal .hud-pill {
  height: 32px;
  padding: 0 7px;
  gap: 4px;
}

.stage.duo-seg-horizontal .koi-bar-track {
  width: 22px;
}

.stage.duo-seg-horizontal .duo-journal-pane {
  padding: max(10px, var(--safe-t, env(safe-area-inset-top, 0px))) max(12px, var(--safe-r, env(safe-area-inset-right, 0px))) max(10px, var(--safe-b, env(safe-area-inset-bottom, 0px))) 12px;
}

.stage.duo-seg-horizontal.is-result-view .duo-journal-pane {
  z-index: 25;
  pointer-events: auto;
}

.stage.duo-seg-horizontal.is-result-view .duo-j-next-box {
  display: none;
}

.stage.duo-seg-horizontal .overlay-gameover {
  left: var(--seg-stage-left, 0px);
  top: var(--seg-stage-top, 0px);
  right: auto;
  bottom: auto;
  width: var(--seg-stage-w, 50%);
  height: var(--seg-stage-h, 100%);
  padding: 10px 10px;
}

.stage.duo-seg-horizontal .panel-result {
  width: 100%;
  padding: 10px 12px 9px;
}

.stage.duo-seg-horizontal .result-grid {
  grid-template-columns: 1fr;
  gap: 8px;
}

.stage.duo-seg-horizontal .result-score {
  font-size: 30px;
}

.stage.duo-seg-horizontal .result-score-wrap {
  padding: 6px 10px;
  margin-bottom: 6px;
}

.stage.duo-seg-horizontal .stat-tier-primary {
  margin-bottom: 6px;
}

.stage.duo-seg-horizontal .stat-tier-secondary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 6px;
}

.stage.duo-seg-horizontal .stat-box {
  padding: 5px 4px;
}

.stage.duo-seg-horizontal .stat-label {
  font-size: 10px;
}

.stage.duo-seg-horizontal .stat-val {
  font-size: 12.5px;
}

.stage.duo-seg-horizontal .stat-val-sm {
  font-size: 10.5px;
}

.stage.duo-seg-horizontal .mission-box {
  margin-top: 4px;
  padding: 5px 8px;
}

.stage.duo-seg-horizontal .mission-item {
  font-size: 11px;
}

.stage.duo-seg-horizontal .result-actions {
  margin-top: 6px;
}

.stage.duo-seg-horizontal .duo-journal-card {
  padding: 10px 12px;
  gap: 7px;
  height: 100%;
  justify-content: space-between;
}

.duo-j-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.stage.duo-seg-horizontal .duo-j-eyebrow {
  font-size: 10.5px;
}

.stage.duo-seg-horizontal .duo-j-zone {
  font-size: 16px;
}

.stage.duo-seg-horizontal .duo-j-stat {
  font-size: 10.5px;
  padding: 2px 8px;
}

.stage.duo-seg-horizontal .duo-j-next-box {
  padding: 7px 9px;
  gap: 4px;
}

.stage.duo-seg-horizontal .duo-j-next-label {
  font-size: 10.5px;
}

.stage.duo-seg-horizontal .duo-j-thumb {
  height: 64px;
}

.stage.duo-seg-horizontal .duo-j-next-name {
  font-size: 13px;
}

.stage.duo-seg-horizontal .duo-j-next-hint,
.stage.duo-seg-horizontal .duo-j-npc {
  font-size: 10.5px;
}

/* v1.8.1 Duo 专属小彩蛋「本局路书」（纯展示，仅左右双段 API 存在时出现，字号 >= 10.5px） */
.duo-j-roadbook {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f9f6ee;
  border: 1px solid rgba(47, 81, 72, 0.22);
}

.duo-rb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.duo-rb-title {
  font-size: 12.5px;
  font-weight: 850;
  color: var(--crayon);
}

.duo-rb-meta {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--silver-600);
}

.duo-rb-cols {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
}

.duo-rb-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.duo-rb-col-label {
  font-size: 10.5px;
  font-weight: 800;
  color: #6b532e;
  border-bottom: 1px dashed rgba(47, 81, 72, 0.22);
  padding-bottom: 2px;
}

.duo-rb-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.duo-rb-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 3px 6px;
  border-radius: 7px;
  background: #ffffff;
  border: 1px solid rgba(47, 81, 72, 0.12);
  font-size: 11px;
  line-height: 1.28;
  color: var(--ink-soft);
}

.duo-rb-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  font-weight: 700;
}

.duo-rb-marks {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.duo-rb-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e2f5ec;
  border: 1px solid #2b8a62;
  color: #166544;
}

.duo-rb-stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  height: 16px;
  border-radius: 99px;
  background: #e6f7f0;
  border: 1px dashed #2f5148;
  color: #1b5c46;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.duo-rb-prog {
  font-size: 10.5px;
  font-weight: 700;
  color: #8c4804;
}

.duo-rb-empty {
  font-size: 10.5px;
  color: var(--silver-600);
  padding: 4px 2px;
}

.duo-rb-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}

.duo-rb-btn {
  min-width: 68px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(47, 81, 72, 0.28);
  background: #ffffff;
  color: var(--ink);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}

.duo-rb-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.duo-rb-page {
  font-size: 11px;
  font-weight: 800;
  color: var(--crayon);
}

/* v1.8 蛇的路碑小题：顶部天空余量轻量出题条（<=3s）与收缩进度小标（>=10.5px，不挡猴与障碍、不与 HUD 重叠） */
.snake-quiz-banner {
  position: absolute;
  left: 50%;
  top: max(56px, calc(var(--safe-t, env(safe-area-inset-top, 0px)) + 52px));
  transform: translateX(-50%);
  z-index: 13;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 7px;
  border-radius: var(--radius-pill);
  background: rgba(244, 250, 243, 0.96);
  border: 1.5px solid #2f7d5b;
  box-shadow: 0 4px 14px rgba(19, 28, 24, 0.16);
  color: #173a2b;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  max-width: calc(100vw - 128px);
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.snake-quiz-banner.is-win {
  background: #fff7e6;
  border-color: #e0452c;
  color: #8f2210;
}

.sq-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: #2f7d5b;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  flex-shrink: 0;
}

.snake-quiz-banner.is-win .sq-badge {
  background: #e0452c;
}

.sq-banner-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.snake-quiz-pill {
  position: absolute;
  left: max(12px, calc(var(--safe-l, env(safe-area-inset-left, 0px)) + 8px));
  top: max(54px, calc(var(--safe-t, env(safe-area-inset-top, 0px)) + 50px));
  z-index: 11;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  background: rgba(242, 249, 241, 0.94);
  border: 1.5px solid rgba(47, 125, 91, 0.56);
  box-shadow: 0 2px 8px rgba(19, 28, 24, 0.10);
  color: #1a4734;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: none;
}

.snake-quiz-pill.is-done {
  background: #e6f7ee;
  border-color: #1b7f4b;
  color: #125834;
}

.sq-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3fab84;
  flex-shrink: 0;
}

.snake-quiz-pill.is-done .sq-dot {
  background: #e0452c;
}

.stage.duo-seg-horizontal .snake-quiz-banner {
  left: calc(var(--seg-stage-left, 0px) + var(--seg-stage-w, 100%) * 0.5);
  top: max(58px, calc(var(--safe-t, env(safe-area-inset-top, 0px)) + 56px));
  max-width: calc(var(--seg-stage-w, 100%) - 16px);
}

.stage.duo-seg-horizontal .snake-quiz-pill {
  left: calc(var(--seg-stage-left, 0px) + max(8px, calc(var(--safe-l, env(safe-area-inset-left, 0px)) + 6px)));
  top: max(58px, calc(var(--safe-t, env(safe-area-inset-top, 0px)) + 56px));
  max-width: calc(var(--seg-stage-w, 100%) - 16px);
}

@media (max-width: 960px) {
  .snake-quiz-banner {
    top: max(56px, calc(var(--safe-t, env(safe-area-inset-top, 0px)) + 54px));
    font-size: 11px;
    padding: 3px 10px 3px 6px;
  }

  .snake-quiz-pill {
    left: max(10px, calc(var(--safe-l, env(safe-area-inset-left, 0px)) + 6px));
    top: max(50px, calc(var(--safe-t, env(safe-area-inset-top, 0px)) + 48px));
    height: 23px;
    font-size: 10.5px;
    padding: 0 8px;
  }
}

@media (max-width: 680px) {
  .snake-quiz-banner {
    top: max(50px, calc(var(--safe-t, env(safe-area-inset-top, 0px)) + 48px));
    font-size: 10.5px;
    max-width: calc(100vw - 24px);
    padding: 3px 9px 3px 5px;
  }

  .sq-badge {
    font-size: 10px;
    padding: 1px 5px;
  }

  .snake-quiz-pill {
    left: max(8px, calc(var(--safe-l, env(safe-area-inset-left, 0px)) + 4px));
    top: max(42px, calc(var(--safe-t, env(safe-area-inset-top, 0px)) + 40px));
    height: 22px;
    font-size: 10.5px;
    padding: 0 7px;
  }
}

/* v1.8 第二程回程邮戳轻量标签 */
.postcard-return-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 99px;
  background: #e4f6ee;
  border: 1px solid rgba(47, 125, 91, 0.45);
  color: #165942;
  font-size: 10px;
  font-weight: 800;
  vertical-align: middle;
}

/* ==================== v1.9 长期追求：造型染色工坊、每日轮换小店、旅行箱贴纸与发现册 ==================== */
#guguShopCanvas,
#snakeHomeCanvas,
#journalEyebrow {
  cursor: pointer;
}

.shop-daily-panel.hidden,
.shop-dye-panel.hidden,
.journal-suitcase-view.hidden,
.journal-discovery-view.hidden,
#journalPostcardsView.hidden,
#shopGrid.hidden {
  display: none !important;
}

.v19-seg-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
}

.btn-v19-tab {
  min-height: 44px;
  min-width: 52px;
  padding: 0 11px;
  border-radius: var(--radius-pill);
  border: 1.5px solid rgba(47, 81, 72, 0.24);
  background: #ffffff;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.btn-v19-tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}

.journal-head-title-wrap {
  min-width: 0;
}

.journal-title-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.journal-unified-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: #f4f7f2;
  border: 1px solid rgba(47, 81, 72, 0.24);
  color: #214a3b;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

/* ---- 第二层：茶壶咕咕每日轮换小店 ---- */
.shop-daily-panel {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 10px;
  align-items: stretch;
  min-width: 0;
}

.daily-featured-card,
.daily-shelf-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1.5px solid rgba(47, 81, 72, 0.22);
  background: linear-gradient(180deg, #fffdf8 0%, #f9f5eb 100%);
  min-width: 0;
}

.daily-featured-card {
  border-color: rgba(224, 69, 44, 0.42);
  background: linear-gradient(180deg, #fffefb 0%, #fff6ec 100%);
}

.daily-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.daily-date-tag {
  font-size: 11px;
  font-weight: 800;
  color: #9e3119;
  background: #ffefe8;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}

.daily-cycle-note {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--silver-600);
  white-space: nowrap;
}

.daily-showcase-body {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  min-width: 0;
}

.daily-preview-wrap {
  width: 108px;
  height: 92px;
  flex-shrink: 0;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 60%, #ffffff 0%, #f4ecdd 100%);
  border: 1px solid rgba(47, 81, 72, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}

.daily-preview-canvas {
  width: 104px;
  height: 88px;
  display: block;
}

.daily-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.daily-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.daily-item-name {
  font-size: 15px;
  font-weight: 850;
  color: var(--ink);
}

.daily-slot-pill {
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 99px;
  background: #e6f5ef;
  color: #1c5a44;
}

.daily-item-desc {
  font-size: 11.5px;
  line-height: 1.38;
  color: var(--ink-soft);
}

.daily-price-line {
  font-size: 12.5px;
  font-weight: 850;
  color: #8c3f05;
}

.btn-daily-main,
.btn-daily-shelf,
.btn-dye-nav,
.btn-dye-action,
.btn-sticker-action {
  min-height: 44px;
  min-width: 44px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1.5px solid rgba(19, 22, 28, 0.20);
  background: var(--ink);
  color: #ffffff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.btn-daily-main.is-buy {
  background: var(--koi-red);
  border-color: var(--koi-red);
}

.btn-daily-main.is-equipped,
.btn-dye-action.is-equipped,
.btn-sticker-action.is-owned {
  background: #e5f5ee;
  border-color: #2b8a62;
  color: #155c3e;
}

.btn-daily-main:disabled,
.btn-dye-action:disabled,
.btn-sticker-action:disabled,
.btn-daily-shelf:disabled {
  opacity: 0.56;
  cursor: default;
}

.daily-shelf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.daily-shelf-title {
  font-size: 12.5px;
  font-weight: 850;
  color: var(--crayon);
}

.daily-shelf-count {
  font-size: 11px;
  font-weight: 800;
  color: var(--silver-600);
}

.daily-shelf-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.daily-shelf-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 7px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(47, 81, 72, 0.16);
}

.daily-shelf-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.daily-shelf-name {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink);
  white-space: normal;
  overflow: visible;
}

.daily-shelf-sub {
  font-size: 10px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--silver-600);
  white-space: normal;
  overflow: visible;
}

.btn-daily-shelf {
  background: #ffffff;
  color: var(--ink);
  font-size: 11px;
  padding: 0 9px;
}

.btn-daily-shelf.is-active {
  background: #2f5148;
  border-color: #2f5148;
  color: #ffffff;
}

.daily-shelf-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 6px;
}

/* ---- 第一层：造型染色工坊 ---- */
.shop-dye-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.dye-outfit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 12px;
  background: #f5f7fa;
  border: 1px solid var(--silver-200);
}

.dye-outfit-center {
  text-align: center;
  min-width: 0;
}

.dye-outfit-title {
  font-size: 13px;
  font-weight: 850;
  color: var(--ink);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dye-outfit-sub {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--silver-600);
}

.btn-dye-nav {
  background: #ffffff;
  color: var(--ink);
  padding: 0 11px;
  font-size: 11.5px;
}

.dye-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.dye-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 7px 6px 6px;
  border-radius: 12px;
  border: 1.5px solid #dce1ea;
  background: #ffffff;
  min-width: 0;
  text-align: center;
}

.dye-card.is-equipped {
  border-color: #2b8a62;
  background: #f5fbf8;
}

.dye-preview-canvas {
  width: 72px;
  height: 58px;
  display: block;
  margin-bottom: 3px;
}

.dye-swatch-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
}

.dye-swatch-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(19, 22, 28, 0.32);
}

.dye-card-name {
  font-size: 12px;
  font-weight: 850;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.dye-card-meta {
  font-size: 10.5px;
  font-weight: 700;
  color: #7c4508;
  margin-bottom: 4px;
  white-space: nowrap;
}

.btn-dye-action {
  width: 100%;
  font-size: 11px;
  padding: 0 4px;
}

.btn-dye-action.is-buy {
  background: var(--koi-red);
  border-color: var(--koi-red);
}

/* ---- 第三层：旅行箱贴纸收藏 ---- */
.journal-suitcase-view {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 12px;
  align-items: stretch;
}

.suitcase-stage-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, #faf5ea 0%, #f1e6d2 100%);
  border: 1.5px solid rgba(92, 58, 28, 0.26);
  min-width: 0;
}

.suitcase-canvas {
  width: 100%;
  max-width: 380px;
  height: auto;
  max-height: 224px;
  display: block;
}

.suitcase-caption {
  margin-top: 5px;
  font-size: 11px;
  font-weight: 800;
  color: #52361c;
  text-align: center;
}

.suitcase-shop-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.suitcase-shop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.suitcase-wallet {
  font-size: 11.5px;
  font-weight: 850;
  padding: 2px 9px;
  border-radius: 99px;
  background: #ffe8ba;
  color: #6b3805;
}

.suitcase-rule {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--silver-600);
}

.sticker-list-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.sticker-row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 12px;
  border: 1.5px solid #dce1ea;
  background: #ffffff;
}

.sticker-row-card.is-owned {
  border-color: rgba(43, 138, 98, 0.45);
  background: #f8fcf9;
}

.sticker-badge-chip {
  width: 38px;
  height: 32px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 900;
  flex-shrink: 0;
  border: 1.5px solid rgba(19, 22, 28, 0.22);
}

.sticker-row-info {
  flex: 1;
  min-width: 0;
}

.sticker-row-title {
  font-size: 12.5px;
  font-weight: 850;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sticker-row-sub {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--silver-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-sticker-action {
  font-size: 11px;
  padding: 0 10px;
}

.btn-sticker-action.is-buy {
  background: var(--koi-red);
  border-color: var(--koi-red);
}

/* ---- 第四层：发现册（不剧透触发条件） ---- */
.discovery-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 5px 10px;
  margin-bottom: 7px;
  border-radius: 11px;
  background: #f5f7f3;
  border: 1px solid rgba(47, 81, 72, 0.20);
}

.disc-total {
  font-size: 12px;
  font-weight: 850;
  color: var(--ink);
}

.disc-tier-pills {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.disc-tier-pill,
.disc-crest-pill {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 99px;
  background: #ffffff;
  border: 1px solid rgba(47, 81, 72, 0.22);
  color: var(--ink-soft);
  white-space: nowrap;
}

.disc-crest-pill.is-unlocked {
  background: #fff4cf;
  border-color: #d99b26;
  color: #6b4104;
}

.discovery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

@media (min-width: 920px) and (min-height: 575px) {
  .discovery-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.disc-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px 9px;
  border-radius: 11px;
  border: 1.5px solid #dce1ea;
  background: #f8f9fb;
  min-width: 0;
}

.disc-card.is-found {
  border-color: rgba(63, 171, 132, 0.48);
  background: linear-gradient(180deg, #ffffff 0%, #f5fbf8 100%);
}

.disc-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.disc-card-title {
  font-size: 12px;
  font-weight: 850;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.disc-card:not(.is-found) .disc-card-title {
  color: #687387;
}

.disc-card-tier {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 99px;
  background: #eef1f6;
  color: #556072;
  flex-shrink: 0;
}

.disc-card.is-found .disc-card-tier {
  background: #e3f5ec;
  color: #175c40;
}

.disc-card-note {
  font-size: 10.5px;
  line-height: 1.34;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.disc-card:not(.is-found) .disc-card-note {
  color: #7c8698;
}

/* 矮屏（<=460px，如 844×390、874×382、594×368）紧凑防溢出 */
@media (max-height: 460px) {
  .v19-seg-tabs {
    gap: 3px;
  }

  .btn-v19-tab {
    min-width: 46px;
    padding: 0 8px;
    font-size: 11px;
  }

  .journal-unified-pill {
    font-size: 10.5px;
    padding: 1px 7px;
  }

  .daily-featured-card,
  .daily-shelf-card {
    padding: 6px 8px;
  }

  .daily-preview-wrap {
    width: 78px;
    height: 68px;
  }

  .daily-preview-canvas {
    width: 74px;
    height: 64px;
  }

  .daily-item-name {
    font-size: 13px;
  }

  .daily-item-desc {
    font-size: 10.5px;
    line-height: 1.28;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .daily-price-line {
    font-size: 11px;
  }

  .daily-showcase-body {
    margin-bottom: 5px;
    gap: 7px;
  }

  .shop-dye-panel {
    gap: 5px;
  }

  .dye-outfit-bar {
    padding: 2px 6px;
  }

  .dye-outfit-title {
    font-size: 11.5px;
  }

  .dye-outfit-sub {
    font-size: 10px;
  }

  .dye-cards-grid {
    gap: 5px;
  }

  .dye-card {
    padding: 4px 4px;
  }

  .dye-preview-canvas {
    width: 56px;
    height: 44px;
    margin-bottom: 2px;
  }

  .dye-card-name {
    font-size: 11px;
  }

  .dye-card-meta {
    font-size: 10px;
    margin-bottom: 2px;
  }

  .journal-suitcase-view {
    gap: 8px;
  }

  .suitcase-stage-col {
    padding: 4px 6px;
  }

  .suitcase-canvas {
    max-height: 172px;
  }

  .suitcase-caption {
    margin-top: 3px;
    font-size: 10px;
  }

  .suitcase-shop-head {
    margin-bottom: 4px;
  }

  .sticker-list-grid {
    gap: 4px;
  }

  .sticker-row-card {
    padding: 3px 7px;
  }

  .sticker-row-title {
    font-size: 11.5px;
  }

  .sticker-row-sub {
    font-size: 10px;
  }

  .suitcase-pager,
  .discovery-pager {
    margin-top: 4px;
  }

  .discovery-summary-bar {
    padding: 3px 8px;
    margin-bottom: 4px;
  }

  .disc-total {
    font-size: 11px;
  }

  .discovery-grid {
    gap: 5px;
  }

  .disc-card {
    padding: 5px 7px;
  }

  .disc-card-title {
    font-size: 11px;
  }

  .disc-card-note {
    font-size: 10px;
    line-height: 1.25;
  }
}

/* 594×368 极限宽度防挤精调（字号严格 >= 10px，按钮严格 >= 44×44） */
@media (max-width: 680px) {
  .btn-v19-tab {
    min-width: 44px;
    padding: 0 6px;
    font-size: 10.5px;
  }

  #shopOverlay .wallet-pill {
    height: 28px;
    padding: 0 6px;
    font-size: 10.5px;
  }

  #shopOverlay .modal-head-actions,
  #postcardsOverlay .modal-head-actions {
    gap: 3px;
  }

  .journal-title-inline {
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
  }

  #postcardsOverlay .panel-title {
    font-size: 13px;
  }

  .journal-unified-pill {
    font-size: 10px;
    padding: 1px 5px;
  }

  .shop-daily-panel {
    grid-template-columns: 1.12fr 0.88fr;
    gap: 6px;
  }

  .daily-cycle-note,
  .suitcase-rule,
  .disc-crest-pill {
    display: none;
  }

  .daily-preview-wrap {
    width: 62px;
    height: 58px;
  }

  .daily-preview-canvas {
    width: 58px;
    height: 54px;
  }

  .daily-item-name {
    font-size: 11.5px;
  }

  .daily-slot-pill {
    font-size: 10px;
    padding: 0 5px;
  }

  .daily-shelf-row {
    padding: 2px 5px;
  }

  .daily-shelf-name {
    font-size: 10.5px;
  }

  .btn-daily-shelf {
    padding: 0 6px;
    font-size: 10px;
  }

  .btn-dye-nav {
    padding: 0 7px;
    font-size: 10.5px;
  }

  .dye-preview-canvas {
    width: 48px;
    height: 38px;
  }

  .dye-card-name {
    font-size: 10.5px;
  }

  .btn-dye-action {
    font-size: 10px;
    padding: 0 2px;
  }

  .suitcase-canvas {
    max-height: 156px;
  }

  .sticker-badge-chip {
    width: 32px;
    height: 28px;
    font-size: 10px;
  }

  .btn-sticker-action {
    font-size: 10px;
    padding: 0 6px;
  }

  .suitcase-pager {
    gap: 5px;
  }

  .suitcase-pager .btn-pager {
    min-width: 68px;
    padding: 0 10px;
    font-size: 11px;
  }

  .suitcase-pager .pager-info {
    min-width: 58px;
    font-size: 11px;
  }
}

/* ==================== v2.0 上线终版样式（无障碍焦点 / 加载与兜底 / 3列贴纸网格 / 明日预告与补货 / 备份与关于 / 减少动态） ==================== */

/* B4 全局高对比键盘可见焦点 */
:focus-visible {
  outline: 2.5px solid #e0452c;
  outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2.5px solid #e0452c;
  outline-offset: 2px;
}

#gameCanvas {
  touch-action: manipulation;
}

/* R3 首屏轻量加载态与全局温和异常兜底条 */
.boot-loading {
  position: absolute;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(24, 28, 35, 0.88);
  color: #ffffff;
}

.boot-loading-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  font-size: 14px;
  font-weight: 800;
}

.boot-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f28c28;
}

.global-error-bar {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 140;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 24px);
  padding: 8px 12px 8px 16px;
  border-radius: 14px;
  background: #1c2430;
  color: #ffffff;
  border: 2px solid #f28c28;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  font-size: 13px;
  font-weight: 700;
}

.btn-err-reload {
  min-height: 44px;
  min-width: 84px;
  padding: 0 14px;
  border-radius: 10px;
  border: 0;
  background: #e0452c;
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
}

/* 更多页页脚：版本行 + 存档备份 + 关于按钮（>=44px） */
.more-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.more-footer-row .about-version-line {
  margin: 0;
  text-align: left;
}

.more-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-footer-link {
  min-height: 44px;
  min-width: 68px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1.5px solid var(--silver-200);
  background: #f6f8fb;
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.btn-footer-link:hover {
  border-color: var(--ink);
}

/* R1 存档备份与重置弹窗 */
.panel-backup,
.panel-about {
  width: min(760px, 100%);
}

.backup-note {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-soft);
  margin: 0 0 8px;
}

.backup-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.backup-textarea {
  width: 100%;
  min-height: 82px;
  max-height: 120px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--silver-200);
  background: #f8fafc;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.4;
  resize: none;
}

.backup-status {
  padding: 6px 10px;
  border-radius: 8px;
  background: #f3f6fa;
  border: 1px solid var(--silver-200);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
}

.backup-status.is-ok {
  background: #e8f8f0;
  border-color: rgba(47, 133, 90, 0.35);
  color: #1f5c3d;
}

.backup-status.is-warn {
  background: #fff6e8;
  border-color: rgba(217, 119, 6, 0.40);
  color: #8c4a08;
}

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

.btn-backup-act {
  min-height: 44px;
  padding: 0 6px;
  border-radius: 10px;
  border: 1.5px solid var(--silver-200);
  background: #ffffff;
  color: var(--ink);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}

.btn-backup-act.is-primary {
  background: #13161c;
  border-color: #13161c;
  color: #ffffff;
}

.btn-backup-act.is-warn {
  background: #fff4e4;
  border-color: #e69128;
  color: #8c4a08;
}

.btn-backup-act.is-danger {
  background: #fff0ee;
  border-color: #e0452c;
  color: #b8321b;
}

.btn-backup-act.is-confirming {
  background: #e0452c;
  border-color: #e0452c;
  color: #ffffff;
}

/* R5 关于页信息卡 */
.about-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.about-info-card {
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1.5px solid var(--silver-200);
}

.about-card-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 6px;
}

.about-card-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
}

/* 每日小店：明日预告与周日补货架 */
.daily-tomorrow-line {
  margin-top: 4px;
  padding: 4px 8px;
  border-radius: 8px;
  background: #f4f7fa;
  border: 1px dashed rgba(47, 81, 72, 0.28);
  font-size: 11px;
  font-weight: 700;
  color: #2f5148;
  line-height: 1.3;
}

.daily-restock-box {
  margin-top: 5px;
  padding: 5px 7px;
  border-radius: 10px;
  background: #fff8ea;
  border: 1.5px solid rgba(242, 140, 40, 0.45);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.daily-restock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  color: #964908;
}

.daily-restock-head > span:last-child {
  flex-shrink: 0;
  white-space: nowrap;
}

.daily-restock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.daily-restock-name {
  font-size: 11px;
  font-weight: 800;
  color: var(--ink);
  min-width: 0;
}

.daily-restock-btns {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.daily-restock-box.is-empty {
  background: #f3f7f4;
  border-color: rgba(47, 81, 72, 0.24);
}

.daily-restock-empty-msg {
  font-size: 11px;
  font-weight: 700;
  color: #2f5148;
  line-height: 1.35;
}

/* B3 旅行箱贴纸 3 列 × 2 行网格（3 页看完 17 枚）+ 详情操作条 */
.sticker-grid-3col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  width: 100%;
}

.sticker-tile-btn {
  min-height: 52px;
  padding: 4px 5px;
  border-radius: 10px;
  border: 1.5px solid var(--silver-200);
  background: #ffffff;
  color: var(--ink);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  text-align: center;
}

.sticker-tile-btn.is-selected {
  border-color: #e0452c;
  background: #fff7f4;
  box-shadow: 0 0 0 1.5px rgba(224, 69, 44, 0.24);
}

.sticker-tile-btn.is-owned {
  background: #f0faf5;
  border-color: rgba(47, 133, 90, 0.42);
}

.sticker-tile-btn.is-owned.is-selected {
  border-color: #1f7a54;
  box-shadow: 0 0 0 1.5px rgba(31, 122, 84, 0.28);
}

.sticker-tile-tag {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.25;
}

.sticker-tile-name {
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink);
}

.sticker-tile-status {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--silver-600);
}

.sticker-tile-btn.is-owned .sticker-tile-status {
  color: #1f7a54;
}

.sticker-tile-btn.is-buyable .sticker-tile-status {
  color: #c7411c;
}

.sticker-detail-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 10px;
  background: #f8f6f0;
  border: 1.5px solid rgba(47, 81, 72, 0.22);
}

.sticker-detail-info {
  min-width: 0;
  flex: 1;
}

.sticker-detail-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
}

.sticker-detail-sub {
  font-size: 10.5px;
  color: var(--ink-soft);
  line-height: 1.3;
}

.btn-sticker-detail-act {
  min-height: 44px;
  min-width: 82px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1.5px solid var(--silver-200);
  background: #eef1f6;
  color: var(--silver-600);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
  flex-shrink: 0;
  cursor: default;
}

.btn-sticker-detail-act.is-buy {
  background: #e0452c;
  border-color: #e0452c;
  color: #ffffff;
  cursor: pointer;
}

.btn-sticker-detail-act.is-owned {
  background: #e8f8f0;
  border-color: #2f855a;
  color: #1f6b48;
  cursor: pointer;
}

/* 结算页三按钮布局（再来一局 + 存明信片 + 回主页） */
.result-actions {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr 0.8fr;
  gap: 7px;
}

.btn-postcard-save {
  background: #fff7eb;
  border-color: rgba(217, 119, 6, 0.45);
  color: #8c4a08;
  padding: 0 8px;
}

/* 594×368 与矮屏高度下：确保更多页（含44px滑块）、备份页、关于页、贴纸网格、结算页全部 0 滚动 0 裁切 */
@media (max-height: 450px), (max-width: 680px) {
  #moreOverlay .panel-more {
    padding: 7px 10px 6px;
  }

  #moreOverlay .modal-head {
    margin-bottom: 4px;
  }

  #moreOverlay .more-entry-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    margin-bottom: 4px;
  }

  #moreOverlay .btn-more-tile {
    min-height: 44px;
    padding: 2px 5px;
    font-size: 10.5px;
    line-height: 1.2;
  }

  #moreOverlay .more-toggle-row {
    gap: 4px;
    margin-bottom: 4px;
  }

  #moreOverlay .more-volume-grid {
    gap: 4px;
    margin-top: 0;
  }

  #moreOverlay .vol-item {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 6px;
    padding: 0 7px;
    min-height: 44px;
  }

  #moreOverlay .vol-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    font-size: 10px;
    line-height: 1.15;
    white-space: nowrap;
  }

  #moreOverlay .vol-head strong {
    font-size: 10px;
  }

  #moreOverlay .more-audition-row {
    margin-top: 4px;
    padding: 2px 6px;
  }

  #moreOverlay .more-footer-row {
    margin-top: 4px;
  }

  #moreOverlay .btn-footer-link {
    min-height: 44px;
    padding: 0 10px;
    font-size: 11px;
  }

  .backup-note {
    font-size: 10.5px;
    margin-bottom: 4px;
  }

  .backup-textarea {
    min-height: 58px;
    max-height: 76px;
    font-size: 10.5px;
    padding: 6px 8px;
  }

  .backup-status {
    padding: 4px 8px;
    font-size: 10.5px;
  }

  .backup-actions-row {
    gap: 4px;
    margin-top: 5px;
  }

  .btn-backup-act {
    font-size: 10.5px;
    padding: 0 4px;
  }

  .about-card-grid {
    gap: 7px;
  }

  .about-info-card {
    padding: 8px 9px;
  }

  .about-card-title {
    font-size: 11.5px;
    margin-bottom: 3px;
  }

  .about-card-text {
    font-size: 10.5px;
    line-height: 1.38;
  }

  /* 594×368 贴纸页 3×2 网格 + 紧凑操作条 */
  .journal-suitcase-view {
    grid-template-columns: 0.92fr 1.08fr;
    gap: 7px;
  }

  .suitcase-canvas {
    max-height: 146px;
  }

  .suitcase-caption {
    font-size: 10px;
  }

  .sticker-grid-3col {
    gap: 4px;
  }

  .sticker-tile-btn {
    min-height: 46px;
    padding: 2px 3px;
    gap: 1px;
  }

  .sticker-tile-tag {
    font-size: 10px;
    padding: 0 4px;
  }

  .sticker-tile-name {
    font-size: 10px;
  }

  .sticker-tile-status {
    font-size: 10px;
  }

  .sticker-detail-bar {
    margin-top: 4px;
    padding: 4px 6px;
    gap: 5px;
  }

  .sticker-detail-title {
    font-size: 11px;
  }

  .sticker-detail-sub {
    font-size: 10px;
  }

  .btn-sticker-detail-act {
    min-width: 72px;
    font-size: 10.5px;
    padding: 0 7px;
  }

  .daily-tomorrow-line {
    font-size: 10px;
    padding: 3px 6px;
  }

  .journal-unified-pill {
    font-size: 10px;
    padding: 1px 6px;
    white-space: normal;
  }
}

/* 减少动态效果支持（尊重系统偏好与应用内「减少动态」开关） */
@media (prefers-reduced-motion: reduce) {
  .hud-koi,
  .hud-koi.warning,
  .num-pop-a,
  .num-pop-b,
  .combo-pop-a,
  .combo-pop-b,
  .record-flash-a,
  .record-flash-b,
  .ach-toast,
  .milestone-toast,
  .snake-quiz-banner {
    animation: none !important;
    transition: none !important;
  }
}

body.reduced-motion .hud-koi,
body.reduced-motion .hud-koi.warning,
body.reduced-motion .num-pop-a,
body.reduced-motion .num-pop-b,
body.reduced-motion .combo-pop-a,
body.reduced-motion .combo-pop-b,
body.reduced-motion .record-flash-a,
body.reduced-motion .record-flash-b,
body.reduced-motion .ach-toast,
body.reduced-motion .milestone-toast,
body.reduced-motion .snake-quiz-banner {
  animation: none !important;
  transition: none !important;
}
