:root {
  --bg: #0f1115;
  --card: #171a21;
  --line: #262b36;
  --text: #e8ecf3;
  --muted: #97a0b0;
  --accent: #3b82f6;
  --ok: #22c55e;
  --bad: #ef4444;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
header b { font-size: 17px; }
header a { color: var(--muted); font-size: 14px; text-decoration: none; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}
h2 { font-size: 17px; margin: 0 0 8px; }
p.sub { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
input, textarea, select {
  width: 100%;
  background: #0f1115;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 12px;
  font-size: 16px;
  font-family: inherit;
}
textarea { min-height: 96px; resize: top; }
button {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 16px;
  cursor: pointer;
}
button.ghost { background: #22283a; color: var(--text); }
button.danger { background: var(--bad); }
button:disabled { opacity: 0.5; cursor: default; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.msg { border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; white-space: pre-wrap; }
.msg.me { background: #22283a; }
.msg.ai { background: #14233b; border: 1px solid #1f3b63; }
.tag { font-size: 13px; color: var(--muted); }
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  border: 1px solid var(--line);
  margin-right: 6px;
}
.pill.on { color: var(--ok); border-color: #1f5135; }
.pill.off { color: var(--bad); border-color: #5a2020; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.thin { color: var(--muted); font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.err { color: var(--bad); font-size: 14px; min-height: 20px; }
.code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 20px;
  letter-spacing: 2px;
  background: #0d1b2d;
  border: 1px dashed #3b82f6;
  padding: 14px;
  border-radius: 10px;
  text-align: center;
}
.hidden { display: none !important; }
nav.agents { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
nav.agents button { padding: 9px 14px; font-size: 15px; background: #22283a; }
nav.agents button.sel { background: var(--accent); }
.qr { display: block; margin: 12px auto; border-radius: 10px; background: #fff; padding: 8px; }
