*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  /* 色板 - 精调柔和 */
  --green: #10b981; --green-bg: #ecfdf5; --green-bd: #a7f3d0;
  --red: #ef4444;   --red-bg: #fef2f2;   --red-bd: #fecaca;
  --blue: #6366f1;  --blue-bg: #eef2ff;  --blue-bd: #c7d2fe;
  --amber: #f59e0b; --amber-bg: #fffbeb; --amber-bd: #fde68a;
  --purple: #a855f7; --purple-bg: #faf5ff; --purple-bd: #e9d5ff;
  --text: #0f172a; --text-2: #334155; --sub: #64748b; --sub-2: #94a3b8;
  --line: #e2e8f0; --line-2: #f1f5f9;
  --bg: #f8fafc; --card: #ffffff;
  --sidebar-w: 220px;
  --sidebar-bg: #0f172a; --sidebar-2: #1e293b; --sidebar-text: #94a3b8;
  --sidebar-active: #6366f1; --sidebar-hover: rgba(255,255,255,.06);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.05);
  --radius: 12px; --radius-sm: 8px; --radius-lg: 16px;
}
html { height: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: 'HarmonyOS Sans SC', 'Noto Sans SC', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ===== 侧边栏 ===== */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column; z-index: 40;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.sidebar .logo {
  padding: 22px 18px 20px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.logo-icon { width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--blue) 0%, #818cf8 100%);
  display: flex; align-items: center; justify-content: center; font-size: 19px;
  box-shadow: 0 2px 8px rgba(99,102,241,.3); }
.logo-text { display: flex; flex-direction: column; gap: 1px; }
.logo-title { font-size: 15px; font-weight: 700; color: #fff; letter-spacing: -.02em; }
.logo-sub { font-size: 10px; color: var(--sub-2); letter-spacing: .06em; text-transform: uppercase; }

.nav-list { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-list::-webkit-scrollbar { width: 0; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 12px; border: none; background: none; color: var(--sidebar-text);
  font-size: 14px; cursor: pointer; border-radius: var(--radius-sm); text-align: left;
  margin-bottom: 2px; transition: all .15s; font-weight: 500; }
.nav-item:hover { background: var(--sidebar-hover); color: #cbd5e1; }
.nav-item.active { background: var(--sidebar-active); color: #fff; font-weight: 600;
  box-shadow: 0 4px 12px -2px rgba(99,102,241,.4); }
.nav-item .ico { font-size: 17px; flex-shrink: 0; width: 20px; text-align: center; }
.nav-item[hidden] { display: none; }

.sidebar-footer { padding: 14px 14px 16px; border-top: 1px solid rgba(255,255,255,.06);
  display: flex; flex-direction: column; gap: 12px; margin-top: auto; }
.btn-add {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 11px; border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
  background: linear-gradient(135deg, var(--blue) 0%, #818cf8 100%); color: #fff;
  box-shadow: 0 4px 12px -2px rgba(99,102,241,.35);
  transition: all .15s; }
.btn-add:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -2px rgba(99,102,241,.45); }
.btn-add:active { transform: translateY(0); }
.btn-import-side {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; margin-top: 8px; padding: 9px; border: 1px solid #e4e7ec;
  border-radius: var(--radius-sm); background: #fff; color: #4b5563;
  font-size: 13px; font-weight: 500; font-family: inherit; cursor: pointer;
  transition: background .15s, border-color .15s; }
.btn-import-side:hover { background: #f8fafc; border-color: #d3d8df; }
.btn-settings-side {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; margin-top: 8px; padding: 9px; border: 1px solid #e4e7ec;
  border-radius: var(--radius-sm); background: #fff; color: #4b5563;
  font-size: 13px; font-weight: 500; font-family: inherit; cursor: pointer;
  transition: background .15s, border-color .15s; }
.btn-settings-side:hover { background: #f8fafc; border-color: #d3d8df; }

/* ===== 主区域 ===== */
.main-wrap { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.72);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 12px;
  border-bottom: none; }
.topbar .title { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.title-bar { display: flex; align-items: center; gap: 14px; flex: 1; }
/* sidebar 底部用户块 */
.user-block { display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.04); border-radius: 12px; padding: 10px 12px; }
.user-avatar { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; letter-spacing: -.01em; margin-left: auto; }
.user-info { flex: 0 1 auto; min-width: 0; text-align: right; }
.user-name { font-size: 13px; font-weight: 600; color: #e2e8f0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-badge { font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 20px;
  display: inline-block; margin-top: 2px; }
.role-badge.role-boss { background: #92400e; color: #fbbf24; }
.role-badge.role-accountant { background: #3730a3; color: #a5b4fc; }
.role-badge.role-cashier { background: #065f46; color: #6ee7b7; }
.logout-btn { border: none; background: rgba(255,255,255,.08); color: #94a3b8;
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; transition: all .15s; flex-shrink: 0; }
.logout-btn:hover { background: rgba(239,68,68,.18); color: #f87171; }
.role-boss { background: var(--amber-bg); color: #b45309; }
.role-accountant { background: var(--blue-bg); color: #4338ca; }
.role-cashier { background: var(--green-bg); color: #047857; }
.month-wrap { position: relative; display: flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 5px 10px; min-height: 36px; }
.month-wrap:hover { border-color: var(--blue); }
.month-ico { color: var(--sub); pointer-events: none; flex-shrink: 0; }
.month-label { font-size: 14px; font-weight: 600; color: var(--text); user-select: none; pointer-events: none; }
.chevron-ico { color: var(--sub); pointer-events: none; flex-shrink: 0; transition: transform .15s; }
.month-wrap.open .chevron-ico { transform: rotate(180deg); }
.month-panel { position: absolute; top: 44px; left: 0; z-index: 40; width: 280px;
  background: #fff; border-radius: 14px; padding: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.15), 0 2px 6px rgba(0,0,0,.05);
  animation: popIn .15s ease-out; border: 1px solid rgba(0,0,0,.06); }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.mp-year { display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; }
.mp-year button { border: none; background: none; cursor: pointer; width: 28px; height: 28px;
  border-radius: 6px; color: var(--sub); display: flex; align-items: center; justify-content: center; }
.mp-year button:hover { background: var(--bg); color: var(--text); }
.mp-year .y-label { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.mp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.mp-grid button { border: none; background: none; padding: 10px 0; border-radius: 8px; cursor: pointer;
  font-size: 13px; color: var(--text-2); transition: all .12s; }
.mp-grid button:hover:not(.disabled) { background: var(--bg); color: var(--text); }
.mp-grid button.active { background: var(--blue); color: #fff; font-weight: 600; }
.mp-grid button.today { outline: 1.5px solid var(--blue); outline-offset: -2px; }
.mp-grid button.disabled { color: var(--line-2); cursor: not-allowed; }
.mp-footer { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--line-2); }
.mp-footer button { border: none; background: none; cursor: pointer; font-size: 13px;
  color: var(--blue); font-weight: 500; padding: 4px 8px; border-radius: 6px; }
.mp-footer button:hover { background: var(--blue-bg); }
.card-wrap { display: flex; align-items: center; gap: 8px; font-weight: 600;
  background: #f2f2f7; border-radius: 10px; padding: 6px 12px; }
.store-wrap { display: flex; align-items: center; gap: 8px; font-weight: 600;
  background: rgba(99,102,241,.1); border-radius: 10px; padding: 6px 12px; }
.store-wrap .picker-label, .card-wrap .picker-label { font-weight: 600; }
.store-ico { color: var(--blue); pointer-events: none; flex-shrink: 0; }
.card-ico { color: var(--sub); pointer-events: none; flex-shrink: 0; }
.card-picker { border: none; background: none; font-size: 14px; color: var(--text);
  font-family: inherit; font-weight: 600; cursor: pointer; outline: none; }
/* === 自绘下拉面板 === */
.picker-wrap { position: relative; cursor: pointer; user-select: none; }
/* 表单里的 picker 灰底圆角，像 iOS input */
.form-body .picker-wrap {
  background: #f2f2f7; border-radius: 12px; padding: 8px 14px;
  font-size: 14px; transition: background .15s;
  display: flex; align-items: center; min-height: 36px; }
.form-body .picker-wrap:hover { background: #e5e5ea; }
.form-body .picker-wrap.open { background: #fff; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.form-body .picker-wrap .picker-label { flex: 1; font-size: 15px; color: var(--text); pointer-events: none; }
.picker-wrap .chevron-ico { color: #9ca3af; font-size: 12px; transition: transform .15s; margin-left: 4px; }
.picker-wrap.open .chevron-ico { transform: rotate(180deg); }
.picker-wrap input[type=hidden] { display: none; }
.picker-panel { display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 60;
  min-width: 200px; background: #fff;
  border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.15), 0 2px 6px rgba(0,0,0,.05);
  padding: 6px; animation: popIn .15s ease-out; max-height: 280px; overflow-y: auto;
  border: 1px solid rgba(0,0,0,.06); }
.picker-wrap.open .picker-panel { display: block; }
.picker-panel button { display: flex; align-items: center; gap: 10px;
  width: 100%; border: none; background: none; cursor: pointer;
  padding: 10px 14px; border-radius: 10px; font-size: 15px; color: var(--text);
  text-align: left; font-family: inherit; transition: background .1s; }
.picker-panel button:hover { background: #f2f2f7; }
.picker-panel button.active { background: rgba(99,102,241,.1); color: var(--blue); font-weight: 600; }
.picker-panel button .tick { width: 16px; flex-shrink: 0; }
.picker-panel button .tick svg { opacity: 0; }
.picker-panel button.active .tick svg { opacity: 1; }
.menu-toggle { display: none; background: none; border: none; cursor: pointer;
  color: var(--text); padding: 4px; }

main { flex: 1; padding: 24px; max-width: 1400px; width: 100%; min-width: 0; overflow-x: hidden; }

/* ===== 卡片 ===== */
.card { background: #fff; border-radius: 16px; padding: 20px;
  margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.06);
  min-width: 0; overflow: hidden; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.muted { color: var(--sub); }
.small { font-size: 12px; }
.amount-out { color: var(--red); font-weight: 600; }
.amount-in { color: var(--green); font-weight: 600; }

/* ===== 按钮 ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 12px; padding: 10px 18px; font-size: 14px;
  cursor: pointer; background: var(--blue); color: #fff; font-weight: 600;
  font-family: inherit; transition: opacity .15s, transform .08s; white-space: nowrap; flex-shrink: 0; }
.btn:hover { opacity: .9; }
.btn:active { transform: scale(.97); }
.btn.block { width: 100%; }
.btn.ghost { background: rgba(99,102,241,.12); color: var(--blue); }
.btn.ghost:hover { background: rgba(99,102,241,.2); }
.btn.gray { background: #f2f2f7; color: #6b7280; font-weight: 500; }
.btn.gray:hover { background: #e5e5ea; }
.btn.danger { background: rgba(239,68,68,.1); color: var(--red); font-weight: 600; }
.btn.danger:hover { background: rgba(239,68,68,.15); }
.btn.sm { padding: 5px 12px; font-size: 12px; border-radius: 8px; }
.btn.mini { padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .4; pointer-events: none; }

/* 操作列: td 内按钮并排 */
.data-table td:last-child { white-space: nowrap; }
.data-table td:last-child .btn { margin-right: 6px; }
.data-table td:last-child .btn:last-child { margin-right: 0; }
/* 日期↔户名 紧凑间距 */
.bank-list-table .dense-x { padding-left: 10px; padding-right: 8px; }
/* 凭证 / 流水凭证 两列分开: 虚线分隔 + 各自留白 */
.bank-list-table .vc-cell { padding-left: 8px; padding-right: 10px; }
.bank-list-table .vc-bank { padding-left: 16px; border-left: 1px dashed var(--line); }
.bank-list-table th.vc-bank { border-left: 1px dashed var(--line); }
/* 金额列: 大额不省略(如 ¥150,505.00) */
.bank-list-table td.amt-dense { padding-left: 8px; padding-right: 10px; white-space: nowrap; overflow: visible; text-overflow: clip; }
/* 标记列: 经营转入徽章不截断 */
.bank-list-table td.mark-cell { overflow: visible; }
.bank-list-table td.mark-cell .badge { white-space: nowrap; max-width: none; }
/* 列拖窄后文字直接裁切, 不显示省略号「…」(鼠标悬停 title 看全文) */
.data-table.bank-list-table td,
.data-table.bank-list-table td.nowrap-cell { text-overflow: clip; }
.data-table.bank-list-table td.nowrap-cell { overflow: hidden; }

/* 分段控件 */
.seg { display: flex; background: #f2f2f7; border-radius: 10px; padding: 3px;
  width: fit-content; }
.seg button { border: none; background: transparent; padding: 6px 14px; border-radius: 8px;
  font-size: 13px; color: #6b7280; cursor: pointer; font-family: inherit;
  font-weight: 500; transition: all .2s; }
.seg button.on { background: #fff; color: var(--text); font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* 徽标 */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px;
  padding: 3px 9px; border-radius: 20px; font-weight: 600;
  white-space: nowrap; flex-shrink: 0; letter-spacing: .01em; }
.badge.ok { background: rgba(16,185,129,.12); color: #059669; }
.badge.warn { background: rgba(245,158,11,.12); color: #d97706; }
.badge.miss { background: rgba(239,68,68,.12); color: #dc2626; }
.badge.info { background: rgba(99,102,241,.12); color: #4f46e5; }
.badge.gray { background: #f2f2f7; color: #6b7280; }
.badge.sug { background: rgba(16,185,129,.15); color: #059669; border: none; }
/* ========== 银行卡明细 tab ========== */
.bd-toolbar {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  padding: 12px 14px; background: #fff; border-radius: 12px;
  margin-bottom: 12px; border: 1px solid #eef0f3;
}

/* ===== 收支 segmented 分段控件 ===== */
.bd-seg {
  display: inline-flex; align-items: center;
  background: #f2f3f5; border-radius: 10px; padding: 3px; gap: 2px;
  user-select: none; flex-shrink: 0;
}
.bd-seg-btn {
  padding: 6px 16px; border: none; border-radius: 8px;
  background: transparent; font-size: 13px; color: var(--sub); font-weight: 500;
  cursor: pointer; transition: all .18s ease;
  font-family: inherit;
}
.bd-seg-btn:hover { color: #1f2937; }
.bd-seg-btn.on {
  background: #fff; color: var(--text); font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

/* popover 风格下拉 picker */
.bd-pick {
  position: relative; display: inline-flex; align-items: center;
  height: 36px; padding: 0 12px; gap: 8px;
  background: #fff; border: 1px solid #e4e6eb; border-radius: 8px;
  font-size: 13px; color: #1f2937; cursor: pointer; user-select: none;
  transition: all .15s;
}
.bd-pick:hover { border-color: #c7ccd3; }
.bd-pick.open { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.bd-pick-ico { color: var(--sub); flex-shrink: 0; }
.bd-pick-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-pick-chv { color: var(--sub); flex-shrink: 0; transition: transform .2s; }
.bd-pick.open .bd-pick-chv { transform: rotate(180deg); }

.bd-pick-panel {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: #fff; border-radius: 10px; border: 1px solid #e4e6eb;
  box-shadow: 0 10px 32px rgba(0,0,0,.12); z-index: 1000;
  padding: 4px; max-height: 260px; overflow-y: auto;
  animation: bdPickIn .15s ease-out;
}
@keyframes bdPickIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
/* 选项 —— 和顶部 picker-panel button 同款 */
.bd-pick-panel button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; border: none; background: none; cursor: pointer;
  padding: 10px 14px; border-radius: 10px; font-size: 14px; color: var(--text);
  text-align: left; font-family: inherit; transition: background .1s;
}
.bd-pick-panel button:hover { background: #f2f2f7; }
.bd-pick-panel button.active { background: rgba(99,102,241,.1); color: var(--blue); font-weight: 600; }
/* 勾号 —— 默认透明, active 才显示（和顶部 .picker-panel button .tick 完全一样） */
.bd-pick-panel button .tick { width: 16px; flex-shrink: 0; }
.bd-pick-panel button .tick svg { opacity: 0; }
.bd-pick-panel button.active .tick svg { opacity: 1; }
/* 分类小圆点 —— 代替图标 */
.bd-cat-dot {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid; flex-shrink: 0; box-sizing: border-box;
}

.bd-kw-wrap { position: relative; display: inline-flex; align-items: center; }
.bd-kw-icon { position: absolute; left: 10px; font-size: 11px; opacity: .55; pointer-events: none; }
.bd-kw {
  width: 200px; height: 30px; padding: 0 12px 0 28px;
  border: 1px solid #e4e6eb; border-radius: 15px;
  font-size: 12px; outline: none; transition: border-color .15s, background .15s; background: #fff;
}
.bd-kw:hover { border-color: #c7ccd3; background: #fafbfc; }
.bd-kw:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(37,99,235,.12); background: #fff; }
.bd-stat { white-space: nowrap; }

/* 分类卡片横滚区 */
.bd-cat-wrap { margin-bottom: 6px; }
.bd-cat-scroll {
  display: grid; gap: 6px;
  grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
}

/* 分类卡片 */
.bd-cat-card {
  --cc-bg: #f5f5f4; --cc-fg: #44403c;
  background: var(--cc-bg); color: var(--cc-fg);
  padding: 6px 10px; border-radius: 10px;
  cursor: pointer; user-select: none;
  white-space: nowrap;
  overflow: hidden;
  border: 1.5px solid transparent;
  transition: transform .15s ease, box-shadow .15s, border-color .15s;
  line-height: 1.2;
  position: relative;
}
.bd-cat-card::after {
  content: ''; position: absolute; right: -12px; bottom: -12px;
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--cc-fg); opacity: .08; pointer-events: none;
}
.bd-cat-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.bd-cat-card.active {
  border-color: var(--cc-fg);
  box-shadow: 0 4px 14px rgba(0,0,0,.14);
}
.bd-cat-card-top,
.bd-cat-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0;
}

.bd-cat-name {
  font-weight: 600; font-size: 11px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bd-cat-card-check {
  flex-shrink: 0; padding: 2px; color: var(--cc-fg);
}
.bd-cat-card-cnt,
.bd-cat-cnt {
  font-size: 10px; opacity: .7; margin-bottom: 0; font-weight: 500;
}
.bd-cat-card-amt,
.bd-cat-amt {
  font-size: 10px; font-weight: 600; opacity: .85;
}

/* 收支分组：大卡片 + 旗下分类小卡片 */
.bd-sum-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 12px;
}
.bd-sum-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.bd-sum-head { border-left: 3px solid var(--line); padding: 12px 14px; }
.bd-sum-head .lab { font-size: 12px; }
.bd-sum-head .val { font-size: 22px; }
.bd-sum-head:has(.amount-out) { border-left-color: var(--red); }
.bd-sum-head:has(.amount-in) { border-left-color: var(--green); }
.bd-cat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 6px;
}
.bd-cat-empty { font-size: 11px; color: var(--sub-2); padding: 6px 2px; }
@media (max-width: 760px) {
  .bd-sum-grid { grid-template-columns: 1fr; }
}

/* 表格里的分类徽章 */
.bd-cat-badge {
  display: inline-block; padding: 4px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  cursor: default;
}
/* 行内分类 trigger — 彩色徽章 + 下拉箭头 */
.bd-cat-trigger {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px; border-radius: 12px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  cursor: pointer; line-height: 1.2;
  transition: filter .15s, transform .1s;
}
.bd-cat-trigger:hover { filter: brightness(.92); }
.bd-cat-trigger:active { transform: scale(.97); }
.bd-cat-trigger.open { filter: brightness(.88); }

/* 共享 popover panel — 和顶部银行卡 picker 同款 */
.bd-row-cat-panel {
  position: fixed; z-index: 2000;
  background: #fff; border-radius: 10px; padding: 3px;
  box-shadow: 0 8px 24px rgba(0,0,0,.16), 0 2px 6px rgba(0,0,0,.06);
  border: 1px solid #e4e6eb;
  min-width: 140px;
  animation: bdPickIn .15s ease-out;
}
.bd-row-cat-panel button {
  display: flex; align-items: center; gap: 8px;
  width: 100%; border: none; background: none; cursor: pointer;
  padding: 7px 10px; border-radius: 7px;
  font-size: 12px; color: var(--text); text-align: left;
  font-family: inherit; transition: background .1s;
}
.bd-row-cat-panel button:hover { background: #f2f2f7; }
.bd-row-cat-panel button.active {
  background: rgba(99,102,241,.1); color: var(--blue); font-weight: 600;
}
.bd-row-cat-panel button .tick { width: 16px; flex-shrink: 0; }
.bd-row-cat-panel button .tick svg { opacity: 0; }
.bd-row-cat-panel button.active .tick svg { opacity: 1; }
.bd-row-cat-panel button .bd-cat-dot {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid; flex-shrink: 0; box-sizing: border-box;
}

/* 表格 — fixed 布局, 严格 fit 容器, 不产生横向滚动 */
.bd-table {
  width: 100%; border-collapse: collapse; background: #fff;
  table-layout: fixed; transform: translateZ(0);
}
.bd-table col.date     { width: 12%; }
.bd-table col.card     { width: 8%; }
.bd-table col.dir      { width: 5%;  }
.bd-table col.counter  { width: 18%; }
.bd-table col.summary  { width: 10%; }
.bd-table col.cat      { width: 9%;  }
.bd-table col.note     { width: 14%; }
.bd-table col.receipt  { width: 6%;  }
.bd-table col.amount   { width: 18%; }

/* 表头和单元格: 全部单行省略, 绝不换行 */
.bd-table th,
.bd-table td {
  padding: 8px 8px; font-size: 13px; line-height: 1.4;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bd-table th {
  background: #f8fafc; font-weight: 600; font-size: 12px;
  color: var(--sub); text-align: left;
  white-space: nowrap; letter-spacing: .02em;
}
/* 金额列: 不截断 + 右对齐 */
.bd-table td.amt,
.bd-table th.amt-th {
  white-space: nowrap; text-align: right; overflow: visible;
  font-variant-numeric: tabular-nums;
}
/* 收支列: 左对齐, badge 不被截断 */
.data-table td.dir, .bd-table td.dir { padding: 7px 4px; text-align: center; vertical-align: middle; overflow: visible; white-space: nowrap; }
.data-table td.dir .badge, .bd-table td.dir .badge { overflow: visible; text-overflow: clip; max-width: none; white-space: nowrap; }
.data-table th.dir-th, .bd-table th.dir-th { overflow: visible; text-overflow: clip; text-align: center; }
/* 分类列: badge 长名不被裁剪 */
.data-table td.cat-cell { overflow: visible; white-space: nowrap; }
.data-table td.cat-cell .bd-cat-trigger { max-width: none; }
/* 日期里的余额允许换行 */
.bd-date .bd-bal { display: block; font-size: 10.5px; color: var(--sub-2); margin-top: 2px; white-space: normal; }
/* 备注 input */
.bd-table td .bd-note-input, .data-table td .bd-note-input { width: 100%; min-width: 0; padding: 5px 8px; font-size: 12.5px; }
.bd-table td .bd-cat-select { width: 100%; min-width: 70px; }

/* bd 表格 wrap 禁止横向滚动条 */
.bd-table-wrap { overflow-x: hidden; }

/* 凭证缩略图 — 更大 */
.bd-thumbs {
  display: flex; gap: 3px; align-items: center;
  position: relative;
}
.bd-thumbs img {
  width: 40px; height: 40px; object-fit: cover;
  border-radius: 6px; cursor: pointer;
  border: 1px solid #e4e6eb; background: #f8fafc;
}
.bd-thumbs img:hover { border-color: var(--blue); }
.bd-thumbs .bd-thumbs-more {
  font-size: 10px; color: #6b7280; font-weight: 600;
  padding: 3px 6px; border-radius: 5px;
  background: #f2f3f5; white-space: nowrap;
}

/* 备注 input */
.bd-note-input {
  width: 100%; box-sizing: border-box;
  padding: 5px 8px; border: 1px solid transparent; border-radius: 6px;
  font-size: 13px; background: transparent; color: #374151;
  outline: none; transition: all .15s;
}
.bd-note-input:hover { border-color: #e4e6eb; }
.bd-note-input:focus { border-color: var(--blue); background: #f8faff; }
.bd-note-input::placeholder { color: #c0c4cc; }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 38px; height: 20px; cursor: pointer; }
.switch input { display: none; }
.switch .slider {
  position: absolute; inset: 0; background: #d1d5db; border-radius: 20px;
  transition: background .2s;
}
.switch .slider::before {
  content: ''; position: absolute; left: 2px; top: 2px;
  width: 16px; height: 16px; background: #fff; border-radius: 50%;
  transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--blue, #2563eb); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch.sm { width: 34px; height: 18px; }
.switch.sm .slider::before { width: 14px; height: 14px; transform: none; }
.switch.sm input:checked + .slider::before { transform: translateX(16px); }

.section-title { font-size: 16px; font-weight: 700; margin: 24px 0 12px;
  display: flex; align-items: center; gap: 8px; letter-spacing: -.01em; }
.section-title .count { background: #f1f5f9; border-radius: 20px; color: var(--sub);
  font-size: 12px; padding: 1px 10px; font-weight: 600; }
.empty { text-align: center; color: var(--sub-2); padding: 48px 0; font-size: 14px; }

/* ===== 仪表盘 ===== */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr));
  gap: 16px; margin-bottom: 24px; }
.dash-card { background: #fff;
  border-radius: 12px; padding: 12px 14px; position: relative; overflow: hidden;
  transition: all .15s; box-shadow: 0 1px 3px rgba(0,0,0,.06); border: 2px solid transparent;
  cursor: pointer; }
.dash-card:hover { opacity: .85; }
.dash-card.on { border-color: var(--blue); background: rgba(99,102,241,.04); }
.dash-card .lab { font-size: 11px; color: var(--sub); margin-bottom: 4px; font-weight: 600; }
.dash-card .val { font-size: 18px; font-weight: 800; letter-spacing: -.03em; }
/* 余额卡片文字配色 */
.dash-card .val.bal-open { color: #64748b; }
.dash-card .val.bal-close { color: #2563eb; }
.dash-card .val.bal-latest { background: linear-gradient(90deg, #4f46e5, #0ea5e9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dash-card .lab.lab-open { color: #94a3b8; }
.dash-card .lab.lab-close { color: #60a5fa; }
.dash-card .lab.lab-latest { color: #818cf8; }
.dash-card .sub { font-size: 11px; color: var(--sub-2); margin-top: 4px; }
.dash-card .ico { font-size: 32px; position: absolute; right: 16px; top: 16px;
  opacity: .12; line-height: 1; }
.dash-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.dash-col h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; letter-spacing: -.01em; }

/* ===== 数据表格 ===== */
.table-wrap { overflow-x: auto; margin-bottom: 16px;
  border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); background: #fff; }
.data-table { width: 100%; border-collapse: collapse; background: #fff; table-layout: fixed;
  transform: translateZ(0); }
/* records 表格单独 auto, 避免被全局 fixed 挤压 */
.data-table.rec-table { table-layout: auto; }
/* ===== 列宽拖拽调整 ===== */
.col-resize-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer;
  font-size: 13px; color: var(--text-2); font-family: inherit; transition: all .15s; }
.col-resize-toggle:hover { border-color: var(--blue); color: var(--blue); }
.col-resize-toggle.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.data-table th { position: relative; }
.uw-table th { position: relative; }
.col-resizer { position: absolute; right: -3px; top: 0; bottom: 0; width: 6px;
  cursor: col-resize; z-index: 5; user-select: none; display: none; }
.col-resizer::before { content: ''; position: absolute; right: 2px; top: 15%; bottom: 15%;
  width: 2px; background: #7c3aed; opacity: 0.55; transition: opacity .15s, background .15s; border-radius: 2px; }
.col-resizer:hover::before, .col-resizer.active::before { opacity: 1; background: #5b21b6; }
body.col-resize-mode .data-table th .col-resizer,
body.col-resize-mode .uw-table th .col-resizer { display: block; }
body.col-resize-mode .data-table th,
body.col-resize-mode .uw-table th { cursor: default; }
body.col-resize-mode .data-table td, body.col-resize-mode .data-table th,
body.col-resize-mode .uw-table td, body.col-resize-mode .uw-table th {
  white-space: nowrap !important; overflow: hidden !important; text-overflow: clip !important; }
.col-resize-tip { position: fixed; z-index: 3000; background: var(--text); color: #fff;
  padding: 4px 10px; border-radius: 6px; font-size: 12px; pointer-events: none; display: none; }
.col-resize-tip.show { display: block; }
.data-table th { background: #f8fafc; padding: 11px 16px; text-align: left; font-size: 12px;
  font-weight: 600; color: var(--sub); border-bottom: 1px solid var(--line);
  white-space: nowrap; text-transform: uppercase; letter-spacing: .03em; }
.data-table td { padding: 12px 16px; font-size: 13px; border-bottom: 1px solid var(--line-2);
  vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: none; }
/* 银行卡列: 多张卡名用「、」连接, 允许换行完整显示, 不截断 */
.data-table td.card-col { white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
.data-table tbody tr { }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table .amt { font-weight: 700; white-space: nowrap; font-size: 14px; letter-spacing: -.01em; text-align: right; }
/* 主表金额列表头右对齐 */
.data-table th.amt-th { text-align: right; }
/* 凭证缩略图基础样式 */
.thumbs { display: flex; flex-wrap: nowrap; gap: 6px; align-items: center; transform: translateZ(0);
  overflow-x: auto; overflow-y: visible; scrollbar-width: thin; scrollbar-color: #bbb transparent; }
.thumbs::-webkit-scrollbar { height: 4px; }
.thumbs::-webkit-scrollbar-track { background: transparent; }
.thumbs::-webkit-scrollbar-thumb { background: #bbb; border-radius: 2px; }
.thumbs img { width: 56px; height: 56px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--line); cursor: pointer;
  flex-shrink: 0; -webkit-user-drag: none; user-select: none; }
/* 表格里的缩略图小一点 */
.data-table .thumbs img { width: 34px; height: 34px; border-radius: 6px; -webkit-user-drag: none; user-select: none; }
/* 流水凭证是 PDF 横向长条截图, 用宽矩形缩略图避免只裁出一条; 尺寸锁定不随列宽变化 */
.data-table .thumbs.thumbs-bank img { width: 34px; height: 34px; }
/* 统一对账页：银行流水凭证与记账凭证一致，统一用 34x34 方形缩略图（见 .uw-thumbs img），
   横向长条截图按 object-fit:cover 居中裁剪；点击/悬停看全图 */
/* 凭证列允许缩略图溢出显示, 列拖窄时图片不被裁切(图片尺寸固定) */
.data-table td:has(.thumbs), .data-table th:has(.thumbs),
.data-table td.vc-cell, .data-table th.vc-cell, .data-table td.v-top { overflow: visible; }
/* 银行流水缩略图条不产生自己的滚动条 */
.thumbs.bd-thumbs { overflow: visible; }
/* 凭证 hover 放大镜预览 */
.img-zoom-preview { position: fixed; z-index: 2000; pointer-events: none;
  max-width: 480px; max-height: 76vh; border-radius: 10px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.35); display: none; line-height: 0; background: #fff; }
.img-zoom-preview.show { display: block; }
.img-zoom-preview img { max-width: 480px; max-height: 76vh; object-fit: contain; display: block; background: #fff; -webkit-user-drag: none; }
.img-zoom-preview.zoom-bank { max-width: none; max-height: none; }
.img-zoom-preview.zoom-bank img { width: 760px; max-width: 95vw; height: auto; max-height: 90vh; object-fit: contain; }
.img-zoom-preview.zoom-rec img { max-width: 400px; max-height: 62vh; }
/* 统一页：银行流水凭证放大预览（横向长条截图，够大才能看清字） */
.img-zoom-preview.zoom-uw-bank { max-width: none; max-height: none; }
.img-zoom-preview.zoom-uw-bank img { width: 900px; max-width: 94vw; height: auto; max-height: 88vh; object-fit: contain; }
.img-zoom-preview.zoom-uw-rec img { max-width: 560px; max-height: 82vh; }

/* ===== 匹配弹窗(可多选) ===== */
.pick-list { max-height: none; overflow-x: auto; overflow-y: auto; }
.pick-list .data-table { width: 100%; min-width: 460px; border-collapse: collapse; table-layout: fixed; }
.pick-list .data-table td,
.pick-list .data-table th { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 金额列不截断 */
.pick-list .data-table td.amt,
.pick-list .data-table td.amt-th,
.pick-list .data-table th.amt-th { overflow: visible; text-overflow: clip; }
/* pick-list 滚动由 .modal > * 规则统一处理 */
.modal .pick-sum, .modal .thumbs, .modal .section-title { flex-shrink: 0; }

.data-table.recon-main td .thumbs img { flex-shrink: 0; }
/* .thumbs 里的勾/叉 — flex 容器最后一个子项，紧贴最后一张图 */
.thumbs > .check-badge { flex-shrink: 0; margin-left: 6px; }
.v-top { vertical-align: top; }
.check-badge { width: 16px; height: 16px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; line-height: 0; font-size: 10px; font-weight: 700;
  color: #fff; }
.check-badge.ok { background: #22c55e; }
.check-badge.ok::before { content: '✓'; }
.check-badge.bad { background: #f59e0b; }
.check-badge.bad::before { content: '!'; font-weight: 800; }
.check-badge.pending { background: #cbd5e1; }
.check-badge.pending::before { content: '?'; font-size: 11px; font-weight: 700; }

/* 旧 receipt-amt 样式（保留兼容, 不再在新表中使用） */
.receipt-amt { font-size: 11px; margin-top: 4px; line-height: 1.3; }
.receipt-amt.amt-match { color: #059669; }
.receipt-amt.amt-mismatch { color: #dc2626; font-weight: 600; cursor: pointer; text-decoration: underline dotted; }

/* ===== 日期时间 picker ===== */
.dt-wrap .dt-panel { display: none; position: absolute; top: calc(100% + 8px); left: 0; right: auto; z-index: 60;
  background: #fff; border-radius: 14px; padding: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.04);
  border: 1px solid rgba(0,0,0,.06); box-sizing: border-box;
  min-width: 440px; overflow-y: hidden !important; scrollbar-width: none; -ms-overflow-style: none; }
.dt-wrap .dt-panel::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
.dt-wrap.open .dt-panel { display: block; }
.dt-cal { margin-bottom: 8px; }
.dt-wrap .picker-label { font-size: 15px; color: var(--text); }
/* 日历部分 */
.dt-cal .dt-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.dt-cal .dt-nav { width: 26px; height: 26px; border: none; background: none; cursor: pointer;
  font-size: 14px; color: #6b7280; border-radius: 6px; transition: background .1s; font-family: inherit; }
.dt-cal .dt-nav:hover { background: #f2f2f7; color: var(--text); }
.dt-cal .dt-title { flex: 1; text-align: center; font-size: 13px; font-weight: 600; color: var(--text); }
.dt-cal .dt-week { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; margin-bottom: 2px; }
.dt-cal .dt-week span { font-size: 11px; color: #9ca3af; padding: 2px 0; font-weight: 500; }
.dt-cal .dt-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.dt-cal .dt-day { width: 32px; height: 28px; border: none; background: none; cursor: pointer;
  border-radius: 6px; font-size: 12px; color: var(--text); font-family: inherit;
  transition: background .12s, color .12s; }
.dt-cal .dt-day:hover { background: #f2f2f7; }
.dt-cal .dt-day.other { color: #d1d5db; }
.dt-cal .dt-day.today { color: var(--blue); font-weight: 600; position: relative; }
.dt-cal .dt-day.today::after { content: ''; position: absolute; bottom: 2px; left: 50%;
  transform: translateX(-50%); width: 3px; height: 3px; border-radius: 50%; background: var(--blue); }
.dt-cal .dt-day.sel { background: var(--blue); color: #fff !important; font-weight: 600; }
.dt-cal .dt-day.sel:hover { background: #4f46e5; }
.dt-cal .dt-day.today.sel::after { background: #fff; }
/* 时间滚轮 — iOS 闹钟风格 */
.dt-time { border-top: 1px solid rgba(0,0,0,.06); padding-top: 6px; }
.dt-cols { display: flex; gap: 12px; }
.dt-col { 
  flex: 1; 
  height: 180px; /* 5 个 item 可见 */
  overflow: hidden; /* 不让内容自己滚 */
  position: relative;
  background: #f9fafb; 
  border-radius: 8px;
  /* 上下渐隐遮罩 */
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
  mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
}
/* 中间蓝色选中指示框 */
.dt-col::after {
  content: '';
  position: absolute;
  top: 72px; left: 4px; right: 4px;
  height: 36px;
  background: rgba(99,102,241,.15);
  border-radius: 8px;
  pointer-events: none;
  z-index: 2;
  box-shadow: inset 0 0 0 1px rgba(99,102,241,.2);
}
.dt-col-track {
  display: flex;
  flex-direction: column;
  transition: transform .18s ease-out;
  /* track 自身也有 mask 的话会影响，让它透明由父级 dt-col 来 mask */
}
.dt-opt { 
  height: 36px; 
  line-height: 36px; 
  text-align: center; 
  font-size: 14px; 
  border-radius: 8px;
  color: #6b7280;
  cursor: pointer; 
  transition: color .12s;
}
.dt-opt:hover { color: #1e293b; }
.dt-opt.on { 
  color: var(--blue); 
  font-weight: 600; 
  font-size: 15px;
}
/* 底部按钮 */
.dt-foot { display: flex; justify-content: flex-end; gap: 6px; margin-top: 4px; }
.dt-btn { border: none; background: none; padding: 4px 14px; border-radius: 6px; cursor: pointer;
  font-size: 12px; color: var(--blue); font-family: inherit; font-weight: 500; transition: background .1s; }
.dt-btn:hover { background: rgba(99,102,241,.08); }
.receipt-amt.amt-mismatch:hover { opacity: .7; }
/* 手机记账(第1列) 和 银行流水(第4列) 自动截断长文本 */
.data-table.recon-main tbody tr td:nth-child(1),
.data-table.recon-main tbody tr td:nth-child(4) { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 候选表: 小字体, 固定布局 */
.pick-list .data-table td { padding: 5px 8px; font-size: 12px; line-height: 1.3; vertical-align: middle; overflow: hidden; }
.pick-list .data-table th { padding: 5px 8px; font-size: 11px; white-space: nowrap; overflow: hidden; }
/* 通用不换行省略 */
.data-table td.nowrap-cell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.data-table td .nowrap-cell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 多笔金额容器: 整体右对齐 */
.data-table td.amt-cell { text-align: right; }
/* 弹窗里保持之前的 */
.pick-list .data-table td.nowrap-cell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-list .data-table td.amt, .pick-list .data-table td:last-child { text-align: right; white-space: nowrap; }
.pick-list .data-table td.nowrap-cell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 除了 .cell-text 的文本列, 其他全部不换行 */
.pick-list .data-table td { white-space: nowrap; text-overflow: ellipsis; }
.pick-list .data-table td .cell-text { white-space: normal; }
/* 通用文本单元格: 2 行截断, 不拆汉字 */
.data-table .cell-text {
  white-space: normal; word-break: keep-all; overflow-wrap: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; max-width: 100%;
}
/* matched 表结构化文本 */
.data-table .list-main {
  font-weight: 600; font-size: 14px; color: #1e293b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.3;
}
.data-table .list-sub {
  font-size: 12px; color: #94a3b8; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.3;
}
/* 弹窗内的 cell-text 同样规则 */
.pick-list .data-table .cell-text {
  white-space: normal; word-break: keep-all; overflow-wrap: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.pick-list tr { cursor: pointer; }
.pick-list tr.on { background: var(--blue-bg); }
.pick-list tr.sug.on { background: var(--blue-bg); }
.pick-list tr.pick-off { opacity: .45; cursor: default; }
/* 推测高亮: 金额合计最可能是当前记账对应的一组流水 */
.pick-list tr.sug { background: var(--green-bg); }
.pick-list tr.sug:hover { background: var(--green-bg); }
.badge.sug { background: var(--green, #10b981); color: #fff; border: none; }
.pick-list input[type="checkbox"] { pointer-events: none; }
.pick-sum { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap;
  gap: 6px; padding: 10px 2px 2px; font-size: 13px; color: var(--text-2); }
.pick-sum b { color: var(--text); }

/* ===== 弹窗/表单 ===== */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  z-index: 50; display: flex; align-items: center; justify-content: center; }
.modal-mask[hidden] { display: none; }
/* 第二层浮层(如盖在向导上的确认框): 只再加一层轻遮罩, 不重复模糊/过度压暗 */
.modal-stack-mask { z-index: 60; background: rgba(0,0,0,.22);
  backdrop-filter: none; -webkit-backdrop-filter: none; }
.modal { background: #fff; width: 580px; max-width: 92vw; border-radius: 20px;
  max-height: 98vh; padding: 14px 18px 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.06);
  animation: modalIn .22s cubic-bezier(.4,0,.2,1);
  overflow-y: auto; overflow-x: hidden; }
/* pick-list（匹配弹窗）：需要 flex 让表格滚动 */
.modal-pick-list { display: flex; flex-direction: column; overflow: hidden; }
.modal.modal-wide { width: 900px; }
/* 确认框：窄而居中，紧凑小卡片 */
.modal.modal-confirm { width: 300px; max-width: 86vw; border-radius: 14px; padding: 16px 18px; }
.confirm-box { padding: 0; text-align: center; }
.modal .confirm-ico { width: 44px; height: 44px; border-radius: 50%; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center; font-size: 21px; }
.confirm-ico.danger { background: var(--red-bg); box-shadow: inset 0 0 0 1px var(--red-bd); }
.confirm-ico.info { background: var(--blue-bg); box-shadow: inset 0 0 0 1px var(--blue-bd); }
.modal .confirm-title { font-size: 15.5px; font-weight: 700; margin-bottom: 6px; letter-spacing: -.01em; }
.modal .confirm-msg { font-size: 12.5px; color: var(--sub); line-height: 1.55; padding: 0 2px; }
.confirm-actions { display: flex; gap: 8px; margin-top: 16px; }
.confirm-actions .btn { flex: 1; padding: 8px; border-radius: 9px; font-size: 13px; }
.btn.cf-danger { background: var(--red); color: #fff; font-weight: 600;
  box-shadow: 0 2px 8px rgba(239,68,68,.28); }
.btn.cf-danger:hover { background: #dc2626; }
.btn.cf-danger:active { transform: translateY(1px); }
.btn.cf-primary { background: var(--blue); color: #fff; font-weight: 600;
  box-shadow: 0 2px 8px rgba(99,102,241,.28); }
.btn.cf-primary:hover { background: #4f46e5; }
.btn.cf-primary:active { transform: translateY(1px); }
/* 所有直接子元素默认不收缩, 只有显式 flex:1 的才滚动 */
.modal > * { flex-shrink: 0; min-height: 0; }
.modal > .form-body,
.modal > form,
.modal > .pick-list { flex: 1; min-height: 0; overflow: auto; padding-right: 4px; margin-right: -4px; }
.modal > #impStep2,
.modal > .skipped-preview { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-right: 4px; margin-right: -4px; }
.modal > .modal-actions, .modal .modal-actions { flex-shrink: 0; padding-top: 10px; margin-top: 0; gap: 10px; }
.modal > .modal-actions .btn { flex: 1; }
/* 表格里的按钮不 flex */
.data-table td:last-child .btn { flex: none; }
/* 只动 transform 不动 opacity：防止动画在后台标签页/渲染节流等情况下被冻结时弹窗停在透明状态 */
@keyframes modalIn { from { transform: scale(.96) translateY(8px); } }
.modal h3 { font-size: 18px; margin-bottom: 8px; font-weight: 700; letter-spacing: -.02em; }
.field { margin-bottom: 6px; }
.field label { display: block; font-size: 12px; color: #9ca3af; margin-bottom: 2px;
  font-weight: 500; letter-spacing: .02em; }
.field input[type=text], .field input[type=number], .field input[type=password],
.field input[type=datetime-local], .field select, .field textarea {
  width: 100%; border: none; border-radius: 12px;
  padding: 8px 14px; font-size: 14px; font-family: inherit; background: #f2f2f7;
  color: var(--text); transition: background .15s, box-shadow .15s; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .15); }
.field textarea { resize: vertical; min-height: 40px; }
/* iOS 风格 datetime-local: 隐藏原生日历图标 */
.field input[type=datetime-local]::-webkit-calendar-picker-indicator {
  opacity: .4; cursor: pointer; padding: 4px; border-radius: 6px;
  transition: opacity .15s; }
.field input[type=datetime-local]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
.amount-input { font-size: 30px !important; font-weight: 700; text-align: center;
  letter-spacing: -.02em; padding: 8px 14px !important; color: var(--text);
  background: #f2f2f7 !important; border: none !important; caret-color: transparent;
  display: block; width: 100%; margin: 0; box-sizing: border-box; border-radius: 12px !important; }
/* 聚焦用内描边, 不超出输入框(避免被弹窗 overflow 裁切导致左侧框显示不全) */
.amount-input:focus { background: #fff !important;
  box-shadow: inset 0 0 0 2px rgba(99,102,241,.45) !important; }
.amount-input::placeholder { color: #d1d5db; }
/* 隐形焦点捕获器: 接管弹窗打开时浏览器自动落在金额框上的焦点 */
.focus-catcher { position: absolute; width: 1px; height: 1px; opacity: 0;
  border: none; padding: 0; margin: -1px 0 0 -1px; background: transparent; pointer-events: none; outline: none; }
/* 隐藏 number 输入框的上下步进箭头 */
.amount-input::-webkit-outer-spin-button,
.amount-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.amount-input { -moz-appearance: textfield; appearance: textfield; }
/* 打开弹窗时不显示光标: 输入框失焦仍保持灰底 */
.amount-input:not(:focus) { background: #f2f2f7 !important; }
.type-toggle { display: flex; gap: 0; margin-bottom: 6px;
  background: #f2f2f7; border-radius: 12px; padding: 3px; }
.type-toggle button { flex: 1; padding: 8px 12px; border-radius: 10px;
  border: none; background: transparent; font-size: 14px; cursor: pointer;
  color: #6b7280; font-weight: 500; font-family: inherit; transition: all .2s; }
.type-toggle button.on { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08);
  color: var(--text); font-weight: 600; }
.type-toggle button.on.expense { color: var(--red); }
.type-toggle button.on.income { color: var(--green); }
.uploader { display: flex; gap: 6px; flex-wrap: wrap; }
.uploader .slot { width: 44px; height: 44px; border-radius: 10px; position: relative; }
.uploader .slot img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.uploader .slot .del { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--red); color: #fff; border: 2px solid #fff;
  font-size: 12px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: var(--shadow-sm); }
.uploader .add { width: 44px; height: 44px; border: none;
  border-radius: 10px; background: #f2f2f7; color: #9ca3af;
  font-size: 22px; cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: background .15s; }
.uploader .add:hover { background: #e5e5ea; color: var(--blue); }

/* ===== 导入向导 ===== */
/* 来源标签页 */
.import-tabs { display: flex; gap: 6px; background: #f3f4f6; border-radius: 12px; padding: 4px; margin-bottom: 14px; }
/* 弹窗内门店选择行 */
.imp-store-row { display: flex; align-items: center; gap: 10px; background: var(--blue-bg);
  border: 1px solid var(--blue-bd); border-radius: 10px; padding: 8px 12px; margin-bottom: 2px; }
.imp-store-ico { font-size: 18px; flex-shrink: 0; }
.imp-store-label { font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.imp-store-pick { position: relative; flex: 1; display: flex; }
.imp-store-picker { display: flex; align-items: center; width: 100%; box-sizing: border-box;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 12px; transition: border-color .15s, box-shadow .15s, background .15s; }
.imp-store-picker:hover { border-color: var(--blue-bd); background: #fcfcff; }
.imp-store-picker.open { border-color: var(--blue); background: #fff;
  box-shadow: 0 0 0 3px var(--blue-bg); }
.imp-store-picker .picker-label { flex: 1; font-size: 14px; font-weight: 600;
  color: var(--text); pointer-events: none; white-space: nowrap; }
.imp-store-picker .picker-panel { min-width: 0; }
.imp-store-picker .picker-panel button { padding: 8px 12px; font-size: 13px;
  border-radius: 8px; gap: 8px; font-weight: 500; }
.imp-store-picker .picker-panel button.active { font-weight: 600; }
.imp-store-picker .picker-panel button .tick { width: 13px; }

/* 待导入文件列表 + 银行卡选择 */
.batch-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; margin-bottom: 8px; }
.batch-fname { flex: 1; min-width: 150px; font-size: 13.5px; font-weight: 600; }
.batch-card-pick { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
/* 自绘紧凑银行卡下拉(替代原生 select) */
.batch-card-picker { display: flex; align-items: center; width: 150px; min-width: 150px;
  flex: 0 0 auto; box-sizing: border-box;
  border: 1px solid var(--line); background: #fff; border-radius: 9px;
  padding: 6px 10px 6px 12px;
  transition: border-color .15s, box-shadow .15s, background .15s; }
.batch-card-picker:hover { border-color: var(--blue-bd); background: #fcfcff; }
.batch-card-picker.open { border-color: var(--blue); background: #fff;
  box-shadow: 0 0 0 3px var(--blue-bg); }
.batch-card-picker .picker-label { flex: 1; font-size: 13px; font-weight: 600;
  color: var(--text); pointer-events: none; white-space: nowrap; }
.batch-card-picker .chevron-ico { margin-left: 6px; }
.batch-card-picker .picker-panel { min-width: 0; padding: 5px; border-radius: 12px; }
.batch-card-picker .picker-panel button { padding: 7px 10px; font-size: 13px;
  border-radius: 8px; gap: 8px; font-weight: 500; }
.batch-card-picker .picker-panel button.active { font-weight: 600; }
.batch-card-picker .picker-panel button .tick { width: 13px; }
/* 未选卡的错误高亮 */
.batch-card-picker.pick-err { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
.batch-card-picker.pick-err .picker-label { color: var(--red); }
@media (max-width: 640px) {
  .batch-card-pick { width: 100%; }
  .batch-card-picker { flex: 1; }
}

/* 随手记: 识别结果摘要卡 (标题左, 收支徽章右, 省垂直空间) */
.ssj-summary-card { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin: 8px 0; padding: 11px 14px;
  background: var(--blue-bg); border: none; }
.ssj-summary-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ssj-summary-badges { display: flex; gap: 8px; flex-shrink: 0; }
@media (max-width: 560px) {
  .ssj-summary-card { flex-direction: column; align-items: flex-start; }
  .ssj-summary-badges { width: 100%; }
}

/* 随手记: 账单块 + 账户行 */
.ssj-file-block { background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; margin-bottom: 10px; }
.ssj-file-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px dashed var(--line); }
.ssj-file-name { font-size: 13.5px; }
.acct-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 6px 2px; transition: opacity .2s; }
.acct-item + .acct-item { border-top: 1px solid #f5f5f7; }
.acct-name { font-size: 13.5px; font-weight: 600; min-width: 120px; flex: 1; }
.import-tab { flex: 1; border: none; background: transparent; padding: 9px 12px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: #6b7280; cursor: pointer; transition: all .15s; }
.import-tab:hover { color: var(--text); }
.import-tab.active { background: #fff; color: var(--blue); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.import-pane { display: none; }
.import-pane.active { display: block; }
.import-upload {
  border: 2px dashed #d1d5db; border-radius: 16px;
  padding: 40px 20px; text-align: center; cursor: pointer;
  background: linear-gradient(180deg, #fafafa 0%, #f3f4f6 100%); transition: all .18s;
  display: block; }
.import-upload:hover { border-color: var(--blue); background: rgba(99,102,241,.04);
  transform: translateY(-1px); }
.import-upload .ico { font-size: 44px; margin-bottom: 12px; display: block; }
.import-upload .hint { font-size: 14px; color: #6b7280; }
.import-upload .hint strong { color: var(--blue); font-weight: 600; }
/* 导入进度行 */
.import-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,.05); }
.import-row:last-child { border-bottom: none; }
.import-row .name { flex: 1; font-size: 14px; color: var(--text); font-weight: 500; }
.import-row .st { font-size: 12px; padding: 4px 10px; border-radius: 8px; }
.import-row .st.ok { background: rgba(16,185,129,.12); color: #059669; }
.import-row .st.err { background: rgba(239,68,68,.12); color: #dc2626; }
.import-row .st.ing { background: #f2f2f7; color: #6b7280; }
.map-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.map-row label { width: 100px; flex-shrink: 0; font-size: 14px; color: #374151; font-weight: 500; }
.map-row select { flex: 1; background: #f2f2f7; border: none; border-radius: 10px;
  padding: 9px 12px; font-size: 14px; font-family: inherit; color: var(--text);
  cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20'%3E%3Cpath fill='%239ca3af' d='M5.5 7.5l4.5 4.5 4.5-4.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.map-row select:focus { outline: none; background: #fff; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.preview-table-wrap { border-radius: 12px; overflow: hidden; margin-top: 10px; }
.preview-table-wrap .data-table td { font-size: 12px; padding: 6px 10px; }
.modal-actions { display: flex; gap: 10px; margin-top: 12px; }
.modal-actions .btn { flex: 1; }
.confirm-body { font-size: 14px; color: var(--text); line-height: 1.6; padding: 4px 0 8px; }

/* ===== 对账卡片 ===== */
.recon-card { border-left: 4px solid var(--green); }
.recon-card.miss-r { border-left-color: var(--red); }
.recon-card.miss-b { border-left-color: var(--amber); }
.recon-card.clickable { cursor: pointer; transition: all .2s; }
.recon-card.clickable:hover { opacity: .85; }
.recon-card.clickable.active-summary { border-left-width: 6px; box-shadow: 0 0 0 2px var(--blue); }
:root { --red-soft: #fff5f5; --amber-soft: #fffbea; --green-soft: #f0f9f0; }
.section-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.diff-ok { color: var(--green); font-weight: 700; }
.diff-bad { color: var(--red); font-weight: 700; }

/* ===== Toast ===== */
.toast { position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 10px 22px; border-radius: 24px;
  font-size: 14px; font-weight: 500; z-index: 90; box-shadow: var(--shadow-lg);
  animation: toastIn .25s; max-width: 90vw; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } }
.toast[hidden] { display: none; }

/* ===== 登录 ===== */
.login-mask { position: fixed; inset: 0; background: var(--bg); z-index: 100;
  display: flex; align-items: center; justify-content: center; }
.login-mask[hidden] { display: none; }
.login-box { width: 360px; max-width: 92vw; background: #fff;
  border-radius: 20px; padding: 36px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.06); }
.login-logo { width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--blue) 0%, #818cf8 100%);
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  box-shadow: 0 4px 14px rgba(99,102,241,.35); }
.login-box h2 { text-align: center; margin-bottom: 4px; }
.login-err { color: var(--red); font-size: 13px; margin-bottom: 10px; text-align: center; }
.login-box code { background: var(--bg); border: 1px solid var(--line); border-radius: 4px;
  padding: 0 5px; font-size: 12px; }

/* ===== 类目标签编辑器 ===== */
.chip-editor { display: flex; flex-wrap: wrap; gap: 8px; border: none;
  border-radius: 12px; padding: 10px; min-height: 48px; background: #f2f2f7; }
.chip-editor:focus-within { background: #fff; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.chip { display: inline-flex; align-items: center; gap: 6px;
  background: rgba(99,102,241,.1); color: #4f46e5; border-radius: 20px;
  padding: 3px 6px 3px 12px; font-size: 13px; font-weight: 500; }
.chip button { border: none; background: none; color: var(--blue); cursor: pointer;
  font-size: 15px; width: 18px; height: 18px; line-height: 1; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; }
.chip button:hover { background: var(--blue-bd); }
.chip-input { border: none; outline: none; flex: 1; min-width: 120px;
  font-size: 14px; font-family: inherit; padding: 3px 2px; }

/* ===== 封账横幅 ===== */
.seal-banner { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; }
.seal-banner.locked { border-color: var(--green-bd); background: var(--green-bg); }
/* 封账条右侧操作组: 导出备份 / 导入备份 / 修改日志 / 封账 */
.seal-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---- 对账修改日志 ---- */
.audit-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.audit-wrap { max-height: 56vh; overflow: auto; border: 1px solid var(--line-2); border-radius: 12px; }
.audit-wrap .data-table { table-layout: fixed; }
.audit-wrap .data-table th { position: sticky; top: 0; z-index: 1; }
.audit-wrap .data-table td { padding: 8px 12px; font-size: 12.5px; vertical-align: top; }
.audit-wrap .audit-time { color: var(--sub); font-variant-numeric: tabular-nums; }
.audit-tag { display: inline-block; padding: 1px 8px; border-radius: 999px;
  background: var(--blue-bg); color: var(--blue); font-size: 11.5px; font-weight: 600;
  white-space: nowrap; }
.audit-month { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px;
  background: #f1f5f9; color: var(--sub); font-size: 11px; }
.audit-detail { white-space: normal; overflow-wrap: anywhere; color: #374151; }

/* ===== 大图 ===== */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 80;
  display: flex; align-items: center; justify-content: center; cursor: pointer; }
.lightbox img { max-width: 92%; max-height: 92%; border-radius: 8px; background: #fff; }

/* 侧边栏遮罩 */
.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 35;
  animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } }
.sidebar-overlay[hidden] { display: none; }

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== 手机适配 ===== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main-wrap { margin-left: 0; padding-bottom: 24px; }
  .menu-toggle { display: flex; }
  main { padding: 12px 12px 24px; max-width: 100%; }
  .dash-row { grid-template-columns: 1fr; gap: 14px; }
  .modal { border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    width: 100%; max-width: 100vw; max-height: 90vh; overflow-y: auto;
    padding: 18px 18px 24px; }
  .modal-mask { align-items: flex-end; }
  .modal h3 { font-size: 18px; margin-bottom: 12px; }
  .form-body .field { margin-bottom: 14px; }
  .form-body .field > label { font-size: 13px; margin-bottom: 4px; }
  .form-body input, .form-body textarea { font-size: 16px; }
  .form-body .picker-wrap { min-height: 44px; padding: 10px 12px; border-radius: 12px; }
  .modal-actions { gap: 10px; padding-top: 16px; }
  .modal-actions .btn { padding: 12px 16px; font-size: 15px; border-radius: 12px; }
  .topbar { padding: 0 12px; height: auto; min-height: 50px; flex-wrap: wrap; gap: 6px; padding-bottom: 8px; padding-top: 8px; }
  .topbar .title { font-size: 16px; order: -2; width: 100%; }
  .title-bar { flex-wrap: wrap; gap: 6px; }
  .menu-toggle { order: -1; }
  .store-wrap, .card-wrap, .month-wrap { padding: 5px 10px; font-size: 13px; min-height: 36px; }
  .dash-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; margin-bottom: 12px; }
  .dash-card { padding: 14px 14px; border-radius: 14px; }
  .dash-card .lab { font-size: 12px; }
  .dash-card .val { font-size: 16px; }
  .section-title { font-size: 15px; margin: 18px 0 10px; }
  .card { padding: 14px; border-radius: 14px; }

  /* ===== 表格变卡片 ===== */
  .table-wrap { overflow-x: visible; }
  .data-table th { display: none; }
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td {
    display: block; width: 100%; table-layout: auto;
  }
  .data-table { background: transparent; border: none; }
  .data-table.rec-table,
  .data-table.recon-main { table-layout: auto; }
  .data-table tbody tr {
    background: #fff; border-radius: 14px; padding: 12px 14px;
    margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.05);
    border: 1px solid var(--line-2); display: flex; flex-wrap: wrap; gap: 4px 10px;
    align-items: center; cursor: pointer;
  }
  .data-table tbody tr:hover { background: #fff; }
  .data-table td { border: none; padding: 4px 0; font-size: 13px; }
  .data-table td::before {
    content: attr(data-label); font-weight: 500; color: var(--sub-2);
    margin-right: 6px; font-size: 11px; text-transform: none;
  }
  .data-table td.amt { font-size: 15px; font-weight: 700; }
  .data-table td:last-child { margin-left: auto; }
  .data-table td.nowrap-cell { white-space: normal; overflow: visible; text-overflow: clip; }
  .data-table td .cell-text { white-space: normal; max-height: none; }
  .data-table .thumbs img { width: 36px; height: 36px; border-radius: 8px; }
  .thumbs img { width: 44px; height: 44px; }

  /* 底部TabBar已移除，不再需要 */
  .sidebar-footer { position: static; padding: 12px; }
  .btn-add { width: 100%; font-size: 15px; padding: 14px; }

  /* 封账横幅 */
  .seal-banner { padding: 12px 14px; font-size: 13px; }

  /* seg 分段控件 */
  .seg { max-width: 100%; }
  .seg button { padding: 10px 14px; font-size: 14px; }
}

/* ===== 浮动记账按钮 ===== */
.fab {
  position: fixed; right: 20px; bottom: 84px; z-index: 44;
  width: 54px; height: 54px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, var(--blue) 0%, #818cf8 100%);
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px -2px rgba(99,102,241,.55);
  cursor: pointer; transition: all .15s;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.fab:hover { transform: scale(1.05); }
.fab:active { transform: scale(.92); }
.fab[hidden] { display: none; }

/* ================= 统一对账工作台（五页合一） ================= */

/* ---- 概览卡区（dash-grid/dash-card 为基础） ---- */
.uw-ov-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; margin-bottom: 12px; }
.uw-ov-card { padding: 12px 14px; border: 1px solid transparent; transition: border-color .15s, background .15s, box-shadow .15s; }
.uw-ov-card.clickable { cursor: pointer; }
.uw-ov-card.clickable:hover { background: #f8faff; }
/* 选中态：实色描边 + 淡底色 + 阴影浮起 */
.uw-ov-card.on { border-color: var(--blue); background: #eef2ff; box-shadow: 0 2px 8px rgba(99,102,241,.18); }
.uw-ov-card.on .val { font-weight: 700; }
.uw-ov-card .val { font-size: 19px; line-height: 1.35; }
.uw-ov-card .sub { margin-top: 2px; }

/* ---- 状态 Tab ---- */
.uw-tabs { display: flex; align-items: center; gap: 8px; padding: 2px 2px 10px; }
.uw-chips { display: flex; gap: 8px; overflow-x: auto; flex: 0 1 auto; min-width: 0;
  padding: 6px 2px; }
.uw-chips::-webkit-scrollbar { display: none; }
.uw-kw-cell { flex: 0 0 auto; }
.uw-kw-cell .bd-kw { width: 190px; }
.wb-tab { position: relative; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid transparent; overflow: hidden;
  background: var(--tbg); color: var(--tc);
  font-size: 11.5px; font-weight: 600; padding: 6px 12px; border-radius: 12px;
  cursor: pointer; white-space: nowrap;
  transition: transform .15s, box-shadow .15s, background .15s; }
/* 右下角装饰圆（同参考卡片，墨色低透明） */
.wb-tab::after { content: ''; position: absolute; right: -12px; bottom: -12px;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--tc); opacity: .07; pointer-events: none; }
.wb-tab:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,.08); }
.wb-tab-cnt { position: relative; font-style: normal; font-weight: 700; font-size: 12px; line-height: 1; }
.wb-tab-cnt.zero { color: #c2c9d2; font-weight: 600; }
.wb-tab.on { background: color-mix(in srgb, var(--tc) 12%, #fff); font-weight: 600;
  border-color: var(--tc); box-shadow: 0 3px 10px -2px color-mix(in srgb, var(--tc) 28%, transparent); }
.wb-tab.on::after { opacity: .1; }

/* ---- 统一大表 ---- */
.uw-table-shell { position: relative; }
/* 横滚渐隐提示：只在对应方向“还有内容”时显现 */
.uw-table-shell::before, .uw-table-shell::after { content: ''; position: absolute;
  top: 4px; bottom: 12px; width: 26px; z-index: 6; pointer-events: none;
  opacity: 0; transition: opacity .2s ease; }
.uw-table-shell::before { left: 0; background: linear-gradient(90deg, rgba(255,255,255,.96), rgba(255,255,255,0)); }
.uw-table-shell::after { right: 0; background: linear-gradient(270deg, rgba(255,255,255,.96), rgba(255,255,255,0)); }
.uw-table-shell.can-l::before { opacity: 1; }
.uw-table-shell.can-r::after { opacity: 1; }
/* 底部收尾线: 明确"已到最后一笔", 到此即为滚动终点 */
.uw-end-mark { display: flex; align-items: center; gap: 12px; padding: 12px 6px 2px; }
.uw-end-mark .uw-end-line { flex: 1 1 auto; height: 1px;
  background: linear-gradient(90deg, transparent, #d4d9e0 35%, #d4d9e0 65%, transparent); }
.uw-end-mark .uw-end-text { flex: 0 0 auto; font-size: 12px; color: #9ca3af; letter-spacing: .02em; }
.uw-table-wrap { position: relative; overflow-x: auto; overflow-y: hidden; overflow-anchor: none;
  background: #fff; border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05); }
/* 细而可见的横向滚动条，提示可以左右滑动 */
.uw-table-wrap::-webkit-scrollbar { height: 5px; }
.uw-table-wrap::-webkit-scrollbar-track { background: transparent; }
.uw-table-wrap::-webkit-scrollbar-thumb { background: #c7ccd6; border-radius: 3px; }
.uw-empty-overlay { position: absolute; left: 0; right: 0; top: 50%; z-index: 4;
  transform: translateY(-50%);
  text-align: center; color: #94a3b8; font-size: 14px; padding: 24px 0;
  background: rgba(255,255,255,.85); pointer-events: none; }
.uw-table { min-width: 1330px; width: 100%; table-layout: fixed; border-collapse: collapse; }
.uw-table th { font-size: 12px; color: #6b7280; font-weight: 600; padding: 10px 8px;
  background: #fafbfc; text-align: left; border-bottom: 1px solid #eef0f3; white-space: nowrap; }
.uw-table td { padding: 6px 8px; font-size: 13px; line-height: 1.4; color: var(--text);
  border-bottom: 1px solid #f2f3f5; vertical-align: middle; }
.uw-table tbody tr:last-child td { border-bottom: none; }
.uw-table .amt { font-weight: 600; white-space: nowrap; font-size: 13px; }
.uw-table .amt.amount-out { color: var(--red); }
.uw-table .amt.amount-in { color: var(--green); }

/* 文本单元格：单行省略，完整内容看 title 或点开编辑 */
.uw-clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uw-date { white-space: nowrap; color: #374151; font-size: 12px;
  overflow: hidden; text-overflow: clip; font-variant-numeric: tabular-nums;
  padding-left: 4px; padding-right: 4px; }
.uw-card-cell { color: #6b7280; font-size: 12px; }
.uw-note-cell { cursor: pointer; }
.uw-sum-cell { cursor: pointer; }
.uw-sum-cell:hover { color: var(--blue); }

/* ---- 中轴：核对标记 ---- */
/* 中间分隔带：银行侧 | 核对 | 记账侧 */
.uw-axis-th { text-align: center !important; background: #f8fafc !important; }
.uw-axis { position: relative; padding: 0; width: 58px;
  background: #f8fafc;
  border-left: 1px solid #e9edf2; border-right: 1px solid #e9edf2; }
.uw-axis-in { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 6px 4px; box-sizing: border-box; }
.uw-match-ok { display: inline-flex; align-items: center; justify-content: center;
  width: 19px; height: 19px; border-radius: 50%;
  background: linear-gradient(135deg, #34d399, #059669);
  color: #fff; font-size: 9.5px; font-weight: 700;
  box-shadow: 0 2px 5px -1px rgba(16,185,129,.5); }
.uw-match-ok.gap { background: linear-gradient(135deg, #fbbf24, #d97706);
  box-shadow: 0 2px 5px -1px rgba(245,158,11,.5); font-size: 8.5px; }
.uw-match-ok.gap small { font-size: 9px; font-weight: 600; margin-left: 1px; }
.uw-axis-badge { display: inline-block; padding: 4px 7px; border-radius: 8px;
  font-size: 10px; line-height: 1.3; font-weight: 600; }
.uw-axis-badge.ronly { background: #fef2f2; color: #dc2626; }
.uw-axis-badge.bonly { background: #fffbeb; color: #d97706; }
.uw-axis-badge.internal { background: #eef2ff; color: #4f46e5; }

/* ---- 记账类目彩签 ---- */
.uw-cat-badge { display: inline-block; vertical-align: middle; padding: 3px 9px; border-radius: 8px;
  font-size: inherit; line-height: inherit; font-weight: 600; max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }

/* ---- 凭证 ---- */
.uw-vc { padding: 4px 8px; }
.uw-thumbs { display: flex; align-items: center; gap: 4px; overflow: visible; }
.uw-thumbs img { width: 34px; height: 34px; border-radius: 7px; object-fit: cover;
  cursor: zoom-in; border: 1px solid #eef0f3; -webkit-user-drag: none; user-select: none; }
.uw-more { font-size: 11px; color: #6b7280; font-weight: 600; }
.uw-add-vc { display: inline-block; font-size: 11px; color: #9ca3af;
  border: 1px dashed #d1d5db; border-radius: 7px; padding: 7px 8px; cursor: pointer; }
.uw-add-vc:hover { color: var(--blue); border-color: var(--blue); }

/* ---- 银行备注 ---- */
.uw-note { width: 100%; min-width: 0; font-size: 12.5px; }

/* ---- 操作按钮 ---- */
/* 操作列固定在表格右缘：任何窗口宽度下“匹配流水/匹配记账”按钮常驻可见可点 */
.uw-table th:last-child { position: sticky; right: 0; z-index: 3;
  background: #fafbfc; box-shadow: inset 1px 0 0 #e9edf2; }
.uw-table td.uw-ops { position: sticky; right: 0; z-index: 2;
  background: #fff; white-space: nowrap; box-shadow: inset 1px 0 0 #eef0f3; }
/* 记账金额列紧贴操作列左侧 (sticky right:160px) —— 任何滚动位置金额常驻可见 */
.uw-table th:nth-child(13) { position: sticky; right: 160px; z-index: 2;
  background: #fafbfc; box-shadow: inset 1px 0 0 #eef0f3; }
.uw-table td.uw-amt-col { position: sticky; right: 160px; z-index: 1;
  background: #fff; box-shadow: inset 1px 0 0 #f3f4f6; }
.uw-btn { display: inline-block; padding: 4px 10px; border-radius: 9px; font-size: 12px;
  border: 1px solid #e2e5ea; background: #fff; color: #374151; cursor: pointer; }
.uw-btn:hover { background: #f6f8fb; }
.uw-btn.danger { color: #dc2626; border-color: transparent; background: #fdecec;
  font-weight: 600; border-radius: 12px; padding: 6px 14px; }
.uw-btn.danger:hover { background: #fbdada; }
.uw-btn.purple { color: #6d28d9; border-color: transparent; background: #ede9fe;
  font-weight: 600; border-radius: 12px; padding: 6px 14px; }
.uw-btn.purple:hover { background: #ddd6fe; }
.uw-btn.receipt { color: #0d9488; border-color: transparent; background: #f0fdfa;
  font-weight: 600; border-radius: 12px; padding: 6px 14px; }
.uw-btn.receipt:hover { background: #ccfbf1; }
.uw-btn.gray { color: #6b7280; }
.uw-ico-btn { display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; margin-left: 4px; border-radius: 8px;
  border: 1px solid #e8eaed; background: #fff; cursor: pointer; font-size: 13px; }
.uw-ico-btn:hover { background: #fffbeb; }

/* ---- 单边空侧 / 多笔银行子行 ---- */
.uw-empty-side { text-align: center; color: #b6bcc6; font-size: 11px; padding: 8px; }
.uw-empty-side .uw-btn { font-size: 12px; }
.uw-banksub td { background: #fcfcfd; }

/* ---- 移动端 ---- */
@media (max-width: 760px) {
  .uw-ov-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .uw-ov-card { padding: 10px 12px; }
  .uw-ov-card .val { font-size: 17px; }
  .uw-tabs { gap: 6px; }
  .uw-kw-cell .bd-kw { width: 130px; }
  .uw-table-wrap { border-radius: 12px; overflow-x: auto; }
  .uw-table-shell::before, .uw-table-shell::after { bottom: 8px; }
  #uwColResizeBtn { padding: 5px 10px; font-size: 12px; }

  /* 统一表不套用全局"表格变卡片"规则，保持表格形态，左右滑动看全部列 */
  .uw-table { display: table; width: 100%; min-width: 1330px; background: #fff; border: none; table-layout: fixed; }
  .uw-table thead { display: table-header-group; }
  .uw-table tbody { display: table-row-group; }
  .uw-table thead th { display: table-cell; }
  .uw-table tbody tr { display: table-row; padding: 0; margin: 0; background: transparent;
    border: none; box-shadow: none; flex-wrap: nowrap; cursor: default; }
  /* 上面给 tr 显式设了 display, 会盖掉浏览器默认的 [hidden]{display:none},
     导致窄屏下筛选/隐藏行失效, 这里补回来 */
  .uw-table tbody tr[hidden] { display: none; }
  .uw-table tbody td { display: table-cell; width: auto; padding: 6px 8px; border-bottom: 1px solid #f2f3f5;
    font-size: 11.5px; line-height: 1.4; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  .uw-table tbody td::before { content: none; }
  /* 日期列锁定字号不被系统放大，保证 2026-06-15 完整显示不截断 */
  .uw-table .uw-date { font-size: 11.5px; letter-spacing: -.01em; }
  .uw-table .uw-empty-side { font-size: 10.5px; }
  /* 操作列：收窄按钮内边距+锁定字号，保证两个按钮完整不截断 */
  .uw-table .uw-ops { padding: 6px 4px; white-space: nowrap; }
  .uw-table .uw-btn { padding: 4px 8px; font-size: 11px; border-radius: 8px;
    -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  .uw-table .uw-ico-btn { width: 24px; height: 24px; margin-left: 3px; font-size: 12px; }
  .uw-table .uw-thumbs-rec img { width: 34px; height: 34px; }

  /* 匹配弹窗候选表不套用"表格变卡片"，保持紧凑表格（窄屏横向滑动查看全部列） */
  .pick-list .data-table { display: table; width: 100%; min-width: 460px;
    background: transparent; border: none; table-layout: fixed; }
  .pick-list .data-table thead { display: table-header-group; }
  .pick-list .data-table tbody { display: table-row-group; }
  .pick-list .data-table th { display: table-cell; }
  .pick-list .data-table tbody tr { display: table-row; padding: 0; margin: 0; background: transparent;
    border: none; border-radius: 0; box-shadow: none; flex-wrap: nowrap; }
  .pick-list .data-table tbody tr:hover { background: #f8fafc; }
  .pick-list .data-table td { display: table-cell; width: auto; border: none; padding: 5px 8px;
    font-size: 12px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pick-list .data-table td::before { content: none; }
  .pick-list .data-table td .cell-text { white-space: nowrap; max-height: none; }
  .pick-list .data-table .thumbs img { width: 30px; height: 30px; border-radius: 6px; }
}

/* ================= 手机端补记账 ================= */
/* 范围选择条: 门店 / 银行卡 / 月份 */
.mb-sel { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; }
.mb-sel::-webkit-scrollbar { display: none; }
.mb-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  max-width: 48vw; border: 1px solid var(--line); background: #fff; color: var(--text-2);
  font-family: inherit; font-size: 13px; font-weight: 500; padding: 9px 13px;
  border-radius: 12px; cursor: pointer; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  transition: border-color .15s, background .15s; }
.mb-chip:hover { background: #fafbfc; border-color: #cbd2dc; }
.mb-chip .mb-chev { flex: 0 0 auto; font-size: 10px; opacity: .45; }
/* 一键记一笔 */
.mb-add { display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px; margin-bottom: 12px; border: none; border-radius: 14px;
  font-family: inherit; font-size: 16px; font-weight: 600; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--blue) 0%, #818cf8 100%);
  box-shadow: 0 4px 12px -2px rgba(99,102,241,.35); transition: transform .15s; }
.mb-add:hover { transform: translateY(-1px); }
.mb-add:active { transform: translateY(0); }
/* 筛选工具条 */
.mb-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.mb-tools .bd-kw-wrap { flex: 1 1 150px; }
.mb-tools .bd-kw { width: 100%; }
/* 补记账清单 */
.mb-list { display: flex; flex-direction: column; gap: 10px; }
.mb-item { background: #fff; border: 1px solid var(--line-2); border-radius: 14px;
  padding: 12px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.05); cursor: pointer;
  transition: border-color .15s, box-shadow .15s; }
.mb-item:hover { border-color: #dbe2ea; box-shadow: 0 3px 10px rgba(0,0,0,.07); }
.mb-row1 { display: flex; align-items: center; gap: 8px; }
.mb-cat { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-amt { flex: 0 0 auto; font-size: 16px; font-weight: 700; }
.mb-note { margin-top: 6px; font-size: 13px; color: var(--text-2); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mb-meta { margin-top: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 12px; color: var(--sub-2); }
.mb-meta .mb-sep { color: #d5dbe3; }
.mb-thumbs { display: inline-flex; gap: 6px; margin-left: auto; }
.mb-thumbs img { width: 34px; height: 34px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--line); }
/* 选择器弹层 */
.mb-pick { max-height: 56vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.mb-pick-row { display: flex; align-items: center; gap: 10px; width: 100%;
  border: none; background: none; font-family: inherit; font-size: 15px; color: var(--text);
  padding: 12px 12px; border-radius: 12px; cursor: pointer; text-align: left; }
.mb-pick-row:hover { background: #f8fafc; }
.mb-pick-row.on { background: var(--blue-bg); color: #4338ca; font-weight: 600; }
.mb-pick-tick { flex: 0 0 16px; font-size: 14px; color: var(--blue); }
.mb-pick-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
