:root {
  --bg: #f4f6fb;
  --ink: #1a2233;
  --muted: #6b7689;
  --line: #e3e8f0;
  --card: #ffffff;
  --brand: #2f5bea;
  --brand-d: #1e40c4;
  --p0: #e8453c; --p0b: #fdecea;
  --p1: #f08c1d; --p1b: #fff4e4;
  --p2: #2f9e6d; --p2b: #e8f6ef;
  --p3: #8a94a6; --p3b: #f0f2f6;
  --shadow: 0 6px 22px rgba(28,40,80,.07);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, 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 22px; }

/* hero */
.hero {
  background: linear-gradient(135deg, #1c2c6b 0%, #2f5bea 60%, #4f7bff 100%);
  color: #fff; padding: 40px 0 34px;
}
.brand { font-weight: 700; letter-spacing: .3px; opacity: .92; margin-bottom: 14px; }
.hero h1 { font-size: 32px; line-height: 1.3; margin: 0 0 12px; font-weight: 800; max-width: 880px; }
.hero .hl { background: rgba(255,255,255,.18); padding: 0 8px; border-radius: 6px; }
.hero .sub { margin: 0; max-width: 820px; color: #e7ecff; font-size: 15px; }
.hero .sub b { color: #fff; }

/* layout */
.layout {
  display: grid; grid-template-columns: 380px 1fr; gap: 22px;
  margin-top: -18px; padding-bottom: 30px; align-items: start;
}
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; box-shadow: var(--shadow);
}
.result-panel { min-height: 400px; }
.panel h2 { font-size: 16px; margin: 0 0 18px; }

/* form */
.field { margin-bottom: 18px; }
.field > label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 8px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 7px 12px; border-radius: 20px; font-size: 13px; cursor: pointer;
  transition: all .14s ease; font-family: inherit;
}
.pill:hover { border-color: var(--brand); color: var(--brand); }
.pill.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.note { font-size: 12.5px; color: var(--brand-d); margin-top: 8px; background: #eef2ff; padding: 6px 10px; border-radius: 8px; }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: 12px; }
.disclaimer {
  margin-top: 8px; font-size: 12px; color: var(--muted);
  background: #f7f9fc; border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px;
}

/* results */
.result-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.result-head h2 { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  border: 1px solid var(--brand); background: var(--brand); color: #fff;
  padding: 7px 13px; border-radius: 8px; font-size: 12.5px; cursor: pointer;
  font-family: inherit; font-weight: 600; transition: all .14s;
}
.btn:hover { background: var(--brand-d); }
.btn.ghost { background: #fff; color: var(--brand); }
.btn.ghost:hover { background: #eef2ff; }
.btn:disabled { opacity: .7; cursor: default; }

.result-block { margin-bottom: 26px; }
.result-block h3 { font-size: 14.5px; margin: 0 0 12px; padding-bottom: 7px; border-bottom: 2px solid var(--line); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 11px; }
.card {
  border: 1px solid var(--line); border-left: 4px solid var(--p3);
  border-radius: 10px; padding: 12px 13px; background: #fff;
}
.card.p0 { border-left-color: var(--p0); }
.card.p1 { border-left-color: var(--p1); }
.card.p2 { border-left-color: var(--p2); }
.card.p3 { border-left-color: var(--p3); opacity: .82; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.mname { font-weight: 700; font-size: 14px; }
.tier { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.tier.p0 { background: var(--p0b); color: var(--p0); }
.tier.p1 { background: var(--p1b); color: var(--p1); }
.tier.p2 { background: var(--p2b); color: var(--p2); }
.tier.p3 { background: var(--p3b); color: var(--p3); }
.mshort { font-size: 12px; color: var(--muted); margin: 3px 0 8px; }
.bar { height: 6px; background: #eef1f6; border-radius: 5px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, #2f5bea, #4f7bff); border-radius: 5px; }
.reasons { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.reasons em { font-style: normal; font-size: 11px; background: #f0f3f9; color: var(--muted); padding: 2px 7px; border-radius: 6px; }

/* deps */
.deps { display: flex; flex-direction: column; gap: 8px; }
.dep-row { font-size: 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dep-row b { color: var(--ink); }
.dep-row .arrow { color: var(--muted); font-size: 11.5px; }
.dep-row i { font-style: normal; background: #eef2ff; color: var(--brand-d); padding: 2px 9px; border-radius: 6px; font-size: 12px; }
.warns { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.warn { font-size: 12.5px; background: var(--p1b); color: #9a5a00; padding: 7px 11px; border-radius: 8px; }

/* roadmap */
.roadmap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.phase { width: 100%; background: #f7f9fc; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.phase-h { font-weight: 700; font-size: 13px; color: var(--brand-d); margin-bottom: 8px; }
.phase-mods { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { background: #fff; border: 1px solid var(--brand); color: var(--brand-d); padding: 5px 12px; border-radius: 20px; font-size: 12.5px; font-weight: 600; }
.phase-arrow { color: var(--muted); font-size: 13px; }

/* risks */
.risks { margin: 0; padding-left: 18px; }
.risks li { font-size: 13px; margin-bottom: 8px; }
.risks li b { color: var(--ink); }
.risk-extra { color: #9a5a00; }

/* footer */
.foot { padding: 24px 22px 40px; color: var(--muted); font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.foot b { color: var(--ink); }

/* responsive */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .hero h1 { font-size: 25px; }
  .hero { padding: 30px 0 28px; }
}

/* print */
@media print {
  .hero, .foot, #form, .actions, .disclaimer { display: none !important; }
  body { background: #fff; }
  .layout { grid-template-columns: 1fr; margin: 0; }
  .panel { box-shadow: none; border: none; }
  .card { break-inside: avoid; }
}
