:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --ink: #16203a;
  --muted: #66708a;
  --line: #e3e8f2;
  --brand: #2f5bea;
  --brand-dark: #1d3fb8;
  --accent: #0fb5a4;
  --w1: #2f5bea;
  --w2: #7a5af0;
  --w3: #94a3b8;
  --hi: #e0573e;
  --mid: #e0992b;
  --lo: #18a05a;
  --shadow: 0 8px 30px rgba(24, 40, 90, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { font-size: 26px; }
.brand-title { font-weight: 700; font-size: 17px; }
.brand-sub { font-size: 12px; color: var(--muted); }
.ghost-link {
  color: var(--brand); text-decoration: none; font-weight: 600; font-size: 14px;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
}
.ghost-link:hover { background: #eef2fe; }

/* Hero */
.hero { padding: 44px 0 26px; }
.hero h1 { font-size: clamp(26px, 4vw, 40px); line-height: 1.18; margin: 0 0 14px; letter-spacing: -0.5px; }
.lead { font-size: 17px; color: #41506e; max-width: 760px; margin: 0; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.hero-badges span {
  font-size: 13px; color: var(--brand-dark); background: #e9eefe;
  padding: 6px 12px; border-radius: 999px; font-weight: 600;
}

/* Layout */
.layout { display: grid; grid-template-columns: 380px 1fr; gap: 22px; align-items: start; margin-top: 8px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.config { padding: 22px; position: sticky; top: 78px; }
.results { padding: 22px; min-height: 420px; }
.panel-title { font-size: 16px; margin: 0 0 16px; color: var(--brand-dark); }

/* Fields */
.field { margin-bottom: 18px; }
.field > label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.field label .sub { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 4px; }
.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.seg { display: flex; flex-wrap: wrap; gap: 7px; }
.seg.col { flex-direction: column; }
.opt, .chip {
  font: inherit; font-size: 13px; cursor: pointer;
  border: 1px solid var(--line); background: #fbfcff; color: var(--ink);
  padding: 7px 12px; border-radius: 9px; transition: all 0.14s; text-align: left;
}
.seg.col .opt { width: 100%; }
.opt:hover, .chip:hover { border-color: var(--brand); }
.opt.active { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 4px 12px rgba(47, 91, 234, 0.28); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip.active { background: #e7f8f4; border-color: var(--accent); color: #0a7d72; font-weight: 600; }
.chip.flash { animation: shake 0.4s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.btn { font: inherit; font-weight: 600; cursor: pointer; border-radius: 10px; padding: 11px 18px; border: 1px solid transparent; transition: all 0.14s; }
.btn.primary { background: var(--brand); color: #fff; flex: 1; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn.tiny { padding: 7px 13px; font-size: 13px; background: #fff; border-color: var(--line); color: var(--ink); }
.btn.tiny:hover { border-color: var(--brand); color: var(--brand); }

/* Empty */
.empty { text-align: center; color: var(--muted); padding: 70px 20px; }
.empty-art { font-size: 52px; margin-bottom: 14px; }

/* Output */
.result-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.result-tools { display: flex; gap: 8px; }
.block-title { font-size: 15px; margin: 26px 0 12px; padding-left: 10px; border-left: 3px solid var(--brand); }

.verdict { background: linear-gradient(135deg, #eef3ff, #f3f0ff); border: 1px solid #dfe6ff; border-radius: 12px; padding: 16px 18px; }
.verdict-main { font-size: 15px; }
.verdict-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.verdict-tags span { font-size: 12px; background: #fff; border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; color: var(--muted); }
.verdict-note { font-size: 13px; color: var(--muted); margin-top: 10px; }

/* Roadmap */
.roadmap { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.wave { flex: 1; min-width: 150px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fbfcff; }
.wave-1 { border-top: 3px solid var(--w1); }
.wave-2 { border-top: 3px solid var(--w2); }
.wave-3 { border-top: 3px solid var(--w3); }
.wave-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; margin-bottom: 10px; }
.wave-no { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; }
.wave-2 .wave-no { background: var(--w2); }
.wave-3 .wave-no { background: var(--w3); }
.wave-items { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { font-size: 12.5px; padding: 5px 10px; border-radius: 8px; background: #eef2fe; color: var(--brand-dark); font-weight: 600; border-left: 3px solid transparent; }
.pill.risk-hi { border-left-color: var(--hi); }
.pill.risk-mid { border-left-color: var(--mid); }
.pill.risk-lo { border-left-color: var(--lo); }
.wave-arrow { align-self: center; color: var(--muted); font-size: 20px; font-weight: 700; }

/* Module cards */
.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.mcard { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; transition: box-shadow 0.15s; }
.mcard:hover { box-shadow: var(--shadow); }
.mcard-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.mcard-top h4 { margin: 6px 0 0; font-size: 15px; }
.wave-tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; color: #fff; }
.wave-tag.wave-1 { background: var(--w1); }
.wave-tag.wave-2 { background: var(--w2); }
.wave-tag.wave-3 { background: var(--w3); }
.risk-tag { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.risk-hi { background: #fdece8; color: var(--hi); }
.risk-mid { background: #fcf2dd; color: #b9750f; }
.risk-lo { background: #e4f7ec; color: var(--lo); }
.mdesc { font-size: 13px; color: var(--muted); margin: 8px 0 12px; }
.bar { height: 7px; background: #eef1f7; border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 999px; }
.mmeta { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.why { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.why span { font-size: 11px; background: #f1f4fb; color: #4a5878; padding: 3px 8px; border-radius: 6px; }
.deps { font-size: 12px; margin-top: 10px; color: #4a5878; }
.deps.muted { color: var(--muted); }
.risk-note { font-size: 12px; color: var(--muted); margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }

/* Risks */
.risks { margin: 0; padding-left: 20px; }
.risks li { font-size: 14px; margin-bottom: 8px; color: #36425e; }
.disclaimer { font-size: 12px; color: var(--muted); margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }

/* Method */
.method { margin: 48px 0 20px; }
.method h2 { font-size: 22px; margin-bottom: 18px; }
.method-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.method-grid > div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.method-grid h4 { margin: 0 0 6px; font-size: 15px; color: var(--brand-dark); }
.method-grid p { margin: 0; font-size: 13.5px; color: var(--muted); }

/* Footer */
.footer { border-top: 1px solid var(--line); margin-top: 30px; padding: 22px 0 40px; background: #fff; }
.footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.footer .muted { color: var(--muted); }

@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  .config { position: static; }
  .wave-arrow { transform: rotate(90deg); }
}

@media print {
  .topbar, .hero, .config, .method, .footer, .result-tools, .ghost-link { display: none !important; }
  body { background: #fff; }
  .layout { display: block; }
  .panel { box-shadow: none; border: none; }
  .mcard, .wave { break-inside: avoid; }
}
