/* =========================================================
   企业内部质量管理系统 - 全局样式
   主题：GMP 医药洁净风 / 青绿 + 白板卡片
   修改配色等仅需改动 :root 变量
   ========================================================= */

/* 手写体（货位卡明细内容可切换）：均为开源/免费商用字体，本地随项目分发（assets/fonts/），无需联网。
   字体名必须与 assets/fonts/<id>.ttf 对应——货位卡顶部"字体"下拉切换，PDF 导出时按 <id>.ttf 内嵌 */
@font-face { font-family: "Ma Shan Zheng"; src: url("../assets/fonts/mashanzheng.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Long Cang"; src: url("../assets/fonts/longcang.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Zhi Mang Xing"; src: url("../assets/fonts/zhimangxing.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "PangMen KaiTi"; src: url("../assets/fonts/pangmenkaiti.ttf") format("truetype"); font-display: swap; }

:root {
  --brand:          #0e7c66;   /* 主品牌色（青绿） */
  --brand-dark:     #0a5f4f;
  --brand-soft:     #e6f4f0;
  --brand-soft2:    #f0faf7;
  --accent:         #2f6feb;   /* 强调 / 链接 */
  --ink:            #1f2937;   /* 主文字 */
  --ink-2:          #4b5563;   /* 次级文字 */
  --ink-3:          #9ca3af;   /* 弱文字 */
  --line:           #e5e7eb;   /* 边框 */
  --bg:             #f4f6f8;   /* 页面背景 */
  --card:           #ffffff;
  --sidebar-bg:     #0f1f1c;
  --sidebar-ink:    #9db8b0;
  --sidebar-active: #12b886;

  /* 状态色（GMP 状态语义） */
  --st-pending:   #d97706;  /* 待检/待验  黄 */
  --st-sampling:  #2f6feb;  /* 取样中     蓝 */
  --st-testing:   #ea580c;  /* 检验中     橙 */
  --st-ok:        #16a34a;  /* 合格/正常   绿 */
  --st-bad:       #dc2626;  /* 不合格     红 */
  --st-ready:     #16a34a;
  --st-lock:      #64748b;

  --radius:      10px;
  --shadow:      0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04);
  --shadow-lg:   0 10px 30px rgba(16,24,40,.12);
  --font: "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* 视口固定：整个页面不出现整体滚动条，内容溢出由各自容器滚动 */
html, body { height: 100%; overflow: hidden; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }

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

.sidebar {
  width: 150px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .brand {
  padding: 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.sidebar .brand .brand-logo { height: 60px; width: auto; max-width: 130px; object-fit: contain; }

.nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav .group {
  font-size: 11px; color: rgba(157,184,176,.55);
  padding: 12px 10px 6px; letter-spacing: 1px;
}
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; margin: 2px 0; border-radius: 8px;
  color: var(--sidebar-ink); font-size: 13.5px;
  cursor: pointer; border-left: 3px solid transparent;
}
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav a.active {
  background: rgba(18,184,134,.16); color: #fff;
  border-left-color: var(--sidebar-active);
  font-weight: 600;
}
.nav a .ic { width: 18px; text-align: center; opacity: .9; }

/* —— 基础信息 可展开树形导航 —— */
.tree-parent { margin: 2px 0; }
.tree-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; margin: 2px 0; border-radius: 8px;
  color: var(--sidebar-ink); font-size: 13.5px; cursor: pointer;
  border-left: 3px solid transparent; user-select: none;
}
.tree-toggle:hover { background: rgba(255,255,255,.05); color: #fff; }
.tree-toggle.open { background: rgba(18,184,134,.16); color: #fff; border-left-color: var(--sidebar-active); font-weight: 600; }
.tree-toggle .ic { width: 18px; text-align: center; opacity: .9; }
.tree-toggle .arrow { margin-left: auto; transition: transform .2s; }
.tree-toggle.open .arrow { transform: rotate(90deg); }

/* —— 基础信息 悬停弹出菜单 —— */
.fly-panel {
  position: fixed; z-index: 300; min-width: 176px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-lg);
  padding: 6px; display: none;
}
.fly-panel.show { display: block; }
.fly-panel a {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; border-radius: 7px;
  font-size: 13.5px; color: var(--ink-2); cursor: pointer;
}
.fly-panel a:hover { background: var(--brand-soft); color: var(--brand); }
.fly-panel a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.fly-panel a .fp-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sidebar-active); flex-shrink: 0; }
.fly-panel a.active .fp-dot { background: var(--sidebar-active); }
/* 一级弹层内的二级菜单项（如 库存管理 → 物料出库/物料退库） */
.fly-panel .fp-sub {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; border-radius: 7px;
  font-size: 13.5px; color: var(--ink-2); cursor: pointer; position: relative;
}
.fly-panel .fp-sub:hover, .fly-panel .fp-sub.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.fly-panel .fp-sub .fp-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sidebar-active); flex-shrink: 0; }
.fly-panel .fp-sub .fp-arrow { margin-left: auto; font-size: 11px; color: var(--ink-3); }

.sidebar .foot {
  padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08);
  font-size: 11px; color: var(--sidebar-ink); line-height: 1.7;
}
.sidebar .foot b { color:#cfe6df; }

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

.topbar {
  height: 58px; background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; position: sticky; top: 0; z-index: 20;
  flex-shrink: 0;
}
/* 顶栏按钮排（检验台账/报告的食品/药品切换）：与账号头像同一行，靠左（紧跟标题之后） */
#topbar-tabs { margin: 0 0 0 auto; margin-left: 24px; margin-right: auto; }
#topbar-tabs .seg-btn { padding: 5px 14px; font-size: 12.5px; }
}
.topbar h1 { font-size: 17px; font-weight: 700; }
.topbar .crumb { font-size: 12px; color: var(--ink-3); margin-top: 1px; }

.user-chip { display:flex; align-items:center; gap:10px; font-size:13px; position:relative; }
.user-chip-info { display:flex; align-items:center; gap:8px; cursor:pointer; padding:4px 6px; border-radius:10px; }
.user-chip-info:hover { background: rgba(14,124,102,.08); }
.user-menu {
  display:none; position:absolute; right:0; top:calc(100% + 6px); z-index:40;
  background:#fff; border:1px solid var(--line); border-radius:10px;
  box-shadow:0 10px 28px rgba(20,36,54,.14); min-width:140px; padding:6px;
}
.user-menu.show { display:block; }
.user-menu button {
  display:block; width:100%; text-align:left; background:none; border:0;
  padding:8px 12px; border-radius:8px; font-size:13px; cursor:pointer; color:#243044;
}
.user-menu button:hover { background:#f3f6f8; }

.login-mask{
  position:fixed; inset:0; z-index:10000;
  display:flex; align-items:center; justify-content:center;
  background:
    radial-gradient(1200px 700px at 10% 10%, rgba(90,160,255,.35), transparent 55%),
    radial-gradient(900px 600px at 90% 80%, rgba(30,80,180,.45), transparent 50%),
    linear-gradient(160deg, #163a7a 0%, #1d4e9a 38%, #2456a8 62%, #1a3d82 100%);
  overflow:hidden;
}
.login-mask::before,
.login-mask::after{
  content:""; position:absolute; border-radius:46% 54% 42% 58%;
  background: rgba(255,255,255,.06); pointer-events:none;
}
.login-mask::before{ width:70vw; height:70vw; left:-18vw; top:-22vw; transform:rotate(-18deg); }
.login-mask::after{ width:62vw; height:62vw; right:-16vw; bottom:-28vw; transform:rotate(12deg); background:rgba(10,40,110,.22); }
.login-brand{
  position:absolute; left:28px; top:22px; z-index:2;
  display:flex; align-items:center; gap:10px; color:#fff;
}
.login-brand img{ width:36px; height:36px; object-fit:contain; filter:brightness(0) invert(1); }
.login-brand-name{ font-size:16px; font-weight:700; letter-spacing:.5px; line-height:1.2; }
.login-brand-sub{ font-size:11px; opacity:.8; }
.login-card{
  position:relative; z-index:2; width:440px; max-width:calc(100vw - 32px);
  padding:48px 44px 30px;
  background: rgba(255,255,255,.22);
  border:1px solid rgba(255,255,255,.28);
  border-radius:20px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 20px 50px rgba(8,24,60,.28);
  display:flex; flex-direction:column; align-items:stretch;
}
.login-avatar{
  width:88px; height:88px; border-radius:50%; margin:0 auto 30px;
  background:#2f6fe4; color:#fff; font-size:24px; font-weight:700;
  display:flex; align-items:center; justify-content:center;
  overflow:hidden; padding:0 10px; word-break:break-all; line-height:1.1;
  box-shadow:0 8px 18px rgba(20,60,160,.35);
}
.login-field{
  display:flex; align-items:center; gap:10px;
  height:44px; padding:0 16px 0 14px; margin-bottom:14px;
  background: rgba(255,255,255,.88); border-radius:22px;
  color:#8a94a6;
}
.login-field input{
  flex:1; border:0; background:transparent; outline:none;
  height:44px; font-size:14px; color:#243044;
}
.login-field input::placeholder{ color:#a8b0bc; }
.login-ico{ display:flex; color:#9aa3b2; flex-shrink:0; }
.login-err{
  min-height:18px; font-size:12px; color:#ffd0d8; text-align:center; margin:-4px 0 8px;
}
.login-btn{
  height:44px; border:0; border-radius:22px; cursor:pointer;
  background:#ff2d6f; color:#fff; font-size:16px; font-weight:700; letter-spacing:4px;
  box-shadow:0 8px 18px rgba(255,45,111,.35);
}
.login-btn:hover{ filter:brightness(1.05); }
.login-btn:disabled{ opacity:.65; cursor:wait; }
.login-links{
  display:flex; justify-content:center; align-items:center; gap:20px;
  margin-top:12px; font-size:12px; color:rgba(255,255,255,.78);
}
.login-links a{ color:rgba(255,255,255,.78); text-decoration:none; margin-right:0; }
.login-links a:hover{ color:#fff; }
.login-qr{
  display:block; text-align:center; margin-top:28px;
  font-size:12px; color:rgba(255,255,255,.85); text-decoration:none;
}
.login-qr:hover{ color:#fff; }
@media print{
  .login-mask{ display:none !important; }
}
.user-chip .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg,#0e7c66,#12b886); color:#fff;
  display:flex; align-items:center; justify-content:center; font-weight:700;
}
.user-chip .p2 { font-size:11px; color:var(--ink-3); }
.sync-badge {
  font-size: 11.5px; color: var(--st-ok); background: var(--brand-soft);
  padding: 4px 10px; border-radius: 20px; display:inline-flex; align-items:center; gap:6px;
}
.sync-badge .dot { width:7px;height:7px;border-radius:50%;background:var(--st-ok); animation:pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

/* 主内容区：占满顶栏以下剩余高度，自身不滚动；内容溢出由页内各容器滚动 */
.page { flex: 1; min-height: 0; padding: 14px 22px 16px; overflow: hidden; display: flex; flex-direction: column; position: relative; }
/* 页面直接子元素默认保持自然高度（不参与拉伸），避免统计块/工具条被压缩 */
.page > * { flex-shrink: 0; }
/* 主体内容块（主卡片 / 双栏分类账 / 直铺表格）：占满剩余高度 */
.page > .card:last-of-type,
.page > .ledger-layout,
.page > .table-wrap { flex: 1; min-height: 0; }
/* 主卡片自身变为列容器，头部/工具条固定，表格区撑满滚动 */
.page > .card:last-of-type { display: flex; flex-direction: column; position: relative; }
/* 分页条固定贴底（.page 直接子元素或主卡片内），内容溢出时始终可见，不被裁剪 */
.page > .pager,
.page > .card:last-of-type > .pager {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  margin: 0; padding: 8px 2px 0; flex-shrink: 0;
  background: var(--bg);
  box-shadow: 0 -6px 10px -6px rgba(0,0,0,.12);
}
/* 表格容器底部为固定分页条预留空间 */
.page > .table-wrap,
.page > .card:last-of-type > .table-wrap { padding-bottom: 52px; box-sizing: border-box; }
/* 分类账双栏：左右卡片等高分栏 */
.page > .ledger-layout { grid-template-rows: minmax(0, 1fr); }
.page > .ledger-layout > .card { min-height: 0; display: flex; flex-direction: column; }
/* 卡片内表格区：占满剩余高度并独立滚动 */
.page .table-wrap { flex: 1; min-height: 0; }
/* 单位表/字典页：分组块占满卡片剩余高度，表头/添加行固定，清单区独立滚动 */
.page > .card:last-of-type > .unit-block,
.page > .card:last-of-type > .unit-grid { flex: 1; min-height: 0; }
/* 供货单位表：多分组网格行均分剩余高度，各组内部滚动 */
.page > .card:last-of-type > .unit-grid { grid-auto-rows: minmax(0, 1fr); overflow: hidden; }
.page > .card:last-of-type > .unit-grid > .unit-block { display: flex; flex-direction: column; min-height: 0; }
/* 字典页：单分组块为列容器 */
.page > .card:last-of-type > .unit-block { display: flex; flex-direction: column; }
.page .unit-head { flex-shrink: 0; }
.page .unit-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.page .unit-addrow { flex-shrink: 0; }
/* 分组内表格区最小高度兜底，避免极端压缩下完全不可见 */
.page .unit-body .table-wrap { min-height: 80px; }
/* 检验报告页：报告卡片列表占满剩余高度，超出时列表容器内滚动 */
.page > .card-list { flex: 1; min-height: 0; overflow-y: auto; padding-right: 2px; }
.page > .card-list > .card:last-child { margin-bottom: 0; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card .card-head {
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;
}
.card .card-head .tt { font-size: 15px; font-weight: 700; }
.card .card-head .sub { font-size: 12px; color: var(--ink-3); margin-top:2px; }
.card-body { padding: 16px 18px; }

/* ---------------- 统计块 ---------------- */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr));
  gap: 14px; margin-bottom: 18px;
}
.stat {
  background: var(--card); border:1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
/* 验收台账：统计块作为筛选按钮（button.stat），其他模块 div.stat 不受影响 */
button.stat {
  cursor: pointer; font-family: inherit; text-align: left; color: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
button.stat:hover { border-color: var(--brand); }
button.stat.active { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
button.stat.active .label { color: var(--brand); font-weight: 700; }
.stat .label { font-size: 12px; color: var(--ink-2); }
.stat .num { font-size: 26px; font-weight: 800; margin: 4px 0 2px; }
.stat .sub { font-size: 11.5px; color: var(--ink-3); }
.stat .num.c-ok{color:var(--st-ok)} .stat .num.c-bad{color:var(--st-bad)}
.stat .num.c-warn{color:var(--st-pending)} .stat .num.c-info{color:var(--accent)}
.stat .num.c-brand{color:var(--brand)}
.stat .num.c-violet{color:#7c3aed}

/* 基础信息 · 物料编码 */
.vitrine { padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: 13px; background: var(--bg-2, #fafbfc); }
.card-foot { padding: 10px 14px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12.5px; text-align: right; }
.sync-badge.sync-cloud .dot { background: var(--accent); }

/* ---------------- 表格 ---------------- */
/* 表格容器：页面内由 flex 撑满剩余高度并独立滚动；弹窗内自然高度由弹窗滚动 */
.table-wrap { overflow: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 680px; }
table.grid th, table.grid td {
  padding: 9px 10px; border: 1px solid var(--line); text-align: left; white-space: nowrap;
}
/* 物料复验台账：表头与内容全部居中 */
table.grid.fy-grid th, table.grid.fy-grid td { text-align: center; }
/* 编辑检验结果明细：检验项目 180、判定 85、操作 60 锁死，标准限度/检验结果均分剩余宽度 */
table.grid.rec-items-tbl{ min-width:0; width:100%; table-layout:fixed; }
table.grid.rec-items-tbl th, table.grid.rec-items-tbl td{ white-space:normal; }
table.grid.rec-items-tbl .rec-th-name,
table.grid.rec-items-tbl .rec-td-name{
  width:180px !important; min-width:180px !important; max-width:180px !important;
  box-sizing:border-box;
}
table.grid.rec-items-tbl .rec-th-vd,
table.grid.rec-items-tbl .rec-td-vd{
  width:85px !important; min-width:85px !important; max-width:85px !important;
  padding-left:4px; padding-right:4px; box-sizing:border-box; overflow:hidden;
}
table.grid.rec-items-tbl .rec-th-op,
table.grid.rec-items-tbl .rec-td-op{
  width:60px !important; min-width:60px !important; max-width:60px !important;
  padding-left:2px; padding-right:2px; box-sizing:border-box; overflow:hidden;
}
table.grid thead th {
  background: var(--brand-soft2); font-weight: 700; font-size: 12.5px; color: var(--ink);
  position: sticky; top: 0; z-index: 2;
}
table.grid tbody tr:nth-child(even){ background:#fafbfc; }
table.grid tbody tr:hover { background: var(--brand-soft); }
table.grid .num-r { text-align: right; }
/* 生产统计表格：抬头与内容全部居中 */
table.grid.ps-t th, table.grid.ps-t td { text-align:center; }

/* 基础物料编码表（保健/药品）：内容居中显示 */
table.grid.mt-t th, table.grid.mt-t td { text-align:center; }
/* 检验台账列表：表头与内容全部居中 */
table.grid.ql-t th, table.grid.ql-t td { text-align:center; }
/* 检验台账：固定列宽，超出列宽自动换行显示 */
table.grid.ql-t, table.grid.ql-g{ table-layout:fixed; width:100%; min-width:0; }
table.grid.ql-t th, table.grid.ql-t td,
table.grid.ql-g th, table.grid.ql-g td{ white-space:normal !important; word-break:break-all; overflow:hidden; }
/* 视图一：物料/包材台账（11 列） */
table.grid.ql-t th:nth-child(1),  table.grid.ql-t td:nth-child(1){ width:48px; }
table.grid.ql-t th:nth-child(2),  table.grid.ql-t td:nth-child(2){ width:170px; }
table.grid.ql-t th:nth-child(3),  table.grid.ql-t td:nth-child(3){ width:140px; }
table.grid.ql-t th:nth-child(4),  table.grid.ql-t td:nth-child(4){ width:160px; }
table.grid.ql-t th:nth-child(5),  table.grid.ql-t td:nth-child(5){ width:130px; }
table.grid.ql-t th:nth-child(6),  table.grid.ql-t td:nth-child(6){ width:80px; }
table.grid.ql-t th:nth-child(7),  table.grid.ql-t td:nth-child(7){ width:100px; }
table.grid.ql-t th:nth-child(8),  table.grid.ql-t td:nth-child(8){ width:80px; }
table.grid.ql-t th:nth-child(9),  table.grid.ql-t td:nth-child(9){ width:160px; }
table.grid.ql-t th:nth-child(10), table.grid.ql-t td:nth-child(10){ width:80px; }
table.grid.ql-t th:nth-child(11), table.grid.ql-t td:nth-child(11){ width:100px; }
table.grid.ql-t th:nth-child(12), table.grid.ql-t td:nth-child(12){ width:60px; }
/* 食品成品台账（15 列）：操作列固定 80px，剩余宽度分给前面列（成品名称不锁死） */
table.grid.ql-t.ql-cp th:nth-child(1),  table.grid.ql-t.ql-cp td:nth-child(1){ width:44px; }
table.grid.ql-t.ql-cp th:nth-child(2),  table.grid.ql-t.ql-cp td:nth-child(2){ width:auto; min-width:120px; }
table.grid.ql-t.ql-cp th:nth-child(3),  table.grid.ql-t.ql-cp td:nth-child(3){ width:90px; }
table.grid.ql-t.ql-cp th:nth-child(4),  table.grid.ql-t.ql-cp td:nth-child(4){ width:100px; }
table.grid.ql-t.ql-cp th:nth-child(5),  table.grid.ql-t.ql-cp td:nth-child(5){ width:90px; }
table.grid.ql-t.ql-cp th:nth-child(6),  table.grid.ql-t.ql-cp td:nth-child(6){ width:90px; }
table.grid.ql-t.ql-cp th:nth-child(7),  table.grid.ql-t.ql-cp td:nth-child(7){ width:90px; }
table.grid.ql-t.ql-cp th:nth-child(8),  table.grid.ql-t.ql-cp td:nth-child(8){ width:90px; }
table.grid.ql-t.ql-cp th:nth-child(9),  table.grid.ql-t.ql-cp td:nth-child(9){ width:50px; }
table.grid.ql-t.ql-cp th:nth-child(10), table.grid.ql-t.ql-cp td:nth-child(10){ width:90px; }
table.grid.ql-t.ql-cp th:nth-child(11), table.grid.ql-t.ql-cp td:nth-child(11){ width:160px; }
table.grid.ql-t.ql-cp th:nth-child(12), table.grid.ql-t.ql-cp td:nth-child(12){ width:190px; }
table.grid.ql-t.ql-cp th:nth-child(13), table.grid.ql-t.ql-cp td:nth-child(13){ width:100px; }
table.grid.ql-t.ql-cp th:nth-child(14), table.grid.ql-t.ql-cp td:nth-child(14){ width:100px; }
table.grid.ql-t.ql-cp th:nth-child(15), table.grid.ql-t.ql-cp td:nth-child(15),
table.grid.ql-t.ql-cp td.col-op{ width:80px; min-width:80px; max-width:80px; }
/* 成品台账（生产统计版）：按类定宽（食品成品 14 列 / 药品成品 13 列均适用，不受列数增减影响） */
table.grid.ql-t.ql-cp th.cp-w120, table.grid.ql-t.ql-cp td.cp-w120{ width:120px; }
table.grid.ql-t.ql-cp th.cp-w150, table.grid.ql-t.ql-cp td.cp-w150{ width:150px; }
/* 饮片/提取物台账（cp-ext）：报告单编号列加宽到 200px */
table.grid.ql-t.ql-cp.cp-ext th.cp-w150, table.grid.ql-t.ql-cp.cp-ext td.cp-w150{ width:200px !important; }
table.grid.ql-t.ql-cp th.cp-w80,  table.grid.ql-t.ql-cp td.cp-w80{ width:80px !important; }
table.grid.ql-t.ql-cp th.cp-w100, table.grid.ql-t.ql-cp td.cp-w100{ width:100px; }
/* cp-w60/cp-w100 需压过 cp-ext 的 nth-child 定宽（同表共存时序号规则优先级更高） */
table.grid.ql-t.ql-cp th.cp-w60,  table.grid.ql-t.ql-cp td.cp-w60{ width:60px !important; }
table.grid.ql-t.ql-cp th.cp-w100, table.grid.ql-t.ql-cp td.cp-w100{ width:100px !important; }
table.grid.ql-t.ql-cp th.cp-pack, table.grid.ql-t.ql-cp td.cp-pack{ width:150px; }
table.grid.ql-t.ql-cp th.cp-result, table.grid.ql-t.ql-cp td.cp-result{ width:80px; }
/* 食品成品台账专属列宽：产品编号110/产品批号110/生产日期110/有效期至110/代表量80/客户报告量80/单位70/包装规格150/
   取样日期100(cp-w100)/取样时间60(cp-w60)/检验日期110/报告单编号200/检验结果80/报告日期110/操作80
   —— 取样日期、取样时间为后加的列（数据来源生产统计 sampleDate/sampleTime），其后各列位次整体后移 2 */
table.grid.ql-t.ql-cp.cp-food th:nth-child(3),  table.grid.ql-t.ql-cp.cp-food td:nth-child(3),
table.grid.ql-t.ql-cp.cp-food th:nth-child(4),  table.grid.ql-t.ql-cp.cp-food td:nth-child(4),
table.grid.ql-t.ql-cp.cp-food th:nth-child(5),  table.grid.ql-t.ql-cp.cp-food td:nth-child(5),
table.grid.ql-t.ql-cp.cp-food th:nth-child(6),  table.grid.ql-t.ql-cp.cp-food td:nth-child(6),
table.grid.ql-t.ql-cp.cp-food th:nth-child(13), table.grid.ql-t.ql-cp.cp-food td:nth-child(13),
table.grid.ql-t.ql-cp.cp-food th:nth-child(16), table.grid.ql-t.ql-cp.cp-food td:nth-child(16){ width:110px; }
table.grid.ql-t.ql-cp.cp-food th:nth-child(7),  table.grid.ql-t.ql-cp.cp-food td:nth-child(7),
table.grid.ql-t.ql-cp.cp-food th:nth-child(8),  table.grid.ql-t.ql-cp.cp-food td:nth-child(8){ width:80px; }
table.grid.ql-t.ql-cp.cp-food th:nth-child(9),  table.grid.ql-t.ql-cp.cp-food td:nth-child(9){ width:70px; }
table.grid.ql-t.ql-cp.cp-food th:nth-child(14), table.grid.ql-t.ql-cp.cp-food td:nth-child(14){ width:200px; }
/* 提取物台账（12 列）：产品编号/产品批号/生产日期/有效期至/代表量/单位/检验日期/报告日期 120px、报告单编号 150px、检验结果 80px */
table.grid.ql-t.ql-cp.cp-ext th:nth-child(3),  table.grid.ql-t.ql-cp.cp-ext td:nth-child(3),
table.grid.ql-t.ql-cp.cp-ext th:nth-child(4),  table.grid.ql-t.ql-cp.cp-ext td:nth-child(4),
table.grid.ql-t.ql-cp.cp-ext th:nth-child(5),  table.grid.ql-t.ql-cp.cp-ext td:nth-child(5),
table.grid.ql-t.ql-cp.cp-ext th:nth-child(6),  table.grid.ql-t.ql-cp.cp-ext td:nth-child(6),
table.grid.ql-t.ql-cp.cp-ext th:nth-child(7),  table.grid.ql-t.ql-cp.cp-ext td:nth-child(7),
table.grid.ql-t.ql-cp.cp-ext th:nth-child(8),  table.grid.ql-t.ql-cp.cp-ext td:nth-child(8),
table.grid.ql-t.ql-cp.cp-ext th:nth-child(9),  table.grid.ql-t.ql-cp.cp-ext td:nth-child(9),
table.grid.ql-t.ql-cp.cp-ext th:nth-child(12), table.grid.ql-t.ql-cp.cp-ext td:nth-child(12){ width:120px; }
table.grid.ql-t.ql-cp.cp-ext th:nth-child(10), table.grid.ql-t.ql-cp.cp-ext td:nth-child(10){ width:150px; }
/* 检验结果下拉：限定在列宽内 */
table.grid.ql-t td select.ed-result{ width:100%; min-width:0; max-width:100%; box-sizing:border-box; }table.grid.ql-t .sq-cell{ display:flex; align-items:center; gap:4px; }
table.grid.ql-t .ed-sqty-inp{ width:46px; min-width:0; max-width:46px; padding:2px 4px; font-size:12px; font-family:var(--font); color:var(--ink); border:1px solid var(--line); border-radius:5px; outline:none; background:#fff; box-sizing:border-box; text-align:center; }
table.grid.ql-t .ed-sqty-inp:focus{ border-color:var(--brand); }
table.grid.ql-t .sq-unit{ color:var(--ink-3); font-size:12px; white-space:nowrap; }
/* 物料/包材台账：与验收记录一致的行高/字体/两行省略 */
table.grid.ql-t thead th, table.grid.ql-t tbody td{
  vertical-align:middle;
  padding:4px 4px !important; overflow:hidden; text-overflow:ellipsis; font-size:12.5px; height:auto !important;
}
table.grid.ql-t thead th{ letter-spacing:0; height:40px !important; line-height:32px !important; }
table.grid.ql-t tbody tr{ height:46px; }
table.grid.ql-t td .cell{
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2;
  line-height:16px; overflow:hidden; word-break:break-all; text-align:center; max-width:100%;
}
/* 操作列按钮压缩高度，避免撑高数据行 */
table.grid.ql-t td.col-op .btn{ height:22px; line-height:20px; padding:1px 8px; font-size:12px; min-width:0; }
table.grid.ql-t td:hover{ overflow:visible; }
/* 视图二：中间体/成品/水质/洁净度（13 列） */
table.grid.ql-g th:nth-child(1),  table.grid.ql-g td:nth-child(1){ width:105px; }
table.grid.ql-g th:nth-child(2),  table.grid.ql-g td:nth-child(2){ width:135px; }
table.grid.ql-g th:nth-child(3),  table.grid.ql-g td:nth-child(3){ width:100px; }
table.grid.ql-g th:nth-child(4),  table.grid.ql-g td:nth-child(4){ width:100px; }
table.grid.ql-g th:nth-child(5),  table.grid.ql-g td:nth-child(5){ width:90px; }
table.grid.ql-g th:nth-child(6),  table.grid.ql-g td:nth-child(6){ width:70px; }
table.grid.ql-g th:nth-child(7),  table.grid.ql-g td:nth-child(7){ width:140px; }
table.grid.ql-g th:nth-child(8),  table.grid.ql-g td:nth-child(8){ width:60px; }
table.grid.ql-g th:nth-child(9),  table.grid.ql-g td:nth-child(9){ width:65px; }
table.grid.ql-g th:nth-child(10), table.grid.ql-g td:nth-child(10){ width:65px; }
table.grid.ql-g th:nth-child(11), table.grid.ql-g td:nth-child(11){ width:65px; }
table.grid.ql-g th:nth-child(12), table.grid.ql-g td:nth-child(12){ width:90px; }
table.grid.ql-g th:nth-child(13), table.grid.ql-g td:nth-child(13){ width:90px; }
/* 饮用水台账（屏幕列表）：表头与内容全部居中显示 */
table.grid.ql-water thead th, table.grid.ql-water tbody td{ text-align:center; }
/* 操作列只占「编辑 删除」两个按钮的宽度（其余列吸收剩余宽度）：改为内容自适应 + 末列按内容收窄 */
table.grid.ql-water{ table-layout:auto; }
table.grid.ql-water th, table.grid.ql-water td{ white-space:nowrap !important; }
table.grid.ql-water th:last-child, table.grid.ql-water td:last-child{ width:1%; white-space:nowrap !important; }
/* 饮用水台账：可点击直接编辑的单元格（批号/取样日期/报告日期/报告编号） */
table.grid.ql-water td.ed-cell{ cursor:pointer; }
table.grid.ql-water td.ed-cell:hover{ background:var(--brand-soft); }
table.grid.ql-water td.ed-cell .ed-input{ width:100%; min-width:0; max-width:none; padding:2px 4px; }
/* 固定列宽，避免行内编辑时列宽收缩/重排 */
table.grid.ps-t{ table-layout:fixed; }
table.grid.ps-t th, table.grid.ps-t td{ word-break:break-all; }
/* 长表头/内容列自动换行（覆盖 grid 通用 nowrap）：规格、内包规格、瓶(袋)/盒、盒/件、入库数量等 */
table.grid.ps-t th, table.grid.ps-t td{ white-space:normal; }
/* 产品编码列（第3列）默认 100px；药品成品表保持 60px（编码短，如 CP-001） */
table.grid.ps-t th:nth-child(1),  table.grid.ps-t td:nth-child(1){ width:45px; }
table.grid.ps-t th:nth-child(2),  table.grid.ps-t td:nth-child(2){ width:180px; }
table.grid.ps-t th:nth-child(3),  table.grid.ps-t td:nth-child(3){ width:100px; }
/* 药品成品生产统计表：产品编码列与产品批号同宽（80px） */
table.grid.ps-t.ps-drug th:nth-child(3), table.grid.ps-t.ps-drug td:nth-child(3){ width:80px; }
/* 药品成品生产统计表：单位列 60px */
table.grid.ps-t.ps-drug th:nth-child(12), table.grid.ps-t.ps-drug td:nth-child(12){ width:60px; }
table.grid.ps-t th:nth-child(4),  table.grid.ps-t td:nth-child(4){ width:80px; }
table.grid.ps-t th:nth-child(5),  table.grid.ps-t td:nth-child(5){ width:85px; }
table.grid.ps-t th:nth-child(6),  table.grid.ps-t td:nth-child(6){ width:85px; }
/* 食品成品生产统计表：报告日期列（第7列）与生产日期（第5列 85px）同宽——原规则即 85px，保持一致 */
table.grid.ps-t th:nth-child(7),  table.grid.ps-t td:nth-child(7){ width:85px; }
table.grid.ps-t th:nth-child(8),  table.grid.ps-t td:nth-child(8){ width:80px; }   /* 理论量：与入库量（第9列）同宽 */
table.grid.ps-t th:nth-child(9),  table.grid.ps-t td:nth-child(9){ width:80px; }
table.grid.ps-t th:nth-child(10), table.grid.ps-t td:nth-child(10){ width:80px; }
table.grid.ps-t th:nth-child(11), table.grid.ps-t td:nth-child(11){ width:55px; }
table.grid.ps-t th:nth-child(12), table.grid.ps-t td:nth-child(12){ width:50px; }
table.grid.ps-t th:nth-child(13), table.grid.ps-t td:nth-child(13){ width:90px; }   /* 规格（包装规格列之前） */
table.grid.ps-t th:nth-child(14), table.grid.ps-t td:nth-child(14){ width:80px; }
table.grid.ps-t th:nth-child(15), table.grid.ps-t td:nth-child(15){ width:90px; }
table.grid.ps-t th:nth-child(16), table.grid.ps-t td:nth-child(16){ width:80px; }
table.grid.ps-t th:nth-child(17), table.grid.ps-t td:nth-child(17){ width:85px; }
table.grid.ps-t th:nth-child(18), table.grid.ps-t td:nth-child(18){ width:70px; }
table.grid.ps-t th:nth-child(19), table.grid.ps-t td:nth-child(19){ width:70px; }
table.grid.ps-t th:nth-child(20), table.grid.ps-t td:nth-child(20){ width:50px; }
table.grid.ps-t th:nth-child(21), table.grid.ps-t td:nth-child(21){ width:70px; }
/* 操作列（最后一列）：宽度收紧到刚好放下按钮，不占多余空间 */
table.grid.ps-t th:last-child, table.grid.ps-t td:last-child{ width:60px; min-width:60px; }
/* 药品成品表：操作列含"编辑/删除"两个按钮，列宽放宽 */
table.grid.ps-t.ps-drug th:last-child, table.grid.ps-t.ps-drug td:last-child{ width:112px; min-width:112px; }
/* 食品成品表（ps-ffin）："入库数量"列前新增"入库日期"列，其后各列整体后移一位
   （原 19 入库数量 / 20 件数 / 21 实入量 → 20 / 21 / 22），
   故按新位次重设列宽，避免沿用上面的通用 nth-child 规则造成错位；
   入库日期给 85px、允许换行（与生产日期/有效期至同宽，日期一行放得下） */
table.grid.ps-t.ps-ffin th:nth-child(19), table.grid.ps-t.ps-ffin td:nth-child(19){ width:85px; white-space:normal; }
table.grid.ps-t.ps-ffin th:nth-child(20), table.grid.ps-t.ps-ffin td:nth-child(20){ width:70px; }
table.grid.ps-t.ps-ffin th:nth-child(21), table.grid.ps-t.ps-ffin td:nth-child(21){ width:50px; }
table.grid.ps-t.ps-ffin th:nth-child(22), table.grid.ps-t.ps-ffin td:nth-child(22){ width:70px; }
/* 药品成品生产统计表（ps-drug）整表按屏幕宽度固定列宽：22 列改用百分比等比分配，合计 99.3%，
   余量由浏览器按比例摊回，既保证表格铺满容器宽度、又不因亚像素取整多出 1px 而出现左右滚动条。
   （原为固定 px 宽，合计约 1790px，窄屏下必须左右拖动才能看完最后一列）
   位次与表头一致：1序号 2产品名称 3产品编码 4产品批号 5生产日期 6有效期至 7报告日期 8理论量 9入库量
   10取样量 11收率 12单位 13规格 14片(粒)/板 15板/盒 16盒/件 17取样日期 18取样时间 19入库数量 20件数
   21实入量 22操作；操作列原 min-width:112px 会撑出滚动条，这里一并放开
   日期类列给足比例（5.3%），窄屏下仍会自动折行——行高 54px 可容纳两行，不会撑高表格 */
table.grid.ps-t.ps-drug th:nth-child(1),  table.grid.ps-t.ps-drug td:nth-child(1){ width:2.4%; }
table.grid.ps-t.ps-drug th:nth-child(2),  table.grid.ps-t.ps-drug td:nth-child(2){ width:8.0%; }
table.grid.ps-t.ps-drug th:nth-child(3),  table.grid.ps-t.ps-drug td:nth-child(3){ width:4.3%; }
table.grid.ps-t.ps-drug th:nth-child(4),  table.grid.ps-t.ps-drug td:nth-child(4){ width:4.5%; }
table.grid.ps-t.ps-drug th:nth-child(5),  table.grid.ps-t.ps-drug td:nth-child(5){ width:5.3%; }
table.grid.ps-t.ps-drug th:nth-child(6),  table.grid.ps-t.ps-drug td:nth-child(6){ width:5.3%; }
/* 报告日期列在页面里带行内 white-space:nowrap（原为防止日期折行），窄屏下会溢出到相邻列，这里强制放开换行 */
table.grid.ps-t.ps-drug th:nth-child(7),  table.grid.ps-t.ps-drug td:nth-child(7){ width:5.3%; white-space:normal !important; }
table.grid.ps-t.ps-drug th:nth-child(8),  table.grid.ps-t.ps-drug td:nth-child(8){ width:4.2%; }
table.grid.ps-t.ps-drug th:nth-child(9),  table.grid.ps-t.ps-drug td:nth-child(9){ width:4.2%; }
table.grid.ps-t.ps-drug th:nth-child(10), table.grid.ps-t.ps-drug td:nth-child(10){ width:4.2%; }
table.grid.ps-t.ps-drug th:nth-child(11), table.grid.ps-t.ps-drug td:nth-child(11){ width:3.3%; }
table.grid.ps-t.ps-drug th:nth-child(12), table.grid.ps-t.ps-drug td:nth-child(12){ width:2.8%; }
table.grid.ps-t.ps-drug th:nth-child(13), table.grid.ps-t.ps-drug td:nth-child(13){ width:4.3%; }
table.grid.ps-t.ps-drug th:nth-child(14), table.grid.ps-t.ps-drug td:nth-child(14){ width:4.3%; }
table.grid.ps-t.ps-drug th:nth-child(15), table.grid.ps-t.ps-drug td:nth-child(15){ width:4.2%; }
table.grid.ps-t.ps-drug th:nth-child(16), table.grid.ps-t.ps-drug td:nth-child(16){ width:4.2%; }
table.grid.ps-t.ps-drug th:nth-child(17), table.grid.ps-t.ps-drug td:nth-child(17){ width:5.3%; }
table.grid.ps-t.ps-drug th:nth-child(18), table.grid.ps-t.ps-drug td:nth-child(18){ width:4.5%; }
table.grid.ps-t.ps-drug th:nth-child(19), table.grid.ps-t.ps-drug td:nth-child(19){ width:4.3%; }
table.grid.ps-t.ps-drug th:nth-child(20), table.grid.ps-t.ps-drug td:nth-child(20){ width:3.4%; }
table.grid.ps-t.ps-drug th:nth-child(21), table.grid.ps-t.ps-drug td:nth-child(21){ width:4.3%; }
/* 操作列（末列）：同样按百分比，并放开原 min-width 以免撑出横向滚动条 */
table.grid.ps-t.ps-drug th:last-child, table.grid.ps-t.ps-drug td:last-child{ width:6.7%; min-width:0; }
table.grid.ps-t td:last-child .btn.sm{ padding:3px 8px; white-space:nowrap; }
/* 内联编辑单元格 */
table.grid.ps-t td.ed{ cursor:text; }
table.grid.ps-t td.ed:hover{ background:#f0f7f5; }
/* 生产统计表产品名称：允许换行，行内 div 限制两行省略 + 气泡显示全名 */
table.grid.ps-t tbody tr { height: 54px; }     /* 行高固定为两行高：36px内容 + 上下各9px padding */
table.grid.ps-t td:nth-child(2) { white-space: normal; vertical-align: middle; text-align: center; }
.ps-name-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 18px;
  max-height: 36px;        /* 2 × line-height，确保最多两行 */
  word-break: break-all;
  white-space: normal;
  text-align: center;
}
.ed-input{ width:120px; min-width:120px; max-width:120px; padding:3px 6px; font-size:12.5px; font-family:var(--font); color:var(--ink); border:1px solid var(--brand); border-radius:6px; outline:none; background:#fff; box-sizing:border-box; }
/* 物料分类账：表格行内直接编辑（点击单元格原地改，回车/失焦保存，Esc 取消） */
.ld-t td[data-ldf]{ cursor:text; }
.ld-t td[data-ldf]:hover{ background:#fffbe6; box-shadow: inset 0 0 0 1px #f0d98c; }
.ld-t td.ld-editing{ background:#fff; box-shadow: inset 0 0 0 2px var(--brand); padding:2px 4px; }
.ld-t td.ld-editing input.ed-input{ width:100%; min-width:0; max-width:100%; padding:2px 5px; }
td.ed-w-name input{ width:360px; min-width:360px; max-width:360px; }
td.ed-w-batch input{ width:200px; min-width:200px; max-width:200px; }
td.ed-w-qty input{ width:90px; min-width:90px; max-width:90px; }
td.ed-w-sm input{ width:50px; min-width:50px; max-width:50px; }
/* 生产统计表：编辑框宽度自动适配列宽 */
table.grid.ps-t .ed-input{ width:100%; min-width:0; max-width:none; padding:2px 4px; }
table.grid.ps-t td.ed{ padding:4px 5px; }
/* 物料初验表：固定列宽 + 内容居中 + 两行行高 */
table.grid.cy-t{ table-layout:fixed; }
table.grid.cy-t th, table.grid.cy-t td{ text-align:center; word-break:break-all; }
/* 物料初验单元格：最多 2 行、超出省略（悬停 title 气泡显示完整内容）；行高固定为两行高度 */
table.grid.cy-t tbody tr{ height:54px; }
/* 物料分类账"添加复验"按钮 / 药品成品分类账"添加返工"按钮：
   绝对定位在来源去向单元格右侧，不占列宽、不影响文字居中 */
table.grid td.ld-src{ position:relative; }
table.grid td.ld-src .ld-addfy,
table.grid td.ld-src .ld-addrw{
  position:absolute; right:4px; top:50%; transform:translateY(-50%);
  height:24px; padding:0 8px; font-size:11px; line-height:22px; margin:0;
}
table.grid td.ld-src .ld-addfy:disabled,
table.grid td.ld-src .ld-addrw:disabled{ opacity:.55; cursor:not-allowed; }
table.grid.cy-t td .cy-clamp{
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
  overflow:hidden; white-space:normal; line-height:1.45; cursor:default;
}
table.grid.cy-t th:nth-child(1),  table.grid.cy-t td:nth-child(1){ width:45px; }
table.grid.cy-t th:nth-child(2),  table.grid.cy-t td:nth-child(2){ width:160px; }
table.grid.cy-t th:nth-child(3),  table.grid.cy-t td:nth-child(3){ width:70px; }
table.grid.cy-t th:nth-child(4),  table.grid.cy-t td:nth-child(4){ width:140px; }
table.grid.cy-t th:nth-child(5),  table.grid.cy-t td:nth-child(5){ width:140px; }
table.grid.cy-t th:nth-child(6),  table.grid.cy-t td:nth-child(6){ width:70px; }
table.grid.cy-t th:nth-child(7),  table.grid.cy-t td:nth-child(7){ width:90px; }
table.grid.cy-t th:nth-child(8),  table.grid.cy-t td:nth-child(8){ width:90px; }
table.grid.cy-t th:nth-child(9),  table.grid.cy-t td:nth-child(9){ width:80px; }
table.grid.cy-t th:nth-child(10), table.grid.cy-t td:nth-child(10){ width:80px; }
table.grid.cy-t th:nth-child(11), table.grid.cy-t td:nth-child(11){ width:130px; white-space:nowrap; }
table.grid.cy-t td.col-op .btn{ padding:2px 6px; font-size:12px; margin:0 1px; }
table.grid.cy-t td.col-op .btn[data-view]{ background:#2f6feb; color:#fff; border-color:#2f6feb; }
table.grid.cy-t td.col-op .btn[data-print]{ background:#16a34a; color:#fff; border-color:#16a34a; }
table.grid.cy-t td.col-op .btn[data-export]{ background:#d97706; color:#fff; border-color:#d97706; }
.ob-short{ color:#e02020; font-weight:700; }
/* 物料出库 · 原料/包材 切换按钮 */
.ob-cat-switch{ display:flex; align-items:center; gap:0; border:1px solid var(--brand); border-radius:8px; overflow:hidden; background:#fff; }
.ob-cat-switch button{ padding:7px 18px; border:none; background:#fff; color:var(--ink-2); font-size:13px; font-family:var(--font); cursor:pointer; transition:background .15s,color .15s; }
.ob-cat-switch button + button{ border-left:1px solid var(--brand); }
.ob-cat-switch button:hover{ background:#eef3ff; color:var(--brand); }
.ob-cat-switch button.on{ background:var(--brand); color:#fff; }
.ob-cat-switch button.on:hover{ background:var(--brand-dark); color:#fff; }
.ed-select{ width:70px; min-width:70px; padding:3px 6px; font-size:12.5px; font-family:var(--font); color:var(--ink); border:1px solid var(--brand); border-radius:6px; outline:none; background:#fff; box-sizing:border-box; }
/* 生产统计·类别筛选条（多选） */
.ps-filter{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:0 2px 12px; }
.ps-filter .fl-label{ font-size:12px; color:var(--ink-2); font-weight:600; white-space:nowrap; }
.ps-filter .fl-hint{ font-size:12px; color:var(--ink-3); }
.ps-filter .fl-select{ padding:4px 8px; font-size:12px; border:1px solid var(--line); border-radius:8px; background:#fff; color:var(--ink); outline:none; }
.ps-filter > .btn{ min-width:auto; padding:4px 12px; font-size:12px; border-radius:14px; }
.ps-filter > .btn.active{ background:var(--brand); color:#fff; border-color:var(--brand); }
.ps-filter .ps-ops{ margin-left:auto; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.ps-filter .ps-ops .no-label{ margin:0; font-size:12px; color:var(--ink-2); white-space:nowrap; }
.ps-filter .ps-ops input#ps-no{ width:200px; height:32px; box-sizing:border-box; }
/* 生产统计排序按钮：白底黑字（active 状态也用白底，仅边框变色区分） */
.ps-filter #ps-sort{ background:#fff; color:#000; border:1px solid var(--line); }
.ps-filter #ps-sort.active{ background:#fff; color:#000; border-color:var(--brand); }
/* 检验台账成品·类别筛选（与生产统计相同的多选胶囊按钮） */
.toolbar .ql-cats{ display:inline-flex; flex-wrap:wrap; align-items:center; gap:6px; }
.toolbar .ql-cats .fl-label{ font-size:12px; color:var(--ink-2); font-weight:600; white-space:nowrap; }
.toolbar .ql-cats .fl-hint{ font-size:12px; color:var(--ink-3); }
.toolbar .ql-cats > .btn{ min-width:auto; padding:4px 12px; font-size:12px; border-radius:14px; }
.toolbar .ql-cats > .btn.active{ background:var(--brand); color:#fff; border-color:var(--brand); }
table.grid .center{ text-align:center; }
/* 分类账流水明细：表头居中显示 */
.ledger-layout table.grid thead th{ text-align:center; }
/* 分类账流水明细：内容全部居中 */
.ledger-layout table.grid td, .ledger-layout table.grid .num-r{ text-align:center; }
/* 分类账流水明细：固定布局不超出屏幕宽度，来源/去向、备注等内容过长时自动换行 */
.ledger-layout table.grid{ table-layout:fixed; width:100%; min-width:0; }
.ledger-layout table.grid th, .ledger-layout table.grid td{ white-space:normal; word-break:break-all; }
/* 分类账流水明细：行高 35px */
.ledger-layout table.grid tbody tr{ height:35px; }
/* 分类账流水明细列宽：日期150 收入发放200 结存200 收发料人150 领料人150 备注150（来源去向自适应） */
.ledger-layout table.grid th:nth-child(1), .ledger-layout table.grid td:nth-child(1){ width:150px; min-width:150px; }
.ledger-layout table.grid th:nth-child(3), .ledger-layout table.grid td:nth-child(3){ width:200px; min-width:200px; }
.ledger-layout table.grid th:nth-child(4), .ledger-layout table.grid td:nth-child(4){ width:200px; min-width:200px; }
.ledger-layout table.grid th:nth-child(5), .ledger-layout table.grid td:nth-child(5){ width:150px; min-width:150px; }
.ledger-layout table.grid th:nth-child(6), .ledger-layout table.grid td:nth-child(6){ width:150px; min-width:150px; }
.ledger-layout table.grid th:nth-child(7), .ledger-layout table.grid td:nth-child(7){ width:150px; min-width:150px; }
.ledger-layout table.grid th:nth-child(8), .ledger-layout table.grid td:nth-child(8){ width:70px; min-width:70px; text-align:center; }
/* 配方基础表 */
.fm-table th, .fm-table td{ text-align:center; }
.grid.fm-table td.num{ color:var(--ink); }
.fm-table th:nth-child(1), .fm-table td:nth-child(1){ width:60px; min-width:60px; }
.fm-table th:nth-child(2), .fm-table td:nth-child(2){ width:220px; min-width:220px; }
.fm-table th:nth-child(3), .fm-table td:nth-child(3){ width:130px; min-width:130px; }
.fm-table th:nth-child(4), .fm-table td:nth-child(4){ width:120px; min-width:120px; }
.fm-table th:nth-child(5), .fm-table td:nth-child(5){ width:150px; min-width:150px; }
/* 包装基础表（多一列系数，共6列）覆盖列宽 */
.grid.fm-table.pk-table th:nth-child(4), .grid.fm-table.pk-table td:nth-child(4){ width:90px; min-width:90px; }
.grid.fm-table.pk-table th:nth-child(5), .grid.fm-table.pk-table td:nth-child(5){ width:120px; min-width:120px; }
.grid.fm-table.pk-table th:nth-child(6), .grid.fm-table.pk-table td:nth-child(6){ width:150px; min-width:150px; }

/* 状态标签 */
.tag { display:inline-flex; align-items:center; gap:6px; padding:2px 10px; border-radius:20px; font-size:12px; font-weight:600; }
.tag .tt{ width:6px;height:6px;border-radius:50%;background:currentColor; }
.t-ok    { background:#e9f9ef; color:var(--st-ok); }
.t-bad   { background:#fdecec; color:var(--st-bad); }
.t-pend  { background:#fdf3e1; color:var(--st-pending); }
.t-test  { background:#fdeee4; color:var(--st-testing); }
.t-info  { background:#e8f0fe; color:var(--accent); }
.t-lock  { background:#eef2f5; color:var(--st-lock); }

/* ---------------- 工具栏 ---------------- */
.toolbar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.toolbar .spacer { flex:1; }
/* 验收台账分页条 */
.pager { display:flex; align-items:center; gap:10px; padding:12px 2px 2px; font-size:12.5px; color:var(--ink-2); }
.pager .pager-info { white-space:nowrap; }
.pager .pager-page { white-space:nowrap; font-weight:600; color:var(--ink); }
.pager .spacer { flex:1; }
.pager .btn { min-width:72px; }
.pager .btn[disabled] { opacity:.4; cursor:not-allowed; }
/* 分类账物料清单分页条：单行紧凑按钮，整体居中 */
.ld-pager { gap:4px; justify-content:center; }
.ld-pager .btn { min-width:0; padding:4px 8px; font-size:12.5px; }
.ld-pager .pager-page { font-size:12px; }
input[type=text], input[type=date], input[type=number], select, textarea {
  font-family: var(--font); font-size: 13px; color: var(--ink);
  padding: 7px 10px; border:1px solid var(--line); border-radius: 8px; background:#fff;
  outline:none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,124,102,.12);
}
.search-w {
  position:relative;
}
.search-w input { width:220px; padding-left:32px; }
.search-w::before {
  content:"⌕"; position:absolute; left:10px; top:50%; transform:translateY(-54%);
  color:var(--ink-3); font-size:15px;
}

/* ---------------- 按钮 ---------------- */
.btn {
  display:inline-flex; align-items:center; gap:6px; cursor:pointer;
  border:1px solid transparent; border-radius:8px; padding:8px 14px;
  font-size:13px; font-weight:600; font-family:var(--font);
  transition: all .15s; background: var(--brand-soft); color: var(--brand);
}
.btn:hover { background:#d9efe8; }
.btn.primary { background: var(--brand); color:#fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.line { background:#fff; border-color:var(--line); color:var(--ink-2); }
.btn.line:hover { border-color:var(--ink-3); background:#f7f8f9; }
.btn.danger { background:#fdecec; color:var(--st-bad); }
.btn.danger:hover { background:#f8d7d7; }
.btn.sm { padding:5px 10px; font-size:12px; border-radius:7px; }
.btn[disabled]{opacity:.5;cursor:not-allowed}

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset:0; background: rgba(15,23,42,.4); backdrop-filter: blur(2px);
  display:none; align-items:flex-start; justify-content:center; padding:40px 16px; z-index:100;
  overflow-y:auto;
}
.modal-mask.open{ display:flex; }
.modal {
  background:#fff; border-radius:14px; box-shadow:var(--shadow-lg);
  width:100%; max-width: 1180px; animation: pop .18s ease;
}
@keyframes pop { from{ transform:translateY(10px); opacity:0 } to{ transform:none; opacity:1 } }
.modal-head {
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 20px; border-bottom:1px solid var(--line); position:sticky; top:0; background:#fff;
  border-radius:14px 14px 0 0; z-index:5;
}
.modal-head .tt{font-size:16px;font-weight:700;}
.modal-head .x{cursor:pointer;color:var(--ink-3);font-size:22px;line-height:1;padding:2px 6px;}
.modal-head .x:hover{color:var(--ink);}
.modal-body{padding:18px 20px; max-height:70vh; overflow-y:auto; overflow-x:hidden;}
.modal-foot{
  display:flex; justify-content:flex-end; gap:10px; padding:14px 20px;
  border-top:1px solid var(--line); position:sticky; bottom:0; background:#fff;
  border-radius:0 0 14px 14px;
}

/* 固定布局弹窗：弹窗整体不滚动，仅内部列表独立滚动（编辑检验结果） */
.modal.modal-fit{ max-height:calc(100vh - 80px); display:flex; flex-direction:column; }
.modal-fit .modal-head{ position:static; flex-shrink:0; }
.modal-fit .modal-body{ max-height:none; overflow:hidden; flex:1 1 auto; min-height:0; display:flex; flex-direction:column; }
.modal-fit .modal-body > *{ flex-shrink:0; }
.modal-fit .fit-area{ flex:1 1 auto; min-height:0; display:flex; flex-direction:column; }
.modal-fit .fit-area .table-wrap{ flex:1 1 auto; min-height:140px; }
.modal-fit .modal-foot{ position:static; flex-shrink:0; }

/* 表单 */
.form-grid { display:grid; grid-template-columns: repeat(4, 1fr); gap: 14px 18px; }
.f-item { display:flex; flex-direction:column; gap:5px; }
.f-item.full { grid-column: 1 / -1; }
.f-item label { font-size:12px; color:var(--ink-2); font-weight:600; }
.f-item label .req{ color:var(--st-bad); }
.field-note{ font-size:11px; color:var(--ink-3); margin-top:3px;}

/* ---------------- 物料分类账 ---------------- */
.ledger-layout { display:grid; grid-template-columns: 300px 1fr; gap:16px; }
/* 货位模板：双栏各占屏幕剩余高度；右栏只让"货位卡"区域滚动，页签/标题/打印工具条/左侧清单固定不动 */
.page > .ledger-layout.hw-layout{ grid-template-rows:minmax(0,1fr); }
.hw-preview-wrap{ flex:1; min-height:0; overflow-y:auto; }
/* 左侧清单：flex 列布局，高度由双栏容器撑满，翻页按钮固定在底部，不随行高变动 */
.left-list-body{ display:flex; flex-direction:column; min-height:0; box-sizing:border-box; flex:1; }
.left-list-items{ flex:1; min-height:0; overflow-y:auto; }
/* 物料清单筛选条：使用项目 / 用途 两个下拉 */
.ld-filters{ display:flex; gap:8px; padding:10px 12px 0; flex-wrap:wrap; }
.ld-filters select{ flex:1; min-width:110px; padding:4px 6px; font-size:12px; font-family:var(--font); color:var(--ink); border:1px solid var(--line); border-radius:6px; background:#fff; outline:none; }
.ld-filters select:focus{ border-color:var(--brand); }
.ld-filters input{ flex:1; min-width:110px; padding:4px 6px; font-size:12px; font-family:var(--font); color:var(--ink); border:1px solid var(--line); border-radius:6px; background:#fff; outline:none; }
.ld-filters input:focus{ border-color:var(--brand); }
.material-list { border-right:1px solid var(--line); }
/* 流水明细抬头信息条：品名/物料编码/批号/报告单号，固定宽度靠左排列 */
.ld-info{ display:flex; flex-wrap:nowrap; align-items:center; justify-content:flex-end; gap:0 20px; padding:10px 18px; font-size:12.5px; color:var(--ink-2); background:#fafbfc; border-bottom:1px solid var(--line); }
.ld-info span{ text-align:left; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ld-info .ld-name{ flex:0 1 auto; min-width:0; margin-right:auto; }
.ld-info .ld-code{ flex:0 1 auto; min-width:0; position:relative; left:-400px; }
.ld-info .ld-batch{ flex:0 1 auto; min-width:0; position:relative; left:-200px; }
.ld-info .ld-no{ flex:0 1 auto; min-width:0; }
.ld-info b{ color:var(--ink); font-weight:600; }
.material-item {
  padding:5px 10px; border-radius:8px; cursor:pointer; margin-bottom:4px;
  border:1px solid transparent; transition: all .12s;
}
.material-item:hover{ background:var(--brand-soft2); }
.material-item.active{ background:var(--brand-soft); border-color:var(--brand); }
.material-item .mn{ font-weight:400; font-size:12px; display:flex; justify-content:space-between; align-items:center; gap:6px;}
/* 品名单行显示：超出宽度省略号截断（完整名称由 title 气泡提示） */
.material-item .mn span:first-child{ flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.material-item .mn .bal{ flex-shrink:0; }
/* 第二行文字改为黑色（原 var(--ink-3) 灰字），批号/入库量/单位统一 */
.material-item .mk{ font-size:11px; color:#000; margin-top:1px; display:flex; justify-content:space-between;}
/* 第二行：批号 .mb、入库量 .mi（成品分类账）、单位 .mu——批号过长省略，入库量居中收缩，单位不被挤压 */
.material-item .mk .mb,
.material-item .mk .mi{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.material-item .mk .mi{ flex:1 1 auto; min-width:0; text-align:center; padding:0 6px; }
.material-item .mk .mu{ flex:0 0 auto; }
.material-item .mr{ font-size:11px; color:var(--ink-4); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bal { font-weight:800; }
.bal.ok{color:var(--st-ok)} .bal.bad{color:var(--st-bad)} .bal.zero{color:var(--ink-3)}

/* ---------------- 检验报告 ---------------- */
.report-sheet {
  font-size: 10.5pt; color: #000; font-family: SimSun, "宋体", serif;
  border:1px solid var(--line); border-radius: 12px;
  background: #fff; overflow:hidden;
  width: 210mm; max-width: 100%; margin: 0 auto;   /* A4 竖向纸 */
  /* flex 纵向布局 + 最小高度撑满 A4 页（297mm - 上下边距 20mm），供底部签字区推至纸底 */
  display: flex; flex-direction: column; min-height: 277mm;
}
/* 查看报告浮窗：全屏遮罩 + 居中 A4 纸（无标题栏、无边框，与打印同款纸面），右上角悬浮关闭图标；
   纸面按视口尺寸 zoom 缩放，整页免滚动查看 */
.rs-view-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center;
  overflow: auto; padding: 20px;
  opacity: 0; transition: opacity .16s ease; z-index: 95;
}
.rs-view-mask.open { opacity: 1; }
/* 纸面固定 A4 宽度（按视口宽度缩放），高度超出视口时在遮罩内滚动查看；margin:auto 兼顾小内容垂直居中 */
.rs-view-box { position: relative; margin: auto; }
.rs-view-x {
  position: absolute; top: -14px; right: -14px; width: 32px; height: 32px; border-radius: 50%;
  background: #fff; color: #334155; font-size: 14px; line-height: 31px; text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.28); cursor: pointer; user-select: none; z-index: 2;
}
.rs-view-x:hover { background: #f1f5f9; color: #000; }
.rs-view-paper { background: #fff; box-shadow: 0 16px 60px rgba(0,0,0,.4); }
/* 除标题外全部不加粗（正式单据正文常规字重），标题保持加粗；结论行加粗 */
.report-sheet * { font-weight: normal !important; }
.report-sheet .rs-title { font-weight: 800 !important; }
.report-sheet .rs-concl { font-weight: bold !important; }
.report-sheet .rs-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 24px 0; font-size: 10.5pt; color: #000; letter-spacing: 1px;
}
.report-sheet .rs-logo { height: 42px; width: auto; }
/* 成品报告（cp）标题上方公司名称行：印出该批成品对应的生产厂家（读取检验台账 producer，为空留空待手写）；
   字号与标题同尺寸联调（下方 qcr-pdf-draw / @media print 中与 rs-title 一起放大） */
.report-sheet .rs-company {
  text-align: center; letter-spacing: 2px; color: #000; padding: 2px 24px 0;
}
/* 页眉联系信息（地址/邮编、电话/传真两行，仅药品成品报告，位于标题上方）：只占纸张左半幅——
   两行构成「1fr + auto」网格：右列（邮编/传真）宽度取两行中较宽者（传真）并左对齐，
   使邮编与传真左边缘对齐；该列右边缘正好落在纸张中线（最右位置＝纸张居中位置），右半幅留空；
   左侧内缩 24px 与页眉/标题对齐（打印/PDF 时归零，见 qcr-pdf-draw / @media print 覆盖规则） */
.report-sheet .rs-contact {
  width: 50%; box-sizing: border-box; padding: 3px 0 0 24px;
  display: grid; grid-template-columns: 1fr auto;
  font-size: 9pt; line-height: 1.45; color: #000;
}
.report-sheet .rs-contact > span { white-space: nowrap; }
.report-sheet .rs-title {
  text-align: center; font-size: 10.5pt; letter-spacing: 4px;
  color: #000; padding: 8px 24px 2px;
}
.report-sheet .rs-file { text-align: right; padding: 0 24px; font-size: 10.5pt; color: #000; }
.report-sheet .rs-no { text-align: left; padding: 2px 24px 10px; font-size: 10.5pt; color: #000; }
/* 四列信息区：第一/三列标题，第二/四列内容（共 6 行，完整黑色表格线）。table+border-collapse：打印光栅化下相邻边框合并为一条线，保证边框粗细一致、不断线。margin/width 左右各内缩 0.5px（24.5px / -49px）：collapse 表格的周边框骑跨盒子边缘绘制（半粗在内半粗在外），比下方 div 区块的边框线向左/右突出 0.5px，打印时可见左边线超出；内缩半个线宽后表格竖线与下方区块边框完全重合 */
.report-sheet table.rs-info {
  width: calc(100% - 49px); border-collapse: collapse;
  margin: 0 24.5px; table-layout: fixed; box-sizing: border-box;
}
.report-sheet .rs-info td { border: 1px solid #000; padding: 4px 10px; font-size: 10.5pt; color: var(--ink); word-break: break-all; text-align: center; }
.report-sheet .rs-info td.lb { background: transparent; color: var(--ink); text-align: center; white-space: nowrap; }
/* 中间体报告（zjt）：第二三四行（批号/数量/报告单号）——上下横线与中间竖线不画，仅保留左右最外框竖线 */
.report-sheet .rs-info tr.zjt-noline td { border: none; }
.report-sheet .rs-info tr.zjt-noline td:first-child { border-left: 1px solid #000; }
.report-sheet .rs-info tr.zjt-noline td:last-child { border-right: 1px solid #000; }
.report-sheet .rs-info tr.zjt-noline td.lb { text-align: left; padding-left: 24px; }
/* 中间体报告：表头独立三列（检验项目/标准规定/检验结果），列宽与下方明细一致，文字居中；
   检验项目列 16.6%+30px（约 147px@703px 版面） */
.report-sheet .rs-tblhead.rs-zjt-head { grid-template-columns: calc(16.6% + 30px) calc(41.7% - 15px) calc(41.7% - 15px); }
/* 药品物料/包材报告（rs-dwb 系）：检验项目列再加宽 20px（10px → 30px） */
.report-sheet .rs-tblhead.rs-dwb-head { grid-template-columns: calc(16.6% + 30px) calc(41.7% - 15px) calc(41.7% - 15px); }
.report-sheet .rs-tblrow.rs-dwb { grid-template-columns: calc(16.6% + 30px) calc(41.7% - 15px) calc(41.7% - 15px); }
.report-sheet .rs-vlines.rs-dwb-vl { grid-template-columns: calc(16.6% + 30px) calc(41.7% - 15px) calc(41.7% - 15px); }
/* 中间体报告：内容列靠左显示 */
.report-sheet .rs-info td.zjt-val { text-align: left; padding-left: 12px; }
/* 中间体报告：首行（检品名称）与检验依据行——标签与合并内容格之间的竖线不画（两侧单元格边框都取消） */
.report-sheet .rs-info.rs-zjt tr:first-child td:first-child { border-right: none; }
.report-sheet .rs-info.rs-zjt tr:first-child td + td { border-left: none; }
.report-sheet .rs-info.rs-zjt tr.zjt-basis td:first-child { border-right: none; }
.report-sheet .rs-info.rs-zjt tr.zjt-basis td + td { border-left: none; }
/* 中间体报告信息表：与下方表头区块同宽同边距（恢复一个整体表格观感，中间无间隔、边线共线） */
/* 中间体报告：明细三列（无判定列），判定列宽度分给 标准规定/检验结果；检验项目列加宽 10px */
.report-sheet .rs-tblhead.rs-zjt-head {
  grid-template-columns: calc(16.6% + 10px) 41.7% 41.7%;
  /* 上提 1px 与信息表底边重叠：左右边框线与信息表边框交叠，任何渲染精度下都连续接上 */
  margin-top: -1px;
  position: relative;
}
.report-sheet .rs-tblrow.rs-zjt-row { grid-template-columns: calc(16.6% + 30px) calc(41.7% - 15px) calc(41.7% - 15px); }
.report-sheet .rs-vlines.rs-zjt-vl { grid-template-columns: calc(16.6% + 30px) calc(41.7% - 15px) calc(41.7% - 15px); }
/* 药品物料/包材报告（rs-dwb 系）：检验项目列再加宽 20px（10px → 30px），仅药品 wl/bc 报告生效 */
.report-sheet .rs-tblhead.rs-dwb-head { grid-template-columns: calc(16.6% + 30px) calc(41.7% - 15px) calc(41.7% - 15px); margin-top: -1px; position: relative; }
.report-sheet .rs-tblrow.rs-dwb { grid-template-columns: calc(16.6% + 30px) calc(41.7% - 15px) calc(41.7% - 15px); }
.report-sheet .rs-vlines.rs-dwb-vl { grid-template-columns: calc(16.6% + 30px) calc(41.7% - 15px) calc(41.7% - 15px); }
/* 饮用水报告（rs-sz，套用药品物料版式）：明细"检验结果"列宽 -20px、再 -50px（合计 -70px），全部加到"检验项目"列
   （即在 rs-zjt / rs-dwb 基础上再调；必须放在本文件内最后一组 rs-zjt / rs-dwb 规则之后——同样特异性，靠后者生效） */
.report-sheet.rs-sz .rs-tblhead,
.report-sheet.rs-sz .rs-tblrow,
.report-sheet.rs-sz .rs-tblrows .rs-vlines { grid-template-columns: calc(16.6% + 100px) calc(41.7% - 15px) calc(41.7% - 85px); }
/* 饮用水报告：竖线只画在有内容的区域——表头与各内容行的单元格右边框提供列间竖线（行内边框，
   末行收尾线之下的空白区没有行，故自然无线）；覆盖层 .rs-vlines 保持无线，不再铺满拉伸区到底 */
.report-sheet.rs-sz .rs-tblhead .c { border-right: 1px solid #000; }
.report-sheet.rs-sz .rs-tblhead .c:last-child { border-right: none; }
.report-sheet.rs-sz .rs-tblrow .c { border-right: 1px solid #000; }
.report-sheet.rs-sz .rs-tblrow .c:last-child { border-right: none; }
.report-sheet.rs-sz .rs-vlines span { border-right: none; }
/* 竖线填满行高：sz 内容行去掉上下 padding（转移到单元格内，行距不变），单元格竖直撑满，
   竖线（单元格右边框）贴合行顶/底——不再出现"行高80、竖线只60、上下空10" */
.report-sheet.rs-sz .rs-tblrow { align-items: stretch; padding: 0; }
.report-sheet.rs-sz .rs-tblhead .c,
.report-sheet.rs-sz .rs-tblrow .c { align-self: stretch; }
/* 内容行高：单元格上下内边距 6px（原 12px）——明细行的行高由它主导，单行内容（10.5pt/行距1.5
   ≈21px）在 12px 时整行约 47px，其中上下留白 24px 占了一半以上，比底部 4 行格子（约 31px）明显偏高。
   收到 6px 后单行整行约 35px，与页脚格子接近、表格更紧凑；行高仍由单元格内边距撑出，
   单元格 align-self:stretch 撑满整行，列间竖线（单元格右边框）依旧贴合行顶/底不断口。
   查看 / 打印 / 导出 PDF 三端同源（打印与 PDF 均直接沿用本规则） */
.report-sheet.rs-sz .rs-tblrow .c { padding-top: 6px; padding-bottom: 6px; }
.report-sheet.rs-sz .rs-tblrow .c:nth-child(2),
.report-sheet.rs-sz .rs-tblrow .c:nth-child(3) { padding-top: 6px; padding-bottom: 6px; }
/* —— 明细行行高与竖线加固（打印排版问题专用）——
   症状：明细行比内容高出一大截（文字顶在行首、行内下方一大片空白），列间竖线在每个行边界处
   断成一小截（竖线只覆盖内容高度、没到行底）。
   成因是"行的上下内边距被重新加上 + 单元格没被撑满行高"：通用规则 .report-sheet .rs-tblrow 的
   padding:12px 0、以及脚本按离屏容器量测给每行打上的等高内联 height，都可能把行撑高；
   行一旦比单元格高，单元格的右边框（= 列间竖线）就只画到内容底部——于是行边界处出现断口。
   这里把行固定为"内边距归零、行高只由内容决定"，并强制单元格撑满整行：行高与竖线始终一致。
   用 !important 是为了盖掉内联样式（脚本设的 height）与后续可能出现的同名声明 */
.report-sheet.rs-sz .rs-tblrow{
  padding: 0 !important; align-items: stretch !important;
  height: auto !important; min-height: 0 !important;
}
.report-sheet.rs-sz .rs-tblrow > .c{
  align-self: stretch !important;
  padding-top: 6px !important; padding-bottom: 6px !important;
}
/* 明细行只保留 3 列（检验项目 / 标准规定 / 检验结果）：网格只有 3 列，行里若多出第 4 个单元格
   （判定列），它会掉到第二行网格——整行被撑成两行高、文字顶在行首、竖线只覆盖第一行。
   多余的单元格直接隐藏（3 列版式本就不显示"判定"列） */
.report-sheet.rs-sz .rs-tblrow > .c:nth-child(n+4),
.report-sheet.rs-sz .rs-tblhead > .c:nth-child(n+4) { display: none; }
/* 横线改画在单元格边框上（行容器不再有垂直边框）：行盒 == grid 轨道 == stretch 单元格高度，
   竖线（单元格右边框）与横线（第2行起各行单元格上边框 / 末行单元格下边框）位于同一边框盒，
   在四角必然完整相交，不再出现"行高80、竖线只60"或竖线两端留断口；
   末行下边框即收尾横线，其下空白区天然无线（下方没有行的单元格） */
.report-sheet.rs-sz .rs-tblrows .rs-tblrow + .rs-tblrow .c { border-top: 1px solid #000; }
/* 饮用水报告（rs-sz）：内容区保留左右表格线（明细区仍拉伸铺满，左右边框与其覆盖层竖线贯通到底），
   但末行内容下方新增一条收尾横线（末行单元格下边框），该线之下的空白区只留左右线、不再画任何横线/底线；
   备注行上表格线恢复（foot 顶边框） */
.report-sheet.rs-sz .rs-tblrows { border-bottom: none; }
.report-sheet.rs-sz .rs-tblrow:nth-last-of-type(2) .c { border-bottom: 1px solid #000; }
/* 明细行贴合内容、矮之行高：中间区不再由内容行 flex:1 占满，明细行按内容高度排列（flex:0 0 auto）
   并靠上对齐，中间区其余空间自然留白（下方留空）；竖线仍由单元格右边框贯穿各行、横线由相邻行
   单元格上边框承担，末行下边框即收尾横线，其下留空区只存左右线、无线 */
.report-sheet.rs-sz .rs-tblrows { display: flex; flex-direction: column; justify-content: flex-start; }
.report-sheet.rs-sz .rs-tblrow { flex: 0 0 auto; }
/* 表头底边框同移入单元格：表头容器仅留左右框线，底部分隔线由各单元格下边框承担，
   表头单元格竖线（右边框）与底部分隔线同框完整相交，无断口 */
.report-sheet.rs-sz .rs-tblhead { border-bottom: none; }
.report-sheet.rs-sz .rs-tblhead .c { border-bottom: 1px solid #000; }
.report-sheet.rs-sz .rs-foot { border-top: 1px solid #000; }
/* 纯化水（rs-chs）：矩阵表末行 td 的底边框即"备注行上方那条线"（单条 1px）。
   rs-sz 的 foot 顶边框会与它叠加成双线、看起来偏粗——故此处强制保持 none；
   放在 .rs-sz 规则之后（特异性相同，靠后者生效） */
.report-sheet.rs-chs .rs-foot { border-top: none !important; }
/* 药品成品报告（rs-dcp 系，物料版式三列）：标准规定列 +4%、检验结果列 -4%（检验项目列不变）；
   表头/明细/竖线覆盖层同模板，列边界严格对齐；仅药品成品报告生效，不影响药品中间体/物料/包材报告。
   注：须放在上面 rs-zjt / rs-dwb 规则之后（同样特异性，靠后者生效） */
.report-sheet .rs-tblhead.rs-dcp-head { grid-template-columns: calc(16.6% + 30px) calc(45.7% - 15px) calc(37.7% - 15px); }
.report-sheet .rs-tblrow.rs-dcp { grid-template-columns: calc(16.6% + 30px) calc(45.7% - 15px) calc(37.7% - 15px); }
.report-sheet .rs-vlines.rs-dcp-vl { grid-template-columns: calc(16.6% + 30px) calc(45.7% - 15px) calc(37.7% - 15px); }
/* 中间检验区四列表头：检验项目/标准规定/检验结果/判定。列宽：检验项目123px（与上方检品名称列等宽）、判定80px，中间两列平分剩余。
   两种版式按报告类别区分（成品报告根节点带 rs-cp 类，见 qcreport.js buildReportSheet）：
   非成品（原料/包材/中间体/水质/洁净度，默认）保持旧版——表头与上方信息表连成一体：取消上框线（由信息表底边线充当表头顶线）、
   上边距 0、列间不画竖线；成品（rs-cp）为新版独立表格——保留完整上框线闭合表头，上边距 2mm 形成两表之间的窄间距，列间画竖线（见下方 .rs-cp 覆盖规则）；
   下框线两种版式均保留，作为表头与明细区分界线 */
.report-sheet .rs-tblhead {
  display: grid; grid-template-columns: 16.6% 36.9% 36.9% 9.6%;
  border: 1px solid #000; border-top: none; margin: -1px 24.5px 0;
  width: calc(100% - 49px); box-sizing: border-box; position: relative;
}
.report-sheet .rs-tblhead .c { padding: 8px 4px; font-size: 10.5pt; text-align: center; }
/* 成品报告（rs-cp）表头：与信息表断开（上边距 2mm）+ 完整上框线闭合 + 列间竖线（单元格 grid 默认纵向拉伸，竖线撑满表头行高；末列靠外框线不加） */
.report-sheet.rs-cp .rs-tblhead { border-top: 1px solid #000; margin-top: 2mm; }
.report-sheet.rs-cp .rs-tblhead .c { border-right: 1px solid #000; }
.report-sheet.rs-cp .rs-tblhead .c:last-child { border-right: none; }
/* 中间检验区明细：从台账读取的检验项目行（无明细时为空白大框），flex:1 占满表头与底部签名行之间剩余空间；左右边框与表头/信息表对齐，上边框由表头下边框承担，下边框闭合检验表格。
   列间竖线由真实覆盖层元素 .rs-vlines 统一绘制（不用 ::before/背景渐变：PDF 导出 exportRectPdf 按真实元素的
   computedStyle 画线，伪元素与背景图不会被绘制）：四列网格与明细行同列宽，3 个空 span 的右边框即列分隔线，
   覆盖层绝对定位铺满明细框全高——明细行不足框高时底部空白区同样有竖线（标准表单空行样式，与打印/PDF 三端一致）；
   pointer-events:none 不影响文字选择/交互；与行内网格百分比同源（内容盒等宽），竖线与表头/明细列边界精确对齐 */
.report-sheet .rs-tblrows { position: relative; flex: 1; min-height: 140px; margin: 0 24.5px 0; width: calc(100% - 49px); box-sizing: border-box; border: 1px solid #000; border-top: none; overflow: hidden; }
/* 中间体/提取物/饮片/药品物料包材报告（rs-zjtsheet）屏幕查看：明细区不裁剪——
   内容超出时行高自动撑开、纸面自然变长滚动查看（与打印/PDF 多页口径一致） */
.report-sheet.rs-zjtsheet .rs-tblrows { overflow: visible; }
.report-sheet .rs-tblrows .rs-vlines {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  display: grid; grid-template-columns: 16.6% 36.9% 36.9% 9.6%;
  pointer-events: none;
}
/* 列竖线仅成品报告（rs-cp）绘制；非成品报告（原料/包材等）检验内容内不画表格线（旧版格式），空覆盖层无边框不显示 */
.report-sheet.rs-cp .rs-vlines span { border-right: 1px solid #000; }
/* 中间体报告：类别不一致时的独立类别行（左对齐）与随后的检验项目行（缩进） */
.report-sheet .rs-tblrow .c.zjt-cat { text-align: left; padding-left: 10px; font-weight: 600; }
.report-sheet .rs-tblrow .c.zjt-sub { text-align: left; padding-left: 18px; }
/* 明细行：四列网格与表头列宽一致（检验项目123px、判定80px，中间两列平分）；左右内边距归零+单元格 4px，与表头单元格内边距一致实现列对齐；align-items:center 使短内容（项目名/判定）随最高列撑起的行高垂直居中；上下 padding 12px 保持行距。
   行间横线（下框线）仅成品报告（rs-cp）绘制；非成品报告明细行不画表格线（旧版格式） */
.report-sheet .rs-tblrow { display: grid; grid-template-columns: 16.6% 36.9% 36.9% 9.6%; align-items: center; padding: 12px 0; font-size: 10.5pt; line-height: 1.6; }
/* 成品报告明细行：行间横线（下边框）——末行下边线由明细区容器边框承担（行 border 与容器
   border 叠在同一位置会变成 2px，比其他线粗一倍）；明细区最后一个子元素是竖线覆盖层
   （.rs-vlines），末行实际是倒数第二个子 div，用 nth-last-of-type(2) 定位；
   行边距/行距由 --cp-pad/--cp-lh 变量控制（无标签报告超高时 pinCpBottom 逐级收紧压缩到一页） */
.report-sheet.rs-cp .rs-tblrow { border-bottom: 1px solid #000; padding: var(--cp-pad, 8px) 0; line-height: var(--cp-lh, 1.6); }
.report-sheet.rs-cp .rs-tblrow:nth-last-of-type(2) { border-bottom: none; }
.report-sheet .rs-tblrow .c { text-align: center; padding: 0 4px; word-break: break-all; line-height: 1.5; }
/* 成品报告不锁定一页：明细区超出一页高度时不再裁剪，内容自然延伸（打印/PDF 同步多页） */
.report-sheet.rs-cp .rs-tblrows { overflow: visible; }
/* 成品报告分页版式（有"标签"检验项目时）：明细区改 flex 纵向布局，行 flex 均摊剩余高度——
   第一页（rs-pg1，非标签项目）拉伸占满整页、行高自动调整；第二页（rs-pg2，标签项目+结论+签名），
   屏幕上以虚线分页线区隔，打印/PDF 由下方媒体规则强制从新页开始 */
.report-sheet.rs-cp .rs-tblrows { display: flex; flex-direction: column; }
.report-sheet.rs-cp .rs-pg1 { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.report-sheet.rs-cp .rs-pg1 .rs-tblrows { flex: 1; }
.report-sheet.rs-cp .rs-tblrow { flex: 1 1 auto; }
.report-sheet.rs-cp .rs-pg2 { display: flex; flex-direction: column; margin-top: 10mm; border-top: 1px dashed #94a3b8; }
/* 成品报告第二页标签区合并版式：整块改 4 列 grid；检验项目列一个格子跨全部行（rs-tagname，内容"标签"），
   标准规定/检验结果/判定按行独立（行间横线由单元格 border-bottom 承担，末行下边线由容器边框承担），
   列间竖线仍由 .rs-vlines 覆盖层绘制 */
.report-sheet.rs-cp .rs-tblrows.rs-tagmerge {
  display: grid; grid-template-columns: 16.6% 36.9% 36.9% 9.6%;
  align-items: stretch;
}
.report-sheet.rs-cp .rs-tagmerge .c {
  display: flex; align-items: center; justify-content: center;
  padding: 2px 4px; box-sizing: border-box;
  word-break: break-all; line-height: 1.5; text-align: center;
}
/* 有标签报告的压缩变量同样作用于标签区单元格与第二页表头（单页折叠/两页压缩共用） */
.report-sheet.rs-cp.rs-cptag .rs-tagmerge .c { padding: var(--cp-pad, 2px) 4px; line-height: var(--cp-lh, 1.5); }
.report-sheet.rs-cp.rs-cptag .rs-tblhead .c { padding: var(--cp-pad, 8px) 4px; line-height: var(--cp-lh, 1.6); }
.report-sheet.rs-cp .rs-tagmerge .rs-tagname { font-size: 10.5pt; }
/* 第二页专用列宽：标签列 30mm、标准规定列 60mm，剩余给检验结果（判定保持原 9.6%）；
   表头/明细/竖线覆盖层三者同模板，保证列边界对齐；不影响第一页列宽 */
.report-sheet.rs-cp .rs-tblhead.rs-head2,
.report-sheet.rs-cp .rs-tblrows.rs-tagmerge,
.report-sheet.rs-cp .rs-tagmerge .rs-vlines { grid-template-columns: 12mm 35mm auto 9.6%; }
/* 成品报告底部区块（结论+签名）：位于纸面最后一个弹性区块之后——前面的明细区/第一页区块（flex:1）
   吸收全部剩余高度，把底部区块顶到纸底；配合 pinCpBottom 把纸面高度补齐整页数，
   无论内容占几页，这两行始终固定在最后一页最底部（不用 margin-top:auto：auto 边距会优先吃掉
   全部剩余空间，导致第一页明细行无法拉伸占满） */
/* 多页模式（rs-multi，由 pinCpBottom 按内容高度自动加/去）：行高保持自然高度——明细行不再拉伸
   吸收剩余空间（否则内容略超一页时多出近一整页空白被行高分摊，行高被撑得极高）；
   剩余空间留白，底部区块 margin-top:auto 贴最后一页底部 */
.report-sheet.rs-cp.rs-multi .rs-tblrows { flex: 0 0 auto; }
.report-sheet.rs-cp.rs-multi .rs-tblrow { flex-grow: 0; }
.report-sheet.rs-cp.rs-multi .rs-pg1 { flex: 0 0 auto; }
.report-sheet.rs-cp.rs-multi .rs-pg1 .rs-tblrows { flex: 0 0 auto; }
.report-sheet.rs-cp.rs-multi .rs-cpfoot { margin-top: auto; padding-bottom: 10mm; }
/* 有标签项目的两页报告（rs-cptag，由 pinCpBottom 检测 rs-pg2 自动加）：第一页明细行——
   行距/边距由 --cp-pad/--cp-lh 变量控制（超高时 pinCpBottom 逐级收紧把非标签项目全部压进第一页） */
.report-sheet.rs-cp.rs-cptag .rs-pg1 .rs-tblrow { padding: var(--cp-pad, 4px) 0; line-height: var(--cp-lh, 1.45); }
/* 页脚页码（仅多页报告，由 pinCpBottom 生成）：整纸绝对定位覆盖层，各页号码按页高落位、底部居中；
   单页报告不生成该节点；多页时底部区块留 7mm 下边距，页码不与签名行重叠 */
.report-sheet.rs-cp { position: relative; }
.report-sheet.rs-cp .rs-pagenos { position: absolute; left: 0; right: 0; top: 0; bottom: 0; pointer-events: none; }
.report-sheet.rs-cp .rs-pagenos span {
  position: absolute; left: 0; width: 100%;
  text-align: center; font-size: 9pt; color: #000; line-height: 16px;
}
.report-sheet .rs-tblrow .c:nth-child(2), .report-sheet .rs-tblrow .c:nth-child(3) {
  display: flex; align-items: center; justify-content: center; align-self: stretch; padding: 0 14px; text-align: center;
}
/* 底部旧版 4 行格子（物料/包材/中间体/水质/洁净度等非成品报告）：备注 / 结论 / 检验人·复核人 / 质量控制部主管·质量保证部经理。
   整体成框并与检验区对齐（左右各内缩 24.5px），上边框取消、与 .rs-tblrows 下边框连成一体；行间横线分隔，
   双列行（检验人/复核人、主管/经理）中间保留竖线；flex 容器内随中区拉伸天然固定于 A4 纸底部 */
/* 纯化水报告（chs）：中间检验明细区为「取样点位分列」的矩阵表——
   表头第一行「检验结果」跨全部取样点位列；第二行 检验项目（跨"判定类别 + 项目名"两列）/标准规定/各点位名称；
   明细行按判定类别（【性状】/【检查】）纵向合并；列宽由页面内 colgroup 百分比给定
   （判定类别 3% / 项目名 10.1% / 标准规定 13.1% / 各点位平分剩余 73.8%）。
   容器 flex:1 占住"信息表底边 ～ 底部 4 行格子顶边"的整段中间区，表头保留自然高、明细行由 JS fitChsMatrix 均分为相同高度
   （查看 / 打印 / 导出 PDF 三端一致）；外框与信息表、底部格子左右对齐（内缩 24.5px），
   上提 1px 且首行不画上框线，与信息表底边共用一条线 */
.report-sheet .rs-matrix-wrap{
  flex: 1 1 auto; min-height: 0; margin: -1px 24.5px 0; width: calc(100% - 49px);
  box-sizing: border-box;
}
/* 表格线用 border-collapse:collapse（与上方信息表 table.rs-info、下方 4 行格子一致）：
   相邻单元格共用一条 1px 线；用 separate 时相邻各自 1px 会并成 2px，看起来明显比上下粗 */
.report-sheet .rs-matrix{
  width: 100%; border-collapse: collapse;
  table-layout: fixed; font-family: SimSun, "宋体", serif;
}
.report-sheet .rs-matrix th, .report-sheet .rs-matrix td{
  border: 1px solid #000; padding: 3px 2px; text-align: center; vertical-align: middle;
  white-space: normal; word-break: break-all; line-height: 1.3; font-weight: normal;
}
.report-sheet .rs-matrix th{ font-weight: 600; }
/* 判定类别格（【检查】）：列宽只留一个字，类别名逐字一格竖排（每字一行、正立）；
   首尾括号旋转 90°（【 变上角括号、】 变下角括号）箍住竖排文字。
   竖排用"逐字一个块级 span"实现，而不用 vertical-rl 书写模式——字形因此走与其它单元格完全相同的
   横排渲染路径，字号/字体与其它内容严格一致（竖排书写模式下部分环境会因字体竖排度量或回退字体
   不同，使同一个字看起来偏小）。该格左右不留内边距，保证窄列里一个字放得下 */
.report-sheet .rs-matrix td.rs-cat{ padding: 3px 0; }
.report-sheet .rs-matrix td.rs-cat > span{ display: block; text-align: center; }
.report-sheet .rs-matrix td.rs-cat > span.rs-cbrk{ transform: rotate(90deg); }
/* 首行不画上框线：由上方信息表的底边充当明细表的顶线（与 rs-tblhead 同一做法） */
.report-sheet .rs-matrix > tbody > tr:first-child > th,
.report-sheet .rs-matrix > tbody > tr:first-child > td{ border-top: none; }
.report-sheet .rs-foot { margin: 0 24.5px; width: calc(100% - 49px); box-sizing: border-box; border: 1px solid #000; border-top: none; font-size: 10.5pt; }
.report-sheet .rf-row { display: flex; align-items: stretch; border-top: 1px solid #000; min-height: 30px; }
.report-sheet .rf-row:first-child { border-top: none; }
.report-sheet .rf-row span { flex: 1; min-width: 0; padding: 5px 10px; line-height: 1.5; text-align: left; word-break: break-all; }
.report-sheet .rf-row span + span { border-left: 1px solid #000; }
/* 底部结论行（仅成品报告 cp）：位于签名标签行上方，"经检验，该批产品符合“检验依据”标准要求，合格/不合格"；
   与信息表/检验区左右对齐，下边框即与签名行之间的表格分隔线 */
.report-sheet .rs-concl { margin: 0 24.5px; width: calc(100% - 49px); box-sizing: border-box; font-size: 10.5pt; text-align: left; padding: 6px 10px 8px; border-bottom: 1px solid #000; }
/* 底部签名标签行（仅成品报告 cp）：原 4 行格子（备注/结论/检验人复核人/主管经理）不用于成品，成品改为一排签名标签
   （检验人/复核人/质检科主管/质量部经理）；无边框不占格线，四列等宽排布（标签后留白供手写签名），flex 容器内随中区拉伸固定于 A4 纸底部 */
.report-sheet .rs-sign { margin: 6px 24.5px 0; width: calc(100% - 49px); box-sizing: border-box; display: flex; align-items: flex-end; font-size: 10.5pt; }
/* 签名标签：四列等宽，标签左对齐，标签右侧空白即手写签名区；text-align:left 保证 PDF/打印文字左对齐 */
.report-sheet .rs-sign span { flex: 1; min-width: 0; white-space: nowrap; text-align: left; }
/* 食品中间体报告"一张 A4 打两份"（rs-2up，见 qcreport.js buildReportSheet/pin2Up）：
   纸面高度由 pin2Up 固定为一页，两个 .rs-copy 各占半页（flex:1 均分，沿中线裁切）；
   每份内部：明细区不再拉伸占满（flex:0 0 auto），底部结论/签名区紧随检验表格（不贴纸底）；
   行边距/行距/内边距/字号由 --cp-pad/--cp-lh/--cp-ipad/--cp-hpad/--cp-bpad/--cp-fs 变量控制，
   内容超高时 pin2Up 逐级收紧，把两份都压进各自半页 */
.report-sheet.rs-2up { display: flex; flex-direction: column; }
.report-sheet.rs-2up .rs-copy {
  position: relative;               /* 作为 offsetParent：pin2Up 按份内 offsetTop 量内容高 */
  display: flex; flex-direction: column;
  flex: 1 1 0; min-height: 0; box-sizing: border-box;
}
.report-sheet.rs-2up .rs-tblrows { flex: 0 0 auto; min-height: 0; }
.report-sheet.rs-2up .rs-pg1 { flex: 0 0 auto; }
.report-sheet.rs-2up .rs-pg1 .rs-tblrows { flex: 0 0 auto; }
.report-sheet.rs-2up .rs-tblrow { flex-grow: 0; }
.report-sheet.rs-2up .rs-cpfoot { margin-top: 0; padding-bottom: 0; }
.report-sheet.rs-2up .rs-brand { padding-top: var(--cp-bpad, 8px); }
.report-sheet.rs-2up .rs-title { padding-top: var(--cp-bpad, 8px); }
.report-sheet.rs-2up table.rs-info td { padding: var(--cp-ipad, 4px) 10px; font-size: var(--cp-fs, 10.5pt); }
.report-sheet.rs-2up .rs-tblhead .c { padding: var(--cp-hpad, 8px) 4px; font-size: var(--cp-fs, 10.5pt); }
.report-sheet.rs-2up .rs-tblrow,
.report-sheet.rs-2up .rs-tblrow .c { font-size: var(--cp-fs, 10.5pt); }
.report-sheet.rs-2up .rs-concl,
.report-sheet.rs-2up .rs-sign { font-size: var(--cp-fs, 10.5pt); }
.report-sheet.rs-2up .rs-sign { margin-top: var(--cp-bpad, 6px); }

/* ---------------- 首页 ---------------- */
.hero {
  background: linear-gradient(120deg, #0e7c66, #12a588); color:#fff;
  border-radius:14px; padding: 24px 26px; margin-bottom:18px;
  box-shadow: var(--shadow-lg);
}
.hero .ht{ font-size:22px; font-weight:800; }
.hero .hs{ font-size:13px; opacity:.9; margin-top:6px; }
.module-grid { display:grid; grid-template-columns: repeat(auto-fit,minmax(250px,1fr)); gap:16px; }
.module-card { background:#fff; border:1px solid var(--line); border-radius:14px; padding:20px; cursor:pointer; box-shadow:var(--shadow); transition: all .15s; }
.module-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color:var(--brand); }
.module-card .mi{ width:44px;height:44px;border-radius:11px; display:flex;align-items:center;justify-content:center;font-size:21px; margin-bottom:12px; }
.module-card .mt{ font-size:16px; font-weight:800; }
.module-card .md{ font-size:12.5px; color:var(--ink-2); margin-top:6px; height: 44px;}

/* 空状态 */
.empty { text-align:center; color:var(--ink-3); padding:40px 10px; font-size:13px; }

/* 滚动条 */
::-webkit-scrollbar { width:10px; height:10px; }
::-webkit-scrollbar-thumb { background:#cdd4da; border-radius:6px; }
::-webkit-scrollbar-track{ background:transparent; }

/* 响应式 */
@media (max-width: 980px){
  .sidebar{ position:fixed; left:-150px; transition:left .2s; z-index:50; }
  .sidebar.open{ left:0; }
  .form-grid{ grid-template-columns: repeat(2,1fr); }
  .rs-meta{ grid-template-columns: repeat(2,1fr); }
  /* 窄屏堆叠：左清单限高滚动，右表格占剩余高度（选择器特异性需 ≥ 桌面规则 .page > .ledger-layout） */
  .page > .ledger-layout{ grid-template-columns:1fr; grid-template-rows: minmax(0, 38vh) minmax(0, 1fr); }
  /* 窄屏单列：供货单位表整体滚动，各分组自然高度完整展示（覆盖桌面均分行规则） */
  .page > .card:last-of-type > .unit-grid { grid-auto-rows: auto; overflow-y: auto; }
  .page > .card:last-of-type > .unit-grid > .unit-block { display: block; overflow: visible; }
  .ham{ display:inline-flex !important; }
}
.ham{ display:none; }

/* 检验报告导出 PDF：必须在屏幕下生效（勿放进 @media print），离屏 186mm 套打印排版 */
.qcr-pdf-draw{
  position:fixed; left:-10000px; top:0; width:186mm; min-height:273mm; background:#fff; z-index:-1;
}
.qcr-pdf-draw .report-sheet{
  width:100%; max-width:none; height:273mm; min-height:273mm;
  overflow:hidden; padding:0; margin:0; border:none; border-radius:0;
  font-size:10.5pt; font-family:SimSun,"宋体",serif; display:flex; flex-direction:column;
  box-sizing:border-box;
}
.qcr-pdf-draw .report-sheet .rs-brand{ padding:8px 0 0; font-size:10.5pt; }
.qcr-pdf-draw .report-sheet .rs-company{ padding-left:0; padding-right:0; font-size:16pt; }
.qcr-pdf-draw .report-sheet .rs-contact{ padding-left:0; padding-right:0; font-size:9pt; }
.qcr-pdf-draw .report-sheet .rs-title{ padding-left:0; padding-right:0; font-size:16pt; }
.qcr-pdf-draw .report-sheet .rs-file,
.qcr-pdf-draw .report-sheet .rs-no{ padding-left:0; padding-right:0; font-size:10.5pt; }
.qcr-pdf-draw .report-sheet table.rs-info{ width:100%; margin:0; font-size:10.5pt; }
.qcr-pdf-draw .report-sheet .rs-tblhead,
.qcr-pdf-draw .report-sheet .rs-tblrow{ grid-template-columns:16.6% 36.9% 36.9% 9.6%; font-size:10.5pt; }
/* 中间体报告 PDF：三列明细（无判定），列宽同屏幕；表头上提 1px 与信息表底边重叠，边框线连续 */
.qcr-pdf-draw .report-sheet .rs-tblhead.rs-zjt-head,
.qcr-pdf-draw .report-sheet .rs-tblrow.rs-zjt-row,
.qcr-pdf-draw .report-sheet .rs-vlines.rs-zjt-vl{ grid-template-columns:calc(16.6% + 30px) calc(41.7% - 15px) calc(41.7% - 15px); }
/* 药品物料/包材报告 PDF：检验项目列 +20px（30px 偏移） */
.qcr-pdf-draw .report-sheet .rs-tblhead.rs-dwb-head,
.qcr-pdf-draw .report-sheet .rs-tblrow.rs-dwb,
.qcr-pdf-draw .report-sheet .rs-vlines.rs-dwb-vl{ grid-template-columns:calc(16.6% + 30px) calc(41.7% - 15px) calc(41.7% - 15px); }
/* 饮用水报告（rs-sz）PDF：明细"检验结果"列 -20px 再 -50px 加到"检验项目"列（须放在上面 rs-zjt / rs-dwb 规则之后） */
.qcr-pdf-draw .report-sheet.rs-sz .rs-tblhead,
.qcr-pdf-draw .report-sheet.rs-sz .rs-tblrow,
.qcr-pdf-draw .report-sheet.rs-sz .rs-tblrows .rs-vlines{ grid-template-columns:calc(16.6% + 100px) calc(41.7% - 15px) calc(41.7% - 85px); }
.qcr-pdf-draw .report-sheet .rs-tblhead.rs-zjt-head{ margin-top:-1px; position:relative; }
/* 药品成品报告 PDF：标准规定列 +4%、检验结果列 -4%（与屏幕/打印同模板） */
.qcr-pdf-draw .report-sheet .rs-tblhead.rs-dcp-head,
.qcr-pdf-draw .report-sheet .rs-tblrow.rs-dcp,
.qcr-pdf-draw .report-sheet .rs-vlines.rs-dcp-vl{ grid-template-columns:calc(16.6% + 30px) calc(45.7% - 15px) calc(37.7% - 15px); }
.qcr-pdf-draw .report-sheet .rs-tblhead,
.qcr-pdf-draw .report-sheet .rs-tblrows,
.qcr-pdf-draw .report-sheet .rs-matrix-wrap,
.qcr-pdf-draw .report-sheet .rs-foot,
.qcr-pdf-draw .report-sheet .rs-concl,
.qcr-pdf-draw .report-sheet .rs-sign{
  width:100%; max-width:none; box-sizing:border-box; margin-left:0; margin-right:0;
}
.qcr-pdf-draw .report-sheet.rs-cp .rs-tblhead{ margin-top:2mm; margin-bottom:0; }
/* 非成品报告（物料/包材/中间体等）PDF：表头上提 1px 与信息表底边重叠（成品 2mm 间距除外） */
.qcr-pdf-draw .report-sheet .rs-tblhead{ margin-top:-1px; position:relative; }
.qcr-pdf-draw .report-sheet.rs-cp .rs-tblhead{ margin-top:2mm; }
/* 成品报告 PDF：纸面高度自适应（超高内容多页导出），明细行单元格画列竖线（覆盖层单页高度不够） */
.qcr-pdf-draw .report-sheet.rs-cp{ height:auto; min-height:273mm; }
.qcr-pdf-draw .report-sheet.rs-cp .rs-tblrows{ overflow:visible; }
.qcr-pdf-draw .report-sheet.rs-cp .rs-tblrow .c{ border-right:1px solid #000; }
.qcr-pdf-draw .report-sheet.rs-cp .rs-tblrow .c:last-child{ border-right:none; }
/* 中间体/提取物/饮片/药品物料包材报告（rs-zjtsheet）PDF：同成品——纸面高度自适应，
   明细区不裁剪、行高随内容自动撑开、行内画列竖线，多页导出全部内容 */
.qcr-pdf-draw .report-sheet.rs-zjtsheet{ height:auto; min-height:273mm; }
.qcr-pdf-draw .report-sheet.rs-zjtsheet .rs-tblrows{ overflow:visible; }
/* 中间体/提取物/饮片/药品物料包材报告（rs-zjtsheet）PDF：同成品——纸面高度自适应，
   明细区不裁剪、行高随内容自动撑开、多页导出全部内容；
   明细列间竖线不画（仅保留外框，与旧版格式一致） */
.qcr-pdf-draw .report-sheet.rs-zjtsheet .rs-tblrow .c{ border-right:none; }
/* 饮用水报告（rs-sz）PDF：恢复行内列竖线——上方 zjt 通用规则去掉了列竖线，饮用水需要保留（同特异性，放在其后覆盖） */
.qcr-pdf-draw .report-sheet.rs-sz .rs-tblhead .c,
.qcr-pdf-draw .report-sheet.rs-sz .rs-tblrow .c{ border-right:1px solid #000; }
.qcr-pdf-draw .report-sheet.rs-sz .rs-tblhead .c:last-child,
.qcr-pdf-draw .report-sheet.rs-sz .rs-tblrow .c:last-child{ border-right:none; }
/* 药品物料/包材报告（rs-dwbsheet）PDF：锁定一页 273mm——超高时 JS 压缩行距/边距/字号
   （--dwb-pad/--dwb-lh/--dwb-fs/--dwb-ipad 由 pinDwbFit 按内容量自动设置） */
.qcr-pdf-draw .report-sheet.rs-dwbsheet{ height:273mm; max-height:273mm; overflow:hidden; }
.qcr-pdf-draw .report-sheet.rs-dwbsheet .rs-tblrows{ overflow:hidden; }
.qcr-pdf-draw .report-sheet.rs-dwbsheet .rs-tblrow{
  padding: var(--dwb-pad, 12px) 0; line-height: var(--dwb-lh, 1.6); font-size: var(--dwb-fs, 10.5pt);
}
.qcr-pdf-draw .report-sheet.rs-dwbsheet .rs-tblrow .c{ line-height: var(--dwb-lh, 1.6); }
.qcr-pdf-draw .report-sheet.rs-dwbsheet .rs-info td{ padding: var(--dwb-ipad, 4px) 10px; }
.qcr-pdf-draw .report-sheet.rs-dwbsheet .rs-tblhead .c{
  padding: var(--dwb-hpad, 8px) 4px; line-height: var(--dwb-lh, 1.6); font-size: var(--dwb-fs, 10.5pt);
}
/* 成品报告分页版式（PDF）：第二页去掉屏幕虚线分页线；第一页区块拉伸使标签项目实际落在第二页坐标区 */
.qcr-pdf-draw .report-sheet.rs-cp .rs-pg2{ margin-top:0; border-top:none; }
/* 第二页专用列宽（PDF 量坐标用）：30mm/60mm */
.qcr-pdf-draw .report-sheet.rs-cp .rs-tblhead.rs-head2,
.qcr-pdf-draw .report-sheet.rs-cp .rs-tblrows.rs-tagmerge,
.qcr-pdf-draw .report-sheet.rs-cp .rs-tagmerge .rs-vlines{
  grid-template-columns: 12mm 35mm auto 9.6%;
}
.qcr-pdf-draw .report-sheet .rs-tblrows{ margin-top:0; margin-bottom:0; min-height:0; flex:1; }
.qcr-pdf-draw .report-sheet .rs-foot{ margin-top:0; margin-bottom:0; font-size:10.5pt; }
/* 饮用水报告（rs-sz）PDF：与查看/打印一致——保留左右线，末行收尾横线，下方留空无底线，备注行上表格线恢复 */
.qcr-pdf-draw .report-sheet.rs-sz .rs-tblrows{ border-bottom:none; flex:0 0 auto; }
.qcr-pdf-draw .report-sheet.rs-sz .rs-tblrow:nth-last-of-type(2) .c{ border-bottom:1px solid #000; }
.qcr-pdf-draw .report-sheet.rs-sz .rs-foot{ border-top:1px solid #000; }
/* 纯化水（rs-chs）PDF：与查看/打印一致——foot 顶边框保持 none，避免与矩阵表末行底边框叠成双线 */
.qcr-pdf-draw .report-sheet.rs-chs .rs-foot{ border-top:none !important; }
.qcr-pdf-draw .report-sheet .rs-concl{ margin-top:0; margin-bottom:0; padding:2px 0 4px; font-size:10.5pt; }
.qcr-pdf-draw .report-sheet .rs-sign{ margin-top:1mm; margin-bottom:0; font-size:10.5pt; }
/* 食品中间体报告"一页两份"（rs-2up）PDF：明细区不拉伸（覆盖上方通用 flex:1，两份各占半页），
   压缩变量（--cp-*）与屏幕/打印同源；纸面高度由 pin2Up 按整页内联设定 */
.qcr-pdf-draw .report-sheet.rs-2up .rs-tblrows{ flex:0 0 auto; min-height:0; }
.qcr-pdf-draw .report-sheet.rs-2up .rs-pg1{ flex:0 0 auto; }
.qcr-pdf-draw .report-sheet.rs-2up .rs-pg1 .rs-tblrows{ flex:0 0 auto; }
.qcr-pdf-draw .report-sheet.rs-2up .rs-tblrow{ flex-grow:0; }
.qcr-pdf-draw .report-sheet.rs-2up .rs-brand{ padding-top: var(--cp-bpad, 8px); }
.qcr-pdf-draw .report-sheet.rs-2up .rs-title{ padding-top: var(--cp-bpad, 8px); }
.qcr-pdf-draw .report-sheet.rs-2up table.rs-info td{ padding: var(--cp-ipad, 4px) 10px; font-size: var(--cp-fs, 10.5pt); }
.qcr-pdf-draw .report-sheet.rs-2up .rs-tblhead .c{ padding: var(--cp-hpad, 8px) 4px; font-size: var(--cp-fs, 10.5pt); }
.qcr-pdf-draw .report-sheet.rs-2up .rs-tblrow,
.qcr-pdf-draw .report-sheet.rs-2up .rs-tblrow .c{ font-size: var(--cp-fs, 10.5pt); }
.qcr-pdf-draw .report-sheet.rs-2up .rs-concl,
.qcr-pdf-draw .report-sheet.rs-2up .rs-sign{ font-size: var(--cp-fs, 10.5pt); }

/* 打印：仅显示打印区，横向纸张，每页顶部重复标题头 */
#print-acc{ display:none; }
/* 领料单打印：表头/页脚随每页重复（全局生效，避免媒体查询兼容问题） */
#print-acc .ob-x-table thead{ display:table-header-group; }
#print-acc .ob-x-table tfoot{ display:table-footer-group; }
@page{ size: landscape; margin: 6mm 10mm; }
@media print{
  /* 打印时强制渲染背景/伪元素颜色（竖线等背景绘制元素在打印中必须显示） */
  *{ -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  /* display 隔离：打印时只保留打印区，其余元素不参与渲染（比 visibility 更可靠，图片稳定显示） */
  body > :not(#print-acc){ display:none !important; }
  #print-acc{ display:block !important; position:static; width:100%; padding:0; }
  /* 打印底色统一白色（不依赖 print-qcr 类）：
     print-color-adjust:exact 会把应用页面背景色也印出来——所有打印（分类账/请验单/接收记录等
     原生 window.print）一律强制 html/body 白底，只有显式设置了背景的元素（表头 #eee 等）才保留颜色 */
  html, body { background: #fff !important; }
  /* 检验报告打印：锁定 A4 竖向一页（297mm-上下边距12mm=273mm），签字区贴底、禁止撑到第二页 */
  /* 打印底色强制白色：纸面高度按整页取整后与真实打印版面可能差几个像素，
     页尾会露出应用页面背景色形成一条色带；打印时html/body一律白色 */
  html.print-qcr, html.print-qcr body { background: #fff !important; }
  html.print-qcr #print-acc{ background:#fff !important; }
  html.print-qcr #print-acc .report-sheet{
    width:186mm; height:273mm; min-height:273mm; max-height:273mm;
    overflow:hidden; padding:0; margin:0; border:none; border-radius:0;
    font-size:10.5pt;
    page-break-inside:avoid; break-inside:avoid; page-break-after:avoid;
  }
  /* 成品报告打印：不锁定一页——内容超高自然分页到第二页；明细行整行不跨页断开；
     行内单元格画列竖线（覆盖层 .rs-vlines 跨页会被裁掉，行内线保证第二页起列分隔线完整） */
  html.print-qcr #print-acc .report-sheet.rs-cp{
    height:auto; max-height:none; min-height:273mm; overflow:visible;
    page-break-inside:auto; break-inside:auto; page-break-after:auto;
  }
  html.print-qcr #print-acc .report-sheet.rs-cp .rs-tblrows{ overflow:visible; }
  html.print-qcr #print-acc .report-sheet.rs-cp .rs-tblrow{ page-break-inside:avoid; break-inside:avoid; }
  html.print-qcr #print-acc .report-sheet.rs-cp .rs-tblrow .c{ border-right:1px solid #000; }
  html.print-qcr #print-acc .report-sheet.rs-cp .rs-tblrow .c:last-child{ border-right:none; }
  /* 食品中间体报告（rs-2up）打印：锁定 A4 一页——两个 .rs-copy 各占半页（沿中线裁切），
     不分页、不裁剪（内容超高由 pin2Up 逐级压缩保证装下）；
     明细行内单元格画列竖线（覆盖层 .rs-vlines 在半页边界处同样正常） */
  html.print-qcr #print-acc .report-sheet.rs-2up{
    height:273mm; max-height:273mm; min-height:273mm; overflow:hidden;
    page-break-inside:avoid; break-inside:avoid; page-break-after:avoid;
  }
  html.print-qcr #print-acc .report-sheet.rs-2up .rs-tblrows{ overflow:visible; }
  html.print-qcr #print-acc .report-sheet.rs-2up .rs-tblrow{ page-break-inside:avoid; break-inside:avoid; }
  /* 中间体/提取物/饮片/药品物料包材报告（rs-zjtsheet）打印：同成品——不锁定一页，
     内容超高自然分页；明细区不裁剪（overflow:visible），行高随内容自动撑开，
     整行不跨页断开，全部内容可打印；明细列间竖线不画（仅保留外框） */
  html.print-qcr #print-acc .report-sheet.rs-zjtsheet{
    height:auto; max-height:none; min-height:273mm; overflow:visible;
    page-break-inside:auto; break-inside:auto; page-break-after:auto;
  }
  html.print-qcr #print-acc .report-sheet.rs-zjtsheet .rs-tblrows{ overflow:visible; }
  html.print-qcr #print-acc .report-sheet.rs-zjtsheet .rs-tblrow{ page-break-inside:avoid; break-inside:avoid; }
  html.print-qcr #print-acc .report-sheet.rs-zjtsheet .rs-tblrow .c{ border-right:none; }
  /* 饮用水报告（rs-sz）打印：恢复行内列竖线——上方 zjt 通用规则去掉了列竖线，饮用水需要保留（同特异性，放在其后覆盖） */
  html.print-qcr #print-acc .report-sheet.rs-sz .rs-tblhead .c,
  html.print-qcr #print-acc .report-sheet.rs-sz .rs-tblrow .c{ border-right:1px solid #000; }
  html.print-qcr #print-acc .report-sheet.rs-sz .rs-tblhead .c:last-child,
  html.print-qcr #print-acc .report-sheet.rs-sz .rs-tblrow .c:last-child{ border-right:none; }
  /* 药品物料/包材报告（rs-dwbsheet）打印：锁定 A4 一页——内容超高时由 JS 压缩行距/边距/字号收缩到一页
     （--dwb-pad / --dwb-lh / --dwb-fs / --dwb-ipad / --dwb-hpad 由 pinDwbFit 按内容量自动设置），不溢出不分页 */
  html.print-qcr #print-acc .report-sheet.rs-dwbsheet{
    height:273mm; max-height:273mm; overflow:hidden;
    page-break-inside:avoid; break-inside:avoid; page-break-after:avoid;
  }
  html.print-qcr #print-acc .report-sheet.rs-dwbsheet .rs-tblrows{ overflow:hidden; }
  html.print-qcr #print-acc .report-sheet.rs-dwbsheet .rs-tblrow{
    padding: var(--dwb-pad, 12px) 0; line-height: var(--dwb-lh, 1.6); font-size: var(--dwb-fs, 10.5pt);
  }
  html.print-qcr #print-acc .report-sheet.rs-dwbsheet .rs-tblrow .c{ line-height: var(--dwb-lh, 1.6); }
  html.print-qcr #print-acc .report-sheet.rs-dwbsheet .rs-info td{ padding: var(--dwb-ipad, 4px) 10px; }
  html.print-qcr #print-acc .report-sheet.rs-dwbsheet .rs-tblhead .c{
    padding: var(--dwb-hpad, 8px) 4px; line-height: var(--dwb-lh, 1.6); font-size: var(--dwb-fs, 10.5pt);
  }
  /* 成品报告分页版式：第二页（标签项目+结论+签名）强制从新页开始；第一页行高按 pinCpBottom 压缩 */
  html.print-qcr #print-acc .report-sheet.rs-cp .rs-pg2{
    break-before: page; page-break-before: always;
    margin-top: 0; border-top: none;
  }
  /* 第二页专用列宽（打印）：30mm/60mm，覆盖上方 #print-acc 通用四列模板 */
  html.print-qcr #print-acc .report-sheet.rs-cp .rs-tblhead.rs-head2,
  html.print-qcr #print-acc .report-sheet.rs-cp .rs-tblrows.rs-tagmerge,
  html.print-qcr #print-acc .report-sheet.rs-cp .rs-tagmerge .rs-vlines{
    grid-template-columns: 12mm 35mm auto 9.6%;
  }
  html.print-qcr #print-acc .report-sheet .rs-brand{ padding:8px 0 0; }
  html.print-qcr #print-acc .report-sheet .rs-company{ padding-left:0; padding-right:0; font-size:16pt; }
  html.print-qcr #print-acc .report-sheet .rs-contact{ padding-left:0; padding-right:0; font-size:9pt; }
  html.print-qcr #print-acc .report-sheet .rs-title{ padding-left:0; padding-right:0; font-size:16pt; }
  html.print-qcr #print-acc .report-sheet .rs-file,
  html.print-qcr #print-acc .report-sheet .rs-no{ padding-left:0; padding-right:0; }
  html.print-qcr #print-acc .report-sheet table.rs-info{ width:100%; margin:0; }
  html.print-qcr #print-acc .report-sheet .rs-tblhead,
  html.print-qcr #print-acc .report-sheet .rs-tblrow{ grid-template-columns: 16.6% 36.9% 36.9% 9.6%; }
  /* 中间体报告打印：三列明细（无判定），列宽同屏幕；表头上提 1px 与信息表底边重叠，边框线连续 */
  html.print-qcr #print-acc .report-sheet .rs-tblhead.rs-zjt-head,
  html.print-qcr #print-acc .report-sheet .rs-tblrow.rs-zjt-row,
  html.print-qcr #print-acc .report-sheet .rs-vlines.rs-zjt-vl{ grid-template-columns: calc(16.6% + 30px) calc(41.7% - 15px) calc(41.7% - 15px); }
  /* 药品物料/包材报告打印：检验项目列 +20px（30px 偏移） */
  html.print-qcr #print-acc .report-sheet .rs-tblhead.rs-dwb-head,
  html.print-qcr #print-acc .report-sheet .rs-tblrow.rs-dwb,
  html.print-qcr #print-acc .report-sheet .rs-vlines.rs-dwb-vl{ grid-template-columns: calc(16.6% + 30px) calc(41.7% - 15px) calc(41.7% - 15px); }
  /* 饮用水报告打印：明细"检验结果"列 -20px 再 -50px 加到"检验项目"列（列宽含 #print-acc 的高特异性，
     须放在上面 rs-zjt / rs-dwb 规则之后生效）；明细区表格线由上方 .report-sheet.rs-sz 规则继承，无需重复 */
  html.print-qcr #print-acc .report-sheet.rs-sz .rs-tblhead,
  html.print-qcr #print-acc .report-sheet.rs-sz .rs-tblrow,
  html.print-qcr #print-acc .report-sheet.rs-sz .rs-tblrows .rs-vlines{ grid-template-columns: calc(16.6% + 100px) calc(41.7% - 15px) calc(41.7% - 85px); }
  html.print-qcr #print-acc .report-sheet .rs-tblhead.rs-zjt-head{ margin-top:-1px; position:relative; }
  /* 药品成品报告打印：标准规定列 +4%、检验结果列 -4%（与屏幕/PDF 同模板） */
  html.print-qcr #print-acc .report-sheet .rs-tblhead.rs-dcp-head,
  html.print-qcr #print-acc .report-sheet .rs-tblrow.rs-dcp,
  html.print-qcr #print-acc .report-sheet .rs-vlines.rs-dcp-vl{ grid-template-columns: calc(16.6% + 30px) calc(45.7% - 15px) calc(37.7% - 15px); }
  /* 中间体报告打印：表头自带上框线、左右外扩 1px 与信息表边框接续 */
  html.print-qcr #print-acc .report-sheet .rs-tblhead,
  html.print-qcr #print-acc .report-sheet .rs-tblrows,
  html.print-qcr #print-acc .report-sheet .rs-matrix-wrap,
  html.print-qcr #print-acc .report-sheet .rs-foot,
  html.print-qcr #print-acc .report-sheet .rs-concl,
  html.print-qcr #print-acc .report-sheet .rs-sign{
    width:100%; max-width:none; box-sizing:border-box; margin-left:0; margin-right:0;
  }
  html.print-qcr #print-acc .report-sheet .rs-tblhead{ margin-top:2mm; margin-bottom:0; }
  /* 非成品报告（物料/包材/中间体等）打印：表头上提 1px 与信息表底边重叠（成品 2mm 间距除外） */
  html.print-qcr #print-acc .report-sheet .rs-tblhead{ margin-top:-1px; position:relative; }
  html.print-qcr #print-acc .report-sheet.rs-cp .rs-tblhead{ margin-top:2mm; }
  html.print-qcr #print-acc .report-sheet .rs-tblrows{ margin-top:0; margin-bottom:0; min-height:0; }
  html.print-qcr #print-acc .report-sheet .rs-foot{ margin-top:0; margin-bottom:0; }
  html.print-qcr #print-acc .report-sheet .rs-concl{ margin-top:0; margin-bottom:0; padding:2px 0 4px; }
  html.print-qcr #print-acc .report-sheet .rs-sign{ margin-top:1mm; margin-bottom:0; }
  /* 饮用水报告（rs-sz）打印：完全复刻查看样式——上方通用 print 规则把表格宽设为 width:100%;margin:0
     撑满纸面，清掉了查看时的左右缩进（margin:0 24.5px + width:calc(100% - 49px)），使打印的表格宽度、
     竖线位置与查看不同；此处为 rs-sz 显式恢复查看布局（缩进、行高按内容、横/竖线、表头底线），
     打印即与查看一致 */
  html.print-qcr #print-acc .report-sheet.rs-sz table.rs-info,
  html.print-qcr #print-acc .report-sheet.rs-sz .rs-tblhead,
  html.print-qcr #print-acc .report-sheet.rs-sz .rs-tblrows,
  html.print-qcr #print-acc .report-sheet.rs-sz .rs-foot{
    margin-left:24.5px; margin-right:24.5px;
    width:calc(100% - 49px); max-width:none;
  }
  /* 明细区与查看完全一致：查看用基础规则 flex:1 拉伸填满纸面（明细行靠上排列，行下方空白
     仍由明细区容器左右框线包住，页脚因此贴到纸底）；此处原先写 flex:0 0 auto（只按内容高
     排列），明细区不拉伸、页脚上移，纸底多出约 333px 空白——打印与查看不一致的直接原因。
     不写 flex 即继承查看的基础 flex:1，打印与查看完全同源。
     多页场景（内容超高）由 .rs-zjtsheet 打印规则的 height:auto 处理：容器高＝内容高时
     flex 无剩余空间可分配，明细区自然贴合内容，不影响分页 */
  html.print-qcr #print-acc .report-sheet.rs-sz .rs-tblrows{
    display:flex; flex-direction:column; justify-content:flex-start;
    border-bottom:none;
  }
  html.print-qcr #print-acc .report-sheet.rs-sz .rs-tblrow{ flex:0 0 auto; }
  html.print-qcr #print-acc .report-sheet.rs-sz .rs-tblrow + .rs-tblrow .c{ border-top:1px solid #000; }
  html.print-qcr #print-acc .report-sheet.rs-sz .rs-tblrow:nth-last-of-type(2) .c{ border-bottom:1px solid #000; }
  html.print-qcr #print-acc .report-sheet.rs-sz .rs-tblhead .c{ border-bottom:1px solid #000; }
  /* 标题字号与查看一致：查看/PDF 均为 10.5pt（见 .report-sheet .rs-title），
     上方通用 print 规则把它放大到 16pt，标题行高随之增加约 10px，
     使标题以下（信息表/表头/明细/页脚）整体比查看下移约 10px；此处按查看字号还原 */
  html.print-qcr #print-acc .report-sheet.rs-sz .rs-title{ font-size:10.5pt; }
  /* 纯化水报告（rs-chs）打印：矩阵表区（.rs-matrix-wrap）与查看一致。
     纯化水与饮用水同属"水质"报告（根类同时带 rs-sz），但版式不同——纯化水用矩阵表
     （.rs-matrix-wrap > table.rs-matrix），饮用水用三列明细（.rs-tblhead/.rs-tblrows）。
     上方通用 print 规则把 .rs-matrix-wrap 的 width 设为 100%、margin 清零，而上方 rs-sz
     恢复块只覆盖 table.rs-info/.rs-tblhead/.rs-tblrows/.rs-foot，未含 .rs-matrix-wrap，
     于是打印的矩阵表比查看宽 49px、左右各外移 24.5px：与上方信息表、下方 4 行格子的
     左右边线错位，矩阵表末行底边也随之外扩（"顶部和底部表格位置不对"的直接原因）。
     此处按查看布局还原（margin 24.5px + width calc(100% - 49px)），打印即与查看同宽同位 */
  html.print-qcr #print-acc .report-sheet.rs-chs .rs-matrix-wrap{
    margin-left:24.5px; margin-right:24.5px;
    width:calc(100% - 49px); max-width:none;
  }
  /* 纯化水（rs-chs）打印：整张纸宽固定为整数像素 703px（≈186mm @96dpi）。
     原因：纸宽写成 186mm 时实际布局宽为 702.98px，减去左右各 24.5px 内缩后，
     矩阵表与下方 4 行格子（.rs-foot）宽都是 653.98px 这类小数。矩阵表用
     border-collapse:collapse（相邻格共线、由浏览器按设备像素取整后绘制），
     .rs-foot 用普通盒边框（按盒边缘绘制），两者在小数宽度下的取整相位不一致，
     于是"备注"行的左右竖线与上方矩阵表左右竖线错开约 0.5px，接缝处露出细缝。
     把纸宽锁定为整数 703px 后，内缩区宽恰为整数 654px，折叠边框与盒边框取整一致，
     竖线上下连续；查看面板本就是 703px 宽，打印即与查看完全同构 */
  html.print-qcr #print-acc .report-sheet.rs-chs{ width:703px; max-width:none; }
  /* 放行审核单打印：A4 竖向 12mm，HTML 矢量，不用截图 */
  html.print-rel #print-acc .report-sheet.rel-sheet{
    width:186mm; height:273mm; min-height:273mm; max-height:273mm;
    overflow:hidden; padding:0; margin:0; border:none; border-radius:0;
    font-size:10.5pt; font-family:SimSun,"宋体",serif; box-sizing:border-box;
    display:flex; flex-direction:column;
    page-break-inside:avoid; break-inside:avoid; page-break-after:avoid;
  }
  html.print-rel #print-acc .report-sheet.rel-sheet .rs-brand{ padding:8px 0 0; font-size:10.5pt; }
  html.print-rel #print-acc .report-sheet.rel-sheet .rel-title{ padding-left:0; padding-right:0; font-size:16pt; }
  html.print-rel #print-acc .report-sheet.rel-sheet .rel-no{ padding-left:0; padding-right:0; font-size:10.5pt; }
  html.print-rel #print-acc .report-sheet.rel-sheet table.rel-all{
    width:100%; margin:0; flex:1; height:100%;
  }
  html.print-rel #print-acc .report-sheet.rel-sheet .rel-all tr,
  html.print-rel #print-acc .report-sheet.rel-sheet .rel-all tr.h1,
  html.print-rel #print-acc .report-sheet.rel-sheet .rel-all tr.h,
  html.print-rel #print-acc .report-sheet.rel-sheet .rel-all tr:last-child{
    height:auto;
  }
  /* 报告/放行单打印内容占满 A4 内容区：表格与区块去掉左右内缩，左右边距与页面一致(12mm) */
  #print-acc .report-sheet table.rs-info{ width:100%; margin:0; }
  #print-acc .report-sheet .rs-tblhead,
  #print-acc .report-sheet .rs-tblrows,
  #print-acc .report-sheet .rs-foot,
  #print-acc .report-sheet .rs-concl,
  #print-acc .report-sheet .rs-sign{ width:100%; max-width:none; margin-left:0; margin-right:0; box-sizing:border-box; }
  #print-acc .report-sheet.rs-cp .rs-tblhead{ margin-top:2mm; margin-bottom:0; }
  #print-acc .report-sheet .rs-tblrows{ margin-top:0; margin-bottom:0; }
  #print-acc .report-sheet .rs-foot{ margin-top:0; margin-bottom:0; }
  #print-acc .report-sheet .rs-concl{ margin-top:0; margin-bottom:0; padding:2px 0 4px; }
  #print-acc .report-sheet .rs-sign{ margin-top:1mm; margin-bottom:0; }
  /* 打印内容顶部：LOGO + 公司名靠左（位于 thead，随每页重复）；标题 4 号(14pt) */
  #print-acc .ph-brand{ text-align:left; font-size:14pt; font-weight:700; }
  #print-acc .print-logo{ height:45px; width:auto; vertical-align:middle; margin-right:8px; }
  #print-acc thead{ display:table-header-group; }
  /* 打印顶部第 1~4 行（公司名/标题/编号/类别+年份）四个方向全部无边框 */
  #print-acc .acc-x-table thead tr:nth-child(1) th,
  #print-acc .acc-x-table thead tr:nth-child(2) th,
  #print-acc .acc-x-table thead tr:nth-child(3) th,
  #print-acc .acc-x-table thead tr:nth-child(4) th{
    border:0 !important; border-top:none !important; border-right:none !important;
    border-bottom:none !important; border-left:none !important;
  }
  #print-acc .acc-x-table{ border-collapse:collapse; width:100%; }
  #print-acc .acc-x-table th, #print-acc .acc-x-table td{ border:1px solid #000; padding:1px 5px; font-size:10.5px; text-align:center; word-break:break-all; vertical-align:middle; }
  #print-acc .acc-x-table th{ background:#eee; font-weight:600; }
  /* 换页时数据行保持完整：禁止在行中间拆分，放不下的整行移到下一页 */
  #print-acc .acc-x-table tbody tr{ page-break-inside:avoid; break-inside:avoid; }
  /* 表格线从"序号"行(thead 第5行)开始：该行顶部有横线 */
  #print-acc .acc-x-table thead tr:nth-child(5) th{ border-top:1px solid #000 !important; }
  /* 打印列宽（已删「包装规格」列，原第 8 列起整体前移一位）：
     序号(1)=50 进货日期(2)=50 物料编码(4)=70 件数(8)=45 总量(9)=50 单位(10)=50
     储存条件(11)=60 收货人(13)=45 生产日期(14)=70 有效期至(15)=70 物料批号(16)=75 */
#print-acc .acc-x-table th:nth-child(1),  #print-acc .acc-x-table td:nth-child(1){ min-width:50px; width:50px; }
#print-acc .acc-x-table th:nth-child(2),  #print-acc .acc-x-table td:nth-child(2){ min-width:50px; width:50px; }
#print-acc .acc-x-table th:nth-child(4),  #print-acc .acc-x-table td:nth-child(4){ min-width:70px; width:70px; }
#print-acc .acc-x-table th:nth-child(8),  #print-acc .acc-x-table td:nth-child(8){ min-width:45px; width:45px; }
#print-acc .acc-x-table th:nth-child(9),  #print-acc .acc-x-table td:nth-child(9){ min-width:50px; width:50px; }
#print-acc .acc-x-table th:nth-child(10), #print-acc .acc-x-table td:nth-child(10){ min-width:50px; width:50px; }
#print-acc .acc-x-table th:nth-child(11), #print-acc .acc-x-table td:nth-child(11){ min-width:60px; width:60px; }
#print-acc .acc-x-table th:nth-child(13), #print-acc .acc-x-table td:nth-child(13){ min-width:45px; width:45px; }
#print-acc .acc-x-table th:nth-child(14), #print-acc .acc-x-table td:nth-child(14),
#print-acc .acc-x-table th:nth-child(15), #print-acc .acc-x-table td:nth-child(15){ min-width:70px; width:70px; }
#print-acc .acc-x-table th:nth-child(16), #print-acc .acc-x-table td:nth-child(16){ min-width:75px; width:75px; }
/* 复验台账打印表（16 列，已删件数列）：列宽对齐接收记录打印表；min-width:0 清掉验收通用列宽的错位干扰 */
#print-acc .acc-x-table.fy-x th, #print-acc .acc-x-table.fy-x td{ white-space:normal; min-width:0 !important; }
#print-acc .acc-x-table.fy-x th:nth-child(1),  #print-acc .acc-x-table.fy-x td:nth-child(1){ width:50px; }
#print-acc .acc-x-table.fy-x th:nth-child(2),  #print-acc .acc-x-table.fy-x td:nth-child(2){ width:50px; }
#print-acc .acc-x-table.fy-x th:nth-child(3),  #print-acc .acc-x-table.fy-x td:nth-child(3){ width:100px; }
#print-acc .acc-x-table.fy-x th:nth-child(4),  #print-acc .acc-x-table.fy-x td:nth-child(4){ width:70px; }
#print-acc .acc-x-table.fy-x th:nth-child(5),  #print-acc .acc-x-table.fy-x td:nth-child(5){ width:100px; }
#print-acc .acc-x-table.fy-x th:nth-child(6),  #print-acc .acc-x-table.fy-x td:nth-child(6){ width:100px; }
#print-acc .acc-x-table.fy-x th:nth-child(7),  #print-acc .acc-x-table.fy-x td:nth-child(7){ width:60px; }
#print-acc .acc-x-table.fy-x th:nth-child(8),  #print-acc .acc-x-table.fy-x td:nth-child(8){ width:50px; }
#print-acc .acc-x-table.fy-x th:nth-child(9),  #print-acc .acc-x-table.fy-x td:nth-child(9){ width:50px; }
#print-acc .acc-x-table.fy-x th:nth-child(10), #print-acc .acc-x-table.fy-x td:nth-child(10){ width:60px; }
#print-acc .acc-x-table.fy-x th:nth-child(11), #print-acc .acc-x-table.fy-x td:nth-child(11){ width:60px; }
#print-acc .acc-x-table.fy-x th:nth-child(12), #print-acc .acc-x-table.fy-x td:nth-child(12){ width:45px; }
#print-acc .acc-x-table.fy-x th:nth-child(13), #print-acc .acc-x-table.fy-x td:nth-child(13){ width:75px; }
#print-acc .acc-x-table.fy-x th:nth-child(14), #print-acc .acc-x-table.fy-x td:nth-child(14){ width:75px; }
#print-acc .acc-x-table.fy-x th:nth-child(15), #print-acc .acc-x-table.fy-x td:nth-child(15){ width:75px; }
/* 留样管理台账打印表（13 列）：列宽交给浏览器按内容自适应 —— min-width:0/width:auto 清掉接收记录打印表的定宽规则干扰 */
#print-acc .acc-x-table.ly-x th, #print-acc .acc-x-table.ly-x td{ min-width:0 !important; width:auto !important; white-space:normal; }
  /* 打印页眉（不显示边框）；标题 4 号(14pt) */
  #print-acc .ph-title{ font-size:14pt; font-weight:800; background:#fff; padding:8px 0 2px; letter-spacing:2px; border:none; }
  #print-acc .ph-num{ text-align:right; background:#fff; padding:0 2px 4px; border:none; }
  #print-acc .ph-left{ text-align:left; background:#fff; padding:4px 2px; border:none; }
  #print-acc .ph-right{ text-align:right; background:#fff; padding:4px 2px; border:none; }
  /* —— 物料分类明细账 打印（宋体；内容小四 12px） —— */
  #print-acc .ld-x-table{ border-collapse:collapse; width:100%; table-layout:fixed; font-family:SimSun,"宋体",serif; }
  #print-acc .ld-x-table th, #print-acc .ld-x-table td{ border:1px solid #000; padding:1px 5px; font-size:12px; text-align:center; word-break:break-all; vertical-align:middle; }
  #print-acc .ld-x-table th{ background:#eee; font-weight:600; }
  /* 前 4 行（LOGO/标题/编号/信息条）无边框，表头行(第5行)顶部有线 */
  #print-acc .ld-x-table thead tr:nth-child(1) th,
  #print-acc .ld-x-table thead tr:nth-child(2) th,
  #print-acc .ld-x-table thead tr:nth-child(3) th,
  #print-acc .ld-x-table thead tr:nth-child(4) th{
    border:0 !important; border-top:none !important; border-right:none !important;
    border-bottom:none !important; border-left:none !important;
  }
  #print-acc .ld-x-table thead tr:nth-child(5) th{ border-top:1px solid #000 !important; height:46px; }
  #print-acc .ld-x-table thead{ display:table-header-group; }
  /* 列宽：日期180 来源去向(第2列)剩余 收入发放200 结存200 收发料人150 领退料人150 备注200 */
  #print-acc .ld-x-table th:nth-child(1),  #print-acc .ld-x-table td:nth-child(1){ min-width:180px; width:180px; }
  #print-acc .ld-x-table th:nth-child(3),  #print-acc .ld-x-table td:nth-child(3){ min-width:200px; width:200px; }
  #print-acc .ld-x-table th:nth-child(4),  #print-acc .ld-x-table td:nth-child(4){ min-width:200px; width:200px; }
  #print-acc .ld-x-table th:nth-child(5),  #print-acc .ld-x-table td:nth-child(5){ min-width:150px; width:150px; }
  #print-acc .ld-x-table th:nth-child(6),  #print-acc .ld-x-table td:nth-child(6){ min-width:150px; width:150px; }
  #print-acc .ld-x-table th:nth-child(7),  #print-acc .ld-x-table td:nth-child(7){ min-width:200px; width:200px; }
  #print-acc .ld-x-table tbody tr{ page-break-inside:avoid; break-inside:avoid; }
  /* —— 检验台账 打印（物料/包材 10 列；中间体/成品/水质/洁净度 12 列） —— */
  #print-acc .ql-x-table{ border-collapse:collapse; width:100%; }
  #print-acc .ql-x-table th, #print-acc .ql-x-table td{ border:1px solid #000; padding:1px 5px; font-size:10.5px; text-align:center; word-break:break-all; vertical-align:middle; }
  #print-acc .ql-x-table th{ background:#eee; font-weight:600; }
  #print-acc .ql-x-table thead tr:nth-child(1) th,
  #print-acc .ql-x-table thead tr:nth-child(2) th,
  #print-acc .ql-x-table thead tr:nth-child(3) th,
  #print-acc .ql-x-table thead tr:nth-child(4) th{
    border:0 !important; border-top:none !important; border-right:none !important;
    border-bottom:none !important; border-left:none !important;
  }
  #print-acc .ql-x-table thead tr:nth-child(5) th{ border-top:1px solid #000 !important; height:46px; }
  #print-acc .ql-x-table thead{ display:table-header-group; }
  #print-acc .ql-x-table tbody tr{ page-break-inside:avoid; break-inside:avoid; }
  /* 视图一（物料台账/包材台账）列宽：以下 6 列按内容定宽并禁止换行，保证日期/批号/编号整行完整显示——
     物料批号(3) / 请验日期(7) / 取样量(8) / 报告单编号(9) / 检验结果(10) / 报告日期(11)
     （宽度按 10.5px 字号、长值实测留约 10% 余量；食品侧更长的批号/编号也已覆盖） */
  #print-acc .ql-x-table.ql-v1 th:nth-child(3),  #print-acc .ql-x-table.ql-v1 td:nth-child(3){ width:125px; min-width:125px; white-space:nowrap; }
  #print-acc .ql-x-table.ql-v1 th:nth-child(7),  #print-acc .ql-x-table.ql-v1 td:nth-child(7){ width:78px;  min-width:78px;  white-space:nowrap; }
  #print-acc .ql-x-table.ql-v1 th:nth-child(8),  #print-acc .ql-x-table.ql-v1 td:nth-child(8){ width:70px;  min-width:70px;  white-space:nowrap; }
  #print-acc .ql-x-table.ql-v1 th:nth-child(9),  #print-acc .ql-x-table.ql-v1 td:nth-child(9){ width:145px; min-width:145px; white-space:nowrap; }
  #print-acc .ql-x-table.ql-v1 th:nth-child(10), #print-acc .ql-x-table.ql-v1 td:nth-child(10){ width:58px; min-width:58px; white-space:nowrap; }
  #print-acc .ql-x-table.ql-v1 th:nth-child(11), #print-acc .ql-x-table.ql-v1 td:nth-child(11){ width:78px; min-width:78px; white-space:nowrap; }
  #print-acc .ql-x-table.ql-v2 th:nth-child(5),  #print-acc .ql-x-table.ql-v2 td:nth-child(5){ width:90px; }
  #print-acc .ql-x-table.ql-v2 th:nth-child(12), #print-acc .ql-x-table.ql-v2 td:nth-child(12){ width:90px; }
  #print-acc .ql-x-table.ql-v3 th:nth-child(1),  #print-acc .ql-x-table.ql-v3 td:nth-child(1){ width:36px; }
  #print-acc .ql-x-table.ql-v3 th:nth-child(5),  #print-acc .ql-x-table.ql-v3 td:nth-child(5){ width:80px; }
  #print-acc .ql-x-table.ql-v3 th:nth-child(6),  #print-acc .ql-x-table.ql-v3 td:nth-child(6){ width:80px; }
#print-acc .ql-x-table.ql-v3 th:nth-child(10), #print-acc .ql-x-table.ql-v3 td:nth-child(10){ width:130px; }
#print-acc .ql-x-table.ql-v3 th:nth-child(13), #print-acc .ql-x-table.ql-v3 td:nth-child(13){ width:80px; }
  /* —— 请验通知单 打印（版式与用户模板一致：标签列+值列+右侧联次竖列，所有行高统一 34px） —— */
  #print-acc .qyx-table{ font-family:SimSun,"宋体",serif; border-collapse:collapse; width:100%; table-layout:fixed; }
  #print-acc .qyx-table th, #print-acc .qyx-table td{ border:1px solid #000; padding:1px 6px; font-size:15px; text-align:center; vertical-align:middle; word-break:break-all; overflow:hidden; height:34px; }
  /* 标签列：整格居中；第一个标签列（物料类别/生产日期/规格/备注…）块宽＝六个字（min-width:6em，.qlj 默认），
     第二个标签列（品名/供应商/供方批号/包装规格…）块宽＝四个字（.qlj-s）；
     不足基准宽度的标签在块内两端分散显示，「有效(保质)期至」等超长标签随内容撑宽、不换行 */
  #print-acc .qyx-table .ql{ text-align:center; }
  #print-acc .qyx-table .ql .qlj{ display:inline-block; min-width:6em; text-align:justify; text-align-last:justify; }
  #print-acc .qyx-table .ql .qlj.qlj-s{ min-width:4em; }
  #print-acc .qyx-table .qtitle{ font-size:18px; letter-spacing:6px; }
  /* 联次竖排：只保留左边框（右/上/下框线不显示），文字逐字竖排，字号与标签一致 */
  #print-acc .qyx-table .qlinks{ writing-mode:vertical-rl; letter-spacing:4px; font-size:15px; line-height:1.5; border-right:none !important; border-top:none !important; border-bottom:none !important; border-left:1px solid #000 !important; }
  #print-acc .qyx-table .qlogo{ white-space:nowrap; }
  #print-acc .qyx-table td.qv .qcell{ display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; text-overflow:ellipsis; line-height:1.05; word-break:break-all; }
  #print-acc .qyx-table .print-logo{ height:45px; width:auto; vertical-align:middle; margin-right:8px; }
  #print-acc .qyx-table tbody tr{ page-break-inside:avoid; break-inside:avoid; }
  /* 生产统计打印表：页眉3行无边框，表头行(第4行)完整表格线 */
  #print-acc .ps-x-table{ border-collapse:collapse; width:100%; table-layout:fixed; }
  #print-acc .ps-x-table th, #print-acc .ps-x-table td{ border:1px solid #000; padding:3px 5px; font-size:10.5px; text-align:center; word-break:break-all; vertical-align:middle; height:45px; }
  #print-acc .ps-x-table th{ background:#eee; font-weight:600; }
  #print-acc .ps-x-table thead tr:nth-child(1) th,
  #print-acc .ps-x-table thead tr:nth-child(2) th,
  #print-acc .ps-x-table thead tr:nth-child(3) th{
    border:0 !important; border-top:none !important; border-right:none !important;
    border-bottom:none !important; border-left:none !important;
  }
  #print-acc .ps-x-table thead tr:nth-child(4) th{ border-top:1px solid #000 !important; }
  #print-acc .ps-x-table thead{ display:table-header-group; }
  /* 列宽：序号35 产品名称215 产品编码70 产品批号70 生产日期80 有效期80 入库日期80 理论50 入库50 取样50 收率50 单位50
     （序号原 50、产品名称原 200：序号偏宽，-15 挪给产品名称，总宽不变） */
  #print-acc .ps-x-table th:nth-child(1),  #print-acc .ps-x-table td:nth-child(1){ min-width:35px; width:35px; }
  #print-acc .ps-x-table th:nth-child(2),  #print-acc .ps-x-table td:nth-child(2){ min-width:215px; width:215px; }
  #print-acc .ps-x-table th:nth-child(3),  #print-acc .ps-x-table td:nth-child(3){ min-width:70px; width:70px; }
  #print-acc .ps-x-table th:nth-child(4),  #print-acc .ps-x-table td:nth-child(4){ min-width:70px; width:70px; }
  #print-acc .ps-x-table th:nth-child(5),  #print-acc .ps-x-table td:nth-child(5){ min-width:80px; width:80px; }
  #print-acc .ps-x-table th:nth-child(6),  #print-acc .ps-x-table td:nth-child(6){ min-width:80px; width:80px; }
  #print-acc .ps-x-table th:nth-child(7),  #print-acc .ps-x-table td:nth-child(7){ min-width:80px; width:80px; }
  #print-acc .ps-x-table th:nth-child(8),  #print-acc .ps-x-table td:nth-child(8){ min-width:50px; width:50px; }
  #print-acc .ps-x-table th:nth-child(9),  #print-acc .ps-x-table td:nth-child(9){ min-width:50px; width:50px; }
  #print-acc .ps-x-table th:nth-child(10), #print-acc .ps-x-table td:nth-child(10){ min-width:50px; width:50px; }
  #print-acc .ps-x-table th:nth-child(11), #print-acc .ps-x-table td:nth-child(11){ min-width:50px; width:50px; }
  #print-acc .ps-x-table th:nth-child(12), #print-acc .ps-x-table td:nth-child(12){ min-width:50px; width:50px; }
  #print-acc .ps-x-table tbody tr{ page-break-inside:avoid; break-inside:avoid; }
  /* 领料单打印表：页眉3行无边框，表头行(第4行)完整表格线；表格右侧留3mm边距 */
  #print-acc .ob-x-table{ border-collapse:collapse; width:calc(100% - 3mm); page-break-inside:avoid; break-inside:avoid; }
  #print-acc .ob-x-table th, #print-acc .ob-x-table td{ border:0.75px solid #000; padding:1px 4px; font-size:10.5pt; text-align:center; word-break:break-all; vertical-align:middle; height:40px; }
  #print-acc .ob-x-table .ph-title{ font-size:16pt !important; }
  #print-acc .ob-x-table .ph-num, #print-acc .ob-x-table .ph-num td{ font-size:10.5pt; }
  #print-acc .ob-x-table .bq-fix{ height:38px; line-height:12.5px; overflow:hidden; display:flex; align-items:center; justify-content:center; }
  #print-acc .ob-x-table th{ background:#eee; font-weight:600; }
  #print-acc .ob-x-table thead tr:nth-child(1) th,
  #print-acc .ob-x-table thead tr:nth-child(2) th,
  #print-acc .ob-x-table thead tr:nth-child(3) th{
    border:0 !important; border-top:none !important; border-right:none !important;
    border-bottom:none !important; border-left:none !important;
  }
  #print-acc .ob-x-table thead tr:nth-child(4) th{ border-top:0.75px solid #000 !important; }
  /* 表头每页重复（含跨页） */
  #print-acc .ob-x-table thead{ display:table-header-group !important; }
  /* 领料单：名称300 批号190，单位/数量/备注均分剩余宽度 */
  #print-acc .ob-x-table:not(.ob-x-back) thead tr:nth-child(4) th:nth-child(1),
  #print-acc .ob-x-table:not(.ob-x-back) tbody td:nth-child(1){ width:300px; min-width:0; }
  #print-acc .ob-x-table:not(.ob-x-back) thead tr:nth-child(4) th:nth-child(2),
  #print-acc .ob-x-table:not(.ob-x-back) tbody td:nth-child(2){ width:190px; min-width:0; }
  #print-acc .ob-x-table:not(.ob-x-back) thead tr:nth-child(4) th:nth-child(n+3),
  #print-acc .ob-x-table:not(.ob-x-back) tbody td:nth-child(n+3){ width:auto; min-width:0; }
  /* 退料单：列宽只作用在第4行表头和数据行（避免页眉合并格把整表压窄）；批号与领料单同为 190 */
  /* 退料单列宽（与 stock.js 的 colgroup 保持一致，总宽不变）：物料名称 290 / 数量 70 */
  #print-acc .ob-x-table.ob-x-back thead tr:nth-child(4) th:nth-child(1),
  #print-acc .ob-x-table.ob-x-back tbody td:nth-child(1){ width:290px; }
  #print-acc .ob-x-table.ob-x-back thead tr:nth-child(4) th:nth-child(2),
  #print-acc .ob-x-table.ob-x-back tbody td:nth-child(2){ width:190px; }
  #print-acc .ob-x-table.ob-x-back thead tr:nth-child(4) th:nth-child(3),
  #print-acc .ob-x-table.ob-x-back tbody td:nth-child(3){ width:100px; }
  #print-acc .ob-x-table.ob-x-back thead tr:nth-child(4) th:nth-child(4),
  #print-acc .ob-x-table.ob-x-back tbody td:nth-child(4){ width:60px; }
  #print-acc .ob-x-table.ob-x-back thead tr:nth-child(4) th:nth-child(5),
  #print-acc .ob-x-table.ob-x-back tbody td:nth-child(5){ width:70px; }
  #print-acc .ob-x-table.ob-x-back thead tr:nth-child(4) th:nth-child(6),
  #print-acc .ob-x-table.ob-x-back tbody td:nth-child(6){ width:40px; }
  #print-acc .ob-x-table tbody tr{ page-break-inside:avoid; break-inside:avoid; }
  /* 表头每页重复（含跨页） */
  #print-acc .ob-x-table thead{ display:table-header-group !important; }
  #print-acc .ob-x-table tfoot{ display:table-footer-group !important; }
  /* 表格底部：用途行 / 签名标签行（无边框、左对齐、内容靠上） */
  #print-acc .ob-x-table tr.ob-foot-use td,
  #print-acc .ob-x-table tr.ob-foot-sign td{ border:0 !important; height:auto; padding:4px 2px 1px; text-align:left; font-size:10.5pt; vertical-align:top; }
}
/* 编号输入框标签 */
.no-label{ color:var(--ink-2); font-size:13px; white-space:nowrap; }
/* 领料单顶部信息区：标签+控件横向排列 */
.ob-head{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.ob-head label{ font-size:13px; color:var(--ink-2); font-weight:600; white-space:nowrap; }
.ob-head input[type=date]{ width:150px; }
.ob-head select{ min-width:130px; }
/* 类别筛选 + 历史出库：组成一个不可拆分的行内组，两控件始终同一行 */
.ob-head .ob-cat-hist-row{ display:inline-flex; align-items:center; gap:10px; white-space:nowrap; }
/* 历史出库输入框：480px */
.ob-head .ob-hist-wrap input#ob-hist{ width:480px; }
/* 工序下拉：调窄一点 */
.ob-head select#ob-proc{ min-width:95px; width:95px; }
/* 收率输入框：填百分比，窄框 */
.ob-head input#ob-yield{ width:64px; }
/* 退库单历史出库输入框：位于用途位置 */
.ob-head input#oc-input{ width:380px; }
.ob-head input#sb-input{ width:380px; }
.ob-head input#sb-out{ width:450px; }
.ob-head input#sb-reason{ width:130px; }
.ob-head input#sb-back{ flex:1; width:auto; min-width:0; }
/* 用途输入框：固定宽度 380px */
.ob-head input#ob-use{ width:380px; }
/* 历史出库：独占一行（第二行），与领料日期左对齐 */
.ob-hist-wrap{ flex-basis:100%; display:flex; align-items:center; gap:10px; }
.ob-hist-wrap input#ob-hist{ flex:1; min-width:280px; }
table.grid.ob-t th, table.grid.ob-t td{ text-align:center; }
table.grid.ob-t td input{ text-align:center; }
/* 固定列宽，避免点击编辑时列宽收缩/重排 */
table.grid.ob-t{ table-layout:fixed; }
table.grid.ob-t th, table.grid.ob-t td{ word-break:break-all; }
table.grid.ob-t th:nth-child(1), table.grid.ob-t td:nth-child(1){ width:200px; }
table.grid.ob-t th:nth-child(2), table.grid.ob-t td:nth-child(2){ width:200px; }
table.grid.ob-t th:nth-child(3), table.grid.ob-t td:nth-child(3){ width:70px; }
table.grid.ob-t th:nth-child(4), table.grid.ob-t td:nth-child(4){ width:90px; }
table.grid.ob-t th:nth-child(5), table.grid.ob-t td:nth-child(5){ width:120px; }
table.grid.ob-t th:nth-child(6), table.grid.ob-t td:nth-child(6){ width:80px; }
table.grid.ob-t th:nth-child(7), table.grid.ob-t td:nth-child(7){ width:80px; }
/* 退料单列表（物料名称/批号/退库物料质量/单位/数量/备注/操作）列宽 */
table.grid.ob-t.ob-t-back th:nth-child(1), table.grid.ob-t.ob-t-back td:nth-child(1){ width:190px; }
table.grid.ob-t.ob-t-back th:nth-child(2), table.grid.ob-t.ob-t-back td:nth-child(2){ width:200px; }
table.grid.ob-t.ob-t-back th:nth-child(3), table.grid.ob-t.ob-t-back td:nth-child(3){ width:70px; }
table.grid.ob-t.ob-t-back th:nth-child(4), table.grid.ob-t.ob-t-back td:nth-child(4){ width:60px; }
table.grid.ob-t.ob-t-back th:nth-child(5), table.grid.ob-t.ob-t-back td:nth-child(5){ width:100px; }
table.grid.ob-t.ob-t-back th:nth-child(6), table.grid.ob-t.ob-t-back td:nth-child(6){ width:120px; }
table.grid.ob-t.ob-t-back th:nth-child(7), table.grid.ob-t.ob-t-back td:nth-child(7){ width:80px; }
table.grid.oc-t th, table.grid.oc-t td{ text-align:center; }
@media (max-width:1100px){ .ob-head select{ min-width:100px; } .ob-head input#ob-use{ width:380px; } }
.toolbar input#rec-no{ width:220px; }
.toolbar input#ld-no{ width:220px; }
.toolbar input#ps-no{ width:220px; }
.toolbar input#ob-no{ width:220px; }
@media (max-width:1100px){ .toolbar input#rec-no{ width:150px; } .toolbar input#ps-no{ width:150px; } .toolbar input#ob-no{ width:150px; } }

/* 基础信息·物料编码：类别分签 */
.seg-tabs{ display:flex; flex-wrap:wrap; gap:8px; margin:4px 0 14px; }
.seg-btn{
  border:1px solid var(--line); background:#fff; color:var(--ink-2);
  padding:7px 16px; border-radius:9px; font-size:13px; cursor:pointer; transition:.15s;
}
.seg-btn:hover{ border-color:var(--ink-3); color:var(--ink-1); }
.seg-btn.active{ background:var(--brand); color:#fff; border-color:var(--brand); font-weight:600; }
.mt-sum{ color:var(--ink-3); font-size:12.5px; margin-left:6px; }

/* 基础信息·物料编码：子分类分签（点大类后再细分，如 包材→瓶 / 复合膜袋） */
.sub-tabs{ margin:8px 0 10px; padding-bottom:8px; border-bottom:1px dashed var(--line); }
.sub-seg{ display:flex; flex-wrap:wrap; gap:8px; margin:4px 0 0; }
.sub-seg .seg-btn{ padding:4px 14px; font-size:12.5px; border-radius:20px; background:#f4f6f8; border-color:transparent; color:var(--ink-2); }
.sub-seg .seg-btn:hover{ color:var(--brand); border-color:var(--brand); }
.sub-seg .seg-btn.active{ background:var(--brand-soft); color:var(--brand); border-color:var(--brand); font-weight:600; }

.print-only{ display:none; }
.grid td.num{ width:44px; min-width:44px; text-align:center; color:var(--ink-3); }
@media print {
  html{ zoom:1 !important; }
  /* 骨架复位为普通流式布局，保证多页完整打印 */
  html, body{ overflow:visible !important; height:auto !important; }
  .layout{ display:block !important; height:auto !important; min-height:0 !important; overflow:visible !important; }
  .main{ display:block !important; height:auto !important; min-height:0 !important; }
  .sidebar,.topbar,.toolbar,.page .btn,.no-print{ display:none !important; }
  .page{ display:block !important; overflow:visible !important; padding:0 !important; min-height:0 !important; }
  .page > .card:last-of-type, .page > .ledger-layout, .page > .table-wrap, .page > .card-list{ display:block !important; flex:none !important; overflow:visible !important; }
  .page > .card:last-of-type > .unit-grid, .page > .card:last-of-type > .unit-block{ display:block !important; grid-template-columns:none !important; grid-auto-rows:auto !important; overflow:visible !important; }
  .page .unit-body{ display:block !important; flex:none !important; min-height:0 !important; }
  .print-only{ display:block; }
  .table-wrap{ max-height:none !important; overflow:visible !important; padding-bottom:0 !important; }
  .grid-acc{ height:auto !important; }
  .grid-acc tbody tr{ height:auto !important; min-height:0 !important; }
  table.grid.ql-t tbody tr{ height:auto !important; min-height:0 !important; }
  table.grid.ql-t td .cell{ -webkit-line-clamp:none !important; display:block !important; }
  /* —— 物料初验记录 打印/PDF：同检验报告单 .report-sheet 结构，A4竖向撑满 —— */
  html.print-cy #print-acc .cy-sheet{
    width:186mm; height:273mm; min-height:273mm; max-height:273mm;
    overflow:hidden; padding:0; margin:0; border:none; border-radius:0;
    font-size:12pt; font-family:SimSun,serif; box-sizing:border-box;
    page-break-inside:avoid; break-inside:avoid; page-break-after:avoid;
  }
  html.print-cy #print-acc .cy-sheet table{ width:100%; margin:0; }
  html.print-cy #print-acc .cy-sheet .print-logo{ height:42px; width:auto; }
}
/* 初验记录 PDF 导出专用 */
.cy-pdf-draw .cy-sheet{
  width:100%; max-width:none; height:273mm; min-height:273mm; max-height:273mm;
  overflow:hidden; border:none; border-radius:0; margin:0; padding:0;
  font-size:12pt; font-family:SimSun,serif;
  display:flex; flex-direction:column; box-sizing:border-box;
}

/* 验收台账：检验结果只读占位 */
.ro-note{ color:var(--ink-3); font-size:12.5px; line-height:22px; }

/* 台账切换条（验收台账 seg-tabs 复用基础信息样式） */

/* 基础信息 · 供货单位/生产企业 维护 */
.unit-grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:16px; }
@media (max-width:980px){ .unit-grid{ grid-template-columns:1fr; } }
.unit-block{ border:1px solid var(--line); border-radius:12px; overflow:hidden; background:#fff; }
.unit-head{ display:flex; align-items:center; justify-content:space-between; padding:10px 14px; background:var(--brand-soft); font-weight:700; color:var(--brand-dark); }
.unit-count{ font-size:12px; color:var(--ink-3); font-weight:400; }
.unit-body{ padding:12px 14px; }
.unit-list{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; min-height:20px; }
.unit-chip{ display:flex; align-items:center; gap:4px; background:var(--brand-soft2); border:1px solid var(--line); border-radius:20px; padding:4px 6px 4px 12px; font-size:13px; }
.unit-del{ border:none; background:transparent; color:var(--ink-3); cursor:pointer; font-size:15px; line-height:1; padding:0 4px; }
.unit-del:hover{ color:var(--st-bad); }
.unit-addrow{ display:flex; gap:8px; }
.unit-addrow input{ flex:1; }

/* 验收台账 · 物料验收：固定列宽，不允许拖动 */
.grid-acc{ table-layout:fixed; width:100% !important; min-width:0 !important; }
.grid-acc thead th, .grid-acc tbody td{ text-align:center; }
/* 物料接收记录列表：列宽按列序号固定（已删除「包装规格」列，原第 8 列起整体前移一位） */
.grid-acc th:nth-child(1),  .grid-acc td:nth-child(1){ width:28px; }
.grid-acc th:nth-child(2),  .grid-acc td:nth-child(2){ width:52px; }
.grid-acc th:nth-child(3),  .grid-acc td:nth-child(3){ width:96px; }
.grid-acc th:nth-child(4),  .grid-acc td:nth-child(4){ width:132px; }
.grid-acc th:nth-child(5),  .grid-acc td:nth-child(5){ width:108px; }
.grid-acc th:nth-child(6),  .grid-acc td:nth-child(6){ width:108px; }
.grid-acc th:nth-child(7),  .grid-acc td:nth-child(7){ width:112px; }
.grid-acc th:nth-child(8),  .grid-acc td:nth-child(8){ width:40px; }
.grid-acc th:nth-child(9),  .grid-acc td:nth-child(9){ width:50px; }
.grid-acc th:nth-child(10), .grid-acc td:nth-child(10){ width:40px; }
.grid-acc th:nth-child(11), .grid-acc td:nth-child(11){ width:70px; }
.grid-acc th:nth-child(12), .grid-acc td:nth-child(12){ width:56px; }
.grid-acc th:nth-child(13), .grid-acc td:nth-child(13){ width:50px; }
.grid-acc th:nth-child(14), .grid-acc td:nth-child(14){ width:80px; }
.grid-acc th:nth-child(15), .grid-acc td:nth-child(15){ width:80px; }
.grid-acc th:nth-child(16), .grid-acc td:nth-child(16){ width:100px; }
.grid-acc th:nth-child(17), .grid-acc td:nth-child(17){ width:70px; }
.grid-acc th:nth-child(18), .grid-acc td:nth-child(18){ width:62px; }
.grid-acc th, .grid-acc td{
  vertical-align:middle;
  padding:4px 4px !important; white-space:normal !important; overflow:hidden; text-overflow:ellipsis; font-size:12.5px; height:auto !important;
}
.grid-acc thead th{ letter-spacing:0; height:40px !important; line-height:32px !important; }
/* 数据行：固定 46px 行高（容纳 2 行文字，行高统一） */
.grid-acc tbody tr{ height:46px; }
/* 单元格内容最多 2 行，超过 2 行省略号截断 */
.grid-acc td .cell{
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2;
  line-height:16px; overflow:hidden; word-break:break-all; text-align:center;
  max-width:100%;
}
.grid-acc td.col-num .cell, .grid-acc td.col-pkg .cell, .grid-acc td.num-r .cell{ line-height:16px; }
.grid-acc th.col-num, .grid-acc td.col-num{ width:28px; min-width:28px; text-align:center; }
.grid-acc th.col-pkg, .grid-acc td.col-pkg{ width:40px; min-width:40px; text-align:center; }
.grid-acc th.col-code, .grid-acc td.col-code{ min-width:132px; }
.grid-acc th.col-name, .grid-acc td.col-name{ min-width:96px; }
.grid-acc th.col-unit, .grid-acc td.col-unit{ min-width:108px; }
.grid-acc th.col-batch, .grid-acc td.col-batch{ min-width:112px; }
/* 放行台账：检验报告单号 / 放行单号 两列同宽（沿用供方批号列宽） */
.tw-rel th.col-batch, .tw-rel td.col-batch{ min-width:112px; }
/* 放行台账：操作列两排小按钮（已放行：打印/导出 + 查看/取消；未放行：查看/放行） */
.rel-op{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; }
.rel-op-row{ display:flex; flex-direction:row; align-items:center; justify-content:center; gap:4px; }
.tw-rel .rel-op .btn, .tw-rel td.col-op .btn{
  min-width:36px; height:22px; line-height:20px; padding:0 6px; font-size:11px;
}
.tw-rel th.col-op, .tw-rel td.col-op{ width:92px; min-width:92px; }
.tw-rel table.grid tbody td.col-op{ overflow:hidden; height:var(--rel-rowh,64px) !important; }
/* 放行台账：固定列宽 + 内容超宽自动换行（沿用质检台账 ql-t 模式） */
.tw-rel table.grid{ table-layout:fixed; width:100%; min-width:0; }
.tw-rel table.grid th, .tw-rel table.grid td{ white-space:normal !important; word-break:break-all; overflow:hidden; }
.tw-rel table.grid th:nth-child(1),  .tw-rel table.grid td:nth-child(1){ width:40px; }
.tw-rel table.grid th:nth-child(2),  .tw-rel table.grid td:nth-child(2){ width:116px; }
.tw-rel table.grid th:nth-child(3),  .tw-rel table.grid td:nth-child(3),
.tw-rel table.grid th.col-code, .tw-rel table.grid td.col-code{
  width:110px !important; min-width:110px !important; max-width:110px !important;
}
.tw-rel table.grid th:nth-child(4),  .tw-rel table.grid td:nth-child(4){ width:110px; }
.tw-rel table.grid th:nth-child(5),  .tw-rel table.grid td:nth-child(5){ width:110px; }
.tw-rel table.grid th:nth-child(6),  .tw-rel table.grid td:nth-child(6){ width:100px; }
.tw-rel table.grid th:nth-child(7),  .tw-rel table.grid td:nth-child(7){ width:68px; }
.tw-rel table.grid th:nth-child(8),  .tw-rel table.grid td:nth-child(8){ width:92px; }
.tw-rel table.grid th:nth-child(9),  .tw-rel table.grid td:nth-child(9){ width:92px; }   /* 请验日期：放完整 年-月-日 */
.tw-rel table.grid th:nth-child(10), .tw-rel table.grid td:nth-child(10){ width:64px; }
.tw-rel table.grid th:nth-child(11), .tw-rel table.grid td:nth-child(11),
.tw-rel table.grid th.col-rpt, .tw-rel table.grid td.col-rpt{
  width:90px !important; min-width:90px !important; max-width:90px !important;
}
.tw-rel table.grid th:nth-child(12), .tw-rel table.grid td:nth-child(12){ width:92px; }   /* 报告日期：放完整 年-月-日 */
.tw-rel table.grid th:nth-child(13), .tw-rel table.grid td:nth-child(13){ width:76px; }
.tw-rel table.grid th:nth-child(14), .tw-rel table.grid td:nth-child(14),
.tw-rel table.grid th.col-relno, .tw-rel table.grid td.col-relno{
  width:110px !important; min-width:110px !important; max-width:110px !important;
}
.tw-rel table.grid th:nth-child(15), .tw-rel table.grid td:nth-child(15){ width:92px; }
/* 放行台账（屏幕列表）：表格线用黑色实线；「隐藏」时回到全站默认的浅灰线（和其它表格一样，不是没有线） */
.tw-rel table.grid{ border:1px solid #000; }
.tw-rel table.grid th, .tw-rel table.grid td{ border:1px solid #000; }
.tw-rel table.grid thead th{ border-bottom:2px solid #000; }
.tw-rel.no-lines table.grid,
.tw-rel.no-lines table.grid th,
.tw-rel.no-lines table.grid td{ border:1px solid var(--line); }
/* 工具条：行高 −/＋ 按钮与当前值 */
.rel-rowh-btn{ min-width:26px; padding:0 6px !important; font-size:14px; line-height:24px; }
.rel-rowh-val{ display:inline-flex; align-items:center; justify-content:center; min-width:30px; height:26px;
  font-size:12px; color:var(--ink-2); font-variant-numeric:tabular-nums; }
/* 放行台账：行高固定由 --rel-rowh 控制，默认 64px 刚好放下两排操作按钮 */
.tw-rel table.grid thead th, .tw-rel table.grid tbody td{
  vertical-align:middle;
  padding:4px 4px !important; overflow:hidden; text-overflow:ellipsis; font-size:12.5px;
}
.tw-rel table.grid thead th{ letter-spacing:0; height:40px !important; line-height:32px !important; }
.tw-rel table.grid tbody tr{ height:var(--rel-rowh,64px); }
.tw-rel table.grid tbody td{ height:var(--rel-rowh,64px) !important; max-height:var(--rel-rowh,64px); box-sizing:border-box; }
.tw-rel table.grid tbody td .cell{
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2;
  line-height:16px; overflow:hidden; word-break:break-all; text-align:center; max-width:100%;
}
/* 放行状态列：保留标签+日期完整显示，不做两行截断 */
.tw-rel table.grid tbody td.col-st .cell{ display:block; -webkit-line-clamp:unset; line-height:15px; }
/* 放行台账操作列按钮压缩，避免撑高固定行高 */
.tw-rel td.col-op .btn{ height:22px; line-height:20px; padding:0 6px; font-size:11px; min-width:36px; white-space:nowrap; }
/* 行高调到 56 以下（compact 档）：内容与操作按钮同步压缩，保证矮行里两排按钮不被裁掉 */
.tw-rel.compact table.grid thead th, .tw-rel.compact table.grid tbody td{ padding-top:2px !important; padding-bottom:2px !important; }
.tw-rel.compact table.grid tbody td .cell{ line-height:15px; }
.tw-rel.compact .rel-op{ gap:1px; }
.tw-rel.compact td.col-op .btn{ height:17px; line-height:15px; padding:0 4px; font-size:10.5px; min-width:0; }
/* 放行台账：翻页按钮组严格居中（左侧显示总条数） */
.tw-rel + .pager{ position:relative; }
.tw-rel + .pager .pager-btns{ position:absolute; left:50%; transform:translateX(-50%); display:flex; align-items:center; gap:8px; }
/* 列表「滚动显示」模式（放行台账 / 生产统计）：列表不分页，表格容器内纵向滚动，表头滚动时吸附在容器顶部
   （table.grid thead th 本身已是 position:sticky）；横向仍可滚动，避免宽表被裁切 */
.table-wrap.wrap-scroll{ max-height:calc(100vh - 360px); min-height:280px; overflow:auto; }
/* 审核放行单（A4 打印）：按模板排版（抬头/物料信息/12项审核表/审核结论/是否放行/备注），小四字体、行高撑满 A4 */
.report-sheet.rel-sheet{ min-height:auto; }
.report-sheet.rel-sheet .rs-brand{ padding:18px 24px 8px; font-size:16pt; }
.report-sheet.rel-sheet .rel-title{ text-align:center; font-size:16pt; letter-spacing:6px; padding:10px 24px 6px; color:#000; font-weight:800 !important; }
.report-sheet.rel-sheet .rel-no{ text-align:right; padding:2px 24px 10px; font-size:12pt; color:#000; }
.report-sheet.rel-sheet table{ width:100%; border-collapse:collapse; table-layout:fixed; }
.report-sheet.rel-sheet table td{ border:1px solid #000; padding:3px 6px; font-size:10.5pt; color:#000; text-align:center; word-break:break-all; }
.report-sheet.rel-sheet table td.lb{ background:#fff; font-weight:normal !important; white-space:nowrap; }
.report-sheet.rel-sheet table td.l{ text-align:left; }
/* 所有表格线统一 1px（含外框）：border-collapse 合并渲染，打印与 PDF 导出均稳定；三表相接处上一表末行去底边避免叠加 */
.report-sheet.rel-sheet .rel-info tr:last-child td{ border-bottom:0; }
.report-sheet.rel-sheet .rel-audit tr:last-child td{ border-bottom:0; }
.report-sheet.rel-sheet .rel-audit td.res{ text-align:center; white-space:nowrap; }
.report-sheet.rel-sheet .rel-info tr{ height:50px; }
.report-sheet.rel-sheet .rel-info td{ padding:10px 8px; }
.report-sheet.rel-sheet .rel-info td.v{ text-align:center; }
.report-sheet.rel-sheet .rel-audit tr{ height:33px; }
.report-sheet.rel-sheet .rel-audit td{ padding:3px 4px; line-height:1.3; }
.report-sheet.rel-sheet .rel-audit td.l{ text-align:left; }
.report-sheet.rel-sheet .rel-audit tr.h td{ font-weight:normal !important; background:#fff; }
.report-sheet.rel-sheet .rel-foot tr{ height:42px; }
.report-sheet.rel-sheet .rel-foot tr:last-child{ height:98px; }
.report-sheet.rel-sheet .rel-foot td{ padding:10px 8px; }
.report-sheet.rel-sheet .rel-foot td.v{ text-align:center; }
#print-acc .report-sheet.rel-sheet{ min-height:auto; }
/* 连体表格（与 Word 导出一致的 10 列网格）：信息区 40px、审核区 32px、页脚 34px、备注 60px（一页内放下） */
.report-sheet.rel-sheet .rel-all tr{ height:34px; }
.report-sheet.rel-sheet .rel-all tr.h1{ height:40px; }
.report-sheet.rel-sheet .rel-all tr.h{ height:32px; }
.report-sheet.rel-sheet .rel-all tr:last-child{ height:60px; }
.report-sheet.rel-sheet .rel-all td.res{ white-space:nowrap; }
/* 大号复选符号（大于正文，紧凑行高避免撑高行，打印一页内放下） */
.report-sheet.rel-sheet .chk{ font-size:14pt; line-height:1; }
/* 放行审核单导出 PDF：覆盖屏幕左右内边距，版心铺满 186mm */
.qcr-pdf-draw .report-sheet.rel-sheet{
  height:273mm; min-height:273mm; max-height:273mm; overflow:hidden;
  display:flex; flex-direction:column;
}
.qcr-pdf-draw .report-sheet.rel-sheet .rs-brand{ padding:8px 0 0; font-size:10.5pt; }
.qcr-pdf-draw .report-sheet.rel-sheet .rel-title{ padding-left:0; padding-right:0; font-size:16pt; }
.qcr-pdf-draw .report-sheet.rel-sheet .rel-no{ padding-left:0; padding-right:0; font-size:10.5pt; }
.qcr-pdf-draw .report-sheet.rel-sheet table.rel-all{ width:100%; margin:0; flex:1; }
.qcr-pdf-draw .report-sheet.rel-sheet .rel-all tr,
.qcr-pdf-draw .report-sheet.rel-sheet .rel-all tr.h1,
.qcr-pdf-draw .report-sheet.rel-sheet .rel-all tr.h,
.qcr-pdf-draw .report-sheet.rel-sheet .rel-all tr:last-child{ height:auto; }
.grid-acc th.col-date, .grid-acc td.col-date{ min-width:96px; font-variant-numeric:tabular-nums; }
.grid-acc th.col-op, .grid-acc td.col-op{ width:62px; min-width:62px; text-align:center; overflow:visible; white-space:normal; }
/* 操作列按钮压缩高度，避免撑高数据行（行高由 JS 均分控制） */
.grid-acc td.col-op .btn { height:22px; line-height:20px; padding:1px 8px; font-size:12px; min-width:0; }
.grid-acc tbody td.num-r{ text-align:center !important; }
.grid-acc td:hover{ overflow:visible; }
/* 留样管理台账列表：表头与内容居中、长内容自动换行；列宽固定（固定布局 + 显式列宽，
   纸张/屏幕窄时由 .table-wrap 横向滚动，避免列被压到无法阅读）；
   样品名称列 width:auto 吸收剩余宽度，保证表格始终占满卡片 */
table.grid.sl-grid{ table-layout:fixed; }
table.grid.sl-grid th, table.grid.sl-grid td{ text-align:center; white-space:normal; word-break:break-all; vertical-align:middle; }
table.grid.sl-grid th:nth-child(1),  table.grid.sl-grid td:nth-child(1){ width:44px; }
table.grid.sl-grid th:nth-child(2),  table.grid.sl-grid td:nth-child(2){ width:100px; white-space:nowrap; }
table.grid.sl-grid th:nth-child(3),  table.grid.sl-grid td:nth-child(3){ width:auto; min-width:140px; }
table.grid.sl-grid th:nth-child(4),  table.grid.sl-grid td:nth-child(4){ width:84px; }
table.grid.sl-grid th:nth-child(5),  table.grid.sl-grid td:nth-child(5){ width:160px; white-space:nowrap; }
table.grid.sl-grid th:nth-child(6),  table.grid.sl-grid td:nth-child(6){ width:96px; white-space:nowrap; }
table.grid.sl-grid th:nth-child(7),  table.grid.sl-grid td:nth-child(7){ width:84px; }
table.grid.sl-grid th:nth-child(8),  table.grid.sl-grid td:nth-child(8){ width:56px; }
table.grid.sl-grid th:nth-child(9),  table.grid.sl-grid td:nth-child(9){ width:auto; min-width:150px; }
table.grid.sl-grid th:nth-child(10), table.grid.sl-grid td:nth-child(10){ width:94px; white-space:nowrap; }
table.grid.sl-grid th:nth-child(11), table.grid.sl-grid td:nth-child(11){ width:102px; white-space:nowrap; }
table.grid.sl-grid th:nth-child(12), table.grid.sl-grid td:nth-child(12){ width:96px; white-space:nowrap; }
table.grid.sl-grid th:nth-child(13), table.grid.sl-grid td:nth-child(13){ width:88px; white-space:nowrap; }
.tw-acc{ overflow:auto; }
/* 验收台账：压缩统计块与分页条，抬高列表容器（仅台账页生效，不影响其他模块） */
#acc-tabs + .stat-grid { margin-bottom: 10px; }
#acc-tabs + .stat-grid .stat { padding: 8px 14px; }
#acc-tabs + .stat-grid .stat .num { font-size: 21px; margin: 2px 0 1px; }
#acc-tabs + .stat-grid + .card .pager { padding-top: 8px; }
/* 验收台账：省略单元格悬停浮窗（显示完整内容） */
.cell-tip{
  position:fixed; z-index:9999; display:none; pointer-events:none;
  background:#2b3a4a; color:#fff; font-size:12.5px; line-height:1.5;
  padding:8px 10px; border-radius:6px; box-shadow:0 4px 14px rgba(0,0,0,.25);
  max-width:320px; white-space:normal; word-break:break-all;
}