:root {
  --ink: #070b12; --ink-2: #0b1220; --panel: #0e1724; --line: rgba(150, 180, 210, .16);
  --gold: #f0b429; --cyan: #2bb3e0; --text: #e9f1f8; --muted: #8ea3b6; --muted-2: #5d7387;
  --red: #e0472d; --green: #34d399;
}
* { box-sizing: border-box; }
/* hidden 属性必须能压过 .login{display:grid} 这类作者样式，否则登录后遮罩还在 */
[hidden] { display: none !important; }
body { margin: 0; background: var(--ink); color: var(--text); font-family: "Inter", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px; }
h1, h3 { margin: 0; }
input, select, textarea, button { font: inherit; color: inherit; }
code { background: rgba(255,255,255,.06); padding: 2px 5px; border-radius: 3px; font-size: .85em; }
.muted { color: var(--muted); }
.hint { color: var(--muted-2); font-size: .82rem; margin: 6px 0 14px; line-height: 1.6; }
.btn { border: 1px solid var(--line); background: rgba(255,255,255,.04); border-radius: 4px; padding: 8px 14px; cursor: pointer; transition: .18s; font-size: .86rem; }
.btn:hover { border-color: var(--cyan); color: #fff; }
.btn.primary { background: linear-gradient(180deg, #2fbbe8, #1590bd); border-color: transparent; color: #04121a; font-weight: 700; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: none; }
.btn.danger { color: #ff8a70; border-color: rgba(224,71,45,.4); }
.btn.tiny { padding: 5px 10px; font-size: .78rem; }

/* 登录 */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(700px 500px at 50% 0%, rgba(43,179,224,.14), transparent 60%); }
.login-box { width: min(360px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 30px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.login-box .logo { font-size: 34px; }
.login-box p { margin: 0 0 8px; color: var(--muted); font-size: .86rem; }
.login-box input { background: #070d15; border: 1px solid var(--line); border-radius: 4px; padding: 11px 13px; text-align: center; letter-spacing: .12em; }
.login-box small { color: #ff8a70; min-height: 1em; }

/* 框架 */
.bar { display: flex; justify-content: space-between; align-items: center; padding: 14px clamp(14px, 3vw, 28px); border-bottom: 1px solid var(--line); background: #080e17; position: sticky; top: 0; z-index: 20; }
.bar-left { display: flex; align-items: center; gap: 10px; }
.bar-left b { letter-spacing: .04em; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(52,211,153,.12); }
.dot.off { background: var(--red); box-shadow: 0 0 0 4px rgba(224,71,45,.12); }
.bar-right { display: flex; gap: 8px; align-items: center; }
.tabs { display: flex; gap: 4px; padding: 12px clamp(14px, 3vw, 28px) 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tab:hover { color: #fff; }
.tab.on { color: var(--cyan); border-bottom-color: var(--cyan); }
main { padding: clamp(14px, 2.4vw, 26px); max-width: 1180px; margin: 0 auto; }
.pane { display: none; }
.pane.on { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* 卡片 */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 20px; margin-bottom: 16px; }
.card h3 { font-size: 1rem; margin-bottom: 4px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.row { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 6px; font-size: .86rem; color: var(--muted); }
.row b { color: var(--text); }
input[type="range"] { width: 100%; accent-color: var(--cyan); }
.preset-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: .78rem; color: var(--muted-2); margin-bottom: 6px; }
.field input, .field select, .add-row input, textarea {
  width: 100%; background: #070d15; border: 1px solid var(--line); border-radius: 4px; padding: 9px 11px; font-size: .88rem;
}
textarea { resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cyan); }
.check { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--muted); margin: 10px 0 14px; }
.switch { width: 40px; height: 22px; accent-color: var(--gold); }

/* 表格 */
.table-wrap { overflow: auto; max-height: 420px; border: 1px solid var(--line); border-radius: 4px; }
.table-wrap.tall { max-height: 62vh; }
.tbl { width: 100%; border-collapse: collapse; font-size: .85rem; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted-2); font-size: .76rem; padding: 9px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #0d1622; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid rgba(150,180,210,.08); }
.tbl tr:hover td { background: rgba(43,179,224,.04); }
.tbl input[type="text"], .tbl input[type="number"] { background: #070d15; border: 1px solid transparent; border-radius: 3px; padding: 5px 7px; width: 100%; font-size: .85rem; }
.tbl input:hover { border-color: var(--line); }
.tbl input:focus { border-color: var(--cyan); }
.tbl input[type="color"] { width: 34px; height: 26px; padding: 0; border: 1px solid var(--line); background: none; }
.badge { font-size: .72rem; padding: 2px 7px; border-radius: 2px; }
.badge.ok { background: rgba(52,211,153,.14); color: #6ee7b7; }
.badge.no { background: rgba(150,180,210,.1); color: var(--muted-2); }
.add-row { display: grid; grid-template-columns: 1fr 56px 80px 90px auto; gap: 8px; margin-top: 12px; }
.add-row input[type="number"] { background: #070d15; border: 1px solid var(--line); border-radius: 4px; padding: 9px; }

/* 队列 & 统计 */
.queue { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.queue .q-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: rgba(240,180,41,.08); border: 1px solid rgba(240,180,41,.28); border-radius: 4px; padding: 8px 10px; font-size: .84rem; }
.queue .q-item button { background: none; border: 0; color: #ff8a70; cursor: pointer; font-size: .78rem; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0; }
.stat { background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 4px; padding: 12px; text-align: center; }
.stat b { display: block; font-size: 1.5rem; }
.stat span { font-size: .74rem; color: var(--muted-2); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.savehint { position: fixed; right: 18px; bottom: 18px; background: rgba(43,179,224,.14); border: 1px solid rgba(43,179,224,.4); color: #7fe0ff; padding: 8px 14px; border-radius: 4px; font-size: .8rem; opacity: 0; transition: .25s; pointer-events: none; }
.savehint.on { opacity: 1; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.linkbox { margin-top: 14px; font-size: .8rem; color: var(--muted); word-break: break-all; line-height: 1.8; }
.linkbox a { color: var(--cyan); }

@media (max-width: 820px) {
  .grid2 { grid-template-columns: 1fr; }
  .add-row { grid-template-columns: 1fr 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
}
