/* ===== Reset & Variables ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

@import url('https://fonts.googleapis.com/css2?family=ZCOOL+KuaiLe&family=Noto+Sans+SC:wght@400;500;700&display=swap');

:root {
  --coral:         #FF6B6B;
  --orange:        #FF8E53;
  --yellow:        #FFD93D;
  --teal:          #4ECDC4;
  --sky:           #74C0FC;
  --pink:          #FF8FB1;
  --mint:          #A8E6CF;
  --lavender:      #C3B1E1;

  --primary:       var(--coral);
  --primary-light: #FFE8E8;
  --bg:            #FFFBF0;
  --card:          #FFFFFF;
  --text:          #3D2C2C;
  --text-muted:    #A08888;
  --border:        #FFE4CC;
  --radius:        20px;
  --radius-pill:   50px;
  --shadow:        0 4px 20px rgba(255,107,107,0.14);
  --shadow-soft:   0 2px 14px rgba(0,0,0,0.06);
}

html { font-size: 16px; }

body {
  font-family: 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle, #FFD93D50 2px, transparent 2px),
    radial-gradient(circle, #FF6B6B20 1.5px, transparent 1.5px);
  background-size: 40px 40px, 20px 20px;
  background-position: 0 0, 10px 10px;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== Page System ===== */
.page { display: none; min-height: 100vh; padding-bottom: 48px; }
.page.active { display: block; }

/* ===== Start Page Hero ===== */
.start-hero {
  text-align: center;
  padding: 52px 24px 76px;
  background: linear-gradient(145deg, #FF6B6B 0%, #FF8E53 38%, #FFD93D 72%, #A8E6CF 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}

/* Floating sparkle dots */
.start-hero::before {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  background: rgba(255,255,255,0.38);
  border-radius: 50%;
  top: 18px;
  left: 16px;
  pointer-events: none;
  box-shadow:
    52px 18px 0 -2px rgba(255,255,255,0.28),
    108px  6px 0  3px rgba(255,255,255,0.32),
    190px 22px 0 -1px rgba(255,255,255,0.22),
    265px  8px 0  2px rgba(255,255,255,0.26),
    318px 16px 0 -2px rgba(255,255,255,0.2),
     28px 68px 0  1px rgba(255,255,255,0.22),
    150px 62px 0 -3px rgba(255,255,255,0.3),
    280px 58px 0  2px rgba(255,255,255,0.2);
}

/* Rounded wave bottom */
.start-hero::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: -5%;
  width: 110%;
  height: 52px;
  background: var(--bg);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.hero-icon {
  font-size: 76px;
  margin-bottom: 16px;
  display: block;
  animation: hero-bounce 3s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.18));
}

@keyframes hero-bounce {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%       { transform: translateY(-14px) rotate(4deg); }
}

.start-hero h1 {
  font-family: 'ZCOOL KuaiLe', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 1px;
  margin-bottom: 12px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.hero-sub {
  font-size: 14px;
  opacity: 0.92;
  line-height: 1.85;
  font-weight: 500;
}

/* ===== Start Form ===== */
.start-form {
  background: var(--card);
  border-radius: var(--radius) var(--radius) 0 0;
  margin-top: -20px;
  padding: 36px 20px 28px;
  position: relative;
  z-index: 1;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.04);
}

.form-label {
  font-family: 'ZCOOL KuaiLe', 'PingFang SC', sans-serif;
  font-size: 19px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 16px;
}

.age-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.age-chip {
  flex: 1 1 calc(33.33% - 10px);
  padding: 14px 0;
  border: 2.5px solid var(--border);
  border-radius: var(--radius-pill);
  background: #fff;
  font-family: 'ZCOOL KuaiLe', 'PingFang SC', sans-serif;
  font-size: 17px;
  font-weight: 400;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-soft);
}

.age-chip:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

/* Each age chip gets its own candy color when selected */
.age-chip:nth-child(1).selected { background: #FFE8E8; border-color: #FF6B6B; color: #FF6B6B; transform: scale(1.06) translateY(-2px); box-shadow: 0 6px 16px rgba(255,107,107,0.28); }
.age-chip:nth-child(2).selected { background: #FFF0E3; border-color: #FF8E53; color: #D96830; transform: scale(1.06) translateY(-2px); box-shadow: 0 6px 16px rgba(255,142,83,0.28); }
.age-chip:nth-child(3).selected { background: #FFFBE0; border-color: #E6AA00; color: #A37800; transform: scale(1.06) translateY(-2px); box-shadow: 0 6px 16px rgba(230,170,0,0.28); }
.age-chip:nth-child(4).selected { background: #EAFFF0; border-color: #51CF66; color: #2B8A3E; transform: scale(1.06) translateY(-2px); box-shadow: 0 6px 16px rgba(81,207,102,0.28); }
.age-chip:nth-child(5).selected { background: #E8F4FF; border-color: #4DABF7; color: #1971C2; transform: scale(1.06) translateY(-2px); box-shadow: 0 6px 16px rgba(77,171,247,0.28); }
.age-chip:nth-child(6).selected { background: #F5EEFF; border-color: #CC5DE8; color: #862E9C; transform: scale(1.06) translateY(-2px); box-shadow: 0 6px 16px rgba(204,93,232,0.28); }

.form-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.85;
  margin-top: 16px;
}

.dim-preview {
  margin-top: 28px;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px;
  border: 2px dashed var(--border);
}

.preview-title {
  font-family: 'ZCOOL KuaiLe', sans-serif;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-align: center;
}

.dim-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.dim-tags span {
  font-size: 13px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  color: var(--text);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dim-tags span:hover {
  transform: translateY(-2px) scale(1.05);
}

/* ===== Buttons ===== */
.btn-primary {
  display: block;
  width: 100%;
  padding: 17px;
  background: linear-gradient(135deg, #FF6B6B, #FF8E53);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-family: 'ZCOOL KuaiLe', sans-serif;
  font-size: 19px;
  font-weight: 400;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 6px 22px rgba(255,107,107,0.42), 0 2px 0 rgba(0,0,0,0.08) inset;
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.18), transparent 60%);
  border-radius: inherit;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(255,107,107,0.46);
}

.btn-primary:active {
  transform: scale(0.97) translateY(0);
  box-shadow: 0 4px 12px rgba(255,107,107,0.3);
}

.btn-secondary {
  display: block;
  width: 100%;
  padding: 15px;
  background: #fff;
  color: var(--teal);
  border: 2.5px solid var(--teal);
  border-radius: var(--radius-pill);
  font-family: 'ZCOOL KuaiLe', sans-serif;
  font-size: 17px;
  font-weight: 400;
  cursor: pointer;
  margin-top: 14px;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-soft);
}

.btn-secondary:hover {
  background: #E6FAFA;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(78,205,196,0.25);
}

.btn-secondary:active { transform: scale(0.97); }

/* ===== Quiz Page ===== */
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px 10px;
  background: #fff;
  border-bottom: 2px dashed var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.btn-back {
  background: none;
  border: none;
  font-family: 'ZCOOL KuaiLe', sans-serif;
  font-size: 15px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 0;
  visibility: hidden;
  min-width: 64px;
  transition: color 0.15s;
}

.btn-back:hover { color: var(--coral); }

.progress-text {
  font-family: 'ZCOOL KuaiLe', sans-serif;
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 400;
}

.progress-bar-wrap {
  height: 7px;
  background: var(--border);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #FF6B6B, #FF8E53, #FFD93D, #4ECDC4, #74C0FC);
  background-size: 300% 100%;
  transition: width 0.4s cubic-bezier(0.34, 1.1, 0.64, 1);
  width: 0%;
  border-radius: 0 4px 4px 0;
}

.quiz-body {
  padding: 28px 20px 20px;
  animation: fadeUp 0.25s ease;
}

.dim-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--coral);
  font-family: 'ZCOOL KuaiLe', sans-serif;
  font-size: 14px;
  font-weight: 400;
  padding: 6px 18px;
  border-radius: var(--radius-pill);
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(255,107,107,0.15);
}

.question-text {
  font-family: 'ZCOOL KuaiLe', 'PingFang SC', sans-serif;
  font-size: 19px;
  font-weight: 400;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 28px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-btn {
  width: 100%;
  padding: 15px 20px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: 'ZCOOL KuaiLe', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: all 0.18s cubic-bezier(0.34, 1.3, 0.64, 1);
  line-height: 1.4;
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  gap: 10px;
}

.opt-emoji {
  font-size: 20px;
  flex-shrink: 0;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.option-btn:hover {
  border-color: var(--coral);
  background: #FFF5F5;
  transform: translateX(6px);
  box-shadow: 0 4px 16px rgba(255,107,107,0.15);
}

.option-btn:hover .opt-emoji {
  transform: scale(1.25) rotate(8deg);
}

.option-btn.selected {
  border-color: var(--coral);
  background: linear-gradient(to right, #FFF0F0, #FFF8F8);
  color: var(--coral);
  transform: translateX(6px);
  box-shadow: 0 4px 16px rgba(255,107,107,0.2);
}

.option-btn.selected .opt-emoji {
  transform: scale(1.25) rotate(8deg);
}

/* ===== Result Page ===== */
.result-hero {
  text-align: center;
  padding: 52px 24px 76px;
  background: linear-gradient(145deg, #4ECDC4 0%, #45B7D1 35%, #74C0FC 70%, #CC5DE8 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.result-hero::before {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  background: rgba(255,255,255,0.38);
  border-radius: 50%;
  top: 16px;
  left: 14px;
  pointer-events: none;
  box-shadow:
    58px 22px 0 -2px rgba(255,255,255,0.26),
    118px  6px 0  3px rgba(255,255,255,0.32),
    195px 18px 0 -1px rgba(255,255,255,0.2),
    278px 10px 0  2px rgba(255,255,255,0.26),
     24px 62px 0  1px rgba(255,255,255,0.2),
    160px 68px 0 -2px rgba(255,255,255,0.3),
    290px 54px 0  2px rgba(255,255,255,0.2);
}

.result-hero::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: -5%;
  width: 110%;
  height: 52px;
  background: var(--bg);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.result-title-icon {
  font-size: 64px;
  margin-bottom: 12px;
  display: block;
  animation: celebrate 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes celebrate {
  0%   { transform: scale(0) rotate(-25deg); opacity: 0; }
  60%  { transform: scale(1.22) rotate(6deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.result-hero h2 {
  font-family: 'ZCOOL KuaiLe', sans-serif;
  font-size: 26px;
  font-weight: 400;
  margin-bottom: 8px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.result-sub { font-size: 14px; opacity: 0.9; }

/* ===== Talent Badges ===== */
.talent-badges {
  display: flex;
  gap: 14px;
  padding: 30px 20px 0;
  justify-content: center;
  flex-wrap: wrap;
}

.talent-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 3px solid var(--dim-color, var(--coral));
  border-radius: var(--radius-pill);
  padding: 12px 24px;
  box-shadow: 0 5px 18px rgba(0,0,0,0.1), 3px 4px 0 var(--dim-color, var(--coral));
}

.talent-badge:nth-child(1) {
  animation: badge-pop-1 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

.talent-badge:nth-child(2) {
  animation: badge-pop-2 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.25s both;
}

@keyframes badge-pop-1 {
  0%   { opacity: 0; transform: scale(0.4) rotate(-14deg); }
  100% { opacity: 1; transform: rotate(-2.5deg); }
}

@keyframes badge-pop-2 {
  0%   { opacity: 0; transform: scale(0.4) rotate(14deg); }
  100% { opacity: 1; transform: rotate(1.8deg); }
}

.badge-emoji { font-size: 24px; }

.badge-label {
  font-family: 'ZCOOL KuaiLe', sans-serif;
  font-size: 18px;
  font-weight: 400;
  color: var(--dim-color, var(--coral));
}

/* ===== Radar Card ===== */
.radar-card {
  margin: 24px 20px 0;
  background: #fff;
  border-radius: var(--radius);
  padding: 20px 16px 16px;
  box-shadow: var(--shadow-soft);
  border: 2px dashed var(--border);
}

.radar-title {
  font-family: 'ZCOOL KuaiLe', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 10px;
}

.radar-wrap {
  position: relative;
  max-width: 320px;
  margin: 0 auto;
}

/* ===== Result Descriptions ===== */
.result-desc {
  padding: 16px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.desc-block {
  background: #fff;
  border-radius: var(--radius);
  padding: 18px 18px 18px 22px;
  box-shadow: var(--shadow-soft);
  border-left: 5px solid var(--dim-color, var(--coral));
}

.desc-block h3 {
  font-family: 'ZCOOL KuaiLe', sans-serif;
  font-size: 16px;
  font-weight: 400;
  margin-bottom: 10px;
  color: var(--text);
}

.desc-block p {
  font-size: 14px;
  line-height: 1.85;
  color: var(--text-muted);
}

.result-actions { padding: 28px 20px 0; }

.result-footer {
  text-align: center;
  padding: 20px 20px 0;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.75;
}

/* ===== Share Card ===== */
#share-card {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 375px;
  background: #fff;
  padding: 28px 20px 24px;
  font-family: 'ZCOOL KuaiLe', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
}

.sc-header { text-align: center; margin-bottom: 20px; }
.sc-title { font-size: 20px; font-weight: 400; color: #3D2C2C; margin-bottom: 4px; }
.sc-sub { font-size: 11px; color: #A08888; }
.sc-badges { display: flex; gap: 10px; justify-content: center; margin-bottom: 20px; flex-wrap: wrap; }
.sc-badge { display: flex; align-items: center; gap: 6px; border: 2.5px solid; border-radius: 50px; padding: 7px 14px; }
.sc-bars { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.sc-row { display: flex; align-items: center; gap: 8px; }
.sc-row-label { font-size: 11px; color: #A08888; width: 56px; text-align: right; flex-shrink: 0; }
.sc-track { flex: 1; height: 8px; background: #FFF0E8; border-radius: 4px; overflow: hidden; }
.sc-fill { height: 100%; border-radius: 4px; }
.sc-pct { font-size: 11px; color: #A08888; width: 30px; flex-shrink: 0; }
.sc-footer { text-align: center; font-size: 11px; color: #C4A8A8; border-top: 2px dashed #FFE4CC; padding-top: 14px; }

/* ===== Animations ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-6px); }
  40%     { transform: translateX(6px); }
  60%     { transform: translateX(-4px); }
  80%     { transform: translateX(4px); }
}
