:root {
  --bg: #0f1729;
  --bg-soft: #f4f6fb;
  --panel: #ffffff;
  --ink: #1c2434;
  --ink-soft: #5a6478;
  --muted: #8a93a6;
  --line: #e4e8f0;
  --brand: #4f46e5;
  --brand-soft: #eef0fe;
  --green: #0f9d6b;
  --green-soft: #e3f6ee;
  --amber: #c8820a;
  --amber-soft: #fcf2dc;
  --red: #d6493f;
  --red-soft: #fbe7e5;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-soft);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

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

/* Header */
.site-header {
  background: linear-gradient(120deg, #131c33 0%, #2a2c6e 60%, #4f46e5 120%);
  color: #fff;
  padding: 18px 0;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { font-size: 34px; line-height: 1; }
.site-header h1 { margin: 0; font-size: 21px; letter-spacing: .3px; }
.tagline { margin: 3px 0 0; font-size: 13px; opacity: .82; }
.header-actions { display: flex; gap: 10px; }

/* Layout */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
  gap: 22px;
  padding: 24px 0 48px;
  align-items: start;
}
@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.input-panel { position: sticky; top: 18px; }
@media (max-width: 920px) { .input-panel { position: static; } }

.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; font-size: 16px; }
.muted { color: var(--muted); font-size: 12.5px; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-soft); }
.field.grow { flex: 1; }
.field span { font-weight: 600; }
input[type="text"], input[type="number"], select {
  font: inherit;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.meta-row { margin-bottom: 14px; }

/* Step editor cards */
.step-list { display: flex; flex-direction: column; gap: 12px; }
.step-edit {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px;
  background: #fbfcfe;
}
.step-edit-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.step-num {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
}
.step-edit-head input[type="text"] { font-weight: 600; }
.btn-remove {
  flex: 0 0 auto;
  border: none; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 18px; line-height: 1; padding: 4px 6px; border-radius: 6px;
}
.btn-remove:hover { background: var(--red-soft); color: var(--red); }

.step-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 9px; margin-bottom: 10px; }
.flags { display: flex; flex-wrap: wrap; gap: 6px; }
.flag-chip {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 10px; font-size: 12px; cursor: pointer; user-select: none;
  background: #fff; color: var(--ink-soft);
}
.flag-chip input { position: absolute; opacity: 0; pointer-events: none; }
.flag-chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 600; }

/* Buttons */
.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border-radius: 9px; padding: 9px 14px; border: 1px solid transparent;
  transition: transform .04s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: #4338ca; }
.btn-ghost { background: rgba(255,255,255,.12); color: inherit; border-color: rgba(255,255,255,.28); }
.result-actions .btn-ghost, .empty-state .btn { color: var(--brand); background: var(--brand-soft); border-color: transparent; }
.result-actions .btn-primary { color: #fff; background: var(--brand); }
.btn-add {
  width: 100%; margin-top: 14px; background: var(--brand-soft); color: var(--brand);
  border: 1px dashed var(--brand);
}
.btn-add:hover { background: #e3e6fd; }

.privacy-note { margin: 16px 0 0; font-size: 12px; color: var(--muted); }

/* Result */
.empty-state { text-align: center; color: var(--muted); padding: 40px 12px; }
.empty-state p { margin: 0 0 16px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 8px; }
@media (max-width: 560px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi {
  border: 1px solid var(--line); border-radius: 12px; padding: 13px;
  background: #fbfcfe;
}
.kpi .v { font-size: 22px; font-weight: 800; line-height: 1.1; }
.kpi .k { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi.accent { background: var(--brand-soft); border-color: transparent; }
.kpi.accent .v { color: var(--brand); }

.section-title { font-size: 14px; margin: 24px 0 12px; color: var(--ink); border-left: 3px solid var(--brand); padding-left: 9px; }

/* Step result cards */
.step-cards { display: flex; flex-direction: column; gap: 12px; }
.scard {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px;
  background: #fff;
}
.scard.qw { border-color: var(--green); box-shadow: 0 0 0 1px var(--green-soft) inset; }
.scard-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.scard-title { font-weight: 700; font-size: 15px; flex: 1; min-width: 140px; }
.pri-badge {
  font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  color: #fff;
}
.tag {
  font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--bg-soft);
  color: var(--ink-soft); border: 1px solid var(--line);
}
.tag.qw { background: var(--green-soft); color: var(--green); border-color: transparent; font-weight: 700; }

.bars { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 11px; }
@media (max-width: 480px) { .bars { grid-template-columns: 1fr; } }
.bar-item .bar-label { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-soft); margin-bottom: 4px; }
.bar-track { height: 7px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; }

.scard-meta { font-size: 12px; color: var(--muted); margin-bottom: 9px; }
.scard-meta b { color: var(--ink-soft); }
.suggest { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.suggest li { font-size: 13px; padding-left: 20px; position: relative; color: var(--ink); }
.suggest li::before { content: "→"; position: absolute; left: 0; color: var(--brand); font-weight: 700; }

/* Roadmap */
.roadmap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px) { .roadmap { grid-template-columns: 1fr; } }
.wave {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fbfcfe;
}
.wave-head { margin-bottom: 10px; }
.wave-window { font-size: 12px; font-weight: 700; color: var(--brand); }
.wave-title { font-size: 13.5px; font-weight: 700; margin-top: 2px; }
.wave-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wave-item {
  background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px;
  font-size: 13px;
}
.wave-item .wi-name { font-weight: 600; }
.wave-item .wi-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.wave-empty { font-size: 12.5px; color: var(--muted); padding: 8px 0; }

.disclaimer { margin-top: 22px; font-size: 11.5px; color: var(--muted); line-height: 1.6; }

/* Footer */
.site-footer { padding: 22px 0 30px; color: var(--muted); font-size: 12.5px; text-align: center; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
