:root {
  --bg: #0f1419;
  --card: #1a212b;
  --card-2: #232c38;
  --text: #e6edf3;
  --muted: #8b98a5;
  --accent: #2f81f7;
  --green: #3fb950;
  --red: #f85149;
  --border: #2d3743;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.login-card h1 { font-size: 20px; margin: 0 0 4px; }
.login-card label {
  display: block;
  text-align: left;
  margin: 16px 0 6px;
  font-size: 13px;
  color: var(--muted);
}
.login-card input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--text);
  font-size: 15px;
}
.login-card button { margin-top: 16px; width: 100%; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-on { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot-off { background: var(--red); }

/* ---------- 布局 ---------- */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
}
.card h2 { margin: 0 0 14px; font-size: 16px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}
.stat {
  background: var(--card-2);
  border-radius: 8px;
  padding: 10px 12px;
}
.stat-label { font-size: 12px; color: var(--muted); }
.stat-val { font-size: 18px; font-weight: 600; margin-top: 2px; }

/* ---------- 控制开关 ---------- */
.controls { display: flex; flex-direction: column; gap: 6px; }
.ctrl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.ctrl-row:last-child { border-bottom: none; }
.ctrl-name { font-size: 15px; }
.ctrl-msg { margin-top: 12px; min-height: 18px; font-size: 13px; }

.switch { position: relative; display: inline-block; width: 52px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--card-2); border: 1px solid var(--border);
  transition: .2s; border-radius: 28px;
}
.slider:before {
  position: absolute; content: ""; height: 20px; width: 20px;
  left: 3px; bottom: 3px; background: #fff; transition: .2s; border-radius: 50%;
}
.switch input:checked + .slider { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .slider:before { transform: translateX(24px); }

/* ---------- 按钮 ---------- */
button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  background: var(--accent);
  color: #fff;
}
button:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); padding: 6px 12px; }

/* ---------- 日志 ---------- */
.logs {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  background: var(--bg);
  border-radius: 8px;
  padding: 12px;
  max-height: 260px;
  overflow-y: auto;
  white-space: pre-wrap;
}
.log-line { padding: 2px 0; border-bottom: 1px solid #1c242e; }
.log-time { color: var(--muted); }
.log-level { color: var(--accent); }
