/**
 * 佳誉 ERP 2.0 — 产品开发 / 版单录入（version_form、BOM 矩阵、Sheet 补丁）
 * 仅含 `.version-form-page` 等版单域选择器；通用表格见 ui_tables.css。
 */
/* BOM 分色矩阵：滚动区与顶栏 sticky，避免遮挡与点击穿透 */
.bom-matrix-wrapper {
    position: relative !important;
    z-index: 100 !important;
    margin-bottom: 100px !important;
}
.bom-matrix-scroll {
    overflow: auto !important;
    max-height: 70vh !important;
}
.bom-toolbar-top {
    position: sticky !important;
    top: 0 !important;
    z-index: 101 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 15px !important;
    padding: 10px !important;
    margin-bottom: 10px !important;
    background: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    border-bottom: 2px solid #e2e8f0 !important;
}
.bom-toolbar-top .btn-success {
    margin-left: auto !important;
}
.bom-toolbar-top button {
    position: relative !important;
    z-index: 10000 !important;
    pointer-events: auto !important;
}
.bom-toolbar-top button.btn-outline-primary {
    background-color: #007bff !important;
    color: #fff !important;
    font-weight: bold !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* ==================== 版单录入（dev/version_form）最终物理标准（单源、禁止与模板重复打架） ==================== */
.tab-inner-content > .container-fluid.version-form-page {
    margin-top: 0;
}

/* 工具栏（版单录入标题行）：强制普通文档流，禁止 fixed/sticky 盖住下方字段（叠罗汉） */
.version-form-page .version-header-bar {
    position: static !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    z-index: auto !important;
    transform: none !important;
}
/* 基础信息区：与标题行物理隔离；版单头为纵向 flex + 每排横向 flex（见 .vf-base-info-grid） */
.version-form-page .info-header-card {
    overflow-x: auto !important;
    overflow-y: visible !important;
    margin-top: 20px !important;
    -webkit-overflow-scrolling: touch;
}
/* 版单头：4 列 × 3 行 Grid（与 version_form 内联样式一致）；前两行各 4 字段，第三行款式图占第 4 列 */
.version-form-page .info-header-card .vf-base-info-grid--4col {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 12px;
    row-gap: 10px;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    align-items: center;
    justify-items: stretch;
    justify-content: start;
}
.version-form-page .info-header-card .vf-base-info-grid--4col > .vf-pair {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px;
    min-height: 30px;
    min-width: 0 !important;
    width: 100%;
    box-sizing: border-box;
}
.version-form-page .info-header-card .vf-base-info-grid--4col > .vf-pair--cover-anchor {
    grid-column: 4;
    width: 100%;
    max-width: 100%;
}
/* 非工作台：款式图格靠左贴内容；工作台表格式由 workbench_hub.css 拉满列宽 */
.version-form-page:not(.wb-header-as-table) .info-header-card .vf-base-info-grid--4col > .vf-pair--cover-anchor {
    justify-self: start;
}
/* 款式图：标签与控件行左对齐（仅非工作台；工作台与其它字段同为右对齐标签） */
.version-form-page:not(.wb-header-as-table) .info-header-card .vf-base-info-grid--4col > .vf-pair--cover-anchor > .vf-label {
    text-align: left !important;
}
/* 竖向堆叠仅用于非工作台表格式；工作台 .wb-header-as-table 由 workbench_hub.css 横排 */
.version-form-page:not(.wb-header-as-table) .info-header-card .vf-base-info-grid--4col > .vf-pair--cover-anchor > .vf-slot {
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
}
.version-form-page .info-header-card .vf-base-info-grid--4col > .vf-pair > .vf-label {
    display: block !important;
    box-sizing: border-box !important;
    flex: 0 0 6em !important;
    width: 6em !important;
    min-width: 6em !important;
    max-width: 6em !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap;
    text-align: right !important;
    align-self: center !important;
}
.version-form-page .info-header-card .vf-base-info-grid--4col > .vf-pair > .vf-slot {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    min-height: 30px;
}
.version-form-page .info-header-card .vf-base-info-grid--4col .vf-control:not(#sheet_code_display):not(#style_name),
.version-form-page .info-header-card .vf-base-info-grid--4col .vf-version-readonly {
    width: 90px !important;
    min-width: 72px !important;
    max-width: 100%;
    flex: 0 0 auto;
}
.version-form-page .info-header-card .vf-base-info-grid--4col #sheet_code_display.vf-control,
.version-form-page .info-header-card .vf-base-info-grid--4col #style_name.vf-control {
    width: 180px !important;
    min-width: 160px !important;
}
.version-form-page:not(.wb-header-as-table) .info-header-card .vf-base-info-grid--4col .vf-cover-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    max-width: min(100%, 420px);
    box-sizing: border-box;
}
.version-form-page:not(.wb-header-as-table) .info-header-card .vf-base-info-grid--4col .vf-cover-path {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 100px !important;
    max-width: 240px !important;
    height: 32px;
    box-sizing: border-box;
}
/* 浏览：横向按钮（勿用 30px 窄宽，否则易竖排字） */
.version-form-page:not(.wb-header-as-table) .info-header-card .vf-base-info-grid--4col .vf-cover-browse {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 52px !important;
    height: 32px;
    padding: 4px 12px;
    white-space: nowrap;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    box-sizing: border-box;
    line-height: 1.2;
    font-size: 14px;
    font-weight: 500;
}

/* 款式图：卡片缩略图 + 浏览（竖向卡片区仅非工作台表格式；工作台横排见 workbench_hub.css） */
.version-form-page:not(.wb-header-as-table) .info-header-card .vf-cover-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    position: relative;
}
.version-form-page:not(.wb-header-as-table) .info-header-card .vf-cover-cardlist {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.version-form-page:not(.wb-header-as-table) .info-header-card .vf-cover-card {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fafafa;
    cursor: pointer;
    overflow: hidden;
    box-sizing: border-box;
}
.version-form-page:not(.wb-header-as-table) .info-header-card .vf-cover-card:disabled {
    cursor: default;
    opacity: 0.88;
}
.version-form-page:not(.wb-header-as-table) .info-header-card .vf-cover-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.version-form-page:not(.wb-header-as-table) .info-header-card .vf-cover-card-empty {
    font-size: 13px;
    color: #9ca3af;
    user-select: none;
}
.version-form-page .vf-cover-src-holder {
    display: none !important;
}

/*
 * 版单「基础信息」条（仅模块轻量壳 module_lite_wrapper）：
 * 与 erp-card / 13px 表单对齐；工作台走 wb-hub-header-form.wb-header-as-table 表格式，勿在此用 gap 覆盖表格线。
 */
.module-lite-page .jiayu-style-header-card .info-header-card {
    margin-top: 0 !important;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}
.module-lite-page .jiayu-style-header-card .info-header-card .vf-base-info-grid--4col {
    column-gap: 14px !important;
    row-gap: 12px !important;
}
.module-lite-page .jiayu-style-header-card .info-header-card .vf-base-info-grid--4col > .vf-pair > .vf-label {
    flex: 0 0 5.5em !important;
    width: 5.5em !important;
    min-width: 5.5em !important;
    max-width: 5.5em !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #374151 !important;
}
.module-lite-page .jiayu-style-header-card .info-header-card .vf-base-info-grid--4col .vf-control:not(#sheet_code_display):not(#style_name),
.module-lite-page .jiayu-style-header-card .info-header-card .vf-base-info-grid--4col .vf-version-readonly {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    font-size: 13px !important;
    height: 32px;
    min-height: 32px;
    box-sizing: border-box;
}
.module-lite-page .jiayu-style-header-card .info-header-card .vf-base-info-grid--4col #sheet_code_display.vf-control,
.module-lite-page .jiayu-style-header-card .info-header-card .vf-base-info-grid--4col #style_name.vf-control {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    font-size: 13px !important;
    min-height: 32px;
    box-sizing: border-box;
}
.module-lite-page .jiayu-style-header-card .info-header-card .vf-base-info-grid--4col .vf-cover-row {
    max-width: 100% !important;
}
.module-lite-page .jiayu-style-header-card .info-header-card .vf-base-info-grid--4col .vf-cover-path {
    max-width: none !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    font-size: 13px;
}
.module-lite-page .jiayu-style-header-card .info-header-card .vf-base-info-grid--4col .vf-cover-browse {
    font-size: 13px;
}
.module-lite-page .jiayu-style-header-card .module-lite-header-strip__body {
    min-width: 0;
}
.module-lite-page .jiayu-style-header-card .erp-card-header.module-lite-header-strip__head {
    flex-wrap: wrap;
    gap: 4px 12px;
}
.module-lite-page .jiayu-style-header-card .module-lite-header-strip__head-hint {
    text-align: right;
    max-width: min(100%, 380px);
    line-height: 1.35;
}
.module-lite-page .jiayu-style-header-card .module-lite-header-strip__actions {
    margin-top: 12px;
}
.module-lite-page .jiayu-style-header-card .module-lite-header-strip__readonly {
    font-size: 13px;
    line-height: 1.55;
}
.module-lite-page .jiayu-style-header-card .module-lite-header-strip__readonly strong {
    font-size: 13px;
    color: #111827;
}

/*
 * 模块轻量页（BOM/单耗等长表）：操作条 sticky，避免滚入表格后无法回到「返回 / 编辑 / 保存」。
 * 滚动容器为 base_layout 的 .tab-panel（overflow:auto），sticky 相对该容器生效。
 */
.module-lite-page.jiayu-module-sheet-gate > .module-lite-head {
    position: sticky;
    top: 0;
    z-index: 45;
    background: #f4f7f6;
    box-shadow: 0 1px 0 #e5e7eb;
}
/* BOM：标题 + 视图/筛选 +「增加物料」整块 sticky，滚长表时操作始终可见 */
.module-lite-page #pane-s5 .bom-sticky-chrome {
    position: sticky;
    top: 3.25rem;
    z-index: 40;
    background: #fff;
    padding-top: 6px;
    padding-bottom: 6px;
    margin-bottom: 6px;
    box-shadow: 0 1px 0 #f3f4f6;
}
.module-lite-page #pane-s5 .bom-sheet-toolbar {
    margin-bottom: 0;
}
/* BOM 横滚仅发生在表格壳层，勿在整块 #sheetPanes 再套一层纵向滚动 */
.module-lite-page .bom-split-table-root {
    overflow: visible;
}
.module-lite-page .bom-split-x-scroll {
    overflow-x: auto;
    overflow-y: visible;
    max-height: none;
}
.module-lite-page .bom-bom-list-shell {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}
/* 物料行数较多时启用虚拟滚动：纵向滚轮在表壳内，仅渲染可见行 */
:is(.module-lite-page, .version-form-page) .bom-bom-list-shell.bom-bom-list-shell--virtual {
    overflow-y: auto;
    max-height: min(72vh, calc(100vh - 200px));
    -webkit-overflow-scrolling: touch;
}
:is(.module-lite-page, .version-form-page) .bom-virtual-spacer td {
    padding: 0;
    border: 0;
    background: transparent;
}
:is(.module-lite-page, .version-form-page) .bom-virtual-hint {
    font-size: 12px;
    color: #6b7280;
    margin: 0 0 6px;
    text-align: right;
}

/* 工作台基础信息：卡片标题区与模块条一致（表格式网格由 workbench_hub.css 负责） */
.workbench-hub-page .jiayu-style-header-card .erp-card-header.module-lite-header-strip__head {
    flex-wrap: wrap;
    gap: 4px 12px;
}
.workbench-hub-page .jiayu-style-header-card .module-lite-header-strip__head-hint {
    text-align: right;
    max-width: min(100%, 380px);
    line-height: 1.35;
}
.workbench-hub-page .jiayu-style-header-card .module-lite-header-strip__body {
    min-width: 0;
}

/* Sheet8 工艺说明 / Sheet9 二次工艺：多条文本记录展示区 + 标题栏右侧「新增」 */
.version-form-page .sheet-section-header--split {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.version-form-page .sheet-section-header--split .btn {
    min-width: 80px;
    height: 30px;
    padding: 2px 10px;
    font-size: 14px;
    box-sizing: border-box;
}
/* Sheet1 颜色维护：新增行按钮统一右置 */
.version-form-page #pane-s1 .sheet-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.version-form-page #pane-s1 #btn-add-color {
    margin-left: auto;
}
/* 兼容历史 id */
.version-form-page #pane-s1 #btn-add-color-row {
    margin-left: auto;
}
/* Sheet4 单耗核算：新增行按钮统一右置（完整版单/轻量模块共用） */
.version-form-page #pane-s4 .consumption-sheet-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.version-form-page #pane-s4 #btn-add-consumption {
    margin-left: auto;
}

/* Sheet4 单耗表：损耗% 仅少量数字，收窄；单耗 / 实际单耗 显示 4 位小数，适当加宽（整页 + 模块轻量壳） */
#pane-s4 table.table-cons-sheet {
    table-layout: fixed;
    width: 100%;
}
#pane-s4 table.table-cons-sheet th.cons-col-match-mode,
#pane-s4 table.table-cons-sheet td.cons-col-match-mode {
    width: 7.5rem;
    min-width: 6.5rem;
}
#pane-s4 table.table-cons-sheet th.cons-col-scope-colors,
#pane-s4 table.table-cons-sheet td.cons-col-scope-colors {
    min-width: 10rem;
}
#pane-s4 table.table-cons-sheet .cons-scope-pick-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    max-height: 4.5rem;
    overflow-y: auto;
}
#pane-s4 table.table-cons-sheet .cons-scope-ro {
    font-size: 12px;
    color: #6b7280;
}
#pane-s4 .consumption-sheet-hint {
    margin-top: 0.25rem;
}
#pane-s4 table.table-cons-sheet th.cons-col-loss,
#pane-s4 table.table-cons-sheet td.cons-col-loss {
    width: 3.75rem;
    max-width: 4.25rem;
    box-sizing: border-box;
    white-space: nowrap;
}
#pane-s4 table.table-cons-sheet .cons-loss {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}
#pane-s4 table.table-cons-sheet th.cons-col-net,
#pane-s4 table.table-cons-sheet td.cons-net {
    width: 7.5rem;
    min-width: 6.5rem;
    box-sizing: border-box;
    text-align: center;
}
#pane-s4 table.table-cons-sheet th.cons-col-total,
#pane-s4 table.table-cons-sheet td.cons-total {
    width: 8.5rem;
    min-width: 7.25rem;
    box-sizing: border-box;
    text-align: center;
}
#pane-s4 table.table-cons-sheet th.cons-col-oper,
#pane-s4 table.table-cons-sheet td.cons-col-oper {
    text-align: center;
    vertical-align: middle;
}
#pane-s4 table.table-cons-sheet tfoot .cons-net,
#pane-s4 table.table-cons-sheet tfoot .cons-total {
    text-align: center;
}

/* Sheet2 尺码表：工具条在左，新增部位行在同一行最右 */
.version-form-page #pane-s2 .sheet-section-header-s2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.version-form-page #pane-s2 .sheet-section-header-s2 #size-action-bar,
.version-form-page #pane-s2 .sheet-section-header-s2 #size-list-toolbar,
.version-form-page #pane-s2 .sheet-section-header-s2 #size-detail-toolbar {
    flex: 1 1 auto;
    min-width: 0;
}
.version-form-page #pane-s2 #btn-add-size-row {
    margin-left: auto;
    flex: 0 0 auto;
}
/* Sheet6 工价表：新增工序按钮统一右置 */
.version-form-page #pane-s6 .sheet-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.version-form-page #pane-s6 #btn-add-process {
    margin-left: auto;
}
/* Sheet5 BOM：标题左、视图/筛选/增加物料同一粘性条（浏览态 inert 不覆盖视图筛选） */
.version-form-page #pane-s5 .bom-sheet-toolbar {
    display: flex;
    align-items: center;
    gap: 10px 12px;
}
.version-form-page #pane-s5 .bom-toolbar-nav-cluster {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    margin-left: auto;
}
.version-form-page #pane-s5 .bom-toolbar-title-block {
    flex: 1 1 200px;
    min-width: 0;
}
.version-form-page #pane-s5 .bom-sticky-chrome {
    position: sticky;
    top: 0;
    z-index: 40;
    background: #fff;
    padding-top: 6px;
    padding-bottom: 6px;
    margin-bottom: 8px;
    box-shadow: 0 1px 0 #f3f4f6;
}
.version-form-page .text-entries-display {
    margin-top: 8px;
    min-height: 24px;
}
.version-form-page .text-entry-card {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: #fafafa;
    box-sizing: border-box;
}
.version-form-page .text-entry-card-meta {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
}
.version-form-page .text-entry-card-body {
    font-size: 14px;
    color: #111827;
    white-space: pre-wrap;
    word-break: break-word;
}
.version-form-page .text-entry-empty {
    font-size: 14px;
    color: #9ca3af;
    padding: 8px 0;
}
.version-form-page .s8-composer,
.version-form-page .s11-composer {
    margin-top: 10px;
}

/* Sheet11 版单排期：4 列表格线；第一行 4 格、第二行 3 格内容 + 1 空格左对齐 */
.version-form-page #pane-s11 .schedule-table-wrap {
    margin-top: 8px;
    width: 100%;
    overflow-x: auto;
}
.version-form-page #pane-s11 .schedule-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin-bottom: 0;
}
.version-form-page #pane-s11 .schedule-table th,
.version-form-page #pane-s11 .schedule-table td {
    text-align: left;
    vertical-align: top;
}
.version-form-page #pane-s11 .schedule-cell {
    padding: 10px 12px;
    min-width: 0;
}
.version-form-page #pane-s11 .schedule-cell--empty {
    background: #fafafa;
}
.version-form-page #pane-s11 .schedule-field-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 6px 0;
}
.version-form-page #pane-s11 .schedule-readonly-box {
    height: 30px;
    line-height: 30px;
    padding: 0 8px;
    font-size: 14px;
    box-sizing: border-box;
    background: #f3f4f6;
    border: 1px solid #ced4da;
    border-radius: 4px;
    color: #111827;
    max-width: 180px;
}
.version-form-page #pane-s11 .schedule-date-input {
    width: 180px !important;
    max-width: 100%;
}
.version-form-page #pane-s11 .schedule-countdown-row {
    margin-top: 10px;
}
.version-form-page #pane-s11 .schedule-countdown-text {
    font-size: 14px;
    color: #2563eb;
}

/* Sheet10 附件管理：先命名再上传；表格列 名称 / 文件 / 操作 */
.version-form-page #pane-s10 .attachment-toolbar {
    margin-bottom: 10px;
}
.version-form-page #pane-s10 .attachment-toolbar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    row-gap: 8px;
}
.version-form-page #pane-s10 .attachment-toolbar-inner .attachment-label {
    flex: 0 0 auto;
    margin: 0;
}
.version-form-page #pane-s10 .attachment-name-input {
    width: 220px;
    max-width: 100%;
    min-width: 0;
}
.version-form-page #pane-s10 .attachment-filename-hint {
    font-size: 13px;
    color: #6b7280;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.version-form-page #pane-s10 .attachment-toolbar-hint {
    margin-top: 6px;
    margin-bottom: 0;
}
.version-form-page #pane-s10 .attachment-table {
    width: 100%;
    margin-top: 4px;
}
.version-form-page #pane-s10 .attachment-col-actions {
    width: 200px;
    white-space: nowrap;
}
.version-form-page #pane-s10 .attachment-actions-cell .btn {
    width: 80px;
    height: 30px;
    padding: 2px 6px;
    font-size: 12px;
    box-sizing: border-box;
}
.version-form-page #pane-s10 .attachment-pick-btn,
.version-form-page #pane-s10 .attachment-upload-btn {
    height: 30px;
    padding: 2px 10px;
    font-size: 14px;
    box-sizing: border-box;
}

/* Sheet9 二次工艺：标题用 .sheet-section-header 与其它 Sheet 一致；文本域固定尺寸且禁止拖拽改大小；右侧提交（iframe 内不依赖 Bootstrap 工具类） */
.version-form-page #pane-s9 .secondary-process-editor {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 12px;
    margin-top: 8px;
}
.version-form-page #pane-s9 .secondary-process-textarea {
    width: 560px;
    max-width: 100%;
    min-width: 0;
    height: 120px;
    min-height: 120px;
    resize: none !important;
    box-sizing: border-box !important;
    font-size: 14px !important;
    line-height: 1.4;
    margin: 0 !important;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 6px 8px;
}
.version-form-page #pane-s9 .secondary-process-submit-btn {
    flex-shrink: 0;
    width: 80px;
    height: 30px;
    padding: 0 !important;
    line-height: 28px !important;
    font-size: 14px !important;
    box-sizing: border-box;
}

/* Sheet8 工艺说明：与 Sheet9 二次工艺同一套（标题区 + 固定文本域 + 右侧提交） */
.version-form-page #pane-s8 .process-desc-editor {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 12px;
    margin-top: 8px;
}
.version-form-page #pane-s8 .process-desc-textarea {
    width: 560px;
    max-width: 100%;
    min-width: 0;
    height: 120px;
    min-height: 120px;
    resize: none !important;
    box-sizing: border-box !important;
    font-size: 14px !important;
    line-height: 1.4;
    margin: 0 !important;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 6px 8px;
}
.version-form-page #pane-s8 .process-desc-submit-btn {
    flex-shrink: 0;
    width: 80px;
    height: 30px;
    padding: 0 !important;
    line-height: 28px !important;
    font-size: 14px !important;
    box-sizing: border-box;
}

/* Sheet13 SKU预览：颜色/尺码列内容居中；表宽随列定宽不拉满屏；内部 SKU 列有上限，右侧留白 */
.version-form-page #pane-s13 .sku-preview-table {
    width: auto !important;
    max-width: 100%;
    table-layout: fixed;
}
.version-form-page #pane-s13 .sku-preview-table th:nth-child(1),
.version-form-page #pane-s13 .sku-preview-table td:nth-child(1),
.version-form-page #pane-s13 .sku-preview-table th:nth-child(2),
.version-form-page #pane-s13 .sku-preview-table td:nth-child(2) {
    text-align: center !important;
    vertical-align: middle !important;
    width: 10em;
}
.version-form-page #pane-s13 .sku-preview-table th:nth-child(3),
.version-form-page #pane-s13 .sku-preview-table td:nth-child(3) {
    width: 14em;
    max-width: 240px;
    text-align: center;
    vertical-align: middle;
    word-break: break-all;
}
/* 不在 .version-form-page 上强制 overflow-*：由 .tab-panel 负责滚动，避免与内部表格/下拉叠层冲突 */

/* 1) 顶区：与全局顶栏对齐；不缩小系统标签栏高度（恢复默认 40px，避免「修了版单、别的标签难点的」） */
.main-content:has(.version-form-page) {
    padding-top: 64px;
}
.main-content:has(.version-form-page) .tabs-bar {
    margin: 0;
    padding: 0 5px;
}
.main-content:has(.version-form-page) .tab-inner-content {
    margin: 0;
    padding: 0 5px 8px;
}
.main-content:has(.version-form-page) .content-header,
.main-content:has(.version-form-page) .breadcrumb {
    margin: 0 !important;
    padding: 0 5px !important;
}

.version-form-page,
.version-form-page label,
.version-form-page th,
.version-form-page td {
    font-size: 14px !important;
}
.version-form-page .sheet-tabs-bar .tab {
    font-size: 14px !important;
}

/* Sheet1 颜色表：table-layout auto + 列最小宽度；窄屏在 .sheet-color-sheet-scroll-wrap 内横向滚动 */
.version-form-page .sheet-color-sheet-scroll-wrap {
    overflow-x: auto;
    overflow-y: visible;
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}
.version-form-page .table-color-sheet {
    table-layout: auto;
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
}
.version-form-page .table-color-sheet th,
.version-form-page .table-color-sheet td {
    text-align: center !important;
    vertical-align: middle !important;
}
.version-form-page .table-color-sheet thead th {
    font-size: 14px;
    font-weight: 600;
    padding: 6px 8px;
    line-height: 1.2;
}
.version-form-page .table-color-sheet tbody td {
    padding: 6px 8px;
    font-size: 14px;
}
/* Sheet1：打色供应商行与列头、数据同表，显式网格线（与版单工作台表格式头同色阶） */
.version-form-page .table-color-sheet.table-color-sheet--wired {
    border: 1px solid #d1d5db;
}
.version-form-page .table-color-sheet.table-color-sheet--wired > thead > tr > th,
.version-form-page .table-color-sheet.table-color-sheet--wired > tbody > tr > td {
    border-color: #e5e7eb !important;
}
.version-form-page .table-color-sheet.table-color-sheet--wired .color-sheet-supplier-meta-th,
.version-form-page .table-color-sheet.table-color-sheet--wired .color-sheet-supplier-actions-th {
    background: #fff;
    vertical-align: middle;
    font-weight: 400;
}
.version-form-page .table-color-sheet.table-color-sheet--wired .color-sheet-supplier-inner {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.version-form-page .table-color-sheet.table-color-sheet--wired .color-sheet-supplier-actions-th {
    white-space: nowrap;
    width: 1%;
}
.version-form-page .table-color-sheet.table-color-sheet--wired thead .color-sheet-supplier-meta-tr + tr > th {
    background: #f9fafb;
}
.version-form-page #pane-s1 .color-sheet-dye-select {
    max-width: min(320px, 48vw);
    flex: 1 1 auto;
    min-width: 140px;
}
.version-form-page .table-color-sheet .td-color-name,
.version-form-page .table-color-sheet .th-col-name {
    min-width: 150px;
    width: auto;
    box-sizing: border-box;
}
.version-form-page .table-color-sheet .td-color-code,
.version-form-page .table-color-sheet .th-col-code {
    min-width: 150px;
    width: auto;
    box-sizing: border-box;
}
.version-form-page .table-color-sheet .color-sheet-hex-cell,
.version-form-page .table-color-sheet .th-col-hex,
.version-form-page .table-color-sheet .color-sheet-archive-cell,
.version-form-page .table-color-sheet .th-col-archive {
    min-width: 220px;
    width: auto;
    box-sizing: border-box;
}
.version-form-page .table-color-sheet .color-sheet-archive-cell {
    padding: 4px 8px !important;
    vertical-align: middle !important;
}
.version-form-page .table-color-sheet .color-sheet-archive-cell .pantone-code {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 30px !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
}
.version-form-page .table-color-sheet .color-sheet-hex-cell {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px 8px !important;
    white-space: nowrap;
}
.version-form-page .table-color-sheet .td-color-actions,
.version-form-page .table-color-sheet .th-color-actions {
    width: 1%;
    min-width: 52px;
    max-width: 64px;
    white-space: nowrap;
    box-sizing: border-box;
}

/* 名称/色号：铺满单元格，避免固定像素与窄表冲突 */
.version-form-page .table-color-sheet input.form-control.color-sheet-inp-name,
.version-form-page .table-color-sheet input.form-control.color-sheet-inp-code {
    display: block !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 30px !important;
    min-height: 30px !important;
    padding: 0 8px !important;
    line-height: 30px !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
}

.version-form-page .table-color-sheet .color-sheet-hex-cell > input {
    margin: 0 !important;
    flex-shrink: 0;
}
.version-form-page .table-color-sheet .color-swatch {
    display: block;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border: 1px solid #ced4da;
    border-radius: 2px;
    box-sizing: border-box;
}
.version-form-page .table-color-sheet .color-picker-input {
    display: block;
    width: 32px;
    height: 28px;
    padding: 0;
    border: 0;
    cursor: pointer;
    flex-shrink: 0;
    box-sizing: border-box;
}
.version-form-page .table-color-sheet input.form-control.hex-code-field {
    width: 7.5rem !important;
    min-width: 7.5rem !important;
    max-width: 9rem !important;
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 6px !important;
    line-height: 28px !important;
    font-size: 13px !important;
    box-sizing: border-box !important;
    flex: 0 0 auto;
}

/* Sheet2 尺码表：保持原逻辑，不与 Sheet1 混用宽度 */
:is(.version-form-page, .module-lite-page) .table-size-sheet {
    border-collapse: collapse;
    /* 仅占内容宽度，避免两列尺码时整行被拉成全屏宽、数字框显得「巨大」 */
    width: auto;
    max-width: 100%;
}
:is(.version-form-page, .module-lite-page) .table-size-sheet.table-size-sheet--wired {
    border: 1px solid #d1d5db;
}
:is(.version-form-page, .module-lite-page) .table-size-sheet.table-size-sheet--wired > thead > tr > th,
:is(.version-form-page, .module-lite-page) .table-size-sheet.table-size-sheet--wired > tbody > tr > td {
    border-color: #e5e7eb !important;
}
:is(.version-form-page, .module-lite-page) .table-size-sheet th,
:is(.version-form-page, .module-lite-page) .table-size-sheet td {
    text-align: center !important;
    vertical-align: middle !important;
}
/* th/td 必须为 table-cell：flex 仅放在内层，否则导入多列后表头会竖排、列错位 */
:is(.version-form-page, .module-lite-page) .table-size-sheet th.size-col-head {
    padding: 4px 6px;
    min-width: 3.25rem;
    max-width: 7rem;
}
:is(.version-form-page, .module-lite-page) .table-size-sheet .size-col-head-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
}
:is(.version-form-page, .module-lite-page) .table-size-sheet .size-col-drag-handle,
:is(.version-form-page, .module-lite-page) .table-size-sheet .size-row-drag-handle {
    flex: 0 0 auto;
    display: inline-block;
    width: 1.1rem;
    min-height: 1.5rem;
    line-height: 1.2;
    cursor: grab;
    user-select: none;
    color: #9ca3af;
    letter-spacing: -2px;
    font-size: 12px;
}
:is(.version-form-page, .module-lite-page) .table-size-sheet .size-col-drag-handle::before,
:is(.version-form-page, .module-lite-page) .table-size-sheet .size-row-drag-handle::before {
    content: '⋮⋮';
}
:is(.version-form-page, .module-lite-page) .table-size-sheet td.size-part-cell {
    text-align: left !important;
}
:is(.version-form-page, .module-lite-page) .table-size-sheet .size-part-cell-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    min-width: 0;
}
:is(.version-form-page, .module-lite-page) .table-size-sheet td.size-part-cell .size-part {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 0 !important;
    margin-right: 0 !important;
}
:is(.version-form-page, .module-lite-page) .table-size-sheet input.size-col-header-inp {
    flex: 0 1 auto;
    min-width: 2.75rem !important;
    max-width: 6.5rem !important;
    width: 4.25rem !important;
    font-weight: 600;
    text-align: center;
}
:is(.version-form-page, .module-lite-page) .table-size-sheet tr.size-data-row.size-drag-over-target,
:is(.version-form-page, .module-lite-page) .table-size-sheet th.size-col-head.size-drag-over-target {
    outline: 2px dashed #2563eb;
    outline-offset: -2px;
    background-color: rgba(37, 99, 235, 0.06);
}
:is(.version-form-page, .module-lite-page) .table-size-sheet input {
    display: block !important;
    margin: 0 auto !important;
}
:is(.version-form-page, .module-lite-page) .table-size-sheet .td-color-name,
:is(.version-form-page, .module-lite-page) .table-size-sheet .td-color-code {
    width: auto;
    min-width: 80px;
}
:is(.version-form-page, .module-lite-page) .table-size-sheet input.form-control.color-sheet-inp-name {
    width: 160px !important;
    max-width: 160px !important;
    min-width: 160px !important;
}
:is(.version-form-page, .module-lite-page) .table-size-sheet input.form-control.color-sheet-inp-code {
    width: 100px !important;
    max-width: 100px !important;
    min-width: 100px !important;
}
:is(.version-form-page, .module-lite-page) .table-size-sheet .color-sheet-hex-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}
:is(.version-form-page, .module-lite-page) .table-size-sheet .color-swatch {
    display: block;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border: 1px solid #ced4da;
    border-radius: 2px;
    margin: 0;
    box-sizing: border-box;
}
:is(.version-form-page, .module-lite-page) .table-size-sheet .color-picker-input {
    display: block;
    width: 40px;
    height: 28px;
    padding: 0;
    border: 0;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
    box-sizing: border-box;
}
:is(.version-form-page, .module-lite-page) .table-size-sheet input.form-control.hex-code-field.size-base-value {
    width: 5rem !important;
    max-width: 6rem !important;
    min-width: 3.25rem !important;
    text-align: right !important;
    font-variant-numeric: tabular-nums;
}
:is(.version-form-page, .module-lite-page) .table-size-sheet input.size-gap,
:is(.version-form-page, .module-lite-page) .table-size-sheet input.size-tolerance,
:is(.version-form-page, .module-lite-page) .table-size-sheet input.size-derived {
    width: 5rem !important;
    max-width: 6rem !important;
    min-width: 3.25rem !important;
    text-align: right !important;
    font-variant-numeric: tabular-nums;
}
:is(.version-form-page, .module-lite-page) .table-size-sheet input.form-control.hex-code-field:not(.size-base-value) {
    width: 120px !important;
    max-width: 120px !important;
    min-width: 72px !important;
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
    font-size: 14px !important;
}
:is(.version-form-page, .module-lite-page) .table-size-sheet .td-color-actions,
:is(.version-form-page, .module-lite-page) .table-size-sheet .th-color-actions {
    width: 50px;
    min-width: 50px;
    text-align: center;
    white-space: nowrap;
}

/* 删除：50×30 扁平淡色、横向 */
.version-form-page .table-color-sheet button.btn-color-sheet-del,
:is(.version-form-page, .module-lite-page) .table-size-sheet button.btn-color-sheet-del {
    width: 50px !important;
    height: 30px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    padding: 0 !important;
    font-size: 12px !important;
    line-height: 30px !important;
    box-sizing: border-box !important;
    border: 1px solid #e5e7eb !important;
    color: #6b7280 !important;
    background: #f9fafb !important;
    border-radius: 2px !important;
    display: inline-block !important;
    vertical-align: middle !important;
    text-align: center !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    margin: 0 auto !important;
}
.version-form-page .table-color-sheet button.btn-color-sheet-del:hover,
:is(.version-form-page, .module-lite-page) .table-size-sheet button.btn-color-sheet-del:hover {
    background: #f3f4f6 !important;
    color: #374151 !important;
}

/* 仅隐藏版单页误用的固定角按钮，勿用全局选择器屏蔽 .btn-success */
.version-form-page .fixed-bottom-right,
.version-form-page .btn-fixed {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Sheet2 尺码表：粘贴区容器（左对齐、与右上角基准条错开） */
.version-form-page .size-paste-container {
    max-width: 800px;
    margin-left: 0;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
}
.version-form-page .size-paste-label {
    align-self: flex-start;
}
.version-form-page .size-paste-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-shrink: 0;
}
.version-form-page #size-paste-zone.form-control,
.version-form-page #size-paste-zone.paste-zone {
    min-height: 220px;
    font-size: 14px;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
}
#pane-s2 .size-chart-name-field .size-chart-name-input {
    max-width: 360px;
    height: 30px;
    font-size: 14px;
}

#pane-s2 .size-sheet-status.is-ok {
    color: #15803d;
    margin-bottom: 0;
}
#pane-s2 .size-sheet-status.is-err {
    color: #b91c1c;
    margin-bottom: 0;
    font-weight: 500;
}

.version-form-page .size-sheet-status.is-ok {
    color: #15803d;
    margin-bottom: 0;
}
.version-form-page .size-sheet-status.is-err {
    color: #b91c1c;
    margin-bottom: 0;
}

/* Sheet2 v2：多命名尺寸表列表 + 右键插入行列 */
#pane-s2 .size-chart-list-panel {
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
#pane-s2 .size-chart-name-table-wrap {
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #fff;
}
#pane-s2 .size-chart-name-table {
    font-size: 14px;
    margin-bottom: 0;
}
#pane-s2 .size-chart-name-table thead th {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f6 100%);
    color: #374151;
    font-weight: 600;
    border-color: #e2e8f0;
    white-space: nowrap;
    vertical-align: middle;
}
#pane-s2 .size-chart-name-table tbody td {
    vertical-align: middle;
    border-color: #e2e8f0;
}
#pane-s2 .size-chart-name-table-col-actions {
    width: 6.5rem;
}
#pane-s2 .size-chart-name-link {
    font-size: 14px;
    font-weight: 500;
    color: #2563eb;
}
#pane-s2 .size-list-toolbar,
#pane-s2 .size-detail-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
/* Sheet2：尺码组在 pane 顶部（版次级），与三套类型列表分离 */
#pane-s2 .size-group-style-strip .size-group-style-strip-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 1.25rem;
}
#pane-s2 .size-group-style-strip-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 1.25rem;
}
#pane-s2 .size-group-style-strip .size-group-style-hint {
    flex: 1 1 220px;
    min-width: 0;
    line-height: 1.45;
}
/* 尺码组 + 基准尺码：同行、固定宽度，避免 form-control 100% 撑满一行 */
#pane-s2 .size-action-inline-group {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px 16px;
    flex: 0 1 auto;
    min-width: 0;
}
#pane-s2 .size-action-field {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px 8px;
    flex: 0 0 auto;
}
#pane-s2 .size-action-field .size-action-label {
    flex-shrink: 0;
}
#pane-s2 #size-group-select.size-action-select {
    width: 200px !important;
    min-width: 160px !important;
    max-width: 240px !important;
    height: 30px !important;
    font-size: 14px;
    padding: 0 8px;
    box-sizing: border-box;
}
#pane-s2 #base-size-select.size-action-select {
    width: 100px !important;
    min-width: 72px !important;
    max-width: 120px !important;
    height: 30px !important;
    font-size: 14px;
    padding: 0 6px;
    box-sizing: border-box;
}
#pane-s2 #size-chart-ctx-menu.size-chart-ctx-menu {
    position: fixed;
    z-index: 1060;
    min-width: 10rem;
    padding: 0.35rem 0;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border: 1px solid #e5e7eb;
    display: none;
}
#pane-s2 #size-chart-ctx-menu.size-chart-ctx-menu.is-open {
    display: flex;
    flex-direction: column;
}
#pane-s2 .size-chart-ctx-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.45rem 0.85rem;
    border: none;
    background: transparent;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
}
#pane-s2 .size-chart-ctx-item:hover {
    background: #f9fafb;
}
#pane-s2 #btn-size-insert-col.size-add-col-toolbar {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Sheet2 v3：三套固定类型列表 */
#pane-s2 .dimension-type-list-panel {
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
#pane-s2 .dimension-type-table-wrap {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: #fff;
}
#pane-s2 .dimension-type-table thead th {
    background: #f9fafb;
    color: #374151;
    font-weight: 600;
    border-bottom: 1px solid #f3f4f6;
}
#pane-s2 .dimension-type-table tbody td {
    vertical-align: middle;
    border-bottom: 1px solid #f3f4f6;
}
#pane-s2 .dimension-type-table-col-actions {
    width: 11rem;
}
#pane-s2 .dimension-type-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem;
}

/* Sheet2 网格向导：尺码表场景全表居中（C-01 例外，仅 #pane-s2） */
#pane-s2 .scw-grid-table th,
#pane-s2 .scw-grid-table td,
#pane-s2 .scw-grid-table .scw-grid-cell,
#pane-s2 .scw-preview-table thead th,
#pane-s2 .scw-preview-table tbody td,
#pane-s2 .scw-saved-table thead th,
#pane-s2 .scw-saved-table tbody td,
#pane-s2 .scw-saved-table .form-control {
    text-align: center;
    vertical-align: middle;
}

/* ==================== Sheet5 BOM：视图切换 + 录入弹窗 + 类别 Badge ==================== */
.version-form-page .bom-sheet-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    margin-bottom: 0;
}
.module-lite-page #pane-s5 .bom-toolbar-add-slot,
.version-form-page #pane-s5 .bom-toolbar-add-slot {
    flex: 0 0 auto;
}
.module-lite-page #pane-s5 .bom-toolbar-add-slot .btn,
.version-form-page #pane-s5 .bom-toolbar-add-slot .btn {
    white-space: nowrap;
}
.version-form-page .bom-view-toggle-group {
    display: inline-flex;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
}
/* Sheet5：物料大类筛选（全部 / 面料 / 辅料），与视图切换并列 */
.version-form-page .bom-mat-cat-filter-group {
    display: inline-flex;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
}
.version-form-page .bom-mat-cat-btn {
    padding: 6px 12px;
    font-size: 13px;
    border: none;
    background: #f8f9fa;
    color: #495057;
    cursor: pointer;
    line-height: 1.2;
}
.version-form-page .bom-mat-cat-btn + .bom-mat-cat-btn {
    border-left: 1px solid #dee2e6;
}
.version-form-page .bom-mat-cat-btn:hover {
    background: #e9ecef;
}
.version-form-page .bom-mat-cat-btn.active {
    background: #2563EB;
    color: #fff;
    font-weight: 600;
}
.version-form-page .bom-view-btn {
    padding: 6px 12px;
    font-size: 13px;
    border: none;
    background: #f8f9fa;
    color: #495057;
    cursor: pointer;
    line-height: 1.2;
}
.version-form-page .bom-view-btn + .bom-view-btn {
    border-left: 1px solid #dee2e6;
}
.version-form-page .bom-view-btn:hover {
    background: #e9ecef;
}
.version-form-page .bom-view-btn.active {
    background: #2563EB;
    color: #fff;
    font-weight: 600;
}
.version-form-page .bom-view-panel {
    margin-top: 4px;
}
.version-form-page .bom-view-hint {
    margin: 8px 0;
    font-size: 14px;
}
.version-form-page .bom-item-modal-content {
    min-width: min(720px, 96vw);
    max-width: 920px;
}
.version-form-page .bom-item-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.version-form-page .bom-item-modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #333;
}
.version-form-page .bom-item-modal-close {
    border: none;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #9ca3af;
    padding: 0 4px;
}
.version-form-page .bom-item-modal-close:hover {
    color: #374151;
}
.version-form-page .bom-item-modal-hint {
    font-size: 13px;
    margin: 0 0 12px;
}
.version-form-page .bom-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
    align-items: start;
}
.version-form-page .bom-modal-field-span2 {
    grid-column: 1 / -1;
}
.version-form-page .bom-modal-field label,
.version-form-page .bom-modal-label-block {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
}
.version-form-page .bom-item-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
    padding-top: 0;
    border-top: none;
}
.version-form-page .bom-scope-check-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: #fafafa;
    max-height: 160px;
    overflow: auto;
}
.version-form-page .bom-scope-check-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
}
.version-form-page .bom-scope-check-row.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
/* 模块轻量壳无 .version-form-page 包裹时，配色勾选列表仍须置灰样式生效 */
.bom-item-modal-root .bom-scope-check-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: #fafafa;
    max-height: 160px;
    overflow: auto;
}
.bom-item-modal-root .bom-scope-check-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
}
.bom-item-modal-root .bom-scope-check-row.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.bom-item-modal-root .bom-scope-check-row.is-picked {
    background: #eff6ff;
    border-radius: 4px;
    padding: 4px 8px;
    margin: -4px -8px;
}
.version-form-page .bom-process-chain-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}
.version-form-page .bom-process-chain-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.version-form-page .bom-process-chain-row .bom-process-chain-inp {
    flex: 1;
    min-width: 0;
}
.version-form-page .bom-btn-add-chain {
    margin-top: 4px;
}
/* 成品蓝 / 坯布橙 / 辅料绿 */
.version-form-page .bom-cat-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.version-form-page .bom-cat-badge-fabric {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
}
.version-form-page .bom-cat-badge-greige {
    background: #ffedd5;
    color: #c2410c;
    border: 1px solid #fdba74;
}
.version-form-page .bom-cat-badge-trims {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}
.version-form-page .bom-board-scroll-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
/* 按颜色看板：完整网格线 + 与版单卡片一致的留白（矩阵视图专用，与「按物料」横线-only 区分） */
.version-form-page .bom-board-grid-table {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e5e7eb;
    font-size: 13px;
    table-layout: auto;
}
.version-form-page .bom-board-grid-table thead th {
    background: #f8fafc;
    color: #111827;
    font-weight: 600;
    border: 1px solid #e5e7eb;
    padding: 10px 12px;
    text-align: center;
    vertical-align: middle;
}
.version-form-page .bom-board-grid-table tbody td {
    border: 1px solid #e5e7eb;
    padding: 10px 12px;
    vertical-align: middle;
}
.version-form-page .bom-board-grid-table tbody tr {
    height: auto;
    min-height: 42px;
}
.version-form-page .bom-board-grid-table tbody tr:hover {
    background: #f9fafb;
}
.version-form-page .bom-board-grid-table .bom-mat-col {
    text-align: left;
}
.version-form-page .bom-board-grid-table .cell-calc {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.version-form-page .bom-board-color-table .bom-board-color-name {
    vertical-align: middle;
    font-weight: 600;
    background: #f8fafc;
    white-space: nowrap;
}

/* 按颜色 — 成本分析矩阵：左物料 + 动态色列 + 表尾综合成本 */
.version-form-page .bom-board-color-cost-matrix {
    table-layout: auto;
}
.version-form-page .bom-board-color-cost-matrix .bom-cc-th-mat {
    text-align: left;
    min-width: 200px;
}
.version-form-page .bom-board-color-cost-matrix .bom-cc-th-color {
    color: #15803d;
    font-weight: 700;
    text-align: center;
    min-width: 100px;
    white-space: nowrap;
}
.version-form-page .bom-board-color-cost-matrix .bom-cc-td-mat {
    text-align: left;
}
.version-form-page .bom-board-color-cost-matrix .bom-cc-td-mat.bom-board-mat-cell {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.version-form-page .bom-board-color-cost-matrix .bom-cc-td-mat .bom-board-mat-name {
    flex: 1;
    min-width: 120px;
}
.version-form-page .bom-board-color-cost-matrix .bom-cc-td-cost {
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.version-form-page .bom-board-color-cost-matrix tbody tr.bom-cc-tr-summary {
    background: #e8f4fc;
}
.version-form-page .bom-board-color-cost-matrix tbody tr.bom-cc-tr-summary:hover {
    background: #e8f4fc;
}
.version-form-page .bom-board-color-cost-matrix tbody tr.bom-cc-tr-summary td {
    border-top: 1px solid #cbd5e1;
    font-weight: 700;
}
.version-form-page .bom-board-color-cost-matrix .bom-cc-td-summary-label {
    text-align: left;
    color: #0f172a;
}
.version-form-page .bom-board-color-cost-matrix .bom-cc-td-summary-val {
    text-align: center;
    color: #1d4ed8;
    font-size: 14px;
    font-weight: 700;
}
.version-form-page .bom-material-table .bom-col-spec-trio {
    font-size: 13px;
    max-width: 140px;
}

/* BOM 按物料列表：宽屏撑开、12px 密排、三列 sticky（# / 类别 / 物料） */
.version-form-page .bom-bom-list-shell {
    width: 100%;
}
@media (min-width: 1200px) {
    .version-form-page .bom-bom-list-shell {
        overflow-x: visible;
    }
}
@media (max-width: 1199.98px) {
    .version-form-page .bom-bom-list-shell {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}
.version-form-page .bom-material-table.bom-material-table-dense {
    width: max-content;
    min-width: 100%;
    font-size: 12px;
    table-layout: auto;
}
.version-form-page .bom-material-table.bom-material-table-dense th,
.version-form-page .bom-material-table.bom-material-table-dense td {
    font-size: 12px;
    padding: 0.25rem 0.4rem;
    vertical-align: middle;
}
:is(.version-form-page, .module-lite-page) .bom-material-table tr.bom-row--flash-focus {
    animation: bom-row-flash-focus 1.4s ease-out;
}
@keyframes bom-row-flash-focus {
    0%,
    100% {
        background-color: transparent;
    }
    18% {
        background-color: #dbeafe;
    }
}
.version-form-page .bom-material-table.bom-material-table-dense .bom-mat-sticky-idx,
.version-form-page .bom-material-table.bom-material-table-dense .bom-mat-sticky-cat,
.version-form-page .bom-material-table.bom-material-table-dense .bom-mat-sticky-mat {
    position: sticky;
    z-index: 2;
    background: #fff;
    box-shadow: 2px 0 3px rgba(15, 23, 42, 0.08);
}
.version-form-page .bom-material-table.bom-material-table-dense thead th.bom-mat-sticky-idx,
.version-form-page .bom-material-table.bom-material-table-dense thead th.bom-mat-sticky-cat,
.version-form-page .bom-material-table.bom-material-table-dense thead th.bom-mat-sticky-mat {
    z-index: 3;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}
.version-form-page .bom-material-table.bom-material-table-dense .bom-mat-sticky-idx {
    left: 0;
    min-width: 2.25rem;
}
.version-form-page .bom-material-table.bom-material-table-dense .bom-mat-sticky-cat {
    left: 2.25rem;
    min-width: 4.5rem;
}
.version-form-page .bom-material-table.bom-material-table-dense .bom-mat-sticky-mat {
    left: 6.75rem;
    min-width: 9rem;
    max-width: 14rem;
}
.version-form-page .bom-material-table.bom-material-table-dense .bom-cell-stack {
    line-height: 1.35;
    white-space: normal;
}
.version-form-page .bom-material-table.bom-material-table-dense .bom-col-scope {
    max-width: 240px;
}
.version-form-page .bom-scope-badges-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    max-width: 220px;
    max-height: 3.6em;
    overflow: hidden;
}
.version-form-page .bom-scope-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 0.15em 0.45em;
}
.version-form-page .bom-material-table.bom-material-table-dense .bom-cell-process-req {
    color: #b45309;
    font-weight: 600;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 4px;
    padding: 2px 6px;
    line-height: 1.3;
}

/* BOM 弹窗：大号 modal-lg + 分组卡片 + Select2 + 底部成本条（整壳 flex 列，正文区单独滚动） */
.version-form-page .bom-item-modal-content.bom-modal-lg {
    min-width: min(960px, 98vw);
    max-width: 1100px;
    max-height: min(92vh, 920px);
    min-height: 0;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
}
/* 非 BOM 物料行弹窗的通用 bom-modal-body（若存在）；物料弹窗用下方 .bom-item-modal-root 覆盖 */
.version-form-page .bom-modal-body {
    overflow-y: auto;
    max-height: min(70vh, 680px);
    flex: 1;
    min-height: 0;
    padding-right: 2px;
}
.version-form-page .bom-modal-cards {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.version-form-page .bom-card {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 10px;
    background: #fff;
    overflow: hidden;
}
.version-form-page .bom-card-head {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    font-size: 13px;
    font-weight: 700;
    padding: 7px 12px;
    color: #334155;
    border-bottom: 1px solid #e2e8f0;
}
.version-form-page .bom-card-ico {
    margin-right: 4px;
}
.version-form-page .bom-card-body {
    padding: 10px 12px;
}
.version-form-page .bom-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
    align-items: start;
}
.version-form-page .bom-card .bom-modal-field-span2 {
    grid-column: 1 / -1;
}
/* BOM 表单必填：星号（整页版单 / 模块轻量 / 独立弹窗根节点均可生效） */
.version-form-page .bom-label-req::after,
.module-lite-page .bom-label-req::after,
.bom-item-modal-root .bom-label-req::after {
    content: " *";
    color: #c53030;
    font-weight: 700;
    opacity: 0.9;
}

/* 物料表列表表头：必填列（由 JS 输出 .bom-th-req） */
.module-lite-page .bom-material-table-split th.bom-th-req .bom-th-req-mark,
.version-form-page .bom-material-table-split th.bom-th-req .bom-th-req-mark {
    color: #c53030;
    font-weight: 700;
    margin-left: 2px;
}
.version-form-page .bom-temp-badge {
    display: inline-block;
    margin-left: 8px;
    margin-top: 6px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 4px;
}
.version-form-page .bom-material-select2 + .select2-container {
    width: 100% !important;
}
.version-form-page .bom-item-modal-root .select2-container {
    z-index: 1060;
}
.version-form-page .bom-item-modal-root .select2-container .select2-selection--single {
    height: 30px;
    min-height: 30px;
    padding-top: 2px;
}
.version-form-page .bom-item-modal-root .select2-container .select2-selection__rendered {
    line-height: 26px;
    font-size: 14px;
}
.version-form-page .bom-item-modal-root .select2-container .select2-selection__arrow {
    height: 28px;
}
.version-form-page .bom-scope-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 8px 10px;
}
.version-form-page .bom-scope-check-row.is-picked {
    background: #eff6ff;
    border-radius: 4px;
    padding: 4px 8px;
    margin: -4px -8px;
}
.version-form-page .bom-modal-total-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 12px 4px 8px;
    margin-top: 6px;
    border-top: 2px solid #e2e8f0;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}
.version-form-page .bom-modal-total-label {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}
.version-form-page .bom-modal-total-value {
    font-size: 1.65rem;
    font-weight: 800;
    color: #15803d;
    letter-spacing: 0.02em;
    line-height: 1.2;
}
.version-form-page .bom-modal-total-hint {
    font-size: 12px;
    flex: 1 1 200px;
}
.version-form-page .bom-total-manual-input {
    max-width: 140px;
    display: inline-block;
    vertical-align: middle;
}
.version-form-page .bom-total-edit-toggle {
    padding: 0 6px;
    font-size: 13px;
}

/* BOM 弹窗正文区滚动：与下方「定稿」规则合并，避免 max-height 互相覆盖 */
.version-form-page .bom-modal-compact {
    font-size: 12px;
}
.bom-item-modal-root .bom-modal-compact .row[class*="bom-bom-row-"] {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 0.85rem;
    margin-bottom: 0.5rem;
}
.bom-item-modal-root .bom-modal-compact .form-label-sm {
    margin-bottom: 0.3rem;
    font-size: 13px;
    line-height: 1.25;
}
.bom-item-modal-root .bom-modal-compact .form-control-sm,
.bom-item-modal-root .bom-modal-compact .form-select-sm,
.bom-item-modal-root .bom-modal-compact .select2-container .select2-selection--single {
    min-height: 36px;
    height: 36px;
}
.bom-item-modal-root .bom-bom-row-1 .col-md-4,
.bom-item-modal-root .bom-bom-row-1 .col-md-6,
.bom-item-modal-root .bom-bom-row-2 > [class*="col-"],
.bom-item-modal-root .bom-bom-row-3 > [class*="col-"] {
    padding-right: calc(var(--bs-gutter-x) * 0.5);
    padding-left: calc(var(--bs-gutter-x) * 0.5);
}
.bom-item-modal-root .bom-bom-row-2 .bom-h-row-material {
    min-width: 260px;
}
.bom-item-modal-root .bom-m-spec-section .row.g-2 {
    --bs-gutter-x: 0.85rem;
    --bs-gutter-y: 0.65rem;
}
.bom-item-modal-root .bom-chain-temp-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.15rem;
    margin-bottom: 0.25rem;
}
.bom-item-modal-root .bom-chain-temp-label input {
    margin: 0;
}
.bom-item-modal-root .bom-modal-compact .bom-field-block {
    margin-bottom: 0.1rem;
}
@media (max-width: 991.98px) {
    .bom-item-modal-root .bom-bom-row-2 .bom-h-row-material {
        min-width: 0;
    }
}

/* BOM 弹窗：横向优先 + 正文区可滚动（内容超出必出滚动条） */
.version-form-page .bom-item-modal-root .bom-modal-body,
.bom-item-modal-root .bom-modal-body {
    flex: 1 1 auto;
    min-height: 120px;
    max-height: min(72vh, calc(92vh - 200px));
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    padding-right: 8px;
}

/*
 * 物料行录入：以「弹窗内容区」宽度为基准（容器查询），不依赖整页/iframe 视口 ≥768px。
 * 否则抽屉、窄 iframe 下 @media (min-width: 768px) 永不命中，Bootstrap col-12 会整列竖排，观感极差。
 */
.version-form-page .bom-item-modal-content.bom-modal-lg,
.bom-item-modal-root .bom-item-modal-content.bom-modal-lg {
    container-type: inline-size;
    container-name: bom-item-modal;
}

@container bom-item-modal (min-width: 300px) {
    #bomItemModal .bom-bom-row-1.bom-row1--three {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: end;
        column-gap: 0.75rem;
        row-gap: 0.5rem;
    }
    #bomItemModal .bom-bom-row-1.bom-row1--two {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: end;
        column-gap: 0.75rem;
        row-gap: 0.5rem;
    }
    #bomItemModal .bom-bom-row-1.bom-row1--three > [class*="col-"],
    #bomItemModal .bom-bom-row-1.bom-row1--two > [class*="col-"] {
        width: 100%;
        max-width: none;
        flex: none;
    }
}

@container bom-item-modal (min-width: 400px) {
    #bomItemModal .bom-bom-row-2 {
        display: grid;
        grid-template-columns: minmax(160px, 1.2fr) minmax(64px, 0.45fr) minmax(180px, 1.65fr);
        align-items: end;
        column-gap: 0.85rem;
        row-gap: 0.55rem;
    }
    #bomItemModal .bom-bom-row-2 > [class*="col-"] {
        width: 100%;
        max-width: none;
        flex: none;
    }
}

@container bom-item-modal (min-width: 360px) {
    #bomItemModal .bom-bom-row-3 {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: end;
        column-gap: 0.65rem;
        row-gap: 0.55rem;
    }
    #bomItemModal .bom-bom-row-3 > [class*="col-"] {
        width: 100%;
        max-width: none;
        flex: none;
    }
}

@container bom-item-modal (min-width: 720px) {
    #bomItemModal .bom-bom-row-3 {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        column-gap: 0.75rem;
    }
}

@media (min-width: 768px) {
    .version-form-page .bom-item-modal-root .bom-bom-row-1.bom-row1--three {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: end;
        column-gap: 1rem;
        row-gap: 0.65rem;
    }
    .version-form-page .bom-item-modal-root .bom-bom-row-1.bom-row1--two {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: end;
        column-gap: 1rem;
        row-gap: 0.65rem;
    }
    .version-form-page .bom-item-modal-root .bom-bom-row-1.bom-row1--three > [class*="col-"],
    .version-form-page .bom-item-modal-root .bom-bom-row-1.bom-row1--two > [class*="col-"] {
        width: 100%;
        max-width: none;
        flex: none;
    }
    .version-form-page .bom-item-modal-root .bom-bom-row-2 {
        display: grid;
        grid-template-columns: minmax(200px, 1.25fr) minmax(72px, 0.55fr) minmax(260px, 2.2fr);
        align-items: end;
        column-gap: 1rem;
        row-gap: 0.65rem;
    }
    .version-form-page .bom-item-modal-root .bom-bom-row-2 > [class*="col-"] {
        width: 100%;
        max-width: none;
        flex: none;
    }
    .version-form-page .bom-item-modal-root .bom-bom-row-3 {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        align-items: end;
        column-gap: 0.65rem;
        row-gap: 0.65rem;
    }
    .version-form-page .bom-item-modal-root .bom-bom-row-3 > [class*="col-"] {
        width: 100%;
        max-width: none;
        flex: none;
    }
}

.version-form-page .bom-item-modal-root .bom-bom-row-1 .form-control.form-control-sm,
.version-form-page .bom-item-modal-root .bom-bom-row-1 .form-select.form-select-sm {
    min-height: 36px;
    height: 36px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    box-shadow: none;
}
.version-form-page .bom-bom-card {
    margin-bottom: 0;
}
.version-form-page .bom-sm-card {
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}
.version-form-page .bom-sm-card .bom-sm-card-header,
.version-form-page .bom-bom-card > .card-header.bom-sm-card-header {
    font-size: 12px;
    font-weight: 700;
    color: #1e3a5f;
    background: linear-gradient(180deg, #e8f4fc 0%, #dbeafe 100%);
    border-bottom: 1px solid #bfdbfe;
}
.version-form-page .bom-h-row {
    min-height: 28px;
}
.version-form-page .bom-h-row .col-form-label-sm {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    line-height: 1.2;
}
.version-form-page .bom-h-row-material .bom-material-select-wrap {
    width: 100%;
}
.version-form-page .bom-settlement-card {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    min-width: 168px;
    box-shadow: inset 0 1px 0 #fff;
}
.version-form-page .bom-settlement-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.version-form-page .bom-footer-main-row {
    align-items: flex-end !important;
}
.version-form-page .bom-modal-total-hint-wrap {
    min-width: 0;
}
.version-form-page #bomItemModal.bom-cat-trims #bom-m-spec-section {
    display: none !important;
}
.version-form-page .bom-modal-group {
    margin-bottom: 0;
}
.version-form-page .bom-modal-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    border-radius: 2px;
    border: 1px solid #e9ecef;
}
.version-form-page .bom-field-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
}
.version-form-page .bom-field-inline-material {
    align-items: flex-start;
}
.version-form-page .bom-field-inline-material .bom-field-label {
    padding-top: 4px;
}
.version-form-page .bom-field-label {
    flex: 0 0 72px;
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    text-align: right;
    line-height: 1.2;
}
.version-form-page .bom-field-control,
.version-form-page .bom-item-modal-root .bom-field-control {
    height: 30px;
    min-height: 30px;
    font-size: 14px;
    padding-top: 4px;
    padding-bottom: 4px;
}
.version-form-page textarea.bom-field-control {
    height: auto;
    min-height: 60px;
}
.version-form-page .bom-material-select-wrap {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.version-form-page .bom-material-select-wrap .select2-container {
    flex: 1 1 160px;
    min-width: 0;
}
.version-form-page .bom-greige-suppliers-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}
.version-form-page .bom-chain-temp-label {
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}
.version-form-page .bom-chain-temp-label input {
    margin-right: 6px;
    vertical-align: middle;
}
.version-form-page .bom-modal-footer-erp {
    flex-shrink: 0;
    background: #fafbfc;
}
.version-form-page .bom-item-modal-root .bom-modal-footer-erp.bom-modal-footer-actions-only {
    padding-top: 4px;
    padding-bottom: 4px;
}
.version-form-page .bom-item-modal-root .bom-modal-footer-erp.bom-modal-footer-actions-only .bom-item-modal-actions {
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
}
.version-form-page .bom-est-cost-hero {
    font-size: 1.5rem;
    font-weight: 800;
    color: #15803d;
    line-height: 1.15;
    letter-spacing: 0.03em;
}
.version-form-page .bom-field-error,
.version-form-page .bom-field-control.bom-field-error {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.25);
}

/* BOM 弹窗：加工模式专用视觉标记 */
#bomItemModal[data-material-lib-subcat="dyeing"],
#bomItemModal[data-material-lib-subcat="process"] {
    border-top: 5px solid #ffc107; /* 橙色提醒：这是加工服务 */
}

/* 隐藏不必要的字段：当 subcat 是加工类时，隐藏幅宽克重 */
#bomItemModal[data-material-lib-subcat="dyeing"] .bom-modal-spec-group,
#bomItemModal[data-material-lib-subcat="process"] .bom-modal-spec-group {
    display: none !important;
}

/* BOM 弹窗：紧凑行距 + 抵消 admin-modal 对 .card 去边框（分组卡片须可见） */
.version-form-page .bom-item-modal-root .bom-card-body-tight {
    padding-top: 8px;
    padding-bottom: 8px;
}
.version-form-page .bom-item-modal-root .bom-card-body-tight .form-label-sm,
.version-form-page .bom-item-modal-root .bom-m-maincat-row .form-label-sm {
    margin-bottom: 2px;
    line-height: 1.25;
}
.version-form-page .bom-item-modal-root .bom-bom-field-stack .bom-field-block {
    margin-bottom: 8px;
}
.version-form-page .bom-item-modal-root .bom-bom-field-stack .form-label-sm {
    margin-bottom: 4px;
    display: block;
}
.version-form-page .bom-item-modal-root .bom-card {
    margin-bottom: 8px;
}
.bom-item-modal-root.admin-modal .card.bom-sm-card.bom-bom-card {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
    background: #fff;
}
.bom-item-modal-root.admin-modal .card.bom-sm-card.bom-bom-card .card-header {
    border-bottom: 1px solid #bfdbfe;
}

/* 列表展示：给子分类打上 Badge */
.badge-subcat-finished { background-color: #e3f2fd; color: #0d47a1; }
.badge-subcat-greige { background-color: #fff3e0; color: #e65100; }
.badge-subcat-dyeing { background-color: #f3e5f5; color: #4a148c; }

/* Sheet6 工序库选择弹窗：结果区滚动，避免小屏占满视口 */
.version-form-page .process-pick-modal .process-pick-modal-content {
    width: min(720px, 96vw);
}
.version-form-page .process-pick-modal .process-pick-results-wrap {
    max-height: 260px;
    overflow: auto;
}
.version-form-page .process-pick-modal .process-pick-row {
    cursor: pointer;
}
.version-form-page .process-pick-modal .process-pick-row:hover {
    background: #f8fafc;
}

/* Sheet6 工价表：限制机器类型/选择工序列宽，保证工价列可读 */
.version-form-page .sheet-process-table {
    table-layout: fixed;
    width: 100%;
}
.version-form-page .sheet-process-table thead th:nth-child(1),
.version-form-page .sheet-process-table tbody td:nth-child(1) {
    width: 6.25rem;
    max-width: 7rem;
    min-width: 0;
}
.version-form-page .sheet-process-table thead th:nth-child(2),
.version-form-page .sheet-process-table tbody td:nth-child(2) {
    width: 5.5rem;
    max-width: 6.25rem;
    min-width: 0;
}
.version-form-page .sheet-process-table thead th:nth-child(3),
.version-form-page .sheet-process-table tbody td:nth-child(3) {
    width: 5rem;
    max-width: 5.5rem;
    min-width: 0;
}
.version-form-page .sheet-process-table thead th:nth-child(4),
.version-form-page .sheet-process-table tbody td:nth-child(4) {
    width: 9.5rem;
    max-width: 11rem;
    min-width: 0;
}
.version-form-page .sheet-process-table thead th:nth-child(5),
.version-form-page .sheet-process-table tbody td:nth-child(5) {
    width: 4.75rem;
    max-width: 5.25rem;
    min-width: 0;
}
.version-form-page .sheet-process-table thead th:nth-child(6),
.version-form-page .sheet-process-table tbody td:nth-child(6) {
    width: 6.5rem;
    max-width: 7.5rem;
    min-width: 0;
}
.version-form-page .sheet-process-table thead th:nth-child(7),
.version-form-page .sheet-process-table tbody td:nth-child(7) {
    width: 7.5rem;
    min-width: 7rem;
    max-width: 9rem;
}
.version-form-page .sheet-process-table thead th:nth-child(8),
.version-form-page .sheet-process-table tbody td:nth-child(8) {
    width: 3.25rem;
    max-width: 4rem;
    min-width: 0;
}
.version-form-page .sheet-process-table td:nth-child(1) .proc-style-type,
.version-form-page .sheet-process-table td:nth-child(2) .proc-process-type,
.version-form-page .sheet-process-table td:nth-child(3) .proc-machine-type,
.version-form-page .sheet-process-table td:nth-child(4) .proc-library-select {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
}
.version-form-page .sheet-process-table .proc-code,
.version-form-page .sheet-process-table .proc-name,
.version-form-page .sheet-process-table .proc-unit-price {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
}
.version-form-page .sheet-process-table td:nth-child(6) .proc-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.version-form-page .sheet-process-table td.proc-library-cell {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}
/* Sheet6 操作列：删除为小标签样式，单行横向展示 */
.version-form-page .sheet-process-table td.proc-op-cell {
    white-space: nowrap;
    vertical-align: middle;
}
.version-form-page .sheet-process-table .btn-del-process-tag {
    display: inline-block;
    margin: 0;
    padding: 2px 10px;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 500;
    color: #b91c1c;
    background: #fff;
    border: 1px solid #fecaca;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
}
.version-form-page .sheet-process-table .btn-del-process-tag:hover {
    background: #fef2f2;
    border-color: #f87171;
    color: #991b1b;
}

/* Sheet7 成本核算：固定左列（成本项）+ 数据列居中 */
.version-form-page .costing-matrix-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
}
.version-form-page .sheet-costing-table {
    min-width: 420px;
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}
.version-form-page .sheet-costing-table caption {
    caption-side: top;
    padding: 0.35rem 0.5rem 0.5rem;
}
.version-form-page .sheet-costing-table > thead > tr > th,
.version-form-page .sheet-costing-table > tbody > tr > th,
.version-form-page .sheet-costing-table > tbody > tr > td,
.version-form-page .sheet-costing-table > tfoot > tr > th {
    border: 1px solid #cbd5e1;
    vertical-align: middle;
    padding: 0.45rem 0.5rem;
}
.version-form-page .sheet-costing-table .costing-col-label {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 10rem;
    min-width: 10rem;
    max-width: 10rem;
    box-sizing: border-box;
    text-align: center;
    font-weight: 600;
    background: #f1f5f9;
    color: #1e293b;
    border-right: 2px solid #94a3b8 !important;
}
.version-form-page .sheet-costing-table thead .costing-col-label {
    z-index: 4;
    background: #e2e8f0;
}
.version-form-page .sheet-costing-table tfoot .costing-col-label {
    z-index: 3;
    background: #e2e8f0;
}
.version-form-page .sheet-costing-table .costing-col-data {
    min-width: 4.25rem;
    text-align: center;
}
.version-form-page .sheet-costing-table tbody tr.costing-row-fabric th.costing-col-label {
    font-weight: 500;
}
.version-form-page .sheet-costing-table tbody tr.costing-row-loss th.costing-col-label {
    font-weight: 500;
    color: #64748b;
}
.version-form-page .sheet-costing-table tbody tr.costing-row-mat-subtotal th.costing-col-label {
    font-weight: 600;
    background: #e8eef4;
}
.module-lite-sheet-root .sheet-costing-table tbody tr.costing-row-loss th.costing-col-label {
    color: #64748b;
}
.module-lite-sheet-root .sheet-costing-table tbody tr.costing-row-mat-subtotal th.costing-col-label {
    font-weight: 600;
    background: #e8eef4;
}
.version-form-page .sheet-costing-table tbody td.costing-col-data {
    color: #475569;
}
.version-form-page .sheet-costing-table tfoot th.costing-col-data {
    color: #0f172a;
}
/* BOM Sheet5：按母料系数时「用量」只读灰底（JS 可附加 .bom-unit-usage-readonly 或设 readonly） */
.version-form-page .bom-item-modal-root #bom-m-unit-usage.bom-unit-usage-readonly,
.version-form-page .bom-item-modal-root #bom-m-unit-usage[readonly] {
    background-color: #e9ecef;
    cursor: not-allowed;
}

/* ========== 版单模块轻量页：默认只读 + 编辑门禁；返回工作台按钮强调 ========== */
.jiayu-module-sheet-gate[data-sheet-locked="1"] #sheetPanes[inert],
.jiayu-module-sheet-gate.module-lite-page--viewing #sheetPanes[inert] {
    border-radius: 8px;
    background-color: #f3f4f6;
    box-shadow: inset 0 0 0 1px #e5e7eb;
}
.jiayu-module-sheet-gate[data-sheet-locked="1"] #sheetPanes[inert] input,
.jiayu-module-sheet-gate[data-sheet-locked="1"] #sheetPanes[inert] select,
.jiayu-module-sheet-gate[data-sheet-locked="1"] #sheetPanes[inert] textarea,
.jiayu-module-sheet-gate.module-lite-page--viewing #sheetPanes[inert] input,
.jiayu-module-sheet-gate.module-lite-page--viewing #sheetPanes[inert] select,
.jiayu-module-sheet-gate.module-lite-page--viewing #sheetPanes[inert] textarea {
    background-color: #e5e7eb !important;
    color: #6b7280 !important;
}
#btn-add-bom[aria-disabled="true"] {
    opacity: 0.88;
    cursor: pointer;
}
a.btn-module-lite-back,
a.btn.btn-module-lite-back {
    background-color: #eff6ff !important;
    border-color: #2563eb !important;
    color: #1d4ed8 !important;
    font-weight: 600 !important;
}
a.btn-module-lite-back:hover,
a.btn.btn-module-lite-back:hover {
    background-color: #dbeafe !important;
    border-color: #1d4ed8 !important;
    color: #1e3a8a !important;
}

/* ========== BOM 按物料：左 4 列 + 中间横向滚动 + 右 4 列固定 ========== */
/* 档案行：仅在整页只读（锁版单 / 工作台浏览态）时淡化行底；可编辑时与新行一致 */
.version-form-page[data-sheet-locked="1"] .bom-material-table-split tbody tr.bom-row--from-archive > td,
.jiayu-module-sheet-gate.module-lite-page--viewing .bom-material-table-split tbody tr.bom-row--from-archive > td,
body.is-locked .bom-material-table-split tbody tr.bom-row--from-archive > td {
    background-color: #f8fafc !important;
}
.bom-material-table-split tbody tr.bom-row--from-archive .bom-archive-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 10px;
    line-height: 1.35;
    font-weight: 500;
    color: #475569;
    background: #e2e8f0;
    border-radius: 4px;
    vertical-align: middle;
    white-space: nowrap;
}
.bom-material-table-split tbody tr.bom-row--from-archive .btn-bom-peise:disabled,
.bom-material-table-split tbody tr.bom-row--from-archive .btn-bom-peima:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.version-form-page .bom-split-table-root {
    position: relative;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    /* 勿 overflow:hidden：会裁切左列原生 select（物料类型）的系统下拉层，表现为「一闪即关」 */
    overflow: visible;
}
.jiayu-module-sheet-gate .bom-split-table-root {
    overflow: visible;
}
.version-form-page .bom-split-x-scroll {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}
.version-form-page .bom-material-table-split {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
    /* auto：避免 fixed + 多维固定列时出现列宽折叠、只读格里文字竖向折叠 */
    table-layout: auto;
}
.version-form-page .bom-material-table-split th,
.version-form-page .bom-material-table-split td {
    padding: 0.3rem 0.35rem;
    vertical-align: middle;
    border-bottom: 1px solid #f3f4f6;
    background: #fff;
    box-sizing: border-box;
}
.version-form-page .bom-material-table-split thead th {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}
.version-form-page .bom-material-table-split .bom-split-mid-cell {
    min-width: 4.5rem;
}
.version-form-page .bom-material-table-split .bom-split-mid-cell--wide {
    min-width: 7rem;
}
.version-form-page .bom-material-table-split .bom-split-mid-cell--spec {
    min-width: 6.5rem;
}
.version-form-page .bom-material-table-split .bom-split-mid-cell--peibi {
    min-width: 5.5rem;
}
.version-form-page .bom-material-table-split .bom-mid-col-color,
.jiayu-module-sheet-gate .bom-material-table-split .bom-mid-col-color {
    min-width: 4.25rem;
    max-width: 7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}
.version-form-page .bom-material-table-split .bom-mid-col-color .bom-cell-ro,
.jiayu-module-sheet-gate .bom-material-table-split .bom-mid-col-color .bom-cell-ro {
    text-align: center;
}
/* 季节列：与颜色列同为短文本，整列居中 */
.version-form-page .bom-material-table-split thead th.bom-mid-col-season,
.version-form-page .bom-material-table-split tbody td.bom-mid-col-season,
.jiayu-module-sheet-gate .bom-material-table-split thead th.bom-mid-col-season,
.jiayu-module-sheet-gate .bom-material-table-split tbody td.bom-mid-col-season {
    text-align: center;
}
.version-form-page .bom-material-table-split .bom-mid-col-season .bom-cell-ro,
.jiayu-module-sheet-gate .bom-material-table-split .bom-mid-col-season .bom-cell-ro {
    text-align: center;
}
.version-form-page .bom-material-table-split .bom-split-mid-cell--usage {
    min-width: 5.75rem;
}
.version-form-page .bom-material-table-split input.bom-inline-unit-usage {
    max-width: 7rem;
    text-align: right;
}

/* 固定用量：列表用量列内联正整数输入（不再使用改用量弹窗）；与「(固定)」同一行、输入框收窄 */
.bom-material-table-split .bom-inline-fixed-usage {
    width: 3.25rem;
    max-width: 3.5rem;
    min-width: 2.75rem;
    flex: 0 0 auto;
    box-sizing: border-box;
    text-align: right;
}
.bom-material-table-split .bom-inline-purchase-price {
    max-width: 6.5rem;
    min-width: 4.5rem;
    text-align: right;
}
.bom-material-table-split .bom-fixed-usage-inline {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.25rem;
}
.bom-material-table-split .bom-fixed-usage-inline .bom-fixed-usage-label {
    flex-shrink: 0;
    white-space: nowrap;
    line-height: 1.2;
}
.version-form-page .bom-material-table-split .form-control-sm,
.version-form-page .bom-material-table-split .form-select-sm,
.jiayu-module-sheet-gate .bom-material-table-split .form-control-sm,
.jiayu-module-sheet-gate .bom-material-table-split .form-select-sm {
    font-size: 12px;
    padding: 0.2rem 0.35rem;
    min-height: 30px;
    height: 30px;
}
.version-form-page .bom-material-table-split .select2-container,
.jiayu-module-sheet-gate .bom-material-table-split .select2-container {
    font-size: 12px;
}
.version-form-page .bom-material-table-split .select2-container .select2-selection--single,
.jiayu-module-sheet-gate .bom-material-table-split .select2-container .select2-selection--single {
    height: 30px;
    padding: 2px 6px;
}
.version-form-page .bom-material-table-split .select2-container .select2-selection__rendered,
.jiayu-module-sheet-gate .bom-material-table-split .select2-container .select2-selection__rendered {
    line-height: 24px;
    padding-left: 2px;
    font-size: 12px;
    font-weight: 400;
}
.version-form-page .bom-material-table-split .select2-container .select2-selection__arrow,
.jiayu-module-sheet-gate .bom-material-table-split .select2-container .select2-selection__arrow {
    height: 28px;
}
/* 左固定：序号 → 类型 → 名称 → 供应商 */
.version-form-page .bom-material-table-split .bom-lc1 {
    position: sticky;
    left: 0;
    z-index: 4;
    min-width: 2.5rem;
    width: 2.5rem;
    text-align: center;
    box-shadow: 2px 0 4px rgba(15, 23, 42, 0.06);
}
.version-form-page .bom-material-table-split .bom-lc2 {
    position: sticky;
    left: 2.5rem;
    z-index: 4;
    min-width: 5.5rem;
    width: 5.5rem;
    box-shadow: 2px 0 4px rgba(15, 23, 42, 0.06);
}
/* 物料名称列：长名称易截断，11rem 过窄；与左侧 lc1+lc2 衔接后 lc4 的 left = 8rem + 本列最大宽 */
.version-form-page .bom-material-table-split .bom-lc3 {
    position: sticky;
    left: 8rem;
    z-index: 4;
    min-width: 15rem;
    width: 18rem;
    max-width: 18rem;
    box-shadow: 2px 0 4px rgba(15, 23, 42, 0.06);
}
/* 物料名称列：面料档案子类徽标（坯布 / 染整 / 加工）与物料下拉同一行左右排列（含模块轻量壳） */
.version-form-page .bom-material-table-split .bom-lc3 .bom-mat-name-cell,
.jiayu-module-sheet-gate .bom-material-table-split .bom-lc3 .bom-mat-name-cell {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px 8px;
    min-width: 0;
    max-width: 100%;
}
.version-form-page .bom-material-table-split .bom-lc3 .bom-mat-name-cell > .bom-stage-badge,
.jiayu-module-sheet-gate .bom-material-table-split .bom-lc3 .bom-mat-name-cell > .bom-stage-badge {
    flex-shrink: 0;
    align-self: center;
}
.version-form-page .bom-material-table-split .bom-lc3 .bom-mat-name-cell > .select2-container,
.jiayu-module-sheet-gate .bom-material-table-split .bom-lc3 .bom-mat-name-cell > .select2-container {
    flex: 1 1 0;
    min-width: 0;
}
/* 未挂 Select2 时由原生 select 占满剩余宽；挂 Select2 后由 .select2-container 承担（hidden select 不参与 flex） */
.version-form-page .bom-material-table-split .bom-lc3 .bom-mat-name-cell > select.bom-inline-mat-select:not(.select2-hidden-accessible),
.jiayu-module-sheet-gate .bom-material-table-split .bom-lc3 .bom-mat-name-cell > select.bom-inline-mat-select:not(.select2-hidden-accessible) {
    flex: 1 1 0;
    min-width: 0;
}
/* Select2 在固定宽列内占满，减少未必要省略；悬停见全文仍依赖 option 文本 */
.version-form-page .bom-material-table-split .bom-lc3 .select2-container {
    max-width: 100%;
}
.version-form-page .bom-material-table-split .bom-lc3 .select2-container .select2-selection--single {
    max-width: 100%;
}
.version-form-page .bom-material-table-split .bom-lc3 .select2-container .select2-selection__rendered {
    max-width: 100%;
    box-sizing: border-box;
    padding-right: 1.5rem;
}
/* 物料名称 Select2（Select2-bootstrap 主题常默认 1rem）：与整张表统一 12px / 常规字重 */
.version-form-page .bom-material-table-split .bom-lc3 .select2-container .select2-selection--single,
.jiayu-module-sheet-gate .bom-material-table-split .bom-lc3 .select2-container .select2-selection--single {
    font-size: 12px;
    font-weight: 400;
}
.version-form-page .bom-material-table-split .bom-lc3 .select2-container .select2-selection__rendered,
.jiayu-module-sheet-gate .bom-material-table-split .bom-lc3 .select2-container .select2-selection__rendered {
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 24px !important;
}
.version-form-page .bom-stage-badge {
    display: inline-block;
    align-self: flex-start;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
}
.version-form-page .bom-stage-badge--dyeing {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.version-form-page .bom-stage-badge--greige {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fdba74;
}
.version-form-page .bom-stage-badge--process {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}
.version-form-page .bom-board-grid-table .bom-board-mat-cell {
    vertical-align: top;
}
.version-form-page .bom-board-grid-table .bom-board-mat-cell .bom-stage-badge {
    margin-right: 6px;
    vertical-align: middle;
}
.version-form-page .bom-board-grid-table .bom-mat-col .bom-stage-badge {
    margin-right: 6px;
    vertical-align: middle;
}
.version-form-page .bom-material-table-split .bom-lc4 {
    position: sticky;
    left: 26rem;
    z-index: 4;
    min-width: 6.5rem;
    width: 6.5rem;
    max-width: 6.5rem;
    box-shadow: 2px 0 4px rgba(15, 23, 42, 0.06);
}
/* 左固定列：类型(8rem) → 物料名(8–26rem) → 供应商(26rem)，与表头 DOM 顺序一致 */
.version-form-page .bom-material-table-split thead th.bom-lc1,
.version-form-page .bom-material-table-split thead th.bom-lc2,
.version-form-page .bom-material-table-split thead th.bom-lc3,
.version-form-page .bom-material-table-split thead th.bom-lc4 {
    z-index: 5;
    background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
}
/* 右固定：用量 → 总量 → 总价 → 操作；用量与总量同为只读汇总列 */
.version-form-page .bom-material-table-split .bom-rc-usage,
.jiayu-module-sheet-gate .bom-material-table-split .bom-rc-usage {
    position: sticky;
    right: 19rem;
    z-index: 3;
    min-width: 6.75rem;
    width: 6.75rem;
    max-width: 9rem;
    text-align: right;
    box-shadow: -2px 0 4px rgba(15, 23, 42, 0.06);
    background: #fff;
    vertical-align: middle;
}
.version-form-page .bom-material-table-split .bom-rc-usage .bom-cell-usage-display,
.jiayu-module-sheet-gate .bom-material-table-split .bom-rc-usage .bom-cell-usage-display {
    max-width: 100%;
    white-space: nowrap;
    text-align: right;
    display: block;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
}
.version-form-page .bom-material-table-split .bom-rc-usage .bom-cell-usage-display small,
.jiayu-module-sheet-gate .bom-material-table-split .bom-rc-usage .bom-cell-usage-display small {
    font-size: 11px;
    font-weight: 400;
}
.version-form-page .bom-material-table-split .bom-rc-ops {
    position: sticky;
    right: 0;
    z-index: 6;
    min-width: 10.5rem;
    width: 10.5rem;
    max-width: 10.5rem;
    text-align: center;
    box-shadow: -2px 0 4px rgba(15, 23, 42, 0.06);
    background: #fff;
    vertical-align: middle;
}
.version-form-page .bom-material-table-split .bom-rc2 {
    position: sticky;
    right: 10.5rem;
    z-index: 5;
    min-width: 4.25rem;
    width: 4.25rem;
    text-align: right;
    box-shadow: -2px 0 4px rgba(15, 23, 42, 0.06);
    background: #fff;
    vertical-align: middle;
    white-space: nowrap;
}
.version-form-page .bom-material-table-split .bom-rc1 {
    position: sticky;
    right: 14.75rem;
    z-index: 4;
    /* rc2(4.25) → rc1(4.25)：用量 sticky right = 10.5+4.25+4.25 = 19rem；勿单独加宽以免错位 */
    min-width: 4.25rem;
    width: 4.25rem;
    text-align: right;
    box-shadow: -2px 0 4px rgba(15, 23, 42, 0.06);
    background: #fff;
    vertical-align: middle;
    white-space: nowrap;
}
.version-form-page .bom-material-table-split .bom-rc1.bom-cell-total-qty,
.jiayu-module-sheet-gate .bom-material-table-split .bom-rc1.bom-cell-total-qty {
    font-size: 12px;
    white-space: nowrap;
}
.version-form-page .bom-material-table-split thead th.bom-rc-usage,
.version-form-page .bom-material-table-split thead th.bom-rc1,
.version-form-page .bom-material-table-split thead th.bom-rc2,
.version-form-page .bom-material-table-split thead th.bom-rc-ops,
.jiayu-module-sheet-gate .bom-material-table-split thead th.bom-rc-usage,
.jiayu-module-sheet-gate .bom-material-table-split thead th.bom-rc1,
.jiayu-module-sheet-gate .bom-material-table-split thead th.bom-rc2,
.jiayu-module-sheet-gate .bom-material-table-split thead th.bom-rc-ops {
    z-index: 7;
    background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
    /* 表体仍为数字右对齐；表头标题居中 */
    text-align: center !important;
}
.version-form-page .bom-material-table-split .bom-cell-ro {
    display: inline-block;
    max-width: 10rem;
    color: #4b5563;
    font-size: 12px;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}
/* BOM 物料表操作列：与「按码矩阵」同级的紧凑字号，避免实心主色块撑高换行 */
.version-form-page .bom-row-actions .bom-btn-compact {
    padding: 0.28rem 0.55rem;
    font-size: 12px;
    line-height: 1.25;
    white-space: nowrap;
    min-width: 0;
}
.version-form-page .bom-row-actions {
    justify-content: center;
    flex-wrap: wrap;
    row-gap: 4px;
    column-gap: 4px;
}
.version-form-page .bom-btn-del-icon {
    color: #9ca3af;
    padding: 0;
    min-width: 2rem;
    min-height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 999px;
}
.version-form-page .bom-btn-del-icon:hover {
    color: #dc2626;
    background: #fef2f2;
}

/* 配色/配码弹窗：隐藏主录入块，保留配比方式 + 应用范围 + 工艺链 */
#bomItemModal.bom-modal--scope-only #bom-modal-primary-block {
    display: none !important;
}
#bomItemModal.bom-modal--scope-only .bom-item-modal-hint {
    display: none !important;
}
#bomItemModal.bom-modal--scope-only #bom-modal-save-add-next {
    display: none !important;
}

/* 成品面料卷重三参：行内表「卷重」按钮 — 卷重块在 #bom-modal-primary-block 内，不可整块隐藏 */
#bomItemModal.bom-modal--roll-only #bom-modal-dist-row,
#bomItemModal.bom-modal--roll-only #bom-scope-section,
#bomItemModal.bom-modal--roll-only #bom-process-chain-wrap {
    display: none !important;
}
#bomItemModal.bom-modal--roll-only .bom-item-modal-hint {
    display: none !important;
}
#bomItemModal.bom-modal--roll-only #bom-modal-save-add-next {
    display: none !important;
}
#bomItemModal.bom-modal--roll-only #bom-m-legacy-category-wrap,
#bomItemModal.bom-modal--roll-only .bom-bom-row-1,
#bomItemModal.bom-modal--roll-only .bom-bom-row-1 + .mb-3,
#bomItemModal.bom-modal--roll-only .bom-bom-row-2,
#bomItemModal.bom-modal--roll-only .bom-bom-row-3,
#bomItemModal.bom-modal--roll-only #bom-m-coefficient-wrap {
    display: none !important;
}
#bomItemModal.bom-modal--roll-only #bom-m-finished-roll-wrap {
    display: flex !important;
}

/* 版单列表（style_list）：锁定原因说明 */
.card-lock-reason {
    font-size: 12px;
    line-height: 1.4;
    color: #6b7280;
    margin: 6px 0 4px;
    padding: 6px 8px;
    background: #f3f4f6;
    border-radius: 6px;
}
.style-list-lock-reason {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.35;
    color: #6b7280;
    max-width: 16rem;
}

/* 样衣制作列表：锁定角标与卡片弱化 */
.sample-card {
    position: relative;
}
.sample-card--locked {
    opacity: 0.92;
    filter: saturate(0.9);
}
.sample-card-lock-icon {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.sample-card-lock-reason {
    margin-bottom: 6px;
}

/* Sheet5：委外染色 / 按码矩阵 / 委外工艺弹窗（与 admin-modal.is-open 联动） */
.version-form-page .bom-matrix-modal-content,
.bom-matrix-modal-content {
    max-width: 920px;
    width: calc(100vw - 2rem);
    max-height: calc(100vh - 3rem);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}
.version-form-page .bom-matrix-modal-content.bom-matrix-modal--narrow,
.bom-matrix-modal-content.bom-matrix-modal--narrow {
    max-width: 520px;
}
.version-form-page .bom-matrix-modal .bom-modal-body,
.bom-matrix-modal .bom-modal-body {
    min-height: 0;
    overflow-y: auto;
}
.version-form-page .bom-matrix-modal .erp-table-standard th,
.bom-matrix-modal .erp-table-standard th {
    font-size: 12px;
    color: #6b7280;
}
.version-form-page .bom-matrix-modal .erp-table-standard td,
.bom-matrix-modal .erp-table-standard td {
    vertical-align: middle;
}

/* 委外染色弹窗：上下文（部位 / 坯布 / 供应商 / 配色范围） */
.bom-dye-matrix-header-main {
    min-width: 0;
    flex: 1;
    padding-right: 0.75rem;
}
.bom-dye-matrix-context {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.25rem;
    margin-top: 0.35rem;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}
.bom-dye-ctx-item {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    max-width: 100%;
}
.bom-dye-ctx-k {
    color: #9ca3af;
    flex-shrink: 0;
}
.bom-dye-ctx-k::after {
    content: "：";
}
.bom-dye-ctx-v {
    color: #374151;
    font-weight: 500;
    word-break: break-word;
}
#bomDyeMatrixModal.is-dye-view-mode .bom-dye-color-pick-list .bom-dye-color-cb {
    pointer-events: none;
    opacity: 0.65;
}

/* 委外染色：先勾选颜色 */
.bom-dye-color-pick-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding: 0.5rem 0;
}
.bom-dye-color-pick-list .form-check {
    margin-bottom: 0;
    min-width: 7rem;
}
.bom-dye-color-pick-list .form-check-input {
    margin-top: 0.35rem;
}
.bom-dye-color-pick-list .bom-dye-color-option.is-dye-color-locked .form-check-label {
    color: #9ca3af;
    cursor: not-allowed;
}
.bom-dye-color-pick-list .bom-dye-color-option.is-dye-color-locked .form-check-input:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}
.bom-dye-color-pick-list .bom-dye-color-option.is-dye-color-owned .form-check-label {
    font-weight: 500;
}

/* 委外染色弹窗：适中宽度 + 数字列可读（损耗/染费勿压成 50px） */
.version-form-page .bom-matrix-modal-content.bom-matrix-modal--dye,
.bom-matrix-modal-content.bom-matrix-modal--dye {
    max-width: 920px;
}
#bomDyeMatrixModal .erp-table-standard {
    table-layout: fixed;
    width: 100%;
}
#bomDyeMatrixModal .erp-table-standard th:nth-child(1),
#bomDyeMatrixModal .erp-table-standard td:nth-child(1) {
    width: 12%;
}
#bomDyeMatrixModal .erp-table-standard th:nth-child(2),
#bomDyeMatrixModal .erp-table-standard td:nth-child(2) {
    width: 22%;
}
#bomDyeMatrixModal .erp-table-standard th:nth-child(3),
#bomDyeMatrixModal .erp-table-standard td:nth-child(3) {
    width: 16%;
}
#bomDyeMatrixModal .erp-table-standard th:nth-child(4),
#bomDyeMatrixModal .erp-table-standard td:nth-child(4) {
    width: 12%;
}
#bomDyeMatrixModal .erp-table-standard th:nth-child(5),
#bomDyeMatrixModal .erp-table-standard td:nth-child(5) {
    width: 14%;
}
#bomDyeMatrixModal .erp-table-standard th:nth-child(6),
#bomDyeMatrixModal .erp-table-standard td:nth-child(6) {
    width: 24%;
}
#bomDyeMatrixModal .bom-dye-in-process,
#bomDyeMatrixModal .bom-dye-in-supplier {
    width: 100%;
    font-size: 14px;
    height: 30px;
}
#bomDyeMatrixModal .bom-dye-matrix-color {
    font-size: 14px;
    color: #111827;
    padding-right: 0.5rem;
}
#bomDyeMatrixModal .bom-dye-in-loss,
#bomDyeMatrixModal .bom-dye-in-price {
    width: 100%;
    min-width: 5.5rem;
    max-width: none;
    box-sizing: border-box;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    text-align: right;
    padding: 0.25rem 0.5rem;
    height: 30px;
}
#bomDyeMatrixModal .bom-dye-in-pc {
    width: 100%;
    font-size: 14px;
    height: 30px;
}
#bomDyeMatrixModal .erp-table-standard th:nth-child(4),
#bomDyeMatrixModal .erp-table-standard th:nth-child(5) {
    text-align: right;
}
#bomDyeMatrixModal .bom-cell-dye-fee-hint {
    color: #6b7280;
    font-size: 12px;
}

/* RD1 · 版单列表卡片视图（style_list #cardView）— L1 密度 + erp-badge */
.dev-style-list-page .dev-style-list-view-toggle {
    margin-left: auto;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.dev-style-list-page .dev-style-list-view-toggle-label {
    font-size: 12px;
    color: #6b7280;
}
.dev-style-list-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}
.dev-style-list-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
}
.dev-style-list-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.dev-style-list-card--locked {
    opacity: 0.92;
    filter: saturate(0.9);
}
.dev-style-list-card-cover {
    aspect-ratio: 4 / 3;
    background: #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.dev-style-list-card-cover-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.dev-style-list-card-cover-img--hidden {
    display: none;
}
.dev-style-list-card-cover-placeholder {
    color: #9ca3af;
    font-size: 12px;
}
.dev-style-list-card-cover-placeholder--hidden {
    display: none;
}
.dev-style-list-card-body {
    padding: 12px 16px;
    flex: 1;
    min-width: 0;
}
.dev-style-list-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
    cursor: pointer;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dev-style-list-card-meta {
    margin-bottom: 8px;
}
.dev-style-list-card-lock-line {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    min-width: 0;
}
.dev-style-list-card-lock-text {
    font-size: 12px;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.dev-style-list-card-code {
    font-size: 12px;
    color: #6b7280;
}
.dev-style-list-card-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 8px 16px;
    background: #f9fafb;
    border-top: 1px solid #f3f4f6;
}
.dev-style-list-cards-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #9ca3af;
    padding: 48px 16px;
    font-size: 14px;
}
