:root {
  --night: #191432;
  --purple: #2c2c54;
  --gold: #d4a574;
  --paper: #faf8f5;
  --ink: #1a1a2e;
  --muted: #777381;
  --red: #a7443c;
  --line: rgba(212, 165, 116, .35);
  --shadow: 0 18px 55px rgba(25, 20, 50, .13);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 50% 0, #fff 0, var(--paper) 44%, #f1ece5 100%); }
button { font: inherit; }
#app { min-height: 100vh; }
.screen { width: min(100%, 720px); min-height: 100vh; margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) 20px max(32px, env(safe-area-inset-bottom)); }
.loading-screen { min-height: 100vh; display: grid; place-content: center; text-align: center; color: var(--purple); }
.eyebrow { color: var(--gold); font-family: Georgia, serif; font-size: 12px; letter-spacing: .28em; }
.hero { position: relative; overflow: hidden; min-height: 100vh; color: #fff; background: linear-gradient(155deg, #151129 0%, #2c2c54 54%, #352648 100%); }
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 16%, rgba(212,165,116,.2), transparent 30%), repeating-linear-gradient(90deg, transparent 0 46px, rgba(255,255,255,.018) 47px 48px); pointer-events: none; }
.hero-inner { position: relative; min-height: calc(100vh - 56px); display: flex; flex-direction: column; justify-content: center; }
.laurel { width: 76px; height: 76px; margin: 28px auto; border: 1px solid var(--gold); border-radius: 50%; display: grid; place-items: center; color: var(--gold); font: 30px Georgia, serif; box-shadow: 0 0 45px rgba(212,165,116,.18); }
h1, h2, h3 { font-family: Georgia, "Songti SC", serif; }
h1 { margin: 0; text-align: center; font-size: clamp(34px, 10vw, 54px); line-height: 1.16; font-weight: 600; }
.subtitle { color: #d9c5aa; text-align: center; line-height: 1.8; }
.intro { margin: 28px 0; color: rgba(255,255,255,.82); line-height: 1.9; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 24px 0 30px; }
.feature { padding: 14px 8px; border: 1px solid rgba(212,165,116,.35); border-radius: 14px; text-align: center; background: rgba(255,255,255,.04); }
.feature b { display: block; color: #fff; font-size: 14px; }
.feature small { color: rgba(255,255,255,.55); font-size: 11px; }
.primary, .secondary { width: 100%; min-height: 54px; border-radius: 16px; cursor: pointer; transition: transform .18s, opacity .18s; }
.primary { border: 0; background: linear-gradient(135deg, #e1ba8e, var(--gold)); color: #201831; font-weight: 700; box-shadow: 0 12px 30px rgba(212,165,116,.2); }
.secondary { border: 1px solid var(--line); color: var(--purple); background: rgba(255,255,255,.7); }
button:active { transform: scale(.985); }
.fine-print { color: rgba(255,255,255,.45); text-align: center; font-size: 12px; line-height: 1.7; }
.quiz-head { position: sticky; top: 0; z-index: 3; padding: 12px 0 18px; background: linear-gradient(var(--paper) 75%, transparent); }
.progress-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.progress { height: 5px; margin-top: 10px; overflow: hidden; border-radius: 99px; background: #e6dfd7; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--purple), var(--gold)); transition: width .3s; }
.stage { margin: 24px 0 12px; color: #9a744e; text-align: center; font-size: 13px; }
.question { margin: 0 0 26px; font-size: clamp(22px, 6vw, 29px); line-height: 1.55; text-align: center; }
.options { display: grid; gap: 12px; }
.option { width: 100%; min-height: 68px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: rgba(255,255,255,.76); text-align: left; line-height: 1.55; box-shadow: 0 8px 26px rgba(25,20,50,.04); cursor: pointer; }
.option.selected { border-color: var(--purple); color: #fff; background: var(--purple); }
.option-letter { display: inline-grid; width: 27px; height: 27px; margin-right: 9px; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-family: Georgia, serif; font-size: 13px; }
.quiz-nav { display: flex; gap: 10px; margin-top: 22px; }
.quiz-nav button { min-height: 46px; }
.oracle { min-height: 100vh; display: grid; place-content: center; text-align: center; color: #fff; background: var(--night); }
.oracle-ring { width: 92px; height: 92px; margin: 0 auto 26px; border: 2px solid rgba(212,165,116,.25); border-top-color: var(--gold); border-radius: 50%; animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-screen { padding: 0 0 40px; }
.result-hero { padding: max(40px, env(safe-area-inset-top)) 22px 44px; color: #fff; text-align: center; background: radial-gradient(circle at 50% 15%, rgba(212,165,116,.22), transparent 32%), linear-gradient(150deg, #17122e, #2c2c54); }
.result-hero h1 { margin-top: 12px; color: #fff; }
.deity-card { display: block; width: min(78vw, 320px); aspect-ratio: 3 / 4; margin: 22px auto 18px; padding: 0; border: 0; border-radius: 20px; color: inherit; background: transparent; cursor: pointer; perspective: 1100px; }
.deity-card-inner { position: relative; display: block; width: 100%; height: 100%; border-radius: inherit; transition: transform .7s cubic-bezier(.2,.72,.2,1); transform-style: preserve-3d; box-shadow: 0 24px 60px rgba(0,0,0,.32), 0 0 0 6px rgba(212,165,116,.06); }
.deity-card.is-flipped .deity-card-inner { transform: rotateY(180deg); }
.deity-face { position: absolute; inset: 0; display: block; overflow: hidden; border: 1px solid rgba(212,165,116,.72); border-radius: inherit; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.deity-front { background: #211a3d; }
.deity-front::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), inset 0 -90px 90px rgba(14,10,28,.62); }
.deity-front img { display: block; width: 100%; height: 100%; object-fit: cover; }
.flip-hint { position: absolute; z-index: 1; right: 14px; bottom: 13px; left: 14px; padding: 9px 12px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; color: #f3dfc4; background: rgba(17,12,34,.68); font-size: 12px; letter-spacing: .05em; backdrop-filter: blur(8px); }
.deity-back { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 30px 25px; color: #f8eee1; background: radial-gradient(circle at 50% 8%, rgba(212,165,116,.28), transparent 34%), linear-gradient(145deg, #24203c, #17122e); transform: rotateY(180deg); }
.deity-back strong { color: #f0c895; font: 600 23px/1.4 Georgia, "Songti SC", serif; }
.deity-back p { margin: 0; font-size: 14px; line-height: 1.9; }
.deity-back small { color: rgba(255,255,255,.55); }
.deity-symbols { padding: 8px 12px; border: 1px solid rgba(212,165,116,.4); border-radius: 999px; color: #e7c8a4; font-size: 12px; }
.portrait-fallback { width: 100%; min-height: 420px; display: grid; place-items: center; color: var(--gold); font: 56px Georgia, "Songti SC", serif; }
.portrait-fallback[hidden] { display: none; }
.match { display: inline-block; margin: 14px 0; padding: 7px 13px; border: 1px solid var(--gold); border-radius: 99px; color: #efd0aa; }
.tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tag { padding: 5px 10px; border: 1px solid rgba(212,165,116,.5); border-radius: 99px; color: #e7c8a4; font-size: 12px; }
.result-body { width: min(calc(100% - 32px), 680px); margin: -20px auto 0; position: relative; }
.card { margin-bottom: 14px; padding: 22px; border: 1px solid rgba(212,165,116,.18); border-radius: 20px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.card h2 { margin: 0 0 14px; color: var(--purple); font-size: 20px; }
.rich { color: #403b47; line-height: 1.85; }
.rich p { margin: 0 0 12px; }
.rich ol { padding-left: 22px; }
.dimension { margin: 18px 0; }
.dimension-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.dimension-bar { height: 9px; margin: 8px 0; border-radius: 99px; overflow: hidden; background: #ddd4ca; }
.dimension-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--purple)); }
.dimension-note { color: var(--muted); font-size: 12px; }
.shadow-card { color: #fff; background: linear-gradient(145deg, #24203c, #373052); }
.shadow-card h2 { color: #e6c395; }
.shadow-profile { display: grid; grid-template-columns: 88px 1fr; align-items: center; gap: 16px; margin: 12px 0 16px; }
.shadow-profile img { width: 88px; aspect-ratio: 3 / 4; border: 1px solid rgba(212,165,116,.5); border-radius: 12px; object-fit: cover; }
.shadow-profile h2 { margin: 0 0 6px; }
.shadow-role { margin: 0; color: #d7c4ae; font-size: 12px; line-height: 1.55; }
.quote { margin: 22px 0 0; color: var(--red); font: italic 18px/1.7 Georgia, "Songti SC", serif; text-align: center; }
.actions { display: grid; gap: 10px; margin-top: 16px; }
.poster-preview { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(12,9,25,.86); backdrop-filter: blur(8px); }
.poster-preview-panel { width: min(100%, 520px); max-height: calc(100vh - 32px); display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid rgba(212,165,116,.35); border-radius: 22px; background: #faf8f5; box-shadow: 0 30px 90px rgba(0,0,0,.45); }
.poster-preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; color: var(--ink); }
.poster-preview-head strong { color: var(--purple); font: 600 19px Georgia, "Songti SC", serif; }
.poster-preview-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.poster-preview-head button { width: 38px; height: 38px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; color: var(--purple); background: #fff; font-size: 25px; cursor: pointer; }
.poster-preview-scroll { min-height: 0; overflow: auto; border-radius: 14px; background: #eae3da; }
.poster-preview-scroll img { display: block; width: 100%; height: auto; -webkit-touch-callout: default; user-select: auto; }
.poster-download { display: grid; place-items: center; min-height: 50px; text-decoration: none; }
.wechat-save-tip { margin: 0; padding: 12px; border-radius: 12px; color: #fff; background: var(--purple); text-align: center; font-weight: 700; }
.error { min-height: 100vh; display: grid; place-content: center; padding: 30px; text-align: center; }
@media (max-width: 420px) { .feature-grid { grid-template-columns: 1fr; } .feature { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
