:root {
  --bg: #f7f6f3;
  --card: #ffffff;
  --ink: #1c1c1e;
  --mute: #6d6d73;
  --line: #e6e3dd;
  --soft: #efeee8;
  --accent: #2f6fed;
  --accent2: #7c5cd6;
  --ok: #1e9e7a;
  --warn: #d9761f;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
.topbar {
  display: flex; align-items: baseline; gap: 12px;
  padding: 18px 22px; max-width: 760px; margin: 0 auto; width: 100%;
}
.brand { font-weight: 650; font-size: 15px; text-decoration: none; letter-spacing: -.01em; }
.tagline { font-size: 12px; color: var(--mute); }
main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 6px 22px 48px; }
footer {
  max-width: 760px; margin: 0 auto; width: 100%; padding: 0 22px 34px;
  font-size: 12px; color: var(--mute);
}

/* ---------- 首页 ---------- */
h1.page { font-size: 27px; line-height: 1.3; margin: 14px 0 8px; font-weight: 660; letter-spacing: -.015em; }
p.lede { margin: 0 0 26px; color: var(--mute); font-size: 14.5px; }
.scale-card {
  display: block; text-decoration: none; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 20px;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.scale-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(22,22,28,.07); border-color: #d8d4cb; }
.scale-card .row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.scale-card h2 { font-size: 17px; margin: 0; font-weight: 630; }
.badge {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--soft); color: #56565c; font-weight: 500;
}
.badge.blue { background: #e8effd; color: #2456b8; }
.scale-card .desc { font-size: 13.5px; color: var(--mute); margin: 2px 0 0; }

.dim-intro { margin-top: 10px; }
.dim-row { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; font-size: 13.5px; border-bottom: 1px solid #f1efe9; }
.dim-row:last-child { border-bottom: 0; }
.dim-row b { font-weight: 620; min-width: 62px; }
.dim-row .dim-brief { color: var(--mute); font-size: 12.5px; }
.dot { width: 8px; height: 8px; border-radius: 99px; flex: 0 0 8px; position: relative; top: -1px; }

/* ---------- 答题 ---------- */
.progress-wrap { position: sticky; top: 0; background: var(--bg); padding: 10px 0 12px; z-index: 5; }
.progress-top { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--mute); margin-bottom: 7px; }
.progress-bar { height: 4px; background: #e4e1da; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .22s ease; }
.progress-fill.purple { background: var(--accent2); }
.qtext { font-size: 22px; line-height: 1.55; font-weight: 550; margin: 34px 0 30px; letter-spacing: -.005em; min-height: 68px; }
.opts { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; font-size: 15px; color: var(--ink); cursor: pointer;
  font-family: inherit; line-height: 1.45;
  transition: border-color .14s, background .14s, transform .1s;
}
.opt:hover { border-color: #c9c4b9; background: #fdfcfa; }
.opt:active { transform: scale(.99); }
.opt.sel { border-color: var(--accent2); background: #f5f1ff; }
.opt .k {
  flex: 0 0 22px; height: 22px; border-radius: 6px; background: var(--soft);
  color: #6b6b71; font-size: 11.5px; display: flex; align-items: center; justify-content: center;
  font-weight: 600;
}
.opt.sel .k { background: var(--accent2); color: #fff; }
.qfoot { display: flex; justify-content: space-between; margin-top: 22px; font-size: 13px; }
.linkbtn {
  background: none; border: 0; padding: 4px 0; color: var(--mute); font: inherit;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.linkbtn:disabled { opacity: .35; cursor: default; }
.hint { font-size: 12px; color: var(--mute); margin-top: 18px; }

/* ---------- 结果 ---------- */
.radar { display: block; width: 100%; max-width: 460px; margin: 4px auto 8px; height: auto; }
.dim-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; margin-bottom: 12px;
}
.dim-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.dim-badge {
  width: 22px; height: 22px; border-radius: 7px; color: #fff; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 22px;
}
.dim-badge.sm { width: 18px; height: 18px; border-radius: 6px; font-size: 10.5px; flex: 0 0 18px; }
.dim-name { font-size: 15.5px; font-weight: 630; }
.dim-score { margin-left: auto; font-size: 19px; font-weight: 660; letter-spacing: -.02em; }
.dim-score small { font-size: 11.5px; font-weight: 500; color: var(--mute); letter-spacing: 0; }
.track { position: relative; height: 8px; background: #ebe8e1; border-radius: 99px; overflow: hidden; }
.track .fill { height: 100%; border-radius: 99px; transition: width .4s ease; }
.track .mid { position: absolute; left: 50%; top: 0; bottom: 0; width: 1.5px; background: rgba(0,0,0,.16); }
.dim-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.lv { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: var(--soft); color: #56565c; }
.lv.high { background: #efe9fc; color: #5636b8; }
.lv.low { background: #e9f1f6; color: #2b5f7a; }
.delta { font-size: 11.5px; color: var(--mute); }
.delta.up { color: #b3563a; }
.delta.down { color: #2b7a6a; }
.dim-text { font-size: 13.5px; color: #45454b; margin: 10px 0 2px; line-height: 1.72; }

details.panel summary {
  cursor: pointer; font-size: 14px; font-weight: 620; color: var(--ink);
  list-style: none; display: flex; align-items: center; gap: 6px;
}
details.panel summary::-webkit-details-marker { display: none; }
details.panel summary::after { content: '＋'; margin-left: auto; color: var(--mute); font-weight: 400; }
details.panel[open] summary::after { content: '－'; }
details.panel[open] summary { margin-bottom: 6px; }

.facet-group { margin-top: 16px; }
.facet-group h4 { font-size: 13px; margin: 0 0 8px; font-weight: 620; display: flex; align-items: center; gap: 7px; }
.facet-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.fname { font-size: 12.5px; color: #45454b; width: 76px; flex: 0 0 76px; }
.ftrack { flex: 1; height: 6px; background: #ebe8e1; border-radius: 99px; overflow: hidden; }
.ffill { display: block; height: 100%; border-radius: 99px; }
.fval { font-size: 12px; color: var(--mute); width: 26px; text-align: right; flex: 0 0 26px; font-variant-numeric: tabular-nums; }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 20px; margin: 18px 0; font-size: 13.5px; color: #45454b;
}
.panel h3 { font-size: 14px; margin: 0 0 8px; font-weight: 620; color: var(--ink); }
.panel ul { margin: 8px 0 0; padding-left: 18px; }
.panel li { margin-bottom: 6px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 22px 0 8px; }
.btn {
  font: inherit; font-size: 14px; padding: 10px 18px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
}
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn:hover { border-color: #c9c4b9; }
.btn.primary:hover { background: #333; }

/* ---------- 历史 ---------- */
.hist { margin-top: 30px; }
.hist h2 { font-size: 14px; color: var(--mute); font-weight: 600; margin: 0 0 10px; letter-spacing: .04em; }
.rec {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.rec:last-child { border-bottom: 0; }
.rec .when { color: var(--mute); font-size: 12px; flex: 0 0 auto; }
.rec .mini-row { display: flex; gap: 9px; flex-wrap: wrap; margin-left: auto; }
.rec .mini { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; color: #45454b; }
.rec .mini i { width: 6px; height: 6px; border-radius: 99px; display: inline-block; }
.rec button { background: none; border: 0; color: #b0aca4; cursor: pointer; font-size: 15px; padding: 2px 4px; flex: 0 0 auto; }
.rec button:hover { color: #8a857c; }
.empty { font-size: 13px; color: var(--mute); padding: 12px 0; }

@media (max-width: 520px) {
  main { padding: 4px 16px 40px; }
  .topbar, footer { padding-left: 16px; padding-right: 16px; }
  h1.page { font-size: 23px; }
  .qtext { font-size: 19px; margin: 26px 0 24px; }
  .rec { flex-wrap: wrap; }
  .rec .mini-row { margin-left: 0; width: 100%; order: 3; }
  .fname { width: 68px; flex: 0 0 68px; }
}
