/* ===== 打印弹窗样式（完全独立于主题）===== */

/* --- 强制覆盖关闭按钮颜色，不受主题影响 --- */
.print-modal .modal-close {
    color: #1e293b !important;
    background: transparent;
    border: none;
    font-size: 28px;
    cursor: pointer;
}

/* 打印弹窗表格样式 */
.print-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: #ffffff !important;
    color: #1e293b !important;
}
.print-table th {
    background: #f1f5f9 !important;
    padding: 0.75rem;
    text-align: left;
    color: #1e293b !important;
    font-weight: 600;
}
.print-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e2e8f0 !important;
    vertical-align: middle;
    background: #ffffff !important;
    color: #1e293b !important;
}
.print-table img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}
.qty-input {
    width: 70px;
    padding: 0.3rem;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px;
    background: #ffffff !important;
    color: #1e293b !important;
}
.remove-row {
    background: none !important;
    border: none !important;
    color: #ef4444 !important;
    font-size: 1.2rem;
    cursor: pointer;
}
.print-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    background: #ffffff !important;
}
.btn-print-confirm {
    background: #2563eb !important;
    color: white !important;
    border: none !important;
    padding: 0.7rem 2rem;
    border-radius: 40px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* 打印模态框背景和容器 */
.print-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5) !important;
    backdrop-filter: blur(4px);
    z-index: 1000;
}
.print-modal .modal-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    background: #ffffff !important;
    border-radius: 32px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25) !important;
    display: flex;
    flex-direction: column;
    margin: 0;
    border: none !important;
}

/* 弹窗头部固定 */
.print-modal .modal-header {
    flex-shrink: 0;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
}
.print-modal .modal-header h3 {
    color: #1e293b !important;
    font-size: 1.5rem;
    margin: 0;
}

/* 内容区域滚动 */
.print-modal .info-modal-content {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1.5rem 2rem;
    min-height: 200px;
    background: #ffffff !important;
    color: #1e293b !important;
}

/* 底部按钮固定 */
.print-modal .print-actions {
    flex-shrink: 0;
    padding: 1rem 2rem 2rem;
    border-top: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
}

/* 取消按钮样式 */
#printModal .btn-clear {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
    padding: 0.7rem 2rem;
    border-radius: 40px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
#printModal .btn-clear:hover {
    background: #e2e8f0 !important;
}

/* ===== 4cm x 3cm 标签打印样式（标准版）===== */
body {
    margin: 0;
    padding: 0;
    background: white;
}
.print-label {
    width: 4cm;
    height: 3cm;
    page-break-after: always;
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', Arial, sans-serif;
    box-sizing: border-box;
    overflow: visible;
    margin: 0;
    padding: 0 0.2cm 0 0.6cm;
    color: #1e293b;
}
.print-label .top-area {
    height: 55%;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    font-size: 7pt;
    font-weight: bold;
    text-align: left;
    word-break: break-word;
    padding: 2px 0;
    line-height: 1.3;
    width: 100%;
    color: #1e293b;
}
.print-label .bottom-area {
    height: 45%;
    display: flex;
    flex-direction: row;
    width: 100%;
    color: #1e293b;
}
.bottom-area .left-area {
    width: 70%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1px 0;
    position: relative;
    top: -0.2cm;
    color: #1e293b;
}
.bottom-area .right-area {
    width: 30%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 7pt;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    margin-left: 0.2cm;
    color: #1e293b;
}
.left-area svg {
    max-width: 100%;
    height: auto;
    display: block;
}
.barcode-code {
    font-family: "黑体", SimHei, "Microsoft YaHei", Arial, sans-serif;
    font-weight: bold;
    font-size: 12pt;
    text-align: center;
    margin-top: 2px;
    line-height: 1.2;
    color: #1e293b;
}

@media print {
    @page {
        size: 4cm 3cm;
        margin: 0;
    }
    body {
        margin: 0;
        padding: 0;
    }
}

/* ===== 标签预览区域 ===== */
.label-preview-row {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 0 2rem 1.5rem 2rem;
    flex-shrink: 0;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
}
.preview-card {
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: #1e293b;
}
.preview-card.selected {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
}
.preview-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 13px;
    color: #475569;
    font-weight: 600;
}
.preview-label-wrap {
    display: inline-block;
    border: 1px dashed #94a3b8;
    background: white;
    overflow: hidden;
    line-height: 1.2;
    color: #1e293b;
}

/* 标准版预览容器尺寸 */
#previewStandard .print-label,
.preview-label-wrap:not(.mini) .print-label {
    width: 4cm;
    height: 3cm;
    margin: 0;
    color: #1e293b;
}

/* Mini 预览容器尺寸 */
.preview-label-wrap.mini {
    width: 4cm;
    height: 3cm;
    overflow: hidden;
    color: #1e293b;
}

/* ===== Mini 版标签样式（4cm × 3cm，4 行重复 code）===== */
.print-label.mini-label {
    width: 4cm;
    height: 3cm;
    margin: 0;
    padding: 0.1cm 0.1cm;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    font-family: "黑体", SimHei, "Microsoft YaHei", Arial, sans-serif;
    color: #1e293b;
}

.mini-code-line {
    flex: 1;
    font-weight: bold;
    font-size: 10pt;
    letter-spacing: 0.5pt;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1e293b;
}