:root {
  color-scheme: dark;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --bg: #020a1c;
  --bg-deep: #010716;
  --surface: rgba(7, 24, 55, 0.78);
  --surface-strong: rgba(9, 31, 70, 0.94);
  --line: rgba(104, 148, 229, 0.34);
  --blue: #2477ff;
  --blue-soft: #56a3ff;
  --gold: #f7c95c;
  --gold-light: #ffe8a0;
  --text: #f7f9ff;
  --muted: #a8b7d5;
  --danger: #ff8e7a;
  --radius: 22px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; background: var(--bg); }
body { color: var(--text); overflow-x: hidden; }
button, input, textarea { font: inherit; }
select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(1, 7, 22, 0.16), rgba(1, 7, 22, 0.52)),
    url("./assets/energy-background.png") center bottom / cover no-repeat;
  pointer-events: none;
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 18%, rgba(36, 119, 255, 0.12), transparent 43%);
  pointer-events: none;
  z-index: -1;
}

.app-shell {
  min-height: 100svh;
  width: min(100%, 520px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom));
  display: flex;
}

.screen {
  width: 100%;
  min-height: calc(100svh - 40px);
  display: flex;
  flex-direction: column;
  animation: screen-in 480ms cubic-bezier(.22,.78,.25,1);
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.brand {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .04em;
}

.event-label {
  width: max-content;
  margin: 26px auto 10px;
  padding: 7px 13px;
  border: 1px solid rgba(247,201,92,.48);
  border-radius: 999px;
  color: var(--gold-light);
  background: rgba(247,201,92,.08);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .08em;
}

.welcome-copy {
  width: 100%;
  margin: 23px auto 0;
  padding: 16px 17px;
  border: 1px solid rgba(104,148,229,.27);
  border-radius: 16px;
  background: rgba(5,21,50,.6);
  text-align: left;
}
.welcome-copy strong { display: block; margin-bottom: 8px; color: #edf4ff; font-size: 14px; }
.welcome-copy p { margin: 0; color: #b9c8e1; font-size: 12px; line-height: 1.72; }
.welcome-copy span { display: block; margin-top: 9px; color: #82c9ff; font-size: 11px; }
.landing { justify-content: space-between; text-align: center; }
.landing-top { padding-top: clamp(28px, 8svh, 78px); }

.landing h1 {
  margin: 48px 0 12px;
  font-size: clamp(38px, 10vw, 58px);
  line-height: 1.08;
  letter-spacing: -.04em;
  font-weight: 900;
}

.landing h1 em { color: var(--gold); font-style: normal; text-shadow: 0 0 26px rgba(247, 201, 92, .22); }
.landing-subtitle { margin: 0; font-size: clamp(19px, 5vw, 24px); font-weight: 600; letter-spacing: .02em; }
.landing-meta { margin: 38px 0 0; color: var(--muted); font-size: 15px; letter-spacing: .14em; }

.energy-orbit {
  width: 210px;
  height: 118px;
  margin: 28px auto 0;
  position: relative;
  display: grid;
  place-items: center;
}
.energy-orbit::before,
.energy-orbit::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(86, 163, 255, .55);
  border-radius: 50%;
  transform: rotate(-8deg);
}
.energy-orbit::before { width: 180px; height: 62px; box-shadow: 0 0 24px rgba(36,119,255,.18); }
.energy-orbit::after { width: 128px; height: 40px; border-color: rgba(247,201,92,.72); }
.energy-arrow { font-size: 42px; color: var(--blue-soft); filter: drop-shadow(0 0 14px rgba(36,119,255,.65)); animation: rise 1.8s ease-in-out infinite; }
@keyframes rise { 50% { transform: translateY(-8px); color: var(--gold); } }

.landing-actions { padding-bottom: 6px; }
.primary-button,
.secondary-button {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 17px;
  cursor: pointer;
  font-weight: 800;
  font-size: 18px;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}
.primary-button {
  color: #071328;
  background: linear-gradient(135deg, #fff0a9, #f7c95c 52%, #dca839);
  box-shadow: 0 13px 34px rgba(247, 201, 92, .2), inset 0 1px 0 rgba(255,255,255,.75);
}
.primary-button.blue { color: white; background: linear-gradient(135deg, #2e8cff, #1459e8); box-shadow: 0 13px 34px rgba(36,119,255,.24); }
.secondary-button { color: var(--text); background: rgba(10, 31, 67, .82); border: 1px solid var(--line); margin-top: 10px; }
.primary-button:active, .secondary-button:active { transform: scale(.985); }
.microcopy { color: var(--muted); font-size: 12px; line-height: 1.65; margin: 14px 8px 0; }

.quiz-header { margin-bottom: 22px; }
.quiz-headline { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.quiz-headline strong { font-size: 17px; }
.quiz-headline span { font-size: 13px; color: var(--muted); }
.progress-track { height: 5px; margin-top: 12px; border-radius: 20px; background: rgba(111, 143, 197, .22); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--gold)); border-radius: inherit; transition: width 450ms cubic-bezier(.22,.78,.25,1); box-shadow: 0 0 12px rgba(36,119,255,.65); }

.question-card { flex: 1; display: flex; flex-direction: column; }
.question-index { color: var(--gold); font-size: 12px; letter-spacing: .12em; margin: 3px 0 9px; }
.question-card h2 { font-size: clamp(24px, 6.4vw, 31px); line-height: 1.42; margin: 0 0 24px; letter-spacing: -.025em; }
.answers { display: grid; gap: 10px; }
.answer {
  appearance: none;
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 14px;
  color: #eaf1ff;
  background: rgba(6, 23, 54, .78);
  border: 1px solid rgba(91, 133, 207, .42);
  border-radius: 16px;
  cursor: pointer;
  line-height: 1.46;
  transition: border 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.answer:hover { border-color: rgba(86,163,255,.78); }
.answer.selected { border-color: var(--gold); background: linear-gradient(90deg, rgba(247,201,92,.16), rgba(10,32,73,.9)); box-shadow: 0 0 0 1px rgba(247,201,92,.18), 0 0 24px rgba(247,201,92,.1); transform: translateX(3px); }
.answer-letter { flex: 0 0 31px; height: 31px; border-radius: 50%; border: 1px solid rgba(138,169,224,.58); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.answer.selected .answer-letter { color: #071328; background: var(--gold); border-color: var(--gold); }
.quiz-actions { margin-top: 18px; }
.primary-button[disabled] { opacity: .42; cursor: not-allowed; box-shadow: none; }

.stage-screen { justify-content: center; text-align: center; }
.stage-number { color: var(--gold); font-size: 14px; letter-spacing: .16em; }
.stage-screen h2 { font-size: 34px; margin: 12px 0; }
.stage-screen p { color: var(--muted); line-height: 1.8; margin: 0 auto 34px; max-width: 360px; }
.stage-symbol { width: 132px; height: 132px; margin: 0 auto 30px; border: 1px solid rgba(247,201,92,.72); transform: rotate(45deg); display: grid; place-items: center; box-shadow: inset 0 0 48px rgba(36,119,255,.25), 0 0 42px rgba(36,119,255,.18); animation: symbol-in 700ms cubic-bezier(.18,.84,.23,1); }
.stage-symbol span { transform: rotate(-45deg); font-size: 44px; color: var(--gold); }
@keyframes symbol-in { from { opacity: 0; transform: rotate(25deg) scale(.72); } to { opacity: 1; transform: rotate(45deg) scale(1); } }

.result-screen { padding-bottom: 10px; }
.result-header { text-align: center; }
.result-header h1 { margin: 12px 0 0; font-size: 18px; }
.rank-name { font-size: clamp(58px, 17vw, 88px); font-weight: 900; letter-spacing: .04em; margin: 4px 0 0; color: var(--rank-color, var(--gold)); text-shadow: 0 0 32px color-mix(in srgb, var(--rank-color, var(--gold)) 35%, transparent); }
.rank-title { color: var(--rank-color, var(--gold)); font-size: 17px; font-weight: 700; letter-spacing: .08em; }
.score-line { color: var(--muted); font-size: 13px; margin-top: 7px; }
.result-source {
  width: max-content;
  margin: 12px auto 0;
  padding: 6px 12px;
  border: 1px solid rgba(101, 214, 255, 0.28);
  border-radius: 999px;
  color: #bfeeff;
  background: rgba(36, 119, 255, 0.1);
  font-size: 12px;
}

.closing-copy {
  margin-top: 22px;
  padding: 19px 18px;
  border: 1px solid rgba(247,201,92,.3);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(247,201,92,.09), rgba(9,31,70,.72));
  text-align: center;
}
.closing-copy h3 { margin: 0 0 9px; color: var(--gold-light); font-size: 17px; }
.closing-copy p { margin: 0; color: #c5d2e7; font-size: 12px; line-height: 1.75; }
.closing-copy strong { display: block; margin-top: 12px; color: #f6f9ff; font-size: 13px; }

.demographics-heading { margin: 46px 0 24px; }
.demographics-heading h1 { margin: 0 0 8px; font-size: 31px; }
.demographics-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.demographics-form { display: grid; gap: 18px; }
.demographics-form fieldset { margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(5,21,50,.72); }
.demographics-form legend { padding: 0 7px; color: #dce6f8; font-size: 14px; font-weight: 700; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.choice-grid.ages { grid-template-columns: repeat(2, 1fr); }
.choice-grid label { position: relative; cursor: pointer; }
.choice-grid input { position: absolute; opacity: 0; pointer-events: none; }
.choice-grid span { min-height: 44px; display: grid; place-items: center; padding: 8px; border: 1px solid rgba(104,148,229,.34); border-radius: 11px; color: #cbd8ee; background: #051631; font-size: 13px; text-align: center; transition: .2s ease; }
.choice-grid input:checked + span { border-color: var(--gold); color: #06132b; background: var(--gold); font-weight: 800; box-shadow: 0 0 20px rgba(247,201,92,.2); }
.choice-grid input:focus-visible + span { outline: 3px solid rgba(86,163,255,.45); outline-offset: 2px; }
.medallion { width: 74px; height: 74px; margin: 18px auto 4px; display: grid; place-items: center; border: 1px solid var(--rank-color, var(--gold)); transform: rotate(45deg); background: rgba(7,25,57,.75); box-shadow: inset 0 0 28px color-mix(in srgb, var(--rank-color, var(--gold)) 24%, transparent), 0 0 34px color-mix(in srgb, var(--rank-color, var(--gold)) 18%, transparent); }
.medallion span { transform: rotate(-45deg); font-weight: 900; font-size: 22px; color: var(--rank-color, var(--gold)); }

.radar-wrap { width: 270px; margin: 16px auto 8px; }
.radar { overflow: visible; width: 100%; height: auto; }
.radar-grid { fill: rgba(36,119,255,.045); stroke: rgba(99,145,222,.35); stroke-width: 1; }
.radar-axis { stroke: rgba(99,145,222,.28); stroke-width: 1; }
.radar-shape { fill: color-mix(in srgb, var(--rank-color, var(--gold)) 28%, transparent); stroke: var(--rank-color, var(--gold)); stroke-width: 2; filter: drop-shadow(0 0 7px color-mix(in srgb, var(--rank-color, var(--gold)) 35%, transparent)); }
.radar-label { fill: #c9d5eb; font-size: 11px; font-weight: 600; }

.insight { background: rgba(5,21,50,.8); border: 1px solid rgba(91,133,207,.36); border-radius: 17px; padding: 15px 16px; margin-top: 10px; }
.insight h3 { color: var(--gold); font-size: 15px; margin: 0 0 6px; }
.insight.upgrade h3 { color: var(--blue-soft); }
.insight p { margin: 0; color: #d4def0; font-size: 13.5px; line-height: 1.7; }
.result-actions { margin-top: 18px; }

body.preview-open { overflow: hidden; }
.card-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: max(18px, env(safe-area-inset-top)) 14px max(28px, env(safe-area-inset-bottom));
  background: rgba(0, 5, 17, .88);
  backdrop-filter: blur(12px);
}
.card-preview-panel {
  position: relative;
  width: min(100%, 470px);
  padding: 46px 14px 20px;
  border: 1px solid rgba(104, 147, 220, .32);
  border-radius: 24px;
  background: linear-gradient(180deg, #0a1e43, #041127);
  box-shadow: 0 26px 80px rgba(0, 0, 0, .48);
}
.card-preview-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  color: #dfe9fb;
  background: rgba(255, 255, 255, .09);
  font-size: 27px;
  line-height: 1;
}
.card-preview-heading { text-align: center; color: #fff; font-size: 22px; font-weight: 800; }
.card-preview-tip {
  margin: 10px 0 14px;
  text-align: center;
  color: #b7c7e1;
  font-size: 14px;
  line-height: 1.65;
}
.card-preview-tip strong { color: #f7c95c; }
.card-preview-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .35);
  -webkit-touch-callout: default;
  user-select: auto;
}
.card-original-button { margin-top: 14px; }
.card-system-share-button { width: 100%; margin-top: 10px; }
.card-link-button {
  width: 100%;
  margin-top: 7px;
  padding: 10px;
  border: 0;
  color: #91a7c9;
  background: transparent;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.card-preview-footnote { margin-top: 9px; text-align: center; color: #8194b4; font-size: 12px; line-height: 1.5; }
.card-preview-overlay.original-mode { padding: 0; align-items: flex-start; background: #000; }
.card-preview-overlay.original-mode .card-preview-panel {
  width: min(100%, 600px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #000;
  box-shadow: none;
}
.card-preview-overlay.original-mode .card-preview-heading,
.card-preview-overlay.original-mode .card-preview-tip,
.card-preview-overlay.original-mode .card-original-button,
.card-preview-overlay.original-mode .card-system-share-button,
.card-preview-overlay.original-mode .card-link-button,
.card-preview-overlay.original-mode .card-preview-footnote { display: none; }
.card-preview-overlay.original-mode .card-preview-image { width: 100%; border-radius: 0; box-shadow: none; }
.card-preview-overlay.original-mode .card-preview-close {
  position: fixed;
  z-index: 2;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  color: #fff;
  background: rgba(0, 0, 0, .55);
}
.brand-footer { text-align: center; color: var(--muted); font-size: 11px; margin: 16px 0 0; line-height: 1.7; }

.needs-screen h1 { font-size: 29px; line-height: 1.32; margin: 40px 0 8px; }
.needs-screen > p { color: var(--muted); margin: 0 0 28px; line-height: 1.65; }
.need-grid { display: grid; gap: 12px; }
.need-option { padding: 17px; background: rgba(5,21,50,.8); border: 1px solid var(--line); border-radius: 17px; color: var(--text); text-align: left; cursor: pointer; }
.need-option.selected { border-color: var(--gold); background: rgba(247,201,92,.12); }
.need-option strong { display: block; font-size: 16px; margin-bottom: 4px; }
.need-option span { color: var(--muted); font-size: 13px; }
.needs-actions { margin-top: auto; padding-top: 22px; }

.capture-heading { margin: 38px 0 22px; }
.capture-heading .eyebrow { color: var(--gold); font-size: 12px; letter-spacing: .12em; }
.capture-heading h1 { margin: 8px 0 8px; font-size: 29px; line-height: 1.3; }
.capture-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.profile-form { display: grid; gap: 15px; padding-bottom: 12px; }
.profile-form > label > span, .profile-form legend { display: block; margin: 0 0 7px; color: #dce6f8; font-size: 13px; font-weight: 600; }
.profile-form input[type="text"], .profile-form input[type="tel"], .profile-form input:not([type]), .profile-form select {
  width: 100%; min-height: 50px; padding: 0 14px; color: var(--text); background: rgba(5,21,50,.82); border: 1px solid var(--line); border-radius: 13px; outline: none;
}
.profile-form input:focus, .profile-form select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(247,201,92,.1); }
.profile-form fieldset { margin: 0; padding: 13px 14px 8px; border: 1px solid var(--line); border-radius: 14px; background: rgba(5,21,50,.62); }
.radio-row { display: flex; align-items: center; gap: 9px; min-height: 34px; color: #dce6f8; font-size: 13px; }
.radio-row input, .consent-row input { accent-color: var(--gold); }
.consent-row { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.consent-row > span { margin: -2px 0 0 !important; color: var(--muted) !important; font-weight: 400 !important; }
.form-error { padding: 10px 12px; border-radius: 10px; color: #ffd7d0; background: rgba(184,55,39,.18); border: 1px solid rgba(255,142,122,.35); font-size: 12px; }
.data-note { margin: -4px 0 0; text-align: center; color: var(--muted); font-size: 11px; line-height: 1.6; }

.toast { position: fixed; left: 50%; bottom: max(28px, env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 10px 16px; border-radius: 999px; background: rgba(247,201,92,.94); color: #08142b; font-weight: 700; font-size: 13px; box-shadow: var(--shadow); animation: toast-in .3s ease; z-index: 5; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

@media (min-width: 720px) {
  body { padding: 32px 0; }
  .app-shell { min-height: 860px; padding: 18px; background: rgba(1,7,22,.36); border: 1px solid rgba(118,146,199,.32); border-radius: 30px; box-shadow: var(--shadow); }
  .screen { min-height: 824px; }
}

@media (max-height: 720px) {
  .landing h1 { margin-top: 24px; }
  .energy-orbit { margin-top: 14px; transform: scale(.85); }
  .answer { padding: 11px 12px; font-size: 14px; }
  .question-card h2 { font-size: 22px; margin-bottom: 15px; }
  .quiz-header { margin-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
