:root {
  --bg: #0f1115;
  --bg-soft: #161a22;
  --panel: #1b212c;
  --panel-2: #222a37;
  --line: #2c3441;
  --text: #e8edf4;
  --muted: #97a3b6;
  --accent: #5b8cff;
  --accent-2: #38d39f;
  --warn: #ffb454;
  --danger: #ff6b6b;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(0,0,0,.28);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 700px at 80% -10%, #1d2535 0%, var(--bg) 55%) fixed;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.wrap { width: min(1180px, 92vw); margin: 0 auto; }

/* topbar */
.topbar { border-bottom: 1px solid var(--line); background: rgba(15,17,21,.7); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; flex-wrap: wrap; }
.brand { display: flex; gap: 12px; align-items: center; }
.logo { font-size: 26px; filter: drop-shadow(0 2px 6px rgba(91,140,255,.5)); }
h1 { font-size: 19px; margin: 0; letter-spacing: .2px; }
.tagline { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.topbar-actions { display: flex; gap: 8px; }

/* layout */
.layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 22px 0 40px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.panel-head h2 { font-size: 15px; margin: 0 0 4px; }
.panel-head .hint { margin: 0 0 14px; color: var(--muted); font-size: 12.5px; }
.panel-head.sticky { position: sticky; top: 70px; background: var(--panel); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-bottom: 12px; margin-bottom: 6px; z-index: 5; }

/* fields */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
input[type=text], input[type=number], select {
  width: 100%; background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; font-size: 14px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,140,255,.18); }

/* step rows */
.steps { display: flex; flex-direction: column; gap: 12px; }
.step {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px; padding: 12px;
  position: relative;
}
.step-top { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.step-idx { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.step-name { flex: 1; }
.step-name input { font-weight: 600; }
.step-del { background: transparent; border: none; color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; padding: 4px 6px; border-radius: 6px; }
.step-del:hover { color: var(--danger); background: rgba(255,107,107,.12); }
.step-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 10px; }
.step-grid .mini > span { font-size: 11px; color: var(--muted); display: block; margin-bottom: 3px; }
.step-grid input, .step-grid select { padding: 7px 9px; font-size: 13px; }
.flags { display: flex; flex-wrap: wrap; gap: 7px; }
.flag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; cursor: pointer; user-select: none; }
.flag input { accent-color: var(--accent); margin: 0; }
.flag.on { color: var(--text); border-color: var(--accent); background: rgba(91,140,255,.12); }

/* buttons */
.btn { cursor: pointer; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); border-radius: 9px; padding: 9px 14px; font-size: 13px; transition: .15s; }
.btn:hover { border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 11px; font-size: 12px; }
.btn.add { width: 100%; margin-top: 12px; border-style: dashed; color: var(--muted); }
.btn.add:hover { color: var(--accent); }
.legend { font-size: 11.5px; color: var(--muted); margin: 14px 0 0; line-height: 1.7; }

/* summary cards */
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px; padding: 12px 13px; }
.card .k { font-size: 11px; color: var(--muted); }
.card .v { font-size: 22px; font-weight: 800; margin-top: 3px; letter-spacing: .3px; }
.card .u { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.card.accent .v { color: var(--accent); }
.card.green .v { color: var(--accent-2); }
.card.warn .v { color: var(--warn); }

/* scoreboard */
.scoreboard { display: flex; flex-direction: column; gap: 9px; margin-bottom: 18px; }
.row {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px;
  display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center;
}
.row .rname { font-weight: 600; font-size: 14px; }
.row .tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.tag { font-size: 10.5px; padding: 2px 7px; border-radius: 999px; background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line); }
.tag.win { color: #062; background: #b9f6d0; border-color: #b9f6d0; font-weight: 700; }
.tag.hot { color: #5a1313; background: #ffc9c9; border-color: #ffc9c9; font-weight: 700; }
.bars { display: flex; flex-direction: column; gap: 5px; min-width: 190px; }
.bar { display: grid; grid-template-columns: 56px 1fr 34px; gap: 7px; align-items: center; font-size: 11px; color: var(--muted); }
.track { height: 7px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.fill { height: 100%; border-radius: 999px; }
.fill.b { background: linear-gradient(90deg,#ff8a5b,#ff6b6b); }
.fill.a { background: linear-gradient(90deg,#5b8cff,#38d39f); }
.bar .num { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }

/* blocks */
.block { margin-top: 6px; margin-bottom: 18px; }
.block h3 { font-size: 14px; margin: 0 0 10px; }
.sug { border-left: 3px solid var(--accent); background: var(--panel-2); border-radius: 0 9px 9px 0; padding: 10px 13px; margin-bottom: 9px; }
.sug .st { font-weight: 600; font-size: 13.5px; }
.sug .sd { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.sug .meta { font-size: 11px; color: var(--muted); margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; }
.sug .meta b { color: var(--accent-2); }

/* roadmap */
.week { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; margin-bottom: 10px; }
.week .wt { font-weight: 700; font-size: 13px; margin-bottom: 7px; color: var(--accent); }
.week ul { margin: 0; padding-left: 18px; }
.week li { font-size: 12.8px; margin-bottom: 5px; color: var(--text); }
.week li span { color: var(--muted); }

.empty { color: var(--muted); font-size: 13px; text-align: center; padding: 26px 10px; border: 1px dashed var(--line); border-radius: 10px; }
.copied { color: var(--accent-2); font-size: 12.5px; height: 18px; margin: 6px 0 0; }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 22px 0 34px; color: var(--muted); font-size: 12.5px; }
.foot .sub { font-size: 11.5px; opacity: .8; margin-top: 4px; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .panel-head.sticky { position: static; }
  .topbar { position: static; }
  .step-grid { grid-template-columns: repeat(2, 1fr); }
  .summary { grid-template-columns: repeat(3, 1fr); }
  .bars { min-width: 150px; }
}
@media (max-width: 480px) {
  .summary { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; }
  .bars { min-width: 0; }
}
