:root {
  /* 2026-09 新皮肤基线（与主题 B「现代亮色」一致，作无主题时的兜底） */
  --c-bg: #f4f6f9;
  --c-surface: #ffffff;
  --c-surface-2: #f7f9fb;
  --c-row-alt: #fbfcfe;
  --c-border: #e3e8ef;
  --c-border-strong: #cbd4df;
  --c-text: #1c2a38;
  --c-muted: #4f5b6b;
  --c-primary: #2f6bff;
  --c-primary-hover: #255ae0;
  --c-primary-soft: #eaf1ff;
  --c-accent: #6d5efc;
  --c-head-bg: #f7f9fb;
  --c-hover: #f1f4f8;
  --c-nav-bg: #ffffff;
  --c-nav-text: #46536a;
  --c-nav-active-bg: #eaf1ff;
  --c-nav-active-text: #2f6bff;
  --c-nav-hover: #f1f4f8;
  --c-success: #12805c;
  --c-success-bg: #e3f5ee;
  --c-warning: #9a5b00;
  --c-warning-bg: #fdf0dd;
  --c-danger: #c2273a;
  --c-danger-bg: #fde8eb;
  --c-info: #1d5fbf;
  --c-info-bg: #e7f0fd;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16,24,40,.05);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 14px;
}

#app { display: flex; height: 100vh; }
/* 主列：顶栏 + 业务域横排 + 内容区 纵向排列 */
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-main > main { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }


/* Sidebar */
#sidebar {
  width: 252px;
  flex: 0 0 252px;
  background: linear-gradient(180deg, #183b5b 0%, #122f49 100%);
  border-right: none;
  overflow-y: auto;
}
.brand {
  padding: 18px 18px 14px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.brand span { font-size: 12px; color: #aec4d6; font-weight: 400; }

#nav { padding: 8px 0; }
.nav-mod {
  padding: 9px 16px;
  font-weight: 600;
  font-size: 13.5px;
  color: #d8e6f0;
  cursor: default;
}
.nav-item {
  padding: 7px 16px 7px 34px;
  font-size: 13px;
  color: #a9c0d2;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,.09); color: #fff; }
.nav-item.active {
  background: rgba(81, 156, 207, .2);
  color: #fff;
  border-left-color: var(--c-accent);
  font-weight: 500;
}

/* Main */
main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#topbar {
  height: 52px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 0 24px;
  box-shadow: 0 1px 4px rgba(28, 54, 77, .04);
}
#topbar-right { flex-shrink: 0; color: var(--c-muted); font-size: 13px; }

#content { flex: 1; min-width: 0; overflow-y: auto; padding: 24px 28px; }

/* 仓库合并入口的页内子功能 Tab 条（常驻于 #content 之外，切换子页不丢失） */
.subtabs { display: flex; align-items: center; gap: 6px; padding: 8px 28px 0; border-bottom: 1px solid var(--c-border); background: var(--c-surface); flex-wrap: wrap; }
.subtabs[hidden] { display: none; }
.subtabs-label { font-size: 13px; font-weight: 600; color: var(--c-muted); margin-right: 6px; }
.subtab { height: 34px; padding: 0 16px; border: 1px solid var(--c-border); border-bottom: none; border-radius: 8px 8px 0 0; background: var(--c-bg); color: var(--c-text); font-size: 13px; cursor: pointer; transition: background .12s, color .12s, border-color .12s; position: relative; top: 1px; }
.subtab:hover { background: var(--c-hover); }
.subtab.active { background: var(--c-surface); color: var(--c-primary); font-weight: 600; border-color: var(--c-border); border-bottom: 2px solid var(--c-primary); }

/* Page primitives */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-title { font-size: 20px; font-weight: 700; letter-spacing: .1px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--c-border); }
.tab {
  padding: 8px 14px; font-size: 13.5px; cursor: pointer; color: var(--c-muted);
  border-bottom: 2px solid transparent;
}
.tab.active { color: var(--c-primary); border-bottom-color: var(--c-primary); font-weight: 500; }

/* Buttons */
.btn {
  border: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-text);
  padding: 7px 13px; border-radius: 6px; cursor: pointer; font-size: 13px; transition: background .15s, transform .15s, box-shadow .15s;
}
.btn:hover { background: var(--c-surface-2); transform: translateY(-1px); }
.btn-primary { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.btn-primary:hover { background: #163d60; box-shadow: 0 3px 8px rgba(30,79,122,.22); }
.btn-danger { color: #a32d2d; border-color: #f0c9c9; }
.btn-danger:hover { background: #fcebeb; }
.btn-sm { padding: 3px 8px; font-size: 12px; }

/* Table */
table.grid { width: 100%; border-collapse: collapse; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.grid th, table.grid td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--c-surface-2); font-size: 13px; }
table.grid th { background: #edf3f8; color: var(--c-muted); font-weight: 600; }
table.grid tr:last-child td { border-bottom: none; }
table.grid tbody tr:hover td { background: #f5f9fc; }
.row-actions { display: flex; gap: 6px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 12.5px; color: var(--c-muted); }
.field input, .field select, .field textarea {
  border: 1px solid var(--c-border); border-radius: 6px; padding: 7px 10px; font-size: 13px; font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid rgba(30,79,122,.18); border-color: var(--c-primary); }
.form-row { display: flex; gap: 14px; }
.form-row .field { flex: 1; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.checks label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--c-text); }
/* 角色权限分组勾选 */
.perm-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; align-items: start; }
.perm-group { border: 1px solid var(--c-border); border-radius: 8px; padding: 10px 12px; background: var(--c-surface); }
.perm-group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; padding-bottom: 7px; border-bottom: 1px solid var(--c-border); }
.perm-group-head b { font-size: 13px; font-weight: 600; color: var(--c-text); }
.perm-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.perm-toggle { border: 0; background: none; padding: 0; font-size: 12px; color: var(--c-primary, #2f6fed); cursor: pointer; }
.perm-toggle:hover { text-decoration: underline; }
.perm-group .checks { gap: 7px 14px; }
/* 功能权限矩阵 */
.pm-matrix th { white-space: nowrap; text-align: center; font-size: 12px; padding: 7px 8px; }
.pm-matrix td.pm-cell { text-align: center; padding: 4px; }
.pm-matrix td.pm-cell input { cursor: pointer; transform: scale(1.1); }
.pm-matrix .pm-label { min-width: 200px; }
.pm-matrix .pm-label .pill { font-size: 11px; margin-left: 4px; }

/* Modal */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.35); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: var(--c-surface); border-radius: 10px; width: 600px; max-width: 94vw; padding: 18px 20px; box-shadow: 0 8px 30px rgba(0,0,0,.18); }
.modal.wide-detail-form { width: 1180px; max-width: 94vw; }
.modal h3 { margin: 0 0 14px; font-size: 16px; }
.modal-body { max-height: 80vh; overflow: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.help-modal { width: 620px; }
.reference-modal { width: min(1100px, 96vw); }
.reference-picker { display: flex; gap: 8px; align-items: center; }
.reference-picker input { flex: 1; background: var(--c-surface-2); }
.ref-steps { display: flex; gap: 8px; margin-bottom: 12px; font-size: 12.5px; }
.ref-steps span, .ref-steps b { padding: 5px 12px; border-radius: 14px; background: var(--c-surface-2); color: var(--c-muted); font-weight: 500; }
.ref-steps b { background: var(--c-primary-soft); color: var(--c-primary); font-weight: 700; }
.ref-grid { min-width: 880px; }
.ref-grid input[type="number"] { width: 82px; }
.help-summary { margin: 0 0 12px; color: var(--c-text); font-size: 14px; line-height: 1.7; }
.help-list { margin: 0; padding-left: 20px; color: #4b5968; font-size: 13px; line-height: 1.8; }
.help-list li + li { margin-top: 4px; }

/* 项目明细行编辑器 */
.items-block { margin-top: 14px; border: 1px solid var(--c-border); border-radius: 8px; padding: 12px 14px; background: var(--c-surface); box-shadow: var(--shadow); overflow-x: auto; }
.items-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.item-grid th, .item-grid td { padding: 5px 6px; font-size: 12.5px; }
.item-grid input { width: 100%; border: 1px solid var(--c-border); border-radius: 5px; padding: 5px 6px; font-size: 12.5px; font-family: inherit; }

/* 请购单：右上角操作按钮（替代右下角页脚） */
.form-toolbar { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 12px; }
/* 明细行 Excel 表格样式：细网格、单元格内输入框无边框铺满 */
.excel-grid { table-layout: fixed; min-width: 980px; }
.excel-grid th, .excel-grid td { border: 1px solid var(--c-border); padding: 0; text-align: left; vertical-align: middle; }
.excel-grid th { background: var(--c-surface-2); padding: 6px 8px; font-weight: 600; }
.excel-grid td { background: var(--c-surface); }
.excel-grid .item-row:hover td { background: var(--c-surface-2); }
.excel-grid input { border: none; border-radius: 0; background: transparent; padding: 6px 7px; width: 100%; box-sizing: border-box; }
.excel-grid input:focus { outline: 2px solid var(--c-primary, #2f6fed); outline-offset: -2px; }
.excel-grid .btn-danger { margin: 4px; }
/* 明细表横向滚动容器：列多时不裁切，超宽则滚动；表格外层边框交给容器，避免双层边框 */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--c-border); border-radius: var(--radius); margin-top: 8px; }
.table-scroll > table.grid { border: none; border-radius: 0; }
.item-grid { min-width: 720px; }

/* 任务书（与真实模板版式一致） */
.taskbook { color: #111; font-size: 13px; }
.tb-company { font-size: 17px; font-weight: 700; text-align: center; }
.tb-sub { font-size: 11.5px; text-align: center; color: #555; margin-top: 2px; }
.tb-title { text-align: center; font-size: 16px; margin: 12px 0 14px; border-bottom: 2px solid #222; padding-bottom: 8px; }
.tb-info, .tb-items { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.tb-info th, .tb-info td { border: 1px solid #333; padding: 6px 8px; text-align: left; }
.tb-info th { background: #f2f2f2; width: 92px; font-weight: 600; }
.tb-items th, .tb-items td { border: 1px solid #333; padding: 5px 8px; text-align: left; }
.tb-items th { background: #f2f2f2; text-align: center; }
.tb-subtitle { font-weight: 600; margin: 10px 0 4px; }
.tb-foot { display: flex; justify-content: space-between; margin-top: 16px; }
.tb-slogan { margin-top: 20px; text-align: center; font-size: 11px; color: #666; }

/* Toast */
#toast-root { position: fixed; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast { background: #1f2937; color: #fff; padding: 9px 14px; border-radius: 6px; font-size: 13px; opacity: 0; transition: opacity .2s; }
.toast.show { opacity: 1; }

/* 页签（新增/编辑以页签承载，离开不丢数据） */
#tab-layer { display: none; flex: 1; flex-direction: column; min-height: 0; }
.tab-bar { display: flex; gap: 6px; padding: 12px 18px 0; flex-wrap: wrap; border-bottom: 1px solid var(--c-border); background: var(--c-surface); position: sticky; top: 0; z-index: 6; }
.tab-chip { padding: 7px 12px; border: 1px solid var(--c-border); border-bottom: none; border-radius: 8px 8px 0 0; background: var(--c-bg); cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 6px; color: var(--c-muted); }
.tab-chip.active { background: var(--c-surface); font-weight: 600; border-color: var(--c-primary); color: var(--c-primary); }
.tab-chip .tab-x { color: #6b7280; font-size: 13px; line-height: 1; padding: 0 1px; }
.tab-chip .tab-x:hover { color: #e53e3e; }
.tab-body { flex: 1; min-height: 0; overflow: auto; padding: 18px 22px; }
.tab-form-panel { max-width: 900px; }
.tab-form-footer { position: sticky; bottom: 0; background: var(--c-surface); border-top: 1px solid var(--c-border); padding: 12px 0; margin-top: 18px; }
.tab-form-footer-inner { display: flex; gap: 10px; justify-content: flex-end; max-width: 900px; }

/* Placeholder (留白，无样式) */
.blank-page { padding: 40px 4px; color: #6b7280; font-size: 14px; }

/* Misc */
.muted { color: var(--c-muted); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; background: var(--c-surface-2); color: var(--c-muted); }
.pill.ok { background: #eaf3de; color: #3b6d11; }
.pill.warn { background: #faefd9; color: #854f0b; }
.pill.info { background: #e6f1fb; color: #185fa5; }
.pill.danger { background: #fde2e2; color: #b71c1c; }

/* 请购单 Excel 粘贴区 */
.paste-area { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.paste-area textarea { flex: 1; border: 1px solid var(--c-border); border-radius: 6px; padding: 6px 8px; font-size: 12.5px; font-family: inherit; resize: vertical; }
.paste-btns { display: flex; flex-direction: column; gap: 6px; }
.card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.form-section { margin: 0 0 14px; padding: 16px 18px 4px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow); }
.form-section-title { margin: 0 0 14px; font-weight: 700; color: var(--c-primary); font-size: 14px; }
.form-section-title::before { content: ''; display: inline-block; width: 4px; height: 14px; margin-right: 8px; vertical-align: -2px; border-radius: 2px; background: var(--c-accent); }
.summary-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.summary-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 13px 16px; box-shadow: var(--shadow); }
.summary-card .label { color: var(--c-muted); font-size: 12px; }
.summary-card .value { font-size: 21px; font-weight: 700; margin-top: 5px; color: var(--c-primary); }
.po-line-table { min-width: 1280px; }
.po-line-table select { width: 100%; border: 0; background: transparent; padding: 6px; font: inherit; }
.po-line-table input { width: 100%; border: 0; background: transparent; padding: 6px; font: inherit; }
.po-line-table input:focus, .po-line-table select:focus { outline: 2px solid rgba(30,79,122,.22); outline-offset: -2px; }
/* 单价列加宽，避免长单价（元/件或元/kg）被输入框截断 */
.po-line-table .po_remote_price { min-width: 110px; text-align: right; }
.so-price { min-width: 110px; text-align: right; }
.po-status { margin: 10px 0 4px; font-size: 13px; }
.po-head { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.po-head .field { margin-bottom: 10px; }
.po-head input { width: 100%; box-sizing: border-box; }
.ro { padding: 7px 10px; background: var(--c-surface-2); border: 1px solid var(--c-surface-2); border-radius: 6px; color: var(--c-text); font-size: 13px; }
table.grid tfoot td { background: var(--c-surface-2); border-top: 2px solid var(--c-border); }
.dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 10px; }
.dept-cell { border: 1px solid var(--c-border); border-radius: 6px; padding: 10px 12px; font-size: 13px; }
.dept-cell b { display: block; margin-bottom: 4px; }
.filter-bar { display: flex; gap: 10px; margin-bottom: 12px; align-items: center; flex-wrap: wrap; }
.filter-bar input, .filter-bar select { border: 1px solid var(--c-border); border-radius: 6px; padding: 6px 10px; font-size: 13px; }
.pager { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.pager .muted { margin: 0 4px; }

/* Kanban */
.kanban { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.kb-col { flex: 0 0 184px; background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: 8px; display: flex; flex-direction: column; min-height: 200px; }
.kb-head { padding: 8px 10px; font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--c-border); }
.kb-body { padding: 8px; flex: 1; }
.kb-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; }
.kb-code { font-weight: 600; font-size: 13px; }
.kb-name { font-size: 12.5px; margin: 2px 0; }

/* 采购任务工作台：左右分栏（左=请购单来源 右=采购任务单派生） */
.pt-split { display: flex; flex-direction: column; gap: 12px; }
.pt-head { font-size: 15px; font-weight: 600; }
.pt-chain { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 8px; padding: 8px 12px; font-size: 12.5px; }
.chain-node { padding: 2px 9px; border-radius: 11px; background: var(--c-surface-2); color: var(--c-muted); white-space: nowrap; }
.chain-node.done { background: #eaf3de; color: #3b6d11; }
.chain-node.current { background: var(--c-primary-soft); color: var(--c-primary); font-weight: 600; }
.chain-arrow { color: var(--c-muted); }
.pt-cols { display: flex; gap: 16px; align-items: flex-start; }
.pt-left, .pt-right { flex: 1; min-width: 0; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 8px; padding: 12px 14px; max-height: 72vh; overflow: auto; }
.pt-panel-title { font-size: 13.5px; font-weight: 600; margin-bottom: 10px; color: var(--c-text); display: flex; align-items: center; gap: 6px; }
.pt-panel-title::before { content: ""; width: 4px; height: 14px; background: var(--c-primary); border-radius: 2px; }
.pt-right .pt-panel-title::before { background: var(--c-accent); }
.pt-toolbar { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.pt-dropdown { position: relative; }
.pt-dropdown-menu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 190px; padding: 6px; border: 1px solid var(--c-border); border-radius: 8px; background: var(--c-surface); box-shadow: var(--shadow-md); flex-direction: column; gap: 2px; }
.pt-dropdown-menu label { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--c-text); white-space: nowrap; }
.pt-dropdown-menu label:hover { background: var(--c-hover); }
.pt-dropdown-menu label input { margin: 0; }
.pt-dropdown-menu .pt-menu-item { border: 0; background: transparent; text-align: left; padding: 7px 10px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 13px; color: var(--c-text); white-space: nowrap; width: 100%; }
.pt-dropdown-menu .pt-menu-item:hover { background: var(--c-hover); color: var(--c-primary); }
.pt-menu-sep { height: 1px; background: var(--c-border); margin: 4px 2px; }
.pt-more-actions { position: relative; }
.pt-more-actions > summary { list-style: none; cursor: pointer; }
.pt-more-actions > summary::-webkit-details-marker { display: none; }
.pt-more-actions[open] > .row-actions { position: absolute; z-index: 20; right: 0; top: calc(100% + 6px); min-width: 430px; padding: 10px; border: 1px solid var(--c-border); border-radius: 8px; background: var(--c-surface); box-shadow: var(--shadow-md); }
.pqo-batch-table { min-width: 1240px; }
.pqo-batch-table th, .pqo-batch-table td { vertical-align: middle; white-space: nowrap; }
.purchase-execution-tabs { display:flex; align-items:center; gap:4px; margin:0 0 14px; padding:4px; width:max-content; max-width:100%; border:1px solid var(--c-border); border-radius:8px; background:var(--c-surface-2); }
.purchase-execution-tab { border:0; border-radius:6px; padding:8px 18px; background:transparent; color:var(--c-muted); font:inherit; font-weight:600; cursor:pointer; white-space:nowrap; }
.purchase-execution-tab:hover { color:var(--c-primary); background:var(--c-surface); }
.purchase-execution-tab.active { color:#fff; background:var(--c-primary); box-shadow:0 1px 3px rgba(0,0,0,.12); }
.pt-summary { margin-bottom: 0; gap: 8px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pt-summary .summary-card { padding: 8px 12px; box-shadow: none; }
.pt-summary .summary-card .value { margin-top: 2px; font-size: 18px; }
.req-block { border: 1px solid var(--c-border); border-radius: 8px; margin-bottom: 12px; overflow: hidden; }
.req-block-head { background: var(--c-surface-2); padding: 7px 10px; font-size: 12.5px; font-weight: 600; border-bottom: 1px solid var(--c-border); }
.req-block table.grid { border: none; border-radius: 0; }
.req-block .grid th, .req-block .grid td { padding: 5px 8px; font-size: 12.5px; }
.req-block .grid tr:last-child td { border-bottom: none; }
.xref { color: var(--c-primary); cursor: pointer; text-decoration: underline; font-size: 12px; }
.xref:hover { color: #134c86; }
tr.xref-on { background: var(--c-hover); }
.greyed { color: #9aa3af; }
tr.flash { animation: flashbg 1.2s ease; }
@keyframes flashbg { 0%, 100% { background: var(--c-surface); } 30% { background: #fff3cd; } }
/* 采购任务工作台：左右逐行对齐对照表 */
.pt-align { width: max-content; min-width: 1120px; border-collapse: collapse; table-layout: auto; }
/* table.grid 自带 overflow:hidden，会让表格自己成为「滚动容器」，导致里面所有 position:sticky 的
   表头 / 冻结列全部失效（这正是之前明细表头跟着滚的原因）。table-scroll 里圆角本来就是 0，
   放开 overflow 不会影响外观，但 sticky 才是针对真正的滚动祖先生效。 */
.table-scroll > table.pt-align { overflow: visible; }
.show-full-source .pt-align { min-width: 1450px; }
.pt-align th, .pt-align td { border: 1px solid var(--c-border); padding: 3px 6px; vertical-align: middle; font-size: 12.5px; line-height: 1.3; }
/* 表头整体吸顶：整个 thead（分组行 + 列名行）作为一个块固定在滚动容器顶部。
   逐格 sticky 时两行都顶在 top:0 会互相覆盖（列名行被分组行压住 = 等于没锁），
   而按两行高度算偏移又容易出现 1px 缝隙/半格错位，所以直接粘 thead。
   z-index 6 高于正文冻结列（sticky-select=5 / sticky-source-name=3），横向滚动时表头压住正文。 */
.pt-align thead { position: sticky; top: 0; z-index: 6; }
.pt-align thead th { background: var(--c-surface); }
.pt-align .grp-left { background: var(--c-surface-2); color: var(--c-primary); }
.pt-align .grp-right { background: var(--c-surface-2); color: #6b46c1; }
.pt-align .grp-mid { background: var(--c-surface-2); }
.pt-align .pair-mid { text-align: center; color: var(--c-primary); font-weight: 700; background: var(--c-surface-2); white-space: nowrap; }
.pt-align tr.pair-row:hover { background: var(--c-hover); }
.pt-align .src-code { width: 46px; min-width: 46px; max-width: 46px; font-size: 11.5px; color: var(--c-muted); white-space: normal; overflow-wrap: anywhere; }
.pt-align .col-short, .pt-align .src-number, .pt-align .src-qty { width: 1%; white-space: nowrap; text-align: center; }
.pt-align .src-long { min-width: 86px; max-width: 170px; }
.pt-align .src-remark { min-width: 110px; max-width: 190px; }
.pt-cell-wrap { display: -webkit-box; max-width: 100%; overflow: hidden; white-space: normal; overflow-wrap: anywhere; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; cursor: pointer; }
.pt-cell-wrap.expanded { display: block; overflow: visible; -webkit-line-clamp: unset; }
.pt-align .sticky-select { position: sticky; left: 0; z-index: 5; background: var(--c-surface); min-width: 28px; }
.pt-align .sticky-source { position: sticky; left: 29px; z-index: 4; background: var(--c-surface-2); width: 46px; min-width: 46px; max-width: 46px; white-space: normal; overflow-wrap: anywhere; }
.pt-align .sticky-source-name { position: sticky; left: 29px; z-index: 3; background: var(--c-surface-2); min-width: 105px; max-width: 165px; }
.pt-align thead .sticky-select, .pt-align thead .sticky-source, .pt-align thead .sticky-source-name { z-index: 8; }
.pt-align .sticky-supplier { position: sticky; right: 0; z-index: 4; background: var(--c-surface); min-width: 150px; box-shadow: -1px 0 0 var(--c-border); }
.pt-align .sticky-status { position: sticky; right: 0; z-index: 3; background: var(--c-surface); box-shadow: -1px 0 0 var(--c-border); }
.pt-align thead .sticky-supplier, .pt-align thead .sticky-status { z-index: 8; }
.pt-align td.src-change-cell { background: #fff3b0 !important; color: #c62828 !important; font-weight: 600; }
.pt-align .src-tag { display: block; font-size: 10.5px; color: var(--c-muted); margin-top: 2px; }
.pt-align .pt-mat-cell { max-width: 230px; }
.pt-align tr.pt-sec-head td { background: var(--c-surface-2); border-top: 2px solid var(--c-border); padding: 7px 10px; font-size: 13px; cursor: pointer; user-select: none; text-align: left; }
.pt-align tr.pt-sec-head td b { color: var(--c-text); margin-left: 6px; }
.pt-align tr.pt-sec-head.collapsed td { background: var(--c-surface-2); }
.pt-sec-caret { display: inline-block; width: 14px; color: var(--c-primary); }
.pt-sec-count { margin-left: 10px; color: var(--c-muted); font-size: 11px; font-weight: 400; }
.pt_mat_input { width: 150px; box-sizing: border-box; }
.badge { display: inline-block; background: var(--c-accent); color: #fff; border-radius: 8px; font-size: 10px; padding: 0 5px; margin-left: 3px; }
.unmatched-row { background: #fff8f3; }
.pt-legend { padding: 8px 10px; font-size: 12px; line-height: 1.6; }
.pt-align tr.pt-exception-row td, tr.pt-exception-row td { background: #fff5f5; }
/* 同一请购来源拆分出的多行共享来源单元格：组内任一行异常时同步标异常底色 */
.pt-align td.src-group-exception { background: #fff5f5; }
/* 深色主题：异常行浅粉底改为深红底，避免深底上大块刺眼浅色 */
:root[data-theme="A"] .pt-align tr.pt-exception-row td, :root[data-theme="A"] tr.pt-exception-row td, :root[data-theme="A"] .pt-align td.src-group-exception { background: #3d2229; }
.pt-exception-text { display: block; margin-top: 3px; color: #b42318; font-size: 11px; white-space: nowrap; }
.pt-has-change td { background: #fffdf6; }
/* 采购待办：整单已办结的行灰显置底；详情里已下单/已用库存/已关闭明细行同样灰显，突出"还要处理的" */
tr.pt-done-task td { color: #8a8f99; }
:root[data-theme="A"] tr.pt-done-task td { color: #7d8494; }
.pt-align tr.pt-line-done td { color: #8a8f99; background: #fafbfc; }
:root[data-theme="A"] .pt-align tr.pt-line-done td { color: #7d8494; background: #1d2026; }
.pt-change-summary { border: 0; background: transparent; padding: 0; cursor: pointer; display: inline-flex; gap: 4px; }
.pt-change-summary:hover { filter: brightness(.96); }
.pt-change-panel { border: 1px solid #e6b95c; border-left: 4px solid #d89714; background: #fffdf6; border-radius: 5px; overflow: hidden; }
.pt-change-head { min-height: 38px; padding: 6px 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff8e6; border-bottom: 1px solid #f0d8a8; }
.pt-change-head strong { color: #85520b; margin-right: 12px; }
.pt-change-head span { color: #745b34; font-size: 12px; }
.pt-change-warning { padding: 6px 10px; color: #8a6116; font-size: 12px; border-bottom: 1px solid #f2e2bf; }
.pt-change-scroll { max-height: 300px; }
.pt-change-table { border: 0; border-radius: 0; }
.pt-change-table th, .pt-change-table td { padding: 5px 7px; font-size: 12px; vertical-align: top; }
.pt-change-diff { min-width: 420px; }
.pt-change-material { min-width: 110px; font-weight: 600; color: var(--c-text); }
.pt-change-field { display: grid; grid-template-columns: 72px minmax(70px, auto) 18px minmax(70px, auto); align-items: center; gap: 5px; min-height: 23px; border-bottom: 1px dashed #eee4d0; }
.pt-change-field:last-child { border-bottom: 0; }
.pt-change-field b { font-weight: 500; color: var(--c-muted); }
.diff-old { color: #a33a32; background: #fff0ef; padding: 1px 4px; border-radius: 2px; }
.diff-new { color: #237447; background: #eaf7ef; padding: 1px 4px; border-radius: 2px; }
.diff-arrow { color: #9b8d73; text-align: center; }
.deleted-value { text-decoration: line-through; }
.rq-change-reason { display:block; grid-column:1 / -1; width:100%; max-width:none; box-sizing:border-box; }
.rq-change-reason input { width:100%; box-sizing:border-box; }
.rq-lock-notice { display:block; grid-column:1 / -1; width:100%; clear:both; box-sizing:border-box; margin: 8px 0; padding: 8px 10px; border: 1px solid #f0c36d; border-left: 4px solid #d89714; background: #fff9e8; color: #80530b; font-size: 12.5px; }
.item-grid tr.rq-purchased-row td { background: var(--c-surface-2); }
.item-grid tr.rq-purchased-row input:disabled { color: #555f6d; background: var(--c-surface-2); opacity: 1; cursor: not-allowed; }
.rq-purchase-state { min-width: 72px; text-align: center; white-space: nowrap; }
.item-grid tr.rq-cancelled-row td { background: #fff1f2; color: #8b5a61; }
.item-grid tr.rq-cancelled-row input { color: #8b5a61; text-decoration: line-through; background: transparent; cursor: not-allowed; }
.rq-cancel-reason { max-width: 150px; margin-top: 4px; color: #a33a46; font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.rq-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 8px; padding: 6px 8px; border: 1px solid var(--c-border); border-radius: 8px; background: var(--c-surface-2); }
.rq-tab { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border: 1px solid var(--c-border); border-radius: 14px; background: var(--c-surface); color: var(--c-text); font-size: 12.5px; cursor: pointer; user-select: none; }
.rq-tab:hover { border-color: var(--c-primary); }
.rq-tab.active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.rq-tab-del { border: 0; background: transparent; color: inherit; opacity: .55; font-size: 13px; cursor: pointer; padding: 0 2px; line-height: 1; }
.rq-tab-del:hover { opacity: 1; }
.rq-tab-add { border: 1px dashed var(--c-border-strong); background: transparent; color: var(--c-primary); border-radius: 14px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; }
.rq-tab-add:hover { border-style: solid; }
.po-cancelled-line { background:#f5f5f5; color:#8c8c8c; }
.po-cancelled-line input,.po-cancelled-line select { background:#f5f5f5!important; color:#8c8c8c!important; }
.po-history { margin-top:12px; padding:10px 12px; }
.po-history summary { cursor:pointer; font-weight:600; color:#315b85; }
.po-history table { margin-top:10px; }
.po-create-preview { max-height: 52vh; overflow: auto; }
.po-create-preview p { margin: 0 0 10px; }
/* 标准物料文字联想下拉 */
.combo { position: relative; }
.pt_mat_input { width: 152px; box-sizing: border-box; }
.combo-code { display: inline-block; margin-left: 4px; font-size: 11px; color: #2f7d2f; white-space: nowrap; }
.combo-list { position: absolute; left: 0; top: 100%; z-index: 60; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.14); min-width: 300px; max-height: 250px; overflow: auto; }
.combo-list.open-up { top: auto; bottom: 100%; }
.combo-item { padding: 6px 10px; cursor: pointer; border-bottom: 1px solid #f0f0f0; font-size: 12.5px; }
.combo-item:last-child { border-bottom: none; }
.combo-item:hover { background: var(--c-primary-soft); }
.combo-foot { padding: 5px 10px; font-size: 11.5px; color: var(--c-muted); background: var(--c-surface-2); border-top: 1px solid var(--c-border); position: sticky; bottom: 0; }

/* 生产汇报：统计卡片 */
.stat-row { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.stat-card { flex: 1 1 140px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 12px 16px; text-align: center; }
.stat-card b { display: block; font-size: 24px; color: var(--c-primary); }
.daily-person { border: 1px solid var(--c-border); border-radius: 10px; padding: 10px; margin-top: 10px; background: var(--c-surface); }
.daily-person > .row-actions > b { min-width: 140px; }
.daily-allocation { display: grid; grid-template-columns: minmax(180px,1.3fr) minmax(130px,1fr) 80px 80px 100px minmax(130px,1fr) auto; gap: 8px; align-items: center; border-top: 1px dashed var(--c-border); padding-top: 8px; margin-top: 8px; }
.daily-allocation input,.daily-allocation select { min-width: 0; }
@media (max-width: 1000px) { .daily-allocation { grid-template-columns: 1fr 1fr; } }
.stat-card span { font-size: 12px; color: var(--c-muted); }

/* BOM 提取 / 图纸档案 */
.bom-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 16px; margin-bottom: 6px; }
.bom-card-title { font-weight: 600; margin-bottom: 6px; }
.bom-upload { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.bom-upload input[type=file] { flex: 1 1 240px; min-width: 200px; }
#bomPreview { margin-top: 14px; }
.bom-map { background: var(--c-bg); border: 1px dashed var(--c-border); border-radius: var(--radius); padding: 12px; margin-top: 10px; }
.bom-map-title, .bom-preview-title { font-weight: 600; margin: 10px 0 6px; font-size: 14px; }
.bom-map-grid { margin-bottom: 6px; }
.bom-map-grid select { max-width: 200px; }

/* 电气管理：进度条 / 触发提示 */
.progress { display:inline-block; width:80px; height:8px; background:var(--c-bg); border:1px solid var(--c-border); border-radius:6px; overflow:hidden; vertical-align:middle; margin-right:6px; }
.progress-bar { height:100%; background:var(--c-primary); }
.tb-trigger { background:#fff7e6; border:1px solid #ffd591; color:#ad6800; border-radius:6px; padding:8px 10px; margin:8px 0; font-size:13px; }

/* 质检模块：项目检索下拉 / 图片缩略图 / 问题库 */
.sug-box { position:absolute; left:0; top:100%; z-index:60; background: var(--c-surface); border:1px solid var(--c-border); border-radius:6px; box-shadow:0 6px 18px rgba(0,0,0,.14); margin-top:2px; width:100%; max-height:200px; overflow:auto; }
.sug-item { padding:6px 10px; cursor:pointer; border-bottom:1px solid #f0f0f0; font-size:12.5px; }
.sug-item:last-child { border-bottom:none; }
.sug-item:hover { background:var(--c-primary-soft); }
.thumb-row { display:flex; gap:10px; flex-wrap:wrap; }
.thumb { position:relative; width:92px; border:1px solid var(--c-border); border-radius:6px; overflow:hidden; background:var(--c-surface-2); }
.thumb img { width:100%; height:64px; object-fit:cover; display:block; }
.thumb-name { font-size:11px; padding:2px 4px; color:#557; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.thumb-del { position:absolute; top:2px; right:2px; background:rgba(225,0,0,.85); color:#fff; border:none; border-radius:50%; width:18px; height:18px; cursor:pointer; line-height:16px; font-size:12px; padding:0; }
/* 请购物料图片（新料/定做件附图） */
.rq-img-btn { position:relative; padding:2px 6px; line-height:1.4; }
.rq-img-count { display:inline-block; min-width:14px; margin-left:1px; border-radius:7px; background:#2563eb; color:#fff; font-size:10px; line-height:14px; text-align:center; padding:0 3px; }
.rq-img-grid { display:flex; gap:10px; flex-wrap:wrap; margin-top:8px; }
.rq-img-grid .thumb { width:104px; }
.rq-img-grid .thumb img { height:78px; }
.rq-img-click { cursor: zoom-in; }
.rq-lightbox { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.86); display: flex; flex-direction: column; }
.rq-lightbox-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: rgba(0,0,0,.55); }
.rq-lightbox-name { font-size: 13px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rq-lightbox-actions { display: flex; align-items: center; gap: 6px; }
.rq-lightbox-actions .btn { color: #fff; border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.08); }
.rq-lightbox-actions .btn:hover { background: rgba(255,255,255,.18); color: #fff; }
.rq-lightbox-body { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 20px; }
.rq-lightbox-body img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .15s ease; transform-origin: center; }
.rq-img-pending { height:78px; display:flex; align-items:center; justify-content:center; font-size:11px; color:#557; background:var(--c-surface-2); }
.qa-desc { max-width:200px; white-space:pre-wrap; font-size:12px; vertical-align:top; }
.tb-problems { margin-top:14px; border:1px solid #dbeafe; background:#f7fbff; border-radius:8px; padding:10px 12px; }
.tb-problems b { color:#1d4ed8; }
.tb-problems-tbl { width:100%; border-collapse:collapse; margin-top:6px; font-size:12px; }
.tb-problems-tbl th, .tb-problems-tbl td { border:1px solid var(--c-border); padding:4px 6px; text-align:left; vertical-align:top; }

/* ========================================================================== */
/* 2026 弗格森企业工作台设计系统（保留原业务 DOM 与逻辑）                    */
/* ========================================================================== */
:root {
  --c-bg: #f4f5f7;
  --c-surface: #ffffff;
  --c-surface-2: #f2f4f7;
  --c-row-alt: #fcfcfd;
  --c-border: #e2e5e9;
  --c-border-strong: #c9ced5;
  --c-text: #20242a;
  --c-muted: #737b87;
  --c-primary: #235f8c;
  --c-primary-hover: #194d75;
  --c-primary-soft: #edf4fa;
  --c-accent: #d48628;
  --c-head-bg: #e9edf1;
  --c-hover: #f4f6f9;
  --c-nav-bg: #ffffff;
  --c-nav-text: #435065;
  --c-nav-active-bg: #edf4fa;
  --c-nav-active-text: #1d527a;
  --c-nav-hover: #f5f6f8;
  --c-success: #287a4b;
  --c-success-bg: #e9f7ef;
  --c-warning: #a86109;
  --c-warning-bg: #fff4df;
  --c-danger: #c83831;
  --c-danger-bg: #ffeded;
  --c-info: #2866a7;
  --c-info-bg: #eaf3fc;
  --c-nav: #243b4a;
  --radius: 4px;
  --shadow: 0 1px 3px rgba(24, 32, 45, .06);
}

/* 主题 A：深色驾驶舱（大屏看板风，2026-09 重配色板） */
:root[data-theme="A"] {
  --c-bg: #0d1424;
  --c-surface: #151f35;
  --c-surface-2: #1a2742;
  --c-row-alt: #17233c;
  --c-border: #263a5e;
  --c-border-strong: #33507c;
  --c-text: #e6edf7;
  --c-muted: #8ba1c0;
  --c-primary: #3b82f6;
  --c-primary-hover: #2f6fe0;
  --c-primary-soft: #122a52;
  --c-accent: #22d3ee;
  --c-head-bg: #101a30;
  --c-hover: #1c2c4c;
  --c-nav-bg: #0d1626;
  --c-nav-text: #8ba1c0;
  --c-nav-active-bg: #14304f;
  --c-nav-active-text: #7db3f7;
  --c-nav-hover: #152440;
  --c-success: #34d399;
  --c-success-bg: #0e3a2c;
  --c-warning: #fbbf24;
  --c-warning-bg: #3a2c0c;
  --c-danger: #f87171;
  --c-danger-bg: #43191e;
  --c-info: #7db3f7;
  --c-info-bg: #12294a;
  --shadow: 0 4px 18px rgba(0,0,0,.5);
}

/* —— 深色主题 A 专项修正：深底上的硬编码深灰文字改为浅色，避免看不清（不动浅色主题 B/C） —— */
:root[data-theme="A"] .page-title { color: #e9f1fb; }
:root[data-theme="A"] .icon-btn,
:root[data-theme="A"] .topbar-action { color: #aebfd6; }
:root[data-theme="A"] .icon-btn:hover,
:root[data-theme="A"] .topbar-action:hover { color: var(--c-text); background: var(--c-hover); }
:root[data-theme="A"] .btn { color: var(--c-text); }
:root[data-theme="A"] table.grid th { color: #d2deec; }
:root[data-theme="A"] .field label { color: #9fb1c8; }
:root[data-theme="A"] .field input,
:root[data-theme="A"] .field select,
:root[data-theme="A"] .field textarea,
:root[data-theme="A"] .paste-area textarea { color: var(--c-text); }
:root[data-theme="A"] .field input:disabled,
:root[data-theme="A"] .field select:disabled,
:root[data-theme="A"] .field textarea:disabled { color: #8a9bb3; }
:root[data-theme="A"] .form-section > h3,
:root[data-theme="A"] .form-section > h4 { color: #d2deec; }
:root[data-theme="A"] .form-section-title { color: #cdd9e8; }
:root[data-theme="A"] .help-list { color: #b6c4d6; }
:root[data-theme="A"] .user-copy b { color: #e6eef8; }
:root[data-theme="A"] .user-copy small { color: #93a6bd; }
:root[data-theme="A"] .chevron { color: #aab8c9; }
:root[data-theme="A"] .greyed { color: #93a6bd; }
:root[data-theme="A"] .tab-chip .tab-x { color: #aab8c9; }
:root[data-theme="A"] .blank-page { color: #8fa3ba; }
:root[data-theme="A"] .thumb-name { color: #c2cedd; }
:root[data-theme="A"] .login-card-head p { color: #9c9c9e; }
:root[data-theme="A"] .field-input input { color: #1a1a1a; background: transparent; border-color: transparent; }
:root[data-theme="A"] .field-input input::placeholder { color: #8fa3ba; }
/* 深色 A：明细表内联输入框（item-grid/excel-grid/po-line-table 透明背景）默认黑字看不清 */
:root[data-theme="A"] .item-grid input, :root[data-theme="A"] .item-grid select, :root[data-theme="A"] .item-grid textarea,
:root[data-theme="A"] .excel-grid input, :root[data-theme="A"] .excel-grid select, :root[data-theme="A"] .excel-grid textarea,
:root[data-theme="A"] .po-line-table input, :root[data-theme="A"] .po-line-table select { color: var(--c-text); }
/* 深色 A：占位提示文字统一浅灰蓝（含 Excel 粘贴框长提示，默认深灰在深底上不可读） */
:root[data-theme="A"] ::placeholder { color: #7f93b0; opacity: 1; }
:root[data-theme="A"] .login-error { color: #ff9b94; }

/* 主题 A 专项：项目全程进度看板（lifecycle）在深底上重构配色——保证 done/doing/todo/na 均清晰可读，且状态可区分（不动浅色主题 B/C） */
:root[data-theme="A"] .lifecycle-track { background: var(--c-surface); border-color: var(--c-border-strong); }
:root[data-theme="A"] .lifecycle-node { background: var(--c-surface-2); border-color: var(--c-border); }
:root[data-theme="A"] .lifecycle-node b { color: var(--c-text); }
:root[data-theme="A"] .lifecycle-node small { color: var(--c-muted); }
:root[data-theme="A"] .lifecycle-dot { background: var(--c-surface); color: var(--c-muted); border: 1px solid var(--c-border-strong); }
:root[data-theme="A"] .lifecycle-node.done { background: var(--c-success-bg); }
:root[data-theme="A"] .lifecycle-node.done b { color: #b9f0d2; }
:root[data-theme="A"] .lifecycle-node.done small { color: #8fe0b4; }
:root[data-theme="A"] .lifecycle-node.done .lifecycle-dot { background: var(--c-success); color: #04130b; border-color: var(--c-success); }
:root[data-theme="A"] .lifecycle-node.doing { background: var(--c-info-bg); }
:root[data-theme="A"] .lifecycle-node.doing b { color: #cfe6fb; }
:root[data-theme="A"] .lifecycle-node.doing small { color: #9fcaf0; }
:root[data-theme="A"] .lifecycle-node.doing .lifecycle-dot { background: var(--c-info); color: #04161f; border-color: var(--c-info); }
:root[data-theme="A"] .lifecycle-node.na { background: var(--c-surface); }
:root[data-theme="A"] .lifecycle-node.na b,
:root[data-theme="A"] .lifecycle-node.na small { color: var(--c-muted); }
:root[data-theme="A"] .lifecycle-overall { color: var(--c-primary); }
/* 深色主题 A：顶部业务域横排使用浅色文字 + 高对比选中态 */
:root[data-theme="A"] #topnav { background: var(--c-nav-bg); border-bottom-color: var(--c-border); }
:root[data-theme="A"] .topnav-item { color: var(--c-nav-text); }
:root[data-theme="A"] .topnav-item:hover { background: var(--c-nav-hover); color: #fff; }
:root[data-theme="A"] .topnav-item.active { background: var(--c-primary); border-color: var(--c-primary); color: #04222a; }
:root[data-theme="A"] .topnav-system { color: var(--c-nav-text); }
:root[data-theme="A"] .topnav-more-menu { background: var(--c-nav-bg); border-color: var(--c-border); }
:root[data-theme="A"] .topnav-more-item { color: var(--c-nav-text); }
:root[data-theme="A"] .topnav-more-item:hover { background: var(--c-nav-hover); color: #fff; }
:root[data-theme="A"] .topnav-more-item.active { background: var(--c-primary-soft); color: var(--c-primary); }
:root[data-theme="A"] .lifecycle-risk { background: var(--c-danger-bg); color: var(--c-danger); border-left-color: var(--c-danger); }

/* 主题 B：现代 SaaS 亮色（2026-09 新默认，Linear/飞书风） */
:root[data-theme="B"] {
  --c-bg: #f4f6f9;
  --c-surface: #ffffff;
  --c-surface-2: #f7f9fb;
  --c-row-alt: #fbfcfe;
  --c-border: #e3e8ef;
  --c-border-strong: #cbd4df;
  --c-text: #1c2a38;
  --c-muted: #4f5b6b;
  --c-primary: #2f6bff;
  --c-primary-hover: #255ae0;
  --c-primary-soft: #eaf1ff;
  --c-accent: #6d5efc;
  --c-head-bg: #f7f9fb;
  --c-hover: #f1f4f8;
  --c-nav-bg: #ffffff;
  --c-nav-text: #46536a;
  --c-nav-active-bg: #eaf1ff;
  --c-nav-active-text: #2f6bff;
  --c-nav-hover: #f1f4f8;
  --c-success: #12805c;
  --c-success-bg: #e3f5ee;
  --c-warning: #9a5b00;
  --c-warning-bg: #fdf0dd;
  --c-danger: #c2273a;
  --c-danger-bg: #fde8eb;
  --c-info: #1d5fbf;
  --c-info-bg: #e7f0fd;
}

/* 主题 C：清爽圆润（2026-09-08 v3 企业微信/钉钉风：白底 + 大圆角 + 蓝紫渐变主色） */
:root[data-theme="C"] {
  --c-bg: #f2f4f9;
  --c-surface: #ffffff;
  --c-surface-2: #f5f7fc;
  --c-row-alt: #ffffff;
  --c-border: #e9edf4;
  --c-border-strong: #d4dcea;
  --c-text: #222a3d;
  --c-muted: #565f72;
  --c-primary: #2f6bff;
  --c-primary-hover: #1f54d6;
  --c-primary-soft: #eaf1ff;
  --c-accent: #7e3af2;
  --c-head-bg: #f5f7fc;
  --c-hover: #f4f6fb;
  --c-nav-bg: #ffffff;
  --c-nav-text: #4a5468;
  --c-nav-active-bg: #eaf1ff;
  --c-nav-active-text: #1f54d6;
  --c-nav-hover: #f4f6fb;
  --c-success: #0e9f6e;
  --c-success-bg: #e3f6ef;
  --c-warning: #dd9310;
  --c-warning-bg: #fdf4e0;
  --c-danger: #e02424;
  --c-danger-bg: #fdeaea;
  --c-info: #0694a2;
  --c-info-bg: #e0f7f9;
  --shadow: 0 4px 14px rgba(47,107,255,.08);
}

body { font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif; font-size: 13px; overflow: hidden; }
button, input, select, textarea { font: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid rgba(35,95,140,.22); outline-offset: 1px; }

/* 主框架 */
#sidebar { width: 210px; flex-basis: 210px; background: var(--c-nav-bg); border-right: 1px solid var(--c-border); overflow-x: hidden; transition: width .2s ease, flex-basis .2s ease; box-shadow: 1px 0 4px rgba(31,41,55,.03); z-index: 10; display: flex; flex-direction: column; }
.brand { min-height: 58px; padding: 10px 16px; display: flex; align-items: center; gap: 10px; color: var(--c-nav-text); background: var(--c-nav-bg); border-bottom: 1px solid var(--c-border); white-space: nowrap; }
.brand-mark { position: relative; flex: 0 0 36px; width: 36px; height: 36px; overflow: hidden; border-radius: 10px 10px 10px 3px; background: linear-gradient(145deg, #243f5a, #276d9a); box-shadow: 0 3px 9px rgba(35,78,113,.2); }
.brand-mark::before { content: ''; position: absolute; left: 8px; top: 10px; width: 20px; height: 11px; border-top: 3px solid #fff; border-bottom: 3px solid rgba(255,255,255,.82); transform: skewX(-28deg); }
.brand-mark::after { content: ''; position: absolute; left: 8px; bottom: 6px; width: 4px; height: 4px; border-radius: 50%; background: #e7a64b; box-shadow: 8px 0 #e7a64b, 16px 0 #e7a64b; }
.brand-mark i { position: absolute; right: -7px; top: -7px; width: 20px; height: 20px; border: 2px solid rgba(255,255,255,.15); border-radius: 50%; }
.brand-mark-image { border-radius: 50%; background: transparent; box-shadow: 0 2px 7px rgba(31,65,94,.18); }
.brand-mark-image::before, .brand-mark-image::after { display: none; }
.brand-mark-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-copy { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.brand-copy strong { color: var(--c-nav-text); font-size: 15px; letter-spacing: .5px; }
.brand-copy small { margin-top: 3px; color: var(--c-muted); font-size: 10.5px; font-weight: 400; letter-spacing: .3px; }
.nav-search-wrap { position: relative; margin: 12px 12px 7px; flex: none; }
.nav-search-wrap input { width: 100%; height: 32px; padding: 0 32px 0 30px; border: 1px solid var(--c-border); border-radius: 4px; color: var(--c-nav-text); background: var(--c-surface-2); transition: .15s ease; }
.nav-search-wrap input:focus { border-color: var(--c-primary); background: var(--c-surface); box-shadow: 0 0 0 2px var(--c-primary-soft); outline: none; }
.nav-search-wrap input::placeholder { color: var(--c-muted); }
.nav-search-icon { position: absolute; left: 10px; top: 5px; color: var(--c-muted); font-size: 16px; }
.nav-search-wrap kbd { position: absolute; right: 8px; top: 7px; min-width: 17px; height: 18px; text-align: center; color: var(--c-nav-text); background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: 3px; font: 11px/16px sans-serif; }
#nav { padding: 2px 8px 12px; flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--c-border) transparent; }
/* 用户要求"恢复以前那样，菜单都在左边"：左侧显示全部业务域的二级菜单，当前域分组高亮 */
/* 侧栏仅显示当前业务域的二级菜单：非激活域整体隐藏（元素仍在 DOM，供搜索跨域跳转/测试） */
.nav-section { display: none; }
.nav-section.active { display: block; }
.nav-section.active .nav-mod { color: var(--c-primary); background: var(--c-nav-hover); }
.nav-mod { height: 38px; padding: 0 9px; display: flex; align-items: center; gap: 10px; color: var(--c-nav-text); cursor: pointer; border-radius: 4px; font-size: 13px; font-weight: 600; transition: background .12s; }
.nav-mod:hover { color: var(--c-nav-text); background: var(--c-nav-hover); }
.nav-mod-icon { width: 18px; flex: 0 0 18px; text-align: center; color: var(--c-muted); font-size: 15px; font-family: Arial, sans-serif; }
.nav-mod-name { flex: 1; }
.nav-arrow { color: var(--c-muted); font-size: 15px; transition: transform .2s; }
.nav-mod.collapsed .nav-arrow { transform: rotate(-90deg); }
.nav-item { min-height: 34px; margin: 1px 0; padding: 8px 9px 8px 12px; display: flex; align-items: center; justify-content: space-between; color: var(--c-text); cursor: pointer; border: none; border-radius: 4px; font-size: 12.5px; transition: .12s; }
.nav-item i { visibility: hidden; font-style: normal; font-size: 17px; color: var(--c-primary); }
.nav-item:hover { color: var(--c-text); background: var(--c-nav-hover); }
.nav-item:hover i { visibility: visible; }
.nav-item.active { color: var(--c-nav-active-text); background: var(--c-nav-active-bg); border: none; font-weight: 600; box-shadow: inset 3px 0 var(--c-primary); }
.nav-item.active i { visibility: visible; }
.nav-empty { padding: 24px 8px; color: var(--c-muted); text-align: center; }
.sidebar-foot { height: 38px; padding: 0 14px; border-top: 1px solid var(--c-border); display: flex; align-items: center; gap: 7px; color: var(--c-muted); font-size: 11px; white-space: nowrap; }
.sidebar-foot small { margin-left: auto; color: var(--c-muted); }
.status-dot, .cloud-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #36ad6a; box-shadow: 0 0 0 3px rgba(54,173,106,.1); }

main { background: var(--c-bg); }
#topbar { height: 58px; min-height: 58px; padding: 0 20px; border-color: var(--c-border); box-shadow: none; }

/* 业务域横排（顶部）：仅切换业务域，无悬停下拉；低分辨率溢出收进「更多」 */
#topnav { flex: 1; min-width: 0; height: auto; min-height: 0; display: flex; align-items: center; gap: 4px; padding: 0; background: transparent; border-bottom: none; overflow: visible; white-space: nowrap; flex-wrap: nowrap; }
.topnav-item { height: 32px; padding: 0 14px; border: 1px solid transparent; border-radius: 16px; background: transparent; color: var(--c-text); font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .12s, color .12s, border-color .12s; }
.topnav-item:hover { background: var(--c-hover); color: var(--c-text); }
.topnav-item.active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; font-weight: 600; }
.topnav-sep { width: 1px; height: 22px; margin: 0 8px; background: var(--c-border); }
.topnav-system { color: var(--c-muted); }
.topnav-system.active { background: var(--c-primary); color: #fff; }
.topnav-more { position: relative; }
.topnav-caret { font-size: 10px; }
.topnav-more-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 80; min-width: 120px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 8px; padding: 6px; box-shadow: 0 10px 28px rgba(25,48,71,.16); display: flex; flex-direction: column; gap: 2px; }
.topnav-more-item { text-align: left; height: 34px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--c-text); font-size: 13px; cursor: pointer; white-space: nowrap; }
.topnav-more-item:hover { background: var(--c-hover); }
.topnav-more-item.active { background: var(--c-primary-soft); color: var(--c-primary); font-weight: 600; }
#topbar-right { display: flex; align-items: center; gap: 9px; flex-shrink: 0; color: var(--c-muted); }
.icon-btn, .topbar-action { border: 0; background: transparent; color: #687180; cursor: pointer; }
.icon-btn { width: 32px; height: 32px; border-radius: 4px; display: grid; place-items: center; font-weight: 600; }
.icon-btn:hover, .topbar-action:hover { background: var(--c-hover); color: #303744; }
#module-help { border: 1px solid #d8e1ea; border-radius: 50%; color: var(--c-primary); font-size: 15px; }
#module-help:hover { border-color: var(--c-primary); background: #eef5fb; }
.topbar-action { height: 30px; padding: 0 9px; display: flex; align-items: center; gap: 7px; border-radius: 4px; font-size: 12px; }
.topbar-divider { width: 1px; height: 22px; background: var(--c-border); }
.user-avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #55657a; font-size: 12px; }
.user-copy { display: flex; flex-direction: column; line-height: 1.15; }
.user-copy b { color: #3b424c; font-size: 12px; font-weight: 600; }
.user-copy small { margin-top: 3px; color: #9aa0a8; font-size: 9.5px; }
.chevron { color: #a2a7ae; }
.account-wrap { position: relative; }
.account-trigger {
  min-height: 42px; display: flex; align-items: center; gap: 9px; padding: 5px 7px;
  border: 0; border-radius: 6px; background: transparent; color: inherit; cursor: pointer; font-family: inherit;
}
.account-trigger:hover, .account-trigger[aria-expanded="true"] { background: #f2f5f8; }
.account-trigger[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.chevron { transition: transform .15s ease; }
.account-menu {
  position: absolute; top: calc(100% + 7px); right: 0; z-index: 70; width: 190px;
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 8px; padding: 6px;
  box-shadow: 0 10px 28px rgba(25, 48, 71, .16);
}
.account-menu-head { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px 10px; border-bottom: 1px solid var(--c-surface-2); margin-bottom: 4px; }
.account-menu-head b { color: var(--c-text); font-size: 13px; }
.account-menu-head span { color: var(--c-muted); font-size: 11px; }
.account-menu > button {
  width: 100%; display: flex; align-items: center; gap: 9px; border: 0; background: transparent;
  border-radius: 5px; padding: 9px 10px; color: var(--c-text); cursor: pointer; font-family: inherit; font-size: 13px; text-align: left;
}
.account-menu > button:hover { background: #f1f5f9; }
.account-menu > button.account-logout { color: #b13a3a; }
/* ---------- 登录页（左右分栏） ---------- */
.login-screen { position: fixed; inset: 0; z-index: 10000; }
.login-screen[hidden] { display: none; }
/* ---------- 登录页（素材包重构：左64% 背景 + 右36% 登录卡） ---------- */
.login-screen { position: fixed; inset: 0; z-index: 10000; }
.login-screen[hidden] { display: none; }
.login-split { display: grid; grid-template-columns: 64fr 36fr; min-height: 100vh; }

/* 左侧品牌区：素材包 bg-clean 背景（设备完整无字） */
.login-aside {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 3.2vh 5.2% 3.6vh;
  color: #fff; overflow: hidden;
  background: #071321 url('login-bg-clean.jpg?v=20261121mat1') center center / cover no-repeat;
}
.login-aside::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(7,19,33,.42) 0%, rgba(7,19,33,.18) 42%, rgba(7,19,33,.06) 100%);
}
.login-aside > * { position: relative; z-index: 1; }
.login-aside-inner { display: flex; flex-direction: column; height: 100%; justify-content: space-between; }
.login-logo img { display: block; width: clamp(180px, 17vw, 300px); height: auto; filter: drop-shadow(0 4px 14px rgba(0,0,0,.35)); }
.login-aside-text { margin-bottom: auto; margin-top: auto; }
.login-slogan { margin: 0 0 2.2vh; font-size: clamp(30px, 3.5vw, 62px); line-height: 1.2; font-weight: 700; letter-spacing: 1px; text-shadow: 0 3px 16px rgba(0,0,0,.4); }
.login-sub { margin: 0; color: rgba(255,255,255,.9); font-size: clamp(12px, 1.15vw, 20px); letter-spacing: 1px; }
.login-aside-foot { font-size: clamp(11px, .95vw, 16px); color: rgba(255,255,255,.85); }

/* 右侧表单区：浅灰蓝底 + 白色卡片（下划线输入） */
.login-main { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 40px 32px; background: #edeef5; }
.login-card {
  width: min(460px, 100%); min-width: 0;
  padding: 46px 46px 34px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(7,19,33,.06);
}
.login-card-head h1 { margin: 0 0 8px; font-size: 30px; font-weight: 700; color: #1a1a1a; }
.login-card-head p { margin: 0 0 34px; color: #9c9c9e; font-size: 15px; }
.login-card form { display: flex; flex-direction: column; }
.field-group { margin-bottom: 8px; }
.field-input { position: relative; display: flex; align-items: center; border-bottom: 1px solid #e5e6eb; transition: border-color .15s; }
.field-input:focus-within { border-bottom-color: #0a6ce8; }
.field-icon { position: absolute; left: 2px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; color: #0a6ce8; pointer-events: none; }
.field-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.field-icon-right { left: auto; right: 2px; width: 20px; height: 20px; color: #6b7280; }
.field-input input {
  width: 100%; min-width: 0; height: 66px; padding: 0 34px 0 34px; font-size: 16px;
  border: none; border-radius: 0; background: transparent; color: #1a1a1a;
  outline: none; box-shadow: none;
}
.field-input input::placeholder { color: #9c9c9e; }
.field-row { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 4px; }
.password-toggle { display: flex; align-items: center; gap: 8px; color: #333; font-size: 14px; cursor: pointer; }
.password-toggle input { width: 16px; height: 16px; margin: 0; accent-color: #0a6ce8; }
.login-logout-tip { color: #9c9c9e; font-size: 14px; }
.login-links { display: flex; justify-content: center; gap: 38px; margin-top: 22px; font-size: 14px; }
.login-links a { text-decoration: none; }
.login-links a:first-child { color: #2e6fd8; }
.login-links a:last-child { color: #333; }
.login-links a:hover { text-decoration: underline; }
.login-error { min-height: 18px; color: #c0392b; font-size: 13px; margin-top: 6px; }
.login-submit {
  height: 54px; margin-top: 14px; font-size: 18px; letter-spacing: 4px;
  border: none; border-radius: 12px; background: #0a6ce8; color: #fff; cursor: pointer;
  box-shadow: 0 8px 20px rgba(10,108,232,.25); transition: background .15s, transform .1s;
}
.login-submit:hover { background: #055ac4; }
.login-submit:active { transform: translateY(1px); }
.login-help { margin-top: 20px; font-size: 12px; color: #9aa9b8; text-align: center; }
.login-help summary { cursor: pointer; }

/* 窄屏：隐藏左区（按素材包建议 <992px），右区全宽居中 */
@media (max-width: 991px) {
  .login-split { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .login-main { padding: 24px 16px; }
  .login-card { width: 100%; max-width: 460px; padding: 36px 30px 28px; }
}
.dashboard-stage{margin-bottom:10px}.stage-distribution{display:flex;gap:8px;flex-wrap:wrap;margin-top:9px}.stage-distribution span{background:var(--c-surface-2);border:1px solid var(--c-border);border-radius:4px;padding:5px 9px;font-size:12px}.stage-distribution strong{color:var(--c-primary);margin-left:4px}.lifecycle-card{margin-bottom:10px;padding:12px}.lifecycle-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.lifecycle-head>div{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.health-dot{width:10px;height:10px;border-radius:50%;display:inline-block}.risk-红{background:#d92d20}.risk-黄{background:#f0a000}.risk-绿{background:#12a150}.lifecycle-overall{font-size:20px;color:#185fa5}.lifecycle-track{display:grid;grid-template-columns:repeat(auto-fit,minmax(100px,1fr));margin-top:12px;border:1px solid var(--c-border);border-radius:5px;overflow:hidden}.lifecycle-node{position:relative;display:grid;grid-template-columns:30px 1fr;grid-template-rows:auto auto;align-items:center;column-gap:7px;padding:9px;border-right:1px solid var(--c-border);background: var(--c-surface)}.lifecycle-node:last-child{border-right:0}.lifecycle-node b{font-size:12px}.lifecycle-node small{grid-column:2;color:#718096}.lifecycle-dot{grid-row:1/3;width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:10px;background:var(--c-surface-2);color:#64748b}.lifecycle-node.done{background:#f0faf5}.lifecycle-node.done .lifecycle-dot{background:#16a166;color:#fff}.lifecycle-node.doing{background:#f1f7fd}.lifecycle-node.doing .lifecycle-dot{background:#2673b8;color:#fff}.lifecycle-node.na{background:#f7f7f7}.lifecycle-risk{margin-top:8px;color:#b42318;background:#fff4f2;border-left:3px solid #d92d20;padding:6px 9px;font-size:12px}@media(max-width:1100px){.lifecycle-track{grid-template-columns:repeat(3,1fr)}.lifecycle-node:nth-child(3){border-right:0}}@media(max-width:700px){.lifecycle-track{grid-template-columns:1fr}.lifecycle-node{border-right:0;border-bottom:1px solid var(--c-border)}.lifecycle-head{align-items:flex-start}}
[hidden] { display: none !important; }
#content { padding: 18px 20px 28px; }

/* 页面通用结构 */
.page-head { min-height: 40px; margin: -2px 0 10px; }
.page-title { position: relative; color: #252b34; font-size: 17px; font-weight: 600; letter-spacing: 0; }
.page-title::after { content: ''; display: block; width: 24px; height: 2px; margin-top: 6px; background: var(--c-accent); border-radius: 2px; }
.toolbar { gap: 6px; padding: 9px 10px; margin-bottom: 10px !important; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 4px; box-shadow: var(--shadow); }
.toolbar .field { margin-bottom: 0; }
.tabs { gap: 0; margin-bottom: 12px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 4px 4px 0 0; }
.tab { padding: 9px 16px; }
.tab.active { color: var(--c-primary); border-bottom-color: var(--c-primary); }

/* 按钮 */
.btn { min-height: 30px; padding: 5px 12px; border-color: var(--c-border-strong); border-radius: 3px; color: #424a55; box-shadow: none; transition: border-color .12s, color .12s, background .12s, box-shadow .12s; }
.btn:hover { color: var(--c-primary); border-color: #86a9c3; background: #f4f8fb; transform: none; }
.btn-primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.btn-primary:hover { color: #fff; background: var(--c-primary-hover); border-color: var(--c-primary-hover); box-shadow: 0 2px 6px rgba(35,95,140,.2); }
.btn-danger { color: #d93d35; border-color: #f1c3c0; }
.btn-danger:hover { color: #c8322b; background: #fff1f0; border-color: #eb8e88; }
.btn-sm { min-height: 25px; padding: 2px 8px; font-size: 12px; }
.row-actions { gap: 5px; flex-wrap: nowrap; }

/* 数据表格：紧凑、清晰、长表头吸顶 */
.table-scroll { background: var(--c-surface); border-color: var(--c-border); border-radius: 4px; box-shadow: var(--shadow); }
table.grid { border-color: var(--c-border); border-radius: 4px; box-shadow: var(--shadow); }
table.grid th, table.grid td { padding: 8px 10px; border-right: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border); font-size: 12.5px; line-height: 1.35; }
table.grid th:last-child, table.grid td:last-child { border-right: none; }
table.grid th:first-child, table.grid td:first-child { min-width: 82px; }
table.grid th:last-child, table.grid td:last-child { min-width: 86px; }
table.grid th { position: sticky; top: 0; z-index: 2; color: var(--c-text); background: var(--c-head-bg); font-weight: 600; white-space: nowrap; }
table.grid tbody tr:nth-child(even) td { background: var(--c-row-alt); }
table.grid tbody tr:hover td { background: var(--c-hover); }
table.grid tbody tr:focus-within td { background: var(--c-hover); }
.excel-grid th { background: var(--c-head-bg); }
.excel-grid input:focus { outline-color: var(--c-primary); background: var(--c-surface); }

/* 表单 */
.field { gap: 5px; margin-bottom: 11px; }
.field label { color: var(--c-muted); font-size: 12px; }
.field input, .field select, .field textarea, .paste-area textarea { min-height: 32px; padding: 6px 9px; border-color: var(--c-border-strong); border-radius: 3px; color: var(--c-text); background-color: var(--c-surface); }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--c-primary); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: #729cbd; box-shadow: 0 0 0 2px rgba(35,95,140,.1); }
.field input:disabled, .field select:disabled, .field textarea:disabled { color: #8a919a; background: var(--c-surface-2); }
.form-section, .card, .items-block, .bom-card { border-color: var(--c-border); border-radius: 4px; box-shadow: var(--shadow); }
.form-section { position: relative; padding-top: 19px; }
.form-section > h3, .form-section > h4 { color: var(--c-text); }
.form-toolbar { padding: 8px 10px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 4px; }

/* 页签与弹窗 */
.tab-bar { gap: 2px; padding: 9px 20px 0; background: var(--c-surface-2); }
.tab-chip { padding: 7px 13px; border-radius: 4px 4px 0 0; background: var(--c-surface-2); }
.tab-chip.active { color: var(--c-primary); border-color: #e1e3e7; border-top: 2px solid var(--c-primary); background: var(--c-surface); }
.tab-body { padding: 18px 20px; background: var(--c-bg); color: var(--c-text); }
.tab-form-footer { border-color: var(--c-border); box-shadow: 0 -3px 8px rgba(30,37,48,.04); }
.modal-mask { background: rgba(20,27,37,.48); backdrop-filter: blur(1px); }
.modal { padding: 0; overflow: hidden; border-radius: 5px; box-shadow: 0 16px 50px rgba(16,24,40,.2); }
.modal h3 { margin: 0; padding: 14px 18px; border-bottom: 1px solid var(--c-border); font-size: 15px; }
.modal-body { padding: 16px 18px 4px; }
.modal-actions { margin: 0; padding: 11px 18px; border-top: 1px solid var(--c-border); background: var(--c-surface-2); }
.toast { border-radius: 4px; background: #303642; box-shadow: 0 5px 18px rgba(0,0,0,.16); }
.pill { border-radius: 3px; padding: 2px 7px; }
.pill.ok { color: #287a4b; background: #e9f7ef; }
.pill.warn { color: #a86109; background: #fff4df; }
.pill.info { color: #2866a7; background: #eaf3fc; }
.pill.danger { color: #c83831; background: #ffeded; }

/* 侧栏收起：保留模块图标，悬停仍可识别 */
.sidebar-mini #sidebar { width: 60px; flex-basis: 60px; }
.sidebar-mini .brand { padding: 10px 13px; }
.sidebar-mini .brand-copy, .sidebar-mini .nav-search-wrap, .sidebar-mini .nav-mod-name, .sidebar-mini .nav-arrow, .sidebar-mini .nav-item, .sidebar-mini .sidebar-foot span:not(.status-dot), .sidebar-mini .sidebar-foot small { display: none; }
.sidebar-mini #nav { padding: 8px; overflow: visible; }
.sidebar-mini .nav-mod { justify-content: center; padding: 0; }
.sidebar-mini .nav-mod-icon { width: 32px; flex-basis: 32px; }
.sidebar-mini .sidebar-foot { justify-content: center; padding: 0; }

@media (max-width: 900px) {
  #sidebar { position: fixed; inset: 0 auto 0 0; }
  .sidebar-mini #sidebar { transform: translateX(-100%); width: 224px; }
  #topbar { padding: 0 12px; }
  #content, .tab-body { padding: 14px 12px 22px; }
  .user-copy, .chevron, .topbar-divider { display: none; }
  .form-row { flex-direction: column; gap: 0; }
}

/* ========================================================================== */
/* 高密度录入模式：四列表头 + Excel 式连续网格（紧凑）                       */
/* ========================================================================== */

/* 页签表单把原先分散在多个 form-row 中的短字段连续排为四列 */
.tab-form-panel {
  max-width: 900px;
  color: var(--c-text);
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  column-gap: 10px;
  row-gap: 0;
  align-content: start;
}
.tab-form-panel.wide-detail-form { width: 100%; max-width: none; }
.wide-detail-form .tab-form-footer-inner { width: 100%; max-width: none; }
.wide-detail-form .form-section,
.wide-detail-form .items-block { width: 100%; min-width: 0; box-sizing: border-box; }
.material-category-manager > .page-head,
.material-category-manager > .table-scroll { grid-column: 1 / -1; width: 100%; min-width: 0; box-sizing: border-box; }
.material-category-manager > .table-scroll > table { width: 100%; min-width: 1120px; }
.wide-detail-scroll { width: 100%; max-width: 100%; }
.wide-detail-grid { width: 100%; min-width: 1740px; table-layout: auto; }
.wide-detail-grid th:first-child, .wide-detail-grid td:first-child { min-width: 54px; }
.wide-detail-grid th:last-child, .wide-detail-grid td:last-child { min-width: 58px; }
.wide-detail-grid th:not(:first-child):not(:last-child),
.wide-detail-grid td:not(:first-child):not(:last-child) { min-width: 118px; }
.wide-detail-grid input, .wide-detail-grid select { width: 100%; min-width: 100px; box-sizing: border-box; border: 0; background: transparent; }
.industrial-gas-form > .industrial-gas-form-card { grid-column: 1 / -1; width: 100%; min-width: 0; box-sizing: border-box; }
.tab-form-panel:has(#inv_no) { width: 100%; max-width: none; }
.tab-form-panel:has(#inv_no) > .page-title,
.tab-form-panel:has(#inv_no) > .muted,
.tab-form-panel:has(#inv_no) > .table-scroll { grid-column: 1 / -1; width: 100%; min-width: 0; box-sizing: border-box; }
.tab-form-panel:has(#inv_no) > .table-scroll > table { min-width: 900px; }
/* 请购单表单：明细为 11 列 Excel 式网格，占满整页宽度（与发票表单同策略） */
.tab-form-panel:has(#r_code) { width: 100%; max-width: none; }
.tab-form-panel:has(#r_code) > .items-block,
.tab-form-panel:has(#r_code) > .rq-lock-notice,
.tab-form-panel:has(#r_code) > .rq-change-reason { grid-column: 1 / -1; width: 100%; min-width: 0; box-sizing: border-box; }
.tab-form-panel:has(#r_code) > .items-block > .table-scroll { width: 100%; min-width: 0; }
.tab-form-panel:has(#r_code) > .items-block table.item-grid { min-width: 1180px; }
.industrial-gas-form-scroll { width: 100%; max-width: 100%; }
.industrial-gas-entry-grid { width: 100%; min-width: 1080px; table-layout: fixed; }
.industrial-gas-entry-grid th:nth-child(1) { width: 138px; }
.industrial-gas-entry-grid th:nth-child(2) { width: 116px; }
.industrial-gas-entry-grid th:nth-child(3),
.industrial-gas-entry-grid th:nth-child(4),
.industrial-gas-entry-grid th:nth-child(5),
.industrial-gas-entry-grid th:nth-child(6),
.industrial-gas-entry-grid th:nth-child(7) { width: 96px; }
.industrial-gas-entry-grid th:nth-child(8) { width: 190px; }
.industrial-gas-entry-grid th:nth-child(9) { width: 76px; }
.industrial-gas-entry-grid input,
.industrial-gas-entry-grid select { width: 100%; min-width: 0; height: 32px; box-sizing: border-box; border: 1px solid var(--c-border-strong); border-radius: 3px; padding: 5px 7px; color: var(--c-text); background: var(--c-surface); font: inherit; }
.industrial-gas-entry-grid input[readonly] { color: var(--c-muted); background: var(--c-surface-2); }
.industrial-gas-entry-grid input:focus,
.industrial-gas-entry-grid select:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 2px rgba(35,95,140,.1); }
.purchase-ledger-form-scroll { width: 100%; max-width: 100%; }
.purchase-ledger-entry-grid { min-width: 2600px; table-layout: fixed; }
.purchase-ledger-entry-grid th { width: 112px; }
.purchase-ledger-entry-grid th:nth-child(1) { width: 138px; }
.purchase-ledger-entry-grid th:nth-child(3),
.purchase-ledger-entry-grid th:nth-child(4),
.purchase-ledger-entry-grid th:nth-child(16),
.purchase-ledger-entry-grid th:nth-child(17),
.purchase-ledger-entry-grid th:nth-child(18) { width: 170px; }
.purchase-ledger-entry-grid input,
.purchase-ledger-entry-grid select { width: 100%; min-width: 0; height: 32px; box-sizing: border-box; border: 1px solid var(--c-border-strong); border-radius: 3px; padding: 5px 7px; color: var(--c-text); background: var(--c-surface); font: inherit; }
.purchase-ledger-entry-grid input[readonly] { color: var(--c-muted); background: var(--c-surface-2); }
.purchase-ledger-entry-grid input:focus,
.purchase-ledger-entry-grid select:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 2px rgba(35,95,140,.1); }
.shipping-paste-panel { width: 100%; margin: 0 0 10px; }
.shipping-paste-panel textarea { display: block; width: 100%; min-height: 118px; box-sizing: border-box; resize: vertical; padding: 10px 12px; border: 1px solid var(--c-border-strong); border-radius: 3px; font: inherit; }
.aftersales-paste-panel { width: 100%; margin: 0 0 10px; }
.aftersales-paste-panel textarea { display: block; width: 100%; min-height: 72px; box-sizing: border-box; resize: vertical; padding: 8px 10px; border: 1px solid var(--c-border-strong); border-radius: 3px; font: inherit; }
.shipping-items-block { width: 100%; box-sizing: border-box; }
.shipping-line-grid { min-width: 980px; table-layout: fixed; }
.shipping-line-grid .ship-col-material { width: 72px; min-width: 72px; max-width: 72px; }
.shipping-line-grid .ship-col-qty { width: 64px; min-width: 64px; max-width: 64px; }
.shipping-line-grid .ship-col-unit { width: 52px; min-width: 52px; max-width: 52px; }
.shipping-line-grid :is(.ship-col-material,.ship-col-qty,.ship-col-unit) input { min-width: 0; width: 100%; box-sizing: border-box; }

/* 系统管理 · 单据类型维护 */
.document-type-grid { display: grid; grid-template-columns: repeat(2, minmax(320px, 1fr)); gap: 12px; align-items: start; }
.document-type-card { margin: 0; padding: 12px; }
.document-type-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.document-type-head > div { display: flex; flex-direction: column; gap: 2px; }
.document-type-list { display: grid; gap: 5px; }
.document-type-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.menu-order-row { grid-template-columns:32px minmax(130px,1fr) minmax(120px,auto) auto; }
.menu-order-row code { color:var(--c-muted); font-size:11px; }
.document-type-seq { color: var(--c-muted); text-align: center; font-size: 12px; }
.document-type-row input { width: 100%; min-width: 0; height: 30px; box-sizing: border-box; }
@media (max-width: 900px) { .document-type-grid { grid-template-columns: 1fr; } }
.hd-workspaces { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; width:100%; margin:10px 0; }
.hd-workspace { position:relative; display:grid; gap:3px; min-height:82px; padding:12px 14px; text-align:left; color:var(--c-text); background:var(--c-surface); border:1px solid var(--c-border); border-radius:5px; cursor:pointer; }
.hd-workspace:hover { border-color:var(--c-primary); }
.hd-workspace.active { color:var(--c-primary); border-color:var(--c-primary); background:var(--c-primary-soft); box-shadow:inset 0 0 0 1px var(--c-primary); }
.hd-workspace b { font-size:14px; }
.hd-workspace span { color:var(--c-muted); font-size:12px; }
.hd-workspace em { color:var(--c-muted); font-size:11px; font-style:normal; }
.hd-workspace-help { display:flex; align-items:flex-start; gap:12px; margin-bottom:10px; }
.hd-workspace-help b { white-space:nowrap; }
.hd-table-scroll { width:100%; max-width:100%; min-width:0; overflow:auto; border:1px solid var(--c-border-strong); }
#hd-table { min-width:1380px; border:0; }
#hd-table[data-workspace="header"] :is(th,td):nth-child(10),
#hd-table[data-workspace="header"] :is(th,td):nth-child(11),
#hd-table[data-workspace="detail"] :is(th,td):nth-child(10),
#hd-table[data-workspace="detail"] :is(th,td):nth-child(11) { display:none; }
#hd-table[data-workspace="list"] :is(th,td):nth-child(7),
#hd-table[data-workspace="list"] :is(th,td):nth-child(8),
#hd-table[data-workspace="list"] :is(th,td):nth-child(9),
#hd-table[data-workspace="list"] :is(th,td):nth-child(12) { display:none; }
#hd-table[data-workspace="disabled"] :is(th,td):nth-child(n+7):nth-child(-n+12) { display:none; }
@media (max-width:1050px) { .hd-workspaces { grid-template-columns:repeat(2,minmax(180px,1fr)); } }
@media (max-width:680px) { .hd-workspaces { grid-template-columns:1fr; } .hd-workspace-help { display:block; } .hd-workspace-help span { display:block; margin-top:5px; } }
.tab-form-panel > .form-row { display: contents; }
.tab-form-panel > .form-toolbar,
.tab-form-panel > .items-block,
.tab-form-panel > .form-section,
.tab-form-panel > .tab-form-footer,
.tab-form-panel > .bom-card { grid-column: 1 / -1; }
.tab-form-panel > .field:has(textarea),
.tab-form-panel > .field:has(.checks),
.tab-form-panel > .field:has(input[type="file"]) { grid-column: 1 / -1; }
.tab-form-panel > .form-row > .field[style*="flex:1"],
.tab-form-panel > .form-row > .field.muted { grid-column: span 2; }

/* 带分区标题的复杂单据同样采用四列连续排布 */
.form-section {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  column-gap: 10px;
  row-gap: 0;
  padding: 10px 12px 4px;
  margin-bottom: 10px;
}
.form-section > .form-row { display: contents; }
.form-section > .form-section-title,
.form-section > h3,
.form-section > h4,
.form-section > .items-block,
.form-section > .table-scroll,
.form-section > .row-actions,
.form-section > .field:has(textarea),
.form-section > .field:has(.checks) { grid-column: 1 / -1; }
.form-section > .table-scroll,
.form-section > .row-actions { width: 100%; min-width: 0; box-sizing: border-box; }
.form-section-title { margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--c-border); color: var(--c-text); font-size: 13px; font-weight: 600; }
.form-section > .form-row > .field.muted { grid-column: span 2; }

/* 更短的字段高度和间距，减少表头占用 */
.tab-form-panel .field,
.form-section .field { min-width: 0; margin-bottom: 7px; gap: 3px; }
.tab-form-panel .field label,
.form-section .field label { min-height: 16px; color: var(--c-muted); font-size: 11.5px; line-height: 16px; }
.tab-form-panel .field input,
.tab-form-panel .field select,
.tab-form-panel .field textarea,
.form-section .field input,
.form-section .field select,
.form-section .field textarea { min-width: 0; min-height: 29px; padding: 4px 7px; }
.tab-form-panel textarea,
.form-section textarea { min-height: 48px; resize: vertical; }
.form-toolbar { min-height: 38px; padding: 4px 7px; margin-bottom: 8px; }
.items-block { margin-top: 7px; padding: 8px; border-radius: 2px; box-shadow: none; }
.items-head { min-height: 29px; margin-bottom: 5px; }
.paste-area { margin-bottom: 5px; }
.paste-area textarea { min-height: 45px; padding: 5px 7px; }

/* 主列表与明细表统一为 Excel 式连续细网格 */
.table-scroll { margin-top: 5px; border: 1px solid var(--c-border-strong); border-radius: 2px; box-shadow: none; }
table.grid {
  border: 1px solid var(--c-border-strong);
  border-radius: 0;
  box-shadow: none;
}
.table-scroll > table.grid { border: 0; }
table.grid th,
table.grid td {
  height: 29px;
  padding: 4px 7px;
  border: 1px solid var(--c-border-strong);
  font-size: 12px;
  line-height: 1.25;
  vertical-align: middle;
}
table.grid th {
  height: 30px;
  color: #3f4b59;
  background: var(--c-head-bg);
  border-color: #cbd1d7;
  text-align: center;
  vertical-align: middle;
}
table.grid tbody tr:nth-child(even) td { background: var(--c-surface); }
table.grid tbody tr:hover td { background: var(--c-hover); }
table.grid tbody tr:focus-within td { background: #f3f8fc; }

/* 可编辑明细单元格去掉内层“文本框感”，直接在格内编辑 */
.item-grid th,
.item-grid td,
.excel-grid th,
.excel-grid td { padding: 0; }
.item-grid th,
.excel-grid th { padding: 4px 6px; }
.item-grid input,
.item-grid select,
.item-grid textarea,
.excel-grid input,
.excel-grid select,
.excel-grid textarea {
  width: 100%;
  min-height: 28px;
  padding: 3px 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.item-grid input:hover,
.item-grid select:hover,
.excel-grid input:hover,
.excel-grid select:hover { background: rgba(255,255,255,.75); }
.item-grid input:focus,
.item-grid select:focus,
.item-grid textarea:focus,
.excel-grid input:focus,
.excel-grid select:focus,
.excel-grid textarea:focus {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--c-primary);
  outline-offset: -2px;
  background: var(--c-surface);
  box-shadow: none;
}
.item-grid .btn { margin: 2px 3px; min-height: 23px; }

/* 列表页也略微收紧，增加一屏可见行数 */
#content { padding-top: 14px; }
.page-head { min-height: 34px; margin-bottom: 7px; }
.toolbar { padding: 6px 8px; margin-bottom: 7px !important; }
.card { padding: 10px 12px; margin-bottom: 8px; }

@media (max-width: 1050px) {
  .tab-form-panel,
  .form-section { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .tab-form-panel > .field:has(textarea),
  .tab-form-panel > .field:has(.checks),
  .form-section > .field:has(textarea),
  .form-section > .field:has(.checks) { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .tab-form-panel,
  .form-section { display: block; }
  .tab-form-panel > .form-row,
  .form-section > .form-row { display: block; }
}

/* 图纸进度：基本信息紧凑排列，录入表在其下方全宽展开 */
.dp-form-head {
  grid-template-columns: minmax(300px, 1.5fr) minmax(150px, .65fr) minmax(220px, .85fr);
}
.dp-lines-section {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
}
.dp-lines-section .items-head { margin-bottom: 7px; }
.dp-lines-section .table-scroll { width: 100%; margin-top: 0; }

/* 电气项目详情：按业务阶段分页，避免所有记录纵向堆叠 */
.elec-project-head { align-items: center; }
.elec-overview-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 7px;
  margin-bottom: 9px;
}
.elec-overview-strip > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 7px 11px;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  background: var(--c-surface);
}
.elec-overview-strip span { color: var(--c-muted); font-size: 11.5px; }
.elec-overview-strip b { color: var(--c-text); font-size: 15px; }
.elec-overview-strip .risk { border-color: #e0a2a2; background: rgba(193,52,52,.06); }
.elec-overview-strip .risk b { color: var(--c-danger); }
.elec-detail-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--c-border);
  border-radius: 5px;
  background: var(--c-head-bg);
}
.elec-detail-nav button {
  min-width: 130px;
  min-height: 34px;
  padding: 6px 15px;
  color: var(--c-muted);
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
}
.elec-detail-nav button:hover { color: var(--c-text); background: var(--c-hover); }
.elec-detail-nav button.active { color: var(--c-primary); border-color: var(--c-border); background: var(--c-surface); box-shadow: var(--shadow); }
.elec-detail-nav em { display: inline-block; min-width: 18px; margin-left: 5px; padding: 1px 5px; color: inherit; border-radius: 10px; background: var(--c-primary-soft); font-size: 10px; font-style: normal; }
.elec-detail-pane { display: none; }
.elec-detail-pane.active { display: block; }
.elec-detail-pane > :first-child { margin-top: 0; }
.elec-focus { margin: 0 0 9px; }
.elec-task-form { margin-bottom: 0; }
.elec-responsibility { display: block; padding-bottom: 10px; }
.elec-deliverable-grid { display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)); gap: 6px; margin-top: 8px; }
.elec-deliverable { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 9px; border: 1px solid var(--c-border); background: var(--c-head-bg); }
.elec-pane-loading { padding: 28px; }
.elec-mini-progress { display: grid; grid-template-columns: minmax(90px, 1fr) 36px; align-items: center; gap: 7px; min-width: 145px; }
.elec-mini-progress > div { height: 7px; overflow: hidden; border-radius: 6px; background: var(--c-border); }
.elec-mini-progress > div > span { display: block; height: 100%; border-radius: inherit; background: var(--c-primary); }
.elec-mini-progress b { font-size: 11px; text-align: right; }
.elec-mini-strip > div { min-width: 0; }
.elec-mini-strip b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.elec-scope-note { margin: 0 0 9px; }
.elec-mini-basic { margin-bottom: 9px; }
.elec-two-progress { display: grid; grid-template-columns: repeat(2, minmax(300px, 1fr)); gap: 10px; }
.elec-two-progress > section { padding: 15px 16px 10px; border: 1px solid var(--c-border); border-radius: 5px; background: var(--c-surface); box-shadow: var(--shadow); }
.elec-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.elec-progress-head > div { display: grid; gap: 2px; }
.elec-progress-head b { font-size: 15px; }
.elec-progress-head span { color: var(--c-muted); font-size: 11.5px; }
.elec-progress-head strong { color: var(--c-primary); font-size: 22px; }
.elec-two-progress input[type="range"] { width: 100%; margin: 0 0 13px; accent-color: var(--c-primary); }
.elec-two-progress .form-row { display: grid; grid-template-columns: 105px minmax(180px, 1fr); gap: 9px; }
.elec-two-progress .field { min-width: 0; }
.elec-mini-actions { display: flex; justify-content: flex-end; margin-top: 10px; }

@media (max-width: 1050px) {
  .elec-overview-strip { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .elec-deliverable-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .elec-two-progress { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .elec-overview-strip { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .elec-detail-nav button { min-width: 112px; padding-inline: 10px; }
  .elec-deliverable-grid { grid-template-columns: 1fr; }
  .elec-two-progress .form-row { grid-template-columns: 1fr; }
}

/* 物料齐套分析：保持 Excel 式紧凑，风险仅做轻量标识 */
.pc-summary { grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 7px; margin-bottom: 8px; }
.pc-summary .summary-card { padding: 8px 11px; box-shadow: none; }
.pc-summary .summary-card .value { margin-top: 1px; font-size: 18px; }
.pc-summary .pc-ok { color: #287a4b; }
.pc-summary .pc-danger, .pc-danger-text { color: #c83831 !important; }
.pc-grid, .pc-detail-grid { white-space: nowrap; }
.pc-grid th, .pc-grid td, .pc-detail-grid th, .pc-detail-grid td { padding: 5px 7px; }
.pc-grid td, .pc-detail-grid td { height: 28px; }
.pc-grid .pc-risk-danger td:first-child { border-left: 3px solid #d6453d; }
.pc-grid .pc-risk-warn td:first-child { border-left: 3px solid #d9942f; }
.pc-grid .pc-risk-ok td:first-child { border-left: 3px solid #3d9864; }
.pc-overdue-row { background: var(--c-hover); }
.pc-progress { min-width: 105px; }
.pc-progress > span { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2px; }
.pc-progress small { color: var(--c-muted); font-size: 10px; }
.pc-progress .progress { height: 4px; }
.pc-detail-grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .pc-summary { grid-template-columns: repeat(2, minmax(140px, 1fr)); } }
.dp-entry-grid {
  min-width: 920px;
  table-layout: fixed;
  box-shadow: none !important;
}
.dp-entry-grid th,
.dp-entry-grid td {
  border: 1px solid var(--c-border) !important;
  padding: 0 !important;
  vertical-align: middle;
}
.dp-entry-grid th { padding: 6px 8px !important; text-align: center !important; }
.dp-entry-grid th:nth-child(1) { width: 150px; }
.dp-entry-grid th:nth-child(2) { width: 30%; }
.dp-entry-grid th:nth-child(3) { width: 30%; }
.dp-entry-grid th:nth-child(4),
.dp-entry-grid th:nth-child(5) { width: 100px; }
.dp-entry-grid th:nth-child(6) { width: 48px; }
.dp-entry-grid input {
  width: 100%;
  min-height: 34px;
  box-sizing: border-box;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 6px 8px;
}
.dp-entry-grid input:focus {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--c-primary);
  outline-offset: -2px;
}
.dp-entry-grid .btn-danger { display: block; margin: 3px auto; }
.dp-detail-grid { min-width: 900px; }

@media (max-width: 1050px) {
  .dp-form-head { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
}

@media (max-width: 680px) {
  .dp-form-head { display: block; }
}

/* 主题切换器（A 深色 / B 浅色 / C 工业暖色） */
.theme-switch { display: flex; align-items: center; gap: 6px; margin-right: 2px; }
.theme-switch-label { font-size: 12px; color: var(--c-muted); margin-right: 2px; }
.theme-btn { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border: 1px solid var(--c-border); border-radius: 14px; background: var(--c-surface); color: var(--c-muted); cursor: pointer; font-size: 12px; line-height: 1; transition: color .15s, border-color .15s, background .15s; }
.theme-btn:hover { color: var(--c-text); border-color: var(--c-primary); }
.theme-btn.active { color: var(--c-primary); border-color: var(--c-primary); background: var(--c-primary-soft); font-weight: 600; }
.theme-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex: none; }
.theme-dot-a { background: linear-gradient(135deg, #0d1424, #3b82f6); }
.theme-dot-b { background: #2f6bff; }
.theme-dot-c { background: linear-gradient(135deg, #2f6bff, #7e3af2); }

/* 全局业务表格：全部字段常显，按内容类型分配列宽 */
/* 不强制 fixed：浏览器缩放时宁可出现滚动，也不能挤压控件导致列内容重叠。 */
table.grid.erp-smart-grid { width: max-content; min-width: 100%; table-layout: auto; }
table.grid.erp-smart-grid :is(th,td).erp-col-control { width: 52px; min-width: 52px; max-width: 52px; text-align: center; }
table.grid.erp-smart-grid :is(th,td).erp-col-unit { width: 64px; min-width: 64px; max-width: 64px; text-align: center; white-space: nowrap; }
table.grid.erp-smart-grid :is(th,td).erp-col-number { width: 82px; min-width: 82px; max-width: 96px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.grid.erp-smart-grid th.erp-col-number { text-align: center; }
table.grid.erp-smart-grid :is(th,td).erp-col-date { width: 118px; min-width: 108px; max-width: 132px; white-space: nowrap; }
table.grid.erp-smart-grid :is(th,td).erp-col-status { width: 96px; min-width: 82px; max-width: 118px; text-align: center; }
table.grid.erp-smart-grid :is(th,td).erp-col-code { width: 142px; min-width: 112px; max-width: 168px; }
table.grid.erp-smart-grid :is(th,td).erp-col-material { width: 96px; min-width: 76px; max-width: 118px; }
table.grid.erp-smart-grid :is(th,td).erp-col-text { width: 150px; min-width: 118px; max-width: 190px; }
table.grid.erp-smart-grid :is(th,td).erp-col-wide { width: 190px; min-width: 150px; max-width: 240px; }
table.grid.erp-smart-grid :is(th,td).erp-col-note { width: 230px; min-width: 180px; max-width: 300px; }
table.grid.erp-smart-grid :is(th,td).erp-col-action { width: 1%; min-width: 92px; white-space: nowrap; text-align: center; }
table.grid.erp-smart-grid td.erp-col-action .row-actions { justify-content: center; }
table.grid.erp-smart-grid .erp-cell-text { display: -webkit-box; overflow: hidden; overflow-wrap: anywhere; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; cursor: pointer; }
table.grid.erp-smart-grid .erp-col-code .erp-cell-text { display: block; text-overflow: ellipsis; white-space: nowrap; }
table.grid.erp-smart-grid .erp-cell-text.expanded { display: block; overflow: visible; white-space: normal; -webkit-line-clamp: unset; }
.table-scroll table.grid.erp-smart-grid :is(th,td).erp-col-action { position: sticky; right: 0; z-index: 3; background: var(--c-surface); box-shadow: -1px 0 0 var(--c-border); }
.table-scroll table.grid.erp-smart-grid th.erp-col-action { z-index: 5; background: var(--c-head-bg); }
.table-scroll table.grid.erp-smart-grid tbody tr:hover td.erp-col-action,
.table-scroll table.grid.erp-smart-grid tbody tr:focus-within td.erp-col-action { background: var(--c-hover); }

/* 电气管理交付版：项目分页、详情分区、人员排程 */
.elec-list-tools { display:flex;align-items:center;gap:10px;margin:12px 0 8px;padding:10px 12px;border:1px solid var(--c-border);border-radius:6px;background:var(--c-surface); }
.elec-search { display:flex;align-items:center;flex:1;min-width:220px;gap:7px; }
.elec-search span { color:var(--c-muted);font-size:18px; }
.elec-search input { width:100%; }
.elec-list-tools select { width:140px; }
.elec-table-pager { display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:38px;padding:7px 10px;color:var(--c-muted);border:1px solid var(--c-border);border-top:0;background:var(--c-surface);font-size:12px; }
.elec-table-pager > div { display:flex;gap:6px; }
.elec-detail-summary { display:grid;grid-template-columns:1fr 1fr .7fr 1fr minmax(220px,1.6fr);gap:1px;margin-bottom:10px;overflow:hidden;border:1px solid var(--c-border);border-radius:6px;background:var(--c-border); }
.elec-detail-summary > div { display:grid;gap:4px;min-width:0;padding:11px 13px;background:var(--c-surface); }
.elec-detail-summary span { color:var(--c-muted);font-size:11px; }
.elec-detail-summary b { overflow:hidden;color:var(--c-text);text-overflow:ellipsis;white-space:nowrap; }
.elec-detail-summary .has-blocker { background:color-mix(in srgb,var(--c-warning) 9%,var(--c-surface)); }
.elec-detail-summary .has-blocker b { color:var(--c-warning); }
.elec-detail-tabs { position:sticky;top:54px;z-index:12;display:flex;gap:5px;overflow-x:auto;margin:0 0 10px;padding:7px;border:1px solid var(--c-border);border-radius:7px;background:color-mix(in srgb,var(--c-surface) 95%,transparent);box-shadow:var(--shadow);backdrop-filter:blur(8px); }
.elec-detail-tab { display:inline-flex;align-items:center;justify-content:center;flex:1 0 auto;min-width:108px;height:35px;padding:0 12px;color:var(--c-muted);border:1px solid transparent;border-radius:5px;background:transparent;cursor:pointer;font-size:13px; }
.elec-detail-tab:hover { color:var(--c-text);background:var(--c-hover); }
.elec-detail-tab.active { color:#fff;border-color:var(--c-primary);background:var(--c-primary);box-shadow:0 3px 10px rgba(24,94,137,.2); }
.elec-detail-tab em { min-width:18px;margin-left:6px;padding:1px 5px;border-radius:9px;background:rgba(127,127,127,.15);font-size:10px;font-style:normal; }
.elec-detail-tab.active em { background:rgba(255,255,255,.22); }
.elec-detail-panel[hidden] { display:none!important; }
.elec-detail-panel { animation:elec-pane-in .16s ease-out; }
.elec-detail-panel > :first-child { margin-top:0; }
.elec-detail-panel .form-section,.elec-detail-panel .items-block { margin-bottom:10px; }
.elec-detail-panel .items-head,.elec-detail-panel .form-section-title { font-size:14px; }
.elec-responsibility-block > .notice,.elec-responsibility-block > .stats { grid-column:1/-1; }
.elec-responsibility-block > .stats { display:grid;grid-template-columns:repeat(6,minmax(120px,1fr));gap:7px;margin:4px 0 8px; }
.elec-responsibility-block .stat { padding:8px 9px;border:1px solid var(--c-border);border-radius:4px;background:var(--c-head-bg); }
.elec-responsibility-block .stat-label { margin-bottom:4px;color:var(--c-muted);font-size:11px; }
@keyframes elec-pane-in { from { opacity:.35;transform:translateY(3px); } to { opacity:1;transform:none; } }
.elec-schedule-filter { align-items:center; }
.elec-schedule-legend { display:flex;gap:18px;margin:-2px 0 9px;color:var(--c-muted);font-size:12px; }
.elec-schedule-legend span { display:inline-flex;align-items:center;gap:5px; }
.elec-schedule-legend i { width:9px;height:9px;border-radius:50%;background:var(--c-success); }
.elec-schedule-legend i.info { background:var(--c-primary); }
.elec-schedule-legend i.warn { background:var(--c-warning); }
.elec-schedule-legend i.danger { background:var(--c-danger); }
.elec-schedule-scroll { max-height:calc(100vh - 350px); }
.elec-schedule-scroll table { min-width:1780px; }
.elec-schedule-scroll thead th { position:sticky;top:0;z-index:3; }
.elec-schedule-scroll .elec-person-sticky { position:sticky;left:0;z-index:2;min-width:130px;background:var(--c-surface);box-shadow:1px 0 0 var(--c-border); }
.elec-schedule-scroll thead .elec-person-sticky { z-index:5;background:var(--c-head-bg); }
.elec-day-cell { min-width:48px;text-align:center; }
@media (max-width:1100px) { .elec-detail-summary{grid-template-columns:repeat(3,minmax(140px,1fr));}.elec-detail-summary>:last-child{grid-column:span 2;}.elec-responsibility-block>.stats{grid-template-columns:repeat(3,minmax(120px,1fr));} }
@media (max-width:700px) { .elec-list-tools{align-items:stretch;flex-direction:column;}.elec-list-tools select{width:100%;}.elec-detail-summary{grid-template-columns:repeat(2,minmax(120px,1fr));}.elec-detail-summary>:last-child{grid-column:span 2;}.elec-detail-tabs{top:46px;}.elec-detail-tab{min-width:100px;}.elec-schedule-legend{flex-wrap:wrap;gap:8px 14px;} }


/* ============================================================
 * AI 助手悬浮面板
 * ============================================================ */
#assistant-root { position:fixed;right:18px;bottom:18px;z-index:900;display:flex;flex-direction:column;align-items:flex-end; }
#assistant-fab { width:48px;height:48px;border:none;border-radius:50%;background:var(--c-primary,#18608a);color:#fff;font-size:20px;cursor:pointer;box-shadow:0 6px 18px rgba(24,94,137,.35);display:flex;align-items:center;justify-content:center;position:relative;transition:transform .15s; }
#assistant-fab:hover { transform:translateY(-2px); }
#assistant-fab .assistant-fab-badge { position:absolute;top:-2px;right:-2px;min-width:12px;height:12px;padding:0 3px;border-radius:6px;background:var(--c-danger,#d64545);color:#fff;font-size:10px;line-height:12px; }
#assistant-panel { width:min(420px,calc(100vw - 24px));height:min(560px,calc(100vh - 120px));margin-bottom:10px;display:flex;flex-direction:column;border:1px solid var(--c-border,#d8dee6);border-radius:12px;background:var(--c-surface,#fff);box-shadow:0 12px 40px rgba(15,35,55,.18);overflow:hidden; }
#assistant-panel[hidden] { display:none!important; }
.assistant-head { display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid var(--c-border,#d8dee6);background:var(--c-head-bg,#f5f7fa); }
.assistant-title { display:flex;align-items:center;gap:9px; }
.assistant-title-icon { width:28px;height:28px;border-radius:8px;background:var(--c-primary,#18608a);color:#fff;display:flex;align-items:center;justify-content:center;font-size:14px; }
.assistant-title b { font-size:14px; }
.assistant-title small { display:block;color:var(--c-muted,#8a94a3);font-size:11px; }
.assistant-head-actions { display:flex;gap:4px; }
.assistant-icon-btn { width:28px;height:28px;border:none;border-radius:6px;background:transparent;color:var(--c-muted,#8a94a3);font-size:14px;cursor:pointer; }
.assistant-icon-btn:hover { background:var(--c-hover,#eceff4);color:var(--c-text,#22303f); }
#assistant-body { flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:10px;background:var(--c-bg,#f2f4f8); }
.assistant-msg { display:flex;max-width:92%; }
.assistant-msg-user { align-self:flex-end; }
.assistant-msg-assistant { align-self:flex-start; }
.assistant-bubble { padding:9px 12px;border-radius:10px;font-size:13px;line-height:1.65;white-space:pre-wrap;word-break:break-word; }
.assistant-msg-user .assistant-bubble { background:var(--c-primary,#18608a);color:#fff;border-bottom-right-radius:3px; }
.assistant-msg-assistant .assistant-bubble { background:var(--c-surface,#fff);border:1px solid var(--c-border,#d8dee6);border-bottom-left-radius:3px; }
.assistant-card { margin-top:8px;border:1px solid var(--c-border,#d8dee6);border-radius:8px;padding:8px 10px;background:var(--c-head-bg,#f8fafc);white-space:normal; }
.assistant-card-title { font-size:12px;font-weight:600;color:var(--c-muted,#8a94a3);margin-bottom:5px; }
.assistant-card-steps ol { margin:0;padding-left:18px; }
.assistant-card-steps li { margin:3px 0; }
.assistant-card-text { font-size:13px; }
.assistant-table-wrap { overflow-x:auto; }
.assistant-table-wrap table { border-collapse:collapse;width:100%;font-size:12px;white-space:nowrap; }
.assistant-table-wrap th,.assistant-table-wrap td { padding:4px 8px;border-bottom:1px solid var(--c-border,#e3e8ef);text-align:left; }
.assistant-table-wrap th { color:var(--c-muted,#8a94a3);font-weight:500;background:var(--c-head-bg,#f0f3f7); }
.assistant-links { display:flex;flex-wrap:wrap;gap:6px; }
.assistant-link { display:inline-block;padding:4px 10px;border-radius:6px;border:1px solid var(--c-primary,#18608a);color:var(--c-primary,#18608a);font-size:12px;text-decoration:none;cursor:pointer;background:transparent; }
.assistant-link:hover { background:var(--c-primary,#18608a);color:#fff; }
.assistant-typing { display:flex;gap:4px;align-items:center; }
.assistant-typing i { width:6px;height:6px;border-radius:50%;background:var(--c-muted,#a8b2c0);animation:assistant-blink 1.2s infinite; }
.assistant-typing i:nth-child(2) { animation-delay:.2s; }
.assistant-typing i:nth-child(3) { animation-delay:.4s; }
@keyframes assistant-blink { 0%,80%,100% { opacity:.25; } 40% { opacity:1; } }
#assistant-suggestions { display:flex;flex-wrap:wrap;gap:6px;padding:8px 14px 0;min-height:0; }
#assistant-suggestions:empty { display:none; }
.assistant-chip { padding:4px 11px;border-radius:14px;border:1px solid var(--c-border,#d8dee6);background:var(--c-surface,#fff);color:var(--c-text,#22303f);font-size:12px;cursor:pointer; }
.assistant-chip:hover { border-color:var(--c-primary,#18608a);color:var(--c-primary,#18608a); }
#assistant-form { display:flex;gap:8px;padding:10px 14px;border-top:1px solid var(--c-border,#d8dee6);background:var(--c-surface,#fff); }
#assistant-input { flex:1;height:36px;padding:0 11px;border:1px solid var(--c-border,#d8dee6);border-radius:8px;font-size:13px;background:var(--c-surface,#fff);color:var(--c-text,#22303f);outline:none; }
#assistant-input:focus { border-color:var(--c-primary,#18608a); }
#assistant-send { height:36px;padding:0 16px; }
@media (max-width:600px) { #assistant-root{right:10px;bottom:10px;} #assistant-panel{height:min(520px,calc(100vh - 90px));} }

/* ============================================================
   2026-09 内容区排版层（配合新三主题：B 现代亮色 / C 企业蓝白 / A 深色驾驶舱）
   规则只作用于内容区组件，导航框架（顶部业务域横排 + 左侧二级菜单）不变
   ============================================================ */

/* ---- 按钮：现代圆角 + 主色实底 ---- */
.btn { min-height:32px; padding:5px 14px; border:1px solid var(--c-border-strong); border-radius:6px; background:var(--c-surface); color:var(--c-text); font-size:13px; box-shadow:none; transform:none; transition:background .12s,border-color .12s; }
.btn:hover { background:var(--c-hover); color:var(--c-text); border-color:var(--c-border-strong); transform:none; box-shadow:none; }
.btn-primary { background:var(--c-primary); border-color:var(--c-primary); color:#fff; font-weight:500; }
.btn-primary:hover { background:var(--c-primary-hover); border-color:var(--c-primary-hover); color:#fff; }
.btn-danger { color:var(--c-danger); border-color:var(--c-danger-bg); }
.btn-danger:hover { background:var(--c-danger-bg); color:var(--c-danger); }
.btn-sm { min-height:25px; padding:2px 10px; font-size:12px; border-radius:5px; }

/* ---- 输入控件：统一高度 + 聚焦环 ---- */
.field input, .field select, .field textarea, .paste-area textarea,
.filter-bar input, .filter-bar select {
  min-height:32px; padding:5px 9px;
  border:1px solid var(--c-border-strong); border-radius:6px;
  background:var(--c-surface); color:var(--c-text); font-size:12.5px;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color:var(--c-border-strong); }
.field input:focus, .field select:focus, .field textarea:focus,
.filter-bar input:focus, .filter-bar select:focus {
  outline:none; border-color:var(--c-primary); box-shadow:0 0 0 3px var(--c-primary-soft);
}
.field input:disabled, .field select:disabled, .field textarea:disabled { background:var(--c-surface-2); color:var(--c-muted); }

/* ---- 表单分区：卡片化 + 标题色条 + 底部操作区 ---- */
.form-section, .tab-form-panel { background:var(--c-surface); border:1px solid var(--c-border); border-radius:8px; box-shadow:var(--shadow); }
.form-section { padding:14px 16px 10px; margin-bottom:14px; }
.form-section-title { display:flex; align-items:center; gap:8px; margin:0 0 10px; padding-bottom:0; border-bottom:1px solid var(--c-border); color:var(--c-text); font-size:13.5px; font-weight:600; }
.form-section-title::before { content:''; flex:0 0 4px; width:4px; height:14px; border-radius:2px; background:var(--c-primary); margin-right:0; }
.form-actions { grid-column:1 / -1; display:flex; justify-content:flex-end; gap:8px; margin-top:10px; padding-top:10px; border-top:1px dashed var(--c-border); }

/* ---- 表格：去竖线、灰底表头、细行线、悬浮浅色 ---- */
/* 宽表必须可横向滚动；此前 overflow:hidden 会把最右侧列（如项目成本的操作列）直接裁掉。
   纵向也改为 auto：采购待办工作台明细表等带 max-height 的表格需要上下滚动，否则超出部分会被裁掉。 */
.table-scroll { margin-top:6px; border:1px solid var(--c-border); border-radius:8px; overflow-x:auto; overflow-y:auto; -webkit-overflow-scrolling:touch; box-shadow:var(--shadow); background:var(--c-surface); }
.table-scroll > table.grid { border:0; }
table.grid { border:1px solid var(--c-border); border-radius:0; box-shadow:none; }
table.grid th, table.grid td { height:auto; padding:8px 11px; border:0; border-bottom:1px solid var(--c-border); font-size:12.5px; line-height:1.35; text-align:left; vertical-align:middle; }
table.grid th { position:sticky; top:0; z-index:2; color:var(--c-muted); background:var(--c-head-bg); font-weight:600; border-bottom:1px solid var(--c-border-strong); }
table.grid tbody tr:last-child td { border-bottom:0; }
table.grid tbody tr:hover td, table.grid tbody tr:focus-within td { background:var(--c-hover); }
table.grid tfoot td { background:var(--c-surface-2); border-top:1px solid var(--c-border); }
.num, .src-number, .src-qty { font-variant-numeric:tabular-nums; }

/* 采购交付跟催：订单量/已收/未收 三列收窄 */
table.grid.followup-grid :is(th, td).col-qty { width: 1%; white-space: nowrap; text-align: center; font-variant-numeric: tabular-nums; }

/* Excel 内联明细表：保持格内编辑形态（收窄本层对 padding 的影响） */
.item-grid th, .excel-grid th { padding:6px 8px; }
.item-grid td, .excel-grid td { padding:0; }
.item-grid, .excel-grid { border:0; }
.item-grid input, .item-grid select, .item-grid textarea,
.excel-grid input, .excel-grid select, .excel-grid textarea {
  min-height:30px; padding:4px 7px; border:0; border-radius:0; background:transparent; box-shadow:none;
}
.item-grid input:hover, .excel-grid input:hover, .item-grid select:hover, .excel-grid select:hover { background:var(--c-hover); }
.item-grid input:focus, .excel-grid input:focus, .item-grid select:focus, .excel-grid select:focus,
.item-grid textarea:focus, .excel-grid textarea:focus {
  position:relative; z-index:1; outline:2px solid var(--c-primary); outline-offset:-2px; background:var(--c-surface); box-shadow:none;
}

/* ---- 筛选栏：白卡片 ---- */
.filter-bar { background:var(--c-surface); border:1px solid var(--c-border); border-radius:8px; padding:10px 12px; margin-bottom:12px; box-shadow:var(--shadow); }

/* ---- 状态胶囊：圆角软色（色值跟随主题） ---- */
.pill { border-radius:999px; padding:2px 10px; font-size:11.5px; font-weight:500; }
.pill.ok { background:var(--c-success-bg); color:var(--c-success); }
.pill.warn { background:var(--c-warning-bg); color:var(--c-warning); }
.pill.info { background:var(--c-info-bg); color:var(--c-info); }
.pill.danger { background:var(--c-danger-bg); color:var(--c-danger); }

/* ---- 统计卡：等高网格 + 大数字 ---- */
.stat-row, .stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(165px,1fr)); gap:12px; margin-bottom:14px; }
.stat-card, .stat { background:var(--c-surface); border:1px solid var(--c-border); border-radius:8px; padding:13px 15px; box-shadow:var(--shadow); }
.stat-card b { font-size:22px; font-weight:700; font-variant-numeric:tabular-nums; color:var(--c-text); }
.stat-card span { font-size:12px; color:var(--c-muted); }
.stat .stat-label { font-size:12px; color:var(--c-muted); }
.stat .stat-value { font-size:20px; font-weight:700; font-variant-numeric:tabular-nums; color:var(--c-text); }

/* ---- 电气页新组件：流程步骤链 / 概览条 ---- */
.flow-steps { display:flex; align-items:center; flex-wrap:wrap; gap:6px; background:var(--c-surface); border:1px solid var(--c-border); border-radius:8px; padding:9px 14px; margin-bottom:12px; font-size:12.5px; box-shadow:var(--shadow); }
.flow-steps .lab { color:var(--c-muted); margin-right:2px; }
.flow-steps .step { padding:2px 10px; border-radius:999px; background:var(--c-surface-2); color:var(--c-muted); }
.flow-steps .step.done { background:var(--c-success-bg); color:var(--c-success); }
.flow-steps .step.now { background:var(--c-primary-soft); color:var(--c-primary); font-weight:600; box-shadow:inset 0 0 0 1px var(--c-primary); }
.flow-steps .arr { color:var(--c-border-strong); font-size:11px; }
.flow-steps .note { margin-left:auto; color:var(--c-muted); font-size:11.5px; }
.kv-strip { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:10px 18px; background:var(--c-surface); border:1px solid var(--c-border); border-radius:8px; padding:12px 16px; margin-bottom:14px; box-shadow:var(--shadow); }
.kv b { display:block; font-size:11.5px; color:var(--c-muted); font-weight:500; margin-bottom:3px; }
.kv span { font-size:14px; font-weight:600; color:var(--c-text); }
.kv-strip > div label { display:block; font-size:11.5px; color:var(--c-muted); font-weight:500; margin-bottom:3px; }
.kv-strip > div span { font-size:14px; font-weight:600; color:var(--c-text); word-break:break-all; }

/* ---- 设备维护 ---- */
.eq-tabs { display:flex; gap:4px; margin:0 0 14px; padding:4px; width:max-content; max-width:100%; border:1px solid var(--c-border); border-radius:8px; background:var(--c-surface-2); }
.eq-tab { border:0; background:none; padding:7px 14px; border-radius:6px; font-size:13px; color:var(--c-muted); cursor:pointer; }
.eq-tab.active { background:var(--c-surface); color:var(--c-primary); font-weight:600; box-shadow:var(--shadow); }
.eq-section { margin-bottom:16px; }
.eq-section-title { font-size:13.5px; font-weight:600; margin-bottom:9px; display:flex; align-items:center; gap:8px; }
.eq-section-title::before { content:''; display:inline-block; width:4px; height:13px; border-radius:2px; background:var(--c-primary); }
.eq-section-title .btn { margin-left:auto; }
.eq-toolbar { display:flex; gap:10px; margin-bottom:12px; flex-wrap:wrap; }
.eq-toolbar input, .eq-toolbar select { border:1px solid var(--c-border-strong); border-radius:6px; padding:6px 10px; font-size:13px; color:var(--c-text); background:var(--c-surface); }
.danger-text { color:#c83831; }
.warn-text { color:#a86109; }
.muted-text { color:var(--c-muted); }

/* ---- 批量到货 ---- */
.batch-scroll { max-height:52vh; overflow:auto; border:1px solid var(--c-border); border-radius:8px; padding:8px 10px; background:var(--c-surface); }
.batch-order { margin-bottom:10px; }
.batch-order-head { display:flex; align-items:center; gap:10px; padding:6px 8px; background:var(--c-surface-2); border-radius:6px; font-size:13px; margin-bottom:6px; }
.batch-line { display:flex; align-items:center; gap:10px; padding:6px 8px; border-bottom:1px solid var(--c-border); }
.batch-line.controlled { background:var(--c-surface-2); opacity:.75; }
.batch-line-main { display:flex; align-items:center; gap:8px; flex:1; font-size:13px; color:var(--c-text); }
.batch_line_qty { width:90px; padding:5px 8px; border:1px solid var(--c-border-strong); border-radius:5px; color:var(--c-text); background:var(--c-surface); }

/* ---- 明细分区：标题行 + 右侧动作 ---- */
.items-block { margin-top:7px; padding:12px 14px; border:1px solid var(--c-border); border-radius:8px; background:var(--c-surface); box-shadow:var(--shadow); }
.items-head { min-height:29px; margin-bottom:8px; display:flex; align-items:center; gap:8px; }
.items-head span { font-size:13.5px; font-weight:600; color:var(--c-text); }
.items-head span::before { content:''; display:inline-block; width:4px; height:13px; border-radius:2px; background:var(--c-primary); margin-right:7px; vertical-align:-1px; }
.items-head .btn-sm, .items-head button { margin-left:auto; }

/* ---- 页头：标题 18px ---- */
.page-title { font-size:18px; font-weight:700; letter-spacing:0; }
.page-title::after { display:none; }
.page-head { align-items:flex-start; }

/* ---- 弹窗：圆角 + 底部操作右对齐 ---- */
.modal { border-radius:12px; }
.modal-actions { padding-top:12px; border-top:1px solid var(--c-border); display:flex; justify-content:flex-end; gap:8px; }

/* ---- 主题 C 专项：清爽圆润（大圆角 + 蓝紫渐变主按钮 + 白顶栏） ---- */
:root[data-theme="C"] #topbar { background: var(--c-surface); border-bottom: 1px solid var(--c-border); }
:root[data-theme="C"] .topnav-item { border-radius: 18px; }
:root[data-theme="C"] .topnav-item.active { background: linear-gradient(135deg, #2f6bff, #7e3af2); border-color: transparent; }
:root[data-theme="C"] .btn { border-radius: 10px; }
:root[data-theme="C"] .btn-primary { background: linear-gradient(135deg, #2f6bff, #7e3af2); border: none; box-shadow: 0 4px 12px rgba(47,107,255,.28); }
:root[data-theme="C"] .btn-primary:hover { background: linear-gradient(135deg, #1f54d6, #6d28d9); }
:root[data-theme="C"] .btn-sm { border-radius: 8px; }
:root[data-theme="C"] .field input, :root[data-theme="C"] .field select, :root[data-theme="C"] .filter-bar input { border-radius: 10px; }
:root[data-theme="C"] .form-section, :root[data-theme="C"] .table-scroll, :root[data-theme="C"] .filter-bar, :root[data-theme="C"] .items-block, :root[data-theme="C"] .flow-steps, :root[data-theme="C"] .kv-strip { border-radius: 12px; }
:root[data-theme="C"] .modal { border-radius: 16px; }
:root[data-theme="C"] .nav-item { border-radius: 10px; }
:root[data-theme="C"] .nav-item.active { box-shadow: inset 3px 0 transparent; background: var(--c-nav-active-bg); }
:root[data-theme="C"] .user-avatar { background: linear-gradient(135deg, #2f6bff, #7e3af2); }
:root[data-theme="C"] .flow-steps .step.now { background: linear-gradient(135deg, rgba(47,107,255,.12), rgba(126,58,242,.10)); color: #1f54d6; box-shadow: inset 0 0 0 1px rgba(47,107,255,.45); }
:root[data-theme="C"] .progress-bar, :root[data-theme="C"] .progress > div { background: linear-gradient(90deg, #2f6bff, #7e3af2); }

/* ---- 主题 A 专项：深色驾驶舱微调 ---- */
:root[data-theme="A"] .topnav-item.active { color:#fff; }
:root[data-theme="A"] .btn { background:var(--c-surface); }
:root[data-theme="A"] .btn-primary { background:var(--c-primary); }
:root[data-theme="A"] .form-section-title, :root[data-theme="A"] .items-head span { color:var(--c-text); }
:root[data-theme="A"] .flow-steps .arr { color:var(--c-border); }

/* ============================================================
   2026-09-08 登录页左右协调：左侧品牌区改为随主题变量（右侧本就跟随 --c-bg）
   ============================================================ */
:root {
  --login-aside-bg:
    radial-gradient(1100px 560px at -12% -10%, rgba(99,102,241,.32), transparent 60%),
    radial-gradient(820px 480px at 122% 118%, rgba(217,119,6,.22), transparent 55%),
    linear-gradient(152deg, #1b2440 0%, #10162b 100%);
  --login-aside-text: #e8ecf8;
  --login-aside-muted: #9aa6c8;
  --login-aside-feature: #d5dcf0;
  --login-aside-check-bg: rgba(99,102,241,.26);
  --login-aside-check: #a5b4fc;
}
:root[data-theme="A"] {
  --login-aside-bg:
    radial-gradient(1100px 560px at -12% -10%, rgba(59,130,246,.30), transparent 60%),
    radial-gradient(820px 480px at 122% 118%, rgba(34,211,238,.16), transparent 55%),
    linear-gradient(152deg, #101a30 0%, #0b1120 100%);
  --login-aside-text: #e6edf7;
  --login-aside-muted: #8ba1c0;
  --login-aside-feature: #d7e3f5;
  --login-aside-check-bg: rgba(59,130,246,.25);
  --login-aside-check: #7db3f7;
}
:root[data-theme="C"] {
  --login-aside-bg:
    radial-gradient(1100px 560px at -12% -10%, rgba(47,107,255,.34), transparent 60%),
    radial-gradient(820px 480px at 122% 118%, rgba(126,58,242,.28), transparent 55%),
    linear-gradient(152deg, #1d2440 0%, #141a30 100%);
  --login-aside-text: #eef1fb;
  --login-aside-muted: #a3aecf;
  --login-aside-feature: #d9def3;
  --login-aside-check-bg: rgba(126,58,242,.28);
  --login-aside-check: #b79cff;
}
/* 登录页素材包重构（2026-11-21）：左侧用 bg-clean 背景，不受主题变量覆盖 */
.login-aside { background: #071321 url('login-bg-clean.jpg?v=20261121mat1') center center / cover no-repeat; color: #fff; }
.login-sub { color: rgba(255,255,255,.9); }
.login-aside-foot { color: rgba(255,255,255,.85); }
@media (max-width: 991px) { .login-main { background: #edeef5; } }

/* ============================================================
   表单列宽治理：短字段不再被输入控件的默认最小宽度撑开。
   仅作用于 table-layout.js 已识别的标准 grid；复杂合并表头保持原布局。
   ============================================================ */
table.grid.erp-smart-grid td :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}
table.grid.erp-smart-grid :is(th, td).erp-col-control,
table.grid.erp-smart-grid :is(th, td).erp-col-unit,
table.grid.erp-smart-grid :is(th, td).erp-col-number,
table.grid.erp-smart-grid :is(th, td).erp-col-status,
table.grid.erp-smart-grid :is(th, td).erp-col-material {
  padding-right: 6px;
  padding-left: 6px;
}
table.grid.erp-smart-grid td.erp-col-number :is(input:not([type="checkbox"]):not([type="radio"]), select),
table.grid.erp-smart-grid td.erp-col-unit :is(input:not([type="checkbox"]):not([type="radio"]), select),
table.grid.erp-smart-grid td.erp-col-status :is(input:not([type="checkbox"]):not([type="radio"]), select) {
  width: 100%;
  min-width: 0;
  padding-right: 5px;
  padding-left: 5px;
}
/* 11 列以上的单据采用紧凑档：先收数字、单位、日期等，不牺牲名称和备注。 */
table.grid.erp-smart-grid[data-erp-density="dense"] :is(th, td).erp-col-control { width: 44px; min-width: 44px; max-width: 44px; }
table.grid.erp-smart-grid[data-erp-density="dense"] :is(th, td).erp-col-unit { width: 56px; min-width: 56px; max-width: 56px; }
table.grid.erp-smart-grid[data-erp-density="dense"] :is(th, td).erp-col-number { width: 72px; min-width: 68px; max-width: 82px; }
table.grid.erp-smart-grid[data-erp-density="dense"] :is(th, td).erp-col-date { width: 108px; min-width: 100px; max-width: 116px; }
table.grid.erp-smart-grid[data-erp-density="dense"] :is(th, td).erp-col-status { width: 82px; min-width: 72px; max-width: 96px; }
table.grid.erp-smart-grid[data-erp-density="dense"] :is(th, td).erp-col-code { width: 124px; min-width: 104px; max-width: 142px; }
table.grid.erp-smart-grid[data-erp-density="dense"] :is(th, td).erp-col-material { width: 84px; min-width: 68px; max-width: 100px; }
table.grid.erp-smart-grid[data-erp-density="dense"] :is(th, td).erp-col-action { min-width: 78px; }
/* 编辑明细中的数字控件不允许反向把列撑宽；按钮列仍固定在滚动区右侧。 */
table.grid.erp-smart-grid[data-erp-editable="true"] td.erp-col-number input[type="number"] { appearance: textfield; }
table.grid.erp-smart-grid[data-erp-editable="true"] td.erp-col-number input[type="number"]::-webkit-inner-spin-button { margin: 0; }

/* 请购列表：短业务字段固定为紧凑列，给项目与右侧操作腾出空间。 */
table.grid.requisition-list-grid :is(th, td):nth-child(2) { width: 78px; min-width: 70px; max-width: 86px; text-align: center; }
table.grid.requisition-list-grid :is(th, td):nth-child(3) { width: 68px; min-width: 60px; max-width: 76px; text-align: center; }
table.grid.requisition-list-grid :is(th, td):nth-child(6) { width: 72px; min-width: 64px; max-width: 82px; text-align: center; }
table.grid.requisition-list-grid :is(th, td):nth-child(8) { width: 52px; min-width: 48px; max-width: 58px; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ============ 电气模块整改（20260908）：六节点流程条 / 电气看板 / 节点圆点 ============ */
.flow-steps .step.delayed { background: #fde2e2; color: var(--c-danger); }
.elec-node-flow .step { cursor: pointer; }
.elec-node-flow .step:hover { opacity: .82; }
.elec-node-dots { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }
.elec-node-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--c-border-strong); }
.elec-node-dots i.ok { background: var(--c-success); }
.elec-node-dots i.info { background: var(--c-primary); }
.elec-node-dots i.danger { background: var(--c-danger); }
.elec-node-dots i.skip { background: var(--c-muted); opacity: .4; }
.elec-board-scroll { overflow-x: auto; }
.elec-board-scroll table { min-width: 1080px; }
.elec-board-scroll thead th { white-space: nowrap; }
.eb-cell { min-width: 92px; }
.eb-cell .eb-sub { font-size: 11px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
td.eb-click { cursor: pointer; }
td.eb-click:hover { background: var(--c-hover); }
.eb-delayed-toggle { display: inline-flex; align-items: center; gap: 5px; color: var(--c-muted); font-size: 12.5px; white-space: nowrap; }
.elec-detail-panel .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 10px; }
.elec-detail-panel .stat { padding: 8px 10px; border: 1px solid var(--c-border); border-radius: 8px; background: var(--c-surface-2); }
.elec-detail-panel .stat-label { color: var(--c-muted); font-size: 12px; margin-bottom: 4px; }
.elec-detail-panel .release-stats { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; margin-bottom: 6px; }
.elec-detail-panel .release-stat { display: inline-flex; align-items: center; gap: 8px; }
.elec-detail-panel .release-label { color: var(--c-muted); font-size: 13px; }
.page-head.compact{margin:12px 0 8px;align-items:center}.production-package{margin:10px 0;padding:12px;border-left:4px solid var(--primary,#3157a4)}.compact-grid input,.compact-grid select{min-width:90px;padding:5px 7px}.compact-grid input[type="checkbox"]{min-width:auto}.daily-allocation{display:grid;grid-template-columns:minmax(240px,2fr) 110px 110px minmax(180px,1fr) auto;gap:8px;margin:8px 0;align-items:center}.checkline{display:flex;align-items:center;gap:8px;margin:14px 0}.text-danger{color:#c62828}.text-success{color:#16823b}@media(max-width:900px){.daily-allocation{grid-template-columns:1fr 1fr}.daily-allocation button{grid-column:span 2}.production-package .form-row{grid-template-columns:1fr 1fr}}

/* 项目明细驱动的生产拆分与批量报工工作台 */
.production-source-head{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:10px;margin-bottom:12px;padding:12px;border:1px solid var(--c-border);border-radius:10px;background:var(--c-surface-2)}
.production-source-head>div:not(.field){display:flex;flex-direction:column;gap:5px}.production-source-head span{font-size:12px;color:var(--c-muted)}
.production-source-item{margin:12px 0;padding:0;overflow:hidden}.production-source-title{display:flex;align-items:center;gap:14px;flex-wrap:wrap;padding:10px 12px;background:var(--c-surface-2);border-bottom:1px solid var(--c-border)}
.production-source-title .checkline{margin:0}.production-source-title span{color:var(--c-muted);font-size:12px}.production-source-item .table-scroll{margin:0}.production-source-item table{margin:0}
.production-report-toolbar{display:grid;grid-template-columns:220px minmax(320px,1fr);gap:12px;align-items:end;margin:12px 0;padding:12px;border:1px solid var(--c-border);border-radius:10px;background:var(--c-surface-2)}
.production-report-toolbar .grow{min-width:0}.production-report-grid textarea{min-width:230px;resize:vertical}.production-report-grid input[type="number"]{width:92px;min-width:92px}.production-report-grid .row-actions{margin-top:5px}
@media(max-width:900px){.production-source-head{grid-template-columns:1fr 1fr}.production-report-toolbar{grid-template-columns:1fr}.production-source-title{align-items:flex-start}}

/* ==========================================================================
   共享质感层 v2026-09-14（主题无关：深A / 浅B / 柔C 三套共用，各自配色不变）
   —— 只统一"形状与质感"：圆角尺度 / 阴影层级 / 状态标签形态；配色仍走 --c-* 变量。
   —— 置于文件末尾，确保在既有叠层之后生效（特异性 :root[data-theme]+组件，可覆盖历史硬编码）。
   ========================================================================== */
:root {
  --radius-control: 8px;      /* 按钮、输入框、下拉 */
  --radius-block: 12px;       /* 卡片、区块、表格、弹窗 */
  --radius-pill: 999px;       /* 状态胶囊 */
  --shadow-sm: 0 1px 2px rgba(16,24,40,.04);
  --shadow-md: 0 2px 8px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.16);
}
/* 深色驾驶舱：阴影改深色并加重，避免亮色阴影在深底上发灰 */
:root[data-theme="A"] {
  --shadow-sm: 0 1px 3px rgba(0,0,0,.35);
  --shadow-md: 0 4px 14px rgba(0,0,0,.42);
  --shadow-lg: 0 16px 44px rgba(0,0,0,.6);
}
/* 柔和主题：保留"大圆角 + 蓝紫柔光阴影"的个性 */
:root[data-theme="C"] {
  --radius-control: 10px;
  --radius-block: 14px;
  --shadow-sm: 0 4px 14px rgba(47,107,255,.08);
}

/* 卡片与区块：统一大圆角 + 轻阴影 */
:root[data-theme] .card,
:root[data-theme] .form-section,
:root[data-theme] .items-block,
:root[data-theme] .bom-card { border-radius: var(--radius-block); box-shadow: var(--shadow-sm); }
/* 区块内再嵌卡片时不叠加阴影，避免"影子里套影子" */
:root[data-theme] .form-section .card,
:root[data-theme] .form-section .items-block { box-shadow: none; }

/* 表格容器与表格本体圆角统一（内层不圆角，交给外层 overflow 裁剪） */
:root[data-theme] .table-scroll { border-radius: var(--radius-block); }
:root[data-theme] table.grid { border-radius: var(--radius-block); }
:root[data-theme] .table-scroll > table.grid { border-radius: 0; }
/* 与 workspace-ux 的表格工具条拼接时，容器只需下圆角 */
:root[data-theme] .ux-table-tools + .table-scroll { border-radius: 0 0 var(--radius-block) var(--radius-block); }

/* 表单控件与按钮：统一圆角 */
:root[data-theme] .btn { border-radius: var(--radius-control); }
:root[data-theme] .field input,
:root[data-theme] .field select,
:root[data-theme] .field textarea,
:root[data-theme] .filter-bar input,
:root[data-theme] .filter-bar select { border-radius: var(--radius-control); }

/* 弹窗：大圆角 + 高层阴影 */
:root[data-theme] .modal { border-radius: var(--radius-block); box-shadow: var(--shadow-lg); }

/* 状态标签统一为胶囊 */
:root[data-theme] .pill { border-radius: var(--radius-pill); }

/* ==========================================================================
   共享质感层 · 第二批（呼吸感与精致度）v2026-09-14
   —— 聚焦环统一由主题主色驱动；表格行高舒展；数字等宽；区块内边距透气。
   ========================================================================== */

/* 1) 聚焦环：统一走主题主色（替换历史硬编码钢青蓝，B/C 主题下不再串色） */
:root { --focus-ring: rgba(47,107,255,.30); }
:root[data-theme="A"] { --focus-ring: rgba(59,130,246,.48); }
:root[data-theme="C"] { --focus-ring: rgba(126,58,242,.28); }

/* 键盘聚焦环统一交给 workspace-ux.css 的 :focus-visible（其已用 var(--c-primary) 跟随主题，勿覆盖）；
   此处仅修输入框点击聚焦时来自 styles.css:874 的硬编码钢青蓝。 */
:root[data-theme] .field input:focus,
:root[data-theme] .field select:focus,
:root[data-theme] .field textarea:focus {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
  border-color: var(--c-primary);
  box-shadow: none;
}
/* 校验失败的输入框：workspace-ux.js 的 prepareSave() 会设 aria-invalid=true 并立刻 .focus()，
   与上条 :focus 规则同时命中且本条特异性更高，否则红色警示会被主色边框覆盖（"报错了却显示蓝框"）。 */
:root[data-theme] .field :is(input, select, textarea)[aria-invalid="true"]:focus {
  outline: 2px solid var(--c-danger);
  outline-offset: 2px;
  border-color: var(--c-danger);
  box-shadow: 0 0 0 2px var(--c-danger-bg);
}

/* 2) 表格：行高更舒展。注意：带 data-ux-density 的表由 workspace-ux.css 接管密度，此处排除以免覆盖其"舒适/紧凑"切换 */
:root[data-theme] table.grid:not([data-ux-density]) th,
:root[data-theme] table.grid:not([data-ux-density]) td { padding: 10px 12px; }
/* 2b) .req-block 等嵌入式小表格保持紧凑（与 styles.css:319 的历史定义一致，不被上面的 10px 撑开） */
:root[data-theme] .req-block .grid th,
:root[data-theme] .req-block .grid td { padding: 5px 8px; }
/* 2c) 历史 dense 密度体系（styles.css:1701 起）同步收敛 */
:root[data-theme] table.grid.erp-smart-grid[data-erp-density="dense"] :is(th, td) { padding: 7px 9px; }

/* 3) 数字列等宽，纵向比对更整齐 */
:root[data-theme] table.grid :is(td, th).erp-col-number,
:root[data-theme] table.grid :is(td, th).erp-col-unit { font-variant-numeric: tabular-nums; }

/* 4) 表单区块内边距更透气（弹窗内边距交 workspace-ux.css 的 .modal>.modal-body/.modal-actions 统一管理，勿覆盖） */
:root[data-theme] .form-section { padding: 14px 18px 16px; }

/* ==========================================================================
   共享质感层 · 第三批（交互精致度）v2026-09-14
   —— 控件圆角延续统一；滚动条美化；状态点语义化；导航微交互；头像主题色。
   ========================================================================== */

/* 1) 控件圆角延续：侧栏/顶栏小控件此前硬编码 4px/6px，与 --radius-control 不一致。
      .topbar-action（styles.css:733 定义，4px）、.icon-btn、.account-trigger（6px）均为真实存在的类，一并收敛。 */
:root[data-theme] .nav-mod,
:root[data-theme] .nav-item,
:root[data-theme] .icon-btn,
:root[data-theme] .topbar-action,
:root[data-theme] .account-trigger { border-radius: var(--radius-control); }
/* 主题切换"深/浅/柔"是 28px 高的胶囊按钮（原硬编码 14px），保持胶囊语义，不收成方角 */
:root[data-theme] .theme-btn { border-radius: var(--radius-pill); }

/* 2) 滚动条美化（Chromium/WebKit 生效；Firefox 由 scrollbar-* 兜底） */
:root[data-theme] #content::-webkit-scrollbar,
:root[data-theme] #nav::-webkit-scrollbar,
:root[data-theme] .table-scroll::-webkit-scrollbar,
:root[data-theme] .modal-body::-webkit-scrollbar,
:root[data-theme] .tab-body::-webkit-scrollbar { width: 10px; height: 10px; }
:root[data-theme] #content::-webkit-scrollbar-track,
:root[data-theme] #nav::-webkit-scrollbar-track,
:root[data-theme] .table-scroll::-webkit-scrollbar-track,
:root[data-theme] .modal-body::-webkit-scrollbar-track { background: transparent; }
:root[data-theme] #content::-webkit-scrollbar-thumb,
:root[data-theme] #nav::-webkit-scrollbar-thumb,
:root[data-theme] .table-scroll::-webkit-scrollbar-thumb,
:root[data-theme] .modal-body::-webkit-scrollbar-thumb { background: var(--c-border-strong); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
:root[data-theme] #content::-webkit-scrollbar-thumb:hover,
:root[data-theme] #nav::-webkit-scrollbar-thumb:hover,
:root[data-theme] .table-scroll::-webkit-scrollbar-thumb:hover,
:root[data-theme] .modal-body::-webkit-scrollbar-thumb:hover { background: var(--c-muted); background-clip: content-box; }
:root[data-theme] #content,
:root[data-theme] .modal-body,
:root[data-theme] .tab-body { scrollbar-width: thin; scrollbar-color: var(--c-border-strong) transparent; }

/* 3) 状态点语义化（跟随主题成功色，替换硬编码绿）。与 styles.css:708 的 .status-dot, .cloud-dot 成对定义保持一致 */
:root[data-theme] .status-dot,
:root[data-theme] .cloud-dot { background: var(--c-success); box-shadow: 0 0 0 3px var(--c-success-bg); }

/* 4) 导航与图标按钮微交互：统一平滑过渡 */
:root[data-theme] .nav-mod,
:root[data-theme] .nav-item { transition: background .15s ease, color .15s ease; }
:root[data-theme] .icon-btn,
:root[data-theme] .topbar-action { transition: background .15s ease, color .15s ease; }
:root[data-theme] table.grid tbody tr td { transition: background .12s ease; }

/* 5) 头像用主题主色（柔和主题 C 保留蓝紫渐变个性） */
:root { --avatar-bg: var(--c-primary); }
:root[data-theme="C"] { --avatar-bg: linear-gradient(135deg, #2f6bff, #7e3af2); }
:root[data-theme] .user-avatar { background: var(--avatar-bg); }

/* ==========================================================================
   共享质感层 · 第四批（语义与细节 · 登录页）v2026-09-14
   ========================================================================== */

/* 1) 页面标题：文字色走主题变量（替换硬编码 #252b34），字重收敛更耐看 */
:root[data-theme] .page-title { color: var(--c-text); font-weight: 600; }

/* 2) 空状态/占位：统一走弱化文字色 + 更舒展留白 */
:root[data-theme] .blank-page { color: var(--c-muted); padding: 48px 8px; }

/* 3) 语义文字色统一走主题变量（替换硬编码，深/浅/柔自动适配） */
:root[data-theme] .text-danger { color: var(--c-danger); }
:root[data-theme] .text-success { color: var(--c-success); }
:root[data-theme] .greyed { color: var(--c-muted); }

/* 4) 登录页：登录表单卡片化（白底 + 大圆角 + 中阴影 + 内边距），提升第一印象 */
:root[data-theme] .login-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-block);
  padding: 32px 30px 26px;
  box-shadow: var(--shadow-md);
}
:root[data-theme] .login-card-head h1 { color: var(--c-text); font-weight: 600; }

/* ==========================================================================
   共享质感层 · 第五批（打印 + 窄屏外壳）v2026-09-14
   ========================================================================== */

/* 1) 打印：只保留内容，去掉应用框架与操作按钮，单据/表格转为清晰线框 */
@media print {
  #sidebar, #topbar, #crumb, #subtabs, .tab-bar, .row-actions, .pager,
  .filter-bar, #toast-root, .theme-switch,
  /* 表格工具条（workspace-ux.js 生成）：含搜索框与"显示列"下拉，不隐藏会印出空输入框 */
  .ux-table-tools, .ux-columns { display: none !important; }
  html, body, #app, .app-main, main, #content {
    display: block !important; height: auto !important; overflow: visible !important;
    background: #fff !important; color: #000 !important;
  }
  #content { padding: 0 !important; }
  /* 若当前正在查看弹窗（单据/明细），只打印弹窗本身 */
  body:has(.modal-mask) #app { display: none !important; }
  .modal-mask { position: static !important; inset: auto !important; background: none !important; display: block !important; }
  .modal { width: auto !important; max-width: none !important; box-shadow: none !important; border: 1px solid #bbb !important; }
  .modal-body { max-height: none !important; overflow: visible !important; }
  .card, .form-section, .items-block, .bom-card, .table-scroll, .tab-form-panel,
  .split-batch, .stat-card {
    box-shadow: none !important; border: 1px solid #bbb !important; border-radius: 0 !important; background: #fff !important;
  }
  .form-section-title, .page-title { color: #000 !important; }
  table.grid { font-size: 11px !important; }
  table.grid th, table.grid td { padding: 4px 6px !important; border: 1px solid #bbb !important; color: #000 !important; }
  table.grid th { background: #eee !important; color: #000 !important; }
  table.grid tbody tr:nth-child(even) td { background: #fafafa !important; }
  .pill { border: 1px solid #999 !important; background: transparent !important; color: #000 !important; }
  .btn { display: none !important; }
}

/* 打印页边距（@page 必须置于顶层，嵌套在 @media 内会被部分浏览器忽略） */
@page { margin: 12mm; }

/* 2) 窄屏外壳适配：侧栏收窄、内容留白收紧（桌面为主，小屏可用） */
@media (max-width: 960px) {
  /* 侧栏宽度由 workspace-ux.css 统一管理（<=1300px 收窄到 210px）；此处只收紧内容留白 */
  #content { padding: 18px 18px; }
}
@media (max-width: 768px) {
  #topbar { padding: 0 12px; }
  .topnav-item { height: 30px; padding: 0 10px; font-size: 12.5px; }
  #content { padding: 14px 12px; }
}

/* ============ 生产按图纸拆解（20260915）：批次分组与设备卡片 ============ */
.split-batch { border:1px solid var(--c-border); border-radius:8px; margin-bottom:10px; background:var(--c-surface-2); }
.split-batch > summary { cursor:pointer; padding:9px 12px; font-size:13.5px; user-select:none; }
.split-batch > summary:hover { background:var(--c-hover); border-radius:8px; }
.split-batch .split-batch-body { padding:4px 10px 10px; display:grid; gap:10px; }
.split-batch .production-source-item[data-blocked] { opacity:.55; }

/* ============ 项目成本（20260915 重做）：缺单价明细行标黄 ============ */
tr.price-missing > td { background: #fff4df; }
:root[data-theme="A"] tr.price-missing > td { background: #3a2f1a; color: var(--c-text); }

/* ============ 20260928 发票管理：拖拽识别区 ============ */
.inv-dropzone { border: 2px dashed var(--c-border-strong, #b8c0cc); border-radius: 10px; padding: 18px 20px; margin: 12px 0; text-align: center; background: var(--c-surface-2); transition: border-color .15s, background .15s; cursor: pointer; }
.inv-dropzone.dragging, .inv-dropzone:hover { border-color: var(--c-primary, #2f6fed); background: color-mix(in srgb, var(--c-primary, #2f6fed) 6%, var(--c-surface-2)); }
/* 采购待办：行级负责人单元格（含改派按钮） */
.pt-buyer-cell { white-space: nowrap; }
.pt-buyer-cell .pill.danger { padding: 1px 6px; font-size: 11px; }

/* ================= 成本分析 · 经营驾驶舱（深色大屏，20261007） ================= */
.cockpit{margin:-4px -8px;padding:16px 18px 26px;border-radius:12px;color:#dbe7ff;
  background:radial-gradient(1200px 600px at 70% -10%,#1d3f7a 0%,transparent 60%),
             radial-gradient(900px 500px at 10% 110%,#123a6e 0%,transparent 55%),
             linear-gradient(160deg,#081226 0%,#0b1e42 55%,#081226 100%)}
.cockpit .ck-head{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:4px 2px 12px;flex-wrap:wrap}
.cockpit .ck-head h1{margin:0;font-size:20px;letter-spacing:2px;background:linear-gradient(90deg,#7fd4ff,#eaf6ff 45%,#8fe3c8);-webkit-background-clip:text;background-clip:text;color:transparent}
.cockpit .ck-sub{font-size:12px;color:#5f7db0;margin-top:4px}
.cockpit .ck-years{display:flex;gap:6px}
.cockpit .ck-years span{padding:5px 16px;border-radius:16px;font-size:13px;color:#8fb0e8;border:1px solid #2a4a86;cursor:pointer;background:rgba(20,40,80,.35)}
.cockpit .ck-years span.on{background:linear-gradient(90deg,#1f6feb,#2fa3ff);color:#fff;border-color:#5ab6ff;box-shadow:0 0 14px rgba(47,163,255,.55)}
.cockpit .ck-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px}
.cockpit .ck-kpi{position:relative;border:1px solid #1d3a70;border-radius:12px;padding:14px 16px 12px;background:linear-gradient(180deg,rgba(23,48,94,.75),rgba(10,24,52,.85));overflow:hidden}
.cockpit .ck-kpi::after{content:"";position:absolute;inset:0 auto 0 0;width:3px;background:linear-gradient(180deg,#37c8ff,#1f6feb)}
.cockpit .ck-kpi.warn::after{background:linear-gradient(180deg,#ffd166,#ff8f3d)}
.cockpit .ck-kpi.bad::after{background:linear-gradient(180deg,#ff7b7b,#d9213e)}
.cockpit .ck-kpi.ok::after{background:linear-gradient(180deg,#4fe0a8,#1f9d6e)}
.cockpit .ck-kpi .v{font-size:23px;font-weight:700;color:#fff;font-variant-numeric:tabular-nums;text-shadow:0 0 18px rgba(80,170,255,.45)}
.cockpit .ck-kpi.warn .v{color:#ffd166}
.cockpit .ck-kpi.bad .v{color:#ff8f8f}
.cockpit .ck-kpi.ok .v{color:#4fe0a8}
.cockpit .ck-kpi.dim .v{color:#5c7cb4}
.cockpit .ck-kpi .l{font-size:12px;color:#7d9cd4;margin-top:4px}
.cockpit .ck-kpi .l .s{font-size:11px;color:#5c7cb4;margin-top:2px}
.cockpit .ck-grid2{display:grid;grid-template-columns:1.35fr 1fr;gap:12px;margin-top:12px}
@media(max-width:1100px){.cockpit .ck-grid2{grid-template-columns:1fr}}
.cockpit .ck-panel{border:1px solid #1d3a70;border-radius:12px;padding:12px 14px;background:linear-gradient(180deg,rgba(19,40,82,.6),rgba(9,20,44,.85));box-shadow:inset 0 0 24px rgba(30,80,160,.12)}
.cockpit .ck-panel h3{margin:0 0 6px;font-size:14px;color:#9fc3f8;font-weight:600}
.cockpit .ck-panel h3 em{font-style:normal;font-size:11px;color:#5c7cb4;margin-left:8px}
.cockpit .ck-chart{width:100%;height:250px}
.cockpit .ck-alerts{display:flex;flex-direction:column;gap:8px;margin-top:4px}
.cockpit .ck-al{display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:10px;font-size:13px;color:#cfe0ff}
.cockpit .ck-al .tag{font-size:11px;padding:2px 10px;border-radius:10px;white-space:nowrap}
.cockpit .ck-al .amt{margin-left:auto;font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap}
.cockpit .ck-al.red{background:linear-gradient(90deg,rgba(217,33,62,.22),rgba(217,33,62,.05));border:1px solid #7a2233}
.cockpit .ck-al.red .tag{background:#d9213e;color:#fff}
.cockpit .ck-al.red .amt{color:#ff9c9c}
.cockpit .ck-al.yel{background:linear-gradient(90deg,rgba(216,151,20,.2),rgba(216,151,20,.04));border:1px solid #7a5c1e}
.cockpit .ck-al.yel .tag{background:#d89714;color:#241a05}
.cockpit .ck-al.yel .amt{color:#ffd166}
.cockpit .ck-al.none{border:1px dashed #1d3a70;color:#5c7cb4;text-align:center}
.cockpit .ck-al a{color:#7fd4ff}
.cockpit .ck-table{width:100%;border-collapse:collapse;font-size:12.5px}
.cockpit .ck-table th{color:#6f92c9;font-weight:500;text-align:right;padding:7px 8px;border-bottom:1px solid #1d3a70;white-space:nowrap}
.cockpit .ck-table th:first-child,.cockpit .ck-table td:first-child{text-align:left}
.cockpit .ck-table td{padding:7px 8px;border-bottom:1px solid rgba(29,58,112,.45);text-align:right;font-variant-numeric:tabular-nums;color:#cfe0ff;white-space:nowrap}
.cockpit .ck-table tr:last-child td{border-bottom:none}
.cockpit .ck-table td .s{font-size:11px;color:#5c7cb4}
.cockpit .ck-table .pos{color:#4fe0a8}
.cockpit .ck-table .neg{color:#ff8f8f}
.cockpit .ck-table .dim,.cockpit .dim{color:#5c7cb4}
.cockpit .ck-table a{color:#9fd0ff;text-decoration:none}
.cockpit .ck-foot{margin-top:12px;font-size:11.5px;color:#5c7cb4;line-height:1.8}
/* 采购待办明细工作台：每行物料的负责人内联下拉改派（采购部门在职员工） */
.pt-line-buyer { width: 108px; border: 1px solid var(--c-border); border-radius: 3px; padding: 2px 4px; background: var(--c-surface); color: var(--c-text); font-size: 12.5px; }
.pt-line-buyer:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 2px rgba(35,95,140,.1); }

/* ===== 弹窗：标题栏拖动移动 + 上下左右/四角缩放 + 右上角关闭 + 内容自适应滚动 ===== */
.modal { position: relative; }
.modal.is-resizable { display: flex; flex-direction: column; }
.modal.is-resizable .modal-body { flex: 1 1 auto; min-height: 0; max-height: none; overflow: auto; }
.modal.is-resizable h3 { padding-right: 46px; cursor: move; user-select: none; }
.modal-close {
  position: absolute; top: 9px; right: 12px; z-index: 10;
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px;
  background: transparent; color: var(--c-muted, #64748b);
  font-size: 22px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: rgba(15,23,42,.08); color: var(--c-text, #0f172a); }
.modal-resize-handle { position: absolute; z-index: 6; touch-action: none; }
.modal-rh-n { top: 0; left: 12px; right: 12px; height: 6px; cursor: ns-resize; }
.modal-rh-s { bottom: 0; left: 12px; right: 12px; height: 6px; cursor: ns-resize; }
.modal-rh-e { right: 0; top: 12px; bottom: 12px; width: 6px; cursor: ew-resize; }
.modal-rh-w { left: 0; top: 12px; bottom: 12px; width: 6px; cursor: ew-resize; }
.modal-rh-ne { top: 0; right: 0; width: 16px; height: 16px; cursor: nesw-resize; }
.modal-rh-nw { top: 0; left: 0; width: 16px; height: 16px; cursor: nwse-resize; }
.modal-rh-se { bottom: 0; right: 0; width: 16px; height: 16px; cursor: nwse-resize; }
.modal-rh-sw { bottom: 0; left: 0; width: 16px; height: 16px; cursor: nesw-resize; }
.modal-rh-se::after {
  content: ''; position: absolute; right: 5px; bottom: 5px;
  width: 9px; height: 9px; pointer-events: none;
  border-right: 2px solid var(--c-border-strong, #94a3b8);
  border-bottom: 2px solid var(--c-border-strong, #94a3b8);
  border-bottom-right-radius: 3px;
}
.modal-rh-se:hover::after, .modal-rh-se:active::after { border-color: var(--c-primary, #2563eb); }
body.modal-resizing, body.modal-dragging { user-select: none !important; }
body.modal-dragging, body.modal-dragging * { cursor: move !important; }
body.modal-resizing .modal, body.modal-dragging .modal { transition: none !important; }

/* ==========================================================================
   新增入库 / 新增出库：表单铺满可用区域（20261023）
   仅调整容器尺寸与空间分配：取消 900px 宽度上限、明细区纵向撑满剩余高度。
   字段、按钮与业务逻辑均不变；用表单唯一字段做锚点，避免波及其他单据。
   ========================================================================== */
/* 1) 页签内容区改为纵向弹性容器，表单可撑满视口剩余高度 */
.tab-body:has(#o_out_type),
.tab-body:has(#a_po_row) { display: flex; flex-direction: column; }

/* 2) 表单面板：占满可用宽度，纵向跟随容器增长（内容多时照常滚动） */
.tab-form-panel:has(#o_out_type),
.tab-form-panel:has(#a_po_row) {
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* 3) 表头字段行：行内字段等分铺满（保留原有 3/4/1 的分组），窄屏自动换行 */
.tab-form-panel:has(#o_out_type) > .form-row,
.tab-form-panel:has(#a_po_row) > .form-row,
.tab-form-panel:has(#o_out_type) .form-section > .form-row,
.tab-form-panel:has(#a_po_row) .form-section > .form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 12px;
  width: 100%;
}
.tab-form-panel:has(#o_out_type) > .form-row > .field,
.tab-form-panel:has(#a_po_row) > .form-row > .field,
.tab-form-panel:has(#o_out_type) .form-section > .form-row > .field,
.tab-form-panel:has(#a_po_row) .form-section > .form-row > .field {
  flex: 1 1 150px;
  min-width: 0;
}

/* 4) 带分区标题的容器同步改为纵向流，避免四列网格留下空列 */
.tab-form-panel:has(#o_out_type) .form-section {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.tab-form-panel:has(#o_out_type) > .form-section > .field,
.tab-form-panel:has(#a_po_row) > .field { width: 100%; min-width: 0; }
.tab-form-panel:has(#o_out_type) .reference-picker,
.tab-form-panel:has(#a_po_row) .reference-picker { width: 100%; }

/* 5) 明细区：不压缩高度——明细行完整展开，整个表单随 .tab-body 上下滚动（2026-11-21 用户要求） */
.tab-form-panel:has(#o_out_type) > .items-block,
.tab-form-panel:has(#a_po_row) > .items-block {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: visible;
}
.tab-form-panel:has(#o_out_type) > .items-block > .items-head,
.tab-form-panel:has(#a_po_row) > .items-block > .items-head,
.tab-form-panel:has(#a_po_row) > .items-block > .paste-area { flex: 0 0 auto; }
.tab-form-panel:has(#o_out_type) > .items-block > .table-scroll,
.tab-form-panel:has(#a_po_row) > .items-block > .table-scroll {
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
}
/* 明细表随容器铺满：超宽屏不留白，窄屏仍按各表最小宽度横向滚动 */
.tab-form-panel:has(#o_out_type) table.item-grid,
.tab-form-panel:has(#a_po_row) table.item-grid { width: 100%; }

/* 6) 底部操作条与面板同宽，按钮靠右对齐 */
.tab-form-panel:has(#o_out_type) > .tab-form-footer .tab-form-footer-inner,
.tab-form-panel:has(#a_po_row) > .tab-form-footer .tab-form-footer-inner { width: 100%; max-width: none; }

/* 项目外协跟进：进度记录里的照片缩略图 */
.of-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; border: 1px solid var(--c-border); margin: 2px; cursor: pointer; }

/* ===== 移动端适配：项目看板只读视图 ===== */
@media (max-width: 768px) {
  /* 侧栏折叠，主区全宽 */
  #sidebar { display: none; }
  .app-main { width: 100%; }
  #topbar { height: 48px; min-height: 48px; padding: 0 12px; }
  #topnav { overflow-x: auto; }
  #content { padding: 12px 12px 20px; }

  /* 统计卡片：手机 2 列 */
  .stat-row { gap: 10px; }
  .stat-card { flex: 1 1 calc(50% - 5px); padding: 12px 14px; }

  /* 筛选栏纵向堆叠 */
  .filter-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .filter-bar > input, .filter-bar > select { width: 100%; }
  .filter-bar > .btn { align-self: flex-start; }

  /* 阶段条跑马灯：横向滚动，保留节点名称 */
  .lifecycle-track { display: flex; flex-wrap: nowrap; overflow-x: auto; }
  .lifecycle-node { flex: 0 0 auto; min-width: 78px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 8px 6px; border-right: 1px solid var(--c-border); border-bottom: 0; }
  .lifecycle-node:last-child { border-right: 0; }
  .lifecycle-node b { font-size: 11px; white-space: nowrap; }
  .lifecycle-node small { font-size: 10px; }
  .lifecycle-dot { width: 26px; height: 26px; }

  /* 卡片头部竖排 */
  .lifecycle-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .lifecycle-head > div:last-child { width: 100%; display: flex; align-items: center; justify-content: space-between; }

  /* 只读：隐藏写操作按钮（归档），保留查看/同步 */
  #pk_archive_done, [data-pk-archive] { display: none !important; }
}

/* ---------- 登录页素材包最终修正（追加末尾，覆盖全局 focus/换行规则） ---------- */
/* 账号框 autofocus 会触发全局 input:focus-visible 蓝框，登录页去掉 */
.login-card .field-input input:focus,
.login-card .field-input input:focus-visible { outline: none !important; box-shadow: none !important; }
/* 主标题按素材包保持一行 */
.login-slogan { white-space: nowrap; font-size: clamp(26px, 3.1vw, 56px) !important; }

/* 素材包修正补充：副标题一行 + 窄屏卡片不溢出 */
.login-sub { white-space: nowrap; font-size: clamp(11px, 1vw, 18px) !important; }
@media (max-width: 991px) {
  .login-main { grid-template-columns: minmax(0, 1fr); padding: 24px 14px; }
  .login-card { width: 100%; max-width: 460px; min-width: 0; box-sizing: border-box; }
  .login-card .field-input input { min-width: 0; }
}

/* ---------- 按桌面设计稿精确调整字体位置与大小（2026-11-21） ----------
   设计稿：左区 1818x1600 / 右区 1030x1600；用 vh 等比缩放保证各分辨率一致 */
/* 左区：绝对定位还原设计稿元素位置 */
.login-aside-inner { display: block !important; position: relative; height: 100%; }
.login-logo { position: absolute !important; top: 0; left: 0; }
.login-logo img { width: clamp(150px, 12vh, 250px) !important; }
.login-aside-text { position: absolute !important; top: 31vh; left: 0; right: 0; margin: 0 !important; }
.login-slogan { font-size: clamp(34px, 6.4vh, 76px) !important; line-height: 1.16 !important; margin: 0 0 2.2vh !important; white-space: nowrap !important; }
.login-sub { font-size: clamp(15px, 2.6vh, 30px) !important; white-space: nowrap !important; }
.login-aside-foot { position: absolute !important; bottom: 2.6vh; left: 5.2% !important; font-size: clamp(13px, 1.9vh, 22px) !important; }

/* 右区：按设计稿比例放大字体 */
.login-card { padding: 4.6vh 46px 3.6vh !important; }
.login-card-head h1 { font-size: clamp(27px, 3.5vh, 42px) !important; margin-bottom: 1vh !important; }
.login-card-head p { font-size: clamp(14px, 1.95vh, 23px) !important; margin-bottom: 4.2vh !important; }
/* 输入框高度上限：避免高分辨率下 7.2vh 把账号/密码框拉得过高（1080p 约 78px），
   收窄到常规 52–64px，同时保留小屏自适应 */
.login-card .field-input input { height: clamp(52px, 5.6vh, 64px) !important; font-size: clamp(15px, 1.95vh, 21px) !important; }
.password-toggle, .login-logout-tip { font-size: clamp(13px, 1.8vh, 21px) !important; }
.login-links { font-size: clamp(13px, 1.95vh, 22px) !important; margin-top: 3vh !important; }
/* 按钮随输入框同比收窄，保持“按钮略低于输入框”的原有视觉层级 */
.login-submit { height: clamp(48px, 5.2vh, 58px) !important; font-size: clamp(16px, 2vh, 22px) !important; }

/* ---------- 物料截图粘贴区（2026-11-24：请购行附图由「上传」改为「截图粘贴」） ---------- */
.rq-img-paste { display: flex; align-items: center; justify-content: center; min-height: 84px; margin: 8px 0 6px; padding: 14px; border: 2px dashed var(--c-border-strong); border-radius: 8px; color: var(--c-muted); background: var(--c-surface-2); cursor: pointer; text-align: center; font-size: 13px; outline: none; transition: border-color .15s, color .15s, background .15s; }
.rq-img-paste:hover, .rq-img-paste:focus { border-color: #2563eb; color: #2563eb; background: rgba(37, 99, 235, .06); }

/* ---------- 一键框选截图（2026-11-24：getDisplayMedia 全屏遮罩框选） ---------- */
.rq-img-capture { display: block; width: 100%; margin: 8px 0 6px; padding: 12px; font-size: 14px; }
.shot-overlay { position: fixed; inset: 0; z-index: 100000; background: #000; cursor: crosshair; user-select: none; }
.shot-overlay .shot-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.shot-overlay .shot-tip { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); padding: 8px 16px; border-radius: 6px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 13px; pointer-events: none; white-space: nowrap; }
.shot-overlay .shot-rect { position: absolute; display: none; border: 2px solid #22c55e; background: rgba(34, 197, 94, .12); box-shadow: 0 0 0 1px rgba(255, 255, 255, .6); pointer-events: none; }


/* ---------- 请购单明细：规格型号 / 备注 改为多行自适应（2026-11-30） ----------
   原来这三列是单行 <input>，长规格/长备注只能在框内横向滚动，看不到全文；
   改为 <textarea>，按列宽自动换行、高度随内容增长（JS 侧 autoGrowCell 兜底 field-sizing 不支持的浏览器）。
   列宽仍交给全局 erp-smart-grid 体系（auto 布局），只把「规格型号」列适度放宽，保证长规格不至于被挤成竖排。 */
.rq-item-grid td { vertical-align: top; }
table.grid.erp-smart-grid.rq-item-grid :is(th,td).erp-col-text:nth-child(4) { width: 220px; min-width: 180px; max-width: 300px; }
.rq-item-grid textarea.cell-wrap {
  display: block; width: 100%; min-width: 0; box-sizing: border-box; margin: 0;
  resize: none; overflow: hidden; field-sizing: content;
  white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word;
  line-height: 1.4; min-height: 30px; padding: 4px 7px;
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
  font-family: inherit; font-size: 12.5px; color: inherit;
}
.rq-item-grid textarea.cell-wrap:hover { background: var(--c-hover); }
.rq-item-grid textarea.cell-wrap:focus { outline: 2px solid var(--c-primary); outline-offset: -2px; background: var(--c-surface); }
.rq-item-grid tr.rq-purchased-row textarea.cell-wrap { color: #555f6d; background: transparent; }
.rq-item-grid tr.rq-cancelled-row textarea.cell-wrap { color: #8b5a61; text-decoration: line-through; background: transparent; }
.rq-item-grid textarea.cell-wrap:disabled, .rq-item-grid textarea.cell-wrap:read-only { background: transparent; color: #555f6d; -webkit-text-fill-color: #555f6d; opacity: 1; cursor: default; }
.rq-item-grid tr.rq-cancelled-row textarea.cell-wrap { color: #8b5a61; -webkit-text-fill-color: #8b5a61; }

/* ---------- 请购单物料明细：单元格不隐藏、超宽自动换行 + 数字列居中 + 列宽微调（2026-12-01） ----------
   1) 所有单元不再省略/裁切：取消 nowrap 与 line-clamp，内容按列宽自动换行（文本列已由 textarea 承担，
      这里同时兜住表头、状态列与将来可能出现的静态文本 span）。
   2) 单台量 / 总量 / 单位 三列内容居中（输入控件自身的 text-align 不继承，需显式声明）。
   3) 物料名称（erp-col-wide）收窄 3 个字、材质品牌（erp-col-material）放宽 3 个字；
      字号 12.5px，1 个汉字 ≈ 12.5px，3 字 ≈ 37.5px。列宽仍走 erp-smart-grid 的 auto 布局，
      只调整这三类列的 width/min/max，不使用 <colgroup> 或 fixed 布局。 */
.rq-item-grid :is(th,td) { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.rq-item-grid :is(th,td) .erp-cell-text { display: block; overflow: visible; white-space: normal; -webkit-line-clamp: unset; text-overflow: clip; }
.rq-item-grid td input.i_uq,
.rq-item-grid td input.i_tq { text-align: center; }
.rq-item-grid td textarea.i_unit.cell-wrap { text-align: center; padding-left: 4px; padding-right: 4px; }
table.grid.erp-smart-grid.rq-item-grid :is(th,td).erp-col-wide { width: 152px; min-width: 112px; max-width: 202px; }
table.grid.erp-smart-grid.rq-item-grid :is(th,td).erp-col-material { width: 134px; min-width: 114px; max-width: 156px; }
table.grid.erp-smart-grid.rq-item-grid[data-erp-density="dense"] :is(th,td).erp-col-material { width: 122px; min-width: 106px; max-width: 138px; }
/* 序号列（可编辑数字框）居中：与其他数字列对齐，input 固定 44px 宽需 margin 自动居中 */
.rq-item-grid td input.i_seq { display: block; margin: 0 auto; text-align: center; }
