:root {
  --deep: #0E3461; --main: #1A4F8B; --ink: #1F2A37; --grey: #5B6B7D; --line: #D5E0EC;
  --pale: #F5F8FC; --gold: #B8862B; --lane-w: 108px;
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: #fff; color: var(--ink); }
button { font: inherit; cursor: pointer; }

.top { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; justify-content: space-between;
  padding: 18px 24px 10px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #F3F7FC, #fff); }
.top h1 { margin: 0; font-size: 24px; color: var(--deep); letter-spacing: .5px; }
.top .sub { margin: 6px 0 0; font-size: 14px; color: var(--grey); }
.tools { display: flex; flex-wrap: wrap; gap: 10px; }
.grp { display: flex; gap: 6px; flex-wrap: wrap; }
.grp button { border: 1px solid var(--line); background: #fff; color: var(--deep); border-radius: 8px; padding: 6px 12px; font-size: 14px; }
.grp button:hover { border-color: var(--main); }
.grp button.on { background: var(--deep); color: #fff; border-color: var(--deep); }

.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 24px; border-bottom: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 11px 4px 8px; background: #fff; font-size: 13px; color: var(--ink); user-select: none; }
.chip i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.chip.on { color: #fff; }
.chip.off { opacity: .45; }
.only { font-size: 13px; color: var(--grey); display: inline-flex; gap: 4px; align-items: center; }
.link { border: 0; background: none; color: var(--main); font-size: 13px; padding: 0; }

.stage { position: relative; display: flex; border-bottom: 1px solid var(--line); }
.lanes { position: relative; flex: 0 0 var(--lane-w); border-right: 1px solid var(--line); background: #fff; z-index: 2; }
.lane-name { position: absolute; left: 0; right: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 16px; border-top: 1px solid var(--line); }
.lane-name b { width: 4px; height: 28px; border-radius: 2px; margin-right: 8px; }
.scroller { flex: 1; overflow-x: auto; overflow-y: hidden; cursor: grab; }
.scroller.grabbing { cursor: grabbing; }
.scroller svg { display: block; user-select: none; }
svg text { font-family: inherit; }
.node { cursor: pointer; }
.node.dragging { cursor: ns-resize; }

.panel { position: fixed; right: 20px; bottom: 20px; width: min(380px, calc(100vw - 40px)); background: rgba(255,255,255,.97);
  border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px 14px; box-shadow: 0 10px 30px rgba(14,52,97,.16); z-index: 10; }
.panel .close { position: absolute; right: 10px; top: 8px; border: 0; background: none; font-size: 22px; color: var(--grey); }
.panel .meta { font-size: 13px; color: var(--grey); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.panel .meta i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.panel h2 { margin: 6px 0 4px; font-size: 19px; color: var(--deep); }
.panel p { margin: 4px 0; font-size: 14px; line-height: 1.6; }
.panel .src a { color: var(--main); }
.badge { margin-left: 10px; font-size: 12px; color: var(--gold); border: 1px solid var(--gold); border-radius: 4px; padding: 0 5px; }
.panel .same { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--grey); line-height: 1.7; }
.panel .same b { color: var(--ink); font-weight: 600; }

.tip { position: fixed; pointer-events: none; z-index: 20; max-width: 300px; background: var(--deep); color: #fff;
  font-size: 13px; line-height: 1.55; padding: 7px 10px; border-radius: 8px; }

.foot { padding: 12px 24px 28px; font-size: 13px; color: var(--grey); }
.foot .hint { margin: 0 0 8px; }
.foot ul { margin: 0; padding-left: 18px; line-height: 1.7; }
.foot .upd { margin: 8px 0 0; }

@media (max-width: 720px) {
  :root { --lane-w: 72px; }
  .top { padding: 14px 14px 8px; }
  .top h1 { font-size: 19px; }
  .legend, .foot { padding-left: 14px; padding-right: 14px; }
  .lane-name { font-size: 14px; }
  .lane-name b { display: none; }
}
