/* ============================================================
 * 迷宫回信 —— 移动端主题（雾 · 信 · 迷宫）
 * ============================================================ */
:root {
  --bg: #0d0f1e;
  --card: rgba(255, 255, 255, .055);
  --border: rgba(255, 255, 255, .12);
  --text: #eef0ff;
  --muted: #9aa0c3;
  --acc1: #8b5cf6;
  --acc2: #22d3ee;
  --gold: #fbbf24;
  --grad: linear-gradient(135deg, var(--acc1), var(--acc2));
  /* 衬线字体：迷宫古卷 / 回信质感（在线加载失败时退回系统宋体） */
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  /* 结局主题色（结局页按 data-ending 覆写） */
  --th-a: var(--acc1);
  --th-b: var(--acc2);
  --th-glow: rgba(139, 92, 246, .5);
  /* 测试场景色（随迷宫深入按 data-scene 覆写：紫→青→血红→暖金） */
  --qs-a: #a78bfa;
  --qs-b: #fbbf24;
  --qs-rgb: 167, 139, 250;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  min-height: 100vh;
  /* 背景光随 --qs-rgb 变化（测试时 JS 按当前题目实时覆写该变量） */
  background:
    radial-gradient(920px 640px at 80% -10%, rgba(var(--qs-rgb), .22), transparent 62%),
    radial-gradient(740px 520px at 8% 85%, rgba(var(--qs-rgb), .1), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

/* ---------- 雾气氛围层 ---------- */
.fog {
  position: fixed; z-index: 0; pointer-events: none;
  width: 130vmax; height: 130vmax; border-radius: 50%;
  opacity: .05; filter: blur(60px);
}
.fog-a {
  top: -55vmax; left: -45vmax;
  background: radial-gradient(circle, #8b5cf6 0%, transparent 62%);
  animation: fogDrift 26s ease-in-out infinite alternate;
}
.fog-b {
  bottom: -60vmax; right: -50vmax;
  background: radial-gradient(circle, #22d3ee 0%, transparent 62%);
  animation: fogDrift 34s ease-in-out infinite alternate-reverse;
}
@keyframes fogDrift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(9vmax, 6vmax) scale(1.18); }
}

/* 结局模式：全局背景染上结局主题色 */
body[data-ending] { transition: background 1.4s ease; }

#app { max-width: 520px; margin: 0 auto; padding: 0 20px 48px; }

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.center { text-align: center; }

/* ---------- 屏幕切换 ---------- */
.screen { display: none; }
.screen.active { display: block; animation: screenIn .4s ease both; }
@keyframes screenIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; cursor: pointer; user-select: none;
  font-size: 15px; font-weight: 600; color: var(--text);
  padding: 13px 18px; border-radius: 14px;
  transition: transform .15s ease, box-shadow .2s ease, opacity .2s;
  font-family: inherit;
}
.btn:active { transform: scale(.96); }

.btn.primary {
  background: var(--grad);
  box-shadow: 0 10px 26px rgba(139, 92, 246, .35);
}
.btn.xl { width: 100%; font-size: 17px; padding: 16px; margin-top: 26px; }

.btn.ghost {
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  color: var(--text); flex: 1;
}
.btn.danger {
  width: 100%; margin-top: 28px;
  background: rgba(239, 68, 68, .1);
  border: 1px solid rgba(239, 68, 68, .4);
  color: #fca5a5; font-weight: 500;
}

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); font-size: 17px; cursor: pointer;
  transition: transform .15s;
}
.icon-btn:active { transform: scale(.92); }

/* 测试页「上一题」按钮（位于题目下方，居中） */
.back-btn {
  display: block; margin: 26px auto 0; padding: 9px 18px; border-radius: 999px; cursor: pointer;
  background: var(--card); border: 1px solid var(--border);
  color: var(--muted); font-size: 13.5px; font-family: inherit;
  transition: transform .15s, color .2s;
}
.back-btn:active { transform: scale(.94); color: var(--text); }

.link-row { display: flex; gap: 12px; margin-top: 14px; }
.btn-col { margin-top: 26px; }
.btn-col .link-row { margin-top: 14px; }

/* ---------- 首页 ---------- */
.hero { padding: 68px 4px 24px; text-align: center; }
.hero-emoji { font-size: 64px; animation: float 3.4s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}
/* 迷宫描边动画：像有人在为你画出这条路 */
.maze-path {
  stroke-dasharray: 460;
  stroke-dashoffset: 460;
  animation: mazeDraw 2.8s ease-out .3s forwards;
}
@keyframes mazeDraw { to { stroke-dashoffset: 0; } }

.hero-title {
  margin-top: 18px;
  font-family: var(--serif);
  font-size: 34px; font-weight: 900; letter-spacing: 10px; text-indent: 10px;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: fadeUp .9s ease .5s both;
}
.hero-sub {
  margin-top: 14px; color: var(--muted); font-size: 15px; line-height: 1.9;
  font-family: var(--serif); letter-spacing: 1px;
  animation: fadeUp .9s ease .8s both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: none; }
}

.chip-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip {
  font-size: 12.5px; color: #cdd3f5; padding: 6px 13px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border);
}

.stat-row { display: flex; gap: 10px; margin-top: 26px; }
.stat {
  flex: 1; padding: 14px 6px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 5px;
}
.stat b { font-size: 19px; }
.stat span { font-size: 12px; color: var(--muted); }

/* ---------- 测试页（配色随场景变化）---------- */
.quiz-top { display: flex; align-items: center; justify-content: flex-end; padding-top: 20px; }
.q-count { font-size: 13px; color: var(--muted); letter-spacing: 1px; }

/* 场景漂浮图标层 */
.scene-deco { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.scene-deco span {
  position: absolute; opacity: .12; line-height: 1;
  text-shadow: 0 0 18px rgba(var(--qs-rgb), .55);
  animation: decoFloat 7s ease-in-out infinite;
}
@keyframes decoFloat {
  0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); opacity: .1; }
  50% { transform: translateY(-14px) rotate(var(--rot, 0deg)); opacity: .2; }
}

.progress-track {
  height: 7px; border-radius: 99px; margin: 16px 0 22px;
  background: rgba(255, 255, 255, .08); overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, var(--qs-a), var(--qs-b));
  box-shadow: 0 0 12px rgba(var(--qs-rgb), .6);
  transition: width .45s cubic-bezier(.22, 1, .36, 1);
  position: relative; overflow: hidden;
}
/* 进度条流光：像火把在甬道里移动 */
.progress-fill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: torch 2.2s ease-in-out infinite;
}
@keyframes torch {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}

.q-card {
  background: var(--card);
  border: 1px solid rgba(var(--qs-rgb), .3);
  border-radius: 22px; padding: 26px 22px 18px;
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .32), 0 0 36px rgba(var(--qs-rgb), .12);
  transition: border-color 1s ease, box-shadow 1s ease;
}
.q-card.anim { animation: slideIn .42s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes slideIn {
  from { opacity: 0; transform: translateY(22px) scale(.97); filter: blur(3px); }
  to   { opacity: 1; transform: none; filter: none; }
}

.q-scene {
  display: inline-block; font-size: 11.5px; letter-spacing: 3px; color: var(--qs-a);
  padding: 4px 12px; border-radius: 999px; margin-bottom: 16px;
  background: rgba(var(--qs-rgb), .12); border: 1px solid rgba(var(--qs-rgb), .4);
  transition: all 1s ease;
}
.q-text {
  font-family: var(--serif);
  font-size: 20px; font-weight: 600; line-height: 1.7; min-height: 100px; letter-spacing: .5px;
}

.opts { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.opt {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  padding: 15px 16px; border-radius: 16px; cursor: pointer;
  background: rgba(255, 255, 255, .04);
  border: 1.5px solid var(--border);
  color: var(--text); font-size: 15.5px; line-height: 1.55; font-family: inherit;
  transition: border-color .2s, background .2s, transform .12s, box-shadow .25s;
}
.opt:active { transform: scale(.98); }
@media (hover: hover) {
  .opt:hover { border-color: rgba(var(--qs-rgb), .55); background: rgba(var(--qs-rgb), .08); }
}
.opt-badge {
  width: 30px; height: 30px; flex: none; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: var(--muted);
  background: rgba(255, 255, 255, .07); border: 1px solid var(--border);
  transition: all .2s;
}
.opt.selected {
  border-color: var(--qs-a);
  background: rgba(var(--qs-rgb), .13);
  animation: optPulse .5s ease;
}
@keyframes optPulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--qs-rgb), .5); }
  100% { box-shadow: 0 0 0 14px rgba(var(--qs-rgb), 0); }
}
.opt.selected .opt-badge {
  background: linear-gradient(135deg, var(--qs-a), var(--qs-b)); color: #fff; border-color: transparent;
  box-shadow: 0 0 10px rgba(var(--qs-rgb), .55);
}

/* ---------- 结局页（主题随结局变化）---------- */
.trait-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 18px 4px 6px; }
.trait-chip {
  font-size: 12.5px; padding: 7px 14px; border-radius: 999px; letter-spacing: .5px;
  color: #eef0ff;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--th-b);
  box-shadow: 0 0 12px var(--th-glow);
  animation: fadeUp .7s ease both;
}
.trait-chip:nth-child(2) { animation-delay: .12s; }
.trait-chip:nth-child(3) { animation-delay: .24s; }

.result-head { text-align: center; padding: 52px 4px 10px; position: relative; }
/* 结局图标：弹入 + 主题色光晕 + 呼吸 */
.result-emoji {
  font-size: 78px; line-height: 1;
  animation: emojiIn .7s cubic-bezier(.18, 1.2, .4, 1) both;
  position: relative;
  filter: drop-shadow(0 0 22px var(--th-glow));
}
.result-emoji::after {
  content: ""; position: absolute; left: 50%; top: 50%; z-index: -1;
  width: 150px; height: 150px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--th-glow) 0%, transparent 65%);
  opacity: .55;
  animation: auraBreath 3.2s ease-in-out infinite;
}
@keyframes emojiIn {
  from { opacity: 0; transform: scale(.3) rotate(-8deg); }
  to   { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes auraBreath {
  0%, 100% { opacity: .4; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: .75; transform: translate(-50%, -50%) scale(1.15); }
}

.result-kicker {
  margin-top: 20px; font-size: 12px; letter-spacing: 6px; color: var(--muted);
  animation: fadeUp .7s ease .15s both;
}
.result-title {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: 36px; font-weight: 900; letter-spacing: 8px; text-indent: 8px;
  background: linear-gradient(135deg, var(--th-a), var(--th-b) 70%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 0 18px var(--th-glow));
  animation: fadeUp .8s ease .3s both;
}
.result-tagline {
  margin-top: 12px; color: var(--muted); font-size: 14.5px; font-style: italic;
  font-family: var(--serif); letter-spacing: 1px; min-height: 22px;
  animation: fadeUp .8s ease .45s both;
}

.tag-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.tag {
  font-size: 12.5px; padding: 6px 13px; border-radius: 999px;
  background: rgba(34, 211, 238, .1); border: 1px solid rgba(34, 211, 238, .35); color: #a5e6f5;
}
.combo-code {
  margin-top: 14px; font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px; letter-spacing: 3px; color: var(--muted);
}

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; padding: 20px 18px; margin-top: 16px;
  backdrop-filter: blur(12px);
}
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 16px; }

.dim-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.dim-row:last-child { margin-bottom: 2px; }
.dim-name { width: 66px; flex: none; font-size: 12px; color: var(--muted); text-align: center; }
.dim-name:first-child { text-align: right; }
.dim-name:last-child { text-align: left; }
.dim-bar { flex: 1; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.dim-fill {
  height: 100%; border-radius: 99px; background: var(--grad);
  transition: width 1s cubic-bezier(.22, 1, .36, 1);
}

.result-desc { font-size: 14.5px; line-height: 2; color: #d6daf5; }

/* 成就卡片 */
.ach-card {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px; border-radius: 16px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--border);
  margin-bottom: 10px;
}
.ach-card.got { border-color: rgba(251, 191, 36, .4); background: rgba(251, 191, 36, .06); }
.ach-card.locked { opacity: .55; }
.ach-icon { font-size: 26px; flex: none; margin-top: 2px; }
.ach-name { font-size: 15px; font-weight: 700; }
.ach-name .new-badge {
  font-style: normal; font-size: 10px; color: #0d0f1e; margin-left: 6px;
  background: var(--gold); border-radius: 6px; padding: 2px 6px; vertical-align: 2px;
}
.ach-desc { margin-top: 4px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.ach-date { margin-top: 5px; font-size: 11px; color: rgba(154, 160, 195, .6); }

/* ---------- 图鉴页 ---------- */
.page-top { display: flex; align-items: center; gap: 14px; padding: 22px 0 18px; }
.page-title { font-size: 21px; font-weight: 800; }

.tabs {
  display: flex; gap: 6px; padding: 5px; border-radius: 14px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--border);
  margin-bottom: 18px;
}
.tab {
  flex: 1; padding: 10px; border: none; border-radius: 10px; cursor: pointer;
  background: transparent; color: var(--muted); font-size: 14px; font-weight: 600;
  font-family: inherit; transition: all .2s;
}
.tab.active { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(139, 92, 246, .35); }
.tab span { font-size: 11.5px; opacity: .85; }

.list { display: flex; flex-direction: column; gap: 0; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.end-card {
  border-radius: 18px; padding: 18px 12px; text-align: center;
  background: var(--card); border: 1px solid var(--border);
}
.end-card.got { border-color: rgba(251, 191, 36, .45); background: rgba(251, 191, 36, .05); }
.end-card.locked { opacity: .5; }
.end-icon { font-size: 34px; }
.end-name { margin-top: 10px; font-size: 14.5px; font-weight: 700; }
.end-tag { margin-top: 6px; font-size: 11.5px; color: var(--muted); line-height: 1.6; }

.page-tip { margin-top: 20px; text-align: center; font-size: 12px; color: var(--muted); }

/* ---------- 历史页 ---------- */
.run-item {
  display: flex; align-items: center; gap: 13px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 14px 15px; margin-bottom: 11px;
}
.run-icon { font-size: 28px; flex: none; }
.run-main { flex: 1; min-width: 0; }
.run-title { font-size: 15px; font-weight: 700; }
.run-meta { margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.run-achs { display: flex; gap: 4px; font-size: 16px; flex: none; }
.empty-tip { text-align: center; color: var(--muted); font-size: 13.5px; padding: 40px 10px; line-height: 2; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 44px; transform: translateX(-50%) translateY(20px);
  background: rgba(20, 24, 48, .92); border: 1px solid var(--border);
  color: var(--text); font-size: 13.5px; padding: 11px 22px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: all .3s ease; z-index: 99;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
 * 结局专属主题：每个结局一套配色 / 背景 / 图标专属动画
 * ============================================================ */

/* 🛡 骑士 · 钢蓝剑光 */
body[data-ending="knight"] {
  --th-a: #bae6fd; --th-b: #38bdf8; --th-glow: rgba(56, 189, 248, .5);
  background:
    radial-gradient(900px 600px at 50% -10%, rgba(56, 189, 248, .22), transparent 60%),
    radial-gradient(700px 500px at 100% 80%, rgba(125, 211, 252, .1), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
[data-ending="knight"] .result-emoji { animation: emojiIn .7s cubic-bezier(.18,1.2,.4,1) both, knightSlash 2.8s ease-in-out 1.2s infinite; }
@keyframes knightSlash {
  0%, 100% { transform: rotate(0); filter: drop-shadow(0 0 22px var(--th-glow)); }
  12% { transform: rotate(-14deg) scale(1.06); filter: drop-shadow(0 0 34px rgba(186,230,253,.9)); }
  24% { transform: rotate(6deg); }
}

/* 🕯 圣人 · 烛光暖金 */
body[data-ending="saint"] {
  --th-a: #fde68a; --th-b: #f59e0b; --th-glow: rgba(245, 158, 11, .45);
  background:
    radial-gradient(800px 550px at 50% 0%, rgba(245, 158, 11, .2), transparent 60%),
    radial-gradient(600px 450px at 20% 90%, rgba(253, 230, 138, .08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
[data-ending="saint"] .result-emoji { animation: emojiIn .7s cubic-bezier(.18,1.2,.4,1) both, candleSway 3.6s ease-in-out 1s infinite; }
@keyframes candleSway {
  0%, 100% { transform: rotate(-2.5deg) translateY(0); }
  50% { transform: rotate(2.5deg) translateY(-5px); }
}

/* 🗡 暴怒 · 血红震颤 */
body[data-ending="rage"] {
  --th-a: #fecaca; --th-b: #ef4444; --th-glow: rgba(239, 68, 68, .5);
  background:
    radial-gradient(900px 600px at 50% -5%, rgba(239, 68, 68, .24), transparent 62%),
    radial-gradient(600px 450px at 85% 85%, rgba(127, 29, 29, .22), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
[data-ending="rage"] .result-emoji { animation: emojiIn .7s cubic-bezier(.18,1.2,.4,1) both, rageShake 2.6s ease-in-out 1.1s infinite; }
@keyframes rageShake {
  0%, 86%, 100% { transform: translate(0, 0); }
  88% { transform: translate(-4px, 1px) rotate(-3deg); }
  92% { transform: translate(4px, -1px) rotate(3deg); }
  96% { transform: translate(-3px, 2px) rotate(-2deg); }
}

/* 📏 守序 · 冷青刻度 */
body[data-ending="order"] {
  --th-a: #99f6e4; --th-b: #2dd4bf; --th-glow: rgba(45, 212, 191, .42);
  background:
    radial-gradient(850px 580px at 50% -8%, rgba(45, 212, 191, .18), transparent 60%),
    radial-gradient(650px 460px at 0% 75%, rgba(153, 246, 228, .07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
[data-ending="order"] .result-emoji { animation: emojiIn .7s cubic-bezier(.18,1.2,.4,1) both, float 3.4s ease-in-out 1s infinite; }

/* 🌀 圆圈 · 迷雾紫旋转 */
body[data-ending="loop"] {
  --th-a: #d8b4fe; --th-b: #a855f7; --th-glow: rgba(168, 85, 247, .5);
  background:
    radial-gradient(900px 620px at 50% -5%, rgba(168, 85, 247, .22), transparent 62%),
    radial-gradient(720px 500px at 90% 78%, rgba(216, 180, 254, .1), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
[data-ending="loop"] .result-emoji { animation: emojiIn .7s cubic-bezier(.18,1.2,.4,1) both, loopSpin 5.5s linear 1s infinite; }
@keyframes loopSpin {
  from { transform: rotate(0) translateY(0); }
  50% { transform: rotate(180deg) translateY(-8px); }
  to { transform: rotate(360deg) translateY(0); }
}

/* 👻 幽灵 · 幽绿明灭 */
body[data-ending="ghost"] {
  --th-a: #a7f3d0; --th-b: #34d399; --th-glow: rgba(52, 211, 153, .4);
  background:
    radial-gradient(880px 600px at 50% -5%, rgba(52, 211, 153, .17), transparent 62%),
    radial-gradient(680px 480px at 15% 82%, rgba(167, 243, 208, .07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
[data-ending="ghost"] .result-emoji { animation: emojiIn .7s cubic-bezier(.18,1.2,.4,1) both, ghostFlicker 3.8s ease-in-out 1s infinite; }
@keyframes ghostFlicker {
  0%, 100% { opacity: 1; transform: translateY(0); filter: drop-shadow(0 0 22px var(--th-glow)); }
  20% { opacity: .55; transform: translateY(-10px) translateX(6px); }
  45% { opacity: .95; transform: translateY(-3px); }
  70% { opacity: .4; transform: translateY(-14px) translateX(-7px); }
}

/* 🛏 沉眠 · 深夜蓝 */
body[data-ending="sleep"] {
  --th-a: #bfdbfe; --th-b: #3b82f6; --th-glow: rgba(59, 130, 246, .45);
  background:
    radial-gradient(880px 620px at 50% -5%, rgba(59, 130, 246, .2), transparent 62%),
    radial-gradient(700px 500px at 100% 80%, rgba(30, 58, 138, .25), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
[data-ending="sleep"] .result-emoji { animation: emojiIn .7s cubic-bezier(.18,1.2,.4,1) both, sleepSink 5s ease-in-out 1s infinite; }
@keyframes sleepSink {
  0%, 100% { transform: translateY(0) rotate(0); opacity: 1; }
  50% { transform: translateY(9px) rotate(-4deg); opacity: .8; }
}

/* 🪞 镜子 · 银白闪光 */
body[data-ending="mirror"] {
  --th-a: #f8fafc; --th-b: #94a3b8; --th-glow: rgba(226, 232, 240, .45);
  background:
    radial-gradient(880px 600px at 50% -5%, rgba(226, 232, 240, .16), transparent 60%),
    radial-gradient(620px 440px at 12% 78%, rgba(148, 163, 184, .1), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
[data-ending="mirror"] .result-emoji { animation: emojiIn .7s cubic-bezier(.18,1.2,.4,1) both, mirrorShine 3.4s ease-in-out 1s infinite; }
@keyframes mirrorShine {
  0%, 100% { filter: drop-shadow(0 0 22px var(--th-glow)) brightness(1); }
  50% { filter: drop-shadow(0 0 40px rgba(248, 250, 252, .9)) brightness(1.45); }
}

/* 🎪 享乐 · 橙粉暖光 */
body[data-ending="hedon"] {
  --th-a: #fdba74; --th-b: #fb7185; --th-glow: rgba(251, 113, 133, .45);
  background:
    radial-gradient(880px 600px at 50% -5%, rgba(251, 113, 133, .2), transparent 62%),
    radial-gradient(680px 480px at 88% 80%, rgba(253, 186, 116, .12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
[data-ending="hedon"] .result-emoji { animation: emojiIn .7s cubic-bezier(.18,1.2,.4,1) both, hedonPop 2.4s ease-in-out 1s infinite; }
@keyframes hedonPop {
  0%, 100% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-13px) scale(1.05) rotate(4deg); }
  55% { transform: translateY(0) scale(.97); }
}

/* 🔮 天命 · 紫金星辉（最华丽） */
body[data-ending="destiny"] {
  --th-a: #e9d5ff; --th-b: #fbbf24; --th-glow: rgba(216, 180, 254, .62);
  background:
    radial-gradient(950px 650px at 50% -8%, rgba(168, 85, 247, .28), transparent 62%),
    radial-gradient(700px 500px at 50% 110%, rgba(251, 191, 36, .16), transparent 60%),
    radial-gradient(560px 400px at 12% 30%, rgba(233, 213, 255, .1), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
[data-ending="destiny"] .result-emoji { animation: emojiIn .7s cubic-bezier(.18,1.2,.4,1) both, destinyPulse 2.6s ease-in-out 1s infinite; }
@keyframes destinyPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 22px var(--th-glow)); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 46px rgba(251, 191, 36, .85)); }
}

/* 🌗 悬崖勒马 · 灰金觉醒（由暗转明） */
body[data-ending="cliff"] {
  --th-a: #e4e4e7; --th-b: #fbbf24; --th-glow: rgba(251, 191, 36, .42);
  background:
    radial-gradient(880px 600px at 50% -5%, rgba(161, 161, 170, .16), transparent 60%),
    radial-gradient(640px 460px at 50% 105%, rgba(251, 191, 36, .14), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
[data-ending="cliff"] .result-emoji { animation: emojiIn .7s cubic-bezier(.18,1.2,.4,1) both, cliffAwake 3.2s ease-in-out 1s infinite; }
@keyframes cliffAwake {
  0%, 100% { filter: drop-shadow(0 0 22px var(--th-glow)) brightness(.92); }
  50% { filter: drop-shadow(0 0 34px rgba(251, 191, 36, .8)) brightness(1.25); }
}

/* ============================================================
 * 每题氛围主题由 JS 直接覆写 --qs-a / --qs-b / --qs-rgb 驱动
 * （配置见 data.js 的 QTHEMES，无需在此分块定义）
 * ============================================================ */

/* ---------- 动效降级（省电 / 低性能设备） ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01s !important; animation-iteration-count: 1 !important; }
}
