/* ============ 仓库物流管理系统 · 样式 ============ */
:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --line: #e4e8f0;
  --line-2: #eef1f7;
  --text: #1e2533;
  --muted: #6b7688;
  --brand: #2563eb;
  --brand-d: #1d4ed8;
  --brand-l: #eff4ff;
  --ok: #0f9d58;
  --ok-l: #e8f7ef;
  --warn: #d97706;
  --warn-l: #fef4e6;
  --bad: #dc2626;
  --bad-l: #fdecec;
  --side: #0e1729;
  --side-2: #16223a;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 18px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-d); }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 226px;
  flex: 0 0 226px;
  background: linear-gradient(180deg, var(--side) 0%, #0a1120 100%);
  color: #c7d2e4;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.brand .logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  display: grid; place-items: center;
  font-size: 17px; color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .45);
}
.brand .t1 { color: #fff; font-weight: 600; font-size: 15px; letter-spacing: .3px; }
.brand .t2 { font-size: 11px; color: #8494ad; letter-spacing: 1.6px; }

.nav { padding: 10px 10px 24px; }
.nav-group { margin-top: 14px; }
.nav-group .gt {
  font-size: 11px; color: #6d7d96; letter-spacing: 1.4px;
  padding: 4px 10px 6px; text-transform: uppercase;
}
.nav a {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 8px;
  color: #b9c6da; font-size: 13.5px;
  transition: background .12s, color .12s;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active { background: linear-gradient(90deg, rgba(37, 99, 235, .95), rgba(37, 99, 235, .55)); color: #fff; font-weight: 500; }
.nav .ico { width: 16px; text-align: center; opacity: .9; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 58px; background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; position: sticky; top: 0; z-index: 20;
}
.topbar .crumb { font-size: 15px; font-weight: 600; }
.topbar .crumb .sub { font-weight: 400; color: var(--muted); font-size: 12.5px; margin-left: 8px; }
.top-right { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.top-right .who { color: var(--text); font-weight: 500; }
.role-chip {
  background: var(--brand-l); color: var(--brand-d);
  padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500;
}

.content { padding: 20px 22px 40px; flex: 1; }
.foot { text-align: center; color: #98a2b3; font-size: 12px; padding: 10px 0 22px; }

/* ---------- 通用块 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card-h {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line-2);
}
.card-h h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.card-h .hint { color: var(--muted); font-size: 12.5px; }
.card-b { padding: 16px; }
.card-b.tight { padding: 0; }

.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.page-h h1 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -.2px; }
.page-h .desc { color: var(--muted); font-size: 13px; margin-top: 3px; }
.page-h .acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border: 1px solid transparent; border-radius: 8px;
  background: var(--brand); color: #fff;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background .12s, box-shadow .12s, transform .02s;
  white-space: nowrap;
}
.btn:hover { background: var(--brand-d); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: #fff; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: #f8fafc; border-color: #cfd7e6; color: var(--text); }
.btn.danger { background: var(--bad); }
.btn.danger:hover { background: #b91c1c; }
.btn.ok { background: var(--ok); }
.btn.ok:hover { background: #0b8049; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.link { background: none; color: var(--brand); padding: 0 4px; height: auto; }
.btn.link:hover { text-decoration: underline; background: none; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 16px; }
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld.s2 { grid-column: span 2; }
.fld.s3 { grid-column: span 3; }
.fld.s4 { grid-column: span 4; }
.fld label { font-size: 12.5px; color: #475467; font-weight: 500; }
.fld label .req { color: var(--bad); margin-left: 2px; }
.fld .help { font-size: 11.5px; color: var(--muted); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=tel],
input[type=search], input[type=email], select, textarea {
  width: 100%; height: 36px;
  padding: 0 10px; border-radius: 8px;
  border: 1px solid #d5dbe7; background: #fff; color: var(--text);
  font: inherit; font-size: 13.5px; outline: none;
  transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
select { padding-right: 26px; appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7688' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
input[readonly] { background: #f7f9fc; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: #344054; }
.check input { width: 15px; height: 15px; accent-color: var(--brand); }

.form-acts { display: flex; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line-2); background: #fbfcfe; border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- 筛选栏 ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.filters .fld { gap: 4px; }
.filters .fld label { font-size: 12px; color: var(--muted); }
.filters input, .filters select { height: 34px; }
.filters .grow { flex: 1 1 200px; }
.filters .sp { flex: 1; }

/* ---------- 表头下拉筛选 ---------- */
th.thf { position: relative; }
.thf-head { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
th.r .thf-head { justify-content: flex-end; }
.thf-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; padding: 0; border: none; background: transparent;
  color: #98a2b3; cursor: pointer; font-size: 9px; line-height: 1; border-radius: 4px; flex: none;
}
.thf-btn:hover { color: var(--brand); background: #eef2ff; }
.thf-panel {
  position: fixed; display: none; z-index: 90; min-width: 220px; padding: 10px;
  background: #fff; border: 1px solid #e4e7ec; border-radius: 10px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, .16);
}
.thf-panel.open { display: block; }
.thf-panel input, .thf-panel select {
  width: 100%; height: 32px; font-size: 13px; color: #344054;
  padding: 0 8px; border: 1px solid #d0d5dd; border-radius: 6px; background: #fff;
  box-sizing: border-box;
}
.thf-panel input[type="date"] { padding: 0 3px; min-width: 0; }
.thf-panel .dates { display: flex; gap: 6px; }
.thf-panel .dates input { flex: 1; min-width: 0; }
.thf-panel .chk { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #475467; }
.thf-panel .chk input { width: 15px; height: 15px; accent-color: var(--brand); }
.thf-actions { display: flex; justify-content: flex-end; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px solid #f2f4f7; }
.thf-actions .fclear { font-size: 12px; color: var(--brand); text-decoration: none; }
.thf-actions .fclear:hover { text-decoration: underline; }

/* ---------- 表格 ---------- */
.tbl-wrap { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.tbl th {
  text-align: left; font-weight: 600; font-size: 12px; color: #667085;
  background: #fafbfd; border-bottom: 1px solid var(--line);
  padding: 9px 12px; white-space: nowrap; letter-spacing: .2px;
}
table.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.tbl tbody tr:hover { background: #f8faff; }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl td.r, table.tbl th.r { text-align: right; }
table.tbl td.c, table.tbl th.c { text-align: center; }
table.tbl .num { font-variant-numeric: tabular-nums; }
table.tbl .mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 12.5px; }
table.tbl .sub { color: var(--muted); font-size: 12px; }
table.tbl tfoot td { background: #fafbfd; font-weight: 600; border-top: 1px solid var(--line); }
table.tbl .pname { font-weight: 500; }
.empty { padding: 42px 16px; text-align: center; color: var(--muted); font-size: 13.5px; }
.empty .ic { font-size: 26px; opacity: .35; display: block; margin-bottom: 6px; }

/* ---------- 徽标 ---------- */
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500; line-height: 18px; white-space: nowrap; }
.badge.draft { background: #f1f3f8; color: #59637a; }
.badge.posted { background: var(--ok-l); color: #0b7a44; }
.badge.cancelled { background: var(--bad-l); color: #b91c1c; }
.badge.pending { background: #f1f3f8; color: #59637a; }
.badge.picked { background: var(--warn-l); color: #b45309; }
.badge.transit { background: var(--brand-l); color: var(--brand-d); }
.badge.delivered { background: var(--ok-l); color: #0b7a44; }
.badge.exception { background: var(--bad-l); color: #b91c1c; }
.badge.low { background: var(--bad-l); color: #b91c1c; }
.badge.warn { background: var(--warn-l); color: #b45309; }
.badge.ok { background: var(--ok-l); color: #0b7a44; }
.badge.done { background: var(--ok-l); color: #0b7a44; }
.badge.info { background: var(--brand-l); color: var(--brand-d); }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden;
  display: block; text-decoration: none; color: inherit; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.kpi:hover { border-color: var(--brand); box-shadow: 0 6px 16px rgba(37,99,235,.12); transform: translateY(-2px); }
.kpi .k { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: 24px; font-weight: 650; letter-spacing: -.5px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .v small { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 3px; }
.kpi .d { font-size: 12px; color: var(--muted); margin-top: 3px; }
.kpi::after { content: ""; position: absolute; right: -24px; top: -24px; width: 72px; height: 72px; border-radius: 50%; background: var(--brand-l); opacity: .7; }
.kpi.g::after { background: var(--ok-l); }
.kpi.w::after { background: var(--warn-l); }
.kpi.b::after { background: var(--bad-l); }
.kpi .ico { position: absolute; right: 14px; top: 13px; font-size: 16px; opacity: .5; z-index: 1; }

/* ---------- 提示 ---------- */
.flash { padding: 10px 14px; border-radius: 9px; font-size: 13.5px; margin-bottom: 14px; display: flex; gap: 8px; align-items: flex-start; }
.flash.ok { background: var(--ok-l); color: #0b6b3f; border: 1px solid #c8eed9; }
.flash.bad { background: var(--bad-l); color: #a51f1f; border: 1px solid #f6d3d3; }
.flash .x { margin-left: auto; cursor: pointer; opacity: .6; }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.pager .pbtns { display: flex; gap: 4px; align-items: center; }
.pager a, .pager span.pg {
  min-width: 30px; height: 28px; padding: 0 8px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: #fff; color: #475467; font-size: 12.5px;
}
.pager a:hover { border-color: #c3cde0; color: var(--brand-d); background: #f8faff; }
.pager a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager a.disabled { opacity: .4; pointer-events: none; }

/* ---------- 详情页 ---------- */
.doc-head { display: flex; flex-wrap: wrap; gap: 10px 34px; padding: 16px; }
.doc-head .it { min-width: 140px; }
.doc-head .it .lb { font-size: 12px; color: var(--muted); }
.doc-head .it .vl { font-size: 14px; font-weight: 500; margin-top: 2px; }
.doc-no { font-family: "SFMono-Regular", Consolas, monospace; font-size: 15px; font-weight: 600; letter-spacing: .2px; }

/* ---------- 看板 ---------- */
.two-col { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; align-items: start; }
.chart { display: flex; align-items: flex-end; gap: 10px; height: 168px; padding: 10px 4px 0; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .bars { display: flex; gap: 3px; align-items: flex-end; width: 100%; height: 100%; justify-content: center; }
.chart .bar { width: 11px; border-radius: 4px 4px 2px 2px; transition: height .3s; min-height: 2px; }
.chart .bar.in { background: linear-gradient(180deg, #60a5fa, #2563eb); }
.chart .bar.out { background: linear-gradient(180deg, #fdba74, #ea580c); }
.chart .lb { font-size: 11px; color: var(--muted); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); align-items: center; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 15% 0%, #1e3a8a 0%, #0b1220 55%, #070c16 100%);
}
.login-card { width: 100%; max-width: 392px; background: #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, .38); overflow: hidden; }
.login-card .lh { padding: 26px 28px 18px; }
.login-card .lh .logo { width: 40px; height: 40px; border-radius: 11px; background: linear-gradient(135deg, #3b82f6, #1d4ed8); display: grid; place-items: center; color: #fff; font-size: 19px; box-shadow: 0 6px 16px rgba(37, 99, 235, .4); }
.login-card h1 { font-size: 19px; margin: 14px 0 4px; }
.login-card .sub { color: var(--muted); font-size: 13px; }
.login-card form { padding: 8px 28px 26px; display: flex; flex-direction: column; gap: 13px; }
.login-card .btn { height: 40px; font-size: 14px; }
.login-tip { font-size: 12px; color: var(--muted); background: #f7f9fc; border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; }

/* ---------- 打印 ---------- */
@media print {
  .sidebar, .topbar, .footer, .foot, .no-print, .pager { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; }
  .card { box-shadow: none; border-color: #ddd; }
}

/* ---------- 移动端菜单 ---------- */
.menu-btn {
  display: none; align-items: center; justify-content: center;
  width: 38px; height: 38px; border: 0; background: none;
  font-size: 21px; color: var(--text); cursor: pointer;
  border-radius: 8px; margin-right: 2px; flex: none;
}
.menu-btn:hover { background: var(--bg); }

.backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .5);
  z-index: 55; display: none; opacity: 0; transition: opacity .22s ease;
}
.backdrop.open { display: block; opacity: 1; }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .two-col { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fld.s3, .fld.s4 { grid-column: span 2; }
}
@media (max-width: 900px) {
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 10px; justify-content: flex-start; }
  .crumb { flex: 1; min-width: 0; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: min(282px, 84vw);
    transform: translateX(-100%);
    transition: transform .24s ease;
    z-index: 60; box-shadow: 0 0 40px rgba(0, 0, 0, .35);
  }
  .sidebar.open { transform: translateX(0); }
  .nav { display: block; padding: 10px 10px 28px; }
  .nav-group { margin-top: 14px; }
  .nav-group .gt { display: block; }
  .nav a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; font-size: 14px; border-radius: 9px; }
  .brand { padding: 16px 18px; }
  .content { padding: 14px 12px 40px; }
}
@media (max-width: 620px) {
  .form-grid { grid-template-columns: 1fr; }
  .fld.s2, .fld.s3, .fld.s4 { grid-column: span 1; }
  .page-h { flex-direction: column; align-items: stretch; }
  .page-h h1 { font-size: 18px; }
  .topbar { height: 52px; }
  .crumb { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-right .who, .top-right .role-chip { display: none; }
  .top-right { gap: 6px; }
  .content { padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px)); }
  .kpi .v { font-size: 21px; }
  .btn { min-height: 36px; }
  .filters .fld, .filters .grow { flex: 1 1 100%; }
  .doc-head { gap: 8px 18px; }
  .modal .box { max-width: none; }
  .login-wrap { padding: 16px; }
}

/* ---------- 补充：数值色、进度条、复选、弹层 ---------- */
table.tbl td.num.pos, table.tbl td.pos { color: var(--ok); }
table.tbl td.num.neg, table.tbl td.neg { color: var(--bad); }
table.tbl td.diff.pos { color: var(--ok); font-weight: 600; }
table.tbl td.diff.neg { color: var(--bad); font-weight: 600; }
table.tbl tfoot td { background: #f8fafc; font-weight: 600; border-top: 1px solid var(--line); }
table.tbl tfoot td.r { text-align: right; }

.hint { color: var(--muted); font-size: 12.5px; }
.hint b { color: var(--text); }

.bar { height: 8px; border-radius: 6px; background: #eef2f8; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #f97316, #ef4444); }

label.chk { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; cursor: pointer; }
label.chk input { width: 15px; height: 15px; accent-color: var(--brand); }

input.num-input, .num-input { text-align: right; font-variant-numeric: tabular-nums; }

.card-b { padding: 16px; }
.card-h + .card-b { padding-top: 4px; }

.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: none;
  align-items: center; justify-content: center; z-index: 80; padding: 16px; }
.modal.open { display: flex; }
.modal .box { background: #fff; border-radius: 12px; width: 100%; max-width: 420px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .25); overflow: hidden; }
.modal .box-h { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line-2); font-weight: 600; }
.modal .box-b { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.modal .box-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px;
  border-top: 1px solid var(--line-2); background: #fbfcfe; }
.modal-x { cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; background: none; border: 0; }

.sub { color: var(--muted); font-size: 12px; }
.r { text-align: right; }
.c { text-align: center; }

/* ---------- 移动端底部导航 + 上滑面板（手机版重新设计） ---------- */
.tabbar, .sheet, .sheet-backdrop { display: none; }

@media (max-width: 900px) {
  /* 性能优化：去 sticky、去阴影（滚动卡顿主因） */
  .topbar { position: relative; }
  .card { box-shadow: none; border: 1px solid var(--line); }
  .kpi { box-shadow: none; border: 1px solid var(--line); }
  .kpi:hover { box-shadow: none; transform: none; }
  .menu-btn { display: none; }
  .sidebar { display: none; }
  .backdrop { display: none; }
  .foot { display: none; }

  /* 底部导航 */
  .tabbar {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0;
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #fff; border-top: 1px solid var(--line);
    z-index: 50;
  }
  .tabbar .tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; border: 0; background: none; color: var(--muted);
    text-decoration: none; font-size: 11px; padding: 5px 0; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar .tab .ti { font-size: 20px; line-height: 1; }
  .tabbar .tab.active { color: var(--brand); }
  .tabbar .tab.active .tl { font-weight: 600; }

  /* 上滑面板 */
  .sheet {
    display: block;
    position: fixed; left: 0; right: 0; bottom: 0;
    background: #fff; border-radius: 16px 16px 0 0;
    z-index: 70; transform: translateY(105%);
    transition: transform .22s ease;
    max-height: 72vh; overflow-y: auto;
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    visibility: hidden;
    box-shadow: 0 -8px 30px rgba(15, 23, 42, .15);
  }
  .sheet.open { transform: translateY(0); visibility: visible; }
  .sheet-h {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; font-weight: 600; font-size: 15px;
    border-bottom: 1px solid var(--line-2);
  }
  .sheet-x { cursor: pointer; color: var(--muted); font-size: 16px; border: 0; background: none; }
  .sheet-b { display: flex; flex-direction: column; padding: 6px 0; }
  .sheet-item {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px; color: var(--text); text-decoration: none; font-size: 15px;
    border-bottom: 1px solid #f2f4f8;
    -webkit-tap-highlight-color: transparent;
  }
  .sheet-item:active { background: #f7f9fc; }
  .sheet-backdrop {
    display: block;
    position: fixed; inset: 0; background: rgba(15, 23, 42, .5);
    z-index: 65; opacity: 0; visibility: hidden; transition: opacity .2s ease;
  }
  .sheet-backdrop.open { opacity: 1; visibility: visible; }

  /* 内容区底部留出导航空间 */
  .content { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- 移动端表格转卡片 ---------- */
@media (max-width: 620px) {
  .tbl-wrap { overflow-x: visible; border-radius: 0; }
  .tbl-wrap table.tbl, .tbl-wrap table.tbl tbody, .tbl-wrap table.tbl tr, .tbl-wrap table.tbl td {
    display: block; width: auto;
  }
  .tbl-wrap table.tbl thead { display: none; }
  .tbl-wrap table.tbl tr {
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 2px 12px 8px;
    background: #fff;
  }
  .tbl-wrap table.tbl td {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 7px 0; border-bottom: 1px solid #f2f4f8; text-align: right;
  }
  .tbl-wrap table.tbl td:last-child { border-bottom: 0; }
  .tbl-wrap table.tbl td::before {
    content: attr(data-label);
    color: var(--muted); font-size: 12px; white-space: nowrap; flex: none; text-align: left;
  }
  .tbl-wrap table.tbl td:not([data-label])::before { display: none; }
  .tbl-wrap table.tbl td.col-act {
    flex-direction: row; flex-wrap: wrap; justify-content: flex-start; gap: 6px;
    padding-top: 10px; border-bottom: 0;
  }
  .tbl-wrap table.tbl td.col-act::before { display: none; }
  .tbl-wrap table.tbl td .empty { text-align: center; width: 100%; padding: 8px 0; }
  .tbl-wrap table.tbl td .empty .ic { display: block; }
}

