:root {
  --bg: #0b1120;
  --panel: #111a2e;
  --panel-2: #16213a;
  --line: #243049;
  --ink: #e8edf6;
  --ink-dim: #9aa7bd;
  --muted: #6b7894;
  --brand: #38bdf8;
  --brand-2: #0ea5e9;
  --good: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 80% -10%, #15233f 0%, var(--bg) 55%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(960px, 92vw); margin: 0 auto; }

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 0.85rem; }
.micro { color: var(--muted); font-size: 0.78rem; margin-top: 0.6rem; }
.hint { color: var(--ink-dim); font-size: 0.92rem; margin: 0.2rem 0 1rem; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(10, 16, 30, 0.7);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; gap: 12px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 9px; font-size: 1.05rem; }
.brand .dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 14px var(--brand);
}
.tagline { color: var(--ink-dim); font-size: 0.82rem; }

/* Hero */
.hero { padding: 56px 0 28px; }
.hero h1 {
  font-size: clamp(1.7rem, 4.4vw, 2.7rem);
  line-height: 1.2; margin: 0 0 16px; letter-spacing: -0.01em;
}
.lede { font-size: 1.06rem; color: var(--ink-dim); max-width: 60ch; }
.lede strong { color: var(--ink); }
.hero-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 22px; }
.reassure { color: var(--muted); font-size: 0.8rem; }

/* Buttons */
.btn {
  font: inherit; cursor: pointer; border: 1px solid transparent;
  border-radius: 10px; padding: 11px 20px; font-weight: 600;
  transition: transform .06s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, var(--brand), var(--brand-2)); color: #04121f; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--panel-2); }

/* Cards */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  margin: 20px 0;
  box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 6px; font-size: 1.25rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Progress */
.progress { flex: 1; min-width: 160px; height: 7px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--brand), var(--good)); transition: width .25s ease; }

/* Quiz */
.dim-group { border-top: 1px solid var(--line); padding: 18px 0; }
.dim-group:first-child { border-top: none; }
.dim-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dim-title h3 { margin: 0; font-size: 1.08rem; }
.dim-title .dim-desc { color: var(--muted); font-size: 0.84rem; }
.q { margin: 14px 0; }
.q-text { margin-bottom: 8px; font-size: 0.97rem; }
.opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.opt {
  border: 1px solid var(--line); background: var(--panel-2);
  border-radius: 9px; padding: 9px 8px; font-size: 0.8rem;
  cursor: pointer; text-align: center; color: var(--ink-dim);
  transition: all .12s ease; user-select: none;
}
.opt:hover { border-color: var(--brand); color: var(--ink); }
.opt.sel { background: linear-gradient(180deg, var(--brand), var(--brand-2)); color: #04121f; border-color: var(--brand); font-weight: 600; }

.quiz-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 18px; }

/* Funnel inputs */
.funnel-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.funnel-grid label { display: flex; flex-direction: column; gap: 7px; font-size: 0.9rem; color: var(--ink-dim); }
.funnel-grid input {
  font: inherit; padding: 11px 13px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
}
.funnel-grid input:focus { outline: none; border-color: var(--brand); }

/* Report top */
.report-top { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: center; }
.score-block { display: flex; flex-direction: column; gap: 14px; }
.big-score { font-size: 4.2rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.big-score small { font-size: 1.3rem; color: var(--muted); font-weight: 500; }
.maturity .badge {
  display: inline-block; padding: 4px 12px; border-radius: 99px;
  background: var(--panel-2); border: 1px solid var(--line);
  font-weight: 700; font-size: 1rem; margin-right: 8px;
}
.m-name { font-size: 1.2rem; font-weight: 700; }
.m-summary { color: var(--ink-dim); font-size: 0.95rem; margin: 8px 0 0; }
.radar-block { display: flex; justify-content: center; }
#radar { max-width: 100%; height: auto; }

/* Dimension bars */
.dim-bar { margin: 14px 0; }
.dim-bar-head { display: flex; justify-content: space-between; font-size: 0.92rem; margin-bottom: 6px; }
.dim-bar-head .v { font-weight: 700; }
.bar-track { height: 10px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; transition: width .4s ease; }

/* Funnel report */
.funnel-stages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 8px 0 14px; }
.stage {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px;
}
.stage .s-label { font-size: 0.82rem; color: var(--muted); }
.stage .s-rate { font-size: 1.8rem; font-weight: 800; margin: 4px 0; }
.stage .s-status { font-size: 0.82rem; font-weight: 600; }
.leak { font-size: 1rem; padding: 12px 14px; background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); border-radius: 10px; }
.uplift { font-size: 1rem; padding: 12px 14px; background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3); border-radius: 10px; margin-top: 10px; }

/* Roadmap */
.roadmap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.phase { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.phase h3 { margin: 0 0 4px; font-size: 1.02rem; }
.phase .ph-sub { color: var(--muted); font-size: 0.78rem; margin-bottom: 10px; }
.phase ul { margin: 0; padding-left: 18px; }
.phase li { margin: 8px 0; font-size: 0.88rem; color: var(--ink-dim); }

.cta-card { background: linear-gradient(180deg, var(--panel-2), var(--panel)); }
.report-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

/* History */
#historyList .hist-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-top: 1px solid var(--line); font-size: 0.9rem; gap: 12px;
}
#historyList .hist-item:first-child { border-top: none; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 26px 0 50px; }
.site-footer p { color: var(--ink-dim); font-size: 0.9rem; margin: 6px 0; }

/* Responsive */
@media (max-width: 720px) {
  .report-top { grid-template-columns: 1fr; }
  .radar-block { order: -1; }
  .funnel-grid, .funnel-stages, .roadmap { grid-template-columns: 1fr; }
  .opts { grid-template-columns: 1fr 1fr; }
  .hero { padding: 38px 0 18px; }
}

/* Print */
@media print {
  body { background: #fff; color: #111; }
  .site-header, .site-footer, .hero, #quiz, #funnel, .report-actions, .cta-card, #historyWrap { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ccc; background: #fff; color: #111; break-inside: avoid; }
  .m-summary, .hint, .dim-bar-head, .phase li { color: #333; }
}
