:root {
  --bg: #0b1220;
  --bg-2: #111827;
  --card: rgba(17, 24, 39, 0.88);
  --card-2: rgba(30, 41, 59, 0.72);
  --text: #e5edf7;
  --muted: #93a4b8;
  --dim: #64748b;
  --primary: #60a5fa;
  --primary-2: #a78bfa;
  --danger: #fb7185;
  --comfort: #34d399;
  --gold: #fbbf24;
  --border: rgba(148, 163, 184, 0.22);
  --selected: rgba(96, 165, 250, 0.14);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 18% 10%, rgba(96, 165, 250, 0.18), transparent 32%),
    radial-gradient(circle at 86% 0%, rgba(167, 139, 250, 0.18), transparent 32%),
    linear-gradient(180deg, #0b1220 0%, #111827 58%, #070b12 100%);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .07;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}
#app {
  width: min(100%, 630px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(10px, env(safe-area-inset-top)) 12px 22px;
}
.page { display: none; animation: fadeIn .28s ease both; }
.page.active { display: block; }
.site-link {
  display: block;
  width: fit-content;
  margin: 0 auto 10px;
  padding: 6px 12px;
  border: 1px solid rgba(96, 165, 250, .28);
  border-radius: 999px;
  color: var(--primary);
  background: rgba(96, 165, 250, .08);
  font-size: 12px;
  letter-spacing: .04em;
  text-decoration: none;
}

.site-link:active { transform: translateY(1px); }
.brand-chip, .result-kicker, .camp-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--primary);
  background: rgba(96, 165, 250, .08);
  font-size: 12px;
  letter-spacing: .04em;
}
h1 {
  margin: 14px 0 8px;
  font-size: clamp(31px, 8.6vw, 42px);
  line-height: .98;
  letter-spacing: -.06em;
  text-align: left;
}
.slogan { margin: 0 0 14px; color: var(--muted); font-size: 14px; text-align: left; line-height: 1.55; }
.hero-image {
  width: clamp(210px, 72vw, 300px);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  margin: 0 auto 14px;
  border-radius: 20px;
  border: 1px solid rgba(96,165,250,.25);
  box-shadow: 0 22px 70px rgba(0,0,0,.32), 0 0 28px rgba(96,165,250,.12);
}
.intro-text, .result-card {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(17,24,39,.92), rgba(15,23,42,.78));
  box-shadow: var(--shadow);
}
.intro-text { color: var(--muted); line-height: 1.68; font-size: 13px; text-align: left; }
.intro-text strong { color: var(--text); }
.btn {
  width: 100%;
  min-height: 50px;
  margin-top: 14px;
  border: 0;
  border-radius: 16px;
  color: #06111f;
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .02em;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 14px 36px rgba(96, 165, 250, .24);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .42; cursor: not-allowed; }
.hint, .share-text, .dev-tag { text-align: center; color: var(--dim); }
.hint { font-size: 12px; margin-top: 14px; }
.share-text { font-size: 13px; line-height: 1.65; }
.dev-tag { font-size: 10px; margin-top: 26px; letter-spacing: .12em; text-transform: uppercase; }
.header-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 10px 0 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  background: linear-gradient(180deg, rgba(11,18,32,.96), rgba(11,18,32,.76));
}
.logo { display: block; color: var(--primary); font-weight: 900; font-size: 17px; }
.sub-logo { display: block; margin-top: 4px; color: var(--dim); font-size: 11px; line-height: 1.45; }
.progress-container { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.progress-text { color: var(--muted); font-size: 13px; }
.accent { color: var(--primary); }
.progress-bar { height: 7px; overflow: hidden; border-radius: 999px; background: rgba(148, 163, 184, .12); margin-bottom: 18px; }
.progress-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--primary-2)); transition: width .24s ease; }
.camp-hint { margin-bottom: 14px; }
#question-text { margin: 12px 0 18px; text-align: left; font-size: clamp(20px, 5vw, 24px); line-height: 1.38; letter-spacing: -.02em; }
.options-container { display: grid; gap: 10px; }
.option-btn {
  width: 100%;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-height: 64px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text);
  background: var(--card);
  text-align: left;
  font-size: 15px;
  line-height: 1.55;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.option-btn:hover { transform: translateY(-1px); border-color: rgba(96,165,250,.55); }
.option-btn.selected { background: var(--selected); border-color: var(--primary); box-shadow: 0 0 0 1px rgba(96,165,250,.22) inset; }
.option-label {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  color: var(--primary);
  background: rgba(96, 165, 250, .12);
  font-weight: 900;
}
.nav-bar { display: flex; gap: 12px; margin-top: 18px; }
.nav-btn {
  flex: 1;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(148, 163, 184, .08);
  cursor: pointer;
  font-weight: 800;
}
.nav-btn:disabled { opacity: .36; cursor: not-allowed; }
.primary-nav { color: #06111f; border: 0; background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.result-card { text-align: center; overflow: hidden; padding: 10px; }
.result-card::before {
  content: "";
  display: block;
  width: 120px;
  height: 120px;
  margin: -60px auto -58px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96,165,250,.28), transparent 70%);
  filter: blur(10px);
}
.result-kicker { margin-bottom: 6px; font-size: 11px; }
.result-camp {
  display: inline-flex;
  margin: 2px 0 10px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--gold);
  background: rgba(251, 191, 36, .1);
  border: 1px solid rgba(251, 191, 36, .22);
  font-size: 12px;
  font-weight: 800;
}
.result-avatar {
  width: min(100%, 360px);
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  display: block;
  margin: 0 auto 12px;
  border-radius: 18px;
  border: 1px solid rgba(96,165,250,.35);
  background: var(--bg-2);
  box-shadow: 0 20px 60px rgba(0,0,0,.38), 0 0 30px rgba(96,165,250,.16);
}
.result-name { font-size: clamp(26px, 7.4vw, 34px); line-height: 1; font-weight: 950; letter-spacing: -.05em; }
.result-version { margin-top: 6px; color: var(--primary); font-size: 14px; font-weight: 800; }
.result-quote { margin: 10px auto 12px; color: var(--gold); font-size: 14px; line-height: 1.55; font-weight: 700; }
.result-section {
  margin-top: 9px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(15, 23, 42, .66);
  text-align: left;
}
.section-label { display: inline-flex; margin-bottom: 8px; font-size: 15px; font-weight: 900; letter-spacing: .12em; }
.section-label.danger { color: var(--danger); }
.section-label.comfort { color: var(--comfort); }
.result-section p { margin: 0; color: var(--muted); line-height: 1.62; font-size: 13px; }
.share-line {
  margin-top: 10px;
  padding: 11px;
  border-radius: 18px;
  color: var(--text);
  background: linear-gradient(135deg, rgba(96,165,250,.13), rgba(167,139,250,.13));
  border: 1px solid rgba(96,165,250,.24);
  line-height: 1.5;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  max-width: calc(100% - 32px);
  padding: 11px 14px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(15, 23, 42, .92);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 420px) {
  #app { padding-inline: 12px; }
  .hero-image { width: min(78vw, 320px); }
  .result-card { padding: 10px; border-radius: 18px; }
  .result-avatar { border-radius: 18px; }
  .option-btn { font-size: 14px; }
  .nav-bar { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}


/* Mobile-first result composition: 1 screen ≈ image + core text */
#page-result .header-nav {
  position: static;
  padding-top: 6px;
  padding-bottom: 9px;
  margin-bottom: 10px;
}
#page-result .sub-logo { font-size: 10px; }
#page-result .btn { margin-top: 12px; }

@media (max-width: 430px) {
  #app { width: 100%; padding-inline: 10px; }
  .brand-chip { font-size: 11px; padding: 6px 9px; }
  .hero-image { width: min(74vw, 288px); }
  .intro-text { max-height: 168px; overflow: auto; }
  #question-text { font-size: 20px; }
  .option-btn { min-height: 58px; padding: 12px; font-size: 14px; }
  .nav-btn { min-height: 44px; }
  .result-avatar { width: min(100%, 336px); }
  .result-card { border-radius: 18px; }
  .result-name { font-size: clamp(24px, 8vw, 32px); }
  .result-section { border-radius: 15px; }
}

@media (max-height: 760px) and (max-width: 430px) {
  .site-link { margin-bottom: 6px; }
  #page-result .header-nav { display: none; }
  .result-avatar { width: min(100%, 310px); }
  .result-kicker, .result-camp { transform: scale(.94); transform-origin: center; }
  .result-quote { display: none; }
}

@media (min-width: 600px) {
  .hero-image { width: 600px; }
  .result-avatar { width: 600px; }
}
