/* style.css - 维财在线 3.0（与官网首页一致的蓝色主题） */
:root {
  /* 第二十一轮：统一蓝色阶 + 中性 slate 阶（原为 3 个蓝 + 7 个散灰） */
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --brand-700: #1e40af;
  --side-bg: #0b1f3f;
  --side-bg2: #122c55;
  --side-text: #9db4d6;
  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-500: #64748b;
  --ink-400: #94a3b8;
  --danger: #dc2626;
  --success: #15803d;
  --warn: #b45309;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --muted: #64748b;
  --bg: #f5f7fb;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  --sh-1: 0 1px 2px rgba(15,23,42,.05);
  --sh-2: 0 6px 20px rgba(15,23,42,.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; color: #1f2937; background: var(--bg); }
button { font-family: inherit; }
.btn { background: var(--primary); color: #fff; border: none; padding: 8px 18px; border-radius: 4px; cursor: pointer; font-size: 14px; }
.btn:hover { background: var(--primary-dark); }
.btn.ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn.ghost:hover { background: var(--primary-light); }
.btn.gray { background: #fff; color: #374151; border: 1px solid #d1d5db; }
.btn.gray:hover { background: #f3f4f6; }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn.block { width: 100%; padding: 10px; }
.btn:disabled { background: #9ca3af; border-color: #9ca3af; cursor: not-allowed; }
input, select, textarea { font-family: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid #d1d5db; border-radius: 4px; background: #fff; }
input[type="radio"], input[type="checkbox"] { width: auto; padding: 0; border: none; background: none; vertical-align: -2px; margin-right: 6px; }
input:focus, select:focus { outline: none; border-color: var(--primary); }
.link { color: var(--primary); cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; }
.hint { color: var(--muted); font-size: 12px; }
.center { text-align: center; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
/* 反向余额（如应付账款出现借方余额）：位置仍按科目属性，赤字提示 */
.num.neg { color: #dc2626; }

/* ---------- 登录页 ---------- */
#auth-view { display: none; min-height: 100vh; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a5fd7 0%, #144aa8 60%, #0e3a86 100%); }
.auth-card { background: #fff; border-radius: 12px; padding: 40px 44px; width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.auth-card h1 { color: var(--primary); text-align: center; margin-bottom: 6px; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.auth-tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.auth-tabs span { flex: 1; text-align: center; padding: 10px; cursor: pointer; color: var(--muted); font-size: 15px; }
.auth-tabs span.active { color: var(--primary); border-bottom: 2px solid var(--primary); margin-bottom: -2px; font-weight: 600; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: #374151; margin-bottom: 5px; }
.form-row input, .form-row select { width: 100%; }
.err-msg { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ---------- 主框架 ---------- */
#app-view { display: none; height: 100vh; }
.sidebar { width: 108px; background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column; flex-shrink: 0; z-index: 30; }
.side-logo { padding: 16px 8px; text-align: center; color: #fff; font-weight: 700; font-size: 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.side-logo small { display: block; font-size: 10px; font-weight: 400; color: var(--side-text); margin-top: 2px; }
.side-nav { flex: 1; overflow-y: auto; }
.side-item { position: relative; padding: 14px 6px; text-align: center; cursor: pointer; font-size: 13px; border-left: 3px solid transparent; }
.side-item .ico { display: block; font-size: 20px; margin-bottom: 4px; }
.side-item:hover { background: var(--side-bg2); color: #fff; }
.side-item.active { background: var(--side-bg2); color: #fff; border-left-color: var(--primary); }
.dd-check { display: block; padding: 8px 16px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.dd-check:hover { background: var(--primary-light); }
.fx-wrap input, .qty-wrap input { padding: 3px 6px; font-size: 12px; border: 1px solid var(--border); border-radius: 4px; }
.fx-wrap .fx-cur { padding: 3px 6px; font-size: 12px; }
/* 飞出二级菜单：独立于侧栏的固定定位面板（避免被 side-nav 的 overflow 裁剪） */
#nav-flyout { display: none; position: fixed; min-width: 160px; background: #fff; color: #1f2937;
  border-radius: 6px; box-shadow: 0 8px 30px rgba(0,0,0,.28); padding: 6px 0; z-index: 90;
  max-height: calc(100vh - 20px); overflow-y: auto; }
#nav-flyout .f-item { display: block; padding: 10px 18px; font-size: 13px; cursor: pointer; white-space: nowrap; text-align: left; }
#nav-flyout .f-item:hover { background: var(--primary-light); color: var(--primary); }
#nav-flyout .f-sep { height: 1px; background: var(--border); margin: 4px 0; }
.side-bottom { border-top: 1px solid rgba(255,255,255,.08); }

/* 模块分组（第十四轮）：财务会计 展开/收拢 + 二级菜单 */
.side-item.side-group { padding-right: 18px; }
.nav-toggle { position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; line-height: 16px; text-align: center; font-size: 14px; font-weight: 700;
  border: 1px solid rgba(255,255,255,.35); border-radius: 4px; color: var(--side-text); }
.side-group:hover .nav-toggle { color: #fff; border-color: #fff; }
.side-item.l2 { padding: 10px 6px 10px 18px; font-size: 12px; background: rgba(0,0,0,.18); }
.side-item.l2 .ico { font-size: 16px; margin-bottom: 2px; }
.nav-children { border-left: 3px solid transparent; }
.side-item.wip .ico { opacity: .55; }
.side-item.wip { color: var(--side-text); }
.wip-tag { display: inline-block; margin-top: 3px; font-size: 10px; padding: 1px 6px; border-radius: 8px;
  background: rgba(255,255,255,.14); color: var(--side-text); }

/* 待开发模块占位页 */
.wip-page { max-width: 720px; margin: 24px auto; padding: 28px 32px; }
.wip-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.wip-ico { font-size: 40px; }
.badge-wip { display: inline-block; margin-top: 4px; font-size: 12px; padding: 2px 10px; border-radius: 10px;
  background: #fef3c7; color: #92400e; }
.wip-desc { color: var(--text2, #6b7280); line-height: 1.7; }
.wip-page h4 { margin: 18px 0 8px; }
.wip-feats { margin: 0; padding-left: 20px; line-height: 2; }
.wip-api { background: #f3f4f6; border: 1px solid var(--border); border-radius: 6px; padding: 14px 16px;
  font-size: 12px; line-height: 1.7; overflow-x: auto; white-space: pre-wrap; }

/* 顶部条 */
.workbench { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 52px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 16px; gap: 14px; flex-shrink: 0; }
.set-selector { position: relative; }
.set-sel-btn { display: flex; align-items: center; gap: 8px; border: 1px solid #d1d5db; border-radius: 4px; padding: 7px 14px;
  cursor: pointer; font-size: 14px; background: #fff; max-width: 340px; }
.set-sel-btn:hover { border-color: var(--primary); }
.set-sel-btn .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-sel-btn .arrow { color: var(--muted); font-size: 11px; }
.set-dropdown { display: none; position: absolute; top: 44px; left: 0; width: 380px; max-height: 420px; overflow-y: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.18); z-index: 60; }
.set-dropdown.show { display: block; }
.set-dd-co { padding: 8px 14px 4px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.set-dd-item { padding: 9px 14px 9px 26px; cursor: pointer; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.set-dd-item:hover { background: var(--primary-light); color: var(--primary); }
.set-dd-item small { color: var(--muted); }
.set-dd-actions { border-top: 1px solid var(--border); padding: 6px 0; }
.set-dd-actions .f-item { padding: 9px 14px; cursor: pointer; font-size: 13px; color: var(--primary); }
.set-dd-actions .f-item:hover { background: var(--primary-light); }
.period-badge { display: flex; align-items: center; gap: 6px; font-size: 14px; color: #374151; }
.period-badge b { color: var(--primary); font-size: 15px; }
.topbar .spacer { flex: 1; }
.who { color: #374151; font-size: 13px; }
#btn-logout { background: none; border: 1px solid #d1d5db; border-radius: 4px; padding: 6px 12px; cursor: pointer; color: #6b7280; font-size: 13px; }
#btn-logout:hover { color: var(--danger); border-color: var(--danger); }

/* 标签页条 */
.tabbar { display: flex; align-items: center; background: #fff; border-bottom: 1px solid var(--border); padding: 0 8px; height: 40px;
  gap: 4px; overflow-x: auto; flex-shrink: 0; }
.tabbar .wt { display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 30px; line-height: 30px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 4px; cursor: pointer; color: #4b5563; white-space: nowrap; background: #fafafa; }
.tabbar .wt.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.tabbar .wt .x { font-size: 12px; opacity: .6; padding: 0 2px; }
.tabbar .wt .x:hover { opacity: 1; }
/* 页签刷新按钮（第十八轮）：绿色 ⟳，点击时转一圈 */
.wt .rf { display: none; color: var(--primary); opacity: .8; cursor: pointer; font-size: 13px; }
.wt.active .rf { display: inline-block; color: var(--primary); opacity: .9; }
.wt .rf:hover { opacity: 1; }
.wt .rf.spin { animation: rfspin .6s linear; }
@keyframes rfspin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* 工作区 */
.workspace { flex: 1; overflow-y: auto; padding: 0 16px 16px; }
.tab-pane { display: none; padding-top: 12px; }
.tab-pane.active { display: block; }
.empty-tip { color: var(--muted); text-align: center; padding: 22px 0; font-size: 14px; }

/* ---------- 通用组件 ---------- */
.card { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 16px; margin-bottom: 14px; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar label { font-size: 13px; color: #4b5563; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid th, .grid td { border: 1px solid var(--border); padding: 7px 9px; }
.grid th { background: #eef4ff; font-weight: 600; color: #374151; white-space: nowrap; }
/* ---------- 表头随滚动固定（第十七轮） ----------
   滚动容器为 .workspace：表头粘在可视区顶部，长表格下拉时始终可见。
   border-collapse 下真实边框不随 sticky 元素移动，故用 inset 阴影重画下/右边框。
   多行表头（如科目余额表 3 行）的 top 偏移由 JS fixStickyHeads() 按实际行高写入。 */
.grid thead th { position: sticky; top: 0; z-index: 3; background: #eef4ff;
  box-shadow: inset 0 -1px 0 var(--border), inset -1px 0 0 var(--border); }
.grid thead tr.grp-head th { background: #f6f9ff; }
@media print { .grid thead th { position: static; box-shadow: none; } }
.grid tbody tr:hover { background: #f9fafb; }
.grid .total-row td { background: #eef4ff; font-weight: 700; }
.cat-head td { background: #eef2f7 !important; font-weight: 700; color: #374151; }
.row-disabled { color: #9ca3af; }
.badge { display: inline-block; background: var(--primary-light); color: var(--primary); font-size: 12px; border-radius: 3px; padding: 2px 8px; margin-left: 8px; }
.tag-aux { display: inline-block; background: #e0e7ff; color: #4338ca; font-size: 11px; border-radius: 3px; padding: 1px 6px; margin-right: 4px; }
.tag-custom { display: inline-block; background: #fef3c7; color: #b45309; font-size: 11px; border-radius: 3px; padding: 1px 6px; margin-left: 6px; }
.bal-ok { color: var(--primary); font-size: 13px; }
.bal-bad { color: var(--danger); font-size: 13px; }
/* 第十九轮：凭证录入「辅助核算」可检索组合框 */
.aux-sel-wrap.aux-combo { position: relative; }
.aux-sel-wrap.aux-combo .aux-inp { width: 190px; padding-right: 20px; }
.aux-sel-wrap.aux-combo .aux-caret { position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 11px; pointer-events: none; }
.aux-sel-wrap.aux-combo .acc-dd { min-width: 220px; max-height: 240px; }
.acc-opt.acc-new { border-top: 1px solid var(--border); color: var(--primary); font-weight: 600; }
/* 第十九轮：资产负债表借贷不平衡警示条 */
.bs-warn { margin-top: 10px; padding: 8px 12px; border: 1px solid var(--danger); background: #fff1f0; color: var(--danger);
  border-radius: 4px; font-size: 13px; line-height: 1.6; }
.bs-ok { margin-top: 10px; padding: 6px 12px; border: 1px solid var(--primary); background: var(--primary-light);
  color: var(--primary); border-radius: 4px; font-size: 13px; }
.report-title { text-align: center; font-size: 18px; font-weight: 700; letter-spacing: 4px; margin-bottom: 4px; }
.report-sub { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.aux-checks { display: flex; flex-wrap: wrap; gap: 10px; }
.aux-check { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.aux-check input { width: auto; }
/* 凭证列表勾选框：悬停或已选时显示（参照柠檬云） */
.vchk-cell { opacity: 0; transition: opacity .15s; }
.vchk-cell input, #vl-chk-all { width: auto; cursor: pointer; }
tr:hover .vchk-cell, .vchk-cell.on { opacity: 1; }
/* 弹窗中的单选/复选行：圆圈与文字水平对齐（优先级须高于 .form-row label） */
.form-row label.radio-line, .modal label.radio-line { display: flex; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; margin-bottom: 0; }
.radio-line input { margin-right: 0; }
.data-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #f3f4f6; }
.data-row:last-child { border-bottom: none; }

/* 凭证编辑器 */
.vhead { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.vhead .vword { width: 64px; text-align: center; }
.vhead .vno { width: 70px; text-align: center; background: #f3f4f6; }
.entry-table input { width: 100%; border: 1px solid transparent; padding: 5px 6px; background: transparent; }
.entry-table input:focus { border-color: var(--primary); background: #fff; }
.entry-table tr:hover input { border-color: #e5e7eb; }
.vrow-summary { width: 26%; } .vrow-acc { width: 30%; } .vrow-amt { width: 16%; }
.aux-sub td { background: #f8fafc; padding: 6px 10px; }
.aux-selects { display: flex; gap: 14px; flex-wrap: wrap; }
.aux-sel-wrap { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.aux-sel-wrap em { font-style: normal; color: var(--muted); }
.aux-sel-wrap select { padding: 3px 6px; font-size: 12px; }

/* 期末结转 */
.close-legend { display: flex; gap: 24px; font-size: 13px; color: #4b5563; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
.close-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.dot-g { background: var(--primary); } .dot-b { background: #3b82f6; } .dot-gr { background: #9ca3af; }
.year-card { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 18px; margin-bottom: 14px; }
.year-card h3 { font-size: 20px; margin-bottom: 14px; color: #374151; }
.month-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.month-cell { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; cursor: pointer; text-align: center; transition: box-shadow .15s; background: #fff; }
.month-cell:hover { box-shadow: 0 4px 14px rgba(26,95,215,.25); border-color: var(--primary); }
.month-cell .mh { padding: 6px; font-size: 13px; color: #fff; background: var(--primary); }
.month-cell.st-carried .mh { background: #3b82f6; }
.month-cell.st-closed .mh { background: #9ca3af; }
.month-cell.st-future { opacity: .45; cursor: not-allowed; }
.month-cell .mn { font-size: 26px; font-weight: 700; padding: 10px 0; color: #374151; }
.month-cell .ms { font-size: 11px; color: var(--muted); padding-bottom: 8px; }
.wizard-step { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 18px; margin-bottom: 14px; }
.wizard-step h3 { font-size: 16px; margin-bottom: 12px; }
.check-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.check-card { border: 1px solid var(--border); border-radius: 6px; padding: 14px; }
.check-card .amt { font-size: 18px; font-weight: 700; color: var(--primary); margin: 8px 0; }

/* 首页仪表盘 */
.dash-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 14px; }
.dash-card { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 20px; text-align: center; cursor: pointer; transition: box-shadow .15s; }
.dash-card:hover { box-shadow: 0 6px 20px rgba(26,95,215,.18); }
.dash-card .t { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.dash-card .d { font-size: 12px; color: var(--muted); }
.dash-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { background: #f8fafc; border: 1px solid var(--border); border-radius: 6px; padding: 14px; text-align: center; }
.kpi .v { font-size: 20px; font-weight: 700; color: #111827; }
.kpi .k { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 筛选面板 */
.filter-panel { display: none; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 16px; margin-bottom: 12px; }
.filter-panel.show { display: block; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 20px; }
.filter-grid .fg { display: flex; align-items: center; gap: 8px; }
.filter-grid .fg label { width: 70px; font-size: 13px; color: #4b5563; text-align: right; }
.filter-grid .fg input, .filter-grid .fg select { flex: 1; }

/* 设置页 */
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.set-tile { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 18px 12px; text-align: center; cursor: pointer; transition: box-shadow .15s; }
.set-tile:hover { box-shadow: 0 6px 18px rgba(26,95,215,.16); border-color: var(--primary); }
.set-tile .ico { font-size: 22px; margin-bottom: 8px; }
.set-tile .t { font-size: 14px; }
.set-tile .d { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* 弹窗 / toast */
.modal-mask { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100; align-items: flex-start; justify-content: center; padding-top: 8vh; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 8px; padding: 24px; width: 480px; max-width: 94vw; max-height: 82vh; overflow-y: auto; }
.modal h3 { margin-bottom: 16px; font-size: 16px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.toast { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 9px 20px;
  border-radius: 4px; font-size: 13px; opacity: 0; transition: opacity .25s; z-index: 200; pointer-events: none; }
.toast.show { opacity: .92; }
.del { background: none; border: none; color: #9ca3af; cursor: pointer; font-size: 12px; }
.del:hover { color: var(--danger); }

/* 打印 */
@media print {
  @page { margin: 0; } /* 页边距为 0 时浏览器自动隐藏页眉页脚（标题/网址/日期/页码） */
  body { background: #fff; padding: 12mm 12mm; }
  .sidebar, .topbar, .tabbar, .toolbar, .filter-panel, .btn, .toast { display: none !important; }
  .workspace { padding: 0; overflow: visible; }
  .card { border: none; padding: 0; }
  /* 凭证专用打印：只显示打印区 */
  body.print-custom { padding: 10mm 12mm; }
  body.print-custom #app-view { display: none !important; }
  body.print-custom #print-area { display: block !important; }
}
/* 凭证打印格式 */
.voucher-paper { font-family: "SimSun", serif; color: #000; padding: 10px; page-break-after: always; }
.voucher-paper:last-child { page-break-after: auto; }
.voucher-paper h2 { text-align: center; font-size: 20px; letter-spacing: 8px; margin-bottom: 6px; }
.voucher-paper .vp-meta { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.voucher-paper table { width: 100%; border-collapse: collapse; font-size: var(--vp-font, 13px); }
.voucher-paper th, .voucher-paper td { border: 1px solid #000; padding: 5px 8px; }
.voucher-paper th { text-align: center; }
.voucher-paper .vp-foot { display: flex; justify-content: space-between; font-size: 13px; margin-top: 10px; }

/* ---------- 凭证编辑：科目下拉导航 ---------- */
.entry-table td { position: relative; }
.acc-dd { position: absolute; z-index: 60; top: 100%; left: 0; min-width: 320px; max-height: 260px; overflow-y: auto;
  background: #fff; border: 1px solid #d1d5db; border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 4px 0; font-size: 13px; }
.acc-opt { padding: 6px 10px; cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.acc-opt .acc-code { color: var(--primary, #1a5fd7); font-weight: 600; min-width: 70px; }
.acc-opt.disabled { color: #9ca3af; cursor: not-allowed; }
.acc-opt.disabled .acc-code { color: #9ca3af; }
.acc-opt .acc-sub { font-size: 11px; color: #9ca3af; }
.acc-opt.hi:not(.disabled) { background: #eef4ff; }
.acc-empty { padding: 12px; color: #9ca3af; text-align: center; }

/* ---------- 查询凭证：分录级分组展示 ---------- */
table.voucher-groups tbody.vgroup { border-bottom: 3px double #d1d5db; }
table.voucher-groups tbody.vgroup:last-child { border-bottom: none; }
.vg-head td { background: #f4f7fe; font-size: 13px; padding: 7px 10px; border-bottom: 1px solid #e5e7eb; }
.vg-head .hint { font-size: 12px; }
.vg-ent td { border-bottom: none; }
.vg-total td { background: #fafbfe; font-size: 12px; color: #6b7280; padding: 5px 10px; border-top: 1px dashed #e5e7eb; }
.vg-total td.num { font-size: 13px; color: #111827; }
.aux-tag { display: inline-block; margin-left: 6px; padding: 0 6px; font-size: 11px; border-radius: 3px; background: #eef4ff; color: var(--primary, #1a5fd7); }
.acc-code { color: var(--primary, #1a5fd7); font-weight: 600; margin-right: 4px; }

/* ---------- 账套下拉：搜索 + 平铺 ---------- */
.set-dd-search { padding: 6px 8px; border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; background: #fff; }
.set-dd-search input { width: 100%; border: 1px solid #d1d5db; border-radius: 4px; padding: 5px 8px; font-size: 13px; }
.set-dd-item.cur { background: #eef4ff; }
.set-dd-item .cur-tag { font-size: 11px; color: var(--primary, #1a5fd7); border: 1px solid var(--primary, #1a5fd7); border-radius: 3px; padding: 0 4px; }

/* ---------- 设置→账套：卡片管理页 ---------- */
.set-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.set-card { position: relative; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; cursor: pointer; transition: box-shadow .15s; }
.set-card:hover { box-shadow: 0 4px 14px rgba(26,95,215,.12); border-color: #c9dcff; }
/* 第二十五轮修订：当前账套的强调交给右下角丝带，边框降为浅蓝，避免整页一排蓝框 */
.set-card.cur { border-color: #bfdbfe; }
.set-card.cur:hover { border-color: #93c5fd; }
.sc-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #f0f2f5; }
.sc-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.sc-gear { color: #6b7280; cursor: pointer; font-size: 15px; padding: 0 4px; }
.sc-gear:hover { color: var(--primary, #1a5fd7); }
.gear-menu { display: none; position: absolute; right: 8px; top: 36px; z-index: 30; background: #fff; border: 1px solid #e5e7eb; border-radius: 6px; box-shadow: 0 8px 20px rgba(0,0,0,.12); padding: 4px 0; min-width: 88px; }
.gear-menu.show { display: block; }
.gear-menu span { display: block; padding: 7px 14px; font-size: 13px; color: #374151; }
.gear-menu span:hover { background: #eef4ff; color: var(--primary, #1a5fd7); }
.sc-body { padding: 12px; font-size: 13px; color: #4b5563; display: flex; flex-direction: column; gap: 8px; }
.sc-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-ico { font-style: normal; color: #9ca3af; margin-right: 4px; }
.tag-tax { display: inline-block; margin-left: 6px; padding: 0 6px; font-size: 11px; border-radius: 3px; background: #eef4ff; color: var(--primary, #1a5fd7); border: 1px solid #d5e4ff; }
/* 参考柠檬云：丝带放在右下角，右上角的「设置」齿轮始终可见 */
.cur-ribbon { position: absolute; right: -34px; bottom: 18px; transform: rotate(-45deg);
  background: var(--primary); color: #fff; font-size: 11px; letter-spacing: .5px; padding: 3px 36px; }

/* ---------- 账套编辑：标签页 ---------- */
.mtabs { display: flex; gap: 20px; border-bottom: 1px solid #e5e7eb; margin: 12px 0 16px; }
.mtab { padding: 6px 2px; font-size: 14px; color: #6b7280; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.mtab.on { color: var(--primary, #1a5fd7); border-bottom-color: var(--primary, #1a5fd7); font-weight: 600; }
/* 卡片不裁剪齿轮菜单；角标单独裁剪 */
.set-card { overflow: visible; }
.sc-ribbon-frame { position: absolute; inset: 0; overflow: hidden; border-radius: 8px; pointer-events: none; z-index: 5; }

/* ---------- 科目页：类别标签 + 批量操作 ---------- */
.acc-tabs { display: flex; gap: 26px; border-bottom: 1px solid #e5e7eb; margin-bottom: 12px; padding: 0 4px; }
.acc-tab { padding: 7px 4px; font-size: 14px; color: #6b7280; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.acc-tab.on { color: var(--primary, #1a5fd7); border-bottom-color: var(--primary, #1a5fd7); font-weight: 600; }
.acc-tab:hover { color: var(--primary, #1a5fd7); }
.batch-wrap { position: relative; display: inline-block; }
.batch-wrap .gear-menu { right: 0; top: 32px; left: auto; }

/* ---------- 科目管理弹窗：柠檬云两列布局 ---------- */
.km-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; margin: 14px 0 4px; }
.km-field { display: flex; flex-direction: column; gap: 5px; }
.km-field > label { font-size: 13px; color: #4b5563; }
.km-field > input, .km-field > select { width: 100%; }
.km-radio { display: flex; gap: 22px; align-items: center; min-height: 34px; padding: 0 2px; }
.km-radio label { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; cursor: pointer; }
.km-sec { border: 1px solid #e5e7eb; border-radius: 6px; margin-top: 12px; }
.km-sec-head { display: flex; align-items: center; gap: 7px; padding: 9px 12px; font-size: 14px; cursor: pointer; user-select: none; }
.km-sec-body { padding: 4px 12px 12px 30px; border-top: 1px dashed #e5e7eb; }

/* ---------- 柠檬云式查询面板（绿色期间药丸） ---------- */
.qp-wrap { position: relative; display: inline-block; }
.qp-pill { display: inline-flex; align-items: center; gap: 8px; background: #1a5fd7; color: #fff; border: none; border-radius: 4px; padding: 6px 14px; font-size: 13px; cursor: pointer; }
.qp-pill:hover { background: #144aa8; }
.qp-fico { font-size: 12px; opacity: .85; }
.qp-panel { position: absolute; z-index: 60; top: 36px; left: 0; width: 340px; background: #fff; border: 1px solid #e5e7eb; border-radius: 6px; box-shadow: 0 8px 28px rgba(0,0,0,.14); padding: 14px 16px 10px; }
.qp-row { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.qp-row > label { flex: none; width: 76px; font-size: 13px; color: #4b5563; text-align: right; }
.qp-row > input, .qp-row > select { flex: 1; min-width: 0; }
.qp-sep { flex: none; color: #9ca3af; font-size: 12px; }
.qp-check { margin: 2px 0 8px 82px; font-size: 13px; }
.qp-check label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.qp-radios { display: flex; gap: 16px; font-size: 13px; }
.qp-radios label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.qp-actions { display: flex; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #f0f0f0; }

/* ---------- 工具栏下拉菜单 ---------- */
.dd-wrap { position: relative; display: inline-block; }
.dd-menu { position: absolute; z-index: 60; top: 32px; right: 0; min-width: 150px; background: #fff; border: 1px solid #e5e7eb; border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 4px 0; }
.dd-item { display: block; padding: 8px 16px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.dd-item:hover { background: #eef4ff; color: var(--primary, #1a5fd7); }
.dis-cb { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: #b5bdc9; margin-right: 6px; }

/* 余额表三组合并表头 */
.grp-head th { text-align: center !important; background: #f6f9ff; }
.aux-row td { color: #6b7280; font-size: 12.5px; background: #fcfdff; }
.acc-block-head { font-weight: 600; color: #1a5fd7; padding: 8px 4px 4px; }

/* ---------- 报表标题仅打印时显示 ---------- */
.print-only { display: none !important; }
@media print {
  .print-only { display: block !important; }
  .report-title { text-align: center; font-size: 18px; font-weight: 700; letter-spacing: 6px; margin: 8px 0 2px; }
  .report-sub { text-align: center; font-size: 12px; color: #6b7280; margin-bottom: 8px; }
}
/* 查询面板内科目搜索下拉定位 */
.qp-row { position: relative; }
.dd-item.dis { color: #b5bdc9; cursor: default; }
.dd-item.dis:hover { background: none; color: #b5bdc9; }
.acc-dd-panel { max-height: 220px; overflow-y: auto; }

/* ---------- 报表期间选择器（日期框下拉期间网格） ---------- */
.pp-wrap { position: relative; display: inline-block; }
.pp-panel { position: absolute; z-index: 70; top: 34px; left: 0; width: 264px; background: #fff;
  border: 1px solid #e5e7eb; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 10px; }
.pp-year { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pp-year b { font-size: 14px; }
.pp-nav { cursor: pointer; padding: 2px 10px; color: #6b7280; border-radius: 4px; }
.pp-nav:hover { background: #eef4ff; color: #1a5fd7; }
.pp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pp-cell { text-align: center; padding: 6px 2px; font-size: 13px; border: 1px solid #f0f0f0; border-radius: 5px; cursor: pointer; user-select: none; }
.pp-cell:hover { border-color: #1a5fd7; color: #1a5fd7; }
.pp-cell.sel { background: #1a5fd7; color: #fff; border-color: #1a5fd7; }
.pp-cell.dis { color: #c4cad4; cursor: default; }
.pp-cell.dis:hover { border-color: #f0f0f0; color: #c4cad4; }

/* ---------- 启用状态开关（柠檬云式） ---------- */
.sw { position: relative; display: inline-block; width: 34px; height: 18px; vertical-align: middle; }
.sw input { display: none; }
.sw span { position: absolute; inset: 0; background: #d1d5db; border-radius: 9px; transition: .18s; cursor: pointer; }
.sw span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: #fff; border-radius: 50%; transition: .18s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.sw input:checked + span { background: #18b160; }
.sw input:checked + span::after { left: 18px; }

/* ---------- 金额栏计算器浮层 ---------- */
.calc-pad { position: absolute; z-index: 80; top: calc(100% + 4px); left: 0; width: 220px; background: #fff;
  border: 1px solid #e5e7eb; border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 8px; }
.calc-pad .calc-expr { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.calc-pad .calc-res { margin-top: 6px; font-size: 12px; text-align: right; min-height: 16px; }


/* ==========================================================================
   第二十一轮 · 视觉升级（蓝色主色调）
   说明：本节只覆盖观感（颜色/圆角/间距/层级），不改任何类名与结构，
        原有功能样式与打印样式全部保留。
   ========================================================================== */

/* 图标：emoji → 单色线性 SVG */
.ico-svg { width: 20px; height: 20px; display: block; margin: 0 auto 4px; }
.side-item.side-group { padding-left: 26px; }
.side-item.side-group .ico-svg { display: inline-block; vertical-align: -4px; margin: 0 6px 0 0; }
.side-item.l2 .ico-svg { width: 16px; height: 16px; margin-bottom: 2px; }

/* 侧栏 */
.sidebar { width: 96px; background: linear-gradient(180deg, #0b1f3f, #0d2447); }
.side-logo { font-size: 15px; letter-spacing: .5px; padding: 18px 6px; }
.side-item { border-radius: 8px; margin: 2px 6px; padding: 11px 4px; transition: background .15s, color .15s; }
.side-item:hover { background: rgba(255,255,255,.06); }
.side-item.active { background: #12325e; border-left: 3px solid #60a5fa;
  box-shadow: inset 0 0 0 1px rgba(96,165,250,.18); }
.side-item.l2 { background: transparent; margin: 1px 6px 1px 10px; border-radius: 6px; }
.side-item.l2.active { background: #163a6b; }

/* 顶栏 / 页签 */
.topbar { height: 54px; box-shadow: var(--sh-1); }
.set-sel-btn { border-color: var(--border-strong); border-radius: 8px; padding: 8px 12px; }
.period-badge { background: var(--primary-light); color: var(--brand-700); border-radius: 999px; padding: 4px 12px; font-size: 13px; }
.tabbar { height: 44px; }
.tabbar .wt { border: none; background: transparent; border-radius: 8px 8px 0 0; color: var(--ink-500); height: 34px; }
.tabbar .wt.active { background: #fff; color: var(--brand-700); font-weight: 600; box-shadow: inset 0 -2px 0 var(--primary); }

/* 卡片 / 表格 / 表单 */
.card { border-color: var(--border); border-radius: var(--r-md); box-shadow: var(--sh-1); padding: 18px; }
.grid th, .grid td { border: none; border-bottom: 1px solid var(--border); padding: 9px 10px; }
.grid th { background: #f8fafc; color: var(--ink-700); font-size: 12.5px; letter-spacing: .2px;
  box-shadow: inset 0 -1px 0 var(--border-strong); }
.grid tbody tr:hover { background: #f8fbff; }
.grid .total-row td { background: #f1f5f9; border-top: 1px solid var(--border-strong); font-weight: 700; }
.cat-head td { background: #f1f5f9 !important; }
.btn { border-radius: 8px; font-weight: 500; transition: background .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.25); }
.btn.ghost { border-color: var(--border-strong); }
.btn.gray { border-color: var(--border-strong); }
input, select, textarea { border-color: var(--border-strong); border-radius: 8px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.link:focus-visible { outline: 2px solid rgba(37,99,235,.4); outline-offset: 2px; border-radius: 3px; }

/* 首页 / 设置卡片 */
.dash-card, .set-tile, .kpi, .month-cell, .year-card, .wizard-step, .set-card { border-radius: var(--r-md); }
.dash-card { box-shadow: var(--sh-1); padding: 22px 18px; }
.dash-card:hover { box-shadow: var(--sh-2); border-color: #bfdbfe; }
.dash-card .t { font-size: 14px; color: var(--ink-700); }
.kpi { background: linear-gradient(180deg, #fff, #f8fafc); box-shadow: var(--sh-1); }
.kpi .v { font-size: 21px; letter-spacing: -.3px; }
.set-tile:hover { box-shadow: var(--sh-2); }

/* 期末结转：状态语义改为 蓝=未结转 / 琥珀=已结转 / 绿=已结账 */
.dot-g { background: #2563eb !important; }
.dot-b { background: #d97706 !important; }
.dot-gr { background: #15803d !important; }
.month-cell.st-carried .mh { background: #d97706; }
.month-cell.st-closed .mh { background: #15803d; }
.month-cell .mh { font-weight: 600; letter-spacing: .5px; }

/* 徽标 */
.badge, .tag-aux, .tag-custom, .tag-tax { border-radius: 999px; font-weight: 500; }
.tag-aux, .aux-tag, .tag-tax { background: #e0eaff; color: #1d4ed8; }

/* 提示条：借贷不平衡（红）/ 资产异常（琥珀）/ 历史账套（蓝） */
.bs-warn { border-radius: var(--r-sm); }
.bs-note { margin-top: 10px; padding: 9px 12px; border-radius: var(--r-sm); font-size: 13px; line-height: 1.7; }
.bs-note.warn { border: 1px solid #fcd34d; background: #fffbeb; color: #92400e; }
.bs-note.info { border: 1px solid #bfdbfe; background: #eff6ff; color: #1e40af; }

/* 空状态 */
.empty-tip { color: var(--ink-500); padding: 40px 0; font-size: 14px; }

/* 弹窗 */
.modal { border-radius: var(--r-lg); box-shadow: 0 24px 60px rgba(15,23,42,.25); }
.toast { border-radius: 8px; background: #0f172a; }

/* 打印：加公司/报表/期间页眉与页码 */
@media print {
  .bs-note { display: none !important; }
  .report-title { letter-spacing: 6px; }
}

/* 表头 sticky 规则的优先级高于 .grid th，需要同选择器覆盖 */
.grid thead th { background: #f8fafc; color: var(--ink-700); font-size: 12.5px;
  box-shadow: inset 0 -1px 0 var(--border-strong), inset -1px 0 0 transparent; }
.grid thead tr.grp-head th { background: #f1f5f9; }

/* ==========================================================================
   第二十二轮 · 侧栏标识 / 分页 / 加载占位 / 重分类开关
   ========================================================================== */

/* 侧栏标识：图形 + 保留「永久免费」 */
.side-logo { padding: 9px 6px 8px; }
/* 商标原图直接使用（不重绘、不改色）：白底转透明，仅保留图形与笔尖镂空 */
.side-logo-img { width: 38px; height: 38px; display: block; margin: 0 auto 4px; }
.side-logo small { font-size: 10px; letter-spacing: .5px; margin-top: 0; }

/* 加载占位：点开页签立刻有反馈，避免 fetch 期间白屏 */
.loading { display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 64px 0; color: var(--ink-500); font-size: 13px; }
.loading::before { content: ''; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid #dbeafe; border-top-color: var(--primary); animation: pgspin .7s linear infinite; }
@keyframes pgspin { to { transform: rotate(360deg); } }

/* 分页条 */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 6px;
  padding: 12px 4px 2px; font-size: 13px; color: var(--ink-500); flex-wrap: wrap; }
.pager .pg-btn { min-width: 30px; height: 28px; padding: 0 8px; border: 1px solid var(--border-strong);
  background: #fff; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--ink-700); }
.pager .pg-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.pager .pg-btn:disabled { opacity: .45; cursor: not-allowed; }
.pager .pg-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager .pg-size { height: 28px; padding: 0 6px; border: 1px solid var(--border-strong); border-radius: 6px; }

/* 资产负债表：往来科目重分类开关 */
.rc-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
  color: var(--ink-700); cursor: pointer; user-select: none; padding: 4px 10px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.rc-toggle:hover { border-color: var(--primary); color: var(--primary); }
.rc-toggle input { width: auto; margin: 0; }

/* ==========================================================================
   第二十二轮修订 3 · 侧栏横向布局 / 筛选栏与表头一体
   ========================================================================== */

/* 侧栏：96 → 150px，图标与文字左右排列，主项加粗 */
.sidebar { width: 150px; }
.side-logo { padding: 14px 12px 10px; text-align: left; }
.side-logo-img { width: 40px; height: 40px; margin: 0 0 6px; }
.side-logo small { display: block; font-size: 10px; letter-spacing: .5px; }

.side-item {
  display: flex; align-items: center; gap: 10px;
  margin: 2px 8px; padding: 10px 12px;
  text-align: left; font-size: 14px; font-weight: 600;
  border-left: 3px solid transparent; border-radius: 8px;
}
.side-item .ico-svg { width: 20px; height: 20px; flex: 0 0 20px; margin: 0; display: block; }
.side-item .ico { display: block; font-size: 18px; margin: 0; }
.side-item.side-group { padding-left: 32px; }
.side-item.side-group .ico-svg { margin: 0; display: block; }
.nav-toggle { left: 9px; }
.side-item.l2 {
  margin: 1px 8px 1px 12px; padding: 8px 10px 8px 34px;
  font-size: 13px; font-weight: 500; background: transparent; border-radius: 6px;
}
.side-item.l2 .ico-svg { width: 16px; height: 16px; flex: 0 0 16px; }
.side-item.l2::before { content: ''; position: absolute; left: 20px; width: 2px; height: 2px; border-radius: 50%; background: currentColor; opacity: .45; }
.wip-tag { margin-top: 0; margin-left: auto; font-size: 10px; padding: 1px 5px; }
.side-bottom .side-item { justify-content: flex-start; }

/* 筛选栏与表格合为一体：白底连成一张卡，压缩总高度 */
.tab-pane > .toolbar {
  background: #fff; border: 1px solid var(--border); border-bottom: none;
  border-radius: 10px 10px 0 0; padding: 8px 12px; margin-bottom: 0; gap: 8px;
  /* 第二十二轮修订 4：筛选栏与表格一起吸顶，下拉时始终可见 */
  position: sticky; top: 0; z-index: 6;
  box-shadow: 0 1px 0 var(--border);
}
.tab-pane > .toolbar + .card {
  border-radius: 0 0 10px 10px; border-top: 1px solid #f1f5f9;
  padding-top: 6px; margin-top: 0; box-shadow: none;
}
.tab-pane > .toolbar + .card .grid { margin-top: 0; }
.grid th, .grid td { padding: 7px 9px; }
.grid th { font-size: 12px; }
.grid thead tr.grp-head th { padding: 5px 9px; }
.tab-pane > .toolbar .btn.sm { padding: 3px 9px; }
.tab-pane > .toolbar .qp-pill { padding: 5px 12px; }

@media (max-width: 900px) {
  .sidebar { width: 64px; }
  .side-item { justify-content: center; padding: 10px 4px; font-size: 0; gap: 0; }
  .side-item .ico-svg, .side-item .ico { margin: 0 auto; }
  .side-logo-img { margin: 0 auto 4px; }
  .side-logo small { display: none; }
  .wip-tag { display: none; }
}

/* 侧栏文案不换行；待开发标记收成右侧小圆点，避免撑开宽度 */
.side-item { white-space: nowrap; font-size: 13.5px; }
.side-item .wip-tag { display: none; }
.side-item.wip::after {
  content: ''; position: absolute; right: 10px; top: 50%; margin-top: -3px;
  width: 6px; height: 6px; border-radius: 50%; background: #f59e0b;
}
.side-item.l2 { font-size: 12.5px; }

/* 侧栏顶部标识区居中（侧栏加宽后） */
.side-logo { text-align: center; padding: 14px 10px 10px; }
.side-logo-img { margin: 0 auto 6px; }
.side-logo small { text-align: center; }

/* ==========================================================================
   第二十二轮修订 5 · 表格列线（只改观感，不动结构与布局）
   ========================================================================== */
.grid th + th,
.grid td + td { border-left: 1px solid #eef2f7; }
.grid thead th { border-left-color: #dbe3ec; }
.grid thead th:first-child,
.grid tbody td:first-child { border-left: none; }
/* 合计行与分类行不画列线，保持整块感 */
.grid .total-row td,
.grid .cat-head td,
.grid .aux-row td:first-child { border-left-color: transparent; }
/* 表头最后一条竖线去掉，避免贴边重线 */
.grid thead th:last-child { border-right: none; }
/* 数字列右侧留一点呼吸，列线看起来不挤 */
.grid th.num, .grid td.num { padding-right: 12px; }

/* ==========================================================================
   第二十五轮 · 可视化（财务）
   ========================================================================== */
.vf-issues { display: flex; flex-direction: column; gap: 6px; }
.vf-issue { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px;
  background: #f8fafc; border: 1px solid var(--border); cursor: pointer; font-size: 13px; }
.vf-issue:hover { border-color: var(--primary); background: var(--primary-light); }
.vf-issue .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.vf-issue.lv-high .dot { background: #dc2626; }
.vf-issue.lv-mid .dot { background: #d97706; }
.vf-issue.lv-low .dot { background: #94a3b8; }
.vf-issue .t { color: var(--ink-500); }

.vf-matrix td { padding: 6px 8px; }
.mx { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 22px;
  border-radius: 6px; font-size: 11px; color: #fff; }
.mx-closed { background: #15803d; }
.mx-carried { background: #d97706; }
.mx-open { background: #2563eb; }
.mx-missing { background: #e2e8f0; color: #94a3b8; }
.vf-legend { display: flex; gap: 18px; margin-top: 10px; font-size: 12px; color: var(--ink-500); }
.vf-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; }

.vf-bar-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 13px; }
.vf-bar-row .n { width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-700); }
.vf-bar-row .b { flex: 1; height: 14px; background: #f1f5f9; border-radius: 7px; overflow: hidden; }
.vf-bar-row .b i { display: block; height: 100%; background: linear-gradient(90deg, #60a5fa, #2563eb); border-radius: 7px; }
.vf-bar-row .v { width: 92px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-900); font-weight: 600; }

/* 可视化：可自由选择的期间输入框 */
.vf-pp { width: 132px; height: 32px; padding: 0 8px; border: 1px solid var(--border-strong);
  border-radius: 8px; font-weight: 600; color: var(--brand-700); background: #fff; }
.vf-pp:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }

/* 第二十六轮：科目余额表树形缩进与折叠 */
.tb-caret { display: inline-block; width: 14px; margin-right: 3px; cursor: pointer; text-align: center;
  color: var(--ink-400); font-size: 11px; user-select: none; }
.tb-caret:hover { color: var(--primary); }
.tb-caret.ghost { cursor: default; pointer-events: none; }
.grid tbody tr[data-code] td:first-child { white-space: nowrap; }

/* 第二十七轮：旧账导入弹窗（左右结构） */
.form-row.lr { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 12px; }
.form-row.lr > label { margin: 0; text-align: right; font-size: 13px; color: var(--ink-700); }
.form-row.lr > .ctrl { min-width: 0; }
.form-row.lr > .ctrl input, .form-row.lr > .ctrl select { width: 100%; }
.li-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }

/* 第三十轮：登录页同意条款 + 备案号 */
#auth-view { position: relative; }
.auth-agree { display: flex; align-items: flex-start; gap: 8px; margin: 2px 0 14px;
  font-size: 12.5px; color: var(--ink-500); line-height: 1.65; cursor: pointer; user-select: none; }
.auth-agree input { width: 16px; height: 16px; margin: 2px 0 0; flex: 0 0 16px; accent-color: var(--primary); cursor: pointer; }
.auth-agree a { color: var(--primary); text-decoration: none; }
.auth-agree a:hover { text-decoration: underline; }
.auth-footer { position: absolute; left: 0; right: 0; bottom: 16px; text-align: center;
  font-size: 12px; color: rgba(255,255,255,.72); }
.auth-footer a { color: rgba(255,255,255,.85); text-decoration: none; }
.auth-footer a:hover { color: #fff; text-decoration: underline; }
.auth-footer .sep { margin: 0 8px; opacity: .6; }

/* 第三十轮：公安备案图标 */
.auth-footer img.beian-ico { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; border-radius: 2px; }

.auth-footer .auth-corp { margin-top: 4px; font-size: 11.5px; color: rgba(255,255,255,.6); }

/* 第三十一轮：找回密码 / 恢复码 */
.auth-forgot { text-align: center; margin-top: 10px; font-size: 12.5px; }
.auth-forgot a { color: var(--primary); text-decoration: none; }
.auth-forgot a:hover { text-decoration: underline; }
.recovery-box { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 22px; letter-spacing: 4px;
  text-align: center; padding: 14px; background: var(--primary-light); border: 1px dashed #93c5fd;
  border-radius: 8px; color: var(--brand-700); user-select: all; }

/* 第三十二轮：右上角用户菜单（悬停或点击展开） */
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 6px; background: none; border: 1px solid transparent;
  border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 13px; color: var(--ink-700); }
.user-btn:hover { background: var(--primary-light); border-color: var(--border); color: var(--brand-700); }
.user-btn .caret { font-size: 10px; color: var(--ink-400); }
.user-dd { display: none; position: absolute; right: 0; top: 38px; min-width: 148px; background: #fff;
  border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(15,23,42,.12);
  padding: 6px 0; z-index: 80; }
.user-menu.open .user-dd, .user-menu:hover .user-dd { display: block; }
.user-dd .dd-item { padding: 9px 16px; font-size: 13px; color: var(--ink-700); cursor: pointer; white-space: nowrap; }
.user-dd .dd-item:hover { background: var(--primary-light); color: var(--brand-700); }
.user-dd .dd-item.danger:hover { background: #fef2f2; color: var(--danger); }

/* 第三十二轮：个人设置分页 + 危险区 */
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 22px; padding: 14px 16px; border: 1px solid #fecaca; border-radius: 10px; background: #fff7f7; }
.danger-zone b { color: var(--danger); }

/* ==========================================================================
   第三十三轮 · 打印对话框排版 + 凭证页居中/页码
   ========================================================================== */
/* 对话框：单选项并排、方向并排、不换行 */
.pp-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; font-size: 14px; }
.pp-inline { display: flex; align-items: center; gap: 14px; font-size: 14px; flex-wrap: wrap; }
.pp-inline select { padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: 8px; }
.pp-opts .radio-line, .pp-inline .radio-line { white-space: nowrap; }

/* 凭证页：按纸张尺寸固定为整页，内容垂直居中，上下留白相等 */
#print-area { --page-w: 210mm; --page-h: 297mm; }
.voucher-paper {
  width: var(--page-w); height: var(--page-h); padding: var(--vp-pad, 12mm 10mm); box-sizing: border-box; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; position: relative;
  margin: 0 auto; page-break-after: always; break-after: page;
}
.voucher-paper:last-child { page-break-after: auto; break-after: auto; }
.voucher-paper .vp-blank td { height: 7mm; }
.voucher-paper .vp-pageno { position: absolute; left: 0; right: 0; bottom: 6mm;
  text-align: center; font-size: 11px; color: #000; }
@media print {
  body.print-custom { padding: 0; }
  body.print-custom #print-area { display: block !important; }
}

/* 第三十五轮：备份恢复分页 + 说明 */
.bak-legend { max-width: 960px; margin-top: 14px; font-size: 12.5px; color: var(--ink-500); line-height: 2; }
.bak-legend b { color: var(--ink-700); }
.bak-legend .ok { color: #15803d; }
.bak-legend .no { color: #94a3b8; }

/* 第三十六轮：成员与审核 */
.badge.ok-badge { background: #dcfce7; color: #15803d; }
.badge.gray-badge { background: #f1f5f9; color: #64748b; }
.member-add { display: flex; gap: 8px; margin-top: 14px; align-items: center; }
.member-add input { width: 220px; }
.member-add select { width: 120px; }

/* 第三十六轮：权限矩阵 */
.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.perm-group { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.perm-title { font-weight: 600; font-size: 13px; color: var(--ink-700); margin-bottom: 6px; }
.perm-group .radio-line { font-size: 13px; margin: 4px 0; }

/* 第三十七轮：批量作业 */
.b-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--ink-500); }
.b-foot .spacer { flex: 1; }
.b-prog { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.b-prog-hd { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-700); margin-bottom: 8px; }
.b-bar { height: 6px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.b-bar i { display: block; height: 100%; background: var(--primary, #1a5fd7); transition: width .25s; }

/* 第三十八轮：凭证打印 · 外币/数量小字 + 续页 */
.voucher-paper .vp-sub { font-size: 11px; color: #444; margin-top: 2px; line-height: 1.25; }
@media print { .voucher-paper .vp-sub { color: #000; } }
