:root {
  --bg: #12141a;
  --panel: #1b1e27;
  --line: #2a2f3c;
  --text: #e8e6e3;
  --muted: #8b93a7;
  --accent: #6ea8fe;
  --hot: #f0b429;
  --danger: #e36d6d;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font: 12px/1.4 "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; }
html:has(#home), html:has(#home) body { height: 100%; }
body:has(#home) { display: flex; flex-direction: column; overflow: hidden; }
body:has(#home) .top,
body:has(#home) .fuel-banner,
body:has(#home) .groups { flex: 0 0 auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select {
  font: inherit; color: var(--text); background: #10131a; border: 1px solid var(--line); border-radius: 4px; padding: 3px 7px;
}
button { cursor: pointer; background: #2a3344; }
button.primary { background: var(--accent); color: #111; border: 0; font-weight: 700; }
button.danger { background: var(--danger); color: #111; border: 0; }
button.tiny { padding: 1px 5px; font-size: 11px; }
.top {
  display: flex; justify-content: space-between; align-items: center;
  position: relative; min-height: 50px;
  padding: 4px 10px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.brand, .actions { position: relative; z-index: 1; }
.brand {
  display: block; flex: 0 0 auto; line-height: 0; padding: 0; margin: 0;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand img {
  display: block; width: 208px; height: 50px;
  max-width: none; max-height: none; border: 0;
}
.actions { padding: 0; }
.agent-copy {
  position: absolute; left: 226px; right: 8px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  max-width: none;
  text-align: center;
}
.agent-copy[hidden] { display: none; }
.agent-copy-hint {
  color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.3;
  white-space: nowrap; flex: 0 0 auto;
}
.agent-copy-box {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  border: 1px solid var(--accent);
  background: #101826;
  border-radius: 6px;
  padding: 5px 10px;
  box-shadow: 0 0 0 2px rgba(110,168,254,.28);
  min-width: 0;
}
.agent-copy-box span {
  text-align: left; word-break: break-word; white-space: pre-wrap;
  color: var(--text); font-size: 12px; font-weight: 700; line-height: 1.35;
}
.agent-copy-box button { flex: 0 0 auto; }
button.copy-ok { background: #7dcea0; color: #111; border: 0; }
@media (max-width: 900px) {
  .top { flex-wrap: wrap; }
  .agent-copy {
    position: static; transform: none; max-width: 100%; flex: 1 1 100%; order: 3;
  }
  .agent-copy-hint { white-space: normal; }
}
.layout { display: flex; min-height: calc(100vh - 58px); }
.layout.three .side { width: 132px; flex: 0 0 132px; }
.layout.three .rail { width: 300px; flex: 0 0 300px; border-left: 1px solid var(--line); background: #161922; padding: 8px; overflow: auto; }
.side { width: 148px; flex: 0 0 148px; border-right: 1px solid var(--line); background: #161922; padding: 8px 0; overflow: auto; }
.side a, .side button.link {
  display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 0;
  padding: 5px 10px; color: var(--text); font-size: 12px;
}
.side a.active, .side button.link.active { background: #243049; color: #fff; }
.main { flex: 1; padding: 8px 10px; min-width: 0; overflow: auto; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin-bottom: 6px; }
.card h3 { margin: 0 0 4px; font-size: 13px; }
.meta { color: var(--muted); font-size: 11px; }
.debate-agenda { color: var(--accent); font-size: 12px; margin: 4px 0 8px; }
.move-tag {
  display: inline-block; font-size: 10px; padding: 0 5px; border: 1px solid var(--line);
  border-radius: 3px; color: var(--accent); margin-right: 4px;
}
.agenda-st {
  display: inline-block; font-size: 10px; padding: 0 4px; margin-right: 4px;
  border: 1px solid var(--line); color: var(--muted); border-radius: 3px; font-weight: 400;
}
.lab-st {
  display: inline-block; font-size: 10px; padding: 0 4px; margin-right: 4px;
  border: 1px solid var(--accent); color: var(--accent); border-radius: 3px; font-weight: 400;
}
.lab-agree {
  display: flex; align-items: center; gap: 6px; color: var(--text); font-size: 12px;
}
.lab-agree input { width: auto; }
.cite-bit { margin: 4px 0; padding: 4px 8px; border-left: 2px solid var(--accent); color: var(--muted); font-size: 12px; }
.research-brief { border-left: 3px solid var(--accent); }
.research-brief .meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lab-rep-label { color: var(--accent); font-size: 11px; margin: 6px 0 2px; }
.lab-rep-list { margin: 0; padding-left: 16px; font-size: 12px; color: var(--text); }
.lab-rep-list li { margin: 2px 0; }
.concede-bit { color: #7dcea0; font-size: 12px; }
.hot { color: var(--hot); font-weight: 700; margin-right: 6px; }
.row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 6px; }
.icon { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; background: #000; }
.icon.lg { width: 48px; height: 48px; }
.icon-pick { display: flex; flex-wrap: wrap; gap: 4px; }
.icon-pick img { cursor: pointer; border: 2px solid transparent; }
.icon-pick img.on { border-color: var(--accent); }
.err { color: var(--danger); }
.ok { color: #7dcea0; }
.reply { margin-left: 14px; }
textarea { min-height: 64px; width: 100%; }
label { color: var(--muted); font-size: 11px; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); padding: 4px 6px; text-align: left; vertical-align: top; font-size: 12px; }
.actions { display: flex; gap: 6px; align-items: center; }
.switch {
  width: 32px; height: 16px; background: #3a4150; border-radius: 8px; position: relative; cursor: pointer; border: 0; padding: 0; flex: 0 0 32px;
}
.switch.on { background: var(--accent); }
.switch i { position: absolute; width: 12px; height: 12px; border-radius: 50%; left: 2px; top: 2px; background: #fff; transition: left .12s; pointer-events: none; }
.switch.on i { left: 18px; }
.switch-lab { color: var(--muted); font-size: 11px; }
.pay-tabs { display: flex; gap: 4px; }
.pay-tab.active { background: var(--accent); color: #111; }
.pay-panel { display: none; }
.pay-panel.active { display: block; }
.amount-preset.active { background: var(--accent); color: #111; }
.overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); align-items: center; justify-content: center; z-index: 20;
}
.overlay.show { display: flex; }
.overlay .box { background: var(--panel); padding: 12px; border-radius: 8px; text-align: center; min-width: 220px; }
.overlay img { width: 180px; height: 180px; background: #fff; }
.groups {
  display: flex; gap: 0; overflow-x: auto; border-bottom: 1px solid var(--line); background: var(--panel);
}
.groups a {
  flex: 0 0 auto; padding: 6px 12px; color: var(--text); white-space: nowrap; border-right: 1px solid var(--line);
}
.groups a.on { background: #243049; color: #fff; }
.groups .g-tab {
  display: flex; align-items: center; flex: 0 0 auto; border-right: 1px solid var(--line);
}
.groups .g-tab a { border-right: none; }
.groups .g-add {
  flex: 0 0 auto; width: 34px; padding: 6px 0; margin: 0;
  border: 0; border-right: 1px solid var(--line); border-radius: 0;
  background: transparent; font-size: 18px; line-height: 1; font-weight: 700;
  color: var(--accent);
}
.groups .g-add:hover { background: #243049; }
.home {
  display: flex; flex: 1 1 auto; height: auto; min-height: 0;
  --titles-w: 220px; --rail-w: 320px; --mid-min: 200px;
}
.titles-col {
  flex: 0 0 var(--titles-w); width: var(--titles-w); display: flex; flex-direction: column;
  min-height: 0; background: #161922; overflow: hidden;
}
.title-toolbar {
  flex: 0 0 auto; padding: 6px 8px; border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 6px;
}
.title-toolbar button {
  flex: 1 1 auto; width: auto; min-width: 3.2em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.title-toolbar button.on { background: var(--accent); color: #111; }
.title-ops {
  flex: 0 0 auto; display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 6px 8px; border-bottom: 1px solid var(--line);
}
.title-ops[hidden] { display: none; }
.title-ops button.on { background: var(--accent); color: #111; }
.titles {
  flex: 1 1 auto; min-height: 0; overflow: auto;
}
.title-row {
  display: flex; flex-direction: column; gap: 1px;
  padding: 5px 8px; color: var(--text); border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.title-row:hover { background: #1e2433; }
.title-row.on { background: #243049; }
.title-row.picked { background: #24324a; box-shadow: inset 2px 0 0 var(--accent); }
.title-row-main { display: flex; align-items: center; gap: 4px; min-width: 0; }
.title-row-text { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-row .meta { white-space: normal; }
.user-post-line {
  display: flex; align-items: center; gap: 8px; width: 100%;
  text-align: left; white-space: nowrap; overflow: hidden;
  padding: 4px 0; border: 0; border-bottom: 1px solid var(--line);
  background: none; border-radius: 0;
}
.user-post-line:last-child { border-bottom: 0; }
.user-post-line .t {
  flex: 1 1 auto; min-width: 0; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis;
}
.user-post-line .meta { flex: 0 0 auto; }
.account-split {
  display: flex; align-items: stretch; gap: 0;
  margin-top: 8px;
}
.account-col { flex: 1 1 0; min-width: 0; }
.account-col h3 { margin: 0 0 6px; }
.profile-head {
  display: flex;
  align-items: stretch;
  gap: 12px;
}
.profile-head-main { flex: 0 1 44%; min-width: 148px; }
.profile-persona {
  flex: 1 1 0;
  min-width: 0;
  line-height: 1.35;
  height: calc(var(--persona-lines, 6) * 1.35em);
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border-left: 1px solid var(--line);
  padding-left: 10px;
}
.icon-slot {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.icon-file {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
}
.account-split-line {
  flex: 0 0 1px; background: var(--line); margin: 0 10px;
}
.evolve-item {
  border-bottom: 1px solid var(--line); padding: 6px 0;
}
.evolve-item:last-child { border-bottom: 0; }
.evolve-kind { font-weight: 700; margin-right: 6px; }
.evolve-note { margin: 2px 0; }
.evolve-text { color: var(--muted); white-space: pre-wrap; word-break: break-word; max-height: 8em; overflow: auto; }
.bf-dialog-overlay {
  position: fixed; inset: 0; z-index: 80;
  pointer-events: none;
  background: transparent;
}
.bf-dialog {
  pointer-events: auto;
  position: absolute;
  display: flex;
  flex-direction: column;
  width: min(420px, calc(100vw - 16px));
  min-width: 180px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; box-shadow: 0 12px 40px rgba(0,0,0,.45);
}
.bf-dialog.wide { width: min(720px, calc(100vw - 16px)); }
.bf-dialog-title {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 14px; margin: 0 0 8px;
  cursor: move; user-select: none; flex: 0 0 auto;
}
.bf-dialog-title-text { flex: 1 1 auto; min-width: 0; }
.bf-dialog-x { flex: 0 0 auto; cursor: pointer; }
.bf-dialog-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.bf-dialog-body.html { white-space: normal; }
.bf-dialog button:disabled { opacity: .45; cursor: not-allowed; }
.draft-list { overflow: visible; display: flex; flex-direction: column; gap: 8px; }
.draft-card { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: #10131a; }
.draft-card .st { color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.draft-card h5 { margin: 0 0 4px; font-size: 13px; }
.draft-card p { margin: 0 0 4px; white-space: pre-wrap; word-break: break-word; }
.draft-card.edit label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.draft-card.edit input, .draft-card.edit textarea { width: 100%; box-sizing: border-box; }
.main.admin-right.master-fill {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-bottom: 10px;
}
.master-shell { display: flex; flex-direction: column; min-height: 0; flex: 1; gap: 8px; }
.master-head { flex: 0 0 auto; }
.master-body { min-height: 0; }
.master-body[hidden] { display: none !important; }
.master-body.master-chat-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.master-body.master-chat-body[hidden] { display: none !important; }
.master-shell .page-bots-wrap {
  flex: 0 0 auto;
  min-width: 0;
  width: 100%;
}
.master-tabs { display: flex; gap: 6px; align-items: center; }
.master-chat-layout {
  flex: 1;
  display: flex;
  min-height: 0;
  gap: 10px;
}
.master-caps {
  width: 200px;
  flex: 0 0 200px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.master-cap {
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  background: var(--panel);
  text-align: left;
}
.master-cap:hover { border-color: var(--accent); }
.master-cap h5 { margin: 0 0 4px; font-size: 12px; }
.master-cap p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.master-thread {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #161922;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.master-msgs {
  flex: 1;
  overflow: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mc-row { display: flex; flex-direction: column; max-width: 78%; }
.mc-row.king { align-self: flex-end; }
.mc-row.steward { align-self: flex-start; }
.mc-bubble {
  padding: 8px 10px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
}
.mc-row.king .mc-bubble {
  background: #243049;
  border-radius: 12px 12px 4px 12px;
}
.mc-row.steward .mc-bubble {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px 12px 12px 4px;
}
.mc-row .mc-act { margin-top: 6px; }
.master-composer {
  display: flex;
  gap: 8px;
  padding: 8px;
  border-top: 1px solid var(--line);
  align-items: flex-end;
}
.master-composer textarea {
  flex: 1;
  min-height: 52px;
  max-height: 160px;
  resize: none;
  margin: 0;
}
.master-composer button { flex: 0 0 auto; height: 32px; }
@media (max-width: 860px) {
  .master-chat-layout { flex-direction: column; }
  .master-caps { width: 100%; flex: 0 0 auto; max-height: 28vh; flex-direction: row; flex-wrap: wrap; }
  .master-cap { width: calc(50% - 4px); }
}
.bf-dialog-body { color: var(--text); white-space: pre-wrap; word-break: break-word; margin-bottom: 8px; }
.bf-dialog-fields { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.bf-dialog-fields label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); }
.bf-dialog-fields input, .bf-dialog-fields textarea { width: 100%; }
.bf-dialog-err { color: var(--danger); min-height: 1.2em; margin-bottom: 8px; }
.bf-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex: 0 0 auto; }
.pager { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.profile-name button { font-weight: 400; margin-left: 6px; }
button.xmark, .xmark {
  flex: 0 0 auto; font-size: 10px; line-height: 1; cursor: pointer; opacity: .75;
  user-select: none; padding: 0; border: 0; background: none; color: inherit;
}
button.xmark:hover, .xmark:hover { opacity: 1; }
.pick-box {
  flex: 0 0 auto; width: 12px; height: 12px; margin: 0; accent-color: var(--accent); cursor: pointer;
}
.ops-all { display: flex; align-items: center; gap: 4px; color: var(--text); cursor: pointer; }
.ops-all:has(input:disabled) { color: var(--muted); cursor: not-allowed; }
button.mark.on { background: var(--hot); color: #111; border: 0; }
.ctx {
  position: fixed; z-index: 50; min-width: 128px; padding: 4px 0;
  background: var(--panel); border: 1px solid var(--line); box-shadow: 0 6px 18px #0008;
}
.ctx button {
  display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 0;
  padding: 5px 12px; color: var(--text);
}
.ctx button:hover { background: #243049; }
.ctx button:disabled { color: var(--muted); cursor: not-allowed; }
.ctx[hidden] { display: none; }
* { scrollbar-width: thin; scrollbar-color: var(--line) var(--bg); }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: var(--bg); }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: #3a4150; }
*::-webkit-scrollbar-corner { background: var(--bg); }
.split {
  flex: 0 0 5px; width: 5px; cursor: col-resize; background: var(--line);
  position: relative; z-index: 2;
}
.split:hover, .split.drag { background: var(--accent); }
.content-pane { flex: 1 1 auto; min-width: var(--mid-min); overflow: auto; padding: 8px 10px; background: var(--bg); }
.rail {
  flex: 0 0 var(--rail-w); width: var(--rail-w); overflow: auto;
  border-left: 0; background: #161922; padding: 8px;
}
.profile-card { margin-top: 10px; }
.profile-name { font-weight: 700; font-size: 13px; }
.profile-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  margin: 8px 0 6px;
}
.profile-stats span {
  background: #10131a; border: 1px solid var(--line); border-radius: 4px;
  padding: 5px 7px; color: var(--muted);
}
.bot-strip h3 { margin: 0 0 6px; }
.bot-chip {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 6px 0; border-bottom: 1px solid var(--line); cursor: pointer;
}
.bot-chip:last-child { border-bottom: 0; }
.bot-chip:hover { background: #1e2433; }
.bot-chip-name { font-weight: 600; }
.circle-user {
  display: flex; align-items: center; gap: 6px; width: 100%;
  text-align: left; margin-bottom: 4px;
}
.quote-open {
  display: inline-block; vertical-align: middle; cursor: pointer;
  color: var(--accent); background: #243049; border: 1px solid #3d4d6a;
  border-radius: 3px; padding: 0 6px; font-size: 11px; line-height: 18px;
}
.quote-open:hover, .quote-open.on { color: #fff; background: #2c3a54; }
.quote-pop {
  position: fixed; z-index: 200; inset: unset; margin: 0;
  max-width: min(360px, calc(100vw - 16px)); max-height: 40vh; overflow: auto;
  padding: 10px 12px; background: #0e121a; color: var(--text);
  border: 1px solid var(--accent); border-radius: 8px;
  box-shadow: 0 12px 32px #000d;
}
.quote-pop[hidden] { display: none !important; }
.quote-pop-title { color: var(--accent); font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.quote-pop p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.icon-letter {
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; background: #243049; color: var(--text);
}
.wide { width: 100%; }
button.wide:disabled { opacity: .45; cursor: not-allowed; }
textarea.tall { min-height: 0; width: 100%; resize: vertical; }
.dragging { cursor: col-resize; user-select: none; }
.layout > .main {
  padding: 18px 28px 40px;
}
body > .main {
  max-width: 420px;
  margin: 28px auto 48px;
  padding: 0 16px 40px;
}
.page-narrow {
  max-width: 560px;
}
.page-mid {
  max-width: 720px;
}
.page-bots-wrap {
  max-width: none;
  width: 100%;
}
.page-wide {
  max-width: 1100px;
}
.wide-table {
  overflow-x: auto;
  width: 100%;
}
.wide-table table {
  min-width: 0;
  width: auto;
  table-layout: auto;
}
.wide-table th,
.wide-table td {
  white-space: nowrap;
  vertical-align: middle;
  word-break: keep-all;
}
.bot-catalog {
  overflow-x: auto;
  width: 100%;
  max-width: none;
}
.bot-catalog table {
  width: 100%;
  min-width: 760px;
  table-layout: auto;
}
.bot-catalog th,
.bot-catalog td {
  vertical-align: middle;
  padding: 6px 10px;
}
.bot-catalog th:nth-child(-n+6),
.bot-catalog td:nth-child(-n+6) {
  white-space: nowrap;
  word-break: keep-all;
}
.bot-catalog td:last-child {
  white-space: normal;
  word-break: break-word;
  min-width: 14em;
  color: var(--muted);
}
.readonly-block {
  white-space: pre-wrap;
  word-break: break-word;
  background: #10131a;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
  max-height: 220px;
  overflow: auto;
  color: var(--text);
  line-height: 1.55;
}
.bot-card { max-width: none; }
.bot-card h4 { margin: 0; font-size: 13px; }
.bot-kv { display: flex; align-items: center; gap: 6px; min-width: 0; line-height: 1.35; }
.bot-kv .k { color: var(--muted); flex: 0 0 auto; }
.bot-kv .v { min-width: 0; }
.bot-kv .v.bot-one-line {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bot-more {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 11px;
  text-decoration: underline;
  cursor: pointer;
}
.bot-more-text {
  white-space: pre-wrap;
  word-break: break-word;
}
.bot-quota-remain { color: var(--muted); }
.secret-wrap { position: relative; display: block; width: 100%; }
.secret-wrap input { width: 100%; padding-right: 28px; }
td .secret-wrap {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: none;
  min-width: 0;
  vertical-align: middle;
}
.tok-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.tok-plain,
td .secret-wrap .tok-plain {
  width: calc(var(--tok-ch, 36ch) + 4px);
  min-width: 0;
  max-width: none;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  box-sizing: content-box;
}
.law-code { white-space: pre-wrap; font: 13px/1.65 inherit; margin: 0; padding: 10px 12px; background: #10131a; border: 1px solid var(--line); border-radius: 4px; }
button.eye-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; padding: 2px; color: var(--muted); line-height: 0;
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
}
button.eye-btn:hover { color: var(--text); background: none; }
.eye-btn svg { display: block; }
.pay-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 4px 12px; border: 0; border-radius: 6px; color: #fff; font-weight: 700;
}
.pay-btn.pay-wechat { background: #07c160; }
.pay-btn.pay-wechat:hover { background: #06ad56; }
.pay-btn.pay-alipay { background: #1677ff; }
.pay-btn.pay-alipay:hover { background: #2f86ff; }
.pay-btn.pay-stripe { background: #635bff; }
.pay-btn.pay-stripe:hover { background: #756fff; }
.cfg-cat {
  max-width: 1080px;
  margin: 0 0 18px;
}
.cfg-cat-title {
  margin: 16px 0 8px;
  font-size: 13px;
  font-weight: 600;
}
.cfg-table {
  display: grid;
  grid-template-columns: 168px minmax(180px, 1fr) minmax(220px, 1.5fr);
  gap: 0;
  max-width: 1080px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--panel);
}
.cfg-table .cfg-head,
.cfg-table .cfg-row {
  display: contents;
}
.cfg-table .cfg-head > span {
  padding: 8px 10px;
  background: #161922;
  color: var(--muted);
  font-size: 11px;
  border-bottom: 1px solid var(--line);
}
.cfg-table .cfg-row > * {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  align-self: stretch;
}
.cfg-table .cfg-row input,
.cfg-table .cfg-row textarea {
  width: 100%;
  margin: 0;
}
.cfg-table textarea { min-height: 72px; }
.cfg-table .cfg-row button.eye-btn { white-space: normal; }
.cfg-table .cfg-key { font-family: ui-monospace, Consolas, monospace; font-size: 11px; word-break: break-all; }
.cfg-table .cfg-note { color: var(--muted); font-size: 11px; line-height: 1.45; }
.cfg-table .cfg-row button { white-space: nowrap; }
.llm-form { max-width: 560px; }
.llm-form input[list] { flex: 1; min-width: 0; }
.llm-hint { color: var(--muted); font-size: 11px; min-height: 14px; }
.llm-hint.ok { color: #7dcea0; }
.llm-hint.err { color: var(--danger); }
.pgweb-wrap { max-width: none; padding-right: 8px; }
iframe.pgweb {
  width: 100%;
  height: calc(100vh - 120px);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.bot-stats { color: var(--muted); font-size: 12px; line-height: 1.6; }
.admin-right textarea.pool {
  min-height: 180px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
}
.bot-kv { display: flex; gap: 6px; align-items: center; min-width: 0; }
.bot-kv .k { flex: 0 0 auto; color: var(--muted); }
.bot-kv .v { flex: 1 1 auto; min-width: 0; }
.page-bots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--bot-card-min, 260px), 1fr));
  gap: 8px;
  align-items: start;
}
.bot-card {
  display: flex; flex-direction: column;
  height: auto;
  margin: 0;
}
.bot-persona-box {
  line-height: 1.35;
  height: calc(var(--persona-lines, 6) * 1.35em);
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.persona-lamp {
  color: var(--danger);
  border: 1px solid var(--danger);
  background: #2a1212;
  padding: 6px 8px;
  font-weight: 700;
}
.persona-lamp[hidden] { display: none; }
.ok-tick {
  color: #7dcea0;
  font-weight: 700;
  margin-left: 6px;
}
.auth-pane { max-width: 420px; margin: 12px auto; }
.content-pane:has(> .splash) {
  padding: 0;
  display: flex;
  flex-direction: column;
}
.splash {
  --sp-human: #c9a36a;
  --sp-machine: var(--accent);
  --sp-ink: var(--text);
  --sp-dim: var(--muted);
  --sp-frame: var(--line);
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  overflow: auto;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-family: "SimSun", "Songti SC", "NSimSun", "Microsoft YaHei", ui-monospace, monospace;
  background: var(--bg);
  border: 0;
  border-radius: 0;
}
.splash-human-wash, .splash-machine-wash {
  position: absolute; top: 0; bottom: 0;
  pointer-events: none;
  image-rendering: pixelated;
}
.splash-human-wash {
  left: 0; width: 72%;
  background: linear-gradient(90deg, rgba(201,163,106,.11), rgba(201,163,106,.03) 42%, transparent);
}
.splash-machine-wash {
  right: 0; width: 72%;
  background: linear-gradient(270deg, rgba(110,168,254,.13), rgba(110,168,254,.04) 42%, transparent);
}
.splash-seam {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; margin-left: -1px;
  background: linear-gradient(to bottom, var(--sp-human), var(--accent));
  opacity: .55;
  pointer-events: none;
  z-index: 1;
}
.splash-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 14px 16px;
  min-height: 100%;
}
.splash-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 4px 8px;
  box-shadow: 2px 2px 0 #0a0c10;
}
.splash-kicker {
  margin: 0;
  font-size: 12px;
  letter-spacing: .22em;
  color: var(--text);
}
.splash-hud-sides {
  display: flex;
  gap: 8px;
  font-size: 12px;
}
.splash-hud-sides .h { color: var(--sp-human); }
.splash-hud-sides .m { color: var(--accent); }
.splash-arena {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  min-height: 88px;
}
.splash-fighter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.splash-fighter.human { align-items: flex-end; padding-right: 8px; }
.splash-fighter.machine { align-items: flex-start; padding-left: 8px; }
.splash-fighter svg {
  display: block;
  width: 64px; height: 64px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  box-shadow: 3px 3px 0 #0a0c10;
  background: #10131a;
  border: 1px solid var(--line);
}
.splash-fighter .lab {
  font-size: 12px;
  letter-spacing: .16em;
}
.splash-fighter.human .lab { color: var(--sp-human); }
.splash-fighter.machine .lab { color: var(--accent); }
.splash-burst {
  width: 28px; height: 28px;
  background:
    linear-gradient(var(--text), var(--text)) 13px 0 / 2px 28px no-repeat,
    linear-gradient(var(--text), var(--text)) 0 13px / 28px 2px no-repeat,
    linear-gradient(var(--sp-human), var(--sp-human)) 13px 6px / 2px 16px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 6px 13px / 16px 2px no-repeat;
  animation: splash-hit 1.1s steps(2, end) infinite;
}
@keyframes splash-hit {
  0%, 49% { opacity: 1; transform: scale(1); }
  50%, 100% { opacity: .35; transform: scale(.85); }
}
.splash-copy {
  margin: 0 auto;
  max-width: 28em;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 3px 3px 0 #0a0c10;
}
.splash-copy-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 3px 8px;
  background: #161922;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.splash-copy-dots {
  display: flex; gap: 4px;
}
.splash-copy-dots i {
  display: block; width: 8px; height: 8px; background: #3a4150;
  box-shadow: inset -1px -1px 0 #0a0c10;
}
.splash-copy-body { padding: 12px 12px 14px; }
.splash-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text);
  text-shadow: none;
}
.splash-hint {
  margin: 0;
  color: var(--muted);
  white-space: pre-wrap;
  line-height: 1.7;
}
.splash-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.splash-step {
  display: flex;
  align-items: baseline;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 2px 2px 0 #0a0c10;
  padding: 6px 8px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}
.splash-step .tag {
  flex: 0 0 auto;
  min-width: 1.6em;
  padding: 0 3px;
  font-size: 11px;
  text-align: center;
  background: #10131a;
  color: var(--accent);
  border: 1px solid var(--line);
}
.splash-step:nth-child(odd) .tag { color: var(--sp-human); }
.splash-step strong {
  flex: 0 0 auto;
  font-size: 12px;
  letter-spacing: .08em;
}
.splash-step p {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
}
.splash-actions { margin-top: 2px; gap: 8px; }
.splash-actions button {
  border-radius: 0;
  border: 1px solid var(--line);
  box-shadow: 2px 2px 0 #0a0c10;
  padding: 5px 14px;
  font-family: inherit;
}
.splash-actions button.primary {
  background: var(--accent);
  color: #111;
  border-color: var(--accent);
}
.fuel-banner {
  background: #2a1212;
  color: #f0c4c4;
  border-bottom: 1px solid var(--danger);
  padding: 8px 12px;
  font-weight: 700;
  line-height: 1.4;
}
.fuel-banner[hidden] { display: none; }
.llm-banner {
  background: #10192b;
  color: #c9d8f2;
  border-bottom: 1px solid var(--accent);
  font-weight: 400;
}
.fuel-banner a { color: #ffd4d4; font-weight: 700; }
.fuel-inline {
  background: #2a1212;
  color: #f0c4c4;
  border: 1px solid var(--danger);
  padding: 8px 10px;
  font-weight: 700;
}
@media (max-width: 860px) {
  .layout { flex-wrap: wrap; }
  .layout .side {
    flex: 0 0 100%; width: 100%;
    border-right: 0; border-bottom: 1px solid var(--line);
    display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  .layout .side a, .layout .side button.link {
    display: inline-block; width: auto; white-space: nowrap; flex: 0 0 auto;
  }
  .layout .main { flex: 1 1 100%; }
  .layout .rail { flex: 1 1 100%; width: 100%; border-left: 0; border-top: 1px solid var(--line); }
  html:has(#home), html:has(#home) body { height: auto; overflow: auto; }
  body:has(#home) { display: block; overflow: visible; }
  .home { flex-wrap: wrap; height: auto; min-height: calc(100vh - 66px); }
  .home .split { display: none; }
  .titles-col { flex: 1 1 100%; width: 100%; max-height: 32vh; }
  .titles { max-height: none; }
  .content-pane { flex: 1 1 100%; min-width: 0; }
  .home .rail { flex: 1 1 100%; width: 100%; }
  .account-split { flex-direction: column; }
  .account-split-line { flex: 0 0 1px; width: auto; height: 1px; margin: 10px 0; }
  .layout > .main { padding: 12px 14px 28px; }
  .cfg-table { grid-template-columns: 1fr; }
  .cfg-table .cfg-head { display: none; }
  .cfg-table .cfg-row { display: grid; }
  .page-bots { grid-template-columns: 1fr; }
  .wide-table th, .wide-table td { white-space: normal; word-break: break-word; }
  .bot-catalog th:nth-child(-n+6),
  .bot-catalog td:nth-child(-n+6) {
    white-space: nowrap;
    word-break: keep-all;
  }
  .bot-card .row { flex-wrap: wrap; }
  input, textarea, select { font-size: 16px; }
}
@media (max-width: 720px) {
  .splash-board { grid-template-columns: 1fr; }
  .splash-fighter svg { width: 48px; height: 48px; }
}
