:root {
  --bg: #f4f5f7;
  --paper: #ffffff;
  --ink: #17212b;
  --muted: #657281;
  --line: #dfe4ea;
  --sidebar: #18232d;
  --sidebar-ink: #e9eef3;
  --accent: #1f6feb;
  --accent-soft: #eaf2ff;
  --ok: #16734b;
  --ok-bg: #e9f7f0;
  --hold: #986b05;
  --hold-bg: #fff7df;
  --lock: #687481;
  --lock-bg: #f0f2f4;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --radius: 8px;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { display: flex; min-height: 100vh; }
button, a { font: inherit; }

.sidebar {
  width: 232px;
  flex: 0 0 232px;
  min-height: 100vh;
  background: var(--sidebar);
  color: var(--sidebar-ink);
  display: flex;
  flex-direction: column;
  padding: 22px 15px 16px;
}
.brand-kicker { color: #9fb0bf; font-size: 11px; letter-spacing: .12em; }
.brand-title { font-size: 21px; font-weight: 700; margin-top: 5px; }
.brand-sub { color: #aebac5; font-size: 12px; margin: 5px 0 22px; }
#nav { display: grid; gap: 4px; }
#nav button {
  border: 0;
  border-radius: 6px;
  padding: 10px 11px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
#nav button:hover, #nav button.on { background: #27465f; color: #fff; }
.sidebar-foot { margin-top: auto; padding-top: 18px; }
.sidebar-foot a, .sidebar-foot button {
  display: block;
  color: #cfe0ff;
  background: transparent;
  border: 0;
  padding: 7px 0;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  font-size: 13px;
}
.hint { color: #9eabb6; font-size: 12px; line-height: 1.5; margin: 10px 0 0; }

.shell { flex: 1; min-width: 0; }
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 25px 38px 0;
}
.eyebrow { color: var(--muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.topbar h1 { margin: 4px 0 0; font-size: 24px; }
.sub { color: var(--muted); margin: 5px 0 0; font-size: 13px; }
.live-status { color: var(--muted); font-size: 12px; white-space: nowrap; padding-top: 5px; }
main { max-width: 1140px; padding: 20px 38px 60px; }

.notice {
  border: 1px solid #f1ce80;
  border-left: 4px solid var(--hold);
  border-radius: var(--radius);
  background: var(--hold-bg);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.notice strong { display: block; margin-bottom: 4px; }
.notice p { margin: 0; color: #6e5312; line-height: 1.55; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.kpi .label { color: var(--muted); font-size: 12px; }
.kpi .value { font-size: 18px; font-weight: 700; margin-top: 6px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 24px 0 8px; }
.section-head h2 { font-size: 17px; margin: 0; }
.section-head p { color: var(--muted); font-size: 12px; margin: 0; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.next-panel { border-left: 4px solid var(--accent); }
.next-title { font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.meta { color: var(--muted); font-size: 13px; line-height: 1.55; }
.row { display: flex; flex-wrap: wrap; gap: 7px 16px; }
.row span { min-width: 145px; }
.timeline { display: grid; gap: 8px; }
.timeline-item { display: grid; grid-template-columns: 116px 1fr auto; gap: 12px; align-items: start; border-bottom: 1px solid var(--line); padding: 11px 0; }
.timeline-item:last-child { border-bottom: 0; padding-bottom: 0; }
.timeline-date { color: var(--muted); font-size: 12px; }
.timeline-title { font-weight: 650; }
.timeline-desc { color: var(--muted); font-size: 13px; line-height: 1.45; margin-top: 3px; }

.task-list { display: grid; gap: 8px; }
.task { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); overflow: hidden; }
.task summary { cursor: pointer; list-style: none; padding: 14px 15px; }
.task summary::-webkit-details-marker { display: none; }
.task summary:hover { background: #f8fafc; }
.task-head { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.task-index { color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; }
.task-title { font-weight: 700; }
.task-stage { color: var(--muted); font-size: 12px; margin-top: 3px; }
.task-body { border-top: 1px solid var(--line); padding: 13px 15px 15px 53px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.task-body p { margin: 0 0 8px; }
.task-body p:last-child { margin-bottom: 0; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 8px; font-size: 12px; white-space: nowrap; }
.pill.done { color: var(--ok); background: var(--ok-bg); }
.pill.next { color: var(--accent); background: var(--accent-soft); }
.pill.hold { color: var(--hold); background: var(--hold-bg); }
.pill.locked { color: var(--lock); background: var(--lock-bg); }
.pill.bad { color: var(--bad); background: var(--bad-bg); }

.flow { display: grid; gap: 8px; }
.flow-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 13px; background: var(--paper); }
.flow-num { color: var(--muted); font-size: 12px; text-align: center; }
.flow-title { font-weight: 650; }
.flow-deps { color: var(--muted); font-size: 12px; margin-top: 3px; }

.run-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.run-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--paper); }
.run-card h3 { font-size: 15px; margin: 0 0 8px; }
.run-card dl { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 6px 10px; margin: 0; font-size: 13px; }
.run-card dt { color: var(--muted); }
.run-card dd { margin: 0; word-break: break-word; }
.checks { display: grid; gap: 5px; margin-top: 12px; }
.check { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--line); padding-bottom: 5px; font-size: 12px; }
.check:last-child { border-bottom: 0; }
.check span:last-child { color: var(--ok); font-weight: 650; }

.links { display: grid; gap: 8px; }
.links a { color: var(--accent); text-decoration: none; }
.links a:hover { text-decoration: underline; }
.small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.mono { font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; word-break: break-all; }
.empty { color: var(--muted); padding: 18px 0; }

@media (max-width: 860px) {
  body { display: block; }
  .sidebar { width: 100%; min-height: auto; }
  #nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sidebar-foot { margin-top: 14px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .run-grid { grid-template-columns: 1fr; }
  .topbar, main { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 520px) {
  #nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { display: block; }
  .live-status { margin-top: 10px; }
  .grid { grid-template-columns: 1fr 1fr; }
  .timeline-item { grid-template-columns: 1fr; gap: 4px; }
  .task-head { grid-template-columns: 24px minmax(0, 1fr); }
  .task-head .pill { grid-column: 2; justify-self: start; }
  .task-body { padding-left: 15px; }
  .flow-row { grid-template-columns: 28px minmax(0, 1fr); }
  .flow-row .pill { grid-column: 2; justify-self: start; }
  .run-card dl { grid-template-columns: 108px minmax(0, 1fr); }
}
