:root {
  color-scheme: light;
  --page: #f4f7fb;
  --surface: #fff;
  --surface-soft: #f7f9fc;
  --line: #dfe7f1;
  --line-soft: #eaf0f6;
  --ink: #17253b;
  --ink-soft: #42546e;
  --muted: #8795a9;
  --blue: #2879ed;
  --blue-soft: #eaf3ff;
  --green: #20a66a;
  --green-soft: #e7f8f0;
  --red: #df5559;
  --red-soft: #fff2f2;
  --shadow: 0 12px 32px rgba(49, 76, 111, 0.07);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 1120px; background: var(--page); }

body { margin: 0; color: var(--ink); background: var(--page); }

button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 21px 16px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
}

.brand { display: flex; align-items: center; gap: 11px; min-height: 52px; padding: 0 6px; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid #cfe0f6; border-radius: 13px;
  color: var(--blue); background: #eef5ff; font-size: 22px; font-weight: 750;
}
.brand > span:nth-child(2) { display: grid; gap: 3px; }
.brand strong { font-size: 16px; letter-spacing: -.02em; }
.brand small { color: var(--muted); font-size: 10px; }
.brand em {
  margin-left: auto; padding: 5px 8px; border-radius: 999px;
  color: var(--blue); background: var(--blue-soft); font-size: 9px; font-style: normal; font-weight: 700;
}

.nav-label { margin: 32px 8px 14px; color: #9aa7b9; font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.nav { display: grid; gap: 5px; }
.nav-item {
  position: relative; min-height: 60px; display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 12px; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 13px; color: #53647b;
  transition: background 150ms ease, color 150ms ease;
}
.nav-item:hover { color: #235da9; background: #f4f8fe; }
.nav-item.is-active { color: #226ddc; background: #eaf3ff; }
.nav-item.is-active::before {
  content: ""; position: absolute; left: -16px; width: 4px; height: 34px;
  border-radius: 0 4px 4px 0; background: var(--blue);
}
.nav-icon {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 11px; background: #f3f6fa; color: #7789a1;
}
.nav-item.is-active .nav-icon { color: var(--blue); background: white; }
.nav svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-item > span:nth-child(2) { display: grid; gap: 3px; }
.nav-item strong { font-size: 12px; font-weight: 710; }
.nav-item small { color: #9aa8ba; font-size: 9px; }
.nav-item i { font-size: 21px; font-style: normal; }

.side-status {
  position: absolute; left: 22px; right: 22px; bottom: 26px;
  min-height: 66px; display: flex; align-items: center; gap: 10px;
  padding: 12px; border: 1px solid #dbe8f6; border-radius: 13px; background: #f4f8fd;
}
.side-status > span {
  flex: 0 0 auto; width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 50%; color: var(--blue); background: #e3efff; font-weight: 800;
}
.side-status div { display: grid; gap: 3px; }
.side-status strong { color: #36506e; font-size: 10px; }
.side-status small { color: #95a2b3; font-size: 9px; }
.side-status.is-alert { border-color: #f0c8ca; background: var(--red-soft); }
.side-status.is-alert > span { color: var(--red); background: #ffe0e1; }
.side-status.is-alert strong { color: #c9494d; }

.workspace { min-width: 0; }
.topbar {
  height: 65px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 38px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96);
}
.topbar > div:first-child { display: grid; gap: 4px; }
.topbar > div:first-child strong { font-size: 12px; font-weight: 740; }
.topbar > div:first-child small { color: #92a0b2; font-size: 9px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.refresh-button, .alert-pill {
  height: 33px; padding: 0 15px; border: 1px solid #dbe5f0; border-radius: 10px;
  background: white; color: #53647a; font-size: 10px; font-weight: 650; cursor: pointer;
}
.refresh-button:hover { border-color: #aac9ee; color: var(--blue); }
.refresh-button:disabled { opacity: .6; cursor: wait; }
.alert-pill { color: var(--red); border-color: #f1ced0; background: #fff6f6; cursor: default; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--blue); background: var(--blue-soft); font-size: 10px; font-weight: 800; }
.admin-name { font-size: 10px; }

.content { padding: 29px 38px 48px; }
.heading { min-height: 76px; display: flex; align-items: flex-start; justify-content: space-between; }
.heading span { color: var(--blue); font-size: 10px; font-weight: 750; letter-spacing: .1em; }
.heading h1 { margin: 4px 0 0; font-size: 24px; line-height: 1.15; letter-spacing: -.04em; }
.heading p { margin: 7px 0 0; color: #8391a4; font-size: 10px; }

.status-card {
  position: relative; overflow: visible; min-height: 330px;
  border: 1px solid #dbe5f0; border-radius: 17px; background: var(--surface); box-shadow: var(--shadow);
}
.table-toolbar {
  height: 58px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px 0 20px; border-bottom: 1px solid var(--line-soft);
}
.table-toolbar > div:first-child { display: flex; align-items: baseline; gap: 9px; }
.table-toolbar strong { color: #263b59; font-size: 12px; font-weight: 760; }
.table-toolbar small { color: #94a1b2; font-size: 9px; }
.settings-wrap { position: relative; }
.gear-button {
  width: 34px; height: 34px; display: grid; place-items: center; padding: 0;
  border: 1px solid #d8e4f0; border-radius: 10px; background: #f7faff; color: #5d85af; cursor: pointer;
}
.gear-button:hover, .gear-button[aria-expanded="true"] { color: var(--blue); border-color: #b7d2f1; background: #edf5ff; }
.gear-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.column-menu {
  position: absolute; z-index: 20; top: 41px; right: 0; width: 210px;
  padding: 10px; border: 1px solid #dce6f1; border-radius: 12px; background: white;
  box-shadow: 0 14px 35px rgba(34, 57, 86, .15);
}
.column-menu::before { content: "显示字段"; display: block; padding: 3px 7px 8px; color: #8190a5; font-size: 9px; font-weight: 700; }
.column-menu label { display: flex; align-items: center; gap: 9px; padding: 7px; border-radius: 8px; color: #3d506a; font-size: 10px; cursor: pointer; }
.column-menu label:hover { background: #f4f8fd; }
.column-menu input { accent-color: var(--blue); }

.table-scroll { overflow-x: auto; overflow-y: visible; border-radius: 0 0 17px 17px; }
table { width: max-content; min-width: 100%; table-layout: fixed; border-collapse: collapse; }
thead { background: #f6f8fb; }
th {
  position: relative; height: 48px; padding: 0 12px; color: #536681;
  font-size: 11px; font-weight: 760; text-align: center; white-space: nowrap;
  border-bottom: 1px solid var(--line-soft); user-select: none;
}
th[draggable="true"] { cursor: grab; }
th.is-dragging { opacity: .42; }
th.is-drag-target { background: #eaf3ff; }
.resize-handle {
  position: absolute; z-index: 4; top: 50%; right: -4px; width: 9px; height: 26px;
  transform: translateY(-50%); cursor: col-resize;
}
.resize-handle::after {
  content: ""; position: absolute; left: 4px; top: 7px; width: 1px; height: 12px;
  border-radius: 1px; background: #bdc9d8;
}
.resize-handle:hover::after, .resize-handle.is-resizing::after { width: 2px; background: var(--blue); }
td {
  height: 92px; padding: 14px 12px; border-bottom: 1px solid var(--line-soft);
  color: #3a4e69; font-size: 10px; text-align: center; vertical-align: middle;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdff; }
tbody tr.is-warning { background: #fffafa; }
tbody tr.is-warning td:first-child { box-shadow: inset 3px 0 0 var(--red); }

.node-cell, .line-cell { display: flex; align-items: center; gap: 10px; text-align: left; }
.node-badge {
  flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 50%; color: var(--blue); background: #eef5ff; font-size: 16px; font-weight: 720;
}
.node-badge.is-error { color: var(--red); background: #ffe8e8; }
.node-copy { min-width: 0; display: grid; gap: 5px; }
.node-copy strong { overflow: hidden; color: #334966; font-size: 12px; font-weight: 730; text-overflow: ellipsis; white-space: nowrap; }
.node-copy small { color: #91a0b3; font-size: 9px; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.muted { color: #9aa8b9; }

.status-tag { display: inline-flex; align-items: center; justify-content: center; min-width: 62px; min-height: 28px; padding: 0 10px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 10px; font-weight: 720; }
.status-tag.is-error { color: var(--red); background: #ffe8e9; }
.status-tag.is-muted { color: #74849a; background: #edf1f5; }

.metric { display: grid; justify-items: center; gap: 7px; }
.metric strong { color: #465b75; font-size: 10px; font-weight: 710; font-variant-numeric: tabular-nums; }
.progress { width: 70px; height: 5px; overflow: hidden; border-radius: 999px; background: #e8edf3; }
.progress.flow { width: 96px; }
.progress span { display: block; width: var(--progress, 0%); height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2aa86e, #63c493); }
.metric.is-warning strong { color: var(--red); }
.metric.is-warning .progress span { background: linear-gradient(90deg, #d94f54, #ee7b7e); }
.traffic-value { white-space: nowrap; }
.online-count { color: #354b67; font-size: 16px; font-weight: 740; }
.online-count small { margin-left: 3px; color: #8795a8; font-size: 9px; font-weight: 500; }
.days { font-size: 11px; font-weight: 720; white-space: nowrap; }
.days.is-warning { color: var(--red); }

.actions { display: flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; }
.action-button {
  min-width: 72px; height: 30px; padding: 0 10px; border: 1px solid #cfe0f4;
  border-radius: 8px; color: #2874d8; background: #f4f8fd; font-size: 9px; font-weight: 700; cursor: pointer;
}
.action-button:hover { border-color: #9dc2ee; background: #eaf3ff; }
.action-button:disabled { color: #a4afbd; border-color: #e1e7ee; background: #f6f8fa; cursor: not-allowed; }
.path { display: flex; align-items: center; justify-content: center; gap: 5px; flex-wrap: wrap; }
.path span { max-width: 115px; overflow: hidden; padding: 5px 7px; border-radius: 7px; color: #42617f; background: #edf4fb; text-overflow: ellipsis; white-space: nowrap; }
.path i { color: #9dabbc; font-style: normal; }

.empty-state { display: grid; place-items: center; min-height: 270px; padding: 30px; color: #8d9bad; font-size: 11px; text-align: center; }

.form-dialog {
  width: 420px; max-width: calc(100vw - 32px); padding: 0; border: 0; border-radius: 17px;
  color: var(--ink); background: white; box-shadow: 0 26px 70px rgba(28, 49, 76, .24);
}
.form-dialog::backdrop { background: rgba(24, 38, 58, .38); backdrop-filter: blur(2px); }
.form-dialog form { padding: 22px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }
.dialog-heading > div { display: flex; align-items: center; gap: 11px; }
.dialog-heading > div > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--blue); background: var(--blue-soft); font-size: 15px; font-weight: 760; }
.dialog-heading h2 { margin: 0; font-size: 16px; }
.dialog-heading p { margin: 4px 0 0; color: #8a98aa; font-size: 9px; }
#dialog-close { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; color: #8492a4; background: #f4f6f9; font-size: 20px; cursor: pointer; }
.form-dialog label { display: block; margin-bottom: 8px; color: #465a73; font-size: 10px; font-weight: 700; }
.input-wrap { position: relative; }
.input-wrap input { width: 100%; height: 42px; padding: 0 56px 0 13px; border: 1px solid #d8e2ed; border-radius: 9px; outline: none; color: #2f445f; background: #fbfcfe; font-size: 12px; }
.input-wrap input:focus { border-color: #86b7ed; box-shadow: 0 0 0 3px #eaf3ff; }
.input-wrap span { position: absolute; right: 13px; top: 50%; color: #8493a6; font-size: 10px; transform: translateY(-50%); }
.dialog-help { min-height: 16px; margin: 8px 0 0; color: #8b99ab; font-size: 9px; line-height: 1.55; }
.dialog-error { margin: 9px 0 0; padding: 8px 10px; border-radius: 8px; color: #c9474b; background: var(--red-soft); font-size: 9px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 19px; }
.dialog-actions button { min-width: 78px; height: 34px; border-radius: 8px; font-size: 10px; font-weight: 700; cursor: pointer; }
.cancel-button { border: 1px solid #dbe3ec; background: white; }
.save-button { border: 1px solid var(--blue); color: white; background: var(--blue); }
.save-button:disabled { opacity: .55; cursor: wait; }

.toast {
  position: fixed; z-index: 50; left: 50%; bottom: 28px; min-width: 220px; max-width: 420px;
  padding: 12px 16px; border-radius: 10px; color: white; background: #263951;
  box-shadow: 0 12px 32px rgba(23, 37, 56, .24); font-size: 10px; text-align: center; transform: translateX(-50%);
}
.toast.is-error { background: #c9464b; }

@media (max-width: 1360px) {
  .shell { grid-template-columns: 224px minmax(0, 1fr); }
  .sidebar { padding-inline: 13px; }
  .nav-item.is-active::before { left: -13px; }
  .content, .topbar { padding-left: 25px; padding-right: 25px; }
  td, th { padding-left: 9px; padding-right: 9px; }
}
