/* ========== 全局重置 & 变量 ========== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --success: #16a34a;
  --warning: #ca8a04;
  --danger: #dc2626;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.12);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

/* ========== 页面切换 ========== */
.screen {
  display: none;
  min-height: 100vh;
  padding: 24px 20px;
  animation: fadeIn 0.4s ease;
}

.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

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

/* ========== 欢迎页 ========== */
.welcome-container {
  width: 100%;
  max-width: 480px;
  text-align: center;
}

.brand-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  border-radius: 100px;
  margin-bottom: 24px;
}

.welcome-title {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 36px;
}

.feature-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
  text-align: left;
}

.feature-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.feature-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.feature-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 32px;
  padding: 20px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
}

.stat-item {
  text-align: center;
}

.stat-num {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}

.welcome-note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-light);
}

/* ========== 按钮 ========== */
.btn-primary {
  display: inline-block;
  padding: 14px 32px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  background: var(--text-light);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  display: inline-block;
  padding: 12px 28px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-large {
  padding: 16px 40px;
  font-size: 17px;
}

.btn-block {
  width: 100%;
  text-align: center;
}

/* ========== 答题页 ========== */
.quiz-container {
  width: 100%;
  max-width: 520px;
}

.progress-header {
  margin-bottom: 32px;
}

.progress-info {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.progress-current {
  color: var(--primary);
  font-size: 22px;
}

.progress-total {
  color: var(--text-light);
}

.progress-bar-wrapper {
  width: 100%;
  height: 6px;
  background: var(--border-light);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: 100px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-category {
  font-size: 13px;
  color: var(--text-light);
  font-weight: 600;
}

.question-area {
  margin-bottom: 32px;
}

.question-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 8px;
  color: var(--text);
}

.question-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

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

.option-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  font-size: 15px;
  font-weight: 500;
}

.option-item:hover {
  border-color: var(--primary-light);
  background: rgba(37, 99, 235, 0.02);
}

.option-item.selected {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.06);
  color: var(--primary-dark);
}

.option-radio {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: var(--transition);
}

.option-item.selected .option-radio {
  border-color: var(--primary);
}

.option-item.selected .option-radio::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
}

.option-text {
  flex: 1;
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* ========== 留资页 ========== */
.lead-container {
  width: 100%;
  max-width: 440px;
}

.lead-preview {
  text-align: center;
  padding: 32px 24px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.preview-lock-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.lead-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
}

.lead-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.preview-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-bottom: 8px;
}

.preview-score-num {
  font-size: 48px;
  font-weight: 900;
  color: var(--primary);
  filter: blur(8px);
}

.preview-score-max {
  font-size: 20px;
  color: var(--text-light);
  font-weight: 600;
}

.preview-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.lead-form {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.required {
  color: var(--danger);
}

.form-input {
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder {
  color: var(--text-light);
}

.form-error {
  color: var(--danger);
  font-size: 14px;
  min-height: 20px;
}

.lead-privacy {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
}

/* ========== 结果页 ========== */
.result-container {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-score-card {
  text-align: center;
  padding: 36px 24px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.result-tier-icon {
  font-size: 56px;
  margin-bottom: 12px;
}

.result-score-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-bottom: 8px;
}

.result-score-num {
  font-size: 56px;
  font-weight: 900;
  line-height: 1;
}

.result-score-max {
  font-size: 24px;
  color: var(--text-light);
  font-weight: 600;
}

.result-tier-label {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 12px;
}

.result-tier-summary {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 360px;
  margin: 0 auto;
  line-height: 1.7;
}

.result-chart-card,
.result-details-card,
.result-suggestions-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  padding: 24px;
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 16px;
}

.radar-chart-container {
  display: flex;
  justify-content: center;
}

.details-list,
.suggestions-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.details-list li,
.suggestions-list li {
  padding-left: 24px;
  position: relative;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.details-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

.suggestions-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: bold;
}

.result-cta-card {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(124, 58, 237, 0.05));
  border-radius: var(--radius);
  border: 1px solid rgba(37, 99, 235, 0.15);
  padding: 28px 24px;
  text-align: center;
}

.cta-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
}

.cta-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
}

/* ========== 加载动画 ========== */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========== 响应式 ========== */
@media (max-width: 480px) {
  .screen {
    padding: 16px 16px;
  }

  .welcome-title {
    font-size: 28px;
  }

  .question-title {
    font-size: 19px;
  }

  .option-item {
    padding: 16px;
    font-size: 14px;
  }

  .result-score-num {
    font-size: 44px;
  }

  .stats-row {
    gap: 12px;
    padding: 16px;
  }
}
