:root {
  --ink: #142033;
  --muted: #66758c;
  --line: #e2e8f0;
  --bg: #f3f6fa;
  --card: #ffffff;
  --brand: #0b2545;
  --brand-2: #123a63;
  --teal: #0f766e;
  --teal-2: #0b5f58;
  --accent: #c9971f;
  --accent-2: #e8c765;
  --ok: #067647;
  --danger: #b42318;
  --warn: #b54708;
  --info: #175cd3;
  --purple: #7a5af8;
  --shadow: 0 1px 2px rgba(16, 32, 56, .04), 0 10px 28px rgba(16, 32, 56, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: var(--base-font, 14px);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-2); }
h1, h2, h3, h4 { margin: 0; font-weight: 650; }
p { line-height: 1.8; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mono { font-family: ui-monospace, Consolas, "SFMono-Regular", monospace; }
.strong { font-weight: 650; }
.hidden { display: none !important; }
.link { color: var(--teal); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd6e2; border: 3px solid transparent; border-radius: 999px; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #acbccd; background-clip: content-box; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 228px; flex: 0 0 228px; color: #d7e3f0;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-deep, #071a30) 100%);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  z-index: 40; transition: width .18s ease, flex-basis .18s ease;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 12px 10px 10px 12px; border-bottom: 1px solid rgba(255,255,255,.08); flex: 0 0 auto; }
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-mark {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), #a97c12); color: #1a1405; font-weight: 800; font-size: 16px;
  box-shadow: 0 2px 8px rgba(201,151,31,.35);
}
.brand-tx { min-width: 0; }
.brand strong { display: block; color: #fff; font-size: 14.5px; letter-spacing: .04em; line-height: 1.25; white-space: nowrap; }
.brand small { color: var(--accent-2); font-size: 10px; letter-spacing: .02em; line-height: 1.3; white-space: nowrap; }
.nav-collapse {
  flex: 0 0 24px; width: 24px; height: 24px; border-radius: 6px; cursor: pointer;
  background: transparent; color: #a9bdd4; border: 1px solid rgba(255,255,255,.16);
  font-size: 13px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
}
.nav-collapse:hover { color: #fff; border-color: rgba(255,255,255,.34); background: rgba(255,255,255,.06); }
.sidebar nav { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 6px 8px; }
.sidebar nav::-webkit-scrollbar { width: 6px; }
.sidebar nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border: 1px solid transparent; background-clip: content-box; }
.sidebar nav a, .nav-group-h {
  display: flex; align-items: center; gap: 8px; width: 100%;
  color: #b7c9dd; padding: 5px 8px; border-radius: 7px; font-size: 12.5px; line-height: 1.35;
  font-family: inherit; text-align: left; background: none; border: 0; cursor: pointer;
  transition: background .12s ease, color .12s ease;
  flex-wrap: nowrap; white-space: nowrap; word-break: keep-all;
}
.sidebar nav a .nav-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; white-space: nowrap; }
.nav-i { flex: 0 0 15px; width: 15px; height: 15px; opacity: .78; }
.sidebar nav a, .sidebar nav a * { white-space: nowrap; }
.sidebar nav a { min-height: 28px; }
.sidebar nav a:hover, .nav-group-h:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a:hover .nav-i { opacity: 1; }
.sidebar nav a.active { background: rgba(201,151,31,.16); color: #fff; font-weight: 650; box-shadow: inset 2px 0 0 var(--accent); }
.sidebar nav a.active .nav-i { opacity: 1; color: var(--accent-2); }
.nav-home { font-weight: 600; color: #eaf2fb; margin-bottom: 2px; }
.nav-group { margin-top: 2px; padding-top: 4px; border-top: 1px solid rgba(255,255,255,.06); }
.nav-group:first-of-type { border-top: 0; padding-top: 2px; margin-top: 0; }
.nav-group-h { color: #88a1bb; font-size: 11px; font-weight: 600; letter-spacing: .06em; padding: 3px 8px 4px; min-height: 26px; }
.nav-group-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-caret { flex: 0 0 11px; opacity: .5; transition: transform .16s ease; }
.nav-group.is-open .nav-caret { transform: rotate(90deg); opacity: .8; }
.nav-items { display: none; padding: 0 0 2px 2px; }
.nav-group.is-open .nav-items { display: block; }
.user-box { border-top: 1px solid rgba(255,255,255,.08); padding: 8px 10px 10px 12px; font-size: 11.5px; color: #9db3c8; flex: 0 0 auto; }
.user-box .name { color: #fff; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-box .user-role { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .9; }
.user-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.user-links a { display: inline-flex; align-items: center; gap: 5px; color: #c3d5e8; }
.user-links .nav-i { flex: 0 0 14px; width: 14px; height: 14px; }

@media (min-width: 861px) {
  body.nav-rail .sidebar { width: 62px; flex-basis: 62px; }
  body.nav-rail .sidebar-head { justify-content: center; padding: 10px 0 8px; }
  body.nav-rail .brand-tx, body.nav-rail .nav-t, body.nav-rail .nav-group-t, body.nav-rail .nav-caret,
  body.nav-rail .user-meta { display: none; }
  body.nav-rail .brand { justify-content: center; }
  body.nav-rail .brand-mark { flex: 0 0 28px; width: 28px; height: 28px; }
  body.nav-rail .nav-collapse { transform: rotate(180deg); position: absolute; top: 42px; right: 4px; width: 18px; height: 18px; font-size: 11px; }
  body.nav-rail .sidebar nav { padding: 8px 0 12px; scrollbar-width: none; }
  body.nav-rail .sidebar nav::-webkit-scrollbar { width: 0; height: 0; }
  body.nav-rail .sidebar nav a { justify-content: center; padding: 9px 0; border-radius: 0; }
  body.nav-rail .nav-group { border-top: 0; padding-top: 0; margin-top: 0; }
  body.nav-rail .nav-group-h { justify-content: center; padding: 7px 0; }
  body.nav-rail .nav-group-h::after { content: ''; display: block; width: 18px; height: 1px; background: rgba(255,255,255,.2); }
  body.nav-rail .nav-items { display: block; }
  body.nav-rail .user-box { padding: 10px 0 12px; text-align: center; }
  body.nav-rail .user-links { justify-content: center; margin-top: 0; }
}
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: #fff; border-bottom: 1px solid var(--line); padding: 0 18px;
  height: 56px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30;
}
.topbar h1 { font-size: 17px; font-weight: 650; flex: 0 0 auto; max-width: 34%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.nav-toggle { display: none; }
.topbar-search { margin-left: 4px; flex: 0 1 300px; min-width: 110px; }
.topbar-search input[type=search] {
  width: 100%; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: #f7f9fc; font-size: 12.5px;
}
.topbar-search input[type=search]:focus { background: #fff; border-color: #9db4cc; outline: none; }
@media (max-width: 1080px) { .topbar-search { display: none; } }
.icon-btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink); width: 32px; height: 32px;
  border-radius: 8px; cursor: pointer; font-size: 15px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.icon-btn:hover { border-color: #c0cfdd; background: #f7fafd; }
.quick-acts { display: flex; gap: 6px; align-items: center; }
.quick-act { white-space: nowrap; }
.topbar-t { display: inline; }
@media (max-width: 1280px) { .quick-acts { display: none; } }
.topbar-dup { white-space: nowrap; }
@media (max-width: 980px) { .topbar-dup, .role-switch { display: none; } }
.role-switch select { border: 1px solid var(--line); border-radius: 8px; padding: 5px 6px; font-size: 12px; background: #fff; max-width: 168px; }
.topbar-user { font-size: 12px; color: var(--muted); text-align: right; line-height: 1.35; white-space: nowrap; }
.topbar-user b { display: block; color: var(--ink); font-size: 13px; }
@media (max-width: 760px) { .topbar-user { display: none; } .topbar { gap: 8px; } .topbar h1 { max-width: 50%; font-size: 15px; } .nav-toggle { display: inline-flex; } }
.content { padding: 16px 20px 28px; flex: 1; min-width: 0; }
.site-foot { padding: 12px 20px 20px; color: #93a4ba; font-size: 11px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-foot__site { color: #6f8ba8; text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.site-foot__site:hover { color: var(--brand); border-color: rgba(11,37,69,.3); background: #f2f7fc; }
.site-foot a { color: #6f8ba8; }
.site-foot a:hover { color: var(--brand); }
.site-foot__copy { border-bottom: 1px dotted rgba(111,139,168,.5); }
.site-foot__contact { white-space: nowrap; }
.nav-copy { display: block; margin-top: 6px; color: #8ea9c4; font-size: 10.5px; text-decoration: none; letter-spacing: .02em; }
.nav-copy:hover { color: #d7e6f5; }
body.nav-rail .nav-copy { text-align: center; font-size: 0; }
body.nav-rail .nav-copy::after { content: "©"; font-size: 10.5px; }
.nav-mask { display: none; }
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .18s ease; width: 250px; flex-basis: 250px; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-mask { display: block; position: fixed; inset: 0; background: rgba(8,18,32,.42); z-index: 35; }
  .content { padding: 12px; }
  .nav-toggle { display: inline-flex; }
  .quick-act span, .topbar-t { display: none; }
}

/* ---------- 卡片 / 栅格 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow); min-width: 0; }
.card > h2, .card > h3 { font-size: 15px; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card > h2 .sub, .card > h3 .sub { font-size: 12px; color: var(--muted); font-weight: 400; }
.card.pad-0 { padding: 0; overflow: hidden; }
.card-h { padding: 13px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-h h2, .card-h h3 { margin: 0; font-size: 15px; }
.card-h .sub { font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.card-b { padding: 14px 16px; }
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3, .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .grid-2, .grid-4 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.spacer { flex: 1; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); min-height: 88px; display: flex; flex-direction: column; }
.kpi .lab { font-size: 12px; color: var(--muted); }
.kpi .num { font-size: 23px; font-weight: 700; letter-spacing: -.02em; margin-top: 3px; }
.kpi .sub { margin-top: auto; padding-top: 6px; font-size: 12px; color: var(--muted); }
.kpi.teal .num { color: var(--teal); }
.kpi.gold .num { color: #8a6d12; }
.kpi.red .num { color: var(--danger); }
.kpi.warn .num { color: var(--warn); }
.kpi.ok .num { color: var(--ok); }
.kpi.info .num { color: var(--info); }
a.kpi { color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.kpi:hover { border-color: var(--teal); box-shadow: 0 2px 12px rgba(15,118,110,.14); transform: translateY(-1px); }

/* ---------- 表格 ---------- */
.table-wrap { overflow: auto; max-width: 100%; }
.table-tools { display: flex; align-items: center; gap: 8px; margin: 2px 0 8px; padding: 0 2px; }
.table-tools .small { margin-right: auto; }
/* 数据表：视图统一输出 <table class="table">，table.data 为历史别名，两者同款 */
table.table, table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; color: var(--ink); }
table.table th, table.table td,
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid #edf1f6; text-align: left; vertical-align: middle; }
table.table thead th, table.data thead th {
  background: #f7f9fc; color: #5b6b82; font-weight: 600; font-size: 12px;
  white-space: nowrap; position: sticky; top: 0; z-index: 1; border-bottom: 1px solid #e3eaf3;
}
table.table th:first-child, table.table td:first-child { padding-left: 16px; }
table.table th:last-child, table.table td:last-child { padding-right: 16px; }
/* 列多的表不再被挤扁：容器变窄时整体横向滚动，列宽保持可读（手机端保持原生收缩） */
@media (min-width: 761px) {
  .table-wrap > table.table { min-width: 880px; }
}
table.table th { white-space: nowrap; }
table.table td.num, table.table td.right { white-space: nowrap; }
table.table td .muted.small { line-height: 1.5; }
table.table td .cell-sub { display: flex; flex-wrap: wrap; gap: 0 8px; margin-top: 3px; }
table.table tbody tr:nth-child(even) { background: #fcfdff; }
table.table tbody tr:hover, table.data tbody tr:hover { background: #f2f7fd; }
table.table tbody tr:last-child td, table.data tbody tr:last-child td { border-bottom: 0; }
table.table td.num, table.table th.num, table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.table td.right, table.table th.right, table.data td.right, table.data th.right { text-align: right; }
table.table td.center, table.table th.center, table.data td.center, table.data th.center { text-align: center; }
table.table .main-cell, table.data .main-cell { font-weight: 650; color: #1f2d3d; word-break: break-word; }
table.table tr.is-urgent-red td:first-child, table.data tr.is-urgent-red td:first-child { box-shadow: inset 3px 0 0 #dc2626; }
table.table tr.is-urgent-blue td:first-child, table.data tr.is-urgent-blue td:first-child { box-shadow: inset 3px 0 0 #2563eb; }
table.table tr.is-urgent-yellow td:first-child, table.data tr.is-urgent-yellow td:first-child { box-shadow: inset 3px 0 0 #d97706; }
.table-foot { padding: 10px 14px; border-top: 1px solid var(--line); }

/* ---------- 徽标 / 标签 ---------- */
.badge { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; line-height: 1.7; white-space: nowrap; border: 1px solid transparent; }
.badge-ok { background: #ecfdf3; color: var(--ok); border-color: #b7e4c9; }
.badge-warn { background: #fffaeb; color: var(--warn); border-color: #f3d9a4; }
.badge-danger { background: #fef3f2; color: var(--danger); border-color: #f6c9c4; }
.badge-info { background: #eff8ff; color: var(--info); border-color: #c3ddfb; }
.badge-muted { background: #f2f4f7; color: #5b6b82; border-color: #dde3ea; }
.badge-purple { background: #f5f3ff; color: var(--purple); border-color: #ddd6fe; }
.tag { display: inline-flex; align-items: center; padding: 0 6px; border-radius: 5px; font-size: 11px; line-height: 1.65; background: #eef2f7; color: #4d5d74; white-space: nowrap; }
.tag-danger { background: #dc2626; color: #fff; }
.tag-warn { background: #f79009; color: #fff; }
.tag-ok { background: #067647; color: #fff; }
.tag-on { background: rgba(255,255,255,.22); color: #fff; }

/* 急件颜色标记（行级手工标记，与定损状态自带的颜色分开） */
.urgent-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.urgent-red { background: #dc2626; }
.urgent-blue { background: #2563eb; }
.urgent-yellow { background: #d97706; }
.urgent-none { background: #cbd5e1; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 8px; padding: 7px 12px; font-size: 13px; line-height: 1.2; cursor: pointer;
  font-family: inherit; white-space: nowrap; transition: border-color .12s, background .12s, color .12s;
}
.btn:hover { border-color: #c3d1e0; background: #f9fbfd; color: var(--ink); }
.btn.sm { padding: 5px 9px; font-size: 12px; border-radius: 7px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn.teal { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.teal:hover { background: var(--teal-2); border-color: var(--teal-2); color: #fff; }
.btn.gold { background: #b9860b; border-color: #b9860b; color: #fff; }
.btn.gold:hover { background: #9d7108; border-color: #9d7108; color: #fff; }
.btn.danger { color: var(--danger); border-color: #f0c2bd; }
.btn.danger:hover { background: #fef3f2; }
.btn[disabled], .btn.disabled { opacity: .55; cursor: not-allowed; }
.btn-icon { padding: 5px 7px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- 表单 ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.filters .field { margin: 0; }
.filters-toggle { display: none; }
.filters input, .filters select { min-width: 130px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; min-width: 0; }
.field > label { font-size: 12px; color: #5b6b82; font-weight: 600; }
.field .hint { font-size: 11px; color: var(--muted); }
.field .req { color: var(--danger); margin-left: 2px; }
input[type=text], input[type=number], input[type=date], input[type=datetime-local], input[type=password], input[type=search], input[type=tel], input:not([type]), input[type=email], input[type=url], select, textarea {
  width: 100%; border: 1px solid #d8e1eb; border-radius: 8px; padding: 7px 9px; font-size: 13px;
  background: #fff; color: var(--ink); font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #8fb0cf; box-shadow: 0 0 0 3px rgba(23,92,211,.08); }
textarea { min-height: 78px; resize: vertical; }
input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--teal); }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: 1 / -1; }
@media (max-width: 980px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2, .form-grid .span-3 { grid-column: auto; } }
.form-actions { display: flex; gap: 10px; align-items: center; padding-top: 10px; border-top: 1px solid var(--line); margin-top: 4px; }
/* 12 栅格的表单项（sys/dicts 等页面在用）：无样式时会退化成整行堆叠 */
.form-item { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; min-width: 0; }
.form-item .form-label { font-size: 12px; color: #5b6b82; font-weight: 600; }
.form-item .form-label em { color: var(--danger); font-style: normal; margin-left: 2px; }
.form-item .form-control { width: 100%; }
.form-item .hint, .form-item small { font-size: 11px; color: var(--muted); }
.form-grid .col-2 { grid-column: span 2; }
.form-grid .col-3 { grid-column: span 3; }
.form-grid .col-4 { grid-column: span 4; }
.form-grid .col-5 { grid-column: span 5; }
.form-grid .col-6 { grid-column: span 6; }
.form-grid .col-12 { grid-column: 1 / -1; }
.form-grid:has(.col-4), .form-grid:has(.col-5), .form-grid:has(.col-12) { grid-template-columns: repeat(12, minmax(0, 1fr)); }
@media (max-width: 980px) {
  .form-grid:has(.col-4), .form-grid:has(.col-5), .form-grid:has(.col-12) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .form-grid .col-4, .form-grid .col-5 { grid-column: span 6; }
  .form-grid .col-3 { grid-column: span 3; }
}
@media (max-width: 640px) {
  .form-grid:has(.col-4), .form-grid:has(.col-5), .form-grid:has(.col-12) { grid-template-columns: 1fr; }
  .form-grid .col-2, .form-grid .col-3, .form-grid .col-4, .form-grid .col-5, .form-grid .col-6, .form-grid .col-12 { grid-column: auto; }
}
.checkline { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.checkline input { flex: 0 0 auto; }

/* ---------- 提示 ---------- */
.alert { padding: 9px 12px; border-radius: 9px; margin-bottom: 12px; font-size: 13px; border: 1px solid transparent; }
.alert-success { background: #ecfdf3; border-color: #b7e4c9; color: #05603a; }
.alert-error { background: #fef3f2; border-color: #f6c9c4; color: #912018; }
.alert-warn { background: #fffaeb; border-color: #f3d9a4; color: #7a2e0e; }
.alert-info { background: #eff8ff; border-color: #c3ddfb; color: #194185; }
.empty { padding: 34px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.empty b { display: block; color: var(--ink); margin-bottom: 4px; font-size: 14px; }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; flex-wrap: wrap; }
.pager-nav { display: flex; gap: 5px; flex-wrap: wrap; }
.pager .btn { min-width: 32px; }

/* ---------- 详情 ---------- */
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.detail-grid .item { padding: 9px 0; border-bottom: 1px dashed #edf1f6; min-width: 0; }
.detail-grid .k { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.detail-grid .v { font-size: 13px; word-break: break-all; }
.detail-grid .span-2 { grid-column: span 2; }
.detail-grid .span-3 { grid-column: 1 / -1; }
@media (max-width: 980px) { .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .detail-grid { grid-template-columns: 1fr; } .detail-grid .span-2, .detail-grid .span-3 { grid-column: auto; } }
.section-title { font-size: 13.5px; font-weight: 650; margin: 4px 0 8px; padding-left: 8px; border-left: 3px solid var(--accent); }

/* ---------- 图表 ---------- */
.chart { width: 100%; }
.chart-bars { display: flex; gap: 8px; align-items: flex-end; height: 168px; padding: 8px 2px 0; }
.chart-bars .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.chart-bars .bar-stack { width: 100%; max-width: 46px; display: flex; flex-direction: column-reverse; gap: 2px; justify-content: flex-start; }
.chart-bars .bar { border-radius: 4px 4px 0 0; min-height: 2px; transition: opacity .15s; }
.chart-bars .bar:hover { opacity: .82; }
.chart-bars .bar-label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.chart-bars .bar-val { font-size: 11px; color: var(--ink); font-weight: 600; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--muted); }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }

/* ---------- 分析页竖排柱（.vbars*）：每月一列，两类并排 ---------- */
.vbars-scroll { overflow-x: auto; overflow-y: hidden; }
.vbars { display: flex; gap: 10px; align-items: flex-end; min-width: 100%; padding: 6px 2px 0; }
.vbars-col { flex: 1 1 0; min-width: 46px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.vbars-bars { flex: 0 0 120px; height: 120px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.vbars-bars .vbar { width: 14px; max-width: 18px; border-radius: 3px 3px 0 0; min-height: 2px; transition: opacity .15s; }
.vbars-bars .vbar:hover { opacity: .82; }
.vbars-label { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ---------- 分析页排行（.rank-*） ---------- */
.rank-list { display: flex; flex-direction: column; gap: 7px; }
.rank-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink); text-decoration: none; }
.rank-row:hover { color: var(--teal); text-decoration: none; }
.rank-name { flex: 0 0 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.rank-bar { flex: 1 1 auto; height: 8px; border-radius: 5px; background: #eef2f7; overflow: hidden; }
.rank-bar i { display: block; height: 100%; min-width: 2px; border-radius: 5px; background: linear-gradient(90deg, #0e7490, #2fb3a4); }
.rank-row b { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { width: 148px; height: 148px; border-radius: 50%; position: relative; flex: 0 0 148px; }
.donut::after { content: ''; position: absolute; inset: 26px; background: #fff; border-radius: 50%; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 2; }
.donut-center b { font-size: 21px; letter-spacing: -.02em; }
.donut-center span { font-size: 11px; color: var(--muted); }
.donut-legend { flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 5px; font-size: 12px; }
.donut-legend .lr { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.donut-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.progress { height: 8px; background: #eef2f7; border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--teal); border-radius: 999px; }
.progress.warn > i { background: #d97706; }
.progress.danger > i { background: #dc2626; }

/* ---------- 时间线 ---------- */
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: #e2e8f0; }
.timeline .tl-item { position: relative; padding: 0 0 13px; }
.timeline .tl-item::before { content: ''; position: absolute; left: -17px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: #fff; border: 2px solid var(--teal); }
.timeline .tl-item .t { font-size: 11px; color: var(--muted); }
.timeline .tl-item .d { font-size: 12.5px; margin-top: 1px; }

/* ---------- 抽屉 ---------- */
.help-drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 360px; max-width: 92vw; background: #fff;
  box-shadow: -8px 0 30px rgba(16,32,56,.14); transform: translateX(100%); transition: transform .2s ease;
  z-index: 60; display: flex; flex-direction: column;
}
body.help-open .help-drawer { transform: none; }
.help-h { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.help-h b { display: block; font-size: 15px; }
.help-h small { color: var(--muted); font-size: 11px; }
.help-b { padding: 16px; overflow-y: auto; font-size: 13px; }
.help-foot { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.drawer-mask { display: none; }
body.help-open .drawer-mask { display: block; position: fixed; inset: 0; background: rgba(8,18,32,.3); z-index: 55; }

/* ---------- 登录 ---------- */
.auth-body { background: radial-gradient(1200px 600px at 18% 10%, #16395f 0%, #0b2545 42%, #071a30 100%); min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; }
.auth-hero { padding: 56px 64px; color: #dbe7f5; display: flex; flex-direction: column; justify-content: center; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.auth-brand .brand-mark { width: 42px; height: 42px; flex: 0 0 42px; font-size: 22px; border-radius: 12px; }
.auth-brand b { color: #fff; font-size: 20px; letter-spacing: .04em; }
.auth-brand span { color: var(--accent-2); font-size: 12px; }
.auth-hero h1 { font-size: 34px; line-height: 1.25; color: #fff; letter-spacing: -.01em; margin-bottom: 14px; }
.auth-hero p { color: #a9c0d8; max-width: 520px; font-size: 13.5px; }
.auth-points { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 24px; max-width: 560px; }
.auth-point { border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); border-radius: 10px; padding: 10px 12px; }
.auth-point b { display: block; color: #fff; font-size: 13px; margin-bottom: 2px; }
.auth-point span { font-size: 11.5px; color: #9fb7cf; }
.auth-panel { background: #fff; display: flex; align-items: center; justify-content: center; padding: 40px 36px; }
.auth-box { width: 100%; max-width: 392px; }
.auth-box h2 { font-size: 21px; margin-bottom: 4px; }
.auth-box .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 18px; line-height: 1.65; }
.auth-box .field > label { font-size: 12px; }
.auth-box .btn { width: 100%; padding: 9px; margin-top: 4px; }
.auth-note { color: var(--muted); font-size: 11.5px; line-height: 1.7; margin: 14px 0 0; }
.auth-brandmini { display: none; }

/* 演示身份：2 列卡片，按角色配色，移动端 1 列 */
.demo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.demo-card { margin: 0; min-width: 0; }
.demo-card.is-lead { grid-column: 1 / -1; }
.demo-card.is-lead .demo-btn { border-color: #e6d3a3; background: linear-gradient(100deg, #fffaf0, #fdf7e9); padding: 9px 11px; }
.demo-card.is-lead .demo-btn:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(201, 151, 31, .18); }
.demo-btn {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 9px;
  border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe;
  font-family: inherit; text-align: left; cursor: pointer;
  transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease, background .14s ease;
}
.demo-btn:hover { border-color: #9dc3c0; background: #fff; box-shadow: 0 3px 12px rgba(15, 118, 110, .13); transform: translateY(-1px); }
.demo-btn:active { transform: translateY(0); box-shadow: none; }
.demo-btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.demo-av {
  flex: 0 0 30px; width: 30px; height: 30px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #1d4e79, #0b2545);
}
.demo-tx { flex: 1; min-width: 0; }
.demo-tx b { display: block; font-size: 13px; font-weight: 650; color: var(--ink); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-tx em { display: block; font-style: normal; font-size: 11px; color: var(--muted); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-go { flex: 0 0 auto; font-size: 16px; line-height: 1; color: #c3cede; transition: color .14s ease, transform .14s ease; }
.demo-btn:hover .demo-go { color: var(--teal); transform: translateX(2px); }
.demo-btn[data-role="boss"] .demo-av { background: linear-gradient(135deg, #d8a72b, #a97c12); color: #241a03; }
.demo-btn[data-role="clerk"] .demo-av { background: linear-gradient(135deg, #1d4e79, #0b2545); }
.demo-btn[data-role="field"] .demo-av { background: linear-gradient(135deg, #0f766e, #0b5f58); }
.demo-btn[data-role="finance"] .demo-av { background: linear-gradient(135deg, #2563d9, #12459b); }
.demo-btn[data-role="agent"] .demo-av { background: linear-gradient(135deg, #7a5af8, #5b3fd6); }
.demo-btn[data-role="bookkeeper"] .demo-av { background: linear-gradient(135deg, #c2620d, #8f3a06); }
.auth-sep { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; color: #93a1b5; font-size: 11.5px; }
.auth-sep::before, .auth-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-demo { margin-top: 22px; border-top: 1px dashed var(--line); padding-top: 14px; }
.auth-demo b { font-size: 12px; color: #5b6b82; display: block; margin-bottom: 6px; }
.demo-users { display: flex; flex-wrap: wrap; gap: 6px; }
.demo-users a { border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; font-size: 11.5px; color: #4d5d74; background: #f8fafc; }
.demo-users a:hover { border-color: var(--teal); color: var(--teal); background: #f0fdfa; }
.auth-err { background: #fef3f2; border: 1px solid #f6c9c4; color: #912018; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; margin-bottom: 12px; }
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-panel { min-height: 100vh; padding: 30px 22px; align-items: flex-start; }
  .auth-box { max-width: 440px; margin: 0 auto; }
  .auth-brandmini { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
  .auth-brandmini .brand-mark { width: 38px; height: 38px; flex: 0 0 38px; font-size: 20px; border-radius: 11px; }
  .auth-brandmini b { display: block; color: var(--brand); font-size: 16px; letter-spacing: .03em; line-height: 1.3; }
  .auth-brandmini span { display: block; color: var(--muted); font-size: 11px; }
}
@media (max-width: 380px) {
  .demo-grid { grid-template-columns: 1fr; }
}

/* ---------- 产品介绍 ---------- */
.landing { background: #f3f6fa; }
.landing-nav { height: 60px; background: rgba(11,37,69,.96); color: #dbe7f5; display: flex; align-items: center; padding: 0 26px; gap: 14px; position: sticky; top: 0; z-index: 20; }
.landing-nav .brand strong { color: #fff; }
.landing-nav .brand small { color: var(--accent-2); }
.landing-nav .spacer { flex: 1; }
.landing-nav a.nl { color: #c3d5e8; font-size: 13px; margin-left: 16px; }
.landing-nav a.nl:hover { color: #fff; }
.landing-hero { background: radial-gradient(1000px 460px at 12% 0%, #19466f 0%, #0b2545 48%, #071a30 100%); color: #dbe7f5; padding: 64px 26px 72px; }
.landing-hero .wrap { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.landing-hero h1 { color: #fff; font-size: 38px; line-height: 1.22; letter-spacing: -.02em; margin-bottom: 16px; }
.landing-hero h1 em { font-style: normal; color: var(--accent-2); }
.landing-hero p { color: #a9c0d8; font-size: 14.5px; max-width: 560px; }
.landing-cta { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.landing-cta .btn { padding: 9px 16px; }
.landing-stats { display: flex; gap: 26px; margin-top: 30px; flex-wrap: wrap; }
.landing-stats b { display: block; color: #fff; font-size: 22px; }
.landing-stats span { font-size: 11.5px; color: #9fb7cf; }
.landing-card { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14); border-radius: 14px; padding: 16px; }
.landing-card h3 { color: #fff; font-size: 14px; margin-bottom: 10px; }
.landing-card .lr { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: #b9cde1; padding: 6px 0; border-bottom: 1px dashed rgba(255,255,255,.1); }
.landing-card .lr:last-child { border-bottom: 0; }
.landing-card .lr b { color: #fff; }
.landing-section { max-width: 1080px; margin: 0 auto; padding: 44px 26px; }
.landing-section h2 { font-size: 24px; margin-bottom: 6px; }
.landing-section .lead { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.feature .fi { width: 34px; height: 34px; border-radius: 9px; background: #eff8ff; color: var(--info); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.feature b { display: block; font-size: 14px; margin-bottom: 4px; }
.feature p { font-size: 12.5px; color: var(--muted); margin: 0; line-height: 1.7; }
.landing-foot { background: #071a30; color: #8fa8c2; font-size: 12px; padding: 26px; }
.landing-foot__in { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.landing-foot__in a { color: #9fd0f5; }
.landing-foot__crumb { line-height: 1.9; }
.landing-foot__crumb .copy { color: #c7dcf1; border-bottom: 1px dotted rgba(159,208,245,.5); text-decoration: none; }
.landing-biz { display: flex; align-items: center; gap: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(120,180,230,.2); border-radius: 12px; padding: 10px 14px; }
.landing-biz__qr { width: 106px; height: 106px; border-radius: 8px; background: #fff; padding: 4px; display: block; flex: 0 0 auto; object-fit: contain; }
.landing-biz b { display: block; color: #fff; font-size: 13px; margin-bottom: 3px; }
.landing-biz .ph { display: inline-block; font-size: 17px; font-weight: 700; color: #7fd4ff; letter-spacing: .02em; text-decoration: none; }
.landing-biz .tip { font-size: 11px; color: #8fa8c2; margin-top: 3px; }
@media (max-width: 900px) { .landing-hero .wrap { grid-template-columns: 1fr; } .feature-grid { grid-template-columns: 1fr; } .landing-hero h1 { font-size: 28px; } .landing-foot__in { justify-content: center; text-align: center; } }

/* ---------- 打印 ---------- */
.print-body { background: #eef2f7; padding: 18px; }
.print-bar { max-width: 860px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.paper { max-width: 860px; margin: 0 auto; background: #fff; padding: 42px 52px; box-shadow: 0 4px 20px rgba(16,32,56,.08); }
.paper h1 { text-align: center; font-size: 22px; letter-spacing: .12em; margin-bottom: 6px; }
.paper .paper-sub { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 22px; }
.paper h2 { font-size: 14px; margin: 18px 0 6px; padding-left: 8px; border-left: 3px solid var(--brand, #2f6fed); }
.paper .paper-row { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 12px; color: #4d5d74; }
.paper table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 12px 0; }
.paper table th, .paper table td { border: 1px solid #cfd8e3; padding: 7px 9px; text-align: left; }
.paper table th { background: #f5f8fb; font-weight: 600; }
.paper .paper-p { font-size: 13px; line-height: 2; text-indent: 2em; }
.paper .sign-row { display: flex; justify-content: space-between; gap: 30px; margin-top: 46px; font-size: 13px; }
.paper .sign-row > div { flex: 1; }
.paper .sign-line { margin-top: 30px; border-top: 1px solid #b9c6d6; padding-top: 5px; color: var(--muted); font-size: 12px; }
@media print {
  .no-print, .print-bar, .table-tools, .site-foot, .m-foot { display: none !important; }
  body, .print-body { background: #fff; padding: 0; }
  .paper { box-shadow: none; padding: 0; max-width: none; }
  body.printing-one .side, body.printing-one .top, body.printing-one .page-head,
  body.printing-one .tabs, body.printing-one .flash, body.printing-one .foot { display: none !important; }
  body.printing-one .main { margin: 0 !important; }
  body.printing-one .print-target { box-shadow: none !important; border: 0 !important; }
  body.printing-one .print-target tr { break-inside: avoid; }
  @page { margin: 12mm; }
}

/* ---------- 移动端 ---------- */
.m-body { background: #f3f6fa; padding-bottom: 70px; }
.m-head { background: linear-gradient(180deg, var(--brand), #0e3357); color: #fff; padding: 16px 16px 22px; border-radius: 0 0 18px 18px; }
.m-head .row { align-items: flex-start; }
.m-head h1 { font-size: 18px; color: #fff; }
.m-head .muted { color: #a9c0d8; }
.m-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.m-kpis .mk { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); border-radius: 10px; padding: 8px 10px; }
.m-kpis .mk b { display: block; font-size: 19px; color: #fff; }
.m-kpis .mk span { font-size: 10.5px; color: #b9cde1; }
.m-tabs { display: flex; gap: 6px; padding: 10px 12px 0; }
.m-tab { flex: 1; text-align: center; padding: 7px 0; font-size: 12.5px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); }
.m-tab.active { background: var(--brand, #0f2033); border-color: var(--brand, #0f2033); color: #fff; font-weight: 600; }
.m-list { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.m-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; box-shadow: var(--shadow); }
.m-item .t { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.m-item .t b { font-size: 13.5px; }
.m-item .meta { color: var(--muted); font-size: 11.5px; margin-top: 4px; }
.m-item .acts { margin-top: 9px; display: flex; gap: 8px; }
.m-board-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.m-kpi-card { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px 11px 24px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdff; color: inherit; text-decoration: none; }
.m-kpi-card .lab { font-size: 11px; color: var(--muted); }
.m-kpi-card .num { font-size: 18px; font-variant-numeric: tabular-nums; color: #0f2033; }
.m-kpi-card .num small { font-size: 10px; color: var(--muted); margin-left: 2px; font-weight: 400; }
.m-kpi-card em { font-style: normal; font-size: 10px; color: #8a9bb0; line-height: 1.35; }
.m-kpi-card i { position: absolute; right: 9px; bottom: 7px; font-style: normal; font-size: 10px; color: var(--teal); }
.m-kpi-card:active { background: #eef6fb; }
.m-tabbar { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); display: flex; z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
.m-tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; font-size: 10.5px; color: #6b7f95; }
.m-tabbar a.on { color: var(--teal); }
.m-tabbar .nav-i { width: 18px; height: 18px; flex: 0 0 18px; }
.m-tabbar em { font-style: normal; background: #dc2626; color: #fff; font-size: 9px; border-radius: 999px; padding: 0 5px; margin-top: -2px; }

/* ---------- 外勤现场：打卡 / 取证 / 断网补传 ---------- */
.m-geo { display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; flex-wrap: wrap; }
.m-geo-log { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 6px; }
.m-geo-log .meta { display: flex; gap: 6px; align-items: center; }
.m-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0; }
.m-thumb { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #eef2f7; aspect-ratio: 1 / 1; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10px; color: var(--muted); }
.m-thumb img { width: 100%; height: 100%; object-fit: cover; }
.m-thumb span { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(15,32,51,.62); color: #fff; font-size: 9px; padding: 1px 3px; }
.m-media { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.m-media a { display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #eef2f7; aspect-ratio: 1 / 1; font-size: 10.5px; color: var(--muted); text-align: center; padding: 4px; }
.m-media a img { width: 100%; height: 100%; object-fit: cover; }
.m-media a.m-video { background: #12263c; color: #dbe9f7; }
.m-media a.m-video .vtag { font-size: 12px; color: #fff; }
.m-media a.m-video .vname { font-size: 9px; padding: 0 4px; line-height: 1.4; word-break: break-all; }
.m-media a.m-file { word-break: break-all; }
.m-media a { position: relative; }
.m-geo-tag { position: absolute; left: 4px; top: 4px; background: rgba(6,118,71,.86); color: #fff; font-size: 9px; line-height: 1; padding: 2px 4px; border-radius: 4px; }
.m-auto-up { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin: 2px 0 10px; }
.m-auto-up input { width: 16px; height: 16px; }

/* ---------- 系统水印（演示环境） ---------- */
.sys-watermark {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-content: space-around;
  justify-items: center;
  gap: 6.5rem 2rem;
  padding: 3rem 2rem;
  transform: rotate(-24deg) scale(1.28);
  transform-origin: center center;
  user-select: none;
  -webkit-user-select: none;
}
.sys-watermark span {
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .04em;
  color: rgba(15, 23, 42, .12);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
body.auth-body .sys-watermark span,
body.screen-body .sys-watermark span,
body.m-body .sys-watermark span { color: rgba(255, 255, 255, .14); }
@media (max-width: 760px) {
  .sys-watermark { grid-template-columns: repeat(2, 1fr); gap: 5rem 1rem; transform: rotate(-24deg) scale(1.5); }
  .sys-watermark span { font-size: 11px; }
}

/* ---------- 移动端页脚 ---------- */
.m-foot { padding: 14px 12px 6px; text-align: center; color: #8a9bb0; font-size: 11px; line-height: 1.9; }
.m-foot a { color: #4d7fa8; }
@media print { .sys-watermark { display: none !important; } }

/* ================= vNext 2026-11：统一排版 / 移动端 H5 / 弹层 / 打印 ================= */
/* 字号：正文 14、辅助 12.5、标签 12，最小不低于 11.5，避免中文小字发虚 */
:root {
  --fs-xs: 11.5px; --fs-sm: 12.5px; --fs-md: 13px; --fs-base: 14px; --fs-lg: 15px; --fs-xl: 17px;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px;
  --btn-h: 34px;
}
body { line-height: 1.55; }
.small { font-size: var(--fs-sm); }
.muted.small { line-height: 1.6; }
h1, h2, h3, h4 { letter-spacing: 0; }
.topbar h1 { font-size: var(--fs-xl); }
.card > h2, .card > h3, .card-h h2, .card-h h3 { font-size: var(--fs-lg); }

/* 页面头：以前 .page-h 没有样式，标题和按钮挤成一团 */
.page-h {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin: 2px 0 14px;
}
.page-h > div:first-child { min-width: 0; flex: 1 1 320px; }
.page-h h1 {
  font-size: 19px; font-weight: 700; line-height: 1.35; color: #0f2033;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.page-h h1 .sub { font-size: var(--fs-sm); font-weight: 400; color: var(--muted); }
.page-h .muted.small { margin-top: 4px; font-size: var(--fs-sm); }
.page-h .btn-row, .page-h > .btn-row { flex: 0 0 auto; justify-content: flex-end; }
@media (max-width: 720px) {
  .page-h { margin-bottom: 10px; }
  .page-h h1 { font-size: 16px; }
  .page-h .btn-row { width: 100%; justify-content: flex-start; }
}

/* 标签页：统一「全部 / 未完成 / 已完成」这类切换条 */
.tabs { display: inline-flex; gap: 4px; padding: 3px; background: #f1f5f9; border-radius: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs a, .tabs button { border: 0; background: transparent; color: #5b6b82; font-size: 12.5px; padding: 5px 11px; border-radius: 8px; cursor: pointer; font-family: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.tabs a:hover, .tabs button:hover { background: #e7eef7; color: var(--ink); }
.tabs a.on, .tabs a.active, .tabs button.on, .tabs button.active { background: #fff; color: var(--brand); font-weight: 650; box-shadow: 0 1px 3px rgba(16,32,56,.1); }

/* 侧栏：一级模块更清晰，二级缩进出一条线；默认只展开当前模块 */
.sidebar nav a { font-size: 13px; padding: 6px 8px; min-height: 32px; border-radius: 8px; }
.nav-group { margin-top: 5px; padding-top: 4px; }
.nav-group-h { font-size: 11.5px; min-height: 30px; padding: 6px 8px; letter-spacing: .04em; }
.nav-group.is-open > .nav-group-h { color: #cfe1f3; background: rgba(255,255,255,.05); }
.nav-items { padding: 2px 0 4px 10px; margin-left: 6px; border-left: 1px solid rgba(255,255,255,.07); }
.nav-items a { font-size: 12.5px; min-height: 30px; }
body.nav-rail .nav-items { padding-left: 0; margin-left: 0; border-left: 0; }
body.nav-rail .sidebar nav a { justify-content: center; min-height: 34px; }
/* 收起后悬停显示名称，不再只剩图标猜谜 */
@media (min-width: 861px) {
  body.nav-rail .sidebar nav a, body.nav-rail .nav-group-h { position: relative; }
  body.nav-rail .sidebar nav a:hover::after, body.nav-rail .nav-group-h:hover::after {
    content: attr(title); position: absolute; left: 58px; top: 50%; transform: translateY(-50%);
    background: #0b2545; color: #fff; font-size: 12px; padding: 4px 9px; border-radius: 6px;
    white-space: nowrap; z-index: 60; box-shadow: 0 4px 14px rgba(0,0,0,.22);
  }
}

/* 顶栏：身份在前、快捷入口在后，右侧只留最常用 */
.topbar { height: 58px; gap: 10px; padding: 0 16px; }
.topbar-user { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.topbar-user b { font-size: 12.5px; }
.topbar-user span { font-size: 11px; color: var(--muted); }
.role-switch select { max-width: 150px; font-size: 12px; padding: 6px 8px; }
.quick-act.is-on { border-color: var(--teal); color: var(--teal); background: #f0fdfa; }
@media (max-width: 860px) {
  .topbar { height: 52px; padding: 0 10px; }
  .topbar h1 { font-size: 15px; max-width: 40%; }
  .topbar-search { display: none; }
}

/* 弹层最大化：抽屉 / 任何 data-maximizable 面板都能一键铺满 */
[data-max-btn] {
  border: 1px solid var(--line); background: #fff; color: #5b6b82; border-radius: 7px;
  width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 13px; flex: 0 0 26px;
}
[data-max-btn]:hover { border-color: #c0cfdd; color: var(--ink); }
.is-max { position: fixed !important; inset: 10px !important; width: auto !important; max-width: none !important;
  height: auto !important; max-height: none !important; transform: none !important; z-index: 80 !important;
  border-radius: var(--r-md); display: flex !important; flex-direction: column; }
.is-max .help-b, .is-max .drawer-b { flex: 1 1 auto; min-height: 0; }

/* 长说明收起：页面顶部不再占半屏，需要时展开或进右侧说明抽屉 */
.desc-clamp { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.desc-clamp.is-open { -webkit-line-clamp: unset; display: block; }
.desc-more { border: 0; background: none; color: var(--teal); font-size: 12px; cursor: pointer; padding: 0 0 0 4px; font-family: inherit; }

/* 表格：数字列对齐、空值占位统一 */
table.table td.right, table.table th.right { font-variant-numeric: tabular-nums; }
table.table td .badge + .badge { margin-left: 4px; }
.table-wrap img { max-width: 100%; }
img[loading="lazy"] { background: #f2f4f7; }

/* ---------- 移动端 H5：表格自动变卡片 + 底部五个主入口 ---------- */
.mtab { display: none; }
@media (max-width: 860px) {
  .content { padding: 12px 12px 84px; }
  .site-foot { display: none; }
  .mtab {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 46;
    background: rgba(255,255,255,.98); border-top: 1px solid var(--line);
    padding: 5px 2px calc(5px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 18px rgba(16,32,56,.07);
  }
  .mtab a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 3px 0; font-size: 10.5px; color: #7a8ba0; border-radius: 8px; }
  .mtab a .nav-i { width: 19px; height: 19px; }
  .mtab a.active { color: var(--teal); background: #f0fdfa; font-weight: 600; }
  .mtab a em { font-style: normal; position: absolute; top: 2px; right: 50%; margin-right: -18px; background: #dc2626; color: #fff; font-size: 9px; line-height: 1; padding: 2px 4px; border-radius: 999px; }
  .mtab a { position: relative; }

  /* 所有列表表格在手机上变成卡片，不再横向滚动 */
  .table-wrap { overflow: visible; }
  .table-wrap > table.table { min-width: 0 !important; display: block; width: 100%; }
  table.table thead { display: none; }
  table.table, table.table tbody, table.table tr, table.table td { display: block; width: auto; }
  table.table tbody tr {
    border: 1px solid var(--line); border-radius: var(--r-md); background: #fff !important;
    margin: 0 0 10px; padding: 4px 0; box-shadow: var(--shadow);
  }
  table.table tbody tr:hover { background: #fff !important; }
  table.table td {
    border: 0 !important; padding: 6px 13px !important; white-space: normal !important;
    display: flex; gap: 10px; align-items: flex-start; justify-content: space-between;
    font-size: 13px; text-align: right !important;
  }
  table.table td::before {
    content: attr(data-label); flex: 0 0 78px; text-align: left; color: var(--muted);
    font-size: 12px; font-weight: 600; padding-top: 1px;
  }
  table.table td[data-label=""]::before, table.table td:not([data-label])::before { display: none; }
  table.table td.main-cell, table.table td:first-child { font-size: 14px; }
  table.table td .muted.small { text-align: right; }
  table.table tr.is-urgent-red td, table.table tr.is-urgent-yellow td, table.table tr.is-urgent-blue td { box-shadow: none; }
  table.table tr.is-urgent-red { border-left: 3px solid #dc2626; }
  table.table tr.is-urgent-yellow { border-left: 3px solid #d97706; }
  table.table tr.is-urgent-blue { border-left: 3px solid #2563eb; }
  .table-tools { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { min-height: 76px; padding: 10px 12px; }
  .kpi .num { font-size: 19px; }
  .filters { padding: 10px; gap: 6px; }
  .filters .field { flex: 1 1 140px; }
  .filters input, .filters select { min-width: 0; width: 100%; }
  /* 手机屏小：筛选条默认只留一个关键词，其余条件点「筛选条件」再展开 */
  .filters-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%;
    border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 10px;
    padding: 9px 12px; font-size: 13px; font-family: inherit; cursor: pointer; min-height: 38px; }
  .filters-toggle::after { content: "▾"; color: var(--muted); }
  .filters.is-collapsed { padding-top: 8px; }
  .filters.is-collapsed > .field:not(:first-child) { display: none; }
  .filters.is-collapsed > .btn-row, .filters.is-collapsed > .filters-actions { border-top: 0; padding-top: 2px; }
  .detail-grid { grid-template-columns: 1fr; }
  .card { padding: 12px; border-radius: 12px; }
  .card.pad-0 { padding: 0; }
  .page-h h1 { font-size: 16px; }
  .help-drawer { width: 100vw; max-width: 100vw; }
  .pager { padding: 8px 4px 4px; }
}

/* 触摸友好：按钮和输入在手机上不低于 38px */
@media (max-width: 860px) {
  .btn { min-height: 38px; padding: 8px 13px; font-size: 13.5px; }
  .btn.sm { min-height: 32px; }
  input[type=text], input[type=number], input[type=date], input[type=search], input[type=tel],
  input[type=password], input:not([type]), select, textarea { min-height: 38px; font-size: 14px; }
}

/* 打印：批量打印时隐藏一切非单据内容 */
@media print {
  .mtab, .table-tools, .site-foot, .topbar, .sidebar, .nav-mask, .help-drawer, .drawer-mask { display: none !important; }
  body.printing-all .no-print { display: none !important; }
  body.printing-one .print-target, body.printing-all .print-target { break-inside: auto; }
  table.table thead { display: table-header-group; }
  table.table tr { break-inside: avoid; }
}

/* 顶部跳转进度条：点击后立刻有反馈，弱网也不会觉得卡死 */
.cp-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 10000;
  background: linear-gradient(90deg, var(--teal), #38bdf8);
  box-shadow: 0 0 8px rgba(15,118,110,.5); opacity: 0; transition: width .45s ease, opacity .2s ease;
}
.cp-progress.on { opacity: 1; width: 82%; }

/* 面包屑 / 返回：任何子页面都能一眼知道在哪、一键退回 */
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin: 0 0 10px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--teal); }
.crumbs .sep { color: #c2ccd8; }
.crumbs span:last-of-type { color: var(--ink); font-weight: 600; }
.crumbs-back {
  margin-left: auto; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.crumbs-back:hover { border-color: #c0cfdd; background: #f7fafd; }

/* 侧栏徽标：未处理数量直接标在菜单上 */
.nav-badge {
  flex: 0 0 auto; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px;
  background: #dc2626; color: #fff; font-size: 10px; line-height: 17px; text-align: center; font-weight: 700;
}
body.nav-rail .nav-badge { position: absolute; top: 3px; right: 12px; transform: scale(.9); }

@media (min-width: 861px) { .topbar-only-mobile { display: none !important; } }
@media (max-width: 860px) { .crumbs { margin-bottom: 8px; } .crumbs .sep, .crumbs span { display: none; } .crumbs span:last-of-type { display: inline; } .crumbs-back { margin-left: 0; } }

/* ---------- 主题皮肤：在系统设置里切换，不改任何业务逻辑 ---------- */
:root { --brand-deep: #071a30; }
body[data-theme="teal"] { --brand: #0b3b3a; --brand-2: #0f5c58; --brand-deep: #05221f; --teal: #0f766e; --teal-2: #0b5f58; --accent: #d0a53a; --accent-2: #ecd07f; }
body[data-theme="graphite"] { --brand: #1f2937; --brand-2: #334155; --brand-deep: #0b1220; --teal: #2563eb; --teal-2: #1d4ed8; --accent: #c9971f; }
body[data-theme="warm"] { --brand: #4a2a17; --brand-2: #6b3d20; --brand-deep: #2a170c; --teal: #a1551f; --teal-2: #7e3f14; --accent: #d9a441; --accent-2: #f0cd86; }
body[data-theme="teal"] .auth-body, body[data-theme="graphite"] .auth-body, body[data-theme="warm"] .auth-body { background: radial-gradient(1200px 600px at 18% 10%, var(--brand-2) 0%, var(--brand) 42%, var(--brand-deep) 100%); }
