/* ============================================================
   星尘心理 · 测试三页制通用样式 v1.0
   三页：index.html（欢迎页）/ test.html（答题页）/ result.html（结果页）
   使用：每页 <link rel="stylesheet" href="css/style.css">
   主题色可通过本文件 :root 变量覆盖（建议各测试保留默认靛蓝）
   ============================================================ */

:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --primary-bg: rgba(99, 102, 241, 0.1);
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --text: #1f2937;
  --text-sub: #6b7280;
  --text-light: #9ca3af;
  --bg: #f5f6fa;
  --card: #ffffff;
  --line: #e5e7eb;
  --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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.7;
  min-height: 100vh;
}

/* ============ 通用容器 ============ */
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.page-center { justify-content: center; }

/* ============ 顶部 Logo ============ */
.logo-bar { text-align: center; padding: 20px 0 8px; }
.logo-bar img { max-height: 44px; }

/* ============ 欢迎页（index.html） ============ */
.welcome-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 32px;
  margin-top: 16px;
}
.welcome-badge {
  display: inline-block;
  background: var(--primary-bg);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}
.welcome-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.4;
}
.welcome-subtitle {
  color: var(--text-sub);
  font-size: 15px;
  margin-bottom: 24px;
}
.info-block {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.info-block h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.info-block ul { list-style: none; }
.info-block li {
  font-size: 14px;
  color: var(--text-sub);
  padding: 3px 0 3px 18px;
  position: relative;
}
.info-block li::before {
  content: '·';
  position: absolute;
  left: 4px;
  color: var(--primary);
  font-weight: 700;
}
.warning-block {
  background: #fffbea;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 13px;
  color: #92400e;
  margin-bottom: 24px;
  line-height: 1.6;
}
.start-btn {
  display: block;
  width: 100%;
  padding: 16px;
  background: var(--gradient);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
  transition: all 0.2s ease;
}
.start-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(99, 102, 241, 0.45); }
.start-btn:active { transform: translateY(0); }

/* ============ 答题页（test.html） ============ */
.test-header { margin-bottom: 16px; }
.progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 8px;
}
.progress-track {
  height: 8px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--gradient);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.question-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
}
.question-number {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}
.question-dimension {
  display: inline-block;
  font-size: 12px;
  background: var(--primary-bg);
  color: var(--primary-dark);
  padding: 2px 10px;
  border-radius: 12px;
  margin-bottom: 12px;
}
.question-text {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.7;
  margin-bottom: 24px;
  min-height: 3em;
}

.option-list { display: flex; flex-direction: column; gap: 10px; }
.option {
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  font-family: inherit;
}
.option:hover { background: #eceffb; }
.option.selected {
  background: var(--primary-bg);
  border-color: var(--primary);
  color: var(--primary-dark);
  font-weight: 600;
}

.nav-row {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.nav-btn {
  flex: 1;
  padding: 13px;
  border: none;
  border-radius: 25px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.btn-prev { background: var(--bg); color: var(--text-sub); }
.btn-prev:hover:not(:disabled) { background: var(--line); }
.btn-next { background: var(--primary); color: #fff; }
.btn-next:hover:not(:disabled) { background: var(--primary-dark); }
.nav-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.dots-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 20px;
  justify-content: center;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
  cursor: pointer;
  transition: all 0.2s ease;
}
.dot.answered { background: var(--primary-light); }
.dot.current { background: var(--primary); transform: scale(1.3); }

/* ============ 结果页（result.html） ============ */
.result-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
  margin-top: 16px;
}
.result-title {
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 20px;
}
.result-hero {
  background: var(--gradient);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 22px 20px;
  text-align: center;
  margin-bottom: 22px;
}
.result-hero .hero-title { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.result-hero .hero-content { font-size: 14px; line-height: 1.7; opacity: 0.95; text-align: left; }
.result-hero .hero-content p { margin-bottom: 6px; }
.result-hero .hero-content p:last-child { margin-bottom: 0; }

.score-display {
  text-align: center;
  padding: 20px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 22px;
}
.score-number { font-size: 40px; font-weight: 800; color: var(--primary); }
.score-label { font-size: 13px; color: var(--text-sub); margin-top: 2px; }

.section-block { margin-bottom: 24px; }
.section-block:last-child { margin-bottom: 0; }
.section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dimension-bar { margin-bottom: 16px; }
.dimension-bar:last-child { margin-bottom: 0; }
.dimension-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 6px;
}
.dimension-label-row .dim-score { color: var(--text-sub); }
.bar-track {
  height: 14px;
  background: var(--line);
  border-radius: 7px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 7px;
  transition: width 0.8s ease;
}

.dimension-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 12px;
}
.dimension-item:last-child { margin-bottom: 0; }
.dimension-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.dimension-item-name { font-weight: 700; font-size: 15px; }
.dimension-item-score {
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  padding: 3px 12px;
  border-radius: 14px;
}
.dimension-item-desc { font-size: 14px; color: var(--text-sub); line-height: 1.7; }

.result-note {
  background: #fffbea;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 13px;
  color: #92400e;
  margin-bottom: 22px;
  line-height: 1.6;
}

.result-actions { display: flex; gap: 12px; }
.result-btn {
  flex: 1;
  padding: 13px;
  border-radius: 25px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.btn-retry { background: var(--card); color: var(--primary); border: 2px solid var(--primary); }
.btn-retry:hover { background: var(--primary-bg); }
.btn-home { background: var(--gradient); color: #fff; border: none; }
.btn-home:hover { opacity: 0.92; }

/* ============ 页脚 / 返回 ============ */
.footer-note {
  text-align: center;
  color: var(--text-light);
  font-size: 12px;
  margin-top: 24px;
  line-height: 1.8;
}
.back-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 13px;
}
.back-link:hover { color: var(--primary); }

.hidden { display: none !important; }
.text-center { text-align: center; }

/* ============ 响应式 ============ */
@media (max-width: 520px) {
  .welcome-card, .result-card { padding: 26px 20px; }
  .question-card { padding: 22px 18px; }
  .welcome-title { font-size: 21px; }
  .question-text { font-size: 16px; }
  .result-actions { flex-direction: column; }
}
