* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --text: #1a1a1a;
  --muted: #667085;
  --line: #e6e8ee;
  --bg: #f4f6f8;
  --card: #fff;
  --blue: #1677ff;
  --green: #16803c;
  --orange: #d48806;
  --red: #cf1322;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

button, input { font: inherit; }

.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 24px;
  background: #111827;
  color: #fff;
}

.top h1 { font-size: 18px; font-weight: 600; }
.top p { margin-top: 4px; color: #9ca3af; font-size: 12px; }
.top-actions { display: flex; gap: 8px; }

input[type="search"] {
  width: 260px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  background: #1f2937;
  color: #fff;
}

button {
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
}

button.ghost { background: #fff; color: var(--text); border: 1px solid var(--line); }
button.active { background: #111827; }

main { padding: 20px 24px 40px; }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.stat, .panel { background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.stat { padding: 14px 16px; }
.stat b { display: block; margin-top: 6px; font-size: 26px; }
.stat span, .muted { color: var(--muted); font-size: 12px; }
.ok { color: var(--green); }
.warn { color: var(--orange); }
.bad { color: var(--red); }

.panel { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; background: #fafbfc; }
tr.click { cursor: pointer; }
tr.click:hover { background: #f7faff; }

.tag {
  display: inline-block;
  min-width: 40px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 12px;
  text-align: center;
}
.tag.online { color: var(--green); background: #f0fdf4; }
.tag.stale { color: var(--orange); background: #fff7e6; }
.tag.offline { color: var(--red); background: #fff1f0; }
.tag.plain { color: #475467; background: #f2f4f7; }

.bar { width: 88px; height: 6px; margin-top: 6px; border-radius: 99px; background: #eef0f3; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--green); }
.bar i.warn { background: var(--orange); }
.bar i.bad { background: var(--red); }

.empty { padding: 48px 16px; text-align: center; color: var(--muted); }

.detail-head, .range, .grid, .split { display: flex; gap: 12px; }
.detail-head { align-items: center; margin-bottom: 16px; }
.detail-head h2 { font-size: 20px; }
.range { margin: 8px 0 16px; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; }
.grid .stat b { font-size: 16px; font-weight: 600; }
.split { align-items: flex-start; }
.split .panel { flex: 1; min-width: 0; }
.panel h3 { padding: 14px 16px 0; font-size: 14px; }
.gate { max-width: 420px; margin: 48px auto; padding: 24px; }
.gate h2 { font-size: 16px; }
.gate .err { margin-top: 8px; color: var(--red); font-size: 13px; }
.gate form { display: flex; gap: 8px; margin-top: 16px; }
.gate input {
  flex: 1;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
}
.charts { display: grid; gap: 8px; padding: 8px 16px 16px; }
.chart-box { height: 120px; }
svg { width: 100%; height: 110px; display: block; }
svg text { fill: var(--muted); font-size: 11px; }

@media (max-width: 960px) {
  .stats, .grid { grid-template-columns: repeat(2, 1fr); }
  .split, .top { display: block; }
  .top-actions { margin-top: 12px; }
  input[type="search"] { width: 100%; }
}
