/* ===========================================================
   平台总后台样式（SaaS 运营方视角）
   =========================================================== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #f4f6f9; color: #1f2430; font-size: 14px;
}
a { color: inherit; text-decoration: none; }

/* ---------- 登录页 ---------- */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: linear-gradient(135deg, #1d2b53 0%, #2b4b8f 55%, #3a6fb0 100%);
}
.login-box { display: flex; width: 860px; max-width: 94vw; background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 24px 60px rgba(10, 25, 60, .35); }
.login-left { flex: 1.15; padding: 44px 38px; background: linear-gradient(150deg, #16264a, #24417e); color: #fff; }
.login-left h1 { font-size: 24px; margin: 0 0 10px; letter-spacing: .5px; }
.login-left p { color: #b9c8e4; font-size: 13px; line-height: 1.7; margin: 0 0 18px; }
.login-left ul { list-style: none; padding: 0; margin: 0 0 22px; }
.login-left li { font-size: 13px; color: #d5e0f5; margin: 9px 0; }
.login-right { flex: 1; padding: 44px 38px; }
.login-right h2 { font-size: 19px; margin: 0 0 22px; color: #1f2430; }
.fi { margin-bottom: 15px; }
.fi label { display: block; font-size: 12px; color: #7a8699; margin-bottom: 6px; }
.fi input, .fi select, .fi textarea {
  width: 100%; padding: 11px 13px; border: 1px solid #dfe4ec; border-radius: 9px;
  font-size: 14px; outline: none; transition: .18s; background: #fbfcfe; font-family: inherit;
}
.fi input:focus, .fi select:focus, .fi textarea:focus { border-color: #2b6cb0; background: #fff; box-shadow: 0 0 0 3px rgba(43,108,176,.12); }
.btn-primary {
  width: 100%; padding: 12px; border: 0; border-radius: 9px; background: #2b6cb0; color: #fff;
  font-size: 15px; cursor: pointer; transition: .18s; font-family: inherit;
}
.btn-primary:hover { background: #24568c; }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.tip { font-size: 12px; color: #94a0b3; margin-top: 14px; min-height: 16px; }

/* ---------- 主框架 ---------- */
.layout { display: flex; min-height: 100vh; }
.side {
  width: 224px; background: #16264a; color: #c7d3e8; flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side .brand { padding: 20px 22px; border-bottom: 1px solid rgba(255,255,255,.08); }
.side .brand b { display: block; color: #fff; font-size: 15px; letter-spacing: .4px; }
.side .brand span { font-size: 11px; color: #7f92b5; }
.side nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.side nav .grp { font-size: 11px; color: #5f7291; padding: 12px 12px 6px; letter-spacing: .5px; }
.side nav a { display: block; padding: 10px 12px; border-radius: 8px; font-size: 13.5px; margin-bottom: 2px; transition: .16s; }
.side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side nav a.on { background: #2b6cb0; color: #fff; font-weight: 500; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px; background: #fff; border-bottom: 1px solid #e8ecf3; display: flex;
  align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.topbar h2 { font-size: 16px; margin: 0; font-weight: 600; }
.topbar .right { display: flex; align-items: center; gap: 14px; font-size: 13px; color: #6b7688; }
.view { padding: 22px 24px 40px; }

/* ---------- 卡片 / 表格 ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.card { background: #fff; border-radius: 12px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(20,35,70,.06); }
.card .lb { font-size: 12px; color: #8892a4; margin-bottom: 8px; }
.card .vl { font-size: 24px; font-weight: 600; color: #16264a; line-height: 1.2; }
.card .vl small { font-size: 13px; font-weight: 400; color: #8892a4; margin-left: 4px; }
.card .sub { font-size: 12px; color: #9aa5b6; margin-top: 6px; }

.panel { background: #fff; border-radius: 12px; padding: 18px 20px 8px; box-shadow: 0 1px 3px rgba(20,35,70,.06); margin-bottom: 18px; }
.panel h3 { font-size: 15px; margin: 0 0 14px; font-weight: 600; }
.tb-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 10px 8px; color: #7a8699; font-weight: 500; border-bottom: 1px solid #eef1f6; white-space: nowrap; font-size: 12px; }
td { padding: 11px 8px; border-bottom: 1px solid #f4f6fa; color: #333c4d; vertical-align: middle; }
tbody tr:hover { background: #fafbfd; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11.5px; background: #eef1f6; color: #64748b; }
.tag.green { background: #e6f6ed; color: #10884a; }
.tag.red { background: #fdeceb; color: #c93a2e; }
.tag.warn { background: #fff4e5; color: #b5731a; }
.tag.blue { background: #e9f1fb; color: #2b6cb0; }

.btn { padding: 7px 14px; border: 0; border-radius: 7px; font-size: 13px; cursor: pointer; background: #2b6cb0; color: #fff; font-family: inherit; transition: .16s; }
.btn:hover { filter: brightness(1.08); }
.btn.red { background: #d9483b; }
.btn.ghost { background: #eef1f6; color: #5a6577; }
.btn.sm { padding: 5px 11px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.empty { text-align: center; color: #a3adbd; padding: 36px 0; font-size: 13px; }
.loading { text-align: center; color: #a3adbd; padding: 40px 0; }
.t { font-size: 12px; color: #94a0b3; }

.bar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.bar input, .bar select { padding: 8px 12px; border: 1px solid #dfe4ec; border-radius: 8px; font-size: 13px; outline: none; font-family: inherit; }
.bar input:focus, .bar select:focus { border-color: #2b6cb0; }

/* ---------- 弹窗 ---------- */
#modalMask { position: fixed; inset: 0; background: rgba(18,28,50,.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
#modalMask.hide { display: none; }
#modalBox { background: #fff; border-radius: 14px; width: 520px; max-width: 92vw; max-height: 86vh; overflow-y: auto; padding: 22px 24px 18px; position: relative; }
#modalBox h3 { margin: 0 0 18px; font-size: 16px; }
#modalBox .x { position: absolute; right: 18px; top: 16px; cursor: pointer; color: #98a2b3; font-size: 20px; line-height: 1; }
#modalBox .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

#toast {
  position: fixed; left: 50%; bottom: 46px; transform: translateX(-50%);
  background: rgba(22,38,74,.94); color: #fff; padding: 11px 22px; border-radius: 26px;
  font-size: 13.5px; z-index: 200; transition: .25s;
}
#toast.hide { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(10px); }

@media (max-width: 820px) {
  .login-left { display: none; }
  .side { width: 62px; }
  .side .brand b, .side .brand span, .side nav a { font-size: 0; }
  .side nav a { text-align: center; padding: 12px 0; }
  .side nav a::first-letter { font-size: 18px; }
  .view { padding: 16px 14px 32px; }
}
