:root {
  --ink: #0e0e0e;
  --paper: #ffffff;
  --soft: #f4f2ec;
  --hair: #0e0e0e;
  --red: #d93a2b;
  --blue: #0f4c97;
  --yellow: #f2b300;
  --muted: #6b665c;
  --sans: "Helvetica Neue", Helvetica, Arial, "Noto Sans SC", "Source Han Sans SC",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, Menlo, Consolas, "DejaVu Sans Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

.top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 38px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  letter-spacing: .02em;
}
.top .ring {
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
}
.top .who {
  margin-left: auto;
  font: 10px var(--mono);
  letter-spacing: .16em;
  opacity: .75;
}

main { padding: 12px; }

section {
  border: 2px solid var(--hair);
  margin-bottom: 10px;
}
section > h3 {
  margin: 0;
  padding: 5px 10px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  letter-spacing: .18em;
  font-weight: 600;
}
.body { padding: 10px; }

/* 总闸 */
.gate {
  display: block;
  width: 100%;
  padding: 14px 12px;
  border: 2px solid var(--hair);
  background: var(--red);
  color: #fff;
  font: 700 15px/1.3 var(--sans);
  letter-spacing: .06em;
  cursor: pointer;
  text-align: left;
}
.gate small {
  display: block;
  font: 400 11px/1.4 var(--sans);
  letter-spacing: .02em;
  opacity: .92;
  margin-top: 3px;
}
.gate.on { background: var(--blue); }
.gate:active { transform: translateY(1px); }

.state {
  margin-top: 8px;
  padding: 6px 8px;
  background: var(--soft);
  border-left: 6px solid var(--ink);
  font-size: 12px;
  color: #2a2823;
}
.state b { font-weight: 700; }

/* 名单 */
.list { display: flex; flex-direction: column; gap: 6px; }
.prow {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--ink);
  padding: 6px 8px;
  cursor: pointer;
  background: #fff;
  font-size: 13px;
  user-select: none;
}
.prow .box {
  width: 16px;
  height: 16px;
  border: 2px solid var(--ink);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-size: 11px;
  line-height: 1;
  color: #fff;
}
.prow.on { background: var(--yellow); }
.prow.on .box { background: var(--ink); }
.prow .nm { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .me { font: 9px var(--mono); letter-spacing: .12em; color: var(--muted); }
.empty { color: var(--muted); font-size: 12px; padding: 4px 0; }

/* 开关 */
.sw {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  cursor: pointer;
  font-size: 13px;
  user-select: none;
}
.sw input { appearance: none; width: 34px; height: 18px; border: 2px solid var(--ink); background: #fff; position: relative; cursor: pointer; margin: 0; flex: 0 0 auto; }
.sw input::after { content: ""; position: absolute; top: 1px; left: 1px; width: 12px; height: 12px; background: var(--ink); transition: left .12s; }
.sw input:checked { background: var(--ink); }
.sw input:checked::after { left: 17px; background: #fff; }
.sw .desc { color: var(--muted); font-size: 11px; }

/* 按钮组 */
.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
button.act {
  border: 2px solid var(--hair);
  background: #fff;
  color: var(--ink);
  font: 600 13px/1.2 var(--sans);
  padding: 9px 6px;
  cursor: pointer;
}
button.act:active { transform: translateY(1px); }
button.act.hot { background: var(--ink); color: #fff; }

.note { font: 11px/1.5 var(--sans); color: var(--muted); margin: 6px 0 0; }

/* 区域设置 */
.regrow { border: 1px solid var(--ink); padding: 8px; margin-bottom: 8px; background: #fff; }
.regline { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.regname { font-weight: 700; font-size: 13px; }
.regstate { font: 11px var(--mono); color: var(--muted); letter-spacing: .04em; }
.regbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
button.mini {
  border: 2px solid var(--hair); background: #fff; color: var(--ink);
  font: 600 12px/1.2 var(--sans); padding: 6px 4px; cursor: pointer;
}
button.mini:active { transform: translateY(1px); }
.acts .wide { grid-column: 1 / -1; }
