:root {
  --ink: #10223e;
  --ink-2: #40516a;
  --muted: #728096;
  --line: #dfe6f1;
  --canvas: #f4f7fb;
  --surface: #ffffff;
  --blue: #2f6bff;
  --blue-soft: #edf3ff;
  --cyan: #34c7e8;
  --mint: #21b982;
  --mint-soft: #e9f9f3;
  --amber: #e99a2f;
  --amber-soft: #fff5e5;
  --danger: #e85252;
  --danger-soft: #fff0f0;
  --nav: #11233f;
  --shadow: 0 18px 48px rgba(31, 55, 91, .10);
  --radius: 18px;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.is-hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { color: var(--blue); font: 700 11px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .16em; }

.brand-mark { width: 38px; height: 38px; position: relative; border-radius: 12px; background: linear-gradient(145deg, var(--blue), #2559db); box-shadow: 0 8px 20px rgba(47,107,255,.28); overflow: hidden; }
.brand-mark span { position: absolute; display: block; background: rgba(255,255,255,.94); border-radius: 999px; transform: rotate(-28deg); }
.brand-mark span:nth-child(1) { width: 21px; height: 4px; left: 8px; top: 10px; }
.brand-mark span:nth-child(2) { width: 16px; height: 4px; left: 10px; top: 17px; }
.brand-mark span:nth-child(3) { width: 10px; height: 4px; left: 12px; top: 24px; }
.brand-mark--large { width: 58px; height: 58px; border-radius: 18px; }
.brand-mark--large span:nth-child(1) { width: 31px; height: 6px; left: 12px; top: 15px; }
.brand-mark--large span:nth-child(2) { width: 24px; height: 6px; left: 15px; top: 25px; }
.brand-mark--large span:nth-child(3) { width: 15px; height: 6px; left: 18px; top: 36px; }

.login-stage { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 44%) 1fr; background: var(--surface); }
.login-rail { position: relative; padding: 72px clamp(42px, 7vw, 110px); color: white; overflow: hidden; background: var(--nav); display: flex; flex-direction: column; justify-content: center; }
.login-rail::before { content: ""; position: absolute; width: 520px; height: 520px; border: 1px solid rgba(83,153,255,.16); border-radius: 50%; left: -250px; top: -210px; box-shadow: 0 0 0 70px rgba(83,153,255,.035), 0 0 0 140px rgba(83,153,255,.025); }
.login-rail > * { position: relative; z-index: 1; }
.route-line { margin: 62px 0 42px; }
.route-node { display: grid; grid-template-columns: 14px 1fr; gap: 2px 18px; align-items: center; color: #aebbd0; }
.route-node i { grid-row: 1 / span 2; width: 14px; height: 14px; border-radius: 50%; background: #63738c; box-shadow: 0 0 0 7px rgba(255,255,255,.04); }
.route-node b { color: white; font-size: 17px; }
.route-node small { font-size: 12px; letter-spacing: .04em; }
.route-node.is-live i { background: var(--mint); box-shadow: 0 0 0 7px rgba(33,185,130,.12), 0 0 22px rgba(33,185,130,.5); }
.route-link { width: 1px; height: 62px; background: linear-gradient(var(--mint), #63738c); margin-left: 6px; }
.login-rail p { color: #aebbd0; line-height: 1.9; max-width: 440px; }
.login-panel { display: grid; place-items: center; padding: 56px 28px; background: radial-gradient(circle at 80% 10%, #eef4ff, transparent 34%), var(--surface); }
.login-card { width: min(430px, 100%); }
.brand-inline { display: flex; gap: 12px; align-items: center; margin-bottom: 54px; }
.brand-inline strong { font-size: 23px; letter-spacing: -.04em; }
.login-card h1 { margin: 10px 0 10px; font-size: clamp(30px, 4vw, 42px); letter-spacing: -.055em; }
.login-card > .muted { margin: 0 0 34px; line-height: 1.8; }
.field { display: grid; gap: 9px; margin-bottom: 18px; }
.field > span { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); background: #fbfcfe; border-radius: 12px; min-height: 46px; padding: 11px 13px; color: var(--ink); outline: none; transition: .18s ease; }
.field textarea { min-height: 104px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); background: white; box-shadow: 0 0 0 4px rgba(47,107,255,.10); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-error { min-height: 24px; color: var(--danger); font-size: 13px; padding-top: 12px; }

.button { border: 0; border-radius: 11px; min-height: 40px; padding: 0 16px; font-weight: 700; color: var(--ink-2); background: #eef2f7; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible, .nav-list button:focus-visible, .icon-button:focus-visible { outline: 3px solid rgba(47,107,255,.28); outline-offset: 2px; }
.button--primary { color: white; background: var(--blue); box-shadow: 0 10px 24px rgba(47,107,255,.22); }
.button--soft { color: var(--blue); background: var(--blue-soft); }
.button--danger { color: var(--danger); background: var(--danger-soft); }
.button--ghost { color: var(--ink-2); background: transparent; border: 1px solid var(--line); }
.button--block { width: 100%; min-height: 48px; margin-top: 8px; }
.button--small { min-height: 32px; padding: 0 11px; border-radius: 9px; font-size: 12px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--nav); color: white; padding: 24px 18px; display: flex; flex-direction: column; z-index: 20; }
.sidebar-brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 24px; }
.sidebar-brand strong { display: block; font-size: 20px; }
.sidebar-brand small { display: block; color: #8fa0ba; margin-top: 3px; font-size: 11px; }
.line-badge { margin: 0 4px 25px; padding: 13px 14px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.035); border-radius: 14px; display: flex; gap: 11px; align-items: center; }
.line-badge i { width: 9px; height: 9px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 12px rgba(33,185,130,.9); }
.line-badge b, .line-badge small { display: block; }
.line-badge b { font-size: 12px; }
.line-badge small { color: #8fa0ba; margin-top: 3px; font-size: 10px; }
.nav-list { display: grid; gap: 6px; }
.nav-list button { min-height: 45px; border: 0; border-radius: 11px; padding: 0 13px; background: transparent; color: #aebbd0; text-align: left; font-weight: 700; display: flex; align-items: center; gap: 12px; }
.nav-list button span { width: 20px; color: #7f91ab; font: 700 18px/1 ui-monospace, monospace; text-align: center; }
.nav-list button:hover { color: white; background: rgba(255,255,255,.05); }
.nav-list button.is-active { color: white; background: linear-gradient(90deg, rgba(47,107,255,.28), rgba(47,107,255,.08)); box-shadow: inset 3px 0 var(--blue); }
.nav-list button.is-active span { color: #7ea4ff; }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); padding: 18px 8px 0; display: grid; gap: 12px; }
.sidebar-foot small { color: #71839e; line-height: 1.5; }
.sidebar-foot button { border: 0; background: none; color: #aebbd0; padding: 0; text-align: left; }

.workspace { min-width: 0; }
.topbar { height: 92px; padding: 0 clamp(22px, 3vw, 44px); background: rgba(244,247,251,.90); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; }
.topbar h2 { font-size: 23px; margin: 5px 0 0; letter-spacing: -.03em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.server-time { color: var(--muted); font: 12px/1 ui-monospace, Consolas, monospace; }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: white; background: var(--ink); font-weight: 800; }
.page-content { padding: 28px clamp(22px, 3vw, 44px) 54px; outline: none; }
.section-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; margin-bottom: 18px; }
.section-head h3 { margin: 0; font-size: 19px; letter-spacing: -.03em; }
.section-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 21px; min-height: 142px; box-shadow: 0 8px 24px rgba(31,55,91,.045); position: relative; overflow: hidden; }
.metric::after { content: ""; position: absolute; width: 70px; height: 70px; border-radius: 50%; right: -24px; top: -25px; background: var(--metric-soft, var(--blue-soft)); }
.metric-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.metric-value { margin-top: 16px; font: 750 34px/1 Arial, "Microsoft YaHei UI", sans-serif; letter-spacing: -.045em; }
.metric-note { margin-top: 13px; color: var(--muted); font-size: 11px; }
.metric--mint { --metric-soft: var(--mint-soft); }
.metric--amber { --metric-soft: var(--amber-soft); }
.metric--cyan { --metric-soft: #e9faff; }
.panel-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr); gap: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(31,55,91,.04); overflow: hidden; }
.panel-head { padding: 19px 21px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.panel-head h3 { margin: 0; font-size: 15px; }
.panel-body { padding: 20px; }
.pulse-list { display: grid; gap: 14px; }
.pulse-row { display: grid; grid-template-columns: 80px 1fr 34px; gap: 12px; align-items: center; font-size: 12px; }
.pulse-row b { font: 700 12px ui-monospace, Consolas, monospace; }
.pulse-bar { height: 7px; background: #edf1f6; border-radius: 20px; overflow: hidden; }
.pulse-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.status-note { border-radius: 14px; padding: 15px; background: var(--mint-soft); color: #18785b; font-size: 12px; line-height: 1.75; }
.status-note.is-warning { color: #9a6119; background: var(--amber-soft); }

.data-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 8px 24px rgba(31,55,91,.04); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th, td { padding: 14px 16px; border-bottom: 1px solid #edf1f6; text-align: left; font-size: 13px; white-space: nowrap; }
th { background: #f8fafd; color: var(--muted); font-size: 11px; letter-spacing: .04em; }
tbody tr:hover { background: #fbfcff; }
tbody tr:last-child td { border-bottom: 0; }
.cell-main { font-weight: 700; color: var(--ink); }
.cell-sub { color: var(--muted); font-size: 11px; margin-top: 4px; }
.tag { display: inline-flex; min-height: 25px; padding: 0 9px; align-items: center; border-radius: 999px; background: #eef2f7; color: var(--ink-2); font-size: 11px; font-weight: 700; }
.tag--green { color: #167454; background: var(--mint-soft); }
.tag--red { color: #b83d3d; background: var(--danger-soft); }
.tag--blue { color: #285edb; background: var(--blue-soft); }
.tag--amber { color: #986019; background: var(--amber-soft); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #98a6b8; margin-right: 7px; }
.dot.is-online { background: var(--mint); box-shadow: 0 0 0 4px rgba(33,185,130,.10); }
.empty { padding: 62px 20px; text-align: center; color: var(--muted); }
.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.search { min-width: 260px; min-height: 40px; padding: 0 13px; background: white; border: 1px solid var(--line); border-radius: 11px; outline: none; }
.search:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(47,107,255,.08); }
.pagination { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 16px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(10,25,49,.46); backdrop-filter: blur(5px); display: grid; place-items: center; padding: 24px; }
.modal { width: min(620px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: white; border-radius: 20px; box-shadow: 0 28px 90px rgba(7,22,47,.28); }
.modal-head { padding: 22px 24px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; font-size: 19px; }
.modal-body { padding: 22px 24px; }
.modal-actions { padding: 16px 24px 22px; display: flex; justify-content: flex-end; gap: 9px; }
.icon-button { border: 0; background: transparent; color: var(--muted); width: 36px; height: 36px; border-radius: 10px; }
.icon-button:hover { background: #eef2f7; }
.checkbox { display: flex; gap: 9px; align-items: center; color: var(--ink-2); font-size: 13px; margin: 6px 0 16px; }
.checkbox input { width: 17px; height: 17px; accent-color: var(--blue); }
.help { margin-top: -7px; margin-bottom: 15px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.toast-root { position: fixed; z-index: 200; right: 24px; bottom: 24px; display: grid; gap: 10px; }
.toast { max-width: 380px; padding: 13px 16px; color: white; background: var(--ink); border-radius: 12px; box-shadow: var(--shadow); font-size: 13px; animation: toast-in .22s ease both; }
.toast.is-error { background: #bb4242; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.mobile-only { display: none; }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .login-stage { grid-template-columns: 1fr; }
  .login-rail { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -270px; width: 248px; transition: left .2s ease; box-shadow: 18px 0 50px rgba(9,25,48,.25); }
  .sidebar.is-open { left: 0; }
  .mobile-only { display: inline-grid; place-items: center; }
  .topbar { padding: 0 16px; gap: 10px; }
  .topbar-actions .server-time { display: none; }
  .topbar-actions .button { display: none; }
  .page-content { padding: 20px 14px 44px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric { min-height: 122px; padding: 17px; }
  .metric-value { font-size: 27px; }
  .toolbar, .section-head { align-items: stretch; flex-direction: column; }
  .search { min-width: 0; width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 430px) {
  .metric-grid { grid-template-columns: 1fr; }
  .topbar h2 { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
