:root {
  --canvas: #f4f6f8;
  --surface: #ffffff;
  --sidebar: #172331;
  --sidebar-active: #293d51;
  --text: #1e2c3b;
  --muted: #596878;
  --border: #dce2e8;
  --accent: #12665f;
  --accent-soft: #e8f4f1;
  --warning: #765313;
  --warning-soft: #fff7e7;
  --danger: #a62935;
  --danger-soft: #fff0f1;
  --radius: 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--canvas);
  font-size: 14px;
  line-height: 1.6;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #2b8fbd; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; font-weight: 650; line-height: 1.3; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -100px; z-index: 100; color: var(--text); background: white; padding: 12px 16px; border: 2px solid var(--accent); border-radius: var(--radius); }
.skip-link:focus { top: 16px; }
.app-shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 16px 20px; color: #f2f6fa; background: var(--sidebar); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #4d7376; border-radius: var(--radius); color: #a2e4d8; font-weight: 750; font-size: 22px; }
.brand strong { font-size: 15px; font-weight: 650; white-space: nowrap; }
.brand div > span { display: block; color: #bac6d2; font-size: 12px; }
.navigation { display: grid; gap: 4px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 0; border-radius: var(--radius); color: #c8d3dd; background: transparent; text-align: left; }
.nav-item > span { width: 20px; text-align: center; font-size: 17px; }
.nav-item:hover { background: #223345; color: white; }
.nav-item.active { color: white; background: var(--sidebar-active); box-shadow: inset 3px 0 #82d0c2; }
.sidebar-footer { margin-top: auto; padding: 24px 8px 0; color: #b6c4d1; font-size: 12px; }
.stage-label { display: inline-block; padding: 2px 8px; margin-bottom: 8px; border: 1px solid #586775; border-radius: 4px; color: #dae3eb; }
main { min-width: 0; padding: 32px; }
.page-header { display: flex; justify-content: space-between; gap: 24px; align-items: center; margin-bottom: 24px; }
.eyebrow { margin-bottom: 4px; font-size: 12px; color: var(--muted); }
.page-description { margin-top: 8px; color: var(--muted); }
.header-actions, .toolbar-buttons { display: flex; align-items: center; gap: 12px; }
.button { min-height: 36px; padding: 6px 14px; border: 1px solid transparent; border-radius: var(--radius); white-space: nowrap; font-weight: 550; }
.button.secondary { background: var(--surface); border-color: #c7d0d8; color: var(--text); }
.button.secondary:hover:enabled { border-color: var(--accent); color: var(--accent); }
.button.primary { background: var(--accent); color: white; }
.button:disabled { background: #edf0f3; color: #71808e; border-color: #dce2e8; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; color: var(--muted); background: #e8edf1; border-radius: 4px; font-size: 12px; white-space: nowrap; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pill.connected { color: var(--accent); background: var(--accent-soft); }
.status-pill.failed { color: var(--danger); background: var(--danger-soft); }
.notice { display: flex; align-items: baseline; gap: 16px; padding: 12px 16px; color: var(--warning); background: var(--warning-soft); border: 1px solid #eedbbb; border-left: 3px solid #c19341; border-radius: var(--radius); }
.notice strong { white-space: nowrap; }
.load-summary { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: 12px 0 20px; color: var(--muted); font-size: 12px; }
.load-summary.has-error { color: var(--danger); }
.load-summary > span { white-space: nowrap; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.metric { padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.metric > span { color: var(--muted); font-size: 13px; }
.metric > strong { display: block; margin: 8px 0 4px; font-size: 30px; line-height: 1.3; font-weight: 650; font-variant-numeric: tabular-nums; }
.metric > p { font-size: 12px; color: var(--muted); }
.overview-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.panel-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.caption { font-size: 12px; color: var(--muted); }
.facts, .settings-facts { margin: 0; padding: 0 20px; }
.facts > div, .settings-facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding: 12px 0; border-bottom: 1px solid #edf0f3; }
.facts > div:last-child, .settings-facts > div:last-child { border-bottom: 0; }
dt { color: var(--muted); }
dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.rules { margin: 0; padding: 16px 20px 16px 36px; color: var(--muted); }
.rules li + li { margin-top: 8px; }
.capability-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 4px 20px; gap: 0 24px; }
.capability { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid #edf0f3; }
.capability > span:last-child { color: var(--muted); font-size: 12px; }
.capability > span.is-enabled { color: var(--accent); }
.muted { color: var(--muted); padding: 12px 0; }
.section-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.count-label { margin-left: 8px; color: var(--muted); font-size: 12px; font-weight: 400; }
.form-preview { display: flex; align-items: end; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.form-preview label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.form-preview input, .form-preview select { width: 240px; min-height: 36px; padding: 6px 10px; border: 1px solid #d3dae1; border-radius: var(--radius); background: #eef1f4; color: #71808e; }
.form-preview select { width: 160px; }
.form-preview .wide-field { flex: 1; min-width: 240px; }
.wide-field input { width: 100%; }
.control-note { color: var(--muted); font-size: 12px; padding-bottom: 8px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; min-width: 680px; border-collapse: collapse; text-align: left; }
th { padding: 12px 16px; font-size: 12px; font-weight: 600; color: var(--muted); background: #f9fafb; white-space: nowrap; border-bottom: 1px solid var(--border); }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: 0; }
.empty-state { padding: 52px 20px; text-align: center; }
.empty-state strong { font-size: 14px; font-weight: 550; }
.empty-state p { margin-top: 8px; color: var(--muted); font-size: 12px; }
.helper-panel { margin-top: 20px; padding: 16px 20px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); background: #eef2f5; }
.helper-panel h3 { margin-bottom: 8px; color: var(--text); }
.helper-panel p + p { margin-top: 8px; }
code { font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; color: var(--text); overflow-wrap: anywhere; }
.helper-panel > code { display: block; margin: 4px 0; }
.helper-panel > code + p { margin-top: 8px; }
.rule-banner { margin-bottom: 20px; padding: 12px 16px; border: 1px solid #c7dfd9; border-left: 3px solid var(--accent); border-radius: var(--radius); background: var(--accent-soft); }
.rule-banner strong { color: var(--accent); }
.rule-banner p { margin-top: 4px; color: #3f625e; }
.settings-facts > div { min-height: 48px; }
.settings-facts dt { flex: 0 1 45%; }
.main-footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
@media (min-width: 1600px) { main { max-width: 1440px; width: 100%; margin: 0 auto; padding: 40px; } }
@media (max-width: 1100px) { .app-shell { grid-template-columns: 188px minmax(0, 1fr); } main { padding: 24px; } .metrics { gap: 12px; } .metric { padding: 16px; } .overview-columns { grid-template-columns: 1fr; } .capability-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .page-header { align-items: start; } .header-actions { flex-direction: column; align-items: end; gap: 8px; } }
@media (max-width: 760px) { .app-shell { display: block; } .sidebar { position: static; height: auto; padding: 16px; } .brand { padding: 0 0 16px; } .navigation { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; } .nav-item { justify-content: center; gap: 8px; padding: 10px 4px; font-size: 12px; } .nav-item.active { box-shadow: inset 0 -3px #82d0c2; } .nav-item > span { font-size: 15px; width: 16px; } .sidebar-footer { display: none; } main { padding: 20px 16px; } .page-header { gap: 12px; margin-bottom: 20px; } h1 { font-size: 24px; } .page-description { font-size: 12px; } .notice { display: block; } .notice strong { display: block; margin-bottom: 4px; } .load-summary { display: block; } .load-summary > span { display: block; margin-top: 4px; } .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } .main-footer { flex-direction: column; gap: 4px; } .form-preview { align-items: start; } .form-preview label, .form-preview input, .form-preview select { width: 100%; } .control-note { padding-bottom: 0; } }
@media (max-width: 380px) { .nav-item { gap: 4px; } .nav-item > span { display: none; } .page-header { display: block; } .header-actions { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-top: 16px; } .capability-grid { grid-template-columns: 1fr; } .panel-heading { padding: 14px 16px; } .facts, .settings-facts { padding: 0 16px; } .toolbar-buttons { gap: 8px; flex-wrap: wrap; } }

.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 460px; padding: 32px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.auth-brand { padding: 0 0 24px; }
.auth-brand .brand-mark { color: var(--accent); border-color: var(--accent); }
.auth-brand div > span { color: var(--muted); }
.auth-card h1 { font-size: 24px; }
.auth-card > .caption { margin-top: 16px; }
.login-link { display: inline-block; text-align: center; text-decoration: none; }
.form-stack { display: grid; gap: 16px; }
.form-stack label, .settings-grid label { display: grid; gap: 6px; font-size: 13px; }
.form-stack input, .form-stack textarea, .form-stack select, .settings-grid input, .search-form input { width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid #bcc8d3; border-radius: var(--radius); color: var(--text); background: var(--surface); }
textarea { resize: vertical; }
input[type="checkbox"] { width: 16px; height: 16px; min-height: auto; accent-color: var(--accent); }
.form-stack .checkbox-field, .settings-grid .checkbox-field { display: flex; align-items: center; gap: 12px; }
.checkbox-field input { order: -1; }
.field-help { color: var(--muted); font-size: 12px; font-weight: 400; }
.form-error { padding: 10px 12px; color: var(--danger); background: var(--danger-soft); border: 1px solid #edc5ca; border-radius: var(--radius); overflow-wrap: anywhere; }
.sidebar-button { margin-top: 12px; color: #eef4f8; background: transparent; border-color: #607284; }
.sidebar-button:hover { background: var(--sidebar-active); }
.auto-refresh-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.search-form { display: flex; gap: 12px; align-items: end; margin-bottom: 16px; }
.search-form label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; width: min(100%, 420px); }
.cell-secondary { color: var(--muted); font-size: 12px; margin-top: 4px; overflow-wrap: anywhere; }
td { vertical-align: top; overflow-wrap: anywhere; }
.text-cell { max-width: 300px; min-width: 180px; }
.text-cell > div { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.id-cell { max-width: 180px; font-family: Consolas, monospace; font-size: 12px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; min-width: 150px; }
.button.small { padding: 3px 8px; min-height: 30px; font-size: 12px; }
.button.danger { color: var(--danger); background: var(--surface); border-color: #e2bbc1; }
.button.danger:hover { background: var(--danger-soft); }
.pagination { display: flex; align-items: center; justify-content: end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.pagination > span { margin-right: auto; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; padding: 24px; }
.settings-caption { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.form-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: end; align-items: center; gap: 16px; }
.form-footer .form-error { flex: 1; }
dialog { width: min(640px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 0; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); background: var(--surface); }
dialog::backdrop { background: rgba(16, 28, 40, .48); }
.dialog-form { padding: 20px 24px; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.dialog-heading h2 { font-size: 18px; }
.icon-button { padding: 2px 12px; color: var(--muted); background: transparent; font-size: 24px; }
.dialog-footer { display: flex; justify-content: end; gap: 12px; margin-top: 24px; }
.dialog-form > .form-error { margin-top: 16px; }
.confirm-value { padding: 12px; background: var(--canvas); border: 1px solid var(--border); border-radius: var(--radius); white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-facts { margin: 0; }
.detail-facts > div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.detail-facts dd { text-align: left; white-space: pre-wrap; }
.import-results { max-height: 360px; overflow: auto; }
.import-results p { padding: 8px 0; border-bottom: 1px solid var(--border); }
.batch-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 0 0 12px; }
.selection-count { color: var(--muted); font-size: 12px; min-width: 80px; font-variant-numeric: tabular-nums; }
.batch-toolbar label { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 12px; color: var(--muted); }
.batch-toolbar select { min-height: 34px; width: 136px; padding: 5px 8px; background: var(--surface); color: var(--text); border: 1px solid #bcc8d3; border-radius: var(--radius); }
.selection-cell { width: 44px; min-width: 44px; padding: 14px 12px; text-align: center; vertical-align: middle; }
.selection-cell input { display: block; margin: 0 auto; cursor: pointer; }
.selected-row { background: #edf7f3; }
.batch-preview { max-height: 240px; overflow: auto; }
.batch-summary { padding-bottom: 12px; font-size: 13px; font-variant-numeric: tabular-nums; }
.batch-results { max-height: 360px; overflow: auto; margin-bottom: 16px; }
.batch-result { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.batch-result strong { font-size: 13px; font-weight: 550; overflow-wrap: anywhere; }
.batch-result p { grid-column: 1 / -1; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.batch-result-state { font-size: 12px; white-space: nowrap; }
.batch-result.succeeded .batch-result-state { color: var(--accent); }
.batch-result.failed .batch-result-state { color: var(--danger); }
.batch-result.unknown .batch-result-state { color: var(--warning); }
.toast { position: fixed; z-index: 200; bottom: 24px; left: 50%; transform: translateX(-50%); max-width: min(600px, calc(100% - 32px)); padding: 12px 20px; border: 1px solid #b8d7cf; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); box-shadow: 0 4px 16px #15263322; overflow-wrap: anywhere; }
.toast.failed { color: var(--danger); background: var(--danger-soft); border-color: #edc5ca; }
@media (max-width: 760px) { .sidebar-footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 0 0; gap: 12px; } .sidebar-button { margin: 0; font-size: 12px; min-height: 30px; } .settings-grid { grid-template-columns: 1fr; padding: 20px 16px; } .form-footer { padding: 16px; flex-wrap: wrap; } .form-footer .form-error { flex-basis: 100%; } .header-actions { flex-wrap: wrap; } .pagination { flex-wrap: wrap; } .pagination > span { flex-basis: 100%; } .auth-card { padding: 24px; } .detail-facts > div { grid-template-columns: 100px minmax(0, 1fr); } .dialog-form { padding: 16px; } }
@media (max-width: 380px) { .auth-screen { padding: 16px; } .auth-card { padding: 20px; } .search-form { flex-wrap: wrap; } .search-form label { width: 100%; } }
@media (max-width: 760px) { .batch-toolbar { gap: 8px; } .batch-toolbar label { margin-left: 0; } .batch-toolbar select { width: 124px; } }
