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

:root {
  --primary: #5b6cff;
  --primary-dark: #4353e8;
  --accent: #ffb020;
  --bg: #f3f5ff;
  --text: #2b2f45;
  --text-light: #8a8fa8;
  --card: #ffffff;
}

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

#app { max-width: 480px; margin: 0 auto; min-height: 100vh; }

.screen { padding: 24px 20px 48px; animation: fadeIn 0.3s ease; }
.hidden { display: none !important; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.btn {
  display: block; width: 100%; border: none; border-radius: 14px;
  padding: 14px; font-size: 17px; font-weight: 600; cursor: pointer;
  transition: transform 0.1s ease;
}
.btn:active { transform: scale(0.97); }
.btn-lg { padding: 16px; font-size: 18px; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #7a5cff);
  color: #fff; box-shadow: 0 6px 16px rgba(91, 108, 255, 0.35);
}
.btn-ghost { background: transparent; color: var(--primary); margin-top: 12px; }

/* 首页 */
.hero {
  background: linear-gradient(160deg, #5b6cff 0%, #7a5cff 60%, #9a5cff 100%);
  border-radius: 0 0 32px 32px; margin: -24px -20px 0; padding: 72px 28px 48px;
  text-align: center; color: #fff; min-height: 82vh;
  display: flex; flex-direction: column; justify-content: center;
}
.hero-badge {
  display: inline-block; margin: 0 auto 20px; padding: 6px 16px;
  background: rgba(255, 255, 255, 0.2); border-radius: 999px; font-size: 13px;
}
.hero h1 { font-size: 34px; line-height: 1.35; letter-spacing: 1px; }
.hero-sub { margin: 18px 0 36px; font-size: 16px; opacity: 0.9; line-height: 1.7; }
.hero .btn-primary { background: #fff; color: var(--primary-dark); box-shadow: 0 8px 20px rgba(0,0,0,0.15); }
.hero-tip { margin-top: 18px; font-size: 13px; opacity: 0.75; }

/* 学段选择 */
.screen-title { font-size: 22px; margin: 24px 0 8px; }
.screen-sub { color: var(--text-light); font-size: 14px; margin-bottom: 24px; }

.band-list { display: flex; flex-direction: column; gap: 14px; }
.band-card {
  display: flex; align-items: center; gap: 16px; text-align: left;
  background: var(--card); border: 2px solid transparent; border-radius: 16px;
  padding: 20px; cursor: pointer; transition: all 0.15s ease;
}
.band-card:active { border-color: var(--primary); transform: scale(0.98); }
.band-emoji { font-size: 32px; }
.band-name { font-size: 18px; font-weight: 700; }
.band-desc { margin-left: auto; font-size: 13px; color: var(--text-light); }

/* 答题 */
.quiz-head { margin-bottom: 16px; }
.progress { height: 8px; background: #e2e6fb; border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), #9a5cff); border-radius: 999px; transition: width 0.3s ease; }
.quiz-meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--text-light); }

.quiz-card { background: var(--card); border-radius: 20px; padding: 24px 20px; box-shadow: 0 4px 20px rgba(91,108,255,0.08); }
.quiz-dim { display: inline-block; font-size: 12px; color: var(--primary); background: #eef0ff; padding: 4px 12px; border-radius: 999px; margin-bottom: 14px; }
.quiz-text { font-size: 18px; line-height: 1.6; margin-bottom: 22px; }

.options { display: flex; flex-direction: column; gap: 12px; }
.option-btn {
  text-align: left; background: #f7f8ff; border: 2px solid #e6e9fb; border-radius: 14px;
  padding: 15px 16px; font-size: 15px; line-height: 1.5; color: var(--text); cursor: pointer;
  transition: all 0.15s ease;
}
.option-btn.selected { border-color: var(--primary); background: #eef0ff; color: var(--primary-dark); font-weight: 600; }

/* 加载 */
.loading-box { text-align: center; padding-top: 40vh; color: var(--text-light); }
.spinner {
  width: 44px; height: 44px; margin: 0 auto 18px;
  border: 4px solid #dfe3fb; border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 结果页 */
.result-card { background: var(--card); border-radius: 24px; padding: 32px 24px; text-align: center; box-shadow: 0 6px 24px rgba(91,108,255,0.1); }
.result-label { font-size: 14px; color: var(--text-light); margin-bottom: 16px; }

.score-ring {
  width: 148px; height: 148px; margin: 0 auto 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--primary) 0deg, #e6e9fb 0deg);
  position: relative;
}
.score-ring::before { content: ""; position: absolute; inset: 12px; background: #fff; border-radius: 50%; }
.score-num { position: relative; font-size: 40px; font-weight: 800; color: var(--primary-dark); }
.score-num::after { content: " 分"; font-size: 14px; font-weight: 400; color: var(--text-light); }

.level-tag {
  display: inline-block; padding: 6px 18px; border-radius: 999px;
  background: linear-gradient(135deg, #ffb020, #ff8a3d); color: #fff;
  font-size: 16px; font-weight: 700; margin-bottom: 12px;
}
.level-desc { font-size: 14px; color: var(--text); line-height: 1.7; margin-bottom: 22px; }

.dim-list { text-align: left; margin-bottom: 22px; }
.dim-row { margin-bottom: 14px; }
.dim-row-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.dim-row-head .dim-name { font-weight: 600; }
.dim-row-head .dim-pct { color: var(--primary-dark); font-weight: 700; }
.dim-track { height: 8px; background: #eef0fb; border-radius: 999px; overflow: hidden; }
.dim-fill { height: 100%; background: linear-gradient(90deg, #5b6cff, #9a5cff); border-radius: 999px; }
.dim-desc { font-size: 12px; color: var(--text-light); margin-top: 4px; }

.suggestion-box { background: #fff8ec; border: 1px solid #ffe3b3; border-radius: 14px; padding: 16px; text-align: left; margin-bottom: 24px; }
.suggestion-title { font-size: 14px; font-weight: 700; color: #b36a00; margin-bottom: 6px; }
.suggestion-box p { font-size: 14px; line-height: 1.7; color: #7a5a20; }

/* 表单 */
.form-card { background: var(--card); border-radius: 20px; padding: 24px 20px; box-shadow: 0 4px 20px rgba(91,108,255,0.08); }
.field { display: block; margin-bottom: 18px; }
.field > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.field input[type="text"], .field input[type="tel"] {
  width: 100%; padding: 13px 14px; border: 2px solid #e6e9fb; border-radius: 12px;
  font-size: 16px; outline: none; transition: border-color 0.15s;
}
.field input:focus { border-color: var(--primary); }

.radio-row { display: flex; gap: 10px; }
.radio-row label {
  flex: 1; text-align: center; padding: 12px 0; border: 2px solid #e6e9fb;
  border-radius: 12px; font-size: 15px; cursor: pointer;
}
.radio-row input { display: none; }
.radio-row label:has(input:checked) { border-color: var(--primary); background: #eef0ff; color: var(--primary-dark); font-weight: 600; }

.form-tip { text-align: center; font-size: 12px; color: var(--text-light); margin-top: 14px; }

/* 成功页 */
.success-box { text-align: center; padding-top: 24vh; }
.success-icon { font-size: 56px; margin-bottom: 16px; }
.success-box h2 { font-size: 24px; margin-bottom: 12px; }
.success-box p { color: var(--text-light); font-size: 14px; line-height: 1.8; margin-bottom: 28px; }

/* 提示 */
.toast {
  position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%);
  background: rgba(30, 32, 48, 0.9); color: #fff; padding: 10px 20px;
  border-radius: 999px; font-size: 14px; z-index: 99; white-space: nowrap;
}

.share-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 100;
  color: #fff; text-align: right; padding: 16px 24px; font-size: 15px;
}
.share-arrow { font-size: 42px; line-height: 1; }
