:root {
  --paper: #F7F3EA;
  --paper-2: #EFE8DA;
  --ink: #2B2B26;
  --ink-soft: #5B5950;
  --ink-faint: #8B887C;
  --card: #FFFFFF;
  --line: rgba(43, 43, 38, 0.10);
  --dawn: #6FB3B8;   /* 朝露蓝：年轻的起点 */
  --gold: #E9B44C;   /* 正午金：平衡的中间 */
  --dusk: #2F6B60;   /* 暮色绿：通透的终点 */
  --coral: #E8644A;  /* 唯一的强调色 */
  --coral-deep: #D1543B;
  --radius: 22px;
  --shadow: 0 18px 46px rgba(43, 43, 38, 0.08);
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.65;
  background:
    radial-gradient(640px 420px at 12% -4%, rgba(232, 100, 74, 0.10), transparent 62%),
    radial-gradient(760px 520px at 106% 112%, rgba(111, 179, 184, 0.13), transparent 62%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 44px 22px 72px;
}

/* ===== 页面入场 ===== */
.page { animation: rise .5s ease both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px 34px 30px;
}

/* ===== 首页 ===== */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .08em;
  color: var(--dusk);
}
.brand .mark {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--dawn), var(--dusk));
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; font-weight: 700;
}

.hero-title {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(32px, 6.4vw, 52px);
  line-height: 1.22;
  margin: 26px 0 14px;
  letter-spacing: .01em;
}
.hero-title .accent { color: var(--coral); }

.hero-sub {
  color: var(--ink-soft);
  font-size: 17px;
  max-width: 30em;
  margin: 0 0 30px;
}

/* 刻度尺（签名元素） */
.scale-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(255,255,255,0.25));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 20px 14px;
  margin-bottom: 26px;
}
.scale-caption {
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: .1em;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.scale {
  position: relative;
}
.scale-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--dawn) 0%, var(--gold) 50%, var(--dusk) 100%);
}
.scale-marker {
  position: absolute;
  left: 0;
  top: 6px;
  transform: translate(-50%, -50%);
  width: 0; height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 11px solid var(--ink);
  filter: drop-shadow(0 2px 3px rgba(43,43,38,.3));
}
.scale-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  color: var(--ink-faint);
}

/* ===== 表单（实际年龄必选） ===== */
.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
  margin-top: 4px;
}
.age-field {
  flex: 1 1 220px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 0 18px;
  min-height: 54px;
}
.age-field:focus-within { border-color: var(--coral); }
.age-field label { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.age-field select {
  appearance: none;
  -webkit-appearance: none;
  border: 0; outline: 0; background: transparent;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 8px 0 10px;
  text-align: right;
  cursor: pointer;
}
.age-field select:invalid { color: var(--ink-faint); }
.age-field .chev {
  flex: none;
  color: var(--ink-faint);
  pointer-events: none;
  margin-left: 2px;
}
.age-required {
  flex-basis: 100%;
  font-size: 12.5px;
  color: var(--ink-faint);
  margin: 2px 2px 0;
}
.age-required b { color: var(--coral); font-weight: 700; }

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 16px;
  min-height: 54px;
  padding: 0 28px;
  border-radius: 999px;
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:focus-visible { outline: 3px solid rgba(232,100,74,.4); outline-offset: 2px; }
.btn-primary {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 10px 22px rgba(232,100,74,.32);
}
.btn-primary:hover { background: var(--coral-deep); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover { border-color: var(--ink-faint); color: var(--ink); }
.btn-block { width: 100%; }

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--ink-faint);
}
.meta-line span { display: inline-flex; align-items: center; gap: 6px; }
.meta-line svg { flex: none; }

/* ===== 答题页 ===== */
.test-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.back-btn {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font-family: var(--sans); font-size: 14px; color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 4px;
  border-radius: 8px;
}
.back-btn:hover { color: var(--ink); }
.back-btn:focus-visible { outline: 3px solid rgba(232,100,74,.4); }
.back-btn[disabled] { opacity: .3; pointer-events: none; }
.counter { font-size: 13px; color: var(--ink-faint); letter-spacing: .04em; }

.progress { margin-bottom: 30px; }
.progress-rail {
  height: 6px; border-radius: 999px; background: var(--paper-2);
  overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--dawn), var(--dusk));
  transition: width .35s ease;
}

.question {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(20px, 4.4vw, 25px);
  line-height: 1.5;
  margin: 0 0 26px;
}

.options { display: grid; gap: 12px; }
.opt {
  appearance: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 15.5px;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color .18s ease, background .18s ease, transform .12s ease;
}
.opt:hover { border-color: rgba(232,100,74,.55); transform: translateY(-1px); }
.opt:focus-visible { outline: 3px solid rgba(232,100,74,.35); outline-offset: 1px; }
.opt .letter {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--ink-faint);
  transition: all .18s ease;
}
.opt.is-selected {
  border-color: var(--coral);
  background: #FDF1EC;
}
.opt.is-selected .letter {
  background: var(--coral); border-color: var(--coral); color: #fff;
}

/* ===== 结果页：年龄对比 ===== */
.compare-title {
  text-align: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: .08em;
  margin: 6px 0 20px;
}
.age-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
.age-card {
  border-radius: 18px;
  padding: 20px 16px 18px;
  text-align: center;
  border: 1px solid var(--line);
}
.age-card.is-real {
  background: linear-gradient(170deg, rgba(111,179,184,.20), rgba(111,179,184,.05));
  border-color: rgba(111,179,184,.42);
}
.age-card.is-psy {
  background: linear-gradient(170deg, rgba(232,100,74,.16), rgba(232,100,74,.04));
  border-color: rgba(232,100,74,.40);
}
.age-card-label {
  display: block;
  font-size: 13px;
  letter-spacing: .14em;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.age-card-num {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(46px, 13vw, 66px);
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
}
.age-card.is-real .age-card-num { color: #3F8C93; }
.age-card.is-psy .age-card-num { color: var(--coral); }
.age-card-num small {
  font-family: var(--sans);
  font-size: .32em;
  font-weight: 700;
  color: var(--ink-soft);
}

.cmp-text {
  text-align: center;
  color: var(--ink-soft);
  font-size: 15px;
  max-width: 34em;
  margin: 0 auto 24px;
  line-height: 1.7;
}

/* 阶段（保留称号） */
.stage { text-align: center; margin: 28px 0 4px; }
.stage-name {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(24px, 5.4vw, 32px);
  margin: 12px 0 6px;
}
.stage-desc {
  color: var(--ink-soft);
  max-width: 34em;
  margin: 0 auto;
  font-size: 15px;
}

/* 心态关键词 */
.keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 0 0 30px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-soft);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }

/* 通用小节标题 */
.sec-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 18px;
  margin: 32px 0 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sec-title .bar { width: 4px; height: 18px; border-radius: 2px; background: linear-gradient(180deg, var(--dawn), var(--dusk)); }
.sec-sub { font-size: 13px; color: var(--ink-faint); margin: 0 0 18px; }

.dim { margin-bottom: 18px; }
.dim-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 7px;
  gap: 12px;
}
.dim-name { font-weight: 700; font-size: 14px; }
.dim-name em {
  font-style: normal;
  font-weight: 400;
  font-size: 12.5px;
  color: var(--ink-faint);
  margin-left: 8px;
}
.dim-state {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-soft);
}
.dim-rail {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--dawn), var(--gold), var(--dusk));
  opacity: .9;
}
.dim-dot {
  position: absolute;
  top: 50%; left: 0;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--card);
  border: 3px solid var(--ink);
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 6px rgba(43,43,38,.25);
}
.dim-interp { font-size: 13px; color: var(--ink-soft); margin: 8px 2px 0; }

/* 最年轻 / 最成熟 */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.duo-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
}
.duo-card.is-young {
  background: linear-gradient(160deg, rgba(111,179,184,.14), rgba(255,255,255,0) 70%);
  border-color: rgba(111,179,184,.42);
}
.duo-card.is-mature {
  background: linear-gradient(160deg, rgba(47,107,96,.13), rgba(255,255,255,0) 70%);
  border-color: rgba(47,107,96,.42);
}
.duo-tag {
  font-size: 11.5px;
  letter-spacing: .14em;
  color: var(--ink-faint);
  display: block;
  margin-bottom: 6px;
}
.duo-card b { font-family: var(--serif); font-size: 17px; }
.duo-card p { font-size: 13.5px; color: var(--ink-soft); margin: 8px 0 0; }
.duo-note {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 14px;
  color: var(--ink-soft);
}

/* 成长建议 */
.tips { display: grid; gap: 10px; }
.tip {
  display: flex;
  gap: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 14px;
}
.tip .num {
  flex: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--dusk);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700;
  margin-top: 1px;
}

/* 得分回顾 */
.score-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.score-line b { color: var(--dusk); font-size: 16px; }

/* ===== 历史记录 ===== */
.history-row {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.his-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.his-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 20px;
  margin: 0;
}
.his-clear {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-faint);
  padding: 6px 10px;
  border-radius: 8px;
}
.his-clear:hover { color: var(--coral); }
.his-list { display: grid; gap: 14px; }
.his-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  background: var(--card);
}
.his-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.his-date { font-size: 12.5px; color: var(--ink-faint); }
.his-tag {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--dusk);
  background: rgba(47,107,96,.12);
  padding: 3px 10px;
  border-radius: 999px;
  margin-left: auto;
}
.his-del {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--ink-faint);
  display: inline-flex;
  padding: 4px;
  border-radius: 6px;
}
.his-del:hover { color: var(--coral); }
.his-ages { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.his-age {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 34px;
  line-height: 1;
  color: #3F8C93;
}
.his-age.is-psy { color: var(--coral); }
.his-age small {
  font-family: var(--sans);
  font-size: .4em;
  font-weight: 700;
  color: var(--ink-soft);
  margin-left: 2px;
}
.his-arrow { color: var(--ink-faint); font-size: 20px; }
.his-diff { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.his-foot { margin-top: 10px; font-size: 13px; color: var(--ink-soft); }
.his-empty { text-align: center; padding: 30px 10px 22px; }
.his-empty p { font-family: var(--serif); font-weight: 700; font-size: 18px; margin: 0 0 6px; }
.his-empty-sub { font-family: var(--sans); font-weight: 400; font-size: 13.5px; color: var(--ink-faint); margin: 0 0 20px; }
.his-empty .btn { min-width: 180px; }

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}
.result-actions .btn { flex: 1 1 200px; }

/* ===== 更多测评推荐 ===== */
.more-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.more-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color .18s ease, transform .12s ease, box-shadow .18s ease;
}
.more-card:hover {
  border-color: rgba(232,100,74,.55);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(43,43,38,.06);
}
.more-card:active { transform: translateY(0); }
.more-card:focus-visible { outline: 3px solid rgba(232,100,74,.35); outline-offset: 2px; }
.more-card .m-emoji {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  line-height: 1;
}
.more-card .m-txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.more-card .m-name { font-weight: 700; font-size: 14px; line-height: 1.4; }
.more-card .m-desc { font-size: 12.5px; color: var(--ink-faint); line-height: 1.4; }

.disclaimer {
  margin-top: 26px;
  font-size: 12px;
  color: var(--ink-faint);
  text-align: center;
  line-height: 1.6;
}

footer {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 22px 44px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-faint);
}

.toast {
  position: fixed;
  left: 50%; bottom: 30px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  padding: 12px 22px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
  z-index: 50;
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 560px) {
  .wrap { padding: 28px 16px 56px; }
  .panel { padding: 24px 20px 22px; border-radius: 18px; }
  .hero-title { margin-top: 20px; }
  .field-row .btn { flex: 1 1 100%; }
  .duo { grid-template-columns: 1fr; }
  .more-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
