/* ===== 字体缩放防护 ===== */
html, body, div, p, span, a, button, h1, h2, h3, h4, h5, h6, li, ul {
  -webkit-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
}
html { font-size: 16px; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== 设计 Token（源自既有国风水墨 · 宣纸体系） ===== */
:root {
  /* 纸色 */
  --bg: #faf6ee;
  --bg-2: #f2ecdf;
  --surface: #fffdf7;
  --paper: #f7f1e4;
  /* 墨色 */
  --ink: #3a3028;
  --ink-2: #6b5d4a;
  --ink-3: #94826a;
  /* 金线 */
  --gold: #b8943e;
  --gold-light: #d3b36a;
  --gold-dark: #8b6914;
  /* 印泥朱红 / 青玉绿 */
  --cinnabar: #c41e3a;
  --cinnabar-deep: #9e1730;
  --jade: #3a8c5c;
  /* 辅助色 */
  --amber-warn: #e08020;
  --surface-gold: #fffdf3;
  --gold-on: #ffffff;
  --ink-warm: #6b3a0e;
  --ink-warm-deep: #5c3310;
  /* 分隔线 */
  --line: rgba(139, 105, 20, .16);
  --line-strong: rgba(139, 105, 20, .32);
  /* 字体 */
  --font-display: "Kaiti SC", "STKaiti", "KaiTi", "FangSong", serif;
  --font-song: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Menlo", monospace;
  /* 圆角 / 阴影 */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 3px rgba(58, 40, 20, .07);
  --shadow-md: 0 8px 22px rgba(58, 40, 20, .10);
  --shadow-lg: 0 16px 44px rgba(58, 40, 20, .16);
  --focus-ring: 0 0 0 3px rgba(184, 148, 62, .35);
  --ease: cubic-bezier(.22, .9, .3, 1);
}

body {
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  overflow-x: hidden;
  min-height: 100dvh;
  color: var(--ink);
  background:
    url('/public/images/paper-texture.png') center / 560px repeat,
    linear-gradient(180deg, var(--bg) 0%, var(--bg) 42%, var(--bg-2) 100%);
  background-attachment: fixed;
  background-blend-mode: multiply;
}

/* ===== 金尘粒子（底景呼吸） ===== */
body::before {
  content: '';
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none; z-index: 0;
  background:
    radial-gradient(1px 1px at 10% 12%, rgba(139,105,20,0.18), transparent),
    radial-gradient(1px 1px at 22% 32%, rgba(139,105,20,0.12), transparent),
    radial-gradient(1.2px 1.2px at 38% 52%, rgba(139,105,20,0.15), transparent),
    radial-gradient(0.8px 0.8px at 55% 22%, rgba(139,105,20,0.10), transparent),
    radial-gradient(1.3px 1.3px at 72% 62%, rgba(139,105,20,0.14), transparent),
    radial-gradient(0.9px 0.9px at 88% 42%, rgba(139,105,20,0.12), transparent),
    radial-gradient(1px 1px at 14% 72%, rgba(139,105,20,0.10), transparent),
    radial-gradient(1.1px 1.1px at 48% 82%, rgba(139,105,20,0.15), transparent);
  animation: particleShimmer 18s ease-in-out infinite;
}
@keyframes particleShimmer { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }

/* ===== 容器 ===== */
#app {
  position: relative; z-index: 1;
  max-width: 480px; margin: 0 auto;
  min-height: 100dvh;
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
}

/* ===== 通用组件 ===== */
.page { display: none; flex-direction: column; align-items: center; flex: 1; width: 100%; }
.page.active { display: flex; animation: pageIn .4s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.icon { display: inline-flex; width: 20px; height: 20px; flex: none; }
.icon svg { width: 100%; height: 100%; display: block; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; min-width: 48px; padding: 10px 28px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--gold-dark);
  font-size: 16px; font-weight: 600; letter-spacing: 2px;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), border-color .16s, background .16s;
}
.btn:hover { border-color: var(--gold); }
.btn:active { transform: scale(.96); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn.primary {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border-color: transparent; color: var(--gold-on);
  box-shadow: 0 6px 18px rgba(139, 105, 20, .28);
}
.btn.primary:active { transform: scale(.97); box-shadow: 0 2px 8px rgba(139, 105, 20, .3); }
.btn.primary:focus-visible { box-shadow: var(--focus-ring), 0 6px 18px rgba(139, 105, 20, .28); }
.btn.small { font-size: 14px; padding: 8px 18px; min-height: 42px; letter-spacing: 1px; }
.btn:disabled { opacity: .42; pointer-events: none; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  color: var(--ink-2); font-size: 14px; letter-spacing: 1px;
  padding: 12px 16px; min-height: 44px;
  touch-action: manipulation;
}
.btn-ghost:active { color: var(--gold-dark); }
.btn-ghost:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 999px; }

/* Toast */
.toast {
  position: fixed; top: 9%; left: 50%; transform: translate(-50%, -50%);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  padding: 10px 22px; border-radius: 999px;
  font-size: 14px; letter-spacing: 1px;
  z-index: 999; pointer-events: none;
  animation: toastIn .3s var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -58%) scale(.9); } }

/* Modal */
.modal-overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(58, 40, 20, .5);
  z-index: 100;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; animation: fadeIn .25s var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: linear-gradient(180deg, var(--surface), var(--paper));
  border: 1px solid var(--gold);
  border-radius: 18px;
  padding: 26px 24px 22px;
  max-width: 400px; width: 100%;
  max-height: 82vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  color: var(--ink);
  animation: modalIn .32s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.modal-head { text-align: center; margin-bottom: 14px; }
.modal-seal-mini { width: 34px; height: 34px; margin: 0 auto 6px; display: block; }
.modal-head h3 { font-family: var(--font-display); font-size: 21px; letter-spacing: 5px; color: var(--ink); font-weight: 700; padding-left: 5px; }
.rule-sec { margin-bottom: 12px; }
.rule-sec h4 {
  font-size: 14px; font-weight: 700; color: var(--gold-dark); letter-spacing: 1px;
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 7px;
}
.rule-sec h4::before { content: ''; width: 6px; height: 6px; background: var(--gold); transform: rotate(45deg); flex: none; }
.rule-sec p, .rule-sec li { font-size: 13.5px; line-height: 1.85; color: var(--ink-2); }
.rule-sec ul { padding-left: 18px; }
.modal-box .btn { margin: 18px auto 0; width: fit-content; display: flex; }
/* 答错满 3 次 · 失败提示 */
.fail-box { text-align: center; padding: 28px 24px 24px; }
.fail-desc { font-size: 14.5px; color: var(--ink-2); letter-spacing: 1px; line-height: 1.8; }

/* 头像 */
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover; display: block;
  background: var(--paper);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
}
.avatar.xs { width: 26px; height: 26px; font-size: 13px; }
.avatar.sm { width: 32px; height: 32px; font-size: 15px; }
.avatar.md { width: 42px; height: 42px; font-size: 19px; }
.avatar.is-initial {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); color: var(--surface);
  background: linear-gradient(145deg, var(--gold-dark), var(--gold));
}
.me-tag {
  display: inline-block; margin-left: 6px;
  font-size: 10px; color: var(--cinnabar);
  border: 1px solid var(--cinnabar); border-radius: 3px;
  padding: 1px 4px; vertical-align: 1px;
  font-family: var(--font-display); letter-spacing: 1px;
}

/* ===== 加载页 ===== */
.loading-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; gap: 22px; }
.loading-seal {
  width: 68px; height: 68px;
  font-family: var(--font-display);
  font-size: 38px; font-weight: bold; color: var(--cinnabar);
  border: 3px solid var(--cinnabar);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  opacity: .9;
  animation: sealPulse 1.6s ease-in-out infinite;
}
@keyframes sealPulse { 0%, 100% { opacity: .55; transform: scale(.96); } 50% { opacity: 1; transform: scale(1); } }
.loading-bar { width: 120px; height: 3px; border-radius: 3px; background: rgba(139, 105, 20, .15); overflow: hidden; }
.loading-bar span { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, var(--gold-dark), var(--gold-light)); border-radius: 3px; animation: loadingSlide 1.1s ease-in-out infinite; }
@keyframes loadingSlide { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }
.loading-wrap p { color: var(--ink-3); font-size: 13px; letter-spacing: 2px; }

/* ===== 非微信页 ===== */
.not-wechat-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; text-align: center; gap: 14px; padding: 24px; }
.not-wechat-wrap .icon { color: var(--gold); }
.not-wechat-wrap p { color: var(--ink-2); font-size: 15px; line-height: 1.8; }
.not-wechat-wrap .sub { font-size: 12px; color: var(--ink-3); }

/* ===== 首页 ===== */
.home-wrap { width: 100%; }
.home-userbar {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 4px 4px 16px;
}
.user-meta { flex: 1; min-width: 0; }
.user-greet { font-size: 16px; font-weight: 600; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-greet b { font-family: var(--font-display); font-weight: 700; color: var(--gold-dark); }
.user-sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.home-main {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; align-items: center;
  padding-top: 40px; width: 100%;
}
.home-seal {
  width: 64px; height: 64px; margin-bottom: 14px;
  animation: sealAppear .7s cubic-bezier(.34, 1.56, .64, 1) both;
  filter: drop-shadow(0 2px 4px rgba(158, 23, 48, .18));
}
@keyframes sealAppear {
  0% { opacity: 0; transform: scale(.3) rotate(-14deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
.home-title {
  font-family: var(--font-display);
  font-size: 42px; font-weight: 700; letter-spacing: 8px;
  background: linear-gradient(180deg, var(--ink-warm), var(--gold-dark) 42%, var(--ink-warm-deep));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  line-height: 1.12; margin-top: 4px;
}
.home-subtitle {
  font-family: var(--font-display);
  font-size: 22px; letter-spacing: 14px;
  color: var(--ink-2);
  margin-top: 2px; padding-left: 14px;
}
.home-cloud { width: 200px; height: 16px; margin: 12px 0 14px; opacity: .65; }
.home-cloud img { width: 100%; height: 100%; display: block; }

/* 卷轴入口 */
.home-scroll-btn {
  position: relative; width: 216px;
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center;
  margin: 2px 0 20px;
  touch-action: manipulation;
  transition: transform .2s var(--ease);
}
.home-scroll-btn:active { transform: scale(.96); }
.home-scroll-btn.is-locked { opacity: .55; }
.home-scroll-btn.is-locked .scroll-text { color: var(--ink-2); }
.home-scroll-btn:focus-visible { outline: none; }
.home-scroll-btn:focus-visible .scroll-face { box-shadow: var(--focus-ring); }
.scroll-rod {
  width: 100%; height: 11px; border-radius: 6px; position: relative; flex: none;
  background: linear-gradient(180deg, var(--gold-dark), var(--gold-light) 45%, var(--gold-dark));
  box-shadow: 0 2px 5px rgba(58, 40, 20, .28), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.scroll-rod::after {
  content: ''; position: absolute; left: 4%; right: 4%; top: 50%; height: 1px;
  background: rgba(139, 105, 20, .45);
}
.scroll-face {
  width: 172px; padding: 12px 0;
  border-left: 3px solid rgba(184, 148, 62, .4);
  border-right: 3px solid rgba(184, 148, 62, .4);
  background: linear-gradient(180deg, rgba(139, 105, 20, .10), rgba(139, 105, 20, .03));
  text-align: center;
  transition: box-shadow .2s;
}
.scroll-text {
  font-family: var(--font-display);
  font-size: 21px; letter-spacing: 5px; font-weight: 700; color: var(--ink);
  padding-left: 5px; white-space: nowrap;
}
.home-scroll-btn:hover .scroll-face { box-shadow: 0 0 0 3px rgba(184, 148, 62, .12); }

.home-actions { display: flex; gap: 10px; margin-bottom: 18px; }
.home-action-btn {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  background: none; border: none; cursor: pointer; padding: 6px 14px;
  color: var(--ink-2); font-size: 12.5px; letter-spacing: 1px;
  border-radius: 12px; touch-action: manipulation;
  transition: color .18s;
}
.home-action-btn:active { color: var(--gold-dark); }
.home-action-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.home-action-btn .icon-circle {
  width: 46px; height: 46px; border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-dark);
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.home-action-btn:active .icon-circle { transform: scale(.94); border-color: var(--gold); box-shadow: 0 0 0 4px rgba(184, 148, 62, .14); }
.home-action-btn .label { font-size: 12.5px; letter-spacing: 1px; }

/* 山水底景：按原图比例（750:500 = 3:2）整幅显示，不裁切、不变形；
   不加边框/圆角/阴影，避免出现视觉框；超宽屏用 max-height 兜底 */
.home-hero {
  width: 100vw; flex: none;
  aspect-ratio: 3 / 2;
  max-height: 40vh;
  margin: auto calc(-50vw + 50%) calc(-16px - env(safe-area-inset-bottom));
  background: url('/public/images/bg-hero.png') center / cover no-repeat;
}

/* ===== 闯关页 ===== */
.game-wrap { width: 100%; }
.game-header {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 4px 0 10px;
}
.game-level-chip {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 700; letter-spacing: 2px;
  color: var(--gold-dark);
  background: rgba(184, 148, 62, .12);
  border: 1px solid rgba(184, 148, 62, .3);
  padding: 5px 12px; border-radius: 999px;
}
.game-total { font-size: 12px; color: var(--ink-3); letter-spacing: 1px; }
.game-timer {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 26px; font-weight: 600; color: var(--gold-dark);
  font-variant-numeric: tabular-nums; letter-spacing: 1px;
}

.game-progress { display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 12px; }
.game-progress-track { flex: 1; height: 8px; border-radius: 999px; background: rgba(139, 105, 20, .12); position: relative; }
.game-progress-fill {
  height: 100%; min-width: 10px; border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
  position: relative;
  transition: width .5s var(--ease);
}
.game-progress-seal {
  position: absolute; right: -3px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; border-radius: 3px;
  background: var(--cinnabar);
  box-shadow: 0 0 0 3px rgba(196, 30, 58, .18);
}
.game-progress-pct { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; width: 34px; text-align: right; }

.game-stats { display: flex; gap: 10px; width: 100%; margin-bottom: 14px; }
.stat-chip {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 13px; color: var(--ink-2); letter-spacing: .5px;
}
.stat-chip b { font-size: 15px; font-variant-numeric: tabular-nums; margin-left: 2px; }
.stat-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.stat-dot.jade { background: var(--jade); box-shadow: 0 0 0 3px rgba(58, 140, 92, .14); }
.stat-dot.warn { background: var(--amber-warn); box-shadow: 0 0 0 3px rgba(224, 128, 32, .16); }
.stat-dot.cinnabar { background: var(--cinnabar); box-shadow: 0 0 0 3px rgba(196, 30, 58, .14); }

/* 卡片网格 */
.card-grid { display: grid; gap: 11px; width: 100%; justify-content: center; }
.card-grid.cols2 { grid-template-columns: repeat(2, 1fr); }
.card-grid.cols3 { grid-template-columns: repeat(3, 1fr); }
.card-grid.cols4 { grid-template-columns: repeat(4, 1fr); }

.game-card {
  position: relative;
  aspect-ratio: 1 / 1;
  background:
    url('/public/images/paper-texture.png') center / 220px repeat,
    linear-gradient(180deg, var(--surface), var(--paper));
  background-blend-mode: multiply;
  border: 1.5px solid rgba(139, 105, 20, .22);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .5);
  cursor: pointer;
  touch-action: manipulation;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease), opacity .3s;
}
.game-card::before {
  content: ''; position: absolute; top: 7px; left: 7px; width: 7px; height: 7px;
  border-top: 1.5px solid rgba(139, 105, 20, .3); border-left: 1.5px solid rgba(139, 105, 20, .3);
  border-top-left-radius: 2px;
}
.game-card::after {
  content: ''; position: absolute; bottom: 7px; right: 7px; width: 7px; height: 7px;
  border-bottom: 1.5px solid rgba(139, 105, 20, .3); border-right: 1.5px solid rgba(139, 105, 20, .3);
  border-bottom-right-radius: 2px;
}
.game-card:active { transform: scale(.96); }
.game-card:focus-visible { outline: none; }
.game-card .card-inner {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 8px;
  font-family: var(--font-song);
  font-weight: 600; color: var(--ink);
  line-height: 1.32; letter-spacing: 1px;
  overflow-wrap: anywhere; word-break: keep-all;
}
.game-card .card-inner.size-m { font-size: 17px; }
.game-card .card-inner.size-l { font-size: 14px; }
.game-card .card-inner.size-xl { font-size: 11.5px; }

.game-card.selected {
  border-color: var(--gold);
  transform: translateY(-3px) scale(1.03);
  box-shadow: var(--shadow-md), 0 0 0 3px rgba(184, 148, 62, .16);
}
.game-card.selected::before, .game-card.selected::after { border-color: var(--cinnabar); }

.game-card.match-success { animation: cardGlow .5s var(--ease); }
@keyframes cardGlow {
  0% { box-shadow: 0 0 0 0 rgba(58, 140, 92, 0); }
  40% { box-shadow: 0 0 0 5px rgba(58, 140, 92, .28); border-color: var(--jade); }
  100% { box-shadow: 0 0 0 0 rgba(58, 140, 92, 0); border-color: rgba(139, 105, 20, .22); }
}
.game-card.match-fail { animation: cardShake .5s var(--ease); border-color: var(--cinnabar) !important; }
@keyframes cardShake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-6px); }
  30% { transform: translateX(6px); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
  90% { transform: translateX(2px); }
}

/* 卡片入场（仅新关卡首帧） */
.card-grid.enter .game-card { animation: cardIn .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 26ms); }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px) scale(.92); }
  to { opacity: 1; transform: none; }
}

/* 已消除占位 */
.card-placeholder {
  position: relative; aspect-ratio: 1 / 1;
  border: 1px dashed rgba(139, 105, 20, .22);
  border-radius: var(--radius-sm);
  background: rgba(139, 105, 20, .04);
  display: flex; align-items: center; justify-content: center;
}
.card-placeholder::after {
  content: ''; width: 13px; height: 13px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(184, 148, 62, .6), rgba(184, 148, 62, .12));
}

.game-quit-btn { margin-top: 16px; }

/* 关卡过场 */
.level-transition {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(42, 32, 20, .55);
  z-index: 80;
  align-items: center; justify-content: center;
  padding: 24px;
}
.level-transition.active { display: flex; animation: fadeIn .3s var(--ease); }
.lt-card {
  background: linear-gradient(180deg, var(--surface), var(--paper));
  border: 1px solid var(--gold);
  border-radius: 20px;
  padding: 30px 34px 26px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 320px;
  animation: modalIn .35s var(--ease);
}
.lt-seal {
  width: 70px; height: 62px; margin: 0 auto 14px;
  color: var(--surface);
  font-family: var(--font-display);
  font-size: 19px; font-weight: bold; letter-spacing: 3px;
  background: var(--cinnabar);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(196, 30, 58, .3);
  animation: sealAppear .5s cubic-bezier(.34, 1.56, .64, 1) both;
}
.lt-title { font-family: var(--font-display); font-size: 24px; letter-spacing: 3px; color: var(--ink); font-weight: 700; margin-bottom: 6px; }
.lt-next { font-size: 13.5px; color: var(--ink-2); letter-spacing: .5px; }
.lt-dots { display: flex; justify-content: center; gap: 7px; margin-top: 16px; }
.lt-dots .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.lt-dots .dot.done { background: var(--gold); box-shadow: 0 0 0 3px rgba(184, 148, 62, .15); }

/* ===== 结算页 ===== */
.result-wrap { width: 100%; padding-top: 6px; gap: 14px; }
.result-hero { display: flex; flex-direction: column; align-items: center; }
.result-seal { width: 64px; height: 64px; animation: sealAppear .6s cubic-bezier(.34, 1.56, .64, 1) both; margin-bottom: 10px; }
.result-title { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: 6px; color: var(--ink); padding-left: 6px; }
.result-sub { font-size: 13px; color: var(--ink-3); letter-spacing: 2px; margin-top: 5px; }
.result-time-box {
  background: linear-gradient(180deg, var(--surface), var(--paper));
  border: 1.5px solid var(--gold);
  border-radius: 18px;
  padding: 16px 40px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.result-time-label { font-size: 12px; color: var(--ink-3); letter-spacing: 3px; margin-bottom: 4px; }
.result-time-value { font-family: var(--font-mono); font-size: 40px; font-weight: 600; color: var(--gold-dark); font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.result-stats { display: flex; gap: 10px; width: 100%; }
.stat-card {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
}
.stat-num { display: block; font-family: var(--font-mono); font-size: 20px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-label { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 3px; letter-spacing: 1px; }
.result-levels { width: 100%; }
.result-levels-head { font-size: 12px; color: var(--ink-3); letter-spacing: 2px; text-align: center; margin-bottom: 6px; }
.level-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.level-badge {
  font-size: 12px; padding: 3px 9px; border-radius: 999px;
  background: rgba(58, 140, 92, .13); color: var(--jade);
  font-variant-numeric: tabular-nums;
}
.result-rank-line { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; color: var(--gold-dark); font-weight: 600; letter-spacing: .5px; }
.result-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ===== 排行榜 ===== */
.leaderboard-wrap { width: 100%; }
.lb-header { text-align: center; padding: 6px 0 4px; }
.lb-title { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: 5px; color: var(--ink); padding-left: 5px; }
.lb-sub { font-size: 12px; color: var(--ink-3); letter-spacing: 1.5px; margin-top: 4px; }
/* 排行榜 · 横排列表（头像上方冠名次，昵称、通关时间横排） */
.lb-list { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 6px; }
.lb-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
}
.lb-row.first { border-color: rgba(184, 148, 62, .45); background: linear-gradient(90deg, var(--surface-gold), var(--surface)); }
.lb-row.is-me { outline: 1.5px solid var(--cinnabar); outline-offset: -1.5px; }
.lb-rank-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 60px; flex: none; }
.lb-rank-title {
  font-family: var(--font-display); font-size: 11.5px; letter-spacing: 1px;
  color: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  padding: 2px 8px; border-radius: 4px;
  background: var(--ink-3);
}
.lb-row.first .lb-rank-title { background: var(--cinnabar); }
.lb-row.second .lb-rank-title { background: var(--gold-dark); }
.lb-row.third .lb-rank-title { background: var(--jade); }
.lb-row-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row-time { flex: none; font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.lb-myrank { text-align: center; font-size: 14px; color: var(--ink-2); margin: 14px 0 2px; letter-spacing: .5px; }
.lb-myrank b { color: var(--gold-dark); font-weight: 700; }
.lb-back-row { display: flex; justify-content: center; margin-top: 12px; }

/* ===== 响应式 ===== */
@media (max-width: 380px) {
  #app { padding: 10px 12px; }
  .home-title { font-size: 34px; letter-spacing: 6px; }
  .home-subtitle { font-size: 19px; letter-spacing: 10px; }
  .home-scroll-btn { width: 192px; }
  .scroll-face { width: 152px; }
  .scroll-text { font-size: 18px; letter-spacing: 4px; }
  .home-cloud { width: 170px; }
  .card-grid { gap: 8px; }
  .game-card .card-inner.size-m { font-size: 15px; }
  .game-card .card-inner.size-l { font-size: 12.5px; }
  .game-card .card-inner.size-xl { font-size: 10.5px; }
  .game-timer { font-size: 22px; }
  .result-time-value { font-size: 34px; }
  .btn.primary { font-size: 18px; padding: 12px 32px; }
  .lb-row { padding: 8px 10px; }
}
