:root {
    --bg: #eef2f6;
    --panel: #ffffff;
    --ink: #1c2430;
    --muted: #6b7785;
    --line: #d7dee7;
    --accent: #1f6b4a;
    --accent-soft: #e6f3ec;
    --danger: #b42318;
    --shadow: 0 10px 30px rgba(28, 36, 48, 0.08);
    --radius: 12px;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(31, 107, 74, 0.10), transparent 40%),
        linear-gradient(180deg, #f7fafc 0%, var(--bg) 100%);
    color: var(--ink);
    min-height: 100%;
}

.app-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: #132033;
    color: #e8eef7;
    padding: 28px 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}

.brand-mark {
    display: inline-flex;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2f9e6b, #1f6b4a);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.brand-name {
    font-size: 15px;
    font-weight: 600;
}

.sidebar-user {
    margin: -12px 0 18px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    font-size: 13px;
    line-height: 1.4;
}

.sidebar-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.beian-footer {
    margin: 18px 0 0;
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
    color: #6b7785;
}

.beian-footer a {
    color: inherit;
    text-decoration: none;
}

.beian-footer a:hover {
    text-decoration: underline;
}

.sidebar-footer .beian-footer {
    margin: 10px 0 0;
    font-size: 11px;
    color: #8a97a8;
}

.empty-layout {
    min-height: 100vh;
}

.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(31, 107, 74, 0.16), transparent 42%),
        linear-gradient(180deg, #f7fafc 0%, var(--bg) 100%);
}

.login-card {
    width: min(400px, 100%);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 24px 22px;
}

.login-brand {
    text-align: center;
    margin-bottom: 18px;
}

.login-brand h1 {
    margin: 12px 0 4px;
    font-size: 22px;
}

.login-brand .brand-mark {
    margin: 0 auto;
}

.nav-item {
    display: block;
    color: #c4d0de;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 6px;
}

.nav-item.active, .nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.nav-item.nav-quick {
    background: rgba(47, 158, 107, 0.22);
    color: #fff;
    font-weight: 600;
    margin-bottom: 4px;
}

.nav-item.nav-quick.active,
.nav-item.nav-quick:hover {
    background: rgba(47, 158, 107, 0.38);
    color: #fff;
}

.nav-item.nav-quick-sub {
    margin-bottom: 12px;
    font-size: 13px;
}

.mps-hub-tabs {
    display: flex;
    gap: 8px;
    margin: 0 0 12px;
    padding: 0;
}

.mps-hub-tab {
    border: 1px solid var(--line, #d0d7e2);
    background: #fff;
    color: #334155;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 14px;
    cursor: pointer;
}

.mps-hub-tab.active {
    background: #1f3a5f;
    border-color: #1f3a5f;
    color: #fff;
    font-weight: 600;
}

/* ===== 工序收发 · 桌面宽屏 ===== */
.mps-desk {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 0 28px;
    box-sizing: border-box;
}

.mps-desk-split {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.mps-desk-split.dual {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.mps-desk-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.mps-desk-side {
    display: block;
    width: 100%;
    min-width: 0;
}

.mps-process-banner {
    margin: 0;
}

.mps-process-banner .panel-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: baseline;
    margin: 0;
}

.mps-process-banner-name {
    font-size: 18px;
    font-weight: 700;
    color: #1f3a5f;
}

.mps-desk .mps-scan-panel .panel-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px 16px;
    margin-bottom: 12px;
}

.mps-desk .mps-scan-panel .panel-toolbar strong {
    font-size: 15px;
}

.mps-desk .mps-scan-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: stretch;
}

.mps-desk .mps-scan-row .mso-input,
.mps-desk .mps-scan-row .input {
    min-height: 40px;
    font-size: 15px !important;
    border-radius: 8px;
}

.mps-desk .mps-scope {
    flex: 0 1 220px;
    min-width: 160px;
}

.mps-desk .mps-scan-row > .mso-input[data-mps-scan],
.mps-desk .mps-scan-row > input[data-mps-scan] {
    flex: 1 1 320px;
    min-width: 240px;
    max-width: 520px;
}

.mps-desk > .mso-card,
.mps-desk-main > .mso-card {
    background: var(--panel, #fff);
    border: 1px solid var(--line, #e5e7eb);
    border-radius: 10px;
    padding: 16px 18px;
    box-shadow: none;
}

.mps-desk .mso-card-head {
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 650;
}

.mps-desk .mso-field {
    margin-bottom: 10px;
}

.mps-desk .mso-input {
    min-height: 38px;
    font-size: 14px !important;
    border-radius: 8px;
}

.mps-desk .mps-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--line, #e5e7eb);
    position: sticky;
    bottom: 0;
    background: #fff;
    z-index: 5;
}

.mps-desk .mps-actions .btn {
    flex: 0 0 auto;
    min-width: 140px;
    min-height: 40px;
}

.mps-desk .mso-row2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 720px;
}

.mps-desk .mso-row3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 900px;
}

@media (min-width: 1280px) {
    .mps-desk .mps-ship-list,
    .mps-desk .mps-hist {
        max-height: calc(100vh - 280px);
        overflow: auto;
    }
}

.nav-group {
    margin-bottom: 8px;
}

.nav-group-title {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 0;
    background: transparent;
    color: #8fa3b8;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: none;
    padding: 8px 12px 6px;
    cursor: pointer;
    border-radius: 8px;
}

.nav-group-title::after {
    content: "▸";
    font-size: 11px;
    opacity: 0.8;
    transition: transform 0.15s ease;
}

.nav-group.open .nav-group-title::after {
    transform: rotate(90deg);
}

.nav-group-title:hover {
    color: #d7e3f0;
    background: rgba(255, 255, 255, 0.04);
}

.nav-group-body {
    padding-left: 4px;
}

.nav-group-body .nav-item {
    padding: 8px 12px;
    margin-bottom: 2px;
    font-size: 13px;
}

.content {
    padding: 28px 32px 48px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 18px;
}

.page-header h1 {
    margin: 0 0 6px;
    font-size: 28px;
    letter-spacing: 0.02em;
}

.subtitle {
    margin: 0;
    color: var(--muted);
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: visible;
}

.panel-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.table-wrap {
    overflow: visible;
    padding-bottom: 8px;
}

.table-scroll {
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 72px; /* ????????????????? */
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th, td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    vertical-align: middle;
}

td.thumb-cell {
    position: relative;
    overflow: visible;
    z-index: 1;
}

td.thumb-cell:hover {
    z-index: 50;
}

th {
    background: #f6f8fb;
    color: #445266;
    font-weight: 600;
}

code {
    background: var(--accent-soft);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 6px;
    font-family: Consolas, "Courier New", monospace;
}

.actions { white-space: nowrap; }

.btn {
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover { filter: brightness(1.05); }

.btn-secondary {
    background: #e8eef5;
    color: #243247;
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    font-size: 22px;
    line-height: 1;
}

.btn-link {
    background: transparent;
    color: var(--accent);
    padding: 4px 8px;
}

.btn-link.danger { color: var(--danger); }

.input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 11px;
    font-size: 14px;
    background: #fff;
}

.input.search { max-width: 320px; }

.input:focus {
    outline: 2px solid rgba(31, 107, 74, 0.25);
    border-color: var(--accent);
}

.select-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.form-grid {
    display: grid;
    gap: 14px;
}

.form-grid label {
    display: grid;
    gap: 6px;
    font-size: 13px;
    color: #445266;
}

.form-grid em {
    color: var(--danger);
    font-style: normal;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 40, 0.45);
    display: grid;
    place-items: center;
    padding: 20px;
    z-index: 20;
}

.modal {
    width: min(640px, 100%);
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.modal-wide { width: min(760px, 100%); }
.modal-fg-opening {
    width: min(96vw, 1180px);
    max-height: 94vh;
    height: 94vh;
    display: flex;
    flex-direction: column;
    margin: 3vh auto;
}
.modal-fg-opening .modal-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.fg-opening-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}
.modal-fg-opening .fg-opening-table-scroll {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
}
.fg-op-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.fg-op-row {
    display: grid;
    grid-template-columns: 86px 1fr;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line, #d8e0e6);
    border-radius: 8px;
    background: #fff;
    overflow: visible;
    position: relative;
}
.fg-op-row.is-checked {
    border-color: #8ec4a8;
    background: #f7fbf8;
}
.fg-op-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 2;
}
.fg-op-check {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #445;
    white-space: nowrap;
}
.fg-op-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: visible;
    position: relative;
    z-index: 1;
}
.fg-op-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    align-items: end;
    overflow: visible;
}
.fg-op-f {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    position: relative;
    overflow: visible;
}
.fg-op-f > span {
    font-size: 11px;
    color: #6b7785;
    line-height: 1;
    white-space: nowrap;
}
.fg-op-f .input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    font-size: 13px;
    height: 30px;
    padding: 3px 7px;
}
.fg-op-f-name { flex: 2.2 1 180px; }
.fg-op-f-sm { flex: 0.7 1 72px; max-width: 110px; }
.fg-op-f-num { flex: 0.75 1 78px; max-width: 118px; }
.fg-op-f-stone { flex: 1.6 1 160px; }
.fg-op-f-cert { flex: 1.2 1 120px; }
.fg-op-f-own { flex: 0.55 1 72px; max-width: 96px; }
.fg-op-f-cust { flex: 1 1 120px; max-width: 180px; }
.fg-op-f-remark { flex: 0.9 1 90px; max-width: 140px; }
.fg-op-stone-box {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 0 8px;
    border: 1px solid var(--line, #d8e0e6);
    border-radius: 6px;
    background: #f8faf9;
}
.fg-opening-stone-summary {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #445;
}
.fg-opening-stone-edit {
    padding: 8px 10px;
    background: #f7f9f8;
    border: 1px solid var(--line, #d8e0e6);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.fg-op-stone-slot {
    padding: 8px;
    background: #fff;
    border: 1px solid #e5e9ef;
    border-radius: 8px;
}
.fg-op-stone-slot-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.fg-op-stone-qty {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 72px;
}
.fg-op-stone-qty > span {
    font-size: 11px;
    color: #6b7785;
}
.fg-op-stone-qty .input {
    height: 28px;
    font-size: 12px;
    padding: 2px 6px;
}
.fg-op-stone-slot .stock-cascade {
    gap: 8px;
}
.fg-op-stone-slot .stock-cascade-field {
    min-width: 0;
}
.fg-opening-thumb-wrap {
    position: relative;
    display: inline-block;
    outline: none;
}
.fg-opening-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    background: #eef2f6;
    cursor: zoom-in;
    border: 1px solid #dce3ea;
}
.fg-opening-thumb-empty {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    background: #eef2f6;
    border: 1px dashed #c5ced8;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8a97a5;
    font-size: 11px;
}
.fg-opening-file {
    width: 72px;
    font-size: 10px;
}
.fg-opening-pick {
    position: relative;
    width: 100%;
}
.fg-opening-pick-btn {
    width: 100%;
    padding: 3px 4px !important;
    font-size: 11px !important;
    white-space: nowrap;
}
.fg-opening-pick-drop {
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 60;
    width: min(420px, 72vw);
    max-height: 320px;
    margin-top: 2px;
}
.fg-opening-pick-mini {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: #eef1f5;
}
.fg-opening-hover-preview {
    position: fixed;
    z-index: 12100;
    pointer-events: none;
    padding: 6px;
    background: #fff;
    border: 1px solid #cfd8e3;
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(20, 40, 70, 0.28);
}
.fg-opening-hover-preview img {
    display: block;
    width: 220px;
    height: 220px;
    object-fit: contain;
    background: #f7f9fb;
    border-radius: 4px;
}
.fg-opening-img-zoom {
    position: fixed;
    inset: 0;
    z-index: 12000;
    background: rgba(20, 28, 36, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    cursor: zoom-out;
}
.fg-opening-img-zoom img {
    max-width: min(92vw, 960px);
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0,0,0,.35);
    background: #fff;
}
@media (max-width: 900px) {
    .fg-op-row {
        grid-template-columns: 1fr;
    }
    .fg-op-side {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    .fg-opening-pick {
        width: auto;
    }
}

.modal-sm { width: min(420px, 100%); }

/* 错误提示须盖在业务弹窗之上，否则「保存失败」看起来像没反应 */
.fe-alert-backdrop {
    z-index: 10050;
}

.fe-alert-body {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
    color: #334155;
}

.form-grid-2 {
    grid-template-columns: 1fr 1fr;
}

.form-grid-2 .span-2 {
    grid-column: 1 / -1;
}

@media (max-width: 700px) {
    .form-grid-2 { grid-template-columns: 1fr; }
    .form-grid-2 .span-2 { grid-column: auto; }
}

.modal-header, .modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.modal-footer {
    border-bottom: none;
    border-top: 1px solid var(--line);
    justify-content: flex-end;
    gap: 8px;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.modal-body { padding: 16px; }

.lookup-list {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
}

.lookup-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.alert {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 8px;
}

.alert-ok {
    background: #e8f7ef;
    color: #17663f;
}

.alert-error {
    background: #fdecec;
    color: var(--danger);
}

.muted { color: var(--muted); }
.center { text-align: center; }

.doc-audit-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border, #e5e7eb);
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}
.doc-audit-meta.compact {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
.doc-audit-item { display: inline-flex; gap: 6px; align-items: baseline; }
.doc-audit-label { color: var(--muted); }
.doc-audit-value { color: var(--text, #334155); }
.doc-audit-sep { opacity: 0.45; }

.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
}

.modal-xl { width: min(1100px, 100%); }

.page-header-action { white-space: nowrap; }

/* —— 产品资料开窗（桌面宽屏） —— */
.product-modal-backdrop {
    padding: 28px 36px;
    align-items: center;
    background: rgba(15, 23, 35, 0.52);
    backdrop-filter: blur(2px);
}

.modal-product {
    width: min(1420px, 96vw);
    max-height: min(92vh, 980px);
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(15, 23, 35, 0.22);
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
}

.product-modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.product-modal-header h2 {
    margin: 0;
    font-size: 20px;
    letter-spacing: 0.02em;
}

.product-modal-sub {
    margin: 4px 0 0;
    font-size: 13px;
}

.modal-product .modal-body.product-editor {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 20px 24px;
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.9fr);
    gap: 20px;
    align-items: start;
}

.product-main {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.editor-section {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 18px 18px;
    box-shadow: 0 1px 0 rgba(28, 36, 48, 0.03);
}

.file-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 0;
}

.file-panel {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    background: #f7faf8;
}

.file-panel-title {
    font-size: 13px;
    font-weight: 650;
    color: #243247;
    margin-bottom: 4px;
}

.file-path-hint {
    margin: 0 0 10px;
    font-size: 12px;
    line-height: 1.4;
}

.file-drop {
    display: grid;
    place-items: center;
    min-height: 140px;
    cursor: pointer;
    border-radius: 10px;
    background: #fff;
    border: 1px dashed #b7c4b8;
    padding: 12px;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.file-drop:hover {
    border-color: var(--accent);
    background: #f3faf6;
}

.file-drop-lg {
    min-height: 200px;
}

.file-drop-placeholder {
    display: grid;
    gap: 6px;
    text-align: center;
}

.file-drop-placeholder strong {
    font-size: 14px;
    color: #243247;
}

.preview-zoom img {
    max-width: 100%;
    max-height: 220px;
    object-fit: contain;
}

.modal-product .process-panel {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
    background: linear-gradient(180deg, #f4faf6 0%, #eef6f1 100%);
    min-height: 520px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
}

.modal-product .process-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.modal-product .process-header h3 {
    margin: 0;
    font-size: 15px;
}

.process-header-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
}

.modal-product .process-add {
    margin: 0 0 12px;
}

.modal-product .process-list {
    flex: 1;
    overflow: auto;
    max-height: none;
}

.modal-product .process-list li {
    box-shadow: 0 1px 2px rgba(28, 36, 48, 0.04);
}

.product-modal-footer {
    padding: 14px 24px;
    background: #fff;
    border-top: 1px solid var(--line);
    gap: 10px;
}

.modal-footer-check { margin-right: auto; }

.btn-save {
    min-width: 108px;
    padding: 10px 20px;
    font-weight: 600;
}

@media (max-width: 1180px) {
    .modal-product .modal-body.product-editor {
        grid-template-columns: 1fr;
    }

    .modal-product .process-panel {
        position: static;
        min-height: 360px;
    }
}

/* —— 产品资料工作台（桌面三栏 + 扫码） —— */
.pw-page {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: calc(100vh - 56px);
}

.pw-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 14px;
    background: linear-gradient(180deg, #eef6ff 0%, #e8f2fb 100%);
    border: 1px solid #c9ddf0;
    border-radius: 12px;
}

.pw-brand {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-right: 6px;
    min-width: 120px;
}

.pw-brand strong {
    font-size: 16px;
    color: #1c2430;
}

.pw-filter {
    width: 150px;
    background: #fff;
}

.pw-scan {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 360px;
    min-width: 280px;
    background: #fff;
    border: 1px solid #9ec0e0;
    border-radius: 10px;
    padding: 4px 6px 4px 10px;
}

.pw-scan-ico {
    color: #2f6fed;
    font-size: 14px;
}

.pw-scan .input {
    border: none;
    box-shadow: none;
    outline: none;
    padding: 8px 6px;
}

.pw-scan .input:focus {
    outline: none;
    border: none;
}

.pw-alert { margin: 0; }

.pw-workspace {
    display: grid;
    grid-template-columns: 280px minmax(0, 1.5fr) 320px;
    gap: 12px;
    align-items: stretch;
    flex: 1;
    min-height: 0;
}

.pw-list-pane,
.pw-detail-pane,
.pw-side-pane {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    min-height: 640px;
    overflow: hidden;
}

.pw-list-pane,
.pw-side-pane {
    display: flex;
    flex-direction: column;
}

.pw-pane-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    background: #f6f8fb;
    border-bottom: 1px solid var(--line);
    font-weight: 650;
    font-size: 13px;
}

.pw-pane-head .input-sm {
    max-width: 140px;
    padding: 6px 8px;
    font-size: 12px;
}

.pw-list {
    overflow: auto;
    flex: 1;
    padding: 8px;
}

.pw-list-item {
    width: 100%;
    display: flex;
    gap: 10px;
    align-items: center;
    text-align: left;
    border: 1px solid transparent;
    background: #fff;
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 6px;
    cursor: pointer;
}

.pw-list-item:hover { background: #f5f8fc; }
.pw-list-item.active {
    border-color: #7eb0ef;
    background: #eef5ff;
}

.pw-list-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #f3f5f4;
    display: grid;
    place-items: center;
    overflow: hidden;
    flex-shrink: 0;
}

.pw-list-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pw-list-meta { min-width: 0; }
.pw-list-name {
    font-weight: 650;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pw-list-sub {
    font-size: 12px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pw-empty { padding: 28px 12px; }

.pw-detail-pane {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: auto;
}

.pw-placeholder {
    margin: auto;
    text-align: center;
    padding: 48px 24px;
}

.pw-placeholder h2 { margin: 0 0 8px; font-size: 20px; }

.pw-detail-head {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 16px;
    align-items: start;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfcfd;
}

.pw-hero-drop {
    display: grid;
    place-items: center;
    width: 180px;
    height: 180px;
    border: 1px dashed #b7c4b8;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
}

.pw-hero-drop:hover {
    border-color: var(--accent);
    background: #f3faf6;
}

.pw-hero-drop img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pw-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.pw-title-row h2 {
    margin: 0;
    font-size: 22px;
}

.pw-drawing-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.pw-form-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    background: #fff;
}

.pw-save-btn {
    width: 100%;
    min-height: 48px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 10px;
    letter-spacing: 0.04em;
}

.pw-side-pane {
    gap: 12px;
    background: transparent;
    border: none;
    overflow: auto;
}

.pw-side-card {
    background: #fff;
    border: 1px solid #9ec0e0;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    min-height: 280px;
    overflow: hidden;
}

.pw-side-card .pw-pane-head {
    background: #eef5ff;
    border-bottom-color: #c9ddf0;
}

.pw-process-list {
    padding: 8px;
    overflow: auto;
    flex: 1;
    max-height: 420px;
}

.pw-summary {
    min-height: 0;
    border-color: #e2c48a;
}

.pw-summary .pw-pane-head {
    background: #fff8e8;
    border-bottom-color: #f0dfb0;
}

.pw-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
}

.pw-summary-grid > div {
    background: #fffdf8;
    border: 1px solid #f0e2bd;
    border-radius: 8px;
    padding: 8px 10px;
}

.pw-summary-grid span {
    display: block;
    font-size: 12px;
    color: var(--muted);
}

.pw-summary-grid strong {
    font-size: 16px;
    color: #c45c12;
}

.pw-summary .check-row,
.pw-summary .btn-link {
    margin: 0 12px 12px;
}

.editor-section-title {
    font-size: 14px;
    font-weight: 650;
    color: #243247;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef2f6;
}

.product-form label > span {
    font-size: 12px;
    color: #5b6b7a;
    font-weight: 500;
}

.product-form .input {
    padding: 10px 12px;
    min-height: 40px;
}

.form-grid-3 .span-2 { grid-column: span 2; }

.process-add {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 10px 12px;
}

.process-add-manual {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.process-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.process-list li {
    display: grid;
    grid-template-columns: auto auto 1fr auto auto;
    gap: 8px;
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: grab;
}

.process-empty {
    display: grid !important;
    place-items: center;
    min-height: 100px;
    cursor: default !important;
    border-style: dashed !important;
    background: #f8fafc !important;
}

@media (max-width: 1280px) {
    .pw-workspace {
        grid-template-columns: 240px minmax(0, 1fr) 280px;
    }
}


.file-hidden { display: none; }

/* —— 响应式：销售开单等页 desktop/mobile 切换 —— */
@media (min-width: 901px) {
    .mobile-only { display: none !important; }
}
@media (max-width: 900px) {
    .desktop-only { display: none !important; }
}

.product-card-thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #f3f5f4;
    overflow: hidden;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.product-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: zoom-in;
}
.product-card-title { font-weight: 650; font-size: 14px; margin-bottom: 2px; }
.product-card-code { font-size: 12px; }
.product-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 6px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted, #6b7c74);
}
.product-card-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.img-preview-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(15, 23, 20, 0.72);
    display: grid;
    place-items: center;
    padding: 24px;
}
.img-preview-backdrop img {
    max-width: min(920px, 92vw);
    max-height: min(86vh, 920px);
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
}
.img-preview-close {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2001;
}

.thumb-zoom, .preview-zoom {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

.thumb-zoom img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    object-position: center;
    border-radius: 6px;
    background: #f3f5f4;
    border: 1px solid var(--line);
    display: block;
    cursor: zoom-in;
}

/* 全站智能放大缩略图 */
.smart-img {
    position: relative;
    display: inline-grid;
    place-items: center;
    vertical-align: middle;
    overflow: hidden;
    border-radius: 6px;
    background: #f3f5f4;
    border: 1px solid var(--line);
    cursor: zoom-in;
    width: var(--smart-size, 64px);
    height: var(--smart-size, 64px);
    flex-shrink: 0;
}
.smart-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    pointer-events: none;
}
.smart-img-preview { width: var(--smart-size, 88px); height: var(--smart-size, 88px); }
.smart-img-hero {
    width: var(--smart-size, 120px);
    height: var(--smart-size, 120px);
    border-radius: 10px;
}
.smart-img-mini {
    width: var(--smart-size, 40px);
    height: var(--smart-size, 40px);
    border-radius: 4px;
}
.smart-img-card {
    width: var(--smart-size, 64px);
    height: var(--smart-size, 64px);
}
.smart-img-fill {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: inherit;
    background: transparent;
}

.product-card-thumb .smart-img,
.pb-thumb .smart-img,
.cx-list-thumb .smart-img,
.cx-hero .smart-img {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: inherit;
}

.pb-thumb { overflow: visible; } /* 允许智能放大浮层 */

/* 悬停放大：fixed 浮层，不受表格 overflow 裁切 */
.img-flyout {
    position: fixed;
    z-index: 1200;
    pointer-events: none;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}

.img-flyout img {
    display: block;
    max-width: min(360px, 70vw);
    max-height: min(360px, 70vh);
    object-fit: contain;
    border-radius: 6px;
}

.process-cell {
    min-width: 220px;
    max-width: 420px;
}

.process-seq {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 2px;
    line-height: 1.5;
    font-size: 13px;
    color: var(--ink);
}

.process-step {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px 2px 4px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 500;
    white-space: nowrap;
}

.process-step-num {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}

.process-arrow {
    color: #9aa7b5;
    font-size: 12px;
    padding: 0 2px;
}

.drawing-cell {
    min-width: 140px;
    max-width: 220px;
}

.drawing-name {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
    word-break: break-all;
}

.drawing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.file-link {
    color: #0f766e;
    text-decoration: underline;
    word-break: break-all;
    cursor: pointer;
}

.file-link.btn-as-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
}

.file-meta {
    margin-top: 8px;
    font-size: 13px;
}

.drag-handle { color: #9aa7b5; letter-spacing: -2px; }
.process-order {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.process-name {
    font-weight: 500;
    color: var(--ink);
}

.check-inline {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #445266;
}

@media (max-width: 900px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { padding: 16px; }
    .content { padding: 18px; }
    .page-header { flex-direction: column; align-items: stretch; }
}


/* ���� ���?��� ���� */
.so-header { margin-bottom: 14px; }
.so-header-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
}
.so-header-fields {
    flex: 1 1 auto;
    min-width: 0;
}
.so-header-remark {
    flex: 0 0 clamp(160px, 22%, 280px);
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 140px;
}
.so-header-remark > span,
.so-header .form-grid-6 label > span {
    font-size: 12px;
    color: var(--muted, #5b6b66);
    white-space: nowrap;
}
.so-workspace {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 14px;
    margin-bottom: 14px;
    align-items: start;
}
.so-editor-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.so-editor-title h2,
.so-history-title {
    margin: 0;
    font-size: 16px;
    font-weight: 650;
}
.so-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 16px 0 8px;
}
.so-section-head h3 { margin: 0; font-size: 14px; }
.so-process-add {
    display: grid;
    grid-template-columns: 1.2fr 1fr auto;
    gap: 8px;
    width: min(100%, 520px);
}
.so-materials, .so-processes { margin-top: 8px; }
.so-editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.so-process-list { margin-top: 8px; }
.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.form-grid-3 .span-3 { grid-column: 1 / -1; }
.form-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 12px;
}
.form-grid-4 .span-2 { grid-column: span 2; }
.form-grid-4 .span-4 { grid-column: 1 / -1; }
.form-grid-6 {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px 12px;
}
.form-grid-6 .span-6 { grid-column: 1 / -1; }
.so-image-upload {
    display: grid;
    gap: 8px;
}
.so-file-drop {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.so-hist-block {
    border: 1px solid var(--line, #d7dedb);
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
    background: #fff;
}
.so-hist-head {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f3f7f5;
    border-bottom: 1px solid var(--line, #d7dedb);
}
.so-hist-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 13px;
}
.so-hist-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.so-hist-table { width: 100%; }
.so-hist-lines {
    display: grid;
    gap: 8px;
    padding: 10px;
}
.so-cell-title { font-weight: 600; }
.so-cell-sub {
    font-size: 12px;
    color: var(--muted, #5b6b66);
    margin-top: 2px;
}
.so-route-text {
    font-size: 12px;
    line-height: 1.45;
    max-width: 220px;
    word-break: break-word;
}
.so-qty-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: #fff3e6;
    color: #c45c12;
    font-weight: 650;
    font-size: 13px;
}
tr.row-active td { background: color-mix(in srgb, var(--accent, #2f6fed) 12%, transparent); }

@media (max-width: 1200px) {
    .so-workspace { grid-template-columns: 1fr; }
    .form-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid-3 { grid-template-columns: 1fr 1fr; }
    .form-grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .so-header-row { flex-direction: column; }
    .so-header-remark { flex: 1 1 auto; width: 100%; min-width: 0; }
    .form-grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .form-grid-3 { grid-template-columns: 1fr; }
    .form-grid-4 { grid-template-columns: 1fr; }
    .form-grid-4 .span-2 { grid-column: auto; }
    .form-grid-6 { grid-template-columns: 1fr 1fr; }
    .so-process-add { grid-template-columns: 1fr; width: 100%; }
    .so-hist-actions .btn { flex: 1; }
    .so-hist-actions { width: 100%; }
    .so-hist-actions a.btn { text-align: center; }
}

/* ���� ����������?����� + ��?��?� ���� */
.route-block { margin-top: 16px; }
.route-hint, .route-pool-label, .route-current-label {
    font-size: 13px;
    color: var(--muted, #5b6b66);
    margin: 8px 0 6px;
}
.route-hint { color: var(--text, #1d2a26); font-weight: 600; }
.route-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 12px;
    border: 1px dashed #9eb7ef;
    border-radius: 10px;
    background: #f7f9fd;
}
.route-pool-btn {
    appearance: none;
    border: 1px solid #3b78e7;
    color: #2f6fed;
    background: #fff;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    line-height: 1.2;
}
.route-pool-btn:hover { background: #eef4ff; }
.route-pool-manage { margin-left: auto; }
.route-current {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    min-height: 52px;
    padding: 12px;
    border: 1px dashed #9eb7ef;
    border-radius: 10px;
    background: #f7f9fd;
}
.route-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #2f6fed;
    color: #fff;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 13px;
    cursor: grab;
    user-select: none;
    touch-action: none;
}
.route-chip:active { cursor: grabbing; }
.route-chip-text { white-space: nowrap; }
.route-chip-x {
    appearance: none;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    opacity: 0.9;
}
.route-chip-x:hover { opacity: 1; }
.route-chip-mobile-move { display: none; }
.so-draft-thumb { display: grid; gap: 6px; }
.so-draft-thumb > span { font-size: 13px; color: var(--muted, #5b6b66); }
.so-line-cards, .so-history-cards, .so-picker-cards {
    display: grid;
    gap: 10px;
}
.so-line-card {
    border: 1px solid var(--line, #d7dedb);
    border-radius: 10px;
    padding: 12px;
    background: #fff;
}
.so-line-card-top {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 10px;
    align-items: start;
    margin-bottom: 10px;
}

@media (max-width: 900px) {
    .route-pool-manage { margin-left: 0; width: 100%; }
    .route-chip {
        width: 100%;
        justify-content: space-between;
        cursor: default;
    }
    .route-chip-mobile-move {
        display: inline-flex;
        gap: 4px;
    }
    .route-chip-mobile-move .btn-link { color: #fff; }
}

/* �� ??? / ?? �� */
.so-wo-nos { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.so-wo-no {
    color: #1d4ed8;
    font-weight: 650;
    font-size: 12px;
}
.print-shell {
    min-height: 100vh;
    background: #f4f6f5;
    padding: 16px;
}
.print-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
}
.print-sheet {
    max-width: 980px;
    margin: 0 auto 20px;
    background: #fff;
    border: 1px solid #d7dedb;
    border-radius: 8px;
    padding: 18px 20px;
}
.so-receipt-meta {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 10px 18px;
    font-size: 12px;
}
.so-receipt-meta > div {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    flex: 0 1 auto;
    min-width: 0;
}
.so-receipt-meta > div > span {
    display: inline;
    color: #6b7a75;
    font-size: 12px;
    white-space: nowrap;
}
.so-receipt-meta > div > strong {
    font-weight: 600;
    white-space: nowrap;
}
.so-receipt-remark { margin-top: 10px; font-size: 13px; }
.so-receipt-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 14px;
    font-size: 13px;
}
.so-receipt-table th,
.so-receipt-table td {
    border: 1px solid #d7dedb;
    padding: 8px;
    vertical-align: top;
}
.so-receipt-table th { background: #f3f7f5; }
.print-thumb {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
}
.so-receipt-foot {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}
.so-sign-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.proc-slip-sub {
    margin: 18px 0 8px;
    font-size: 15px;
    font-weight: 650;
}

.proc-slip-totals {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 14px;
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid #d7dedb;
    border-radius: 8px;
    background: #f8fbf9;
    font-size: 13px;
}

.proc-slip-totals > div > span {
    display: block;
    color: #6b7a75;
    font-size: 12px;
    margin-bottom: 2px;
}

.proc-slip-totals b {
    font-size: 14px;
}

.so-receipt-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.so-receipt-title-row h1 {
    margin: 0;
    font-size: 22px;
    text-align: left;
}
.so-receipt-codes,
.wo-codes,
.receipt-wo-qrs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: flex-end;
}
.code-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #5b6b66;
}
.code-box img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    background: #fff;
}
.code-box-sm img {
    width: 56px;
    height: 56px;
}
.code-box-barcode {
    align-items: flex-start;
}
.barcode-wrap {
    background: #fff;
    line-height: 0;
}
.barcode-wrap svg {
    max-width: 100%;
    height: auto;
}
.wo-sheet {
    max-width: 210mm;
    margin: 0 auto 16px;
    background: #fff;
    border: 1px solid #d7dedb;
    border-radius: 8px;
    padding: 14px 16px;
    page-break-after: always;
}
.wo-sheet-a5-landscape {
    min-height: 140mm;
}
.wo-sheet-head {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) minmax(160px, 1.1fr) minmax(280px, 1.4fr);
    gap: 14px 18px;
    align-items: start;
    border-bottom: 1px solid #d7dedb;
    padding-bottom: 12px;
    margin-bottom: 14px;
}
.wo-title-block h1 {
    margin: 0;
    font-size: 22px;
}
.wo-no {
    font-size: 16px;
    font-weight: 700;
    color: #1d4ed8;
    margin-top: 8px;
}
.wo-sheet-meta {
    font-size: 13px;
    display: grid;
    gap: 8px;
}
.wo-sheet-meta label,
.wo-info-grid label {
    display: inline-block;
    min-width: 4.5em;
    color: #6b7a75;
    margin-right: 6px;
}
.wo-body {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 16px 20px;
    margin-bottom: 14px;
    align-items: start;
}
.wo-img {
    width: 120px;
    height: 120px;
    border: 1px solid #d7dedb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f7f9f8;
}
.wo-img img { width: 100%; height: 100%; object-fit: contain; }
.wo-info { font-size: 13px; }
.wo-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
}
.wo-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 24px;
}
.wo-info-grid > div {
    padding: 4px 0;
    border-bottom: 1px dotted #e3e8e6;
}
.wo-qty-row { grid-column: 1 / -1; }
.wo-qty {
    font-size: 22px;
    font-weight: 700;
    color: #c45c12;
}
.wo-req {
    margin-top: 12px;
    padding: 8px 10px;
    background: #fff8f0;
    border-radius: 6px;
    color: #8a3b12;
    line-height: 1.5;
}
.wo-route {
    border-top: 1px dashed #d7dedb;
    padding-top: 12px;
    margin-bottom: 14px;
}
.wo-route-title {
    font-size: 13px;
    font-weight: 650;
    margin-bottom: 8px;
}
.wo-route-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    align-items: center;
    font-size: 13px;
}
.wo-step {
    background: #eef4ff;
    color: #1d4ed8;
    border-radius: 6px;
    padding: 4px 10px;
}
.wo-arrow { color: #8aa0c2; }
.wo-foot {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 13px;
    border-top: 1px solid #d7dedb;
    padding-top: 12px;
}

@media (max-width: 900px) {
    .so-receipt-meta { flex-wrap: wrap; }
    .proc-slip-totals { grid-template-columns: 1fr 1fr; }
    .wo-sheet-head { grid-template-columns: 1fr; }
    .wo-body { grid-template-columns: 96px 1fr; }
    .wo-info-grid { grid-template-columns: 1fr; }
}

@media print {
    .no-print { display: none !important; }
    .print-shell {
        background: #fff;
        padding: 0;
        min-height: 0 !important;
        height: auto !important;
    }
    .print-sheet, .wo-sheet {
        border: 0;
        border-radius: 0;
        box-shadow: none;
        max-width: none;
        margin: 0;
    }
    .wo-sheet-a5-landscape {
        width: 210mm;
        min-height: 148mm;
        page-break-after: always;
        break-after: page;
    }
    .so-receipt-meta {
        flex-wrap: nowrap !important;
        gap: 6px 12px !important;
        font-size: 10px !important;
    }
    .so-receipt-meta > div > span { font-size: 10px !important; }
}

/* —— 可视化工单看板 —— */
.pb-toolbar { gap: 12px; flex-wrap: wrap; }
.pb-filter { width: auto; min-width: 132px; max-width: 180px; }
.pb-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 12px 12px;
}
.pb-sum-chip {
    border: 1px solid #d7dedb;
    background: #f7faf8;
    color: #3d524a;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
}
.pb-sum-chip:hover { background: #eef4f0; }
.pb-sum-chip.active { border-color: #2f6fed; background: #eef4ff; color: #1d4ed8; }
.pb-sum-overdue { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.pb-sum-overdue.active { border-color: #b91c1c; background: #fee2e2; }
.pb-sum-recv { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.pb-sum-recv.active { border-color: #1d4ed8; }
.pb-sum-ship { border-color: #fdba74; background: #fff7ed; color: #c2410c; }
.pb-sum-ship.active { border-color: #c2410c; }
.pb-list { display: grid; gap: 10px; }
.pb-card {
    background: #fff;
    border: 1px solid var(--line, #d7dedb);
    border-radius: 12px;
    padding: 10px 12px;
}
.pb-card-overdue { border-color: #fca5a5; box-shadow: inset 3px 0 0 #ef4444; }
.pb-card-recv:not(.pb-card-overdue) { box-shadow: inset 3px 0 0 #3b82f6; }
.pb-card-child {
    border-left: 3px solid #93c5fd;
    background: #fcfdff;
}
.pb-toggle {
    padding: 0 4px;
    min-width: 22px;
    font-size: 11px;
}
.pb-branch {
    color: #94a3b8;
    font-size: 12px;
    width: 18px;
    text-align: center;
}
.pb-split {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #eef4ff;
    color: #1d4ed8;
    font-weight: 650;
}
/* 左产品资料 · 右工序 */
.pb-card-row {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: 12px 16px;
    align-items: stretch;
}
.pb-card-left {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 10px;
    align-content: start;
    min-width: 0;
    padding-right: 12px;
    border-right: 1px solid var(--line, #e2e8e4);
}
.pb-card-right {
    min-width: 0;
    display: flex;
    align-items: stretch;
}
.pb-thumb {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    border: 1px solid var(--line, #d7dedb);
    background: #f5f7f6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}
.pb-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pb-info { min-width: 0; }
.pb-title-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 4px;
}
.pb-title-row h2 { margin: 0; font-size: 15px; line-height: 1.3; }
.pb-status {
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 999px;
    font-weight: 650;
}
.pb-status-pending { background: #fff3e6; color: #c45c12; }
.pb-status-doing { background: #eef4ff; color: #1d4ed8; }
.pb-status-done { background: #e8f7ee; color: #15803d; }
.pb-status-other { background: #eee; color: #555; }
.pb-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 10px;
    font-size: 12px;
    color: #44534e;
    margin-top: 2px;
    line-height: 1.45;
}
.pb-qty { font-weight: 700; color: #c45c12; }
.pb-alert {
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 999px;
    font-weight: 700;
}
.pb-alert-overdue { background: #fee2e2; color: #b91c1c; }
.pb-alert-recv { background: #dbeafe; color: #1d4ed8; }
.pb-delivery-overdue { color: #b91c1c; font-weight: 700; }
.pb-progress-wrap { margin-top: 8px; }
.pb-progress-bar {
    height: 8px;
    border-radius: 999px;
    background: #e8ece9;
    overflow: hidden;
}
.pb-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #3b82f6, #22c55e);
    transition: width .2s ease;
}
.pb-progress-text {
    margin-top: 4px;
    font-size: 12px;
    color: #44534e;
    line-height: 1.4;
}
.pb-req {
    margin-top: 6px;
    padding: 6px 8px;
    background: #fff8f0;
    border-radius: 6px;
    color: #8a3b12;
    font-size: 12px;
}
.pb-process-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: stretch;
    overflow-x: auto;
    padding-bottom: 2px;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}
.pb-step {
    flex: 0 0 200px;
    min-width: 180px;
    max-width: 240px;
    border: 1px solid var(--line, #d7dedb);
    border-radius: 10px;
    padding: 10px;
    background: #fafbfa;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pb-step-wait { border-color: #e2e8e4; }
.pb-step-ship { border-color: #93c5fd; background: #f8fbff; }
.pb-step-done { border-color: #86efac; background: #f3fdf6; }
.pb-step-skip { border-color: #d1d5db; background: #f3f4f6; opacity: 0.75; }
.pb-step-skipped .pb-step-name { text-decoration: line-through; }
.pb-step-current {
    border-color: #2f6fed;
    box-shadow: 0 0 0 2px rgba(47, 111, 237, 0.18);
}
.pb-step-warn {
    font-size: 11px;
    font-weight: 700;
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 3px 6px;
}
.pb-step-head {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 6px;
    align-items: center;
}
.pb-step-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2f6fed;
    color: #fff;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.pb-step-name { font-weight: 650; font-size: 13px; }
.pb-step-flag { font-size: 11px; color: #64748b; margin-left: auto; font-weight: 650; }
.pb-step-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.pb-chip {
    font-size: 11px;
    line-height: 1.2;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f1f5f3;
    color: #64748b;
}
.pb-chip-ship { background: #fff3e6; color: #c45c12; }
.pb-chip-recv { background: #eef4ff; color: #1d4ed8; }
.pb-chip-done { background: #e8f7ee; color: #15803d; }
.pb-step-body { font-size: 12px; line-height: 1.45; flex: 1; min-height: 0; }
.pb-xfer-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
    max-height: 160px;
    overflow: auto;
}
.pb-xfer {
    border: 1px solid #e8ece9;
    border-radius: 6px;
    padding: 5px 6px;
    background: #fff;
}
.pb-xfer-ship { border-left: 3px solid #f59e0b; }
.pb-xfer-recv { border-left: 3px solid #22c55e; }
.pb-xfer-top {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
}
.pb-xfer-kind { font-weight: 700; }
.pb-xfer-party {
    margin-top: 2px;
    display: flex;
    gap: 6px;
    color: #64748b;
    font-size: 11px;
}
.pb-arrow {
    flex: 0 0 auto;
    align-self: center;
    color: #94a3b8;
    font-weight: 700;
}

@media (max-width: 960px) {
    .pb-card-row {
        grid-template-columns: 1fr;
    }
    .pb-card-left {
        border-right: 0;
        border-bottom: 1px solid var(--line, #e2e8e4);
        padding-right: 0;
        padding-bottom: 10px;
    }
    .pb-step { flex-basis: 170px; }
}

/* —— 销售出库 —— */
.so-out-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    align-items: flex-end;
}
.so-out-toolbar .cx-field { margin: 0; }
.so-out-toolbar .cx-field > span { display: block; font-size: 12px; color: #64748b; margin-bottom: 2px; }
.so-out-scan {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: min(320px, 100%);
    flex: 1 1 220px;
}
.so-out-scan .input { flex: 1; min-width: 140px; }
.so-out-field-err {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.35;
    color: #b42318;
    font-weight: 650;
}
.so-out-gold-row {
    display: flex;
    gap: 6px;
    align-items: center;
}
.so-out-gold-row .input { flex: 1; min-width: 0; }
.so-out-gold-row .btn { flex: 0 0 auto; white-space: nowrap; }
.so-out-gold-hint {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.35;
}
.so-out-hist-editor {
    margin: 0 0 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fafbfc;
}
.so-out-adj-editor {
    border-color: #e2b57a;
    background: #fffaf2;
}
.so-out-adj-compare {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid #e2b57a;
    border-radius: 8px;
    background: #fff;
}
.so-out-adj-compare > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.so-out-adj-compare span {
    font-size: 12px;
    color: #666;
}
.so-out-adj-compare b {
    font-size: 15px;
}
.so-out-adj-compare .so-out-adj-delta b {
    color: #b45309;
}
.so-out-mod-tag {
    margin-top: 2px;
    font-size: 11px;
    font-weight: 650;
    color: #9a3412;
}
.so-out-hist-editor .so-out-piece-head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: center;
    margin-bottom: 10px;
}
.so-out-stone-table .input-sm {
    width: 88px;
    min-width: 72px;
    padding: 4px 6px;
    font-size: 12px;
}
.data-table tr.active-row td {
    background: #eef6ff;
}
.so-out-print-preview { position: relative; }
.so-out-preview-banner {
    margin: 0 0 8px;
    padding: 6px 10px;
    background: #fff7e6;
    border: 1px solid #f5d78e;
    color: #8a5a00;
    font-size: 12px;
    font-weight: 650;
}
.so-out-preview-mark {
    position: absolute;
    inset: 20% 10%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 72px;
    font-weight: 800;
    color: rgba(180, 40, 40, 0.12);
    transform: rotate(-24deg);
    pointer-events: none;
    z-index: 1;
    letter-spacing: 0.2em;
}
.so-out-print-foot {
    margin-top: 8px;
    font-size: 11px;
    color: #555;
    text-align: right;
}
.so-out-batch-mark {
    margin: 0 0 6px;
    padding: 4px 8px;
    font-size: 12px;
    color: #334155;
    background: #eef2ff;
    border-radius: 4px;
    display: inline-block;
}
.so-out-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}
.so-out-list { padding: 0; max-height: calc(100vh - 180px); overflow: auto; position: relative; z-index: 2; }
.so-out-cand-list { display: flex; flex-direction: column; }
.so-out-cand {
    display: grid;
    grid-template-columns: auto 40px 1fr;
    gap: 8px;
    width: 100%;
    text-align: left;
    border: 0;
    border-bottom: 1px solid var(--line, #e2e8e4);
    background: #fff;
    padding: 8px 10px;
    cursor: pointer;
    align-items: center;
    user-select: none;
}
.so-out-cand-check {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0;
}
.so-out-cand.selected { background: #f3faf5; }
.so-out-cand.active.selected { background: #eef4ff; }
.so-out-multi-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
}
.so-out-multi-tabs .so-out-wo-tab-warn {
    background: #fef2f2 !important;
    color: #b91c1c !important;
    border: 1px solid #f87171 !important;
    box-shadow: inset 0 0 0 1px rgba(185, 28, 28, 0.15);
}
.so-out-multi-tabs .so-out-wo-tab-warn.btn-primary {
    background: #dc2626 !important;
    color: #fff !important;
    border-color: #b91c1c !important;
}
.so-out-multi-tabs .so-out-wo-tab-ok:not(.btn-primary) {
    border-color: #86efac;
}
.so-out-wo-tab-mark {
    display: inline-block;
    font-weight: 700;
    margin-right: 2px;
}
.so-out-cand:hover { background: #f5f8f6; }
.so-out-cand.active { background: #eef4ff; outline: 2px solid #93c5fd; outline-offset: -2px; }
.so-out-cand-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 1px solid var(--line, #d7dedb);
    background: #f5f7f6;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.so-out-cand-thumb img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    display: block;
}
.so-out-cand-name { font-weight: 650; font-size: 13px; }
.so-out-cand-meta { min-width: 0; font-size: 12px; }
.so-out-editor { padding: 12px; position: relative; z-index: 1; }
.so-out-head { display: grid; gap: 12px; margin-bottom: 12px; }
.so-out-head-main { display: flex; gap: 10px; align-items: flex-start; }
.so-out-head-main h2 { margin: 0 0 4px; font-size: 16px; }
.so-out-head-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    border: 1px solid var(--line, #d7dedb);
    background: #f5f7f6;
    overflow: hidden;
    flex-shrink: 0;
}
.so-out-head-thumb .smart-img {
    width: 56px !important;
    height: 56px !important;
    max-width: 56px;
    max-height: 56px;
    border: 0;
}
.so-out-hist-thumb {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    overflow: hidden;
}
.so-out-hist-thumb .smart-img {
    width: 36px !important;
    height: 36px !important;
    max-width: 36px;
    max-height: 36px;
    border: 0;
}
.so-out-head-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
}
.so-out-balance {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    padding: 8px 10px;
    background: #f7faf8;
    border-radius: 8px;
    font-size: 13px;
}
.so-out-balance span { color: #64748b; margin-right: 6px; }
.so-out-pieces { display: grid; gap: 12px; }
.so-out-piece {
    border: 1px solid var(--line, #d7dedb);
    border-radius: 10px;
    padding: 10px 12px;
    background: #fcfdff;
}
.so-out-piece-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 8px;
}
.so-out-piece-head h3 { margin: 0; font-size: 14px; }
.so-out-piece-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}
.so-out-calc {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin: 8px 0;
    font-size: 12px;
    color: #334155;
}
.so-out-stone-table { font-size: 12px; }
.so-out-actions { margin-top: 12px; }
.so-out-print-product {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 8px 0 10px;
}
.so-out-print-img {
    width: 22mm;
    height: 22mm;
    border: 1px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.so-out-print-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
@media (max-width: 960px) {
    .so-out-layout { grid-template-columns: 1fr; }
}

.section-title { margin: 16px 0 8px; font-size: 15px; }
.input-xs { max-width: 88px; padding: 4px 6px; font-size: 12px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: #f5f8f6; }
.text-danger { color: #b42318; font-weight: 600; }
.input-warn {
    border-color: #f04438 !important;
    background: #fff5f5;
}
.cx-confirm-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 12px 0 8px;
}
.mini-thumb { width: 40px; height: 40px; object-fit: contain; }
.doc-flyout {
    position: fixed;
    z-index: 40;
    width: min(560px, 92vw);
    max-height: 46vh;
    overflow: auto;
    background: #fff;
    border: 1px solid var(--line, #d7dedb);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0,0,0,.12);
    padding: 10px 12px;
    pointer-events: auto;
}
.row-warn { background: #fff7ed; }
.doc-flyout-title { font-weight: 650; margin-bottom: 8px; font-size: 13px; }
.doc-flyout-wide {
    width: min(980px, 97vw);
    max-height: 62vh;
}
.doc-flyout-sub {
    margin: 10px 0 6px;
    font-size: 12px;
    font-weight: 650;
    color: #4a6358;
}
.table-compact { font-size: 12px; }
.table-compact th, .table-compact td { padding: 4px 6px; }
.emph { color: #c45c12; font-weight: 700; }
.sum-row { background: #f5f8f6; font-weight: 650; }

.doc-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    border: 1px solid #c5d4cc;
    background: #f3f7f5;
    color: #3d5a4c;
    font-size: 11px;
    font-weight: 650;
    cursor: help;
    vertical-align: middle;
    user-select: none;
}
.doc-hint:hover { background: #e4efe9; border-color: #9bb5a8; }

.modal-cast {
    width: min(1180px, 98vw);
    max-height: min(94vh, 980px);
    display: flex;
    flex-direction: column;
}
.modal-cast .modal-body {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

.seg-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 3px;
    margin: 12px 0 8px;
    background: #eef3f0;
    border-radius: 10px;
}
.seg-tab {
    border: 0;
    background: transparent;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #4a6358;
    cursor: pointer;
}
.seg-tab.active {
    background: #fff;
    color: #1f3d32;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.cast-line-list,
.settle-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cast-line-card,
.settle-card {
    border: 1px solid var(--line, #d7dedb);
    border-radius: 12px;
    padding: 12px;
    background: #fff;
}
.cast-line-card.warn,
.settle-card.warn {
    border-color: #f0c28a;
    background: #fffaf3;
}
.cast-line-head,
.settle-card-head {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 10px;
}
.cast-line-head .meta,
.settle-card-head .meta { min-width: 0; flex: 1; }
.cast-line-head .title,
.settle-card-head .title { font-weight: 650; font-size: 14px; }
.cast-fields,
.settle-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.settle-fields-edit {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.settle-calcs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--line, #d7dedb);
}
.field-box label {
    display: block;
    font-size: 12px;
    color: var(--muted, #6b7c74);
    margin-bottom: 4px;
}
.field-box .input,
.field-box select.input {
    width: 100%;
    max-width: none;
}
.field-box .val {
    font-size: 14px;
    font-weight: 650;
    min-height: 34px;
    display: flex;
    align-items: center;
}
.field-box .val.emph { color: #c45c12; }
.settle-total {
    margin-top: 8px;
    padding: 12px;
    border-radius: 10px;
    background: #f5f8f6;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    font-size: 13px;
}
.lookup-inline {
    display: flex;
    gap: 6px;
    align-items: center;
}
.lookup-inline select { flex: 1; min-width: 0; }
.lookup-inline .btn { white-space: nowrap; flex-shrink: 0; }

.stock-cascade {
    display: flex;
    flex-wrap: nowrap;
    gap: 14px 16px;
    align-items: flex-end;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
}
.stock-cascade-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 0 0 auto;
    width: 128px;
}
.stock-cascade-field > label {
    font-size: 12px;
    color: #5b6b7a;
    font-weight: 500;
    white-space: nowrap;
}
.stock-cascade-search {
    width: 140px;
}
.stock-cascade-item {
    width: 220px;
}
.stock-cascade-manage {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    padding-bottom: 2px;
    flex: 0 0 auto;
}
.stock-cascade-bal {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 12px;
    padding-bottom: 8px;
    flex: 0 0 auto;
    white-space: nowrap;
}
.stock-cascade-toggle {
    flex: 0 0 auto;
    padding-bottom: 2px;
    white-space: nowrap;
}

.stock-field-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    min-height: 18px;
}
.stock-field-label > label {
    margin: 0;
    font-size: 12px;
    color: #5b6b7a;
    font-weight: 500;
    white-space: nowrap;
}
.btn-gear {
    border: none;
    background: transparent;
    color: #7a8a9a;
    cursor: pointer;
    padding: 0 2px;
    font-size: 14px;
    line-height: 1;
    border-radius: 4px;
}
.btn-gear:hover {
    color: #243247;
    background: #eef2f6;
}
.btn-gear-lg {
    font-size: 22px;
    padding: 4px 8px;
    line-height: 1;
    color: #4a5560;
}
.btn-gear-lg:hover {
    color: #1a1a1a;
    background: #e8ecef;
}

.stock-in-panel .panel-toolbar {
    margin-bottom: 8px;
}
.setting-ship-in-modal .stock-in-bar {
    flex-wrap: wrap;
}
.setting-ship-in-radios {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 18px;
    margin-bottom: 12px;
    font-size: 13px;
}
.stock-in-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 12px 14px;
    overflow-x: auto;
    padding: 4px 2px 8px;
}
.stock-in-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 0 0 auto;
}
.stock-in-field > label {
    font-size: 12px;
    color: #5b6b7a;
    font-weight: 500;
    white-space: nowrap;
}
.stock-in-type { width: 100px; }
.stock-in-kind { width: 110px; }
.stock-in-cut { width: 100px; }
.stock-in-size { width: 100px; }
.stock-in-search { width: 120px; }
.stock-in-item { width: 200px; }
.stock-in-qty { width: 80px; }
.stock-in-weight { width: 100px; }
.stock-in-price { width: 110px; }
.stock-in-own { width: 90px; }
.stock-in-remark { width: 140px; }
.stock-form-name { width: 200px; }
.stock-form-unit { width: 72px; }
.stock-form-mm { width: 80px; }
.stock-form-active { width: 72px; }
.stock-form-check {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    font-size: 13px;
    color: #243247;
    white-space: nowrap;
}
.stock-form-image {
    width: 120px;
}
.stock-img-drop {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 72px;
    min-width: 72px;
    padding: 4px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #fafbfc;
    cursor: pointer;
}
.stock-img-drop:hover {
    border-color: var(--accent);
}
.stock-in-bal {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
    padding-bottom: 8px;
    white-space: nowrap;
    flex: 0 0 auto;
}
.stock-in-action {
    flex: 0 0 auto;
    padding-bottom: 1px;
}

.input-sm {
    max-width: none;
    min-width: 0;
    padding: 8px 10px;
    font-size: 14px;
}

/* 采购入库：数量/重量加大便于录入 */
.pin-qty-wt {
    width: 100%;
    min-width: 96px;
    min-height: 42px;
    padding: 10px 12px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* 采购入库：明细行金额 / 千足金即时预览 */
.pin-preview-amt,
.pin-preview-fine {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.pin-preview-amt { color: #1a5f4a; }
.pin-preview-fine { color: #8a6d1d; }
.pin-total-preview {
    font-size: 14px;
    color: #334155;
}
.pin-total-preview b {
    font-variant-numeric: tabular-nums;
    margin: 0 2px;
}

@media (max-width: 900px) {
    .cast-fields,
    .settle-fields,
    .settle-fields-edit,
    .settle-calcs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .desk-only-table { display: none !important; }
}
@media (min-width: 901px) {
    .mob-only-cards { display: none !important; }
}
    @media (max-width: 560px) {
    .cast-fields,
    .settle-fields,
    .settle-fields-edit,
    .settle-calcs {
        grid-template-columns: 1fr;
    }
    .seg-tabs { width: 100%; }
    .seg-tab { flex: 1; text-align: center; }
}

/* ── Cast exchange workspace (casting receive / ship) ── */
.cx-page {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.cx-alert { margin: 0; }

.cx-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    padding: 12px 14px;
    background: linear-gradient(180deg, #eef6f1 0%, #e6f0ea 100%);
    border: 1px solid #c5d9cc;
    border-radius: 12px;
}

.cx-toolbar-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    flex: 1 1 520px;
    align-items: flex-end;
}

.cx-field-check {
    min-width: 72px;
}
.cx-field-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 8px;
    accent-color: #0f766e;
    cursor: pointer;
}

.cx-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

.cx-field span {
    font-size: 12px;
    color: var(--muted);
}

.cx-field .input { min-width: 130px; }
.cx-field-wide { flex: 1 1 180px; min-width: 160px; }
.cx-field-wide .input { width: 100%; }

.cx-scan {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 320px;
    min-width: 280px;
    background: #fff;
    border: 1px solid #8fb89f;
    border-radius: 10px;
    padding: 4px 6px 4px 10px;
}

.cx-scan-ico {
    color: var(--accent);
    font-size: 14px;
}

.cx-scan .input {
    border: none;
    box-shadow: none;
    outline: none;
    padding: 8px 6px;
    flex: 1;
    min-width: 0;
}

.cx-workspace {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 320px;
    gap: 12px;
    align-items: stretch;
    min-height: 520px;
}

.cx-list-pane,
.cx-detail-pane,
.cx-side-pane {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    min-height: 520px;
    overflow: hidden;
}

.cx-list-pane,
.cx-side-pane {
    display: flex;
    flex-direction: column;
}

.cx-pane-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    background: #f6f8f6;
    border-bottom: 1px solid var(--line);
    font-weight: 650;
    font-size: 13px;
}


.cx-list-item.needs-edit {
    border-color: #e8a0a0;
    background: #fff8f8;
}

.cx-list-need {
    color: #c0392b;
    font-size: 11px;
    font-weight: 650;
    margin-top: 2px;
}
.cx-list-hint {
    padding: 6px 12px;
    font-size: 12px;
    border-bottom: 1px solid var(--line);
    background: #fafcfb;
}


.cx-tabs {
    display: inline-flex;
    gap: 2px;
    padding: 2px;
    background: #eef3f0;
    border-radius: 8px;
}

.cx-history-log-tabs {
    margin-top: 4px;
}

.cx-history-log-tabs > .cx-tabs {
    margin-bottom: 10px;
}

.cx-tab {
    border: 0;
    background: transparent;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #4a6358;
    cursor: pointer;
}

.cx-tab.active {
    background: #fff;
    color: #1f3d32;
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

.cx-list {
    overflow: auto;
    flex: 1;
    padding: 8px;
}

.cx-list-item {
    width: 100%;
    display: flex;
    gap: 10px;
    align-items: center;
    text-align: left;
    border: 1px solid transparent;
    background: #fff;
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    position: relative;
}

.cx-list-main {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 10px;
    align-items: center;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    cursor: pointer;
    text-align: left;
    color: inherit;
    font: inherit;
}

.cx-list-item:hover { background: #f5f8f6; }
.cx-list-item.selected { border-color: #a8c9b8; background: #f3f9f5; }
.cx-list-item.active {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 1px rgba(31, 107, 74, 0.15);
}

.cx-list-thumb {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #f3f5f4;
    display: grid;
    place-items: center;
    overflow: hidden;
    flex-shrink: 0;
}

.cx-list-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cx-list-meta { min-width: 0; flex: 1; }
.cx-list-name {
    font-weight: 650;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cx-list-sub {
    font-size: 12px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cx-check {
    color: var(--accent);
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.cx-empty { padding: 28px 12px; }

.cx-detail-pane {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: auto;
}

.cx-placeholder {
    margin: auto;
    text-align: center;
    padding: 48px 24px;
}

.cx-placeholder h2 { margin: 0 0 8px; font-size: 18px; }

.cx-detail-head {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 16px;
    align-items: start;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfcfb;
}

.cx-hero {
    display: grid;
    place-items: center;
    width: 160px;
    height: 160px;
    border: 1px dashed #b7c4b8;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.cx-hero-click { cursor: zoom-in; }

.cx-hero img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cx-detail-title h2 {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.3;
}

.cx-codes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.cx-fields-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.cx-fields-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 960px;
}

.cx-weight-pull-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(140px, 0.9fr) minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.cx-weight-pull-row .cx-source-radios {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    margin-top: 4px;
}

@media (max-width: 900px) {
    .cx-weight-pull-row {
        grid-template-columns: 1fr;
    }
}

.stone-h-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}
.stone-h-card {
    background: #f7f8fa;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px 10px;
}
.stone-h-card.stone-h-exchange {
    border-color: #f5d78e;
    background: #fffaf0;
}
.stone-h-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}
.stone-h-spec {
    font-weight: 600;
    font-size: 13px;
    color: #1f2a37;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stone-h-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
}
/* 执模/执模以外仍直接用 stone-h-row 时保留底色 */
.filing-acc-row,
.assembly-acc-row {
    padding: 8px;
    background: #f7f8fa;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}
.stone-h-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 56px;
}
.stone-h-cell > span {
    font-size: 11px;
    color: #6b7280;
}
.stone-h-name { min-width: 120px; flex: 1; }
.stone-h-num { min-width: 52px; max-width: 68px; }
.stone-h-pos { min-width: 52px; max-width: 64px; }
.stone-h-own { min-width: 48px; max-width: 56px; }
.stone-h-stock { min-width: 160px; flex: 1; }
.stone-h-stock-pick { display: flex; gap: 4px; align-items: center; }
.stone-h-check { min-width: 40px; align-items: center; }
.stone-h-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
}
.stone-h-add { margin-top: 4px; }

/* 执模发货：附加重量明细从左到右横排 */
.filing-acc-wrap {
    overflow-x: auto;
    padding-bottom: 4px;
}
.filing-acc-row {
    flex-wrap: nowrap;
    width: max-content;
    min-width: 100%;
    gap: 6px;
    padding: 6px 8px;
    align-items: flex-end;
}
.filing-acc-row-done {
    align-items: center;
    background: #fff;
}
.filing-acc-summary {
    font-size: 12px;
    color: #4b5563;
    white-space: nowrap;
}
.filing-acc-stock {
    min-width: 220px;
    flex: 1 1 auto;
}
.filing-acc-cascade {
    min-width: 200px;
    flex: 1;
}
.filing-acc-row .stone-h-cell {
    min-width: 64px;
    flex: 0 0 auto;
}
.filing-acc-row .stone-h-cell .input {
    min-width: 64px;
    width: 80px;
    padding: 4px 6px;
    font-size: 12px;
}
.filing-acc-row .stone-h-name .input,
.filing-acc-row .stone-h-stock .input {
    width: 140px;
    min-width: 120px;
}
.filing-acc-row .filing-acc-stock .input {
    width: auto;
    min-width: 0;
}
.filing-acc-hint {
    margin-top: 2px;
    font-size: 12px;
}
.filing-acc-picked {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 160px;
}
.filing-acc-picked-name {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stone-sheet-head {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px 16px;
    margin: 12px 0 16px;
    font-size: 13px;
}
.stone-sheet-head span { color: #6b7280; margin-right: 6px; }
.stone-sheet-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 12px;
    font-size: 14px;
}
@media print {
    .no-print, .sidebar, .cx-toolbar { display: none !important; }
    .print-sheet { padding: 0; }
}

.cx-side-scroll {
    overflow: auto;
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cx-side-alert {
    margin: 0;
    font-size: 12px;
    padding: 8px 10px;
}

.cx-settle-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px;
    background: #fff;
}

.cx-settle-card.warn {
    border-color: #f0c28a;
    background: #fffaf3;
}

.cx-settle-head .title {
    font-weight: 650;
    font-size: 13px;
}

.cx-settle-edit {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.cx-settle-calc {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--line);
    font-size: 12px;
}

.cx-balance-card,
.cx-summary-card {
    padding: 12px;
    border-radius: 10px;
    background: #f5f8f6;
    border: 1px solid var(--line);
}

.cx-balance-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 4px 0;
    font-size: 13px;
}

.cx-settle-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 12px;
    padding: 2px 0 4px 8px;
    font-size: 12px;
    line-height: 1.45;
}

.cx-balance-total {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
    font-size: 14px;
}

.cx-balance-total b { color: var(--accent); }

.cx-selected-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cx-selected-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 12px;
    background: #fff;
}

.cx-selected-name {
    font-weight: 650;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cx-confirm {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 650;
    border-radius: 10px;
}

.cx-tag-supp {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 650;
    border-radius: 4px;
    background: #fff3e0;
    color: #c45c00;
    vertical-align: middle;
}
.cx-transit-logs {
    margin-top: 16px;
}

.cx-history-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: flex-end;
    min-width: 0;
}

.cx-history-tools .input.search {
    flex: 1;
    max-width: 420px;
}

.cx-history .table-wrap {
    max-height: 420px;
    overflow: auto;
}

/* Casting receive: wider 已选待收, tighter 收货编辑, 颜色对账偏中 */
.cx-workspace-recv {
    grid-template-columns: 280px 0.58fr 1.42fr;
}

/* 配石镶嵌收货：中间明细加宽，结算预览收窄 */
.cx-workspace-recv.cx-workspace-setting {
    grid-template-columns: 220px minmax(0, 1fr) 200px;
}

.cx-workspace-setting .cx-settle-pane {
    min-width: 180px;
    max-width: 210px;
}

/* 电金收货：结算预览收窄（对齐镶嵌） */
.cx-workspace-recv.cx-workspace-plating {
    grid-template-columns: 220px minmax(0, 1fr) 200px;
}

.cx-workspace-plating .cx-settle-pane {
    min-width: 180px;
    max-width: 210px;
}

.cx-workspace-plating .cx-settle-compact {
    padding: 8px 8px;
    font-size: 12px;
}

.cx-workspace-plating .cx-settle-compact .cx-balance-row {
    font-size: 12px;
    padding: 3px 0;
    gap: 6px;
}

.cx-workspace-plating .cx-settle-compact .cx-formula {
    font-size: 11px;
    line-height: 1.35;
}

.cx-workspace-plating .cx-settle-compact .cx-hint {
    font-size: 11px;
}

.cx-workspace-setting .cx-settle-compact {
    padding: 8px 8px;
    font-size: 12px;
}

.cx-workspace-setting .cx-settle-compact .cx-balance-row {
    font-size: 12px;
    padding: 3px 0;
    gap: 6px;
}

.cx-workspace-setting .cx-settle-compact .cx-formula {
    font-size: 11px;
    line-height: 1.35;
}

.cx-workspace-setting .cx-settle-compact .cx-hint {
    font-size: 11px;
}

/* 实镶石：强制单行横排，超出横向滚动 */
.cx-workspace-setting .stone-h-wrap {
    overflow-x: auto;
    padding-bottom: 4px;
}

.cx-workspace-setting .stone-h-card {
    padding: 6px 8px;
}

.cx-workspace-setting .stone-h-row {
    flex-wrap: nowrap;
    width: max-content;
    min-width: 100%;
    gap: 6px;
}

.cx-workspace-setting .stone-h-cell {
    min-width: 48px;
    flex: 0 0 auto;
}

.cx-workspace-setting .stone-h-cell .input {
    min-width: 48px;
    width: 56px;
    padding: 4px 4px;
    font-size: 12px;
}

.cx-workspace-setting .stone-h-name {
    min-width: 100px;
}

.cx-workspace-setting .stone-h-name .input {
    width: 120px;
}

.cx-workspace-setting .stone-h-num {
    min-width: 56px;
    max-width: none;
}

.cx-workspace-setting .stone-h-num .input {
    width: 64px;
}

.cx-workspace-setting .stone-h-pos {
    min-width: 52px;
    max-width: 64px;
}

.cx-workspace-setting .stone-h-pos .input {
    width: 52px;
    min-width: 52px;
}

.cx-workspace-setting .stone-h-own {
    min-width: 48px;
    max-width: 56px;
}

.cx-workspace-setting .stone-h-own .input {
    width: 48px;
    min-width: 48px;
}

.cx-workspace-setting .stone-h-ct {
    min-width: 96px;
}

.cx-workspace-setting .stone-h-ct .input {
    width: 72px;
}

.cx-workspace-setting .setting-recv-bar {
    margin: 8px 0 12px;
    padding-left: 0;
}

.cx-workspace-setting .setting-recv-qty { width: 110px; }
.cx-workspace-setting .setting-recv-weight { width: 220px; }
.cx-workspace-setting .setting-recv-fineness { width: 120px; }

.cx-workspace-setting .stone-h-cell .input[readonly],
.cx-workspace-setting .stone-h-cell .input:disabled {
    background: #eef0f3;
    color: #4b5563;
    cursor: not-allowed;
}


/* 组装收货：结算预览收窄（不计耗，公式更短，对齐电金/镶嵌） */
.cx-workspace-recv.cx-workspace-assembly {
    grid-template-columns: 220px minmax(0, 1fr) 200px;
}

.cx-workspace-assembly .cx-settle-pane {
    min-width: 180px;
    max-width: 210px;
}

.cx-workspace-assembly .cx-settle-compact {
    padding: 8px 8px;
    font-size: 12px;
}

.cx-workspace-assembly .cx-settle-compact .cx-balance-row {
    font-size: 12px;
    padding: 3px 0;
    gap: 6px;
}

.cx-workspace-assembly .cx-settle-compact .cx-formula {
    font-size: 11px;
    line-height: 1.35;
}

.cx-workspace-assembly .cx-settle-compact .cx-hint {
    font-size: 11px;
}

.cx-workspace-assembly .cx-side-scroll {
    overflow: auto;
}

/* 执模收货：右栏结算适中（先前 228 过窄、340+1.25fr 过宽） */
.cx-workspace-recv.cx-workspace-filing {
    grid-template-columns: 230px minmax(0, 1.2fr) 300px;
}

.cx-workspace-filing .cx-settle-pane {
    min-width: 280px;
    max-width: 320px;
}

.cx-workspace-filing .cx-side-scroll {
    overflow: auto;
}

.cx-settle-compact {
    padding: 10px 12px;
    font-size: 13px;
}

.cx-settle-compact .cx-balance-row {
    font-size: 13px;
    padding: 4px 0;
}

.cx-settle-compact .cx-balance-row b {
    font-size: 14px;
}

.cx-formula {
    font-size: 12px;
    line-height: 1.45;
    padding: 0 0 8px 2px;
    word-break: break-word;
}

.cx-formula-sub {
    padding-left: 8px;
    opacity: 0.9;
}

.cx-settle-warn {
    border-color: #e8a0a0 !important;
    background: #fff7f7 !important;
}

.cx-settle-alert {
    color: #c62828;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.35;
    margin-bottom: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    background: #ffeaea;
}

.cx-settle-compact .cx-balance-row b.neg {
    color: #c62828;
}

.stone-recent {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
.stone-recent-chip {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 4px 8px;
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.cx-workspace-recv .cx-list-item {
    display: block;
    position: relative;
    padding: 8px 28px 8px 8px;
    cursor: default;
}

.cx-workspace-recv .cx-list-main {
    width: 100%;
    display: flex;
    gap: 10px;
    align-items: center;
    text-align: left;
    border: 0;
    background: transparent;
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    min-width: 0;
}

.cx-workspace-recv .cx-list-main:hover { background: transparent; }

.cx-workspace-recv .cx-list-item.active .cx-list-main {
    background: transparent;
}

.cx-workspace-recv .cx-list-meta {
    min-width: 0;
    overflow: hidden;
}

.cx-workspace-recv .cx-list-meta code {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
}

.cx-workspace-recv .cx-list-del {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
    padding: 2px 6px;
    font-size: 11px;
    line-height: 1.2;
    background: #fff;
    border-radius: 4px;
}

.cx-workspace-recv .cx-detail-head {
    gap: 10px;
}

.cx-workspace-recv .cx-hero {
    width: 72px;
    height: 72px;
}

.cx-workspace-recv .cx-detail-title h2 {
    font-size: 15px;
    margin: 0 0 4px;
}

.cx-workspace-recv .cx-fields-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.cx-workspace-recv .cx-detail-pane {
    min-height: 420px;
}

.cx-hint {
    margin: 8px 0 0;
    font-size: 12px;
}

.cx-settle-table-wrap {
    overflow: auto;
    flex: 1;
    min-height: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.cx-settle-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
    line-height: 1.25;
}

.cx-settle-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #eef3f0;
    border-bottom: 1px solid var(--line);
    padding: 6px 8px;
    font-weight: 650;
    white-space: nowrap;
    text-align: right;
}

.cx-settle-table thead th:first-child,
.cx-settle-table tbody td.cx-name-cell {
    text-align: left;
    min-width: 72px;
    max-width: 120px;
}

.cx-settle-table tbody td,
.cx-settle-table tfoot td {
    padding: 4px 6px;
    border-bottom: 1px solid #e8eeeb;
    white-space: nowrap;
    text-align: right;
    vertical-align: middle;
}

.cx-settle-table tbody tr:hover { background: #fafcfb; }
.cx-settle-table tbody tr.warn { background: #fffaf3; }

.cx-settle-table td.emph,
.cx-settle-table th.emph-col,
.cx-settle-table tfoot td.emph {
    color: #c0392b;
    font-weight: 700;
}

.cx-settle-table .input-xs {
    width: 68px;
    max-width: none;
    min-width: 52px;
    padding: 2px 6px;
    font-size: 11px;
    text-align: right;
    /* 去掉上下箭头，避免挡住数值 */
    -moz-appearance: textfield;
    appearance: textfield;
}

.cx-settle-table input[type="number"].input-xs::-webkit-outer-spin-button,
.cx-settle-table input[type="number"].input-xs::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cx-settle-table select.input-xs {
    width: 80px;
    text-align: left;
}

.cx-workspace-recv .cx-fields-grid .input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.cx-workspace-recv .cx-fields-grid input[type="number"]::-webkit-outer-spin-button,
.cx-workspace-recv .cx-fields-grid input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cx-total-row {
    position: sticky;
    bottom: 0;
    z-index: 1;
    background: #f0f4f2;
    font-weight: 650;
}

.cx-total-row td {
    border-top: 2px solid var(--line);
    border-bottom: none;
}

.so-ui-confirm-mask {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.so-ui-confirm {
    width: min(440px, 100%);
    background: #fff;
    border-radius: 10px;
    padding: 18px 20px;
    box-shadow: 0 12px 40px rgba(0,0,0,.18);
    color: #0f172a;
    font-size: 14px;
}

/* ?? ????/??????? + ???? ?? */
.ecom-hist-table .ecom-hist-doc td {
    background: #f1f5f9;
    font-weight: 600;
    border-top: 2px solid #cbd5e1;
    vertical-align: middle;
}
.ecom-hist-table .ecom-hist-line td {
    background: #fff;
    font-weight: 400;
    border-top: 1px solid #e2e8f0;
    vertical-align: middle;
}
.ecom-hist-table .ecom-hist-line.ecom-hist-hit td {
    background: #fff7ed;
}
.ecom-hist-table .ecom-hist-line td:first-child {
    padding-left: 18px;
}

/* 电商成品详情弹窗：盖在挑选窗之上 */
.ecom-fg-detail-backdrop {
    z-index: 60;
}

/* 电商待出库：清单 + 成品仓挑选窗 */
.ecom-cart-table {
    max-height: calc(100vh - 240px);
    overflow: auto;
}
.ecom-cart-table.is-filter-open {
    overflow: visible;
}
.ecom-cart-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #eef3f0;
}
.ecom-picker-modal {
    width: min(1100px, 96vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
}
.ecom-picker-modal .modal-body {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: calc(92vh - 120px);
}
.ecom-picker-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.ecom-picker-split {
    display: grid;
    grid-template-columns: 1fr minmax(260px, 320px);
    gap: 12px;
    min-height: 0;
    flex: 1;
}
/* 全页浏览列表：占满视口剩余高度（勿用于开窗挑选） */
.browse-list-table {
    max-height: calc(100vh - 220px);
    overflow: auto;
}
.browse-list-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #eef3f0;
}
.browse-list-table.is-filter-open {
    overflow: visible;
}
.browse-list-table tr.selected-row td {
    background: #e8f2ff;
}

.ecom-picker-table {
    max-height: min(58vh, 560px);
    overflow: auto;
}
.ecom-picker-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #eef3f0;
}
.ecom-picker-table tr.selected-row td {
    background: #e8f2ff;
}
.ecom-picker-thumb {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    background: #eef2f6;
}
.ecom-picker-detail {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafb;
    padding: 12px;
    overflow: auto;
    max-height: min(58vh, 560px);
}
.ecom-picker-detail-empty {
    padding: 40px 12px;
    text-align: center;
}
.ecom-picker-detail-img {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}
.ecom-picker-detail-title {
    font-weight: 650;
    margin-bottom: 10px;
    word-break: break-all;
}
.ecom-picker-detail-grid {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 6px 10px;
    font-size: 13px;
    align-items: start;
}
.ecom-style-filter-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.ecom-col-filter-th {
    white-space: nowrap;
    vertical-align: middle;
}
.ecom-col-sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    color: inherit;
    font: inherit;
}
.ecom-sort-pair {
    display: inline-flex;
    flex-direction: column;
    line-height: 0.7;
    margin-left: 1px;
}
.ecom-sort-tri {
    font-size: 8px;
    color: #94a3b8;
}
.ecom-sort-tri.is-on {
    color: #2563eb;
}
.ecom-sort-arrow {
    font-size: 10px;
    line-height: 1;
    color: #94a3b8;
}
.ecom-sort-arrow.is-asc,
.ecom-sort-arrow.is-desc {
    color: #2563eb;
}
.ecom-num-pop {
    width: 250px;
}
.ecom-num-range {
    display: grid;
    gap: 4px;
    margin-bottom: 6px;
}
.ecom-num-range label {
    display: grid;
    grid-template-columns: 72px 1fr;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #334155;
}
.ecom-num-range .input {
    height: 28px;
    font-size: 13px;
    padding: 2px 6px;
}
.ecom-col-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
}
.ecom-col-filter-btn:hover,
.ecom-col-filter-btn.is-on {
    color: #2563eb;
    background: #e8f0fe;
}
.ecom-picker-table.is-filter-open {
    overflow: visible;
}
.ecom-style-pop {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 50;
    width: 240px;
    background: #fff;
    border: 1px solid #aeb9c5;
    border-radius: 2px;
    box-shadow: 2px 4px 12px rgba(28, 36, 48, 0.18);
    padding: 6px 8px 8px;
    font-size: 13px;
}
.ecom-style-pop-search,
.ecom-style-pop > .input {
    width: 100%;
    margin-bottom: 4px;
    height: 28px;
    font-size: 13px;
}
.ecom-style-pop-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
    font-size: 13px;
    color: #2563eb;
}
.ecom-style-pop-actions .btn-link {
    background: none;
    border: 0;
    color: #2563eb;
    cursor: pointer;
    padding: 0;
    font-size: 13px;
}
.ecom-style-pop-actions .btn-link:hover {
    text-decoration: underline;
}
.ecom-style-pop-list {
    max-height: 200px;
    overflow: auto;
    border: 1px solid #e2e8f0;
    padding: 2px 0;
    background: #fff;
}
.ecom-style-pop-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 8px;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}
.ecom-style-pop-item:hover { background: #eef5ff; }
.ecom-style-pop-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 8px;
}
@media (max-width: 900px) {
    .ecom-picker-split { grid-template-columns: 1fr; }
}

/* 电商待出库：列表区内滚，工具栏「下一步」开窗确认 */
.ecom-pending-table {
    max-height: calc(100vh - 260px);
    overflow: auto;
}
.ecom-pending-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #eef3f0;
}

/* ?? ?????? / ???? ?? */
.ecom-detail-modal {
    width: min(920px, 96vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.ecom-detail-modal .modal-body.ecom-detail-body {
    overflow: auto;
    max-height: calc(90vh - 140px);
}
.ecom-detail-meta {
    margin-top: 4px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}
.ecom-detail-remark {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 10px;
    padding: 8px 10px;
    background: #f8fafc;
    border-radius: 6px;
}
.ecom-detail-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ecom-detail-card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}
.ecom-detail-card-edit {
    grid-template-columns: 64px minmax(0, 1fr) auto;
}
.ecom-detail-thumb {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f5f9;
    flex-shrink: 0;
}
.ecom-detail-card-edit .ecom-detail-thumb {
    width: 64px;
    height: 64px;
}
.ecom-detail-thumb-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #94a3b8;
}
.ecom-detail-main { min-width: 0; }
.ecom-detail-title-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 8px;
}
.ecom-detail-name {
    font-weight: 650;
    font-size: 14px;
    color: #0f172a;
    line-height: 1.3;
}
.ecom-detail-sub {
    margin-top: 3px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}
.ecom-detail-price { text-align: right; flex-shrink: 0; }
.ecom-detail-sale {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}
.ecom-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 14px;
}
.ecom-detail-grid > div {
    min-width: 0;
    font-size: 12px;
    line-height: 1.35;
}
.ecom-detail-grid span {
    display: block;
    color: #94a3b8;
    font-size: 11px;
    margin-bottom: 1px;
}
.ecom-detail-grid b {
    font-weight: 550;
    color: #334155;
    word-break: break-all;
}
.ecom-detail-stone { grid-column: 1 / -1; }
.ecom-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: stretch;
    min-width: 72px;
}
.ecom-detail-remove { color: #b91c1c !important; }
.ecom-edit-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}
.ecom-edit-fields label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 11px;
    color: #64748b;
}
.ecom-edit-add {
    padding-top: 4px;
    border-top: 1px dashed #e2e8f0;
}
@media (max-width: 720px) {
    .ecom-detail-card,
    .ecom-detail-card-edit {
        grid-template-columns: 56px minmax(0, 1fr);
    }
    .ecom-detail-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .ecom-edit-fields { grid-template-columns: 1fr; }
    .ecom-detail-grid { grid-template-columns: 1fr; }
}

.ecom-ret-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    vertical-align: middle;
    color: #9a3412;
    background: #ffedd5;
}

/* —— 客户对账单 —— */
.cx-stmt-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px 16px;
    margin-top: 14px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
}
.cx-stmt-summary > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cx-stmt-summary span {
    color: #64748b;
    font-size: 11px;
}
.cx-stmt-summary b {
    font-weight: 600;
    color: #0f172a;
}
.cx-stmt-adj td { background: #fffbeb; }
.cx-stmt-ret td { background: #fef2f2; }
.cx-stmt-pay td { background: #ecfdf5; }
.cx-stmt-print tfoot td {
    border-top: 1px solid #94a3b8;
    padding-top: 8px;
}


/* 销售单盈亏卡片 */
.sop-summary { margin: 10px 0 12px; }
.sop-profit-ok { border-color: #86efac !important; background: #f0fdf4 !important; color: #15803d !important; }
.sop-profit-bad { border-color: #fca5a5 !important; background: #fef2f2 !important; color: #b91c1c !important; }
.sop-step-metrics { display: flex; flex-direction: column; gap: 4px; }
.sop-step-cost { font-size: 12px; line-height: 1.45; color: #334155; }
.sop-step-money { margin-top: 4px; padding-top: 4px; border-top: 1px dashed #d7dedb; }
.sop-card-foot {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line, #e2e8e4);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px 12px;
}
.sop-foot-item {
    background: #f8faf9;
    border: 1px solid #e2e8e4;
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sop-foot-item span { font-size: 12px; color: #64748b; }
.sop-foot-item b { font-size: 15px; color: #0f172a; }
.sop-foot-profit.ok { background: #f0fdf4; border-color: #86efac; }
.sop-foot-profit.ok b { color: #15803d; }
.sop-foot-profit.bad { background: #fef2f2; border-color: #fca5a5; }
.sop-foot-profit.bad b { color: #b91c1c; }
@media (max-width: 900px) {
    .sop-card-foot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.sop-sum-card { flex: 1 1 180px; min-width: 160px; max-width: none; }
.sop-sum-ok { border-color: #86efac; background: #f0fdf4; }
.sop-sum-bad { border-color: #fca5a5; background: #fef2f2; }
.sop-profit-big { font-size: 22px; font-weight: 800; line-height: 1.2; margin: 4px 0; }
.sop-card-foot.pb-process-row { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line, #e2e8e4); }

/* 全部销售单 — 工序/出库进度 */
.soa-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: stretch;
    min-width: 280px;
}
.soa-block {
    flex: 1 1 160px;
    min-width: 150px;
    border: 1px solid #e2e8e4;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fafbfa;
}
.soa-block.soa-warn {
    border-color: #fca5a5;
    background: #fef2f2;
}
.soa-block.soa-ok {
    border-color: #bbf7d0;
    background: #f0fdf4;
}
.soa-block-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}
.soa-label {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}
.soa-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
    flex-shrink: 0;
}
.soa-flag {
    font-size: 12px;
    font-weight: 700;
    color: #b91c1c;
}
.soa-flag.ok { color: #15803d; }
.soa-nums {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    font-size: 13px;
    color: #334155;
}
.soa-nums b { font-size: 16px; color: #0f172a; }
.soa-pending { color: #b91c1c; }
.soa-pending b { color: #b91c1c; }
.sop-progress-row { margin-top: 8px; }
.pb-step-head .sop-qty-chip {
    margin-left: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #15803d;
    background: #ecfdf5;
    border: 1px solid #86efac;
    border-radius: 999px;
    padding: 1px 7px;
    line-height: 1.4;
    white-space: nowrap;
}
.pb-step-head .sop-qty-chip.sop-qty-pending {
    color: #b91c1c;
    background: #fef2f2;
    border-color: #fca5a5;
}
@media (max-width: 900px) {
    .soa-status-row { width: 100%; min-width: 0; }
}


/* ===== 手机专用销售开单 /m/sales-order ===== */
.mso-shell {
    min-height: 100vh;
    min-height: 100dvh;
    background: #f0f3f7;
    color: #1c2430;
}
.mso-page {
    max-width: 560px;
    margin: 0 auto;
    padding: 12px 12px 96px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.mso-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 4px 4px;
}
.mso-brand { font-size: 22px; font-weight: 700; letter-spacing: 0.02em; }
.mso-sub { font-size: 12px; color: #6b7785; margin-top: 2px; }
.mso-alert { margin: 0; }
.mso-card {
    background: #fff;
    border: 1px solid #d7dee7;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 6px 18px rgba(28,36,48,0.05);
}
.mso-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.mso-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #4b5563;
}
.mso-field:last-child { margin-bottom: 0; }
.mso-input {
    width: 100%;
    min-height: 44px;
    font-size: 16px !important;
    border-radius: 10px;
}
.mso-row2, .mso-row3 {
    display: grid;
    gap: 10px;
}
.mso-row2 { grid-template-columns: 1fr 1fr; }
.mso-row3 { grid-template-columns: 1fr 1fr 1fr; }
.mso-empty { margin: 8px 0 0; text-align: center; }
.mso-lines { display: flex; flex-direction: column; gap: 8px; }
.mso-line {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 10px;
    border: 1px solid #e5eaf0;
    border-radius: 12px;
    background: #f8fafc;
}
.mso-line-main { flex: 1; min-width: 0; }
.mso-line-title { font-weight: 600; font-size: 15px; }
.mso-line-meta { font-size: 12px; margin-top: 4px; }
.mso-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: #1f6b4a;
    background: #e6f3ec;
    border-radius: 999px;
    padding: 1px 8px;
    margin-right: 4px;
}
.mso-line-actions { display: flex; flex-direction: column; gap: 4px; }
.mso-bottom {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    display: flex;
    gap: 10px;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,0.96);
    border-top: 1px solid #d7dee7;
    backdrop-filter: blur(8px);
    max-width: 560px;
    margin: 0 auto;
    z-index: 20;
}
.mso-btn { flex: 1; min-height: 46px; font-size: 16px; }
.mso-full { width: 100%; min-height: 44px; margin-bottom: 12px; }
.mso-sheet {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: #f0f3f7;
    display: flex;
    flex-direction: column;
    max-width: 560px;
    margin: 0 auto;
}
.mso-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px 10px;
    background: #fff;
    border-bottom: 1px solid #e5eaf0;
    font-size: 17px;
}
.mso-sheet-body {
    flex: 1;
    overflow: auto;
    padding: 12px 14px 24px;
    -webkit-overflow-scrolling: touch;
}
.mso-sheet-foot {
    display: flex;
    gap: 10px;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid #e5eaf0;
}
.mso-upload {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    border: 1.5px dashed #c5ced8;
    border-radius: 12px;
    background: #fff;
    color: #6b7785;
    position: relative;
    overflow: hidden;
}
.mso-upload input[type=file] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.mso-upload img {
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
}
.mso-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
.mso-route { display: flex; flex-direction: column; gap: 6px; }
.mso-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    background: #fff;
    border: 1px solid #e5eaf0;
    border-radius: 10px;
    font-size: 14px;
}
.mso-out { display: flex; align-items: center; gap: 4px; font-size: 12px; margin-left: auto; }
.mso-mat {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid #e5eaf0;
    border-radius: 10px;
    background: #fff;
}
.mso-pick-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.mso-pick {
    text-align: left;
    border: 1px solid #e5eaf0;
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
}
.mso-pick:active { background: #e6f3ec; }
.mso-pick-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }

@media (min-width: 900px) {
    .mso-shell { background: #dde3ea; }
    .mso-page { padding-top: 24px; }
}

/* ===== 手机开单：选产品带图 + 工序拖拽 ===== */
.mso-pick {
    display: flex;
    align-items: stretch;
    gap: 10px;
    padding: 10px;
}
.mso-pick-thumb {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    background: #eef2f6;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mso-pick-thumb .smart-img,
.mso-pick-thumb .smart-img img {
    width: 72px;
    height: 72px;
    object-fit: cover;
}
.mso-pick-body { flex: 1; min-width: 0; text-align: left; }
.mso-pick-body .muted { font-size: 12px; line-height: 1.35; margin-top: 2px; }
.mso-route {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    min-height: 56px;
}
.mso-route-chip {
    width: 100%;
    justify-content: flex-start;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 15px;
    touch-action: none;
}
.mso-route-chip .route-chip-grip {
    opacity: 0.85;
    letter-spacing: -2px;
    margin-right: 2px;
}
.mso-out-onchip {
    margin-left: auto;
    color: #fff;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.mso-out-onchip input { width: 16px; height: 16px; }

.mso-route-chip.mso-dragging {
    opacity: 0.92;
    box-shadow: 0 8px 18px rgba(28,36,48,0.25);
    cursor: grabbing;
}
.mso-route-chip.mso-drop-target {
    outline: 2px dashed #fbbf24;
    outline-offset: 2px;
}
.mso-route {
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.mso-route-move {
    display: inline-flex;
    gap: 2px;
    margin-left: 4px;
}
.mso-route-move .btn {
    min-width: 36px;
    min-height: 36px;
    color: #fff !important;
    background: rgba(255,255,255,0.18);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
}
.mso-route-move .btn:disabled { opacity: 0.35; }
.mso-route-chip {
    flex-wrap: wrap;
}

.mso-line-thumb {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    padding: 0;
    border: 1px solid #e5eaf0;
    border-radius: 10px;
    overflow: hidden;
    background: #eef2f6;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
}
.mso-line-thumb:disabled {
    cursor: default;
    opacity: 0.85;
}
.mso-line-thumb .smart-img,
.mso-line-thumb .smart-img img {
    width: 64px;
    height: 64px;
    object-fit: cover;
}
.mso-preview {
    z-index: 80;
}
.mso-preview img {
    max-width: 96vw;
    max-height: 88vh;
}

.mso-pick {
    display: flex;
    align-items: stretch;
    gap: 10px;
    padding: 10px;
    border: 1px solid #e5eaf0;
    background: #fff;
    border-radius: 12px;
}
.mso-pick-thumb {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #eef2f6;
    cursor: zoom-in;
}
.mso-pick-thumb:disabled { cursor: default; }
.mso-pick-body {
    flex: 1;
    min-width: 0;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}
.mso-upload-preview {
    border-style: solid;
    cursor: zoom-in;
}

.mso-hist { margin-bottom: 8px; }
.mso-hist-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 10px 0;
}
.mso-hist-list { display: flex; flex-direction: column; gap: 10px; }
.mso-hist-item {
    border: 1px solid #e5eaf0;
    border-radius: 12px;
    padding: 10px;
    background: #f8fafc;
}
.mso-hist-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}
.mso-hist-no { font-weight: 600; font-size: 14px; }
.mso-hist-actions { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.mso-hist-lines {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}
.mso-hist-line {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 0;
    background: #fff;
    border-radius: 8px;
    padding: 6px 8px;
    text-align: left;
    cursor: zoom-in;
}
.mso-hist-line-name {
    font-size: 13px;
    color: #1c2430;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* �ֻ�����ɨ�� */
.mps-cam { position: relative; background: #0b1220; border-radius: 12px; overflow: hidden; aspect-ratio: 4/3; margin-bottom: 10px; }
.mps-cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mps-cam-off { display: flex; align-items: center; justify-content: center; color: #9aa7b5; font-size: 13px; min-height: 120px; }
.mps-scan-row { display: flex; gap: 8px; align-items: stretch; margin-bottom: 10px; }
.mps-scan-row .mso-input { flex: 1; }
.mps-mode { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px; border-radius: 999px; background: #e6f3ec; color: #1f6b4a; font-weight: 600; }
.mps-mode.recv { background: #fff4e5; color: #9a5b00; }
.mps-mode.done { background: #eef2f6; color: #6b7785; }
.mps-detail { display: flex; gap: 10px; align-items: flex-start; }
.mps-detail-body { flex: 1; min-width: 0; }
.mps-detail-title { font-weight: 700; font-size: 16px; }
.mps-detail-meta { font-size: 12px; color: #6b7785; margin-top: 4px; line-height: 1.45; }
.mps-acc { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.mps-acc-row { display: grid; grid-template-columns: 56px 1fr; gap: 8px; align-items: start; background: #f7fafc; border-radius: 10px; padding: 8px; }
.mps-acc-fields { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; align-items: end; }
.mps-acc-fields-4 { grid-template-columns: 1fr 1fr; margin-bottom: 6px; }
.mps-acc-fields-4 .mps-check { display: flex; flex-direction: column; gap: 4px; }
.mps-acc-fields-4 .mps-check input { width: auto; align-self: flex-start; margin-top: 6px; }
.mps-acc-fields-stone {
  grid-template-columns: repeat(7, minmax(56px, 1fr));
  margin-top: 4px;
  overflow-x: auto;
  gap: 4px;
}
.mps-acc-fields-stone .mso-input,
.mps-acc-fields-stone select.mso-input {
  min-height: 34px;
  height: 34px;
  padding: 0 4px;
  font-size: 13px;
}
.mps-acc-fields-stone .mps-stone-pos,
.mps-acc-fields-stone .mps-stone-own {
  max-width: 64px;
}
.mps-acc-fields-stone .mps-stone-pos .mso-input,
.mps-acc-fields-stone .mps-stone-own .mso-input {
  padding: 0 2px;
  font-size: 12px;
}
@media (max-width: 720px) {
  .mps-acc-fields-stone {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.mps-acc-fields-stone .mps-check { display: flex; flex-direction: column; gap: 4px; }
.mps-acc-fields-stone .mps-check input { width: auto; align-self: flex-start; margin-top: 6px; }
.mps-stone-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.mps-stone-head .mps-hist-title {
  margin: 0;
  flex: 1;
  min-width: 0;
}
.mps-stone-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.mps-recv-block { margin-top: 8px; padding: 8px; background: #eef3f8; border-radius: 8px; }
.mps-recv-hd { font-weight: 600; font-size: 13px; margin: 8px 0 6px; }
.mps-recv-item { padding: 6px 0; border-top: 1px solid #dde5ee; }
.mps-recv-item:first-of-type { border-top: none; }
.mps-sec-title {
  font-weight: 700;
  font-size: 14px;
  margin: 4px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid #d9e2ec;
  color: #1f2a37;
}
.mps-sec-gap { height: 8px; margin: 12px 0; border-top: 1px dashed #d9e2ec; }
.mps-mat-card {
  background: #f5f8fb;
  border: 1px solid #e4ebf2;
  border-radius: 10px;
  padding: 10px;
  margin: 8px 0;
}
.mps-recv-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 0 10px;
  font-weight: 600;
  font-size: 14px;
}
.mps-ship-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  margin: 6px 0;
  border: 1.5px solid #c5d0dc;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.mps-ship-row.active {
  border-color: #3b82f6;
  background: #eff6ff;
}
.mps-ship-row-main {
  flex: 1;
  min-width: 0;
}
.mps-ship-edit {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #dde5ee;
}
.mps-ship-card {
  margin: 8px 0;
  padding: 12px;
  border: 1.5px solid #c5d0dc;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.mps-ship-card.active {
  border-color: #3b82f6;
  background: #f8fbff;
}
.mps-ship-card-grid {
  display: grid;
  grid-template-columns: 64px minmax(140px, 200px) minmax(280px, 1fr) auto;
  gap: 10px 14px;
  align-items: start;
}
.mps-ship-card-img {
  flex-shrink: 0;
}
.mps-ship-card-prod {
  min-width: 0;
}
.mps-ship-card-prod .mps-hist-title {
  font-size: 15px;
  margin-bottom: 2px;
}
.mps-ship-card-fields {
  display: grid;
  grid-template-columns: minmax(200px, 1.2fr) minmax(180px, 1fr);
  gap: 8px 16px;
  align-items: start;
  min-width: 0;
}
.mps-ship-card-fields > .mps-ship-src {
  grid-column: 1;
}
.mps-ship-card-fields > .mso-row2 {
  grid-column: 1;
}
.mps-ship-card-fields > .mps-ship-pull {
  grid-column: 2;
  grid-row: 1 / span 3;
}
.mps-ship-card-fields > .mps-field-warn,
.mps-ship-card-fields > .muted,
.mps-ship-card-fields > .mps-sec-gap,
.mps-ship-card-fields > .mps-sec-title,
.mps-ship-card-fields > .mps-acc,
.mps-ship-card-fields > .mso-empty,
.mps-ship-card-fields > p {
  grid-column: 1 / -1;
}
.mps-ship-card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
@media (max-width: 900px) {
  .mps-ship-card-grid {
    grid-template-columns: 56px 1fr auto;
  }
  .mps-ship-card-fields {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
  }
  .mps-ship-card-fields > .mps-ship-pull {
    grid-column: 1;
    grid-row: auto;
  }
}
.goods-inputs .goods-input {
  background: #fff;
  border: 1.5px solid #c5d0dc;
  border-radius: 10px;
  padding: 8px 10px 10px;
}
.goods-inputs .goods-input .input {
  min-height: 44px;
  height: 44px;
  line-height: 44px;
  padding: 0 12px;
  font-size: 16px;
  font-weight: 600;
  box-sizing: border-box;
}
.goods-inputs .goods-input.empty-red {
  border-color: #e74c3c;
  background: #fff5f5;
}
.goods-inputs .goods-input.empty-red > span { color: #c0392b; }
.goods-inputs .goods-input.empty-red .input {
  border-color: #e74c3c;
  background: #ffeaea;
  color: #c0392b;
}
.mso-field.empty-red > span { color: #c0392b; }
.mso-field.empty-red .input {
  border-color: #e74c3c;
  background: #ffeaea;
}
.mps-field-warn {
  color: #c0392b;
  font-size: 12px;
  margin: 4px 0 8px;
  line-height: 1.35;
}
.mps-settle-card {
  margin-top: 12px;
  padding: 12px;
  background: #f7fafc;
  border: 1px solid #e4ebf2;
  border-radius: 10px;
}
.mps-settle-hd {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
  color: #1f2a37;
}
.mps-settle-alert {
  background: #fff0f0;
  border: 1px solid #f5c2c2;
  color: #c0392b;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  margin-bottom: 8px;
}
.mps-settle-alert.pending {
  background: #fff8e8;
  border-color: #f5d78e;
  color: #8a6d1d;
}
.mps-settle-row { margin-bottom: 6px; }
.mps-settle-row-main {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
.mps-settle-row-main b { color: #0b5cab; }
.mps-stone-tr .input.input-warn {
  border-color: #e74c3c;
  background: #ffeaea;
  color: #c0392b;
}
.mps-stone-card {
  background: #f5f8fb;
  border: 1px solid #e4ebf2;
  border-radius: 10px;
  padding: 10px;
  margin: 8px 0;
  overflow-x: auto;
}
.mps-stone-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.mps-stone-pos {
  font-weight: 700;
  color: #0b5cab;
  max-width: 88px;
  min-height: 32px;
  padding: 2px 4px;
  font-size: 13px;
}
.mps-stone-name {
  font-weight: 600;
  flex: 1;
  min-width: 120px;
  line-height: 1.35;
  word-break: break-word;
}
.mps-stone-qw { margin-left: auto; color: #0b5cab; font-weight: 700; white-space: nowrap; }
.mps-stone-table { min-width: 520px; }
.mps-stone-tr {
  display: grid;
  grid-template-columns: 48px 48px 64px 36px 56px 56px 56px 56px;
  gap: 4px;
  align-items: center;
  margin-bottom: 4px;
}
.mps-stone-tr.head span {
  font-size: 11px;
  color: #6b7785;
  text-align: center;
}
.mps-stone-tr .input {
  padding: 4px 2px;
  font-size: 12px;
  min-height: 32px;
  text-align: center;
}
.mps-stone-fit {
  display: flex;
  justify-content: center;
  margin: 0;
}
.mps-hist { display: flex; flex-direction: column; gap: 8px; }
.mps-hist-item { display: flex; gap: 8px; align-items: center; background: #f7fafc; border-radius: 10px; padding: 8px; }
.mps-hist-meta { flex: 1; min-width: 0; font-size: 12px; color: #6b7785; }
.mps-hist-title { font-weight: 600; font-size: 13px; color: #1c2430; }
.mps-actions { display: flex; gap: 8px; margin-top: 12px; }
.mps-actions .btn { flex: 1; min-height: 46px; }
.mps-lightbox { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; padding: 16px; }
.mps-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }

.mps-pick-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.mps-pick-item {
  display: flex; gap: 10px; align-items: center;
  width: 100%; text-align: left;
  border: 1px solid #e5eaf0; background: #fff; border-radius: 12px;
  padding: 10px; cursor: pointer;
}
.mps-pick-item:active { background: #e6f3ec; }

.mps-cam { position: relative; }
.mps-guide {
  pointer-events: none;
  position: absolute; left: 8%; right: 8%; top: 50%;
  height: 64px; margin-top: -32px;
  border: 2px solid rgba(46, 204, 113, 0.95);
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.28);
}

.mps-filter-row { align-items: stretch; }
.mps-scope { flex: 1.4; min-width: 0; }
.mps-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.mps-tab {
  flex: 1; min-height: 40px; border: 1px solid #d7dee7; border-radius: 10px;
  background: #fff; font-size: 15px; font-weight: 600; color: #6b7785;
}
.mps-tab.active { background: #e6f3ec; color: #1f6b4a; border-color: #1f6b4a; }

/* 成品仓入库：带图产品下拉 + 右侧大图 */
.fg-pick-row {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 12px;
  align-items: start;
}
.fg-pick-left {
  position: relative;
  min-width: 0;
}
.fg-pick-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  min-height: 48px;
  padding: 6px 10px;
  background: #fff !important;
}
.fg-pick-trigger-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fg-pick-drop {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 40;
  margin-top: 4px;
  max-height: 320px;
  overflow: auto;
  background: #fff;
  border: 1px solid #cfd8e3;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(20, 40, 70, 0.14);
  padding: 8px;
}
.fg-pick-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
}
.fg-pick-item:hover,
.fg-pick-item.active {
  background: #eef5ff;
}
.fg-pick-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.fg-pick-text strong {
  font-size: 13px;
  font-weight: 600;
  color: #1a2332;
}
.fg-pick-noimg {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #eef1f5;
  color: #8a96a8;
  font-size: 11px;
}

.pn-combo {
  position: relative;
}
.pn-combo-drop {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 50;
  margin-top: 4px;
  max-height: 780px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #cfd8e3;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(20, 40, 70, 0.14);
}
.pn-combo-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 12px;
  cursor: pointer;
}
.pn-combo-item:hover {
  background: #eef5ff;
}
.pn-combo-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #1a2332;
  line-height: 1.35;
}
.pn-combo-sub {
  display: block;
  font-size: 12px;
  margin-top: 2px;
  line-height: 1.3;
}

.lk-combo {
  position: relative;
  width: 100%;
}
.lk-combo-drop {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 70;
  margin-top: 2px;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(20, 40, 70, 0.14);
}
.lk-combo-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 13px;
  color: #1a2332;
}
.lk-combo-item:hover,
.lk-combo-item.active {
  background: #eef5ff;
}

.fg-side-image {
  margin: 0 !important;
  padding: 8px !important;
}
.fg-side-image .file-panel-title {
  font-size: 12px;
  margin-bottom: 4px;
}
.fg-side-drop {
  min-height: 120px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ���ϱ��� */
.gm-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}
.gm-kpi {
    background: #f6f8fb;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
}
.gm-kpi-v {
    font-size: 18px;
    font-weight: 650;
    margin-top: 4px;
    color: #0f172a;
}
.gm-unit {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    margin-left: 2px;
}
.gm-period {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 13px;
    align-items: center;
}
.gm-party-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
@media (max-width: 960px) {
    .gm-party-grid { grid-template-columns: 1fr; }
}

/* ����Ʒ���� */
tr.wip-overdue td { background: #fff7ed; }

/* �̳ǻ�Ʒ����Ӧ�̹���/���ӷ������ӿ��������������¼�ͷ�����ڵ� */
.shop-supplier-table { overflow-x: auto; }
.shop-supplier-table .shop-fee-input {
    min-width: 118px;
    width: 100%;
    box-sizing: border-box;
    padding-right: 10px;
}
.shop-supplier-table .shop-fee-input::-webkit-outer-spin-button,
.shop-supplier-table .shop-fee-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.shop-supplier-table .shop-fee-input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* 销售开单：图片 1:1 裁剪 */
.img-crop-backdrop { z-index: 12050; }
.img-crop-modal {
    width: min(560px, 96vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
}
.img-crop-hint { margin: 0 0 8px; font-size: 12px; }
.img-crop-stage {
    position: relative;
    width: 100%;
    height: min(52vh, 420px);
    background: #1a2332;
    border-radius: 8px;
    overflow: hidden;
    touch-action: none;
    user-select: none;
}
.img-crop-src {
    position: absolute;
    display: block;
    max-width: none;
    pointer-events: none;
}
.img-crop-frame {
    position: absolute;
    box-sizing: border-box;
    border: 2px solid #5ec8ff;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}
.img-crop-stage { cursor: grab; }
.img-crop-stage:active { cursor: grabbing; }
.img-crop-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}
.img-crop-zoom-lab {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    font-size: 13px;
    min-width: 0;
}
.img-crop-zoom { flex: 1; min-width: 0; }
.img-crop-zoom-val {
    min-width: 3.2em;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--muted, #6b7280);
}
.img-crop-foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

