/* console.css —— AI智聊总控台（集群、多用户、底粉与账单）*/
* { box-sizing: border-box; }
:root {
  --brand: #165dff;
  --bg: #f5f6f8;
  --panel: #fff;
  --line: #e5e6eb;
  --muted: #86909c;
  --text: #1d2129;
  --ok: #009a29;
  --warn: #d25f00;
  --bad: #cb2634;
}
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: #f53f3f; font-size: 13px; min-height: 20px; }
.hint { color: var(--muted); font-size: 12.5px; margin: 4px 0 0; }

/* 登录 */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 370px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 28px 26px 24px; box-shadow: 0 10px 30px rgba(29,33,41,.06);
}
.login-logo { width: 44px; height: 44px; display: block; margin-bottom: 12px; }
.login-card h1 { font-size: 20px; margin: 0 0 4px; }
.login-card p { margin: 0 0 18px; font-size: 13px; }
.login-card label { display: block; margin: 12px 0 6px; font-size: 13px; color: #4e5969; }
.login-card input {
  width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: 6px; font-size: 14px; outline: none;
}
.login-card input:focus { border-color: var(--brand); }
.login-card button { width: 100%; margin-top: 16px; height: 38px; }

/* 顶部与导航 Tab */
.top {
  min-height: 56px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 6px 18px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: 6px; }
.brand img { width: 28px; height: 28px; border-radius: 6px; }
.brand strong { font-size: 15px; }
.tag { font-size: 12px; color: var(--brand); background: #e8f3ff; border-radius: 10px; padding: 1px 8px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab {
  height: 32px; padding: 0 12px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: #4e5969; font-size: 13.5px; cursor: pointer;
}
.tab:hover { background: #f2f3f5; color: var(--text); }
.tab.active { background: #e8f3ff; color: var(--brand); font-weight: 600; border-color: #bedaff; }
.nav-ext { color: var(--brand); text-decoration: none; font-size: 13px; margin-right: 6px; }
.nav-ext:hover { text-decoration: underline; }
.grow { flex: 1 1 auto; }

/* 布局与卡片 */
.wrap { max-width: 1280px; margin: 0 auto; padding: 18px 18px 60px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 10px 0 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.card .k { font-size: 12.5px; color: var(--muted); }
.card .v { font-size: 22px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }
.card .x { font-size: 12px; color: var(--muted); margin-top: 6px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; margin-bottom: 18px; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; min-width: 0; overflow: hidden; }
.box h2 { font-size: 15px; margin: 0 0 12px; }
.box label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #4e5969; margin-bottom: 10px; min-width: 0; }
.box label.chk { flex-direction: row; align-items: center; gap: 6px; margin: 0 10px 0 0; cursor: pointer; }
.box label.chk input { width: 15px; height: 15px; }
.box input, .box select {
  width: 100%; min-width: 0; max-width: 100%;
  height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; font-size: 13.5px;
}
.box .row { display: flex; flex-wrap: wrap; gap: 10px; min-width: 0; }
.box .row label { flex: 1 1 140px; min-width: 0; }

/* 集群节点卡片 */
.node-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.node-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 15px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.node-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.node-title { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.ok { background: #00b42a; box-shadow: 0 0 0 3px #e8ffea; }
.dot.bad { background: #f53f3f; box-shadow: 0 0 0 3px #ffece8; }
.node-meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 10px; }
.slots-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.slot-item { background: #f7f8fa; border: 1px solid #eef0f4; border-radius: 8px; padding: 7px 10px; }
.slot-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.bar { height: 6px; background: #e5e6eb; border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 4px; transition: width .2s; }
.bar > i.full { background: #f53f3f; }
.node-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; border-top: 1px solid #f2f3f5; }
.cmd-box { display: flex; align-items: center; gap: 10px; background: #f7f8fa; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; flex-wrap: wrap; }
.cmd-box code { flex: 1 1 320px; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; word-break: break-all; }

/* 筛选条与徽章 */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filter-bar select { height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 13px; }
.badge {
  display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; font-weight: 500;
  background: #f2f3f5; color: #4e5969;
}
.badge.ok { background: #e8ffea; color: var(--ok); }
.badge.warn { background: #fff7e8; color: var(--warn); }
.badge.bad { background: #ffece8; color: var(--bad); }
.badge.brand { background: #e8f3ff; color: var(--brand); }
.act-btns { display: flex; gap: 5px; flex-wrap: nowrap; }
.act-btns button { height: 26px; padding: 0 8px; font-size: 12px; }
button.danger { color: var(--bad); border-color: #fdcdc5; }
button.danger:hover:not(:disabled) { background: #ffece8; border-color: #f53f3f; }

.codes { margin-top: 10px; font-size: 13px; line-height: 2; word-break: break-all; }
.codes code { background: #f7f8fa; border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; }

h3 { font-size: 15px; margin: 20px 0 10px; }
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 11px; border-bottom: 1px solid #f2f3f5; white-space: nowrap; }
th { background: #fafbfc; color: var(--muted); font-weight: 500; }
tbody tr:last-child td { border-bottom: 0; }
td.empty { text-align: center; color: var(--muted); padding: 22px 0; }
td.code { font-family: ui-monospace, Menlo, monospace; }
td.num { font-variant-numeric: tabular-nums; }

button {
  height: 34px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--line);
  background: #fff; color: var(--text); font-size: 13.5px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
button:hover:not(:disabled) { border-color: #c9cdd4; background: #f7f8fa; }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }
button.primary:hover:not(:disabled) { background: #0e42d2; border-color: #0e42d2; }
button:disabled { opacity: .55; cursor: not-allowed; }

.inline-msg { margin: 0 0 10px; font-size: 13px; min-height: 20px; border-radius: 6px; }
.inline-msg.ok { color: #009a29; background: #e8ffea; padding: 6px 12px; border: 1px solid #aff0b5; }
.inline-msg.err { color: #cb2634; background: #ffece8; padding: 6px 12px; border: 1px solid #fdcdc5; }

.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: 10px 0 6px; font-size: 13px; color: var(--muted); }
.pager button { height: 30px; padding: 0 10px; font-size: 12.5px; }

.price-official { border: 1px dashed #d1d5db; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; background: #f9fafb; }
.price-official input[disabled] { background: #eef0f3; color: #4b5563; }
.small { font-size: 12px; }
.muted.small { margin-bottom: 6px; }

/* 弹窗 */
dialog.console-dialog {
  width: min(500px, calc(100vw - 24px));
  border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px;
  box-shadow: 0 18px 44px rgba(29,33,41,.18); color: var(--text); background: var(--panel);
}
dialog.console-dialog::backdrop { background: rgba(29,33,41,.42); }
dialog.console-dialog h3 { margin: 0 0 8px; font-size: 16px; }
dialog.console-dialog label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #4e5969; margin-bottom: 10px; }
dialog.console-dialog label.chk { flex-direction: row; align-items: center; gap: 6px; cursor: pointer; }
dialog.console-dialog label.chk input { width: 15px; height: 15px; }
dialog.console-dialog input:not([type="checkbox"]), dialog.console-dialog select {
  width: 100%; height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; font-size: 13.5px;
}
dialog.console-dialog .row { display: flex; gap: 10px; flex-wrap: wrap; }
dialog.console-dialog .row label { flex: 1 1 160px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
