/* ============================================================
   共号账本 · 现代 SaaS 后台主题
   靛蓝 / 蓝紫点缀 · 浅灰背景 · 白卡片大圆角柔阴影 · 深色侧边栏
   ============================================================ */
:root {
  --bg: #f3f5fa;
  --bg-soft: #eceff7;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --panel-3: #edf1f8;
  --line: #e3e8f2;
  --line-soft: #edf0f7;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #8b98ad;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --accent-dark: #4f46e5;
  --accent-soft: rgba(99, 102, 241, .09);
  --accent-ring: rgba(99, 102, 241, .16);
  --green: #059669;
  --amber: #d97706;
  --red: #dc2626;
  --purple: #7c3aed;
  --blue: #2563eb;
  --grad: linear-gradient(135deg, #6366f1, #8b5cf6);
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, .16), 0 4px 12px rgba(16, 24, 40, .06);
  --radius: 14px;
  --radius-sm: 9px;
  --sidebar-w: 226px;
  --sidebar-w-min: 68px;
  --sidebar-bg: linear-gradient(180deg, #1b1e3d 0%, #131530 55%, #0f1126 100%);
  --sidebar-text: #c6cbe8;
}

html[data-theme="dark"] {
  --bg: #0a0f1e;
  --bg-soft: #0d1526;
  --panel: #111a2e;
  --panel-2: #0d1526;
  --panel-3: #1a2440;
  --line: #1f2c49;
  --line-soft: #18223c;
  --text: #e6ebf5;
  --text-2: #a5b1c6;
  --muted: #68769a;
  --accent: #818cf8;
  --accent-2: #a78bfa;
  --accent-dark: #a5b4fc;
  --accent-soft: rgba(129, 140, 248, .13);
  --accent-ring: rgba(129, 140, 248, .22);
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --purple: #a78bfa;
  --blue: #60a5fa;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .3);
  --shadow-lg: 0 16px 40px -8px rgba(0, 0, 0, .55), 0 4px 14px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  font-size: 13.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
::selection { background: rgba(99, 102, 241, .25); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.sub { color: var(--muted); font-size: 11.5px; }
.mono { font-family: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace; font-size: .95em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 登录 ============ */
.login-wrap {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; z-index: 50;
  background:
    radial-gradient(720px 480px at 12% -8%, rgba(99, 102, 241, .35), transparent 60%),
    radial-gradient(680px 520px at 105% 110%, rgba(139, 92, 246, .32), transparent 60%),
    linear-gradient(150deg, #171a38 0%, #10142e 55%, #0c0f24 100%);
  overflow: hidden;
}
.login-bg i {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; pointer-events: none;
}
.login-bg i:nth-child(1) { width: 340px; height: 340px; background: #6366f1; left: -90px; top: -110px; }
.login-bg i:nth-child(2) { width: 300px; height: 300px; background: #8b5cf6; right: -80px; bottom: -100px; }
.login-bg i:nth-child(3) { width: 180px; height: 180px; background: #2563eb; right: 22%; top: -70px; opacity: .35; }
.login-card {
  position: relative; width: 100%; max-width: 368px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 20px; padding: 32px 30px 24px;
  box-shadow: 0 24px 60px -12px rgba(2, 6, 23, .5);
  animation: loginIn .35s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes loginIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.login-logo { display: flex; align-items: center; gap: 13px; margin-bottom: 24px; }
.logo-mark, .brand-mark {
  background: var(--grad); color: #fff; display: grid; place-items: center;
  font-weight: 700; box-shadow: 0 6px 16px rgba(99, 102, 241, .4);
}
.logo-mark { width: 46px; height: 46px; border-radius: 13px; font-size: 21px; flex: 0 0 46px; }
.login-logo h1 { font-size: 19px; letter-spacing: .5px; }
.login-sub { color: var(--muted); font-size: 11.5px; margin: 3px 0 0; }
.login-card .field { margin-bottom: 14px; }
.login-tip { color: var(--muted); font-size: 11px; text-align: center; margin: 16px 0 0; line-height: 1.5; }

/* ============ 布局 ============ */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); background: var(--sidebar-bg);
  color: var(--sidebar-text); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 30;
  transition: width .18s ease, flex-basis .18s ease, transform .2s ease;
}
body.sb-collapsed .sidebar { width: var(--sidebar-w-min); flex-basis: var(--sidebar-w-min); }
.brand { display: flex; align-items: center; gap: 10px; padding: 17px 16px 14px; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; font-size: 15px; flex: 0 0 32px; }
.brand-text { min-width: 0; flex: 1; }
.brand-text strong { display: block; font-size: 13.5px; letter-spacing: .3px; color: #fff; white-space: nowrap; }
.brand-text small { color: #8b90b8; font-size: 9px; letter-spacing: 1.2px; text-transform: uppercase; white-space: nowrap; }
.collapse-btn { flex: 0 0 auto; }
body.sb-collapsed .brand-text, body.sb-collapsed .collapse-btn,
body.sb-collapsed .nav a span, body.sb-collapsed .who, body.sb-collapsed #logout-btn { display: none; }
body.sb-collapsed .brand { justify-content: center; padding-left: 0; padding-right: 0; }
body.sb-collapsed .nav a { justify-content: center; padding: 10px 0; }
body.sb-collapsed .sidebar-foot { justify-content: center; }
#expand-btn { display: none; }
body.sb-collapsed #expand-btn { display: grid; }

.nav { padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 11px; color: var(--sidebar-text);
  font-size: 13px; border-radius: 10px; transition: background .12s, color .12s; position: relative;
}
.nav a i { font-style: normal; width: 19px; height: 19px; flex: 0 0 19px; opacity: .75; display: grid; place-items: center; }
.nav a i svg { width: 18px; height: 18px; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.nav a.active {
  background: var(--grad); color: #fff; font-weight: 600;
  box-shadow: 0 6px 16px -4px rgba(99, 102, 241, .55);
}
.nav a.active i { opacity: 1; }
.nav-badge {
  margin-left: auto; background: #f43f5e; color: #fff; border-radius: 999px;
  font-size: 10px; font-weight: 700; padding: 0 6px; min-width: 17px; text-align: center; line-height: 16px;
}
body.sb-collapsed .nav-badge { position: absolute; top: 3px; right: 5px; margin: 0; }
.sidebar-foot {
  border-top: 1px solid rgba(255, 255, 255, .08); padding: 11px 14px; display: flex; align-items: center;
  gap: 9px; font-size: 12px; color: var(--sidebar-text);
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 30px; display: grid; place-items: center;
  background: linear-gradient(135deg, #38bdf8, #818cf8); color: #fff; font-size: 12px; font-weight: 700;
}
.who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: 1; }
.who span { color: #fff; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { color: #8b90b8; font-size: 10px; }
.link-btn {
  background: none; border: 0; color: #9aa0c7; cursor: pointer; font-size: 12px; padding: 3px 5px; border-radius: 6px;
}
.link-btn:hover { color: #fda4af; text-decoration: none; }
.icon-btn.ghost-dark { background: rgba(255, 255, 255, .07); border-color: transparent; color: #c6cbe8; }
.icon-btn.ghost-dark:hover { background: rgba(255, 255, 255, .14); color: #fff; }

.drawer-mask {
  position: fixed; inset: 0; background: rgba(8, 10, 26, .5); backdrop-filter: blur(2px);
  z-index: 25; opacity: 0; pointer-events: none; transition: opacity .18s;
}
.drawer-mask.show { opacity: 1; pointer-events: auto; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 12px;
  padding: 12px 22px; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.topbar h2 { font-size: 16px; letter-spacing: .2px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.global-search {
  display: flex; align-items: center; gap: 7px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 0 8px 0 12px; transition: border-color .12s, box-shadow .12s;
}
.global-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.global-search svg { width: 15px; height: 15px; color: var(--muted); flex: 0 0 15px; }
.global-search input {
  width: 228px; background: transparent; border: 0; padding: 7px 0; font-size: 12.5px; outline: none;
}
.global-search kbd {
  font-family: inherit; font-size: 10px; color: var(--muted); background: var(--panel-3);
  border-radius: 5px; padding: 1px 6px; white-space: nowrap;
}
.view { padding: 20px 22px 44px; flex: 1; width: 100%; max-width: 1560px; margin: 0 auto; }

/* ============ 通用组件 ============ */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 17px 18px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; }
.card-head h3 { font-size: 13.5px; }
.card-head h3::before {
  content: ""; display: inline-block; width: 3.5px; height: 12px; border-radius: 2px;
  background: var(--grad); margin-right: 8px; vertical-align: -1px;
}
.card-head .spacer { margin-left: auto; }
.section-gap { height: 14px; }

.grid { display: grid; gap: 12px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  padding: 7px 14px; border-radius: var(--radius-sm); cursor: pointer; font-size: 12.5px; font-weight: 500;
  transition: border-color .12s, background .12s, color .12s, box-shadow .12s, transform .08s;
  white-space: nowrap; box-shadow: var(--shadow);
}
.btn:hover { border-color: var(--accent); color: var(--accent-dark); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--grad); border-color: transparent; color: #fff; font-weight: 600;
  box-shadow: 0 6px 16px -6px rgba(99, 102, 241, .55);
}
.btn.primary:hover { filter: brightness(1.07); color: #fff; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
.btn.danger:hover { background: color-mix(in srgb, var(--red) 8%, transparent); color: var(--red); border-color: var(--red); }
.btn.sm { padding: 4px 10px; font-size: 11.5px; border-radius: 7px; }
.btn.lg { padding: 11px 18px; font-size: 14px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.icon-btn {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px;
  border: 1px solid var(--line); background: var(--panel); cursor: pointer; color: var(--text-2);
  font-size: 14px; transition: border-color .12s, color .12s, background .12s; box-shadow: var(--shadow);
}
.icon-btn:hover { color: var(--accent-dark); border-color: var(--accent); }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 11px; color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 11px; outline: none; font-size: 13px; width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring);
}
.field input[type=date] { padding: 7px 9px; }
.field textarea { resize: vertical; min-height: 60px; }
.field .hint { font-size: 10.5px; color: var(--muted); font-style: normal; line-height: 1.45; }
.field input:disabled, .field select:disabled { background: var(--panel-2); color: var(--muted); }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border-radius: 999px;
  font-size: 11px; font-weight: 550; line-height: 19px; white-space: nowrap; border: 1px solid transparent;
  background: var(--panel-3); color: var(--muted);
}
.badge.green { color: var(--green); background: color-mix(in srgb, var(--green) 11%, transparent); border-color: color-mix(in srgb, var(--green) 24%, transparent); }
.badge.blue { color: var(--blue); background: color-mix(in srgb, var(--blue) 11%, transparent); border-color: color-mix(in srgb, var(--blue) 24%, transparent); }
.badge.amber { color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, transparent); border-color: color-mix(in srgb, var(--amber) 26%, transparent); }
.badge.red { color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); border-color: color-mix(in srgb, var(--red) 24%, transparent); }
.badge.purple { color: var(--purple); background: color-mix(in srgb, var(--purple) 11%, transparent); border-color: color-mix(in srgb, var(--purple) 24%, transparent); }
.badge.indigo { color: var(--accent-dark); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 26%, transparent); }
.badge.gray { color: var(--muted); }
.dotmark { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: 0 0 5px; }

/* 统计卡 */
.stat {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px 13px; display: flex; flex-direction: column; gap: 2px; min-width: 0;
  box-shadow: var(--shadow); overflow: hidden;
}
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--panel-3);
}
.stat.accent::before, .stat.blue::before { background: linear-gradient(180deg, var(--blue), var(--accent-2)); }
.stat.green::before { background: var(--green); }
.stat.amber::before { background: var(--amber); }
.stat.red::before { background: var(--red); }
.stat.purple::before { background: var(--purple); }
.stat .label { font-size: 11.5px; color: var(--muted); font-weight: 550; display: flex; align-items: center; gap: 6px; }
.stat .value {
  font-size: 24px; font-weight: 700; letter-spacing: -.3px; line-height: 1.3;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.stat .value small { font-size: 12px; color: var(--muted); font-weight: 450; margin-left: 3px; }
.stat .foot { font-size: 11px; color: var(--muted); margin-top: 2px; }
.stat.accent .value, .stat.blue .value { color: var(--blue); }
.stat.green .value { color: var(--green); }
.stat.red .value { color: var(--red); }
.stat.amber .value { color: var(--amber); }
.stat.purple .value { color: var(--purple); }

.progress { height: 6px; background: var(--panel-3); border-radius: 4px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--grad); border-radius: 4px; transition: width .4s ease; }
.progress.green > i { background: linear-gradient(90deg, #10b981, #34d399); }

/* 环形图（仪表盘回本进度） */
.donut-card { flex-direction: row; align-items: center; gap: 14px; }
.donut { position: relative; width: 74px; height: 74px; flex: 0 0 74px; }
.donut svg { transform: rotate(-90deg); display: block; }
.donut .ring-bg { stroke: var(--panel-3); }
.donut .ring-val { stroke: url(#donutGrad); stroke-linecap: round; transition: stroke-dasharray .5s ease; }
.donut.done .ring-val { stroke: var(--green); }
.donut .donut-num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.donut-meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.donut-meta .label { font-size: 11.5px; color: var(--muted); font-weight: 550; }
.donut-meta .foot { font-size: 11px; color: var(--muted); line-height: 1.55; }

/* ============ 表格 ============ */
.table-wrap {
  overflow: auto; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); box-shadow: var(--shadow);
}
table.tb { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
table.tb th, table.tb td { padding: 8px 11px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.tb th {
  background: var(--panel-2); color: var(--muted); font-weight: 600; font-size: 11px; letter-spacing: .3px;
  position: sticky; top: 0; z-index: 2; white-space: nowrap;
}
table.tb th.sortable { cursor: pointer; user-select: none; }
table.tb th.sortable:hover { color: var(--accent-dark); }
table.tb tbody tr { transition: background .1s; }
table.tb tbody tr:hover { background: color-mix(in srgb, var(--accent) 4%, var(--panel)); }
table.tb tbody tr:last-child td { border-bottom: 0; }
table.tb td.num, table.tb th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tb.dense th, table.tb.dense td { padding: 6px 9px; }
table.tb .row-actions { display: flex; gap: 4px; justify-content: flex-end; }

.empty { padding: 38px 20px; text-align: center; color: var(--muted); font-size: 12.5px; line-height: 1.9; }
.empty strong { display: block; color: var(--text-2); margin-bottom: 3px; font-size: 13.5px; font-weight: 600; }
.empty:has(> strong)::before {
  content: "🗂️"; display: block; font-size: 30px; line-height: 1.2; margin-bottom: 8px; opacity: .65;
}

/* 骨架屏 */
.skl { border-radius: 10px; background: linear-gradient(90deg, var(--panel-3) 25%, var(--panel-2) 48%, var(--panel-3) 72%); background-size: 200% 100%; animation: shimmer 1.15s infinite linear; }
@keyframes shimmer { from { background-position: 180% 0; } to { background-position: -80% 0; } }
.skl-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.skl-card { height: 92px; }
.skl-block { height: 240px; }

/* ============ 筛选 ============ */
.filters { display: flex; flex-wrap: wrap; gap: 9px; align-items: flex-end; margin-bottom: 12px; }
.filters .field { min-width: 118px; }
.filters .field.grow { flex: 1; min-width: 200px; }
.filters .spacer { margin-left: auto; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 5px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel);
  cursor: pointer; font-size: 12px; color: var(--text-2); font-weight: 500;
  transition: all .12s; box-shadow: var(--shadow);
}
.chip:hover { border-color: var(--accent); color: var(--accent-dark); }
.chip.active { background: var(--grad); border-color: transparent; color: #fff; font-weight: 600; box-shadow: 0 4px 12px -4px rgba(99, 102, 241, .5); }

.pager { display: flex; align-items: center; gap: 7px; padding: 10px 2px 0; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.pager .spacer { margin-left: auto; }
.pager .page-btn { min-width: 28px; height: 28px; padding: 0 9px; }
.pager select {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 12px;
}

/* ============ 快速开租 ============ */
.quick-card {
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 4%, var(--panel)), var(--panel) 55%);
}
.quick-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(110px, 1fr) 112px 88px 106px 100px 106px auto;
  gap: 9px; align-items: end;
}
.quick-grid .go { height: 36px; }
.quick-hint {
  font-size: 11.5px; color: var(--muted); margin-top: 11px; padding-top: 9px;
  border-top: 1px dashed var(--line);
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
}
.quick-hint .spacer { margin-left: auto; }
.quick-hint a { color: var(--accent-dark); font-weight: 600; }
.quick-hint b { font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.quick-more { margin-top: 10px; display: flex; gap: 9px; flex-wrap: wrap; align-items: flex-end; }
.quick-more .field { min-width: 132px; }
.check-line {
  display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2);
  padding-bottom: 9px; cursor: pointer; white-space: nowrap;
}
.check-line input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }

/* 历史补录：一行多字段 */
.bf-grid {
  display: grid;
  grid-template-columns: minmax(200px, 1.4fr) minmax(100px, 1fr) 118px 78px 92px 92px 122px 96px auto;
  gap: 9px; align-items: end;
}
.bf-grid .go { height: 36px; }

/* 押金 */
.dep-tag {
  font-size: 10px; color: var(--purple); background: color-mix(in srgb, var(--purple) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--purple) 28%, transparent); border-radius: 5px; padding: 0 5px; margin-left: 3px;
}
.dep-row {
  display: flex; gap: 10px 18px; flex-wrap: wrap; font-size: 12.5px; padding: 11px 13px;
  background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 11px;
}
.dep-row b { font-weight: 650; font-variant-numeric: tabular-nums; }

/* 账号搜索组合框 */
.combo { position: relative; }
.combo-input {
  width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 11px; font-size: 13px; outline: none; transition: border-color .12s, box-shadow .12s;
}
.combo-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 45;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); max-height: 268px; overflow-y: auto; padding: 4px;
  animation: dropIn .13s ease;
}
@keyframes dropIn { from { opacity: 0; transform: translateY(-3px); } }
.combo-item { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 8px; cursor: pointer; font-size: 12.5px; }
.combo-item:hover, .combo-item.on { background: var(--accent-soft); }
.combo-item .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-item .pr { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.combo-empty { padding: 12px; text-align: center; color: var(--muted); font-size: 12px; }

/* 日结按钮 / 小标签 */
.collect-btn {
  color: var(--accent-dark); border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: var(--accent-soft); font-variant-numeric: tabular-nums; font-weight: 600;
}
.collect-btn:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-dark); }
.mode-tag {
  font-size: 10px; color: var(--accent-dark); background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-radius: 5px; padding: 0 5px; margin-left: 4px; vertical-align: 1px; white-space: nowrap;
}

/* ============ 模态 ============ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(10, 12, 30, .52); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 24px; z-index: 60;
  overflow-y: auto; animation: maskIn .15s ease;
}
@keyframes maskIn { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 620px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 17px; box-shadow: var(--shadow-lg); animation: popIn .18s cubic-bezier(.2, .9, .3, 1.15);
}
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.975); } }
.modal.lg { max-width: 860px; }
.modal.sm { max-width: 400px; }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 15px 19px 13px; border-bottom: 1px solid var(--line-soft); }
.modal-head h3 { font-size: 14.5px; }
.modal-head .icon-btn { margin-left: auto; box-shadow: none; }
.modal-body { padding: 16px 19px; max-height: 68vh; overflow-y: auto; }
.modal-foot {
  padding: 12px 19px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px;
  justify-content: flex-end; align-items: center; background: var(--panel-2); border-radius: 0 0 17px 17px; flex-wrap: wrap;
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .sec {
  grid-column: 1 / -1; font-size: 11px; font-weight: 650; color: var(--accent-dark); letter-spacing: .4px;
  padding-top: 8px; border-top: 1px solid var(--line-soft); margin-top: 3px;
  display: flex; align-items: center; gap: 7px;
}
.form-grid .sec::before { content: ""; width: 3px; height: 11px; border-radius: 2px; background: var(--grad); }

/* toast */
.toast-root { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 90; }
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 14px; border-radius: 11px; background: var(--panel); border: 1px solid var(--line);
  box-shadow: var(--shadow-lg); font-size: 12.5px; max-width: 340px; color: var(--text);
  transition: opacity .25s, transform .25s; animation: toastIn .22s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } }
.toast::before {
  content: "ℹ"; width: 19px; height: 19px; flex: 0 0 19px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; background: var(--accent-soft); color: var(--accent-dark);
}
.toast.ok::before { content: "✓"; background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.toast.err::before { content: "✕"; background: color-mix(in srgb, var(--red) 13%, transparent); color: var(--red); }

/* ============ 详情 ============ */
.detail-top { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.detail-title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.detail-title h1 { font-size: 21px; letter-spacing: -.2px; overflow-wrap: anywhere; }
.detail-title .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 12px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 9px; }
.kv .item {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
  background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 11px; padding: 8px 12px;
}
.kv .item span { font-size: 10.5px; color: var(--muted); font-weight: 500; }
.kv .item strong { font-size: 12.5px; font-weight: 550; overflow-wrap: anywhere; }
.pwd-box { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button {
  background: none; border: 0; padding: 8px 13px; color: var(--muted); cursor: pointer;
  font-size: 13px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
  font-weight: 500; transition: color .12s;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--accent-dark); border-bottom-color: var(--accent); font-weight: 650; }

/* ============ 图表 ============ */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 118px; padding-top: 8px; border-bottom: 1px solid var(--line-soft); }
.bars .bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; min-width: 0; height: 100%; }
.bars .bar-col .bar {
  width: 100%; max-width: 24px; background: linear-gradient(180deg, var(--accent-2), var(--accent));
  opacity: .82; border-radius: 5px 5px 2px 2px; min-height: 3px; transition: opacity .12s;
}
.bars .bar-col:hover .bar { opacity: 1; }
.bars .bar-col .cap { font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.hbar { display: flex; flex-direction: column; gap: 8px; }
.hbar .row { display: grid; grid-template-columns: 116px 1fr 72px; gap: 9px; align-items: center; font-size: 12px; }
.hbar .row .track { height: 7px; background: var(--panel-3); border-radius: 4px; overflow: hidden; }
.hbar .row .track > i { display: block; height: 100%; background: var(--grad); border-radius: 4px; opacity: .85; }
.hbar .row .val { text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; font-weight: 550; }

/* ============ 列表行 ============ */
.mini-list { display: flex; flex-direction: column; }
.mini-list .row {
  display: flex; align-items: center; gap: 9px; padding: 8px 2px; border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px; border-radius: 6px;
}
.mini-list .row:last-child { border-bottom: 0; }
.mini-list .row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.only-mobile { display: none; }

@media (max-width: 1220px) {
  .bf-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bf-grid .go { grid-column: 1 / -1; }
  .skl-row { grid-template-columns: repeat(2, 1fr); }
}

/* ============ 响应式 ============ */
@media (max-width: 1120px) {
  .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .global-search input { width: 168px; }
  .global-search kbd { display: none; }
  .quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quick-grid .go { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100dvh; width: var(--sidebar-w) !important;
    flex-basis: auto; transform: translateX(-105%); box-shadow: 8px 0 28px rgba(0, 0, 0, .3);
  }
  .sidebar.open { transform: none; }
  body.sb-collapsed .brand-text, body.sb-collapsed .nav a span,
  body.sb-collapsed .who, body.sb-collapsed #logout-btn { display: flex; }
  body.sb-collapsed .collapse-btn { display: none; }
  body.sb-collapsed .nav a { justify-content: flex-start; padding: 8px 11px; }
  #expand-btn { display: none !important; }
  .only-mobile { display: grid; }
  .view { padding: 14px 12px 36px; }
  .topbar { padding: 10px 12px; gap: 8px; }
  .topbar h2 { font-size: 15px; }
  .global-search { display: none; }
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: minmax(0, 1fr); }
  .skl-row { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .filters .field { flex: 1 1 44%; min-width: 0; }
  .stat .value { font-size: 20px; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-mask { padding: 0; align-items: flex-end; }
  .modal { border-radius: 18px 18px 0 0; max-height: 94dvh; }
  .modal-foot { border-radius: 0; }
  .modal-body { max-height: 72dvh; }
  .hbar .row { grid-template-columns: 82px 1fr 60px; }
  .toast-root { left: 12px; right: 12px; bottom: 12px; }
  .toast { max-width: none; }
  .detail-title h1 { font-size: 18px; }
}
