/* ==================== z881 换肤：品牌色变量 ====================
   默认（:root）= 原蓝色主色 #204df3 系，视觉与改造前一致；
   <html> 带 .theme-grass 时切到草绿系（#b1cc5d 草绿 + #3d4a17 深橄榄，扁平化）。
   切换入口：侧栏底部「换肤」按钮 → toggleTheme()，状态存 localStorage['lvdu_theme']。 */
:root {
  --brand:        #204df3;  /* 主色：实心按钮底、强调文字、链接、图标 */
  --brand-strong: #144d8a;  /* 深一档：hover / 选中态强调 */
  --brand-soft:   #e3e9fd;  /* 浅底：标签、选中行、提示块 */
  --brand-pale:   #f2f5ff;  /* 极浅底：hover 背景、区块底 */
  --brand-line:   #d0e0f0;  /* 边框 / 分隔线 */
  --brand-accent: #204df3;  /* 装饰强调块（浅底场景用） */
  --brand-deep:   #1a2b40;  /* 最深：大字标题、深色徽章 */
  --brand-on:     #ffffff;  /* 主色底之上的文字色 */
}
html.theme-grass {
  --brand:        #5f8c16;  /* 草绿主色（白字对比 ≈4.0，可读） */
  --brand-strong: #4a6f11;  /* hover 深草绿 */
  --brand-soft:   #e7f2c8;  /* 浅草绿底 */
  --brand-pale:   #f4fae8;  /* 极浅草绿底 */
  --brand-line:   #c9dd9b;  /* 草绿边框 */
  --brand-accent: #b1cc5d;  /* 亮草绿（配深字，装饰/标签） */
  --brand-deep:   #3d4a17;  /* 深橄榄（R2 定版，看板按钮/徽章/正文） */
  --brand-on:     #ffffff;
}
/* z486（2026-09-07）：制作报价单 / 制作合同 —— 页面样式（含 A4 预览与打印） */
/* z875（陶总 2026-10-30）：绿色系统一到青绿调 #06aca0（色相 176°），明度保留不变 */
* { box-sizing: border-box; }
/* z864（陶总 2026-10-30）：制作表单页底色也统一成工作台那片「浅灰蓝 → 白」渐变 */
/* z898（陶总 2026-10-31，方案A）：底色改成与工作台主站同一片品牌蓝渐变，不再留白 */
html {
  background-color: #dbe6fc;
  background-image: linear-gradient(180deg, #eff4ff 0%, #e4edfd 45%, #d6e2fc 100%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}
html.theme-grass {
  background-color: #e6f0cd;
  background-image: linear-gradient(180deg, #f6fbe9 0%, #edf5d6 45%, #e0ecc2 100%);
}
body.docs-body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, sans-serif;
  background: transparent;
  color: #222;
  font-size: 14px;
}
/* z626（陶总 2026-09-15）：顶栏对齐工作台其他页面的 .topbar 样式——
   56px 高蓝条不折行、品牌 18px 可点回工作台 + 副标题、按钮层次（主=白底实心 / 次=透明白描边） */
/* z898：顶栏由「整条深蓝大色块」改为白底浅色顶栏 —— 与工作台主站同一套语言：
   白底 + 细分隔线 + 轻阴影；tab 与按钮统一成浅品牌蓝胶囊，主操作实底。 */
.docs-top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px; flex-wrap: nowrap;
  padding: 0 24px; height: 56px;
  background: #ffffff; color: #1f2a4d;
  border-bottom: 1px solid #e6ecf7;
  box-shadow: 0 1px 3px rgba(23, 43, 77, .05);
}
.docs-top .brand { font-size: 17px; font-weight: 600; color: #1f2a4d; text-decoration: none; white-space: nowrap; }
.docs-top .brand .brand-sub { font-size: 13px; font-weight: 400; color: #7c879d; margin-left: 8px; }
/* z914（陶总 2026-11-01）：logo 与三个 tab 之间拉开距离 —— 删掉「制作表单」副标题后
   dtabs 直接贴着 logo，观感太挤；.docs-top 的 12px gap 之外再补 20px。 */
.dtabs { display: flex; gap: 8px; margin-left: 20px; }
.dtab {
  padding: 7px 16px; border: none; background: #e9effe;
  color: #1f2a4d; border-radius: 14px; cursor: pointer; font-size: 13px; font-weight: 500;
}
.dtab:hover { background: #dbe5fc; }
.dtab.active { background: var(--brand); color: #ffffff; }
.dtab.active:hover { background: var(--brand); }
.docs-top .spacer { flex: 1; }
/* 窄屏允许折行，避免按钮挤出屏幕 */
@media (max-width: 1100px) {
  .docs-top { height: auto; flex-wrap: wrap; padding: 10px 16px; }
}
.dbtn {
  padding: 7px 14px; border-radius: 8px; border: none;
  background: #e9effe; color: #1f2a4d; cursor: pointer; font-size: 13px; font-weight: 500;
}
.dbtn:hover { background: #dbe5fc; }
.dbtn.primary { background: var(--brand); color: #ffffff; }
.dbtn.primary:hover { background: var(--brand-strong); }
.dbtn.dark { background: #e9effe; color: #1f2a4d; border: none; }
.dbtn.dark:hover { background: #dbe5fc; }
/* 存入抬头库：品牌绿（与全站绿统一） */
.dbtn.lib { background: #0e9d92; color: #ffffff; }
.dbtn.lib:hover { background: #0b8a80; }
/* z541：保存成功时顶栏「保存单据」按钮短暂变绿，给出可见反馈 */
.docs-top .dbtn.ok { background: #e3f5f2; color: #0e9d92; border: none; font-weight: 600; }

/* z900（陶总 2026-10-31）：左表单卡高度改由 JS 精确同步右侧 A4 纸高度（docs.js 末尾）——
   之前用 flex stretch 会连"表单自身内容超过纸高"也一起拉长，导致左边比纸还长。
   现在规则：卡高=纸高，内容多时卡内滚动，内容少时贴齐纸长；≤1100px 移动端不生效。 */
.docs-main { display: flex; gap: 16px; padding: 16px; align-items: flex-start; }
.docs-form {
  width: 430px; flex: 0 0 430px; background: #fff; border-radius: 14px; padding: 16px 18px;
  box-shadow: 0 2px 10px rgba(23, 43, 77, .08); overflow-y: auto;
}
.docs-preview { flex: 1; min-width: 0; overflow: auto; }

.fsec { border-top: 1px solid #eef2f8; padding-top: 12px; margin-top: 14px; }
.fsec:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.fsec-title { font-size: 13px; font-weight: 600; color: #1f2a4d; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.fsec-title::before { content: ''; width: 3px; height: 13px; border-radius: 2px; background: var(--brand); flex: none; }
.fsec-title .grow { flex: 1; }
.frow { display: flex; gap: 8px; margin-bottom: 8px; }
.frow > label { flex: 1; display: block; font-size: 12px; color: #666; }
.frow > label span { display: block; margin-bottom: 3px; }
input.f-input, select.f-input, textarea.f-input {
  width: 100%; padding: 7px 9px; border: 1px solid #e2e8f2; border-radius: 8px; font-size: 13px;
  font-family: inherit; background: #fff; color: #222; transition: border-color .15s, box-shadow .15s;
}
input.f-input:focus, select.f-input:focus, textarea.f-input:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(67, 112, 250, .12);
}
textarea.f-input { resize: vertical; min-height: 52px; }
.hint { font-size: 11px; color: #999; margin-top: 3px; }
/* z498l（陶总 2026-09-08）：客户切换后 4 字段若已填且与新客户不一致，按陶总"不动那 4 个框"原则
   仅加红框 class 视觉提示，让用户一眼看出"该字段是上一客户残留，需清空或确认"。 */
input.f-input.stale { border-color: #e53935; background: #fff5f5; }
input.f-input.stale:focus { outline: none; border-color: #c62828; box-shadow: 0 0 0 2px rgba(229,57,53,.18); }

/* z523：z521 浮层原挂在 .frow 下但 .frow 无 relative，absolute 锚到表单顶部盖住输入框。
   现包 .cust-wrap 定位容器，浮层 top:100% 固定在输入框正下方。 */
.cust-wrap { position: relative; flex: 1; min-width: 0; }
.cust-sug {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  margin-top: 2px;
  background: #fff;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
  max-height: 320px;
  overflow-y: auto;
  min-width: 100%;
  font-size: 13px;
}
.cust-sug-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
}
.cust-sug-item:last-child { border-bottom: none; }
.cust-sug-item:hover,
.cust-sug-item.active { background: var(--brand-pale); }
.cust-sug-main {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 2px;
}
.cust-sug-badge {
  display: inline-block;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 500;
  color: var(--brand);
  background: var(--brand-pale);
  border-radius: 3px;
}
.cust-sug-sub {
  color: #6b7280;
  font-size: 12px;
  line-height: 1.45;
}
/* z626：抬头库浮层项的「删除」按钮（悬停整行可见，onmousedown 触发避让 blur） */
.cust-sug-item { position: relative; padding-right: 30px; }
.cust-sug-del {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: #c62828; font-size: 16px;
  cursor: pointer; padding: 2px 6px; line-height: 1;
}
.cust-sug-del:hover { background: #fff5f5; border-radius: 4px; }
/* 让含 f-customer 的 label 作为浮层定位上下文 */
.frow label:has(.cust-sug),
.frow > label { position: relative; }
/* z496+：税号行“抓税号”按钮 */
.tax-wrap { display: flex; gap: 6px; align-items: center; }
.tax-wrap .f-input { flex: 1; }
.dbtn.mini.tax-fetch {
  flex: 0 0 auto; padding: 5px 10px; font-size: 12px; white-space: nowrap;
  background: var(--brand); color: #fff; border: 1px solid var(--brand); border-radius: 5px; cursor: pointer;
}
.dbtn.mini.tax-fetch:hover { background: var(--brand-strong); }
.dbtn.mini.tax-fetch:disabled { background: var(--brand-line); border-color: var(--brand-line); cursor: default; }

/* z544（陶总 2026-09-11）：产品明细由「一行 6 列表格」改为「两行卡片」——
   第1行：产品名 1fr + 规格 2fr（＝1/3 : 2/3）；第2行：数量|单位|单价|金额 四等分 + 删除按钮。
   表格（table.items/th/td）相关样式随之废弃，字段名挪到每个输入框上方的小灰字 .ilab。 */
.items { margin-top: 6px; }
.item-card { border: 1px solid #e6eaf0; border-radius: 8px; padding: 8px; background: #fafbfd; }
.item-card + .item-card { margin-top: 8px; }
.ir { display: grid; gap: 8px; align-items: end; }
.ir1 { grid-template-columns: 1fr 2fr; }
.ir2 { grid-template-columns: repeat(4, 1fr) 26px; margin-top: 7px; }
.if { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ilab { font-size: 11px; color: #888; font-weight: 500; line-height: 1.2; }
.items input { width: 100%; padding: 5px 6px; border: 1px solid #dfe3e8; border-radius: 4px; font-size: 12px; background: #fff; }
.items .amt { font-size: 12px; color: #333; padding: 6px 2px; text-align: right; }
.delbtn { border: 0; background: transparent; color: #c62828; cursor: pointer; font-size: 16px; padding: 0; height: 30px; }
.addbtn {
  margin-top: 8px; width: 100%; padding: 7px; border: 1px dashed var(--brand); color: var(--brand);
  background: var(--brand-pale); border-radius: 6px; cursor: pointer; font-size: 13px;
}
.total-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; padding-top: 8px; border-top: 2px solid var(--brand); }
.total-row .lab { font-size: 13px; color: #555; }
.total-row .val { font-size: 20px; font-weight: 700; color: #c62828; }
.total-cn { font-size: 12px; color: #777; text-align: right; margin-top: 2px; }

/* ---------- z624：送货单 ---------- */
/* 明细行第二行：送货单为 数量|单位|备注（3列）替代报价单的 数量|单位|单价|金额（4列） */
.item-card.is-delivery .ir2 { grid-template-columns: repeat(3, 1fr) 26px; }
/* 产品名/规格输入框的工单搜索浮层（锚在各自输入框正下方；.if 已是 flex 容器，加 relative 定位） */
.if { position: relative; }
.item-sug {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 25; margin-top: 2px;
  background: #fff; border: 1px solid #d0d7de; border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,.1); max-height: 260px; overflow-y: auto;
  font-size: 12px; min-width: 100%;
}
.item-sug-item { padding: 6px 10px; cursor: pointer; border-bottom: 1px solid #f0f0f0; }
.item-sug-item:last-child { border-bottom: none; }
.item-sug-item:hover { background: var(--brand-pale); }
.item-sug-main { font-weight: 600; color: #1a1a1a; margin-bottom: 1px; }
.item-sug-sub { color: #6b7280; font-size: 11px; line-height: 1.4; }
/* 历史单据抽屉的送货单类型徽标 */
.dr-type.delivery { background: linear-gradient(135deg, #e1f0ef 0%, #eff6f5 100%); color: #05968b; }

.seg { display: inline-flex; border: 1px solid #ccd2d9; border-radius: 6px; overflow: hidden; }
.seg button { padding: 6px 14px; border: 0; background: #fff; cursor: pointer; font-size: 13px; color: #555; }
.seg button.active { background: var(--brand); color: #fff; font-weight: 700; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #444; cursor: pointer; }
.mini { font-size: 12px; padding: 4px 10px; }

/* ---------- A4 纸张 ---------- */
.paper {
  width: 210mm; min-height: 297mm; margin: 0 auto 24px; background: #fff;
  padding: 16mm 15mm 14mm; box-shadow: 0 2px 10px rgba(0,0,0,.15);
  font-family: "Microsoft YaHei", "SimSun", serif; color: #000; font-size: 13px; line-height: 1.7;
  position: relative;
}
.p-title { text-align: center; font-size: 24px; font-weight: 700; letter-spacing: 6px; margin: 0 0 4px; }
.p-sub { text-align: center; font-size: 12px; color: #666; margin-bottom: 12px; }
.p-meta { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
/* z626（陶总 2026-09-15）：框线粗细统一——
   旧方案 border-collapse:collapse + td/th position:relative（列宽拖拽手柄需要），
   Chrome 对「塌陷边框 + 定位单元格」会重复/漏画某些边，导致外框粗内线细、粗细不齐。
   改 border-collapse:separate + spacing:0，边只画两向：单元格画 上+左，表格画 右+下，
   每条线（内线与外框）都恰好同宽，任何浏览器渲染一致。
   z628（陶总 2026-09-15 晚）：整体再改细——1px → 0.5pt（≈0.67px，打印即 0.5 磅细线）。
   【屏幕上看着粗细不一的原理】预览/打印预览是按屏幕分辨率**栅格化**的：A4(794px) 在窗口里
   缩放显示时，每条 1px 线落在不同的设备像素边界上，Chrome 逐条独立取整——有的画成 1 格、
   有的画成 2 格，看着就粗细不齐；下载的 PDF 是**矢量**，线宽是精确的几何值，放大看每条都
   一样粗。纯显示层现象，实际文件没有粗细差异。改 0.5pt 后所有线同受缩放、同程度抗锯齿，
   屏幕观感也趋一致，打印出来是更纤细的 0.5 磅标准细线。 */
.p-parties {
  width: 100%; border-collapse: separate; border-spacing: 0; margin-bottom: 10px;
  border-right: 0.5pt solid #333; border-bottom: 0.5pt solid #333;
}
.p-parties td { border: none; border-left: 0.5pt solid #333; border-top: 0.5pt solid #333; padding: 5px 8px; font-size: 12px; vertical-align: top; }
.p-parties td.k { width: 74px; background: #f6f8fa; color: #333; }
.p-table {
  width: 100%; border-collapse: separate; border-spacing: 0; margin: 8px 0;
  border-right: 0.5pt solid #333; border-bottom: 0.5pt solid #333;
}
.p-table th, .p-table td { border: none; border-left: 0.5pt solid #333; border-top: 0.5pt solid #333; padding: 6px 6px; font-size: 12px; text-align: center; }
/* z633（陶总 2026-09-15 深夜）：数字/英文段放大到与汉字视觉等大（见 docs.js viz() 说明）。
   12px 雅黑：汉字字面≈9.8px、数字≈8.7px → 数字段 1.15em(13.8px) 字面≈10.0px 齐平。 */
.p-table td .asc { font-size: 1.15em; }
/* z632（陶总 2026-09-15 晚）：产品表格全部单元格默认居中——规格/备注等长内容列不再左对齐，
   不靠逐格加 class="c"（z546 起一列列补，z631 补规格、z632 干脆整表默认居中，杜绝再漏列）。
   个别列将来要左对齐时再加专属类覆盖。 */
.p-table th { background: #f6f8fa; text-align: center; font-weight: 700; position: relative; }
/* z543（陶总 2026-09-11）：列宽手柄改「无痕 + 整列可拉」——
   1) 平时、悬停**都不画任何竖条**（去掉之前的淡蓝竖线与 hover 变宽效果），只保留 col-resize 光标；
   2) 手柄挂在该列**每一行**单元格的右边缘（略跨过边界 4px，更好抓），
      所以整条列线从上到下任意高度都能拖（原来只有表头那一小段能拖）。
   .p-parties 没有 thead，第一行第2格是 colspan=3，故 td 也要 relative。 */
.p-table .resizer,
.p-parties .resizer {
  position: absolute; top: 0; right: -4px; width: 9px; height: 100%;
  cursor: col-resize; user-select: none; background: none; z-index: 3;
}
.p-table td,
.p-parties td { position: relative; }
.p-table td.c { text-align: center; }
.p-table td.r { text-align: right; }
.p-total { font-size: 13px; text-align: right; padding: 6px 2px; }
.p-total b { font-size: 15px; }
.p-cn { font-size: 12px; text-align: right; padding-bottom: 6px; }
.p-note { font-size: 12px; margin: 6px 0; white-space: pre-wrap; }
.p-clause { font-size: 12.5px; white-space: pre-wrap; margin: 8px 0; }
.p-clause .ph { background: #fff6d5; }
.p-sign { display: flex; justify-content: space-between; margin-top: 26px; font-size: 12.5px; }
.p-sign .box { width: 46%; }
.p-sign .line { margin: 26px 0 6px; border-bottom: 1px solid #333; height: 1px; }
.p-stamp { position: relative; }
.p-stamp img { position: absolute; right: 6mm; top: -14mm; width: 42mm; opacity: .92; pointer-events: none; }
.p-footer { margin-top: 14px; padding-top: 6px; border-top: 1px solid #ccc; font-size: 11px; color: #555; }
.p-empty { color: #bbb; }

@media (max-width: 1100px) {
  .docs-main { flex-direction: column; }
  .docs-form { width: 100%; flex: none; max-height: none; }
  .docs-preview { width: 100%; }
  .paper { zoom: .62; }
}
@media (max-width: 620px) { .paper { zoom: .46; } }

/* ---------- z540：历史单据抽屉（保存 / 查阅 / 复制为新单） ---------- */
.docs-drawer-mask { position: fixed; inset: 0; background: rgba(0,0,0,.28); z-index: 60; }
.docs-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 380px; max-width: 92vw; z-index: 61;
  background: #fff; box-shadow: -4px 0 18px rgba(0,0,0,.16);
  display: flex; flex-direction: column;
}
.dr-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  border-bottom: 1px solid #e6e8eb; font-size: 14px;
}
.dr-head .dr-grow { flex: 1; }
.dr-close { border: 0; background: transparent; font-size: 22px; line-height: 1; color: #888; cursor: pointer; padding: 0 4px; }
.dr-close:hover { color: #333; }
.dr-tools { display: flex; gap: 8px; padding: 10px 14px; border-bottom: 1px solid #f0f2f5; }
.dr-tools .f-input { font-size: 13px; }
.dr-tools select.f-input { flex: 0 0 96px; }
/* z644（陶总 2026-09-16）：「新增抬头」改成实心蓝底白字（同对账页「导出对账单」btn-statement 观感） */
.dbtn.add-title { background: var(--brand-strong); color: #fff; border: none; border-radius: 8px; height: 36px; padding: 0 14px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.dbtn.add-title:hover { background: var(--brand-strong); }
.dbtn.add-title:active { transform: scale(0.97); }
/* z638（陶总 2026-09-15）：抬头库「新增」按钮 —— 蓝底白字，只显示一个加号 */
.dbtn.plus {
  flex: 0 0 34px; padding: 0; font-size: 20px; line-height: 32px; text-align: center;
  background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 700; border-radius: 6px;
}
.dbtn.plus:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.dr-list { flex: 1; overflow-y: auto; padding: 8px 14px 20px; }
.dr-empty { color: #999; font-size: 13px; text-align: center; padding: 28px 0; }
.dr-item { border: 1px solid #e6e8eb; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: var(--brand-pale); }
.dr-main { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.dr-main b { font-size: 13px; }
.dr-type {
  font-size: 11px; padding: 1px 7px; border-radius: 3px; background: var(--brand-pale); color: var(--brand);
}
.dr-type.contract { background: #fdf0e6; color: #b26a1a; }
/* ===== z841（陶总 2026-10-21）：我方抬头标记（绿都 / 正典）=====
   跟在「合同/报价单」标签旁，一眼看出这张单是我方哪个主体开的（按票种自动判）。
   配色刻意与 dr-type（橙/蓝）区分，用中性深灰，不抢类型标签。 */
.dr-our {
  margin-left: 6px; padding: 1px 7px; border-radius: 3px;
  background: #eef0f3; color: #4a5568; font-size: 11px; border: 1px solid #d5dae1;
}
.dr-amt { margin-left: auto; font-weight: 700; color: #c62828; }
.dr-sub { font-size: 12px; color: #666; margin-top: 4px; line-height: 1.5; }
.dr-time { color: #aaa; font-size: 11px; }
.dr-acts { display: flex; gap: 6px; margin-top: 8px; }
.dr-acts .dbtn.mini {
  border: 1px solid #ccd2d9; background: #fff; color: #333; border-radius: 5px; cursor: pointer; padding: 4px 10px; font-size: 12px;
}
.dr-acts .dbtn.mini:hover { background: var(--brand-pale); border-color: var(--brand); color: var(--brand); }
.dr-acts .dbtn.mini.danger { color: #c62828; }
.dr-acts .dbtn.mini.danger:hover { background: #fff5f5; border-color: #c62828; color: #c62828; }

/* ---------- z627：抬头库管理抽屉（查看/新增/编辑/删除，右上角「抬头库」入口） ---------- */
.tlib-form { padding: 12px 14px; border-bottom: 1px solid #e6e8eb; background: var(--brand-pale); }
.tlib-form-title { font-size: 13px; font-weight: 700; color: var(--brand); margin-bottom: 8px; }
.tlib-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.tlib-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #556; }
.tlib-grid .f-input { font-size: 13px; padding: 6px 8px; }
.tlib-form-btns { display: flex; gap: 8px; margin-top: 10px; }
.tlib-form-btns .dbtn { padding: 6px 18px; }
.tlib-item .dr-main b { font-size: 14px; }
.tlib-item .dr-acts { margin-top: 6px; }

@media print {
  html { background: #fff !important; background-image: none !important; }
  body.docs-body { background: #fff; }
  .docs-top, .docs-form, .docs-drawer, .docs-drawer-mask, .no-print { display: none !important; }
  .resizer { display: none !important; }
  .docs-main { padding: 0; display: block; }
  .docs-preview { overflow: visible; }
  .paper { zoom: 1; width: 210mm; min-height: auto; margin: 0; padding: 14mm 14mm 10mm; box-shadow: none; }
  .p-clause .ph { background: transparent; color: #000; }
  @page { size: A4; margin: 0; }
}

/* ============================================================
   z908/z910（陶总 2026-10-31~11-01）：顶栏品牌区换真 logo
   · z910 修复「整个顶上都乱了」：z908 把 logo 设了 display:block + 白 chip ——
     顶栏 z898 起是**白底**（白 chip 看不见），block 又把后面的「制作表单」副标题
     挤到第二行、撑破 56px 顶栏。改为：.brand 走 inline-flex 一行排列，
     logo 高 30px、透明底直接放（PNG 本身白底字，白栏上就是原生观感）、不换行。
   · img 加载成功 → .js-brand 容器加 has-logo → 显示 logo、隐藏品牌文字回退；
   · 失败/未配置（速印达）→ 显示原「品牌名 + 制作表单」文字。链接 href="/" 可点回首页。
   ============================================================ */
.docs-top .brand { display: inline-flex; align-items: center; white-space: nowrap; }
.brand .inst-logo {
  display: none;
  height: 24px;
  width: auto;
}
.brand.has-logo .inst-logo { display: inline-block; }
.brand.has-logo .brand-txt { display: none; }

/* ============================================================
   z1257（陶总 2026-11-24）：盖章并入制作表单（第 4 个 tab）—— seal.html 独立页撤销，
   原页专属样式整体搬入 docs.css（颜色/圆角/阴影取自品牌变量与既有卡片语言）。
   表单结构复用 .fsec/.fsec-title/.frow/.f-input/.dbtn，不另起一套。
   ============================================================ */
.seal-mode .docs-only { display: none !important; }   /* 盖章 tab 下隐藏单据类按钮（保存单据/历史单据/抬头库/打印） */
.seal-form { max-height: calc(100vh - 88px); overflow-y: auto; }
/* 文件上传/已选文件 */
.drop { border: 2px dashed var(--brand-line); border-radius: 10px; padding: 24px 14px; text-align: center; color: #8a94a8; cursor: pointer; transition: all .15s; font-size: 13px; line-height: 1.7; background: #fff; }
.drop:hover, .drop.drag { border-color: var(--brand); background: var(--brand-pale); color: var(--brand); }
.drop b { color: var(--brand); word-break: break-all; }
.file-row { display: none; align-items: center; gap: 8px; margin-top: 8px; }
.file-row.has { display: flex; }
.file-row .fname { flex: 1; min-width: 0; font-size: 12.5px; color: #1f2a4d; word-break: break-all; }
.file-row .fsize { font-size: 12px; color: #999; flex: none; }
.file-row .f-del { flex: none; border: none; background: #fdecec; color: #d64541; border-radius: 7px; padding: 5px 12px; font-size: 12px; cursor: pointer; }
.file-row .f-del:hover { background: #f9dcdc; }
/* 抬头章卡片 */
.seal-cards { display: flex; gap: 10px; }
.seal-card { flex: 1; border: 1.5px solid var(--brand-line); border-radius: 10px; padding: 10px; text-align: center; cursor: pointer; transition: all .15s; background: #fff; }
.seal-card img { width: 74px; height: 74px; object-fit: contain; display: block; margin: 0 auto 6px; }
.seal-card .nm { font-size: 12px; line-height: 1.4; color: #1f2a4d; }
.seal-card.on { border-color: var(--brand); background: var(--brand-pale); box-shadow: 0 0 0 2px rgba(32, 77, 243, .10); }
/* 主按钮：品牌实底（与 .dbtn.primary 同源），占满整行 */
.btn-stamp { width: 100%; height: 40px; font-size: 14px; font-weight: 600; margin-top: 4px; }
.btn-stamp:disabled { background: #b9c8f2; cursor: not-allowed; }
.err { color: #d64541; font-size: 12.5px; margin-top: 8px; line-height: 1.5; word-break: break-all; display: none; }
/* 右侧预览卡（与左卡同一卡片语言） */
.seal-view { background: #fff; border-radius: 14px; padding: 14px; box-shadow: 0 2px 10px rgba(23, 43, 77, .08); }
.view-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.view-head b { font-size: 14px; color: #1f2a4d; }
.view-head .meta { font-size: 12px; color: #8a94a8; flex: 1; }
.viewer { width: 100%; height: calc(100vh - 150px); min-height: 420px; border: 1px solid #e6ecf7; border-radius: 8px; background: #f7f9fd; display: flex; align-items: center; justify-content: center; color: #8a94a8; font-size: 13px; overflow: hidden; }
.viewer iframe, .viewer img { width: 100%; height: 100%; border: none; display: block; background: #fff; }
.viewer img { object-fit: contain; }
@media (max-width: 900px) { .seal-form { max-height: none; } .viewer { height: 60vh; } }
