/* ============ 设计变量 ============ */
:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --panel-2: #fafbfe;
  --border: #e5e8f0;
  --border-strong: #d3d9e6;
  --text: #1e2433;
  --text-2: #4b5563;
  --muted: #8b93a7;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-weak: #eef4ff;
  --success: #0f9d58;
  --success-weak: #e9f8f0;
  --warn: #d97706;
  --warn-weak: #fff7e6;
  --danger: #dc2626;
  --danger-weak: #feeceb;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 4px 16px rgba(16, 24, 40, .08);
  --shadow-lg: 0 18px 48px rgba(16, 24, 40, .18);
  /* 正文与数字统一走「系统黑体」：中文 PingFang / 微软雅黑，西文数字 Segoe UI / Helvetica，
     跟企业微信后台一致的观感。数字仍靠 tabular-nums 对齐，不再依赖等宽字体。 */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei",
    "Hiragino Sans GB", "Source Han Sans SC", system-ui, sans-serif;
  --num: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial,
    "PingFang SC", "Microsoft YaHei", sans-serif;
  /* 历史命名保留：--mono 现在指向「比例数字字体」，不是等宽。
     如需真正等宽（对账单号逐位核对），用 --mono-fixed。 */
  --mono: var(--num);
  --mono-fixed: "Consolas", "SF Mono", "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--sans); background: var(--bg); color: var(--text);
  font-size: 13.5px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
a { color: var(--primary); text-decoration: none; }
::selection { background: #cfe0ff; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #c9cfdd; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #aeb6c8; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 登录 ============ */
.login-wrap {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(900px 500px at 15% 0%, #e8f0ff 0%, transparent 60%),
              radial-gradient(700px 500px at 90% 100%, #eef7f1 0%, transparent 60%), var(--bg);
  gap: 22px;
}
.login-card {
  width: 380px; background: var(--panel); border-radius: 16px; padding: 30px 30px 24px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
}
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.login-brand h1 { font-size: 18px; margin: 0; letter-spacing: .3px; }
.login-brand p { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); letter-spacing: .3px; }
.logo {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff;
  font-size: 21px; font-weight: 700; box-shadow: 0 6px 16px rgba(37, 99, 235, .35);
}
.logo.sm { width: 34px; height: 34px; border-radius: 9px; font-size: 16px; }
.login-form { display: flex; flex-direction: column; }
.fl { font-size: 12px; color: var(--text-2); margin: 12px 0 6px; font-weight: 600; }
.login-tip { font-size: 11.5px; color: var(--muted); margin: 14px 0 0; text-align: center; }
.login-remember { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); margin: 12px 0 14px; cursor: pointer; user-select: none; }
.login-remember input { width: 14px; height: 14px; accent-color: var(--primary, #2563eb); cursor: pointer; }
.login-foot { font-size: 11.5px; color: var(--muted); }
.btn.block { width: 100%; justify-content: center; margin-top: 20px; padding: 10px; font-size: 14px; }

/* ============ 骨架 ============ */
.app-shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 208px; flex: 0 0 208px;
  background: linear-gradient(180deg, #16233a 0%, #101a2b 100%);
  display: flex; flex-direction: column; overflow: hidden;
}
.brand {
  display: flex; align-items: center; gap: 10px; padding: 15px 14px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.brand-txt { display: flex; flex-direction: column; min-width: 0; }
.brand-txt b { font-size: 14px; letter-spacing: .5px; color: #fff; }
.brand-txt span { font-size: 10.5px; color: rgba(255, 255, 255, .42); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { flex: 1; overflow-y: auto; padding: 8px 8px 18px; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); }
.nav-group { margin-bottom: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 6px;
  color: #a9b4c8; cursor: pointer; font-size: 13px; position: relative; user-select: none;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #eef3fb; }
.nav-item.active-parent { color: #fff; background: rgba(255, 255, 255, .05); font-weight: 600; }
.nav-item.leaf.active { background: rgba(59, 130, 246, .22); color: #fff; font-weight: 600; }
.nav-item.leaf.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 15px; border-radius: 0 3px 3px 0; background: #4f8cf7;
}
.nav-item .ico { width: 15px; height: 15px; flex: 0 0 15px; opacity: .85; }
.nav-item .chev { margin-left: auto; font-size: 9px; opacity: .5; transition: transform .16s; }
.nav-group.open .nav-item .chev { transform: rotate(90deg); }
.nav-sub { display: none; padding: 2px 0 4px 0; }
.nav-group.open .nav-sub { display: block; }
.nav-sub-item {
  display: flex; align-items: center; padding: 6px 10px 6px 34px; border-radius: 5px;
  color: #97a3b8; cursor: pointer; font-size: 12.5px; position: relative; transition: background .12s, color .12s;
}
.nav-sub-item::before {
  content: ''; position: absolute; left: 21px; top: 50%; width: 4px; height: 4px;
  border-radius: 50%; background: rgba(255, 255, 255, .22);
}
.nav-sub-item:hover { background: rgba(255, 255, 255, .05); color: #e6edf8; }
.nav-sub-item.active { color: #7fb0ff; font-weight: 600; background: rgba(59, 130, 246, .12); }
.nav-sub-item.active::before { background: #4f8cf7; }
/* 进销存合并后的分组标题（采购 / 销售 / 库存），不可点 */
.nav-sub-sep {
  padding: 8px 10px 3px 22px; font-size: 10.5px; letter-spacing: 1px;
  color: rgba(255, 255, 255, .34); user-select: none;
}
.nav-sub-sep:first-child { padding-top: 2px; }
.sidebar-foot { padding: 9px 14px; border-top: 1px solid rgba(255, 255, 255, .07); font-size: 10.5px; color: rgba(255, 255, 255, .32); }

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

/* 顶部多标签 */
.tabbar {
  display: flex; align-items: center; gap: 3px; padding: 6px 12px 0; background: var(--panel);
  border-bottom: 1px solid var(--border); overflow-x: auto; flex: 0 0 auto; min-height: 36px;
}
.tabbar::-webkit-scrollbar { height: 0; }
.tab {
  display: flex; align-items: center; gap: 6px; padding: 5px 10px 6px; border-radius: 6px 6px 0 0;
  font-size: 12.5px; color: var(--text-2); cursor: pointer; white-space: nowrap;
  border: 1px solid transparent; border-bottom: none; position: relative; top: 1px;
}
.tab:hover { background: #f4f6fb; }
.tab.active { background: var(--panel); border-color: var(--border); color: var(--primary); font-weight: 600; }
.tab.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--panel); }
.tab .x { font-size: 13px; color: #b6bdcb; line-height: 1; padding: 0 1px; }
.tab .x:hover { color: var(--danger); }
.tab.pinned { padding-left: 12px; }
.topbar {
  height: 54px; flex: 0 0 54px; background: var(--panel); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
}
.crumb { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; flex: 1; }
.crumb b { color: var(--text); font-weight: 600; font-size: 13.5px; }
.cb-sep { color: #ccd2e0; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.pill {
  font-size: 11.5px; color: var(--text-2); background: var(--panel-2); border: 1px solid var(--border);
  padding: 3px 9px; border-radius: 20px;
}
.user-chip { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.avatar {
  width: 24px; height: 24px; border-radius: 50%; background: var(--primary-weak); color: var(--primary);
  display: grid; place-items: center; font-size: 11.5px; font-style: normal; font-weight: 700;
}
.view { flex: 1; overflow-y: auto; padding: 18px 20px 40px; }

/* ============ 账套切换器（顶部） ============ */
.ledger-switch { position: relative; flex: 0 0 auto; }
.ledger-btn {
  display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px 0 8px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--panel);
  cursor: pointer; font-size: 13px; color: var(--text); max-width: 280px;
}
.ledger-btn:hover { border-color: var(--primary); background: var(--primary-weak); }
.ledger-btn .lg-ico {
  width: 18px; height: 18px; border-radius: 4px; background: var(--primary); color: #fff;
  font-size: 10.5px; display: grid; place-items: center; flex: 0 0 18px;
}
.ledger-btn .lg-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ledger-btn .lg-caret { color: var(--muted); font-size: 10px; }
.ledger-menu {
  position: absolute; top: 38px; left: 0; width: 330px; z-index: 60;
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.lm-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 12px; font-size: 12px; color: var(--muted); background: var(--panel-2);
  border-bottom: 1px solid var(--border);
}
.lm-count { font-variant-numeric: tabular-nums; }
.lm-list { max-height: 300px; overflow-y: auto; padding: 4px; }
.lm-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 9px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px;
}
.lm-item:hover { background: var(--panel-2); }
.lm-item.on { background: var(--primary-weak); }
.lm-item .lm-dot {
  width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--border-strong);
  flex: 0 0 15px; display: grid; place-items: center; font-size: 9px; color: #fff;
}
.lm-item.on .lm-dot { background: var(--primary); border-color: var(--primary); }
.lm-item .lm-txt { flex: 1; min-width: 0; }
.lm-item .lm-txt b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-item .lm-txt span { font-size: 11px; color: var(--muted); }
.lm-foot { border-top: 1px solid var(--border); display: flex; }
.lm-foot button {
  flex: 1; height: 36px; border: none; background: var(--panel-2); cursor: pointer;
  font-size: 12.5px; color: var(--primary); font-family: inherit;
}
.lm-foot button:hover { background: var(--primary-weak); }
.lm-foot button + button { border-left: 1px solid var(--border); color: var(--text-2); }

/* ============ 账套卡片列表 ============ */
.ledger-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.ledger-card {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel);
  padding: 12px 14px; position: relative; transition: box-shadow .15s, border-color .15s;
}
.ledger-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.ledger-card.cur { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-weak) inset; }
.ledger-card-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.ledger-card-head h4 {
  margin: 0; font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.4;
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ledger-card .lc-badge { flex: 0 0 auto; }
.ledger-meta { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted); }
.ledger-meta .row { display: flex; gap: 6px; }
.ledger-meta .row i { color: var(--text-2); font-style: normal; width: 52px; flex: 0 0 52px; }
.ledger-acts {
  display: flex; gap: 6px; margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--border);
}
.ledger-add-card {
  border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--panel-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 150px; cursor: pointer; color: var(--muted); font-size: 12.5px;
}
.ledger-add-card:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-weak); }
.ledger-add-card .plus { font-size: 26px; line-height: 1; }

/* ============ 表单栅格（账套设置） ============ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; max-width: 860px; }
.form-grid .fg-full { grid-column: 1 / -1; }
.form-grid .fg label { font-size: 12.5px; color: var(--text-2); }
.req::before { content: '*'; color: var(--danger); margin-right: 2px; }
.radio-row { display: flex; gap: 16px; align-items: center; height: 32px; }
.radio-row label { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text); cursor: pointer; }
.hint-line { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

/* 卡片内页签（账套设置） */
.tabs-line {
  display: flex; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.tl-item {
  padding: 11px 16px 10px; font-size: 13px; color: var(--text-2); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tl-item:hover { color: var(--primary); }
.tl-item.on { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }
.card-title-sm {
  font-size: 13px; font-weight: 600; color: var(--text); margin: 0 0 14px;
  padding-left: 8px; border-left: 3px solid var(--primary); line-height: 1.2;
}

/* ============ 会计科目树形表 ============ */
.subj-tbl { border-collapse: collapse; font-size: 12.5px; }
.subj-tbl th {
  text-align: left; font-weight: 600; color: var(--text-2); font-size: 12px;
  padding: 8px 10px; background: var(--panel-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.subj-tbl td { padding: 6px 10px; border-bottom: 1px solid #f2f4f9; vertical-align: middle; }
.subj-tbl tbody tr:hover { background: var(--primary-weak); }
.subj-tbl tr.has-kids { background: #fcfdff; }
.subj-tbl tr.has-kids:hover { background: var(--primary-weak); }
.tree-tog {
  display: inline-block; width: 14px; text-align: center; cursor: pointer;
  color: var(--primary); font-size: 10px; user-select: none; margin-right: 2px;
}
.tree-tog:hover { color: var(--primary-dark); }
.tree-dot { display: inline-block; width: 14px; text-align: center; color: #c8cfdd; margin-right: 2px; }
.chk { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.chk input { margin: 0; }

/* ============ 通用元件 ============ */
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 14px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid var(--border);
}
.card-head h3 { margin: 0; font-size: 13.5px; font-weight: 650; }
.card-head .sub { font-size: 11.5px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.page-head h2 { margin: 0; font-size: 18px; letter-spacing: .2px; }
.page-head p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: #fff;
  color: var(--text-2); font-size: 13px; font-family: inherit; cursor: pointer;
  transition: all .12s; white-space: nowrap;
}
.btn:hover { border-color: #b9c2d4; color: var(--text); background: #fbfcfe; }
.btn:active { transform: translateY(.5px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(37, 99, 235, .22); }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn.danger { color: var(--danger); border-color: #f2c9c6; background: #fff; }
.btn.danger:hover { background: var(--danger-weak); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #f1f4fa; }
.btn.sm { height: 27px; padding: 0 9px; font-size: 12px; }
.btn.link { border: none; background: none; color: var(--primary); padding: 0 4px; height: auto; }
.btn.link:hover { text-decoration: underline; }
.btn.link.danger { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.input, select.input, textarea.input {
  height: 32px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13px; color: var(--text); background: #fff; outline: none;
  transition: border-color .12s, box-shadow .12s; width: 100%;
}
textarea.input { height: auto; padding: 7px 10px; resize: vertical; min-height: 60px; line-height: 1.5; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.input:disabled { background: #f6f7fa; color: var(--muted); }
.input.sm { height: 28px; font-size: 12.5px; }
select.input { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' stroke='%238b93a7' stroke-width='1.4' fill='none' stroke-linecap='round'/></svg>"); background-repeat: no-repeat; background-position: right 9px center; padding-right: 26px; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.toolbar .spacer { flex: 1; }
/* 标题栏里筛选框与页签之间的竖分隔线 */
.tb-sep { width: 1px; height: 18px; background: var(--border-strong); margin: 0 4px; flex: 0 0 1px; }
/* 合计行：单独一条细线，不跟控件混在一行（否则长文本换行把工具栏挤成两截） */
.sum-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 16px; border-bottom: 1px solid var(--border); font-size: 12.5px;
}
.sum-bar #sumLine { margin-left: auto; }
.sum-bar:empty { display: none; }

/* 表头列筛选：点标题边上的小三角出菜单；筛过的列标蓝，一眼看出按哪些列在筛。
   ▾ 必须绝对定位：作为行内元素它会把行盒撑高 —— 实测 27 列全加之后表头从 37px
   涨到 55px（窄列里 ▽ 被挤到第二行），一行白占 18px。th 本身是 sticky（＝已定位
   元素），拿它当参照就够，绝不能给 th 写 position:relative（会把 sticky 顶掉）。
   right 取 4px 是有讲究的：th 的右内边距是 12px，右对齐的「报销金额」这类标题
   正好贴在内边距上，▾ 宽 8px，写 5px 会压住标题最后一笔，写 4px 刚好贴边不压字。 */
.th-f {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); z-index: 2;
  border: 0; background: none; cursor: pointer; padding: 0; margin: 0;
  font-size: 10px; line-height: 1; color: var(--muted);
}
.th-f:hover { color: var(--primary); }
.th-f.on { color: var(--primary); font-weight: 700; }
.th-menu {
  position: fixed; z-index: 9999; background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow-lg); padding: 4px; min-width: 150px;
  max-height: 320px; overflow: auto; font-size: 12.5px;
}
.th-mi { padding: 6px 10px; border-radius: 5px; cursor: pointer; white-space: nowrap; }
.th-mi:hover { background: var(--primary-weak); }
.th-mi.on { background: var(--primary-weak); color: var(--primary); font-weight: 600; }
.th-mi.muted { color: var(--muted); cursor: default; }
.th-mi.muted:hover { background: none; }
/* 筛过的列：整个表头字变蓝，不用凑近看那个小三角 */
.tbl thead th.th-fil { color: var(--primary); }
/* 输入式筛选菜单（文本 / 日期 / 金额）：下拉里放输入框，回车即筛 */
.th-menu-q { min-width: 232px; max-width: 300px; padding: 8px; }
.th-q-t { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.th-q-in { width: 100%; height: 28px; font-size: 12.5px; }
.th-q-2 { display: flex; align-items: center; gap: 5px; }
.th-q-2 .th-q-in { flex: 1 1 0; min-width: 0; }
.th-q-2 .muted { font-size: 11.5px; }
.th-q-pre { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.th-q-p {
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text-2);
  border-radius: 5px; padding: 2px 7px; font-size: 11.5px; cursor: pointer;
}
.th-q-p:hover { border-color: var(--primary); color: var(--primary); }
.th-q-b { display: flex; gap: 6px; margin-top: 8px; }
.th-q-h { font-size: 11px; line-height: 1.55; color: var(--text-3); margin-top: 7px; white-space: normal; }
.th-q-h code { font-size: 10.5px; background: var(--panel-2); border-radius: 3px; padding: 0 3px; }
/* 金额那一列多一块「同额多笔」清单，菜单跟着宽一点、高一点。
   max-height 必须放开：.th-menu 默认 320px，加上清单一共要 356px，
   不放开的话「查看全部 N 个金额」正好被挤到滚动区外面，等于藏起来了。 */
.th-menu-a { min-width: 330px; max-width: 360px; max-height: 620px; }
.th-q-grp { margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--border); }
.th-q-gt {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 11.5px; font-weight: 600; color: var(--text-2); margin-bottom: 5px;
}
.th-q-gt .muted { font-weight: 400; font-size: 10.5px; }
.th-q-gl { display: flex; flex-direction: column; gap: 1px; max-height: 208px; overflow-y: auto; }
.th-q-gi {
  display: flex; align-items: baseline; gap: 7px; width: 100%; text-align: left;
  border: 0; background: none; cursor: pointer; border-radius: 5px;
  padding: 4px 6px; font-size: 12px; color: var(--text-2);
}
.th-q-gi:hover { background: var(--primary-weak); }
.th-q-gi b { color: var(--primary); font-weight: 600; font-variant-numeric: tabular-nums; min-width: 64px; }
.th-q-gn { font-size: 11.5px; font-variant-numeric: tabular-nums; }
.th-q-gp {
  font-size: 10.5px; line-height: 1; padding: 2px 4px; border-radius: 3px;
  background: rgba(245, 158, 11, .16); color: #b45309; white-space: nowrap;
}
.th-q-gw {
  flex: 1 1 auto; min-width: 0; font-size: 11px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.th-q-gall {
  display: block; width: 100%; margin-top: 5px; border: 0; background: none; cursor: pointer;
  font-size: 11.5px; color: var(--primary); text-align: left; padding: 3px 6px; border-radius: 5px;
}
.th-q-gall:hover { background: var(--primary-weak); }
/* 顶部「正在筛选 N 列」条件条 */
.fchips {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 6px 10px; margin-bottom: 8px; font-size: 12px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
}
.fchips-lb { color: var(--text-3); }
.fchips-lb b { color: var(--primary); }
.fchip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 6px; border-radius: 5px; background: var(--panel);
  border: 1px solid var(--border); color: var(--text-2); white-space: nowrap;
}
.fchip b { color: var(--primary); font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.fchip a { color: var(--muted); text-decoration: none; font-size: 13px; line-height: 1; }
.fchip a:hover { color: var(--danger); }
.fchips-all { color: var(--primary); margin-left: 2px; }

/* 行勾选框：别用默认大小，在小字号表格里会显得特别大 */
.rowck, .rowck-all { width: 14px; height: 14px; cursor: pointer; vertical-align: middle; margin: 0; }
#selBar { font-size: 12.5px; }
#selBar .btn { margin-left: 2px; }
#selBar a { margin-left: 4px; }
.field-inline { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.field-inline .input { width: 140px; }
.field-inline .input.wide { width: 180px; }
.search-box { position: relative; }
.search-box .input { width: 210px; padding-left: 28px; }
.search-box::before {
  content: ''; position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  width: 12px; height: 12px; border: 1.6px solid #9aa3b8; border-radius: 50%;
}
.search-box::after {
  content: ''; position: absolute; left: 19px; top: 60%; width: 5px; height: 1.6px;
  background: #9aa3b8; transform: rotate(45deg);
}

/* ============ 表格 ============ */
/* 说明：position:sticky 的 th 只有在「滚动容器」里才会吸顶，所以 .tbl-wrap 必须是
   max-height + overflow:auto 的滚动区（否则它自己不滚，表头跟着页面滚走 = 现在的问题）。
   高度按「视口 - 页头/工具栏/面包屑」估算，各页面通用；弹窗里另有更小的上限。 */
.tbl-wrap { width: 100%; overflow: auto; max-height: calc(100vh - 262px); }
.tbl-wrap.no-fix { max-height: none; overflow-x: auto; }
.modal-body .tbl-wrap { max-height: 54vh; }
/* min-width:100% —— App.table 会把「各列宽度之和」写成行内 width，
   列少的表（科目余额表 8 列）就比容器窄，右边留出一条白带；给它垫一个下限就能铺满，
   列多的表本来就更宽，min-width 不会把它们压窄。 */
table.tbl { width: 100%; min-width: 100%; border-collapse: collapse; font-size: 12.8px; }
/* 表头：吸顶 + 完整网格框线（颜色浅，不用重色，避免看久了累） */
table.tbl th {
  text-align: left; font-weight: 600; color: var(--text-2); background: var(--panel-2);
  padding: 9px 12px; white-space: nowrap;
  position: sticky; top: 0; z-index: 2; font-size: 12px;
  border-bottom: 1px solid var(--border-strong);
  border-right: 1px solid #dde4f0;
  /* border-collapse 模式下 sticky 表头的 border-bottom 会在滚动时被盖掉，用内阴影补一条 */
  box-shadow: inset 0 -1px 0 var(--border-strong);
}
table.tbl td {
  padding: 9px 12px; vertical-align: middle;
  border-bottom: 1px solid #e6ebf5; border-right: 1px solid #e6ebf5;
}
table.tbl.auto { border: 1px solid #dde4f0; }
table.tbl tbody tr:hover { background: #f8faff; }
table.tbl tbody tr.clickable { cursor: pointer; }
/* 报表类表格：固定列宽，避免某一列把空白全吃掉 */
table.tbl.fixed { table-layout: fixed; }
table.tbl.fixed th, table.tbl.fixed td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* wrap：长文本（摘要 / 科目全名）换行显示，不再截断省略 */
table.tbl.wrap th, table.tbl.wrap td { white-space: normal; overflow: visible; text-overflow: clip; word-break: break-word; line-height: 1.5; }
table.tbl.wrap td.num { white-space: nowrap; }
/* 按内容定宽（表格宽度由 JS 按列宽之和写入，不拉满整行） */
table.tbl.auto { width: auto; }
table.tbl.compact th { padding: 7px 9px; font-size: 11.5px; }
table.tbl.compact td { padding: 7px 9px; }
/* 带竖线的报表表格：列多时便于横向对照 */
table.tbl.grid th, table.tbl.grid td { border-right: 1px solid #dfe6f2; }
table.tbl.grid th:last-child, table.tbl.grid td:last-child { border-right: none; }
/* 定宽表格：右侧封口，视觉上成为一个完整的表块 */
table.tbl.auto.grid th:last-child, table.tbl.auto.grid td:last-child { border-right: 1px solid #dfe6f2; }
table.tbl.grid thead th { border-bottom: 1px solid var(--border-strong); }
table.tbl.grid tbody tr:hover td { background: #f6f9ff; }
.zero { color: #c5cbd9; }
table.tbl tr.void td { color: #b6bccb; text-decoration: line-through; text-decoration-color: #d5d9e3; }
table.tbl tr.void:hover td { background: #fdf7f6; }
table.tbl tfoot td {
  background: var(--panel-2); font-weight: 650; border-top: 1px solid var(--border);
  border-bottom: none; padding: 10px 12px;
  /* 合计行跟着吸底，长表滚动时也看得到合计 */
  position: sticky; bottom: 0; z-index: 2;
  box-shadow: inset 0 1px 0 var(--border-strong);
}

/* ---- 数据刷新态：换期间 / 换条件时先「空一下」再出新数据，让用户看得见刷新了 ---- */
.is-loading { position: relative; }
.is-loading > * { opacity: .16; transition: opacity .14s ease; }
/* 白色小面板 + 转圈 + 文案：面板垫在下面，避免和淡出的表格文字叠在一起 */
.is-loading::before {
  content: '数据加载中…'; position: absolute; left: 50%; top: 96px; z-index: 6;
  width: 176px; height: 76px; margin-left: -88px; border-radius: 10px;
  background: rgba(255, 255, 255, .96); border: 1px solid var(--border);
  box-shadow: 0 6px 20px rgba(22, 34, 63, .10);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 11px;
  font-size: 12px; color: var(--muted); letter-spacing: .5px;
}
.is-loading::after {
  content: ''; position: absolute; left: 50%; top: 112px; z-index: 7;
  width: 22px; height: 22px; margin-left: -11px; border-radius: 50%;
  border: 2.5px solid var(--border-strong); border-top-color: var(--primary);
  animation: tblSpin .62s linear infinite;
}
@keyframes tblSpin { to { transform: rotate(360deg); } }

/* ---- 明细账（多科目批量）：科目分组行 + 本期小计 + 总合计 ---- */
table.dm-tbl { width: 100%; }
table.dm-tbl td.dm-sum { white-space: normal; word-break: break-word; line-height: 1.5; min-width: 260px; }
table.dm-tbl tr.grp td { background: #f2f6ff; border-top: 1px solid var(--border-strong); padding: 8px 12px; }
.dm-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.dm-head > * { min-width: 0; max-width: 100%; }
.dm-code { font-family: var(--mono); font-weight: 700; color: var(--primary); }
.dm-name { font-weight: 700; color: var(--text); word-break: break-word; }
.dm-meta { margin-left: auto; font-weight: 400; color: var(--text-2); font-size: 11.8px; word-break: break-word; }
table.dm-tbl tr.dm-sub td { background: #fafbfe; font-weight: 600; color: var(--text-2); }
table.dm-tbl tr.dm-total td { background: var(--panel-2); font-weight: 700; color: var(--text); border-top: 2px solid var(--border-strong); }
.num { text-align: right; font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; font-family: var(--mono); font-size: 12.8px; }
.center { text-align: center; }
.mono { font-family: var(--mono); font-size: 12.6px; font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.strong { font-weight: 650; }
.neg { color: var(--danger); }
.pos { color: var(--success); }
.empty { padding: 46px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.empty .ico { font-size: 30px; opacity: .35; display: block; margin-bottom: 8px; }

.tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 4px;
  font-size: 11.5px; background: #f1f3f9; color: var(--text-2); white-space: nowrap;
}
.tag.blue { background: var(--primary-weak); color: var(--primary); }
.tag.green { background: var(--success-weak); color: var(--success); }
.tag.amber { background: var(--warn-weak); color: var(--warn); }
.tag.red { background: var(--danger-weak); color: var(--danger); }
.tag.gray { background: #f1f3f9; color: var(--muted); }
/* 小一号的徽标（v1.21.9）：塞在单号后面标审批状态。
   高度压到 17px，不能把明细行的行高顶起来 —— 一行正文 12.5px，20px 的徽标会把它撑得很松。 */
.tag.xs { height: 17px; padding: 0 5px; font-size: 10.5px; border-radius: 3px; }

.pager { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 10px 16px; font-size: 12.5px; color: var(--text-2); border-top: 1px solid var(--border); }
.pager .pages { display: flex; gap: 4px; }
.pager .pager-size { margin-left: auto; display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.pager .pager-size select {
  height: 28px; padding: 0 4px; border: 1px solid var(--border); border-radius: 5px;
  background: #fff; color: var(--text); font: inherit; font-size: 12.5px; cursor: pointer;
}
.pager button { min-width: 28px; height: 28px; border: 1px solid var(--border); background: #fff; border-radius: 5px; cursor: pointer; font-size: 12.5px; color: var(--text-2); }
.pager button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager button:disabled { opacity: .45; cursor: default; }

/* ============ 工作台 ============ */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.kpi .k-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .k-value { font-size: 21px; font-weight: 700; letter-spacing: -.4px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .k-value small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.kpi .k-foot { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.kpi .k-bar { position: absolute; left: 0; top: 0; width: 3px; height: 100%; background: var(--primary); opacity: .8; }
.kpi.green .k-bar { background: var(--success); }
.kpi.amber .k-bar { background: var(--warn); }
.kpi.red .k-bar { background: var(--danger); }
.kpi.gray .k-bar { background: #cbd2e0; }

.grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

.chart { padding: 6px 10px 0; }
.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--text-2); padding: 0 6px 10px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }

.bar-list { display: flex; flex-direction: column; gap: 9px; }
.bar-item { display: grid; grid-template-columns: 1fr 90px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-track { height: 7px; background: #eef1f7; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #60a5fa, #2563eb); border-radius: 4px; }
.bar-item .bar-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-item .bar-val { text-align: right; font-family: var(--mono); font-size: 12px; color: var(--text-2); }

/* ============ 表单 ============ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.fg { display: flex; flex-direction: column; gap: 5px; }
.fg > label { font-size: 12px; color: var(--text-2); font-weight: 600; }
.fg > label .req { color: var(--danger); margin-left: 2px; }
.fg .hint { font-size: 11px; color: var(--muted); }
.req-line { font-size: 12px; color: var(--danger); padding: 2px 0; min-height: 0; }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(17, 24, 39, .42); backdrop-filter: blur(1.5px);
  display: flex; align-items: flex-start; justify-content: center; z-index: 100; padding: 40px 16px;
  overflow-y: auto; animation: fade .14s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99) } to { opacity: 1; transform: none } }
.modal {
  background: var(--panel); border-radius: 12px; box-shadow: var(--shadow-lg); width: 560px;
  max-width: 100%; animation: pop .16s ease; overflow: hidden;
}
.modal.wide { width: 860px; }
.modal.xwide { width: 1080px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-head .x { border: none; background: none; font-size: 20px; color: var(--muted); cursor: pointer; line-height: 1; padding: 0 2px; }
.modal-head .x:hover { color: var(--text); }
.modal-body { padding: 18px; max-height: calc(100vh - 220px); overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 18px; border-top: 1px solid var(--border); background: var(--panel-2); }

/* ============ 提示 ============ */
.toast-root { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #1f2937; color: #fff; padding: 9px 16px; border-radius: 8px; font-size: 13px;
  box-shadow: var(--shadow); animation: pop .16s ease; max-width: 520px;
}
.toast.ok { background: #0f7a4a; }
.toast.err { background: #b91c1c; }
.toast.warn { background: #b45309; }

/* ============ 单据录入 ============ */
.doc-head { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.doc-head .fg.w2 { grid-column: span 2; }
.items-tbl { width: 100%; border-collapse: collapse; font-size: 12.8px; }
.items-tbl th {
  background: var(--panel-2); border: 1px solid var(--border); padding: 7px 8px;
  font-weight: 600; font-size: 12px; color: var(--text-2); white-space: nowrap;
}
.items-tbl td { border: 1px solid var(--border); padding: 3px 4px; }
.items-tbl td .input { height: 29px; border-color: transparent; background: transparent; border-radius: 4px; }
.items-tbl td .input:hover { border-color: var(--border); background: #fff; }
.items-tbl td .input:focus { border-color: var(--primary); background: #fff; }
.items-tbl td.calc { text-align: right; font-family: var(--mono); font-size: 12.3px; padding-right: 10px; color: var(--text-2); }
.items-tbl .del-row { color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; }
.items-tbl .del-row:hover { color: var(--danger); }
.doc-foot { display: flex; justify-content: space-between; align-items: flex-start; margin-top: 12px; gap: 20px; }
.doc-sums { display: flex; gap: 26px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 11px 18px; }
.doc-sums div { text-align: right; }
.doc-sums span { font-size: 11.5px; color: var(--muted); display: block; }
.doc-sums b { font-size: 16px; font-variant-numeric: tabular-nums; font-family: var(--mono); }
.doc-sums b.hl { color: var(--primary); font-size: 18px; }

/* ============ 单据详情 ============ */
.detail-head { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 18px; margin-bottom: 14px; }
.detail-head .k { font-size: 11.5px; color: var(--muted); }
.detail-head .v { font-size: 13px; font-weight: 600; margin-top: 1px; }

/* 凭证详情弹窗里「双击分录直接改」（v1.21.34） */
.vd-dbltip {
  font-size: 11.5px; color: var(--text-2); background: var(--primary-weak);
  border-radius: 6px; padding: 4px 10px; margin-bottom: 6px;
}
.vd-hit { cursor: text; }
.vd-hit tbody tr { user-select: none; }
.vd-hit tbody tr:hover { background: var(--primary-weak); }
table.tbl.vd-edit { width: 100%; }
table.tbl.vd-edit col { width: auto; }
table.tbl.vd-edit td { padding: 3px 6px; }
table.tbl.vd-edit td.idx { text-align: center; color: var(--muted); font-size: 11.5px; }
table.tbl.vd-edit .vd-in {
  width: 100%; height: 28px; border: 1px solid var(--border); border-radius: 4px;
  padding: 0 8px; font-size: 12.5px; background: #fff; color: inherit;
}
table.tbl.vd-edit .vd-in:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 2px rgba(59, 130, 246, .12); }
table.tbl.vd-edit .vd-in.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl.vd-edit .vd-in.vd-subj.ok { border-color: #b7e3cc; background: #f6fdf9; }
.vd-del { cursor: pointer; color: var(--muted); font-size: 15px; padding: 0 4px; }
.vd-del:hover { color: var(--danger); }
.vd-foot-add { padding: 6px 8px; }

/* ============ 报销单详情的信息格 ============ */
.kv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 18px; padding: 4px 2px 6px; }
.kv-grid i { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.kv-grid span { font-size: 13px; font-weight: 600; word-break: break-all; }
@media (max-width: 1100px) { .kv-grid { grid-template-columns: repeat(2, 1fr); } }
/* 无票金额用柔和的橙红，不用满格红，免得整张表像报错 */
.neg-soft { color: #c2410c; }

/* ============ 报销单列表：统计条 / 疑似重复标 ============ */
.sum-bar { flex-wrap: wrap; row-gap: 6px; }
.sum-line { font-size: 12.5px; color: var(--text); white-space: normal; line-height: 1.6; }
.sum-line b { font-family: var(--mono); }
.sum-line .sum-ok b { color: #1a7f4b; }
.sum-line .sum-warn b { color: #c2410c; }
.sum-line .sum-ok, .sum-line .sum-warn { padding: 1px 7px; border-radius: 10px; }
.sum-line .sum-ok { background: #eafaf1; }
.sum-line .sum-warn { background: #fff3e8; }
/* 「未拆票种」是个可点的链接：点它会筛出有票/无票都为 0 的单 */
.sum-line .sum-gap { padding: 1px 7px; border-radius: 10px; background: #f1f3f9;
  color: var(--text-2); text-decoration: none; cursor: pointer; border: 1px dashed var(--border-strong); }
.sum-line .sum-gap:hover { background: var(--primary-weak); color: var(--primary); border-color: var(--primary); }
.sum-line .sum-gap b { color: var(--text); }
.chk-dup { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); cursor: pointer; user-select: none; white-space: nowrap; }
.chk-dup input { margin: 0; }
.dup-cnt { color: #c2410c; font-family: var(--mono); }
.no-pick { color: #c8cfdd; }
.tbl tbody tr.row-dup td { background: #fff6f6; }
.tbl tbody tr.row-dup:hover td { background: #ffecec; }

/* ============ 报销凭据附件 ============ */
.file-cnt { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
a.file-cnt { color: var(--primary); border-bottom: 1px dashed rgba(37, 99, 235, .45); cursor: pointer; }
a.file-cnt:hover { color: var(--primary-dark); border-bottom-style: solid; }
/* 详情弹窗里「与 F2026… 重复」这种正文中的单号：虚下划线，一眼看出能点进去 */
a.no-link { cursor: pointer; border-bottom: 1px dashed rgba(37, 99, 235, .5); }
a.no-link:hover { border-bottom-style: solid; }
/* 付款明细「附件」列：直接放小图，点一下开原图（比只写文件名省一次猜测） */
img.att-thumb {
  width: 34px; height: 34px; object-fit: cover; border-radius: 4px;
  border: 1px solid var(--border); cursor: zoom-in; vertical-align: middle; background: var(--panel-2);
}
img.att-thumb:hover { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37, 99, 235, .18); }
a.att-chip {
  display: inline-block; padding: 2px 6px; border: 1px solid var(--border);
  border-radius: 4px; font-size: 11.5px; line-height: 16px;
}
a.att-chip:hover { border-color: var(--primary); }
/* v1.19.0：附件可增；v1.20.2 起不能删 —— × 已撤掉，只留「＋」。
   （span.att-box 保留，缩略图外层包一层方便标“新加的”） */
span.att-box { position: relative; display: inline-block; margin: 1px 2px; vertical-align: middle; }
span.att-box[data-new="1"] img.att-thumb { border-color: var(--success); }
a.att-add {
  display: inline-block; width: 34px; height: 34px; line-height: 32px; text-align: center;
  border: 1px dashed var(--border); border-radius: 4px; color: var(--muted);
  font-size: 15px; vertical-align: middle; background: var(--panel-2);
}
a.att-add:hover { border-color: var(--primary); color: var(--primary); }
/* 打车合单拆出来的金额：OCR 修回来、不确定的，加个问号让人去核（不然会当成截图上印的数） */
.amt-guess {
  display: inline-block; min-width: 14px; height: 14px; line-height: 14px; margin-left: 3px;
  padding: 0 3px; border-radius: 7px; font-size: 10px; text-align: center; cursor: help;
  background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; vertical-align: 1px;
}
body.dark .amt-guess { background: rgba(180, 83, 9, .25); color: #fcd34d; border-color: rgba(252, 211, 77, .45); }
/* 关联凭据整行可点 */
a.file-link { display: inline-flex; align-items: center; gap: 6px; }
a.file-link:hover { text-decoration: underline; }
.file-cnt.has-dup { color: #c2410c; font-weight: 650; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; padding: 4px 2px 10px; }
.file-item {
  position: relative; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--panel-2); padding: 6px; overflow: hidden;
}
.file-item.is-dup { border-color: #f0b9b9; background: #fff7f7; }
.file-thumb {
  display: flex; align-items: center; justify-content: center;
  height: 96px; background: #fff; border-radius: 4px; overflow: hidden;
}
.file-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.file-ext { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .5px; }
.file-name {
  font-size: 11.5px; margin-top: 5px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-meta { font-size: 11px; color: var(--muted); }
.file-dup { font-size: 11px; color: #c2410c; margin-top: 2px; }
.file-del {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; line-height: 1;
  border: none; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff;
  font-size: 14px; cursor: pointer; opacity: 0; transition: opacity .12s;
}
.file-item:hover .file-del { opacity: 1; }
.file-del:hover { background: var(--danger); }

/* ============ 报表 ============ */
.report-tbl th, .report-tbl td { border: 1px solid var(--border); }
.report-tbl th { background: #f7f9fd; text-align: center; }
.report-tbl td { padding: 7px 10px; }
.report-tbl .grp { background: #fbfcfe; font-weight: 650; }

/* ============ 打印 ============ */
@media print {
  .sidebar, .topbar, .page-actions, .toolbar, .pager, .no-print { display: none !important; }
  .view { padding: 0; overflow: visible; }
  body { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .card { border: none; box-shadow: none; }
  .app-shell { height: auto; overflow: visible; display: block; }
  .main { overflow: visible; }
  /* 打印时必须放开滚动区，否则只打出一屏；表头改由浏览器按页重复 <thead> */
  .tbl-wrap { max-height: none !important; overflow: visible !important; }
  .vscroll { max-height: none !important; overflow: visible !important; }
  table.tbl thead { display: table-header-group; }
  table.tbl tr { page-break-inside: avoid; }
  table.tbl th { position: static; box-shadow: none; }
  table.tbl th, table.tbl td { border: 1px solid #000 !important; }
  .vbook th { position: static; box-shadow: none; }
  .is-loading > * { opacity: 1 !important; }
  .is-loading::before, .is-loading::after { display: none !important; }
}

/* ============ 期末结转 ============ */
.closing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.closing-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 14px 12px 12px; text-align: center;
  background: var(--panel); display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.closing-card .m-title { font-size: 17px; font-weight: 700; color: var(--text); }
.closing-card .m-sub { font-size: 11.5px; color: var(--muted); }
.closing-card .m-tag { font-size: 11px; padding: 1px 8px; border-radius: 10px; background: #f1f3f9; color: var(--muted); }
.closing-card.closed { background: var(--success-weak); border-color: #cfeade; }
.closing-card.closed .m-title { color: var(--success); }
.closing-card.closed .m-tag { background: #fff; color: var(--success); }
.closing-card .btn { margin-top: 2px; }
/* 逐月结账（v1.21.24）：下一个该结的月份描蓝，被前面月份挡住的灰掉 */
.closing-card.next { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(59, 130, 246, .13); }
.closing-card.next .m-title { color: var(--primary); }
.closing-card.blocked { background: #fbfcfe; opacity: .78; }
.closing-card.blocked .m-tag { background: #eef1f7; color: #98a1b3; }
.closing-card .next-tag {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 8px;
  background: var(--primary); color: #fff; font-size: 10px; font-weight: 500; vertical-align: middle;
}

/* 报表分组行 */
table.tbl .grp td { background: #f7f9fd; font-weight: 650; color: var(--text); }
table.tbl tfoot td { border-top: 1px solid var(--border-strong); }

/* ============ 凭证编辑（整页） ============ */
.vch-card { overflow: hidden; }
.vch-tip { padding: 9px 16px; background: var(--warn-weak); color: #8a5a00; font-size: 12px; border-bottom: 1px solid #f3e2c0; }
.vch-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); background: #fcfdff; }
.vch-word { font-size: 16px; font-weight: 700; letter-spacing: 3px; }
.vch-no { font-size: 13px; color: var(--text-2); }
.vch-no b { color: var(--primary); font-family: var(--mono); }
.vch-sep { width: 1px; height: 18px; background: var(--border); }
.vch-body { padding: 0 16px; }
.vch-tbl { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.vch-tbl th { background: #f7f9fd; border: 1px solid var(--border); padding: 7px 8px; font-size: 12px; font-weight: 600; color: var(--text-2); position: relative; }
.vch-tbl th.amt { text-align: right; }
.vch-tbl td { border: 1px solid var(--border); padding: 0; height: 36px; vertical-align: top; }
.vch-tbl td.idx { text-align: center; color: var(--muted); font-size: 12px; background: #fafbfe; padding-top: 9px; }
.vch-tbl td.op { text-align: center; padding-top: 9px; }
.vch-in { width: 100%; height: 34px; border: 0; outline: none; padding: 0 9px; font: inherit; background: transparent; color: var(--text); }
.vch-in:focus { background: #f0f6ff; box-shadow: inset 0 0 0 1.5px var(--primary); }
.vch-in.num { text-align: right; font-family: var(--mono); font-size: 12.5px; }
/* 摘要 / 科目：一行放不下自动换到下一行（行高随内容长高，不再被截断） */
.vch-ta {
  display: block; width: 100%; min-height: 34px; border: 0; outline: none;
  padding: 8px 9px; font: inherit; line-height: 1.5; color: var(--text);
  background: transparent; resize: none; overflow: hidden; word-break: break-word;
}
.vch-ta:focus { background: #f0f6ff; box-shadow: inset 0 0 0 1.5px var(--primary); }
/* 列宽拖拽把手 */
.vch-rz { position: absolute; top: 0; right: -3px; width: 7px; height: 100%; cursor: col-resize; z-index: 3; }
.vch-rz:hover { background: rgba(37, 99, 235, .18); }
.vch-subj.bad { background: #fff5f4; }
/* 现金流量项目：只在货币资金科目行出现，挂在科目录入框下面 */
.vch-subj-cell { padding: 0 !important; }
.vch-subj-cell > .vch-ta { min-height: 30px; padding: 6px 9px; }
.vch-cf {
  display: block; width: calc(100% - 18px); margin: 0 9px 5px; height: 24px;
  border: 1px solid #d6e4ff; border-radius: 5px; background: #f4f8ff; color: var(--text-2);
  font: inherit; font-size: 11.5px; padding: 0 4px; outline: none; cursor: pointer;
}
.vch-cf:focus { border-color: var(--primary); background: #fff; }
.vch-cf.hidden { display: none; }
.vch-del { color: #ccd2de; cursor: pointer; font-size: 15px; line-height: 1; }
.vch-del:hover { color: var(--danger); }
.ruler { display: flex; justify-content: space-between; font-size: 8.5px; color: #c2c9d8; font-weight: 400; margin-top: 3px; }
.vch-sum { display: flex; justify-content: space-between; align-items: center; padding: 11px 16px; border-top: 1px solid var(--border); background: #fafbfe; }
.vch-big { font-size: 13px; color: var(--text-2); }
.vch-big b { color: var(--text); font-size: 14px; letter-spacing: .5px; }
.vch-tot { display: flex; gap: 22px; align-items: center; font-size: 12.5px; color: var(--text-2); }
.vch-tot b { font-family: var(--mono); color: var(--text); font-size: 13px; }
.vch-diff { padding: 2px 10px; border-radius: 10px; font-size: 12px; }
.vch-diff.ok { background: var(--success-weak); color: var(--success); }
.vch-diff.bad { background: var(--danger-weak); color: var(--danger); }
.vch-foot { padding: 9px 16px 14px; font-size: 11.5px; color: var(--muted); }
.vch-tbl th.left { text-align: left; }

/* ============ 凭证簿（查看凭证） ============ */
.vbook-card { max-width: 100%; }
.gap-bar { padding: 8px 12px; margin-bottom: 10px; border-radius: var(--radius-sm); font-size: 12.5px; border: 1px solid transparent; }
.gap-bar.ok { color: #1a7f4b; background: #eafaf1; border-color: #bfe8cf; }
.gap-bar.warn { color: #9a6700; background: #fff7e0; border-color: #f2dd9b; }
.gap-bar b { font-family: var(--mono); }
.gap-bar:empty { display: none; }
/* 宽度由各列之和决定（JS 按 saved 列宽写行内 width），不再拉满整屏；
   列宽可拖，拖完记 localStorage（见 core.js 的 .col-resizer 全局逻辑） */
.vbook { width: auto; min-width: 0; border-collapse: collapse; font-size: 12.5px; table-layout: fixed; }
/* 凭证簿滚动区：让表头吸顶（同 .tbl-wrap 的道理，sticky 要有滚动容器） */
.vscroll { max-height: calc(100vh - 320px); overflow: auto; }
.vbook th { background: #f7f9fd; padding: 7px 9px; font-size: 11.5px; font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--border); text-align: left; position: sticky; top: 0; z-index: 2; box-shadow: inset 0 -1px 0 var(--border); }
.vbook th.num { text-align: right; }
.vbook td { padding: 4px 9px; vertical-align: top; }
.vbook td.num { text-align: right; font-family: var(--mono); font-size: 12px; white-space: nowrap; }
/* 摘要 / 科目全名过长时换行显示，不再省略号截断 */
.vbook td.sum { word-break: break-word; }
.vbook th, .vbook td { border-right: 1px solid #f1f4fa; }
.vbook th:last-child, .vbook td:last-child { border-right: none; }
.vbook td.subj { color: var(--text-2); word-break: break-word; }
.vbook tr.vline { cursor: pointer; }
.vbook tr.vline:hover td { background: #f7faff; }
.vbook tr.vmeta td { padding: 15px 9px 5px; font-size: 11.5px; color: var(--text-2); border-bottom: 1px dotted #e3e8f2; }
.vbook tr.vmeta span { margin-right: 12px; }
.vbook tr.vmeta .vacts { float: right; }
.vbook tr.vmeta .vacts a { margin-left: 10px; color: var(--primary); cursor: pointer; }
.vbook tr.vmeta .vacts a.danger { color: var(--danger); }
.vbook tr.vmeta .vacts a:hover { text-decoration: underline; }
.vbook tr.vtotal td { padding: 6px 9px 13px; border-bottom: 1px solid var(--border); font-weight: 600; }
.vbook tr.vtotal td.big { font-weight: 400; font-size: 11.5px; color: var(--text-2); letter-spacing: .5px; word-break: break-word; }
.vbook-card .toolbar { padding: 9px 12px; }
.vbook-card .pager { padding: 8px 12px; }

/* 凭证编辑页整体收窄，避免表格被拉得过宽 */
.vch-page { max-width: 1040px; }
.vch-page .page-head { margin-bottom: 12px; }

/* ============ 正式格式报表 ============ */
.stmt-tbl { border-collapse: collapse; font-size: 12.5px; }
.stmt-tbl th { background: #f7f9fd; border-bottom: 1px solid var(--border); padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--text-2); text-align: left; }
.stmt-tbl th.c, .stmt-tbl td.c { text-align: center; }
.stmt-tbl th.num { text-align: right; }
.stmt-tbl td { padding: 6px 10px; border-bottom: 1px solid #f2f4f9; }
.stmt-tbl td.num { text-align: right; font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.stmt-tbl td.nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stmt-tbl .r-title td { background: #f5f9fd; font-weight: 650; color: var(--text); }
.stmt-tbl .r-total td { font-weight: 650; border-top: 1px solid var(--border); }
.stmt-tbl .r-sub td { font-weight: 650; }
.stmt-tbl .r-grand td { font-weight: 700; background: #fafcff; border-bottom: 1px solid var(--border-strong); }
.stmt-tbl tr.sub-head td { text-align: center; color: var(--muted); font-size: 11.5px; background: #fcfdff; padding: 5px 10px; }
/* 系统未细分核算的「其中」行：屏幕上不显示（对齐柠檬云），打印时由 printView 还原成完整 32 行 */
.stmt-tbl tr.no-data { display: none; }
/* 可下钻到明细账的绿点 */
.stmt-tbl .drill { color: #16a34a; font-size: 9px; margin-right: 5px; cursor: pointer; vertical-align: 2px; }
.stmt-tbl .drill:hover { color: #15803d; }
/* 资产负债表：左右两栏各 4 列，框线统一走 table.tbl 的默认样式，不再单独去掉第 4/8 列的竖线 */
.bsheet td { border-right: 1px solid #e6ebf5; }

/* ============ 列宽拖拽 ============ */
/* 注意：这里不要写 position: relative —— 表头的 sticky 会被它覆盖掉，
   而 sticky 本身就是「已定位元素」，足够做 .col-resizer 的定位参照。 */
.col-resizer {
  position: absolute; top: 0; right: -3px; width: 7px; height: 100%;
  cursor: col-resize; z-index: 3; user-select: none;
}
.col-resizer:hover { background: rgba(37, 99, 235, .18); }

/* ============ 输入联想（textarea 版 datalist） ============ */
.sg-box {
  position: fixed; z-index: 9999; max-height: 260px; overflow-y: auto;
  background: #fff; border: 1px solid var(--border-strong); border-radius: 7px;
  box-shadow: 0 10px 30px rgba(22, 34, 63, .16); padding: 4px;
}
.sg-box .sg-item {
  display: flex; align-items: baseline; gap: 8px;
  padding: 6px 9px; border-radius: 5px; font-size: 12.5px; color: var(--text);
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sg-box .sg-item b { font-weight: 500; }
.sg-box .sg-item span { color: var(--muted); font-size: 11.5px; }
.sg-box .sg-item:hover, .sg-box .sg-item.on { background: var(--primary-weak); color: var(--primary); }

/* ============ 智能记账 ============ */
.smart-tips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.smart-chip {
  font-size: 11.5px; color: var(--text-2); background: var(--panel-2); border: 1px dashed var(--border-strong);
  padding: 3px 9px; border-radius: 12px; cursor: pointer;
}
.smart-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-weak); }
.smart-msg { padding: 10px 14px; border-radius: 8px; font-size: 12.5px; line-height: 1.7; }
.smart-msg.ok { background: var(--success-weak); color: #0b6b47; }
.smart-msg.warn { background: var(--warn-weak); color: #8a5a00; }
.smart-msg.bad { background: var(--danger-weak); color: #a12626; }
.smart-msg b { font-size: 13px; }
/* 一次说多笔 */
.smart-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 12.5px; color: var(--text-2);
}
.smart-summary b { font-size: 14px; color: var(--text); }
.smart-summary .c-ok b, .c-ok { color: var(--success); }
.smart-summary .c-bad b, .c-bad { color: var(--danger); }
.smart-list { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.smart-item { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel); overflow: hidden; }
.smart-item.ok { border-color: #a8ddc4; }
.smart-item.bad { border-color: #e8c4c2; }
.smart-item.done { background: var(--panel-2); border-color: var(--border); }
.smart-item-hd {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px;
  background: var(--panel-2); border-bottom: 1px solid var(--border); font-size: 12.5px;
}
.smart-item-hd .grow { flex: 1; }
.smart-idx { font-weight: 600; color: var(--text); }
.smart-item-text { display: flex; gap: 8px; padding: 10px 12px 4px; }
.smart-item-text .input { flex: 1; }
.smart-item-locked { flex: 1; font-size: 12.5px; color: var(--text-2); padding: 5px 0; }
.smart-item-body { padding: 6px 12px 12px; }
.smart-item-body .items-tbl { margin-top: 8px; }

/* ============ 查询条件条（期间 + 查询/重置 + 当前生效期间） ============ */
.range-bar {
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.range-bar .field-inline { margin-right: 0; gap: 4px; }
.range-bar .field-inline .input { width: 122px; }
.range-bar [data-range-tag] {
  font-variant-numeric: tabular-nums; letter-spacing: .1px;
}

/* ============ 会计期间选择器 ============ */
.period-pick { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.period-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-width: 108px; justify-content: space-between; font-weight: 600;
}
.period-btn .pp-caret { color: var(--muted); font-size: 10px; }
.period-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
  display: flex; background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: 10px; box-shadow: 0 12px 30px rgba(17, 24, 39, .14);
  overflow: hidden;
}
.period-pop[hidden] { display: none; }
.pp-years {
  display: flex; flex-direction: column; background: var(--panel-2);
  border-right: 1px solid var(--border); padding: 6px; min-width: 78px;
}
.pp-years button {
  border: 0; background: transparent; text-align: left; padding: 7px 10px;
  font-size: 12.5px; color: var(--text-2); border-radius: 6px; cursor: pointer;
}
.pp-years button:hover { background: #eef1f8; color: var(--text); }
.pp-years button.on { background: var(--primary); color: #fff; font-weight: 600; }
.pp-months {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 8px; min-width: 246px;
}
.pp-months button {
  position: relative; border: 1px solid transparent; background: transparent;
  padding: 9px 6px; font-size: 12.5px; color: var(--text-2);
  border-radius: 6px; cursor: pointer;
}
.pp-months button:hover { background: var(--primary-weak); color: var(--primary); }
.pp-months button.closed { color: var(--text); font-weight: 600; }
.pp-months button.on { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.pp-months button.off { color: #c8ceda; cursor: not-allowed; }
.pp-months button.off:hover { background: transparent; color: #c8ceda; }
.pp-dot {
  display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--success); margin-left: 4px; vertical-align: middle;
}
.pp-months button.on .pp-dot { background: #fff; }
.pp-foot {
  display: none; align-items: center; gap: 10px; justify-content: space-between;
  padding: 8px 10px; border-top: 1px solid var(--border);
}
.period-pop { flex-wrap: wrap; }
.period-pop .pp-foot { display: flex; width: 100%; }
.pp-foot .muted { font-size: 11.5px; }

/* ================= 备份恢复 ================= */
.bk-status { padding: 16px 18px; }
.bk-metrics { display: flex; gap: 12px; flex-wrap: wrap; }
.bk-metric {
  flex: 1 1 180px; min-width: 160px; padding: 12px 14px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--border);
}
.bk-metric span { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }
.bk-metric b { font-size: 18px; font-weight: 700; letter-spacing: -.2px; }
.bk-metric i { font-style: normal; font-size: 12px; color: var(--muted); margin-left: 6px; }
.bk-bar {
  height: 8px; margin: 14px 0 8px; border-radius: 99px; overflow: hidden;
  background: #e9edf6;
}
.bk-bar-fill {
  height: 100%; width: 2%; border-radius: 99px;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  transition: width .35s ease;
}
.bk-bar-fill.warn { background: linear-gradient(90deg, #f59e0b, #d97706); }
.bk-hint { font-size: 12px; color: var(--muted); }
.bk-hint code, .bk-status code { background: var(--panel-2); padding: 1px 6px; border-radius: 4px; font-size: 11.5px; }

/* ================= 票据做账 ================= */
.tk-drop {
  margin: 16px 18px; padding: 26px 18px; text-align: center;
  border: 1.5px dashed var(--border-strong); border-radius: 12px;
  background: var(--panel-2); cursor: pointer; transition: .15s;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.tk-drop:hover, .tk-drop.over { border-color: var(--primary); background: var(--primary-weak); }
.tk-drop-ico {
  width: 34px; height: 34px; line-height: 32px; border-radius: 50%;
  background: #fff; border: 1px solid var(--border-strong);
  font-size: 19px; color: var(--primary); font-weight: 600;
}
/* 上传中：拖拽区整体切换成进度面板，避免看起来「点了没反应」 */
.tk-drop.busy {
  cursor: default; border-style: solid;
  border-color: var(--primary); background: var(--primary-weak);
}
.tk-drop.busy > div:not(.tk-up) { display: none; }
.tk-up { width: 100%; max-width: 480px; margin: 0 auto; }
.tk-up:empty { display: none; }
.tk-up-head { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 9px; }
.tk-up-name {
  font-size: 12.5px; color: var(--text-2); max-width: 380px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tk-spin {
  width: 13px; height: 13px; flex: 0 0 13px; border-radius: 50%;
  border: 2px solid var(--border-strong); border-top-color: var(--primary);
  animation: tkSpin .7s linear infinite;
}
@keyframes tkSpin { to { transform: rotate(360deg); } }
.tk-up-bar {
  height: 7px; border-radius: 99px; overflow: hidden;
  background: #fff; border: 1px solid var(--border-strong);
}
.tk-up-fill {
  height: 100%; width: 0; border-radius: 99px;
  background: var(--primary);
  transition: width .2s ease-out;
}
/* 字节传完了但服务端还在拆张/解析：用流动的条纹表示「在干活」 */
.tk-up-fill.parse {
  background-image: linear-gradient(90deg, var(--primary) 0%, #7fb2ea 40%, var(--primary) 80%);
  background-size: 200% 100%;
  animation: tkFlow 1.1s linear infinite;
}
@keyframes tkFlow { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.tk-up-txt {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 7px; font-size: 11.5px; color: var(--muted);
}
.tk-up-err {
  font-size: 11.5px; color: var(--danger); background: var(--danger-weak);
  border-radius: var(--radius-sm); padding: 4px 8px; display: inline-block;
}
.tk-cards { display: flex; flex-direction: column; gap: 0; }
.tk-card {
  display: flex; gap: 14px; padding: 14px 18px;
  border-top: 1px solid var(--border); align-items: flex-start;
}
.tk-card:first-child { border-top: 0; }
/* 刚传进来/刚拆出来的卡片轻微入场，让人确认「确实加到列表里了」 */
.tk-card.fresh { animation: tkIn .32s ease-out; background: var(--primary-weak); }
@keyframes tkIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
.tk-thumb { width: 120px; flex: 0 0 120px; text-align: center; }
.tk-thumb img {
  width: 120px; height: 84px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border-strong); background: #fff;
}
.tk-pdf {
  width: 120px; height: 84px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--panel-2); display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: var(--danger); letter-spacing: .5px;
}
.tk-file {
  margin-top: 6px; font-size: 11px; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px;
}
.tk-body { flex: 1 1 auto; min-width: 0; }
/* 数据校验提示：只提醒，不替用户改源文件 */
.tk-warn {
  background: var(--warn-weak); border: 1px solid #f5d9a8; color: #7a4a05;
  border-radius: var(--radius-sm); padding: 6px 10px; margin-bottom: 10px; font-size: 12px; line-height: 1.55;
}
.tk-warn b { display: block; margin-bottom: 2px; font-size: 12px; }
.tk-warn ul { margin: 0; padding-left: 16px; }
.tk-hint {
  background: var(--panel-2); border: 1px dashed var(--border-strong); color: var(--muted);
  border-radius: var(--radius-sm); padding: 5px 10px; margin-bottom: 10px; font-size: 11.5px;
}
/* 必填但还没填的输入框 */
.input.need { border-color: var(--danger); background: var(--danger-weak); }
/* 这张票已经做过账（v1.21.34 防重复入账）：默认跳过，别让人以为「拖了就一定生成」 */
.tk-dup {
  background: var(--danger-weak); border: 1px solid #f0b8b8; color: #8a1f1f;
  border-radius: var(--radius-sm); padding: 6px 10px; margin-bottom: 10px;
  font-size: 12px; line-height: 1.6;
}
.tk-card.dup .tk-thumb { opacity: .72; }
.tk-card.dup .tk-dup { margin-bottom: 8px; }
/* 数据来自对账单配对（同源，不是猜的） */
.tk-ok {
  background: var(--success-weak); border: 1px solid #b7e3cc; color: #0a6b3d;
  border-radius: var(--radius-sm); padding: 5px 10px; margin-bottom: 10px; font-size: 11.5px;
}
/* 生成凭证完成弹窗 */
.tk-done-ico {
  width: 44px; height: 44px; line-height: 44px; margin: 0 auto 12px; text-align: center;
  border-radius: 50%; background: var(--success-weak); color: var(--success);
  font-size: 24px; font-weight: 700;
}
.tk-done-tip {
  margin-top: 12px; padding: 9px 12px; border-radius: var(--radius-sm);
  background: var(--primary-weak); color: #1e3a8a; font-size: 12.5px; line-height: 1.6;
}
.tk-fields { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 10px; }
.tk-fields .fg { display: flex; flex-direction: column; gap: 4px; flex: 1 1 120px; min-width: 110px; }
.tk-fields .fg > span { font-size: 11.5px; color: var(--muted); }
.tk-fields .fg input, .tk-fields .fg select { width: 100%; }
.tk-fields .fg:has(input[type="number"]) { flex: 0 0 136px; min-width: 136px; }
.tk-lines { width: 100%; font-size: 12.5px; table-layout: fixed; }
.tk-lines th { background: var(--panel-2); font-weight: 600; }
.tk-lines th:first-child, .tk-lines td:first-child { width: auto; }
.tk-lines td { padding: 4px 8px; }
.tk-lines td.mono { color: var(--text-2); }
.tk-side {
  flex: 0 0 72px; display: flex; flex-direction: column; gap: 10px;
  align-items: center; padding-top: 4px;
}
@media (max-width: 900px) {
  .tk-card { flex-wrap: wrap; }
  .tk-thumb, .tk-side { flex: 0 0 100%; display: flex; gap: 10px; align-items: center; text-align: left; }
  .tk-thumb img, .tk-pdf { width: 84px; height: 60px; }
}

/* ================= 凭证附件 ================= */
.vf-wrap { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 12px; }
.vf-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.vf-head b { font-size: 12.5px; }
.vf-list { display: flex; flex-wrap: wrap; gap: 10px; }
.vf-item {
  position: relative; width: 108px; border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden; background: var(--panel-2);
}
.vf-item img { width: 108px; height: 76px; object-fit: cover; display: block; background: #fff; }
.vf-item .vf-pdf {
  width: 108px; height: 76px; display: flex; align-items: center; justify-content: center;
  color: var(--danger); font-weight: 700; font-size: 13px;
}
.vf-item .vf-name {
  font-size: 10.5px; color: var(--text-2); padding: 3px 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vf-item .vf-x {
  position: absolute; top: 2px; right: 2px; width: 17px; height: 17px; line-height: 15px;
  text-align: center; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff;
  font-size: 12px; cursor: pointer; opacity: 0; transition: .15s;
}
.vf-item:hover .vf-x { opacity: 1; }

/* ===== 银行对账单条（凭证册首页） ===== */
.stmt-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px; border-top: 1px solid var(--border); background: var(--panel-2);
}
.stmt-bar-t { font-size: 12px; color: var(--text-2); display: flex; flex-direction: column; line-height: 1.35; }
.stmt-bar-t i { font-style: normal; font-size: 11px; color: var(--text-3, #999); }
.stmt-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  padding: 4px 9px; border: 1px dashed var(--border); border-radius: 14px;
  background: var(--panel); color: var(--text-2);
}
.stmt-chip a { color: var(--primary); cursor: pointer; text-decoration: none; }
.stmt-chip a:hover { text-decoration: underline; }
.stmt-chip a.del { color: var(--danger); }
.stmt-chip.on { border-style: solid; border-color: #2e9e5b; color: #2e9e5b; background: rgba(46,158,91,.08); }
.stmt-chip.on a { color: #2e9e5b; }
.stmt-chip.on a.del { color: var(--danger); }

/* ===== 工资表 / 固定资产 ===== */
.input.xs { height: 26px; padding: 0 6px; font-size: 12px; }
.btn.xs { height: 22px; min-width: 22px; padding: 0 5px; font-size: 12px; line-height: 1; }
.input.xs.num { text-align: right; font-family: var(--mono); }
td.c-num, th.c-num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12.4px; white-space: nowrap; }
/* 操作列一律不换行：列多的时候浏览器会把这一列压到 40px，「编辑」「删除」就上下叠成两行，
   看着像两排按钮（v1.21.32 辅助核算员工页签实测） */
td.c-act { white-space: nowrap; }
td.c-act a { color: var(--primary); cursor: pointer; margin-right: 10px; font-size: 12.4px; }
td.c-act a:hover { text-decoration: underline; }
td.c-act a:last-child { margin-right: 0; }
.mono { font-family: var(--mono); font-size: 12.6px; font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

.sal-tbl { font-size: 12.6px; }
.sal-tbl th { padding: 8px 6px; }
.sal-tbl td { padding: 4px 6px; }
.sal-tbl tbody tr:hover { background: #f8faff; }
.sal-tbl input.input.xs { width: 100%; }
.sal-total td { background: var(--panel-2); font-weight: 600; border-top: 2px solid var(--border); }
.row-done { opacity: .6; }

/* ================= 逐层下钻：可点科目 / 凭证链接 ================= */
a.drill, .drill-link {
  color: #2563eb; cursor: pointer; text-decoration: none; border-bottom: 1px dashed rgba(37, 99, 235, .45);
}
a.drill:hover, .drill-link:hover { color: #1d4ed8; border-bottom-color: #1d4ed8; }
.drill-vno { font-family: var(--mono); }

/* 明细账：左侧表格 + 右侧科目树 */
.dm-layout { display: flex; gap: 10px; align-items: stretch; min-height: 300px; }
.dm-main { flex: 1 1 auto; min-width: 0; }
.dm-tree {
  flex: 0 0 236px; border-left: 1px solid var(--border); padding: 4px 0 8px 10px;
  max-height: calc(100vh - 250px); overflow: auto;
}
.dm-tree-t { font-size: 11.5px; color: var(--text-2); padding: 4px 8px 6px; position: sticky; top: 0; background: var(--panel); z-index: 2; }
.dm-tree input { width: 100%; margin: 0 0 6px; }
.dm-node {
  padding: 4px 8px; border-radius: 4px; cursor: pointer; font-size: 12.5px;
  display: flex; gap: 6px; align-items: baseline; white-space: nowrap; overflow: hidden;
}
.dm-node:hover { background: var(--panel-2); }
.dm-node.on { background: rgba(37, 99, 235, .1); color: #1d4ed8; font-weight: 600; }
.dm-node .c { font-family: var(--mono); color: var(--text-2); font-size: 11.5px; }
.dm-node.lv1 { padding-left: 8px; }
.dm-node.lv2 { padding-left: 20px; }
.dm-node.lv3 { padding-left: 32px; }
.dm-node.lv4 { padding-left: 44px; }
.dm-tree-empty { padding: 10px 8px; color: var(--text-2); font-size: 12px; }

/* 明细账：柠檬云那种「期初 / 本期合计 / 本年累计」行 */
table.dm2 td.dm-lbl { color: var(--text-2); font-size: 12px; }
table.dm2 tr.row-open td, table.dm2 tr.row-sum td, table.dm2 tr.row-year td { background: #f7f9fe; }
table.dm2 tr.row-open td { border-top: 1px solid var(--border-strong); }
table.dm2 tr.row-year td { font-weight: 600; }
table.dm2 tr.grp-sep td { background: #eef3fd; font-weight: 700; padding: 8px 12px; border-top: 2px solid var(--border-strong); }

/* ================= 单张凭证查看 ================= */
/* width:fit-content —— 凭证块跟着表格宽度走（默认约 770px，用户拖宽了它也跟着变宽），
   不再让表格拉满整屏把摘要列撑成一条河 */
.vdoc { padding: 16px 20px 20px; width: fit-content; max-width: 100%; }
.vdoc-head { position: relative; border-bottom: 2px solid var(--text); padding-bottom: 8px; margin-bottom: 10px; }
.vdoc-title { text-align: center; font-size: 21px; font-weight: 700; letter-spacing: 6px; }
.vdoc-stamp {
  position: absolute; right: 6px; top: 2px; transform: rotate(-9deg);
  color: #d14343; border: 2px solid #d14343; border-radius: 4px;
  padding: 1px 8px; font-size: 13px; font-weight: 700; letter-spacing: 2px; opacity: .85;
}
.vdoc-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 12.5px; color: var(--text-2); margin-top: 6px; }
/* 凭证表不铺满容器：宽度由各列之和决定（行内 style），这里把 min-width:100% 的下限撤掉 */
table.vdoc-tbl { min-width: 0; }
/* 凭证表格子左右留白比普通报表小一点，同样的列宽能多放两个字 */
table.vdoc-tbl th, table.vdoc-tbl td { padding-left: 9px; padding-right: 9px; }
table.vdoc-tbl td { height: 36px; vertical-align: middle; }
table.vdoc-tbl tr.vdoc-empty td { height: 36px; }
table.vdoc-tbl td.vdoc-sum { text-align: right; }
table.vdoc-tbl td.vdoc-subj .vdoc-cf { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
/* 合计行：右边放「制单 / 审核」，和合计挤在同一行，省下一整行高度 */
table.vdoc-tbl tfoot td { background: var(--panel-2); font-weight: 600; }
table.vdoc-tbl tfoot td.vdoc-sign {
  font-weight: 400; font-size: 12px; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
table.vdoc-tbl tfoot.unbalanced td { background: var(--danger-weak); color: var(--danger); }
/* 修改态 */
.vdoc-editbar { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
table.vdoc-tbl input.vdoc-in {
  width: 100%; min-width: 0; padding: 3px 6px; font-size: 12.5px;
  border: 1px solid var(--border-strong); border-radius: 4px; background: #fff;
}
table.vdoc-tbl input.vdoc-in.num { text-align: right; font-family: var(--mono); }
table.vdoc-tbl tr.vdoc-row-edit td { height: 34px; padding: 3px 9px; }
/* 行号列：平时显示序号，鼠标移到这一行才变成「×」——52px 窄列放不下「2 ×」两样东西 */
table.vdoc-tbl tr.vdoc-row-edit td.c { position: relative; }
.vdoc-del {
  position: absolute; left: 0; right: 0; top: 0; bottom: 0;
  display: none; align-items: center; justify-content: center;
  color: var(--danger); cursor: pointer; font-size: 15px; line-height: 1;
}
table.vdoc-tbl tr.vdoc-row-edit:hover td.c > span.vnum { visibility: hidden; }
table.vdoc-tbl tr.vdoc-row-edit:hover .vdoc-del { display: flex; }
.vdoc-del:hover { background: var(--danger-weak); }
/* 附件区 */
.vdoc-files { margin-top: 14px; border-top: 1px dashed var(--border-strong); padding-top: 10px; }
.vdoc-files-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.vdoc-files-head .spacer { flex: 1; }
.vdoc-memo { margin-top: 8px; font-size: 12.5px; color: var(--text-2); }

/* ================= 工资表 / 员工 / 工资条（v1.10.0） ================= */
/* 勾选框内联标签（工资表工具栏「社保拆分明细」） */
.chk-inline {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px;
  color: var(--text-2); cursor: pointer; user-select: none;
  padding: 0 4px; white-space: nowrap;
}
.chk-inline input[type="checkbox"] { width: 14px; height: 14px; margin: 0; cursor: pointer; }

/* 导入预览头部的标签行 */
.imp-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 9px 12px; margin-bottom: 10px; font-size: 12.5px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.imp-head .muted { margin-left: auto; }

/* 工资表：社保四列窄一点，金额右对齐 */
table.sal-tbl td.si-col, table.sal-tbl th.si-col { width: 74px; }
table.sal-tbl input.input { padding: 3px 6px; text-align: right; font-family: var(--mono); }
table.sal-tbl td .input { width: 100%; min-width: 0; }
table.sal-tbl td { padding: 3px 4px; }

/* 工资条（屏幕上那张卡片；打印窗口用 PAY_CSS，互不影响） */
.payslip-box { padding: 4px 2px 0; }
.payslip-box .pay-slip {
  background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 16px 18px 14px; box-shadow: var(--shadow-sm);
}
.payslip-box .pay-title {
  text-align: center; font-size: 18px; font-weight: 700;
  letter-spacing: 8px; color: var(--text); padding-bottom: 10px;
}
.payslip-box .pay-meta {
  display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: space-between;
  font-size: 12.5px; color: var(--text-2); padding-bottom: 10px;
  border-bottom: 1px dashed var(--border-strong); margin-bottom: 10px;
}
.payslip-box .pay-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.payslip-box .pay-tbl th, .payslip-box .pay-tbl td {
  border: 1px solid var(--border); padding: 5px 8px; vertical-align: top;
}
.payslip-box .pay-tbl th { background: var(--panel-2); text-align: center; font-weight: 600; color: var(--text-2); }
.payslip-box .pay-tbl .n { text-align: right; font-family: var(--mono); white-space: nowrap; }
.payslip-box .pay-sec { background: var(--primary-weak); text-align: center; font-weight: 600; color: var(--primary-dark); }
.payslip-box .pay-in { width: 100%; border-collapse: collapse; }
.payslip-box .pay-in td { border: none; padding: 1px 0; }
.payslip-box .pay-in td.n { text-align: right; }
/* 扣款分组（代扣社保）：工资条上把三险归到一块，避免一堆项目平铺看不出层次 */
.payslip-box .pay-in tr.pay-grp td {
  padding-top: 4px; font-weight: 600; color: var(--text-2); font-size: 11.5px; letter-spacing: .04em;
}
.payslip-box .pay-in td.zero { color: var(--muted); }
.payslip-box .pay-cell { padding: 5px 8px; }
.payslip-box .pay-total { font-weight: 700; background: var(--panel-2); font-size: 13px; }
.payslip-box .pay-foot {
  display: flex; flex-wrap: wrap; gap: 4px 18px; justify-content: space-between;
  font-size: 12px; color: var(--text-2); margin-top: 10px;
}

/* 工资统计表 / 资产汇总表：分块小标题 */
.fa-sum-block { margin-bottom: 6px; }
.fa-sum-title {
  font-size: 13px; font-weight: 600; color: var(--text); margin: 14px 0 8px;
  padding-left: 9px; border-left: 3px solid var(--primary);
}
.fa-sum-block:first-child .fa-sum-title { margin-top: 0; }

/* ============ 导入旧账向导（v1.10.2） ============ */
.impw-steps {
  display: flex; align-items: center; gap: 0; margin-bottom: 16px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 18px; box-shadow: var(--shadow-sm);
}
.impw-step { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.impw-step i {
  width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel-2); border: 1px solid var(--border-strong); font-style: normal; font-size: 12px; font-weight: 600;
}
.impw-step.on { color: var(--primary); font-weight: 600; }
.impw-step.on i { background: var(--primary); border-color: var(--primary); color: #fff; }
.impw-step.done { color: var(--success); }
.impw-step.done i { background: var(--success-weak); border-color: var(--success); color: var(--success); }
.impw-steps em { flex: 1; height: 1px; background: var(--border-strong); margin: 0 14px; min-width: 20px; }

.impw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.impw-full { grid-column: 1 / -1; }
.impw-ym { display: flex; gap: 6px; align-items: center; }
.impw-foot {
  display: flex; gap: 10px; align-items: center; justify-content: flex-end;
  margin-top: 14px; padding: 12px 16px; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}

.impw-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  padding: 34px 20px; cursor: pointer; background: var(--panel-2); transition: .16s;
}
.impw-drop:hover, .impw-drop.hover { border-color: var(--primary); background: var(--primary-weak); }
.impw-drop-ico { font-size: 26px; color: var(--primary); line-height: 1; }
.impw-drop b { font-size: 14px; }
.impw-drop span { font-size: 12px; color: var(--muted); }

.impw-tips { margin-top: 16px; font-size: 12.5px; color: var(--text-2); }
.impw-tips ul { margin: 6px 0 8px; padding-left: 20px; }
.impw-tips li { margin: 3px 0; }

.impw-busy { display: flex; align-items: center; gap: 10px; padding: 28px 4px; color: var(--text-2); }
.impw-busy .spin {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong);
  border-top-color: var(--primary); animation: impw-spin .7s linear infinite;
}
@keyframes impw-spin { to { transform: rotate(360deg); } }

.impw-hero { border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 14px; }
.impw-hero-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.impw-hero-sub { font-size: 12.5px; color: var(--muted); margin-top: 5px; }

.impw-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.impw-kpi, .impw-kpis .kpi {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--panel-2);
}
.impw-kpis .kpi i { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); }
.impw-kpis .kpi b { display: block; font-size: 17px; font-weight: 700; font-family: var(--mono); margin: 2px 0 1px; }
.impw-kpis .kpi span { font-size: 11.5px; color: var(--muted); }
.impw-kpis .kpi.good b { color: var(--success); }
.impw-kpis .kpi.bad b { color: var(--danger); }

.impw-sec { margin-top: 18px; }
.impw-sec-t { font-size: 13px; font-weight: 600; margin-bottom: 8px; padding-left: 9px; border-left: 3px solid var(--primary); }
.impw-colbox { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 11px; background: var(--panel-2); margin-bottom: 8px; }
.impw-colbox-h { font-size: 12px; color: var(--text-2); margin-bottom: 7px; }
.impw-cols { display: flex; flex-wrap: wrap; gap: 6px; }
.impw-col {
  font-size: 11.5px; border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 2px 9px; background: #fff; color: var(--muted);
}
.impw-col.ok { border-color: #bfd7ff; background: var(--primary-weak); color: var(--primary-dark); }
.impw-col em { font-style: normal; margin-left: 5px; opacity: .85; }

.impw-issues {
  margin-top: 14px; border: 1px solid var(--warn); background: var(--warn-weak);
  border-radius: var(--radius); padding: 10px 14px; font-size: 12.5px; color: #7c4a03;
}
.impw-issues-t { font-weight: 600; margin-bottom: 4px; }
.impw-issues ul { margin: 0; padding-left: 18px; max-height: 170px; overflow: auto; }
.impw-issues li { margin: 2px 0; }

.impw-warn {
  margin-top: 12px; border: 1px solid #f0c987; background: var(--warn-weak);
  border-radius: var(--radius-sm); padding: 9px 12px; font-size: 12.5px; color: #7c4a03;
}
.impw-good {
  margin-top: 12px; border: 1px solid #b9e6cd; background: var(--success-weak);
  border-radius: var(--radius-sm); padding: 9px 12px; font-size: 12.5px; color: #0b6b3d;
}
.impw-bad {
  border: 1px solid #f3b9b5; background: var(--danger-weak); color: #8a1c17;
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px;
}
.impw-sub { margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.impw-chk { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; color: var(--text); }

.impw-src { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.impw-src label {
  display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 12px 14px; cursor: pointer; background: var(--panel-2);
}
.impw-src label.on { border-color: var(--primary); background: var(--primary-weak); box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }
.impw-src label input { display: none; }
.impw-src label b { font-size: 13px; }
.impw-src label span { font-size: 12px; color: var(--muted); }

.impw-done { display: flex; gap: 14px; align-items: center; }
.impw-done-ico {
  width: 40px; height: 40px; border-radius: 50%; background: var(--success-weak);
  color: var(--success); display: flex; align-items: center; justify-content: center; font-size: 20px; flex: none;
}
.impw-row-bad td { background: #fff5f5; }

@media (max-width: 900px) {
  .impw-grid, .impw-kpis, .impw-src { grid-template-columns: 1fr; }
}

/* ============ 工资表：两行分组表头（v1.10.3） ============ */
.sal-tbl thead th { padding: 7px 10px; }
/* 第一行：分组标题（应发项目 / 代扣社保 / 其他代扣），比正文略淡、居中 */
.sal-tbl thead tr.sal-grp th {
  text-align: center; padding: 3px 6px; font-size: 11.5px; font-weight: 600;
  letter-spacing: .08em; color: var(--text-2); background: #eff3fa;
  top: 0; z-index: 3;
}
/* 分组之间画一条稍重的竖线，避免 15 列看着糊成一片 */
.sal-tbl thead th.sal-gsep, .sal-tbl tbody td.sal-gsep { border-left: 1px solid var(--border-strong); }
.sal-tbl thead tr.sal-grp th.sal-gsep { border-left: 1px solid var(--border-strong); }
/* 第二行是叶子列名，吸顶要顶在第一行下面（--sal-h1 由脚本按实测高度写入） */
.sal-tbl thead tr.sal-leaf th { background: var(--panel-2); top: var(--sal-h1, 27px); z-index: 2; }
.sal-tbl tfoot td.sal-gsep { border-left: 1px solid var(--border-strong); }

/* 「社保还没细分」提示条 */
.sal-split {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 10px; padding: 9px 14px; font-size: 12.5px;
  border: 1px solid #f0c987; background: var(--warn-weak); color: #7c4a03; border-radius: var(--radius-sm);
}
.sal-split b { font-family: var(--mono); }
.sal-split .btn { margin-left: auto; }

/* ===== 凭据查重弹窗（跨单重复文件分组） ===== */
.dup-group { border: 1px solid var(--border); border-radius: var(--radius-sm); margin: 12px 0; overflow: hidden; }
.dup-head {
  padding: 8px 12px; font-size: 12.5px; font-weight: 600; background: #fdf3f3;
  border-bottom: 1px solid var(--border); color: #8c2f2f;
}
.dup-group .file-grid { padding: 12px; }
.dup-group .file-item { width: 168px; }

/* ============ 费用报销审核台账（v1.11.6） ============ */
/* 风险行底纹：只给高/中，低风险不加色，避免整屏花 */
.tbl tbody tr.row-risk-high > td { background: var(--danger-weak); }
.tbl tbody tr.row-risk-mid > td { background: var(--warn-weak); }
.tbl tbody tr.row-risk-high:hover > td { background: #fde0dd; }
.tbl tbody tr.row-risk-mid:hover > td { background: #fff3d9; }
/* 问题/备注列：限高 + 省略，完整内容看 title 或点开单据 */
.tbl td.wrap-cell { line-height: 1.5; }
.risk-note {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; font-size: 12.5px; color: var(--text-2);
}
/* 台账页的 tab 条 */
.tabs-line .btn.on, .tabs-line .btn.primary { font-weight: 600; }
/* 费用明细列：长事由只显示两行，悬停看全文，避免整行被撑高 */
.memo-cell {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.45;
}
/* 付款信息多笔换行后行高会变，压一下行距 */
.tbl td.mono { line-height: 1.45; }

/* ============ 费用报销台账：可双击修改的单元格 ============ */
.cell-edit { display: inline-block; min-width: 24px; border-bottom: 1px dashed transparent; cursor: text; }
.tbl tbody tr:hover .cell-edit { border-bottom-color: var(--border-strong); }
.cell-edit:hover { border-bottom-color: var(--primary); background: var(--primary-weak); border-radius: 3px; }
.cell-input { border: 1px solid var(--primary) !important; box-shadow: 0 0 0 2px var(--primary-weak); }

/* 查重的「已复核」行**不做整体淡出**（v1.21.3）。
   原来 tr 上挂 opacity:.62，写完结论整行发灰 —— 用户 2026-11-04：
   「界面写完后也是黑色，不要灰色」。写完就该还是一条正常的黑字记录，
   靠「复核结论」格里有内容来区分，而不是把字变淡。 */
.dup-tbl .tbl tr.row-done { opacity: 1; }

/* 疑点复核结论：绿字，和「待处理」的红/橙分开；行上还有 .row-done 整体淡出 */
.tbl td .rv-note {
  color: #1a7f4b; line-height: 1.55; word-break: break-word;
  border-left: 2px solid #bfe8cf; padding-left: 6px;
}

/* 复核结论就地编辑（v1.21.2）：格子里直接写，写完自动保存。
   平时看着像正文，鼠标移上去才显一点底色，点进去才像输入框 ——
   不要一上来就是一个灰框，那看着像表单，没人愿意填。
   v1.21.3 起正文用黑色（用户：「字体都是黑色」），左侧那道绿线保留，
   只当「这行有结论」的细标记，不再靠颜色区分状态。 */
.rv-edit {
  min-height: 19px; font-size: 12.5px; line-height: 1.6; color: var(--text);
  border-left: 2px solid #bfe8cf; padding: 1px 6px; border-radius: 3px;
  outline: none; cursor: text; word-break: break-word; white-space: pre-wrap;
}
.rv-edit.is-empty { border-left-color: transparent; padding-left: 6px; }
/* 空结论格不再画「写一句结论，自动保存」的灰字提示（用户 2026-11-04：「这个提示就不用显示了」）。
   表格里一列十几行都挂同一句灰话，看着像没填的表单；点进去就能写，不用教。 */
.rv-edit:hover { background: var(--primary-weak); border-left-color: #bfe8cf; }
.rv-edit:focus {
  background: #fff; border-left-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-weak);
}
.rv-meta {
  margin-top: 3px; padding-left: 6px; font-size: 11.5px; color: var(--text-3);
  display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline;
}
.rv-stat.ok { color: #1a7f4b; }
.rv-stat.busy { color: var(--warn); }
.rv-stat.err { color: var(--danger); }
/* 台账改过 → 原结论失效（v1.21.4）：结论还留着让人看得见，但提示要重核 */
.rv-stale {
  font-size: 11px; color: #8a5a00; background: #fff4e0;
  border: 1px solid #f3d9a8; border-radius: 3px; padding: 0 4px;
}

/* 疑似多报：数字格，能直接改（v1.21.3）。
   平时就是右对齐的黑数字，鼠标移上去出一道下划线暗示「这个能点」；
   人工核定过的加粗 —— 一眼分得出「系统估的」和「人核过的」。 */
.exp-edit {
  display: inline-block; min-width: 58px; text-align: right;
  font-size: 12.5px; font-variant-numeric: tabular-nums;
  color: var(--text); padding: 0 3px; border-radius: 3px;
  outline: none; cursor: text; border-bottom: 1px dashed transparent;
}
.exp-edit:hover { background: var(--primary-weak); border-bottom-color: var(--border-strong); }
.exp-edit:focus {
  background: #fff; border-bottom-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-weak);
}
.exp-edit.is-empty::before { content: attr(data-ph); color: var(--text-3); }
.exp-edit.is-fixed { font-weight: 600; }
.exp-edit.is-saving { opacity: .5; }

/* 风险列可改（v1.21.4）：标签本身就是入口，点一下换成下拉。
   不另开窗口 —— 一列几十行，弹窗一个一个关太慢。
   人工核定过的数字后面跟一个小圆点，和机器判的分开。 */
.risk-edit { cursor: pointer; }
.risk-edit:hover { outline: 2px solid var(--primary-weak); outline-offset: 1px; border-radius: 4px; }
.risk-man {
  font-style: normal; margin-left: 2px; font-size: 15px; line-height: 1;
  color: var(--primary); font-weight: 700;
}
.risk-sel { min-width: 76px; height: 21px; padding: 0 2px; font-size: 12px; }

/* 台账详情里的付款明细：就地改、就地加行、就地存（v1.21.4）。
   表格用 fixed 布局，输入框撑满单元格，看起来就是一张能直接编辑的表。 */
.pay-head {
  display: flex; align-items: center; gap: 10px; margin: 12px 0 4px;
}
.pay-head h4 { margin: 0; }
.pay-tbl { table-layout: fixed; }
.pay-tbl td { padding: 3px 5px; vertical-align: middle; }
.pay-tbl .pay-in {
  border: 1px solid transparent; background: transparent; box-shadow: none;
  height: 24px; line-height: 1.3;
}
.pay-tbl .pay-in:hover { border-color: var(--border); background: #fff; }
.pay-tbl .pay-in:focus {
  border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 2px var(--primary-weak);
}
.pay-tbl .pay-del {
  color: var(--text-3); text-decoration: none; font-size: 15px; line-height: 1;
}
.pay-tbl .pay-del:hover { color: var(--danger); }
/* 占位提示要淡到一眼看出「这是提示不是数据」——
   一列十几行都顶着同一串灰字，很容易被当成已经填好的值。 */
.pay-tbl .pay-in::placeholder { color: var(--text-3); opacity: .45; }

/* 「重复 / 风险核查」9 列，窗口不宽时必然横向滚动；「复核结论」是唯一要动手的列，
   所以钉在右边。sticky 单元格必须自带底色（否则滚过来的字会透过去），
   border-collapse 下边框会被盖掉，用内阴影补线（同 th 吸顶的做法）。
   v1.21.1 起排除 .tbl-sub（跨整行的明细行）：它的 td 也是 last-child，
   sticky + right:0 会把明细内容钉在右边、和上面的列错位。 */
.dup-tbl .tbl tr:not(.tbl-sub) > td:last-child {
  position: sticky; right: 0; z-index: 1;
  background: var(--panel);
  box-shadow: inset 1px 0 0 var(--border), -7px 0 9px -8px rgba(15, 23, 42, .22);
}
.dup-tbl .tbl th:last-child {
  position: sticky; right: 0; z-index: 3;
  background: var(--panel-2);
  box-shadow: inset 1px 0 0 var(--border), inset 0 -1px 0 var(--border-strong),
    -7px 0 9px -8px rgba(15, 23, 42, .22);
}
/* 行 hover 的底色挂在 tr 上，会被上面自带底色的 td 挡住，单独补一条 */
.dup-tbl .tbl tbody tr:not(.tbl-sub):hover > td:last-child { background: #f8faff; }

/* ============ 群组线索（v1.21.0 / 表格化 v1.21.1） ============
   一张发票 / 一张截图被多单引用时，原来按 C(n,2) 铺成十几行，用户「分不清到底有多少笔」。
   v1.21.0 先做成一摞卡片，用户「这里的界面看不习惯，还是按照这种来显示」（指成对线索那套表）
   —— 所以 v1.21.1 改成**同一张 9 列表**：群组占一行，笔数 > 2 的在下面跟一条跨整行明细
   把 N 笔铺开（「11 笔合计 198.94 比发票金额 253.00 少 54.06…」）。
   这里只剩三样：分组小标题、明细行、明细里的单据网格。 */
.dup-sec > td {
  background: var(--panel-2); font-size: 12.5px; font-weight: 600; color: var(--text-2);
  padding: 6px 12px; border-top: 1px solid var(--border-strong);
  position: static;
}
.dup-sec .muted { font-weight: 400; }
.dup-tbl .tbl tr.tbl-sub > td { position: static; background: #fffdf7; padding: 7px 12px 9px; }
/* 明细行只占前 4 列（v1.21.7），后面补的空格子要用正常底色 ——
   否则那几列（尤其「复核结论」）的竖带被一块米黄横条切断，看着像糊在一起。
   用户 2026-11-05：「这个就不参加前面的合并一块，显示界面清爽些」。 */
.dup-tbl .tbl tr.tbl-sub > td.tbl-sub-fill {
  background: var(--panel); border-left: 1px solid var(--border);
}
/* 明细块：宽度跟着前 4 列走，左边一道细竖线表示「这是上面那条的明细」 */
.dup-sub {
  border-left: 2px solid var(--border-strong);
  padding-left: 9px;
}
.dup-sub-h { font-size: 12px; color: var(--text-2); margin-bottom: 5px; line-height: 1.6; }
.dup-more { font-size: 13px; color: var(--text); }
.dup-more b { color: var(--danger); }

/* 明细折叠（v1.21.8）：3 笔以上的组默认收起，「其余 N 笔」那一格变成开关。
   用户 2026-11-05：「我点击就能显示下面的明细，可以用户选择展开还收起来的那种」。
   要做成一个能点的东西，所以是 button —— 不能只加颜色，光标形状和焦点框都得对。 */
.dup-flip {
  display: inline-flex; align-items: center; gap: 7px;
  max-width: 100%; padding: 2px 8px 2px 7px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px;
  font: inherit; line-height: 1.5; color: inherit;
  cursor: pointer; white-space: nowrap;
}
.dup-flip:hover { background: #eef2ff; border-color: #c7d2fe; }
.dup-flip:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.dup-flip.is-open { background: #eef2ff; border-color: #c7d2fe; }
.dup-flip .dup-more { font-size: 12.5px; }
/* 开关的那半截字小一号、用主色，一眼看出「这里是按钮」而不是又一行结论 */
.dup-flip-t { font-size: 11.5px; color: var(--primary); white-space: nowrap; }
.dup-tbl .tbl tr.is-folded { display: none !important; }

/* 拆报组的「建议」列（v1.21.10）没有特殊样式，跟着普通文本走。
   表尾合计里的金额单独加粗、稍微放大一号 —— 用户要的就是「一共多少钱」这一个数。 */
.dup-tbl .tbl tfoot td { font-variant-numeric: tabular-nums; }
.dup-foot-sum { font-size: 13.5px; font-weight: 700; color: var(--text); }
.dup-tbl .tbl tfoot td:nth-child(5) { font-weight: 400; font-size: 12px; color: var(--text-2); }

/* 付款拆分（v1.21.8）：这单 40 块是「38 + 2」两笔付出去的，还是一笔 40 ——
   用户 2026-11-05：「这个 40 元是有 38+2，两笔组成」「在旁边这样显示」。
   挂在那一单的下一排、跨满 4 列，不去挤上面的单号/人名/金额/日期。 */
.dup-pay {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 5px;
  /* 缩进 10px：一眼看出这是上一单的附属行，不是又一张单 */
  margin: -1px 0 2px; padding-left: 10px;
  font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums;
}
/* 上面的 `.dup-grp-row > :last-child` 会把它当成「金额/日期」右对齐，这里拉回来 */
.dup-grp-row > .dup-pay { text-align: left; }
.dup-pay-n { color: var(--text-3); font-size: 11px; }
/* 加号 / 等号淡一档，数字留在正文色 —— 一眼数得出「38 + 2 = 40」 */
.dup-pay-x { color: var(--text-3); }
/* 付款合计和报销额对不上：这是「付款大于报销」那类真风险，整条标红 */
.dup-pay.is-gap { color: var(--danger); }
.dup-pay.is-gap .dup-pay-n { color: var(--danger); opacity: .75; }
.dup-pay.is-gap .dup-pay-x { color: var(--danger); opacity: .6; }
.dup-pay-gap { margin-left: 4px; font-size: 11.5px; }
/* 20 位全电票号要能整段读出来，窄列里也按字符折行、不要被省略 */
.dup-code {
  font-size: 12px; letter-spacing: .2px; word-break: break-all;
  color: var(--text); line-height: 1.45;
}
.dup-grp-body {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2px 18px;
}
/* 单号 + 审批状态徽标同一行（v1.21.9）。单号长度固定 13 位，徽标宽度随文案变，
   所以给个 nowrap + 居中，别让徽标掉到第二行去。 */
.dup-cell-no { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dup-grp-row {
  /* 单号给固定宽、姓名吃掉剩下的：原来 1fr 挂在单号上，单号那格被撑到两百多像素，
     姓名被推到很远，一行看着像三段散开的字。金额和日期靠右对齐，竖着能对着读。
     v1.21.9：第一列 116 → 176px，单号后面要跟一枚状态徽标。 */
  display: grid; grid-template-columns: 176px 1fr 74px 80px;
  gap: 6px; align-items: baseline; font-size: 12.5px; padding: 1px 0;
}
.dup-grp-no { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.dup-grp-no a { color: var(--primary); }
.dup-grp-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.dup-grp-row > .dup-grp-amt,
.dup-grp-row > :last-child { text-align: right; font-variant-numeric: tabular-nums; }
.dup-grp-row > a { color: var(--primary); }

/* 序号列（v1.21.6）：等宽数字，三位数也不会把列宽顶开、更不会折成两行 */
.dup-seq {
  font-family: var(--mono); font-size: 12px; color: var(--text-2);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* 发票号码重复全量核对表（v1.21.5）
   用户 2026-11-04：「18 个重复票号…直接在风险复查页列出」。
   放在主表下面当「底稿」用，所以默认折叠（有不在队列里的才自动展开，见 JS）；
   小节标题做成可点的横条，别让它抢主表的注意力。 */
.inv-dup {
  margin-top: 18px; border-top: 1px dashed var(--border-strong); padding-top: 10px;
}
.inv-dup > summary {
  cursor: pointer; font-size: 12.5px; color: var(--text-2);
  list-style: none; line-height: 1.8; outline: none;
}
.inv-dup > summary::-webkit-details-marker { display: none; }
.inv-dup > summary::before { content: '▸'; display: inline-block; width: 14px; color: var(--muted); }
.inv-dup[open] > summary::before { content: '▾'; }
.inv-dup > summary:hover { color: var(--text); }
.inv-dup .inv-tbl { margin-top: 8px; }
/* 这张表数据多、字小，行距收紧一点，18 行别占掉两屏 */
.inv-dup .inv-tbl table.tbl td { padding: 6px 10px; vertical-align: top; }
.dup-grp-amt { text-align: right; font-variant-numeric: tabular-nums; }

/* 按金额反查（v1.21.11）
   用户 2026-11-05：「这里给我增加一个金额查询。有 1713.7 这笔金额好像有好几个人报销」。
   放在所有线索表上面一条，跟筛选条区分开：它不是筛线索，是绕过规则直接按金额捞单。 */
.dup-amt {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 10px; padding: 8px 10px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
}
.dup-amt-lb { font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.dup-amt-hint {
  flex: 1 1 320px; min-width: 240px;
  font-size: 11.5px; line-height: 1.6; color: var(--text-3);
}
.dup-amt-hint b { color: var(--warn); font-weight: 600; }
/* 结果块和主表之间留出呼吸：这是「另一个视角的答案」，不是主表的续表 */
#dupAmtPanel:not(:empty) { margin-bottom: 12px; }
/* 主表把最后一列（复核结论）钉在右边是对的 —— 那是唯一要动手的列。
   金额结果表的最后一列只是「在不在队列里 / 查一下」，不需要钉；
   钉着反而平白多出一条 9px 的横向滚动条（粘住的格子会多算 2px）。 */
#dupAmtPanel .tbl tr > td:last-child,
#dupAmtPanel .tbl th:last-child {
  position: static; box-shadow: none; background: inherit;
}
/* 「与谁共用凭证」：＝ 是硬命中（同一张票 / 同一张图 / 同一个交易号），
   ≈ 只是弱提示（摘要像、费用日同）。颜色必须拉开，不然等于没说。 */
.dup-rel { font-size: 12px; line-height: 1.5; white-space: nowrap; }
.dup-rel + .dup-rel { margin-top: 3px; }
.dup-rel.is-strong { color: var(--danger); font-weight: 600; }
.dup-rel.is-weak { color: var(--warn); }
.dup-rel-t { font-weight: 400; font-size: 11px; color: var(--text-3); white-space: normal; }

/* 支付金额：点一下就能补录付款（一单可能多笔） */
.cell-pay { display: inline-block; min-width: 44px; cursor: pointer; border-bottom: 1px dashed transparent; }
.tbl tbody tr:hover .cell-pay { border-bottom-color: var(--border-strong); }
.cell-pay:hover { border-bottom-color: var(--primary); background: var(--primary-weak); border-radius: 3px; }
.pay-todo { color: var(--warn); font-size: 11.5px; }
.pay-todo::before { content: "✎ "; }
/* 按报销额推定的金额（图里没读出金额）：浅橙 + 虚线下划线，
   跟「图上读到的」区分开 —— 用户要能一眼看出哪些数要自己核对。 */
.amt-infer { color: var(--warn); border-bottom: 1px dashed currentColor; cursor: help; }
/* v1.20.5：逐格补录存住了但没刷新整表 —— 顶部浮条告诉用户「存了几处、要不要刷新」 */
.pay-dirty {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 2px 4px 2px 10px; border-radius: var(--radius-sm);
  background: var(--success-weak); color: var(--success);
  font-size: 12.5px; white-space: nowrap;
}
.pay-dirty b { font-weight: 600; }
.pay-dirty .btn { padding: 1px 8px; font-size: 12px; }
/* 刚存完那一格闪一下，让人确认「这个值进去了」 */
.cell-just-saved { animation: cellSaved 1.2s ease-out; }
@keyframes cellSaved {
  0% { background: var(--success-weak); }
  100% { background: transparent; }
}
/* 还在后台存（约 0.5 秒）：先把值画上，存的时候压暗一点，存完恢复。
   不压暗的话用户看不出「已经提交了」，会重复敲回车。 */
.cell-saving { opacity: .55; }
/* v1.20.4：图上付的比报销额多，照实登记了 —— 用「下划线点点」区分于推定（虚线），
   鼠标停上去会说差多少。不标的话「付款合计≠报销额」看起来像系统算错。 */
.amt-over { color: var(--primary); border-bottom: 1px dotted currentColor; cursor: help; }
/* 单内两笔付款一模一样：这是查重信号，标出来让人自己判 */
.pay-dup { color: var(--danger); }
/* v1.20.3：这张单有发票截图、但这一项没登记 —— 打黄标，别让它看起来像「本来就没有」 */
.inv-miss {
  display: inline-block; padding: 0 5px; border-radius: 3px; font-size: 11.5px;
  color: var(--warn); background: var(--warn-weak); border: 1px dashed var(--warn); cursor: help;
}
.pay-dup::before { content: ""; }

/* ================= 科目选择器（柠檬云同款：搜索 + 分类页签 + 新增科目） ================= */
.sp-pop {
  position: fixed; z-index: 9999; width: 430px; max-width: calc(100vw - 16px);
  background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  overflow: hidden; display: flex; flex-direction: column;
}
.sp-search { padding: 6px 8px; border-bottom: 1px solid var(--border); }
.sp-search .input { width: 100%; }
.sp-tabs { display: flex; gap: 2px; padding: 3px 6px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.sp-tab {
  border: 0; background: none; padding: 5px 9px; font-size: 12.5px; color: var(--text-2);
  cursor: pointer; border-bottom: 2px solid transparent; border-radius: 5px 5px 0 0;
}
.sp-tab:hover { background: var(--primary-weak); }
.sp-tab.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.sp-list { max-height: 268px; overflow: auto; padding: 3px 0; }
.sp-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; cursor: pointer; font-size: 12.5px; line-height: 1.35; }
.sp-row:hover, .sp-row.on { background: var(--primary-weak); }
.sp-code { font-family: var(--num); color: var(--text-2); flex: none; min-width: 68px; }
.sp-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-bal { flex: none; color: var(--muted); font-family: var(--num); }
.sp-empty { padding: 18px 12px; text-align: center; color: var(--muted); font-size: 12.5px; }
.sp-foot { border-top: 1px solid var(--border); padding: 5px 8px; display: flex; justify-content: center; background: var(--panel-2); }
.sp-add { border: 0; background: none; color: var(--primary); cursor: pointer; font-size: 12.5px; padding: 4px 8px; }
.sp-add:hover { text-decoration: underline; }
/* 一级/中间科目也列出来（v1.21.34）：点它是下钻看下级，不是选中，所以样式上做成「目录」而不是「条目」 */
.sp-row.par .sp-name { font-weight: 600; color: var(--text); }
.sp-tag {
  flex: none; font-size: 11px; color: var(--text-2); background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 1px 7px;
}
.sp-crumb {
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
  padding: 4px 10px; background: var(--primary-weak); border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text-2);
}
.sp-crumb.hidden { display: none; }
.sp-crumb-x {
  border: 0; background: none; color: var(--primary); cursor: pointer;
  font-size: 12px; padding: 2px 6px;
}
.sp-crumb-x:hover { text-decoration: underline; }

/* 新增科目弹窗 */
.modal.sp-create { width: 520px; }
.sc-form { padding: 4px 2px 0; }
.sc-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.sc-row > em { color: var(--danger); font-style: normal; flex: none; width: 8px; }
.sc-row > span:first-of-type { width: 74px; flex: none; color: var(--text-2); text-align: right; }
.sc-row .input { flex: 1; min-width: 0; }
.sc-dir { display: flex; gap: 18px; flex: 1; }
.sc-dir label { display: flex; align-items: center; gap: 5px; }
.sc-chk { display: flex; gap: 14px; align-items: center; flex: 1; flex-wrap: wrap; }
.sc-chk label { display: flex; align-items: center; gap: 5px; }
.sc-auxkind { width: 122px !important; flex: none !important; }
.sc-note { color: var(--danger); font-size: 12px; padding-left: 92px; }
/* 辅助核算维度多选块：勾「辅助核算」才展开（v1.14.2 从单选下拉改成多选） */
.sc-auxrow { align-items: flex-start; }
.sc-auxrow.hidden { display: none; }
.sc-auxbox {
  flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center;
  padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-1, #fafbfd);
}
.sc-auxbox > label { display: flex; align-items: center; gap: 5px; font-size: 12.5px; cursor: pointer; }
.sc-auxbox > label input:disabled + span { color: var(--text-3, #9aa4b8); }
.sc-auxbox .sc-note {
  flex-basis: 100%; padding-left: 0; color: var(--text-3, #98a2b3);
  font-size: 11.5px; line-height: 1.5;
}
/* 自动带出时提示改成主色，让用户注意到「系统替我勾了」 */
.sc-auxbox .sc-note.is-auto { color: var(--primary); }

/* 导入标准科目：准则二选一 */
.sync-std { font-size: 13px; }
.sync-opt {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: var(--panel);
}
.sync-opt:hover { border-color: var(--border-strong); }
.sync-opt.on { border-color: var(--primary); background: var(--primary-weak); }
.sync-opt input { margin-top: 3px; flex: none; }
.sync-opt > span { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.sync-opt i { font-style: normal; color: var(--muted); font-size: 12px; }

/* ================= 辅助核算（v1.13.0） ================= */
.aux-tabs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 0; }
.aux-tab {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: none; padding: 9px 12px 8px; cursor: pointer;
  font: inherit; font-size: 13px; color: var(--text-2); border-bottom: 2px solid transparent;
}
.aux-tab:hover { color: var(--primary); }
.aux-tab.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.aux-cnt {
  min-width: 18px; height: 16px; line-height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--bg-subtle, #f1f4f9); color: var(--muted); font-size: 11px; text-align: center;
}
.aux-tab.on .aux-cnt { background: var(--primary-weak); color: var(--primary); }
.aux-del { margin-left: 2px; color: #c9cede; font-style: normal; cursor: pointer; font-size: 13px; }
.aux-del:hover { color: var(--danger); }
/* 类别改名 / 停用 / 删除入口（v1.14.2）：常显淡色，hover 变主色，避免「找不到在哪改」 */
.aux-edit {
  margin-left: 1px; color: #9aa4b8; font-style: normal; cursor: pointer; font-size: 12px;
  line-height: 1; padding: 2px 3px; border-radius: 3px;
}
.aux-edit:hover { color: var(--primary); background: var(--primary-weak); }
/* 停用的类别：整块压灰，点进去还能重新启用 */
.aux-tab.off { opacity: .55; }
.aux-tab.off::after {
  content: '停用'; font-size: 10px; color: var(--muted); border: 1px solid var(--border);
  border-radius: 3px; padding: 0 3px; margin-left: 1px; font-weight: 400;
}
.aux-bar { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; }
.aux-bar .input { width: 220px; }
.aux-chk { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
/* 「列」下拉（v1.21.26）：开始日期/结束日期/备注 可登记但不必显示。
   面板绝对定位挂在按钮下面，th 不参与（th 绝不能 position:relative，见查重页那次的教训）。 */
.aux-colwrap { position: relative; display: inline-block; }
.aux-colbox {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; min-width: 148px;
  background: #fff; border: 1px solid var(--border, #e2e8f0); border-radius: 6px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .12); padding: 6px 10px 8px; display: flex; flex-direction: column; gap: 6px;
}
.aux-colbox[hidden] { display: none; }
.aux-colhd { font-size: 11.5px; color: var(--text-3, #94a3b8); padding-bottom: 2px; border-bottom: 1px solid var(--border, #eef2f7); margin-bottom: 2px; }
.aux-on { color: var(--success, #16a34a); }
#auxBody .tbl-wrap { max-height: calc(100vh - 300px); overflow: auto; }
/* 辅助核算类别管理弹窗（对齐柠檬云「辅助核算类别」页） */
.aux-tl-note { font-size: 12.5px; color: var(--text-2); line-height: 1.65; padding: 0 2px 10px; }
.aux-sys, .aux-cus {
  display: inline-block; padding: 0 6px; height: 19px; line-height: 17px; border-radius: 3px;
  font-size: 11.5px; background: #f1f4f9; color: #5b6679; border: 1px solid #e3e8f0;
}
.aux-cus { background: var(--primary-weak, #eef4ff); color: var(--primary, #2563eb); border-color: #d6e4ff; }
/* 批量识别营期（v1.14.3） */
.cls-note { font-size: 12.5px; color: var(--text-2); line-height: 1.65; margin-bottom: 8px; }
.cls-input { width: 100%; font-family: inherit; resize: vertical; margin-bottom: 10px; line-height: 1.6; }
.cls-sum { font-size: 12.5px; margin: 2px 0 8px; color: var(--text-2); }
.cls-sum b { color: var(--text-1, #1f2937); }
.cls-wrap { max-height: 320px; overflow: auto; }
.cls-miss td { color: #9aa4b8; }
.cls-ok { color: var(--success, #16a34a); }

/* 营种分类（v1.14.4）：档案表里的分类小标签 */
.aux-cat {
  display: inline-block; padding: 0 6px; height: 19px; line-height: 17px; border-radius: 3px;
  font-size: 11.5px; background: #eef7f0; color: #2f7a4f; border: 1px solid #d5ebdd;
}
#clBody .tbl-wrap { max-height: 380px; overflow: auto; }
#gsBody .tbl-wrap { max-height: 340px; overflow: auto; }
#gsBody .input { height: 24px; font-size: 12px; padding: 0 5px; width: 100%; }

/* ================= 活动分类总览 / 编码勾稽（v1.21.21） ================= */
/* 「编码不勾稽」的小叹号：不拦保存，只提醒。放编码右边一行内，不撑行高 */
.aux-bad {
  display: inline-block; width: 13px; height: 13px; line-height: 13px; margin-left: 4px;
  border-radius: 50%; background: #fdecec; color: #c0392b; border: 1px solid #f5c2c0;
  font-size: 10px; font-style: normal; text-align: center; cursor: help; vertical-align: 1px;
}
.aux-bad-txt { color: #c0392b; font-style: normal; }
.aux-dead-tag {
  display: inline-block; padding: 0 5px; height: 17px; line-height: 15px; border-radius: 3px;
  font-size: 11px; background: #f3f4f6; color: #8a94a6; border: 1px solid #e5e7eb;
}
.aux-row-dead td { color: #9aa4b8; }
.aux-row-dead td:first-child { color: #b8c0cf; }

.aux-stat-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 10px; }
.aux-stat { font-size: 12.5px; color: var(--text-2); }
.aux-stat b { color: var(--text-1, #1f2937); font-size: 14px; margin-right: 2px; }
.aux-stat.warn b { color: #c0392b; }
.aux-stat.warn { color: #a8443a; }

/* 三层树：大类行加底色、编码加粗；名称按层级缩进 —— 靠缩进 + 编码前缀两重看出层级 */
.aux-tree-wrap { max-height: calc(100vh - 330px); overflow: auto; }
.aux-tree .tr-l1 td { background: #f6f8fc; font-weight: 500; border-top: 1px solid var(--border); }
.aux-tree .tr-l1 td:first-child { font-weight: 700; color: var(--primary, #2563eb); letter-spacing: .5px; }
.aux-tree .tr-l2 td:nth-child(2) { padding-left: 22px; }
.aux-tree .tr-l3 td:nth-child(2) { padding-left: 44px; }
.aux-tree .tr-l3 td { color: var(--text-2); }
/* 第四级团号（v1.21.27）：唯一能记账的那层，稍微压深一点、前面加一道竖线当缩进指引 */
.aux-tree .tr-l4 td { color: var(--text-2); background: #fcfdfe; }
.aux-tree .tr-l4 td:nth-child(2) { padding-left: 66px; }
.aux-tree .tr-sec td {
  background: #fbfbfd; color: var(--muted); font-size: 12px; padding: 5px 8px; font-weight: 400;
}
.aux-tree .tr-orphan td:nth-child(2) { padding-left: 22px; }
/* 树上每行好几个操作链接（改分类 / ＋营种 / 编辑 / ＋营期 / 删除），拉开一点别挤成一条 */
.aux-tree td .lnk + .lnk { margin-left: 7px; }
.aux-lv {
  display: inline-block; padding: 0 4px; height: 16px; line-height: 14px; border-radius: 2px;
  font-size: 10.5px; font-weight: 400; border: 1px solid; vertical-align: 1px; margin-left: 2px;
}
.aux-lv.lv1 { background: #eef4ff; color: #2563eb; border-color: #d6e4ff; }
.aux-lv.lv2 { background: #eef7f0; color: #2f7a4f; border-color: #d5ebdd; }
.aux-lv.lv3 { background: #f5f3ff; color: #6d4ac9; border-color: #e3dcfb; }
.aux-lv.lv4 { background: #e8f6f1; color: #0f6e56; border-color: #cdeade; }
/* 列表里标出「团号」这种行（编码列后面的小字标签） */
.aux-lv-tag {
  display: inline-block; margin-left: 5px; padding: 0 4px; height: 16px; line-height: 14px;
  border-radius: 2px; font-size: 10.5px; font-style: normal; vertical-align: 1px;
  background: #e8f6f1; color: #0f6e56; border: 1px solid #cdeade;
}

/* 按规范初始化分类（两步弹窗） */
.bp-sec { font-size: 12.5px; font-weight: 600; color: var(--text-1, #1f2937); margin: 10px 0 6px; }
.bp-sec:first-of-type { margin-top: 4px; }
/* 预览里的「说明」：要能读完整句，别被 nowrap 切掉（fixed 布局下其它列仍 nowrap） */
table.tbl.fixed td.bp-note { white-space: normal; overflow: visible; text-overflow: clip; word-break: break-word; line-height: 1.5; }
#bpBody .tbl-wrap { max-height: 250px; overflow: auto; }
#bpBody .tbl td, #bpBody .tbl th { padding-top: 4px; padding-bottom: 4px; }
.aux-tag-warn {
  display: inline-block; padding: 0 5px; height: 17px; line-height: 15px; border-radius: 3px;
  font-size: 11px; background: #fff6e8; color: #a3651a; border: 1px solid #f3ddb8;
}
#gsBody td { padding-top: 4px; padding-bottom: 4px; }

/* 收款平台（v1.14.5） */
.rc-map { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 6px 0 10px; }
.rc-map label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.rc-map .input { height: 26px; font-size: 12.5px; max-width: 190px; }
.rc-voucher { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; background: #fff; }
.rc-v-head { font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.rc-voucher .tbl td { padding-top: 4px; padding-bottom: 4px; }
.rc-drop { min-height: 120px; }

/* 凭证行上的项目 / 团号下拉：和现金流量项目同一套视觉，横排两格 */
.vch-aux { display: flex; gap: 5px; margin: 0 9px 5px; }
.vch-aux.hidden { display: none; }
.vch-ax {
  flex: 1; min-width: 0; height: 24px; border: 1px solid #d6e4ff; border-radius: 5px;
  background: #f4f8ff; color: var(--text-2); font: inherit; font-size: 11.5px;
  padding: 0 4px; outline: none; cursor: pointer;
}
.vch-ax:focus { border-color: var(--primary); background: #fff; }
/* 科目挂了辅助核算却没选（v1.21.35）：描红 + 轻轻跳一下，让人一眼看到该点哪儿 */
.vch-ax.bad, .vd-ax.bad {
  border-color: var(--danger); background: #fff1f0; color: var(--danger);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, .12);
  animation: axShake .32s ease-in-out 1;
}
@keyframes axShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}
/* 凭证编辑弹窗里的辅助下拉：跟在科目格下面，比新增页窄一号 */
.vd-auxrow { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.vd-ax {
  height: 23px; min-width: 0; max-width: 158px; border: 1px solid #d6e4ff; border-radius: 5px;
  background: #f4f8ff; color: var(--text-2); font: inherit; font-size: 11.5px;
  padding: 0 4px; outline: none; cursor: pointer;
}
.vd-ax:focus { border-color: var(--primary); background: #fff; }
.neg { color: var(--danger); }

/* 生成凭证预览（v1.14.1）：一张单一个卡片，科目格可点开改 */
.acc-plan { max-height: 58vh; overflow: auto; padding-right: 4px; }
.acc-card { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; background: #fff; }
.acc-card:last-child { margin-bottom: 0; }
.acc-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 7px 10px; border-bottom: 1px solid var(--border);
  background: var(--bg-subtle, #f7f9fc); border-radius: 8px 8px 0 0; font-size: 13px;
}
.acc-head .spacer { flex: 1; }
.acc-tbl { width: 100%; border-collapse: collapse; }
.acc-tbl th, .acc-tbl td { padding: 3px 6px; border-bottom: 1px solid #eef1f6; }
.acc-tbl thead th { background: #fbfcfe; font-weight: 500; color: var(--text-2); font-size: 12px; }
.acc-tbl tbody tr:last-child td { border-bottom: 1px solid var(--border); }
.acc-tbl tfoot td { background: #fbfcfe; font-weight: 600; border-bottom: 0; }
.acc-tbl .input.xs { height: 26px; }
.acc-subj { background: #f7faff; }
.acc-subj:focus { background: #fff; border-color: var(--primary); }
.acc-diff { display: none; padding: 5px 10px; font-size: 12px; }
.acc-diff.bad { display: block; color: #b42318; background: #fff4f2; border-radius: 0 0 8px 8px; }

/* 发票登记核查（v1.21.15）：五个指标块 + 说明 + 两个动作按钮 */
.inv-kpis { display: flex; gap: 8px; flex-wrap: wrap; }
.inv-kpi {
  flex: 1 1 132px; min-width: 124px; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; background: #fff;
}
.inv-kpi-n { font-size: 21px; font-weight: 600; line-height: 1.15; color: var(--text); }
.inv-kpi-l { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.inv-kpi-s { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.inv-kpi.ok .inv-kpi-n { color: #0a7c42; }
.inv-kpi.warn { background: #fffbf2; border-color: #f3d9a4; }
.inv-kpi.warn .inv-kpi-n { color: #b54708; }
.inv-note {
  margin-top: 10px; padding: 9px 11px; border-radius: 8px; background: #f6f8fc;
  border: 1px solid #e4eaf3; font-size: 12.5px; line-height: 1.75; color: var(--text-2);
}
.inv-acts { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ===== 查重规则设置弹窗（v1.21.16）=====
   10 条内置规则一排一条：等级下拉 / 勾选启用 / 说明占剩余宽度。
   关掉的整行淡下去，但文字仍然读得清 —— 用户要能看出「这条被我自己关了」。 */
.dr-wrap { font-size: 12.5px; }
.dr-tip {
  background: #f6f8fb; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px; color: var(--text-2); line-height: 1.75; margin-bottom: 12px;
}
.dr-sec {
  font-weight: 700; margin: 2px 0 7px; display: flex; align-items: center; gap: 6px;
  font-size: 13px;
}
.dr-sec .muted { font-weight: 400; font-size: 12px; }
.dr-list { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.dr-row {
  display: flex; align-items: flex-start; gap: 9px; padding: 7px 10px;
  border-bottom: 1px solid var(--border); background: var(--panel);
}
.dr-row:last-child { border-bottom: none; }
.dr-row.off { background: var(--panel-2); }
.dr-row.off .dr-nm { color: var(--muted); }
.dr-row.off .dr-desc { opacity: .72; }
.dr-nm {
  width: 196px; flex: none; display: flex; align-items: center; gap: 6px;
  line-height: 1.5; padding-top: 3px;
}
.dr-desc { flex: 1; color: var(--muted); line-height: 1.65; font-size: 12px; padding-top: 4px; }
.dr-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 10px;
  margin-bottom: 8px; background: var(--panel-2);
}
.dr-c-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; flex-wrap: wrap; }
.dr-conds { display: flex; flex-direction: column; gap: 6px; }
.dr-cond { display: flex; align-items: center; gap: 6px; }
/* 规则行里 .input 默认 width:100%，在 flex 里会把说明文字挤成一条竖线 —— 这里定死各控件宽度 */
.dr-row > select.input { width: 74px; flex: none; }
.dr-row .dr-nm { width: 200px; }
.dr-row .dr-desc { flex: 1; min-width: 0; }
.dr-cond > select.input { flex: none; }
.dr-cond > select[data-cf] { width: 138px; }
.dr-cond > select[data-cop] { width: 118px; }
.dr-c-head > input.input { flex: none; }
/* 自定义规则卡片头：等级下拉同样会被 .input 的 100% 撑满一行，固定住 */
.dr-c-head > select.input { width: 74px; flex: none; }
.dr-row .dr-nm { width: 218px; }

/* ===== 「疑似多报」筛选提示条（v1.21.18）=====
   筛完必须留一条可见的痕迹：不然用户看着只有 8 行，会以为线索本来就这么多。 */
.dup-expbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--primary-weak); border: 1px solid #d6e4ff;
  border-radius: var(--radius-sm); padding: 6px 10px; margin-bottom: 8px;
  font-size: 12.5px; color: var(--text-2);
}
.dup-expbar b { color: var(--primary); }

/* ===== 风险变动提示条（v1.21.19）=====
   三种状态用三种底色：没参照点（灰）/ 一致（绿）/ 有变化（黄）。
   最怕的是把「没参照点」显示成「没变化」—— 那会让人以为查过了。 */
.snap-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 10px; margin-bottom: 8px; font-size: 12.5px;
  background: var(--panel-2); color: var(--text-2);
}
.snap-bar.info { background: #f6f8fb; border-color: #dbe3ef; }
.snap-bar.ok { background: var(--success-weak); border-color: #bfe6d2; }
.snap-bar.warn { background: var(--warn-weak); border-color: #f5d9a8; }
.snap-sep { color: var(--border-strong); }
.snap-up { color: var(--danger); }
.snap-down { color: var(--muted); }
.snap-chg { color: var(--warn); }
.snap-same { color: var(--success); }
.snap-sec { margin: 12px 0 5px; font-size: 13px; }
.snap-list { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.snap-li {
  display: flex; align-items: center; gap: 8px; padding: 5px 10px;
  border-bottom: 1px solid var(--border); font-size: 12.5px;
}
.snap-li:last-child { border-bottom: none; }

/* ---------- 期初余额录入（v1.21.24） ---------- */
table.tbl.fixed td > input.op-num {
  width: 100%; height: 27px; padding: 0 8px; text-align: right;
  border: 1px solid var(--border); border-radius: 4px; background: #fff;
  font-size: 12.5px; font-variant-numeric: tabular-nums; color: inherit;
}
table.tbl.fixed td > input.op-num:focus {
  border-color: var(--primary); outline: none; box-shadow: 0 0 0 2px rgba(59, 130, 246, .12);
}
table.tbl.fixed td > input.op-num::placeholder { color: #cbd2e0; }
.op-warn {
  margin: 0 0 10px; padding: 8px 12px; border-radius: 6px;
  background: rgba(245, 158, 11, .10); border: 1px solid rgba(245, 158, 11, .28);
  color: #92400e; font-size: 12px; line-height: 1.65;
}
/* 期初表的合计条：单独一行，宁可占一行也别被右侧裁掉半个「平衡」 */
.op-sumbar { display: flex; justify-content: flex-end; align-items: center; gap: 4px;
  padding: 2px 14px 8px; font-size: 12.5px; color: var(--text-2); }
.op-sumbar b { color: var(--text); font-variant-numeric: tabular-nums; }

/* 期初页签（v1.21.34）：对齐全柠檬云，按科目类别切，合计始终算全表 */
.op-tabs { display: flex; gap: 2px; align-items: center; }
.op-tab {
  border: 1px solid transparent; background: none; padding: 4px 12px; font-size: 12.5px;
  color: var(--text-2); cursor: pointer; border-radius: 999px;
}
.op-tab:hover { background: var(--primary-weak); }
.op-tab.on { color: var(--primary); background: var(--primary-weak); border-color: var(--primary); font-weight: 600; }
/* 试算平衡结果（v1.21.34）：只报告，不替用户配平 */
.op-check {
  margin: 0 0 12px; padding: 10px 14px; border-radius: 8px; font-size: 12.5px; line-height: 1.7;
  border: 1px solid var(--border);
}
.op-check.ok { background: var(--success-weak); border-color: #b7e3cc; color: #0a6b3d; }
.op-check.warn { background: var(--danger-weak); border-color: #f0b8b8; color: #8a1f1f; }
.op-check-head { font-weight: 600; }
.op-check-cats { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.op-cat {
  font-size: 11.5px; padding: 2px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, .6); border: 1px solid var(--border); color: var(--text-2);
}
.op-cat.on { color: var(--text); font-weight: 600; }
.op-check-hints { margin: 8px 0 0; padding-left: 18px; }
.op-check-hints li { margin-bottom: 3px; }
.op-check-foot { margin-top: 8px; color: var(--text-2); font-size: 11.5px; }
.op-check-foot a { color: var(--primary); cursor: pointer; }

/* 名单批量导入（v1.21.30）：拖放区 + 预览统计 */
.ri-drop { border: 1.5px dashed var(--line); border-radius: 8px; padding: 14px 16px; text-align: center;
  margin: 8px 0 10px; background: var(--bg-2); transition: border-color .15s, background .15s; }
.ri-drop.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--bg-2)); }
.ri-drop-hd { font-size: 13px; color: var(--text-2); }
.ri-sum { font-size: 12.5px; color: var(--text-2); margin: 10px 0 6px; }
.ri-sum b { color: var(--text); }
