/* 主题颜色只在此定义；默认暗色，日间模式保持相同布局与状态语义。 */
:root {
  color-scheme: dark;
  --canvas: #101319;
  --panel: #151a22;
  --fill: #1d2430;
  --ink: #e9edf5;
  --muted: #a3b0c3;
  --line: #2b3544;
  --line-strong: #536279;
  --primary: #8eb5ff;
  --primary-hover: #b4cdff;
  --primary-soft: #213657;
  --button-primary: #2563eb;
  --button-primary-hover: #1d4ed8;
  --ok: #70d5ab;
  --ok-soft: #16372c;
  --bad: #ff9ba5;
  --bad-soft: #3b232b;
  --warn: #f1c575;
  --warn-soft: #382e1c;
  --focus: #8eb5ff;
  --chart-line: #82abff;
  --chart-fill: #82abff;
  --bar-ok: #57bc96;
  --bar-bad: #ec7e88;
  --bar-unk: #dca94f;
  --tooltip: #e9edf5;
  --tooltip-ink: #172033;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 8px;
  --radius-sm: 6px;
  --control: 36px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --gutter: 40px;
  --chart-height: 210px;
  --z-sticky: 10;
  --z-bar: 20;
  --z-drawer: 40;
  --z-skip: 50;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
:root[data-theme="light"] {
  color-scheme: light;
  --canvas: #ffffff;
  --panel: #ffffff;
  --fill: #f3f6fa;
  --ink: #202b3c;
  --muted: #57667c;
  --line: #dfe5ee;
  --line-strong: #97a5b8;
  --primary: #245cda;
  --primary-hover: #1747b8;
  --primary-soft: #eaf1ff;
  --ok: #14714b;
  --ok-soft: #edf8f1;
  --bad: #b63244;
  --bad-soft: #fff0f2;
  --warn: #875608;
  --warn-soft: #fff7e8;
  --focus: #2460db;
  --chart-line: #2563eb;
  --chart-fill: #2563eb;
  --bar-ok: #329d79;
  --bar-bad: #d75f6b;
  --bar-unk: #b88724;
  --tooltip: #202b3c;
  --tooltip-ink: #ffffff;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
html { background: var(--canvas); }
body { font: 14px/1.5 var(--font); color: var(--ink); background: var(--canvas); font-kerning: normal; }
body.app, body.login-page { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
.hidden, [hidden] { display: none !important; }
a { color: var(--primary); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: var(--control); padding: 0 12px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--panel); cursor: pointer;
  color: var(--ink); text-decoration: none; white-space: nowrap; flex-shrink: 0;
}
button:hover, .button:hover { background: var(--fill); }
button.primary, .button.primary { background: var(--button-primary); border-color: var(--button-primary); color: #fff; }
button.primary:hover, .button.primary:hover { background: var(--button-primary-hover); border-color: var(--button-primary-hover); }
button:disabled { opacity: .48; cursor: not-allowed; }
button, a, input, select, textarea { transition: border-color 160ms var(--ease); }
:where(button, a, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
input, select, textarea { min-height: var(--control); min-width: 0; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--panel); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { resize: none; }
label { font-size: 13px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; line-height: 1.3; font-weight: 650; letter-spacing: -.025em; }
h2 { font-size: 17px; line-height: 1.4; font-weight: 650; }
h3 { font-size: 14px; font-weight: 600; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
.hint, .muted, .fineprint { color: var(--muted); }
.hint { font-size: 12px; }
.fineprint { font-size: 12px; }
code, pre { font-family: var(--mono); }
code { font-size: 12px; overflow-wrap: anywhere; }
pre { font-size: 12px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto; max-height: 280px; padding: 14px; background: var(--fill); border-radius: var(--radius-sm); margin: 8px 0; }
summary { cursor: pointer; }
.skip { position: fixed; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: var(--z-skip); padding: 12px; background: var(--panel); border-radius: 6px; }
/* 应用外框锁定视口；每层可伸缩区域都允许收缩，滚动留在内容容器。 */
.topbar { flex: none; min-height: 62px; display: flex; align-items: center; gap: 38px; padding: 0 var(--gutter); border-bottom: 1px solid var(--line); background: var(--panel); z-index: var(--z-bar); }
.brand-lockup { display: flex; align-items: center; gap: 11px; flex: none; text-decoration: none; color: var(--ink); }
.brand { font-size: 19px; font-weight: 650; white-space: nowrap; letter-spacing: -.02em; }
.brand-mark { color: var(--primary); width: 30px; height: 30px; flex: none; }
.nav-icon { width: 18px; height: 18px; flex: none; }
.topbar nav { display: flex; align-self: stretch; align-items: stretch; gap: 26px; }
.topbar nav a { position: relative; display: inline-flex; align-items: center; padding: 0 7px; color: var(--muted); font-weight: 550; text-decoration: none; white-space: nowrap; }
.topbar nav a:hover { color: var(--ink); }
.topbar nav a[aria-current="page"] { color: var(--primary); }
.topbar nav a[aria-current="page"]::after { content: ''; position: absolute; height: 2px; bottom: 0; left: 0; right: 0; background: var(--primary); }
.topbar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; min-width: 0; }
.topbar-actions > .hint { white-space: nowrap; }
.topbar-actions button { font-size: 12px; min-height: 32px; padding: 0 9px; border-color: transparent; background: transparent; }
.topbar-actions button:hover { background: var(--fill); }
.shell { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.head { flex: none; min-height: 86px; padding: 18px var(--gutter) 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.head > div:first-child { min-width: 0; }
.head .hint { margin-top: 4px; }
.head-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.refresh-meta { font-size: 12px; color: var(--muted); }
.head-actions button { min-height: 34px; font-size: 12px; }
.workspace { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; padding: 0 var(--gutter) 20px; overflow: hidden; }
#notice:empty, #history-notice:empty { display: none; }
#notice, #history-notice { flex: none; max-height: 24vh; overflow: auto; }
.notice { padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--fill); font-size: 13px; overflow-wrap: anywhere; }
.notice.warning { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 38%, var(--warn-soft)); }
.notice.error { color: var(--bad); background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 38%, var(--bad-soft)); }
.notice a { font-weight: 600; }
.notice summary { font-weight: 550; }
.notice details, .notice p { margin-top: 5px; }
.pills { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.pill, .status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; line-height: 1.5; font-weight: 550; color: var(--muted); }
.pill::before, .status::before { content: ''; width: 7px; height: 7px; background: currentColor; border-radius: 50%; flex: none; }
.pill.on, .status.ok { color: var(--ok); }
.pill.bad, .status.bad { color: var(--bad); }
.pill.warn, .status.warn { color: var(--warn); }
.status.info { color: var(--primary); }
.tabs { display: flex; gap: 20px; flex: none; border-bottom: 1px solid var(--line); overflow-x: auto; min-width: 0; }
.tabs button { min-height: 42px; border: 0; border-radius: 0; padding: 0 6px; background: transparent; color: var(--muted); position: relative; }
.tabs button[aria-selected="true"], .tabs button[aria-pressed="true"], .tabs button.is-on { color: var(--primary); box-shadow: inset 0 -2px var(--primary); font-weight: 600; }
.seg { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); flex: none; }
.seg button { min-height: 30px; padding: 0 12px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 12px; }
.seg button.is-on, .seg button[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.panel-h { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.panel-h .hint, .panel-h a { font-size: 12px; }
.panel-b { flex: 1; min-height: 0; min-width: 0; }
.empty { min-height: 120px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; padding: 24px; text-align: center; color: var(--muted); }
.empty strong { color: var(--ink); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 28px; margin: 0; }
.facts > div { min-width: 0; }
.facts dt { color: var(--muted); font-size: 12px; }
.facts dd { margin: 4px 0 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
/* 首页使用横向实时带，图表与分类在可分配高度中各自滚动。 */
.overview-workspace { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; overflow: auto; overscroll-behavior: contain; }
.runtime-strip { background: var(--fill); border-radius: var(--radius); padding: 14px 18px; flex: none; }
.overview-status { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 24px; }
.overview-meta { font-size: 12px; color: var(--muted); }
.budget { margin-left: auto; color: var(--muted); font-size: 12px; }
.runtime-capacity, .capacity-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line); }
.meter { min-width: 0; }
.meter-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12px; }
.meter-row > :last-child { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar { height: 3px; background: var(--line); margin-top: 7px; overflow: hidden; border-radius: 3px; }
.bar i { display: block; height: 100%; background: var(--primary); }
.bar-ready i { background: var(--bar-ok); }
.stats-panel { flex: 0 0 auto; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 4px 0 12px; }
.metrics > div { border-left: 1px solid var(--line); padding: 0 20px; min-width: 0; }
.metrics > div:first-child { border-left: 0; padding-left: 0; }
.metrics dt { font-size: 12px; color: var(--muted); }
.metrics dd { margin: 2px 0 0; font-size: 24px; line-height: 1.3; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.metrics dd.sub { font-size: 11px; color: var(--muted); margin-top: 4px; font-weight: 400; letter-spacing: normal; }
.metrics dd a { text-decoration: none; }
.charts-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; }
.chart-section { min-width: 0; }
.chart-section + .chart-section { border-left: 1px solid var(--line); padding-left: 24px; }
.chart-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 4px; flex-wrap: wrap; }
.chart-heading h3 { font-size: 13px; }
.chart-heading .hint, .chart-section > .hint { font-size: 11px; }
.chart-frame { min-width: 0; }
.chart { width: 100%; height: var(--chart-height); display: block; }
.chart-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.chart-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-line { fill: none; stroke: var(--chart-line); stroke-width: 2.3; stroke-linejoin: round; stroke-linecap: round; }
.chart-fill { fill: var(--chart-fill); fill-opacity: .06; }
.bar-ok { fill: var(--bar-ok); }.bar-bad { fill: var(--bar-bad); }.bar-unk { fill: var(--bar-unk); }
.chart-point { outline: none; }
.chart-hit { fill: transparent; cursor: crosshair; }
.chart-guide { stroke: var(--primary); stroke-width: 1; stroke-dasharray: 3 4; }
.chart-dot { fill: var(--primary); stroke: var(--panel); stroke-width: 2; }
.chart-tooltip, .chart-guide, .chart-dot { opacity: 0; pointer-events: none; }
.chart-point:hover .chart-tooltip, .chart-point:focus .chart-tooltip, .chart-point:hover .chart-guide, .chart-point:focus .chart-guide, .chart-point:hover .chart-dot, .chart-point:focus .chart-dot { opacity: 1; }
.chart-tooltip rect { fill: var(--tooltip); }
.chart-tooltip text { fill: var(--tooltip-ink); font-size: 11px; }
.chart-empty { min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 20px; color: var(--muted); background: var(--fill); border-radius: 6px; font-size: 13px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; color: var(--muted); }
.legend i { display: inline-block; height: 7px; width: 7px; margin-right: 5px; border-radius: 2px; }
.legend .k { background: var(--bar-ok); }.legend .b { background: var(--bar-bad); }.legend .u { background: var(--bar-unk); }
.error-panel { flex: 1 1 160px; min-height: 130px; }
.error-panel .table-wrap { flex: 1; min-height: 0; border: 1px solid var(--line); border-radius: 6px; }
.error-panel .hint { font-size: 11px; }
.error-panel th, .error-panel td { padding: 8px 14px; }
/* 表格以容器为滚动边界，表头始终留在视区顶部。 */
.table-wrap { overflow: auto; overscroll-behavior: contain; min-width: 0; min-height: 0; }
table { width: 100%; border-collapse: separate; border-spacing: 0; white-space: nowrap; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); }
th { position: sticky; top: 0; z-index: var(--z-sticky); background: var(--fill); font-size: 12px; color: var(--muted); font-weight: 550; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--fill); }
td.wrap { min-width: 150px; max-width: 330px; white-space: normal; overflow-wrap: anywhere; }
.duration.warn { color: var(--warn); }
.duration.bad { color: var(--bad); }
.tasks-workspace { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.master { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.filters { flex: none; display: flex; align-items: end; flex-wrap: wrap; gap: 10px 12px; padding: 12px 14px; background: var(--fill); border-radius: 8px; max-height: 42vh; overflow: auto; }
.filters label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 12px; min-width: 0; }
.filters input, .filters select { width: 100%; }
.filters label:has(input[name="task_id"]) { flex: 1 1 220px; }
.filter-actions { display: flex; gap: 8px; align-items: center; }
.filter-more, .advanced-filters, #advanced-filters { width: 100%; }
.filter-more summary { font-size: 12px; }
.filter-more-fields, .advanced-fields { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 12px; }
.filter-summary, .list-meta { display: flex; align-items: center; gap: 8px; justify-content: space-between; flex: none; font-size: 12px; color: var(--muted); }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chips button { min-height: 26px; font-size: 11px; background: var(--primary-soft); color: var(--primary); border-color: transparent; }
/* 列表与详情共用一个相对定位区域：宽屏详情覆盖在列表右侧，窄屏改为整页切换。 */
.list-area { position: relative; flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.table-fill { flex: 1; min-height: 0; min-width: 0; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 6px; }
.table-fill .table-wrap { overflow: visible; }
.table-fill .empty { min-height: 100%; }
.task-row { cursor: pointer; }
.task-row.is-selected { background: var(--primary-soft); }
button.task-link { min-height: 28px; padding: 0; border: 0; background: none; color: var(--primary); font: 12px var(--mono); }
.task-id { display: inline-flex; align-items: center; gap: 2px; }
button.copy-button { min-height: 26px; padding: 0 6px; border-color: transparent; background: transparent; color: var(--muted); }
button.copy-button svg { width: 13px; height: 13px; }
button.copy-button:hover { background: var(--fill); color: var(--ink); }
button.copy-button.is-copied, button.detail-task-id.is-copied { color: var(--ok); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.pager { flex: none; display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.pager .hint { margin-right: auto; }
.pager button { min-height: 32px; font-size: 12px; }
.detail { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 12px; overflow: auto; overscroll-behavior: contain; outline: none; }
.detail-head { display: flex; align-items: center; gap: 14px; flex: none; }
.detail-head h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.detail-head button:last-child:not(:first-child) { margin-left: auto; }
.detail-back { border-color: transparent; padding-left: 0; color: var(--primary); font-size: 12px; }
.task-summary { flex: none; background: var(--fill); border-radius: 8px; padding: 14px 18px; }
.task-summary .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.task-summary .facts dd { font-size: 20px; font-weight: 550; }
.task-meta { flex: none; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px 24px; }
.chunk-selector { flex: none; display: flex; gap: 8px; overflow: auto; padding-bottom: 4px; }
.chunk-selector button { flex: 1 0 120px; display: flex; flex-direction: column; align-items: start; gap: 5px; min-height: 66px; padding: 10px 14px; font-size: 12px; border-color: var(--line); }
.chunk-selector button[aria-pressed="true"], .chunk-selector button.is-selected { background: var(--primary-soft); border-color: var(--primary); }
.chunk-summary { flex: none; border-radius: 6px; background: var(--fill); padding: 8px 14px; font-size: 12px; }
.detail-content { flex: 1 1 160px; min-height: 100px; min-width: 0; overflow: auto; overscroll-behavior: contain; }
.detail-content > .table-wrap { overflow: visible; }
.detail-content > .notice { margin-bottom: 10px; }
.detail-content .facts { padding: 14px 0; }
.detail-body { min-height: 0; overflow: auto; }
.detail-empty { min-height: 160px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; color: var(--muted); }
/* 宽屏：详情是从右侧覆盖列表的抽屉，列表不重排、滚动位置与筛选都保留。
   抽屉整体只有一个滚动条、表头吸顶，避免摘要与记录各自出现滚动条。 */
@media (min-width: 901px) {
  .detail:not([hidden]) {
    position: absolute; inset: 0 0 0 auto; width: min(680px, 60%);
    z-index: var(--z-drawer); gap: 0; padding: 0; background: var(--panel);
    border-left: 1px solid var(--line); border-radius: var(--radius) 0 0 var(--radius);
    box-shadow: -22px 0 48px rgb(0 0 0 / .28);
    animation: drawer-in 180ms var(--ease);
  }
  .detail:not([hidden]) > * { margin: 0; padding: 12px 18px; }
  .detail:not([hidden]) > :last-child { padding-bottom: 18px; }
  .detail:not([hidden]) .detail-head { position: sticky; top: 0; z-index: 1; padding: 16px 18px 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
  .detail:not([hidden]) .task-summary, .detail:not([hidden]) .detail-content { max-height: none; flex: none; min-height: 0; overflow: visible; }
  /* 摘要固定六列在抽屉里每列不足 110px，长日期会折行；抽屉内改为三列。 */
  .detail:not([hidden]) .task-summary-metrics .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  @keyframes drawer-in { from { transform: translateX(14px); opacity: .55; } to { transform: none; opacity: 1; } }
}
/* 窄屏：没有并排空间，退回整页切换，详情占满任务工作区。 */
@media (max-width: 900px) {
  .master.detail-open #filters, .master.detail-open #task-list, .master.detail-open .pager { display: none; }
  .master.detail-open .list-area { position: static; }
  .master.detail-open .detail { position: static; flex: 1; width: auto; padding: 0; background: transparent; border: 0; box-shadow: none; }
}
.timeline { list-style: none; margin: 10px 0 0 4px; padding: 0 0 0 14px; border-left: 1px solid var(--line); }
.timeline li { position: relative; padding: 0 0 18px 12px; }
.timeline li::before { content: ''; position: absolute; left: -18px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.timeline time { font-size: 12px; color: var(--muted); }
.timeline .hint { margin-top: 4px; }
.event-data { margin-top: 6px; }
.event-data summary { color: var(--muted); font-size: 12px; }
.resource-workspace { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.resource-toolbar { flex: none; }
.resource-toolbar .pills { padding-top: 14px; }
.resource-content { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 12px; overflow: auto; overscroll-behavior: contain; }
.resource-content > .table-wrap { flex: 1; border: 1px solid var(--line); border-radius: 6px; }
.instance-detail > td { background: var(--fill); white-space: normal; padding: 20px; }
.instance-detail .facts { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.resource-explainer { flex: none; }
.resource-explainer .facts { padding: 10px 0; }
.resource-content > .facts { padding: 18px; background: var(--fill); border-radius: 6px; }
button.instance-toggle { border: 0; background: transparent; padding: 0; color: var(--primary); font-family: var(--mono); }
/* 登录页与工作台共享主题，表单只在内容区内部滚动。 */
.login { flex: 1; min-height: 0; display: flex; justify-content: center; align-items: center; overflow: auto; padding: 28px; }
.login-form { width: min(380px, 100%); flex-shrink: 0; }
.login-symbol { display: flex; width: 46px; height: 46px; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary); border-radius: 10px; margin-bottom: 24px; }
.login-symbol svg { width: 24px; height: 24px; }
.login-form h1 { margin-bottom: 10px; }
.login-form > .hint { font-size: 14px; }
.login-form form { margin-top: 30px; }
.login-form label { display: block; margin-bottom: 7px; }
.login-form input { width: 100%; min-height: 42px; }
.login-form form button { width: 100%; min-height: 42px; margin-top: 20px; }
.login-form #error { min-height: 22px; margin: 10px 0; color: var(--bad); font-size: 13px; }
.login-form .fineprint { margin-top: 6px; }
@media (min-width: 1700px) { :root { --gutter: 64px; } .head { min-height: 96px; } :root { --chart-height: 230px; } }
@media (max-height: 800px) and (min-width: 901px) {
  .head { min-height: 70px; padding-top: 12px; padding-bottom: 10px; }
  .topbar { min-height: 54px; }
  .workspace { gap: 8px; padding-bottom: 12px; }
  .overview-workspace { gap: 8px; }
  .runtime-strip { padding: 10px 16px; }
  .runtime-capacity, .capacity-grid { margin-top: 8px; padding-top: 8px; }
  .panel-h { padding: 6px 0; }
  :root { --chart-height: 160px; }
  .chart-empty { min-height: 130px; }
  .metrics { margin-bottom: 8px; }
  .metrics dd { font-size: 21px; }
}
@media (max-width: 1100px) {
  :root { --gutter: 24px; }
  .topbar { gap: 24px; }
  .topbar nav { gap: 16px; }
  .topbar-actions { gap: 5px; }
  .topbar-actions > .hint { display: none; }
  .refresh-meta { max-width: 170px; }
  .overview-status { gap: 8px 16px; }
  .charts-grid { gap: 16px; }.chart-section + .chart-section { padding-left: 16px; }
}
@media (max-width: 900px) {
  :root { --gutter: 20px; }
  .topbar { min-height: 58px; gap: 20px; }
  .brand { font-size: 16px; }.brand-mark { width: 24px; height: 24px; }
  .topbar nav { gap: 10px; }
  .head { min-height: 82px; }
  .head .hint { max-width: 52ch; }
  .head-actions { gap: 8px; }.head-actions .refresh-meta { display: none; }
  .metrics > div { padding: 0 12px; }
  .charts-grid { grid-template-columns: minmax(0, 1fr); }
  .chart-section + .chart-section { border: 0; padding: 10px 0 0; }
  :root { --chart-height: 200px; }
  .overview-workspace { overflow: auto; }
  .error-panel { flex: none; max-height: 280px; }
  .error-panel .table-wrap { min-height: 110px; }
  .runtime-capacity, .capacity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
  .filters { gap: 8px; }
  .task-summary .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  :root { --gutter: 16px; --control: 38px; }
  .topbar { min-height: 94px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: 48px 42px; gap: 0 8px; padding-bottom: 0; }
  .topbar .brand-lockup { grid-column: 1; grid-row: 1; }
  .topbar .topbar-actions { grid-column: 2; grid-row: 1; }
  .topbar nav { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; gap: 8px; }
  .topbar nav a { justify-content: center; flex: 1; padding: 0 10px; font-size: 14px; }
  .topbar-actions button { min-height: 36px; padding: 0 7px; }
  .topbar-actions button[data-theme-toggle] span { display: none; }
  .topbar-actions .nav-icon { height: 17px; width: 17px; }
  .head { align-items: start; min-height: 80px; padding-top: 14px; padding-bottom: 12px; }
  h1 { font-size: 21px; }h2 { font-size: 16px; }
  .head .hint { font-size: 11px; }
  .workspace { padding-bottom: max(12px, env(safe-area-inset-bottom)); gap: 8px; }
  .notice { padding: 9px 11px; font-size: 12px; }
  .runtime-strip { padding: 12px; }
  .overview-status { gap: 8px 14px; }
  .budget { margin-left: 0; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .metrics > div { padding: 0 10px; }.metrics > div:nth-child(3) { border: 0; padding-left: 0; }
  .metrics dd { font-size: 23px; }
  .panel-h { flex-wrap: wrap; }
  .panel-h .seg { margin-left: auto; }.seg button { padding: 0 9px; }
  .filters { padding: 10px; max-height: 36vh; }
  .filters label { flex: 1 1 120px; }
  .filters label:has(input[name="task_id"]) { flex-basis: 100%; }
  .filter-actions { flex-wrap: wrap; }
  .filter-summary { align-items: start; }
  .pager { flex-wrap: wrap; }.pager .hint { font-size: 11px; }
  .detail { gap: 10px; }.detail-head { gap: 8px; flex-wrap: wrap; }
  .detail-head h2 { font-size: 17px; }.detail-head button { font-size: 11px; }
  .task-summary { padding: 12px; }.task-summary .facts dd { font-size: 18px; }
  .tabs { gap: 16px; }.tabs button { font-size: 13px; }
  .detail-content { min-height: 160px; }
  th, td { padding: 12px; }
  .resource-workspace { gap: 10px; }
  .login-page .topbar { display: flex; min-height: 58px; }.login-page .topbar-actions > .hint { display: none; }
  .login { align-items: start; padding: 40px 24px 24px; }
}
@media (max-height: 550px) {
  .head { min-height: 60px; }.head .hint { display: none; }
  .overview-workspace, .detail, .resource-content { overflow: auto; }
  .error-panel { flex: none; height: 180px; }
  .login { align-items: start; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
/* 新工作区的内容结构；长表始终由实际保存滚动位置的容器承载。 */
.readonly-label { color: var(--muted); font-size: 12px; white-space: nowrap; }
.capacity-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line); }
.stats-foot { margin-top: 8px; }
.filter-main { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; width: 100%; }
.filter-main > label { flex: 0 1 170px; }
.filter-main > .task-search { flex: 1 1 190px; }
.filter-main .filter-actions { margin-left: auto; }
.filter-extra { width: 100%; display: flex; flex-wrap: wrap; gap: 12px; }
.filter-extra > label { flex: 1 1 170px; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.active-filters:empty { display: none; }
.filter-chip { font-size: 11px; min-height: 26px; border-color: transparent; background: var(--primary-soft); color: var(--primary); max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: left; }
.table-fill { overflow: hidden; }
.table-fill > .table-wrap { height: 100%; overflow: auto; }
.pager #page-hint { order: -1; margin-right: auto; }
.cell-meta { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.text-button { border: 0; min-height: 30px; background: transparent; color: var(--primary); padding: 0 7px; font-size: 12px; }
.resource-raw { margin-top: 12px; }
.resource-raw summary { color: var(--muted); font-size: 12px; }
.machine-details { padding: 20px; overflow: auto; background: var(--fill); border-radius: 6px; }
.machine-details .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.resource-foot { flex: none; }
.task-summary { max-height: 24vh; overflow: auto; }
.task-summary-metrics .facts { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px 20px; }
.task-summary-metrics .facts dd { font-size: 15px; }
.task-metadata { margin-top: 12px; font-size: 12px; }
.task-metadata .facts { margin-top: 12px; }
.task-metadata .facts dd { font-size: 13px; font-weight: 400; }
.task-final-error { margin-top: 10px; font-size: 12px; color: var(--bad); overflow-wrap: anywhere; }
button.detail-task-id { min-height: 28px; margin-left: auto; padding: 0 7px; border-color: transparent; background: transparent; color: var(--muted); font-family: var(--mono); font-size: 12px; }
button.detail-task-id:hover { background: var(--fill); color: var(--ink); }
button.detail-task-id.is-copied { color: var(--ok); }
.chunk-facts { padding: 0 14px; background: var(--fill); margin-bottom: 10px; border-radius: 6px; }
.raw-data { max-height: none; margin: 0; }
.history-warning summary .hint { color: inherit; margin-left: 10px; font-weight: 400; }
@media (max-width: 1100px) { .readonly-label { display: none; } .filter-main > label { flex-basis: 145px; } }
@media (max-width: 900px) {
  .capacity-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
  .task-summary-metrics .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .machine-details .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .filter-main > label { flex: 1 1 120px; }
  .filter-main > .task-search { flex: 1 1 100%; }
  .filter-main .filter-actions { flex-basis: 100%; }
  .filter-main .filter-actions button { flex: 1; font-size: 12px; }
  .detail-task-id { flex-basis: 100%; margin-left: 0; }
  .task-summary-metrics .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .machine-details .facts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-height: 800px) and (min-width: 901px) { .capacity-strip { padding-top: 8px; margin-top: 8px; } }

/* 生成反馈沿用与后台相同的文字状态色，不依赖默认浏览器色。 */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.badge.ok { color: var(--ok); }.badge.bad { color: var(--bad); }.badge.warn { color: var(--warn); }
