/* ============ 基础 ============ */
:root {
  --primary: #5b5bd6;
  --primary-dark: #4747b8;
  --primary-light: #eeeefc;
  --ink: #1c1c28;
  --ink-2: #55556a;
  --ink-3: #9a9aab;
  --line: #e8e8f0;
  --bg: #f7f7fb;
  --card: #ffffff;
  --radius: 18px;
  --shadow: 0 8px 32px rgba(40, 40, 90, 0.07);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.page { display: none; min-height: 100vh; }
.page.active { display: block; animation: fadeIn .4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============ 首页 ============ */
#page-home {
  display: none;
  place-items: center;
  background: radial-gradient(1200px 600px at 50% -10%, #e6e6fb 0%, transparent 60%),
              radial-gradient(800px 500px at 90% 100%, #e9f0ff 0%, transparent 60%),
              var(--bg);
}
#page-home.active { display: grid; }
.home-wrap { text-align: center; padding: 48px 24px; max-width: 640px; }
.home-badge {
  display: inline-block; font-size: 12px; letter-spacing: 2px; font-weight: 700;
  color: var(--primary); background: var(--primary-light);
  padding: 7px 16px; border-radius: 20px; margin-bottom: 28px;
}
.home-title { font-size: clamp(38px, 8vw, 60px); font-weight: 800; letter-spacing: -2px; line-height: 1.15; }
.home-title .dot { color: var(--primary); }
.home-sub { margin-top: 14px; font-size: clamp(18px, 4vw, 24px); font-weight: 600; color: var(--ink); }
.home-desc { margin-top: 18px; color: var(--ink-2); font-size: 15px; }
.feature-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin: 40px 0; padding: 22px 12px;
  background: rgba(255,255,255,.7); border: 1px solid rgba(255,255,255,.9);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.feature-num { font-size: 27px; font-weight: 800; color: var(--primary); }
.feature-label { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--primary); color: #fff; border: none;
  padding: 16px 42px; border-radius: 30px; font-size: 17px; font-weight: 700;
  cursor: pointer; box-shadow: 0 8px 24px rgba(91,91,214,.3);
  transition: transform .18s, box-shadow .18s, background .18s;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 12px 30px rgba(91,91,214,.38); }
.btn-primary .arrow { font-size: 20px; }
.resume-hint { margin-top: 20px; font-size: 14px; color: var(--ink-2); }
.resume-hint a { color: var(--primary); font-weight: 600; text-decoration: none; }
.resume-hint a:hover { text-decoration: underline; }
.home-foot { margin-top: 26px; font-size: 12px; color: var(--ink-3); }

/* ============ 答题页 ============ */
#page-test { background: var(--bg); }
.test-wrap { max-width: 720px; margin: 0 auto; padding: 0 20px 40px; }
.test-header { display: flex; justify-content: space-between; align-items: center; padding: 26px 2px 14px; }
.test-brand { font-size: 15px; font-weight: 800; color: var(--primary); letter-spacing: 1px; }
.test-counter { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.progress-track { height: 6px; background: #e6e6f0; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, #7c7ce8, var(--primary)); border-radius: 4px; transition: width .3s ease; }
.question-card {
  position: relative; margin-top: 34px; padding: 48px 40px 44px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--line); min-height: 190px;
  display: flex; align-items: center;
}
.q-mark { position: absolute; top: 14px; left: 22px; font-size: 64px; font-family: Georgia, serif; color: #e4e4f5; line-height: 1; }
.q-mark.close { top: auto; bottom: -18px; left: auto; right: 26px; }
.question-text { font-size: clamp(19px, 4.5vw, 25px); font-weight: 600; line-height: 1.6; width: 100%; position: relative; z-index: 1; }
.scale-hint { text-align: center; margin: 32px 0 16px; font-size: 14px; color: var(--ink-3); }
.scale-options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.scale-btn {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 16px 4px 14px; cursor: pointer; text-align: center;
  transition: all .16s; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.scale-btn:hover { border-color: var(--primary); background: #fafaff; transform: translateY(-2px); }
.scale-btn.selected { border-color: var(--primary); background: var(--primary-light); }
.s-num { font-size: 20px; font-weight: 800; color: var(--ink); }
.scale-btn.selected .s-num { color: var(--primary); }
.s-label { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.scale-btn.selected .s-label { color: var(--primary); }
.test-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; }
.btn-ghost { background: none; border: none; color: var(--primary); font-size: 14px; font-weight: 600; cursor: pointer; padding: 8px 4px; }
.btn-ghost:disabled { color: var(--ink-3); cursor: default; }
.nav-hint { font-size: 12px; color: var(--ink-3); }
.privacy-note { text-align: center; margin-top: 34px; font-size: 12px; color: var(--ink-3); }

/* ============ 结果页 ============ */
#page-result { background: var(--bg); }
.result-wrap { max-width: 680px; margin: 0 auto; padding: 0 20px 60px; }
.result-top { text-align: center; padding: 56px 0 38px; }
.result-label { font-size: 14px; color: var(--ink-2); letter-spacing: 2px; }
.result-code {
  font-size: clamp(64px, 16vw, 96px); font-weight: 800; letter-spacing: 6px;
  line-height: 1.2; margin: 10px 0 4px;
  background: linear-gradient(135deg, #6a6ae0, #9b6ae0);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.result-name { font-size: 22px; font-weight: 700; }
.result-tagline { margin-top: 12px; color: var(--ink-2); font-size: 15px; }
.result-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 28px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.rc-title { font-size: 17px; font-weight: 700; margin-bottom: 18px; padding-left: 12px; border-left: 4px solid var(--primary); }
.rc-text { font-size: 15px; color: var(--ink-2); line-height: 1.9; }
.dim-bars { display: flex; flex-direction: column; gap: 20px; }
.dim-row {}
.dim-labels { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.dim-labels .left { color: var(--primary); }
.dim-labels .right { color: #d97a8a; }
.dim-labels .mid { color: var(--ink-3); font-size: 12px; font-weight: 400; }
.dim-track { height: 10px; border-radius: 6px; background: #f0f0f7; position: relative; overflow: hidden; }
.dim-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: linear-gradient(90deg, #8a8ae8, var(--primary)); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.dim-marker { position: absolute; top: -3px; bottom: -3px; width: 3px; background: var(--ink); border-radius: 2px; left: 50%; opacity: .35; }
.dim-note { font-size: 12px; color: var(--ink-3); margin-top: 20px; line-height: 1.7; }
.trait-list { list-style: none; }
.trait-list li { position: relative; padding-left: 24px; margin-bottom: 12px; font-size: 15px; color: var(--ink-2); line-height: 1.7; }
.trait-list li::before { content: ''; position: absolute; left: 2px; top: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.result-actions { display: flex; gap: 12px; justify-content: center; margin-top: 34px; flex-wrap: wrap; }
.btn-outline { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); padding: 15px 32px; border-radius: 30px; font-size: 16px; font-weight: 700; cursor: pointer; transition: all .18s; }
.btn-outline:hover { background: var(--primary-light); }
.result-foot { text-align: center; margin-top: 30px; font-size: 12px; color: var(--ink-3); line-height: 1.7; }

/* ============ Toast ============ */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 12px 24px; border-radius: 30px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all .3s; z-index: 999;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ 响应式 ============ */
@media (max-width: 480px) {
  .feature-row { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .question-card { padding: 40px 24px 38px; min-height: 160px; }
  .scale-options { grid-template-columns: repeat(5, 1fr); gap: 5px; }
  .scale-btn { padding: 13px 2px 11px; border-radius: 10px; }
  .s-num { font-size: 17px; }
  .s-label { font-size: 9px; }
  .result-card { padding: 22px 20px; }
  .nav-hint { display: none; }
}
