.list-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; padding: 16px 8px; color: #76847e; font-size: 12px; }
.list-pagination .btn:disabled { opacity: .4; cursor: default; }
:root {
  --bg: #f2f7fd;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --surface-muted: #eaf2fb;
  --ink: #16233a;
  --ink-soft: #41566b;
  --muted: #74879c;
  --line: #e1eaf5;
  --line-strong: #cfddec;
  --nav: #eaf3fd;
  --nav-soft: #f6faff;
  --brand: #147d64;
  --brand-strong: #0e654f;
  --brand-soft: #e3f4ee;
  --blue: #2f6fe4;
  --amber: #c77c14;
  --danger: #d94d50;
  --success: #16815f;
  --shadow-sm: 0 1px 2px rgba(28, 52, 88, .04), 0 8px 24px rgba(28, 52, 88, .04);
  --shadow-md: 0 18px 48px rgba(28, 52, 88, .11);
  --sidebar-width: 252px;
  --topbar-height: 42px;
}

html { background: var(--bg); scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(20, 125, 100, .18);
  outline-offset: 2px;
}

.app-layout { min-height: 100vh; }
.sidebar {
  width: var(--sidebar-width);
  background: var(--nav);
  color: #4a6076;
  border-right: 1px solid #d3e3f5;
  box-shadow: 10px 0 30px rgba(38, 82, 130, .05);
  z-index: 700;
}

.sidebar-header {
  min-height: var(--topbar-height);
  padding: 15px 18px;
  border-bottom: 1px solid #d9e7f7;
  display: flex;
  align-items: center;
  gap: 11px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #ffffff;
  display: grid;
  grid-template-columns: repeat(3, 4px);
  justify-content: center;
  align-items: end;
  gap: 3px;
  padding-bottom: 9px;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(47, 111, 228, .16), 0 1px 2px rgba(38, 82, 130, .06);
}
.brand-mark i { display: block; width: 4px; border-radius: 2px; background: var(--blue); animation: brandBars 2.4s ease-in-out infinite; }
.brand-mark i:nth-child(1) { height: 8px; animation-delay: -.7s; }
.brand-mark i:nth-child(2) { height: 15px; animation-delay: -.3s; }
.brand-mark i:nth-child(3) { height: 11px; animation-delay: -.9s; }
.brand-copy { min-width: 0; }
.sidebar-title { font-size: 15px; color: #17324c; margin: 0; gap: 0; }
.sidebar-title::before { display: none; }
.sidebar-subtitle { padding: 0; margin-top: 2px; color: #7b95ad; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }

.sidebar-nav { padding: 18px 12px 12px; overflow-y: auto; }
.nav-group-label { padding: 5px 10px 9px; color: #8aa3b9; font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.nav-item {
  position: relative;
  gap: 11px;
  min-height: 42px;
  margin: 3px 0;
  padding: 9px 11px;
  border-radius: 7px;
  color: #4a6076;
  font-size: 13px;
  transition: background-color .2s ease, color .2s ease, transform .2s ease;
}
.nav-item:hover { background: rgba(47, 111, 228, .09); color: #2f6fe4; transform: translateX(2px); }
.nav-item.active { background: #ffffff; color: #2f6fe4; font-weight: 650; box-shadow: 0 1px 3px rgba(38, 82, 130, .10); }
.nav-item.active::after {
  content: "";
  position: absolute;
  width: 3px;
  height: 18px;
  left: 0;
  top: 12px;
  border-radius: 0 3px 3px 0;
  background: #2f6fe4;
}
.nav-icon { width: 18px; height: 18px; flex: none; display: inline-grid; place-items: center; }
.nav-icon svg { width: 18px; height: 18px; stroke-width: 1.8; }

.sidebar-user {
  margin: 10px 12px 14px;
  padding: 11px;
  background: rgba(255, 255, 255, .75);
  border: 1px solid #dbe8f6;
  border-radius: 8px;
}
.su-avatar { width: 34px; height: 34px; background: #e5b85c; color: #35280f; font-weight: 700; }
.su-name { color: #17324c; font-size: 13px; }
.su-mail { color: #7b95ad; font-size: 10px; }
.su-more { color: #6f8aa3; border-color: #d3e3f5; background: transparent; border-radius: 6px; }
.su-more:hover { color: #d94d50; border-color: rgba(217, 77, 80, .42); background: rgba(217, 77, 80, .08); }

.main-content { min-width: 0; margin-left: var(--sidebar-width); width: calc(100% - var(--sidebar-width)); }
.topbar {
  height: var(--topbar-height);
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 15px;
  position: sticky;
  top: 0;
  z-index: 550;
  background: transparent;
  border-bottom: 0;
}
.menu-toggle {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: none;
  place-items: center;
  color: var(--ink-soft);
  background: var(--surface);
}
.menu-toggle svg { width: 19px; height: 19px; }
.topbar-context { min-width: 0; }
#topbarTitle { display: block; color: var(--ink); font-size: 15px; font-weight: 700; }
.topbar-caption { color: var(--muted); font-size: 11px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-spacer { flex: 1; }
.system-state { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 12px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #20a378; box-shadow: 0 0 0 5px rgba(32, 163, 120, .1); animation: livePulse 2.2s ease-out infinite; }
.topbar-status {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 13px 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .86);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}
.topbar-status .status-text { color: var(--ink-soft); font-size: 12px; letter-spacing: .2px; }
.topbar-sep { width: 1px; height: 13px; background: var(--line-strong); }
.topbar-time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; letter-spacing: .1px; }

.content { padding: 6px 28px 28px; width: 100%; max-width: 1720px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; animation: viewIn .38s cubic-bezier(.2, .8, .2, 1); }
.page-header,
.page-header[style] {
  min-height: 64px;
  margin-bottom: 20px;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 20px;
}
.page-title { color: var(--ink); font-size: 22px; line-height: 1.25; font-weight: 750; }
.page-subtitle { margin-top: 6px; color: var(--muted); font-size: 13px; max-width: 720px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.count-text, .search-bar .count-text, .search-bar > span[id$="Count"] { color: var(--muted); font-size: 12px; }

.btn {
  min-height: 36px;
  padding: 7px 13px;
  border-radius: 7px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  font-weight: 550;
  transition: transform .16s ease, border-color .16s ease, background-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.btn:hover { background: var(--surface-soft); border-color: #b9cbe0; color: var(--ink); transform: translateY(-1px); box-shadow: 0 5px 14px rgba(28, 52, 88, .07); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn:disabled { transform: none; box-shadow: none; cursor: not-allowed; opacity: .58; }
.btn-primary, .btn[style*="background:#2563eb"] {
  min-width: 92px;
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #fff !important;
}
.btn-primary:hover, .btn[style*="background:#2563eb"]:hover { background: var(--brand-strong) !important; border-color: var(--brand-strong) !important; }
.btn-icon { display: inline-flex; align-items: center; gap: 7px; }
.btn-icon svg { width: 15px; height: 15px; }

.stats-grid { gap: 14px; margin-bottom: 16px; }
.stat-card {
  position: relative;
  min-height: 150px;
  padding: 19px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 1px solid var(--line) !important;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(28, 52, 88, .08); border-color: var(--line-strong); }
.stat-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--brand);
  transform: scaleX(.34);
  transform-origin: left;
  transition: transform .35s ease;
}
.stat-card:nth-child(2)::after { background: #2f6fe4; }
.stat-card:nth-child(3)::after { background: #d09a2c; }
.stat-card:nth-child(4)::after { background: #d94d50; }
.stat-card:hover::after { transform: scaleX(1); }
.stat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-label { margin: 0; color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: 0; text-transform: none; }
.stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
}
.stat-card:nth-child(2) .stat-icon { background: #eaf0fd; color: var(--blue); }
.stat-card:nth-child(3) .stat-icon { background: #fff4da; color: var(--amber); }
.stat-card:nth-child(4) .stat-icon { background: #fdebec; color: var(--danger); }
.stat-icon svg { width: 17px; height: 17px; }
.stat-value { margin-top: 12px; color: var(--ink); font-size: 30px; line-height: 1; font-weight: 760; font-variant-numeric: tabular-nums; }
.stat-sub { min-height: 18px; margin-top: 11px; color: var(--muted); font-size: 11px; }
.stat-sub .ok { color: var(--success); } .stat-sub .bad { color: var(--danger); }
.stat-card.is-updated .stat-value { animation: valuePop .36s cubic-bezier(.2, .85, .2, 1); }

.chart-row { gap: 16px; }
.chart-box {
  padding: 15px 16px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.chart-box:hover { border-color: var(--line-strong); box-shadow: 0 12px 28px rgba(28, 52, 88, .06); }

.content-card {
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow: auto;
}
table { min-width: 760px; }
th {
  padding: 13px 16px;
  color: #66756e;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  position: sticky;
  top: 0;
  z-index: 1;
}
td { padding: 14px 16px; color: #34423c; border-bottom: 1px solid #edf2ef; font-size: 13px; }
tbody tr { transition: background-color .15s ease; }
tbody tr:hover td { background: #f8fbf9; }
tbody tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 550; color: var(--ink); }
.content-card td:last-child, .content-card th:last-child { min-width: 108px; }

.search-bar {
  position: relative;
  z-index: 2;
  min-height: 60px;
  margin-bottom: 14px;
  padding: 10px;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(28, 52, 88, .025);
}
.search-bar input, #view-custom input[type="text"], #view-custom input[type="number"], #view-custom textarea, #view-custom select {
  min-height: 38px;
  padding: 8px 12px;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong) !important;
  border-radius: 7px !important;
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.search-bar input:focus, #view-custom input:focus, #view-custom textarea:focus, #view-custom select:focus {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 3px rgba(20, 125, 100, .1) !important;
}
.search-bar input::placeholder { color: #9aa7a1; }
.search-bar .count-text, .search-bar > span[id$="Count"] { margin-left: auto; padding: 0 5px; white-space: nowrap; }
.ac-wrap { width: min(280px, 100%); }
.ac-clear { background: var(--surface-muted); color: var(--muted); }
.ac-panel, .dd-panel { border-color: var(--line); border-radius: 8px; box-shadow: var(--shadow-md); }
.ac-item, .dd-item { border-radius: 5px; color: var(--ink-soft); }
.ac-item:hover, .dd-item:hover { background: var(--surface-soft); }
.ac-hl, .dd-item.active { color: var(--brand); }
.dd-item.active { background: var(--brand-soft); }
.dd-btn {
  min-height: 38px;
  min-width: 146px;
  padding: 8px 12px;
  border-color: var(--line-strong);
  border-radius: 7px;
  color: var(--ink-soft);
}
.dd.open .dd-btn { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(20, 125, 100, .1); }

.badge { padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 650; }
.badge::before { width: 5px; height: 5px; }
.b-success { background: #e5f4ed; color: #14785a; }
.b-failed { background: #fdebec; color: #c43f43; }
.b-canceled { background: #eef1ef; color: #68746e; }
.b-queued { background: #fff1d8; color: #a86109; }
.b-running { background: #e7effd; color: #2f66c7; }

.alert-overview {
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}
.alert-metric { position: relative; min-height: 92px; padding: 15px 18px; border-right: 1px solid var(--line); transition: background-color .18s ease; }
.alert-metric:last-child { border-right: 0; }
.alert-metric:hover { background: #fbfdfc; }
.alert-metric span { display: block; color: var(--muted); font-size: 11px; font-weight: 650; }
.alert-metric strong { display: inline-block; margin-top: 4px; color: var(--ink); font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.alert-metric small { margin-left: 9px; color: #8d9a94; font-size: 11px; }
.alert-metric-critical::before { content: ""; position: absolute; left: 0; top: 17px; bottom: 17px; width: 3px; border-radius: 0 3px 3px 0; background: var(--danger); }
.alert-metric-critical strong { color: var(--danger); }

.alert-workbench {
  margin-bottom: 14px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}
.alert-workbench-head {
  min-height: 58px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}
.alert-workbench-head > div:first-child { display: flex; align-items: center; gap: 10px; min-width: 0; }
.alert-workbench-head strong { color: var(--ink); font-size: 13px; }
.alert-workbench-head .count-text { padding: 3px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-strong); }
.alert-workbench-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.alert-workbench-actions .btn { min-height: 34px; }
#view-alerts .alert-filter-grid {
  min-height: 0;
  margin: 0;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
#view-alerts .alert-filter-grid > input,
#view-alerts .alert-filter-grid > .ac-wrap { grid-column: 1 / -1; }
#view-alerts .alert-filter-grid > input,
#view-alerts .alert-filter-grid .ac-wrap,
#view-alerts .alert-filter-grid .dd,
#view-alerts .alert-filter-grid .dd-btn { width: 100%; min-width: 0; }
#view-alerts .alert-filter-grid .dd-btn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-custom-range { grid-column: 1 / -1; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
#view-alerts .alert-custom-range input { width: 160px; min-height: 36px; padding: 7px 10px; }
.alert-scope-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
}
#view-alerts .alert-lineage-toolbar { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.alert-scope-row > .empty-note { flex: 1 1 100%; max-width: none; margin: 0; padding: 0; text-align: left; }
#view-alerts .alert-history-toolbar { padding: 9px 14px; border-top: 1px solid var(--line); border-bottom: 0; }

.alert-table-card { overflow: hidden; }
.table-card-heading {
  min-height: 58px;
  padding: 11px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.table-card-heading > div { display: flex; align-items: baseline; gap: 11px; min-width: 0; }
.table-card-heading strong { color: var(--ink); font-size: 13px; }
.table-card-heading span { color: var(--muted); font-size: 11px; }
.table-live-label { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.table-live-label i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(22, 129, 95, .1); }
.alert-table-scroll { max-height: min(620px, calc(100vh - 190px)); overflow: auto; scrollbar-gutter: stable; }
.alerts-table { min-width: 0; table-layout: fixed; width: 100%; }
.alerts-table th, .alerts-table td { box-sizing: border-box; }
.alerts-table th:nth-child(1) { width: 100px; }
.alerts-table th:nth-child(2) { width: 150px; }
.alerts-table th:nth-child(4) { width: 88px; }
.alerts-table th:nth-child(5) { width: 86px; }
.alerts-table .event-actions { display: flex; flex-direction: column; gap: 5px; }
.alerts-table .event-actions .btn { width: 100%; padding: 4px 4px; font-size: 10.5px; white-space: nowrap; }
.alerts-table .alert-reason { display: block; line-height: 1.5; overflow-wrap: anywhere; }
.alerts-table .event-object { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alerts-table td { padding-top: 11px; padding-bottom: 11px; vertical-align: middle; }
.alerts-table .alert-row td:first-child { border-left: 3px solid transparent; }
.alerts-table .alert-row.is-open td:first-child { border-left-color: var(--danger); }
.alerts-table .alert-row.is-handled td:first-child { border-left-color: #aab7b0; }
.alerts-table .alert-row.is-handled { opacity: .82; }
.event-time { display: block; color: var(--ink); font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.event-source { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 5px; color: var(--brand); font-size: 10px; letter-spacing: 0; }
.event-source::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: currentColor; }
.alert-row[data-source="rpa"] .event-source { color: #2f6fe4; }
.alert-row[data-source="mysql"] .event-source { color: #147d64; }
.alert-row[data-source="field"] .event-source { color: #8a5cc2; }
.alert-row[data-source="dataphin"] .event-source { color: #c77c14; }
.alert-row[data-source="bi"] .event-source { color: #16815f; }
.alert-row[data-source="system"] .event-source { color: #d94d50; }
.event-object { display: block; color: var(--ink); font-size: 12px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.alert-reason { display: -webkit-box; overflow: hidden; color: var(--ink-soft); line-height: 1.55; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.alert-state-cell { vertical-align: middle; }
.alert-state-cell .handling-detail { max-width: 170px; margin-top: 5px; font-size: 10px; }
.event-actions { flex-wrap: nowrap; }
.event-actions .btn { min-height: 32px; padding: 5px 9px; font-size: 11px; }

.computers-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.computer-card {
  position: relative;
  min-height: 132px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.computer-card:hover { transform: translateY(-2px); box-shadow: 0 13px 28px rgba(28, 52, 88, .07); }
.computer-card::after { content: ""; position: absolute; top: 17px; right: 17px; width: 8px; height: 8px; border-radius: 50%; background: #9ba7a1; }
.computer-card[data-status="idle"]::after { background: var(--success); box-shadow: 0 0 0 4px rgba(22, 129, 95, .1); }
.computer-card[data-status="running"]::after { background: var(--blue); box-shadow: 0 0 0 4px rgba(47, 111, 228, .1); animation: livePulse 2s ease-out infinite; }
.computer-name { padding-right: 24px; color: var(--ink); }
.computer-status { color: var(--muted); }

.link-stages {
  position: relative;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 14px !important;
  margin-bottom: 16px !important;
}
.link-stages::before { content: ""; position: absolute; left: 8%; right: 8%; top: 50%; height: 1px; background: var(--line-strong); }
.stage-card {
  position: relative;
  z-index: 1;
  min-height: 126px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.stage-card:hover { transform: translateY(-2px); box-shadow: 0 13px 28px rgba(28, 52, 88, .07); }
.stage-card::before { content: attr(data-step); position: absolute; top: 15px; right: 16px; color: #bac5bf; font-size: 11px; font-weight: 700; }
.stage-card::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #aebbb4; }
.stage-card.fresh::after { background: var(--success); }
.stage-card.slow::after { background: var(--amber); }
.stage-card.stale::after { background: var(--danger); }
.stage-card.fresh, .stage-card.slow, .stage-card.stale, .stage-card.unknown { border-left-color: var(--line); }
.stage-name { margin-bottom: 12px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .05em; }
.stage-status { color: var(--ink); font-size: 20px; }
.stage-desc { margin-top: 7px; color: var(--muted); }

#view-custom > div[style*="background:#fff"] {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  box-shadow: var(--shadow-sm);
}
#view-custom > div[style*="background:#fff"] > div:first-child { color: var(--ink) !important; }
#view-custom label { color: var(--muted) !important; }
#view-custom input[type="checkbox"] { accent-color: var(--brand); }

.modal { background: rgba(17, 29, 24, .52); backdrop-filter: blur(5px); }
.modal-content { border: 1px solid rgba(255, 255, 255, .45); border-radius: 9px; box-shadow: 0 30px 80px rgba(12, 25, 19, .25); animation: modalIn .24s ease-out; }
.modal-header { border-color: var(--line); }
.modal-header h3 { color: var(--ink); }
.modal-close { border-radius: 6px; background: var(--surface-muted); color: var(--muted); }
.modal-close:hover { background: #e3e9e6; color: var(--ink); }
.modal-footer { border-color: var(--line); }
.dt-field { background: var(--surface-soft); border: 1px solid #edf2ef; border-radius: 7px; }
.dt-label { color: var(--muted); }
.dt-value { color: var(--ink); }

/* 数据源管理 */
#datasourceModal { padding: 18px; }
.datasource-modal-content { width: 760px; max-width: min(760px, calc(100vw - 28px)); max-height: min(900px, calc(100vh - 36px)); overflow: hidden; display: flex; flex-direction: column; }
.datasource-modal-content form { min-height: 0; display: flex; flex: 1; flex-direction: column; }
.datasource-modal-header { flex: none; padding: 19px 22px 17px; background: var(--surface-soft); }
.datasource-modal-header > div { min-width: 0; }
.datasource-modal-header h3 { font-size: 17px; }
.datasource-modal-header p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.datasource-modal-body { min-height: 0; padding: 0 22px; overflow-y: auto; scrollbar-gutter: stable; }
.datasource-form-section { padding: 19px 0 20px; border-bottom: 1px solid var(--line); }
.datasource-form-section-last { border-bottom: 0; }
.datasource-section-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 10px; margin-bottom: 14px; }
.datasource-section-heading strong { color: var(--ink); font-size: 13px; }
.datasource-section-heading span { color: var(--muted); font-size: 10px; }
.datasource-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.datasource-field { min-width: 0; display: flex; flex-direction: column; gap: 7px; color: var(--ink-soft); font-size: 11px; }
.datasource-field-wide { grid-column: 1 / -1; }
.datasource-field > span:first-child b { color: var(--danger); font-weight: 700; }
.datasource-field input, .datasource-field select, .datasource-field textarea { width: 100%; min-width: 0; box-sizing: border-box; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; color: var(--ink); font: inherit; font-size: 12px; outline: none; transition: border-color .16s ease, box-shadow .16s ease; }
.datasource-field input, .datasource-field select { height: 39px; padding: 0 11px; }
.datasource-field textarea { min-height: 82px; padding: 10px 11px; resize: vertical; line-height: 1.6; }
.datasource-field input:focus, .datasource-field select:focus, .datasource-field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(20, 125, 100, .1); }
.datasource-field input::placeholder, .datasource-field textarea::placeholder { color: #a3afa9; }
.datasource-secret-input { position: relative; display: block; }
.datasource-secret-input input { padding-right: 52px; }
.datasource-secret-input button { position: absolute; top: 5px; right: 5px; height: 29px; padding: 0 8px; border-radius: 5px; color: var(--brand); font-size: 10px; font-weight: 650; }
.datasource-secret-input button:hover { background: var(--surface-muted); }
.datasource-switch { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 8px; width: fit-content; color: var(--ink-soft); cursor: pointer; font-size: 11px; }
.datasource-switch input { position: absolute; opacity: 0; pointer-events: none; }
.datasource-switch > span { position: relative; width: 34px; height: 19px; border-radius: 10px; background: #c9d3ce; transition: background .16s ease; }
.datasource-switch > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .16s ease; }
.datasource-switch input:checked + span { background: var(--brand); }
.datasource-switch input:checked + span::after { transform: translateX(15px); }
.datasource-switch input:focus-visible + span { outline: 3px solid rgba(20, 125, 100, .15); outline-offset: 2px; }
.datasource-switch em { font-style: normal; }
.datasource-modal-footer { flex: none; min-height: 66px; padding: 12px 22px; background: var(--surface-soft); }
#datasourceFormError { min-width: 0; margin-right: auto; color: var(--danger); font-size: 11px; line-height: 1.5; }
.datasource-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.datasource-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-sm); transition: box-shadow .18s ease, border-color .18s ease; }
.datasource-card:hover { border-color: var(--line-strong); box-shadow: 0 6px 18px rgba(15, 35, 28, .07); }
.datasource-card.is-disabled { opacity: .7; }
.datasource-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.datasource-card-title { min-width: 0; }
.datasource-card-title strong { display: block; overflow-wrap: anywhere; color: var(--ink); font-size: 15px; }
.datasource-card-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.datasource-card-badges span { padding: 3px 7px; border-radius: 5px; background: var(--surface-muted); color: var(--muted); font-size: 10px; }
.datasource-card-badges .is-on { background: #e8f7f1; color: var(--brand); }
.datasource-card-actions { display: flex; flex: none; gap: 6px; }
.datasource-card-actions .btn { min-width: 0; padding: 5px 9px; font-size: 11px; }
.datasource-card-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 9px 22px; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.datasource-card-row { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 8px; min-width: 0; }
.datasource-card-row.is-wide { grid-column: 1 / -1; }
.datasource-card-row > span:first-child { color: var(--muted); }
.datasource-card-value { min-width: 0; overflow-wrap: anywhere; }
.datasource-secret-value { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.datasource-secret-value button { color: var(--brand); font-size: 11px; font-weight: 650; }
.datasource-card-remark { grid-column: 1 / -1; margin-top: 5px; padding-top: 11px; border-top: 1px solid var(--line); color: var(--muted); overflow-wrap: anywhere; }

#toast {
  top: auto;
  right: 22px;
  bottom: 22px;
  max-width: min(430px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 7px;
  background: #1a2822;
  box-shadow: 0 18px 44px rgba(10, 24, 18, .24);
  transform: translateY(12px);
  transition: opacity .24s ease, transform .24s ease;
}
#toast.show { opacity: 1; transform: translateY(0); }

.login-overlay {
  padding: 24px;
  background: #edf3ef;
  z-index: 9999;
}
.login-shell {
  width: min(920px, 100%);
  min-height: 560px;
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(23, 33, 29, .08);
  border-radius: 10px;
  box-shadow: 0 32px 90px rgba(28, 52, 88, .16);
  animation: loginIn .45s cubic-bezier(.2, .8, .2, 1);
}
.login-brand {
  position: relative;
  padding: 50px;
  color: #eaf4ef;
  background: #17251f;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .08;
  background-image: linear-gradient(rgba(255,255,255,.55) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.55) 1px, transparent 1px);
  background-size: 40px 40px;
}
.login-brand > * { position: relative; z-index: 1; }
.login-brand-head { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 700; }
.login-brand .brand-mark { width: 38px; height: 38px; }
.login-brand h1 { margin: auto 0 10px; max-width: 360px; font-size: 31px; line-height: 1.32; letter-spacing: 0; }
.login-brand p { max-width: 390px; color: #8fa49a; font-size: 14px; line-height: 1.8; }
.signal-board { height: 120px; margin-top: 32px; display: flex; align-items: end; gap: 7px; }
.signal-board i { flex: 1; height: var(--h); max-width: 22px; background: #41b58f; border-radius: 3px 3px 0 0; opacity: .28; transform-origin: bottom; animation: signalMove 2.8s ease-in-out infinite; animation-delay: var(--d); }
.login-panel { padding: 58px 48px; display: flex; align-items: center; justify-content: center; }
.login-box {
  width: 100%;
  max-width: 340px;
  padding: 0;
  gap: 0;
  border-radius: 0;
  box-shadow: none;
}
.login-logo { color: var(--ink); text-align: left; font-size: 24px; }
.login-sub { margin: 7px 0 29px; color: var(--muted); text-align: left; }
.login-field { margin-bottom: 15px; }
.login-field label { display: block; margin-bottom: 7px; color: var(--ink-soft); font-size: 12px; font-weight: 650; }
.login-input-wrap { position: relative; }
.login-box input { width: 100%; height: 44px; border-color: var(--line-strong); border-radius: 7px; }
.login-box input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(20, 125, 100, .1); }
.password-toggle { position: absolute; right: 7px; top: 7px; width: 30px; height: 30px; display: grid; place-items: center; color: var(--muted); border-radius: 6px; }
.password-toggle:hover { color: var(--ink); background: var(--surface-muted); }
.password-toggle svg { width: 16px; height: 16px; }
.login-err { min-height: 22px; margin: 1px 0 5px; text-align: left; font-size: 12px; }
.login-btn { width: 100%; height: 44px; border-radius: 7px; }
.login-foot { margin-top: 18px; text-align: center; color: #9aa7a1; font-size: 11px; }

.request-progress { position: fixed; top: 0; left: 0; right: 0; z-index: 12000; height: 2px; pointer-events: none; opacity: 0; transition: opacity .2s ease; }
.request-progress::after { content: ""; display: block; width: 34%; height: 100%; background: #35aa84; transform: translateX(-110%); }
.request-progress.active { opacity: 1; }
.request-progress.active::after { animation: requestMove 1.15s ease-in-out infinite; }
.sidebar-scrim { display: none; position: fixed; inset: 0; z-index: 650; background: rgba(20, 40, 60, .42); opacity: 0; transition: opacity .2s ease; }
.reveal { animation: revealUp .42s both; animation-delay: var(--reveal-delay, 0ms); }

@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes revealUp { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes valuePop { 0% { opacity: .3; transform: translateY(4px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes loginIn { from { opacity: 0; transform: translateY(12px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(32, 163, 120, .25); } 70% { box-shadow: 0 0 0 7px rgba(32, 163, 120, 0); } 100% { box-shadow: 0 0 0 0 rgba(32, 163, 120, 0); } }
@keyframes brandBars { 0%, 100% { transform: scaleY(.72); } 50% { transform: scaleY(1.08); } }
@keyframes signalMove { 0%, 100% { transform: scaleY(.45); opacity: .18; } 50% { transform: scaleY(1); opacity: .62; } }
@keyframes requestMove { 0% { transform: translateX(-110%); } 60% { transform: translateX(170%); } 100% { transform: translateX(310%); } }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .computers-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .link-stages { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-102%); transition: transform .24s ease; }
  body.nav-open .sidebar { transform: translateX(0); }
  .sidebar-scrim { display: block; pointer-events: none; }
  body.nav-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .main-content { margin-left: 0; width: 100%; }
  .menu-toggle { display: grid; }
  .content { padding: 22px 18px; }
  .topbar { padding: 0 18px; }
  .chart-row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root { --topbar-height: 64px; }
  .topbar { gap: 10px; padding: 0 13px; }
  .topbar-caption, .topbar-time { display: none; }
  .system-state span:last-child { display: none; }
  .content { padding: 18px 12px 28px; }
  .page-header, .page-header[style] { min-height: auto; margin-bottom: 16px; flex-direction: column; gap: 13px; }
  .page-title { font-size: 20px; }
  .page-actions, .page-header > div[style*="display:flex"] { width: 100%; justify-content: space-between !important; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 132px; }
  .computers-grid, .link-stages { grid-template-columns: 1fr !important; }
  .alert-overview { grid-template-columns: 1fr; }
  .alert-metric { min-height: 74px; border-right: 0; border-bottom: 1px solid var(--line); }
  .alert-metric:last-child { border-bottom: 0; }
  .search-bar { align-items: stretch; }
  .search-bar .ac-wrap, .search-bar > input { width: 100%; }
  .search-bar .dd { flex: 1; min-width: 140px; }
  .search-bar .dd-btn { width: 100%; }
  .search-bar .count-text, .search-bar > span[id$="Count"] { width: 100%; margin-left: 0; padding: 2px 3px; }
  .search-bar .btn { flex: 1; }
  .chart-box { padding-left: 8px; padding-right: 8px; }
  .dt-row { grid-template-columns: 1fr; }
  .login-overlay { padding: 12px; }
  .login-shell { min-height: 0; display: block; }
  .login-brand { display: none; }
  .login-panel { min-height: 520px; padding: 42px 28px; }
  #view-custom > div[style*="background:#fff"] { padding: 16px !important; }
  #view-custom div[style*="display:flex;gap:12px;align-items:center"] { align-items: stretch !important; flex-direction: column; gap: 6px !important; }
  #view-custom label[style*="width:80px"] { width: auto !important; }
}

#view-custom select, #view-custom textarea, #view-custom input { min-width: 0; max-width: 100%; }
#recommendList > div, #myRulesList > div { gap: 12px; min-width: 0; }
#recommendList > div > div, #myRulesList > div > div:first-child { min-width: 0; overflow-wrap: anywhere; }
#recommendList > div > button, #myRulesList > div > div:last-child { flex-shrink: 0; }
@media (max-width: 640px) {
  #recommendList > div, #myRulesList > div { flex-wrap: wrap; }
  #recommendList > div > button, #myRulesList > div > div:last-child { margin-left: auto; }
}

.history-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 18px; background: var(--surface-soft, #f8fbff); border-bottom: 1px solid var(--line); }
.history-toolbar > span { flex: 1 1 260px; font-size: 12px; color: var(--text-muted, #66756e); line-height: 1.7; }
.history-toolbar .btn { font-size: 12px; padding: 6px 10px; }
.handling-detail { display: block; max-width: 280px; margin-top: 7px; line-height: 1.6; color: #66756e; overflow-wrap: anywhere; white-space: normal; }
#alertSyncStatus { margin-left: 8px; color: #66756e; }
#tableConfigModal select, #tableConfigModal input:not([type="checkbox"]), #tableConfigModal textarea, #handlingNote { width: 100%; min-width: 0; box-sizing: border-box; padding: 9px 11px; border: 1px solid #d7e1da; border-radius: 8px; background: #fff; color: #243c30; font: inherit; }
#tableConfigModal label { display: block; font-size: 12px; color: #66756e; margin-bottom: 7px; }
#cfgCalendarArea { padding: 14px; border: 1px solid #e1eaf5; border-radius: 10px; background: #f8fbff; }
#cfgCalendarArea input, #cfgCalendarArea select { margin-bottom: 12px; }
#cfgCalendarArea small { display: block; line-height: 1.7; color: #66756e; }
[hidden] { display: none !important; }
.duration-warning { display: block; color: #a56b12; font-size: 11px; margin-top: 5px; }
.notification-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.notification-settings label { display: flex; flex-direction: column; gap: 8px; color: var(--text-muted); font-size: 12px; }
.notification-settings input:not([type="checkbox"]) { width: 100%; box-sizing: border-box; padding: 9px 11px; border: 1px solid #d7e1da; border-radius: 8px; font: inherit; }
.notification-settings .checkbox-label { flex-direction: row; align-items: center; }
.notification-settings small, .empty-note { color: var(--text-muted); font-size: 12px; line-height: 1.7; }
.audit-panel { margin: 16px 0; padding: 16px 20px; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 8px; }
.audit-panel summary { font-size: 13px; font-weight: 600; cursor: pointer; }
.audit-panel > div { max-height: 480px; overflow: auto; margin-top: 12px; }
.execution-item { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 12px; overflow-wrap: anywhere; }
.execution-item:last-child { border-bottom: 0; }
.execution-item span { color: #85611f; }
.execution-item small, .execution-item code { flex-basis: 100%; color: var(--text-muted); line-height: 1.7; white-space: normal; }
@media (max-width: 640px) { .notification-settings { grid-template-columns: 1fr; } }

.lineage-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:12px; padding:14px 18px; margin:0 0 16px; border:1px solid var(--line); border-radius:8px; background:var(--surface); font-size:12px; }
.lineage-toolbar label { display:flex; align-items:center; gap:10px; flex:0 0 auto; white-space:nowrap; }
.lineage-toolbar span { flex:1 1 220px; color:var(--muted); line-height:1.6; }
.lineage-toolbar input, .lineage-toolbar select { min-width:0; max-width:100%; padding:8px 10px; border:1px solid var(--line); border-radius:8px; background:var(--surface); color:var(--ink-soft); font:inherit; }
.dataphin-page-header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.dataphin-summary { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; margin:0 0 16px; }
.dataphin-kpi { position:relative; min-width:0; min-height:112px; padding:15px 16px 14px; overflow:hidden; border:1px solid var(--line); border-radius:8px; background:var(--surface); color:var(--ink); text-align:left; transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease; }
.dataphin-kpi::before { content:""; position:absolute; top:15px; bottom:15px; left:0; width:3px; border-radius:0 3px 3px 0; background:#aebbb4; }
.dataphin-kpi:hover { transform:translateY(-2px); border-color:var(--line-strong); box-shadow:0 9px 24px rgba(22,38,31,.07); }
.dataphin-kpi.is-active { border-color:currentColor; box-shadow:0 0 0 2px color-mix(in srgb,currentColor 13%,transparent); }
.dataphin-kpi > span { display:block; color:var(--muted); font-size:11px; font-weight:650; }
.dataphin-kpi strong { display:block; margin:9px 0 6px; font-size:27px; line-height:1; font-variant-numeric:tabular-nums; }
.dataphin-kpi small { display:block; color:var(--muted); font-size:10px; }
.dataphin-kpi.is-critical { color:var(--danger); }.dataphin-kpi.is-critical::before { background:var(--danger); }
.dataphin-kpi.is-running { color:var(--blue); }.dataphin-kpi.is-running::before { background:var(--blue); }
.dataphin-kpi.is-waiting { color:var(--amber); }.dataphin-kpi.is-waiting::before { background:var(--amber); }
.dataphin-kpi.is-unknown { color:#7a8781; }.dataphin-kpi.is-unknown::before { background:#9ca9a2; }
.dataphin-kpi.is-success { color:var(--success); }.dataphin-kpi.is-success::before { background:var(--success); }
.dataphin-workbench { overflow:hidden; border:1px solid var(--line); border-radius:8px; background:var(--surface); }
.dataphin-workbench-head { display:flex; align-items:center; justify-content:flex-start; gap:12px; min-height:57px; padding:11px 16px; border-bottom:1px solid var(--line); background:var(--surface-soft); }
.dataphin-workbench-head .dp-virtual-toggle { margin-left:auto; }
.dataphin-workbench-head .btn { flex:0 0 auto; }
.dataphin-workbench-head > div { display:flex; align-items:baseline; flex-wrap:wrap; gap:8px 12px; min-width:0; }
.dataphin-workbench-head strong { font-size:13px; }.dataphin-workbench-head .count-text { color:var(--muted); font-size:11px; }
.dataphin-filter-bar { margin:0; padding:12px 16px; border-bottom:1px solid var(--line); background:#fff; }
.dataphin-filter-bar #dpSearch { flex:1 1 280px; width:auto; max-width:420px; }
.dataphin-filter-bar #dpPageInfo { min-width:120px; margin-left:auto; text-align:right; }
.dataphin-instance-list { min-height:180px; max-height:660px; overflow:auto; padding:0 16px; scrollbar-gutter:stable; }
.dataphin-instance { display:grid; grid-template-columns:minmax(230px,1.4fr) minmax(230px,1fr) minmax(150px,.7fr) auto; align-items:center; gap:12px 18px; min-width:0; padding:14px 0 14px 12px; border-bottom:1px solid var(--line); border-left:3px solid transparent; }
.dataphin-instance:last-child { border-bottom:0; }
.dataphin-instance.is-failed { border-left-color:var(--danger); background:linear-gradient(90deg,rgba(217,77,80,.035),transparent 28%); }
.dataphin-instance.is-running { border-left-color:var(--blue); }.dataphin-instance.is-waiting { border-left-color:var(--amber); }
.dataphin-instance-main { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:5px 9px; min-width:0; }
.dataphin-instance-main strong { overflow:hidden; color:var(--ink); font-size:13px; text-overflow:ellipsis; white-space:nowrap; }
.dataphin-instance-main small { grid-column:2; overflow:hidden; color:var(--muted); font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.dp-badge { grid-row:1 / span 2; align-self:center; padding:3px 8px; font-size:10px; }
.dp-success { background:#e7f6ec;color:var(--success); }.dp-failed { background:#fdecec;color:var(--danger); }.dp-running { background:#e8f0fe;color:var(--blue); }.dp-waiting { background:#fff3e0;color:var(--amber); }.dp-unknown { background:#eef1ef;color:#6c7a73; }
.dataphin-instance-meta { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; color:var(--ink-soft); font-size:11px; }
.dataphin-instance-meta span { min-width:0; overflow-wrap:anywhere; }.dataphin-instance-meta small { display:block; margin-bottom:4px; color:var(--muted); font-size:9px; }
.dataphin-instance > code { min-width:0; overflow:hidden; color:var(--muted); font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.dataphin-empty-state { display:grid; place-items:center; align-content:center; gap:8px; min-height:210px; padding:32px; text-align:center; }
.dataphin-empty-state strong { color:var(--ink); font-size:14px; }.dataphin-empty-state span { max-width:560px; color:var(--muted); font-size:12px; line-height:1.7; }
.dataphin-empty-state.is-error strong { color:var(--danger); }
.dataphin-note { margin:10px 2px 0; }
.lineage-panel { margin-bottom:20px; }
.lineage-heading { padding:15px 18px; display:flex; flex-wrap:wrap; gap:8px 18px; align-items:center; border-bottom:1px solid var(--line); background:var(--surface-soft); }
.lineage-heading small { color:var(--muted); font-size:12px; line-height:1.7; }
.lineage-chains { max-height:590px; overflow:auto; padding:0 18px; scrollbar-gutter:stable; }
.lineage-chain { padding:15px 0; border-bottom:1px solid var(--line); animation:chainReveal .3s ease both; }
.lineage-chain:last-child { border:0; }
.chain-title { display:flex; align-items:center; flex-wrap:wrap; justify-content:space-between; gap:12px; margin-bottom:10px; }
.chain-title > div { display:flex; align-items:center; flex-wrap:wrap; gap:9px; min-width:0; }
.chain-title strong { font-size:13px; overflow-wrap:anywhere; }
.chain-link-count { padding:3px 7px; border-radius:999px; background:var(--surface-muted); color:var(--muted); font-size:10px; white-space:nowrap; }
.chain-stages { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:9px; }
.chain-stages > div { display:flex; flex-direction:column; gap:6px; min-width:0; min-height:94px; padding:12px; border:1px solid var(--line); border-radius:7px; background:var(--surface-soft); overflow-wrap:anywhere; font-size:12px; }
.chain-node { position:relative; transition:border-color .18s ease, background-color .18s ease, transform .18s ease; }
.chain-node:hover { transform:translateY(-1px); border-color:var(--line-strong); background:#fff; }
.chain-node::before { content:""; position:absolute; top:13px; right:12px; width:7px; height:7px; border-radius:50%; background:#aebbb4; box-shadow:0 0 0 3px rgba(174,187,180,.12); }
.chain-node.fresh::before { background:var(--success); box-shadow:0 0 0 3px rgba(22,129,95,.11); }
.chain-node.slow::before { background:var(--amber); box-shadow:0 0 0 3px rgba(199,124,20,.11); }
.chain-node.stale::before { background:var(--danger); box-shadow:0 0 0 3px rgba(217,77,80,.11); }
.chain-node:not(:last-child)::after { content:""; position:absolute; top:50%; right:-10px; width:9px; height:1px; background:var(--line-strong); }
.chain-stages small { color:var(--muted); font-size:11px; line-height:1.6; }
.chain-stages span { padding-right:12px; color:var(--ink); line-height:1.6; }
.chain-stages .btn { font-size:11px; white-space:normal; }
.chain-evidence { padding:14px; border:1px solid var(--line); border-radius:10px; background:var(--surface-soft); margin-top:14px; font-size:12px; overflow-wrap:anywhere; }
.chain-evidence p { margin:10px 0 0; line-height:1.8; }
.lineage-log { max-height:420px; overflow:auto; padding:14px; background:var(--surface-soft); border-radius:10px; font-size:11px; white-space:pre-wrap; overflow-wrap:anywhere; }
.dp-error-summary { margin:14px 0; padding:12px 14px; border:1px solid color-mix(in srgb,var(--danger) 35%,transparent); border-left:3px solid var(--danger); border-radius:8px; background:color-mix(in srgb,var(--danger) 5%,var(--surface)); }
.dp-error-summary > strong { display:block; margin-bottom:7px; color:var(--danger); font-size:12px; }
.dp-error-summary > pre { margin:0; max-height:180px; overflow:auto; color:var(--ink-soft); font-size:11px; line-height:1.65; white-space:pre-wrap; overflow-wrap:anywhere; }
.dp-detail-actions { display:flex; gap:8px; margin:16px 0 12px; }
.dp-virtual-toggle { display:inline-flex; align-items:center; gap:6px; padding:7px 11px; border:1px solid var(--line); border-radius:8px; background:var(--surface); color:var(--muted); font-size:11.5px; cursor:pointer; white-space:nowrap; }
.dp-virtual-toggle input[type="checkbox"] { margin:0; width:15px; height:15px; min-height:0; padding:0; border:none !important; border-radius:0 !important; background:none; box-shadow:none !important; accent-color:var(--brand); cursor:pointer; flex:0 0 auto; }
.dp-virtual-toggle:hover { border-color:var(--line-strong); color:var(--ink-soft); }

/* Dataphin 筛选栏：搜索占一行，其余控件排第二行 */
.dataphin-filter-bar { display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.dataphin-filter-bar #dpSearch { flex:1 1 100%; width:100%; max-width:none; }
.dataphin-filter-bar .dd { flex:0 0 auto; }
.dataphin-filter-bar #dpPageInfo { margin-left:auto; min-width:0; text-align:right; padding:0; }
.dataphin-filter-bar .btn { flex:0 0 auto; }
@media (max-width:1180px) {
  .dataphin-filter-bar #dpPageInfo { margin-left:auto; }
}
.event-source { display:inline-flex; align-items:center; gap:6px; font-size:10px; color:var(--brand); margin-bottom:5px; letter-spacing:0; }
.event-actions { display:flex; flex-wrap:nowrap; gap:7px; }
#confirmBody label { display:block; margin:14px 0; font-size:12px; color:var(--muted); }
#confirmBody label input, #eventNote { display:block; width:100%; box-sizing:border-box; margin-top:8px; padding:10px 12px; border:1px solid var(--line); border-radius:8px; background:var(--surface); color:var(--ink); font:inherit; }
#eventNote { min-height:120px; }
#detailContent > p { line-height:1.8; overflow-wrap:anywhere; }
@keyframes chainReveal { from {opacity:0;transform:translateY(5px)} to {opacity:1;transform:translateY(0)} }
@media (max-width:1180px) {
  .dataphin-summary {grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;}
  .dataphin-kpi {min-height:100px;padding:13px 12px 12px;}
  .dataphin-kpi strong {margin:8px 0 5px;font-size:24px;}
  .dataphin-kpi > span {font-size:10.5px;}
  .dataphin-kpi small {font-size:9.5px;}
  .dataphin-instance {grid-template-columns:minmax(220px,1.3fr) minmax(210px,1fr) auto;}
  .dataphin-instance > code {grid-column:1 / span 2;}
  .chain-stages {grid-template-columns:repeat(2,minmax(0,1fr));}
  .link-stages::before, .chain-node:not(:last-child)::after {display:none;}
}
@media (max-width:900px) {
  .alert-scope-row {grid-template-columns:1fr;}
  .alert-scope-row > .empty-note {max-width:none;padding:0 14px 11px;text-align:left;}
}
@media (max-width:640px) {
  #datasourceModal { padding: 0; align-items: flex-end; }
  .datasource-modal-content { width: 100%; max-width: none; max-height: calc(100vh - 18px); border-radius: 9px 9px 0 0; }
  .datasource-modal-header { padding: 16px 15px 14px; }
  .datasource-modal-body { padding: 0 15px; }
  .datasource-form-section { padding: 16px 0 17px; }
  .datasource-form-grid { grid-template-columns: 1fr; gap: 12px; }
  .datasource-field-wide, .datasource-switch { grid-column: 1; }
  .datasource-modal-footer { min-height: 62px; padding: 10px 15px; }
  #datasourceFormError { flex-basis: 100%; order: 3; }
  .datasource-list { grid-template-columns: 1fr; }
  .datasource-card-head { flex-direction: column; }
  .datasource-card-actions { width: 100%; }
  .datasource-card-actions .btn { flex: 1; }
  .dataphin-page-header {align-items:stretch;}.dataphin-page-header > .btn {width:100%;}
  .dataphin-toolbar label {width:100%;justify-content:space-between;flex-wrap:nowrap;}
  .dataphin-toolbar span {order:3;flex-basis:100%;font-size:11px;}
  .dataphin-toolbar .btn {margin-left:auto;}
  .dataphin-summary {grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;}
  .dataphin-kpi {min-height:91px;padding:12px 13px;}.dataphin-kpi::before {top:12px;bottom:12px;}.dataphin-kpi strong {margin:7px 0 4px;font-size:23px;}
  .dataphin-kpi:last-child {grid-column:1 / -1;min-height:82px;}
  .dataphin-workbench-head {align-items:flex-start;padding:10px 11px;}.dataphin-workbench-head > div {display:block;}.dataphin-workbench-head .count-text {display:block;margin-top:3px;}
  .dataphin-filter-bar {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;padding:10px;}
  .dataphin-filter-bar #dpSearch {grid-column:1 / -1;width:100%;max-width:none;}
  .dataphin-filter-bar .dd {min-width:0;}.dataphin-filter-bar .dd-btn {min-width:0;width:100%;padding:7px 8px;gap:6px;font-size:11px;}
  .dataphin-filter-bar #dpPageInfo {grid-column:1 / -1;width:100%;margin:0;padding:2px;text-align:left;}
  .dataphin-filter-bar .btn {min-width:0;}
  .dataphin-instance-list {max-height:620px;padding:0 10px;}
  .dataphin-instance {grid-template-columns:minmax(0,1fr) auto;gap:10px;padding:13px 0 13px 8px;}
  .dataphin-instance-main,.dataphin-instance-meta,.dataphin-instance > code {grid-column:1 / -1;}
  .dataphin-instance-main strong {white-space:normal;overflow-wrap:anywhere;}.dataphin-instance-main small {white-space:normal;overflow-wrap:anywhere;}
  .dataphin-instance > code {white-space:normal;overflow-wrap:anywhere;}.dataphin-instance > .btn {grid-column:2;grid-row:4;}
  #view-alerts .alert-overview {grid-template-columns:repeat(3,minmax(0,1fr));}
  #view-alerts .alert-metric {min-height:88px;padding:12px 10px;border-right:1px solid var(--line);border-bottom:0;}
  #view-alerts .alert-metric:last-child {border-right:0;}
  #view-alerts .alert-metric span {min-height:32px;line-height:1.45;}
  #view-alerts .alert-metric strong {font-size:22px;}
  #view-alerts .alert-metric small {display:none;}
  #view-alerts .alert-metric-critical::before {top:12px;bottom:12px;}
  .alert-workbench-head {align-items:flex-start;flex-direction:column;gap:9px;padding:10px;}
  .alert-workbench-head > div:first-child {width:100%;justify-content:space-between;}
  .alert-workbench-actions {width:100%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;}
  .alert-workbench-actions .btn,.alert-workbench-actions .btn-primary {min-width:0;padding:6px 5px;font-size:11px;}
  #view-alerts .alert-filter-grid {grid-template-columns:repeat(3,minmax(0,1fr));padding:10px;gap:7px;}
  #view-alerts .alert-filter-grid > input,#view-alerts .alert-filter-grid > .ac-wrap {grid-column:1 / -1;}
  #view-alerts .alert-filter-grid .dd {min-width:0;}
  #view-alerts .alert-filter-grid .dd-btn {min-width:0;padding:7px 8px;gap:6px;font-size:11px;}
  .alert-custom-range {grid-column:1 / -1;}
  #view-alerts .alert-custom-range input {width:calc(50% - 14px);min-width:0;}
  #view-alerts .alert-lineage-toolbar {padding:9px 10px;gap:8px;}
  #view-alerts .alert-lineage-toolbar label {width:100%;justify-content:space-between;flex-wrap:nowrap;}
  #view-alerts .alert-lineage-toolbar span {order:3;flex-basis:100%;font-size:11px;}
  #view-alerts .alert-lineage-toolbar .btn {margin-left:auto;}
  .alert-scope-row > .empty-note {display:none;}
  #view-alerts .alert-history-toolbar {padding:8px 10px;gap:7px;}
  #view-alerts .alert-history-toolbar > span {flex-basis:100%;font-size:11px;line-height:1.5;}
  .table-card-heading {min-height:52px;padding:9px 12px;}
  .table-card-heading > div {display:block;}
  .table-card-heading > div > span {display:block;margin-top:3px;}
  .table-live-label {display:none;}
  .alert-table-scroll {max-height:560px;}
  #view-link .link-stages {grid-template-columns:repeat(2,minmax(0,1fr)) !important;gap:8px !important;}
  #view-link .stage-card {min-height:118px;padding:13px 14px;}
  #view-link .stage-card::before {top:12px;right:12px;}
  #view-link .stage-name {margin-bottom:9px;font-size:10px;}
  #view-link .stage-status {font-size:16px;line-height:1.35;overflow-wrap:anywhere;}
  #view-link .stage-desc {display:-webkit-box;margin-top:5px;overflow:hidden;font-size:10px;line-height:1.5;-webkit-box-orient:vertical;-webkit-line-clamp:2;}
  .chain-stages {grid-template-columns:1fr;}
  .chain-stages > div {min-height:82px;}
  .lineage-chains {padding:0 12px;}
  .lineage-toolbar {padding:12px;}
  .lineage-toolbar label {flex-wrap:wrap;}
}

/* Data table preview */
.data-preview-page-header { align-items: center !important; }
.preview-readonly-badge { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 5px 10px; border: 1px solid #bddfd2; border-radius: 999px; background: #eef9f5; color: #106b55; font-size: 11px; font-weight: 650; }
.preview-readonly-badge span { color: #20a378; font-size: 9px; }
.data-preview-workbench { display: grid; grid-template-columns: 290px minmax(0,1fr); min-width: 0; min-height: 650px; height: calc(100vh - var(--topbar-height) - 152px); overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-sm); }
.data-preview-workbench [hidden] { display: none !important; }
.data-preview-sidebar { display: flex; min-width: 0; min-height: 0; flex-direction: column; overflow: hidden; border-right: 1px solid var(--line); background: #f8fbff; }
.preview-source-block { padding: 13px 14px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.preview-source-block label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .02em; }
.preview-source-block select { width: 100%; min-width: 0; height: 38px; padding: 0 34px 0 11px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--ink); font-size: 12.5px; outline: none; }
.preview-source-block select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(20,125,100,.12); }
.preview-source-block select:disabled { color: var(--muted); background: var(--surface-soft); }
.preview-table-search { position: relative; margin: 10px 12px 8px; }
.preview-table-search svg { position: absolute; top: 50%; left: 10px; width: 15px; height: 15px; color: #819088; transform: translateY(-50%); pointer-events: none; }
.preview-table-search input { width: 100%; min-width: 0; height: 38px; padding: 0 10px 0 32px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); font-size: 13px; outline: none; }
.preview-table-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(20,125,100,.1); }
.preview-table-search input::placeholder { color: #9ba7a1; }
.preview-table-heading { display: flex; align-items: center; justify-content: space-between; padding: 5px 14px 8px; color: var(--muted); font-size: 12px; }
.preview-table-heading strong { color: var(--ink-soft); font-size: 13px; }
.preview-table-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--line); scrollbar-gutter: stable; }
.preview-table-item { display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "name name" "desc count"; width: 100%; min-height: 56px; padding: 10px 13px 9px; border-bottom: 1px solid #e8eeea; border-left: 3px solid transparent; background: transparent; color: var(--ink-soft); text-align: left; transition: background-color .16s ease,border-color .16s ease,color .16s ease; }
.preview-table-item:hover { background: #f0f5f2; color: var(--ink); }
.preview-table-item.active { border-left-color: var(--brand); background: #e7f4ef; color: #0f6551; }
.preview-table-item-name { grid-area: name; display: flex; min-width: 0; align-items: center; gap: 8px; }
.preview-table-item-name > span { color: #87958e; font-size: 13px; flex: none; }
.preview-table-item-name strong { min-width: 0; overflow: hidden; font-family: ui-monospace,SFMono-Regular,Consolas,monospace; font-size: 12.5px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; }
.preview-table-item-count { grid-area: count; align-self: end; margin-left: 8px; color: #8c9993; font-family: ui-monospace,SFMono-Regular,Consolas,monospace; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.preview-table-item small { grid-area: desc; margin: 4px 0 0 21px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.preview-sidebar-state { display: grid; min-height: 180px; place-items: center; align-content: center; gap: 8px; padding: 24px 18px; color: var(--muted); font-size: 11px; line-height: 1.6; text-align: center; }
.preview-sidebar-state strong { color: var(--ink-soft); font-size: 12px; }
.preview-sidebar-state span { overflow-wrap: anywhere; }
.preview-sidebar-state.is-error,.preview-sidebar-state.is-error strong { color: var(--danger); }
.preview-spinner { width: 18px; height: 18px; border: 2px solid #d6e1dc; border-top-color: var(--brand); border-radius: 50%; animation: previewSpin .7s linear infinite; }
.preview-table-pagination { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 6px 10px; border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 12px; }
.preview-table-pagination button { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink-soft); font-size: 17px; line-height: 1; }
.preview-table-pagination button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.preview-table-pagination button:disabled { cursor: default; opacity: .35; }
.data-preview-main { display: flex; min-width: 0; min-height: 0; flex-direction: column; overflow: hidden; background: var(--surface); }
.preview-empty-state { display: grid; flex: 1; min-height: 430px; place-items: center; align-content: center; gap: 8px; padding: 36px; color: var(--muted); text-align: center; }
.preview-empty-state strong { color: var(--ink-soft); font-size: 14px; }
.preview-empty-state > span:last-child { max-width: 480px; font-size: 11px; line-height: 1.7; }
.preview-empty-state.is-error strong { color: var(--danger); }
.preview-empty-icon { display: grid; width: 46px; height: 46px; margin-bottom: 4px; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: #718179; }
.preview-empty-icon svg { width: 24px; height: 24px; }
.preview-table-content { display: flex; min-width: 0; min-height: 0; flex: 1; flex-direction: column; }
.preview-detail-header { display: flex; min-height: 82px; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.preview-detail-header > div:first-child { min-width: 0; }
.preview-table-title { display: flex; min-width: 0; align-items: center; gap: 9px; color: var(--brand); }
.preview-table-title strong { min-width: 0; overflow: hidden; color: var(--ink); font-family: ui-monospace,SFMono-Regular,Consolas,monospace; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.preview-current-meta { margin-top: 6px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.preview-tabs { display: inline-flex; flex: none; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); }
.preview-tabs button { min-height: 32px; padding: 5px 11px; border-radius: 5px; color: var(--muted); font-size: 13px; }
.preview-tabs button.active { background: var(--surface); color: var(--brand); font-weight: 650; box-shadow: 0 1px 4px rgba(22,38,31,.1); }
.preview-panel { display: flex; min-width: 0; min-height: 0; flex: 1; flex-direction: column; }
.preview-grid-wrap { min-width: 0; min-height: 0; flex: 1; overflow: auto; background: #fbfcfb; scrollbar-gutter: stable; }
.preview-grid { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; }
.preview-grid th { position: sticky; top: 0; z-index: 2; height: 46px; padding: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line-strong); background: #f1f5f3; color: #5f6f67; font-family: ui-monospace,SFMono-Regular,Consolas,monospace; font-size: 13px; font-weight: 650; letter-spacing: 0; text-transform: none; }
.preview-grid td { max-width: 340px; height: 44px; padding: 9px 13px; border-right: 1px solid #e7ede9; border-bottom: 1px solid #e7ede9; background: var(--surface); color: var(--ink-soft); font-family: ui-monospace,SFMono-Regular,Consolas,monospace; font-size: 13px; white-space: nowrap; }
.preview-sort-button { display: flex; width: 100%; min-width: 120px; height: 46px; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px; color: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; text-align: left; }
.preview-sort-button:hover { background: #e6eeea; color: var(--brand-strong); }
.preview-sort-button.active { background: #e2f2ec; color: var(--brand-strong); }
.preview-sort-button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-sort-button i { flex: none; color: #829189; font-family: Inter,"Segoe UI",sans-serif; font-size: 13px; font-style: normal; }
.preview-sort-button.active i { color: var(--brand); font-weight: 800; }
.preview-grid tr:hover td { background: #f5f8f6; }
.preview-cell-value { display: block; max-width: 310px; overflow: hidden; text-overflow: ellipsis; }
.preview-null { color: #9aa69f; font-style: italic; }
.preview-grid-empty { min-width: 320px; padding: 48px 20px; color: var(--muted); font-family: Inter,"Segoe UI",sans-serif; text-align: center; }
.preview-columns-grid { width: 100%; min-width: 760px; }
.preview-columns-grid th { padding: 9px 13px; }
.preview-columns-grid td { max-width: none; white-space: normal; overflow-wrap: anywhere; }
.preview-columns-grid code { color: var(--brand-strong); font-size: 13px; }
.preview-key-badge { display: inline-flex; padding: 2px 6px; border-radius: 4px; background: #fff3df; color: #99600e; font-size: 9px; font-weight: 700; }
.preview-row-pagination { display: flex; min-height: 54px; align-items: center; justify-content: flex-end; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 12px; flex-wrap: nowrap; }
.preview-row-pagination label { display: flex; align-items: center; gap: 5px; margin-right: auto; white-space: nowrap; }
.preview-row-pagination select { height: 30px; padding: 0 22px 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink-soft); }
.preview-row-pagination .btn { min-width: 54px; min-height: 32px; padding: 5px 8px; font-size: 11.5px; white-space: nowrap; }
.preview-row-pagination #previewRowPageInfo { white-space: nowrap; font-size: 11px; }
@keyframes previewSpin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
  .data-preview-workbench { grid-template-columns: 228px minmax(0,1fr); }
}
@media (max-width: 760px) {
  .data-preview-page-header { align-items: stretch !important; }
  .data-preview-page-header .page-actions { justify-content: space-between; }
  .data-preview-workbench { grid-template-columns: 1fr; height: auto; min-height: 0; overflow: visible; }
  .data-preview-sidebar { max-height: 430px; border-right: 0; border-bottom: 1px solid var(--line); }
  .preview-table-list { min-height: 180px; max-height: 250px; }
  .data-preview-main { min-height: 500px; }
  .preview-empty-state { min-height: 500px; }
  .preview-detail-header { align-items: flex-start; flex-direction: column; min-height: 0; padding: 13px; }
  .preview-tabs { width: 100%; }
  .preview-tabs button { flex: 1; }
  .preview-current-meta { white-space: normal; overflow-wrap: anywhere; }
  .preview-grid-wrap { max-height: 500px; }
  .preview-row-pagination { flex-wrap: wrap; justify-content: space-between; }
  .preview-row-pagination label { width: 100%; margin: 0; }
  .preview-row-pagination #previewRowPageInfo { margin-right: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* 任务计划表：固定列宽，避免操作列被挤出视口 */
#view-plans table { table-layout: fixed; width: 100%; min-width: 0; }
#view-plans th, #view-plans td { box-sizing: border-box; }
#view-plans th:nth-child(1), #view-plans td:nth-child(1) { width: auto; }
#view-plans th:nth-child(2), #view-plans td:nth-child(2) { width: 68px; }
#view-plans th:nth-child(3), #view-plans td:nth-child(3) { width: 118px; }
#view-plans th:nth-child(4), #view-plans td:nth-child(4) { width: 112px; }
#view-plans th:nth-child(5), #view-plans td:nth-child(5) { width: 108px; }
#view-plans td:nth-child(1) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#view-plans td:nth-child(5) .btn { width: auto; padding: 5px 8px; font-size: 11px; white-space: nowrap; }
.ts-cell { display: flex; flex-direction: column; gap: 1px; line-height: 1.35; }
.ts-cell .ts-upd { color: var(--muted); font-size: 10.5px; }

/* 运行记录表：7 列固定布局，避免状态与操作列被挤出 */
#view-records table { table-layout: fixed; width: 100%; min-width: 0; }
#view-records th, #view-records td { box-sizing: border-box; }
#view-records th:nth-child(1), #view-records td:nth-child(1) { width: 78px; }
#view-records th:nth-child(2), #view-records td:nth-child(2) { width: auto; }
#view-records th:nth-child(3), #view-records td:nth-child(3) { width: 122px; }
#view-records th:nth-child(4), #view-records td:nth-child(4) { width: 112px; }
#view-records th:nth-child(5), #view-records td:nth-child(5) { width: 74px; font-size: 11.5px; white-space: nowrap; }
#view-records th:nth-child(6), #view-records td:nth-child(6) { width: 56px; }
#view-records th:nth-child(7), #view-records td:nth-child(7) { width: 50px; }
#view-records td:nth-child(1) { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10.5px; color: var(--muted); }
#view-records td:nth-child(2), #view-records td:nth-child(3) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#view-records td:nth-child(7) .btn { width: auto; padding: 5px 8px; font-size: 11px; }

/* 流程仓库表：6 列固定布局，保证状态列可见 */
#view-flows table { table-layout: fixed; width: 100%; min-width: 0; }
#view-flows th, #view-flows td { box-sizing: border-box; }
#view-flows th:nth-child(1), #view-flows td:nth-child(1) { width: auto; }
#view-flows th:nth-child(2), #view-flows td:nth-child(2) { width: 76px; }
#view-flows th:nth-child(3), #view-flows td:nth-child(3) { width: 66px; }
#view-flows th:nth-child(4), #view-flows td:nth-child(4) { width: 72px; }
#view-flows th:nth-child(5), #view-flows td:nth-child(5) { width: 94px; font-size: 11.5px; }
#view-flows th:nth-child(6), #view-flows td:nth-child(6) { width: 76px; }
#view-flows td:nth-child(1) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#view-flows td:nth-child(2), #view-flows td:nth-child(3), #view-flows td:nth-child(4) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#view-flows td:nth-child(6) .badge { white-space: nowrap; }

/* 宽屏：列宽改用百分比，让各列均匀分摊，避免某一列吃掉全部剩余空间 */
@media (min-width: 1300px) {
  #view-records table { width: 100%; max-width: none; margin: 0; }
  #view-records th:nth-child(1), #view-records td:nth-child(1) { width: 8%; }
  #view-records th:nth-child(2), #view-records td:nth-child(2) { width: 26%; }
  #view-records th:nth-child(3), #view-records td:nth-child(3) { width: 18%; }
  #view-records th:nth-child(4), #view-records td:nth-child(4) { width: 17%; }
  #view-records th:nth-child(5), #view-records td:nth-child(5) { width: 10%; }
  #view-records th:nth-child(6), #view-records td:nth-child(6) { width: 11%; }
  #view-records th:nth-child(7), #view-records td:nth-child(7) { width: 10%; }

  #view-plans table { width: 100%; max-width: none; margin: 0; }
  #view-plans th:nth-child(1), #view-plans td:nth-child(1) { width: 34%; }
  #view-plans th:nth-child(2), #view-plans td:nth-child(2) { width: 12%; }
  #view-plans th:nth-child(3), #view-plans td:nth-child(3) { width: 18%; }
  #view-plans th:nth-child(4), #view-plans td:nth-child(4) { width: 20%; }
  #view-plans th:nth-child(5), #view-plans td:nth-child(5) { width: 16%; }

  .alerts-table { width: 100%; max-width: none; margin: 0; }
  .alerts-table th:nth-child(1) { width: 11%; }
  .alerts-table th:nth-child(2) { width: 19%; }
  .alerts-table th:nth-child(3) { width: 36%; }
  .alerts-table th:nth-child(4) { width: 15%; }
  .alerts-table th:nth-child(5) { width: 19%; }
  .alerts-table .event-actions { flex-direction: row; }
  .alerts-table .event-actions .btn { width: auto; padding: 4px 10px; font-size: 11px; }

  #view-flows table { width: 100%; max-width: none; margin: 0; }
  #view-flows th:nth-child(1), #view-flows td:nth-child(1) { width: 38%; }
  #view-flows th:nth-child(2), #view-flows td:nth-child(2) { width: 11%; }
  #view-flows th:nth-child(3), #view-flows td:nth-child(3) { width: 10%; }
  #view-flows th:nth-child(4), #view-flows td:nth-child(4) { width: 12%; }
  #view-flows th:nth-child(5), #view-flows td:nth-child(5) { width: 15%; }
  #view-flows th:nth-child(6), #view-flows td:nth-child(6) { width: 14%; }
}

/* 自定义日期选择器：替换原生 input[type=date] 的日历弹层 */
.dp-wrap { position: relative; display: inline-flex; align-items: center; }
.dp-wrap > input[type="date"] { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; margin: 0; opacity: 0; pointer-events: none; }
.dp-trigger {
  display: inline-flex; align-items: center; gap: 7px; min-width: 126px;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); font-size: 13px; line-height: 1.3;
  cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease;
}
.dp-trigger:hover { border-color: var(--line-strong); }
.dp-trigger.is-empty { color: var(--muted); }
.dp-trigger.is-active { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(20, 125, 100, .12); }
.dp-icon { width: 14px; height: 14px; flex: none; color: var(--muted); }
.dp-text { font-variant-numeric: tabular-nums; white-space: nowrap; }
.dp-popover {
  position: absolute; z-index: 1300; width: 292px; padding: 12px 12px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-md);
}
.dp-popover[hidden] { display: none; }
.dp-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.dp-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.dp-nav {
  width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 7px; background: transparent; color: var(--ink-soft);
  font-size: 16px; line-height: 1; cursor: pointer;
}
.dp-nav:hover { background: var(--surface-muted); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-week { padding: 2px 0 4px; text-align: center; font-size: 11px; color: var(--muted); }
.dp-day {
  height: 30px; border: 0; border-radius: 7px; background: transparent;
  color: var(--ink); font-size: 12.5px; font-variant-numeric: tabular-nums; cursor: pointer;
}
.dp-day:hover { background: var(--brand-soft); }
.dp-day.is-other { color: #b7c2bc; cursor: default; }
.dp-day.is-other:hover { background: transparent; }
.dp-day.is-today { box-shadow: inset 0 0 0 1px var(--brand); color: var(--brand-strong); font-weight: 600; }
.dp-day.is-selected { background: var(--brand); color: #fff; font-weight: 600; }
.dp-day.is-selected:hover { background: var(--brand-strong); }
.dp-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.dp-foot button { border: 0; background: transparent; color: var(--brand); font-size: 12px; padding: 2px 6px; border-radius: 6px; cursor: pointer; }
.dp-foot button:hover { background: var(--brand-soft); }

/* Dataphin 补数：相近节点候选 */
.dp-cand-list { display: flex; flex-direction: column; gap: 6px; }
.dp-cand-item {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; padding: 8px 12px; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.dp-cand-item:hover {
  border-color: #93c5fd; background: #f5f9ff;
  box-shadow: 0 2px 8px rgba(47, 111, 228, .08);
}
.dp-cand-name {
  font-family: Consolas, "Courier New", monospace; font-size: 12.5px;
  font-weight: 600; color: var(--ink); word-break: break-all;
}
.dp-cand-meta {
  font-size: 11.5px; color: var(--muted); white-space: nowrap; flex: 0 0 auto;
}
/* 数据源测试连接结果 */
#datasourceFormError.ds-test-ok { color: #0f7a55; }
#datasourceFormError.ds-test-fail { color: var(--danger); }

/* Dataphin 表更新清单 */
.dp-table-panel { margin-bottom: 20px; }
.dp-table-body { padding: 0; }
.dp-row-list { max-height: 480px; overflow-y: auto; overscroll-behavior: contain; }
.dp-row { padding: 10px 18px 11px; border-bottom: 1px solid #eef3f1; transition: background-color .15s ease; }
.dp-row:last-child { border-bottom: 0; }
.dp-row:hover { background: #f7fbfe; }
.dp-row.is-bad { background: #fdf6f6; }
.dp-row-head { display: flex; align-items: center; gap: 10px; }
.dp-row-name { min-width: 0; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.dp-row-sub { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 3px; color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.dp-sep { color: #cdd8d3; }
.dp-chip { display: inline-flex; align-items: center; flex: none; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 1.6; }
.dp-chip-success { background: #e9f7f1; color: #0f7a55; }
.dp-chip-failed { background: #fdeeee; color: var(--danger); }
.dp-chip-running, .dp-chip-waiting { background: #eef4ff; color: #2f6fd0; }
.dp-chip-none, .dp-chip-unlinked, .dp-chip-unknown { background: #f2f4f3; color: var(--muted); }
.dp-table-body .empty-note { margin: 0; padding: 14px 18px; }

.dp-date { display: inline-flex; align-items: center; flex: none; margin-left: auto; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; line-height: 1.6; }
.dp-date.is-ok { background: #eef8f3; color: #0f7a55; }
.dp-date.is-lag { background: #fff4e8; color: #b5610b; }
.dp-date.is-muted { background: #f2f4f3; color: var(--muted); font-weight: 500; }
