/* 澄池界面：取值来自 Cindy Light（makecindy/cindy 4f3c30d），只用语义色表达状态。 */
:root {
  color-scheme: light;
  --page: #f2f2ed; --side: #eeeee9; --card: #fdfdf8; --soft: #fafaf5; --on-card: #fcfcfd;
  --ink: rgba(0,0,0,.88); --ink-desc: rgba(0,0,0,.70); --ink-2: rgba(0,0,0,.56); --ink-3: rgba(0,0,0,.44); --ink-dis: rgba(0,0,0,.32);
  --line: rgba(0,0,0,.08); --line-soft: rgba(0,0,0,.05); --hover: rgba(0,0,0,.05); --hover-soft: rgba(0,0,0,.035); --sel: rgba(0,0,0,.08);
  --cta: #3c3f43; --cta-hover: #2e3237; --cta-pressed: #25282c; --cta-fg: #fcfcfc;
  --focus: rgba(65,124,221,.5); --switch-on: #417cdd; --switch-off: #808080;
  --run: #ea6b17; --run-fg: #a3470b; --ok: #18794e; --bad: #c42b1c; --brand: #df0c27;
  --instant: 80ms; --fast: 150ms; --base: 200ms; --enter: 250ms;
  --ease-out: cubic-bezier(.16,1,.3,1); --ease-move: cubic-bezier(.4,0,.2,1);
}
* { box-sizing: border-box }
body { margin: 0; background: var(--page); color: var(--ink); font: 14px/1.5 Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; -webkit-font-smoothing: antialiased }
button, input, select { font: inherit; color: inherit }
button, input, a, summary { touch-action: manipulation }
h1, h2, h3, p { margin: 0 }
h2 { font-size: 15px; font-weight: 600 }
h3 { font-size: 14px; font-weight: 600 }
a { color: var(--ink) }
[hidden] { display: none !important }
.small { font-size: 12px }
.muted { color: var(--ink-2) }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px }
input:focus-visible { outline: 0; border-color: rgba(65,124,221,.6); box-shadow: 0 0 0 3px rgba(65,124,221,.18) }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 20; background: var(--card); padding: 10px 14px; border-radius: 8px }
.skip-link:focus { top: 12px }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none }

/* 按钮：胶囊、80ms 按压、150ms 颜色反馈 */
button { min-height: 36px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; transition: background-color var(--fast), color var(--fast), border-color var(--fast), transform var(--instant) }
button:hover:not(:disabled) { background: #f0f0eb }
button:active:not(:disabled) { transform: scale(.98) }
button:disabled { cursor: not-allowed; opacity: .5 }
button.primary { background: var(--cta); border-color: var(--cta); color: var(--cta-fg); font-weight: 500 }
button.primary:hover:not(:disabled) { background: var(--cta-hover) }
button.primary:active:not(:disabled) { background: var(--cta-pressed) }
button.ghost { border-color: transparent; background: transparent; color: var(--ink-2) }
button.ghost:hover:not(:disabled) { background: var(--hover); color: var(--ink) }
button.danger { color: var(--bad) }
button.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 500 }
button.danger-solid:hover:not(:disabled) { background: #a92418 }
button.icon { width: 36px; padding: 0; border-color: transparent; background: transparent; color: var(--ink-2) }
button.icon:hover:not(:disabled) { background: var(--hover); color: var(--ink) }
input { min-height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); padding: 0 12px; min-width: 0; max-width: 100% }

/* 徽标与状态点 */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 20px; padding: 0 8px; border-radius: 999px; background: var(--hover); color: var(--ink-desc); white-space: nowrap; transition: background-color var(--fast), color var(--fast) }
.badge.ok { background: rgba(24,121,78,.10); color: var(--ok) }
.badge.run { background: rgba(234,107,23,.12); color: var(--run-fg) }
.badge.bad { background: rgba(196,43,28,.10); color: var(--bad) }
.badge.dim { color: var(--ink-2) }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-dis); flex: none }
.dot.ok { background: var(--ok) } .dot.bad { background: var(--bad) } .dot.run { background: var(--run) }
.dot.wait { background: transparent; border: 1px solid var(--ink-dis) }

/* 登录：居中卡片 */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px }
.login-card { width: min(400px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 28px; display: flex; flex-direction: column; gap: 12px }
.login-card h1 { font-size: 20px; font-weight: 600; margin-top: 12px }
.login-status { font-size: 13px; color: var(--ink-desc) }
#login-form { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 }
#login-form label { font-size: 13px; color: var(--ink-2) }
#login-form input, #login-form button { min-height: 44px }

/* 外壳：侧栏独立面 + 扁平页底 */
.shell { display: grid; grid-template-columns: 232px minmax(0,1fr); min-height: 100vh }
.side { background: var(--side); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--cta); color: var(--cta-fg); display: grid; place-items: center; font-weight: 600; flex: none }
.brand-text { display: flex; flex-direction: column; line-height: 1.25 }
.brand-text b { font-weight: 600 }
.brand-text small { font-size: 12px; color: var(--ink-2) }
.nav { display: flex; flex-direction: column; gap: 2px }
.nav button { justify-content: flex-start; gap: 10px; min-height: 36px; padding: 0 10px; border: 0; background: transparent; color: var(--ink) }
.nav button:hover:not(:disabled) { background: var(--hover) }
.nav button[aria-current=page] { background: var(--on-card); color: #292a2c; font-weight: 500 }
.nav-count { margin-left: auto; font-size: 12px; color: var(--ink-3); font-weight: 400 }
.side-bottom { margin-top: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere }
.private { display: flex; align-items: center; gap: 6px }
.private-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand) }
.main { min-width: 0; display: flex; flex-direction: column; outline: 0 }
.topbar { min-height: 46px; border-bottom: 1px solid var(--line); padding: 0 16px 0 24px; display: flex; align-items: center; gap: 12px }
.topbar h1 { font-size: 14px; font-weight: 600; outline-offset: 4px }
.topbar-desc { font-size: 12px; color: var(--ink-3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 4px; flex: none }
.topbar-right button { min-height: 32px; padding: 0 10px; font-size: 13px }
.sync { font-size: 12px; color: var(--ink-2); margin-right: 4px }
.sync.bad { color: var(--bad) }
.content { width: 100%; max-width: 1120px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; gap: 16px }
#view { display: flex; flex-direction: column; gap: 16px; min-width: 0 }
.notice { font-size: 13px; padding: 10px 12px; border-radius: 8px; background: var(--hover-soft); color: var(--ink-desc) }
.notice.danger { background: rgba(196,43,28,.06); border: 1px solid rgba(196,43,28,.2); color: var(--ink) }
.empty { color: var(--ink-2); font-size: 13px; padding: 24px; text-align: center }
.boundary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; font-size: 12px; color: var(--ink-2); padding: 4px 4px 0 }
.boundary b { font-weight: 500; color: var(--ink-desc) }
#server-notice:not(:empty)::before { content: ' ' }

/* 任务状态行 */
.run-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; min-height: 44px }
.run-state { display: flex; align-items: center; gap: 10px; flex: 1 1 320px; min-width: 0 }
.run-copy { display: flex; flex-direction: column; line-height: 1.35; min-width: 0 }
.run-copy b { font-size: 15px; font-weight: 600 }
.run-dot { position: relative; width: 10px; height: 10px; border-radius: 50%; background: var(--ink-dis); flex: none; transition: background-color var(--fast) }
.run-dot[data-tone=ok] { background: var(--ok) } .run-dot[data-tone=bad] { background: var(--bad) } .run-dot[data-tone=run] { background: var(--run) }
.run-dot[data-tone=run]::before { content: ''; position: absolute; inset: 0; border-radius: 50%; animation: breathe 1.6s ease-in-out infinite }

/* 卡片 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; min-width: 0 }
.card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px }
.card-head .aside { margin-left: auto; font-size: 12px; color: var(--ink-3) }
.note { font-size: 12px; color: var(--ink-2) }
.desc { font-size: 13px; color: var(--ink-desc) }

/* 四段漏斗 */
.summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden }
.metric { display: flex; flex-direction: column; align-items: flex-start; gap: 0; min-height: 0; padding: 14px 18px; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: transparent; text-align: left; white-space: normal }
.metric:last-child { border-right: 0 }
.metric:hover:not(:disabled) { background: var(--hover-soft) }
.metric-label { font-size: 12px; color: var(--ink-2) }
.metric-value { font-size: 26px; font-weight: 600; line-height: 1.4; font-variant-numeric: tabular-nums }
.metric-foot { font-size: 12px; color: var(--ink-3) }

/* 六阶段步进条 */
.flow { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px }
.stage { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-height: 88px; padding: 12px 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; white-space: normal }
.stage:hover:not(:disabled) { background: var(--hover-soft) }
.stage[aria-pressed=true], .stage[aria-pressed=true]:hover:not(:disabled) { background: var(--hover) }
.stage-top { display: flex; align-items: center; gap: 8px }
.stage-num { position: relative; width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(0,0,0,.16); display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--ink-3); flex: none; transition: background-color var(--fast), border-color var(--fast), color var(--fast) }
.stage-num::before { content: ''; position: absolute; inset: -2px; border-radius: 50% }
.stage[data-status=running] .stage-num { border: 2px solid var(--run); background: var(--card); color: var(--run-fg) }
.stage[data-status=running] .stage-num::before { animation: breathe 1.6s ease-in-out infinite }
.stage[data-status=success] .stage-num { border-color: var(--ok); background: var(--ok); color: var(--cta-fg) }
.stage[data-status=failed] .stage-num { border-color: var(--bad); background: var(--bad); color: #fff }
.stage[data-status=interrupted] .stage-num { border-color: var(--bad); color: var(--bad) }
.stage[data-status=skipped] .stage-num { border-style: dashed }
body.stale-state .stage[data-status=running] .stage-num { border-color: var(--ink-dis); color: var(--ink-3) }
.stage-line { flex: 1; height: 2px; border-radius: 1px; background: var(--line); overflow: hidden; position: relative }
.stage:last-child .stage-line { visibility: hidden }
.stage[data-status=success][data-next=success] .stage-line { background: rgba(24,121,78,.45) }
.stage[data-flow=true] .stage-line::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(234,107,23,0), var(--run), rgba(234,107,23,0)); background-size: 40% 100%; background-repeat: no-repeat; animation: flow 1.2s linear infinite }
.stage-title { font-size: 13px; font-weight: 500 }
.stage-value { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; overflow-wrap: anywhere }
.stage[data-status=running] .stage-value { color: var(--ink) }
.stage[data-status=failed] .stage-value { color: var(--bad) }

/* 详情 + 右栏 */
.workflow-layout { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start }
.stage-detail { flex: 999 1 460px; display: flex; flex-direction: column; gap: 14px }
.rail { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px }
.stage-detail .card-head { margin: 0 }
.progress-heading { display: flex; justify-content: space-between; gap: 12px; font-size: 13px }
.progress-heading strong { font-weight: 500; font-variant-numeric: tabular-nums }
progress { appearance: none; -webkit-appearance: none; width: 100%; height: 6px; border: 0; border-radius: 3px; background: var(--hover); overflow: hidden; display: block }
progress::-webkit-progress-bar { background: var(--hover); border-radius: 3px }
progress::-webkit-progress-value { background: var(--ink-desc); border-radius: 3px; transition: width var(--base) var(--ease-move) }
progress::-moz-progress-bar { background: var(--ink-desc); border-radius: 3px }
progress[data-tone=run]::-webkit-progress-value { background: var(--run) } progress[data-tone=run]::-moz-progress-bar { background: var(--run) }
progress[data-tone=ok]::-webkit-progress-value { background: var(--ok) } progress[data-tone=ok]::-moz-progress-bar { background: var(--ok) }
progress[data-tone=bad]::-webkit-progress-value { background: var(--bad) } progress[data-tone=bad]::-moz-progress-bar { background: var(--bad) }
progress:not([value])::-webkit-progress-bar { background: linear-gradient(90deg, var(--hover) 0%, rgba(234,107,23,.45) 50%, var(--hover) 100%); background-size: 200% 100%; animation: flow 1.4s linear infinite }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px }
.detail-grid > div { background: var(--soft); border-radius: 8px; padding: 10px 12px; min-width: 0 }
.detail-num { display: block; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums }
.reasons { display: flex; flex-direction: column; gap: 8px }
.reason { display: grid; grid-template-columns: minmax(0,1fr) minmax(48px,120px) 48px; align-items: center; gap: 12px; font-size: 13px }
.reason > span:first-child { overflow-wrap: anywhere }
.reason strong { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums }
.bar { display: block; height: 4px; border-radius: 2px; background: var(--hover); overflow: hidden }
.bar > span { display: block; height: 4px; width: var(--w, 0%); background: var(--ink-dis); transition: width var(--base) var(--ease-move) }
.sub-quick { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 }
.sub-row { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 4px 0 12px; border-radius: 8px; background: var(--soft) }
.sub-row > span { flex: 1; min-width: 0 }
.sub-row button { min-height: 30px; font-size: 12px; padding: 0 12px }
.linkish { min-height: 32px; padding: 0; border: 0; background: transparent; color: var(--ink-2); font-size: 12px; text-decoration: underline; text-underline-offset: 3px }
.linkish:hover:not(:disabled) { background: transparent; color: var(--ink) }
.run-list { display: flex; flex-direction: column }
.run-item { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 13px; border-top: 1px solid var(--line-soft) }
.run-item:first-child { border-top: 0 }
.run-item > span:nth-child(2) { flex: 1; min-width: 0 }
.run-item .muted { font-variant-numeric: tabular-nums }

/* 节点 */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center }
.search { flex: 1 1 260px; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 4px 0 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink-3) }
.search:focus-within { border-color: rgba(65,124,221,.6); box-shadow: 0 0 0 3px rgba(65,124,221,.18) }
.search input { flex: 1; border: 0; background: transparent; padding: 0; min-height: 34px; color: var(--ink) }
.search input:focus-visible { box-shadow: none }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
.segmented { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 999px; background: var(--hover) }
.segmented button { min-height: 30px; padding: 0 12px; border: 0; background: transparent; color: var(--ink-2); font-size: 13px }
.segmented button:hover:not(:disabled) { background: var(--hover-soft); color: var(--ink) }
.segmented button[aria-checked=true], .segmented button[aria-checked=true]:hover:not(:disabled) { background: var(--card); color: var(--ink); font-weight: 500 }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px }
.chips button { min-height: 30px; padding: 0 12px; border-color: transparent; background: transparent; color: var(--ink-2); font-size: 13px }
.chips button[aria-pressed=true] { border-color: rgba(0,0,0,.16); background: var(--card); color: var(--ink) }
.chips .aside { margin-left: auto; font-size: 12px; color: var(--ink-3) }
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto }
table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 13px }
th { text-align: left; font-weight: 500; color: var(--ink-2); padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap }
td { padding: 0 8px; height: 44px; border-bottom: 1px solid var(--line-soft); vertical-align: middle }
th:first-child, td:first-child { padding-left: 16px } th:last-child, td:last-child { padding-right: 16px }
tbody tr:last-child td { border-bottom: 0 }
tbody tr { transition: background-color var(--fast) }
tbody tr:hover { background: var(--hover-soft) }
tbody tr[aria-selected=true] { background: var(--hover) }
td.empty { height: auto }
.row-open { min-height: 32px; padding: 0; border: 0; background: transparent; font-weight: 500; text-align: left; white-space: normal; justify-content: flex-start }
.row-open:hover:not(:disabled) { background: transparent; text-decoration: underline; text-underline-offset: 3px }
.chip { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--hover); white-space: nowrap }
.latency { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; white-space: nowrap }
.latency .bar { width: 48px; flex: none }
.latency .bar > span { background: rgba(0,0,0,.4) }
.cell-muted { color: var(--ink-2) }
.cell-source { color: var(--ink-desc); max-width: 260px }
.drawer { position: fixed; top: 58px; right: 12px; max-height: calc(100vh - 70px); width: min(360px, calc(100vw - 24px)); z-index: 10; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.05); padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; animation: drawer-in var(--base) var(--ease-out) }
.drawer-head { display: flex; align-items: center; gap: 8px }
.drawer-head b { font-size: 15px; font-weight: 600; overflow-wrap: anywhere }
.drawer-head .icon { margin-left: auto }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px }
.kv > div { background: var(--soft); border-radius: 8px; padding: 10px 12px }
.kv strong { display: block; font-size: 16px; font-weight: 600 }
.drawer-sources { display: flex; flex-direction: column; gap: 2px }
.drawer-sources button { justify-content: flex-start; min-height: 32px; padding: 0 10px; border: 0; background: transparent; border-radius: 8px; text-align: left; white-space: normal }
.drawer-sources button:hover:not(:disabled) { background: var(--hover) }

/* 来源 */
.source-list { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden }
.source-group + .source-group { border-top: 1px solid var(--line) }
.source-group > summary { list-style: none; cursor: pointer; min-height: 56px; padding: 8px 16px; display: flex; align-items: center; gap: 12px; transition: background-color var(--fast) }
.source-group > summary::-webkit-details-marker { display: none }
.source-group > summary:hover { background: var(--hover-soft) }
.chev { color: var(--ink-3); transition: transform var(--base) var(--ease-move) }
.source-group[open] .chev { transform: rotate(90deg) }
.group-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35 }
.group-name strong { font-weight: 500 }
.group-stats { display: grid; grid-template-columns: repeat(2, 64px); gap: 8px; text-align: right; font-size: 13px; font-variant-numeric: tabular-nums }
.group-stats small { display: block; font-size: 11px; color: var(--ink-3) }
.files { padding: 0 16px 12px 42px; display: flex; flex-direction: column; gap: 4px }
.file { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 52px; padding: 4px 0 4px 12px; border-radius: 8px; background: var(--soft) }
.file-name { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; line-height: 1.35 }
.file-name strong { font-weight: 500; font-size: 13px }
.url-text { font-size: 11px; color: var(--ink-3); overflow-wrap: anywhere }
.file-status { font-size: 12px; color: var(--ink-2) }
.file-status.bad { color: var(--bad) }
.file-nums { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums }
.file-nums b { color: var(--ink); font-weight: 500 }
.file-nums button { min-height: 28px; padding: 0 8px; font-size: 12px; border-color: transparent; background: transparent; text-decoration: underline; text-underline-offset: 3px }
.toggle { width: 44px; min-height: 44px; padding: 0; border: 0; background: transparent }
.toggle:hover:not(:disabled) { background: transparent }
.toggle .track { width: 36px; height: 20px; border-radius: 999px; background: var(--switch-off); padding: 2px; display: flex; transition: background-color var(--instant) }
.toggle .thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform var(--fast) var(--ease-out) }
.toggle[aria-checked=true] .track { background: var(--switch-on) }
.toggle[aria-checked=true] .thumb { transform: translateX(16px) }

/* 订阅 */
.snapshot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px }
.snapshot-main { flex: 1 1 260px; display: flex; flex-direction: column; gap: 2px }
.snapshot-main b { font-size: 15px; font-weight: 600 }
.snapshot-side { display: flex; flex-direction: column; align-items: flex-end; font-size: 12px; color: var(--ink-2) }
.snapshot-side b { font-size: 18px; font-weight: 600; color: var(--ink) }
.divider { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-2) }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line) }
.sub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap: 16px }
.sub-card { display: flex; flex-direction: column; gap: 12px }
.sub-card .card-head { margin: 0 }
.code { flex: 1; min-width: 0; font: 12px/1.4 "SF Mono", ui-monospace, Menlo, monospace; color: var(--ink); overflow-wrap: anywhere }
.code.hidden-url { color: var(--ink-3); font-family: inherit }
.url-box { display: flex; align-items: center; gap: 4px; min-height: 40px; padding: 4px 4px 4px 12px; border-radius: 8px; background: var(--soft); border: 1px solid var(--line-soft) }
.sub-actions { display: flex; gap: 8px }
.sub-actions .primary { flex: 1 }
.key-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px }
.key-row > span { flex: 1 1 280px; display: flex; flex-direction: column }
.key-row b { font-weight: 500 }
dialog { border: 0; padding: 0; border-radius: 12px; background: var(--card); color: var(--ink); width: min(420px, calc(100vw - 32px)); box-shadow: 0 24px 64px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.08) }
dialog[open] { animation: dialog-in var(--enter) var(--ease-out) }
dialog::backdrop { background: rgba(0,0,0,.24) }
.dialog-card { padding: 20px 22px; display: flex; flex-direction: column; gap: 12px }
.dialog-card h2 { font-size: 16px }
.dialog-card p { font-size: 13px; color: var(--ink-desc) }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px }

/* 记录 */
.runs { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden }
.run-record + .run-record { border-top: 1px solid var(--line) }
.run-record > summary { list-style: none; cursor: pointer; min-height: 52px; padding: 8px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px }
.run-record > summary::-webkit-details-marker { display: none }
.run-record > summary:hover { background: var(--hover-soft) }
.run-record[open] .chev { transform: rotate(90deg) }
.run-title { flex: 1 1 200px; display: flex; flex-direction: column; line-height: 1.35 }
.run-title strong { font-weight: 500 }
.run-body { padding: 0 16px 14px 42px; display: flex; flex-direction: column; gap: 8px }
.history-stages { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 6px }
.history-stages > span { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 8px 10px; border-radius: 8px; background: var(--soft); color: var(--ink-desc) }

/* 动效：只表达真实状态 */
@keyframes breathe { 0%,100% { box-shadow: 0 0 0 0 rgba(234,107,23,.4) } 50% { box-shadow: 0 0 0 5px rgba(234,107,23,0) } }
@keyframes flow { from { background-position: -40% 0 } to { background-position: 140% 0 } }
@keyframes drawer-in { from { opacity: 0; transform: translateX(12px) } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98) } }
body.motion-paused .stage-line::after, body.motion-paused .run-dot::before, body.motion-paused .stage-num::before { animation: none }
body.background *, body.background *::before, body.background *::after { animation-play-state: paused !important }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important }
}

/* 窄屏：侧栏变底部标签栏，点击区域 ≥ 44px */
@media (max-width: 760px) {
  .shell { display: block; padding-bottom: 72px }
  .side { position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; top: auto; height: auto; padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); flex-direction: row; gap: 0 }
  .side .brand, .side-bottom { display: none }
  .nav { flex-direction: row; width: 100%; gap: 0 }
  .nav button { flex: 1 1 0; min-width: 0; min-height: 56px; flex-direction: column; justify-content: center; gap: 2px; padding: 0 2px; font-size: 11px; border-radius: 12px }
  .nav button svg { width: 20px; height: 20px }
  .nav button { color: var(--ink-2) }
  .nav button[aria-current=page] { background: transparent; color: var(--ink); font-weight: 600 }
  .nav-count { display: none }
  .topbar { padding: 0 8px 0 16px; min-height: 52px }
  .topbar-desc, .sync { display: none }
  .topbar-right button { min-height: 44px }
  .content { padding: 14px 16px }
  .run-tools > button { flex: 1 1 0; min-height: 44px }
  .summary { grid-template-columns: repeat(2, minmax(0,1fr)) }
  .metric:nth-child(2) { border-right: 0 }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line) }
  .metric-value { font-size: 20px }
  .flow { grid-template-columns: 1fr; padding: 4px 8px }
  .stage { flex-direction: row; align-items: center; min-height: 44px; padding: 8px 6px; gap: 12px }
  .stage-line { display: none }
  .stage-top { flex: none }
  .stage-title { flex: 1 }
  .detail-grid { grid-template-columns: repeat(3, minmax(0,1fr)) }
  .chips .aside { width: 100%; margin: 0 }
  .files { padding: 0 8px 12px }
  .group-stats { grid-template-columns: repeat(2, 48px) }
  .drawer { top: auto; left: 8px; right: 8px; bottom: 76px; width: auto; max-height: 70vh }
  button, .chips button, .segmented button, .sub-row button { min-height: 44px }
  .boundary { flex-direction: column }
}
