:root {
  --bg: #070a10;
  --bg-2: #0b101a;
  --panel: rgba(15, 21, 33, 0.86);
  --panel-solid: #0f1521;
  --panel-2: #121a28;
  --border: #233047;
  --border-soft: rgba(148, 163, 184, 0.13);
  --text: #e8eefb;
  --text-2: #b8c4d9;
  --muted: #7f8da6;
  --faint: #5d6a82;
  --accent: #5eead4;
  --accent-2: #38bdf8;
  --blue: #60a5fa;
  --amber: #fbbf24;
  --red: #fb7185;
  --green: #34d399;
  --purple: #a78bfa;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, "SFMono-Regular", monospace;
  --sans: "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(1100px 520px at 12% -10%, rgba(56, 189, 248, 0.10), transparent 62%),
    radial-gradient(900px 520px at 95% 8%, rgba(94, 234, 212, 0.07), transparent 60%),
    linear-gradient(180deg, #070a10 0%, #080c14 55%, #070a10 100%);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-2); text-decoration: none; }

.ambient {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  z-index: 0;
}
.ambient-a { width: 420px; height: 420px; top: -180px; left: 18%; background: rgba(59, 130, 246, 0.16); }
.ambient-b { width: 360px; height: 360px; top: 40px; right: -140px; background: rgba(45, 212, 191, 0.12); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 30px;
  background: rgba(7, 10, 16, 0.78);
  border-bottom: 1px solid rgba(148, 163, 184, 0.10);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 15px; letter-spacing: 0.5px;
  color: #041016;
  background: linear-gradient(135deg, #5eead4, #38bdf8 62%, #818cf8);
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.22);
}
.brand-copy h1 { margin: 0; font-size: 18px; letter-spacing: 0.2px; font-weight: 700; }
.brand-copy p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.db-pill {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border-soft);
  background: rgba(18, 26, 40, 0.8);
  padding: 6px 11px; border-radius: 999px;
  color: var(--text-2); font-size: 12px;
}
.pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.10);
}
.pulse.ok { background: var(--green); box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.12); }
.pulse.err { background: var(--red); box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.12); }
.updated { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.auto-toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; user-select: none; }
.auto-toggle input { accent-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text-2);
  padding: 8px 13px; border-radius: 10px;
  font-size: 13px; font-weight: 600;
  transition: 0.18s ease;
}
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { border-color: rgba(94, 234, 212, 0.4); color: var(--text); background: #162031; }
.btn-primary {
  color: #041016;
  border-color: transparent;
  background: linear-gradient(135deg, #5eead4, #38bdf8);
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.18);
}
.btn-primary:hover { filter: brightness(1.06); color: #041016; }
.btn-ghost { background: transparent; }
.btn.loading { opacity: 0.65; pointer-events: none; }

.page { position: relative; z-index: 1; max-width: 1680px; margin: 0 auto; padding: 24px 30px 30px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.stat-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  background: linear-gradient(180deg, rgba(18, 26, 40, 0.92), rgba(12, 18, 29, 0.92));
  border-radius: 14px;
  padding: 15px 16px 14px;
  min-height: 92px;
}
.stat-card::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 2px;
  background: var(--stat-color, var(--accent)); opacity: 0.75;
}
.stat-label { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.stat-value { margin-top: 7px; font-size: 25px; font-weight: 700; letter-spacing: -0.4px; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 12px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.stat-sub { margin-top: 3px; color: var(--faint); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.alert-banner {
  display: flex; align-items: center; gap: 11px;
  margin-top: 16px; padding: 10px 14px;
  border: 1px solid rgba(251, 113, 133, 0.28);
  background: linear-gradient(90deg, rgba(251, 113, 133, 0.10), rgba(251, 113, 133, 0.035));
  border-radius: 12px; color: #fecdd3;
}
.alert-icon {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 12px;
  color: #2a0b12; background: var(--red);
}
.alert-copy { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.alert-copy strong { color: #fda4af; font-size: 12px; }
.alert-copy span { color: #fecdd3; }
.alert-banner .btn { margin-left: auto; padding: 5px 10px; font-size: 11px; border-color: rgba(251, 113, 133, 0.25); }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 26px 2px 12px; }
.section-head h2 { margin: 0; font-size: 15px; letter-spacing: 0.2px; }
.section-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.section-note { color: var(--faint); font-size: 12px; white-space: nowrap; }

.layer-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
}
.layer-card {
  position: relative;
  border: 1px solid var(--border-soft);
  background: linear-gradient(180deg, rgba(18, 26, 40, 0.9), rgba(11, 16, 26, 0.9));
  border-radius: 14px;
  padding: 13px 14px 12px;
  min-height: 128px;
  cursor: pointer;
  transition: 0.18s ease;
  overflow: hidden;
}
.layer-card:hover { transform: translateY(-1px); border-color: rgba(94, 234, 212, 0.26); background: #121b2a; }
.layer-card.active { border-color: var(--layer-color, var(--accent)); box-shadow: inset 0 0 0 1px var(--layer-color, var(--accent)); background: #111c2b; }
.layer-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--layer-color, var(--accent)); opacity: 0.85; }
.layer-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.layer-name { font-weight: 700; font-size: 13px; }
.layer-code { color: var(--faint); font-family: var(--mono); font-size: 11px; }
.layer-nums { display: flex; align-items: baseline; gap: 5px; margin-top: 8px; }
.layer-nums strong { font-size: 22px; letter-spacing: -0.4px; font-variant-numeric: tabular-nums; }
.layer-nums span { color: var(--muted); font-size: 11px; }
.layer-meta { margin-top: 3px; color: var(--faint); font-size: 11px; display: flex; flex-wrap: wrap; gap: 6px; }
.layer-desc { margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.layer-stale { color: var(--red); }

.workspace {
  margin-top: 26px;
  border: 1px solid var(--border-soft);
  background: linear-gradient(180deg, rgba(14, 20, 32, 0.92), rgba(9, 13, 21, 0.92));
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.workspace-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px 18px 0;
  border-bottom: 1px solid var(--border-soft);
}
.tabs { display: flex; gap: 2px; }
.tab {
  position: relative;
  border: 0; background: transparent;
  color: var(--muted); font-weight: 600; font-size: 13px;
  padding: 10px 14px 13px;
  border-radius: 9px 9px 0 0;
}
.tab span { color: var(--faint); font-family: var(--mono); font-size: 10px; margin-left: 4px; }
.tab:hover { color: var(--text-2); }
.tab.active { color: var(--text); }
.tab.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 2px; }
.workspace-meta { color: var(--faint); font-size: 11px; padding-bottom: 12px; text-align: right; }
.tab-panel { padding: 16px 18px 18px; }
.tab-panel.hidden, .hidden { display: none !important; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.search-box {
  flex: 1 1 300px; min-width: 220px;
  display: flex; align-items: center; gap: 8px;
  background: #0a0f19; border: 1px solid var(--border);
  border-radius: 10px; padding: 0 12px; height: 38px;
  transition: border-color 0.18s;
}
.search-box:focus-within { border-color: rgba(94, 234, 212, 0.5); }
.search-box svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 13px; }
.search-box input::placeholder { color: var(--faint); }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--border); border-radius: 10px; background: #0a0f19; }
.seg { border: 0; background: transparent; color: var(--muted); border-radius: 7px; padding: 6px 10px; font-size: 12px; font-weight: 600; }
.seg:hover { color: var(--text-2); }
.seg.active { background: #1a2537; color: var(--text); box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.14); }
.select {
  height: 38px; border: 1px solid var(--border); border-radius: 10px;
  background: #0a0f19; color: var(--text-2); padding: 0 10px; font-size: 12px; outline: none;
}
.select:focus { border-color: rgba(94, 234, 212, 0.45); }
.result-count { color: var(--faint); font-size: 12px; margin-left: auto; font-variant-numeric: tabular-nums; }

.table-list { border: 1px solid var(--border-soft); border-radius: 12px; overflow: hidden; }
.table-head, .table-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.35fr) minmax(280px, 2.6fr) 92px 96px 46px 120px 82px;
  align-items: center;
  gap: 12px;
}
.table-head {
  padding: 10px 14px;
  background: rgba(18, 26, 40, 0.75);
  border-bottom: 1px solid var(--border-soft);
  color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: 0.2px;
}
.table-head .num { text-align: right; }
.table-row {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.075);
  cursor: pointer;
  transition: background 0.14s;
}
.table-row:last-child { border-bottom: 0; }
.table-row:hover { background: rgba(30, 41, 59, 0.36); }
.table-row.is-view { background: rgba(15, 23, 42, 0.18); }
.t-name-wrap { min-width: 0; display: flex; align-items: flex-start; gap: 8px; }
.layer-badge {
  flex: 0 0 auto; margin-top: 1px;
  width: 6px; height: 26px; border-radius: 3px;
  background: var(--layer-color, var(--accent)); opacity: 0.85;
}
.t-name { font-family: var(--mono); font-size: 12.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-sub { color: var(--faint); font-size: 10.5px; margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; }
.t-desc { min-width: 0; }
.t-desc-title { color: var(--text-2); font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-desc-body { color: var(--muted); font-size: 11px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 11.5px; color: var(--text-2); }
.num.dim { color: var(--faint); }
.time-cell { font-size: 11px; color: var(--muted); white-space: nowrap; }
.time-cell small { display: block; color: var(--faint); font-size: 10px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 3px 8px; font-size: 10.5px; font-weight: 600;
  white-space: nowrap; border: 1px solid transparent;
}
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-ok { color: var(--green); background: rgba(52, 211, 153, 0.08); border-color: rgba(52, 211, 153, 0.18); }
.status-warn { color: var(--amber); background: rgba(251, 191, 36, 0.08); border-color: rgba(251, 191, 36, 0.18); }
.status-stale { color: var(--red); background: rgba(251, 113, 133, 0.08); border-color: rgba(251, 113, 133, 0.18); }
.status-static, .status-unknown { color: var(--faint); background: rgba(148, 163, 184, 0.06); border-color: rgba(148, 163, 184, 0.12); }.badge {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--border-soft); background: rgba(148, 163, 184, 0.055);
  color: var(--muted); border-radius: 5px; padding: 1px 5px; font-size: 9.5px; line-height: 1.5;
}
.badge.view { color: var(--purple); border-color: rgba(167, 139, 250, 0.2); background: rgba(167, 139, 250, 0.06); }
.badge.part { color: var(--blue); border-color: rgba(96, 165, 250, 0.2); background: rgba(96, 165, 250, 0.06); }
.badge.warn { color: var(--amber); }
.badge.off { color: var(--faint); }
.empty-state { padding: 48px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: 12px; }

/* Endpoints */
.endpoint-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.endpoint-card {
  border: 1px solid var(--border-soft);
  background: linear-gradient(180deg, rgba(18, 26, 40, 0.78), rgba(11, 16, 26, 0.78));
  border-radius: 13px; padding: 14px 15px;
  transition: 0.18s ease;
}
.endpoint-card:hover { border-color: rgba(94, 234, 212, 0.25); }
.endpoint-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.method {
  font-family: var(--mono); font-size: 9.5px; font-weight: 700;
  padding: 2px 6px; border-radius: 5px; color: #041016;
  background: var(--method-color, var(--green));
}
.endpoint-source { color: var(--faint); font-size: 11px; }
.endpoint-name { font-weight: 700; font-size: 13px; }
.endpoint-state { margin-left: auto; }
.endpoint-path {
  margin-top: 8px; font-family: var(--mono); font-size: 11px; color: var(--accent-2);
  background: rgba(2, 6, 12, 0.5); border: 1px solid rgba(148, 163, 184, 0.09);
  border-radius: 7px; padding: 6px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.endpoint-note { margin-top: 8px; color: var(--muted); font-size: 11.5px; }
.endpoint-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 9px; color: var(--faint); font-size: 11px; }
.endpoint-targets { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.target-chip {
  border: 1px solid rgba(96, 165, 250, 0.18); background: rgba(96, 165, 250, 0.06);
  color: #93c5fd; border-radius: 5px; padding: 2px 6px;
  font-family: var(--mono); font-size: 10px; cursor: pointer;
}
.target-chip:hover { background: rgba(96, 165, 250, 0.14); }
.target-chip.missing { color: var(--faint); border-color: var(--border-soft); background: transparent; cursor: default; }

/* Jobs */
.jobs-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.jobs-head h3 { margin: 0; font-size: 13px; }
.jobs-head p { margin: 3px 0 0; color: var(--muted); font-size: 11.5px; }
.jobs-list { border: 1px solid var(--border-soft); border-radius: 12px; overflow: hidden; }
.job-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 10px; color: var(--muted); font-size: 11.5px;
}
.job-select-all { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.job-select-all input, .job-check { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }
.job-selected-count { color: var(--faint); font-size: 11px; }
.job-toolbar .btn { padding: 6px 10px; font-size: 11px; }
.job-toolbar .btn:disabled { opacity: 0.38; cursor: not-allowed; }
.job-toolbar-hint { margin-left: auto; color: var(--faint); font-size: 10.5px; }
.job-table-head {
  display: grid; grid-template-columns: 34px minmax(340px, 2.4fr) 100px 150px 90px 150px;
  gap: 12px; align-items: center;
  padding: 9px 14px;
  background: rgba(18, 26, 40, 0.78);
  border-bottom: 1px solid var(--border-soft);
  color: var(--faint); font-size: 10.5px; font-weight: 600; letter-spacing: 0.2px;
}
.job-row {
  display: grid; grid-template-columns: 34px minmax(340px, 2.4fr) 100px 150px 90px 150px;
  gap: 12px; align-items: start;
  padding: 12px 14px; border-bottom: 1px solid rgba(148, 163, 184, 0.075);
}
.job-row:last-child { border-bottom: 0; }
.job-row.selected { background: rgba(94, 234, 212, 0.045); }
.job-check-cell { display: flex; align-items: flex-start; justify-content: center; padding-top: 3px; }
.job-name-wrap { min-width: 0; }
.job-title { color: var(--text); font-weight: 700; font-size: 12.5px; }
.job-title-link {
  border: 0; background: transparent; padding: 0; text-align: left;
  color: var(--text); font-weight: 700; font-size: 12.5px; cursor: pointer;
}
.job-title-link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.job-name { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.job-desc { color: var(--muted); font-size: 11px; line-height: 1.6; margin-top: 5px; }
.job-log-link {
  border: 0; background: transparent; color: var(--blue); padding: 0;
  margin-left: 7px; font-size: 10.5px; cursor: pointer;
}
.job-log-link:hover { color: var(--accent); text-decoration: underline; }
.job-targets { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.job-target {
  border: 1px solid rgba(96, 165, 250, 0.16); background: rgba(96, 165, 250, 0.055);
  color: #93c5fd; border-radius: 4px; padding: 1px 5px;
  font-family: var(--mono); font-size: 9.5px;
}
.job-state { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); margin-top: 2px; }
.job-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.job-state.ready::before { background: var(--green); }
.job-state.running::before { background: var(--blue); }
.job-state.disabled::before { background: var(--amber); }
.job-time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.job-result { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.job-result.ok { color: var(--green); }
.job-result.fail { color: var(--red); }

/* Drawer */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(2, 6, 12, 0.62);
  backdrop-filter: blur(3px);
}
.drawer {
  position: fixed; z-index: 61; top: 0; right: 0; bottom: 0;
  width: min(680px, 92vw);
  background: #0b111c;
  border-left: 1px solid var(--border);
  box-shadow: -24px 0 80px rgba(0, 0, 0, 0.45);
  display: flex; flex-direction: column;
  transform: translateX(0);
  animation: slideIn 0.2s ease;
}
@keyframes slideIn { from { transform: translateX(30px); opacity: 0.4; } to { transform: translateX(0); opacity: 1; } }
.drawer-head {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 20px 22px 16px; border-bottom: 1px solid var(--border-soft);
}
.drawer-kicker { color: var(--faint); font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.3px; }
.drawer-head h2 { margin: 4px 0 0; font-family: var(--mono); font-size: 17px; letter-spacing: -0.2px; }
.drawer-sub { margin-top: 3px; color: var(--muted); font-size: 12px; }
.icon-btn { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border); background: var(--panel-2); color: var(--muted); font-size: 20px; line-height: 1; }
.icon-btn:hover { color: var(--text); border-color: rgba(94, 234, 212, 0.35); }
.drawer-body { padding: 18px 22px 30px; overflow-y: auto; }
.detail-hero { border: 1px solid var(--border-soft); background: rgba(18, 26, 40, 0.6); border-radius: 12px; padding: 14px 15px; }
.detail-title { font-size: 15px; font-weight: 700; }
.detail-desc { color: var(--muted); font-size: 12.5px; margin-top: 5px; line-height: 1.65; }
.detail-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.metric { border: 1px solid var(--border-soft); border-radius: 9px; padding: 9px 10px; background: rgba(7, 11, 18, 0.35); }
.metric-label { color: var(--faint); font-size: 10px; }
.metric-value { margin-top: 3px; font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.detail-section { margin-top: 18px; }
.detail-section h3 { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; font-size: 12px; letter-spacing: 0.2px; }
.detail-section h3 span { color: var(--faint); font-weight: 500; font-size: 10.5px; }
.col-table { width: 100%; border-collapse: collapse; border: 1px solid var(--border-soft); border-radius: 10px; overflow: hidden; }
.col-table th { text-align: left; padding: 7px 9px; background: rgba(18, 26, 40, 0.8); color: var(--faint); font-size: 10px; font-weight: 600; }
.col-table td { padding: 6px 9px; border-top: 1px solid rgba(148, 163, 184, 0.07); color: var(--text-2); font-size: 11px; vertical-align: top; }
.col-table td.name { font-family: var(--mono); color: var(--text); }
.col-table td.type { font-family: var(--mono); color: var(--muted); font-size: 10.5px; }
.col-table td.comment { color: var(--muted); }
.pk-pill { color: var(--amber); font-size: 9px; border: 1px solid rgba(251, 191, 36, 0.25); border-radius: 4px; padding: 0 4px; margin-left: 5px; }
.sql-box { font-family: var(--mono); font-size: 10.5px; background: #05080e; border: 1px solid var(--border-soft); border-radius: 8px; padding: 9px 10px; color: var(--accent-2); white-space: pre-wrap; word-break: break-all; }
.detail-note { color: var(--faint); font-size: 11px; margin-top: 10px; line-height: 1.6; }
.detail-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.footer {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin-top: 22px; padding: 0 3px;
  color: var(--faint); font-size: 11px;
}
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); opacity: 0.6; }
.footer-right { margin-left: auto; font-variant-numeric: tabular-nums; }

.toast {
  position: fixed; z-index: 100; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: #1a2333; border: 1px solid rgba(251, 113, 133, 0.35);
  color: #fecdd3; border-radius: 10px; padding: 10px 14px; font-size: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45); max-width: min(720px, 92vw);
}
.toast.ok { border-color: rgba(52, 211, 153, 0.35); color: #bbf7d0; }

.skeleton { position: relative; overflow: hidden; background: #0f1623 !important; border-color: transparent !important; }
.skeleton::before { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.08), transparent); animation: shimmer 1.25s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.row-skeleton { height: 63px; margin: 8px; border-radius: 9px; background: #0f1623; position: relative; overflow: hidden; }
.row-skeleton::before { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.06), transparent); animation: shimmer 1.25s infinite; }

@media (max-width: 1400px) {
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .layer-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .table-head, .table-row { grid-template-columns: minmax(180px, 1.3fr) minmax(240px, 2.3fr) 82px 88px 40px 108px 76px; }
}
@media (max-width: 1080px) {
  .page { padding: 20px; }
  .topbar { padding: 14px 20px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .endpoint-list { grid-template-columns: 1fr; }
  .table-head, .table-row { grid-template-columns: minmax(180px, 1.4fr) minmax(200px, 2fr) 80px 90px 76px; }
  .table-head > :nth-child(5), .table-row > :nth-child(5),
  .table-head > :nth-child(6), .table-row > :nth-child(6) { display: none; }
  .job-row { grid-template-columns: minmax(180px, 1.6fr) 90px 130px 80px; }
  .job-table-head { grid-template-columns: minmax(180px, 1.6fr) 90px 130px 80px; }
  .job-row > :nth-child(5) { display: none; }
  .job-table-head > :nth-child(5) { display: none; }
}
@media (max-width: 720px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .top-actions { justify-content: flex-start; width: 100%; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .layer-grid { grid-template-columns: 1fr 1fr; }
  .table-head { display: none; }
  .table-row { grid-template-columns: 1fr 84px; gap: 8px; }
  .table-row > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .table-row > :nth-child(3), .table-row > :nth-child(4), .table-row > :nth-child(5), .table-row > :nth-child(6) { display: none; }
  .table-row > :nth-child(7) { grid-column: 2; grid-row: 1; }
  .toolbar { align-items: stretch; }
  .result-count { margin-left: 0; }
  .detail-metrics { grid-template-columns: 1fr 1fr; }
  .job-row { grid-template-columns: 1fr 80px; }
  .job-table-head { grid-template-columns: 1fr 80px; }
  .job-row > :nth-child(3), .job-row > :nth-child(4), .job-row > :nth-child(5) { display: none; }
  .job-table-head > :nth-child(3), .job-table-head > :nth-child(4), .job-table-head > :nth-child(5) { display: none; }
}

/* ---------------- 登录 / 账号 / 密码 ---------------- */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  position: relative;
  z-index: 2;
  width: min(420px, 100%);
  padding: 28px 28px 22px;
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(18, 26, 40, 0.96), rgba(9, 13, 21, 0.96));
  box-shadow: var(--shadow);
}
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand h1 { margin: 0; font-size: 17px; letter-spacing: 0.2px; }
.login-brand p { margin: 2px 0 0; color: var(--muted); font-size: 11.5px; }
.login-heading { margin: 26px 0 12px; }
.login-heading h2 { margin: 0; font-size: 20px; letter-spacing: -0.2px; }
.login-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.login-field { display: block; margin-top: 13px; }
.login-field span { display: block; color: var(--muted); font-size: 11.5px; margin-bottom: 6px; }
.login-input {
  width: 100%; height: 42px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: #080d16; color: var(--text); outline: none;
  font-size: 14px; transition: border-color 0.18s;
}
.login-input:focus { border-color: rgba(94, 234, 212, 0.55); }
.login-input[readonly] { color: var(--text-2); background: #0b111b; }
.login-error { min-height: 19px; margin-top: 9px; color: #fda4af; font-size: 11.5px; line-height: 1.5; }
.login-submit {
  width: 100%; height: 42px; margin-top: 4px;
  border: 0; border-radius: 10px;
  background: linear-gradient(135deg, #5eead4, #38bdf8);
  color: #041016; font-weight: 700; font-size: 13px;
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.18);
}
.login-submit:hover { filter: brightness(1.05); }
.login-submit:disabled { opacity: 0.65; cursor: wait; }
.login-hint { display: flex; align-items: center; gap: 7px; margin-top: 18px; color: var(--faint); font-size: 10.5px; }
.login-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }

.account { position: relative; }
.account-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 9px 0 5px;
  border: 1px solid var(--border-soft);
  background: rgba(18, 26, 40, 0.8);
  color: var(--text-2); border-radius: 10px; font-size: 12px;
}
.account-btn:hover { border-color: rgba(94, 234, 212, 0.3); color: var(--text); }
.account-btn .chevron { width: 12px; height: 12px; fill: none; stroke: var(--faint); stroke-width: 2; }
.avatar {
  width: 24px; height: 24px; border-radius: 7px;
  display: grid; place-items: center;
  color: #041016; background: linear-gradient(135deg, #5eead4, #38bdf8);
  font-size: 11px; font-weight: 800;
}
.account-menu {
  position: absolute; right: 0; top: calc(100% + 7px); z-index: 45;
  width: 150px; padding: 5px;
  border: 1px solid var(--border); border-radius: 10px;
  background: #111926; box-shadow: 0 16px 44px rgba(0, 0, 0, 0.45);
}
.account-menu button {
  display: block; width: 100%; text-align: left;
  border: 0; background: transparent; color: var(--text-2);
  padding: 8px 9px; border-radius: 7px; font-size: 12px;
}
.account-menu button:hover { background: #1a2537; color: var(--text); }
.account-menu button.danger { color: #fda4af; }

.auth-banner {
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px; padding: 9px 13px;
  border: 1px solid rgba(251, 191, 36, 0.28);
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.09), rgba(251, 191, 36, 0.025));
  border-radius: 11px; color: #fde68a; font-size: 11.5px;
}
.auth-banner strong { color: var(--amber); font-size: 11.5px; }
.auth-banner .btn { margin-left: auto; padding: 5px 9px; font-size: 11px; border-color: rgba(251, 191, 36, 0.28); color: #fde68a; }

.modal-overlay {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  background: rgba(2, 6, 12, 0.68); backdrop-filter: blur(4px);
  padding: 20px;
}
.modal {
  width: min(430px, 100%);
  border: 1px solid var(--border); border-radius: 16px;
  background: #0d1420; box-shadow: var(--shadow);
  padding: 20px;
}
.modal h3 { margin: 0; font-size: 16px; }
.modal p { margin: 4px 0 0; color: var(--muted); font-size: 11.5px; }
.modal label { display: block; margin-top: 12px; }
.modal label span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.modal input {
  width: 100%; height: 38px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 9px;
  background: #080d16; color: var(--text); outline: none; font-size: 13px;
}
.modal input:focus { border-color: rgba(94, 234, 212, 0.5); }
.form-error { min-height: 18px; margin-top: 8px; color: #fda4af; font-size: 11.5px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.modal-actions .btn { padding: 7px 12px; }

.endpoint-state {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.badge.registered {
  color: var(--green);
  border-color: rgba(52, 211, 153, 0.22);
  background: rgba(52, 211, 153, 0.07);
}
.badge.local {
  color: var(--amber);
  border-color: rgba(251, 191, 36, 0.22);
  background: rgba(251, 191, 36, 0.07);
}
.endpoint-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: -2px 0 12px;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.5;
}
.endpoint-legend span { display: inline-flex; align-items: center; gap: 5px; }
.endpoint-legend b { color: var(--text-2); font-weight: 600; }
.endpoint-legend code {
  font-family: var(--mono);
  color: var(--muted);
  background: rgba(148, 163, 184, 0.07);
  border-radius: 3px;
  padding: 0 3px;
}
.endpoint-legend strong { color: var(--amber); font-weight: 500; }
.legend-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.legend-dot.registered { background: var(--green); }
.legend-dot.local { background: var(--amber); }
.legend-dot.off { background: var(--faint); }

.job-time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.job-time small { display: block; color: var(--faint); font-size: 10px; margin-top: 1px; }
.job-result { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.job-result.ok { color: var(--green); }
.job-result.fail { color: var(--red); }

/* 任务日志浮窗 */
.log-modal {
  width: min(1180px, 94vw);
  height: min(84vh, 920px);
  display: flex; flex-direction: column;
  background: #0b111c; border: 1px solid var(--border);
  border-radius: 18px; overflow: hidden;
  box-shadow: var(--shadow);
}
.log-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 17px 20px 13px; border-bottom: 1px solid var(--border-soft);
}
.log-head h2 { margin: 4px 0 0; font-size: 17px; }
.log-sub { margin-top: 5px; color: var(--muted); font-size: 11.5px; }
.log-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 20px; border-bottom: 1px solid var(--border-soft);
}
.log-toolbar .btn { padding: 6px 10px; font-size: 11px; }
.log-toolbar-hint { margin-left: auto; color: var(--faint); font-size: 10.5px; }
.log-body {
  display: grid; grid-template-columns: minmax(360px, 42%) minmax(0, 58%);
  flex: 1; min-height: 0;
}
.log-runs-wrap { min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--border-soft); }
.log-runs-head, .log-run {
  display: grid; grid-template-columns: minmax(170px, 1.6fr) 118px 64px 64px;
  gap: 9px; align-items: center;
}
.log-runs-head {
  padding: 8px 13px; background: rgba(18, 26, 40, 0.78);
  border-bottom: 1px solid var(--border-soft);
  color: var(--faint); font-size: 10px; font-weight: 600;
}
.log-runs { overflow: auto; min-height: 0; }
.log-run {
  padding: 9px 13px; border-bottom: 1px solid rgba(148, 163, 184, 0.07);
  cursor: pointer;
}
.log-run:hover { background: rgba(30, 41, 59, 0.35); }
.log-run.active { background: rgba(94, 234, 212, 0.06); box-shadow: inset 2px 0 0 var(--accent); }
.log-run .run-task { min-width: 0; }
.log-run .run-title { color: var(--text-2); font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-run .run-file { color: var(--faint); font-family: var(--mono); font-size: 9px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-run .run-time { color: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.log-run .run-duration { color: var(--text-2); font-family: var(--mono); font-size: 10.5px; }
.log-run .run-result { font-size: 10.5px; font-weight: 600; }
.log-run .run-result.success { color: var(--green); }
.log-run .run-result.failed { color: var(--red); }
.log-run .run-result.running { color: var(--blue); }
.log-run .run-result.unknown { color: var(--faint); }
.log-detail { min-height: 0; display: flex; flex-direction: column; }
.log-detail-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 14px; border-bottom: 1px solid var(--border-soft);
  color: var(--muted); font-size: 10.5px;
}
.log-detail-head span:first-child { color: var(--text-2); font-family: var(--mono); font-size: 10.5px; }
.log-pre {
  flex: 1; min-height: 0; overflow: auto; margin: 0;
  padding: 14px 16px; background: #05080e;
  color: #c9d5e8; font-family: var(--mono); font-size: 11px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;
}
.log-empty { padding: 30px; color: var(--faint); font-size: 11px; text-align: center; }

@media (max-width: 1080px) {
  .job-row { grid-template-columns: 34px minmax(180px, 1.6fr) 90px 130px 80px; }
  .job-table-head { grid-template-columns: 34px minmax(180px, 1.6fr) 90px 130px 80px; }
  .job-row > :nth-child(6) { display: none; }
  .job-table-head > :nth-child(6) { display: none; }
  .log-body { grid-template-columns: minmax(300px, 45%) minmax(0, 55%); }
}
@media (max-width: 720px) {
  .job-row { grid-template-columns: 30px 1fr 80px; }
  .job-table-head { grid-template-columns: 30px 1fr 80px; }
  .job-row > :nth-child(4), .job-row > :nth-child(5), .job-row > :nth-child(6) { display: none; }
  .job-table-head > :nth-child(4), .job-table-head > :nth-child(5), .job-table-head > :nth-child(6) { display: none; }
  .job-toolbar-hint { display: none; }
  .log-modal { width: 96vw; height: 88vh; }
  .log-body { grid-template-columns: 1fr; grid-template-rows: minmax(180px, 42%) minmax(0, 58%); }
  .log-runs-wrap { border-right: 0; border-bottom: 1px solid var(--border-soft); }
  .log-runs-head, .log-run { grid-template-columns: minmax(150px, 1.5fr) 110px 60px 58px; }
}

.job-title-line { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }

.job-run-link {
  border: 1px solid rgba(251, 191, 36, 0.24);
  background: rgba(251, 191, 36, 0.06);
  color: var(--amber);
  border-radius: 4px; padding: 1px 6px;
  font-size: 10px; cursor: pointer; white-space: nowrap;
}
.job-run-link:hover { background: rgba(251, 191, 36, 0.13); }
.job-run-link:disabled { opacity: 0.5; cursor: wait; }

/* 表关系 / 血缘 */
.lineage-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.lineage-toolbar .search-box { flex: 1 1 300px; max-width: 460px; }
.lineage-select { width: min(340px, 100%); }
.lineage-toolbar .result-count { margin-left: auto; }
.lineage-note {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 11px; margin-bottom: 12px;
  border: 1px solid var(--border-soft); border-radius: 9px;
  background: rgba(18, 26, 40, 0.55);
  color: var(--muted); font-size: 10.5px;
}
.lineage-note span { display: inline-flex; align-items: center; gap: 5px; }
.lineage-note-text { margin-left: auto; color: var(--faint); }
.lineage-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.lineage-dot.view { background: #34d399; }
.lineage-dot.etl { background: #60a5fa; }
.lineage-dot.declared { background: #fbbf24; }
.lineage-dot.fk { background: #f472b6; }
.lineage-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start;
}
.lineage-main { min-width: 0; }
.lineage-graph-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin: 2px 0 8px;
}
.lineage-graph-head h3 { margin: 0; font-size: 14px; }
.lineage-graph-head p { margin: 3px 0 0; color: var(--muted); font-size: 10.5px; }
.lineage-graph-stats { color: var(--faint); font-size: 10.5px; text-align: right; line-height: 1.6; }
.lineage-graph-wrap {
  border: 1px solid var(--border-soft); border-radius: 12px;
  background:
    radial-gradient(circle at 50% 30%, rgba(94,234,212,0.045), transparent 45%),
    rgba(8, 13, 22, 0.72);
  overflow: auto; max-height: 560px;
}
#lineageSvg { display: block; min-width: 900px; }
.lineage-edge { fill: none; stroke-width: 1.4; opacity: 0.7; }
.lineage-edge.view { stroke: #34d399; }
.lineage-edge.etl { stroke: #60a5fa; }
.lineage-edge.declared { stroke: #fbbf24; stroke-dasharray: 5 4; }
.lineage-edge.fk { stroke: #f472b6; stroke-dasharray: 2 4; }
.lineage-edge.secondary { opacity: 0.3; stroke-dasharray: 3 5; }
.lineage-node { cursor: pointer; }
.lineage-node rect { fill: #0f1a2b; stroke: #25334a; stroke-width: 1; rx: 8; }
.lineage-node:hover rect { fill: #142338; stroke: #3b4b63; }
.lineage-node.selected rect { fill: #102c2c; stroke: #5eead4; stroke-width: 1.8; }
.lineage-node.secondary rect { opacity: 0.72; }
.lineage-node text { fill: #cbd5e1; font-family: var(--sans); font-size: 10.5px; pointer-events: none; }
.lineage-node .node-key { fill: #64748b; font-family: var(--mono); font-size: 8.5px; }
.lineage-node .node-layer { font-size: 8px; font-weight: 700; letter-spacing: 0.4px; }
.lineage-node.selected .node-title { fill: #ecfeff; }
.lineage-empty { padding: 44px 24px; text-align: center; color: var(--faint); font-size: 12px; }
.lineage-summary {
  margin-top: 12px; padding: 13px 14px;
  border: 1px solid var(--border-soft); border-radius: 12px;
  background: rgba(18, 26, 40, 0.55);
}
.lineage-summary-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.lineage-summary-title { font-size: 14px; font-weight: 700; color: var(--text); }
.lineage-summary-key { margin-top: 2px; font-family: var(--mono); font-size: 10.5px; color: var(--accent-2); }
.lineage-summary-desc { margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.lineage-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 11px; }
.lineage-metric { border: 1px solid var(--border-soft); border-radius: 8px; padding: 7px 9px; background: rgba(8,13,22,0.55); }
.lineage-metric-label { color: var(--faint); font-size: 9.5px; }
.lineage-metric-value { margin-top: 2px; color: var(--text); font-family: var(--mono); font-size: 12px; }
.lineage-metric-value.warn { color: var(--amber); }
.lineage-metric-value.bad { color: var(--red); }
.lineage-relations { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.lineage-rel-col { border: 1px solid var(--border-soft); border-radius: 12px; padding: 11px; background: rgba(18,26,40,0.4); min-width: 0; }
.lineage-rel-col h4 { margin: 0 0 8px; font-size: 11px; color: var(--text-2); display: flex; justify-content: space-between; }
.lineage-rel-col h4 span { color: var(--faint); font-weight: 400; }
.lineage-rel-list { display: flex; flex-direction: column; gap: 4px; }
.lineage-rel {
  display: flex; align-items: center; gap: 6px; width: 100%; text-align: left;
  border: 1px solid transparent; background: transparent; border-radius: 6px;
  padding: 5px 6px; color: var(--text-2); cursor: pointer; font-size: 10.5px;
}
.lineage-rel:hover { background: rgba(94,234,212,0.055); border-color: rgba(94,234,212,0.13); }
.lineage-rel-key { font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lineage-rel-kind { margin-left: auto; color: var(--faint); font-size: 9px; flex: none; }
.lineage-side {
  border: 1px solid var(--border-soft); border-radius: 12px; padding: 13px;
  background: rgba(18, 26, 40, 0.55); min-width: 0;
}
.lineage-side-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.lineage-side h3 { margin: 0; font-size: 13px; }
.lineage-side-head span { color: var(--faint); font-size: 10px; }
.lineage-side-desc { margin: 7px 0 10px; color: var(--faint); font-size: 10.5px; line-height: 1.65; }
.lineage-candidates { display: flex; flex-direction: column; gap: 5px; }
.lineage-candidate {
  display: block; width: 100%; text-align: left; border: 1px solid var(--border-soft);
  background: rgba(8,13,22,0.55); border-radius: 8px; padding: 8px 9px; cursor: pointer;
}
.lineage-candidate:hover { border-color: rgba(251,191,36,0.3); background: rgba(251,191,36,0.045); }
.lineage-candidate.active { border-color: rgba(94,234,212,0.4); }
.lc-key { display: block; color: var(--text-2); font-family: var(--mono); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-meta { display: block; margin-top: 3px; color: var(--faint); font-size: 9.5px; }
.lc-badge { color: var(--amber); }
.lineage-side-sub { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-soft); color: var(--faint); font-size: 10px; line-height: 1.7; }
.lineage-side-sub code { color: var(--muted); font-family: var(--mono); font-size: 9.5px; }
.lineage-empty-side { color: var(--faint); font-size: 10.5px; padding: 8px 0; }
.lineage-more { color: var(--faint); font-size: 9.5px; padding: 3px 6px; }

@media (max-width: 1180px) {
  .lineage-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .lineage-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .lineage-layout { grid-template-columns: 1fr; }
  .lineage-side { order: 2; }
  .lineage-relations { grid-template-columns: 1fr; }
  .lineage-toolbar .result-count { margin-left: 0; }
  .lineage-note-text { flex-basis: 100%; margin-left: 0; }
}

.table-lineage-btn {
  border: 1px solid rgba(94, 234, 212, 0.18);
  background: rgba(94, 234, 212, 0.05);
  color: var(--accent-2);
  border-radius: 4px; padding: 0 5px; margin-left: 5px;
  font-size: 9.5px; line-height: 16px; cursor: pointer;
}
.table-lineage-btn:hover { background: rgba(94, 234, 212, 0.12); color: var(--accent); }
.lineage-detail-label { margin: 10px 0 5px; color: var(--faint); font-size: 10px; font-weight: 600; letter-spacing: 0.2px; }
.lineage-chip-list { display: flex; flex-wrap: wrap; gap: 5px; }
.lineage-chip-list .target-chip { cursor: pointer; border: 1px solid rgba(96,165,250,0.16); background: rgba(96,165,250,0.055); }
.lineage-chip-list .target-chip:hover { border-color: rgba(94,234,212,0.35); color: var(--accent); }
.lineage-chip-list .lineage-rel-kind { margin-left: 4px; color: var(--faint); font-size: 8.5px; }

.lineage-assessment {
  margin-top: 10px; padding: 8px 10px; border-radius: 7px;
  border: 1px solid rgba(96, 165, 250, 0.14);
  background: rgba(96, 165, 250, 0.045);
  color: var(--text-2); font-size: 10.5px; line-height: 1.65;
}
.lineage-assessment.warn {
  border-color: rgba(251, 191, 36, 0.2);
  background: rgba(251, 191, 36, 0.045);
  color: #fcd34d;
}

.job-data-range { color: var(--accent-2) !important; }
.run-data { color: var(--accent-2); font-family: var(--mono); font-size: 9px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
