:root {
  --bg: #08090a;
  --bg-soft: #0d0e11;
  --ink: #f3f4f6;
  --ink-2: #c3c7cf;
  --muted: #7c828c;
  --faint: #565b64;
  --line: rgba(255, 255, 255, 0.085);
  --line-strong: rgba(255, 255, 255, 0.16);
  --red: #e32126;
  --red-soft: rgba(227, 33, 38, 0.12);
  --red-line: rgba(227, 33, 38, 0.45);
  --cyan: #19c6e8;
  --green: #37c77d;
  --amber: #e6a23c;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", -apple-system, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Cascadia Mono", "Roboto Mono", Consolas, monospace;
  --radius: 18px;
}

* { box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
}

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

a { color: var(--cyan); text-decoration: none; }

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(620px 420px at 8% -10%, rgba(227, 33, 38, 0.18), transparent 62%),
    radial-gradient(700px 520px at 108% 18%, rgba(25, 198, 232, 0.1), transparent 60%),
    radial-gradient(900px 600px at 50% 118%, rgba(227, 33, 38, 0.06), transparent 70%);
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 72%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 72%);
}

.shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 30px 22px calc(36px + env(safe-area-inset-bottom));
}

/* ---------- screens ---------- */
.screen { display: none; }
.screen.is-active { display: block; animation: rise 0.5s cubic-bezier(0.22, 0.72, 0.2, 1) both; }
.screen-quiz.is-active { display: flex; flex-direction: column; min-height: 100dvh; padding-top: 22px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.hidden { display: none !important; }

/* ---------- masthead ---------- */
.masthead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

.brand {
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--ink);
}

.brand-x { color: var(--red); }

.brand-sub {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- hero ---------- */
.hero { margin-top: 46px; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--faint);
  text-transform: uppercase;
}

.tick { width: 26px; height: 1px; background: var(--red); display: inline-block; }

.hero-title {
  margin: 18px 0 0;
  font-size: clamp(30px, 8.6vw, 38px);
  line-height: 1.34;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.accent-red { color: var(--red); }

.hero-lede {
  margin: 16px 0 0;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--ink-2);
  max-width: 26em;
}

/* ---------- spec strip ---------- */
.spec-strip {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.spec {
  padding: 16px 0 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.spec + .spec { border-left: 1px solid var(--line); padding-left: 16px; }

.spec-num { font-family: var(--font-mono); font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }

.spec-key { font-size: 11px; letter-spacing: 0.14em; color: var(--muted); }

/* ---------- props ---------- */
.props { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 16px; }

.props li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 6px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-2);
}

.prop-index {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--red);
  padding-top: 4px;
  letter-spacing: 0.08em;
}

/* ---------- buttons ---------- */
.actions { margin-top: 38px; display: grid; gap: 12px; }

.btn {
  position: relative;
  width: 100%;
  height: 56px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: transform 0.16s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.985); }

.btn-primary { background: var(--red); color: #fff; box-shadow: 0 12px 34px -18px rgba(227, 33, 38, 0.9); }
.btn-primary[disabled] { background: #34191b; color: #7d5c5e; box-shadow: none; cursor: not-allowed; }

.btn-arrow { font-family: var(--font-mono); font-size: 15px; opacity: 0.85; }

.btn-ghost {
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.015);
}

.btn-ghost:active { background: rgba(255, 255, 255, 0.05); }

.footnote {
  margin: 30px 0 0;
  font-size: 11px;
  line-height: 1.8;
  color: var(--faint);
}

/* ---------- step head ---------- */
.step-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; }

.link-back {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.02em;
  padding: 6px 0;
}

.step-index {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--faint);
}

.page-title { margin: 0; font-size: 26px; font-weight: 650; letter-spacing: -0.01em; }

.page-sub { margin: 10px 0 0; font-size: 13px; line-height: 1.75; color: var(--muted); }

/* ---------- fields ---------- */
.field { margin-top: 30px; }

.field-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  margin-bottom: 12px;
}

.req { font-size: 10px; color: var(--red); letter-spacing: 0.08em; }
.opt { font-size: 10px; color: var(--faint); letter-spacing: 0.08em; }

.chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.chip {
  min-height: 48px;
  padding: 11px 14px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.022);
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.35;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 9px;
  transition: all 0.16s ease;
}

.chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid var(--faint);
  flex: 0 0 7px;
  transition: all 0.16s ease;
}

.chip.on {
  border-color: var(--red-line);
  background: var(--red-soft);
  color: #fff;
}

.chip.on::before { background: var(--red); border-color: var(--red); box-shadow: 0 0 0 3px rgba(227, 33, 38, 0.16); }

.field-warn { margin: 10px 0 0; font-size: 11.5px; color: var(--amber); }

/* ---------- sticky actions ---------- */
.sticky-actions {
  position: sticky;
  bottom: 0;
  margin: 40px -22px 0;
  padding: 18px 22px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 58%, rgba(8, 9, 10, 0.86) 82%, transparent);
}

/* ---------- consent ---------- */
.card {
  margin-top: 26px;
  padding: 6px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.036), rgba(255, 255, 255, 0.012));
}

.consent-card { padding: 4px 18px; }

.check-row {
  width: 100%;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 14px;
  padding: 18px 0;
  text-align: left;
}

.checkbox {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  margin-top: 2px;
  transition: all 0.18s ease;
}

.checkbox::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(43deg) scale(0.4);
  opacity: 0;
  transition: all 0.18s ease;
}

.check-row[aria-pressed="true"] .checkbox { background: var(--red); border-color: var(--red); }
.check-row[aria-pressed="true"] .checkbox::after { opacity: 1; transform: rotate(43deg) scale(1); }

.check-copy { display: grid; gap: 5px; }
.check-title { font-size: 14.5px; font-weight: 550; color: var(--ink); }
.check-sub { font-size: 12px; line-height: 1.7; color: var(--muted); }

.hairline { height: 1px; background: var(--line); }

.notes { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 10px; }

.notes li {
  position: relative;
  padding-left: 14px;
  font-size: 12px;
  line-height: 1.75;
  color: var(--muted);
}

.notes li::before { content: ""; position: absolute; left: 0; top: 9px; width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }

/* ---------- quiz ---------- */
.quiz-top { flex: 0 0 auto; }

.quiz-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

.phase { font-size: 12px; letter-spacing: 0.06em; color: var(--cyan); }

.remain { font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }

.progress { margin-top: 12px; height: 2px; background: rgba(255, 255, 255, 0.08); border-radius: 2px; overflow: hidden; }

.progress-bar {
  height: 100%;
  width: 1%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--red), var(--cyan));
  transition: width 0.35s cubic-bezier(0.3, 0.7, 0.2, 1);
}

.quiz-count {
  margin-top: 9px;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--faint);
}

.question { flex: 1 1 auto; padding-top: 40px; }

.stem {
  margin: 0;
  font-size: clamp(21px, 5.6vw, 25px);
  line-height: 1.6;
  font-weight: 600;
  letter-spacing: -0.01em;
  min-height: 3.2em;
}

.options { margin-top: 30px; display: grid; gap: 10px; }

.opt-btn {
  width: 100%;
  min-height: 58px;
  padding: 15px 16px;
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.022);
  color: var(--ink-2);
  text-align: left;
  font-size: 15px;
  line-height: 1.45;
  transition: transform 0.14s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}

.opt-btn:active { transform: scale(0.99); }

.opt-index {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.06em;
  transition: color 0.16s ease;
}

.opt-btn.on {
  border-color: var(--red-line);
  background: var(--red-soft);
  color: #fff;
}

.opt-btn.on .opt-index { color: var(--red); }

.opt-btn[disabled] { opacity: 0.72; }

.risk-block {
  margin-top: 26px;
  padding: 16px 18px;
  border: 1px solid rgba(25, 198, 232, 0.18);
  border-radius: 14px;
  background: rgba(25, 198, 232, 0.05);
}

.risk-tip { margin: 0; font-size: 12px; line-height: 1.7; color: var(--muted); }

.link-skip { margin-top: 8px; font-size: 13px; color: var(--cyan); }

.quiz-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 calc(6px + env(safe-area-inset-bottom));
}

.link-quiet { font-size: 12.5px; color: var(--faint); padding: 8px 0; }
.link-back.disabled { color: #31353b; pointer-events: none; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(30px + env(safe-area-inset-bottom));
  transform: translate(-50%, 16px);
  max-width: min(84vw, 420px);
  padding: 11px 18px;
  border-radius: 999px;
  background: rgba(24, 25, 28, 0.96);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 60;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- overlay ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 7, 8, 0.9);
  backdrop-filter: blur(6px);
}

.overlay-card { text-align: center; padding: 0 40px; }

.spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--red);
  animation: spin 0.85s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.overlay-title { font-size: 17px; font-weight: 600; letter-spacing: 0.02em; }
.overlay-sub { margin-top: 8px; font-size: 12px; line-height: 1.7; color: var(--muted); }
.overlay-actions { margin: 24px auto 0; width: min(76vw, 300px); display: grid; gap: 10px; }
.overlay-actions .btn { height: 50px; font-size: 14.5px; }

/* ---------- report ---------- */
.banner {
  padding: 12px 15px;
  border-radius: 11px;
  border: 1px solid rgba(25, 198, 232, 0.18);
  background: rgba(25, 198, 232, 0.06);
  color: var(--cyan);
  font-size: 11.5px;
  line-height: 1.65;
}

.crisis {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid rgba(227, 33, 38, 0.45);
  border-radius: var(--radius);
  background: rgba(227, 33, 38, 0.09);
}

.crisis-title { font-size: 19px; font-weight: 680; }
.crisis-note { margin-top: 8px; font-size: 13px; line-height: 1.8; color: #f0d5d6; }

.hotline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  margin-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13.5px;
  color: #fff;
}

.hotline .phone { font-family: var(--font-mono); color: var(--cyan); letter-spacing: 0.04em; }

.report-hero { margin-top: 32px; }

.report-hero .eyebrow { color: var(--faint); }

.report-title { margin: 14px 0 0; font-size: 30px; font-weight: 680; letter-spacing: -0.015em; }

.report-sub { margin: 10px 0 0; font-size: 13px; line-height: 1.75; color: var(--muted); }

.chips-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.chip-tag {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink-2);
  font-size: 10.5px;
  letter-spacing: 0.05em;
}

.section {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0.01));
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink);
  margin: 0 0 16px;
}

.section-title .idx { font-family: var(--font-mono); font-size: 10px; color: var(--faint); letter-spacing: 0.1em; }

.radar-wrap { margin: 0 auto; max-width: 360px; }
.radar-svg { width: 100%; height: auto; display: block; }

.radar-note { margin-top: 6px; font-size: 10.5px; line-height: 1.6; color: var(--faint); text-align: center; }

.dim-row { display: grid; grid-template-columns: 78px 1fr 66px; align-items: center; gap: 12px; padding: 7px 0; }

.dim-name { font-size: 12px; color: var(--ink-2); white-space: nowrap; }

.dim-bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }

.dim-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--red), var(--cyan)); }

.dim-val { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); text-align: right; white-space: nowrap; }

.domain + .domain { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }

.domain-title { font-size: 12.5px; color: var(--cyan); letter-spacing: 0.05em; }

.domain-text { margin-top: 7px; font-size: 13.5px; line-height: 1.85; color: var(--ink-2); }

.domain-action { margin-top: 8px; font-size: 12.5px; line-height: 1.75; color: var(--red); }

.big-num { font-family: var(--font-mono); font-size: 58px; font-weight: 600; line-height: 1; letter-spacing: -0.03em; }

.big-num .unit { margin-left: 8px; font-size: 12px; color: var(--muted); font-weight: 400; letter-spacing: 0.08em; }

.big-meta { margin-top: 8px; font-size: 12px; color: var(--muted); }

.body-text { margin-top: 12px; font-size: 13.5px; line-height: 1.85; color: var(--ink-2); }

.tiny-note { margin-top: 12px; font-size: 10.5px; line-height: 1.7; color: var(--faint); }

.trait { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 0; }

.trait-name { font-size: 13px; color: var(--ink-2); }

.trait-score { font-family: var(--font-mono); font-size: 12.5px; color: var(--cyan); }

.trait-note { font-size: 11.5px; color: var(--faint); padding-bottom: 8px; }

.rule { height: 1px; background: var(--line); margin: 16px 0; }

.focus-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.focus-pill {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(227, 33, 38, 0.4);
  background: rgba(227, 33, 38, 0.12);
  color: #fff;
  font-size: 12.5px;
}

.quadrant { font-size: 17px; font-weight: 600; color: var(--cyan); }

.status-card { border-left: 2px solid var(--line-strong); }
.status-green { border-left-color: var(--green); }
.status-yellow { border-left-color: var(--amber); }
.status-red { border-left-color: var(--red); }

.status-title { font-size: 18px; font-weight: 650; }

.status-actions { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }

.status-actions li { position: relative; padding-left: 14px; font-size: 12.5px; line-height: 1.7; color: var(--ink-2); }

.status-actions li::before { content: "→"; position: absolute; left: 0; color: var(--red); font-size: 11px; }

.report-meta { margin-top: 30px; font-size: 10.5px; line-height: 1.9; color: var(--faint); }

.report-actions { margin-top: 22px; display: grid; gap: 12px; }

/* ---------- small screens ---------- */
@media (max-width: 360px) {
  .shell { padding-left: 18px; padding-right: 18px; }
  .sticky-actions { margin-left: -18px; margin-right: -18px; padding-left: 18px; padding-right: 18px; }
  .dim-row { grid-template-columns: 70px 1fr 60px; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
