/* tsync 控制台 — 晨雾：浅紫白底 + 柔光玻璃 + 大圆角数据卡片 */

:root {
  color-scheme: light;

  --bg: #f7f6fc;
  --glow-1: rgba(91, 75, 196, .12);
  --glow-2: rgba(47, 143, 157, .08);
  --glow-3: rgba(255, 255, 255, .40);

  --glass: rgba(255, 255, 255, .62);
  --glass-strong: rgba(255, 255, 255, .82);
  --glass-inset: rgba(243, 240, 252, .72);
  --glass-border: rgba(116, 100, 180, .14);
  --glass-border-strong: rgba(116, 100, 180, .24);
  --glass-sheen: inset 0 1px 0 rgba(255, 255, 255, .90);
  --glass-shadow: 0 24px 60px rgba(78, 64, 150, .10), 0 2px 8px rgba(78, 64, 150, .05);

  --surface: #ffffff;
  --surface-2: #f6f3ff;
  --surface-3: #efebfa;
  --line: #e8e3f4;
  --line-strong: #d4cce9;

  --text: #211f35;
  --text-2: #47435f;
  --muted: #68637e;

  --accent: #5b4bc4;
  --accent-bright: #7464d8;
  --accent-2: #2f8f9d;
  --accent-ink: #ffffff;
  --ok: #2b7358;
  --run: #356f9e;
  --warn: #8a5f0a;
  --danger: #a8394f;

  --ok-bg: rgba(43, 115, 88, .10);
  --run-bg: rgba(53, 111, 158, .10);
  --warn-bg: rgba(138, 95, 10, .11);
  --danger-bg: rgba(168, 57, 79, .10);
  --blocked-bg: rgba(104, 99, 126, .08);

  --row-hover: rgba(91, 75, 196, .045);
  --hover-tint: rgba(91, 75, 196, .055);
  --th-bg: rgba(91, 75, 196, .045);
  --btn-face: linear-gradient(180deg, #fff, rgba(255, 255, 255, .62));
  --btn-face-hover: linear-gradient(180deg, #fff, rgba(247, 244, 255, .86));
  --btn-hover-shadow: 0 8px 20px rgba(78, 64, 150, .12);
  --code-bg: #241f3a;
  --code-fg: #ece7fb;

  --font: "Segoe UI Variable Text", "DM Sans", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  --mono: "Cascadia Mono", "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 20px;

  --blur: blur(24px) saturate(1.08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 760px at 30% -8%, var(--glow-1), transparent 62%),
    radial-gradient(1050px 680px at 96% 2%, var(--glow-2), transparent 60%),
    radial-gradient(1000px 760px at 62% 112%, var(--glow-3), transparent 64%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-bright); }
code, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }
::selection { background: rgba(91, 75, 196,.32); }

.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;
}

.skip {
  position: fixed; left: 12px; top: -64px; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 8px 14px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600;
}
.skip:focus { top: 12px; }

/* ---------- 骨架 ---------- */
.shell {
  display: grid;
  grid-template-columns: 222px minmax(0, 1fr);
  min-height: 100dvh;
  max-width: 1700px;
  margin: 0 auto;
}

/* ---------- 侧栏 ---------- */
.rail {
  position: sticky;
  top: 14px;
  height: calc(100dvh - 28px);
  margin: 14px 0 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 20px 12px 16px;
  background-color: var(--glass-strong);
  background-image: linear-gradient(160deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0) 48%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-shadow), var(--glass-sheen);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}

.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.brand-mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent-bright), var(--accent) 55%, #178f82);
  color: var(--accent-ink);
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 11px;
  box-shadow: 0 8px 22px rgba(91, 75, 196,.32), inset 0 1px 0 rgba(255, 255, 255, .35);
  flex: none;
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text b { font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.brand-text em { font-style: normal; font-size: 10.5px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 13.5px;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.nav a svg { width: 16px; height: 16px; flex: none; color: var(--muted); transition: color .18s ease; }
.nav a:hover {
  background: var(--hover-tint);
  border-color: var(--glass-border);
  color: var(--text);
}
.nav a:hover svg { color: var(--text-2); }
.nav a.active {
  background: linear-gradient(180deg, rgba(91, 75, 196,.18), rgba(91, 75, 196,.06));
  border-color: rgba(91, 75, 196,.28);
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .03), 0 6px 18px rgba(91, 75, 196,.12);
}
.nav a.active svg { color: var(--accent-bright); }

/* 左侧接口目录 */
.rail-tree {
  flex: 1 1 auto;
  min-height: 0;
  margin: -10px -4px 0;
  padding: 0 4px 4px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.tree-title {
  padding: 0 8px 6px;
  font-size: 10.5px;
  letter-spacing: .08em;
  color: var(--muted);
}
.tree-group, .tree-category { border-radius: var(--r-sm); }
.tree-group > summary, .tree-category > summary {
  display: flex; align-items: center; gap: 6px;
  list-style: none;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  transition: background-color .16s ease, color .16s ease, border-color .16s ease;
}
.tree-group > summary::-webkit-details-marker,
.tree-category > summary::-webkit-details-marker { display: none; }
.tree-group > summary::before, .tree-category > summary::before {
  content: "›";
  flex: none;
  width: 10px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  transform-origin: center;
  transition: transform .16s ease;
}
.tree-group[open] > summary::before,
.tree-category[open] > summary::before { transform: rotate(90deg); }
.tree-group > summary {
  padding: 7px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.tree-group > summary:hover { background: var(--hover-tint); border-color: var(--glass-border); color: var(--text); }
.tree-category { margin-left: 7px; }
.tree-category > summary {
  padding: 5px 8px;
  font-size: 11.5px;
  color: var(--muted);
}
.tree-category > summary:hover { background: var(--hover-tint); color: var(--text-2); }
.tree-group > summary em, .tree-category > summary em {
  margin-left: auto;
  font-style: normal;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 400;
  color: var(--muted);
}
.tree-links { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 6px 25px; }
.tree-links a {
  position: relative;
  display: flex; flex-direction: column; gap: 1px;
  min-width: 0;
  padding: 5px 8px 5px 15px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 1.3;
}
.tree-links a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-links a .nav-name { display: flex; align-items: center; gap: 5px; }
.tree-links a .nav-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
/* 接口状态：整行淡色底 + 左缘 3px 竖条（绿=正常 黄=待同步 红=失败/超期 灰=未同步/停用） */
.tree-links a::before {
  content: "";
  position: absolute; left: 3px; top: 5px; bottom: 5px;
  width: 4px; border-radius: 2px;
  background: var(--line-strong);
}
.tree-links a[data-level="ok"] { background: rgba(43, 115, 88, .07); border-color: rgba(43, 115, 88, .12); }
.tree-links a[data-level="ok"]::before { background: var(--ok); }
.tree-links a[data-level="warn"] { background: rgba(222, 160, 28, .09); border-color: rgba(138, 95, 10, .14); }
.tree-links a[data-level="warn"]::before { background: #dea01c; }
.tree-links a[data-level="error"] { background: rgba(168, 57, 79, .08); border-color: rgba(168, 57, 79, .16); }
.tree-links a[data-level="error"]::before { background: var(--danger); }
/* 兼容未重启的旧进程状态码 */
.tree-links a[data-level="partial"] { background: rgba(168, 57, 79, .08); border-color: rgba(168, 57, 79, .16); }
.tree-links a[data-level="partial"]::before { background: var(--danger); }
.tree-links a[data-level="running"] { background: rgba(222, 160, 28, .09); border-color: rgba(138, 95, 10, .14); }
.tree-links a[data-level="running"]::before { background: #dea01c; }
.tree-links a[data-level="idle"], .tree-links a[data-level="blocked"] { background: rgba(104, 99, 126, .05); }
.nav-time { font-style: normal; font-family: var(--mono); font-size: 9px; color: var(--muted); }
.tree-links a code { font-family: var(--mono); font-size: 9.5px; color: var(--muted); }
.tree-links a:hover { background: var(--hover-tint); border-color: var(--glass-border); color: var(--text); }
.tree-links a:hover code { color: var(--text-2); }
.tree-links a.active {
  background: transparent;
  border-color: transparent;
  color: var(--text);
  font-weight: 600;
}
/* 选中指示：底部居中短横线（只占中间一段） */
.tree-links a.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 90%;
  height: 2px;
  border-radius: 2px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.tree-links a.active code { color: var(--accent-bright); }
.tree-group > summary:focus-visible, .tree-category > summary:focus-visible,
.tree-links a:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 1px; }

.rail-foot {
  margin-top: auto;
  display: flex; flex-direction: column; gap: 3px;
  padding: 14px 10px 0;
  border-top: 1px solid var(--line);
}
/* 桌面端：运行历史/设置收进左侧底部工具区（窄屏再放回横向导航） */
.nav a[data-secondary] { display: none; }
.rail-links { display: flex; flex-direction: column; gap: 2px; margin: 0 0 10px; }
.rail-links a {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  color: var(--text-2); font-size: 12.5px;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.rail-links a svg {
  width: 15px; height: 15px; flex: none; color: var(--muted); transition: color .18s ease;
}
.rail-links a:hover {
  background: var(--hover-tint); border-color: var(--glass-border); color: var(--text);
}
.rail-links a:hover svg { color: var(--text-2); }
.rail-links a.active {
  background: linear-gradient(180deg, rgba(91, 75, 196, .14), rgba(91, 75, 196, .05));
  border-color: rgba(91, 75, 196, .24);
  color: var(--text); font-weight: 600;
}
.rail-links a.active svg { color: var(--accent-bright); }
.clock {
  font-family: var(--mono); font-size: 24px; font-weight: 600;
  letter-spacing: -.03em; line-height: 1.15;
  text-shadow: 0 0 22px rgba(91, 75, 196,.22);
}
.tz { font-size: 10.5px; color: var(--muted); }
.rail-status { margin-top: 8px; font-size: 11.5px; color: var(--text-2); overflow-wrap: anywhere; }

/* ---------- 主区 ---------- */
.main {
  min-width: 0;
  padding: 26px clamp(18px, 2.6vw, 40px) 30px;
}

.topline {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.heading { min-width: 0; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.015em; }
h1 { font-size: 24px; line-height: 1.2; text-shadow: 0 2px 24px rgba(0, 0, 0, .35); }
h2 { font-size: 16px; line-height: 1.3; }
h3 { font-size: 13px; }
.sub { margin: 5px 0 0; color: var(--muted); font-size: 12.5px; max-width: 72ch; }

.runner-pill {
  display: inline-flex; align-items: center; gap: 8px;
  flex: none;
  padding: 6px 12px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--glass);
  box-shadow: var(--glass-sheen), 0 8px 22px rgba(0, 0, 0, .18);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted); flex: none;
}
.dot.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.run { background: var(--run); box-shadow: 0 0 8px var(--run); }
.dot.warn { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.dot.danger { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.dot.idle { background: var(--muted); }
.runner-pill.running .dot { background: var(--run); animation: pulse 1.6s ease-in-out infinite; }
.runner-pill.partial .dot { background: var(--warn); }
.runner-pill.error .dot { background: var(--danger); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* ---------- 概况控制台 ---------- */
.console {
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  background-color: var(--glass);
  background-image: linear-gradient(165deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, 0) 45%);
  box-shadow: var(--glass-shadow), var(--glass-sheen);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  overflow: hidden;
  margin-bottom: 18px;
}

.console-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.stat { padding: 15px 16px 14px; border-right: 1px solid var(--line); min-width: 0; }
.stat:last-child { border-right: 0; }
.stat-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--muted);
  white-space: nowrap;
}
.stat > b {
  display: block; margin-top: 4px;
  font-family: var(--mono); font-size: 24px; font-weight: 600;
  letter-spacing: -.02em; line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis;
}

.schedule-band {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  padding: 12px 16px 20px;
  border-top: 1px solid var(--line);
  background: var(--glass-inset);
}
.band-meta { display: flex; flex-direction: column; gap: 2px; padding-bottom: 2px; }
.band-title { font-size: 12.5px; font-weight: 600; }
.band-sub { font-size: 10.5px; color: var(--muted); line-height: 1.4; }

.rail-chart {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  align-items: end;
  gap: 3px;
  height: 56px;
  padding-bottom: 15px;
  position: relative;
}
.rail-col {
  height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end;
  position: relative;
}
.rail-col::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 1px;
  transform: translateX(-.5px);
  background: linear-gradient(to top, rgba(255, 255, 255, .10), rgba(255, 255, 255, .015));
  pointer-events: none;
}
.rail-bar {
  position: relative;
  z-index: 1;
  height: var(--h, 0%);
  min-height: 3px;
  border-radius: 3px 3px 1px 1px;
  background: linear-gradient(180deg, var(--accent-bright), var(--accent) 60%, rgba(91, 75, 196,.35));
  box-shadow: 0 0 14px rgba(91, 75, 196,.35);
  transition: height .35s ease, filter .15s ease;
}
.rail-col.is-zero .rail-bar {
  min-height: 2px;
  background: rgba(255, 255, 255, .12);
  box-shadow: none;
}
.rail-col:hover .rail-bar { filter: brightness(1.35); }
.rail-tick {
  position: absolute; bottom: -15px; left: 0;
  font-family: var(--mono); font-size: 9px;
  color: var(--muted);
}

.band-total { text-align: right; line-height: 1.15; white-space: nowrap; padding-bottom: 2px; }
.band-total b {
  display: block; font-family: var(--mono); font-size: 21px; font-weight: 600;
  text-shadow: 0 0 18px rgba(91, 75, 196,.25);
}
.band-total span { font-size: 10.5px; color: var(--muted); }

/* ---------- 工具栏 ---------- */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.search {
  position: relative;
  flex: 1 1 260px;
  min-width: 200px;
  max-width: 420px;
}
.search svg {
  position: absolute; left: 11px; top: 50%;
  width: 15px; height: 15px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search input {
  width: 100%; height: 36px;
  padding: 0 12px 0 33px;
  background: var(--glass-inset);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-sm);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .22);
  font-size: 13px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.search input::placeholder { color: var(--muted); }
.run-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.run-filters select {
  height: 36px; padding: 0 10px;
  border: 1px solid var(--glass-border); border-radius: var(--r-sm);
  background: var(--glass-inset); color: var(--text);
  font-size: 12.5px; font-family: inherit; cursor: pointer; outline: none;
}
.run-count { font-size: 11.5px; margin-left: auto; }
.sample-grid td { white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.sample-empty { padding: 14px 12px; font-size: 12.5px; color: var(--muted); }
.search input:focus {
  border-color: rgba(91, 75, 196,.6);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .22), 0 0 0 3px rgba(91, 75, 196,.16), 0 0 22px rgba(91, 75, 196,.12);
}

.filter-chips {
  display: flex; gap: 2px;
  padding: 3px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-sm);
  box-shadow: var(--glass-sheen);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  flex-wrap: wrap;
}
.chip-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 5px 9px;
  border-radius: var(--r-sm);
  font-size: 12px;
  white-space: nowrap;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.chip-btn span { font-family: var(--mono); font-size: 10px; margin-left: 3px; opacity: .8; }
.chip-btn:hover { color: var(--text); background: var(--hover-tint); }
.chip-btn.active {
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .04));
  border-color: var(--glass-border-strong);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10);
}
.toolbar-actions { display: flex; gap: 6px; margin-left: auto; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 31px; padding: 5px 11px;
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--r-sm);
  background: var(--btn-face);
  color: var(--text);
  font-size: 12px;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
  transition: background-color .18s ease, color .18s ease, border-color .18s ease,
              box-shadow .18s ease, transform .18s ease;
}
.btn:hover {
  background: var(--btn-face-hover);
  border-color: var(--glass-border-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), var(--btn-hover-shadow);
}
.btn:active { transform: translateY(1px); }
.btn.sm { min-height: 25px; padding: 3px 8px; font-size: 11.5px; }
.btn.primary {
  background: linear-gradient(180deg, var(--accent-bright), var(--accent) 70%);
  border-color: rgba(255, 255, 255, .24);
  color: var(--accent-ink);
  font-weight: 600;
  box-shadow: 0 8px 22px rgba(91, 75, 196,.28), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn.primary:hover {
  background: linear-gradient(180deg, #8bf0e2, var(--accent-bright) 70%);
  box-shadow: 0 10px 26px rgba(91, 75, 196,.38), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.btn.ghost { border-color: var(--glass-border); color: var(--text-2); }
.btn.ghost:hover { color: var(--text); border-color: var(--glass-border-strong); }
.btn.text { border-color: transparent; background: transparent; box-shadow: none; color: var(--accent-bright); }
.btn.text:hover { background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.btn.danger-text { border-color: transparent; background: transparent; box-shadow: none; color: var(--danger); }
.btn.danger-text:hover { background: var(--danger-bg); border-color: rgba(255, 125, 112, .35); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn[disabled]:hover { background: transparent; border-color: var(--glass-border-strong); transform: none; }

/* ---------- 分组与表格 ---------- */
.group { margin-bottom: 26px; }
.group-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.group-head h2 { font-size: 15px; }
.group-head span { color: var(--muted); font-size: 11px; }

.panel-table {
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  background-color: var(--glass);
  background-image: linear-gradient(165deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, 0) 40%);
  box-shadow: var(--glass-shadow), var(--glass-sheen);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  overflow: hidden;
}
.table-wrap { overflow-x: auto; }
.table-wrap.compact { max-height: 420px; overflow-y: auto; }

.grid { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.grid th {
  text-align: left; font-weight: 500;
  color: var(--muted); font-size: 11px;
  padding: 8px 12px;
  background: var(--th-bg);
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
.grid td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  height: 38px;
}
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tbody tr[data-api] { transition: background-color .14s ease; }
.grid tbody tr[data-api]:hover { background: var(--row-hover); }
.grid .num { text-align: right; }
.grid .muted { color: var(--muted); }
.grid .row-error { background: var(--danger-bg); }

.cat-row th {
  padding: 6px 12px;
  background: var(--th-bg);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: .02em;
}
.cat-row th span { display: inline-flex; align-items: center; gap: 7px; }
.cat-row th span::before {
  content: ""; width: 3px; height: 11px; border-radius: 2px;
  background: var(--accent-bright);
  box-shadow: 0 0 8px rgba(91, 75, 196,.5);
}
.cat-row th em {
  margin-left: 7px; font-style: normal; font-weight: 400;
  font-family: var(--mono); font-size: 10px; color: var(--muted);
}

.cell-table { min-width: 210px; }
.table-name { font-weight: 600; font-size: 13px; }
.table-name:hover { color: var(--accent-bright); text-decoration: underline; text-underline-offset: 3px; }
.api { margin-top: 1px; font-size: 10.5px; color: var(--muted); }
.mode {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--row-hover);
  font-family: var(--mono); font-size: 10.5px;
  color: var(--text-2);
  white-space: nowrap;
}
.cell-actions { text-align: right; white-space: nowrap; }
.cell-actions .btn { margin-left: 4px; }

/* ---------- 状态 ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--blocked-bg);
  color: var(--text-2);
  font-size: 11px;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; }
.chip.ok { background: var(--ok-bg); border-color: rgba(99, 213, 154, .22); color: var(--ok); }
.chip.ok i { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.chip.running { background: var(--run-bg); border-color: rgba(111, 198, 242, .24); color: var(--run); }
.chip.running i { background: var(--run); box-shadow: 0 0 8px var(--run); animation: pulse 1.6s ease-in-out infinite; }
.chip.partial, .chip.queued { background: var(--warn-bg); border-color: rgba(240, 182, 92, .24); color: var(--warn); }
.chip.partial i, .chip.queued i { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.chip.error { background: var(--danger-bg); border-color: rgba(255, 125, 112, .26); color: var(--danger); }
.chip.error i { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.chip.blocked, .chip.idle { background: var(--blocked-bg); border-color: var(--glass-border); color: var(--muted); }
.chip.blocked i, .chip.idle i { background: var(--muted); }

/* 队列优先级标记（turbo=最高…other=最低）：最高=强调色，高=琥珀，中=常规，低=蓝，最低=弱化 */
.prio {
  display: inline-flex; align-items: center;
  margin-left: 6px; padding: 1px 6px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  font-size: 10px; line-height: 1.5;
  color: var(--muted);
  white-space: nowrap;
  vertical-align: middle;
}
.prio-turbo { border-color: rgba(255, 125, 112, .3); background: var(--danger-bg); color: var(--danger); }
.prio-base { border-color: rgba(138, 95, 10, .24); background: var(--warn-bg); color: var(--warn); }
.prio-stock { border-color: rgba(116, 100, 180, .22); background: var(--hover-tint); color: var(--text-2); }
.prio-index { border-color: rgba(53, 111, 158, .24); background: var(--run-bg); color: var(--run); }
.prio-other { opacity: .72; }

.log-status { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.log-status.error, .log-status.fail { color: var(--danger); }
.log-status.warn { color: var(--warn); }
.log-status.done, .log-status.ok { color: var(--ok); }
.log-strategy { font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.log-time { white-space: nowrap; font-size: 11px; }
.log-param { font-size: 11.5px; color: var(--text-2); overflow-wrap: anywhere; }
.log-grid td, .log-grid th { padding-left: 8px; padding-right: 8px; }
.log-msg {
  max-width: 420px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.log-row-expandable { cursor: pointer; }
tr.expanded .log-msg {
  max-width: none; white-space: pre-wrap; overflow-wrap: anywhere;
}
.row-error .log-msg { color: var(--danger); }

/* ---------- 表详情 ---------- */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 6px;
  font-size: 11.5px; color: var(--muted);
}
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--accent-bright); }

.detail-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.detail-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.mode-pick {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 6px 0 10px;
  border: 1px solid var(--glass-border); border-radius: var(--r-sm);
  background: var(--glass-inset); font-size: 12px; color: var(--text-2);
}
.mode-pick select {
  height: 28px; border: none; background: transparent; color: var(--text);
  font-size: 12.5px; font-family: inherit; outline: none; cursor: pointer;
}
.mode-pick input {
  width: 64px; height: 28px; border: none; background: transparent; color: var(--text);
  font-size: 12.5px; font-family: var(--mono); outline: none;
}
.note { font-size: 12px; color: var(--muted); }
.note.danger { color: var(--danger); }

/* 接口规格卡：轻玻璃底 + 紧凑多行表格 */
.spec-card {
  padding: 4px 18px;
  margin-bottom: 16px;
  background-color: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r);
  box-shadow: var(--glass-sheen);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.spec-table {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.9fr) minmax(0, 2.23fr) minmax(0, 0.8fr);
}
.spec-cell {
  display: flex; align-items: baseline; gap: 8px;
  padding: 8px 14px 9px;
  min-width: 0;
  border-top: 1px solid var(--line);
}
.spec-cell:nth-child(4n + 1) { padding-left: 0; }
.spec-cell:nth-child(-n + 4) { border-top: none; }
/* 末行不足四格时让最后一格占满，避免右侧留白 */
.spec-cell:last-child:nth-child(4n + 3) { grid-column: span 2; }
.spec-cell em {
  flex: none; font-style: normal; white-space: nowrap;
  font-size: 11px; line-height: 1.6; color: var(--muted);
}
/* 同列标签定宽，让值纵向对齐 */
.spec-cell:nth-child(4n + 1) em { width: 78px; }
.spec-cell:nth-child(4n + 2) em { width: 44px; }
.spec-cell:nth-child(4n + 3) em { width: 22px; }
.spec-cell:nth-child(4n + 4) em { width: 44px; }
.spec-cell b {
  min-width: 0; font-weight: 500; font-size: 12.5px; line-height: 1.6;
  color: var(--text); overflow-wrap: anywhere;
}

.evidence {
  padding: 12px 14px;
  margin-bottom: 16px;
  background-color: var(--glass);
  background-image: linear-gradient(120deg, rgba(91, 75, 196,.07), rgba(255, 255, 255, 0) 60%);
  border: 1px solid var(--glass-border);
  border-left: 2px solid var(--accent);
  border-radius: var(--r);
  box-shadow: var(--glass-sheen);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.evidence-label { font-size: 10.5px; color: var(--accent-bright); margin-bottom: 3px; }
.evidence p { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--text-2); }
.evidence-meta { margin-top: 6px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }

.panel {
  padding: 16px 18px;
  margin-bottom: 16px;
  background-color: var(--glass);
  background-image: linear-gradient(165deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, 0) 40%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-shadow), var(--glass-sheen);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.panel-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin-bottom: 10px;
}
.panel-head h2 { font-size: 14px; }
.panel-head p { margin: 0; max-width: 56ch; text-align: right; font-size: 11.5px; color: var(--muted); }

.progress-meta { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.progress-track {
  height: 7px;
  background: var(--glass-inset);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(91, 75, 196,.45);
  transition: width .4s ease;
}

.fields-grid th:first-child { width: 190px; }
.fields-grid th:nth-child(2) { width: 110px; }
.fields-grid td { height: auto; padding-top: 8px; padding-bottom: 8px; }
.fields-grid td:first-child { white-space: nowrap; }
.fields-grid .field-desc { color: var(--text-2); line-height: 1.55; overflow-wrap: anywhere; }
.small { font-size: 11.5px; }

/* ---------- 运行记录 ---------- */
.runner-board {
  display: grid;
  grid-template-columns: 1.05fr 1.5fr auto;
  gap: 20px;
  align-items: center;
  padding: 14px 16px;
  margin-bottom: 16px;
  background-color: var(--glass);
  background-image: linear-gradient(165deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, 0) 45%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-shadow), var(--glass-sheen);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.runner-current b { font-family: var(--mono); font-size: 13.5px; margin-right: 6px; }
.runner-current span { font-size: 12px; color: var(--muted); }
.runner-board .eyebrow {
  display: block;
  margin-bottom: 3px;
  font-size: 10.5px; color: var(--muted);
}
.queue-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; max-height: 76px; overflow-y: auto; }
.queue-item {
  padding: 2px 7px;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-sm);
  background: var(--row-hover);
  font-size: 10.5px;
  color: var(--text-2);
}
.runner-controls { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- 设置 ---------- */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 4px;
}
.settings-grid .panel-head { flex-direction: column; gap: 2px; }
.settings-grid .panel-head p { text-align: left; max-width: none; }
.kv { margin: 0; display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 7px 12px; }
.kv dt { padding-top: 1px; font-size: 11.5px; color: var(--muted); }
.kv dd { margin: 0; font-size: 12.5px; overflow-wrap: anywhere; }
.hour-list { display: flex; flex-direction: column; gap: 3px; }
.hour-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 44px;
  align-items: center; gap: 10px;
  font-size: 11px;
}
.hour-row .mono { color: var(--muted); }
.hour-bar {
  height: 5px;
  background: var(--glass-inset);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.hour-bar i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(91, 75, 196,.35);
}
.code-block {
  margin: 0;
  padding: 13px 15px;
  background: var(--code-bg);
  color: var(--code-fg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.8;
  overflow-x: auto;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, .3);
}

/* ---------- 空态 / 页脚 / 提示 ---------- */
.empty {
  padding: 24px;
  margin: 20px 0;
  background-color: var(--glass);
  border: 1px dashed var(--glass-border-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-sheen);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.empty h2 { margin-bottom: 6px; }
.empty p { color: var(--text-2); font-size: 13px; margin: 8px 0; }
.empty pre {
  margin: 10px 0;
  padding: 10px 12px;
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: var(--r-sm);
  font-size: 12px;
  overflow-x: auto;
}
.empty-filter { padding: 20px 0; color: var(--muted); }

.foot {
  display: flex; justify-content: space-between; gap: 20px;
  margin-top: 36px; padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 10.5px; color: var(--muted);
}

.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  max-width: min(380px, calc(100vw - 40px));
  padding: 10px 14px;
  background: var(--glass-strong);
  color: var(--text);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--r);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  font-size: 12.5px;
  transform: translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: rgba(70, 24, 22, .9); border-color: rgba(255, 125, 112, .5); color: var(--danger); }

/* ---------- 晨雾主题：布局与材质 ---------- */
.shell { grid-template-columns: 272px minmax(0, 1fr); }
.rail {
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .85), rgba(246, 243, 255, .70));
  border-color: rgba(255, 255, 255, .85);
}
.brand-mark {
  background: linear-gradient(145deg, #5b4bc4, #7a6ae0 55%, #2f8f9d);
  border-color: rgba(255, 255, 255, .50);
  box-shadow: 0 10px 26px rgba(91, 75, 196, .24), inset 0 1px 0 rgba(255, 255, 255, .40);
}
h1 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.035em;
  background: linear-gradient(120deg, #2b2450, #5b4bc4 58%, #2f8f9d);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}
.sub { font-size: 13px; }
.nav a { border-radius: 12px; }
.tree-links a.active { border-radius: 999px; }
.clock { color: var(--accent); text-shadow: none; }
.runner-pill { background: rgba(255, 255, 255, .72); }

/* 指标区：hero 跨两行，其余四张卡片组成 bento */
.console {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  overflow: visible;
  margin-bottom: 14px;
}
.console-stats {
  grid-template-columns: 1fr repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(92px, auto);
  gap: 12px;
}
.stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, .86);
  border-radius: 24px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 18px 44px rgba(78, 64, 150, .08);
}
.stat:last-child { border-right: 1px solid rgba(255, 255, 255, .86); }
.stat:first-child {
  grid-row: span 2;
  color: #fff;
  background: linear-gradient(150deg, #5b4bc4, #7464d8 52%, #2f8f9d);
  border-color: rgba(255, 255, 255, .35);
  box-shadow: 0 24px 60px rgba(78, 64, 150, .20);
}
.stat:first-child .stat-label { color: rgba(255, 255, 255, .78); }
.stat:first-child > b { margin-top: auto; color: #fff; font-size: 30px; }
.stat:first-child .stat-note { color: rgba(255, 255, 255, .72); }
.stat:first-child .stat-note b {
  font-family: var(--mono); font-weight: 600; color: #fff;
}
.stat > b { margin-top: 6px; font-size: 28px; }
.stat-note { margin-top: 5px; font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.schedule-band {
  margin-top: 12px;
  padding: 14px 18px 20px;
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 24px;
  background: rgba(255, 255, 255, .70);
  box-shadow: 0 18px 44px rgba(78, 64, 150, .07);
}

.panel-table, .panel, .runner-board, .empty {
  border-color: rgba(255, 255, 255, .82);
  border-radius: 24px;
  background-color: rgba(255, 255, 255, .70);
  box-shadow: 0 22px 52px rgba(78, 64, 150, .09), var(--glass-sheen);
}
.search input {
  height: 38px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .86);
  box-shadow: inset 0 1px 2px rgba(78, 64, 150, .05);
}
.search input:focus {
  border-color: rgba(91, 75, 196, .45);
  box-shadow: 0 0 0 4px rgba(91, 75, 196, .10);
}
.filter-chips { border-radius: 999px; background: rgba(255, 255, 255, .62); }
.chip-btn { border-radius: 999px; }
.chip-btn.active {
  color: var(--accent);
  background: #fff;
  border-color: var(--line-strong);
  box-shadow: 0 4px 12px rgba(78, 64, 150, .10);
}
.btn { min-height: 32px; padding: 5px 13px; border-radius: 999px; font-size: 12.5px; }
.btn.primary {
  background: linear-gradient(180deg, var(--accent-bright), var(--accent) 70%);
  border-color: rgba(255, 255, 255, .28);
  box-shadow: 0 10px 24px rgba(91, 75, 196, .24);
}
.btn.primary:hover {
  background: linear-gradient(180deg, #8879e4, var(--accent-bright) 70%);
  box-shadow: 0 12px 28px rgba(91, 75, 196, .32);
}
.grid { font-size: 13px; }
.grid th { padding: 9px 13px; font-size: 11.5px; background: rgba(247, 244, 255, .72); }
.grid td { padding: 8px 13px; height: 42px; }
.table-name { font-size: 13.5px; }
.api { font-size: 11px; }
.log-time { font-size: 11.5px; }
.log-strategy, .log-msg { font-size: 12px; }
.chip { border-color: rgba(116, 100, 180, .12); box-shadow: none; }
.chip.ok { border-color: rgba(43, 115, 88, .20); }
.chip.running { border-color: rgba(53, 111, 158, .22); }
.chip.partial, .chip.queued { border-color: rgba(138, 95, 10, .22); }
.chip.error { border-color: rgba(168, 57, 79, .24); }
.evidence {
  border-left-color: var(--accent);
  background-image: linear-gradient(120deg, rgba(91, 75, 196, .07), rgba(255, 255, 255, 0) 60%);
}
.progress-fill { background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: none; }
.hour-bar i { background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: none; }
.toast { background: rgba(255, 255, 255, .94); }
.toast.error { background: #fff; color: var(--danger); border-color: rgba(168, 57, 79, .35); }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .shell { grid-template-columns: 1fr; }
  .rail {
    position: static; height: auto;
    margin: 10px 12px 0;
    flex-direction: row; align-items: center; gap: 18px;
    padding: 10px 14px;
    border-radius: var(--r);
  }
  .nav { flex-direction: row; margin-left: auto; gap: 2px; }
  .nav a { padding: 7px 9px; }
  .nav a[data-secondary] { display: flex; }
  .rail-tree { display: none; }
  .rail-foot { display: none; }
  .main { padding: 20px 16px 24px; }
  .settings-grid { grid-template-columns: 1fr 1fr; }
}

/* 中窄屏：规格表两列，避免四列把值挤成逐字换行 */
@media (max-width: 1200px) {
  .spec-table { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec-cell:nth-child(4n + 1) { padding-left: 14px; }
  .spec-cell:nth-child(2n + 1) { padding-left: 0; }
  .spec-cell:nth-child(4n + 1) em,
  .spec-cell:nth-child(4n + 2) em,
  .spec-cell:nth-child(4n + 3) em,
  .spec-cell:nth-child(4n + 4) em { width: auto; }
  .spec-cell:nth-child(-n + 4) { border-top: 1px solid var(--line); }
  .spec-cell:nth-child(-n + 2) { border-top: none; }
  .spec-cell:last-child:nth-child(4n + 3) { grid-column: auto; }
  .spec-cell:last-child:nth-child(2n + 1) { grid-column: span 2; }
}

@media (max-width: 760px) {
  body { font-size: 14px; }
  .brand-text em { display: none; }
  .nav a span { font-size: 12.5px; }
  .nav a svg { display: none; }
  h1 { font-size: 24px; }
  .runner-pill { display: none; }
  .console-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(96px, auto); gap: 10px; }
  .stat { padding: 14px; border-radius: 18px; }
  .stat:first-child { grid-row: span 2; }
  .stat > b { font-size: 24px; }
  .stat:first-child > b { font-size: 28px; }
  .schedule-band { padding: 12px 14px 18px; border-radius: 18px; }
  .schedule-band { grid-template-columns: 1fr auto; gap: 10px; }
  .band-meta { grid-column: 1 / -1; }
  .rail-chart { height: 42px; }
  .rail-tick { font-size: 8px; }
  .settings-grid { grid-template-columns: 1fr; }
  .runner-board { grid-template-columns: 1fr; }
  .runner-controls { justify-content: flex-start; }
  .panel-head { flex-direction: column; gap: 3px; }
  .panel-head p { text-align: left; }
  .toolbar-actions { margin-left: 0; width: 100%; }
  .toolbar-actions .btn { flex: 1; }
  .col-mode, .col-last { display: none; }
  .log-msg { max-width: 200px; }
  .run-grid { min-width: 760px; }
  .foot { flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 运行详情弹层 */
tr[data-run-id] { cursor: pointer; }
tr[data-run-id]:hover { background: var(--row-hover); }
dialog.run-dialog {
  width: min(960px, calc(100vw - 48px));
  max-height: min(82vh, 780px);
  padding: 0;
  color: var(--text);
  background-color: var(--glass-strong);
  background-image: linear-gradient(165deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, 0) 40%);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-shadow), var(--glass-sheen);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  overflow: hidden;
}
dialog.run-dialog::backdrop { background: rgba(33, 31, 53, .34); backdrop-filter: blur(2px); }
.run-dialog-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line);
}
.run-dialog-head h2 { margin: 0 0 2px; font-size: 14px; }
.run-dialog-head .sub { margin: 0; font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
.run-dialog .table-wrap { max-height: min(60vh, 560px); overflow: auto; }
.run-dialog .log-grid th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); }
.log-msg[data-error-msg] { cursor: pointer; }
.log-msg[data-error-msg]:hover { text-decoration: underline dotted; }
.log-msg.expanded { max-width: none; white-space: pre-wrap; overflow-wrap: anywhere; }
.run-error-detail {
  margin: 8px 0 0; padding: 10px 12px;
  font: 11.5px/1.6 ui-monospace, "Cascadia Mono", Consolas, monospace;
  white-space: pre-wrap; overflow-wrap: anywhere;
  max-height: 160px; overflow: auto;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; user-select: text; color: var(--danger);
}

/* 运行台账：日期筛选与分页 —— 日期输入与下拉框同规格 */
.run-filters input[type="date"] {
  height: 36px; width: 132px; padding: 0 10px;
  border: 1px solid var(--glass-border); border-radius: var(--r-sm);
  background: var(--glass-inset); color: var(--text);
  font-size: 12.5px; font-family: inherit; outline: none;
  color-scheme: dark; cursor: pointer;
}
.run-filters input[type="date"]:focus {
  border-color: rgba(91, 75, 196, .6);
  box-shadow: 0 0 0 3px rgba(91, 75, 196, .16);
}
.run-filters input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer; opacity: .8; padding: 2px 4px;
  filter: invert(.8) brightness(1.5);
}
/* antd DatePicker 挂点：控件由挂件渲染，原生 input 兜底（隐藏后不占位） */
.date-pick[data-antd-date] { display: inline-flex; align-items: center; }
.date-pick[data-antd-date] input[hidden] { display: none; }
.antd-mount { display: inline-flex; align-items: center; }
.run-pager {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px; padding: 10px 4px 2px; font-size: 12px;
}
.row-queued td { opacity: .82; }
.queue-summary { display: flex; align-items: center; gap: 10px; }
.queue-count { font-size: 13px; }
.queue-count b { font-size: 16px; }

/* 运行历史：行内迷你进度条与当前任务进度条 */
.mini-progress {
  margin-top: 4px; width: 140px; height: 6px; border-radius: 3px;
  background: rgba(255, 255, 255, .09); overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .3);
}
.mini-fill { height: 100%; border-radius: 3px; transition: width .4s ease; }
.mini-fill.run {
  background: linear-gradient(90deg, #5b8cff, #9dc1ff);
  box-shadow: 0 0 8px rgba(91, 140, 255, .55);
}
.mini-fill.ok {
  background: linear-gradient(90deg, #2fa876, #4bd39b);
  box-shadow: 0 0 8px rgba(75, 211, 155, .5);
}
.mini-fill.warn {
  background: linear-gradient(90deg, #d99a2b, #f0b952);
  box-shadow: 0 0 8px rgba(240, 185, 82, .45);
}
.mini-fill.err {
  background: linear-gradient(90deg, #d94b50, #ff7a7e);
  box-shadow: 0 0 8px rgba(255, 122, 126, .45);
}
.runner-progress { margin-top: 8px; width: min(420px, 100%); }

/* 运行详情弹窗：筛选与分页工具栏 */
.dialog-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 2px 10px;
}
.dialog-toolbar select {
  height: 32px; padding: 0 8px;
  border: 1px solid var(--glass-border); border-radius: var(--r-sm);
  background: var(--glass-inset); color: var(--text);
  font-size: 12.5px; font-family: inherit; cursor: pointer; outline: none;
}
.dialog-pager { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* 表详情：接口描述块与同步时间输入 */
.desc-block { margin-bottom: 12px; }
/* 同步时间输入：裸内芯，玻璃外壳由 .mode-pick 统一（与「同步模式」下拉完全一致） */
.mode-pick input[type="time"] {
  width: 72px; height: 28px; padding: 0;
  border: none; background: transparent;
  color: var(--text); font-size: 12.5px; font-family: var(--mono);
  outline: none; color-scheme: dark; cursor: pointer;
}
.mode-pick input[type="time"]::-webkit-calendar-picker-indicator {
  cursor: pointer; opacity: .8;
  filter: invert(.8) brightness(1.5);
}
/* antd TimePicker 挂点（borderless 裸内芯）：外壳仍由 .mode-pick 提供 */
.mode-pick .antd-slot { display: inline-flex; align-items: center; }
.mode-pick .antd-slot input[hidden] { display: none; }
.mode-pick .antd-slot .antd-mount .ant-picker { font-family: var(--mono); }

/* 运行历史：台账可读性 —— 时间分层、接口标题优先、进度右对齐、失败行标记 */
.run-grid { table-layout: fixed; min-width: 980px; }
.run-grid .col-start { width: 90px; }
.run-grid .col-api { width: 212px; }
.run-grid .col-method { width: 112px; }
.run-grid .col-status { width: 112px; }
.run-grid .col-progress { width: 142px; }
.run-grid .col-rows { width: 104px; }
.run-grid .col-duration { width: 96px; }
.run-grid .col-actions { width: 112px; }

.cell-start { white-space: nowrap; line-height: 1.2; }
.run-clock { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); letter-spacing: .01em; }
.run-day { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); }
.cell-api { overflow: hidden; }
.cell-api .table-name {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 600; font-size: 13px;
}
.api-code {
  margin-top: 1px; color: var(--muted); font-size: 10.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cell-method { white-space: nowrap; font-size: 12px; }
.run-trigger { color: var(--text-2); }
.run-phase { color: var(--muted); }
.run-dot { margin: 0 4px; color: var(--line-strong); }
/* 两阶段进度：取数完成但还没入库时在「方式」列给出提示 */
.stage-note {
  margin-top: 3px; font-size: 10.5px; color: var(--run); line-height: 1.2;
}
.queue-warn {
  margin-top: 6px; font-size: 11px; color: var(--warn);
  background: var(--warn-bg); border: 1px solid rgba(138, 95, 10, .22);
  border-radius: 999px; padding: 2px 9px; display: inline-block;
}
.queue-warn code { font-size: 10.5px; }
.cell-status { white-space: normal; }
.fail-note { display: block; margin-top: 3px; color: var(--danger); font-size: 10.5px; line-height: 1.2; }
.cell-progress { min-width: 0; }
.progress-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; white-space: nowrap; }
.progress-num { font-size: 12.5px; font-weight: 600; color: var(--text); }
.progress-num .progress-slash { color: var(--muted); font-weight: 400; }
.progress-pct { color: var(--muted); font-size: 10.5px; }
.cell-progress .mini-progress { width: 100%; height: 5px; margin-top: 5px; }
.cell-rows { font-size: 12.5px; }
.cell-duration { white-space: nowrap; color: var(--text-2); font-size: 12px; }
.run-row.is-failed { background: rgba(168, 57, 79, .035); }
.run-row.is-failed td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.run-row.is-partial { background: rgba(138, 95, 10, .03); }
.run-row.is-partial td:first-child { box-shadow: inset 3px 0 0 var(--warn); }

/* 表详情：最近一次同步（合并进度） + 每日数据量折线图 */
.run-card {
  padding: 14px 18px 16px;
  margin-bottom: 18px;
  background-color: var(--glass);
  background-image: linear-gradient(120deg, rgba(91, 75, 196, .05), rgba(255, 255, 255, 0) 55%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r);
  box-shadow: var(--glass-sheen);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.run-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 9px;
}
.run-head-main { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.run-head h2 { font-size: 14px; flex: none; }
.run-head-right {
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
  justify-content: flex-end; font-size: 11.5px; color: var(--muted);
}
.run-window { font-size: 11.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.run-empty { margin: 6px 0 2px; font-size: 12.5px; color: var(--muted); }
/* 指标网格：1px 分隔线 + 等宽单元，数值列对齐 */
.run-metrics {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  margin: 10px 0 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.run-metric {
  display: flex; flex-direction: column; gap: 1px;
  min-width: 0; padding: 8px 12px 9px;
  background: var(--glass-inset);
}
.run-metric em { font-style: normal; font-size: 11px; line-height: 1.5; color: var(--muted); }
.run-metric b {
  font-weight: 600; font-size: 13px; line-height: 1.5; color: var(--text);
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.run-metric span { font-size: 10.5px; line-height: 1.5; color: var(--muted); }
.run-note {
  margin: 8px 0 0; font-size: 11.5px; line-height: 1.6;
  color: var(--danger); overflow-wrap: anywhere;
}
@media (max-width: 1100px) {
  /* 7 项按 3 列排；末行 1 项时占满整行 */
  .run-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .run-metric:last-child:nth-child(3n + 1) { grid-column: span 3; }
}
/* 窄屏：指标两列排布；单数末项占满整行 */
@media (max-width: 760px) {
  .run-head { flex-direction: column; align-items: flex-start; gap: 5px; }
  .run-head-right { justify-content: flex-start; gap: 12px; }
  .run-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .run-metric:last-child:nth-child(3n + 1) { grid-column: auto; }
  .run-metric:nth-child(odd):last-child { grid-column: span 2; }
}
.run-card .progress { margin-top: 12px; }
.run-card .progress-meta { margin-bottom: 7px; font-size: 12px; }
.progress-fill.ok { background: linear-gradient(90deg, #2b7358, #4fae83); box-shadow: none; }
.progress-fill.partial { background: linear-gradient(90deg, #8a5f0a, #c9a03b); box-shadow: none; }
.progress-fill.error { background: linear-gradient(90deg, #a8394f, #cf7484); box-shadow: none; }
.progress-fill.running { background: linear-gradient(90deg, #356f9e, #62b0e0); }
.progress-fill.idle { background: var(--line-strong); box-shadow: none; }
.daily-chart { padding: 8px 12px 12px; }
.daily-chart svg { width: 100%; height: 170px; }
.dc-line { fill: none; stroke: #6ea8ff; stroke-width: 2; }
.dc-area { fill: rgba(91, 140, 255, .14); }
.dc-dot { fill: #89b4ff; }
.dc-dot:hover { fill: #cfe0ff; }
.dc-axis { stroke: rgba(255, 255, 255, .18); }
.dc-grid { stroke: rgba(255, 255, 255, .08); stroke-dasharray: 3 4; }
.dc-x { fill: var(--muted); font-size: 10px; font-family: var(--mono); }
.dc-ymax { fill: var(--muted); font-size: 10.5px; font-family: var(--mono); }

/* 顶栏右侧：状态胶囊 + 退出按钮 */
.topline-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--glass-border); border-radius: var(--r-sm);
  background: var(--glass-inset); color: var(--muted); cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.icon-btn:hover { color: var(--danger, #e5484d); border-color: rgba(229, 72, 77, .4); }
.icon-btn svg { width: 17px; height: 17px; }
