* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0b0d1a;
  --card: #161a30;
  --card-2: #1e2340;
  --line: rgba(255, 255, 255, 0.08);
  --text: #eef0ff;
  --muted: #9aa0c3;
  --accent: #7c5cff;
  --accent-2: #ff5c8a;
  --ok: #38d39f;
  --warn: #ffc857;
  --bad: #ff6b6b;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100%;
  padding: 24px 20px 40px;
}

.screen { animation: fade-in 0.35s ease; }
.hidden { display: none !important; }
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- home / loading ---------- */
.hero {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
}
.badge-glow {
  width: 140px; height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.35), rgba(255, 92, 138, 0.15) 60%, transparent 70%);
  filter: blur(6px);
  margin-bottom: 12px;
  animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 0.9; } 50% { transform: scale(1.12); opacity: 1; } }

.hero h1 {
  font-size: 40px;
  line-height: 1.2;
  letter-spacing: 4px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  word-break: break-all;
}
.tagline { margin-top: 18px; color: var(--text); font-size: 16px; opacity: 0.92; line-height: 1.6; }
.hint { margin-top: 8px; color: var(--muted); font-size: 13px; }

.btn-primary, .btn-ghost {
  border: none;
  border-radius: 999px;
  padding: 14px 44px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn-primary {
  margin-top: 36px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 28px rgba(124, 92, 255, 0.4);
}
.btn-primary:active { transform: scale(0.96); }
.btn-ghost {
  margin-top: 14px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

/* ---------- quiz ---------- */
.quiz-head { display: flex; align-items: center; gap: 12px; margin: 8px 0 22px; }
.progress-wrap {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--card-2);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.3s ease;
}
.progress-text { color: var(--muted); font-size: 13px; white-space: nowrap; }

.question-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px 22px; }
.question-text { font-size: 19px; line-height: 1.6; font-weight: 600; }

.options { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.option {
  width: 100%;
  text-align: left;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease, background 0.15s ease;
}
.option:hover { border-color: var(--accent); }
.option:active { transform: scale(0.98); }
.option.selected { border-color: var(--accent); background: rgba(124, 92, 255, 0.18); }

/* ---------- result ---------- */
.result-head { text-align: center; padding-top: 8px; }
.kicker {
  display: inline-block;
  font-size: 13px;
  color: var(--accent-2);
  border: 1px solid rgba(255, 92, 138, 0.4);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 14px;
}
.result-visual { display: flex; justify-content: center; }
.result-img {
  width: 200px; height: 200px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--line);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  background: var(--card);
}
.result-emoji {
  width: 200px; height: 200px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 88px;
  background: radial-gradient(circle at 30% 25%, #2a2f55, #161a30 70%);
  border: 3px solid var(--line);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.result-name { margin-top: 18px; font-size: 30px; font-weight: 800; }
.result-code { margin-top: 4px; color: var(--muted); font-size: 15px; letter-spacing: 4px; }
.result-badge {
  margin-top: 10px;
  display: inline-block;
  font-size: 12px;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  margin-top: 18px;
}
.card h3 { font-size: 16px; margin-bottom: 14px; color: var(--text); }
.result-intro { font-size: 17px; font-weight: 700; color: var(--accent-2); margin-bottom: 10px; }
.result-desc { font-size: 15px; line-height: 1.8; color: #d5d8f2; }
.result-sub { margin-top: 12px; font-size: 13px; color: var(--muted); }

.dims { display: flex; flex-direction: column; gap: 14px; }
.dim-row { font-size: 13px; }
.dim-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.dim-name { color: var(--text); font-weight: 600; flex: 1; }
.dim-score { color: var(--muted); font-size: 12px; }
.dim-track { display: block; height: 8px; border-radius: 999px; background: var(--card-2); overflow: hidden; }
.dim-fill { display: block; height: 100%; border-radius: 999px; }
.dim-fill.L { background: var(--bad); }
.dim-fill.M { background: var(--warn); }
.dim-fill.H { background: var(--ok); }
.dim-level { width: 18px; text-align: center; font-weight: 800; flex-shrink: 0; }
.dim-level.L { color: var(--bad); }
.dim-level.M { color: var(--warn); }
.dim-level.H { color: var(--ok); }
.dim-explain { margin-top: 6px; color: var(--muted); line-height: 1.5; }

.result-actions { margin-top: 26px; display: flex; flex-direction: column; align-items: center; }

.toast {
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
