:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1d2129;
  --line: #2a2f3a;
  --text: #e7eaf0;
  --muted: #8f98a8;
  --brand: #22a06b;
  --brand-2: #1b8558;
  --warn: #d98b2b;
  --bad: #d9534f;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 14px/1.6 "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; }

button {
  font: inherit;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
}
button:hover { border-color: #3a4150; }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.primary:hover { background: var(--brand-2); }
button.danger { color: #ffb3b1; border-color: #5a2d2c; }
button.ghost { background: transparent; }
button:disabled { opacity: .5; cursor: not-allowed; }

input, select, textarea {
  font: inherit;
  background: #12151b;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
}
textarea { min-height: 96px; resize: vertical; }
label { display: block; margin: 12px 0 6px; color: var(--muted); font-size: 13px; }

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.auth-card { width: 360px; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, #22a06b, #2bbd7e);
  display: grid; place-items: center; font-weight: 700; color: #07130d;
}
h1 { font-size: 20px; margin: 0; }
.muted { color: var(--muted); }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

.layout { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 14px; }
.side nav { display: grid; gap: 4px; margin-top: 18px; }
.side nav a {
  text-decoration: none; padding: 9px 12px; border-radius: 8px; color: var(--muted);
}
.side nav a.active, .side nav a:hover { background: var(--panel-2); color: var(--text); }
.main { padding: 26px 30px; max-width: 1200px; }
.section-title { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; }
.section-title h2 { font-size: 18px; margin: 0; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
tr:last-child td { border-bottom: 0; }

.tag { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); }
.tag.online, .tag.sent { color: #7fe0b2; border-color: #255c43; background: #12281f; }
.tag.offline, .tag.skipped { color: var(--muted); }
.tag.pending, .tag.claimed { color: #e8c17a; border-color: #5b4720; background: #291f0e; }
.tag.failed { color: #ffb3b1; border-color: #5a2d2c; background: #2a1717; }
.tag.paused { color: #ffc98a; border-color: #6b4520; background: #2b1d0e; }

.grid { display: grid; gap: 14px; }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .n { font-size: 26px; font-weight: 600; }
.stat .k { color: var(--muted); font-size: 13px; }

.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: grid; place-items: center; padding: 20px; z-index: 20;
}
.modal { width: min(720px, 100%); max-height: 86vh; overflow: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; cursor: pointer;
  color: var(--muted); user-select: none;
}
.chip.on { border-color: var(--brand); color: #bdf0d6; background: #12281f; }
.err { color: #ffb3b1; }
.ok { color: #7fe0b2; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
