/* ============================================================
   MBTI 本地测试 · 样式（移动端优先）
   主题色：靛蓝 #4f46e5 系；支持桌面端最大 640px 内容宽度
   ============================================================ */

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef2ff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --border: #e5e7eb;
  --bg: #f5f6f8;
  --card: #ffffff;
  --good: #059669;
  --bad: #d97706;
  --radius: 12px;
  --radius-small: 8px;
}

[v-cloak] { display: none; }

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

html { -webkit-text-size-adjust: 100%; }

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

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

/* ---------- 通用卡片与按钮 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.btn {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  padding: 10px 22px;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:active { background: var(--primary-dark); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:active { background: #f3f4f6; }

.btn-big {
  display: block;
  width: 100%;
  padding: 14px;
  font-size: 17px;
  font-weight: 600;
}

.btn-small { padding: 6px 14px; font-size: 13px; }

/* ---------- 首页 ---------- */
.hero { text-align: center; padding: 28px 0 24px; }

.hero-badge {
  display: inline-block;
  font-size: 12px;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 999px;
  padding: 4px 14px;
  margin-bottom: 14px;
}

.hero h1 { font-size: 30px; letter-spacing: 1px; }

.hero-sub { color: var(--text-muted); font-size: 14px; margin-top: 8px; }

.features { display: flex; flex-direction: column; gap: 16px; }

.feature-item { display: flex; gap: 14px; align-items: flex-start; }

.feature-icon {
  flex: none;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-small);
  font-weight: 700;
}

.feature-name { font-weight: 600; font-size: 15px; }
.feature-desc { color: var(--text-muted); font-size: 13px; }

.home-actions { margin: 24px 0 20px; display: flex; flex-direction: column; gap: 10px; }

.disclaimer {
  color: var(--text-light);
  font-size: 12px;
  text-align: center;
  margin-top: 20px;
  padding: 0 8px;
}

/* ---------- 版本选择卡 ---------- */
.tier-select {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.tier-card {
  flex: 1;
  text-align: center;
  cursor: pointer;
  position: relative;
  margin-bottom: 0;
  transition: border-color .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 12px;
}
.tier-card:hover { border-color: var(--primary); }
.tier-card .btn { margin-top: 8px; }

.tier-card-hot { border-color: var(--primary); }

.tier-hot-badge {
  position: absolute;
  top: -10px; right: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  border-radius: 999px;
  padding: 2px 10px;
}

.tier-name { font-size: 17px; font-weight: 700; }
.tier-meta { font-size: 12px; color: var(--primary); font-weight: 600; }
.tier-desc { font-size: 12px; color: var(--text-muted); }

/* ---------- 结果页：条线匹配卡片 ---------- */
.match-top {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--border);
}
.match-top:first-of-type { padding-top: 4px; }

.match-rank {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-light);
  background: var(--bg);
  margin-top: 2px;
}
.rank-1 { color: #fff; background: var(--primary); }
.rank-2 { color: var(--primary); background: var(--primary-light); }
.rank-3 { color: var(--primary); background: var(--primary-light); }

.match-body { flex: 1; min-width: 0; }

.match-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.match-name { font-size: 15px; font-weight: 600; }

.match-level { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.match-level.lv-high { color: var(--primary); font-weight: 700; }
.match-level.lv-mid { color: var(--primary); }

.match-bar-track {
  height: 8px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.match-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
}

.match-req { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }

.match-all-title {
  font-size: 14px;
  font-weight: 700;
  margin: 18px 0 10px;
}

.match-list { display: flex; flex-direction: column; gap: 8px; }

.match-row { display: flex; align-items: center; gap: 10px; }

.match-row-name {
  flex: none;
  width: 158px;
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-row-track {
  flex: 1;
  height: 6px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}

.match-row-fill {
  height: 100%;
  background: var(--primary);
  opacity: .55;
  border-radius: 999px;
}
.match-row:first-child .match-row-fill,
.match-row:nth-child(2) .match-row-fill,
.match-row:nth-child(3) .match-row-fill { opacity: 1; }

.match-row-score {
  flex: none;
  width: 28px;
  text-align: right;
  font-size: 12px;
  color: var(--text-light);
}

.it-advice {
  margin-top: 18px;
  background: var(--primary-light);
  border-radius: var(--radius-small);
  padding: 12px 14px;
}

.it-advice-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.it-advice-text { font-size: 13px; color: var(--text); }

.match-warn {
  margin-top: 14px;
  font-size: 12px;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-small);
  padding: 10px 12px;
}

.match-disclaimer {
  margin-top: 14px;
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.5;
}

/* ---------- 结果页：A/T 第五维度 ---------- */
.at-block {
  margin-top: 16px;
  padding: 14px;
  background: var(--primary-light);
  border-radius: var(--radius-small);
}

.at-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.at-block .dim-bar { margin-bottom: 6px; }

.at-desc { font-size: 12px; color: var(--text-muted); line-height: 1.6; }

/* ---------- 分享图弹层 ---------- */
.share-modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, .6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.share-panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  max-width: 420px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  text-align: center;
}

.share-title { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }

.share-img {
  width: 100%;
  border-radius: var(--radius-small);
  border: 1px solid var(--border);
  display: block;
}

.share-actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }

/* ---------- 历史记录：对比勾选 ---------- */
.compare-tip {
  font-size: 12px;
  color: var(--text-light);
  margin: -6px 0 12px;
  padding: 0 4px;
}

.compare-check {
  flex: none;
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 4px;
}

.compare-check input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }

.record-selected { border-color: var(--primary); background: var(--primary-light); }

/* ---------- 对比页 ---------- */
.compare-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  text-align: center;
  padding: 24px 16px;
}

.compare-col { flex: 1; min-width: 0; }

.compare-time { font-size: 12px; color: var(--text-light); margin-bottom: 6px; }

.compare-type { font-size: 26px; font-weight: 800; color: var(--primary); letter-spacing: 1px; }

.compare-type.compare-changed { color: var(--bad); }

.compare-name { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.compare-arrow { font-size: 22px; color: var(--text-light); }

.cmp-row { padding: 10px 0; border-bottom: 1px dashed var(--border); }
.cmp-row:last-of-type { border-bottom: none; }

.cmp-bars { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }

.cmp-bar-line {
  height: 8px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}

.cmp-bar-fill { height: 100%; border-radius: 999px; }
.cmp-bar-fill.cmp-old { background: var(--text-light); }
.cmp-bar-fill.cmp-new { background: var(--primary); }

.cmp-delta { font-size: 12px; color: var(--text-muted); }

.cmp-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-muted);
}

.cmp-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: -1px;
}
.cmp-dot.cmp-old { background: var(--text-light); }
.cmp-dot.cmp-new { background: var(--primary); }

.cmp-note { margin-left: auto; color: var(--text-light); }

/* ---------- 续答卡片 ---------- */
.resume-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.resume-title { font-weight: 600; }
.resume-sub { color: var(--text-muted); font-size: 13px; }
.resume-actions { display: flex; gap: 8px; }

/* ---------- 答题页 ---------- */
.quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.quiz-count { color: var(--text-muted); font-size: 14px; font-weight: 600; }

.progress-track {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 20px;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width .2s ease;
}

.question-card { text-align: center; padding: 32px 20px; }

.question-text { font-size: 19px; font-weight: 600; line-height: 1.5; margin-bottom: 28px; }

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

.option-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.option-btn:active { border-color: var(--primary); }

.option-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.option-marker {
  flex: none;
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-radius: 50%;
  transition: border-color .15s, box-shadow .15s;
}
.option-btn.selected .option-marker {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 4px var(--primary);
}

.option-text { flex: 1; }

.quiz-hint { color: var(--text-light); font-size: 12px; margin-top: 20px; }

/* ---------- 结果页 ---------- */
.result-hero { text-align: center; padding: 32px 20px; }

/* 结果页顶部人格插画 */
.result-art {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 16px;
  border: 4px solid var(--primary-light, #eef0ff);
  box-shadow: 0 4px 16px rgba(79, 70, 229, .18);
}

.result-type {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--primary);
}

.result-name { font-size: 17px; font-weight: 600; margin-top: 6px; }

.result-tagline { color: var(--text-muted); font-size: 14px; margin-top: 8px; }

.notice {
  font-size: 13px;
  color: #92400e;
  background: #fffbeb;
  border-color: #fde68a;
}
.notice-tie {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-left: 10px;
  border-left: 4px solid var(--primary);
}

/* 四维度强度条 */
.dim-row { padding: 12px 0; border-bottom: 1px dashed var(--border); }
.dim-row:last-child { border-bottom: none; }

.dim-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.dim-labels .dim-win { color: var(--text); font-weight: 700; }
.dim-name { font-size: 12px; color: var(--text-light); }

.dim-bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.dim-fill-first { background: var(--primary); }
.dim-fill-second { background: #e0e7ff; }

.dim-pcts {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-muted);
}
.dim-pcts .pct-win { color: var(--primary); font-weight: 700; }
.dim-count { font-size: 12px; color: var(--text-light); }

.dim-desc {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-light);
  margin-top: 6px;
}

/* 人格档案 */
.profile-desc { font-size: 14px; color: var(--text); margin-bottom: 20px; }

.profile-cols { display: flex; gap: 16px; margin-bottom: 20px; }
.profile-col { flex: 1; min-width: 0; }

.col-title { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.col-good { color: var(--good); }
.col-bad { color: var(--bad); }

.trait-list { list-style: none; }
.trait-list li {
  font-size: 13px;
  color: var(--text-muted);
  padding: 3px 0 3px 16px;
  position: relative;
}
.trait-list li::before {
  content: "";
  position: absolute;
  left: 2px; top: 11px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--border);
}

.career-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.career-tag {
  font-size: 13px;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 999px;
  padding: 5px 14px;
}

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
}

/* ---------- 历史记录页 ---------- */
.record-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.record-main { cursor: pointer; min-width: 0; }
.record-type { font-size: 17px; font-weight: 700; color: var(--primary); }
.record-name { font-size: 14px; font-weight: 400; color: var(--text); margin-left: 4px; }
.record-time { font-size: 12px; color: var(--text-light); margin-top: 2px; }

.empty-card { text-align: center; color: var(--text-light); padding: 40px 20px; }

/* ---------- 桌面端适配 ---------- */
@media (min-width: 640px) {
  .page { padding-top: 40px; }
  .hero { padding-top: 40px; }
  .option-btn:hover { border-color: var(--primary); }
  .btn-primary:hover { background: var(--primary-dark); }
  .btn-ghost:hover { background: #f3f4f6; }
  .record-main:hover .record-type { text-decoration: underline; }
}
