* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  background: #f2f5fa; color: #26313f; font-size: 13px; line-height: 1.6;
}
button, input, select, textarea { font-family: inherit; font-size: 13px; }
code { background: #eef3fa; padding: 1px 5px; border-radius: 4px; color: #2f5597; font-size: 12px; }

/* ---------- 登录 / 初始化 ---------- */
.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eaf1ff 0%, #f7f9fc 45%, #eef4ff 100%); padding: 24px; }
.boot-card { width: 430px; max-width: 94vw; background: #fff; border: 1px solid #dfe8f5;
  border-radius: 16px; padding: 30px 32px 24px; box-shadow: 0 18px 50px rgba(31,56,100,.12); }
.boot-brand { display: flex; align-items: center; gap: 14px; }
.boot-logo { width: 50px; height: 50px; border-radius: 13px; background: linear-gradient(135deg,#2f5597,#4b7bd6);
  color: #fff; font-size: 26px; font-weight: 700; text-align: center; line-height: 50px; }
.boot-brand h1 { margin: 0; font-size: 21px; color: #1f3864; }
.boot-brand p { margin: 2px 0 0; font-size: 12px; color: #7b8698; }
.boot-badge { margin: 18px 0 16px; padding: 7px 11px; background: #f0f6ff; border: 1px solid #d7e6ff;
  border-radius: 7px; color: #2f5597; font-size: 12px; }
.boot-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid #eef2f8; color: #9aa5b5; font-size: 11.5px; line-height: 1.7; }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12px; color: #5b6572; margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; height: 36px; padding: 0 10px;
  border: 1px solid #d8e0ec; border-radius: 7px; background: #fff; color: #26313f; }
.field textarea { height: 62px; padding: 7px 10px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: #2f5597; box-shadow: 0 0 0 3px rgba(47,85,151,.09); }
.boot-err { min-height: 18px; color: #c0392b; font-size: 12px; margin: 2px 0 6px; }

/* ---------- 通用控件 ---------- */
.btn { display: inline-block; padding: 7px 14px; border: 1px solid #d3dceb; border-radius: 7px;
  background: #fff; color: #2f5597; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #2f5597; background: #f5f9ff; }
.btn-primary { background: #2f5597; border-color: #2f5597; color: #fff; }
.btn-primary:hover { background: #244780; border-color: #244780; }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,.45); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.15); border-color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-danger { color: #c0392b; border-color: #eecdc8; }
.btn-danger:hover { background: #fff5f4; border-color: #c0392b; }
.btn.on { background: #2f5597; border-color: #2f5597; color: #fff; }
.btn:disabled { opacity: .55; cursor: default; }

/* ---------- 顶栏与布局 ---------- */
.topbar { height: 60px; background: linear-gradient(90deg,#1f3864 0%,#2f5597 60%,#3d68b4 100%);
  display: flex; align-items: center; gap: 12px; padding: 0 22px; color: #fff; }
.tb-brand { display: flex; align-items: center; gap: 10px; }
.tb-logo { width: 34px; height: 34px; border-radius: 9px; background: rgba(255,255,255,.18);
  text-align: center; line-height: 34px; font-size: 19px; font-weight: 700; }
.tb-brand b { display: block; font-size: 15px; line-height: 1.2; }
.tb-brand small { display: block; font-size: 10.5px; opacity: .72; }
.tb-tag { padding: 2px 8px; border: 1px solid rgba(255,255,255,.4); border-radius: 20px; font-size: 11px; opacity: .9; }
.tb-spacer { flex: 1; }
.tb-note { font-size: 11.5px; opacity: .72; }
.tb-note code { background: rgba(255,255,255,.15); color: #fff; }
.tb-user { font-size: 12.5px; }
.wrap { max-width: 1360px; margin: 0 auto; padding: 22px 24px 48px; }
.intro { margin-bottom: 16px; }
.intro h2 { margin: 0 0 4px; font-size: 19px; color: #1f3864; }
.intro p { margin: 0; color: #6b7686; font-size: 12.5px; max-width: 1000px; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid #e3e9f2; border-radius: 10px; padding: 13px 15px;
  box-shadow: 0 2px 8px rgba(31,56,100,.04); }
.kpi span { display: block; font-size: 11.5px; color: #7b8698; margin-bottom: 6px; }
.kpi b { font-size: 22px; color: #1f3864; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi em { font-style: normal; font-size: 12px; margin-left: 3px; color: #7b8698; }
.kpi.warn { border-color: #f0dcae; background: #fffbf1; }
.kpi.warn b { color: #a9740a; }
.kpi.off { border-color: #f2c8c3; background: #fff6f5; }
.kpi.off b { color: #c0392b; }
.kpi.ok { border-color: #c6e0cf; background: #f7fdf9; }
.kpi.ok b { color: #1f6b3b; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, 1fr); } }

/* ---------- 卡片 / 表格 ---------- */
.card { background: #fff; border: 1px solid #e3e9f2; border-radius: 10px; padding: 16px 18px 18px;
  margin-bottom: 16px; box-shadow: 0 2px 8px rgba(31,56,100,.04); }
.card-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-hd h3 { margin: 0; font-size: 15px; color: #1f3864; }
.cnt { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 20px; background: #fdeaea;
  color: #c0392b; font-size: 11px; text-align: center; }
.hd-ops { margin-left: auto; display: flex; gap: 7px; flex-wrap: wrap; }
.hd-tip { color: #9aa5b5; font-size: 11.5px; margin-left: auto; }
.tbl-scroll { overflow: auto; border: 1px solid #e8edf5; border-radius: 8px; max-height: 430px; }
.tbl { width: 100%; border-collapse: collapse; min-width: 920px; font-size: 12.5px; }
.tbl th { background: #f7f9fc; color: #5b6572; font-weight: 600; text-align: left; padding: 9px 11px;
  border-bottom: 1px solid #e8edf5; position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.tbl td { padding: 8px 11px; border-bottom: 1px solid #eef2f8; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: #fafcff; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .ops { white-space: nowrap; }
.tbl .ops .btn { padding: 3px 8px; font-size: 11px; margin-right: 4px; }
.tbl .empty { text-align: center; color: #9aa5b5; padding: 26px 10px; }
.sub { font-size: 10.5px; color: #9aa5b5; line-height: 1.5; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 20px; font-size: 11px; white-space: nowrap; }
.badge.b-green { background: #e6f4ea; color: #1f6b3b; }
.badge.b-amber { background: #fff3d6; color: #a9740a; }
.badge.b-red { background: #fdeaea; color: #c0392b; }
.badge.b-gray { background: #eef2f8; color: #6b7686; }
.badge.b-blue { background: #e3efff; color: #1d5fbf; }
.kpi.free { background: #eef5ff; border-color: #d7e6ff; }
.kpi.free b { color: #1d5fbf; }
.plan-box { margin: 12px 0 4px; padding: 10px 12px 4px; border: 1px dashed #c9d8ee; border-radius: 8px; background: #f7faff; }
.plan-box > b { display: block; margin-bottom: 8px; font-size: 12px; color: #1d5fbf; letter-spacing: 1px; }
.plan-box .field { margin-bottom: 10px; }
.plan-sep { display: inline-block; padding: 0 8px; color: #8a97a8; }
.m-free-tip { margin: 4px 0 10px; padding: 8px 10px; background: #eef5ff; border: 1px solid #d7e6ff;
  border-radius: 6px; font-size: 12px; color: #1d5fbf; }
.card-note { margin-top: 10px; padding: 9px 12px; border: 1px solid #e0ebfa; background: #f7faff;
  border-radius: 7px; font-size: 12px; color: #5b6572; line-height: 1.8; }
.card-note b { color: #1f3864; }

/* ---------- 参数 / 授权 ---------- */
.cfg { display: flex; flex-wrap: wrap; gap: 12px; }
.cfg-f { flex: 1 1 190px; min-width: 175px; }
.cfg-f.wide { flex: 2 1 400px; }
.cfg-f.full { flex: 1 1 100%; }
.cfg-f label { display: block; font-size: 11.5px; color: #5b6572; margin-bottom: 5px; }
.cfg-f input { width: 100%; height: 33px; padding: 0 9px; border: 1px solid #d8e0ec; border-radius: 6px; color: #26313f; }
.cfg-f input:focus { outline: none; border-color: #2f5597; }
.lic-bar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 12px; }
.lic-hint { color: #8a95a5; font-size: 11.5px; }
.audit { max-height: 240px; overflow: auto; font-size: 12px; color: #5b6572; }
.audit div { padding: 5px 2px; border-bottom: 1px solid #eef2f8; }
.audit time { color: #9aa5b5; margin-right: 9px; font-size: 11px; }
.audit b { color: #2f5597; margin-right: 6px; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; background: rgba(20,34,58,.45); display: flex;
  align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-card { width: 500px; max-width: 94vw; max-height: 88vh; overflow: auto; background: #fff;
  border-radius: 12px; padding: 20px 22px; box-shadow: 0 24px 60px rgba(20,34,58,.28); }
.modal-card h3 { margin: 0 0 4px; font-size: 17px; color: #1f3864; }
.modal-card .m-sub { color: #7b8698; font-size: 12px; margin: 0 0 16px; }
.m-top { background: #f2f7ff; border: 1px solid #d6e4ff; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; }
.m-top em { font-style: normal; font-weight: 700; color: #2f5597; }
.m-months { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: #5b6572; }
.m-months input { width: 80px; height: 30px; padding: 0 8px; border: 1px solid #d8e0ec; border-radius: 6px; }
.m-amount { margin: 8px 0 14px; padding: 11px 14px; border: 1px solid #c6e0cf; border-radius: 8px;
  background: #f7fdf9; font-size: 13px; color: #5b6572; }
.m-amount b { font-size: 22px; color: #1f6b3b; margin-left: 7px; font-variant-numeric: tabular-nums; }
.m-amount .sub { display: block; margin-top: 3px; }
/* 账号替换：团队版账号名单网格 */
.repl-members { margin: 10px 0 14px; }
.repl-members .sub { color: #8a94a4; font-size: 12px; }
.repl-grid { display: flex; flex-wrap: wrap; gap: 7px; max-height: 170px; overflow: auto; }
.repl-item { flex: 0 0 auto; min-width: 130px; text-align: left; background: #fff; border: 1px solid #dbe3ef;
  border-radius: 8px; padding: 8px 10px; cursor: pointer; font-size: 12px; color: #44546a; line-height: 1.5; }
.repl-item:hover { border-color: #2f5597; }
.repl-item.on { border-color: #2f5597; background: #e8f0fd; box-shadow: 0 0 0 2px rgba(47,85,151,.18); border-left: 3px solid #2f5597; }
.repl-item.on:after { content: '✓ 已选'; display: block; margin-top: 3px; font-size: 10px; color: #2f5597; font-weight: 700; }
.repl-item b { display: block; color: #1f3864; font-size: 13px; }
.repl-item span { color: #5b6572; }
.repl-item em { display: block; font-style: normal; font-size: 10.5px; color: #9aa5b5; margin-top: 2px; }
.m-err { min-height: 18px; color: #c0392b; font-size: 12px; }
.m-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.m-text { white-space: pre-wrap; word-break: break-all; background: #f7f9fc; border: 1px solid #e8edf5;
  border-radius: 8px; padding: 12px; font-size: 12px; line-height: 1.8; max-height: 55vh; overflow: auto; }
.toast { position: fixed; left: 50%; top: 22px; transform: translateX(-50%); z-index: 90;
  padding: 9px 18px; border-radius: 8px; background: #1f3864; color: #fff; font-size: 13px;
  box-shadow: 0 8px 24px rgba(20,34,58,.25); }
.toast.err { background: #c0392b; }
