:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel2: #1c2330;
  --line: #262d38;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #2f81f7;
  --green: #3fb950;
  --red: #f85149;
  --warn: #d29922;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 0 20px; height: 56px;
  background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: baseline; gap: 8px; }
.logo {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  background: var(--accent); color: #fff; font-weight: 700; letter-spacing: .5px;
}
.brand .sub { color: var(--muted); font-size: 13px; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a {
  padding: 6px 14px; border-radius: 6px; color: var(--muted);
}
.topbar nav a:hover { background: var(--panel2); text-decoration: none; color: var(--text); }
.topbar nav a.on { background: var(--panel2); color: var(--text); font-weight: 600; }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.topbar .fp {
  font: 12px/1 ui-monospace, Consolas, monospace;
  color: var(--muted); padding: 4px 8px; border: 1px dashed var(--line); border-radius: 6px;
}
.quit { color: var(--muted); font-size: 13px; }

/* ---------------- 布局 ---------------- */
main { padding: 20px; max-width: 1500px; margin: 0 auto; }
footer { padding: 24px 20px 40px; text-align: center; color: var(--muted); font-size: 12px; }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 16px 18px; margin-bottom: 18px;
}
.card h2 { font-size: 15px; margin: 0 0 14px; font-weight: 600; }
.card h2 .muted { font-weight: 400; font-size: 12px; margin-left: 8px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1000px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------------- 统计卡 ---------------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 16px 18px;
}
.stat.hot { border-color: #2f81f755; box-shadow: inset 0 0 40px #2f81f71a; }
.stat .k { color: var(--muted); font-size: 13px; }
.stat .v { font-size: 32px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .v .of { font-size: 16px; color: var(--muted); font-weight: 400; }
.stat .s { color: var(--muted); font-size: 12px; }

/* ---------------- 表格 ---------------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; color: var(--muted); font-weight: 500;
  padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 9px 10px; border-bottom: 1px solid #1d232c; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #ffffff05; }
tr.dim td { opacity: .55; }

.mono { font-family: ui-monospace, Consolas, monospace; }
.strong { font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.empty { color: var(--muted); text-align: center; padding: 28px 0; margin: 0; }

.tag {
  display: inline-block; padding: 1px 8px; border-radius: 20px;
  font-size: 12px; background: var(--panel2); color: var(--muted); border: 1px solid var(--line);
}
.tag.green { color: var(--green); border-color: #3fb95044; background: #3fb95014; }
.tag.red { color: var(--red); border-color: #f8514944; background: #f8514914; }
.tag.gray { color: var(--muted); }

/* ---------------- 表单 ---------------- */
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input, select, button {
  font: inherit; color: var(--text);
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; outline: none;
}
input:focus, select:focus { border-color: var(--accent); }
input:disabled { opacity: .45; }
button { cursor: pointer; }
button:hover { border-color: #3d4757; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover { background: #1f6feb; }

.row-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row-form .grow { flex: 1; min-width: 200px; }
.filters { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.filters input[name=q] { flex: 1; min-width: 220px; }

/* ---------------- 行内操作 ---------------- */
td.ops { white-space: nowrap; }
td.ops form { display: inline-flex; gap: 4px; align-items: center; margin: 0 6px 0 0; }
button.link {
  background: none; border: none; padding: 2px 4px; color: var(--accent); font-size: 12px;
}
button.link:hover { text-decoration: underline; }
button.link.warn { color: var(--warn); }
button.link.danger { color: var(--red); }
input.tiny { width: 56px; padding: 3px 6px; font-size: 12px; }

/* ---------------- 提示 ---------------- */
.flash {
  padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13px;
  border: 1px solid var(--line); background: var(--panel2);
}
.flash.ok { color: var(--green); border-color: #3fb95044; background: #3fb95014; }
.flash.err { color: var(--red); border-color: #f8514944; background: #f8514914; }

/* ---------------- 登录 ---------------- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login { width: 340px; padding: 28px; }
.login-brand { text-align: center; margin-bottom: 14px; }
.login h1 { font-size: 18px; margin: 0 0 4px; text-align: center; }
.login .muted { text-align: center; margin: 0 0 20px; font-size: 13px; }
.login label { margin-bottom: 14px; }
.login button { width: 100%; margin-top: 6px; padding: 10px; }
