:root {
  --bg: #ffffff;
  --bg-2: #f7f6fb;
  --panel: #ffffff;
  --panel-2: #f4f2fa;
  --line: #e6e2f0;
  --text: #2b2436;
  --text-dim: #6b6380;
  --text-faint: #9a92ad;
  --accent: #f0b35a;
  --accent-2: #e58a6a;
  --gold: #e8a13c;
  --purple: #8a6fd1;
  --red: #e06b6b;
  --green: #4caf6e;
  --blue: #4a90d9;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.app { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* ===== 屏幕切换 ===== */
.screen { display: none; animation: fadeIn .4s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ===== 欢迎页 ===== */
.hero-card {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 28px;
  padding: 60px 0;
}
.hero-kicker {
  letter-spacing: 4px;
  font-size: 13px;
  color: var(--gold);
  font-weight: 600;
}
.hero-card h1 {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(120deg, #d98a2b, #e8a13c, #e06b5a);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.sub {
  color: var(--text-dim);
  font-size: 16px;
  max-width: 460px;
}
.hint { color: var(--text-faint); font-size: 14px; }

/* 密码门槛 */
.pass-gate { width: 100%; max-width: 320px; margin: 0 auto 6px; }
.pass-input-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 50px; padding: 6px 6px 6px 20px;
  transition: border-color .15s ease;
}
.pass-input-row:focus-within { border-color: var(--gold); }
.pass-input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 15px; color: var(--text);
  letter-spacing: 4px; text-align: center;
}
.pass-input::placeholder { letter-spacing: 1px; color: var(--text-faint); }
.pass-submit {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%;
  border: none; cursor: pointer;
  background: linear-gradient(120deg, var(--gold), var(--accent-2));
  color: #2a1c0a; font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease;
}
.pass-submit:hover { transform: scale(1.05); }
.pass-error {
  color: var(--red); font-size: 13px; margin-top: 8px;
  display: none;
}
.pass-error.show { display: block; animation: shake .3s ease; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.primary-btn {
  color: #2a1c0a;
  border: none;
  font-size: 17px;
  font-weight: 700;
  padding: 15px 52px;
  border-radius: 50px;
  cursor: pointer;
  letter-spacing: 2px;
  transition: transform .15s ease, box-shadow .2s ease;
  box-shadow: 0 6px 24px rgba(240,179,90,.35);
}
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(240,179,90,.5); }
.primary-btn:active { transform: translateY(0); }

.hero-meta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.hero-meta span {
  font-size: 13px; color: var(--text-dim);
  border: 1px solid var(--line); padding: 6px 16px; border-radius: 50px;
}

/* 十二生肖环绕动画 */
.hero-visual { width: 260px; height: 260px; position: relative; }
.orbit { width: 100%; height: 100%; position: relative; }
.orbit-ring {
  position: absolute; inset: 20px;
  border: 1px dashed var(--line);
  border-radius: 50%;
  animation: spin 40s linear infinite;
}
.orbit-core {
  position: absolute; inset: 0; margin: auto;
  width: 110px; height: 110px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; letter-spacing: 2px; color: var(--gold);
}
.orbit-emoji {
  position: absolute; inset: 0; margin: auto;
  width: 0; height: 0;
  font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  animation: spin 40s linear infinite;
}
.orbit-emoji::before {
  content: attr(data-e);
}
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ===== 答题页 ===== */
.quiz { padding: 28px 0 60px; }
.quiz-top { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.progress-bar {
  flex: 1; height: 8px; background: var(--panel);
  border-radius: 50px; overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, #7ab0e0, #e06b6b);
  border-radius: 50px; transition: width .3s ease;
}
.quiz-counter { color: var(--text-dim); font-size: 14px; white-space: nowrap; }

.question-card {
  background: linear-gradient(135deg, rgba(122,176,224,.20), rgba(224,107,107,.20));
  border: 1px solid rgba(155,123,216,.35);
  border-radius: 20px;
  padding: 32px 28px;
  backdrop-filter: blur(4px);
}
.q-tag {
  display: inline-block;
  font-size: 12px; color: #4a6da8;
  border: 1px solid rgba(122,176,224,.6);
  padding: 3px 12px; border-radius: 50px;
  margin-bottom: 18px;
  letter-spacing: 1px;
}
.q-text { font-size: 20px; font-weight: 600; margin-bottom: 26px; }

.options { display: flex; flex-direction: column; gap: 12px; }
.option {
  display: flex; align-items: flex-start; gap: 14px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(122,176,224,.35);
  border-radius: 14px;
  padding: 16px 18px;
  cursor: pointer;
  transition: all .15s ease;
  text-align: left;
  font-size: 15px;
  color: var(--text);
}
.option:hover { border-color: #e58a9a; transform: translateX(4px); }
.option .opt-id {
  flex-shrink: 0; width: 28px; height: 28px;
  border-radius: 50%; border: 1px solid rgba(122,176,224,.5);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #5a7fb8;
}
.option.selected {
  border-color: #e58a9a;
  background: linear-gradient(135deg, rgba(122,176,224,.28), rgba(224,107,107,.28));
}
.option.selected .opt-id { background: linear-gradient(135deg, #7ab0e0, #e06b6b); color: #ffffff; border-color: transparent; }

.quiz-nav { display: flex; justify-content: space-between; margin-top: 20px; }
.ghost-btn {
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 50px;
  padding: 10px 26px; cursor: pointer; font-size: 14px;
  transition: all .15s ease;
}
.ghost-btn:hover { border-color: var(--accent); color: var(--text); }
.ghost-btn:disabled { opacity: .35; cursor: default; }

/* ===== 结果页 ===== */
.report-wrap { padding: 40px 0 60px; display: flex; flex-direction: column; gap: 20px; }

.report-card { text-align: center; padding: 34px 24px; }
.hero-report {
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
}
.hero-report::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
  pointer-events: none;
}
.overline { letter-spacing: 3px; font-size: 12px; color: var(--text-faint); margin-bottom: 18px; }

.combo-badge { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 16px; }
.big-emoji { font-size: 72px; line-height: 1; }
.combo-x { font-size: 30px; color: var(--text-faint); font-weight: 300; }
.big-label {
  font-size: 44px; font-weight: 800; letter-spacing: 2px;
  color: var(--accent);
}

.archetype { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.archetype-sub { color: var(--text-dim); font-size: 15px; margin-bottom: 18px; }
.type-badge {
  display: inline-block; padding: 6px 20px; border-radius: 50px;
  font-size: 14px; color: #1a1423; background: var(--accent);
  font-weight: 700;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
}
.panel h2 { font-size: 17px; font-weight: 700; margin-bottom: 14px; color: var(--accent); }
.panel p { color: var(--text-dim); font-size: 15px; }

.top-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.score-card { text-align: center; }
.score-card span { display: block; font-size: 13px; color: var(--text-faint); margin-bottom: 8px; }
.score-card b { display: block; font-size: 26px; font-weight: 800; color: var(--text); }
.score-card em { font-style: normal; font-size: 13px; color: var(--accent); }

.radar-panel .radar-wrap { display: flex; justify-content: center; }
.radar-panel svg { width: 100%; max-width: 420px; height: auto; }
.result-radar-caption h2 { color: var(--text); font-size: 17px; }
.result-radar-caption p { font-size: 13px; color: var(--text-faint); margin-bottom: 10px; }

.trait-readout p { font-size: 15px; }

.portrait #advice-body {
  font-size: 16px; color: var(--text);
  font-style: italic;
  border-left: 3px solid var(--accent);
  padding-left: 16px;
}

.help-panel .help-text { margin-bottom: 10px; }
.help-panel .help-text:last-child { margin-bottom: 0; }

.report-actions { text-align: center; }
.result-light-action-btn {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 50px;
  padding: 13px 40px; cursor: pointer; font-size: 15px; font-weight: 600;
  transition: all .15s ease;
}
.result-light-action-btn:hover { border-color: var(--accent); color: var(--accent); }

.copyright { text-align: center; color: var(--text-faint); font-size: 12px; }

/* ===== 结果页扩展板块 ===== */
.tagline-text {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.7;
}

.keyword-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.kw-tag {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.soul-panel .soul-intro {
  font-size: 13px;
  color: var(--text-faint);
  margin-bottom: 16px;
}
.soul-row { margin-bottom: 20px; }
.soul-row:last-child { margin-bottom: 0; }
.soul-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 6px; font-size: 14px;
}
.soul-name { color: var(--text); font-weight: 700; }
.soul-picked { font-size: 13px; font-weight: 600; }
.soul-bar {
  height: 10px; background: var(--panel-2);
  border-radius: 50px; overflow: hidden; display: flex;
}
.soul-seg { height: 100%; transition: width .5s ease; }
.soul-seg.left { background: var(--blue); }
.soul-seg.right { background: var(--red); }
.soul-labels {
  display: flex; justify-content: space-between;
  margin-top: 5px; font-size: 12px; color: var(--text-faint);
}

.buddy-row { display: flex; align-items: center; gap: 16px; }
.buddy-emoji {
  font-size: 48px; line-height: 1;
  flex-shrink: 0;
}
.buddy-info b { font-size: 18px; color: var(--text); }
.buddy-info p { font-size: 14px; color: var(--text-dim); margin-top: 4px; }

.share-panel .share-text {
  font-size: 14px;
  color: var(--text-dim);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  line-height: 1.7;
}
.copy-btn {
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 50px;
  padding: 11px 30px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s ease;
}
.copy-btn:hover { opacity: .9; transform: translateY(-1px); }
.copy-btn.copied { background: var(--green); }

/* ===== 新增图表样式 ===== */
.chart-panel .result-radar-caption { margin-bottom: 18px; }

/* 气质向 Top5 条形图 */
.bar-row { margin-bottom: 18px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-head {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 6px; font-size: 14px;
}
.bar-rank {
  flex-shrink: 0; width: 22px; height: 22px;
  border-radius: 50%; background: var(--panel-2);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text-dim);
}
.bar-name { flex: 1; font-weight: 600; color: var(--text); }
.bar-val { color: var(--text-faint); font-size: 13px; font-weight: 700; }
.bar-track {
  height: 12px; background: var(--panel-2);
  border-radius: 50px; overflow: hidden;
}
.bar-fill {
  height: 100%; border-radius: 50px;
  transition: width 1s ease;
}
.bar-fill.top { box-shadow: 0 2px 8px rgba(0,0,0,.08); }

/* 心相四轴对比图 */
.axis-row { margin-bottom: 22px; }
.axis-row:last-child { margin-bottom: 0; }
.axis-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 6px; font-size: 14px;
}
.axis-side { color: var(--text); font-weight: 600; }
.axis-name { color: var(--text-faint); font-size: 12px; }
.axis-bar {
  height: 16px; background: var(--panel-2);
  border-radius: 50px; overflow: hidden; display: flex;
}
.axis-seg { height: 100%; transition: width .6s ease; }
.axis-seg.left { border-radius: 50px 0 0 50px; }
.axis-seg.right { border-radius: 0 50px 50px 0; }
.axis-nums {
  display: flex; justify-content: space-between;
  margin-top: 5px; font-size: 12px; color: var(--text-faint);
}

/* 环形图 */
.donut-wrap { position: relative; width: 200px; margin: 0 auto; }
.donut-svg { width: 100%; height: auto; display: block; }
.donut-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  pointer-events: none;
}
.donut-center b { font-size: 34px; font-weight: 800; color: var(--accent); }
.donut-center span { font-size: 13px; color: var(--text-dim); margin-top: 2px; }

/* 天赋与盲区 */
.duo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.duo-card {
  border-radius: 14px; padding: 16px;
  border: 1px solid var(--line);
}
.duo-card.strength { background: rgba(76,175,110,.08); border-color: rgba(76,175,110,.3); }
.duo-card.weakness { background: rgba(224,107,107,.08); border-color: rgba(224,107,107,.3); }
.duo-tag {
  display: inline-block; font-size: 12px; font-weight: 700;
  margin-bottom: 8px;
}
.duo-card.strength .duo-tag { color: var(--green); }
.duo-card.weakness .duo-tag { color: var(--red); }
.duo-card p { font-size: 14px; color: var(--text-dim); line-height: 1.7; }

/* ===== 响应式 ===== */
@media (max-width: 520px) {
  .hero-card h1 { font-size: 30px; }
  .big-emoji { font-size: 56px; }
  .big-label { font-size: 34px; }
  .q-text { font-size: 18px; }
  .top-grid { grid-template-columns: 1fr; }
  .duo-grid { grid-template-columns: 1fr; }
  .hero-visual { width: 220px; height: 220px; }
}
