/* =====================================================
   quiz.css — 心理测试 H5 统一样式
   适用于所有测试页面（开始页 / 答题页 / 结果页）
   颜色通过 CSS 变量 --c1 / --c2 / --bg1 / --bg2 自定义
   ===================================================== */

/* ── CSS 变量默认值（紫色系，可在各页面 <style> 里覆盖） ── */
:root {
  --c1: #5a3d9a;
  --c2: #7b68ee;
  --c-light: #f3e5ff;
  --bg1: #f9f7ff;
  --bg2: #e8e3ff;
  --text-main: #2c3e50;
  --text-sub: #6a7c9c;
  --text-muted: #a0aec0;
  --border: #e2e8f0;
  --shadow: rgba(90, 61, 154, 0.1);
}

/* ── 重置 ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* ── body ── */
body {
  font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg1) 0%, var(--bg2) 100%);
  color: #333;
  line-height: 1.6;
  padding: 15px;
  min-height: 100vh;
}

/* ── 容器 ── */
.container {
  max-width: 600px;
  margin: 0 auto;
}

/* ── 隐藏 ── */
.hidden { display: none !important; }

/* =====================================================
   开始页（Start Screen）
   ===================================================== */

/* 顶部标题区 */
.header {
  text-align: center;
  margin-bottom: 24px;
  padding: 20px 0 10px;
}

.header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--c1);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.35;
}

.header p {
  color: var(--text-sub);
  font-size: 14px;
  max-width: 85%;
  margin: 0 auto;
}

/* 开始卡片（与问题卡同样风格） */
.start-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px var(--shadow);
  padding: 24px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.start-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: linear-gradient(to bottom, var(--c1), var(--c2));
}

.start-intro {
  font-size: 15px;
  color: var(--text-main);
  line-height: 1.7;
  margin-bottom: 14px;
}

.start-tips {
  background: var(--c-light);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--c1);
  list-style: none;
  margin-top: 10px;
}

.start-tips li {
  padding: 4px 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.start-tips li::before {
  content: '•';
  color: var(--c2);
  flex-shrink: 0;
}

/* =====================================================
   答题页（Quiz Screen）
   ===================================================== */

/* 进度条 */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.progress-label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 40px;
}

.progress-bar-bg {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(to right, var(--c1), var(--c2));
  border-radius: 6px;
  transition: width 0.3s ease;
}

/* 问题卡片 */
.question-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px var(--shadow);
  padding: 22px 20px 18px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}

.question-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: linear-gradient(to bottom, var(--c1), var(--c2));
}

.question-number {
  display: inline-block;
  background: var(--c-light);
  color: var(--c1);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.question-text {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 18px;
  line-height: 1.5;
}

/* 选项网格 */
.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.options.single-col {
  grid-template-columns: 1fr;
}

/* 选项按钮 */
.option {
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 13px 12px;
  font-size: 14px;
  color: #4a5568;
  cursor: pointer;
  text-align: center;
  transition: all 0.18s ease;
  line-height: 1.4;
  user-select: none;
  -webkit-user-select: none;
}

.option:active {
  transform: scale(0.97);
}

.option.selected,
.option.active {
  background: linear-gradient(135deg, var(--c1), var(--c2));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px var(--shadow);
  font-weight: 600;
}

/* 评分型选项（5选1竖排，SAS/SDS等） */
.option-score {
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  color: #4a5568;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
  width: 100%;
  display: block;
  margin-bottom: 8px;
}

.option-score:active { transform: scale(0.98); }

.option-score.selected,
.option-score.active {
  background: linear-gradient(135deg, var(--c1), var(--c2));
  color: #fff;
  border-color: transparent;
  font-weight: 600;
}

/* 导航按钮容器 */
.button-container {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

/* 上一题 */
.prev-btn {
  flex: 1;
  padding: 13px;
  background: #f3f3f7;
  color: #888;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}

.prev-btn:active { opacity: 0.8; transform: scale(0.98); }
.prev-btn:disabled { opacity: 0.38; cursor: not-allowed; }

/* 下一题 / 提交 */
.next-btn {
  flex: 2;
  padding: 13px;
  background: linear-gradient(to right, var(--c1), var(--c2));
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--shadow);
  transition: all 0.18s;
}

.next-btn:active { opacity: 0.85; transform: scale(0.98); }
.next-btn:disabled { opacity: 0.38; cursor: not-allowed; }

/* =====================================================
   结果页（Result Screen）
   ===================================================== */

.result-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px var(--shadow);
  padding: 28px 22px;
  text-align: center;
  margin-bottom: 16px;
}

.result-icon {
  font-size: 60px;
  display: block;
  margin: 0 auto 12px;
  line-height: 1;
}

.result-title {
  font-size: 14px;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.result-name {
  font-size: 26px;
  font-weight: 800;
  color: var(--c1);
  margin-bottom: 12px;
  line-height: 1.3;
}

.result-desc {
  font-size: 15px;
  color: #555;
  line-height: 1.7;
  margin-bottom: 18px;
  text-align: left;
}

/* 分析块 */
.result-block {
  background: var(--c-light);
  border-radius: 12px;
  padding: 16px;
  margin: 14px 0;
  text-align: left;
}

.result-block h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--c1);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.result-block p,
.result-block li {
  font-size: 14px;
  color: #4a5568;
  line-height: 1.7;
}

.result-block ul {
  padding-left: 16px;
}

/* 分数展示 */
.score-display {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 16px 0;
}

.score-box {
  background: var(--c-light);
  border-radius: 12px;
  padding: 14px 20px;
  min-width: 90px;
}

.score-box .score-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--c1);
  display: block;
  line-height: 1;
}

.score-box .score-label {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 4px;
  display: block;
}

/* ── 主按钮（开始测试 / 重新测试） ── */
.btn-primary {
  display: block;
  width: 100%;
  padding: 15px;
  background: linear-gradient(to right, var(--c1), var(--c2));
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--shadow);
  transition: opacity 0.18s, transform 0.18s;
  margin-top: 12px;
  text-align: center;
}

.btn-primary:active { opacity: 0.85; transform: scale(0.98); }

/* ── 次按钮 ── */
.btn-secondary {
  display: block;
  width: 100%;
  padding: 13px;
  background: #f3f3f7;
  color: #666;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.18s;
  margin-top: 10px;
  text-align: center;
}

.btn-secondary:active { opacity: 0.75; }

/* ── 微信联系区域 ── */
.wechat-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px var(--shadow);
  padding: 22px;
  text-align: center;
  margin-top: 14px;
}

.wechat-card h3 {
  font-size: 16px;
  color: var(--c1);
  font-weight: 700;
  margin-bottom: 12px;
}

.wechat-card img {
  width: 140px;
  height: 140px;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin: 8px auto;
  display: block;
}

.wechat-id {
  font-size: 15px;
  font-weight: 700;
  color: var(--c1);
  margin: 8px 0 4px;
}

.wechat-tip {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── 页脚 ── */
.footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ── 提示/警告块 ── */
.notice {
  background: #fffbe6;
  border-left: 3px solid #faad14;
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  font-size: 13px;
  color: #7a5a00;
  margin: 12px 0;
  line-height: 1.6;
}

/* ── 响应式 ── */
@media (max-width: 480px) {
  .options { grid-template-columns: 1fr; }
  .question-text { font-size: 16px; }
  .header h1 { font-size: 20px; }
}
