/* 博策信息 · 管理后台（a.bocexx.com） */
:root {
  --navy: #0a2540; --navy-2: #0f3358; --blue: #1b63f0; --blue-dark: #0f4ac4;
  --teal: #00c4a7; --amber: #ff9a3c; --red: #e0342b;
  --ink: #10233b; --ink-2: #3c5573; --ink-3: #6b829c; --line: #e3eaf3;
  --bg: #f4f7fb; --white: #fff;
  --radius: 12px; --shadow-sm: 0 2px 8px rgba(10,37,64,.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.65; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; display: block; }

/* ---------------- 登录 ---------------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(120% 90% at 80% 0%, #123f6d 0%, #0a2540 48%, #07182b 100%);
}
.login-card {
  width: 100%; max-width: 380px; background: #fff; border-radius: 18px;
  padding: 34px 28px 30px; box-shadow: 0 30px 70px rgba(4, 18, 33, .4);
}
.login-card .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.login-card .brand img { width: 40px; height: 40px; border-radius: 10px; }
.login-card .brand b { display: block; font-size: 16px; }
.login-card .brand i { font-style: normal; font-size: 11px; color: var(--ink-3); letter-spacing: .5px; }
.login-card h1 { font-size: 19px; margin-bottom: 6px; }
.login-card .sub { color: var(--ink-3); font-size: 12.6px; margin-bottom: 20px; }

/* ---------------- 骨架 ---------------- */
.shell { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
.side {
  background: var(--navy); color: #b9cbe0; padding: 18px 12px; position: sticky; top: 0;
  height: 100vh; overflow-y: auto;
}
.side .brand { display: flex; align-items: center; gap: 9px; padding: 0 8px 16px; }
.side .brand img { width: 30px; height: 30px; border-radius: 8px; }
.side .brand b { color: #fff; font-size: 14px; display: block; }
.side .brand i { font-style: normal; font-size: 10px; color: #7f9ab5; }
.side nav { display: grid; gap: 2px; }
.side nav a {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 9px;
  font-size: 13.4px; color: #b9cbe0; transition: .16s;
}
.side nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side nav a.on { background: var(--blue); color: #fff; font-weight: 600; }
.side .side-foot { margin-top: 18px; padding: 12px 10px 0; border-top: 1px solid rgba(255,255,255,.1); font-size: 11.5px; color: #7f9ab5; }
.side .side-foot a { color: #9dc4ff; }

.main { min-width: 0; }
.top {
  position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.95);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  padding: 0 22px; height: 58px; display: flex; align-items: center; gap: 14px;
}
.top h1 { font-size: 16px; font-weight: 800; letter-spacing: -.2px; }
.top .grow { flex: 1; }
.top .who { font-size: 12.6px; color: var(--ink-3); }
.top .who b { color: var(--ink); }
.top button.link { border: 0; background: transparent; color: var(--blue); font-size: 12.6px; cursor: pointer; }
.burger { display: none; border: 0; background: transparent; }

.content { padding: 20px 22px 60px; max-width: 1180px; }

/* ---------------- 卡片 / 栅格 ---------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px; }
.kpi span { font-size: 12px; color: var(--ink-3); }
.kpi b { display: block; font-size: 24px; letter-spacing: -.6px; margin-top: 4px; }
.kpi b small { font-size: 12px; font-weight: 400; color: var(--ink-3); margin-left: 4px; letter-spacing: 0; }
.kpi.blue b { color: var(--blue-dark); }
.kpi.red b { color: var(--red); }
.kpi.teal b { color: #00876f; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-top: 14px; overflow: hidden; }
.panel-h { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.panel-h h2 { font-size: 14px; font-weight: 800; }
.panel-h .grow { flex: 1; }
.panel-b { padding: 16px; }
.panel-b.tight { padding: 0; }

/* ---------------- 表格 ---------------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #f8fafd; color: var(--ink-3); font-weight: 600; font-size: 12px; white-space: nowrap; }
tbody tr:hover { background: #fafcff; }
td.num { font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.empty-row { text-align: center; color: var(--ink-3); padding: 34px 10px; font-size: 13px; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12.4px; color: var(--ink-3); margin-bottom: 5px; }
.field .hint { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px;
  font-size: 13.6px; background: #fff; outline: none; transition: .18s;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(27, 99, 240, .1); }
textarea.input { min-height: 84px; resize: vertical; line-height: 1.7; }
textarea.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.4px; min-height: 120px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 15px;
  border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-size: 13.2px; font-weight: 600; cursor: pointer; transition: .16s; white-space: nowrap;
}
.btn:hover { border-color: #c7d6e8; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-danger { color: var(--red); border-color: #f4cdcb; background: #fff7f7; }
.btn-sm { height: 30px; font-size: 12.4px; padding: 0 11px; border-radius: 8px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--blue); }

.tag { display: inline-block; font-size: 11.4px; padding: 1px 8px; border-radius: 999px; font-weight: 700; }
.tag.pending { background: #fff3e6; color: #b26a10; }
.tag.paid { background: #e8f0ff; color: var(--blue-dark); }
.tag.processing { background: #ede9ff; color: #5b45c4; }
.tag.done { background: #e8f8f2; color: #0b6b54; }
.tag.closed { background: #f1f4f8; color: var(--ink-3); }
.tag.on { background: #e8f8f2; color: #0b6b54; }
.tag.off { background: #f1f4f8; color: var(--ink-3); }
.tag.new { background: #e8f0ff; color: var(--blue-dark); }

/* ---------------- 提示 / 弹窗 ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; z-index: 200;
  box-shadow: 0 14px 34px rgba(4, 18, 33, .3); max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #8e2119; }

.modal-mask {
  position: fixed; inset: 0; background: rgba(8, 26, 44, .5); display: none;
  align-items: flex-start; justify-content: center; padding: 32px 16px; z-index: 150; overflow-y: auto;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 720px;
  box-shadow: 0 30px 70px rgba(4, 18, 33, .35);
}
.modal-h { display: flex; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.modal-h h3 { font-size: 15px; flex: 1; }
.modal-h button { border: 0; background: transparent; font-size: 20px; line-height: 1; color: var(--ink-3); cursor: pointer; }
.modal-b { padding: 16px 18px; max-height: 68vh; overflow-y: auto; }
.modal-f { display: flex; gap: 10px; justify-content: flex-end; padding: 13px 18px; border-top: 1px solid var(--line); }

.notice-box {
  background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--blue);
  border-radius: 10px; padding: 12px 14px; font-size: 13px; color: var(--ink-2); margin-bottom: 14px;
}
.notice-box.warn { border-left-color: var(--amber); }
.notice-box.ok { border-left-color: var(--teal); }
.notice-box b { color: var(--ink); }
.notice-box code { background: #f1f5fa; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 5px 12px; font-size: 12.4px; cursor: pointer; color: var(--ink-2);
}
.chips button.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 120px; padding: 6px 0 0; }
.bars > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.bars .bwrap { display: flex; align-items: flex-end; justify-content: center; gap: 3px; width: 100%; flex: 1; }
.bars i { display: block; width: 9px; border-radius: 3px 3px 0 0; min-height: 2px; }
.bars i.o { background: linear-gradient(180deg, #5b93f7, #1b63f0); }
.bars i.l { background: linear-gradient(180deg, #5fe0c9, #00c4a7); }
.bars .blabel { font-size: 10.5px; color: var(--ink-3); }
.legend { display: flex; gap: 16px; justify-content: center; margin-top: 8px; font-size: 11.5px; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.legend i.o { background: #1b63f0; }
.legend i.l { background: #00c4a7; }

/* ---------------- 移动端 ---------------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: fixed; left: 0; top: 0; bottom: 0; width: 232px; z-index: 120;
    transform: translateX(-100%); transition: .25s; height: 100vh;
  }
  .side.open { transform: none; }
  .burger { display: grid; place-items: center; width: 34px; height: 34px; }
  .content { padding: 14px 14px 60px; }
  .top { padding: 0 14px; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .modal-b { max-height: 72vh; }
}
