/* ===== 全局 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --bg1: #e0f2ff;
  --bg2: #ede4ff;
  --bg3: #ffe8f0;
  --ink: #1a2238;
  --ink-soft: #5b6478;
  --ink-mute: #98a0b3;
  --white: #ffffff;
  --shadow: 0 8px 32px rgba(60, 80, 140, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
}

html, body {
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, var(--bg1) 0%, var(--bg2) 50%, var(--bg3) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* ===== 页面切换 ===== */
.page { display: none; min-height: 100vh; padding: 28px 20px 48px; align-items: center; justify-content: center; }
.page.active { display: flex; }

/* ===== 开屏页 ===== */
.start-wrap { text-align: center; max-width: 420px; width: 100%; }
.logo-emoji {
  font-size: 72px;
  margin-bottom: 8px;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.title {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 1px;
  margin: 8px 0 14px;
  background: linear-gradient(120deg, #4facfe 0%, #764ba2 60%, #f5576c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.subtitle { font-size: 18px; color: var(--ink); font-weight: 600; margin-bottom: 6px; }
.hint { font-size: 14px; color: var(--ink-soft); margin-bottom: 32px; }
.cta-btn {
  display: inline-block;
  width: 100%;
  max-width: 280px;
  padding: 16px 0;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  border: none;
  border-radius: 999px;
  background: linear-gradient(120deg, #4facfe 0%, #764ba2 100%);
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(118, 75, 162, 0.35);
  transition: transform .18s ease, box-shadow .18s ease;
}
.cta-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(118, 75, 162, 0.45); }
.cta-btn:active { transform: translateY(0); }
.footnote { font-size: 12px; color: var(--ink-mute); margin-top: 20px; }

/* ===== 答题页 ===== */
.quiz-wrap { width: 100%; max-width: 560px; }
.progress-top { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.progress-track {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4facfe 0%, #764ba2 100%);
  transition: width .4s cubic-bezier(.4, 0, .2, 1);
}
.progress-text { font-size: 13px; color: var(--ink-soft); font-weight: 600; white-space: nowrap; }

.question-text {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 24px;
  min-height: 60px;
}
.options { display: flex; flex-direction: column; gap: 12px; }

.option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px 20px;
  font-size: 16px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
  opacity: 0;
  animation: optIn .35s ease forwards;
}
@keyframes optIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.option-btn:hover { border-color: #4facfe; background: #fff; transform: translateY(-1px); }
.option-btn:active { transform: scale(0.99); }
.option-btn.selected {
  border-color: #764ba2;
  background: linear-gradient(120deg, #4facfe14 0%, #764ba214 100%), #fff;
}
.opt-letter {
  flex: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(120deg, #4facfe 0%, #764ba2 100%);
  color: #fff;
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.opt-text { flex: 1; }

/* ===== 结果页 ===== */
.result-wrap { width: 100%; max-width: 440px; text-align: center; }
.result-card {
  position: relative;
  padding: 32px 24px 28px;
  border-radius: var(--radius);
  color: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.result-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 0%, rgba(255,255,255,0.25), transparent 60%);
  pointer-events: none;
}
.card-header { font-size: 13px; font-weight: 600; opacity: 0.9; letter-spacing: 2px; margin-bottom: 6px; }
.result-emoji { font-size: 80px; line-height: 1; margin: 6px 0 10px; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15)); }
.result-label { font-size: 13px; opacity: 0.92; margin-bottom: 4px; }
.result-name { font-size: 30px; font-weight: 800; line-height: 1.2; margin-bottom: 8px; }
.result-tagline { font-size: 15px; opacity: 0.95; margin-bottom: 18px; }
.surf-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.surf-label { font-size: 13px; opacity: 0.9; }
.surf-index { font-size: 18px; font-weight: 800; }

.result-desc {
  margin: 22px 4px 0;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-soft);
  text-align: left;
  background: rgba(255, 255, 255, 0.6);
  padding: 20px 22px;
  border-radius: var(--radius);
}

.result-actions { display: flex; gap: 12px; margin: 22px 0 10px; }
.action-btn {
  flex: 1;
  padding: 14px 0;
  font-size: 15px;
  font-weight: 700;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.action-btn.primary {
  color: #fff;
  background: linear-gradient(120deg, #4facfe 0%, #764ba2 100%);
  box-shadow: 0 6px 16px rgba(118, 75, 162, 0.3);
}
.action-btn.ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid rgba(118, 75, 162, 0.25);
}
.action-btn:hover { transform: translateY(-2px); }
.share-hint { font-size: 12px; color: var(--ink-mute); }

/* ===== toast ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(26, 34, 56, 0.92);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 99;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 响应式 ===== */
@media (max-width: 380px) {
  .title { font-size: 34px; }
  .logo-emoji { font-size: 60px; }
  .question-text { font-size: 19px; }
  .option-btn { padding: 16px 16px; font-size: 15px; }
  .result-emoji { font-size: 68px; }
  .result-name { font-size: 26px; }
  .result-desc { font-size: 14px; padding: 16px 18px; }
}
@media (min-width: 640px) {
  .question-text { font-size: 24px; }
  .title { font-size: 46px; }
}
