/* style.css - 维财在线 3.0（与官网首页一致的蓝色主题） */
:root {
  --primary: #1a5fd7;
  --primary-dark: #144aa8;
  --primary-light: #eef4ff;
  --side-bg: #0e3a86;
  --side-bg2: #144aa8;
  --side-text: #b9ccf0;
  --danger: #dc2626;
  --border: #e5e7eb;
  --muted: #6b7280;
  --bg: #f3f5f8;
}
* { 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; }

/* ---------- 登录页 ---------- */
#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); }
/* 飞出二级菜单：独立于侧栏的固定定位面板（避免被 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); }

/* 顶部条 */
.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; }

/* 工作区 */
.workspace { flex: 1; overflow-y: auto; padding: 16px; }
.tab-pane { display: none; }
.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; }
.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; }
.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: 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: var(--primary, #1a5fd7); }
.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: -28px; top: 12px; transform: rotate(45deg); background: var(--primary, #1a5fd7); color: #fff; font-size: 11px; padding: 2px 30px; z-index: 5; }

/* ---------- 账套编辑：标签页 ---------- */
.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; }
