/* 16PF 独立版样式 - 移动端优先 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #eef2ff;
  --bg: #f5f7ff;
  --text: #1e293b;
  --text-sub: #64748b;
  --card: #ffffff;
  --border: #e2e8f0;
  --radius: 16px;
  --green: #10b981;
  --orange: #f59e0b;
  --red: #ef4444;
}

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

#app {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px 40px;
  min-height: 100vh;
}

.hidden { display: none !important; }
.tip { color: var(--red); font-size: 14px; min-height: 20px; margin-top: 8px; text-align: center; }
.tip.show { display: block; }

/* ---------- 首页 ---------- */
.hero {
  text-align: center;
  padding: 44px 0 26px;
}
.hero-title {
  font-size: 34px;
  font-weight: 800;
  background: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 2px;
}
.hero-sub { color: var(--text-sub); font-size: 15px; margin-top: 8px; }
.hero-badge {
  display: inline-block;
  margin-top: 14px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 600;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.05);
}
.card h2 { font-size: 18px; margin-bottom: 12px; }
.card p { color: var(--text-sub); font-size: 14px; margin-bottom: 10px; }

.feature-list { list-style: none; margin-top: 6px; }
.feature-list li { font-size: 14px; color: var(--text-sub); padding: 6px 0; border-bottom: 1px dashed var(--border); }
.feature-list li:last-child { border-bottom: none; }
.feature-list b { color: var(--primary); font-size: 16px; }

.gender-group { display: flex; gap: 14px; margin: 14px 0 18px; }
.gender-opt { flex: 1; cursor: pointer; }
.gender-opt input { display: none; }
.gender-box {
  display: block;
  text-align: center;
  padding: 16px 0;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-sub);
  transition: all 0.2s;
  background: #fff;
}
.gender-opt input:checked + .gender-box {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--primary-light);
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 22px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-block { width: 100%; display: block; }
.btn-ghost {
  background: #fff;
  color: var(--primary-dark);
  border: 1.5px solid var(--primary);
  border-radius: 12px;
  padding: 13px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }

.foot { text-align: center; color: #94a3b8; font-size: 12px; padding: 18px 0 6px; }

/* ---------- 答题页 ---------- */
.quiz-top { position: sticky; top: 0; z-index: 10; background: var(--bg); padding: 14px 0 10px; }
.quiz-progress {
  height: 8px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
}
.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 99px;
  transition: width 0.3s;
}
.quiz-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-sub);
  margin-top: 8px;
}

.quiz-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 20px;
  margin-top: 14px;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.06);
  min-height: 260px;
}
.q-content {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.8;
  margin-bottom: 24px;
  word-break: break-word;
}
.q-options { display: flex; flex-direction: column; gap: 12px; }
.opt-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  transition: all 0.15s;
}
.opt-btn:active { transform: scale(0.99); }
.opt-btn.selected { border-color: var(--primary); background: var(--primary-light); }
.opt-tag {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #f1f5f9;
  color: var(--text-sub);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.opt-btn.selected .opt-tag { background: var(--primary); color: #fff; }
.opt-text { flex: 1; word-break: break-word; }

.quiz-nav {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}
.quiz-nav .btn-primary, .quiz-nav .btn-ghost { flex: 1; }

/* ---------- 报告页 ---------- */
.report-hero { text-align: center; padding: 34px 0 18px; }
.report-hero h1 {
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(135deg, #4f46e5, #9333ea);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.report-meta { color: var(--text-sub); font-size: 14px; margin-top: 10px; }
.report-meta span { margin: 0 10px; }

.lie-box { border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.lie-title { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.lie-title b { font-size: 20px; }
.lie-text { font-size: 14px; }
.lie-good { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.lie-mid { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.lie-bad { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}
.tag i { font-style: normal; font-size: 12px; opacity: 0.75; }
.tag.high { background: var(--primary-light); color: var(--primary-dark); border: 1px solid #c7d2fe; }
.tag.low { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.tag-mid { background: #f1f5f9; color: var(--text-sub); border: 1px solid var(--border); }

.radar-wrap { position: relative; width: 100%; }
.radar-wrap canvas { width: 100%; height: auto; display: block; }
.card-note { color: #94a3b8; font-size: 13px; margin-top: 6px; }

.factor-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: #fff;
}
.factor-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.factor-alias {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.factor-name { font-weight: 700; font-size: 15px; flex: 1; }
.factor-score { color: var(--primary-dark); font-weight: 800; font-size: 16px; }

.factor-bar {
  position: relative;
  height: 10px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: visible;
  margin-bottom: 10px;
}
.factor-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 99px;
  transition: width 0.6s;
}
.factor-bar-mark {
  position: absolute;
  top: -3px;
  width: 4px;
  height: 16px;
  border-radius: 4px;
  background: #1e293b;
  transform: translateX(-2px);
}
.factor-desc { font-size: 14px; color: var(--text-sub); margin-bottom: 10px; }
.factor-features { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.feat { font-size: 13px; color: var(--text-sub); }
.feat b { display: block; color: var(--text); font-size: 13px; margin-bottom: 4px; }
.sec-bar .factor-bar-fill { background: linear-gradient(90deg, #10b981, #34d399); }

.intro-text, .notes-text { font-size: 14px; color: var(--text-sub); }
.notes-text p { margin-bottom: 10px; }

.report-actions { display: flex; gap: 12px; margin-top: 20px; }
.report-actions .btn-primary, .report-actions .btn-ghost { flex: 1; }

/* ---------- 打印 ---------- */
@media print {
  body { background: #fff; }
  #app { max-width: none; padding: 0; }
  .hidden { display: none !important; }
  .report-actions { display: none; }
  .card { box-shadow: none; break-inside: avoid; }
  .radar-wrap canvas { width: 560px; }
}

/* ---------- 历史记录 ---------- */
.btn-gap { margin-top: 10px; }
.history-list { display: flex; flex-direction: column; gap: 12px; }
.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.05);
}
.history-item-info { flex: 1; min-width: 0; }
.history-item-date { font-weight: 700; font-size: 15px; }
.history-item-meta { color: var(--text-sub); font-size: 13px; margin-top: 2px; }
.history-item .btn-ghost { padding: 9px 16px; font-size: 13px; flex: none; }
.history-empty { text-align: center; color: var(--text-sub); font-size: 14px; padding: 40px 0; }

/* ---------- 恢复提示弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(30, 41, 59, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-box {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 18px;
  padding: 26px 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  text-align: center;
}
.modal-title { font-size: 19px; font-weight: 800; margin-bottom: 10px; }
.modal-text { font-size: 14px; color: var(--text-sub); margin-bottom: 20px; line-height: 1.7; }
.modal-actions { display: flex; gap: 12px; }
.modal-actions .btn-primary, .modal-actions .btn-ghost { flex: 1; padding: 12px 10px; font-size: 14px; }
