/* ============================================================
   鲁轩江湖二十四席 · 暗夜江湖 × 鎏金（Mobile-First 适配）
   ============================================================ */
:root {
  --bg: #0b0d12;
  --bg-2: #10131b;
  --ink: #f2ecdf;
  --ink-soft: rgba(242, 236, 223, .62);
  --ink-faint: rgba(242, 236, 223, .38);
  --gold: #d8b179;
  --gold-bright: #f0d5a0;
  --gold-deep: #a67c44;
  --red: #d85a48;
  --red-deep: #a03a30;
  --glass: rgba(255, 255, 255, .045);
  --glass-strong: rgba(255, 255, 255, .07);
  --line: rgba(216, 177, 121, .18);
  --line-soft: rgba(255, 255, 255, .07);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.45, .5, 1);
  /* 使用系统中文字体，避免中国大陆用户等待或依赖境外字体 CDN。 */
  --serif: 'Songti SC', 'STSong', 'SimSun', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  overflow-x: hidden;
  overscroll-behavior-y: contain;
}
button, .option, a { touch-action: manipulation; }
button { font-family: inherit; color: inherit; }
::selection { background: rgba(216, 177, 121, .3); }

/* ---------- 氛围层 ---------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.bg-glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; will-change: transform; }
.g-gold {
  width: 55vmax; height: 55vmax; right: -18vmax; top: -22vmax;
  background: radial-gradient(circle, rgba(216, 177, 121, .16), transparent 65%);
  animation: drift 26s ease-in-out infinite alternate;
}
.g-red {
  width: 46vmax; height: 46vmax; left: -16vmax; bottom: -14vmax;
  background: radial-gradient(circle, rgba(216, 90, 72, .12), transparent 65%);
  animation: drift 32s ease-in-out infinite alternate-reverse;
}
.g-blue {
  width: 40vmax; height: 40vmax; left: 30vw; top: 40vh;
  background: radial-gradient(circle, rgba(94, 120, 165, .08), transparent 65%);
  animation: drift 38s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(4vmax, -3vmax, 0) scale(1.12); }
}
#fx { position: absolute; inset: 0; width: 100%; height: 100%; }
.bg-grain {
  position: absolute; inset: 0; opacity: .05; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.bg-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 120% 90% at 50% 40%, transparent 55%, rgba(5, 6, 9, .55));
}

/* ---------- 骨架 ---------- */
.app {
  position: relative; z-index: 1;
  width: min(1180px, 100%);
  min-height: 100vh; min-height: 100dvh;
  margin: 0 auto;
  display: flex; flex-direction: column;
}
.topbar {
  height: calc(76px + var(--sat));
  padding: var(--sat) clamp(20px, 5vw, 56px) 0;
  flex: none;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark {
  width: 36px; height: 36px; display: grid; place-items: center;
  font: 900 19px var(--serif); color: var(--gold);
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--glass); backdrop-filter: blur(8px);
  box-shadow: inset 0 0 12px rgba(216, 177, 121, .08);
}
.brand-text { font-size: 14px; font-weight: 700; letter-spacing: 2.5px; }
.brand-text em { font-style: normal; font-weight: 400; font-size: 11px; letter-spacing: 1.5px; color: var(--ink-faint); margin-left: 10px; }
.top-actions { display: flex; gap: 10px; }
.ghost-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--glass); border: 1px solid var(--line-soft); border-radius: 10px;
  color: var(--ink-soft); cursor: pointer;
  transition: color .25s, border-color .25s, transform .25s var(--ease-out), background .25s;
  backdrop-filter: blur(8px);
}
.ghost-btn:active { transform: translateY(0) scale(.94); background: rgba(216, 177, 121, .1); }
#soundBtn .sound-off { display: none; }
#soundBtn.muted .sound-wave { display: none; }
#soundBtn.muted .sound-off { display: block; }

/* ---------- 屏幕切换 ---------- */
.screen { display: none; flex: 1; position: relative; }
.screen.active { display: flex; flex-direction: column; animation: screenIn .55s var(--ease-out) both; }
@keyframes screenIn {
  from { opacity: 0; transform: translateY(18px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}
.rise { animation: rise .9s var(--ease-out) both; animation-delay: var(--d, 0s); }
@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}
.eyebrow {
  margin: 0 0 18px; font-size: 11px; font-weight: 700;
  letter-spacing: 4px; color: var(--gold);
}

/* ---------- 首页（margin:auto 居中，矮屏可滚动不裁切） ---------- */
#homeScreen { align-items: flex-start; padding: 0 clamp(24px, 9vw, 110px) 30px; }
.home-inner { width: 100%; position: relative; z-index: 1; margin: auto 0; }
.hero-title {
  margin: 0; font: 900 clamp(52px, 9.5vw, 118px)/1.12 var(--serif);
  letter-spacing: clamp(2px, .8vw, 8px);
  color: var(--gold);
  filter: drop-shadow(0 6px 30px rgba(216, 177, 121, .22));
}
.title-br { display: none; } /* 桌面单行，移动端断为两行 */
.hero-title .ch {
  display: inline-block; opacity: 0;
  background: linear-gradient(160deg, var(--gold-bright) 10%, var(--gold) 45%, var(--gold-deep) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: chIn .8s var(--ease-spring) both;
  animation-delay: calc(.12s + var(--i) * .07s);
}
@keyframes chIn {
  from { opacity: 0; transform: translateY(.5em) rotate(6deg) scale(1.25); filter: blur(8px); }
  to   { opacity: 1; transform: none; filter: none; }
}
.hero-sub {
  margin: 24px 0 0; font-size: clamp(15px, 2vw, 21px);
  letter-spacing: 5px; color: var(--ink-soft);
}
.hero-meta {
  display: flex; align-items: center; gap: 16px; margin: 26px 0 40px;
  font-size: 12.5px; letter-spacing: 2px; color: var(--ink-faint);
}
.hero-meta i { width: 3px; height: 3px; border-radius: 50%; background: var(--gold); opacity: .6; flex: none; }

/* CTA 主按钮 */
.cta {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 18px;
  padding: 17px 34px; border: 0; border-radius: 14px; cursor: pointer;
  font-size: 15.5px; font-weight: 700; letter-spacing: 2.5px; color: #1c1409;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold) 55%, var(--gold-deep));
  box-shadow: 0 10px 34px rgba(216, 177, 121, .28), inset 0 1px 0 rgba(255, 255, 255, .45);
  transition: transform .3s var(--ease-spring), box-shadow .3s;
}
.cta:active { transform: translateY(0) scale(.97); }
.cta-glow {
  position: absolute; top: 0; left: -80%; width: 55%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .5), transparent);
  transform: skewX(-22deg);
  animation: sheen 3.2s ease-in-out infinite;
}
@keyframes sheen { 0%, 55% { left: -80%; } 100% { left: 130%; } }
.cta-arrow { font-size: 19px; transition: transform .3s var(--ease-spring); }
.cta.small { padding: 13px 26px; font-size: 14px; border-radius: 12px; }
.cta.wide { width: 100%; justify-content: center; }

/* 角色跑马灯 */
.teaser { display: flex; align-items: center; gap: 18px; margin-top: 52px; max-width: 640px; width: 100%; }
.teaser-label {
  flex: none; font: 700 11px var(--sans); letter-spacing: 3px; color: var(--gold);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px;
  background: var(--glass);
}
.teaser-mask {
  flex: 1; overflow: hidden; position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.teaser-track {
  display: inline-flex; gap: 34px; white-space: nowrap;
  font: 600 13px var(--serif); letter-spacing: 2px; color: var(--ink-faint);
  animation: marquee 36s linear infinite; will-change: transform;
}
.teaser-track b { color: var(--gold); font-weight: 600; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* 悬浮印章 */
.seal-float {
  position: absolute; right: clamp(30px, 9vw, 120px); top: 18%;
  width: 168px; height: 168px; display: grid; place-items: center;
}
.seal {
  width: 138px; height: 138px; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  font: 900 29px/1.55 var(--serif); color: var(--red);
  border: 2px solid rgba(216, 90, 72, .75);
  box-shadow: inset 0 0 0 5px var(--bg), inset 0 0 0 6.5px rgba(216, 90, 72, .45), 0 0 50px rgba(216, 90, 72, .16);
  transform: rotate(-8deg);
  animation: sealBreath 5s ease-in-out infinite;
}
@keyframes sealBreath {
  0%, 100% { transform: rotate(-8deg) scale(1); }
  50% { transform: rotate(-8deg) scale(1.035); }
}
.seal-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px dashed rgba(216, 177, 121, .35);
  animation: spin 30s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.side-word {
  position: absolute; right: clamp(14px, 3vw, 40px); bottom: 90px;
  writing-mode: vertical-rl; font: 500 12.5px var(--serif);
  letter-spacing: 7px; color: var(--ink-faint);
}

/* ---------- 答题 ---------- */
#quizScreen { padding: 10px 0 30px; }
.quiz-wrap { width: min(720px, 100% - 48px); margin: auto auto; }
.quiz-head { display: flex; justify-content: space-between; align-items: flex-end; }
.quiz-no { margin: 0; font: 900 clamp(26px, 4vw, 34px) var(--serif); letter-spacing: 3px; }
.progress-text { font-size: 15px; font-weight: 700; color: var(--gold); letter-spacing: 1px; }
.progress-text em { font-style: normal; font-weight: 400; font-size: 12px; color: var(--ink-faint); margin-left: 5px; }
.progress-track {
  height: 3px; margin: 20px 0 28px; border-radius: 99px;
  background: rgba(255, 255, 255, .07); overflow: visible; position: relative;
}
.progress-fill {
  height: 100%; width: 0; border-radius: 99px; position: relative;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright));
  box-shadow: 0 0 14px rgba(216, 177, 121, .5);
  transition: width .5s var(--ease-out);
}
.progress-fill::after {
  content: ''; position: absolute; right: -4px; top: 50%; translate: 0 -50%;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--gold-bright); box-shadow: 0 0 12px 2px rgba(240, 213, 160, .8);
}

.q-card {
  background: var(--glass); border: 1px solid var(--line-soft);
  border-radius: 22px; padding: clamp(26px, 4.5vw, 44px);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.q-card.leaving { animation: cardOut .26s var(--ease-out) both; }
.q-card.entering { animation: cardIn .42s var(--ease-out) both; }
.q-card.entering.back { animation-name: cardInBack; }
.q-card.leaving.back { animation-name: cardOutBack; }
@keyframes cardIn  { from { opacity: 0; transform: translateX(46px); filter: blur(5px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes cardOut { from { opacity: 1; } to { opacity: 0; transform: translateX(-46px); filter: blur(5px); } }
@keyframes cardInBack  { from { opacity: 0; transform: translateX(-46px); filter: blur(5px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes cardOutBack { from { opacity: 1; } to { opacity: 0; transform: translateX(46px); filter: blur(5px); } }
.q-card h3 {
  margin: 0 0 26px; font: 900 clamp(19px, 2.8vw, 25px)/1.65 var(--serif);
  letter-spacing: 1.5px;
}
.options { display: grid; gap: 12px; }
.option {
  display: flex; align-items: center; gap: 14px;
  min-height: 54px; padding: 15px 18px; border-radius: 14px; cursor: pointer; text-align: left;
  font-size: 15px; letter-spacing: .3px; line-height: 1.55;
  color: var(--ink-soft); background: rgba(255, 255, 255, .028);
  border: 1px solid rgba(255, 255, 255, .06);
  transition: border-color .22s, background .22s, color .22s, transform .22s var(--ease-out), box-shadow .22s;
  opacity: 0; animation: optIn .45s var(--ease-out) both; animation-delay: calc(.08s + var(--i) * .06s);
}
@keyframes optIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.option b {
  flex: none; width: 28px; height: 28px; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--gold);
  border: 1px solid var(--line); border-radius: 8px;
  transition: inherit;
}
.option:active { transform: scale(.985); }
.option.selected {
  color: #1c1409; border-color: transparent; font-weight: 700;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  box-shadow: 0 8px 26px rgba(216, 177, 121, .35);
  transform: scale(1.01);
}
.option.selected b { color: #1c1409; border-color: rgba(28, 20, 9, .35); }

.quiz-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; cursor: pointer; padding: 12px 8px;
  margin: -6px 0; font-size: 13px; letter-spacing: 1.5px; color: var(--ink-faint);
  transition: color .2s, opacity .3s, transform .2s;
}
.back-btn:active { transform: translateX(-3px); color: var(--gold); }
.back-btn.hidden { opacity: 0; pointer-events: none; }
.hint { margin: 0; font-size: 12px; letter-spacing: 1.5px; color: var(--ink-faint); }

/* ---------- 推演 ---------- */
#revealScreen { align-items: center; padding-bottom: 40px; }
.reveal-wrap { display: flex; flex-direction: column; align-items: center; margin: auto 0; }
.astro { position: relative; width: 220px; height: 220px; display: grid; place-items: center; }
.astro .ring { position: absolute; border-radius: 50%; }
.ring.r1 { inset: 0; border: 1px dashed rgba(216, 177, 121, .4); animation: spin 14s linear infinite; }
.ring.r2 { inset: 26px; border: 1px solid rgba(216, 177, 121, .16); border-top-color: rgba(240, 213, 160, .8); animation: spin 5s linear infinite reverse; }
.ring.r3 { inset: 52px; border: 1px dashed rgba(216, 90, 72, .45); animation: spin 9s linear infinite; }
.astro-halo {
  position: absolute; inset: 34px; border-radius: 50%;
  background: radial-gradient(circle, rgba(216, 177, 121, .22), transparent 68%);
  animation: haloPulse 1.6s ease-in-out infinite;
}
@keyframes haloPulse { 0%, 100% { transform: scale(.9); opacity: .7; } 50% { transform: scale(1.12); opacity: 1; } }
.astro-core {
  width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  font: 900 34px var(--serif); color: var(--red);
  border: 2px solid rgba(216, 90, 72, .8);
  background: radial-gradient(circle, rgba(216, 90, 72, .12), transparent 75%);
  animation: haloPulse 1.6s ease-in-out infinite;
}
.reveal-status {
  margin: 36px 0 18px; font: 600 15px var(--serif);
  letter-spacing: 6px; color: var(--gold);
}
.reveal-status::after {
  content: '…'; display: inline-block; width: 1.2em; text-align: left;
  animation: dots 1.2s steps(3) infinite; overflow: hidden; vertical-align: bottom;
}
@keyframes dots { 0% { width: 0; } 100% { width: 1.2em; } }
.reveal-line { width: 210px; height: 2px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
#revealBar {
  height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright));
  box-shadow: 0 0 12px rgba(216, 177, 121, .6);
  transition: width .7s var(--ease-out);
}

/* ---------- 结果：人物形象 + 性格画像 ---------- */
#resultScreen { align-items: center; padding: 22px 0 42px; }
.result-stage { width: min(1040px, calc(100% - 48px)); margin: auto 0; perspective: 1400px; }
.result-card {
  position: relative; display: grid; grid-template-columns: minmax(300px, .92fr) minmax(0, 1.08fr);
  overflow: hidden; border-radius: 30px;
  background: linear-gradient(145deg, rgba(25, 28, 38, .92), rgba(12, 14, 20, .88));
  border: 1px solid var(--line);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 36px 100px rgba(0, 0, 0, .52), inset 0 1px 0 rgba(255, 255, 255, .07);
  transform-style: preserve-3d; will-change: transform;
}
.result-card::before {
  content: ''; position: absolute; inset: 11px; z-index: 4; border-radius: 21px;
  border: 1px solid rgba(216, 177, 121, .11); pointer-events: none;
}
.result-visual {
  position: relative; isolation: isolate; min-height: 650px; overflow: hidden;
  display: flex; align-items: flex-end; justify-content: center;
  background:
    linear-gradient(180deg, rgba(216, 177, 121, .06), transparent 42%),
    radial-gradient(circle at 50% 44%, rgba(216, 177, 121, .17), transparent 42%),
    rgba(7, 9, 13, .46);
  border-right: 1px solid var(--line-soft);
}
.result-visual::after {
  content: ''; position: absolute; inset: auto 0 0; z-index: 1; height: 38%;
  background: linear-gradient(transparent, rgba(8, 9, 13, .86)); pointer-events: none;
}
.portrait-halo {
  position: absolute; z-index: 0; top: 13%; left: 50%; width: 72%; aspect-ratio: 1; translate: -50% 0;
  border-radius: 50%; background: radial-gradient(circle, rgba(240, 213, 160, .24), rgba(216, 177, 121, .08) 48%, transparent 70%);
  filter: blur(4px); animation: portraitBreath 4.8s ease-in-out infinite;
}
.portrait-ring {
  position: absolute; z-index: 0; top: 16%; left: 50%; width: 62%; aspect-ratio: 1; translate: -50% 0;
  border: 1px solid rgba(216, 177, 121, .22); border-radius: 50%;
  box-shadow: 0 0 0 18px rgba(216, 177, 121, .025), 0 0 0 44px rgba(216, 177, 121, .015);
}
@keyframes portraitBreath { 50% { transform: scale(1.07); opacity: .76; } }
.result-photo {
  position: absolute; z-index: 1; left: 50%; bottom: 2px; translate: -50% 0;
  width: min(94%, 520px); height: auto; object-fit: contain;
  opacity: 0; transform: translateY(18px) scale(.97);
  filter: drop-shadow(0 28px 32px rgba(0, 0, 0, .5));
  transition: opacity .55s ease, transform .7s var(--ease-out);
}
.result-photo.loaded { opacity: 1; transform: none; }
.portrait-fallback {
  position: absolute; z-index: 2; inset: 0; display: none;
  align-content: center; justify-items: center; gap: 13px;
  padding: 120px 28px 28px; text-align: center;
  color: var(--ink-soft); font-size: 13px; letter-spacing: 2px;
  background: radial-gradient(circle at 50% 45%, rgba(216, 177, 121, .12), transparent 42%);
}
.result-visual.portrait-failed .portrait-fallback { display: grid; }
.portrait-fallback button {
  min-width: 112px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px;
  color: var(--gold); background: rgba(12, 14, 20, .7); font: inherit; cursor: pointer;
}
.portrait-fallback button:active { transform: scale(.97); }
.result-seal {
  position: absolute; z-index: 3; top: 24px; left: 24px;
  width: 76px; height: 76px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--red); border: 2px solid rgba(216, 90, 72, .8);
  background: rgba(11, 13, 18, .62); backdrop-filter: blur(9px);
  box-shadow: inset 0 0 0 4px rgba(11, 13, 18, .8), inset 0 0 0 5.5px rgba(216, 90, 72, .4), 0 0 44px rgba(216, 90, 72, .2);
  transform: rotate(-7deg);
}
.result-seal .seal-main { font: 900 18px var(--serif); letter-spacing: 3px; }
.result-seal .seal-sub { font-size: 8px; letter-spacing: 1.5px; color: var(--ink-faint); }
.result-seal.stamp { animation: stampIn .55s var(--ease-spring) both; }
@keyframes stampIn {
  0% { opacity: 0; transform: rotate(-24deg) scale(2.1); filter: blur(7px); }
  62% { opacity: 1; transform: rotate(-4deg) scale(.93); filter: none; }
  100% { opacity: 1; transform: rotate(-7deg) scale(1); }
}
.portrait-plaque {
  position: absolute; z-index: 3; top: 26px; right: 24px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 3px;
  padding: 11px 14px; border: 1px solid rgba(216, 177, 121, .22); border-radius: 12px;
  background: rgba(12, 14, 20, .7); backdrop-filter: blur(12px);
}
.portrait-plaque span { font: 700 14px var(--serif); letter-spacing: 3px; color: var(--gold); }
.portrait-plaque small { font-size: 9px; letter-spacing: 1.5px; color: var(--ink-faint); }
.result-copy { position: relative; z-index: 2; padding: 52px 48px 44px; text-align: left; }
.result-label { margin: 0 0 12px; font-size: 12px; letter-spacing: 5px; color: var(--ink-faint); }
.result-name {
  margin: 0; font: 900 clamp(40px, 5vw, 60px)/1.18 var(--serif); letter-spacing: 5px;
  background: linear-gradient(165deg, var(--gold-bright) 15%, var(--gold) 55%, var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 24px rgba(216, 177, 121, .25));
}
.result-tag { margin: 12px 0 0; font-size: 14px; line-height: 1.75; letter-spacing: 2.5px; color: var(--red); font-weight: 500; }
.quote {
  display: block; margin: 22px 0 0; padding: 13px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font: 600 16px/1.8 var(--serif); letter-spacing: 2px; color: var(--gold);
}
.quote-mark { opacity: .55; }
.result-desc {
  margin: 18px 0 0; font-size: 15px; line-height: 1.95; letter-spacing: .6px; color: var(--ink-soft);
}
.personality-analysis {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px;
}
.analysis-block {
  min-width: 0; padding: 16px 17px; border: 1px solid var(--line-soft); border-radius: 14px;
  background: rgba(255, 255, 255, .028);
}
.analysis-main { grid-column: 1 / -1; border-color: rgba(216, 177, 121, .16); background: rgba(216, 177, 121, .045); }
.analysis-kicker { display: block; margin-bottom: 8px; font: 700 11px var(--sans); letter-spacing: 3px; color: var(--gold); }
.analysis-block p { margin: 0; font-size: 13.5px; line-height: 1.85; color: var(--ink-soft); }
.result-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.btn-ghost {
  padding: 13px 22px; border-radius: 12px; cursor: pointer;
  font-size: 13.5px; letter-spacing: 1.5px; color: var(--ink-soft);
  background: transparent; border: 1px solid rgba(255, 255, 255, .13);
  transition: color .25s, border-color .25s, background .25s, transform .25s var(--ease-out);
}
.btn-ghost:active { transform: scale(.97); background: rgba(216, 177, 121, .08); }

/* ---------- 弹窗 / 面板 ---------- */
.modal { position: fixed; inset: 0; z-index: 40; display: none; place-items: center; padding: 20px; }
.modal.open { display: grid; }
.modal-mask { position: absolute; inset: 0; background: rgba(5, 6, 9, .72); backdrop-filter: blur(10px); animation: fadeIn .3s both; }
@keyframes fadeIn { from { opacity: 0; } }
.modal-card {
  position: relative; width: min(400px, 100%); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px);
  overflow-y: auto; padding: 30px 28px 26px; border-radius: 22px;
  background: rgba(18, 21, 30, .92); border: 1px solid var(--line);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .6);
  animation: modalIn .45s var(--ease-spring) both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(28px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes sheetIn { from { transform: translateY(100%); } to { transform: none; } }
.modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-soft);
  background: var(--glass); color: var(--ink-soft); font-size: 19px; cursor: pointer;
  transition: color .2s, border-color .2s;
}
.modal-close:active { color: var(--gold); border-color: var(--line); }
.modal-title { margin: 0 0 6px; font: 900 21px var(--serif); letter-spacing: 2px; }
.share-preview {
  margin: 20px 0; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line-soft); background: rgba(0, 0, 0, .3);
}
.share-preview img { display: block; width: 100%; height: auto; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .cta { flex: 1; justify-content: center; text-decoration: none; }
.modal-actions .btn-ghost { flex: none; }

.qr-panel {
  position: fixed; z-index: 40;
  right: 20px; bottom: calc(24px + var(--sab));
  width: min(360px, calc(100% - 40px)); padding: 28px 26px 24px;
  display: none; border-radius: 20px;
  background: rgba(18, 21, 30, .94); border: 1px solid var(--line);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
}
.qr-panel.open { display: block; animation: modalIn .4s var(--ease-spring) both; }
.panel-note { margin: 0 0 6px; font-size: 12.5px; line-height: 1.8; color: var(--ink-faint); }
.qr-panel input {
  width: 100%; margin: 12px 0 14px; padding: 13px 15px;
  border-radius: 12px; border: 1px solid var(--line-soft); outline: none;
  background: rgba(255, 255, 255, .04); color: var(--ink); font: 16px var(--sans);
  transition: border-color .25s, box-shadow .25s;
}
.qr-panel input:focus { border-color: rgba(216, 177, 121, .55); box-shadow: 0 0 0 3px rgba(216, 177, 121, .12); }
.qr-output { display: grid; place-items: center; min-height: 20px; margin-top: 18px; }
.qr-output:not(:empty) { padding: 14px; border-radius: 14px; background: #fffaf3; }
.download-link { display: none; margin-top: 14px; text-align: center; font-size: 12.5px; letter-spacing: 1px; color: var(--gold); }
.qr-fab {
  position: fixed;
  right: 20px; bottom: calc(20px + var(--sab));
  z-index: 30;
  width: 48px; height: 48px; border-radius: 14px; cursor: pointer;
  font-size: 12px; font-weight: 700; letter-spacing: 1px; color: var(--gold);
  background: rgba(18, 21, 30, .85); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  transition: transform .25s var(--ease-spring), box-shadow .25s, color .25s;
}
.qr-fab:active { transform: scale(.92); color: var(--gold-bright); }

.toast {
  position: fixed; left: 50%; bottom: calc(34px + var(--sab)); z-index: 60;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  padding: 11px 22px; border-radius: 999px; max-width: calc(100vw - 48px);
  font-size: 13px; letter-spacing: 1.5px; color: var(--gold-bright);
  background: rgba(18, 21, 30, .92); border: 1px solid var(--line);
  box-shadow: 0 12px 36px rgba(0, 0, 0, .5);
  transition: opacity .3s, transform .3s var(--ease-out);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

footer {
  flex: none; padding: 20px 22px calc(20px + var(--sab)); text-align: center;
  font-size: 10.5px; letter-spacing: 3px; color: rgba(242, 236, 223, .25);
}

/* ---------- 桌面悬停（触屏设备不生效，避免样式粘连） ---------- */
@media (hover: hover) and (pointer: fine) {
  .ghost-btn:hover { color: var(--gold); border-color: var(--line); background: var(--glass-strong); transform: translateY(-1px); }
  .cta:hover { transform: translateY(-2px); box-shadow: 0 16px 44px rgba(216, 177, 121, .4), inset 0 1px 0 rgba(255, 255, 255, .5); }
  .cta:hover .cta-arrow { transform: translateX(5px); }
  .option:hover { color: var(--ink); border-color: rgba(216, 177, 121, .45); background: rgba(216, 177, 121, .07); transform: translateX(6px); box-shadow: 0 6px 22px rgba(0, 0, 0, .3); }
  .option:hover b { background: rgba(216, 177, 121, .16); }
  .back-btn:hover { color: var(--gold); }
  .btn-ghost:hover { color: var(--gold); border-color: var(--line); background: rgba(216, 177, 121, .06); transform: translateY(-1px); }
  .modal-close:hover { color: var(--gold); border-color: var(--line); }
  .download-link:hover { color: var(--gold-bright); }
  .qr-fab:hover { transform: translateY(-3px); color: var(--gold-bright); box-shadow: 0 14px 38px rgba(0, 0, 0, .5); }
  .qr-panel input:hover { border-color: rgba(216, 177, 121, .3); }
}

/* ---------- 移动端 ---------- */
@media (max-width: 760px) {
  .topbar { height: calc(60px + var(--sat)); padding: var(--sat) 20px 0; }
  .brand { gap: 10px; }
  .brand-mark { width: 32px; height: 32px; font-size: 17px; border-radius: 9px; }
  .brand-text { font-size: 13px; letter-spacing: 2px; }
  .brand-text em { display: none; }
  .ghost-btn { width: 38px; height: 38px; }

  /* 首页 */
  #homeScreen { padding: 0 22px 26px; }
  .eyebrow { margin-bottom: 14px; letter-spacing: 3px; }
  .hero-title {
    font-size: clamp(54px, 16.5vw, 74px);
    letter-spacing: 3px; line-height: 1.16;
  }
  .title-br { display: inline; } /* 移动端拆成「江湖 / 二十四席」两行 */
  .hero-sub { margin-top: 18px; font-size: 15px; letter-spacing: 3px; }
  .hero-meta { margin: 20px 0 28px; gap: 11px; font-size: 12px; letter-spacing: 1.5px; }
  #homeScreen .cta { width: 100%; justify-content: center; padding: 17px 24px; font-size: 16px; }
  .teaser { margin-top: 30px; gap: 10px; }
  .teaser-label { padding: 6px 11px; font-size: 10px; }
  .teaser-track { font-size: 12px; gap: 24px; }
  .seal-float {
    top: 4%; right: 16px; width: 104px; height: 104px;
    z-index: 0; opacity: .9; margin: 0;
  }
  .seal { width: 88px; height: 88px; font-size: 19px; box-shadow: inset 0 0 0 4px var(--bg), inset 0 0 0 5px rgba(216, 90, 72, .45), 0 0 36px rgba(216, 90, 72, .14); }
  .side-word { display: none; }

  /* 答题 */
  #quizScreen { padding: 6px 0 24px; }
  .quiz-wrap { width: calc(100% - 36px); }
  .quiz-no { font-size: 24px; }
  .progress-text { font-size: 14px; }
  .progress-text em { font-size: 11px; }
  .progress-track { margin: 16px 0 22px; }
  .q-card { padding: 24px 18px 20px; border-radius: 18px; }
  .q-card h3 { font-size: 19.5px; margin-bottom: 18px; letter-spacing: 1px; }
  .options { gap: 10px; }
  .option { min-height: 56px; padding: 14px 15px; font-size: 15px; gap: 12px; border-radius: 13px; }
  .option b { width: 27px; height: 27px; }
  .option.selected { transform: none; }
  .quiz-foot { margin-top: 10px; }
  .hint { display: none; }

  /* 推演 */
  .astro { width: 184px; height: 184px; }
  .ring.r2 { inset: 22px; }
  .ring.r3 { inset: 44px; }
  .astro-halo { inset: 28px; }
  .astro-core { width: 64px; height: 64px; font-size: 29px; }
  .reveal-status { margin: 30px 0 16px; }

  /* 结果 */
  #resultScreen { padding: 8px 0 28px; }
  .result-stage { width: calc(100% - 24px); }
  .result-card { display: block; border-radius: 24px; }
  /* 内嵌浏览器对大面积模糊合成开销很高，结果页改为不透明层以优先保证图片渲染。 */
  .result-card, .result-seal, .portrait-plaque { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .result-card::before { inset: 8px; border-radius: 17px; }
  .result-visual { min-height: 410px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .result-photo { bottom: 0; width: min(90%, 330px); }
  .portrait-halo { top: 12%; width: 76%; }
  .portrait-ring { top: 15%; width: 66%; }
  .result-seal { top: 16px; left: 16px; width: 60px; height: 60px; }
  .result-seal .seal-main { font-size: 15px; letter-spacing: 2px; }
  .result-seal .seal-sub { font-size: 7px; letter-spacing: 1px; }
  .portrait-plaque { top: 16px; right: 16px; padding: 9px 11px; }
  .portrait-plaque span { font-size: 12px; letter-spacing: 2px; }
  .portrait-plaque small { font-size: 8px; }
  .result-copy { padding: 28px 22px 24px; }
  .result-label { font-size: 11px; letter-spacing: 3px; margin-bottom: 9px; }
  .result-name { font-size: clamp(36px, 11.5vw, 48px); letter-spacing: 3px; }
  .result-tag { font-size: 13px; letter-spacing: 1.8px; }
  .quote { margin-top: 17px; padding: 11px 0; font-size: 14.5px; }
  .result-desc { margin-top: 15px; font-size: 14px; line-height: 1.85; }
  .personality-analysis { grid-template-columns: 1fr; gap: 9px; margin-top: 20px; }
  .analysis-main { grid-column: auto; }
  .analysis-block { padding: 15px; }
  .analysis-block p { font-size: 13.5px; line-height: 1.82; }
  .result-actions { margin-top: 22px; flex-direction: column; gap: 9px; }
  .result-actions .cta, .result-actions .btn-ghost { width: 100%; justify-content: center; padding: 15px 22px; font-size: 14.5px; }

  /* 弹窗 → 底部抽屉 */
  .modal { padding: 0; place-items: end center; }
  .modal-card {
    width: 100%; max-width: none;
    max-height: 90dvh;
    border-radius: 22px 22px 0 0; border-bottom: 0;
    padding: 28px 20px calc(22px + var(--sab));
    animation: sheetIn .5s var(--ease-spring) both;
  }
  .modal-actions .btn-ghost { flex: 1; }
  .modal-title { font-size: 19px; }

  /* QR 面板（修复被动画覆盖 transform 的定位问题） */
  .qr-panel {
    left: 14px; right: 14px; bottom: calc(14px + var(--sab));
    width: auto; padding: 26px 20px calc(22px + var(--sab));
  }
  .qr-fab { right: 16px; bottom: calc(16px + var(--sab)); width: 46px; height: 46px; }
  footer { padding-bottom: calc(16px + var(--sab)); }
}

/* ---------- 横屏 / 矮屏 ---------- */
@media (max-height: 720px) {
  .progress-track { margin: 14px 0 18px; }
  .q-card { padding: 20px 24px; }
  .q-card h3 { margin-bottom: 16px; font-size: 19px; }
  .option { min-height: 48px; padding: 11px 15px; }
  .result-stage { margin-top: 0; }
}
@media (max-height: 480px) {
  .hero-title { font-size: clamp(40px, 13vh, 58px); max-width: none; }
  .hero-meta { margin: 14px 0 18px; }
  .teaser { display: none; }
  .seal-float { display: none; }
  .astro { width: 150px; height: 150px; }
  .astro-core { width: 54px; height: 54px; font-size: 24px; }
  .reveal-status { margin: 20px 0 12px; }
  .result-visual { min-height: 360px; }
  .result-seal { width: 64px; height: 64px; }
  .result-actions { margin-top: 18px; }
}

@media (max-width: 380px) {
  .topbar { padding-inline: 14px; }
  #homeScreen { padding-inline: 18px; }
  .hero-title { font-size: clamp(50px, 16vw, 62px); }
  .hero-meta { gap: 8px; font-size: 11px; }
  .quiz-wrap { width: calc(100% - 24px); }
  .q-card { padding: 21px 14px 18px; }
  .option { padding: 13px 12px; gap: 10px; }
  .result-stage { width: calc(100% - 16px); }
  .result-visual { min-height: 390px; }
  .result-photo { width: min(92%, 315px); }
  .result-copy { padding-inline: 19px; }
  .modal-card { padding-inline: 16px; }
}

/* ---------- 减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  #fx { display: none; }
  .teaser-track { animation: none; }
}
