/* ==========================================================================
   澄账 · 财务运营后台 — 设计系统
   方向：克制 / 秩序感 / 层次感 / 轻光影感 / 节奏感
   ========================================================================== */

/* 1. Reset / 盒模型基线
   -------------------------------------------------------------------------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }
a { text-decoration: none; color: inherit; }
button { border: none; background: none; font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; border: none; outline: none; }
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* 2. 排版基线
   -------------------------------------------------------------------------- */
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Noto Sans SC", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}.mono { font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; }
.num, td.num, .amount { font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }

/* 3. 语义变量
   -------------------------------------------------------------------------- */
:root {
  /* 表面与层级 */
  --canvas: #EEF1F5;
  --surface: #FFFFFF;
  --surface-2: #F6F8FA;
  --surface-3: #EFF2F6;
  --surface-hover: #F0F3F7;
  --overlay: rgba(16, 28, 44, 0.42);

  /* 品牌（沉稳墨蓝，金融信任感，低饱和） */
  --brand: #33507A;
  --brand-hover: #294263;
  --brand-active: #22364F;
  --brand-weak: rgba(51, 80, 122, 0.08);
  --brand-weak-2: rgba(51, 80, 122, 0.13);
  --on-brand: #FFFFFF;

  /* 文字层级 */
  --text-strong: #1B2735;
  --text-primary: #39475A;
  --text-secondary: #687486;
  --text-tertiary: #98A2B0;
  --text-disabled: #C2C9D3;

  /* 语义色（仅用于状态指示，小面积） */
  --success: #2E6B4E;
  --success-bg: rgba(46, 107, 78, 0.10);
  --warning: #9C6B2A;
  --warning-bg: rgba(156, 107, 42, 0.12);
  --danger: #B0453E;
  --danger-bg: rgba(176, 69, 62, 0.10);
  --info: #33507A;
  --info-bg: rgba(51, 80, 122, 0.08);

  /* 边界与阴影 */
  --border: rgba(24, 42, 68, 0.08);
  --border-strong: rgba(24, 42, 68, 0.16);
  --shadow-sm: 0 1px 2px rgba(22, 38, 61, 0.05), 0 1px 3px rgba(22, 38, 61, 0.06);
  --shadow-md: 0 4px 14px rgba(22, 38, 61, 0.08), 0 2px 5px rgba(22, 38, 61, 0.05);
  --shadow-lg: 0 12px 32px rgba(22, 38, 61, 0.10), 0 4px 12px rgba(22, 38, 61, 0.06);
  --shadow-xl: 0 24px 56px rgba(22, 38, 61, 0.14);

  /* 几何与动效 */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 999px;
  --ease: cubic-bezier(0.33, 1, 0.68, 1);
  --t-fast: 160ms;
  --t-base: 220ms;

  /* 布局 */
  --sidebar-w: 232px;
  --topbar-h: 60px;
  --max: 1400px;
  --gutter: 24px;
}

/* 4. 自定义滚动条
   -------------------------------------------------------------------------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(40, 58, 84, 0.16); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(40, 58, 84, 0.28); }
* { scrollbar-width: thin; scrollbar-color: rgba(40, 58, 84, 0.16) transparent; }

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

/* 侧栏（固定栏，允许磨砂） */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  z-index: 100;
  display: flex; flex-direction: column;
  padding: 20px 14px 16px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 2px 8px 18px;
}
.brand-mark {
  width: 34px; height: 34px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: var(--on-brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-sm);
}
.brand-name { font-size: 15px; font-weight: 700; color: var(--text-strong); letter-spacing: 0.5px; }
.brand-sub { font-size: 10px; color: var(--text-tertiary); letter-spacing: 0.3px; margin-top: -2px; }

.sidebar-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; margin: 0 -4px; padding: 0 4px; }
.sidebar-group-label {
  font-size: 10px; font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.8px;
  padding: 14px 12px 6px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  margin-bottom: 2px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.sidebar-link svg { width: 16px; height: 16px; flex-shrink: 0; stroke-width: 1.8; }
.sidebar-link:hover { background: var(--surface-2); color: var(--text-strong); }
.sidebar-link.active { background: var(--brand-weak); color: var(--brand); font-weight: 600; }
.sidebar-link.active::before {
  content: ''; position: absolute; left: -14px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  border-radius: 2px;
  background: var(--brand);
}
.sidebar-badge {
  margin-left: auto;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--brand);
  color: var(--on-brand);
  font-size: 10px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 10px 2px;
  margin-top: 12px;
  border-top: 1px solid var(--border);
}
.sidebar-user img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.sidebar-user-info { min-width: 0; line-height: 1.3; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: var(--text-strong); }
.sidebar-user-role { font-size: 11px; color: var(--text-tertiary); }

/* 主区 */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex; flex-direction: column;
}
.topbar {
  position: sticky; top: 0; z-index: 90;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 var(--gutter);
  background: rgba(238, 241, 245, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.topbar-title { font-size: 15px; font-weight: 700; color: var(--text-strong); letter-spacing: -0.2px; }
.topbar-breadcrumb { font-size: 12px; color: var(--text-tertiary); }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.page {
  width: 100%; max-width: var(--max);
  margin: 0 auto;
  padding: 20px var(--gutter) 56px;
}

/* 页面头部 */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head-title { font-size: 20px; font-weight: 700; color: var(--text-strong); letter-spacing: -0.3px; line-height: 1.3; }
.page-head-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.page-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 6. 资金概况带（财务首屏主对象，非普通统计卡） */
.balance-band {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.balance-main {
  grid-row: span 2;
  background: var(--brand);
  color: var(--on-brand);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.balance-main::after {
  content: '';
  position: absolute; right: -46px; top: -46px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}
.balance-label { font-size: 11px; color: rgba(255, 255, 255, 0.72); letter-spacing: 0.4px; margin-bottom: 6px; }
.balance-value { font-size: 20px; font-weight: 700; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.balance-trend { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, 0.85); margin-top: 6px; }
.balance-trend svg { width: 12px; height: 12px; }
.balance-trend.down { color: rgba(255, 200, 190, 0.9); }
.balance-split { display: flex; gap: 18px; margin-top: 16px; }
.balance-split-item { font-size: 11px; color: rgba(255, 255, 255, 0.72); }
.balance-split-item b { display: block; font-size: 14px; font-weight: 600; color: var(--on-brand); font-variant-numeric: tabular-nums; margin-top: 1px; }

.balance-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; justify-content: space-between;
  gap: 10px;
  transition: box-shadow var(--t-base) var(--ease);
}
.balance-card:hover { box-shadow: var(--shadow-md); }
.balance-card-top { display: flex; align-items: center; justify-content: space-between; }
.balance-card-label { font-size: 12px; color: var(--text-secondary); }
.balance-card-icon { width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; color: var(--brand); background: var(--brand-weak); }
.balance-card-icon svg { width: 14px; height: 14px; }
.balance-card-icon.green { color: var(--success); background: var(--success-bg); }
.balance-card-icon.amber { color: var(--warning); background: var(--warning-bg); }
.balance-card-icon.red { color: var(--danger); background: var(--danger-bg); }
.balance-card-value { font-size: 18px; font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; line-height: 1.2; }
.balance-card-foot { font-size: 11px; color: var(--text-tertiary); display: flex; align-items: center; gap: 4px; }
.balance-card-foot .dot-up { color: var(--success); font-weight: 600; }
.balance-card-foot .dot-down { color: var(--danger); font-weight: 600; }

/* 7. 面板 */
.panel {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
}
.panel + .panel { margin-top: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-title { font-size: 14px; font-weight: 600; color: var(--text-strong); display: flex; align-items: center; gap: 8px; }
.panel-title svg { width: 15px; height: 15px; color: var(--brand); }
.panel-sub { font-size: 11px; color: var(--text-tertiary); font-weight: 400; }
.panel-link { font-size: 12px; color: var(--text-secondary); font-weight: 500; display: inline-flex; align-items: center; gap: 4px; transition: color var(--t-fast) var(--ease); }
.panel-link svg { width: 12px; height: 12px; }
.panel-link:hover { color: var(--brand); }

.grid-2col { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; }
.grid-3col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4col { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.grid-2eq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-2col > *, .grid-3col > *, .grid-4col > *, .grid-2eq > * { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid-2col > .stack { align-self: start; }

/* 双列自适应：两列各自按内容自然高度堆叠，不强行等高 */
.dash-split { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
.dash-split .stack { gap: 16px; }
.dash-split .stack .panel { margin-bottom: 0; }
@media (max-width: 900px) { .dash-split { grid-template-columns: minmax(0, 1fr); } }

.section-gap { margin-bottom: 16px; }

/* 8. 表格（无边线分割，靠留白/背景差/等宽数字） */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -8px; padding: 0 8px; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead th {
  text-align: left;
  padding: 8px 12px 10px;
  font-size: 11px; font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.4px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.data-table tbody td {
  padding: 12px;
  vertical-align: middle;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(24, 42, 68, 0.045);
}
.data-table tbody tr { transition: background-color var(--t-fast) var(--ease); }
.data-table tbody tr:hover { background: var(--surface-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .num { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-strong); }
.data-table .amount { text-align: right; }
.data-table .amount.in { color: var(--success); }
.data-table .amount.out { color: var(--text-strong); }
.data-table .amount.out.red { color: var(--danger); }
.data-table th.amount, .data-table td.amount { text-align: right; }
.data-table .cell-strong { font-weight: 600; color: var(--text-strong); }
.data-table .cell-mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; color: var(--text-secondary); letter-spacing: 0.2px; }
.data-table .cell-muted { color: var(--text-secondary); }
.data-table .cell-sub { font-size: 11px; color: var(--text-tertiary); margin-top: 1px; }

.user-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-cell img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--surface-3); }
.user-cell-info { min-width: 0; line-height: 1.3; }
.user-cell-name { font-size: 13px; font-weight: 500; color: var(--text-strong); white-space: nowrap; }
.user-cell-sub { font-size: 11px; color: var(--text-tertiary); white-space: nowrap; }

/* 9. 状态徽标（圆形点 + 文字，低饱和） */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.ok { color: var(--success); background: var(--success-bg); }
.status.warn { color: var(--warning); background: var(--warning-bg); }
.status.danger { color: var(--danger); background: var(--danger-bg); }
.status.info { color: var(--brand); background: var(--brand-weak); }
.status.neutral { color: var(--text-secondary); background: var(--surface-2); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-ok { background: var(--success); }
.dot-warn { background: var(--warning); }
.dot-danger { background: var(--danger); }
.dot-info { background: var(--brand); }
.dot-neutral { background: var(--text-disabled); }

/* balance-card-foot 内的变化文字：使用语义文字色，不用圆点背景 */
.balance-card-foot .dot-ok { color: var(--success); background: transparent; font-weight: 600; }
.balance-card-foot .dot-warn { color: var(--warning); background: transparent; font-weight: 600; }
.balance-card-foot .dot-danger { color: var(--danger); background: transparent; font-weight: 600; }
.balance-card-foot .dot-ok svg, .balance-card-foot .dot-warn svg, .balance-card-foot .dot-danger svg { vertical-align: -1px; }

/* 10. 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background-color var(--t-base) var(--ease), color var(--t-base) var(--ease),
              box-shadow var(--t-base) var(--ease), transform var(--t-fast) var(--ease),
              border-color var(--t-base) var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 15px; height: 15px; stroke-width: 1.9; flex-shrink: 0; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); box-shadow: 0 3px 10px rgba(51, 80, 122, 0.25); }
.btn-secondary { background: var(--surface); color: var(--text-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text-strong); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #993A34; box-shadow: 0 3px 10px rgba(176, 69, 62, 0.25); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-xs { height: 26px; padding: 0 10px; font-size: 11px; }
.btn-xs svg { width: 12px; height: 12px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn.is-loading { color: transparent; pointer-events: none; }
.btn.is-loading::after {
  content: ''; position: absolute;
  width: 14px; height: 14px;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn { position: relative; }
.btn.is-loading::after { color: #fff; border-color: rgba(255,255,255,0.4); border-top-color: #fff; }

.icon-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  position: relative;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text-strong); }
.icon-btn svg { width: 17px; height: 17px; stroke-width: 1.8; }
.icon-btn .dot-danger { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; }

/* 表格操作列对齐：按钮数量/宽度不同的行，用等宽占位保持图标在同一垂直线上 */
.row-actions { display: flex; align-items: center; gap: 4px; }
.row-actions .icon-btn { flex-shrink: 0; }
.action-placeholder {
  width: 68px; height: 26px; flex-shrink: 0;
  display: inline-block;
}

/* 11. 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-hint { font-size: 11px; color: var(--text-tertiary); }
.field {
  width: 100%; height: 38px;
  padding: 0 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  color: var(--text-strong);
  font-size: 13px;
  transition: background-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.field::placeholder { color: var(--text-tertiary); }
.field:hover { background: var(--surface-3); }
.field:focus { background: var(--surface); box-shadow: 0 0 0 2px rgba(51, 80, 122, 0.16), inset 0 0 0 1px var(--brand); }
textarea.field { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.field:disabled { opacity: 0.5; cursor: not-allowed; }

/* 自定义 Select（触发按钮 + 下拉面板） */
.select { position: relative; min-width: 140px; }
.select-trigger {
  display: flex; align-items: center; gap: 8px;
  height: 38px; width: 100%;
  padding: 0 34px 0 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-strong);
  cursor: pointer; text-align: left;
  position: relative;
  transition: background-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.select-trigger:hover { background: var(--surface-3); }
.select-trigger:focus-visible { box-shadow: 0 0 0 2px rgba(51, 80, 122, 0.16), inset 0 0 0 1px var(--brand); }
.select-trigger .chev {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  color: var(--text-tertiary);
  pointer-events: none;
  transition: transform var(--t-base) var(--ease);
}
.select.open .chev { transform: translateY(-50%) rotate(180deg); }
.select-trigger .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-panel {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 200;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  max-height: 240px; overflow-y: auto;
  opacity: 0; transform: translateY(-4px);
  pointer-events: none;
  transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}
.select.open .select-panel { opacity: 1; transform: translateY(0); pointer-events: auto; }
.select-option {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.select-option:hover { background: var(--surface-hover); color: var(--text-strong); }
.select-option.selected { background: var(--brand-weak); color: var(--brand); font-weight: 600; }
.select-option .check { width: 13px; height: 13px; opacity: 0; transition: opacity var(--t-fast) var(--ease); color: var(--brand); }
.select-option.selected .check { opacity: 1; }

/* 自定义 Checkbox */
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text-primary); user-select: none; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check-box {
  width: 18px; height: 18px; flex-shrink: 0;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.check-box svg { width: 11px; height: 11px; color: var(--on-brand); opacity: 0; transform: scale(0.5); transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
.check:hover .check-box { border-color: var(--brand); }
.check input:focus-visible + .check-box { box-shadow: 0 0 0 2px rgba(51, 80, 122, 0.16), inset 0 0 0 1px var(--brand); }
.check input:checked + .check-box { background: var(--brand); border-color: var(--brand); }
.check input:checked + .check-box svg { opacity: 1; transform: scale(1); }
.check input:disabled + .check-box { opacity: 0.45; cursor: not-allowed; }
.check .check-label-text { white-space: nowrap; }

/* 自定义 Toggle */
.toggle { position: relative; width: 40px; height: 22px; flex-shrink: 0; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0;
  background: rgba(24, 42, 68, 0.12);
  border-radius: 11px;
  transition: background-color var(--t-base) var(--ease);
}
.toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(22, 38, 61, 0.22);
  transition: transform var(--t-base) var(--ease);
}
.toggle input:checked + .toggle-track { background: var(--brand); }
.toggle input:checked ~ .toggle-thumb { transform: translateX(18px); }
.toggle input:focus-visible + .toggle-track { box-shadow: 0 0 0 2px rgba(51, 80, 122, 0.16); }

/* 12. 搜索与筛选 */
.search { position: relative; width: 260px; }
.search input {
  width: 100%; height: 38px;
  padding: 0 12px 0 36px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  color: var(--text-strong);
  font-size: 13px;
  transition: background-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.search input::placeholder { color: var(--text-tertiary); }
.search input:hover { background: var(--surface-3); }
.search input:focus { background: var(--surface); box-shadow: 0 0 0 2px rgba(51, 80, 122, 0.16), inset 0 0 0 1px var(--brand); }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-tertiary); pointer-events: none; }

.filter-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px; font-weight: 500;
  background: var(--surface);
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.filter-chip svg { width: 12px; height: 12px; }
.filter-chip:hover { color: var(--text-strong); }
.filter-chip.active { background: var(--brand); color: var(--on-brand); box-shadow: none; }
.filter-chip .count { font-size: 10px; opacity: 0.7; font-variant-numeric: tabular-nums; }

/* 13. 进度条 / 账龄 */
.progress { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; min-width: 60px; }
.progress-fill { height: 100%; border-radius: 3px; background: var(--brand); transition: width 0.6s var(--ease); }
.progress-fill.ok { background: var(--success); }
.progress-fill.warn { background: var(--warning); }
.progress-fill.danger { background: var(--danger); }
.budget-row { display: flex; align-items: center; gap: 12px; }
.budget-row .progress { flex: 1; }
.budget-row .budget-pct { font-size: 12px; font-weight: 600; color: var(--text-secondary); font-variant-numeric: tabular-nums; width: 38px; text-align: right; }

/* 14. 图表 */
.chart-tooltip {
  position: absolute; z-index: 220;
  background: var(--text-strong);
  color: #fff;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 6px;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.chart-tooltip.show { opacity: 1; transform: translateY(0); }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; }
.chart-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-secondary); }
.chart-legend-item .swatch { width: 9px; height: 9px; border-radius: 3px; }

/* 15. 列表组件 */
.activity-list { display: flex; flex-direction: column; }
.activity-item { display: flex; gap: 12px; padding: 11px 0; align-items: flex-start; }
.activity-item + .activity-item { border-top: 1px solid rgba(24, 42, 68, 0.045); }
.activity-marker {
  width: 30px; height: 30px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.activity-marker svg { width: 15px; height: 15px; }
.activity-marker.in { background: var(--success-bg); color: var(--success); }
.activity-marker.out { background: var(--danger-bg); color: var(--danger); }
.activity-marker.info { background: var(--brand-weak); color: var(--brand); }
.activity-content { flex: 1; min-width: 0; }
.activity-text { font-size: 13px; color: var(--text-strong); line-height: 1.5; }
.activity-text .mono { color: var(--text-secondary); font-size: 12px; }
.activity-text .amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.activity-time { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

/* 审批 / 报销卡片列表 */
.approval-list { display: flex; flex-direction: column; }
.approval-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius-sm); transition: background-color var(--t-fast) var(--ease); }
.approval-item:hover { background: var(--surface-hover); }
.approval-item + .approval-item { margin-top: 2px; }
.approval-main { flex: 1; min-width: 0; }
.approval-title { font-size: 13px; font-weight: 500; color: var(--text-strong); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.approval-title .cell-mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; color: var(--text-tertiary); }
.approval-meta { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.approval-amt { font-size: 14px; font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.approval-actions { display: flex; gap: 6px; flex-shrink: 0; justify-content: flex-end; }
.approval-right { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; margin-left: 12px; }
.approval-right .approval-amt { margin-bottom: 6px; text-align: right; }

/* 账户卡片 */
.account-card { background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 16px 18px; transition: box-shadow var(--t-base) var(--ease); }
.account-card:hover { box-shadow: var(--shadow-md); }
.account-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.account-bank-logo { width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--brand-weak); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.account-bank-logo.green { background: var(--success-bg); color: var(--success); }
.account-bank-logo.amber { background: var(--warning-bg); color: var(--warning); }
.account-name { font-size: 13px; font-weight: 600; color: var(--text-strong); }
.account-sub { font-size: 11px; color: var(--text-tertiary); font-family: ui-monospace, Menlo, Consolas, monospace; }
.account-balance { font-size: 20px; font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; letter-spacing: -0.3px; margin-bottom: 2px; }
.account-balance small { font-size: 12px; font-weight: 500; color: var(--text-tertiary); margin-right: 2px; }
.account-change { font-size: 11px; color: var(--text-tertiary); }
.account-change b { font-weight: 600; }
.account-change b.up { color: var(--success); }
.account-change b.down { color: var(--danger); }

/* 报表卡 */
.report-card { display: flex; flex-direction: column; gap: 10px; }
.report-card-head { display: flex; align-items: center; gap: 10px; }
.report-card-icon { width: 34px; height: 34px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.report-card-icon svg { width: 17px; height: 17px; }
.report-card-title { font-size: 13px; font-weight: 600; color: var(--text-strong); }
.report-card-desc { font-size: 11px; color: var(--text-tertiary); }
.report-card-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; border-top: 1px solid rgba(24, 42, 68, 0.045); }
.report-card-date { font-size: 11px; color: var(--text-tertiary); }

/* 16. 分页 */
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 4px; padding-top: 14px; }
.pagination-info { font-size: 12px; color: var(--text-tertiary); margin-right: auto; font-variant-numeric: tabular-nums; }
.page-btn {
  min-width: 32px; height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500;
  color: var(--text-secondary);
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.page-btn svg { width: 14px; height: 14px; }
.page-btn:hover { background: var(--surface-2); color: var(--text-strong); }
.page-btn.active { background: var(--brand); color: var(--on-brand); }

/* 17. Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab {
  padding: 8px 14px;
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  position: relative;
  transition: color var(--t-fast) var(--ease);
}
.tab:hover { color: var(--text-strong); }
.tab.active { color: var(--brand); font-weight: 600; }
.tab.active::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px;
  height: 2px; border-radius: 1px; background: var(--brand);
}
.tab .count { font-size: 10px; color: var(--text-tertiary); margin-left: 2px; font-variant-numeric: tabular-nums; }
.tab-panel { display: none; animation: fadeSlideIn 0.24s var(--ease); }
.tab-panel.active { display: block; }

/* 18. 空状态 / 骨架 */
.empty-state { text-align: center; padding: 44px 20px; color: var(--text-secondary); }
.empty-state svg { width: 40px; height: 40px; color: var(--text-disabled); margin-bottom: 12px; }
.empty-state h3 { font-size: 14px; font-weight: 600; color: var(--text-strong); margin-bottom: 4px; }
.empty-state p { font-size: 12px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* 19. 浮层 */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: var(--overlay);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.24s var(--ease);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%; max-width: 540px;
  max-height: 82vh; overflow-y: auto;
  padding: 20px 22px;
  opacity: 0; transform: translateY(10px) scale(0.985);
  transition: opacity 0.26s var(--ease), transform 0.26s var(--ease);
}
.modal-overlay.open .modal { opacity: 1; transform: translateY(0) scale(1); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-title { font-size: 16px; font-weight: 700; color: var(--text-strong); }
.modal-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.modal-close {
  width: 30px; height: 30px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.modal-close:hover { background: var(--surface-hover); color: var(--text-strong); }
.modal-close svg { width: 16px; height: 16px; }
.modal-body { margin-bottom: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; }

/* 下拉菜单（右上角操作） */
.menu {
  position: fixed; z-index: 240;
  min-width: 180px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  opacity: 0; transform: translateY(-4px) scale(0.99);
  pointer-events: none;
  transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}
.menu.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.menu-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px;
  font-size: 13px; color: var(--text-primary);
  border-radius: 6px;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.menu-item svg { width: 15px; height: 15px; color: var(--text-tertiary); }
.menu-item:hover { background: var(--surface-hover); color: var(--text-strong); }
.menu-item:hover svg { color: var(--text-strong); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger svg { color: var(--danger); }
.menu-divider { height: 1px; background: var(--border); margin: 4px 2px; }

/* Toast */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 8px;
  background: var(--text-strong);
  color: #fff;
  font-size: 13px; font-weight: 500;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.26s var(--ease), transform 0.26s var(--ease);
  pointer-events: none;
}
.toast svg { width: 15px; height: 15px; }
.toast.show { opacity: 1; transform: translateY(0); }

/* 20. 登录页 */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: var(--canvas);
}
.login-visual {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px 44px;
  background: var(--brand);
  color: var(--on-brand);
  position: relative;
  overflow: hidden;
}
.login-visual::after {
  content: ''; position: absolute; right: -120px; bottom: -120px;
  width: 340px; height: 340px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
}
.login-visual::before {
  content: ''; position: absolute; right: 40px; top: -90px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
}
.login-visual .brand-mark { background: rgba(255, 255, 255, 0.14); box-shadow: none; }
.login-visual-title { font-size: 20px; font-weight: 700; line-height: 1.4; margin-top: 20px; letter-spacing: -0.3px; }
.login-visual-title small { display: block; font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, 0.72); margin-top: 8px; }
.login-visual-foot { position: relative; z-index: 1; font-size: 11px; color: rgba(255, 255, 255, 0.6); }
.login-visual-stats { display: flex; gap: 28px; position: relative; z-index: 1; }
.login-visual-stats b { display: block; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.login-visual-stats span { font-size: 11px; color: rgba(255, 255, 255, 0.7); }
.login-form-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 380px; }
.login-card .brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.login-title { font-size: 20px; font-weight: 700; color: var(--text-strong); letter-spacing: -0.3px; }
.login-desc { font-size: 13px; color: var(--text-secondary); margin: 4px 0 24px; }
.login-extra { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 12px; }
.login-extra a { color: var(--text-secondary); transition: color var(--t-fast) var(--ease); }
.login-extra a:hover { color: var(--brand); }
.login-card .btn { width: 100%; height: 42px; font-size: 14px; }
.login-card .form-group { margin-bottom: 16px; }
.login-hint { display: flex; align-items: center; gap: 8px; background: var(--brand-weak); color: var(--brand); font-size: 12px; padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 18px; }
.login-hint svg { width: 15px; height: 15px; flex-shrink: 0; }

/* 21. 响应式断点 */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1200px) {
  .balance-band { grid-template-columns: 1fr 1fr; }
  .balance-main { grid-row: span 1; }
  .grid-4col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 992px) {
  :root { --sidebar-w: 208px; }
  .grid-2col, .grid-3col, .grid-2eq { grid-template-columns: minmax(0, 1fr); }
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; --topbar-h: 56px; --gutter: 16px; }
  .sidebar { transform: translateX(-100%); transition: transform 0.28s var(--ease); width: 232px; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-backdrop {
    position: fixed; inset: 0; z-index: 95;
    background: var(--overlay);
    opacity: 0; pointer-events: none;
    transition: opacity 0.24s var(--ease);
  }
  .sidebar-backdrop.open { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; }
  .topbar-title { font-size: 14px; }
  .balance-band { grid-template-columns: 1fr; }
  .grid-4col { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .search { width: 100%; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-head-actions { width: 100%; }
  .page-head-actions .btn { flex: 1; }
  .pagination { justify-content: center; }
  .pagination-info { display: none; }
  .filter-bar { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .topbar-actions .icon-btn.hide-sm { display: none; }
  .hide-sm { display: none !important; }
}

@media (max-width: 480px) {
  .page-head-title { font-size: 18px; }
  .balance-value { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
