/* ============ 订单预览打印样式 ============ */

@media print {
    .no-print { display: none !important; }
    body * { visibility: hidden; }
    #order-print-area, #order-print-area * { visibility: visible; }
    #order-print-area { position: absolute; left: 0; top: 0; width: 100%; padding: 20px; background: white; }
    @page { size: auto; margin: 10mm; }
}

/* 订单预览样式 */
.order-print { font-family: "Microsoft YaHei", "SimSun", sans-serif; font-size: 12px; color: #000; line-height: 1.6; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.order-print .op-header { text-align: center; margin-bottom: 16px; }
.order-print .op-title { font-size: 18px; font-weight: bold; margin-bottom: 8px; }
.order-print .op-meta { font-size: 12px; color: #333; }
.order-print .op-info { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; padding: 10px; border: 1px solid #ddd; border-radius: 4px; }
.order-print .op-info-row { display: flex; gap: 12px; flex-wrap: wrap; }
.order-print .op-info-row > div { flex: none; white-space: nowrap; }
.order-print .op-info-address { flex: 1; min-width: 200px; white-space: normal; }
.order-print .op-info-row-main { align-items: center; }
.order-print .op-left { flex: none; text-align: left; white-space: nowrap; }
.order-print .op-mid { flex: 1; text-align: left; white-space: nowrap; display: inline-block; }
.order-print .op-right { flex: none; text-align: right; white-space: nowrap; margin-left: auto; }
.order-print .op-info label { font-weight: bold; color: #555; }
.order-print table.op-table { width: 100%; border-collapse: collapse; margin-top: 2px; margin-bottom: 12px; }
.order-print table.op-table th, .order-print table.op-table td { border: 1px solid #000; padding: 0 !important; font-size: 11px; }
.cell-inner { min-height: 26px; padding: 4px 10px; display: flex; align-items: center; justify-content: center; line-height: 1.4; }
.order-print table.op-table th .cell-inner { background: #f0f0f0; font-weight: bold; }
.order-print table.op-table td:nth-child(3) .cell-inner, .order-print table.op-table td:nth-child(4) .cell-inner { justify-content: flex-start; }
.order-print table.op-table td:nth-child(3), .order-print table.op-table td:nth-child(4) { max-width: 180px; }
.order-print table.op-table td:nth-child(5) { max-width: 120px; }
.order-print .op-summary { text-align: right; margin: 8px 0; }
.order-print .op-summary div { margin: 2px 0; }
.order-print .op-total { font-weight: bold; font-size: 14px; border-top: 2px solid #000; border-bottom: 2px solid #000; padding: 8px 0; margin: 8px 0; }
.order-print .op-total-row { display: flex; justify-content: space-between; }
.order-print .op-notes { margin-top: 10px; font-size: 11px; }
.order-print .op-notes div { margin: 2px 0; }
.order-print .op-footer { margin-top: 16px; display: flex; justify-content: space-between; font-size: 11px; color: #555; }
.order-print tr { page-break-inside: avoid; }
.order-print .op-signatures { display: flex; justify-content: space-between; margin-top: 24px; padding-top: 16px; list-style: none; }
.order-print .op-sign-item { display: inline-block; font-size: 12px; list-style: none; white-space: nowrap; }
.order-print .op-sign-left { text-align: left; flex: none; }
.order-print .op-sign-center { text-align: center; flex: 1; }
.order-print .op-sign-right { text-align: right; flex: none; }
.order-print .op-sign-label { font-weight: bold; color: #555; }
.order-print .op-sign-name { display: inline-block; margin-left: 4px; }
.order-print .op-sign-line { display: inline-block; width: 100px; border-bottom: 1px solid #000; height: 16px; }

/* 收款码区域：左上角浮动显示，不影响标题居中布局 */
.order-print .op-qr-top-left { float: left; margin-right: 12px; display: flex; gap: 8px; }
.order-print .op-qr-top-left .op-qr-img { width: 60px; height: 60px; object-fit: contain; display: block; border: 1px solid #eee; }

/* ============ 打样单卡片样式 ============ */
.order-print .sample-cards-grid { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
.order-print .sample-card { display: flex; border: 1px solid #000; border-radius: 4px; min-width: 280px; overflow: hidden; page-break-inside: avoid; background: white; }
.order-print .sc-color-bar { width: 80px; height: 80px; flex-shrink: 0; position: relative; overflow: hidden; border-right: 1px solid #000; display: block; }
.order-print .sc-color-img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.order-print .sc-info { flex: 1; padding: 8px 10px; display: flex; flex-direction: column; justify-content: center; }
.order-print .sc-title { font-size: 12px; font-weight: bold; color: #000; margin-bottom: 3px; }
.order-print .sc-code { color: #0066cc; margin-right: 4px; }
.order-print .sc-meta { font-size: 11px; color: #333; line-height: 1.6; }

/* 标签预览样式 - 使用mm单位与打印一致 */
#label-print-area {
    display: flex;
    flex-wrap: wrap;
    gap: 3mm;
    justify-content: center;
    align-content: flex-start;
}

.print-wrap {
    width: 77mm;
    height: 47mm;
    background: white;
    box-shadow: 0 0.5mm 1mm rgba(0,0,0,0.08);
    page-break-inside: avoid;
}

.label-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-family: "Microsoft YaHei", sans-serif;
    color: #000;
    table-layout: auto;
    height: 100%;
}

.label-table td {
    border: 0.15mm solid #000;
    padding: 0.3mm 0.5mm;
    vertical-align: middle;
    word-wrap: break-word;
    line-height: 1.05;
}

/* 左侧信息列 - 占满剩余宽度 */
.label-table .lt-info-cell:not(.lt-right-cell) {
    width: auto;
}

.label-table .lt-info-cell {
    font-size: 3.0mm;
    padding: 0.4mm 0.3mm;
}

.label-table .lt-title-row td {
    background: #f0f0f0;
    font-weight: bold;
    text-align: center;
    font-size: 3.0mm;
    padding: 0.4mm 0.3mm;
}

.label-table .lt-label {
    font-weight: bold;
    color: #555;
    display: inline-block;
}

.label-table .lt-value {
    color: #000;
}

.label-table .lt-strong {
    font-weight: bold;
    color: #c00;
}

.label-table .lt-color-value {
    display: inline-flex;
    align-items: center;
}

.label-table .lt-color-name {
    font-weight: bold;
    font-size: 3.0mm;
}

.label-table .lt-remark {
    color: #666;
    font-size: 3.0mm;
}

.label-table .lt-qr-row td {
    border-top: 0.15mm solid #000;
}

.label-table .lt-right-cell {
    text-align: center;
    padding: 0 !important;
    width: 19mm;
    position: relative;
}

.label-table .lt-right-cell img {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: 100%;
    max-width: 19mm;
    max-height: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    display: block;
    margin: auto;
}

.label-table .lt-qr-info-full {
    font-size: 3.0mm;
    color: #555;
    text-align: center;
    padding: 0.2mm;
    border-top: 0.15mm solid #000;
}