:root {
  --bg: #0e0e0e;
  --surface: #171717;
  --surface-2: #1f1f1f;
  --line: #2c2c2c;
  --text: #f2f2f0;
  --muted: #9a9a94;
  --accent: #f2f2f0;
  --accent-soft: #242424;
  --ok: #7dba96;
  --ok-bg: #1a2a21;
  --danger: #d08888;
  --danger-bg: #2a1a1a;
  --radius: 14px;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  --font: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text); text-decoration: none; }
a:hover { opacity: 0.75; }

.shell {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 36px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-main { flex: 1; }

.site-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.powerby {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 22px;
}

.brand {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-sub {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.brand-note {
  margin: 10px 0 0;
  color: #b8b8b0;
  font-size: 0.86rem;
  max-width: 36em;
  line-height: 1.5;
}

.nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.btn, button.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 16px;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: 0.15s ease;
}

.btn:hover { background: var(--surface-2); border-color: #3a3a3a; }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #111;
  font-weight: 600;
}
.btn.primary:hover { opacity: 0.92; }
.btn.danger {
  border-color: #4a2c2c;
  color: var(--danger);
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.icon {
  padding: 7px 11px;
  min-width: 36px;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.card h2, .card h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
  font-weight: 700;
}

.muted { color: var(--muted); font-size: 0.9rem; }
.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.stack { display: grid; gap: 12px; }

.field {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
}
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: #4a4a4a;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--muted);
}
.badge.ok {
  color: var(--ok);
  background: var(--ok-bg);
  border-color: transparent;
}
.badge.danger {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: transparent;
}
.badge.idle { color: var(--muted); }

.value {
  font-size: 2.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 14px 0 4px;
  line-height: 1;
}
.value small {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 6px;
}

.stats {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
  display: grid;
  gap: 4px;
}

.meta {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
}

.low {
  border-color: #4a2c2c;
  background: #1a1414;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.section-gap { margin-top: 14px; }

.table-wrap { overflow: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  text-align: left;
  padding: 13px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.chart-panel { margin-top: 14px; }
.chart-wrap {
  position: relative;
  height: 300px;
  margin-top: 12px;
}

.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.site-footer {
  margin-top: 36px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 400;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 400;
}
.site-footer a:hover { color: var(--text); }

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: grid;
  gap: 8px;
  z-index: 50;
  width: min(340px, calc(100% - 24px));
}
.toast {
  background: #2a2a2a;
  color: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.88rem;
}
.toast.error { background: #4a2424; }

details summary {
  cursor: pointer;
  color: var(--muted);
}
details summary:hover { color: var(--text); }

@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .topbar, .site-top {
    flex-direction: column;
    align-items: flex-start;
  }
  .shell { width: min(1100px, calc(100% - 28px)); }
}
