:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e222b;
  --line: #2a2f3a;
  --fg: #e6e8ec;
  --muted: #8b93a3;
  --accent: #4f9cf9;
  --ok: #3ecf8e;
  --warn: #f5a524;
  --bad: #f04f5b;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 14px/1.6 "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 导航 ---------- */
.nav {
  display: flex; align-items: center; gap: 18px;
  padding: 0 22px; height: 54px;
  background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.nav a { color: var(--muted); font-size: 14px; padding: 4px 2px; }
.nav a:hover { color: var(--fg); text-decoration: none; }
.nav a.on { color: var(--fg); box-shadow: inset 0 -2px 0 var(--accent); }
.nav .brand { color: var(--fg); font-weight: 600; font-size: 16px; margin-right: 10px; }
.nav .spacer { flex: 1; }
.nav .muted { color: #6b7280; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 22px 60px; }
h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 0 0 12px; color: var(--fg); }
.sub { color: var(--muted); margin: 0 0 22px; font-size: 13px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin-bottom: 18px;
}
.grid { display: grid; gap: 16px; }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) {
  .grid.c4 { grid-template-columns: repeat(2, 1fr); }
  .grid.c3, .grid.c2 { grid-template-columns: 1fr; }
}

.stat { background: var(--panel); border: 1px solid var(--line);
        border-radius: var(--radius); padding: 16px 18px; }
.stat .k { color: var(--muted); font-size: 12px; letter-spacing: .3px; }
.stat .v { font-size: 28px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 13px; color: var(--muted); font-weight: 400; }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; font-size: 12px; white-space: nowrap; }
tbody tr:hover { background: var(--panel-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }

/* ---------- 徽标 ---------- */
.tag {
  display: inline-block; padding: 1px 7px; border-radius: 20px;
  font-size: 11px; background: var(--panel-2); color: var(--muted);
  border: 1px solid var(--line); white-space: nowrap;
}
.tag.ok  { color: var(--ok);   border-color: #1d4d38; background: #12251c; }
.tag.bad { color: var(--bad);  border-color: #542328; background: #26161a; }
.tag.warn{ color: var(--warn); border-color: #55401a; background: #241d10; }
.lat-fast { color: var(--ok); }
.lat-mid  { color: var(--warn); }
.lat-slow { color: var(--bad); }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Consolas, "Cascadia Mono", monospace; }
.ellip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 控件 ---------- */
button, .btn {
  background: var(--panel-2); color: var(--fg); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer;
  font-family: inherit;
}
button:hover, .btn:hover { border-color: #3d4353; background: #262b36; text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #04121f; font-weight: 600; }
button.primary:hover { background: #6badfa; }
button.danger { color: var(--bad); border-color: #4a2228; }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea {
  background: #12151b; color: var(--fg); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit;
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 76px; }
label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 5px; }
.field { margin-bottom: 14px; }
.field .hint { font-size: 12px; color: #6b7280; margin-top: 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.flash.ok    { background: #12251c; border: 1px solid #1d4d38; color: var(--ok); }
.flash.error { background: #26161a; border: 1px solid #542328; color: var(--bad); }

/* ---------- 订阅链接框 ---------- */
.sublink {
  display: flex; gap: 8px; align-items: stretch; margin-bottom: 10px;
}
.sublink code {
  flex: 1; background: #0b0d11; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font-size: 12.5px; overflow-x: auto; white-space: nowrap;
  font-family: ui-monospace, Consolas, monospace; color: #9fd0ff;
}
.sublink button { white-space: nowrap; }
.ok-flash { color: var(--ok) !important; border-color: #1d4d38 !important; }

/* ---------- 条形图 ---------- */
.bar { height: 6px; background: var(--panel-2); border-radius: 4px; overflow: hidden; min-width: 60px; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 46px; }
.spark > i { flex: 1; background: #2b4a72; border-radius: 2px 2px 0 0; min-height: 2px; }
.spark > i:last-child { background: var(--accent); }

/* ---------- 分页 ---------- */
.pager { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 18px; }
.pager a, .pager span {
  padding: 5px 11px; border: 1px solid var(--line); border-radius: 7px;
  color: var(--muted); font-size: 13px;
}
.pager .cur { background: var(--panel-2); color: var(--fg); border-color: #3a4152; }

/* ---------- 公开页 ---------- */
.hero { text-align: center; padding: 44px 0 26px; }
.hero h1 { font-size: 30px; margin-bottom: 10px; }
.hero .live {
  display: inline-flex; align-items: center; gap: 8px; color: var(--ok);
  background: #12251c; border: 1px solid #1d4d38; border-radius: 20px;
  padding: 5px 14px; font-size: 13px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
       box-shadow: 0 0 0 0 rgba(62,207,142,.6); animation: pulse 2s infinite; }
@keyframes pulse {
  70% { box-shadow: 0 0 0 7px rgba(62,207,142,0); }
  100% { box-shadow: 0 0 0 0 rgba(62,207,142,0); }
}
.notice { white-space: pre-wrap; color: var(--muted); font-size: 13px; line-height: 1.8; }
.steps { counter-reset: s; padding-left: 0; list-style: none; }
.steps li { counter-increment: s; padding: 7px 0 7px 30px; position: relative; color: var(--muted); }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 8px;
  width: 20px; height: 20px; border-radius: 50%; background: var(--panel-2);
  border: 1px solid var(--line); color: var(--fg);
  font-size: 11px; display: grid; place-items: center;
}
.foot { text-align: center; color: #5a616f; font-size: 12px; padding: 30px 0 10px; }

/* ---------- 登录 ---------- */
.login-box { max-width: 340px; margin: 14vh auto; }
.login-box h1 { text-align: center; margin-bottom: 22px; }
.or { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.or span { color: var(--muted); font-size: 12px; }
