:root {
  --bg: #0f1320;
  --card: #1a2030;
  --card2: #222a3d;
  --accent: #4ade80;
  --accent2: #38bdf8;
  --text: #e6edf3;
  --muted: #8b97a7;
  --danger: #f87171;
  --border: #2a3347;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #1b2540, var(--bg));
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 32px 16px;
}

.wrap {
  width: 100%;
  max-width: 460px;
}

header { text-align: center; margin-bottom: 24px; }
header h1 { margin: 0; font-size: 26px; }
.sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
}

.status-card .status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 600;
}

.dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(139,151,167,.15);
}
.dot.on { background: var(--accent); box-shadow: 0 0 0 4px rgba(74,222,128,.18); }
.dot.off { background: var(--danger); box-shadow: 0 0 0 4px rgba(248,113,113,.18); }
.dot.busy { background: #fbbf24; box-shadow: 0 0 0 4px rgba(251,191,36,.18); animation: pulse 1s infinite; }
.dot.err { background: #64748b; }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

.meta { color: var(--muted); margin: 12px 0; font-size: 14px; min-height: 18px; }

.label { font-weight: 600; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 12px; }

button {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #06210f;
  transition: filter .15s, opacity .15s;
}
button:hover { filter: brightness(1.05); }
button:disabled { opacity: .55; cursor: not-allowed; }

button.ghost {
  background: transparent;
  color: var(--accent2);
  border: 1px solid var(--border);
  margin-top: 4px;
}

input {
  width: 100%;
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card2);
  color: var(--text);
  font-size: 15px;
  outline: none;
}
input:focus { border-color: var(--accent2); }

.switch-row { display: flex; align-items: center; justify-content: space-between; }

.switch { position: relative; display: inline-block; width: 54px; height: 30px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 30px;
  transition: .2s;
}
.slider::before {
  content: ""; position: absolute;
  height: 22px; width: 22px; left: 3px; top: 3px;
  background: var(--muted);
  border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: rgba(74,222,128,.25); border-color: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(24px); background: var(--accent); }
.switch input:disabled + .slider { opacity: .5; }

.msg { margin-top: 10px; font-size: 13px; min-height: 16px; color: var(--muted); }
.msg.ok { color: var(--accent); }
.msg.err { color: var(--danger); }

footer { text-align: center; color: var(--muted); font-size: 13px; }
footer span { color: var(--accent2); }
