/* ── reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:#0d1117; --surface:#161b22; --surface2:#1c2230; --border:#21262d; --border2:#30363d;
  --text:#e6edf3; --text2:#7d8590; --text3:#484f58;
  --c-blocked:#f85149; --c-waiting:#58a6ff; --c-active:#3fb950; --c-review:#d29922; --c-done:#6e7681;
  --bg-blocked:#2d1117; --bg-waiting:#0d1f36; --bg-active:#0d2318; --bg-review:#2b1d07; --bg-done:#1a1f27;
  --cm:#58a6ff; --cm-bg:#0d1f36; --high:#f0883e;
  font-size:13px;
}
body { background:var(--bg); color:var(--text); line-height:1.5; min-height:100dvh;
  font-family:-apple-system,"SF Pro Text","Segoe UI",system-ui,sans-serif; }

.shell { max-width:1120px; margin:0 auto; padding:16px 16px 32px; display:flex; flex-direction:column; gap:14px; }

/* ── topbar ───────────────────────────────────────────────────────────────── */
.topbar { display:flex; justify-content:space-between; align-items:flex-end;
  border-bottom:1px solid var(--border); padding-bottom:12px; gap:8px; flex-wrap:wrap; }
.eyebrow { font-size:10px; color:var(--text2); text-transform:uppercase; letter-spacing:.1em; }
h1 { font-size:20px; font-weight:700; line-height:1.2; }
.topbar-right { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.machine-chip { font-size:11px; padding:2px 8px; border-radius:20px; background:var(--cm-bg);
  color:var(--cm); border:1px solid var(--border2); font-family:"SF Mono",Menlo,monospace; }
.gen-at { font-size:11px; color:var(--text2); }

/* ── 轮到你 · 行动区 ──────────────────────────────────────────────────────── */
.todo { background:var(--surface); border:1px solid var(--border2); border-radius:8px; padding:12px 14px; }
.todo-head { display:flex; align-items:baseline; gap:10px; margin-bottom:10px; flex-wrap:wrap; }
.todo-title { font-size:15px; font-weight:800; color:var(--text); }
.todo-sub { font-size:11px; color:var(--text2); }
.todo-list { display:flex; flex-direction:column; gap:8px; }
.todo-empty { font-size:13px; color:var(--text2); padding:4px 0; }
.todo-card { border:1px solid var(--border2); border-left-width:3px; border-radius:6px; padding:9px 12px;
  background:var(--surface2); }
.todo-card.pill-blocked { border-left-color:var(--c-blocked); }
.todo-card.pill-waiting { border-left-color:var(--c-waiting); }
.todo-card.pill-active  { border-left-color:var(--c-active); }
.todo-card.pill-review  { border-left-color:var(--c-review); }
.todo-card.pill-done    { border-left-color:var(--c-done); }
.todo-card-head { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:4px; }
.todo-stage { font-size:11px; font-weight:700; padding:1px 7px; border-radius:4px;
  background:var(--bg-review); color:var(--c-review); }
.todo-card.pill-blocked .todo-stage { background:var(--bg-blocked); color:var(--c-blocked); }
.todo-card.pill-waiting .todo-stage { background:var(--bg-waiting); color:var(--c-waiting); }
.todo-card.pill-active  .todo-stage { background:var(--bg-active);  color:var(--c-active); }
.todo-mod { font-size:13px; font-weight:700; color:var(--text); }
.todo-held { font-size:10px; padding:1px 6px; border-radius:3px; background:var(--bg-blocked);
  color:var(--c-blocked); border:1px solid #5a2020; white-space:nowrap; }
.todo-ask { font-size:13px; color:var(--text); line-height:1.5; }
.todo-ask a { color:var(--cm); text-decoration:underline; word-break:break-all; }
.todo-ref { font-size:10px; color:var(--text3); font-family:"SF Mono",Menlo,monospace; margin-top:3px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* ── board ────────────────────────────────────────────────────────────────── */
.board-cap { font-size:11px; color:var(--text2); padding:8px 12px 0; }
.board-wrap { background:var(--surface); border:1px solid var(--border); border-radius:8px; overflow:hidden; }
.board-scroll { overflow-x:auto; -webkit-overflow-scrolling:touch; }
.swimlane { width:100%; border-collapse:collapse; table-layout:fixed; }

.swimlane thead tr { background:var(--surface2); border-bottom:1px solid var(--border2); }
.swimlane th { padding:8px 12px; font-size:11px; font-weight:600; color:var(--text2);
  text-transform:uppercase; letter-spacing:.05em; text-align:center; white-space:nowrap;
  border-right:1px solid var(--border); }
.swimlane th:last-child { border-right:none; }
.col-mod { text-align:left !important; width:200px; min-width:150px; }
.col-stage { width:132px; min-width:104px; }
.hdr-dot { display:inline-block; width:6px; height:6px; border-radius:50%; margin-right:5px; vertical-align:middle; }
.d-blocked{background:var(--c-blocked);} .d-waiting{background:var(--c-waiting);}
.d-active{background:var(--c-active);} .d-review{background:var(--c-review);} .d-done{background:var(--c-done);}

/* ── band row (倡议) ─────────────────────────────────────────────────────── */
.band-row td { padding:0; border-bottom:1px solid var(--border2); }
.band { display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:9px 12px; background:linear-gradient(90deg,var(--surface2),transparent); }
.band-label { font-size:14px; font-weight:800; color:var(--text); letter-spacing:.02em; }
.band-owner { font-size:11px; color:var(--text3); }
.band-rollup { font-size:11px; color:var(--text2); margin-left:auto; }

/* ── item row ─────────────────────────────────────────────────────────────── */
.item-row { border-bottom:1px solid var(--border); }
.item-row:hover { background:rgba(255,255,255,.02); }
.row-blocked .td-mod { border-left:3px solid var(--c-blocked); }

.td-mod { padding:9px 12px 9px 14px; border-right:1px solid var(--border); vertical-align:middle; }
.mod-name { font-size:13px; font-weight:600; color:var(--text);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mod-note { font-size:10px; color:var(--c-review); font-weight:400; margin-left:4px; }
.mod-badges { display:flex; align-items:center; gap:5px; margin-top:3px; flex-wrap:wrap; }
.mod-flow { font-size:10px; color:var(--text3); white-space:nowrap; }

.td-stage { padding:7px 8px; text-align:center; vertical-align:middle;
  border-right:1px solid var(--border); position:relative; }
.td-stage:last-child { border-right:none; }
/* faint track line so empty cells read as a flow */
.td-stage::before { content:''; position:absolute; top:50%; left:0; right:0; height:1px;
  background:var(--border); pointer-events:none; }

/* ── pill ─────────────────────────────────────────────────────────────────── */
.pill { position:relative; z-index:1; display:inline-flex; flex-direction:column; align-items:center;
  gap:2px; padding:5px 9px; border-radius:6px; border:1px solid; min-width:84px; }
.pill-top { font-size:11px; font-weight:700; white-space:nowrap; display:flex; align-items:center; gap:4px; }
.pill-holder { font-size:10px; opacity:.85; white-space:nowrap; }
.pill-blocked{ background:var(--bg-blocked); border-color:var(--c-blocked); color:var(--c-blocked); }
.pill-waiting{ background:var(--bg-waiting); border-color:var(--c-waiting); color:var(--c-waiting); }
.pill-active { background:var(--bg-active);  border-color:var(--c-active);  color:var(--c-active); }
.pill-review { background:var(--bg-review);  border-color:var(--c-review);  color:var(--c-review); }
.pill-done   { background:var(--bg-done);    border-color:var(--c-done);    color:var(--c-done); }

/* ── src marks (声明 vs 推断) ───────────────────────────────────────────── */
.src-mark { font-size:9px; padding:0 4px; border-radius:3px; font-weight:600; line-height:1.4; }
.src-mark.declared { background:#0d2318; color:var(--c-active); border:1px solid #1a4a2e; }
.src-mark.inferred { background:#2b1d07; color:var(--c-review); border:1px solid #4a3410; }

/* ── badges ───────────────────────────────────────────────────────────────── */
.b-cross { font-size:10px; padding:1px 5px; border-radius:3px; background:var(--cm-bg);
  color:var(--cm); border:1px solid var(--border2); white-space:nowrap; }
.b-high { font-size:10px; padding:1px 5px; border-radius:3px; background:#2d1c08;
  color:var(--high); border:1px solid #5a3010; white-space:nowrap; }

.loading { padding:24px; text-align:center; color:var(--text2); }

/* ── depth ────────────────────────────────────────────────────────────────── */
.depth { background:var(--surface); border:1px solid var(--border); border-radius:8px; overflow:hidden; }
.depth > summary { padding:10px 14px; font-size:12px; font-weight:600; color:var(--text2);
  cursor:pointer; user-select:none; list-style:none; display:flex; align-items:center; gap:6px; }
.depth > summary::before { content:'▶'; font-size:9px; transition:transform .15s; }
.depth[open] > summary::before { transform:rotate(90deg); }
.depth-grid { display:grid; grid-template-columns:1fr 1fr; gap:1px; background:var(--border); border-top:1px solid var(--border); }
.panel { background:var(--surface); overflow:hidden; }
.panel-title { font-size:10px; font-weight:700; color:var(--text2); text-transform:uppercase;
  letter-spacing:.07em; padding:6px 12px; border-bottom:1px solid var(--border); background:var(--surface2); }
.panel-body { padding:8px 10px; display:flex; flex-direction:column; gap:4px; }
.mini-row { display:flex; flex-direction:column; gap:1px; padding:3px 0;
  border-bottom:1px solid var(--border); font-size:12px; }
.mini-row:last-child { border-bottom:none; }
.mini-row small { font-size:10px; color:var(--text2); }
.mini-row span { display:flex; align-items:center; gap:5px; }

/* ── footer ───────────────────────────────────────────────────────────────── */
.footer { font-size:11px; color:var(--text2); display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.red-label { color:#f85149; font-weight:700; }
.commit { font-family:"SF Mono",Menlo,monospace; font-size:10px; margin-left:auto; }

/* ── responsive ──────────────────────────────────────────────────────────── */
@media (max-width:640px) {
  .col-mod { width:130px; min-width:110px; }
  .col-stage { width:96px; min-width:84px; }
  .pill { min-width:72px; padding:4px 6px; }
  .depth-grid { grid-template-columns:1fr; }
  .band-rollup { margin-left:0; flex-basis:100%; }
}
