:root {
  color-scheme: dark;
  --ground: #151515; --surface: #101010; --raised: #202020; --border: #303030;
  --text: #ededed; --muted: #b4b4b4; --green: #2EE6A6; --red: #ED7088;
  --yellow: #F5C451; --pending: #7FA8C9;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px; line-height: 1.55; background: var(--ground); color: var(--text);
  font-variant-numeric: tabular-nums;
}
* { box-sizing: border-box; }
body { margin: 0; padding: 24px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; font-weight: 600; text-wrap: balance; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font: inherit; color: inherit; border: 1px solid var(--border); background: var(--raised); padding: 8px 12px; cursor: pointer; border-radius: 4px; min-height: 44px; }
button:hover { background: #2b2b2b; }
button:disabled { opacity: .65; cursor: wait; }
:focus-visible { outline: 2px solid var(--pending); outline-offset: 3px; }
a { color: var(--pending); text-underline-offset: 3px; }
a:hover { color: var(--text); }
.skip { position: absolute; top: -70px; background: var(--surface); padding: 12px; z-index: 2; }
.skip:focus { top: 8px; }
.topbar { display: flex; justify-content: space-between; gap: 24px; align-items: center; }
#project { color: var(--muted); margin-top: 4px; }
.refresh { display: flex; gap: 16px; align-items: center; color: var(--muted); }
.statusbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 24px 0 16px; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.green { color: var(--green); } .red { color: var(--red); } .yellow { color: var(--yellow); } .pending { color: var(--pending); }
.dot.green { background: var(--green); } .dot.red { background: var(--red); }
.dot.yellow { background: var(--yellow); } .dot.pending { background: var(--pending); }
.notice { padding: 12px 16px; background: var(--raised); margin: 0 0 16px; color: var(--muted); overflow-wrap: anywhere; }
/* 1440px：6 × 222px + 5 × 12px = 1392px = 1440px - 2 × 24px；六列完整呈现。 */
.board { display: grid; grid-template-columns: repeat(6, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; align-items: start; padding-bottom: 20px; scrollbar-color: #555 var(--ground); }
.part { min-width: 0; }
.part-head { padding: 16px 12px; min-height: 224px; border-top: 2px solid var(--border); }
.part-head.passed { border-color: var(--green); }
.part-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.part-id, .part-state { font-size: 12px; color: var(--muted); }
.gate { margin-top: 6px; overflow-wrap: anywhere; }
.gate-note, .pass-time { font-size: 12px; color: var(--muted); }
.pass-time { margin-top: 12px; }
.step { margin-bottom: 12px; background: var(--surface); border: 1px solid #252525; border-radius: 4px; padding: 14px 12px 8px; }
.step-title { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.step-title h3 { overflow-wrap: anywhere; }
.step-light { display: flex; align-items: center; gap: 4px; font-size: 12px; white-space: nowrap; padding-top: 2px; }
.owner { color: var(--muted); font-size: 12px; margin-top: 4px; }
.ledger { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; list-style: none; padding: 0; margin: 16px 0 10px; }
.ledger li { font-size: 11px; color: var(--muted); min-width: 0; }
.ledger .dot { display: block; width: 6px; height: 6px; margin-bottom: 4px; background: #4b4b4b; }
.ledger .recorded .dot { background: var(--text); }
.ledger time { display: block; font-size: 11px; margin-top: 3px; }
.items { list-style: none; padding: 0; margin: 0; }
.floor { border: 0; border-top: 1px solid #242424; border-radius: 0; background: transparent; display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 0; text-align: left; font-size: 12px; min-height: 44px; }
.floor:hover { background: var(--raised); }
.floor .name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.soft { color: var(--muted); font-size: 11px; white-space: nowrap; }
.floor-state { font-size: 11px; white-space: nowrap; }
.empty { color: var(--muted); font-size: 12px; padding: 8px 0; }
dialog { width: min(680px, calc(100% - 32px)); max-height: 85dvh; padding: 24px; color: var(--text); background: var(--raised); border: 1px solid #444; border-radius: 6px; overscroll-behavior: contain; }
dialog::backdrop { background: #000a; }
.dialog-top { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.dialog-top h2 { overflow-wrap: anywhere; }
#detail-body h3 { margin: 20px 0 8px; }
#detail-body p, #detail-body li { overflow-wrap: anywhere; white-space: pre-wrap; }
#detail-body ul { padding-left: 20px; }
#detail-body li { margin: 8px 0; }
@media (max-width: 640px) {
  body { padding: 16px; }
  h1 { font-size: 22px; }
  .topbar { display: block; }
  .refresh { justify-content: space-between; gap: 8px; margin-top: 16px; font-size: 12px; }
  .statusbar { display: block; margin-top: 16px; }
  .legend { margin-top: 12px; gap: 12px; font-size: 12px; }
  .board { grid-template-columns: repeat(6, minmax(280px, 82vw)); scroll-snap-type: x proximity; }
  .part { scroll-snap-align: start; }
  .floor { font-size: 14px; }
  .ledger li, .ledger time, .floor-state, .soft { font-size: 12px; }
  dialog { padding: 20px; }
}
