/* =====================================================================
   记账系统 · 统一样式表 (2026-08-22 重构版)
   单层架构：Token → 基础 → 布局 → 组件 → 页面级 → 响应式 → 打印
   原 5 层迭代（基础/v2/v3/v4/液态玻璃/v5）已合并去重。
   ===================================================================== */

/* ---------- 1. 设计 Token ---------- */
:root {
  /* 色彩（青蓝主调统一，暖金点睛） */
  --primary: #1f4e5f;            /* 深青蓝 */
  --primary-2: #2e6d80;
  --accent: #c8a45c;             /* 暖金点睛：KPI 分隔、高光细节 */
  --bg: #eaf1f3;
  --card: #ffffff;
  --line: #dbe4e9;
  --border: #dbe4e9;             /* 兼容别名，同 --line */
  --bg-soft: #f2f7f8;            /* 兼容别名：银行对账等页面使用 */
  --text: #22303c;
  --muted: #5a6a78;              /* 白底对比度 5.3:1，满足 WCAG AA */
  --ok: #178a63;
  --warn: #c05621;
  --danger: #c0392b;
  --focus-ring: 0 0 0 3px rgba(46, 109, 128, .16);

  /* 阴影（三档统一） */
  --shadow-sm: 0 1px 2px rgba(16, 26, 40, .04), 0 1px 6px rgba(16, 26, 40, .05);
  --shadow-md: 0 4px 12px rgba(16, 26, 40, .08), 0 2px 4px rgba(16, 26, 40, .05);
  --shadow-lg: 0 16px 40px rgba(16, 26, 40, .14);

  /* 圆角（三档 + 胶囊） */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius: 12px;                /* 兼容别名，同 --radius-md */
  --radius-full: 999px;

  /* 动效 */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.22, .8, .36, 1);
  --ring: 0 0 0 3px rgba(46, 109, 128, .18);

  /* 玻璃质感（伪玻璃：半透白 + 顶部 1px 内高光；真 blur 仅 sidebar/modal/toast/login） */
  --glass-blur: 16px;

  /* 兼容别名：dashboard 等模板内嵌样式引用 */
  --glass-bg: rgba(255, 255, 255, .72);
  --glass-bg-strong: rgba(255, 255, 255, .86);
  --glass-border: rgba(255, 255, 255, .65);
  --glass-shadow: 0 8px 32px rgba(31, 78, 95, .10), inset 0 1px 0 rgba(255, 255, 255, .95);
  --glass-hover: 0 14px 40px rgba(31, 78, 95, .16), inset 0 1px 0 rgba(255, 255, 255, 1);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, .95);
  --glass-focus: rgba(46, 109, 128, .20);
  --ring-soft: 0 0 0 3px rgba(46, 109, 128, .14);
  --font-num: "SF Mono", "Cascadia Mono", Consolas, "Roboto Mono", monospace;
}

/* ---------- 2. 基础 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  display: flex;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* 液态玻璃底色：青蓝主调统一 + 底部一丝暖金点睛，纯渐变无 blur，开销低 */
  background:
    radial-gradient(1200px 620px at 85% -10%, rgba(78, 178, 197, .22), transparent 55%),
    radial-gradient(900px 520px at -8% 105%, rgba(46, 140, 160, .14), transparent 55%),
    radial-gradient(760px 420px at 55% 118%, rgba(200, 164, 92, .10), transparent 58%),
    linear-gradient(160deg, #e9f1f3 0%, #edf3f4 42%, #e6eef1 100%);
}
/* 键盘用户跳过侧边栏直达主内容 */
.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 9999;
  padding: 8px 16px; border-radius: var(--radius-sm);
  background: var(--primary); color: #fff; font-size: 14px; text-decoration: none;
}
.skip-link:focus { left: 8px; }

/* 全局过渡（统一节奏） */
.btn, .chip, .tab, .sidebar nav a, .dash-card, .grid tbody tr,
.ledger-row select, .ledger-row .amt, input, select, .tag, .check-label,
.logout, .amt-inline, .tabs a {
  transition: all .18s var(--ease);
}

/* ---------- 3. 侧边栏（深色玻璃，全站唯一常驻 blur 表面） ---------- */
.sidebar {
  width: 210px;
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  padding: 20px 14px 14px;
  color: #e8f0f3;
  background: linear-gradient(180deg, rgba(22, 50, 61, .88), rgba(31, 78, 95, .92));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border-right: 1px solid rgba(255, 255, 255, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), 6px 0 24px rgba(31, 78, 95, .10);
}
.brand {
  font-size: 18px; font-weight: 600; letter-spacing: 1px;
  padding: 4px 10px 14px;
  background: linear-gradient(90deg, #fff, #bfe6da);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.sidebar nav {
  display: flex; flex-direction: column; gap: 1px;
  flex: 1 1 auto;
  min-height: 0;                 /* 允许子元素收缩 → 内部可滚动 */
  overflow-y: auto;
  overscroll-behavior: contain;  /* 滚动到底不带动页面 */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.25) transparent;
  padding-right: 2px;
}
.sidebar nav::-webkit-scrollbar { width: 5px; }
.sidebar nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: 3px; }
.sidebar nav::-webkit-scrollbar-track { background: transparent; }
.sidebar nav .nav-group {
  font-size: 10px; letter-spacing: 1.5px;
  color: rgba(255, 255, 255, .36);
  padding: 12px 12px 4px;
  user-select: none;
  flex-shrink: 0;
}
.sidebar nav a {
  position: relative;
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px;
  border-radius: 8px;
  color: #cfe0e7; text-decoration: none;
  font-size: 13px; font-weight: 500;
  flex-shrink: 0;
}
.sidebar nav a .nav-ico { font-size: 14px; opacity: .9; flex-shrink: 0; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .08); transform: translateX(2px); }
.sidebar nav a:focus-visible {
  outline: 2px solid #9fd8cb; outline-offset: -2px;
  background: rgba(255, 255, 255, .08);
}
.sidebar nav a.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .10));
  border: 1px solid rgba(255, 255, 255, .16);
  color: #fff; font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 2px 10px rgba(0, 0, 0, .16);
}
.sidebar nav a.active::before {
  content: "";
  position: absolute; left: -1px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #9fe8d6, var(--accent));
}
.side-foot {
  border-top: 1px solid rgba(255, 255, 255, .12);
  padding-top: 10px; margin-top: 8px;
}
.side-date { color: #a8c2ce; font-size: 12px; padding: 4px 12px 10px; }
.logout {
  color: #9fb8c4; font-size: 13px; text-decoration: none;
  padding: 10px 12px; display: inline-block;
}
.logout:hover { color: #fff; transform: translateX(2px); }

/* ---------- 4. 主区布局 ---------- */
.main {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 40px;
}
.page-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.page-head h1 {
  position: relative;
  padding-left: 14px;
  font-size: 23px; font-weight: 600; letter-spacing: .3px;
  color: #14424f;
}
.page-head h1::before {
  content: "";
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; border-radius: 3px;
  background: linear-gradient(180deg, var(--primary-2), var(--primary));
}
.muted { color: var(--muted); font-weight: normal; font-size: 14px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chk { display: inline-flex; align-items: center; gap: 5px; font-size: 13px;
       color: #4a5a68; cursor: pointer; white-space: nowrap; }
.chk input { cursor: pointer; }
.dual-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 4px; }
.dual-col {
  background: rgba(255, 255, 255, .88);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
}
.attach-list { margin-top: 4px; display: flex; flex-direction: column; gap: 2px; }
.attach-link { font-size: 12px; color: var(--primary-2); text-decoration: none;
               word-break: break-all; display: inline-block; }
.attach-link:hover { text-decoration: underline; }
.sec-title { font-size: 17px; font-weight: 600; color: #164a58; letter-spacing: .3px;
             margin: 26px 0 12px; }
.sec-title .btn { margin-left: 10px; }

/* ---------- 5. 按钮（唯一定义） ---------- */
.btn {
  display: inline-block;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(219, 228, 233, .9);
  background: rgba(255, 255, 255, .82);
  color: var(--text);
  font-size: 14px; font-weight: 500; letter-spacing: .2px;
  font-family: inherit;
  text-decoration: none; cursor: pointer;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .95);
  transition: transform .16s var(--ease), box-shadow .16s var(--ease),
              border-color .16s, color .16s, background .16s;
}
.btn:hover {
  border-color: var(--primary-2); color: var(--primary-2);
  background: #fff;
  transform: translateY(-1px); box-shadow: var(--shadow-md), inset 0 1px 0 #fff;
}
.btn:active { transform: translateY(0) scale(.98); box-shadow: var(--shadow-sm); }
.btn:focus-visible { outline: none; box-shadow: var(--ring), var(--shadow-sm); }
.btn:disabled, .btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; }
.btn.primary {
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  border-color: transparent; color: #fff;
  box-shadow: 0 2px 8px rgba(31, 78, 95, .28), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.btn.primary:hover {
  background: linear-gradient(135deg, #3a7f94, #2a6073);
  color: #fff;
  box-shadow: 0 4px 14px rgba(31, 78, 95, .34), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.btn.primary:active { box-shadow: 0 1px 4px rgba(31, 78, 95, .3); }
.btn.danger { color: var(--danger); border-color: #f0c4bf; }
.btn.danger:hover { background: #fdf1f0; border-color: var(--danger); color: var(--danger);
                    box-shadow: 0 2px 8px rgba(192, 57, 43, .18); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.big { font-size: 15px; padding: 11px 22px; }
/* 提交中 loading（JS 配合：文字透明 + 旋转指示） */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn-loading::after {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 15px; height: 15px; margin: -7.5px 0 0 -7.5px;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin .7s linear infinite;
}
.btn-loading:not(.primary)::after {
  border-color: rgba(31, 78, 95, .25); border-top-color: var(--primary-2);
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ---------- 6. 表单控件 ---------- */
input[type=text], input[type=password], input[type=number], input[type=date],
select, textarea {
  padding: 8px 12px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit;
  background: #fff; color: var(--text);
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary-2);
  box-shadow: var(--focus-ring);
}
input::placeholder, textarea::placeholder { color: #8a97a3; }
input[type=checkbox], input[type=radio] { cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; color: var(--muted); }
.field[hidden] { display: none !important; }  /* tab 切换时必须真正隐藏 */
.field-ops { display: flex; gap: 8px; align-items: center; }
.form-foot { margin-top: 16px; display: flex; justify-content: flex-end; }

/* 必填标记 */
.req { color: var(--danger); font-weight: 600; margin-left: 2px; }

/* 输入框填充态（有值时的微妙底色变化） */
input:not(:placeholder-shown):not([type=file]):not([type=checkbox]):not([type=radio]),
select:not([value=""]):not(:invalid) {
  background: #fcfdfd;
}

/* 可搜索下拉（SearchSelect 组件） */
.ss { position: relative; }
.ss-input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; font-size: 14px; outline: none; box-sizing: border-box;
  min-height: 38px;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.ss-input:focus {
  border-color: var(--primary-2);
  box-shadow: var(--focus-ring);
  background: #fcfdfd;
}
.ss-input:not(:placeholder-shown) { background: #fcfdfd; }
.ss-options {
  position: absolute; z-index: 50; top: calc(100% + 4px); left: 0; right: 0;
  max-height: 230px; overflow: auto;
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .70);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .95);
  margin: 0; padding: 4px; list-style: none;
  animation: ss-drop .16s var(--ease-out);
}
@keyframes ss-drop {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.ss-options li {
  padding: 8px 10px; border-radius: 6px; cursor: pointer;
  font-size: 13px; line-height: 1.4;
  transition: background .12s, color .12s;
}
.ss-options li:hover,
.ss-options li.sel {
  background: rgba(46, 109, 128, .10); color: var(--primary-2);
}
.ss-options li.ss-empty { color: var(--muted); cursor: default; }
.ss-options li.ss-empty:hover { background: transparent; }

/* 文件上传 chip */
.file-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.file-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(46, 109, 128, .08); border: 1px solid rgba(46, 109, 128, .18);
  border-radius: var(--radius-full); padding: 4px 12px;
  font-size: 12px; color: var(--primary-2);
  animation: chip-in .2s var(--ease-out);
}
.file-chip::before { content: "📎"; font-size: 11px; }
@keyframes chip-in {
  from { opacity: 0; transform: scale(.9); }
  to { opacity: 1; transform: scale(1); }
}

/* 收款 / 导入表单 */
.income-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.income-form .field-ops { margin-left: auto; }
.income-form .field input, .income-form .field select { width: 100%; }
.import-form { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.import-form .field { flex: 1; min-width: 200px; margin-bottom: 0; }

/* 期初余额等行内金额输入 */
.amt-inline {
  width: 130px; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 13px; text-align: right; outline: none;
  background: #fff; min-height: 0;
}
.amt-inline:focus { border-color: var(--primary-2); box-shadow: var(--focus-ring); }

/* ---------- 7. 统计卡 / 仪表卡 ---------- */
.stat-strip { display: flex; gap: 14px; margin-bottom: 20px; }
.stat, .dash-card {
  position: relative; overflow: hidden;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(255, 255, 255, .60);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .95);
  transition: transform .2s var(--ease-out), box-shadow .2s ease,
              border-color .2s, background .2s;
}
.stat:hover, .dash-card:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 1);
  border-color: rgba(46, 109, 128, .30);
}
.stat {
  display: flex; flex-direction: column; gap: 2px;
  padding: 16px 22px; min-width: 160px;
}
.stat::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--primary-2), rgba(46, 109, 128, .35));
  border-radius: 0 3px 3px 0;
}
.stat label { display: block; color: var(--muted); font-size: 12px;
              letter-spacing: .6px; margin-bottom: 4px; font-weight: 500; }
.stat strong {
  font-size: 24px; font-weight: 600; letter-spacing: -.5px;
  color: var(--primary-2);
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}
.stat strong.pos { color: var(--ok); }
.stat strong.neg { color: var(--danger); }
.dash-card { border-left: 3px solid var(--primary-2); padding: 18px 20px; }
.dash-card:has(.dash-val.up) { border-left-color: var(--ok); }
.dash-card:has(.dash-val.down) { border-left-color: var(--danger); }
.dash-val {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.dash-val.up { color: var(--ok); }
.dash-val.down { color: var(--danger); }

/* ---------- 8. 表格 ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.grid {
  width: 100%; border-collapse: collapse;
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(255, 255, 255, .60);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .95);
}
.grid th, .grid td { padding: 11px 14px; text-align: left; font-size: 14px;
  border-bottom: 1px solid rgba(31, 78, 95, .08); }
.grid th {
  background: rgba(31, 78, 95, .05); color: #4a5a68;
  font-weight: 600; font-size: 12px; letter-spacing: .8px;
  padding: 10px 14px;
}
.grid tr:last-child td { border-bottom: none; }
.grid tbody tr { transition: background .18s var(--ease-out); }
.grid tbody tr:hover { background: rgba(46, 109, 128, .07);
                       box-shadow: inset 3px 0 0 var(--primary-2); }
.grid tbody tr.row-main { cursor: pointer; }
.grid a { color: var(--primary-2); }
.grid a:hover { color: var(--primary); text-decoration: underline; }
.num { text-align: right; font-family: var(--font-num);
       font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.mono { font-family: var(--font-num); }
.empty { text-align: center; color: var(--muted); padding: 48px 20px !important;
         font-size: 13px; letter-spacing: .4px; }
.empty::before {
  content: "◌"; display: block;
  font-size: 36px; margin-bottom: 12px; opacity: .35; color: var(--primary-2);
  animation: empty-pulse 2.4s ease-in-out infinite;
}
@keyframes empty-pulse {
  0%, 100% { opacity: .25; transform: scale(1); }
  50% { opacity: .45; transform: scale(1.08); }
}
.row-void { opacity: .5; }
.sub-row { color: var(--muted); }
td.warn { color: var(--warn); font-weight: 500; }
.total-row td {
  font-weight: 600; background: rgba(31, 78, 95, .05); text-align: right;
  border-top: 1px solid rgba(31, 78, 95, .14);
  font-family: var(--font-num); font-variant-numeric: tabular-nums;
}
.total-row td:first-child { text-align: center; }
.total-row .cell { text-align: center; }

/* ---------- 9. 状态标签 ---------- */
.tag {
  display: inline-block; padding: 3px 11px;
  border-radius: var(--radius-full);
  font-size: 12px; font-weight: 500; letter-spacing: .3px;
  background: #eef3f6; color: #4a5a68;
}
.tag.待复核 { background: #fff7e6; color: #8a5410; }
.tag.已确认, .tag.已生成, .tag.已匹配, .tag.已完成 { background: #e6f6ee; color: #14603f; }
.tag.已核销 { background: #e3eef9; color: #1d5fa8; }
.tag.作废 { background: #f8ecea; color: var(--danger); }
.tag.摊销 { background: #e8f1fb; color: #1d5fb8; }
.tag.折旧 { background: #f0eefb; color: #4c38a8; }
.tag.收入 { background: #e6f6ee; color: #1d7a4f; }
.tag.支出 { background: #fdf3e8; color: #8a4c14; }
.tag.未匹配 { background: #f6f4ee; color: #6e562c; }
.tag.部分匹配 { background: #fff7e6; color: #8a5410; }
.tag.忽略 { background: #f0f0f3; color: #5b5b66; }
.dup-badge {
  display: inline-block; margin-left: 6px; padding: 1px 8px;
  border-radius: var(--radius-full); font-size: 11px; font-weight: 600;
  background: #fdecea; color: var(--danger);
}

/* ---------- 10. 面板 ---------- */
.panel {
  background: rgba(255, 255, 255, .80);
  border: 1px solid rgba(255, 255, 255, .60);
  border-radius: var(--radius-lg);
  padding: 20px; margin-bottom: 20px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .95);
  transition: box-shadow .2s var(--ease), background .2s, border-color .2s;
}
.panel:hover {
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 1);
  background: rgba(255, 255, 255, .88);
}
.panel h2 {
  font-size: 16px; font-weight: 600; color: #164a58;
  letter-spacing: .2px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.panel h2 .hint { margin: 0 0 0 2px; font-weight: 400; }
.panel h2 .tag { margin-left: 4px; }
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
/* 可搜索下拉所在面板：放开溢出并提升层级，避免下拉列表被裁剪 */
.panel-ss { overflow: visible; z-index: 60; }
.panel:has(.ss) { overflow: visible; z-index: 60; }
.hint { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.hint a { color: var(--primary-2); }
.hint a:hover { color: var(--primary); text-decoration: underline; }

/* ---------- 11. 复核 / 分录编辑器 ---------- */
.trace-line { margin: 10px 0 2px; font-size: 13px; line-height: 1.7; }
.trace-line a { color: var(--primary-2); text-decoration: none; font-weight: 600; }
.trace-line a:hover { text-decoration: underline; }
.snap-hl td:first-child { font-weight: 600; color: var(--primary-2); }
.audit-bar { display: flex; align-items: center; gap: 10px; margin: 12px 0 6px; flex-wrap: wrap; }
.audit-bar select { max-width: 170px; }
.audit-more { color: var(--muted); font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  border: 1px solid var(--line); background: rgba(255, 255, 255, .8); color: #33414d;
  border-radius: 14px; padding: 3px 12px; font-size: 12.5px; cursor: pointer;
  transition: all .16s var(--ease);
}
.chip:hover {
  border-color: var(--primary-2); color: var(--primary-2); background: #fff;
  box-shadow: var(--shadow-sm);
}
.chip:active { transform: scale(.96); }
.chip:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 2px; }
.check-label {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: var(--radius-full);
  padding: 5px 14px; font-size: 13px; cursor: pointer;
  background: rgba(255, 255, 255, .8);
  transition: all .16s var(--ease);
}
.check-label:hover { border-color: var(--primary-2); background: #fff; box-shadow: var(--shadow-sm); }
.check-label:has(input:checked) {
  border-color: var(--primary-2); background: rgba(46, 109, 128, .08); color: var(--primary-2);
  font-weight: 500;
}
.check-label input { accent-color: var(--primary); }
.row-edit td { background: rgba(31, 78, 95, .03); padding: 14px 16px; border-top: none;
               animation: row-expand .22s var(--ease-out); }
@keyframes row-expand {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.row-edit-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.row-edit-form .field input, .row-edit-form .field select {
  padding: 7px 10px; font-size: 13px; min-height: 34px;
}
.row-edit-form .field select { min-width: 170px; }
.row-edit-form .field-ops { margin-left: auto; }
.row-edit-hint { margin-top: 10px; font-size: 12.5px; color: var(--warn); }
.field-summary { width: 100%; }
.field-summary input { width: 100%; }
/* 主行展开高亮 */
tr.row-main:has(+ tr.row-edit:not([hidden])) { background: #eef6f3; }
tr.row-main:has(+ tr.row-edit:not([hidden])) td { border-bottom-color: transparent; }

.ledger { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; width: 100%; }
.ledger-side { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; }
.ledger-title {
  font-size: 13px; font-weight: 600; color: var(--primary-2);
  margin-bottom: 8px; letter-spacing: 1px;
}
.ledger-rows { display: flex; flex-direction: column; gap: 7px; margin-bottom: 8px; }
.ledger-row { display: flex; gap: 8px; align-items: center; }
.ledger-row select {
  flex: 1; padding: 7px 10px; min-height: 34px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 13px; background: #fff; outline: none;
}
.ledger-row .amt {
  width: 108px; padding: 7px 10px; min-height: 34px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 13px; text-align: right; outline: none;
  font-variant-numeric: tabular-nums;
}
.ledger-row select:focus, .ledger-row .amt:focus {
  border-color: var(--primary-2); box-shadow: var(--focus-ring);
}
.row-del {
  width: 26px; height: 26px; border: 1px solid #f0c4bf; border-radius: 6px;
  background: #fdf1f0; color: var(--danger); font-size: 14px; line-height: 1;
  cursor: pointer; flex-shrink: 0;
}
.row-del:hover { background: var(--danger); color: #fff; }
.row-del:focus-visible { outline: 2px solid var(--danger); outline-offset: 2px; }
.ledger-total {
  font-size: 13px; color: #33414d; font-weight: 600; margin-top: 8px;
  font-variant-numeric: tabular-nums;
}
.balance-bar {
  width: 100%; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px;
  background: #f0f3f6; color: var(--muted);
  transition: background .3s var(--ease), color .3s var(--ease);
}
.balance-bar.ok { background: #e6f6ee; color: #14603f; font-weight: 500; }
.balance-bar.err { background: #fdf1f0; color: var(--danger); font-weight: 500; }

/* ---------- 12. 摊销期次进度 ---------- */
.row-progress td { background: #fafbfc; border-bottom: 1px dashed var(--line); }
.period-wrap { padding: 2px 0; }
.period-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.period-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.period-cell {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; font-size: 12px; color: var(--text); text-decoration: none;
}
.period-cell input[type=checkbox] { margin: 0; accent-color: #2f9e64; pointer-events: none; }
.period-cell.done { border-color: #b8dfc6; background: #f0faf3; color: #1f7a46; }
.period-cell.cost { border-color: #b8d0e8; background: #f0f6fc; color: #245a8a; }
.period-cell.future { opacity: .5; }
.period-cell.open { border-color: #f0d9a8; background: #fffaf0; color: #9a6a1a; }
.progress-bar { flex: 1; height: 8px; border-radius: 4px; background: #edf0f2; overflow: hidden; }
.progress-bar i { display: block; height: 100%; background: linear-gradient(90deg, #34a853, #2f9e64); }

/* ---------- 13. 凭证版式 ---------- */
.voucher-sheet {
  background: #fff; border: 1.5px solid #1f2a33; border-radius: 0;
  padding: 26px 28px; box-shadow: none;
  /* A5 横向纸面观感：横宽比例固定 210:148，与下载 PDF 一致。
     多行分录/长摘要内容超高时由详情页脚本整体缩放适配（不改变 A5 比例） */
  max-width: 794px; margin: 0 auto;
  aspect-ratio: 210 / 148;
}
.voucher-title {
  text-align: center; font-size: 22px; font-weight: 700;
  letter-spacing: 10px; color: #1f2a33; margin-bottom: 6px;
}
.voucher-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 4px 10px; margin-bottom: 12px;
  border-bottom: 2px solid #1f2a33;
}
.voucher-no { font-size: 14px; }
.voucher-no b { font-family: var(--font-num); }
.voucher-date { font-size: 14px; letter-spacing: 1px; }
.entry-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.entry-grid th, .entry-grid td {
  border: 1px solid #1f2a33; padding: 9px 12px; font-size: 14px; height: 34px;
}
.entry-grid th { background: #f6f8fa; font-weight: 600; text-align: center; }
.entry-grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
.entry-grid td.amt {
  text-align: right; font-size: 14px; padding-right: 14px;
  font-family: var(--font-num); font-variant-numeric: tabular-nums;
}
.entry-grid td.amt.red { color: #c33; }
.entry-grid td.mark { color: #2e9e5b; font-weight: 700; font-size: 15px; }
.total-row td { font-weight: 700; background: #f6f8fa; text-align: right; }
.voucher-amount {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid #1f2a33; border-top: none;
  padding: 10px 12px; font-size: 14px;
}
.amount-label { color: var(--muted); }
.amount-cn { font-weight: 700; letter-spacing: 1px; }
.voucher-foot { display: flex; justify-content: space-between; align-items: flex-end;
  margin-top: 18px; gap: 20px; }
.foot-attach { font-size: 14px; color: #22303c; }
.foot-attach b { font-family: var(--font-num); }
.sign-area {
  display: flex; gap: 30px; font-size: 13px; color: var(--muted);
  border-top: 1px solid #1f2a33; padding-top: 26px;
}
.sign-cell { min-width: 52px; text-align: center; line-height: 1.9; }
.sign-name { font-weight: 700; color: #1f2a33; font-size: 14px; letter-spacing: 2px; }
.signer-label { display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
  font-size: 14px; color: #33414d; }
.signer-label input { flex: 1; }
.voucher-meta { font-size: 13px; color: var(--muted); margin-top: 16px; line-height: 1.8; }
.danger-form { margin-top: 16px; }

/* ---------- 14. 报表 Tab / 进度条 ---------- */
.tab-bar {
  display: flex; gap: 2px; background: rgba(31, 78, 95, .06);
  padding: 5px; border-radius: var(--radius-md); margin-bottom: 18px;
  flex-wrap: wrap; border: 1px solid rgba(31, 78, 95, .08);
}
.tab {
  padding: 8px 20px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
  color: var(--muted); text-decoration: none; border: none; background: transparent;
  font-family: inherit; cursor: pointer;
  transition: color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
}
.tab:hover:not(.active) {
  color: var(--primary-2); background: rgba(255, 255, 255, .65);
}
.tab.active {
  background: linear-gradient(135deg, rgba(46, 109, 128, .95), rgba(31, 78, 95, .95));
  color: #fff; font-weight: 600;
  box-shadow: 0 3px 10px rgba(31, 78, 95, .25), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.tab:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 2px; }
.bar { display: inline-block; width: 90px; height: 8px; background: #eef1f4;
  border-radius: 4px; vertical-align: middle; margin-right: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--primary-2);
         transition: width .4s var(--ease-out); }

/* ---------- 15. 银行流水对账 ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs a {
  padding: 6px 14px; border-radius: var(--radius-full);
  border: 1px solid var(--border); color: var(--muted);
  font-size: 13px; background: var(--card); text-decoration: none;
}
.tabs a:hover { border-color: var(--primary-2); color: var(--primary-2);
                transform: translateY(-1px); }
.tabs a.active { background: var(--primary); border-color: var(--primary);
                 color: #fff; font-weight: 600; }
.sm { font-size: 12px; color: var(--muted); }
.link { color: var(--primary-2); text-decoration: none; }
a.link:hover { text-decoration: underline; }
.ellipsis { max-width: 180px; overflow: hidden; text-overflow: ellipsis;
            white-space: nowrap; display: inline-block; vertical-align: bottom; }
.ops-cell { white-space: nowrap; }
.linked { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 4px; }
.match-row > td { padding: 0 !important; background: var(--bg-soft); }
.match-cell { padding: 0 !important; }
.match-block { padding: 14px 18px; border-left: 3px solid var(--primary);
               background: rgba(255, 255, 255, .88); }
.match-hd { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.match-group { margin-top: 10px; }
.match-title { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.cand-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--card); margin-bottom: 6px;
  cursor: pointer;
}
.cand-row:hover { border-color: var(--primary-2); }
.cand-row input[type=checkbox] { width: 16px; height: 16px; }
.cand-amt {
  width: 96px; padding: 4px 8px; border: 1px solid var(--border);
  border-radius: 6px; font-variant-numeric: tabular-nums; text-align: right;
}
.group-row { background: var(--bg-soft); }

/* ---------- 16. 提示条 / 状态文字 ---------- */
.notice {
  display: flex; align-items: flex-start; gap: 10px;
  background: #e6f6ee; color: #14603f; padding: 13px 18px; border-radius: var(--radius-md);
  margin-bottom: 18px; font-size: 14px; word-break: break-all;
  box-shadow: inset 3px 0 0 rgba(26, 157, 110, .35), var(--shadow-sm);
  animation: notice-in .3s var(--ease-out);
}
.notice::before { content: "ℹ"; flex-shrink: 0; font-size: 16px; font-weight: 700;
                  line-height: 1.6; opacity: .7; }
.notice a { color: #14603f; font-weight: 600; }
.notice.ok { background: #e6f6ee; color: #14603f;
             box-shadow: inset 3px 0 0 rgba(26, 157, 110, .35), var(--shadow-sm); }
.notice.ok::before { content: "✓"; }
.notice.warn { background: #fff7e0; color: #7a5410; border: 1px solid #eed484;
               box-shadow: inset 3px 0 0 rgba(192, 86, 33, .4), var(--shadow-sm); }
.notice.warn::before { content: "⚠"; }
.notice.err, .notice.dup-warn {
  background: #fdf1f0; color: #a03a2a; border: 1px solid #f2b8ad;
  box-shadow: inset 3px 0 0 rgba(192, 57, 43, .4), var(--shadow-sm);
}
.notice.err::before, .notice.dup-warn::before { content: "✕"; }
@keyframes notice-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.error { color: var(--danger); font-size: 13px; }
.pos { color: #16a34a; }
.neg { color: var(--danger); }
.edit-cell { width: 60px; }
.edit-box { margin-top: 12px; padding: 12px; background: #f8fafb;
  border: 1px dashed var(--line); border-radius: var(--radius-sm); }
.edit-box summary { cursor: pointer; color: var(--primary-2); font-size: 13px; }
.mapping-form { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- 17. Toast / 确认弹窗 ---------- */
#toast-wrap {
  position: fixed; top: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .70);
  border-left: 4px solid var(--primary-2);
  color: var(--text);
  padding: 12px 18px; border-radius: 10px; font-size: 14px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .95);
  display: flex; align-items: center; gap: 10px;
  opacity: 0; transform: translateX(24px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
  max-width: 340px;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--primary-2); }
.toast .t-ico { font-size: 16px; flex-shrink: 0; }
.toast.ok .t-ico { color: var(--ok); }
.toast.err .t-ico { color: var(--danger); }
.toast span:last-child { line-height: 1.5; }

.modal-overlay {
  position: fixed; inset: 0; z-index: 9990;
  background: rgba(16, 26, 40, .40);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .18s var(--ease);
}
.modal-overlay.show { opacity: 1; }
.modal {
  background: rgba(255, 255, 255, .90);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, .70);
  border-radius: var(--radius-lg);
  padding: 24px; width: 360px; max-width: 92vw;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .95);
  transform: translateY(10px) scale(.98);
  transition: transform .2s var(--ease);
}
.modal-overlay.show .modal { transform: translateY(0) scale(1); }
.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 10px; }
.modal-text { font-size: 14px; color: var(--muted); line-height: 1.7;
              margin-bottom: 22px; word-break: break-all; }
.modal-ops { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- 18. 登录页 ---------- */
.login-body {
  min-height: 100vh; display: flex; position: relative;
  align-items: center; justify-content: center;
  background:
    radial-gradient(560px 420px at 88% 6%, rgba(64, 168, 190, .22), transparent 62%),
    radial-gradient(520px 420px at 8% 94%, rgba(64, 190, 140, .20), transparent 62%),
    linear-gradient(135deg, #16323d, #1f4e5f);
}
.login-card {
  position: relative; z-index: 1;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 20px;
  padding: 40px 34px; width: 360px; max-width: 90vw;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  text-align: center;
  animation: login-in .5s var(--ease);
}
@keyframes login-in {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.login-card .brand {
  font-size: 21px; color: var(--primary); padding: 0 0 8px;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.login-sub { color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.login-card input { width: 100%; margin-bottom: 14px; padding: 11px 14px;
                    text-align: center; }
.login-card button {
  width: 100%; margin-top: 14px; padding: 11px 0;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  color: #fff; border: none; border-radius: 10px;
  font-size: 15px; font-family: inherit; cursor: pointer;
  box-shadow: 0 8px 22px rgba(31, 78, 95, .30);
  transition: transform .16s var(--ease), box-shadow .16s var(--ease);
}
.login-card button:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(31, 78, 95, .36); }
.login-card button:active { transform: translateY(0) scale(.98); }
.login-card button:focus-visible { outline: 2px solid #9fd8cb; outline-offset: 2px; }
.login-card .error { color: var(--danger); margin: 10px 0 0; font-size: 13px; }
.login-foot {
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted); letter-spacing: .3px;
}

/* ---------- 19. 移动端导航 ---------- */
.nav-toggle {
  display: none; position: fixed; top: 12px; left: 12px; z-index: 120;
  width: 42px; height: 42px; border: none; border-radius: 10px;
  background: var(--primary); color: #fff; font-size: 20px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}
.nav-toggle:focus-visible { outline: 2px solid #9fd8cb; outline-offset: 2px; }
.nav-scrim {
  display: none; position: fixed; inset: 0; z-index: 105;
  background: rgba(16, 26, 40, .35);
  opacity: 0; transition: opacity .22s var(--ease);
}
.nav-scrim.show { opacity: 1; }

/* ---------- 20. 骨架屏 / 滚动条 ---------- */
.skel {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, #eef1f4 25%, #f7f9fb 37%, #eef1f4 63%);
  background-size: 400% 100%;
  animation: skel 1.4s ease infinite;
}
@keyframes skel {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(31, 78, 95, .22); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(31, 78, 95, .34); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 21. 页面进入动效（轻量，最多 100ms 级联） ---------- */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.main > * { animation: rise-in .4s var(--ease-out) both; }
.main > *:nth-child(2) { animation-delay: .03s; }
.main > *:nth-child(3) { animation-delay: .06s; }
.main > *:nth-child(n+4) { animation-delay: .09s; }

/* ---------- 22. 响应式（三断点：≤768 手机 / 769-1180 平板 / ≥1440 大屏） ---------- */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-scrim.show { display: block; }
  body { flex-direction: column; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 240px;
    transform: translateX(-100%); transition: transform .22s var(--ease);
    z-index: 110; padding-top: 64px;
    box-shadow: 2px 0 12px rgba(0, 0, 0, .18);
  }
  .sidebar.open { transform: translateX(0); }
  .main { padding: 16px 12px 40px; max-width: 100%; margin-top: 12px; }
  .page-head h1 { font-size: 19px; }
  .page-head { gap: 10px; }
  .main > * { animation: none; }

  .stat-strip { flex-direction: column; gap: 10px; }
  .stat { min-width: 0; width: 100%; }
  .stat strong { font-size: 18px; }
  .panel-grid, .dual-grid { grid-template-columns: 1fr; gap: 14px; }

  .ledger { grid-template-columns: 1fr; gap: 12px; }
  .ledger-row { flex-wrap: wrap; }
  .ledger-row select { flex-basis: 100%; }
  .ledger-row .amt { width: 100%; flex: 1; }
  .row-edit-form { flex-direction: column; align-items: stretch; gap: 10px; }
  .row-edit-form .field { width: 100%; }
  .field-summary input { font-size: 14px; }

  input[type=text], input[type=password], input[type=number],
  input[type=date], select, textarea { font-size: 16px; min-height: 42px; }
  .btn { min-height: 38px; }
  .btn.small { min-height: 30px; }

  .grid th, .grid td { padding: 8px 10px; }
  .table-scroll { margin: 0 -4px; }

  .income-form { flex-direction: column; align-items: stretch; }
  .income-form .field-ops { margin-left: 0; }

  .tab-bar { gap: 2px; }
  .tab { padding: 7px 12px; font-size: 13px; }
  .amt-inline { width: 100%; }

  .voucher-sheet { overflow-x: auto; padding: 16px 12px; }
  .voucher-title { font-size: 18px; letter-spacing: 6px; }
  .entry-grid { min-width: 640px; }
  .sign-area { flex-wrap: wrap; gap: 16px; }
  .sign-cell { min-width: 44px; }
  .sidebar nav a:hover { transform: none; }
}

@media (min-width: 769px) and (max-width: 1180px) {
  .main { padding: 24px 28px; max-width: 1180px; }
  .stat-strip { gap: 12px; flex-wrap: wrap; }
  .stat { min-width: 0; flex: 1 1 44%; padding: 12px 16px; }
  .grid th, .grid td { padding: 9px 12px; }
  .panel-grid { gap: 16px; }
  .toolbar { flex-wrap: wrap; }
  input[type=text], input[type=password], input[type=number],
  input[type=date], select, textarea { min-height: 40px; }
  .btn { min-height: 36px; }
}

@media (min-width: 1440px) {
  .main { padding: 32px 48px; }
  .stat { padding: 16px 24px; }
}

/* 超小屏（<420px）进一步压缩 */
@media (max-width: 420px) {
  .main { padding: 12px 8px 40px; }
  .panel { padding: 14px; }
  .stat-strip .stat { padding: 10px 14px; }
  .btn.big { width: 100%; }
}

/* ---------- 23. 打印（A5 横向凭证标准版式，左侧留装订边） ---------- */
@media print {
  @page {
    size: A5 landscape;
    margin: 8mm 7mm 10mm 11mm;   /* 左侧留装订边 */
  }
  .sidebar, .toolbar, .danger-form, .page-head, .nav-toggle, .nav-scrim { display: none !important; }
  body { background: #fff; display: block; margin: 0; }
  .main { max-width: 100%; padding: 0; }
  .main > *, .panel, .stat, .dash-card, .btn, .tag, .tab {
    animation: none !important; transform: none !important;
  }
  .voucher-sheet { border: none; box-shadow: none; padding: 0; aspect-ratio: auto; }
  .voucher-title { font-size: 15px; margin-bottom: 3px; letter-spacing: 6px; }
  .voucher-head { padding: 4px 0 5px; margin-bottom: 5px; }
  .voucher-no { font-size: 11px; }
  .voucher-no b { font-size: 12px; }
  .voucher-date { font-size: 11px; letter-spacing: 0; }
  .entry-grid { width: 100%; max-width: 100%; table-layout: fixed; }
  .entry-grid th, .entry-grid td {
    padding: 4px 3px; font-size: 11px; height: auto;
    overflow-wrap: break-word; word-break: break-word;
  }
  .entry-grid th { font-size: 11px; width: auto !important; }
  .entry-grid td.amt { padding: 3px 4px; font-size: 11px; }
  .entry-grid td.mark { font-size: 12px; }
  .total-row td { font-size: 11px; }
  .voucher-amount { padding: 6px 8px; font-size: 11px; gap: 8px; flex-wrap: wrap;
                    max-width: 100%; box-sizing: border-box; }
  .amount-cn { letter-spacing: .5px; word-break: break-word; }
  .voucher-foot { margin-top: 8px; }
  .foot-line { font-size: 11px; }
  .voucher-meta { margin-top: 6px; font-size: 10px; line-height: 1.6; word-break: break-word; }
}

/* ---------- 24. 减弱动态效果偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
