:root {
  --ink: #263b42;
  --muted: #50675e;
  --line: #d5e6dd;
  --paper: #fff;
  --bg: #f5faf8;
  --teal: #347a80;
  --teal-pressed: #285f65;
  --orange: #d98761;
  --orange-ink: #9c502f;
  --surface-soft: #eaf5ee;
  --sage: #a4c8b7;
  --focus: #467f78;
  --input-bg: #f9fcfa;
  --placeholder: #607469;
  --error: #9c4c32;
  --shadow: 0 8px 26px rgba(44, 90, 74, .065);

  --font-title: 1.5rem;
  --font-section: 1.25rem;
  --font-card: 1.125rem;
  --font-body: 1rem;
  --font-help: .875rem;
  --font-label: .8125rem;
  --font-number: 1.875rem;
  --line-body: 1.55;
  --gutter: 16px;
  --card-padding: 18px;
  --card-gap: 14px;
  --radius-card: 16px;
  --radius-control: 12px;
  --touch-target: 44px;
  --button-primary: 52px;
  --button-secondary: 48px;
  --input-min: 52px;
  --ring-size: 12.5rem;
  --ring-column: 9.25rem;
  --legend-column: 5.25rem;
  --page-max: 430px;
}

* { box-sizing: border-box; }
html { color: var(--ink); background: #e7f2ec; }
body {
  margin: 0;
  font: var(--font-body)/var(--line-body) -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
button, input, textarea { font: inherit; }
button { border: 0; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
button:active, .about-site:active { transform: scale(.985); }
p, h1, h3 { margin-top: 0; }
.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--page-max);
  min-height: 100vh;
  min-height: 100dvh;
  margin: auto;
  background: var(--bg);
  box-shadow: 0 0 65px rgba(44, 90, 74, .09);
}
.screen {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 20px var(--gutter) max(24px, env(safe-area-inset-bottom, 0px));
  overflow-wrap: anywhere;
}
.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.top-note { flex: 0 1 auto; text-align: right; color: var(--muted); font-size: var(--font-label); }
.wordmark { font-size: var(--font-body); font-weight: 800; letter-spacing: .08em; }
.wordmark b { color: var(--orange); }
.wordmark-btn, .back, .quiet, .about-link {
  min-width: var(--touch-target);
  min-height: var(--touch-target);
  padding: 6px 8px;
  background: transparent;
  white-space: normal;
}
.wordmark-btn { text-align: left; }
.home-brand { justify-content: flex-start; }
.product-name { font-size: var(--font-body); font-weight: 700; }
.back, .quiet, .about-link { font-size: var(--font-body); color: var(--teal); }
.progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 12px 0 20px; }
.progress span { height: 4px; border-radius: 20px; background: #dbece3; }
.progress span.current { background: var(--teal); }
.progress span.done { background: var(--sage); }

.eyebrow, .hero-badge { font-size: var(--font-label); letter-spacing: .06em; font-weight: 700; color: var(--teal); }
.eyebrow { margin-bottom: 8px; }
.h1, .hero-title, .about-hero h1 {
  font-size: var(--font-title);
  line-height: 1.32;
  letter-spacing: -.025em;
  margin: 0 0 12px;
  font-weight: 750;
}
.desc, .coping-answer, .about-point p, .about-copy { font-size: var(--font-body); line-height: var(--line-body); }
.desc { color: var(--muted); margin: 0 0 16px; }
.panel, .entry, .practice, .outcome, .chart-wrap {
  padding: var(--card-padding);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--paper);
  box-shadow: var(--shadow);
  min-width: 0;
}
.panel { margin: var(--card-gap) 0; }
.label, .outcome-name, .entry strong, .practice strong, .about-point strong, .donut-detail .title, .mini-title {
  font-size: var(--font-card);
  font-weight: 700;
  line-height: 1.4;
}
.label, .outcome-name { display: block; margin: 0 0 8px; }
.hint, .notice, .small-panel p, .range-ends, .comparison, .score-status, .empty, .probability-error {
  font-size: var(--font-help);
  line-height: var(--line-body);
  color: var(--muted);
}
.input-hint { margin: 8px 0 0; }
.spaced { margin-top: var(--card-gap); }
.spaced-large { margin-top: 24px; }
.notice, .small-panel, .donut-detail, .empty {
  border-radius: var(--radius-control);
  padding: 12px 14px;
  background: var(--surface-soft);
}
.notice { display: flex; align-items: flex-start; gap: 10px; border: 1px solid #dcebe2; }
.notice > :first-child { flex: none; }
.notice > :last-child { min-width: 0; }
.divider { height: 1px; background: var(--line); margin: var(--card-gap) 0; }
.range-line, .range-ends, .outcome-header, .prob, .total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 10px;
}
.range-line .label { flex: 1 1 8em; margin: 0; }
.range-ends { align-items: flex-start; }
.range-ends span:last-child { text-align: right; }
.score { font: 500 var(--font-number)/1.1 Georgia, serif; color: var(--teal); white-space: nowrap; }
.score small { font-weight: 600; font-size: var(--font-help); color: var(--muted); margin-left: 3px; }
textarea {
  display: block;
  width: 100%;
  min-height: max(var(--input-min), 6em);
  resize: vertical;
  field-sizing: content;
  border: 1px solid #bfd4c9;
  border-radius: var(--radius-control);
  background: var(--input-bg);
  padding: 12px;
  color: var(--ink);
  font-size: var(--font-body);
  line-height: var(--line-body);
  overflow-wrap: anywhere;
}
textarea::placeholder { color: var(--placeholder); opacity: 1; }
textarea:focus { border-color: var(--focus); }
input[type=range] { display: block; width: 100%; min-height: var(--touch-target); margin: 0; accent-color: var(--teal); cursor: pointer; }

.footer {
  position: sticky;
  z-index: 2;
  bottom: 0;
  width: 100%;
  padding: 10px var(--gutter) calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.primary, .secondary {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-control);
  font-size: var(--font-body);
  line-height: 1.35;
  font-weight: 700;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}
.primary { min-height: var(--button-primary); background: var(--teal); color: white; box-shadow: 0 7px 16px rgba(52, 122, 128, .16); }
.primary:active { background: var(--teal-pressed); }
.secondary { min-height: var(--button-secondary); border: 1px solid #c4d9d0; background: var(--paper); color: var(--teal); }
.centered { display: block; margin: 8px auto 0; }
.footmeta { text-align: center; font-size: var(--font-label); line-height: 1.4; color: var(--muted); margin: 6px 0 0; }

.hero { padding: 28px 0 8px; }
.hero-title em { color: var(--orange-ink); font-style: normal; }
.entry, .practice {
  display: flex;
  width: 100%;
  min-height: var(--touch-target);
  align-items: center;
  gap: 12px;
  text-align: left;
  margin: var(--card-gap) 0 0;
}
.entry-copy { flex: 1; min-width: 0; }
.practice p { font-size: var(--font-help); color: var(--muted); line-height: var(--line-body); margin: 4px 0 0; }
.entry .chev, .practice .chev { color: var(--teal); font-size: var(--font-section); flex: none; }
.icon-circle { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: #e2f2e8; color: var(--teal); flex: none; }
.icon-circle.orange { background: #fbede3; color: var(--orange-ink); }
.about-link { display: block; margin: var(--card-gap) auto 0; font-size: var(--font-help); }

.cards { display: flex; flex-direction: column; gap: var(--card-gap); }
.outcome-header { margin-bottom: 10px; }
.kind, .chip, .badge, .about-methods span { display: inline-block; border-radius: 99px; padding: 4px 8px; font-size: var(--font-label); line-height: 1.4; color: var(--muted); background: var(--surface-soft); }
.kind { font-weight: 700; }
.outcome.worst, .minicard.worst { --outcome-ink: #984e30; --outcome-soft: #fff1e8; --outcome-line: #e9c5b2; }
.outcome.usual, .minicard.usual { --outcome-ink: #315d78; --outcome-soft: #edf5fa; --outcome-line: #c2d8e5; }
.outcome.best, .minicard.best { --outcome-ink: #376448; --outcome-soft: #edf6ef; --outcome-line: #c9dfce; }
.kind, .minicard .badge { color: var(--outcome-ink); background: var(--outcome-soft); }
.outcome input[type=range] { accent-color: var(--outcome-ink); }
.outcome textarea { min-height: max(var(--input-min), 4.6em); }
.prob { margin-top: 10px; }
.prob > :first-child { flex: 1 1 7em; }
.prob strong, .total strong, .minicard .final-probability { font-size: var(--font-number); font-weight: 750; line-height: 1.15; color: var(--teal); font-variant-numeric: tabular-nums; }
.total { margin-top: var(--card-gap); padding: 10px 14px; background: #eaf5ee; border-radius: var(--radius-control); font-size: var(--font-help); }
.probability-error { color: var(--error); }

.chart-wrap > .hint { margin: 0; }
.donut-center span { font-size: var(--font-help); color: var(--muted); }
.donut-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--ring-column)), 1fr)); gap: 12px; align-items: center; margin: var(--card-gap) 0; }
.donut-shell { position: relative; width: 100%; max-width: var(--ring-size); margin: auto; aspect-ratio: 1; }
.donut-shell svg { display: block; width: 100%; height: 100%; overflow: visible; }
.donut-ring { transition: stroke-width .2s ease, opacity .2s ease; cursor: pointer; }
.donut-ring:focus-visible { stroke-width: 32; outline: none; }
.donut-hit { pointer-events: stroke; cursor: pointer; }
.donut-hit.is-empty { pointer-events: none; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; pointer-events: none; }
.donut-center strong { font-size: var(--font-number); font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--teal); }
.donut-center span { line-height: 1.3; }
.prob-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--legend-column)), 1fr)); gap: 6px; min-width: 0; }
.prob-key { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 7px; width: 100%; min-width: 0; min-height: var(--touch-target); padding: 7px 8px; border-radius: var(--radius-control); border: 1px solid transparent; background: transparent; text-align: left; }
.prob-key.selected { background: #edf7f1; border-color: #c9dfd2; }
.prob-key .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.prob-key .name { font-size: var(--font-help); font-weight: 700; flex: 1 1 2em; min-width: 0; }
.prob-key .percent { font-size: var(--font-card); font-weight: 750; font-variant-numeric: tabular-nums; }
.donut-detail .detail { font-size: var(--font-body); color: var(--muted); line-height: var(--line-body); white-space: pre-wrap; overflow-wrap: anywhere; }
.donut-detail .title { margin-bottom: 4px; }
.small-panel { margin-top: var(--card-gap); }
.small-panel p { margin: 4px 0 0; }

.timeline { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.timeitem { text-align: center; flex: 1; min-width: 0; }
.timeitem strong { font-size: var(--font-number); line-height: 1.15; color: var(--teal); font-variant-numeric: tabular-nums; }
.timeitem span { display: block; font-size: var(--font-help); color: var(--muted); line-height: 1.4; }
.line-arrow { font-size: var(--font-card); color: var(--muted); }
.summary-delta { padding: 12px 14px; border-radius: var(--radius-control); background: #e9f5ed; color: #33584d; font-size: var(--font-body); line-height: var(--line-body); }
.mini-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 5.625rem), 1fr)); grid-auto-rows: 1fr; gap: 8px; }
.minicard { min-width: 0; border: 1px solid var(--outcome-line, var(--line)); border-radius: var(--radius-control); padding: 10px 6px; background: var(--paper); text-align: center; }
.minicard .final-probability { margin: 8px 0 2px; color: var(--outcome-ink); font-family: Arial, sans-serif; letter-spacing: -.025em; white-space: nowrap; }
.minicard .initial-probability { white-space: nowrap; }
.minicard > span:not(.badge) { display: block; font-size: var(--font-help); color: var(--ink); line-height: 1.4; text-wrap: balance; }
.comparison { margin-top: 4px; color: var(--ink); }

.media { display: flex; flex-direction: column; justify-content: space-between; gap: 20px; min-height: 150px; border-radius: var(--radius-card); padding: var(--card-padding); background: linear-gradient(135deg, #2e676b, #43776d 55%, #50766b); color: white; box-shadow: var(--shadow); }
.media > span { font-size: var(--font-label); letter-spacing: .05em; }
.media h3 { font-size: var(--font-section); margin: 0 0 4px; line-height: 1.35; }
.media p { font-size: var(--font-body); line-height: var(--line-body); margin: 0; }
.media.recommendation-card { background: var(--paper); border: 1px solid var(--line); color: var(--ink); }
.recommendation-card > span { color: var(--muted); }
.player { width: 100%; margin: var(--card-gap) 0; border-radius: var(--radius-control); }
.empty { margin-top: var(--card-gap); }

.about-hero { padding: 24px 0 8px; }
.about-hero .mission { font-size: var(--font-card); color: var(--teal); font-weight: 700; margin: 0 0 12px; }
.about-point { display: flex; gap: 12px; align-items: flex-start; border-top: 1px solid var(--line); padding: var(--card-gap) 0; }
.about-point > div { min-width: 0; }
.about-point .no { font-size: var(--font-label); color: var(--orange-ink); font-weight: 800; flex: none; }
.about-point p, .about-copy { color: var(--muted); margin: 4px 0 0; }
.about-methods { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--card-gap); }
.about-site { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; padding: 10px 12px; width: 100%; min-height: var(--button-secondary); border-radius: var(--radius-control); background: #f1faf5; color: var(--teal); border: 1px solid var(--line); font-size: var(--font-body); font-weight: 650; }

@media (min-width: 600px) {
  body { padding: 20px 0; }
  .stage { border-radius: 24px; min-height: max(820px, calc(100dvh - 40px)); }
  .footer { border-radius: 0 0 24px 24px; }
  .stage::after { pointer-events: none; content: "交互原型 · 仅演示体验流程"; position: fixed; bottom: 25px; right: 24px; font-size: var(--font-label); color: var(--muted); }
}

@media (prefers-reduced-motion: reduce) {
  .donut-ring, .donut-hit { transition: none; }
}
