/* 星海控制台 · 深空终端风（redesign 2026-10-09） */
:root {
  --bg: #05080f;
  --bg2: #080d18;
  --surface: #0c1322;
  --surface2: #111a2e;
  --border: #1c2a44;
  --text: #c9d6e8;
  --muted: #6b7b9c;
  --cyan: #2ef2ff;
  --cyan2: #5ef2ff;
  --gold: #ffb84d;
  --red: #ff6b8a;
  --orange: #ff9d4d;
  --green: #3ef2a0;
  --grad: linear-gradient(90deg, #2ef2ff, #3ef2a0);
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Code", Consolas, "SFMono-Regular", monospace;
  --cyan-glow: rgba(46,242,255,.20);
  --grid: rgba(46,242,255,.035);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #122042 0%, var(--bg) 55%) fixed;
  color: var(--text);
  font-size: 14px;
}

.app { display: flex; height: 100vh; overflow: hidden; }

/* 侧边栏 */
.sidebar {
  width: 182px; flex: 0 0 182px;
  background: linear-gradient(180deg, var(--bg2), #060a13);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 10px 8px;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 4px 6px 8px; }
.brand-logo {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--grad); color: #06222b; font-weight: 800; font-size: 16px;
  display: grid; place-items: center; box-shadow: 0 0 16px rgba(46,242,255,.22);
}
.brand-logo svg { width: 17px; height: 17px; fill: #06222b; stroke: none; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: .5px; }
.brand-sub { color: var(--muted); font-size: 11px; }

.nav { display: flex; flex-direction: column; gap: 0; margin-top: 2px; flex: 1; min-height: 0; overflow-y: auto; padding-right: 2px; }
.nav::-webkit-scrollbar { width: 5px; }
.nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.nav::-webkit-scrollbar-thumb:hover { background: var(--muted); }
.nav-group-title {
  font-size: 9.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .6px;
  padding: 8px 12px 2px; opacity: .55; flex-shrink: 0;
}
.nav-group-title:first-of-type { padding-top: 4px; }
.nav-item {
  padding: 6px 12px; border-radius: 7px; color: var(--muted); cursor: pointer;
  font-size: 12.5px; transition: .15s; user-select: none; flex-shrink: 0;
  display: flex; align-items: center; justify-content: flex-start; gap: 8px;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(56,189,248,.16), transparent);
  color: var(--cyan); border-left: 3px solid var(--cyan);
}
.nav-caret { font-size: 10px; transition: transform .2s; opacity: .7; margin-left: auto; }
.nav-parent.open .nav-caret { transform: rotate(90deg); }
.nav-submenu { padding-left: 10px; display: none; }
.nav-submenu.open { display: block; }
.nav-subitem {
  display: flex; align-items: center; gap: 7px; padding: 5px 10px 5px 18px; border-radius: 6px;
  color: var(--muted); cursor: pointer; font-size: 12px; transition: .15s;
  margin: 1px 0 1px 3px;
}
.nav-subitem:hover { background: var(--surface); color: var(--text); }
.nav-subitem.active {
  background: linear-gradient(90deg, rgba(56,189,248,.12), transparent);
  color: var(--cyan); border-left: 2px solid var(--cyan);
}
/* 只读 vs 可编辑 视觉分组（dashboard 强制把「查看」与「修改」分开） */
.nav-divider {
  height: 1px; background: var(--border); margin: 8px 6px 6px;
  flex-shrink: 0; opacity: .55;
}
.nav-badge {
  font-size: 10px; line-height: 14px; padding: 0 6px; border-radius: 7px;
  background: rgba(148,163,184,.18); color: var(--muted); white-space: nowrap;
  letter-spacing: .2px; margin-left: auto;
}
.nav-badge-editable {
  background: rgba(56,189,248,.22); color: var(--cyan);
}
.nav-badge-readonly {
  background: rgba(250,204,21,.16); color: #fbbf24;
}
.sidebar-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; padding: 8px; }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

/* 主区 */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 46px; padding: 0 16px; border-bottom: 1px solid var(--border); background: rgba(11,18,34,.6);
}
.pills { display: flex; gap: 10px; }
.pill {
  display: flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--border); font-size: 12.5px; color: var(--muted);
}
.pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.pill.ok { color: var(--green); border-color: rgba(52,211,153,.4); }
.pill.ok .dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.pill.bad { color: var(--red); border-color: rgba(251,113,133,.4); }
.pill.bad .dot { background: var(--red); }
.pill.warn { color: var(--gold); border-color: rgba(251,191,36,.4); }
.pill.warn .dot { background: var(--gold); }

/* WS 断开提示条：仅 NapCat↔Bot 的 WebSocket 真正断开时显示 */
.ws-alert {
  display: flex; align-items: center; gap: 10px;
  margin: 10px 16px 0; padding: 10px 14px;
  background: rgba(251,113,133,.12); border: 1px solid rgba(251,113,133,.45);
  border-radius: 10px; color: var(--red); font-size: 13.5px;
}
.ws-alert .ws-alert-ico { font-size: 15px; }
.ws-alert .ws-alert-text { flex: 1; font-weight: 600; }
.ws-alert .btn-restart { color: var(--red); border-color: rgba(251,113,133,.5); }
.ws-alert .btn-restart:hover { background: rgba(251,113,133,.18); }
/* 自愈中（NapCat 重启后正在走 token→密码回退登录）：这是"进展"不是"故障"，
   用琥珀色而非红色，避免用户看到红条就以为坏了去打人工干预。 */
.ws-alert.is-healing {
  background: rgba(251,191,36,.12); border-color: rgba(251,191,36,.45);
  color: #fbbf24;
}
.ws-alert.is-healing .ws-alert-text { font-weight: 600; }
.actions { display: flex; gap: 8px; }
.btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: 9px; cursor: pointer; font-size: 13px; transition: .15s;
}
.btn:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-start { background: linear-gradient(90deg, rgba(52,211,153,.2), transparent); border-color: rgba(52,211,153,.5); color: var(--green); }
.btn-restart { background: linear-gradient(90deg, rgba(56,189,248,.2), transparent); border-color: rgba(56,189,248,.5); color: var(--cyan); }
.btn-stop { background: linear-gradient(90deg, rgba(251,113,133,.2), transparent); border-color: rgba(251,113,133,.5); color: var(--red); }
.btn-link { text-decoration: none; display: inline-flex; align-items: center; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 7px; }

.pagination {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border);
  gap: 10px; flex-wrap: wrap;
}
.pager-info { color: var(--muted); font-size: 12.5px; }
.pager-btns { display: flex; gap: 8px; align-items: center; }
.pager-jump { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; }
.pager-jump input {
  width: 58px; background: #05080f; border: 1px solid var(--border); border-radius: 7px;
  padding: 5px 8px; color: var(--text); font-size: 12px; outline: none; text-align: center;
}
.pager-jump input:focus { border-color: var(--cyan); }
.pager-jump input::-webkit-outer-spin-button,
.pager-jump input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.content { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 22px; min-width: 0; }
.section { display: none; min-width: 0; max-width: none; margin: 0 auto; width: 100%; }
#sec-ranking { max-width: none; }
.section.active { display: block; animation: fade .25s; }
@keyframes fade { from{opacity:0; transform: translateY(6px)} to{opacity:1} }
.sec-title { font-size: 17px; font-weight: 700; margin-bottom: 16px; padding-left: 10px; border-left: 4px solid var(--cyan); }

/* 卡片 */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.cards.row { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
@media (max-width: 1200px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: linear-gradient(160deg, var(--surface2), var(--surface));
  border: 1px solid var(--border); border-radius: 13px; padding: 16px 18px;
}
.card-label { color: var(--muted); font-size: 12px; }
.card-value { font-size: 22px; font-weight: 700; margin: 6px 0 2px; color: var(--cyan2); }
.card-sub { color: var(--muted); font-size: 11.5px; }
/* 临时号标记（BOT_SELF_ID != BOT_PRIMARY_ID）：金色警示，提醒当前跑的是一顶替号、到期要切回 */
.card-sub.is-temp { color: var(--gold); }
/* 锁定版本提示：跨整行显示（不塞进卡片，避免撑坏 3 卡片布局）。
   默认隐藏，有 hint 时由 JS 加 is-on；金色 = 这是「会过期」的提醒，不是普通说明。 */
.ver-hint { display: none; margin: 10px 0 0; line-height: 1.55; color: var(--gold); }
.ver-hint.is-on { display: block; }

/* 面板 */
.panel {
  background: linear-gradient(160deg, var(--surface2), var(--surface));
  border: 1px solid var(--border); border-radius: 13px; padding: 16px 18px; margin-bottom: 16px;
  min-width: 0; overflow-wrap: break-word;
}
.panel-title { font-size: 13.5px; font-weight: 600; color: var(--cyan); margin-bottom: 12px; }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.7; margin-bottom: 12px; }
.notes { color: var(--muted); font-size: 12.5px; line-height: 1.9; padding-left: 18px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th, .tbl td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.tbl th { color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--surface); }
.tbl tbody tr:hover { background: rgba(56,189,248,.06); }
.tbl td.gold { color: var(--gold); font-weight: 700; }

/* 章节头部 */
.sec-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sec-header .sec-title { margin-bottom: 0; }
.sec-actions { display: flex; align-items: center; gap: 12px; }
.loading-hint { color: var(--muted); font-size: 12.5px; opacity: 0; transition: opacity .2s; }
.loading-hint.active { opacity: 1; }
.empty-state {
  text-align: center; padding: 36px 18px; margin-bottom: 16px;
  background: linear-gradient(160deg, var(--surface2), var(--surface));
  border: 1px dashed var(--border); border-radius: 13px;
}
.empty-title { color: var(--muted); font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.empty-sub { color: var(--muted); font-size: 12px; opacity: .75; }

/* 图表网格 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 920px) { .grid-2 { grid-template-columns: 1fr; } }
canvas { max-height: 260px; }
.chart-ph {
  min-height: 220px; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12.5px;
}

/* 日志 */
.log {
  background: #05080f; border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; font-family: "Consolas", "Courier New", monospace; font-size: 12px;
  color: #9fe6c9; white-space: pre-wrap; word-break: break-all; max-height: 280px; overflow-y: auto; line-height: 1.6;
}
.log.big { max-height: calc(100vh - 160px); }

/* 对话详情 */
.chat-detail { background: #05080f; border: 1px solid var(--border); border-radius: 10px; padding: 12px; max-height: 300px; overflow-y: auto; }
.chat-detail .msg { margin-bottom: 10px; }
.chat-detail .role { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.chat-detail .role.user { color: var(--cyan); }
.chat-detail .role.assistant { color: var(--orange); }
.chat-detail .bubble { background: var(--surface); border-radius: 8px; padding: 8px 10px; line-height: 1.6; }

/* 纠正列表 */
.corr-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; flex-wrap: wrap; gap: 8px;
}
.corr-header .panel-title { margin-bottom: 0; }
.add-row { display: flex; gap: 8px; margin-bottom: 12px; }
.add-row input {
  flex: 1; background: #05080f; border: 1px solid var(--border); border-radius: 9px;
  padding: 9px 12px; color: var(--text); font-size: 13px; outline: none;
}
.add-row input:focus { border-color: var(--cyan); }
.corr-list { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.corr-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: 9px;
  padding: 10px 12px; display: flex; align-items: flex-start; gap: 10px;
}
.corr-item .idx { color: var(--gold); font-weight: 700; min-width: 20px; }
.corr-item .body { flex: 1; }
.corr-item .txt { line-height: 1.6; }
.corr-item .meta { color: var(--muted); font-size: 11px; margin-top: 4px; }
.corr-item .del { color: var(--red); cursor: pointer; border: none; background: none; font-size: 16px; }

/* 可编辑配置（已压缩，自适应多列） */
.cfg-edit { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.cfg-row { display: flex; flex-direction: column; gap: 4px; }
.cfg-row > label { color: var(--text); font-size: 12.5px; font-weight: 600; }
.cfg-row input,
.cfg-row select,
.cfg-row textarea {
  width: 100%; max-width: 100%;
  background: #05080f; border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 10px; color: var(--text); font-size: 12.5px; outline: none;
}
.cfg-row textarea { resize: vertical; font-family: "Consolas", "Courier New", monospace; line-height: 1.5; }
.cfg-row input:focus,
.cfg-row select:focus,
.cfg-row textarea:focus { border-color: var(--cyan); }
.cfg-hint { color: var(--muted); font-size: 11px; line-height: 1.4; }
.cfg-note-row { grid-column: 1 / -1; }
.cfg-note {
  display: block; font-size: 11px; line-height: 1.6; color: var(--muted);
  background: rgba(56,189,248,0.05); border-left: 2px solid var(--cyan);
  border-radius: 4px; padding: 7px 10px; margin-top: 2px;
}
.cfg-note b { color: var(--text); font-weight: 600; }
.cfg-static {
  width: 100%; max-width: 100%;
  background: #05080f; border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 10px; color: var(--cyan); font-size: 12.5px;
  font-weight: 600; user-select: none;
}
.cfg-subtitle { font-size: 12px; font-weight: 600; color: var(--cyan); margin: 10px 0 1px; padding-top: 8px; border-top: 1px dashed var(--border); }
.cfg-section-title { font-size: 12.5px; font-weight: 700; color: var(--text); margin: 14px 0 8px; padding: 6px 10px; background: rgba(56,189,248,0.06); border-left: 3px solid var(--cyan); border-radius: 4px; letter-spacing: 0.5px; }
.cfg-section-title:first-child { margin-top: 2px; }
/* 配置项自适应多列：QQ号 / 群号 成对的输入框并排，
   宽屏 2 列、中等屏 1 列、更宽屏可自动扩展；空占位行隐藏 */
.cfg-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px 22px; }
.cfg-row-empty { display: none; }
.cfg-row.inline { flex-direction: row; gap: 28px; align-items: center; flex-wrap: wrap; }
.inline-inputs { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-inputs select { width: auto; min-width: 100px; flex-shrink: 0; }
.inline-inputs input { flex: 1; min-width: 140px; }
@media (max-width: 720px) {
  .cfg-edit { gap: 8px; }
  .cfg-pair { gap: 8px 10px; }
  .cfg-row input,
  .cfg-row select,
  .cfg-row textarea { padding: 8px 10px; }
  .cfg-section-title { margin: 12px 0 6px; }
  .cfg-subtitle { margin: 8px 0 1px; }
}
@media (max-width: 480px) {
  .cfg-row > label { font-size: 12px; }
  .cfg-hint { font-size: 10.5px; }
}

/* 账号管理：大屏下与全局一致占满，表单保持适中 */
#sec-accounts .panel { max-width: none; margin-left: auto; margin-right: auto; }
#sec-accounts .cfg-row,
#sec-accounts .actions { max-width: 560px; }
#sec-accounts .actions { flex-wrap: wrap; }
#sec-accounts #acc-msg { flex: 1 1 auto; min-width: 0; }
#acc-table { table-layout: fixed; }
#acc-table th:nth-child(1),
#acc-table td:nth-child(1) { width: 22%; word-break: break-all; }
#acc-table th:nth-child(2),
#acc-table td:nth-child(2) { width: 20%; word-break: break-all; }
#acc-table th:nth-child(3),
#acc-table td:nth-child(3) { width: 12%; }
#acc-table th:nth-child(4),
#acc-table td:nth-child(4) { width: 10%; }
#acc-table th:nth-child(5),
#acc-table td:nth-child(5) { width: 28%; text-align: right; }
#acc-table th:nth-child(6),
#acc-table td:nth-child(6) { width: 8%; text-align: center; }
.acc-status { font-size: 12px; font-weight: 600; }
.acc-status.online { color: var(--green); }
.acc-status.offline { color: var(--muted); }

/* 账号操作记录 */
#sec-account-logs .panel { max-width: none; margin-left: auto; margin-right: auto; }
#acc-logs-table { table-layout: fixed; }
#acc-logs-table th:nth-child(1),
#acc-logs-table td:nth-child(1) { width: 22%; }
#acc-logs-table th:nth-child(2),
#acc-logs-table td:nth-child(2) { width: 14%; }
#acc-logs-table th:nth-child(3),
#acc-logs-table td:nth-child(3) { width: 20%; word-break: break-all; }
#acc-logs-table th:nth-child(4),
#acc-logs-table td:nth-child(4) { width: 44%; }
.toggle-item { display: flex; align-items: center; gap: 10px; }
.toggle-item > label { color: var(--text); font-size: 13px; font-weight: 600; }

/* 开关 */
.switch { position: relative; display: inline-block; width: 46px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0; background: #243049;
  border: 1px solid var(--border); border-radius: 24px; transition: .2s;
}
.slider::before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 2px;
  background: #9fb2d4; border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: rgba(52,211,153,.45); border-color: rgba(52,211,153,.7); }
.switch input:checked + .slider::before { transform: translateX(22px); background: var(--green); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 6px 13px; font-size: 12.5px; color: var(--text);
}
.chip .n { color: var(--cyan2); font-weight: 700; margin-left: 6px; }
.chip.ok { border-color: rgba(52,211,153,.4); color: var(--green); }
.chip.active { border-color: rgba(56,189,248,.7); background: rgba(56,189,248,.14); color: #38bdf8; }

/* 知识库文章列表 */
.kb-header { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.kb-title-row { display: flex; align-items: center; justify-content: space-between; }
.kb-title-row .panel-title { margin-bottom: 0; }
.kb-title-row #kb-list-count { font-weight: 400; color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.kb-search-row { display: flex; gap: 8px; }
.kb-search-row input {
  flex: 1; background: #05080f; border: 1px solid var(--border); border-radius: 9px;
  padding: 9px 12px; color: var(--text); font-size: 13px; outline: none;
}
.kb-search-row input:focus { border-color: var(--cyan); }
.kb-eat-row { display: flex; gap: 8px; align-items: center; }
.btn-eat { background: linear-gradient(135deg, #f093fb, #f5576c); color: #fff; border: none; font-weight: 600; }
.btn-eat:hover { filter: brightness(1.08); }

/* 登录层 */
.login-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 8, 18, 0.92);
}
.login-card {
  width: 340px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--border-radius-lg, 12px); padding: 28px 26px;
}
.login-logo {
  width: 54px; height: 54px; border-radius: 14px; margin: 0 auto 12px;
  background: linear-gradient(135deg, #fb7185, #fb923c); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 600;
}
.login-title { text-align: center; font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.login-sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.login-label { display: block; color: var(--muted); font-size: 12px; margin: 10px 0 6px; }
.login-input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg2); color: var(--text); font-size: 14px; outline: none;
}
.login-input:focus { border-color: var(--cyan); }
.login-btn {
  width: 100%; margin-top: 16px; padding: 10px; border: none; border-radius: 8px;
  background: linear-gradient(90deg, rgba(56,189,248,.25), rgba(34,211,238,.25));
  border: 1px solid rgba(56,189,248,.5); color: var(--cyan); font-size: 14px; cursor: pointer;
}
.login-btn:hover { filter: brightness(1.1); }
.login-hint { margin-top: 12px; font-size: 12px; color: var(--muted); background: var(--bg2); border-radius: 8px; padding: 8px; }
.user-box { display: flex; align-items: center; gap: 8px; margin-right: 10px; }
.user-name { font-size: 13px; color: var(--text); }
.user-role {
  font-size: 12px; background: rgba(56,189,248,.18); color: var(--cyan);
  border-radius: 6px; padding: 2px 8px;
}
.eat-subtype {
  background: #05080f; border: 1px solid var(--border); border-radius: 9px;
  padding: 9px 12px; color: var(--text); font-size: 13px; outline: none; cursor: pointer;
}
.eat-subtype:focus { border-color: var(--cyan); }
.eat-result {
  margin-top: 2px; padding: 12px 14px; border-radius: 11px;
  background: rgba(245, 87, 108, 0.08); border: 1px solid rgba(245, 87, 108, 0.35);
}
.eat-title { font-size: 15px; margin-bottom: 4px; }
.eat-type { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.eat-desc { font-size: 13.5px; line-height: 1.6; color: var(--text); }
.eat-kw { font-size: 12px; color: var(--muted); margin-top: 6px; }
.kb-empty { text-align: center; padding: 28px 0; color: var(--muted); font-size: 13px; }
#kb-table td.kb-title {
  max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--cyan2); font-weight: 500;
}
#kb-table td.kb-title:hover { color: var(--cyan); text-decoration: underline; }
#kb-table td:first-child { color: var(--muted); font-variant-numeric: tabular-nums; }

/* 功能清单 */
.cmd-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 16px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.cmd-toolbar input[type="text"] {
  flex: 1; min-width: 180px; background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 7px 12px; font-size: 13px;
}
.cmd-toolbar input:focus { outline: none; border-color: var(--cyan); }
.cmd-toolbar select {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 7px 10px; font-size: 13px;
}
.cmd-toolbar #cmd-page-info { color: var(--muted); font-size: 12.5px; min-width: 80px; text-align: center; }
.cmd-toolbar-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.cmd-toggle-admin {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 12.5px; cursor: pointer; user-select: none;
}
.cmd-toggle-admin input { accent-color: var(--cyan); }
.cmd-cat-nav {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 14px;
}
.cmd-cat-tab {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 7px 12px; font-size: 12.5px; cursor: pointer;
  transition: all .15s ease; white-space: nowrap; user-select: none;
}
.cmd-cat-tab:hover { border-color: var(--cyan); color: var(--cyan); }
.cmd-cat-tab.active { background: var(--cyan); color: #fff; border-color: var(--cyan); font-weight: 600; }
.cmd-groups { display: flex; flex-direction: column; gap: 16px; }
.cmd-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cmd-cols-single { grid-template-columns: minmax(0, 1fr); }
.cmd-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cmd-col-info .cmd-group {
  border-color: rgba(56,189,248,.5);
  box-shadow: 0 0 0 1px rgba(56,189,248,.18), 0 6px 18px rgba(56,189,248,.08);
}
.cmd-col-info .panel-title { color: var(--cyan); }
@media (max-width: 920px) {
  .cmd-cols { grid-template-columns: 1fr; }
}
.cmd-group { margin-bottom: 0; }
.cmd-group-header { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.cmd-toggle {
  width: 22px; height: 22px; display: grid; place-items: center;
  border-radius: 6px; color: var(--muted); font-size: 11px;
  transition: .15s;
}
.cmd-group-header:hover .cmd-toggle { color: var(--cyan); background: rgba(56,189,248,.08); }
.cmd-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.cmd-list.collapsed { display: none; }
.cmd-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px;
}
.cmd-item.compact { padding: 8px 12px; }
.cmd-name {
  font-size: 14px; font-weight: 600; color: var(--cyan2); margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.cmd-item.compact .cmd-name { margin-bottom: 0; }
.cmd-scope {
  font-size: 11px; font-weight: 500; color: var(--muted);
  background: rgba(56,189,248,.08); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 12px;
}
.cmd-aliases { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.cmd-item.compact .cmd-aliases,
.cmd-item.compact .cmd-desc,
.cmd-item.compact .cmd-actions { display: none; }
.cmd-item.compact .cmd-desc.collapsed { display: none; }
.cmd-list.compact .cmd-item:hover .cmd-desc:not(.collapsed) { display: block; }
.cmd-list.compact .cmd-item:hover .cmd-actions { display: flex; }
.chip.sm { padding: 3px 10px; font-size: 11.5px; border-radius: 14px; color: var(--muted); cursor: default; }
.chip.sm:hover { border-color: var(--cyan); color: var(--cyan); }
.cmd-desc { font-size: 12.5px; color: var(--text); line-height: 1.6; }
.cmd-actions {
  display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border);
}
.cmd-actions .btn { padding: 5px 10px; font-size: 11.5px; }
.nav-feature { padding-left: 24px; font-size: 12.5px; opacity: .9; }
.code-box {
  background: #05080f; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-family: monospace; font-size: 13px; color: var(--cyan2); word-break: break-all;
}

/* 弹窗 */
.modal {
  position: fixed; inset: 0; z-index: 100; align-items: center; justify-content: center;
}
.modal-overlay { position: fixed; inset: 0; background: rgba(2,6,23,.75); }
.modal-body {
  position: relative; width: min(840px, calc(100vw - 32px)); max-height: 86vh;
  background: linear-gradient(160deg, var(--surface2), var(--surface));
  border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px;
  display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.modal-header h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--cyan); }
.modal-meta {
  display: flex; flex-wrap: wrap; gap: 10px 16px;
  color: var(--muted); font-size: 12px; margin-bottom: 12px; padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}
.modal-meta span { background: rgba(56,189,248,.08); padding: 4px 8px; border-radius: 6px; }
.modal-content {
  flex: 1; overflow-y: auto; white-space: pre-wrap; word-break: break-all;
  font-size: 13px; line-height: 1.8; color: var(--text);
  padding-right: 4px;
}
.modal-actions { margin-top: 14px; text-align: right; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #1e2c4a; border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* 排行榜数据 */
.rk-chart-panel .rk-charts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  min-height: 260px;
}
.rk-chart-box { min-height: 240px; position: relative; min-width: 0; }
@media (max-width: 920px) {
  .rk-chart-panel .rk-charts { grid-template-columns: 1fr; }
}

/* 排行榜紧凑模式 */
.rk-summary-cards.rk-compact {
  gap: 10px;
  margin-bottom: 10px;
}
.rk-summary-cards.rk-compact .card {
  padding: 10px 12px;
  border-radius: 10px;
}
.rk-summary-cards.rk-compact .card-label {
  font-size: 11px;
}
.rk-summary-cards.rk-compact .card-value {
  font-size: 17px;
  margin: 3px 0 1px;
}
.rk-summary-cards.rk-compact .card-sub {
  font-size: 10.5px;
}

.rk-chart-panel.rk-compact {
  padding: 12px 14px;
  margin-bottom: 12px;
}
.rk-chart-panel.rk-compact .panel-title {
  font-size: 12.5px;
  margin-bottom: 8px;
}
.rk-chart-panel.rk-compact .rk-charts {
  gap: 14px;
  min-height: 190px;
}
.rk-chart-panel.rk-compact .rk-chart-box {
  min-height: 175px;
}
/* 历史趋势：单图占满整行，且更高一些（提高特异性以覆盖 .rk-compact .rk-chart-box） */
.rk-charts-single { grid-template-columns: 1fr; min-height: auto; }
.rk-chart-panel.rk-compact .rk-chart-box.rk-chart-box-wide { min-height: 220px; }
.rk-sub { font-size: 11px; color: #7e93b3; font-weight: 400; margin-left: 6px; }
.rk-sub.filter-active { color: #ff9800; font-weight: 700; }
.rk-table-wrap { overflow-x: auto; margin-top: 4px; }
.rk-guild-table, .rk-job-table { width: 100%; border-collapse: collapse; font-size: 12px; color: #c3d2e8; table-layout: fixed; }
.rk-guild-table th, .rk-guild-table td,
.rk-job-table th, .rk-job-table td {
  padding: 6px 10px; border-bottom: 1px solid rgba(255,255,255,.06); text-align: left; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.rk-guild-table th.num, .rk-guild-table td.num,
.rk-job-table th.num, .rk-job-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.rk-guild-table thead th,
.rk-job-table thead th {
  color: #93a8c8; font-weight: 600; background: rgba(255,255,255,.03);
}
/* 固定表头列宽，确保 thead/tbody 对齐（列序拖拽后由 JS 同步宽度） */
.rk-guild-table thead th[data-col="index"] { width: 42px; }
.rk-guild-table thead th[data-col="guild"] { width: 16%; }
.rk-guild-table thead th[data-col="count"] { width: 10%; }
.rk-guild-table thead th[data-col="avg"] { width: 13%; }
.rk-guild-table thead th[data-col="top"] { width: 12%; }
.rk-guild-table thead th[data-col="median"] { width: 12%; }
.rk-guild-table thead th[data-col="top80_avg"] { width: 12%; }
.rk-guild-table thead th[data-col="top_server"] { width: 13%; }
.rk-guild-table thead th[data-col="server_count"] { width: 10%; }

/* 帮派平均功力柱状图分页 */
.rk-chart-pager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 10px; font-size: 12px; color: #93a8c8;
}
.rk-chart-pager .pager-btns { display: flex; align-items: center; gap: 6px; }
.rk-chart-pager .pager-jump input,
.rk-chart-pager .pager-size select {
  background: #111827; color: #c3d2e8; border: 1px solid rgba(255,255,255,.1);
  border-radius: 5px; padding: 3px 6px; font-size: 12px;
}
.rk-chart-pager .pager-jump input { width: 50px; }
.rk-job-table thead th[data-col="index"] { width: 42px; }
.rk-job-table thead th[data-col="job"],
.rk-job-table thead th[data-sort="job"] { width: 80px; }
.rk-job-table thead th[data-col="count"] { width: 13%; }
.rk-job-table thead th[data-col="avg"] { width: 15%; }
.rk-job-table thead th[data-col="max"] { width: 15%; }
.rk-job-table thead th[data-col="median"] { width: 15%; }
.rk-job-table thead th[data-col="min"] { width: 15%; }
.rk-guild-table.frozen-thead thead th,
.rk-job-table.frozen-thead thead th { position: sticky; top: 0; z-index: 5; }
.rk-guild-table th.sortable,
.rk-job-table th.sortable { cursor: pointer; user-select: none; }
.rk-guild-table th.sortable:hover,
.rk-job-table th.sortable:hover { color: #cfe0f5; }
.rk-guild-table th.sortable.active,
.rk-job-table th.sortable.active { color: #38bdf8; }
.rk-guild-table th.sortable.active::after,
.rk-job-table th.sortable.active::after { content: " \25BC"; font-size: 9px; }
.rk-guild-table th.sortable.active.asc::after,
.rk-job-table th.sortable.active.asc::after { content: " \25B2"; }
.rk-guild-table tbody tr:hover,
.rk-job-table tbody tr:hover { background: rgba(56,189,248,.06); }
.rk-guild-table td:first-child,
.rk-job-table td:first-child { color: #7e93b3; }

/* 面板收起/展开 */
.panel-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; margin-right: 6px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: 4px; color: #93a8c8; cursor: pointer; font-size: 10px;
  vertical-align: middle; padding: 0;
}
.panel-toggle:hover { background: rgba(56,189,248,.15); color: #38bdf8; }
.panel-toggle::before { content: "▼"; }
.panel.collapsed .panel-toggle::before { content: "▶"; }
.panel.collapsed .panel-body { display: none; }
.panel.collapsed .panel-title { margin-bottom: 0; }

/* 图表横向滚动（Chart.js 滚动版须配合 JS 设 canvas.style.width + responsive:false） */
.rk-chart-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  min-width: 0;
}
.rk-chart-scroll canvas {
  display: block;
}
.rk-chart-scroll.rk-scrolling {
  cursor: grabbing;
}
.rk-chart-scroll {
  cursor: grab;
}

/* 帮派明细分页 */
.rk-guild-pager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 10px; font-size: 12px; color: #93a8c8;
}
.rk-guild-pager .pager-btns { display: flex; align-items: center; gap: 6px; }
.rk-guild-pager .pager-jump input,
.rk-guild-pager .pager-size select {
  background: #111827; color: #c3d2e8; border: 1px solid rgba(255,255,255,.1);
  border-radius: 5px; padding: 3px 6px; font-size: 12px;
}
.rk-guild-pager .pager-jump input { width: 50px; }

/* 历史对比表分页（同款样式） */
.rk-compare-pager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 10px; font-size: 12px; color: #93a8c8;
}
.rk-compare-pager .pager-btns { display: flex; align-items: center; gap: 6px; }
.rk-compare-pager .pager-jump input,
.rk-compare-pager .pager-size select {
  background: #111827; color: #c3d2e8; border: 1px solid rgba(255,255,255,.1);
  border-radius: 5px; padding: 3px 6px; font-size: 12px;
}
.rk-compare-pager .pager-jump input { width: 50px; }

/* 子表列宽拖拽柄 */
.rk-resizer-sub {
  position: absolute; right: 0; top: 0; bottom: 0; width: 6px;
  cursor: col-resize; background: transparent; z-index: 2;
}
.rk-guild-table th, .rk-job-table th, .rk-compare-table th { position: relative; }
.rk-guild-table th:hover .rk-resizer-sub,
.rk-job-table th:hover .rk-resizer-sub,
.rk-compare-table th:hover .rk-resizer-sub { background: rgba(56,189,248,.25); }

.rk-compare-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 8px 0 6px; font-size: 12px; color: #93a8c8; }
.rk-compare-controls label { display: flex; align-items: center; gap: 5px; }
.rk-compare-controls select { background: #111827; color: #c3d2e8; border: 1px solid rgba(255,255,255,.1); border-radius: 5px; padding: 4px 8px; font-size: 12px; }
.rk-compare-seg { display: inline-flex; margin-left: auto; background: rgba(255,255,255,.05); border-radius: 5px; padding: 2px; }
.rk-compare-tab { background: transparent; border: none; color: #93a8c8; padding: 4px 10px; border-radius: 4px; font-size: 12px; cursor: pointer; }
.rk-compare-tab.active { background: rgba(56,189,248,.18); color: #38bdf8; }
.rk-compare-note { font-size: 11.5px; color: #8298ba; margin-bottom: 6px; min-height: 16px; }
.rk-compare-table { width: 100%; border-collapse: collapse; font-size: 12px; color: #c3d2e8; }
.rk-compare-table th, .rk-compare-table td {
  padding: 6px 10px; border-bottom: 1px solid rgba(255,255,255,.06); text-align: left; white-space: nowrap;
}
.rk-compare-table th.num, .rk-compare-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.rk-compare-table thead th {
  color: #93a8c8; font-weight: 600; background: rgba(255,255,255,.03);
}
.rk-compare-table.frozen-thead thead th { position: sticky; top: 0; z-index: 5; }
.rk-compare-table th.sortable { cursor: pointer; user-select: none; }
.rk-compare-table th.sortable:hover { color: #cfe0f5; }
.rk-compare-table th.sortable.active { color: #38bdf8; }
.rk-compare-table th.sortable.active::after { content: " \25BC"; font-size: 9px; }
.rk-compare-table th.sortable.active.asc::after { content: " \25B2"; }
.rk-compare-table tbody tr:hover { background: rgba(56,189,248,.06); }
.rk-compare-table td:first-child { color: #7e93b3; }
.rk-compare-up { color: #4ade80; }
.rk-compare-down { color: #fb7185; }
.rk-trend-delta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 11.5px;
  color: #9fb3d1;
}
.rk-delta-vs { color: #7e93b3; }
.rk-delta-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  color: #c3d2e8;
}
.rk-delta-chip em { font-style: normal; color: #8298ba; font-size: 10.5px; }
.rk-delta-chip.up { color: #4ade80; border-color: rgba(74,222,128,.25); }
.rk-delta-chip.down { color: #fb7185; border-color: rgba(251,113,133,.25); }
.rk-trend-note {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted, #7d8db0);
  margin-left: 8px;
}
@media (max-width: 1200px) {
  .rk-summary-cards.rk-compact { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 920px) {
  .rk-summary-cards.rk-compact { grid-template-columns: repeat(2, 1fr); }
  .rk-chart-panel.rk-compact .rk-charts { grid-template-columns: 1fr; min-height: auto; }
}
@media (max-width: 640px) {
  .rk-summary-cards.rk-compact { grid-template-columns: repeat(2, 1fr); }
}
.rk-filters {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 0;
}
.rk-filters input[type="text"],
.rk-filters select {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 7px 10px; font-size: 13px; min-width: 140px;
}
.rk-filters input[type="text"] { min-width: 220px; }
.rk-filters select { min-width: 130px; }
.rk-filters input:focus,
.rk-filters select:focus { outline: none; border-color: var(--cyan); }
.rk-table-wrap {
  overflow: auto; max-height: 62vh; border: 1px solid var(--border); border-radius: 10px;
}
.rk-table-wrap .tbl { min-width: 100%; border: none; table-layout: fixed; }
.rk-table-wrap .tbl th,
.rk-table-wrap .tbl td {
  white-space: nowrap; font-size: 12px; padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.rk-table-wrap .tbl th {
  position: relative; user-select: none;
  background: linear-gradient(180deg, #1e3a5f 0%, #142238 100%);
  color: #e0f2fe; font-weight: 700; font-size: 13px;
  border-bottom: 2px solid var(--cyan);
  cursor: grab;
}
.rk-table-wrap.frozen-thead .tbl th {
  position: sticky; top: 0; z-index: 2;
}
.rk-table-wrap .tbl tr:hover td { background: rgba(56,189,248,.06); }
.rk-table-wrap .tbl tr.rk-top td { background: rgba(251,191,36,.08); }
.rk-table-wrap .tbl tr.rk-top:hover td { background: rgba(251,191,36,.14); }
.sec-subtitle { color: var(--muted); font-size: 14px; font-weight: 500; margin-left: 8px; }

/* 排行榜列宽拖拽 */
.rk-table-wrap .tbl th,
.rk-table-wrap .tbl td {
  overflow: hidden;
  text-overflow: ellipsis;
}
.rk-table-wrap .tbl th:active { cursor: grabbing; }
.rk-table-wrap .tbl th.rk-dragging { opacity: .55; background: #0f2942; }
.rk-table-wrap .tbl th.rk-drag-over { background: #26547c; box-shadow: inset 0 0 0 2px var(--cyan); }

.rk-resizer {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  z-index: 3;
  background: rgba(56,189,248,.55);
  opacity: 0;
  transition: opacity .15s;
}
.rk-table-wrap .tbl th:hover .rk-resizer { opacity: 1; }

/* 表头工具栏 */
.rk-table-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
.rk-table-header .panel-title { margin: 0; }
.rk-freeze-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted); margin-left: auto;
  cursor: pointer; user-select: none;
}
.rk-freeze-toggle .switch { flex: 0 0 auto; }
.panel-title.rk-title-with-toggle {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
.panel-title.rk-title-with-toggle > span:first-child,
.panel-title.rk-title-with-toggle > button:first-child { flex-shrink: 0; }

/* 导出 CSV 按钮：推到标题栏右侧，紧邻「冻结首行」 */
.rk-export-btn { margin-left: auto; white-space: nowrap; }
/* 帮派：关键字输入 + 下拉候选（同一行内紧凑排布） */
.rk-combo { display: inline-flex; gap: 6px; align-items: center; }
.rk-combo input[type="text"] { min-width: 150px; width: 150px; }
.rk-combo select { min-width: 150px; max-width: 220px; }
/* 导出范围 + 导出按钮：靠右成组，内部不重复 margin-left:auto */
.rk-export-group {
  display: inline-flex; gap: 6px; align-items: center; margin-left: auto;
  padding-left: 10px; border-left: 1px solid var(--border);
}
.rk-export-group label { font-size: 12px; color: var(--muted, #8aa); white-space: nowrap; }
.rk-export-group .rk-export-btn { margin-left: 0; }
.rk-export-group select { min-width: 110px; }
.rk-export-btn + .rk-freeze-toggle { margin-left: 0; }

/* 凤凰集帮派明细：标题栏内联「人数≥N」筛选 */
.rk-inline-filter {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-dim); white-space: nowrap;
}
.rk-inline-filter input[type="number"] {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 4px 8px; font-size: 12px; width: 60px;
}
.rk-inline-filter input:focus { outline: none; border-color: var(--cyan); }
.rk-inline-filter .btn { padding: 4px 10px; font-size: 12px; }

/* 右键列菜单 */
.rk-col-menu {
  position: fixed; z-index: 1000;
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  padding: 8px 0; min-width: 160px; max-width: 240px;
  max-height: 70vh; overflow-y: auto;
}
.rk-col-menu-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px 8px 14px; font-size: 12px; color: var(--muted);
  border-bottom: 1px solid var(--border); margin-bottom: 4px;
  gap: 10px;
}
.rk-col-menu-close {
  background: transparent; border: none; color: var(--muted);
  font-size: 14px; cursor: pointer; padding: 2px 6px; border-radius: 4px;
  line-height: 1;
}
.rk-col-menu-close:hover { background: rgba(255,255,255,.1); color: var(--text); }
.rk-col-menu-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px; font-size: 13px; cursor: pointer;
  transition: background .12s;
}
.rk-col-menu-item:hover { background: rgba(56,189,248,.12); }
.rk-col-menu-item input[type="checkbox"] { cursor: pointer; }
.rk-col-menu-reset {
  margin: 8px 14px 4px; width: calc(100% - 28px);
}

/* 分页每页行数选择 */
.pager-size {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--border);
  font-size: 13px; color: var(--muted);
}
.pager-size select {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 8px; font-size: 13px;
}
.pager-size select:focus { outline: none; border-color: var(--cyan); }

/* 密码显示/隐藏切换（登录框 + 账号管理表单共用） */
.pwd-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pwd-wrap input {
  width: 100%;
  padding-right: 38px;
}
.login-pwd-wrap { position: relative; display: flex; align-items: center; }
.acc-pwd-wrap { position: relative; display: flex; align-items: center; }
.pwd-eye {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  opacity: .7;
  user-select: none;
  transition: opacity .12s;
}
.pwd-eye:hover { opacity: 1; }

/* 只读账号：锁定配置区 UI */
.readonly-mode input,
.readonly-mode textarea,
.readonly-mode select {
  background: rgba(30, 40, 60, .4) !important;
  color: var(--muted) !important;
  cursor: not-allowed !important;
  border-color: rgba(34, 48, 82, .5) !important;
}
.readonly-mode input:disabled + .slider,
.readonly-mode .switch input:disabled + .slider {
  opacity: .5; cursor: not-allowed;
}
.readonly-hint {
  color: var(--gold);
  background: rgba(251, 191, 36, .08);
  border: 1px solid rgba(251, 191, 36, .25);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
}

/* 三次元图库网格 */
.three-d-filter { display: flex; gap: 10px; margin-bottom: 14px; align-items: center; }
.three-d-filter input { flex: 1; max-width: 360px; }

/* ============ 手机 / 窄屏适配 ============ */
/* 汉堡按钮与遮罩默认隐藏，仅窄屏启用 */
.hamburger { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 820px) {
  /* 顶栏：汉堡出现；状态点换行到第二行避免拥挤 */
  .hamburger {
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 auto; width: 40px; height: 40px; padding: 0; margin-right: 6px;
    font-size: 20px; line-height: 1; border-radius: 8px;
  }
  .topbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; }
  .topbar .pills { order: 3; width: 100%; justify-content: flex-start; gap: 10px; }
  .topbar .actions { margin-left: auto; gap: 6px; flex-wrap: wrap; }

  /* 侧边栏改为抽屉：默认移出屏幕，.open 时滑入 */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 60;
    width: 250px; flex: 0 0 250px;
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: 4px 0 28px rgba(0,0,0,.55);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.show {
    display: block; position: fixed; inset: 0; z-index: 55;
    background: rgba(2, 6, 14, .55);
  }
  .main { width: 100%; }

  /* 触控目标放大，避免误触 */
  .nav-item { padding: 13px 14px; font-size: 14px; }
  .nav-subitem { padding: 12px 12px 12px 24px; font-size: 13.5px; }
  .nav-group-title { padding: 12px 12px 2px; }
  .btn { min-height: 40px; }

  /* 排行榜 / 全区表格：固定最小宽度，窄屏横向滚动而非压扁 */
  .rk-table-wrap .tbl { min-width: 720px; }
  .rk-guild-table, .rk-job-table { min-width: 560px; }
}

@media (max-width: 480px) {
  .topbar .actions .btn { padding: 8px 10px; font-size: 12px; min-height: 38px; }
  .content { padding: 14px; }
  .sec-title { font-size: 17px; }
  /* 登录卡窄屏全宽 */
  .login-card { width: 92%; max-width: 360px; padding: 24px 18px; }
  .login-input { padding: 12px; font-size: 16px; }  /* 16px 防 iOS 聚焦缩放 */
}
.three-d-toolbar { display: flex; align-items: center; gap: 8px; }
.three-d-switch-label { color: var(--muted); font-size: 12px; user-select: none; }
.sec-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sec-title-row .sec-title { margin-bottom: 0; }
.three-d-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.three-d-card {
  background: rgba(17, 24, 39, .65);
  border: 1px solid rgba(55, 65, 81, .6);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.three-d-img-wrap {
  aspect-ratio: 3/4;
  overflow: hidden;
  background: rgba(0, 0, 0, .25);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.three-d-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.three-d-card.img-hidden .three-d-img-wrap img { display: none; }
.three-d-img-mask {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  background: rgba(17, 24, 39, .85);
  font-size: 12px;
  user-select: none;
  cursor: pointer;
  transition: background .15s ease;
}
.three-d-img-mask:hover { background: rgba(17, 24, 39, .72); color: #e5e7eb; }
.three-d-img-mask .lock-icon { font-size: 24px; }
.three-d-info { padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.three-d-info .tag { margin: 0; }
.three-d-fname {
  flex: 1 1 100%;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ===================== 权限白名单：一行一个号 + 昵称/群名 + 分页（2026-10-01 新增） ===================== */
.wl-box {
  border: 1px solid var(--border); border-radius: 9px;
  background: #05080f; overflow: hidden;
}
.wl-head, .wl-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; }
.wl-head {
  background: rgba(56, 189, 248, .06);
  border-bottom: 1px solid var(--border);
  font-size: 11px; color: var(--muted); letter-spacing: .3px;
}
.wl-col-num { flex: 0 0 150px; }
.wl-col-name { flex: 1 1 auto; min-width: 0; }
.wl-col-act { flex: 0 0 26px; }
.wl-rows { max-height: 330px; overflow-y: auto; }
.wl-row { border-bottom: 1px dashed var(--border); }
.wl-row:last-child { border-bottom: none; }
.wl-row input {
  background: #0a1220; border: 1px solid var(--border); border-radius: 6px;
  padding: 5px 8px; color: var(--text); font-size: 12.5px; outline: none;
}
.wl-row input:focus { border-color: var(--cyan); }
.wl-row input.wl-num { flex: 0 0 150px; font-family: "Consolas", "Courier New", monospace; }
.wl-row input.wl-name { flex: 1 1 auto; min-width: 0; }
.wl-row input.wl-name.auto { color: var(--muted); }
.wl-nores { color: var(--muted); font-size: 12px; }
.wl-row .wl-del {
  flex: 0 0 26px; height: 26px; border: none; cursor: pointer;
  background: rgba(251, 113, 133, .12); color: var(--red);
  border-radius: 6px; font-size: 13px; line-height: 1;
}
.wl-row .wl-del:hover { background: rgba(251, 113, 133, .28); }
.wl-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 12px; }
.wl-foot {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 7px 10px; border-top: 1px solid var(--border);
  background: rgba(56, 189, 248, .035);
}
.wl-add {
  border: 1px dashed var(--cyan); background: transparent; color: var(--cyan);
  border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer;
}
.wl-add:hover { background: rgba(56, 189, 248, .12); }
.wl-count { color: var(--muted); font-size: 11px; }
.wl-pager { margin-left: auto; display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.wl-pager button {
  border: 1px solid var(--border); background: #0a1220; color: var(--text);
  border-radius: 5px; padding: 2px 9px; cursor: pointer; font-size: 13px; line-height: 1.2;
}
.wl-pager button:disabled { opacity: .3; cursor: default; }
.wl-pager .wl-cur { color: var(--cyan); font-weight: 600; min-width: 42px; text-align: center; }
.wl-pager select {
  background: #0a1220; border: 1px solid var(--border); color: var(--text);
  border-radius: 5px; padding: 2px 6px; font-size: 12px; width: auto;
}
@media (max-width: 720px) {
  .wl-head { display: none; }
  .wl-row { flex-wrap: wrap; gap: 6px; }
  .wl-row input.wl-num { flex: 1 1 110px; min-width: 100px; }
  .wl-row input.wl-name { flex: 1 1 140px; min-width: 120px; }
  .wl-pager { margin-left: 0; }
}

/* ===================== 深空终端 redesign 叠层 ===================== */
/* 全局扫描线 + 细网格背景（不挡交互） */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(46,242,255,.025) 0 1px, transparent 1px 3px),
    linear-gradient(rgba(28,42,68,.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28,42,68,.35) 1px, transparent 1px);
  background-size: auto, 100% 38px, 38px 100%;
  mix-blend-mode: screen;
  opacity: .5;
}
.app { position: relative; z-index: 1; }

/* 品牌徽标：磷光渐变 + 外发光 */
.brand-logo {
  background: var(--grad); color: #04121a; font-weight: 800; font-size: 19px;
  box-shadow: 0 0 16px rgba(46,242,255,.55), inset 0 0 8px rgba(255,255,255,.25);
}
.brand-name {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--cyan);
}

/* 导航图标 */
.nav-ico {
  width: 16px; height: 16px; flex: 0 0 16px; margin-right: 9px;
  stroke: currentColor; fill: none; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; opacity: .92;
}
.nav-subitem .nav-ico { width: 14px; height: 14px; flex-basis: 14px; margin-right: 7px; }

/* 导航激活项辉光 */
.nav-item.active {
  background: linear-gradient(90deg, rgba(46,242,255,.18), transparent);
  color: var(--cyan); border-left: 3px solid var(--cyan);
  box-shadow: inset 0 0 18px rgba(46,242,255,.12);
}
.nav-subitem.active {
  background: linear-gradient(90deg, rgba(46,242,255,.14), transparent);
  color: var(--cyan); border-left: 2px solid var(--cyan);
}

/* 卡片 / 面板：青色内发光 + 细描边 */
.card, .panel {
  border: 1px solid var(--border);
  box-shadow: 0 0 0 1px rgba(46,242,255,.04), 0 8px 26px rgba(0,0,0,.45),
              inset 0 0 22px rgba(46,242,255,.045);
  transition: box-shadow .25s, transform .25s, border-color .25s;
}
.card:hover, .panel:hover {
  border-color: rgba(46,242,255,.4);
  box-shadow: 0 0 0 1px rgba(46,242,255,.12), 0 10px 30px rgba(0,0,0,.5),
              inset 0 0 30px rgba(46,242,255,.09);
}
.sec-title { border-left: 4px solid var(--cyan); text-shadow: 0 0 16px rgba(46,242,255,.4); }

/* 数据读数用等宽字体，更像仪表盘 */
.card-value, .card-sub, .pager-info, code, pre,
table, td, th, input, .mono {
  font-family: var(--mono);
}
.card-value { letter-spacing: -.3px; text-shadow: 0 0 18px rgba(94,242,255,.35); }

/* 按钮悬停辉光 */
.btn:hover { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 14px rgba(46,242,255,.25); }
.btn-start:hover { box-shadow: 0 0 14px rgba(62,242,160,.3); }
.btn-stop:hover { box-shadow: 0 0 14px rgba(255,107,138,.3); }

/* 状态点呼吸增强 */
.dot-live { box-shadow: 0 0 10px var(--green); }

/* === 终端质感层（redesign 2026-10-10） === */
body::before{
  content:''; position:fixed; inset:0; pointer-events:none; z-index:0;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size:56px 56px;
}
body::after{
  content:''; position:fixed; inset:0; pointer-events:none; z-index:1;
  background:repeating-linear-gradient(0deg, rgba(0,0,0,0) 0 2px, rgba(46,242,255,.015) 2px 3px);
}
.app{ position:relative; z-index:2; }
.nav-ico{ width:17px; height:17px; flex-shrink:0; opacity:.8; stroke:currentColor; fill:none; transition:.15s; }
.nav-item:hover .nav-ico{ opacity:1; }
.nav-item.active .nav-ico{ opacity:1; filter:drop-shadow(0 0 5px var(--cyan-glow)); }
.nav-subitem .nav-ico{ width:14px; height:14px; opacity:.8; stroke:currentColor; fill:none; }
.nav-subitem:hover .nav-ico, .nav-subitem.active .nav-ico{ opacity:1; }

/* === 筛选预览面板（帮派 / 排名范围，2026-10-18） === */
#rk-panel-preview .panel-body { padding: 10px 12px 12px; }
#rk-panel-preview .rk-table-header { align-items: center; flex-wrap: wrap; gap: 8px; }
#rk-panel-preview .rk-inline-filter { gap: 8px; }
#rk-panel-preview .rk-inline-filter select { min-width: 110px; }

.rk-preview-stats {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px;
}
.rk-pv-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px;
  background: rgba(46,242,255,.06); border: 1px solid rgba(46,242,255,.22);
  color: var(--text); white-space: nowrap;
}
.rk-pv-chip b { color: var(--cyan); font-family: var(--mono); font-weight: 700; }
.rk-pv-chip.hit { border-color: rgba(62,242,160,.35); background: rgba(62,242,160,.08); }
.rk-pv-chip.hit b { color: var(--green); }
.rk-pv-chip.miss { border-color: rgba(255,107,138,.4); background: rgba(255,107,138,.08); }
.rk-pv-chip.miss b { color: var(--red); }
.rk-pv-chip.cond { color: var(--muted); border-style: dashed; background: transparent; }

.rk-preview-guilds {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px;
}
.rk-pv-gl { font-size: 12px; color: var(--muted); margin-right: 2px; }
.rk-pv-gchip {
  cursor: pointer; font-size: 12px; padding: 2px 9px; border-radius: 999px;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  transition: border-color .12s, color .12s, box-shadow .12s;
}
.rk-pv-gchip b { color: var(--gold); font-family: var(--mono); margin-left: 3px; }
.rk-pv-gchip:hover { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 10px var(--cyan-glow); }
.rk-pv-gchip:hover b { color: var(--cyan); }

.rk-preview-wrap { max-height: 330px; overflow: auto; }
.rk-preview-table { width: 100%; font-size: 12.5px; }
.rk-preview-table th { position: sticky; top: 0; z-index: 1; }
.rk-pv-empty, .rk-pv-more {
  text-align: center; color: var(--muted); font-size: 12px; padding: 14px 8px;
}
.rk-pv-more { border-top: 1px dashed var(--border); }
.rk-pv-muted { color: var(--muted); }

/* === 凤凰集筛选栏：两行并一行（2026-10-18） === */
.rk-filters-one { flex-wrap: nowrap; overflow-x: auto; gap: 8px; padding: 10px 0 8px; }
.rk-filters-one > * { flex: 0 0 auto; }
.rk-filters-one > input[type="text"] { min-width: 150px; }
.rk-filters-one .rk-combo { gap: 5px; }
.rk-filters-one .rk-combo input[type="text"] { min-width: 106px; width: 106px; }
.rk-filters-one .rk-combo select { min-width: 118px; max-width: 152px; }
.rk-filters-one > select { min-width: 92px; }
.rk-filters-one > label {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--muted); white-space: nowrap;
}
.rk-filters-one > label select { min-width: 82px; }
.rk-filters-one > label input[type="number"] {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 6px 8px; font-size: 12px;
}
.rk-filters-one .btn { padding: 6px 12px; font-size: 12.5px; white-space: nowrap; }
.rk-filters-one .rk-export-group { padding-left: 8px; gap: 5px; }
.rk-filters-one .rk-export-group select { min-width: 92px; }

/* 全区榜预览：帮派标签里的区服角标 */
.rk-pv-gchip .rk-pv-sv {
  font-style: normal; font-size: 11px; color: var(--muted);
  margin-left: 5px; padding-left: 5px; border-left: 1px solid var(--border);
}
/* 全区榜单/帮派组合框与凤凰集一致 */
#asr-filters-bar .rk-combo input[type="text"] { min-width: 100px; width: 100px; }
#asr-filters-bar .rk-combo select { min-width: 132px; max-width: 200px; }

/* 单行筛选栏·紧凑档（2026-10-18 二调）：目标是在 1400px 内容区一行排完，
   搜索框吃弹性剩余空间，其余控件固定窄宽；仍超宽时整条横向滚动而不是换行。 */
.rk-filters-one { gap: 6px; }
.rk-filters-one input[type="text"],
.rk-filters-one select { padding: 6px 8px; font-size: 12.5px; }
.rk-filters-one > input[type="text"] { min-width: 110px; flex: 1 1 130px; }
.rk-filters-one > select { min-width: 84px; }
.rk-filters-one .rk-combo { gap: 4px; }
.rk-filters-one .rk-combo input[type="text"] { min-width: 92px; width: 92px; flex: 0 0 92px; }
.rk-filters-one .rk-combo select { min-width: 104px; max-width: 132px; }
.rk-filters-one > label select { min-width: 76px; }
.rk-filters-one > label input[type="number"],
#rk-filter-gongli-custom { width: 62px !important; min-width: 0; }
.rk-filters-one .btn { padding: 6px 10px; font-size: 12px; }
.rk-filters-one .rk-export-group { padding-left: 6px; gap: 4px; }
.rk-filters-one .rk-export-group label { font-size: 11px; }
.rk-filters-one .rk-export-group select { min-width: 84px; }
/* 全区帮派下拉：别占 200px 空转（优先级高于前面的 #asr-filters-bar 规则） */
#asr-filters-bar .rk-combo select { min-width: 104px; max-width: 128px; }

/* === 预览数据表：分页 + 列勾选 / 拖序 / 调宽（2026-10-18） === */
.rk-preview-wrap { max-height: clamp(280px, 48vh, 560px); overflow: auto; }
.rk-preview-table.pv-table { border-collapse: separate; border-spacing: 0; }
.rk-preview-table.pv-table th {
  position: sticky; top: 0; z-index: 2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding-right: 14px; cursor: grab;
}
.rk-preview-table.pv-table th.rk-dragging { opacity: .45; }
.rk-preview-table.pv-table th.rk-drag-over { box-shadow: inset 2px 0 0 var(--cyan); }
.rk-preview-table.pv-table td {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rk-preview-table.pv-table td.num { font-family: var(--mono); }

/* 列宽拖拽把手 */
.pv-resizer {
  position: absolute; right: 0; top: 0; bottom: 0; width: 7px;
  cursor: col-resize; z-index: 3; background: transparent;
}
.rk-preview-table.pv-table th:hover .pv-resizer { background: rgba(46,242,255,.35); }
.pv-resizer:hover { background: rgba(46,242,255,.6); }

/* 分页条 */
.pv-pager {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border);
  font-size: 12px; color: var(--muted);
}
.pv-pager .pv-pg-info b { color: var(--cyan); font-family: var(--mono); }
.pv-pager .pv-pg-btns { display: inline-flex; align-items: center; gap: 5px; }
.pv-pager .pv-pg-btns .btn { padding: 3px 9px; font-size: 12px; }
.pv-pager .pv-pg-btns .btn[disabled] { opacity: .38; cursor: not-allowed; }
.pv-pager .pv-pg-jump {
  width: 56px; padding: 3px 6px; font-size: 12px; text-align: center;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
}
.pv-pager .pv-pg-size { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; }
.pv-pager .pv-pg-size select { padding: 3px 6px; font-size: 12px; }
.pv-col-hint {
  padding: 6px 14px 4px; font-size: 11.5px; color: var(--muted);
  border-top: 1px dashed var(--border); margin-top: 4px;
}

/* ---------------- 公告群群发面板（2026-10-20 新增） ---------------- */
/* 整行占位：.cfg-pair 是 grid，默认只占一列（min 320px），面板会被挤窄 */
.cfg-row.cfg-span-all { grid-column: 1 / -1; }

/* 面板整体限宽 720px：铺满整页会又高又宽（用户 2026-10-20 反馈「太大太宽」） */
.tdbc { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 720px; min-width: 0; }
.tdbc textarea {
  width: 100%; min-height: 96px; max-height: 300px; resize: vertical;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6;
  padding: 9px 12px; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
}
.tdbc textarea:focus { outline: none; border-color: rgba(46,242,255,.5); box-shadow: 0 0 0 2px var(--cyan-glow); }
.tdbc-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tdbc-tools .btn { padding: 4px 10px; font-size: 12px; }
.tdbc-hint { font-size: 11.5px; color: var(--muted); }

/* 群选择：紧凑 chip + 两列自适应网格（⛔ 不做整行列表，一列一行太占高度） */
.tdbc-targets {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(206px, 1fr));
  gap: 6px; padding: 8px;
  border: 1px dashed var(--border); border-radius: 8px;
}
.tdbc-t {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  padding: 4px 8px; font-size: 12px; line-height: 1.45; cursor: pointer;
  background: rgba(46,242,255,.03); border: 1px solid var(--border); border-radius: 6px;
}
.tdbc-t:hover { border-color: rgba(46,242,255,.42); }
/* ⛔ 必须用 `.tdbc .tdbc-t input` 这种更高特异性：全局 `.cfg-row input { width:100% }`
   会把 checkbox 拉成整行宽（2026-10-20 首版就栽在这，群名被挤出可视区）。 */
.tdbc .tdbc-t input {
  flex: 0 0 13px; width: 13px; height: 13px; max-width: none; margin: 0;
  accent-color: var(--cyan);
}
.tdbc-t b { flex: 0 0 auto; font-family: var(--mono); color: var(--cyan); font-weight: 600; }
.tdbc-t span {
  flex: 1 1 auto; min-width: 0; text-align: right; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tdbc-all { display: flex; gap: 6px; align-items: center; grid-column: 1 / -1; }
.tdbc-all button {
  font-size: 11.5px; padding: 2px 8px; cursor: pointer;
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
}
.tdbc-all button:hover { border-color: rgba(46,242,255,.45); color: var(--cyan); }
.tdbc-empty { font-size: 12.5px; color: var(--red); }
.tdbc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tdbc-status { font-size: 12.5px; color: var(--muted); }
.tdbc-status.active { color: var(--cyan); }

/* ---- 群发模板：chip 按钮 + 管理区（2026-10-20 二期） ---- */
.tdbc-tools-label { flex: 0 0 auto; font-size: 12px; color: var(--muted); }
.tdbc-tpls { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; min-width: 0; }
.tdbc-tpl {
  font-size: 12px; padding: 3px 10px; cursor: pointer; white-space: nowrap;
  background: rgba(46,242,255,.06); color: var(--cyan);
  border: 1px solid rgba(46,242,255,.28); border-radius: 999px;
}
.tdbc-tpl:hover { background: rgba(46,242,255,.16); border-color: rgba(46,242,255,.55); }

.tdbc-tpledit {
  display: flex; flex-direction: column; gap: 7px;
  padding: 10px; border: 1px solid rgba(46,242,255,.22); border-radius: 8px;
  background: rgba(46,242,255,.035);
}
.tdbc-tpledit-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; }
.tdbc-tpledit-head b { color: var(--cyan); font-size: 12.5px; }
.tdbc-tpledit-head select {
  flex: 1 1 170px; min-width: 0; max-width: 250px; padding: 3px 8px; font-size: 12px;
  background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 6px;
}
.tdbc-tpledit-head .btn { padding: 3px 9px; font-size: 12px; }
/* ⛔ 与 .tdbc-t input 同理：全局 .cfg-row input { width:100% } 会打穿，必须两级特异性 */
.tdbc .tdbc-tpledit input[type="text"] {
  width: 100%; max-width: 100%;
  padding: 6px 10px; font-size: 12.5px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
}
.tdbc .tdbc-tpledit textarea {
  width: 100%; min-height: 96px; max-height: 280px; resize: vertical;
  padding: 8px 10px; font-family: var(--mono); font-size: 12.5px; line-height: 1.6;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
}
.tdbc-tpledit-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tdbc-tpledit-bar .btn { padding: 4px 10px; font-size: 12px; }
