:root {
  --bg: #f7f3ee;
  --card: #ffffff;
  --ink: #2f2a26;
  --muted: #8a8078;
  --line: #ece4db;
  --primary: #c76b52;
  --primary-deep: #a94f3a;
  --primary-soft: #f8e8e2;
  --safe: #5d8f7c;
  --safe-soft: #e4efe9;
  --warn: #d9a441;
  --warn-soft: #faf0dc;
  --risk: #b8402e;
  --risk-soft: #fbe9e6;
  --shadow: 0 10px 30px rgba(74, 55, 42, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", -apple-system, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 20px 56px;
}

.screen { display: none; }
.screen.active { display: block; animation: fadeIn .35s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 顶部品牌 ---------- */
.brand {
  text-align: center;
  padding: 26px 0 10px;
}
.brand .logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--primary);
  font-weight: 700;
}
.brand .logo::before {
  content: "";
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 5px var(--primary-soft);
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 22px;
}
.card + .card { margin-top: 16px; }

/* ---------- Landing ---------- */
.hero { text-align: center; padding: 18px 0 8px; }
.hero .eyebrow {
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--muted);
  margin-bottom: 10px;
}
.hero h1 {
  font-size: 32px;
  line-height: 1.25;
  margin: 0 0 12px;
  letter-spacing: 1px;
}
.hero h1 em {
  font-style: normal;
  color: var(--primary);
}
.hero .sub {
  color: var(--muted);
  font-size: 15px;
  max-width: 460px;
  margin: 0 auto;
}

.points { margin: 22px 0 6px; }
.points li {
  display: flex;
  gap: 10px;
  margin: 0 0 12px;
  padding-left: 2px;
  font-size: 15px;
}
.points li .dot {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--safe-soft);
  color: var(--safe);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
}

.version-grid { margin-top: 18px; }
.version {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  background: var(--card);
}
.version:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.version .v-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.version .v-name { font-size: 17px; font-weight: 700; }
.version .v-tag {
  font-size: 12px; color: var(--primary);
  background: var(--primary-soft);
  padding: 2px 9px; border-radius: 999px; font-weight: 700;
}
.version .v-desc { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.version .v-meta { font-size: 12.5px; color: var(--muted); margin-top: 8px; }

.disclaimer {
  background: var(--warn-soft);
  border: 1px solid #f0dfb8;
  border-radius: 12px;
  padding: 13px 15px;
  font-size: 12.5px;
  color: #7a6025;
  margin-top: 18px;
}
.privacy { color: var(--muted); font-size: 12.5px; margin-top: 12px; text-align: center; }

.history-toggle {
  margin: 18px 0 0;
  text-align: center;
  color: var(--primary);
  background: none; border: none;
  font-size: 14px; cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
}
.history-list { margin-top: 10px; }
.history-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 4px;
  border-bottom: 1px dashed var(--line);
  font-size: 13.5px;
}
.history-item .h-date { color: var(--muted); }
.history-item .h-score { font-weight: 700; }

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 15px 18px;
  border-radius: 14px;
  border: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .2s, transform .2s, background .2s;
}
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-deep); }
.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: #f6f1eb; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Intro ---------- */
.intro-card { text-align: center; padding: 28px 22px; }
.intro-card .big-ico {
  width: 72px; height: 72px;
  margin: 6px auto 16px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid; place-items: center;
  font-size: 30px;
}
.intro-card h2 { font-size: 22px; margin: 0 0 10px; }
.intro-card .tips { text-align: left; margin: 18px 0 22px; }
.intro-card .tips li { margin-bottom: 10px; font-size: 15px; }
.intro-card .mode-badge {
  display: inline-block; margin-bottom: 16px;
  background: var(--safe-soft); color: var(--safe);
  padding: 5px 14px; border-radius: 999px; font-size: 13px; font-weight: 700;
}

/* ---------- Quiz ---------- */
.quiz-top {
  position: sticky; top: 0;
  background: var(--bg);
  padding: 12px 0 10px;
  z-index: 5;
}
.progress-wrap {
  display: flex; align-items: center; gap: 12px;
}
.progress-track {
  flex: 1; height: 8px;
  background: #e9e1d8; border-radius: 999px; overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--primary), #e29a7e);
  border-radius: 999px;
  transition: width .3s ease;
}
.progress-text { font-size: 13px; color: var(--muted); white-space: nowrap; }

.question-card { padding: 24px 22px 20px; }
.q-index { font-size: 13px; color: var(--primary); font-weight: 700; letter-spacing: 1px; }
.q-text { font-size: 20px; line-height: 1.55; margin: 12px 0 22px; font-weight: 600; }

.options { display: grid; gap: 10px; }
.option {
  display: flex; align-items: flex-start; gap: 12px;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  padding: 14px 14px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font-size: 15px;
  font-family: inherit;
  transition: border-color .15s, background .15s;
  width: 100%;
}
.option .o-num {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #f2ece5; color: var(--muted);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
}
.option .o-label { padding-top: 1px; }
.option:hover { border-color: #d8c8bb; }
.option.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.option.selected .o-num { background: var(--primary); color: #fff; }

.quiz-nav { display: flex; gap: 12px; margin-top: 20px; }
.quiz-nav .btn { flex: 1; }

/* ---------- Loading ---------- */
.loading-box { text-align: center; padding: 60px 24px; }
.spinner {
  width: 52px; height: 52px;
  margin: 0 auto 22px;
  border: 5px solid var(--primary-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-box h2 { font-size: 20px; margin: 0 0 8px; }
.loading-text { color: var(--muted); font-size: 14.5px; min-height: 24px; }

/* ---------- Result ---------- */
.result-head { text-align: center; padding: 14px 0 4px; }
.result-head .label { color: var(--muted); font-size: 13px; letter-spacing: 2px; }
.result-head h2 { font-size: 26px; margin: 8px 0 6px; }

.score-ring {
  position: relative;
  width: 150px; height: 150px;
  margin: 18px auto 6px;
}
.score-ring svg { transform: rotate(-90deg); }
.score-ring .ring-num {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  flex-direction: column;
  text-align: center;
}
.score-ring .ring-num b { font-size: 38px; line-height: 1; }
.score-ring .ring-num span { font-size: 12px; color: var(--muted); }

.band-text {
  background: var(--safe-soft);
  border: 1px solid #cfe2d8;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14.5px;
  color: #355c4d;
  margin-top: 14px;
}
.band-text.risk { background: var(--risk-soft); border-color: #f0c7be; color: #8a2e20; }

.section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 17px; font-weight: 700;
  margin: 26px 0 12px;
}
.section-title::before {
  content: ""; width: 4px; height: 18px;
  border-radius: 2px; background: var(--primary);
}

.radar-wrap { display: grid; place-items: center; padding: 8px 0; }
.radar-wrap svg { max-width: 100%; height: auto; }

.dim-bars { display: grid; gap: 12px; }
.dim-row { font-size: 13.5px; }
.dim-row .d-top { display: flex; justify-content: space-between; margin-bottom: 6px; }
.dim-row .d-name { font-weight: 600; }
.dim-row .d-val { color: var(--muted); font-variant-numeric: tabular-nums; }
.dim-row .d-bar {
  height: 9px; background: #eee6dd; border-radius: 999px; overflow: hidden;
}
.dim-row .d-fill {
  height: 100%; width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7aa493, var(--safe));
  transition: width .6s ease;
}
.dim-row.low .d-fill { background: linear-gradient(90deg, #d98f61, var(--warn)); }

.pill-list { display: grid; gap: 10px; }
.pill {
  display: flex; gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px;
  font-size: 14px;
}
.pill .p-ico { font-size: 18px; line-height: 1; }
.pill .p-body b { display: block; margin-bottom: 2px; }
.pill .p-body span { color: var(--muted); font-size: 13px; }
.pill.safe { background: var(--safe-soft); border-color: #cfe2d8; }
.pill.watch { background: var(--warn-soft); border-color: #f0dfb8; }

.risk-box {
  background: var(--risk-soft);
  border: 1px solid #efb9ad;
  border-radius: 14px;
  padding: 16px;
  margin-top: 8px;
}
.risk-box h3 { margin: 0 0 10px; color: var(--risk); font-size: 16px; }
.risk-box ul { margin: 0; padding-left: 18px; }
.risk-box li { margin-bottom: 8px; font-size: 14px; }
.risk-box .safety {
  margin-top: 12px;
  background: #fff;
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 13px;
  color: #7c2a1f;
  border: 1px dashed #efb9ad;
}

.suggestions { counter-reset: sug; }
.suggestion {
  display: flex; gap: 12px;
  border-bottom: 1px dashed var(--line);
  padding: 12px 2px;
  font-size: 14.5px;
}
.suggestion:last-child { border-bottom: none; }
.suggestion .s-num {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--primary-soft); color: var(--primary-deep);
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 700;
}

.result-actions { display: grid; gap: 10px; margin-top: 24px; }

.copy-toast {
  position: fixed; left: 50%; bottom: 30px;
  transform: translateX(-50%) translateY(20px);
  background: #2f2a26; color: #fff;
  padding: 10px 18px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none;
  transition: all .3s ease;
}
.copy-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.footnote { color: var(--muted); font-size: 12px; text-align: center; margin-top: 18px; }