/* =====================================================================
 * 星石销售通 样式 (app.css) — 品牌蓝 #1a5fb4
 * ===================================================================== */
:root {
  --brand: #1a5fb4; --brand-2: #3f8de3; --bg: #eef1f5; --panel: #fff;
  --line: #e3e8ee; --text: #243244; --dim: #7b8ba1;
  --up: #d92b2b; --down: #159d63; --orange: #e2711d; --purple: #7a4fd0; --teal: #0e8a8a;
  --font: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; font-family: var(--font); font-size: 13px; color: var(--text); background: var(--bg); overflow: hidden; -webkit-font-smoothing: antialiased; }
body { display: flex; flex-direction: column; }
.mono { font-family: Consolas, monospace; }
.dim { color: var(--dim); }
.num-pos, .up { color: var(--up); }
.num-neg { color: var(--down); }
i, em { font-style: normal; }
small { font-size: 11px; color: var(--dim); margin-left: 3px; font-weight: 400; }

/* ---------- 全局「隐藏客户信息」：一键打码客户名称/电话/地址/税号 ----------
   body.mask-on 时只模糊客户侧敏感字段（名称/电话/地址/税号），
   金额、编号、联系人、开户行等我方照常显示；打印走独立 iframe 不受影响。
   打码统一用 .mask-cust（客户名称 + 抬头里的名称/电话/地址/税号）。 */
body.mask-on .mask-cust { filter: blur(4px); }

/* ---------- 截图框选：全屏半透明遮罩 + 十字光标拖拽出矩形 ---------- */
.shot-mask { position: fixed; inset: 0; z-index: 9999; cursor: crosshair; background: transparent; user-select: none; }
.shot-tip { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 10002; padding: 8px 16px; border-radius: 8px; background: rgba(15, 23, 42, .85); color: #fff; font-size: 13px; pointer-events: none; white-space: nowrap; }
.shot-shade { position: fixed; display: none; background: rgba(15, 23, 42, .38); z-index: 10000; pointer-events: none; }
.shot-rect { position: fixed; display: none; border: 2px solid #3f8de3; outline: 1px solid rgba(255, 255, 255, .7); background: transparent; z-index: 10001; pointer-events: none; }

/* ---------- 登录 ---------- */
.login-wrap { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #eaf2fb 0%, #dbe8f8 45%, #cfe0f5 100%); overflow: hidden; }
.login-wrap::before { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(63,141,227,.22), transparent 68%); top: -160px; right: -120px; }
.login-wrap::after { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(26,95,180,.14), transparent 68%); bottom: -140px; left: -100px; }
.login-box { position: relative; width: 420px; max-width: calc(100vw - 24px); background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 24px 60px rgba(23,51,79,.18); z-index: 2; }
.lg-brand { display: flex; align-items: center; gap: 13px; padding: 26px 30px 22px; background: linear-gradient(135deg, #1a5fb4, #3f8de3); color: #fff; }
.lg-logo { width: 52px; height: 52px; border-radius: 17px; background: linear-gradient(135deg, #1a5fb4, #3f8de3); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.lg-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lg-t { font-size: 19px; font-weight: 800; letter-spacing: .5px; }
.lg-edition-badge { display: inline-block; margin-left: 8px; padding: 1px 8px; font-size: 11px; font-weight: 600; letter-spacing: 0; border-radius: 10px; vertical-align: 2px; background: linear-gradient(135deg, #f7d774, #d4a017); color: #5b4300; border: 1px solid rgba(255, 220, 130, .65); box-shadow: 0 1px 4px rgba(0,0,0,.18); }
/* ★ 演示模式角色切换气泡（2026-11-24）：紫色按钮旁的气泡提示（显示在按钮下方，避免被顶栏上边界裁剪） */
.demo-role-switch { position: relative; display: inline-flex; align-items: center; }
.demo-role-bubble { position: absolute; top: calc(100% + 9px); left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 5px 10px; font-size: 12px; line-height: 1; background: #fff; color: #7c3aed; border: 1px solid #7c3aed; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 9999; animation: demoBubbleFloat 2s ease-in-out infinite; }
.demo-role-bubble::before { content: ''; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-bottom-color: #fff; }
@keyframes demoBubbleFloat { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-4px); } }
/* ★ 旧数据迁移引导气泡（2026-11-24）：紧贴「旧数据迁移」入口卡片下方，白底紫边，可换行 */
.wq-migrate { position: relative; }
.wq-migrate .demo-migrate-bubble { position: absolute; top: calc(100% + 9px); right: 0; width: 230px; padding: 7px 10px; font-size: 12px; line-height: 1.5; background: #fff; color: #7c3aed; border: 1px solid #7c3aed; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 9999; animation: demoMigrateFloat 2s ease-in-out infinite; text-align: left; white-space: normal; word-break: break-all; }
.wq-migrate .demo-migrate-bubble::before { content: ''; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-bottom-color: #fff; }
@keyframes demoMigrateFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
/* ★ 导入发票引导气泡（2026-11-24）：紧贴「导入发票」按钮下方，白底蓝边，可换行 */
.demo-imp-wrap .demo-imp-bubble { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: 240px; padding: 7px 10px; font-size: 12px; line-height: 1.5; background: #fff; color: #1a5fb4; border: 1px solid #1a5fb4; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 9999; animation: demoMigrateFloat 2s ease-in-out infinite; text-align: left; white-space: normal; word-break: break-all; }
.demo-imp-wrap .demo-imp-bubble::before { content: ''; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-bottom-color: #fff; }
.lg-s { font-size: 11px; opacity: .85; margin-top: 2px; }
.lg-slogan { text-align: center; font-size: 19px; font-weight: 700; letter-spacing: 3px; color: #1a5fb4; padding: 14px 30px 4px; }
.lg-form { padding: 24px 30px 8px; }
.lg-row { margin-bottom: 14px; }
.lg-row label { display: block; font-size: 12.5px; color: #4a5f75; margin-bottom: 5px; font-weight: 600; }
.lg-row input, .lg-row select { width: 100%; height: 36px; border: 1px solid #ccd8e5; border-radius: 5px; padding: 0 10px; font-size: 13.5px; outline: none; }
.lg-row input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(63,141,227,.16); }
.lg-btn { width: 100%; height: 40px; font-size: 14.5px; font-weight: 700; letter-spacing: 3px; margin-top: 6px; }
.lg-tip { text-align: center; font-size: 11.5px; color: #93a4b6; padding: 12px 0 4px; line-height: 1.8; }
.lg-demo-label { color: #7a8a9c; }
.lg-demo-item { color: #3f8de3; text-decoration: none; cursor: pointer; }
.lg-demo-item:hover { color: #1a5fb4; text-decoration: underline; }
.lg-foot { padding: 12px 30px; border-top: 1px solid #eef2f7; text-align: center; font-size: 11px; color: #9aa9b8; line-height: 1.6; }

/* ---------- 框架 ---------- */
.app-titlebar { height: 46px; background: linear-gradient(120deg, #14528f 0%, #1a5fb4 55%, #2f7fd8 100%); color: #fff; display: flex; align-items: center; padding: 0 14px; gap: 12px; flex: 0 0 auto; }
.tb-logo { width: 30px; height: 30px; border-radius: 8px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.4); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; }
.tb-title { font-size: 15.5px; font-weight: 800; letter-spacing: .5px; }
.tb-sub { font-size: 11px; opacity: .8; }
.tb-spacer { flex: 1; }
.tb-info { display: flex; gap: 14px; font-size: 12px; }
.tb-info b { font-weight: 600; }
.tb-user { display: flex; align-items: center; gap: 7px; background: rgba(255,255,255,.13); padding: 4px 11px; border-radius: 20px; font-size: 12.5px; }
.tu-avatar { width: 22px; height: 22px; border-radius: 50%; background: #fff; color: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; }
.tb-exit { cursor: pointer; opacity: .85; font-size: 12px; }
.tb-exit:hover { opacity: 1; text-decoration: underline; }

.menubar { height: 38px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: stretch; padding: 0 8px; flex: 0 0 auto; overflow-x: auto; }
.mn-item { display: flex; align-items: center; gap: 5px; padding: 0 15px; cursor: pointer; font-size: 13.5px; color: #3d4f66; border-bottom: 2.5px solid transparent; white-space: nowrap; user-select: none; }
.mn-item:hover { background: #f3f7fc; }
.mn-item.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 700; }

.app-main { flex: 1; display: flex; min-height: 0; }
.tabsbar { display: none; height: 34px; background: #f6f8fa; border-bottom: 1px solid var(--line); align-items: flex-end; padding: 0 8px; gap: 2px; overflow-x: auto; flex: 0 0 auto; }
.tab { display: flex; align-items: center; gap: 6px; padding: 6px 10px 6px 13px; background: #eceff3; border: 1px solid var(--line); border-bottom: none; border-radius: 6px 6px 0 0; font-size: 12.5px; cursor: pointer; white-space: nowrap; color: #54677e; }
.tab.on { background: #fff; color: var(--brand); font-weight: 700; }
.tab-x { width: 15px; height: 15px; display: flex; align-items: center; justify-content: center; border-radius: 3px; font-size: 10px; color: #9aa9b8; }
.tab-x:hover { background: #d92b2b; color: #fff; }
.panels { flex: 1; position: relative; overflow: hidden; min-height: 0; }
.panel { position: absolute; inset: 0; overflow: auto; padding: 12px; display: none; }
.panel.on { display: block; animation: panelfade .14s ease; }
@keyframes panelfade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.statusbar { height: 26px; background: #fff; border-top: 1px solid var(--line); display: flex; align-items: center; padding: 0 14px; gap: 16px; font-size: 11.5px; color: var(--dim); flex: 0 0 auto; }
.statusbar b { color: var(--text); font-weight: 600; }
.st-warn { color: var(--up); font-weight: 600; }

/* ---------- 通用组件 ---------- */
.btn { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 14px; background: #fff; border: 1px solid #c8d3df; border-radius: 5px; font-size: 12.5px; color: #3d4f66; cursor: pointer; user-select: none; white-space: nowrap; }
.btn:hover { border-color: var(--brand-2); color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #2569c4; }
/* 蓝色普通按钮（报价编辑页工具栏等）：与 primary 同色但常规字重，用于突出可点击的操作按钮 */
.btn.blue, .btn.xs.blue { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.blue:hover, .btn.xs.blue:hover { background: #2569c4; border-color: #2569c4; color: #fff; }
.btn.danger { color: var(--up); border-color: #e8b3b3; }
.btn.danger:hover { background: #fdf1f1; }
/* ★ 一键归档按钮（2026-11-19）：橙色醒目 */
.btn.orange { background: #e67e22; border-color: #e67e22; color: #fff; font-weight: 600; }
.btn.orange:hover { background: #d97418; border-color: #d97418; color: #fff; }
.btn.xs { height: 24px; padding: 0 9px; font-size: 11.5px; }
/* 合同列表操作列：「💰未税支出 / ♻️废料收入」并排成一组，紧跟在「🛒采购」下面一行
   （块级 + 居中，两个按钮并排，行距 4px，视觉上就是采购的下一行） */
td .op-pair { display: flex; gap: 4px; justify-content: center; margin-top: 4px; }
td .op-pair > .btn { flex: 0 1 auto; }
.btn.sm { height: 27px; padding: 0 11px; font-size: 12px; }
.btn:active { transform: translateY(1px); }
.btn.primary:active { background: #1a539c; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn, .tab, .mn-item { transition: background .12s, color .12s, border-color .12s; }
.btnbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.tb-sep { width: 1px; height: 16px; background: var(--line); margin: 0 2px; }
.tb-chk { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--text); cursor: pointer; user-select: none; white-space: nowrap; }
.tb-chk input[type="checkbox"] { width: 15px; height: 15px; }
.spacer { flex: 1; }

.querybar { background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.qi > label { display: block; font-size: 11.5px; color: var(--dim); margin-bottom: 4px; }
.qi input, .qi select { height: 30px; border: 1px solid #ccd8e5; border-radius: 5px; padding: 0 9px; font-size: 12.5px; outline: none; min-width: 120px; background: #fff; }
.qi input:focus, .qi select:focus { border-color: var(--brand-2); }
.qi input[type="date"] { min-width: 130px; }
.qacts { margin-left: auto; display: flex; gap: 8px; }

input[type="text"], input[type="search"], input[type="number"], input[type="date"], input[type="password"], input[type="tel"], select, textarea {
  font-family: var(--font); color: var(--text); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-2) !important; box-shadow: 0 0 0 2.5px rgba(63,141,227,.13); }
input[type="checkbox"] { cursor: pointer; }

.card { background: var(--panel); border: 1px solid #aebccd; border-radius: 7px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(36,50,68,.06); }
.card-hd { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid #eef2f7; font-size: 13.5px; font-weight: 700; }
.card-hd .ico { font-size: 14px; }
.card-hd .hd-acts { margin-left: auto; display: flex; gap: 7px; font-weight: 400; }
/* 工资结算按月叠放的分组卡片 */
.settle-grp { margin-bottom: 10px; }
.settle-grp .card-hd { padding: 11px 14px; }
.settle-grp .settle-gtitle { font-size: 15px; letter-spacing: .5px; }
.card-bd { padding: 12px 14px; }
.mt12 { margin-top: 12px; } .mb12 { margin-bottom: 12px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 10px; margin-bottom: 12px; }
/* 分段筛选（我的发票：全部 / 仅票差） */
.seg { display: inline-flex; background: #eef2f7; border-radius: 8px; padding: 3px; gap: 3px; margin-bottom: 12px; }
.seg-btn { border: none; background: transparent; color: var(--dim); padding: 5px 14px; border-radius: 6px; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all .15s; }
.seg-btn.on { background: #fff; color: var(--brand, #2563eb); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
/* 旧数据迁移：上传区卡片美化 */
.mig-zone { border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 4px rgba(15,23,42,.05); transition: box-shadow .18s, border-color .18s, transform .18s; overflow: hidden; }
.mig-zone:hover { border-color: var(--brand-2, #93c5fd); box-shadow: 0 4px 14px rgba(37,99,235,.12); transform: translateY(-1px); }
.mig-zone-hd { background: linear-gradient(135deg, #f8fafc, #f1f5f9); }
.mig-zone-ico { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.mig-sub { font-size: 12px; color: var(--dim); margin-bottom: 10px; line-height: 1.6; }
.mig-zone-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mig-zone-actions .btn.blue { height: 32px; padding: 0 14px; font-size: 13px; border-radius: 7px; }
.mig-file { margin-top: 9px; font-size: 12px; color: var(--dim); font-family: Consolas, "Microsoft YaHei", monospace; word-break: break-all; padding: 6px 8px; background: #f8fafc; border-radius: 6px; border: 1px dashed var(--line); }

.kpi { background: #fff; border: 1px solid var(--line); border-radius: 7px; padding: 11px 14px; position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3.5px; background: var(--brand-2); }
.kpi.red::before { background: var(--up); } .kpi.green::before { background: var(--down); }
.kpi.purple::before { background: var(--purple); } .kpi.orange::before { background: var(--orange); }
.kpi.teal::before { background: var(--teal); }
.k-l { font-size: 11.5px; color: var(--dim); }
.k-v { font-size: 20px; font-weight: 800; margin-top: 3px; font-family: Consolas, "Microsoft YaHei", monospace; letter-spacing: -.3px; }
.k-v small { font-size: 11px; }
.kpi.red .k-v { color: var(--up); } .kpi.green .k-v { color: var(--down); }
.kpi.purple .k-v { color: var(--purple); } .kpi.teal .k-v { color: var(--teal); }
.k-s { font-size: 11px; color: var(--dim); margin-top: 2px; }

/* 表格 */
.tbl-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 7px; background: #fff; max-height: calc(100vh - 200px); }
/* 手机端卡片视图：桌面端默认隐藏，body.m 下由下方规则切换为显示 */
.tcard-list { display: none; }
table.grid { border-collapse: collapse; width: 100%; font-size: 12.5px; }
table.grid th { background: #f5f8fb; color: #4a5b72; font-weight: 600; padding: 8px 10px; border-bottom: 1.5px solid #dde5ed; text-align: left; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
table.grid td { padding: 7px 10px; border-bottom: 1px solid #eef2f6; }
table.grid th.num, table.grid td.num { text-align: right; }
table.grid tbody tr:hover { background: #f4f8fd; }
table.grid tbody tr.clickable { cursor: pointer; }
table.grid tr.total td { background: #f7f9fc; font-weight: 700; border-top: 1.5px solid #dde5ed; }
table.grid.zebra tbody tr:nth-child(even) { background: #dae7f5; }
/* 宽表横向滚动时首列冻结：行标识（编号/名称）始终可见 */
table.grid th:first-child { position: sticky; left: 0; z-index: 3; }
table.grid td:first-child { position: sticky; left: 0; z-index: 2; background: #fff; box-shadow: inset -1px 0 0 #eef2f6; }
table.grid.zebra tbody tr:nth-child(even) td:first-child { background: #dae7f5; }
/* 「我的发票」整页固定布局：顶部（筛选+汇总卡）不动，下方统一滚动，表头 sticky 吸顶 */
.iv-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.iv-scroll { flex: 1; min-height: 0; overflow: auto; }
.iv-scroll .tbl-wrap { max-height: none; overflow: visible; }
table.grid tbody tr:hover td:first-child { background: #f4f8fd; }
/* 已分配高亮：指派给业务员的客户/合同整行淡黄底 */
table.grid tbody tr.row-assigned { background: #fff8e1; }
table.grid.zebra tbody tr.row-assigned:nth-child(even) { background: #fbf0d6; }
table.grid tbody tr.row-assigned td:first-child { background: #fff8e1; }
table.grid.zebra tbody tr.row-assigned:nth-child(even) td:first-child { background: #fbf0d6; }
table.grid tbody tr.row-assigned:hover { background: #f9ecc3; }
table.grid tbody tr.row-assigned:hover td:first-child { background: #f9ecc3; }
/* ★ 查看高亮（2026-11-15）：点击某行按钮/链接查看该行数据时，整行金黄高亮，方便定位正在查看的行 */
table.grid tbody tr.row-view { background: #fff3c4; }
table.grid tbody tr.row-view td { background: #fff3c4; }
table.grid tbody tr.row-view td:first-child { background: #fff3c4; }
table.grid.zebra tbody tr.row-view:nth-child(even) { background: #fbe9a6; }
table.grid.zebra tbody tr.row-view:nth-child(even) td { background: #fbe9a6; }
table.grid.zebra tbody tr.row-view:nth-child(even) td:first-child { background: #fbe9a6; }
table.grid tbody tr.row-view:hover { background: #fce08a; }
table.grid tbody tr.row-view:hover td { background: #fce08a; }
table.grid tbody tr.row-view:hover td:first-child { background: #fce08a; }
/* 勾选选中：批量分配勾选后整行淡蓝亮起（优先级在已分配淡黄之上） */
table.grid tbody tr.row-selected { background: #e3f1ff; }
table.grid tbody tr.row-selected td:first-child { background: #e3f1ff; }
table.grid.zebra tbody tr.row-selected:nth-child(even) { background: #e0eefc; }
table.grid.zebra tbody tr.row-selected:nth-child(even) td:first-child { background: #e0eefc; }
table.grid tbody tr.row-selected:hover { background: #c8e2fa; }
table.grid tbody tr.row-selected:hover td:first-child { background: #c8e2fa; }
/* 行内展开高亮：点击合同行展开后，父行深绿强调、子行（展开明细区）浅绿 */
table.grid tbody tr.row-open { background: #a5d6a7; }
table.grid tbody tr.row-open td { background: #a5d6a7; }
table.grid tbody tr.row-open td:first-child { background: #a5d6a7; }
table.grid tbody tr.row-open:hover { background: #94cd97; }
table.grid tbody tr.row-open:hover td { background: #94cd97; }
table.grid tbody tr.row-open:hover td:first-child { background: #94cd97; }
table.grid tr.total td:first-child { background: #f7f9fc; }
.tag { display: inline-block; padding: 1.5px 8px; border-radius: 10px; font-size: 11px; background: #eef2f7; color: #5a6b80; }
.tag.green { background: #e3f5ec; color: #159d63; } .tag.red { background: #fdeaea; color: #d92b2b; }
.tag.blue { background: #e6f0fb; color: #1a5fb4; } .tag.orange { background: #fdf0e3; color: #e2711d; }
.tag.purple { background: #f1eafb; color: #7a4fd0; }   /* 加工厂类型标签 */
.tag.teal { background: #e0f4f4; color: #0e8a8a; }     /* 管材类型标签 */
.tag.dim { background: #eef0f3; color: #98a5b3; }
.tag.tag-click { cursor: pointer; }
.tag.tag-click:hover { box-shadow: 0 0 0 1.5px var(--brand-2); }
/* 可点击状态标签（我的合同：点击修改状态） */
.st-click { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.st-click::after { content: "✎"; font-size: 10px; color: #b3c1d1; }
.st-click:hover::after { color: var(--brand); }
.st-click:hover .tag { box-shadow: 0 0 0 1.5px var(--brand-2); }
/* ★ 财务角标（2026-10-20）：业务员登记采购/未税支出后，财务「我的合同」合同编号旁的红点提示 */
.dot-badge { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e5484d;
  margin-right: 5px; vertical-align: middle; box-shadow: 0 0 0 2px rgba(229,72,77,.2); animation: dotPulse 1.6s ease-in-out infinite; }
@keyframes dotPulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
/* ★ 财务行内展开（2026-10-24）：列表行下方展开子行，内含六个折叠明细区块 */
tr.subrow > td { padding: 0 !important; background: #eef8f0 !important; border-bottom: 2px solid #bfe0c6; box-shadow: inset 3px 0 0 #2e7d4f; }
/* 子行内部的卡片/统计卡/折叠块默认白底，会盖住子行浅绿；统一透成浅绿底、保留边框 */
tr.subrow .card, tr.subrow .fin-sec { background: transparent; }
tr.subrow .kpi, tr.subrow .fin-sec-hd { background: #f4fbf5 !important; }
tr.subrow .kpi { border-color: #cde6d3; }
tr.subrow table.grid td { background: transparent; }
tr.subrow table.grid td:first-child { background: transparent; box-shadow: none; }
tr.subrow .fin-panels { padding: 10px 12px; }
.fin-sec { border: 1px solid var(--line); border-radius: 7px; background: #fff; margin-bottom: 8px; overflow: hidden; }
.fin-sec:last-child { margin-bottom: 0; }
.fin-sec-hd { display: flex; align-items: center; gap: 6px; padding: 8px 12px; font-weight: 600; font-size: 13px; cursor: pointer; user-select: none; background: #fafbfd; }
.fin-sec-hd:hover { background: #f0f5fb; }
.fin-sec-hd .ico { font-size: 15px; }
.fin-sec-hd .fin-sec-sum { margin-left: auto; color: var(--muted); font-weight: 400; font-size: 12px; margin-right: 4px; }
.fin-sec-hd .fold-ico { display: inline-block; width: 14px; color: var(--muted); }
.fin-sec-bd { padding: 8px 12px 10px; }
/* 行内展开区顶部的收支统计卡（2026-10-24）：复用 .kpis/.kpi，压一下间距贴合子行 */
.fin-kpis { margin-bottom: 10px; }
.fin-kpis .kpi { padding: 7px 10px; }
.fin-kpis .k-l { font-size: 11px; line-height: 1.3; }
.fin-kpis .k-v { font-size: 16px; line-height: 1.25; margin-top: 2px; }
.fin-kpis .k-s { font-size: 10.5px; line-height: 1.4; margin-top: 3px; }
.fin-sec-bd table.grid { font-size: 12px; }
.fin-sec-bd table.grid th, .fin-sec-bd table.grid td { padding: 5px 8px; }
.fin-detail .fin-row { display: flex; align-items: center; padding: 4px 0; border-bottom: 1px dashed #eef2f6; }
.fin-detail .fin-row:last-child { border-bottom: none; }
.fin-detail .fin-row .d-i { width: 96px; color: var(--muted); flex-shrink: 0; }
.fin-detail .fin-row .d-v { flex: 1; display: flex; align-items: center; gap: 6px; }
/* 未读行整行闪烁：业务员新变动 → 财务未确认前整行持续闪烁
   ★ 2026-11-21 统一口径：财务视角闪烁统一橙色（原红色 rgba(229,72,77) 改为橙色，与 fin-unread-row/del-pending-row 一致） */
tr.fin-unread { animation: finBlinkRow 1.1s ease-in-out infinite; }
tr.fin-unread td { animation: finBlinkBg 1.1s ease-in-out infinite; }
.fin-unread:not(tr) { animation: finBlinkBg 1.1s ease-in-out infinite; }
@keyframes finBlinkRow { 0%,100% { box-shadow: inset 3px 0 0 rgba(255,159,28,.9); } 50% { box-shadow: inset 3px 0 0 rgba(255,159,28,.2); } }
@keyframes finBlinkBg { 0%,100% { background: rgba(255,159,28,.10); } 50% { background: rgba(255,159,28,.30); } }
/* 合同行整行闪烁（财务列表，未读变动合同/发票行的整行提示，比未读行更醒目） */
tr.fin-unread-row td { animation: finRowBlinkBg 1.1s ease-in-out infinite; }
tr.fin-unread-row { animation: finRowBlinkBar 1.1s ease-in-out infinite; }
@keyframes finRowBlinkBg { 0%,100% { background: rgba(255,159,28,.12); } 50% { background: rgba(255,159,28,.34); } }
@keyframes finRowBlinkBar { 0%,100% { box-shadow: inset 4px 0 0 rgba(255,159,28,.95); } 50% { box-shadow: inset 4px 0 0 rgba(255,159,28,.25); } }
/* 被驳回合同整行红色（2026-10-31）：醒目提示业务员该合同被驳回，需修改后重新提交 */
tr.fin-reject-row td { background: rgba(229,72,77,.08); color: #c0392b; }
tr.fin-reject-row { box-shadow: inset 4px 0 0 rgba(229,72,77,.9); }
tr.fin-reject-row:hover td { background: rgba(229,72,77,.14); }
/* ★ 被驳回合同整行红色闪烁（2026-11-21）：业务员「我的合同」列表里被财务驳回（rejectReason 非空）的合同
   整行红色持续闪烁，比菜单小红标更醒目，一眼定位「待修改」；重新提交归档清除驳回后自动消失 */
tr.reject-red-row td { animation: rejectRedBg 1.1s ease-in-out infinite; }
tr.reject-red-row { animation: rejectRedBar 1.1s ease-in-out infinite; }
@keyframes rejectRedBg { 0%,100% { background: rgba(229,72,77,.10); } 50% { background: rgba(229,72,77,.34); } }
@keyframes rejectRedBar { 0%,100% { box-shadow: inset 5px 0 0 rgba(229,72,77,.95); } 50% { box-shadow: inset 5px 0 0 rgba(229,72,77,.22); } }
/* ★ 待删审批合同整行橙色闪烁（2026-11-21）：业务员申请删除（delReq）后，财务/管理员视角该合同整行橙色闪烁，
   一眼定位待审批删除的合同（与「待核对」橙闪区分，用更醒目的橙色 + 左侧加粗橙条）；批准/删除后 delReq 消失，闪烁自动消失 */
tr.del-pending-row td { animation: delPendingBg 1.1s ease-in-out infinite; }
tr.del-pending-row { animation: delPendingBar 1.1s ease-in-out infinite; }
@keyframes delPendingBg { 0%,100% { background: rgba(230,126,34,.12); } 50% { background: rgba(230,126,34,.36); } }
@keyframes delPendingBar { 0%,100% { box-shadow: inset 5px 0 0 rgba(230,126,34,.98); } 50% { box-shadow: inset 5px 0 0 rgba(230,126,34,.28); } }
/* 移动端卡片模式：待删审批卡片橙色闪烁 */
body.m .tcard.del-pending-row { animation: delPendingBg 1.1s ease-in-out infinite; box-shadow: inset 5px 0 0 rgba(230,126,34,.98), 0 1px 4px rgba(23,51,79,.06); }
/* ★ 全局搜索命中行高亮（2026-11-22）：财务视角「待核对合同」搜索命中某合同（含嵌套明细）时，整行淡绿高亮；
   静态底色不闪烁，避免与「待核对橙闪/驳回红闪/待删橙闪」混淆。 */
tr.search-hit-row td { background: #e8f6e8; }
tr.search-hit-row { box-shadow: inset 4px 0 0 #2e9e4f; }
tr.search-hit-row:hover td { background: #d9f0d9; }
body.m .tcard.search-hit-row { box-shadow: inset 4px 0 0 #2e9e4f, 0 1px 4px rgba(23,51,79,.06); }
/* ★ 搜索命中文字高亮（2026-11-22）：命中关键字加粗变红 + 红色背景闪烁，让命中文字更醒目 */
b.hl { color: #d33; font-weight: 700; font-size: 1.5em; border-radius: 2px; padding: 0 1px; animation: hlPulse 1.1s ease-in-out infinite; }
@keyframes hlPulse {
  0%, 100% { background: rgba(229,72,77,.16); }
  50% { background: rgba(229,72,77,.42); }
}

/* ★ 搜索框清除按钮常显示 + 加大（2026-11-22）：全局所有 type="search" 输入框的 X 清除按钮
   改为「始终显示」（不再 hover/聚焦才出现）+ 用大号 SVG 图标放大、颜色加深，更醒目。 */
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px;
  cursor: pointer;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18"><circle cx="12" cy="12" r="10" fill="%23cbd5e0"/><path d="M8.5 8.5 L15.5 15.5 M15.5 8.5 L8.5 15.5" stroke="%23596575" stroke-width="2.4" stroke-linecap="round" fill="none"/></svg>') center/18px 18px no-repeat;
  opacity: 1;
}
input[type="search"]::-webkit-search-cancel-button:hover {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18"><circle cx="12" cy="12" r="10" fill="%23e2504c"/><path d="M8.5 8.5 L15.5 15.5 M15.5 8.5 L8.5 15.5" stroke="%23ffffff" stroke-width="2.4" stroke-linecap="round" fill="none"/></svg>') center/18px 18px no-repeat;
}

/* ★ 欠票时间过长整行红色（2026-11-04）：供应商超过 3 个月未开发票，整行浅红 + 左侧红条 */
tr.owe-old-row td { background: rgba(229,72,77,.09); }
tr.owe-old-row { box-shadow: inset 4px 0 0 rgba(229,72,77,.92); }
tr.owe-old-row:hover td { background: rgba(229,72,77,.16); }
/* 确认按钮：消除闪烁 */
.fin-ack { flex-shrink: 0; border: 1px solid #d33; color: #d33; background: #fff; border-radius: 50%; width: 20px; height: 20px; line-height: 16px; font-size: 12px; cursor: pointer; padding: 0; text-align: center; }
.fin-ack:hover { background: #d33; color: #fff; }
/* ★ 对账「未对账」标签红闪（2026-11-01）：仅标签闪烁，行用浅红，不整行闪（避免晃眼） */
.fin-recon-blink { animation: reconBlink 1.1s ease-in-out infinite; }
@keyframes reconBlink { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
/* ★ 业务员侧「待确认」记录整行橙闪（2026-11-01）：财务补登/改金额后待业务员确认的记录，整行醒目提示 */
tr.fin-pending-row td { animation: finPendingBg 1.1s ease-in-out infinite; }
tr.fin-pending-row { animation: finPendingBar 1.1s ease-in-out infinite; }
@keyframes finPendingBg { 0%,100% { background: rgba(255,159,28,.14); } 50% { background: rgba(255,159,28,.36); } }
@keyframes finPendingBar { 0%,100% { box-shadow: inset 4px 0 0 rgba(255,159,28,.95); } 50% { box-shadow: inset 4px 0 0 rgba(255,159,28,.25); } }

/* ================= 手机端财务「待核对合同」优化（2026-11-18） =================
   痛点：手机上找待核对合同麻烦、六类明细横向表格溢出、核对按钮太小难点、信息冗余。
   方案：展开区横向表格可横向滚动不外溢；核对/改金额/驳回按钮加大触控区；
   收支统计卡单列紧凑；折叠小节标题可换行；卡片展开区留白收紧。 */
body.m .fin-panels { padding: 2px 0; }
/* 六类明细表格及其它弹窗/详情内的横向明细表：手机端统一改为「每条记录一张纵向卡片」，
   不再横向挤压/翻页。表头隐藏，tr 变卡片，td 纵向堆叠并在前面显示字段名（data-label，由 JS 自动注入）；
   金额大字醒目、凭证图片独立成行、对账操作（状态标签+按钮）清晰拆开。 */
body.m .fin-sec-bd { padding: 6px 8px 10px; overflow: visible; }
/* 卡片化表格的外层 .tbl-wrap 去框化：去掉边框/滚动/限高，让卡片自然流式展示 */
body.m .tbl-wrap.grid-card-wrap {
  border: none; overflow: visible; max-height: none; background: transparent; border-radius: 0;
}
body.m table.grid.grid-card {
  width: 100%; display: block; table-layout: auto; font-size: 12.5px;
  border-collapse: separate; border-spacing: 0;
}
body.m table.grid.grid-card thead { display: none; }
body.m table.grid.grid-card tbody { display: block; }
body.m table.grid.grid-card tr {
  display: block; position: relative;
  margin-bottom: 10px; padding: 10px 12px;
  background: #fff; border: 1px solid #dde5ee; border-radius: 10px;
  box-shadow: 0 1px 3px rgba(23,51,79,.06);
}
body.m table.grid.grid-card tr:last-child { margin-bottom: 0; }
/* 卡片模式下取消表格的 sticky 首列 / hover 变色，避免覆盖卡片自身背景 */
body.m table.grid.grid-card td:first-child { position: static; background: transparent; box-shadow: none; }
body.m table.grid.grid-card tbody tr:hover { background: #fff; }
/* 未核对记录卡片：左侧橙色提示条 + 淡橙底，一眼定位；
   卡片模式下整卡闪烁（td 不再各自闪背景，避免盖住卡片底色） */
body.m table.grid.grid-card tr.fin-unread {
  border-left: 4px solid rgba(255,159,28,.95);
  animation: finBlinkBg 1.1s ease-in-out infinite;
}
body.m table.grid.grid-card tr.fin-unread td { animation: none; }
body.m table.grid.grid-card tr.fin-unread:hover { background: #fffaf2; }
body.m table.grid.grid-card td {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 4px 0; border: none; text-align: left;
  white-space: normal; word-break: break-word;
}
/* 字段名（data-label）显示在每行左侧，占固定窄列 */
body.m table.grid.grid-card td::before {
  content: attr(data-label);
  flex: 0 0 62px; color: #8a98ab; font-size: 11.5px; line-height: 1.5;
  padding-top: 1px;
}
/* 无 data-label 的 td（对账列）不显示前缀 */
body.m table.grid.grid-card td:not([data-label])::before { content: none; }
/* 金额列：大字醒目，值右对齐（日期/数量列同理靠右显示数值） */
body.m table.grid.grid-card td.num { justify-content: flex-end; text-align: right; }
body.m table.grid.grid-card td.num::before { margin-right: auto; }
body.m table.grid.grid-card td.num b { font-size: 16px; }
/* 图片凭证列：缩略图横向排列、独立成行 */
body.m table.grid.grid-card td.fin-img-td img {
  width: 44px; height: 32px; object-fit: cover; border-radius: 4px;
  border: 1px solid #e3e6eb; margin: 2px 4px 2px 0;
}
/* 对账列：占满整行，标签/按钮/说明各自成清晰条目 */
body.m table.grid.grid-card td.fin-recon-td {
  display: block; margin-top: 6px; padding-top: 8px;
  border-top: 1px dashed #e4eaf1;
}
body.m table.grid.grid-card td.fin-recon-td::before { content: none; }
/* recon-cell 内部三块：状态标签、操作按钮、附加说明，纵向清晰排列 */
body.m .fin-sec-bd .recon-cell {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
}
body.m .fin-sec-bd .recon-cell .recon-tag { display: block; }
body.m .fin-sec-bd .recon-cell .recon-tag .tag { font-size: 12.5px; padding: 3px 10px; }
body.m .fin-sec-bd .recon-cell .recon-btns {
  display: flex; flex-wrap: wrap; gap: 6px;
}
body.m .fin-sec-bd .recon-cell .recon-notes { display: block; }
/* 折叠小节标题：手机端允许换行、summary 换到下方，避免「收款记录 共X笔」挤不下 */
body.m .fin-sec-hd { padding: 9px 12px; font-size: 13.5px; flex-wrap: wrap; row-gap: 2px; }
body.m .fin-sec-hd .fin-sec-sum { font-size: 11.5px; width: 100%; margin-left: 22px; order: 3; }
body.m .fin-sec-hd .fold-ico { margin-left: auto; }
/* 收支统计卡：手机端财务点开合同「不需要这组 KPI」，直接隐藏，减少滚动直接看到收款/采购明细 */
body.m .fin-kpis { display: none; }
/* 财务核对操作按钮：手机端加大触控区，避免手指误触 */
body.m .fin-sec-bd [data-recon-confirm],
body.m .fin-sec-bd [data-recon-change],
body.m .fin-sec-bd [data-recon-reject],
body.m .fin-sec-bd [data-recon-unlock] {
  height: 36px; padding: 0 15px; font-size: 13.5px; margin: 0;
  white-space: nowrap; touch-action: manipulation;
}
/* 卡片里「待核对 N 笔」红标签更醒目 */
body.m .tc-v .tag.red { font-size: 13px; padding: 3px 9px; }
/* 卡片展开区（fin-panels）内边距收紧，去掉多余留白 */
body.m .tc-exp .fin-panels { margin: 0 -2px; }
/* 待核对合同卡片：整卡左侧加橙色提示条，未核对项一眼可见 */
body.m .tcard.fin-unread-row { box-shadow: inset 4px 0 0 rgba(255,159,28,.95), 0 1px 4px rgba(23,51,79,.06); }
/* ★ 被驳回合同卡片（2026-11-21）：整卡红色闪烁 + 左侧红色提示条，醒目提醒「待修改」 */
body.m .tcard.reject-red-row { animation: rejectRedBg 1.1s ease-in-out infinite; box-shadow: inset 5px 0 0 rgba(229,72,77,.95), 0 1px 4px rgba(23,51,79,.06); }
/* ★ 待删审批合同卡片（2026-11-21）：整卡红色闪烁 + 左侧红色提示条，醒目提醒「待审批删除」 */
body.m .tcard.del-req-row { animation: delReqBg 1.1s ease-in-out infinite; box-shadow: inset 5px 0 0 rgba(229,72,77,.95), 0 1px 4px rgba(23,51,79,.06); }

.empty { padding: 44px 0; text-align: center; color: var(--dim); }
.e-i { font-size: 34px; margin-bottom: 8px; opacity: .55; }
.e-t { font-size: 13px; }
/* 表头排序 + 分页 */
.thsort { cursor: pointer; user-select: none; display: inline-flex; align-items: center; gap: 3px; }
.thsort:hover { color: var(--brand); }
.thsort .sico { font-size: 9.5px; opacity: .45; font-style: normal; }
.thsort:hover .sico { opacity: 1; }
table.grid th.on-sort .sico { opacity: 1; color: var(--brand); }
.pager { display: flex; align-items: center; gap: 8px; padding: 8px 2px 2px; font-size: 12px; color: var(--dim); }
.pg-info { margin-right: auto; }
/* 列设置：拖拽调宽 / 隐藏列 / 增加列 */
.tbl-holder { position: relative; }
.tbl-set { position: absolute; top: 2px; right: 6px; z-index: 6; height: 21px; padding: 0 8px; font-size: 11.5px;
  line-height: 19px; background: #fff; border: 1px solid var(--line); border-radius: 4px; color: #54677e; cursor: pointer; opacity: .6; }
.tbl-set:hover { opacity: 1; color: var(--brand); border-color: var(--brand); background: #f3f8ff; }
/* 列顺序：按住表头拖动换位置（_ 开头的固定列不参与） */
table.grid thead th { user-select: none; }
table.grid thead th.th-drag { cursor: grab; }
table.grid thead th.th-drag:hover { background: #eef4fb; }
table.grid thead th.th-dragging { opacity: .4; cursor: grabbing; }
table.grid thead th.th-over { background: #e3eefa !important; box-shadow: inset 3px 0 0 var(--brand), inset -3px 0 0 rgba(45,120,220,.35); }
table.grid th .col-rz { position: absolute; right: 0; top: 0; bottom: 0; width: 7px; cursor: col-resize; z-index: 2; }
table.grid th .col-rz:hover { background: var(--brand); opacity: .3; }
.col-off { display: none !important; }
.cs-t { font-weight: 700; font-size: 12.5px; margin: 10px 0 4px; }
.cs-g { display: flex; flex-wrap: wrap; }
.ck { display: inline-flex; align-items: center; gap: 5px; width: 33%; padding: 3px 0; font-size: 12.5px; cursor: pointer; }
.ck input { margin: 0; }
/* 列设置：一行 = 勾选 + ✎改列名 + ✕删除列 */
.cs-i { display: inline-flex; align-items: center; width: 40%; min-width: 200px; padding: 3px 0; gap: 4px; }
.cs-i .ck { width: auto; flex: 1; min-width: 0; padding: 0; }
.cs-i .btn { flex: none; padding: 1px 7px; font-size: 11.5px; line-height: 1.6; }
.cs-i .rn-inp { flex: 1; min-width: 0; width: auto; font-size: 12.5px; padding: 2px 6px; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(18,35,58,.42); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 7vh 16px 16px; overflow: auto; }
.modal { background: #fff; border-radius: 9px; width: 760px; max-width: 96vw; box-shadow: 0 18px 50px rgba(10,30,60,.3); animation: pop .16s ease; }
.modal.wide { width: 1100px; }   /* 宽弹窗：Excel 导入预览 / 批量照片等多列表格 */
.modal.modal-mach { width: 1360px; max-width: 98vw; }  /* 加工预算：更宽以容纳工序参数列与计价说明（2026-11-14） */
.modal.modal-mach .modal-bd { max-height: 88vh; }
@keyframes pop { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
/* 单据预览页（报价/合同/送货单/质保书）—— 统一 A4 纸张 210mm × 297mm */
.doc-preview { background: #fff; border: 1px solid var(--line); border-radius: 4px;
  box-sizing: border-box; width: 210mm; min-height: 297mm; padding: 14mm 13mm;
  margin: 0 auto 16px; box-shadow: 0 5px 20px rgba(23,51,79,.13);
  transform-origin: top center; position: relative; }
/* 超过一页时的分页虚线（预览专用，不进打印）：已由「真拆成多张纸」取代，选择器保留兼容 */
.pg-break { position: absolute; left: 13mm; right: 13mm; height: 0; border-top: 1px dashed #d39090; z-index: 4; pointer-events: none; }
.pg-break .pg-tag { position: absolute; right: 0; top: -9px; font-size: 10.5px; line-height: 17px; color: #b03a3a;
  background: #fff; border: 1px solid #eccfcf; border-radius: 9px; padding: 0 7px; white-space: nowrap; }
/* 分页预览：超过一页的单据被拆成一张张 .doc-preview，外层 .doc-stack 用灰底把纸「托」起来、
   纸与纸之间留出间距 —— 屏幕上看到的就是「上下两张 A4 纸」（打印走独立 iframe，不受影响） */
.doc-stack { background: var(--bg); border-radius: 6px; padding: 14px 8px;
  display: flex; flex-direction: column; align-items: center; }
.doc-stack .doc-preview { margin: 0 0 26px; }
.doc-stack .doc-preview:last-child { margin-bottom: 0; }
/* 工具条上的页数角标（1 页=灰、多页=红） */
.doc-pages { margin-left: 8px; font-size: 12px; color: #8a97a6; }
.doc-pages.warn { color: #c0392b; font-weight: 700; }
.doc-wrap { padding: 8px 6px 4px; }
/* 合同预览涂鸦：两层结构，保证画面清晰、缩放后仍精确对位
   .doodle-wrap  —— 无缩放的外壳，负责占位与上下间距（z-index 高于纸内的绝对定位 logo）
   .doodle-paper —— 绝对铺满整张 A4，内部用 zoom 跟纸张同步缩放
   canvas        —— 像素尺寸 = 纸张在屏幕上的真实像素，1:1 绘制（不被二次放大 → 不发虚）
   只读态 pointer-events:none 不拦操作；进入绘制态变 crosshair 并接管鼠标/触摸 */
/* ★ 定位基准必须是「纸张自己」：.doodle-wrap 一旦继承了 .doc-stack 的 align-items:center，
   它的盒子会收缩到内容宽度、不再贴纸张左边，而 .doodle-paper 是 absolute left:0 ——
   画布就会整体偏到纸张左边（真机实测偏 368px），鼠标全落在纸上、画不到任何东西。
   故这里显式 stretch：wrap 铺满父容器宽度，纸张与画布共用同一个左边界。 */
.doodle-wrap { position: relative; z-index: 6; align-self: stretch; width: 100%; }
/* ★ z-index:5 必须有：wrap 里 paper（画布层）在 DOM 上排在 sheet（合同纸）之前，
   两者都是定位元素且 z auto 时按 DOM 顺序绘制 → 合同纸把画布整个盖住，
   涂鸦「画了也不显示」（数据落库正常、像素画上了，就是看不见）。z:5 压在纸内容（水印 z2 / 分页线 z4）之上 */
.doodle-paper { position: absolute; left: 0; top: 0; z-index: 5; transform-origin: top left; pointer-events: none; }
.doodle-cv { display: block; width: 100%; height: 100%; pointer-events: none; touch-action: none; }
/* ★ 画布只做显示层，永远不接鼠标：paper 与 sheet 是兄弟节点，监听挂在 sheet 上，
   若涂鸦时画布 pointer-events:auto，真实鼠标事件会被画布截走、冒泡到 wrap 而不经过
   sheet → 合成事件（dispatchEvent 到 sheet）能画、真鼠标画不出。事件一律落在纸上 */
.panel.doodling .doc-preview { cursor: crosshair; }
/* 涂鸦壳把纸张包进来后，纸张的居中由 wrap 自己的 flex/居中规则接管，不能再吃 .doc-stack 的 26px 下间距 */
.doc-stack .doodle-wrap > .doc-preview { margin: 0 auto; }
.doc-stack .doodle-wrap { margin-bottom: 26px; }
.doc-stack .doodle-wrap:last-child { margin-bottom: 0; }
/* 涂鸦工具模式提示：贴在工具条下方的短横条，永不拦截鼠标（关键：提示不能挡住正在画的纸） */
.doodle-hint { position: sticky; top: 0; z-index: 20; margin: -4px auto 8px; max-width: 620px;
  background: #2c3e50; color: #fff; font-size: 12.5px; line-height: 1.5; padding: 6px 12px;
  border-radius: 6px; text-align: center; pointer-events: none; opacity: 0;
  transform: translateY(-4px); transition: opacity .2s, transform .2s; }
.doodle-hint.show { opacity: .95; transform: none; }
/* 标红 7 色选择条：进入标红工具时出现，点色块切换颜色（当前色高亮描边） */
.hl-colors { display: none; align-items: center; gap: 6px; position: sticky; top: 0; z-index: 21;
  margin: 0 auto 8px; padding: 6px 10px; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 4px 14px rgba(23,51,79,.12); width: fit-content; }
.hl-colors.show { display: flex; }
.hl-colors-label { font-size: 12px; color: #5a6b7d; margin-right: 2px; }
.hl-swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; padding: 0; box-sizing: border-box; transition: transform .12s; }
.hl-swatch:hover { transform: scale(1.15); }
.hl-swatch.on { border-color: #2c3e50; box-shadow: 0 0 0 2px #fff inset; }
/* 涂鸦文字批注的 inline 输入框：点击合同直接浮出，不弹模态框（字号恒定 16） */
.doodle-text-inp { position: absolute; z-index: 30; box-sizing: border-box; min-width: 120px; max-width: 560px;
  padding: 2px 6px; line-height: 1.5; font-weight: bold; font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: rgba(255,255,255,.92); border: 1.5px solid #f23b3b; border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.14); outline: none; }
.doodle-text-inp:focus { border-color: #d91f1f; background: #fff; }
/* 打印/预览时避免表格行被拦腰截断 */
.print-body table { page-break-inside: auto; }
.print-body tr { page-break-inside: avoid; page-break-after: auto; }
.print-body thead { display: table-header-group; }
.print-body h1, .print-body .p-sec { page-break-inside: avoid; }
/* 超过一页时「排好两页」：签章栏整块不切、合计行不孤立（与 ui.js 打印底座同一套规则） */
.print-body .p-sign, .print-body .p-sign tr, .print-body .p-sign td { page-break-inside: avoid; break-inside: avoid; }
.print-body tbody.p-keep { page-break-inside: avoid; break-inside: avoid; }
.print-body h1, .print-body .sub, .print-body .p-head { page-break-after: avoid; }
.modal-hd { display: flex; align-items: center; justify-content: space-between; padding: 13px 17px; border-bottom: 1px solid var(--line); font-size: 14.5px; font-weight: 700; }
.modal-x { cursor: pointer; color: var(--dim); font-size: 15px; padding: 2px 5px; border-radius: 4px; }
.modal-x:hover { background: #f0f3f7; color: var(--up); }
.modal-bd { padding: 15px 17px; max-height: 66vh; overflow: auto; }
/* ★ 资源库企业资料编辑弹窗：加高内容区，让门头照片等图片显示更大（2026-11-22） */
.modal.modal-tall .modal-bd { max-height: 84vh; }
.modal-ft { padding: 11px 17px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.form-grid.c3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid .fg.w100 { grid-column: 1 / -1; }
/* 按单据版式分行的表单（每行一个 .form-row，行内列数固定；窄屏也不会塌成一列一个字段）
   报价单信息用它：计价方式+交货时间 / 交货方式+运输方式+运费负担 / 结算方式 / 报价有效期 */
.form-rows { display: flex; flex-direction: column; gap: 10px; }
.form-rows .form-row { display: grid; gap: 10px 14px; grid-template-columns: 1fr 1fr; }
.form-rows .form-row.c1 { grid-template-columns: 1fr; }
.form-rows .form-row.c3 { grid-template-columns: 1fr 1fr 1fr; }
.fg label { display: block; font-size: 12px; color: #4a5f75; margin-bottom: 4px; font-weight: 600; }
.fg label.red { color: #c62828; }
.fg label i { color: var(--up); }
.fg input, .fg select, .fg textarea { width: 100%; border: 1px solid #ccd8e5; border-radius: 5px; padding: 6px 9px; font-size: 12.5px; background: #eef4fb; }
.fg input:focus, .fg select:focus, .fg textarea:focus { background: #fff; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(63,141,227,.14); outline: none; }
.fg textarea { resize: vertical; }

/* 提示 */
.toast-box { position: fixed; top: 56px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #fff; border: 1px solid var(--line); border-left: 3.5px solid var(--brand); border-radius: 6px; padding: 10px 15px; font-size: 12.5px; box-shadow: 0 8px 24px rgba(10,30,60,.16); opacity: 0; transform: translateX(18px); transition: all .25s; max-width: 340px; }
.toast.show { opacity: 1; transform: none; }
.toast.ok { border-left-color: var(--down); } .toast.err { border-left-color: var(--up); } .toast.warn { border-left-color: var(--orange); }
.toast.ok::before { content: "✓"; font-weight: 700; color: var(--down); margin-right: 6px; }
.toast.err::before { content: "✕"; font-weight: 700; color: var(--up); margin-right: 6px; }
.toast.warn::before { content: "⚠"; color: var(--orange); margin-right: 6px; }

/* 图片灯箱：点击全屏看大图（送货单物流图片 / 照片墙），点击任意处或 Esc 关闭 */
.lightbox-mask { position: fixed; inset: 0; background: rgba(10,22,38,.86); z-index: 300; display: flex; align-items: center; justify-content: center; cursor: zoom-out; animation: panelfade .15s ease; }
.lightbox-mask img { max-width: 94vw; max-height: 92vh; border-radius: 6px; box-shadow: 0 18px 60px rgba(0,0,0,.5); }
.lightbox-tip { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.75); font-size: 12px; pointer-events: none; }
/* ★ 截图预览（非安全上下文兜底，2026-11-22）：截图后弹出预览，右键复制图片 */
.shot-preview-mask { cursor: default; }
.shot-preview-box { display: flex; flex-direction: column; gap: 10px; max-width: 92vw; max-height: 92vh; background: #fff; border-radius: 10px; padding: 12px 14px; box-shadow: 0 18px 60px rgba(0,0,0,.5); }
.shot-preview-hd { display: flex; align-items: center; gap: 10px; color: #1f2937; }
.shot-preview-hd .spacer { flex: 1; }
.shot-preview-img { display: block; max-width: 86vw; max-height: 70vh; border-radius: 6px; border: 1px solid #e2e8f0; background: #f8fafc; cursor: default; }
.shot-preview-ft { text-align: center; }
/* 状态栏「保存中」指示 */
.st-sync { color: var(--brand); font-weight: 600; }

/* 明细编辑表 */
.items-edit { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: #fff; }
.items-edit table { width: 100%; border-collapse: collapse; font-size: 12.5px; table-layout: fixed; }
.items-edit th { background: #f5f8fb; padding: 7px 6px; border-bottom: 1px solid var(--line); font-weight: 600; color: #4a5b72; }
.items-edit td { padding: 4px 5px; border-bottom: 1px solid #f0f3f7; }
.items-edit input { width: 100%; border: 1px solid #b9cfe8; background: #eaf3fd; padding: 4px 6px; border-radius: 4px; font-size: 12.5px; color: var(--text); }
.items-edit input::placeholder { color: #8aa3c0; }
.items-edit input:hover { border-color: #9fc0e4; background: #eef5fc; }
.items-edit input:focus { border-color: var(--brand-2); background: #fff; box-shadow: 0 0 0 3px rgba(63,141,227,.16); outline: none; }
.items-edit input[readonly] { background: #eef2f7; color: #7c8aa0; }
.items-edit .num input { text-align: right; }
.items-edit input.tc { text-align: center; }   /* 居中列（单位/产地/公差等短字段） */
.items-edit td.c input { text-align: center; }
.items-edit tfoot td { background: #f7f9fc; font-weight: 700; padding: 7px 6px; }
.row-del { color: #c57f7f; cursor: pointer; font-size: 14px; padding: 0 5px; }
.row-del:hover { color: var(--up); }
.add-line { margin: 8px; }

/* 详情 */
.detail { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 18px; }
.detail .d-i { font-size: 11.5px; color: var(--dim); }
.detail .d-v { font-size: 13px; margin-top: 2px; }
.detail .d-v.mono { font-family: Consolas, monospace; }
.d-block { grid-column: 1 / -1; padding: 8px 10px; background: #f8fafc; border-radius: 6px; font-size: 12px; line-height: 1.7; color: #4a5b72; }

/* 工作台 */
.wc-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 18px 22px; border-radius: 8px; color: #fff; background: linear-gradient(120deg, #1a5fb4 0%, #2f7fd8 55%, #4a97e6 100%); box-shadow: 0 6px 20px rgba(26,95,180,.24); margin-bottom: 12px; position: relative; }
.wc-mask-btn { position: absolute; top: 12px; right: 14px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.38); color: #fff; border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; line-height: 1.4; }
.wc-mask-btn:hover { background: rgba(255,255,255,.28); }

/* 每个业务页面右上角的「隐藏/显示关键信息」悬浮开关（所有页面统一入口，跟状态栏按钮联动）
   ★ 悬浮层：外层 wrap 高度 0 且 sticky（滚动时按钮吸在面板顶部），内层按钮 absolute 定位——
   按钮不占布局空间，不会把工作台蓝色横幅等首块内容挤窄（此前 float:right 会让 flex/表格首块避让浮动而缩宽）。 */
/* 顶部标题栏右侧的「隐藏/显示关键信息」开关（白色半透明胶囊压在蓝色标题条上，与状态栏按钮联动） */
.tb-mask { flex: 0 0 auto; padding: 4px 12px; font-size: 12px; font-weight: 600; color: #fff; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.45); border-radius: 20px; cursor: pointer; line-height: 1.5; transition: background .15s ease; }
.tb-mask:hover { background: rgba(255,255,255,.3); }
.tb-mask.tb-mask-on { color: #6b4400; background: #ffd66b; border-color: #ffd66b; }
.tb-mask.tb-mask-on:hover { background: #ffe08a; }
.wc-hi { font-size: 19px; font-weight: 800; }
.wc-quote { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 7px; font-size: 22px; font-weight: 800; line-height: 1.35; }
.wc-q-tag { font-size: 11px; font-weight: 700; letter-spacing: .5px; padding: 1px 6px; border-radius: 3px; background: #fff; color: #ff0000; box-shadow: 0 1px 2px rgba(0,0,0,.18); }
.wc-quote > span:last-child { color: #fff; opacity: 1; text-shadow: 0 1px 3px rgba(0,0,0,.28); }
.wc-sub { font-size: 12px; opacity: .85; margin-top: 4px; }
.wc-quick { display: flex; gap: 10px; flex-wrap: wrap; }
/* ★ 工作台顶部固定区（2026-11-20）：每日一句 + 整排 KPI 统计卡吸顶，向下滚动时固定不动 */
.wc-sticky-top { position: sticky; top: -12px; z-index: 25; margin: -12px -12px 0; padding: 12px 12px 12px; background: var(--bg); }
.wq { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.3); border-radius: 8px; padding: 9px 8px; cursor: pointer; font-size: 12px; width: 76px; box-sizing: border-box; }
.wq:hover { background: rgba(255,255,255,.24); }
.wq i { font-style: normal; font-size: 19px; line-height: 1; }
.wq span { white-space: nowrap; }
/* ★ 工作台 hero「我的合同」后「查合同」卡片（2026-10-30）：与前后 .wq 按钮样式一致，点开弹出面板内搜索 */
.wq-search { position: relative; }
.wq-search .wqs-pop { position: absolute; top: calc(100% + 10px); left: 0; width: 440px; max-height: 420px;
  background: #fff; border: 1px solid #e2e9f1; border-radius: 10px; box-shadow: 0 10px 30px rgba(20,40,70,.18);
  z-index: 3000; display: none; overflow: hidden; }
.wq-search .wqs-bar { padding: 8px; border-bottom: 1px solid #eef2f7; }
.wq-search .wqs-bar input { width: 100%; height: 32px; border: 1px solid #dde5ee; border-radius: 8px;
  padding: 0 12px; font-size: 13px; color: #33465f; outline: none; background: #f7f9fc; box-sizing: border-box; }
.wq-search .wqs-bar input:focus { border-color: var(--brand); background: #fff; }
.wq-search .wqs-bar input::placeholder { color: #9aa7b8; }
.wq-search .wqs-list { max-height: 340px; overflow-y: auto; padding: 6px; }
.wq-search .wqs-item { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: 7px;
  cursor: pointer; font-size: 13px; color: #33465f; transition: background .1s; }
.wq-search .wqs-item:hover { background: #eef4fb; }
.wq-search .wqs-item .wqs-row { display: flex; align-items: center; gap: 8px; }
.wq-search .wqs-item .wqs-no { flex: 0 0 auto; color: var(--brand); font-weight: 600; }
.wq-search .wqs-item .wqs-cust { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wq-search .wqs-item .wqs-amt { flex: 0 0 auto; }
.wq-search .wqs-item .wqs-date { flex: 0 0 auto; font-size: 12px; }
.wq-search .wqs-item .wqs-sub { display: flex; align-items: center; gap: 10px; padding-left: 2px; font-size: 12px; color: #6b7c93; }
.wq-search .wqs-item .wqs-seller { flex: 0 0 auto; white-space: nowrap; }
.wq-search .wqs-item .wqs-line { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #8a9ab0; }
.wq-search .wqs-none, .wq-search .wqs-more { padding: 10px 12px; font-size: 12.5px; color: #9aa7b8; }
.wq-search .wqs-more { border-top: 1px dashed #e8eef5; margin-top: 4px; padding-top: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }
.rc-row { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px dashed #edf1f5; font-size: 12.5px; }
.rc-row:last-child { border-bottom: none; }
.rc-tag { flex: 0 0 auto; }

/* 上传 */
.up-area { border: 1.5px dashed #c3d2e2; border-radius: 8px; padding: 22px; text-align: center; color: var(--dim); cursor: pointer; background: #fafcfe; }
.up-area:hover { border-color: var(--brand-2); color: var(--brand); }
.up-area b { display: block; font-size: 13px; margin-bottom: 3px; }

/* ---------- 质保书库：自定义文件夹树 ---------- */
.warr-wrap { display: flex; gap: 14px; align-items: flex-start; margin-top: 12px; }
.warr-side { flex: 0 0 322px; max-width: 340px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.warr-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.warr-tools .btn { flex: 1 1 auto; min-width: 0; }
.warr-tree { flex: 1 1 auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 8px 4px; overflow: auto; max-height: 62vh; min-height: 200px; }
.warr-node { display: flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 12.5px; color: #33475c; white-space: nowrap; }
.warr-node:hover { background: #eef4fb; }
.warr-node.warr-active { background: #e3eefa; color: var(--brand); font-weight: 600; }
.warr-node.warr-active .warr-cnt { background: #d3e5f8; color: var(--brand); }
.warr-arrow { width: 14px; text-align: center; color: var(--dim); flex: 0 0 14px; font-size: 11px; }
.warr-ico { flex: 0 0 18px; text-align: center; }
.warr-lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.warr-cnt { color: var(--dim); font-size: 11px; background: #f0f3f7; border-radius: 9px; padding: 0 7px; line-height: 16px; }
/* 文件夹节点右侧的「⬆ 上传」：鼠标移到节点上才显示（手机上常显，靠列表右上「⬆ 上传到此处」也行） */
.warr-up { flex: 0 0 auto; width: 20px; height: 18px; line-height: 18px; text-align: center; margin-right: 4px; border-radius: 5px; background: #e6f1fb; color: #1a5fb4; font-size: 12px; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .12s ease; }
.warr-node:hover .warr-up { opacity: 1; pointer-events: auto; }
.warr-up:hover { background: #1a5fb4; color: #fff; }
@media (max-width: 900px) { .warr-up { opacity: 1; pointer-events: auto; } }
/* 文件夹排序：悬停节点时露出 ↑↓ 小箭头（同级前 / 后挪一位；已在头 / 尾的那一侧置灰） */
.warr-mvgrp { flex: 0 0 auto; display: inline-flex; gap: 2px; margin-right: 2px; opacity: 0; pointer-events: none; transition: opacity .12s ease; }
.warr-node:hover .warr-mvgrp { opacity: 1; pointer-events: auto; }
.warr-mv { width: 17px; height: 18px; line-height: 18px; text-align: center; border-radius: 5px; background: #eef1f5; color: #45596e; font-size: 12px; cursor: pointer; }
.warr-mv:hover { background: #1a5fb4; color: #fff; }
.warr-mv.off { opacity: .28; cursor: default; }
.warr-mv.off:hover { background: #eef1f5; color: #45596e; }
@media (max-width: 900px) { .warr-mvgrp { opacity: 1; pointer-events: auto; } }
.warr-files { flex: 1; min-width: 0; }
.warr-path { font-size: 12.5px; color: #33475c; margin: 2px 0 10px; padding: 8px 12px; background: #f6f9fc; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.warr-path b { color: var(--brand); }

/* ---------- 资源库：门店 / 仓库照片墙 ---------- */
.ph-h { font-weight: 700; font-size: 12.5px; color: #2f4a66; margin: 12px 0 7px; border-left: 3px solid var(--brand-2); padding-left: 8px; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 10px; }
.ph-item { border: 1px solid #e2e9f1; border-radius: 7px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.ph-item img { width: 100%; height: 116px; object-fit: cover; display: block; background: #f4f7fa; cursor: zoom-in; }
.ph-item img:hover { opacity: .9; }
.ph-meta { font-size: 11.5px; padding: 7px 9px; color: #3d5a7a; line-height: 1.55; word-break: break-all; }
.ph-ops { margin-top: 6px; display: flex; gap: 5px; }
.empty.sm { padding: 16px 0; }
.empty.sm .e-i { font-size: 22px; }
.empty.sm .e-t { font-size: 12.5px; }

/* 未税支出 · 按月分组的月份小标题条（笔数 / 未税 / 折含税 / 垫付与待报销小计） */
.exp-mh { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; margin: 16px 0 0;
  padding: 0 2px 6px; border-bottom: 2px solid var(--brand-2); font-size: 13px; color: #2f4a66; }
.exp-mh b { font-size: 14px; letter-spacing: .5px; }
.exp-mh .s { color: var(--dim); font-size: 12px; }
.exp-mh:first-child { margin-top: 4px; }
/* 未税支出 · 月内按合同聚类的合同小标题条（同一合同的多笔支出归到一段） */
.exp-ch { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 12px 0 0;
  padding: 4px 10px; background: #f2f7fd; border-left: 3px solid var(--brand-2); border-radius: 0 4px 4px 0;
  font-size: 12.5px; color: #2f4a66; }
.exp-ch b { font-size: 13px; }
.exp-ch span { color: var(--dim); }
.exp-ch:first-child { margin-top: 0; }

/* ---------- 打印模板 ----------
   ★ 2026-10-12「预览 = 打印」对齐：下面这些数值必须与 ui.js printDocHtml 里的打印底座逐条一致，
     否则预览纸会比真实打印稿高/矮几毫米到二十几毫米（表格行高、h1 字号边距、签章格内边距），
     于是「预览显示超过一页、真要打却是一页」。改任何一条都要两边一起改。
   display:flow-root 让 .print-body 自己成为定位/布局参考：否则首元素(h1)的外边距会「逃逸」到
   .print-body 之外，把整块往下推（标题视觉位置不变，但 logo 的参考点会跟着偏） */
.print-body { font-size: 12.5px; line-height: normal; position: relative; display: flow-root; }
.print-body h1 { font-size: 19px; text-align: center; margin: 6px 0 2px; letter-spacing: 2px; }
.print-body .p-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 8px; font-size: 12.5px; }
.print-body table.p-tbl { width: 100%; border-collapse: collapse; margin: 8px 0; }
.print-body table.p-tbl th, .print-body table.p-tbl td { border: 1px solid #444; padding: 5px 7px; font-size: 12px; line-height: normal; }
.print-body table.p-tbl th { background: #f2f2f2; text-align: center; }
.print-body .p-sec { margin: 7px 0; font-size: 12.5px; }
/* 报价单条款区（计价方式/交货时间…）按行排列，行距收紧一点，免得 A4 被挤到第二页 */
.print-body .p-sec.p-tight { margin: 3px 0; }
/* 报价单附图片（在「我的报价 → 操作 → 📷」上传，存报价单的 img 字段）：
   纸宽 210mm − 左右各 15mm = 180mm，高 88mm，居中，整块不跨页 */
.print-body .q-img { text-align: center; margin: 6mm auto 0; page-break-inside: avoid; break-inside: avoid; }

/* 报价单 logo：贴纸张左上角（距纸边左/上各 15mm，尺寸 18×18mm）。
   定位参考 = .print-body 左上角：预览下该点距纸边 = .doc-preview 的 padding(14mm 13mm)，
   打印下 = @page margin(14mm 13mm)，故 left 2mm / top 1mm 在预览与打印两处数值一致（ui.js 同步） */
.print-body .q-logo { position: absolute; left: 2mm; top: 1mm; width: 18mm; height: 18mm; object-fit: contain; }
/* 图片拉伸填满 180×88mm 图区（strict fill，不裁切不留白，可能变形） */
.print-body .q-img img { width: 180mm; height: 88mm; object-fit: fill; display: block; margin: 0 auto; }
/* 显示方式=填充：等比缩放填满图区、居中裁切多余部分、不变形（object-fit: cover） */
.print-body .q-img img.cover { object-fit: cover; }
/* 显示方式=完整显示：等比缩放完整显示、四周留白、不变形（object-fit: contain） */
.print-body .q-img img.contain { object-fit: contain; }
.print-body .p-sign { width: 100%; margin-top: 14px; }
.print-body .p-sign td { border: 1px solid #444; padding: 5px 7px; vertical-align: top; width: 50%; font-size: 12px; line-height: normal; }
/* 产品合格证版式：居中大标题 + 英文副题 + 编号，紧贴打印线 */
.print-body .cert-title { text-align: center; font-size: 26px; font-weight: 700; letter-spacing: 8px; margin: 2px 0 0; }
.print-body .cert-title img { display: inline-block; }
.print-body .cert-title span { display: inline-block; }
.print-body .cert-en { text-align: center; font-size: 11px; letter-spacing: 3px; color: #555; margin: 2px 0 4px; }
.print-body .cert-no { text-align: right; font-size: 12px; margin-bottom: 2px; }
.print-body .cert-tbl { margin-top: 4px; }
.print-body .cert-concl { font-size: 13px; }

/* 印章叠印（合同章/发货章等）：绝对定位悬浮在签章格右上，半透明+正片叠底盖住文字更像真章；直径 42mm（打印按物理尺寸，屏幕按比例换算） */
.doc-stamp { position: absolute; width: 42mm; height: 42mm; object-fit: contain; opacity: .88;
  mix-blend-mode: multiply; pointer-events: none; transform: rotate(-8deg); z-index: 2; }
/* 公司资料 · 印章管理预览框 */
.seal-prev { display: inline-flex; width: 64px; height: 64px; border: 1px dashed #c3cfdb; border-radius: 8px;
  background: #f7fafc; align-items: center; justify-content: center; overflow: hidden; flex: none; cursor: pointer; transition: background .12s ease, border-color .12s ease; }
.seal-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.seal-prev i { font-style: normal; color: #b3bfcc; font-size: 12px; }

@media print {
  .app-titlebar, .menubar, .tabsbar, .statusbar, .querybar, .btnbar { display: none !important; }
  /* 只打印当前激活的页签，其他页签内容不进纸 */
  .panel { display: none !important; }
  .panel.on { display: block !important; position: static; overflow: visible; }
  .panels { overflow: visible; }
}

/* ---------- 窄屏（手机/平板）通用兜底 ---------- */
@media (max-width: 900px) {
  .form-grid { grid-template-columns: 1fr; }
  .detail { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .modal { width: 96vw; }
}

/* =====================================================================
 * 手机端专项适配 — app.js 在窄屏给 body 加 .m 类，此处所有规则挂在 .m 下
 * ===================================================================== */
/* 消除手机端点击 300ms 延迟与双击缩放误触 */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
/* ★ 锁定缩放（2026-11-18）：让所有元素也走 manipulation，避免子元素默认 touch-action:auto
   重新允许双击缩放。配合 viewport user-scalable=no 与 JS 手势拦截，三层锁定页面缩放比例。
   注意：manipulation 仅禁用双击缩放，保留单指滚动，不影响输入框等交互。 */
body, body * { touch-action: manipulation; }
/* iPhone 刘海屏安全区 */
.app-titlebar { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }

/* ★ 手机状态栏安全区（2026-11-18）：viewport-fit=cover 下标题栏会顶到屏幕最上沿，
   与系统状态栏（时间/信号/电量）重叠。顶部预留 safe-area-inset-top，高度随之内增。 */
body.m .app-titlebar {
  height: auto;
  min-height: 50px;
  padding-top: env(safe-area-inset-top);
  padding-bottom: 6px;
  padding-left: max(10px, env(safe-area-inset-left));
  padding-right: max(10px, env(safe-area-inset-right));
  gap: 6px 8px;
  flex-wrap: wrap;
  align-items: center;
  box-sizing: border-box;
}
body.m .tb-logo { width: 32px; height: 32px; flex: 0 0 auto; }
body.m .tb-title { font-size: 14px; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.m .tb-sub, body.m .tb-info { display: none; }   /* 手机隐藏副标题与顶部统计，让位主标题 */
body.m .tb-user { padding: 5px 9px; font-size: 12px; max-width: 36vw; flex: 0 0 auto; }
body.m .tb-user > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.m .tu-avatar { width: 24px; height: 24px; }

/* ★ 顶部操作区（2026-11-18）：隐藏弹性占位符，让业务员徽标与隐藏/截图/退出按钮
   整体换行到第二行，避开状态栏，保证可见可点击。 */
body.m .tb-spacer { display: none; }
body.m .app-titlebar .tb-mask { flex: 0 0 auto; }
body.m .tb-exit { font-size: 13px; padding: 6px 4px 6px 8px; flex: 0 0 auto; }   /* 加大退出触控区 */

/* 菜单条：触控加高、隐藏滚动条、边缘渐隐提示可滚动 */
body.m .menubar { height: 44px; padding: 0 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
body.m .menubar::-webkit-scrollbar { display: none; }
body.m .mn-item { padding: 0 13px; font-size: 13.5px; }
body.m .menubar { position: relative; }
body.m .menubar::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 22px; background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,.95)); pointer-events: none; }

/* 页签条：触控加大 */
body.m .tabsbar { height: 38px; padding: 0 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
body.m .tabsbar::-webkit-scrollbar { display: none; }
body.m .tab { padding: 8px 8px 8px 13px; font-size: 13px; }
body.m .tab-x { width: 22px; height: 22px; font-size: 12px; }

/* 状态栏：手机隐藏时钟 / Ctrl+S 提示 / 单窗口切换，保留同步与刷新 */
body.m .st-ctrltip, body.m #st_time, body.m #st_solo { display: none !important; }
body.m .statusbar { height: 30px; padding: 0 max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); gap: 10px; }
body.m .statusbar .btn.xs { height: 24px; padding: 0 8px; }

/* 按钮 / 输入触控目标加大（移动端建议 ≥36px） */
body.m .btn { height: 36px; padding: 0 14px; font-size: 13px; }
body.m .btn.sm { height: 32px; }
body.m .btn.xs { height: 28px; padding: 0 10px; font-size: 12px; }
body.m .qi input, body.m .qi select { height: 36px; font-size: 14px; }
body.m .fg input, body.m .fg select, body.m .fg textarea { font-size: 15px; padding: 8px 10px; }   /* ≥16px 防 iOS 聚焦自动放大 */
body.m .lg-row input { font-size: 16px; }
body.m .items-edit input { font-size: 14px; padding: 6px 7px; }
body.m .items-edit th, body.m .items-edit td { padding: 7px 5px; }

/* 查询栏：手机上动作按钮换行铺满 */
body.m .querybar { padding: 10px; gap: 10px; }
body.m .qacts { width: 100%; margin-left: 0; }
body.m .qacts .btn { flex: 1; justify-content: center; }

/* 弹窗：贴底抽屉式 + 动态视口高度，软键盘弹出不遮挡 */
body.m .modal-mask { padding: 0; align-items: flex-end; }
body.m .modal { width: 100vw; max-width: 100vw; border-radius: 14px 14px 0 0; animation: sheetUp .22s ease; padding-bottom: env(safe-area-inset-bottom); }
body.m .modal.wide { width: 100vw; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
body.m .modal-hd { padding: 13px 15px; font-size: 15.5px; }
body.m .modal-x { padding: 8px 6px 8px 12px; font-size: 17px; }
body.m .modal-bd { max-height: calc(100dvh - 150px); padding: 13px 15px; -webkit-overflow-scrolling: touch; }
body.m .modal-ft { padding: 10px 15px calc(10px + env(safe-area-inset-bottom)); gap: 10px; }
body.m .modal-ft .btn { flex: 1; justify-content: center; height: 40px; font-size: 14px; }

/* 提示浮条：手机顶部居中，避开手指操作区 */
body.m .toast-box { left: 12px; right: 12px; top: max(60px, env(safe-area-inset-top)); align-items: center; }
body.m .toast { max-width: 100%; width: 100%; box-sizing: border-box; }

/* 表格：惯性滚动，操作列按钮好按 */
body.m .tbl-wrap { -webkit-overflow-scrolling: touch; }
body.m table.grid td { padding: 9px 9px; }
body.m table.grid th { padding: 9px 9px; }
body.m .tbl-set { top: 0; right: 0; height: 28px; line-height: 26px; padding: 0 11px; font-size: 12.5px; opacity: .92; }
body.m .pager { flex-wrap: wrap; gap: 6px; }
body.m .pager .btn.xs { flex: 1; }

/* ========== 手机端列表卡片化：隐藏表格，改纵向堆叠卡片（消除横向滚动） ========== */
body.m .tbl-holder > .tbl-wrap { display: none; }          /* 隐藏表格 */
body.m .tbl-holder > .tbl-set { display: none; }           /* 隐藏「⚙列」设置（手机端无列操作） */
body.m .tbl-holder > .tcard-list { display: flex; flex-direction: column; gap: 12px; }
body.m .tcard {
  background: #fff; border: 1.5px solid #c3cedb; border-radius: 12px;
  padding: 12px 14px; box-shadow: 0 2px 10px rgba(23,51,79,.14), 0 1px 2px rgba(23,51,79,.06);
}
body.m .tcard:active { background: #f4f8fd; }
body.m .tc-row { display: flex; align-items: flex-start; padding: 5px 0; border-bottom: 1px dashed #eef2f6; }
body.m .tc-row:last-child { border-bottom: none; }
body.m .tc-k {
  flex: none; width: 84px; color: #8a98ab; font-size: 12px; line-height: 1.5;
  padding-right: 8px; box-sizing: border-box; word-break: break-all;
}
body.m .tc-v {
  flex: 1; color: #22374d; font-size: 13.5px; line-height: 1.5;
  word-break: break-word; text-align: left;
}
/* ★ 列表卡片三列布局（2026-11-18 用户诉求：进一步降低卡片高度）。
   对字段较多、适合并排的列表启用 grid 三列；字段改上下结构（label 上、值下）；
   操作列 / 展开区 / 合计卡占满整行；长字段跨整行。 */
body.m .tc-contracts .tcard,
body.m .tc-suppliers .tcard,
body.m .tc-customers .tcard,
body.m .tc-quotes .tcard,
body.m .tc-purchases .tcard,
body.m .tc-deliveries .tcard,
body.m .tc-invoices .tcard,
body.m .tc-products .tcard,
body.m .tc-settlements .tcard {
  display: grid; grid-template-columns: 1fr 1fr 1fr; column-gap: 10px; row-gap: 4px;
}
body.m .tc-contracts .tc-row,
body.m .tc-suppliers .tc-row,
body.m .tc-customers .tc-row,
body.m .tc-quotes .tc-row,
body.m .tc-purchases .tc-row,
body.m .tc-deliveries .tc-row,
body.m .tc-invoices .tc-row,
body.m .tc-products .tc-row,
body.m .tc-settlements .tc-row {
  flex-direction: column; align-items: stretch; padding: 4px 0; border-bottom: none; min-width: 0;
}
body.m .tc-contracts .tc-k,
body.m .tc-suppliers .tc-k,
body.m .tc-customers .tc-k,
body.m .tc-quotes .tc-k,
body.m .tc-purchases .tc-k,
body.m .tc-deliveries .tc-k,
body.m .tc-invoices .tc-k,
body.m .tc-products .tc-k,
body.m .tc-settlements .tc-k {
  width: auto; padding-right: 0; font-size: 10.5px; line-height: 1.35;
}
/* 三列下值字号略收敛，紧凑不换行过多 */
body.m .tc-contracts .tc-v,
body.m .tc-suppliers .tc-v,
body.m .tc-customers .tc-v,
body.m .tc-quotes .tc-v,
body.m .tc-purchases .tc-v,
body.m .tc-deliveries .tc-v,
body.m .tc-invoices .tc-v,
body.m .tc-products .tc-v,
body.m .tc-settlements .tc-v {
  font-size: 13px; line-height: 1.4;
}
body.m .tc-contracts .tc-op, body.m .tc-contracts .tc-exp,
body.m .tc-suppliers .tc-op, body.m .tc-suppliers .tc-exp,
body.m .tc-customers .tc-op, body.m .tc-customers .tc-exp,
body.m .tc-quotes .tc-op, body.m .tc-quotes .tc-exp,
body.m .tc-purchases .tc-op, body.m .tc-purchases .tc-exp,
body.m .tc-deliveries .tc-op, body.m .tc-deliveries .tc-exp,
body.m .tc-invoices .tc-op, body.m .tc-invoices .tc-exp,
body.m .tc-products .tc-op, body.m .tc-products .tc-exp,
body.m .tc-settlements .tc-op, body.m .tc-settlements .tc-exp { grid-column: 1 / -1; }
body.m .tc-contracts .tcard-total, body.m .tc-suppliers .tcard-total,
body.m .tc-customers .tcard-total, body.m .tc-quotes .tcard-total,
body.m .tc-purchases .tcard-total, body.m .tc-deliveries .tcard-total,
body.m .tc-invoices .tcard-total, body.m .tc-products .tcard-total,
body.m .tc-settlements .tcard-total { grid-column: 1 / -1; }
/* 长文本字段（备注/地址/开户行/账户/描述/内容/名称/联系人等）跨整行独占，避免三列下挤坏 */
body.m .tc-row[data-k="remark"], body.m .tc-row[data-k="note"],
body.m .tc-row[data-k="memo"], body.m .tc-row[data-k="addr"],
body.m .tc-row[data-k="address"], body.m .tc-row[data-k="bank"],
body.m .tc-row[data-k="account"], body.m .tc-row[data-k="scope"],
body.m .tc-row[data-k="feature"], body.m .tc-row[data-k="desc"],
body.m .tc-row[data-k="content"], body.m .tc-row[data-k="name"],
body.m .tc-row[data-k="supplierName"], body.m .tc-row[data-k="customerName"],
body.m .tc-row[data-k="contact"] { grid-column: 1 / -1; }
/* 合同编号（no）不再跨列：与「签订日期」同排，节约一行纵向空间（编号 12 字符等宽在窄格内可单行放下） */
body.m .tc-row[data-k="no"] { grid-column: auto; }
body.m .tc-row[data-k="no"] .tc-v { white-space: nowrap; overflow: visible; }
/* ★ 极窄屏响应式降级（<360px）：三列太挤时降为两列，避免内容溢出/间距混乱 */
@media (max-width: 359px) {
  body.m .tc-contracts .tcard,
  body.m .tc-suppliers .tcard,
  body.m .tc-customers .tcard,
  body.m .tc-quotes .tcard,
  body.m .tc-purchases .tcard,
  body.m .tc-deliveries .tcard,
  body.m .tc-invoices .tcard,
  body.m .tc-products .tcard,
  body.m .tc-settlements .tcard {
    grid-template-columns: 1fr 1fr; column-gap: 12px;
  }
}
/* 值右对齐的列（金额/数量）在卡片里也右对齐 */
body.m .tc-v .num, body.m .tc-v b { font-variant-numeric: tabular-nums; }

/* ★ 金额/数量字段（2026-11-18 用户诉求）：金额是关键信息，手机端必须单行显示、不得换行，
   右对齐保持数字列整齐，字号略收敛保证三列窄格内单行放下、不裁切、不溢出、不遮挡。
   命中条件：ui.js 对 align:right 的列加 .tc-row-num 类（覆盖合同/报价/采购/送货单等所有列表金额列）。 */
body.m .tc-row-num .tc-v {
  white-space: nowrap;          /* 金额单行，不折行 */
  text-align: right;            /* 数字右对齐，列间对齐协调 */
  overflow: visible;            /* 不裁切 */
  font-size: 12.5px;            /* 略收敛，保证窄格单行放下 */
  line-height: 1.4;
}
body.m .tc-row-num .tc-v .mono,
body.m .tc-row-num .tc-v b {
  white-space: nowrap;          /* 等宽金额数字强制单行 */
}
/* 金额标签：去掉全局 break-all 的强制断词，让中文标签自然显示、不裁切首字 */
body.m .tc-row-num .tc-k {
  word-break: normal;
  white-space: nowrap;
  overflow: visible;
}
/* ★ 短值字段内联（2026-11-18 用户诉求）：日期/口径/业务员/审核等短值字段，
   标签+值合并为一行（「标签: 值」），不再「标签在上、值在下」占两行，节约纵向空间。
   两个相邻的短字段在 grid 里自然各占一格并排。 */
body.m .tc-row-inline {
  flex-direction: row; align-items: baseline; gap: 5px; padding: 5px 0;
}
body.m .tc-row-inline .tc-k {
  flex: none; width: auto; padding-right: 0; word-break: normal; white-space: nowrap;
  color: #8a98ab; font-size: 11px;
}
body.m .tc-row-inline .tc-v {
  flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 13px; line-height: 1.4; text-align: left;
}
/* 操作列：底部横排，按钮原样保留 */
body.m .tc-op { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #eef2f6; align-items: center; }
/* ★ 单个操作列容器（2026-11-18 调整）：
   - 默认自适应宽度、横向排列，让金额/状态等「单链接型」操作列多列并排省空间；
   - .tc-opi-full（含多个 .btn 的聚合操作列，如合同 _op 一整串按钮）占满整行，
     内部按钮再换行，避免横向溢出 */
body.m .tc-opi { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
body.m .tc-opi-full { display: flex; width: 100%; }
/* 单链接操作列的 label 前缀（如「差额」「红冲」「平账」），横向多列排列后仍可辨识 */
body.m .tc-opi .tc-opi-k { font-size: 11px; color: #8a98ab; margin-right: 2px; }
body.m .tc-op .btn { height: 34px; padding: 0 12px; font-size: 13px; white-space: nowrap; }
/* 卡片展开区（opt.expand） */
body.m .tc-exp { margin-top: 10px; padding-top: 10px; border-top: 1px solid #eef2f6; }
/* ★ 展开区顶部「收起」条（2026-11-18）：明确的一键收起入口，把卡片折叠回初始状态 */
body.m .tc-foldbar { display: flex; align-items: center; justify-content: center; padding: 7px 0;
  font-size: 12px; color: #2b6cb0; cursor: pointer; user-select: none;
  background: #f0f6fd; border: 1px dashed #c9ddf3; border-radius: 7px; margin-bottom: 8px; }
body.m .tc-foldbar:active { background: #e2eefb; }
body.m .tc-exp-bd { width: 100%; }
body.m .tcard-total { background: #f7f9fc; border-color: #dde5ed; }
body.m .tcard-total .tc-v { font-weight: 700; }

/* KPI / 工作台 */
body.m .kpis { grid-template-columns: repeat(2, 1fr); }
body.m .wc-hero { padding: 14px 16px; }
body.m .wc-sticky-top { top: -9px; margin: -9px -9px 0; padding: 9px 9px 9px; }
body.m .wc-hi { font-size: 16.5px; }
body.m .wc-quote { font-size: 19px; margin-top: 5px; }
body.m .wq { padding: 9px 12px; }

/* A4 单据预览：手机减小留白（fitA4 会自动按宽度缩放纸张） */
body.m .doc-wrap { padding: 4px 0 2px; }
body.m .panel { padding: 9px; }

/* 登录页：小屏去掉外框阴影占满视口，键盘弹出不顶飞 */
@media (max-width: 640px) {
  .login-wrap { align-items: flex-start; padding: max(7vh, env(safe-area-inset-top)) 0 20px; }
  .login-box { border-radius: 0 0 14px 14px; box-shadow: 0 10px 34px rgba(23,51,79,.16); }
  .lg-brand { padding: 20px 22px 17px; }
  .lg-form { padding: 20px 22px 6px; }
  .lg-row input, .lg-row select { height: 42px; }
  .lg-btn { height: 44px; }
}

/* ================= 内部沟通群（mod_chat.js） ================= */
.mn-item .mn-badge { display: inline-block; min-width: 16px; height: 16px; line-height: 16px; padding: 0 4px;
  margin-left: 5px; border-radius: 8px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 700;
  text-align: center; vertical-align: 1px; }
/* ★ 菜单角标闪烁（2026-11-21）：待审批删除申请 / 财务待核对，红点呼吸闪烁提醒管理员/财务 */
.mn-item .mn-badge-blink { animation: mnBadgeBlink 1.1s ease-in-out infinite; }
@keyframes mnBadgeBlink { 0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(229,72,77,.55); } 50% { opacity: .45; box-shadow: 0 0 0 4px rgba(229,72,77,0); } }

/* ★ 「管理」页签（2026-11-18）：数据备份/用户管理/功能管理/操作日志 四合一，页内顶部切换 */
.mg-tabbar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 8px 12px 0;
  border-bottom: 1px solid var(--line); background: #fff; }
.mg-tab { padding: 8px 16px; cursor: pointer; font-size: 13.5px; color: #3d4f66; border-bottom: 2.5px solid transparent;
  white-space: nowrap; user-select: none; transition: background .12s ease, color .12s ease, border-color .12s ease; }
.mg-tab:hover { background: #f3f7fc; }
.mg-tab.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 700; }
.mg-tabbody { padding: 12px; }
.mg-tabpane { min-height: 120px; }

/* ★ 财务「漏账登记」橙色吸顶按键（2026-11-19）：待核对合同页顶部，向下滚动列表时保持可见 */
.fin-recon-bar { position: sticky; top: -12px; z-index: 30; display: flex; align-items: center; gap: 10px;
  margin: -12px -12px 10px; padding: 10px 12px; background: linear-gradient(90deg, #fff6ec, #ffe9d0);
  border-bottom: 1px solid #f4d9b8; }
.fin-recon-btn { background: #e2711d; color: #fff; border: none; font-weight: 700; padding: 9px 20px;
  font-size: 14px; border-radius: 7px; box-shadow: 0 2px 8px rgba(226,113,29,.35); }
.fin-recon-btn:hover { background: #d06112; color: #fff; }
.fin-recon-tip { font-size: 12.5px; color: #a8693a; }
/* ★ 待对账时橙色按钮呼吸闪烁（2026-11-19）：有 pending 登记时加 .blink，醒目提示 */
.fin-recon-btn { position: relative; }
.fin-recon-btn.blink { animation: reconBlink 1.1s ease-in-out infinite; }
@keyframes reconBlink {
  0%, 100% { background: #e2711d; box-shadow: 0 2px 8px rgba(226,113,29,.35); }
  50% { background: #ff8c2e; box-shadow: 0 0 16px 4px rgba(255,140,46,.65); }
}
.fin-recon-badge { position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; line-height: 18px;
  padding: 0 5px; border-radius: 9px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 700;
  text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
body.m .fin-recon-bar { top: -9px; margin: -9px -9px 8px; padding: 9px; flex-wrap: wrap; }




.chat-wrap { margin-top: 10px; border: 1px solid #e2e9f1; border-radius: 8px; background: #fff; overflow: hidden; display: flex; }
/* ★ 多群（2026-10-20）：左侧群列表 + 右侧消息区 */
.chat-groups { flex: 0 0 180px; width: 180px; border-right: 1px solid #e8eef5; background: #fbfcfe; padding: 8px; overflow-y: auto; }
.chat-gitem { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 7px; cursor: pointer;
  font-size: 13.5px; color: #33465f; margin-bottom: 2px; transition: background .1s ease; }
.chat-gitem:hover { background: #eef4fb; }
.chat-gitem.on { background: #e3eefb; color: #1a5fb4; font-weight: 600; }
.chat-gitem .chat-gname { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-gitem .chat-gbadge { flex: 0 0 auto; min-width: 16px; height: 16px; line-height: 16px; padding: 0 4px;
  border-radius: 8px; background: #e5484d; color: #fff; font-size: 11px; text-align: center; }
.chat-main-col { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.chat-body { height: calc(100vh - 330px); height: calc(100dvh - 330px); min-height: 280px; overflow-y: auto; padding: 12px 14px; background: #f7f9fc; }
.chat-body .empty { padding: 40px 0; }
.chat-msg { display: flex; gap: 9px; margin-bottom: 12px; align-items: flex-start; }
.chat-msg .chat-av { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 8px; background: #dfe9f5; color: #1a5fb4;
  font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.chat-msg.me .chat-av { background: #1a5fb4; color: #fff; }
.chat-main { min-width: 0; flex: 1 1 auto; }
.chat-meta { display: flex; align-items: center; gap: 7px; font-size: 12px; margin-bottom: 3px; flex-wrap: wrap; }
.chat-meta b { font-size: 12.5px; color: #17334f; }
.chat-meta .dim { font-size: 11.5px; }
.chat-del { cursor: pointer; color: #9fb0c2; font-size: 12px; padding: 0 2px; }
.chat-del:hover { color: #e5484d; }
.chat-text { display: inline-block; max-width: 100%; padding: 7px 11px; border-radius: 8px; background: #fff;
  border: 1px solid #e5ecf4; font-size: 13.5px; line-height: 1.65; color: #22364d; white-space: normal;
  word-break: break-word; overflow-wrap: anywhere; }
.chat-msg.me .chat-text { background: #eaf3ff; border-color: #cfe2fa; }
.chat-input { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #e8eef5; background: #fff; align-items: stretch; }
.chat-input textarea { flex: 1 1 auto; resize: vertical; min-height: 42px; max-height: 160px; font-size: 13.5px;
  line-height: 1.6; padding: 9px 11px; border: 1px solid #d7e0ea; border-radius: 7px; font-family: inherit; }
.chat-input textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(26,95,180,.10); }
.chat-input .btn { align-self: stretch; height: auto; padding: 0 20px; }
body.m .chat-body { height: calc(100vh - 300px); height: calc(100dvh - 300px); min-height: 220px; }
body.m .chat-text { font-size: 14px; }

/* ★ 沟通群手机布局（2026-11-18）：把左侧「全公司/小群」列表改成顶部横向标签栏，
   不再占用左侧 180px 列，消息区拉通全宽，提升移动端阅读体验。 */
body.m .chat-wrap { flex-direction: column; }
body.m .chat-groups {
  flex: 0 0 auto;
  width: 100%;
  border-right: none;
  border-bottom: 1px solid #e8eef5;
  padding: 8px 10px;
  display: flex;
  flex-direction: row;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  white-space: nowrap;
}
body.m .chat-groups::-webkit-scrollbar { display: none; }
body.m .chat-gitem {
  flex: 0 0 auto;
  margin-bottom: 0;
  padding: 7px 14px;
  border-radius: 16px;
  border: 1px solid #dbe4ee;
  background: #fff;
  font-size: 13px;
  white-space: nowrap;
}
body.m .chat-gitem.on { background: #1a5fb4; color: #fff; border-color: #1a5fb4; }
body.m .chat-gitem .chat-gbadge { background: #e5484d; }
body.m .chat-main-col { min-height: 0; }

/* 沟通群：图片消息 + 图片按钮 */
.chat-img-wrap { margin-top: 5px; max-width: 340px; }
.chat-img { display: block; max-width: 100%; max-height: 120px; border-radius: 8px; border: 1px solid #dbe5ef;
  background: #fff; cursor: zoom-in; transition: transform .12s ease; }
.chat-img:hover { transform: scale(1.01); }
.chat-img-name { font-size: 11px; margin-top: 3px; word-break: break-all; }
.chat-input .chat-img-btn { align-self: stretch; height: auto; padding: 0 12px; white-space: nowrap; }
/* ★ @ 提及（2026-11-22）：输入区 @ 按钮 + 成员选择列表 + 气泡内 @名字 高亮 */
.chat-input .chat-at-btn { align-self: stretch; height: auto; width: 42px; padding: 0; font-weight: 700; font-size: 15px; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.chat-mention { color: #1a5fb4; background: #e6f0ff; border-radius: 3px; padding: 0 3px; font-weight: 600; }
.chat-mention.me { color: #fff; background: #1a5fb4; }
.chat-msg.mentioned .chat-text { border: 1px solid #9ec5f2; }
/* ★ 撤回消息（2026-11-22）：灰色斜体提示 */
.chat-text.chat-recalled { background: #f2f5f9; border-color: #e2e8f0; color: #8a99ab; font-style: italic; }
.chat-del { cursor: pointer; color: #9fb0c2; font-size: 12px; padding: 0 4px; margin-left: 4px; }
.chat-del:hover { color: #1a5fb4; }
.at-list { max-height: 320px; overflow: auto; }
.at-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.at-row:hover { background: #f0f5fb; }
.at-row .chat-av { width: 30px; height: 30px; border-radius: 50%; background: #eaf3ff; color: #1a5fb4; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: 0 0 auto; }
.chat-input.chat-drop-on { background: #eef5ff; box-shadow: inset 0 0 0 2px var(--brand); }
.chat-input.chat-drop-on textarea { border-color: var(--brand); }
/* ★ 📎 图片按钮作为拖放目标（2026-11-22）：拖到按钮上高亮 */
.chat-input .chat-img-btn.chat-drop-on { background: #eef5ff; box-shadow: inset 0 0 0 2px var(--brand); color: var(--brand); }
body.m .chat-img-wrap { max-width: 100%; }
/* ★ 待发送图片附件区（2026-11-22）：拖入/选择/粘贴/截图先放这里，点「发送」才发出 */
.chat-pending { padding: 8px 12px 0; border-top: 1px solid #eef2f7; background: #fbfdff; }
.chat-pending-hd { font-size: 12px; margin-bottom: 6px; }
.chat-pending-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-pending-item { position: relative; width: 96px; background: #fff; border: 1px solid #dbe5ef; border-radius: 8px; overflow: hidden; }
.chat-pending-thumb { display: block; width: 100%; height: 68px; object-fit: cover; background: #f0f4f9; }
.chat-pending-name { font-size: 11px; padding: 3px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-pending-del { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; line-height: 18px; text-align: center;
  background: rgba(0,0,0,.55); color: #fff; border-radius: 50%; font-size: 11px; cursor: pointer; }
.chat-pending-del:hover { background: #e5484d; }
/* 多图消息：多张图横向排列 */
.chat-imgs-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 5px; }
.chat-imgs-wrap .chat-img-wrap { margin-top: 0; }

/* 通用多图上传区（multiImgPicker）拖入图片高亮 */
[data-mdrop] { transition: background .12s ease, border-color .12s ease; }
[data-mdrop].mdrop-on { background: #eef5ff; border-color: var(--brand) !important; box-shadow: inset 0 0 0 2px var(--brand); }
/* 采购/付款单图片单元格拖拽框（data-pdrop）高亮 */
[data-pdrop] { transition: background .12s ease, border-color .12s ease; }
[data-pdrop].mdrop-on { background: #eef5ff; border-color: var(--brand) !important; box-shadow: inset 0 0 0 2px var(--brand); }
/* 通用拖拽上传区（UI.bindDrop 绑定的任意元素）高亮 */
.mdrop-on { background: #eef5ff !important; border-color: var(--brand) !important; box-shadow: inset 0 0 0 2px var(--brand); }

/* ---------- 多选下拉（「完结月份」等需同时选多项的筛选） ---------- */
.msel { position: relative; }
.msel > summary { list-style: none; cursor: pointer; display: flex; align-items: center; height: 30px; min-width: 150px;
  padding: 0 26px 0 9px; border: 1px solid #ccd8e5; border-radius: 5px; background: #fff; font-size: 12.5px;
  color: var(--text); position: relative; user-select: none; }
.msel > summary::-webkit-details-marker { display: none; }
.msel > summary::after { content: "▼"; position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  color: var(--dim); font-size: 9px; }
.msel[open] > summary { border-color: var(--brand-2); box-shadow: 0 0 0 2.5px rgba(63,141,227,.13); }
.msel-pop { position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; min-width: 224px; max-height: 272px;
  overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 7px;
  box-shadow: 0 10px 28px rgba(23,51,79,.16); padding: 6px; }
.msel-quick { display: flex; gap: 6px; padding: 2px 2px 6px; border-bottom: 1px dashed var(--line); margin-bottom: 4px; }
.msel-q { flex: 1; border: 1px solid var(--line); background: #f7f9fc; border-radius: 5px; font-size: 11.5px;
  padding: 3px 0; cursor: pointer; color: #45607e; font-family: var(--font); white-space: nowrap; }
.msel-q:hover { background: #eaf2fb; border-color: var(--brand-2); color: var(--brand); }
.msel-pop label { display: flex; align-items: center; gap: 7px; padding: 5px 7px; border-radius: 5px;
  cursor: pointer; font-size: 12.5px; white-space: nowrap; }
.msel-pop label:hover { background: #f3f7fc; }
.msel-pop label input[type="checkbox"] { height: auto; min-width: 0; width: 14px; padding: 0; margin: 0; }
.msel-pop label em { margin-left: auto; font-size: 11px; color: var(--dim); padding-left: 10px; }
.msel-empty { padding: 8px 7px; font-size: 12px; color: var(--dim); }
/* 单选日期下拉（点选某个日期，如「我的报价」按日期筛选） */
.dpk-item { display: block; width: 100%; text-align: left; padding: 6px 9px; border: none; background: none;
  border-radius: 5px; cursor: pointer; font-size: 12.5px; color: var(--text); font-family: var(--font);
  white-space: nowrap; }
.dpk-item:hover { background: #f3f7fc; color: var(--brand); }
.dpk-item.on { background: #eaf2fb; color: var(--brand); font-weight: 700; }
.dpk .msel-quick { margin-bottom: 0; }
body.m .msel > summary { height: 36px; font-size: 14px; }
body.m .msel-pop { min-width: 240px; max-height: 320px; }
body.m .msel-pop label { font-size: 14px; padding: 7px; }

/* ---------------- 可搜索下拉（searchselect，如「关联合同」按编号/客户名搜索） ---------------- */
.ssel { position: relative; }
.ssel input.ssel-txt { width: 100%; padding-right: 26px; }
.ssel .ssel-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); cursor: pointer;
  color: var(--dim); font-size: 13px; line-height: 1; padding: 2px; }
.ssel .ssel-clear:hover { color: var(--red); }
.ssel-pop { position: absolute; z-index: 70; top: calc(100% + 4px); left: 0; min-width: 100%; max-height: 264px;
  overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 7px;
  box-shadow: 0 10px 28px rgba(23,51,79,.16); padding: 4px; }
.ssel-pop .ssel-item { padding: 7px 9px; border-radius: 5px; cursor: pointer; font-size: 12.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.ssel-pop .ssel-item:hover, .ssel-pop .ssel-item.on { background: #eaf2fb; color: var(--brand); }
.ssel-pop .ssel-item b { color: var(--brand); font-weight: 600; }
.ssel-pop .ssel-item .ssel-sub { font-size: 11px; color: var(--dim); margin-left: 6px; }
.ssel-pop .ssel-none { padding: 8px 9px; font-size: 12px; color: var(--dim); }

/* ---------------- 导入明细：表头行 / 列对应（未匹配的列手动指定字段） ---------------- */
.imp-map { border: 1px solid var(--line); border-radius: 8px; background: #f7fafe; padding: 8px 10px; }
.imp-map > summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--brand); outline: none; }
.imp-map > summary::marker { color: var(--brand); }
.imp-map .tbl-wrap { background: #fff; border-radius: 6px; }
.imp-map select.impk { width: 100%; padding: 3px 4px; font-size: 12px; }
.imp-map tr.imp-un > td { background: #fff7ec; }
.imp-map tr.imp-un select.impk { border-color: var(--orange); }

/* ---------------- 报价「算重量」浮动小窗（边填表边算，可拖动 / 最小化） ---------------- */
.sw-float { position: fixed; right: 20px; bottom: 20px; width: 362px; max-width: calc(100vw - 24px); max-height: 78vh; display: flex; flex-direction: column; background: #fff; border: 1px solid #cfdcea; border-radius: 10px; box-shadow: 0 14px 40px rgba(10,30,60,.26); z-index: 60; }
.sw-float.flash { animation: swflash .34s ease; }
@keyframes swflash { 0% { box-shadow: 0 0 0 3px rgba(26,95,180,.55), 0 14px 40px rgba(10,30,60,.26); } 100% { box-shadow: 0 14px 40px rgba(10,30,60,.26); } }
.sw-float-hd { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 9px 9px 0 0; background: linear-gradient(120deg, #1a5fb4, #3f8de3); color: #fff; font-size: 12.5px; font-weight: 700; cursor: move; -webkit-user-select: none; user-select: none; }
.sw-float-tgt { font-weight: 400; font-size: 11.5px; color: #dbeaff; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-float-hd .sp { flex: 1; }
.sw-float-ic { cursor: pointer; padding: 0 4px; border-radius: 4px; font-size: 12px; line-height: 16px; }
.sw-float-ic:hover { background: rgba(255,255,255,.24); }
.sw-float-bd { padding: 10px 12px; overflow: auto; }
.sw-float.min .sw-float-bd, .sw-float.min .sw-float-ft { display: none; }
.sw-float.min { width: 220px; }
.sw-float-ft { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 9px 12px; border-top: 1px solid var(--line); background: #fafcfe; border-radius: 0 0 9px 9px; }
.sw-float .form-grid { grid-template-columns: 1fr; gap: 8px 10px; }
.sw-float .form-grid.sw-params { grid-template-columns: 1fr 1fr; }
.sw-float .fg { min-width: 0; }
.sw-float .card { margin-bottom: 0; }
.sw-float .fg > span.dim { display: block; margin-top: 2px; font-size: 11px; }
@media (max-width: 700px) { .sw-float { right: 8px; bottom: 8px; width: calc(100vw - 16px); max-height: 62vh; } }
/* ⚖ 算重量当前目标行：浅黄底，一眼看出会填到哪一行 */
.items-edit tr.wrow td { background: #fff8e3; }

/* ============ 钢管质保书（产品质量保证书填写工具 · 整页版） ============ */
.wp-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.wp-top .sp { flex: 1; }
.wp-legend { display: flex; gap: 20px; padding: 8px 14px; background: var(--panel, #fff); border: 1px solid var(--line, #e0e4ea); border-radius: 7px; font-size: 12.5px; flex-wrap: wrap; margin-bottom: 10px; }
.wp-legend span { display: flex; align-items: center; gap: 6px; }
.wp-dot { display: inline-block; width: 13px; height: 13px; border-radius: 3px; }
.wp-dot.red { background: #fdeaea; border: 2px solid #d92b2b; }
.wp-dot.green { background: #e3f5ec; border: 2px solid #159d63; }
.wp-dot.gray { background: #f2f4f7; border: 2px solid #b0bac6; }
.wp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 14px; }
.wp-fg { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wp-fg.w100 { grid-column: 1 / -1; }
.wp-fg label { font-size: 12px; color: #5a6b80; font-weight: 500; }
.wp-fg label i { color: #d92b2b; font-style: normal; }
.wp-fg input, .wp-fg select { padding: 6px 10px; border: 1px solid #dde5ed; border-radius: 6px; font-size: 13px; background: #fff; color: #263238; font-family: inherit; width: 100%; }
.wp-fg input:focus, .wp-fg select:focus { outline: none; border-color: var(--brand, #1a5fb4); box-shadow: 0 0 0 3px rgba(26,95,180,.1); }
.wp-fg input.wp-readonly { background: #fafbfd; color: #455a64; font-weight: 600; }
.wp-fg .wp-tip { font-size: 11px; color: #98a5b3; }
.wp-fg .wp-chk { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #455a64; margin-top: 2px; cursor: pointer; user-select: none; }
.wp-fg .wp-chk input { width: auto; flex: 0 0 auto; }
.wp-tip { font-size: 11px; color: #78909c; margin-top: 6px; line-height: 1.6; }
.wp-hints { font-size: 11.5px; color: #159d63; line-height: 1.8; margin-top: 12px; background: #f1f8f4; border-radius: 6px; padding: 9px 12px; }
.wp-hints b { color: #1b5e20; }
.wp-sec { font-size: 13px; font-weight: 600; color: #37474f; margin: 14px 0 10px; padding-bottom: 7px; border-bottom: 2px solid #e0e0e0; }
/* 牌号编辑弹窗里的取值范围格子 */
.wp-rg { display: grid; grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); gap: 9px; }
.wp-rg-item { display: flex; flex-direction: column; min-width: 0; }
.wp-rg-item label { font-size: 11px; font-weight: 600; color: #455a64; margin-bottom: 3px; }
.wp-rg-item.auto label { color: #159d63; }
.wp-rg-item.manual label { color: #d92b2b; }
.wp-rg-item input { width: 100%; padding: 6px 9px; border: 1px solid #ddd; border-radius: 5px; font-size: 13px; font-family: inherit; }
.wp-rg-item input:focus { outline: none; border-color: #1565c0; box-shadow: 0 0 0 2px rgba(21,101,192,.12); }
/* 成分/力学数据表格（红绿灰三色格子） */
.wp-tbl-scroll { overflow: auto; border: 1px solid var(--line, #e0e4ea); border-radius: 7px; }
.wp-tbl { border-collapse: collapse; width: 100%; font-size: 12px; }
.wp-tbl th { background: #eceff1; color: #455a64; padding: 7px 5px; text-align: center; border: 1px solid #cfd8dc; font-weight: 600; font-size: 11px; white-space: nowrap; }
.wp-tbl th.wp-th-toggle { cursor: pointer; background: #fdeaea; color: #c62828; user-select: none; }
.wp-tbl th.wp-th-toggle:hover { background: #f8d7d7; }
.wp-tbl th.wp-th-toggle::after { content: ' ⇅'; font-size: 10px; }
.wp-tbl td { border: 1px solid #e0e0e0; padding: 0; text-align: center; vertical-align: middle; }
.wp-tbl td.seq { background: #eceff1; color: #546e7a; font-weight: 600; padding: 4px 6px; }
.wp-tbl td input { width: 100%; border: none; background: transparent; text-align: center; font-size: 12px; padding: 5px 3px; font-family: inherit; color: inherit; box-sizing: border-box; }
.wp-tbl td input:focus { outline: 2px solid #1565c0; border-radius: 3px; }
.wp-tbl td.red { background: #fff3f3; }
.wp-tbl td.red input { color: #c62828; }
.wp-tbl td.green { background: #f1f8f2; }
.wp-tbl td.green input { color: #2e7d32; font-weight: 600; }
.wp-actions { display: flex; gap: 10px; padding: 14px 16px; background: var(--panel, #fff); border: 1px solid var(--line, #e0e4ea); border-radius: 7px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
/* 钢管质保书 docx 模板版式预览（对齐 template.docx 17 行单表结构，34 列网格） */
.wp-doc-head { text-align: center; margin-bottom: 8px; }
.wp-doc-title { font-size: 32px; font-weight: 700; letter-spacing: 2px; display: flex; align-items: center; justify-content: center; gap: 6px; line-height: 1.2; }
.wp-doc-title-cn { letter-spacing: 10px; }
.wp-doc-sub-en { font-size: 20px; font-weight: 700; letter-spacing: 3px; color: #222; margin-top: 4px; }
/* 抬头左右两行：左项靠左、右项靠右（公司名+TS编号 / 英文+材质单编号） */
.wp-doc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.wp-doc-company { text-align: left; font-size: 16px; font-weight: 700; letter-spacing: 1px; color: #111; }
.wp-doc-sub { font-size: 11.5px; color: #37474f; letter-spacing: .5px; text-align: left; }
.wp-doc-ts { font-size: 12.5px; font-weight: 700; color: #111; letter-spacing: .5px; text-align: right; }
.wp-doc-no { letter-spacing: 0; font-size: 12.5px; text-align: right; }
.wp-doc-tbl { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 1.35; table-layout: fixed; }
.wp-doc-tbl th, .wp-doc-tbl td { border: 1px solid #444; padding: 4px 4px; vertical-align: middle; overflow: hidden; }
.wp-doc-tbl th { text-align: center; font-weight: 600; }
.wp-doc-tbl td { text-align: center; }
.wp-doc-tbl td.lbl { text-align: left; white-space: nowrap; }
.wp-doc-tbl td .en, .wp-doc-tbl th .en { display: block; color: #777; font-weight: 400; letter-spacing: .3px; }
.wp-doc-tbl td.c { text-align: center; }
.wp-doc-tbl td.mono, .wp-doc-tbl td.c.mono { font-family: Consolas, Menlo, monospace; }
.wp-doc-head-tbl { margin-top: 8px; }
/* 表内标题行（模板里「化学成分/物理性能」是跨 34 列的整行合并单元格，非独立标题） */
.wp-doc-tbl td.wp-doc-sec { text-align: left; font-weight: 700; font-size: 13px; letter-spacing: 2px; background: #fff; border-top: none; }
.wp-doc-foot { margin-top: 0; }
.wp-doc-foot td { height: 34px; }
/* 质保书预览印章：混排模式让白底透明、居中叠在对应格上 */
.wp-doc-tbl .wp-doc-stamp-cell { position: relative; }
.wp-doc-stamp { display: inline-block; object-fit: contain; opacity: .92; mix-blend-mode: multiply; vertical-align: middle; }
/* 签发单位章：浮在文字上方，绝对定位居中；格 overflow 放开避免裁剪残缺 */
.wp-doc-tbl td.wp-doc-stamp-box { position: relative; overflow: visible; }
.wp-doc-stamp-company { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); opacity: .92; mix-blend-mode: multiply; z-index: 5; pointer-events: none; }
/* 公司 logo 水印：仅勾选 TS 编号时显示；单个大 logo 居中浮在文字上方，极淡，倾斜 18° */
.wp-doc-wm { position: absolute; top: 50%; left: 50%; width: 90mm; height: 90mm; transform: translate(-50%, -50%) rotate(-18deg); pointer-events: none; z-index: 10; background-repeat: no-repeat; background-size: contain; background-position: center; opacity: .1; }
/* 质保书 A4 横向预览容器（模板为 landscape） */
.doc-preview.wp-landscape { width: 297mm; min-height: 210mm; padding: 25.4mm 19mm; }
@media print {
  .wp-doc-tbl th, .wp-doc-tbl td { border-color: #000; }
}

/* ---------- 工作台「记事本 · 待办事项」 ---------- */
.note-add { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.note-add input[type="text"] { flex: 1; height: 32px; padding: 0 10px; border: 1.5px solid #b9cfe8; border-radius: 6px; font-size: 13px; background: #eaf3fd; color: var(--text); }
.note-add input[type="text"]::placeholder { color: #8aa3c0; }
.note-add input[type="text"]:focus { border-color: var(--brand-2); background: #fff; box-shadow: 0 0 0 3px rgba(63,141,227,.16); outline: none; }
.note-add input[type="date"] { height: 32px; padding: 0 8px; border: 1.5px solid #b9cfe8; border-radius: 6px; font-size: 12px; color: var(--text); background: #eaf3fd; }
.note-list { max-height: 180px; overflow-y: auto; }
.note-row { display: flex; align-items: center; gap: 8px; padding: 7px 6px; border-bottom: 1px dashed var(--line); font-size: 13px; }
.note-row:last-child { border-bottom: none; }
.note-chk { cursor: pointer; font-size: 15px; line-height: 1; user-select: none; flex-shrink: 0; }
.note-txt { flex: 1; word-break: break-all; line-height: 1.5; }
.note-date { font-size: 11px; color: var(--dim); white-space: nowrap; flex-shrink: 0; cursor: pointer; padding: 2px 5px; border-radius: 4px; }
.note-date:hover { background: rgba(26, 95, 180, .08); color: var(--brand); }
.note-date.overdue { color: var(--up); font-weight: 600; }
.note-del { cursor: pointer; color: var(--dim); font-size: 13px; padding: 0 3px; flex-shrink: 0; visibility: hidden; }
.note-row:hover .note-del { visibility: visible; }
.note-del:hover { color: var(--up); }
.note-row.note-done .note-txt { color: var(--dim); text-decoration: line-through; }
.note-row.note-overdue { background: #fdeeee; border-radius: 6px; }
.note-row.note-overdue .note-txt { color: var(--up); }
.note-grp { padding: 8px 6px 4px; font-size: 12px; color: var(--dim); border-top: 1px solid var(--line); }

/* ---------- 工作台「每日打卡」按钮 + 打卡记录 ---------- */
.wc-checkin { margin-left: 6px; padding: 3px 12px; border: none; border-radius: 16px; cursor: pointer;
  font-size: 13px; font-weight: 700; color: var(--brand); background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.22); vertical-align: middle; transition: transform .1s; }
.wc-checkin:hover { transform: translateY(-1px); }
.wc-checkin.done { color: #fff; background: linear-gradient(120deg, #ffb300, #ff9500); }
.ck-list { max-height: 360px; overflow-y: auto; }
.ck-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px dashed var(--line); font-size: 13px; }
.ck-row:last-child { border-bottom: none; }
.ck-ico { font-size: 16px; }
.ck-date { flex: 1; }
.ck-time { color: var(--dim); }

/* ---------- 加工预算（mach_cost.js）：多工序叠加计价 ---------- */
.mc-wrap { font-size: 13px; }
.mc-tip { color: var(--dim, #888); margin-bottom: 10px; }
.mc-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line, #e3e3e3); border-radius: 8px; margin-bottom: 10px; background: var(--pri-soft, #eef4ff); }
.mc-bar-label { font-weight: 700; }
.mc-bar-hint { font-size: 12px; color: var(--dim, #888); }
.mc-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 8px; border: none; border-bottom: 1px solid #3ba05a; border-radius: 0; margin-bottom: 0; background: transparent; }
.mc-row:last-of-type { border-bottom: 1px solid #2f8a4b; }
.mc-row .mc-params { flex: 1; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 220px; }
.mc-in { padding: 4px 6px; border: 1px solid var(--line, #ddd); border-radius: 6px; font-size: 12.5px; max-width: 110px; width: 110px; box-sizing: border-box; }
select.mc-in { -webkit-appearance: none; appearance: none; padding-right: 18px; background-color: #fffbe6; border-color: #e6c95c; font-weight: 600; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23e05252'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 5px center; }
#mc_globalthk { width: 110px; -webkit-appearance: none; appearance: none; padding-right: 18px; background-color: #fffbe6; border-color: #e6c95c; font-weight: 600; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23e05252'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 5px center; }
/* 参数数字输入框：浅红色背景 */
.mc-params input.mc-in { background-color: #fdeaea; border-color: #f0b8b8; }
/* 材料费行 */
.mc-matbar { gap: 16px; padding: 10px 14px; }
.mc-matbar input.mc-in { background-color: #fdeaea; border-color: #f0b8b8; }
.mc-matbar b { font-size: 15px; }
.mc_kindname { display: inline-block; font-weight: 600; color: var(--text, #333); min-width: 118px; }
/* 参数标签统一宽度；无下拉的行补等宽空白，参数起始位置对齐 */
.mc-lb { display: inline-block; width: 40px; text-align: right; }
.mc-psp { display: inline-block; width: 110px; }
/* 物流限制备注：独立一行靠左 */
.mc-lim { flex-basis: 100%; font-size: 12px; color: var(--dim, #999); }
.mc-ck { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--dim, #666); white-space: nowrap; cursor: pointer; }
.mc-amt { font-weight: 700; min-width: 76px; text-align: right; white-space: nowrap; }
/* ★ 多工艺工序（折弯/开槽/焊接/表面处理/倒短）：勾选展开模式（2026-11-14） */
.mc-procbox { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mc-procck { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; color: #2b6cb0; white-space: nowrap; cursor: pointer; padding: 2px 6px; border: 1px solid #b8cdf0; border-radius: 12px; background: #eef4ff; }
.mc-procck input { margin: 0; }
.mc-procck:has(input:checked) { background: #d7e6ff; border-color: #6a9be8; font-weight: 600; }
.mc-subs { flex-basis: 100%; display: flex; flex-direction: column; gap: 3px; padding: 2px 0 2px 46px; }
.mc-subrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 3px 6px; background: #f6f9ff; border-left: 3px solid #6a9be8; border-radius: 0 6px 6px 0; }
.mc-subname { display: inline-block; font-weight: 600; color: #2b6cb0; min-width: 80px; font-size: 12.5px; }
.mc-subrow .mc-params { flex: 1; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.mc-del { border: none; background: none; color: var(--dim, #999); cursor: pointer; font-size: 14px; padding: 2px 4px; }
.mc-del:hover { color: var(--red, #d33); }
.mc-total { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--pri-soft, #eef4ff); font-size: 14px; font-weight: 700; }
.mc-total b { font-size: 18px; color: var(--pri, #2b6cb0); }
.mc-notes { margin-top: 8px; font-size: 12px; color: var(--dim, #777); line-height: 1.8; }
.mc-rough .mc-red { color: var(--red, #d33); }
/* 光洁度对照表：每行浅绿分隔线 */
.mc-rough td, .mc-rough th { border-bottom: 1px solid #7fc9a0; }
.mc-rough th { text-align: left; }
.mc-rough tr:last-child td { border-bottom: none; }
.mc-foot { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line, #e3e3e3); font-size: 11.5px; color: var(--dim, #999); line-height: 1.7; }

/* 加工预算：手动调价列 */
.mc-base-wrap { display: inline-flex; align-items: center; gap: 4px; }
/* 其他加工行无手动调价框：保留等宽占位，保持参数与其他行对齐 */
.mc-base-wrap:empty { display: inline-block; width: 88px; }
.mc-base-label { font-size: 12px; color: var(--dim, #888); }

/* 加工预算：表头 */
.mc-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 2px solid #e05252; background: #f2f5fa; font-size: 12px; font-weight: 700; color: var(--dim, #666); }
.mc-hc { flex: none; }
.mc-base-wrap .mc-in { background: #fffbe6; border-color: #e6c95c; font-weight: 600; }

/* 表面处理：固定工艺名标签 */
.mc-sproc { display: inline-block; font-weight: 600; color: var(--pri, #2b6cb0); min-width: 64px; }

/* 焊接：固定工艺名标签 */
.mc-wtype { display: inline-block; font-weight: 600; color: var(--pri, #2b6cb0); min-width: 64px; }

/* 图片拖拽识别：拖入图片时高亮容器（报价编辑区） */
.drag-over { outline: 2px dashed #1a5fb4 !important; outline-offset: 1px; background: rgba(26,95,180,.12) !important; box-shadow: 0 0 0 3px rgba(26,95,180,.15) !important; }
