/* === 基础变量 === */
:root {
  --bg-primary: #0B1628;
  --bg-secondary: #111D32;
  --bg-card: #162033;
  --bg-card-hover: #1a2740;
  --brand-gold: #c49a3c;
  --brand-gold-light: #d4ac0d;
  --text-primary: #E8ECF1;
  --text-secondary: #8899AA;
  --text-muted: #5A6B7D;
  --border: #1E3048;
  --danger: #E74C3C;
  --success: #27AE60;
  --warning: #F39C12;
  --info: #3498db;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
}

/* === Reset === */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* === 页面切换 === */
.page { display: none; min-height: 100vh; }
.page.active { display: flex; flex-direction: column; }

/* === 欢迎页 === */
.welcome-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
}
.brand-logo {
  font-size: 14px;
  color: var(--brand-gold);
  letter-spacing: 4px;
  margin-bottom: 32px;
  text-transform: uppercase;
}
.welcome-container h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.3;
}
.subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 40px;
}
.welcome-features {
  text-align: left;
  margin-bottom: 48px;
  width: 100%;
  max-width: 360px;
}
.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  color: var(--text-secondary);
  font-size: 14px;
}
.feature-icon {
  color: var(--brand-gold);
  font-size: 10px;
}

/* === 按钮 === */
.btn-primary {
  background: linear-gradient(135deg, var(--brand-gold), #a67c2e);
  color: #fff;
  border: none;
  padding: 14px 48px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  max-width: 320px;
  transition: all 0.2s;
  letter-spacing: 1px;
}
.btn-primary:active { transform: scale(0.98); opacity: 0.9; }
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 14px 32px;
  border-radius: var(--radius);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:active { background: var(--bg-card); }

/* === 进度条 === */
.progress-bar-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--bg-secondary);
  z-index: 100;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-gold), var(--brand-gold-light));
  transition: width 0.4s ease;
  width: 0%;
}
.progress-text {
  position: fixed;
  top: 12px;
  right: 16px;
  font-size: 12px;
  color: var(--text-muted);
  z-index: 100;
}

/* === 答题页 === */
.quiz-container {
  flex: 1;
  padding: 48px 20px 24px;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}
.dimension-badge {
  display: inline-block;
  font-size: 11px;
  color: var(--brand-gold);
  background: rgba(196,154,60,0.1);
  border: 1px solid rgba(196,154,60,0.2);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 8px;
}
.dimension-label {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 28px;
  line-height: 1.3;
}

/* === 题目卡片 === */
.question-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
.question-number {
  font-size: 12px;
  color: var(--brand-gold);
  font-weight: 600;
  margin-bottom: 8px;
}
.question-text {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 20px;
  font-weight: 500;
}

/* === 分值选项卡 === */
.level-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.level-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  width: 100%;
  font-family: inherit;
  color: var(--text-primary);
}
.level-option:active { transform: scale(0.99); }
.level-option .level-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.2s;
}
.level-option .level-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  padding-top: 3px;
  transition: color 0.2s;
}
.level-option.selected {
  border-color: var(--brand-gold);
  background: rgba(196,154,60,0.08);
}
.level-option.selected .level-num {
  background: var(--brand-gold);
  color: #fff;
}
.level-option.selected .level-desc {
  color: var(--text-primary);
}
.level-option.lv-1.selected { border-color: var(--danger); background: rgba(231,76,60,0.06); }
.level-option.lv-1.selected .level-num { background: var(--danger); }
.level-option.lv-2.selected { border-color: #E67E22; background: rgba(230,126,34,0.06); }
.level-option.lv-2.selected .level-num { background: #E67E22; }
.level-option.lv-3.selected { border-color: var(--warning); background: rgba(243,156,18,0.06); }
.level-option.lv-3.selected .level-num { background: var(--warning); }
.level-option.lv-4.selected { border-color: var(--brand-gold); background: rgba(196,154,60,0.06); }
.level-option.lv-4.selected .level-num { background: var(--brand-gold); }
.level-option.lv-5.selected { border-color: var(--success); background: rgba(39,174,96,0.06); }
.level-option.lv-5.selected .level-num { background: var(--success); }

/* === 答题导航 === */
.quiz-nav {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  padding-bottom: 32px;
}
.quiz-nav .btn-primary { flex: 1; max-width: none; }
.quiz-nav .btn-secondary { flex: 0 0 auto; }
#btn-prev { display: none; }

/* === 开放题页 === */
.open-container {
  flex: 1;
  padding: 48px 20px 24px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}
.open-container h2 {
  font-size: 22px;
  margin-bottom: 8px;
}
.open-hint {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 32px;
}
.open-question {
  margin-bottom: 24px;
}
.open-question label {
  display: block;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 10px;
  line-height: 1.5;
}
.open-question textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}
.open-question textarea:focus { border-color: var(--brand-gold); }
.open-question textarea::placeholder { color: var(--text-muted); }
.open-container .btn-primary {
  margin-top: 16px;
  max-width: none;
}

/* === 留资页 === */
.lead-container {
  flex: 1;
  padding: 48px 20px 24px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}
.report-ready {
  text-align: center;
  margin-bottom: 36px;
}
.report-ready-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--success), #1e8449);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  margin-bottom: 16px;
}
.report-ready h2 {
  font-size: 20px;
  margin-bottom: 8px;
}
.report-ready p {
  color: var(--text-secondary);
  font-size: 14px;
}
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.required { color: var(--danger); }
.form-group input,
.form-group select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.form-group input:focus,
.form-group select:focus { border-color: var(--brand-gold); }
.form-group input::placeholder { color: var(--text-muted); }
.form-group select { color: var(--text-secondary); }
.form-group select option { background: var(--bg-secondary); }
#lead-form .btn-primary {
  margin-top: 8px;
  max-width: none;
}

/* === 报告页 === */
.report-container {
  padding: 0 0 48px;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

/* 报告封面 */
.report-cover {
  text-align: center;
  padding: 48px 24px 40px;
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border-bottom: 1px solid var(--border);
}
.report-cover .brand-logo { margin-bottom: 24px; }
.report-cover h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
}
.report-cover .report-name {
  font-size: 18px;
  color: var(--brand-gold);
  margin-bottom: 8px;
}
.report-date {
  font-size: 13px;
  color: var(--text-muted);
}

/* 总览 */
.report-overview {
  padding: 32px 20px;
  border-bottom: 1px solid var(--border);
}
.score-display {
  text-align: center;
  margin-bottom: 24px;
}
.score-big {
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.score-total {
  font-size: 20px;
  color: var(--text-muted);
  font-weight: 400;
}
.level-badge {
  display: inline-block;
  padding: 6px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 12px;
}
.level-start { background: rgba(231,76,60,0.15); color: var(--danger); border: 1px solid rgba(231,76,60,0.3); }
.level-growth { background: rgba(243,156,18,0.15); color: var(--warning); border: 1px solid rgba(243,156,18,0.3); }
.level-mature { background: rgba(39,174,96,0.15); color: var(--success); border: 1px solid rgba(39,174,96,0.3); }
.level-leading { background: rgba(52,152,219,0.15); color: var(--info); border: 1px solid rgba(52,152,219,0.3); }
.overview-text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-top: 20px;
}

/* 雷达图 */
.report-radar {
  padding: 32px 16px;
  border-bottom: 1px solid var(--border);
}
.report-section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  padding: 0 4px;
}
.radar-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}
.radar-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-muted);
}
.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

/* 维度详细分析 */
.report-dimensions {
  padding: 28px 20px;
  border-bottom: 1px solid var(--border);
}
.dimension-result {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 20px 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.dim-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.dim-name {
  font-size: 15px;
  font-weight: 600;
}
.dim-score {
  font-size: 14px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
}
.dim-score.score-low { background: rgba(231,76,60,0.15); color: var(--danger); }
.dim-score.score-mid { background: rgba(243,156,18,0.15); color: var(--warning); }
.dim-score.score-high { background: rgba(39,174,96,0.15); color: var(--success); }
.dim-bar {
  height: 4px;
  background: var(--bg-secondary);
  border-radius: 2px;
  margin-bottom: 12px;
  overflow: hidden;
}
.dim-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}
.dim-bar-fill.bar-low { background: var(--danger); }
.dim-bar-fill.bar-mid { background: var(--warning); }
.dim-bar-fill.bar-high { background: var(--success); }
.dim-level-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--brand-gold);
}
.dim-feedback {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 10px;
}
.dim-recommendation {
  font-size: 12px;
  color: var(--brand-gold);
  background: rgba(196,154,60,0.08);
  border: 1px solid rgba(196,154,60,0.15);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  line-height: 1.6;
}

/* 最弱维度高亮 */
.weakest-highlight {
  padding: 28px 20px;
  border-bottom: 1px solid var(--border);
}
.weakest-card {
  background: linear-gradient(135deg, rgba(231,76,60,0.08), rgba(196,154,60,0.05));
  border: 1px solid rgba(231,76,60,0.2);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius);
  padding: 24px 20px;
}
.weakest-card .weakest-label {
  font-size: 11px;
  color: var(--danger);
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.weakest-card .weakest-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
}
.weakest-card .weakest-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* CTA */
.report-cta {
  padding: 40px 20px;
  text-align: center;
}
.report-cta h3 {
  font-size: 18px;
  margin-bottom: 12px;
}
.report-cta p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
}
.report-cta .btn-primary {
  max-width: 300px;
  margin: 0 auto 20px;
  display: block;
  text-decoration: none;
  text-align: center;
  line-height: 1;
}
.report-bottom-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 20px;
  border: 1px solid var(--border);
  text-align: left;
  margin: 0 20px;
}
.report-bottom-text strong {
  color: var(--brand-gold);
}

/* === 响应式 === */
@media (min-width: 768px) {
  .welcome-container h1 { font-size: 36px; }
  .question-text { font-size: 16px; }
  .report-container { padding: 0 20px 48px; }
}

/* === 动画 === */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.3s ease forwards; }

/* === 加载状态 === */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11,22,40,0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--brand-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-secondary);
}
