/* ============================================
   近期情绪压力自查量表 - 统一样式规范
   3 套风格（右上角可切换）：
     body.theme-mist   晨雾白（浅色 · 柔和薄荷，默认）
     body.theme-night  夜航蓝（深色 · 睡前安静）
     body.theme-warm   暖阳杏（浅色 · 暖调纸感）
   变量名与 chan/common.css 保持同一套命名，便于互相迁移
   ============================================ */

/* ---------- 默认 = 晨雾白 ---------- */
:root {
  --primary-color: #0d9488;
  --primary-light: #14b8a6;
  --primary-soft: rgba(13, 148, 136, 0.09);
  --primary-gradient: linear-gradient(135deg, #14b8a6, #0d9488);

  --bg-gradient: radial-gradient(900px 520px at 18% 0%, #e3f4f1 0%, #f2f9f8 46%, #eaf1f9 100%);
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-card-light: rgba(255, 255, 255, 0.62);
  --bg-hover: rgba(13, 148, 136, 0.08);

  --text-primary: #17323a;
  --text-secondary: #3d5a63;
  --text-muted: #6b8791;
  --text-faint: #93a9b1;

  --success-color: #15803d;
  --success-bg: rgba(21, 128, 61, 0.09);
  --error-color: #b91c1c;
  --error-bg: rgba(185, 28, 28, 0.08);
  --warning-color: #b45309;
  --warning-bg: rgba(180, 83, 9, 0.09);
  --info-color: #0369a1;

  --border-color: rgba(23, 80, 90, 0.14);
  --border-hover: rgba(13, 148, 136, 0.45);

  --radius-sm: 8px;
  --radius-md: 13px;
  --radius-lg: 20px;
  --radius-full: 999px;

  --shadow-card: 0 12px 32px rgba(28, 88, 96, 0.11), 0 2px 6px rgba(28, 88, 96, 0.05);
  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei",
    sans-serif;
  --font-title: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei",
    sans-serif;
  --font-num: ui-monospace, Consolas, "SFMono-Regular", Menlo, monospace;
  --texture: radial-gradient(640px 300px at 88% 4%, rgba(20, 184, 166, 0.07), transparent 70%),
    radial-gradient(520px 300px at 4% 96%, rgba(96, 165, 250, 0.07), transparent 70%);
}

/* ---------- 风格 A：晨雾白（浅色 · 柔和薄荷） ---------- */
body.theme-mist {
  --primary-color: #0d9488;
  --primary-light: #14b8a6;
  --primary-soft: rgba(13, 148, 136, 0.09);
  --primary-gradient: linear-gradient(135deg, #14b8a6, #0d9488);
  --bg-gradient: radial-gradient(900px 520px at 18% 0%, #e3f4f1 0%, #f2f9f8 46%, #eaf1f9 100%);
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-card-light: rgba(255, 255, 255, 0.62);
  --bg-hover: rgba(13, 148, 136, 0.08);
  --text-primary: #17323a;
  --text-secondary: #3d5a63;
  --text-muted: #6b8791;
  --text-faint: #93a9b1;
  --border-color: rgba(23, 80, 90, 0.14);
  --border-hover: rgba(13, 148, 136, 0.45);
  --shadow-card: 0 12px 32px rgba(28, 88, 96, 0.11), 0 2px 6px rgba(28, 88, 96, 0.05);
  --texture: radial-gradient(640px 300px at 88% 4%, rgba(20, 184, 166, 0.07), transparent 70%),
    radial-gradient(520px 300px at 4% 96%, rgba(96, 165, 250, 0.07), transparent 70%);
}

/* ---------- 风格 B：夜航蓝（深色 · 睡前安静） ---------- */
body.theme-night {
  --primary-color: #7dd3fc;
  --primary-light: #bae6fd;
  --primary-soft: rgba(125, 211, 252, 0.12);
  --primary-gradient: linear-gradient(135deg, #38bdf8, #4f7fd6);
  --bg-gradient: radial-gradient(880px 520px at 78% 6%, #172a49 0%, #0d1626 56%, #080e18 100%);
  --bg-card: rgba(255, 255, 255, 0.055);
  --bg-card-light: rgba(255, 255, 255, 0.035);
  --bg-hover: rgba(125, 211, 252, 0.1);
  --text-primary: #dce8f6;
  --text-secondary: #b3c6da;
  --text-muted: #8299b1;
  --text-faint: #64798f;
  --success-color: #4ade80;
  --success-bg: rgba(74, 222, 128, 0.12);
  --error-color: #fca5a5;
  --error-bg: rgba(248, 113, 113, 0.13);
  --warning-color: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.1);
  --info-color: #7dd3fc;
  --border-color: rgba(160, 200, 240, 0.16);
  --border-hover: rgba(125, 211, 252, 0.5);
  --shadow-card: 0 12px 34px rgba(0, 0, 0, 0.42);
  --texture: radial-gradient(560px 280px at 90% 8%, rgba(125, 211, 252, 0.06), transparent 70%),
    radial-gradient(520px 320px at 6% 94%, rgba(79, 127, 214, 0.09), transparent 70%);
}

/* ---------- 风格 C：暖阳杏（浅色 · 暖调纸感） ---------- */
body.theme-warm {
  --primary-color: #b4642e;
  --primary-light: #d98a4d;
  --primary-soft: rgba(180, 100, 46, 0.1);
  --primary-gradient: linear-gradient(135deg, #d98a4d, #b4642e);
  --bg-gradient: radial-gradient(900px 520px at 14% 0%, #fdf1e0 0%, #fdf6ee 48%, #fbf0e4 100%);
  --bg-card: rgba(255, 255, 255, 0.78);
  --bg-card-light: rgba(255, 255, 255, 0.6);
  --bg-hover: rgba(180, 100, 46, 0.08);
  --text-primary: #3a2a18;
  --text-secondary: #6b5334;
  --text-muted: #91795a;
  --text-faint: #b39d7f;
  --success-color: #15803d;
  --success-bg: rgba(21, 128, 61, 0.09);
  --error-color: #b91c1c;
  --error-bg: rgba(185, 28, 28, 0.08);
  --warning-color: #a15c0a;
  --warning-bg: rgba(161, 92, 10, 0.09);
  --info-color: #0369a1;
  --border-color: rgba(120, 88, 44, 0.18);
  --border-hover: rgba(180, 100, 46, 0.45);
  --shadow-card: 0 12px 30px rgba(140, 100, 50, 0.13), 0 2px 6px rgba(140, 100, 50, 0.06);
  --texture: radial-gradient(620px 300px at 86% 6%, rgba(217, 138, 77, 0.09), transparent 70%),
    radial-gradient(520px 300px at 4% 96%, rgba(196, 150, 90, 0.08), transparent 70%);
}

/* ---------- 动态背景画布 ---------- */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  pointer-events: none;
}

/* 风格底纹层 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--texture);
}

/* ---------- 全局重置 ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-base);
}

body {
  background: var(--bg-gradient);
  min-height: 100vh;
  padding: 20px;
  color: var(--text-primary);
  transition: background 0.35s ease, color 0.35s ease;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 容器 ---------- */
.container {
  max-width: 780px;
  margin: 0 auto;
  margin-top: 44px;
}

/* ---------- 步骤容器（4 步共用一个页面） ---------- */
.step {
  display: none;
}

.step.active {
  display: block;
  animation: gateFadeIn 0.35s ease;
}

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

/* ---------- 卡片 ---------- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
}

/* ---------- 按钮 ---------- */
.btn {
  border: none;
  padding: 12px 30px;
  border-radius: var(--radius-full);
  font-size: 15.5px;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  font-family: inherit;
}

.btn:hover:not(:disabled) {
  transform: scale(1.03);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  font-weight: bold;
  box-shadow: 0 8px 20px -8px var(--primary-color);
}

.btn-warning {
  background: linear-gradient(135deg, #f0b429, #d98613);
  color: #3a2405;
  font-weight: bold;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--border-hover);
  color: var(--primary-color);
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-lg {
  font-size: 17px;
  padding: 15px 44px;
}

/* ---------- 简介页 ---------- */
.hero {
  text-align: center;
  margin-bottom: 20px;
}

.hero-icon {
  font-size: 46px;
  line-height: 1;
  margin-bottom: 10px;
}

.hero h2 {
  font-family: var(--font-title);
  font-size: 24px;
  letter-spacing: 0.5px;
  margin-bottom: 9px;
}

.hero p {
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.8;
}

.rule-list {
  list-style: none;
  display: grid;
  gap: 9px;
  margin: 16px 0;
}

.rule-list li {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-secondary);
  padding-left: 18px;
  position: relative;
}

.rule-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--primary-color);
}

/* 免责声明 / 用药提示类盒子（首页与结果页共用） */
.compliance-box {
  background: var(--warning-bg);
  border-left: 3px solid var(--warning-color);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 13px 15px;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--text-secondary);
}

.compliance-box strong {
  color: var(--warning-color);
}

/* 各维度题量一览 */
.factor-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.factor-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-card-light);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
}

.start-wrap {
  text-align: center;
  margin-top: 22px;
}

/* ---------- 门槛页（验证码 / 灵点支付） ---------- */
.gate-box {
  max-width: 440px;
  margin: 0 auto;
  text-align: center;
}

.gate-box h2 {
  font-family: var(--font-title);
  color: var(--text-primary);
  font-size: 21px;
  margin-bottom: 8px;
}

.gate-sub {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 20px;
}

.gate-tabs {
  position: relative;
  display: flex;
  background: var(--bg-card-light);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 4px;
  margin-bottom: 18px;
}

.gate-tab-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
  box-shadow: 0 2px 10px rgba(28, 88, 96, 0.22);
  opacity: 0.9;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.gate-tabs[data-active="pay"] .gate-tab-slider {
  transform: translateX(100%);
}

.gate-tab {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 8px;
  border: none;
  background: none;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.25s;
  white-space: nowrap;
}

.gate-tab.active {
  color: #fff;
  font-weight: bold;
}

.gate-tab .gt-cost {
  color: var(--warning-color);
  font-weight: bold;
  font-size: 13px;
}

.gate-tab.active .gt-cost {
  color: #fff;
}

.gate-panel {
  display: none;
}

.gate-panel.active {
  display: block;
  animation: gateFadeIn 0.3s ease;
}

.gate-input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card-light);
  color: var(--text-primary);
  font-size: 16px;
  text-align: center;
  letter-spacing: 1.5px;
  outline: none;
  font-family: var(--font-num);
  transition: border-color 0.2s;
}

.gate-input::placeholder {
  color: var(--text-faint);
  letter-spacing: 0;
  font-family: var(--font-base);
}

.gate-input:focus {
  border-color: var(--primary-color);
}

.gate-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.gate-msg {
  font-size: 13px;
  min-height: 20px;
  line-height: 1.5;
  margin: 10px 0;
}

.gate-msg.err {
  color: var(--error-color);
}

.gate-msg.ok {
  color: var(--success-color);
}

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

.back-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.back-link:hover {
  color: var(--primary-color);
}

/* ---------- 作答页 · 进度 ---------- */
.progress-wrap {
  margin-bottom: 14px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.progress-head b {
  font-family: var(--font-num);
  color: var(--primary-color);
}

.progress-bar {
  height: 8px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--bg-card-light);
  border: 1px solid var(--border-color);
}

.progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  transition: width 0.35s ease;
}

/* ---------- 作答页 · 题目与选项 ---------- */
.question-box {
  font-size: 18px;
  line-height: 1.75;
  margin-bottom: 6px;
  color: var(--text-primary);
  font-family: var(--font-title);
}

.q-number {
  color: var(--primary-color);
  font-size: 13px;
  font-weight: bold;
  font-family: var(--font-num);
}

.option-wrap {
  display: grid;
  gap: 10px;
  margin: 16px 0 6px;
}

.opt-btn {
  background: var(--bg-card-light);
  border: 1.5px solid var(--border-color);
  color: var(--text-primary);
  padding: 13px 16px;
  border-radius: var(--radius-md);
  font-size: 14.5px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: all 0.22s ease;
  display: flex;
  align-items: center;
  gap: 11px;
  line-height: 1.5;
}

.opt-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  transform: translateX(4px);
}

.opt-btn:disabled {
  cursor: default;
  opacity: 0.85;
}

.opt-btn.picked {
  background: var(--primary-soft);
  border-color: var(--primary-color);
  color: var(--primary-color);
  opacity: 1;
  font-weight: bold;
}

.opt-letter {
  flex: 0 0 auto;
  display: inline-block;
  width: 26px;
  height: 26px;
  line-height: 26px;
  text-align: center;
  background: var(--border-color);
  border-radius: 50%;
  font-weight: bold;
  font-size: 13px;
  font-family: var(--font-num);
  color: var(--text-secondary);
}

.opt-btn.picked .opt-letter {
  background: var(--primary-color);
  color: #fff;
}

.opt-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.opt-text {
  font-size: 14.5px;
}

.opt-hint {
  font-size: 11.5px;
  color: var(--text-faint);
  font-weight: normal;
}

.opt-btn.picked .opt-hint {
  color: var(--primary-light);
}

.prev-wrap {
  text-align: center;
  margin-top: 16px;
}

.prev-wrap .btn {
  padding: 9px 22px;
  font-size: 13.5px;
}

/* ---------- 结果页 ---------- */
#result-card {
  --level-color: var(--primary-color);
}

.level-reveal {
  text-align: center;
  margin: 2px 0 18px;
}

.level-stage {
  position: relative;
  width: 172px;
  height: 172px;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.level-halo,
.level-rays,
.level-ring {
  position: absolute;
  pointer-events: none;
  opacity: 0;
}

/* 呼吸光晕 */
.level-halo {
  inset: 28px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--level-color) 0%, transparent 70%);
  filter: blur(15px);
}

/* 旋转光芒（比 chan 更柔，降低透明度） */
.level-rays {
  inset: -14px;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    var(--level-color) 0deg 3deg,
    transparent 3deg 18deg
  );
  -webkit-mask-image: radial-gradient(circle, #000 16%, transparent 66%);
  mask-image: radial-gradient(circle, #000 16%, transparent 66%);
}

/* 冲击波圆环 */
.level-ring {
  inset: 32px;
  border-radius: 50%;
  border: 2px solid var(--level-color);
}

.level-reveal.reveal-play .level-badge {
  animation: levelSpinReveal 1.4s ease-in-out both;
}
.level-reveal.reveal-play .level-halo {
  animation: levelHaloPulse 1.6s ease-out 0.5s both;
}
.level-reveal.reveal-play .level-rays {
  animation: levelRaysIn 1.1s ease-out 0.55s both, levelRaysSpin 22s linear 1.65s infinite;
}
.level-reveal.reveal-play .level-ring {
  animation: levelRingBurst 1.2s cubic-bezier(0.16, 0.8, 0.3, 1) both;
}
.level-reveal.reveal-play .level-ring.r1 {
  animation-delay: 0.5s;
}
.level-reveal.reveal-play .level-ring.r2 {
  animation-delay: 0.66s;
}
.level-reveal.reveal-play .level-ring.r3 {
  animation-delay: 0.82s;
}
.level-reveal.reveal-play .level-name {
  animation: levelNameSlam 0.7s cubic-bezier(0.2, 1.35, 0.35, 1) 0.66s both;
}
.level-reveal.reveal-play .level-tagline {
  animation: levelFadeUp 0.6s ease 1s both;
}

.level-badge {
  width: 104px;
  height: 104px;
  margin: 0;
  border-radius: 50%;
  border: 2px solid var(--level-color);
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.35), transparent 62%),
    var(--primary-gradient);
  box-shadow: 0 0 34px -8px var(--level-color);
}

.level-emoji {
  font-size: 52px;
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.22));
}

.level-name {
  font-size: 27px;
  font-weight: 900;
  letter-spacing: 2px;
  font-family: var(--font-title);
  color: var(--level-color);
}

.level-tagline {
  margin-top: 7px;
  font-size: 13px;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}

/* 关键数据 */
.result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 6px 0 18px;
}

.result-cell {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card-light);
  padding: 12px;
  text-align: center;
}

.result-cell span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.result-cell b {
  font-size: 21px;
  font-family: var(--font-num);
  color: var(--primary-color);
}

/* 整体解读 */
.total-comment {
  padding: 15px 17px;
  font-size: 14px;
  line-height: 1.9;
  color: var(--text-secondary);
  background: var(--bg-card-light);
  border-left: 3px solid var(--level-color);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* 小节标题 */
.section-title {
  margin: 20px 0 11px;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.section-title::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 12px;
  margin-right: 7px;
  vertical-align: -1px;
  border-radius: 2px;
  background: var(--level-color);
}

/* 最需要留意的三项 */
.focus-list {
  display: grid;
  gap: 10px;
}

.focus-card {
  padding: 13px 15px;
  background: var(--bg-card-light);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--level-color);
}

.focus-rank {
  display: inline-block;
  font-size: 13px;
  color: var(--primary-color);
  margin-bottom: 5px;
}

.focus-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.focus-head b {
  font-size: 15px;
  color: var(--text-primary);
}

.focus-score {
  font-size: 12px;
  font-family: var(--font-num);
  font-weight: bold;
}

.focus-text {
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.85;
  color: var(--text-secondary);
}

/* 十维度明细 */
.factor-list {
  display: grid;
  gap: 15px;
}

.factor-row {
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border-color);
}

.factor-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

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

.factor-name {
  font-size: 14px;
  font-weight: bold;
  color: var(--text-primary);
}

.factor-right {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.factor-mean {
  font-size: 16px;
  font-family: var(--font-num);
  color: var(--text-primary);
}

.factor-level {
  font-size: 12px;
  font-weight: bold;
}

.factor-bar {
  height: 8px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--bg-card-light);
  border: 1px solid var(--border-color);
}

.factor-bar-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: var(--radius-full);
  transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.factor-text {
  margin-top: 8px;
  font-size: 12.8px;
  line-height: 1.85;
  color: var(--text-secondary);
}

/* 高危引导 */
.risk-box {
  display: none;
  margin-top: 18px;
  padding: 15px 17px;
  font-size: 13.5px;
  line-height: 1.95;
  color: var(--text-secondary);
  background: var(--error-bg);
  border: 1px solid var(--error-color);
  border-radius: var(--radius-md);
}

.risk-box strong {
  display: block;
  margin-bottom: 6px;
  color: var(--error-color);
}

.risk-box b {
  color: var(--error-color);
}

/* 结果页免责声明 */
.disclaimer-box {
  margin-top: 18px;
  padding: 13px 15px;
  font-size: 12px;
  line-height: 1.9;
  color: var(--text-muted);
  background: var(--bg-card-light);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
}

.disclaimer-box strong {
  color: var(--text-secondary);
}

.result-actions {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

/* 结果卡入场冲击（延迟与揭晓爆发点对齐） */
#result-card.card-impact {
  animation: cardImpact 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) 0.5s both;
}

/* ---------- 右上角风格选择器 ---------- */
.style-picker {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 200;
}

.style-picker-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, border-color 0.2s;
}

.style-picker-btn:hover {
  transform: translateY(-1px);
  border-color: var(--border-hover);
}

.style-picker-panel {
  position: absolute;
  top: 46px;
  right: 0;
  width: 218px;
  padding: 7px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card);
  display: none;
}

.style-picker.open .style-picker-panel {
  display: block;
  animation: gateFadeIn 0.22s ease;
}

.style-picker-title {
  font-size: 11.5px;
  color: var(--text-muted);
  padding: 6px 9px 8px;
  letter-spacing: 0.5px;
}

.style-option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: var(--radius-md);
  background: none;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.style-option:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.style-option .st-ico {
  font-size: 16px;
  line-height: 1;
}

.style-option .st-desc {
  display: block;
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 1px;
}

.style-option .st-check {
  margin-left: auto;
  color: var(--primary-color);
  font-weight: bold;
  opacity: 0;
}

.style-option.active {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.style-option.active .st-check {
  opacity: 1;
}

/* ---------- 页脚 ---------- */
.footer {
  text-align: center;
  margin-top: 26px;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.7;
}

.footer a {
  display: inline-block;
  margin-top: 6px;
  font-size: 12.5px;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.footer a:hover {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

/* ---------- 关键帧 ---------- */
/* 徽章揭晓：蓄力缩到极小 → 炸开 → 收放两轮 → 落定 */
@keyframes levelSpinReveal {
  0% {
    transform: scale(0.2) rotate(0deg);
    opacity: 0;
  }
  12% {
    transform: scale(0.36) rotate(-40deg);
    opacity: 1;
  }
  20% {
    transform: scale(0.26) rotate(-62deg);
  }
  38% {
    transform: scale(1.7) rotate(168deg);
  }
  52% {
    transform: scale(0.84) rotate(320deg);
  }
  66% {
    transform: scale(1.3) rotate(452deg);
  }
  80% {
    transform: scale(0.94) rotate(548deg);
  }
  92% {
    transform: scale(1.1) rotate(600deg);
  }
  100% {
    transform: scale(1) rotate(720deg);
  }
}

@keyframes levelHaloPulse {
  0% {
    opacity: 0;
    transform: scale(0.45);
  }
  34% {
    opacity: 0.6;
    transform: scale(1.24);
  }
  100% {
    opacity: 0.24;
    transform: scale(1);
  }
}

@keyframes levelRaysIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 0.16;
  }
}

@keyframes levelRaysSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes levelRingBurst {
  0% {
    transform: scale(0.42);
    opacity: 0.85;
  }
  60% {
    opacity: 0.32;
  }
  100% {
    transform: scale(2.35);
    opacity: 0;
  }
}

@keyframes levelNameSlam {
  0% {
    transform: scale(1.55) translateY(-7px);
    opacity: 0;
    filter: blur(10px);
    letter-spacing: 12px;
  }
  52% {
    transform: scale(0.94) translateY(0);
    opacity: 1;
    filter: blur(0);
    letter-spacing: 2px;
  }
  76% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
    filter: blur(0);
    letter-spacing: 2px;
  }
}

@keyframes levelFadeUp {
  0% {
    transform: translateY(10px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes cardImpact {
  0% {
    transform: translate(0, 0) scale(1);
  }
  14% {
    transform: translate(0, -6px) scale(1.012);
  }
  32% {
    transform: translate(-6px, 2px) scale(1.004);
  }
  50% {
    transform: translate(5px, -2px) scale(1);
  }
  68% {
    transform: translate(-3px, 1px);
  }
  86% {
    transform: translate(2px, -1px);
  }
  100% {
    transform: translate(0, 0) scale(1);
  }
}

/* ---------- 响应式 ---------- */
@media (max-width: 560px) {
  body {
    padding: 14px;
  }
  .container {
    margin-top: 40px;
  }
  .card {
    padding: 21px 17px;
  }
  .hero h2 {
    font-size: 21px;
  }
  .question-box {
    font-size: 16.5px;
  }
  .level-name {
    font-size: 23px;
  }
  .level-stage {
    width: 150px;
    height: 150px;
  }
  .level-badge {
    width: 92px;
    height: 92px;
  }
  .level-emoji {
    font-size: 44px;
  }
  .result-cell b {
    font-size: 19px;
  }
}
