:root {
  --ink: #14263a;
  --ink-2: #4a6076;
  --line: #dfe7ef;
  --bg: #f5f8fb;
  --card: #ffffff;
  --brand: #0e7490;
  --brand-2: #0369a1;
  --ok: #15803d;
  --warn: #b45309;
  --dead: #c2410c;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: #0f2740;
  color: #e6eef7;
}

.brand { display: flex; align-items: center; gap: 8px; }
.brand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #22d3ee; box-shadow: 0 0 0 3px rgba(34, 211, 238, .18);
}
.brand .sub { font-size: 12px; color: #7ea3c4; }

.nav { display: flex; gap: 6px; align-items: center; }
.nav a {
  color: #cfe0ef; text-decoration: none; padding: 5px 11px;
  border-radius: 6px; font-size: 13px;
}
.nav a:hover { background: rgba(255, 255, 255, .1); }
.nav a.on { background: #22d3ee; color: #06283d; font-weight: 600; }
.nav a.quit { color: #94a9bd; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 18px 16px 40px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
}

.card h2, .card h3 { margin: 0 0 12px; font-size: 15px; }

.stats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.stat {
  flex: 1 1 140px; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 14px;
}
.stat b { display: block; font-size: 22px; line-height: 1.2; color: var(--brand-2); }
.stat span { font-size: 12px; color: var(--ink-2); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink-2); font-weight: 600; font-size: 12px; background: #fafcfe; }
td.mono, .mono { font-family: var(--mono); font-size: 12.5px; }
.tbl-wrap { overflow-x: auto; }

.tag { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.tag.ok   { background: #e7f7ee; color: var(--ok); }
.tag.warn { background: #fff3e2; color: var(--warn); }
.tag.dead { background: #ffede6; color: var(--dead); }
.tag.off  { background: #eef1f5; color: #64748b; }

form.inline { display: inline; }
input, select, textarea {
  font: inherit; color: inherit; background: #fff;
  border: 1px solid #cbd8e4; border-radius: 7px; padding: 7px 9px; width: 100%;
}
input[type=submit], button { width: auto; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.row > label { flex: 1 1 180px; min-width: 150px; display: block; font-size: 12.5px; color: var(--ink-2); }
.row > label input, .row > label select { margin-top: 4px; }

.btn {
  display: inline-block; cursor: pointer; border: 1px solid transparent;
  background: var(--brand-2); color: #fff; padding: 7px 14px;
  border-radius: 7px; font-size: 13px; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: #fff; color: var(--brand-2); border-color: #c7d9e8; }
.btn.danger { background: #fff; color: var(--dead); border-color: #f0c9b8; }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; }

.hint { font-size: 12px; color: var(--ink-2); }
.err { background: #fff1ec; border: 1px solid #f3c4b0; color: #9a3412; padding: 8px 11px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
.okbox { background: #eefbf3; border: 1px solid #a7e0c0; color: #14532d; padding: 8px 11px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }

details { margin-top: 6px; }
details summary { cursor: pointer; color: var(--brand-2); font-size: 12.5px; }
details[open] summary { margin-bottom: 8px; }

.foot { text-align: center; font-size: 12px; color: #8aa0b4; padding: 0 16px 24px; }

pre {
  background: #0f2740; color: #c9e4f5; padding: 11px 13px; border-radius: 9px;
  overflow-x: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.6;
}

@media (max-width: 640px) {
  .nav { width: 100%; overflow-x: auto; }
  th:nth-child(4), td:nth-child(4) { display: none; }
}
