:root {
  --bg0: #0f1412;
  --bg1: #18201c;
  --ink: #e8f0ea;
  --muted: #9bb0a3;
  --line: rgba(232, 240, 234, 0.12);
  --accent: #c6f26d;
  --accent-ink: #132016;
  --danger: #ff7a7a;
  --card: rgba(255, 255, 255, 0.04);
  --ok: #6dffb0;
  --warn: #ffd36d;
  --font: "IBM Plex Sans", "PingFang SC", "Noto Sans SC", sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg0);
}

.bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(198, 242, 109, 0.16), transparent 60%),
    radial-gradient(700px 400px at 90% 0%, rgba(109, 255, 176, 0.08), transparent 55%),
    linear-gradient(160deg, #101613, #0c100e 45%, #151b18);
  z-index: -1;
}

.shell {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 64px;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.03em;
}

.sub, .hint, .section-head p, .empty {
  color: var(--muted);
  line-height: 1.6;
}

.top-actions { display: flex; gap: 10px; align-items: center; }

button, .ghost {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
}

button:hover, .ghost:hover { border-color: rgba(198, 242, 109, 0.5); }
button.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  font-weight: 600;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }

.panel, .stat, .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.auth {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 16px;
  margin-bottom: 18px;
  align-items: end;
}
.auth label { display: grid; gap: 8px; font-size: 13px; color: var(--muted); }
.auth input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
  color: var(--ink);
  padding: 12px 14px;
  font: inherit;
}
.auth .hint { grid-column: 1 / -1; margin: 0; font-size: 13px; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.stat { padding: 18px; }
.stat span { display: block; font-size: 1.8rem; font-weight: 600; }
.stat label { color: var(--muted); font-size: 13px; }

.section-head { margin-bottom: 14px; }
.section-head h2, .help h2 { margin: 0 0 6px; font-size: 1.2rem; }
code, pre { font-family: var(--mono); }
code {
  color: var(--accent);
  background: rgba(198, 242, 109, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.card { padding: 16px; display: grid; gap: 12px; }
.card-head { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.card h3 { margin: 0; font-size: 1.05rem; word-break: break-all; }
.badge {
  font-size: 12px;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid var(--line);
}
.badge.on { color: var(--ok); border-color: rgba(109,255,176,0.35); }
.badge.off { color: var(--muted); }
.meta { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions button { padding: 8px 12px; font-size: 13px; }

.empty { display: none; padding: 24px 4px; }
.empty.show { display: block; }

.help { padding: 16px; margin-top: 28px; }
.help pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
  color: #d7e6db;
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 720px) {
  .top { flex-direction: column; align-items: start; }
  .auth { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
}
