/* ============================================
   物料管理样式
   ============================================ */

.material-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    height: calc(100vh - 100px);
    overflow: hidden;
}

/* 右侧内容区 - A4纸样式 */
.material-content {
    background: #e8e8e8;
    border-radius: 8px;
    overflow-y: auto;
    padding: 15px;
}

/* A4页面 */
.material-page {
    width: 210mm;
    min-height: 297mm;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    padding: 15mm;
    box-sizing: border-box;
    margin: 0 auto 20px;
}

.material-title {
    text-align: center;
    font-size: 20pt;
    font-weight: bold;
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #2c3e50;
    padding-bottom: 10px;
}

/* 物料表格 */
.material-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11pt;
    background: #fff;
}

.material-table thead {
    background: #2c3e50;
    color: #fff;
}

.material-table th {
    padding: 10px 6px;
    text-align: center;
    font-weight: 600;
    font-size: 10pt;
    border: 1px solid #34495e;
}

.material-table td {
    padding: 8px 6px;
    border: 1px solid #ddd;
    vertical-align: middle;
    text-align: center;
}

.material-table td:nth-child(2),
.material-table td:nth-child(3) {
    text-align: left;
}

.material-table tbody tr:nth-child(even) {
    background: #f9f9f9;
}

.material-table tbody tr:hover {
    background: #f0f7ff;
}

/* 分类标签 */
.category-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
}

.category-stage { background: #e74c3c; }
.category-light { background: #f39c12; }
.category-sound { background: #9b59b6; }
.category-decoration { background: #27ae60; }
.category-led { background: #3498db; }
.category-other { background: #95a5a6; }

/* 统计信息 */
.material-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    font-size: 32px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f7ff;
    border-radius: 8px;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
    font-family: 'Consolas', 'Monaco', monospace;
}

/* 拆分配置弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.split-product-info {
    background: #e3f2fd;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.split-product-info strong {
    display: block;
    font-size: 14px;
    margin-bottom: 5px;
}

.split-product-info span {
    display: inline-block;
    margin-right: 15px;
    font-size: 12px;
    color: #666;
}

.split-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.split-table th,
.split-table td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: left;
}

.split-table th {
    background: #f5f5f5;
    font-weight: 600;
}

.split-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
}

.split-hint {
    margin-top: 15px;
    padding: 10px;
    background: #fff8e1;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
}

.split-hint p {
    margin: 5px 0;
}

/* 打印样式 */
@media print {
    @page {
        size: A4 portrait;
        margin: 15mm;
    }

    header,
    .material-sidebar {
        display: none !important;
    }

    .material-layout {
        display: block;
        height: auto;
        overflow: visible;
    }

    .material-content {
        padding: 0;
        background: #fff;
        overflow: visible;
    }

    .material-page {
        width: 100%;
        min-height: auto;
        box-shadow: none;
        padding: 0;
        page-break-after: always;
    }

    .material-page:last-child {
        page-break-after: auto;
    }

    body {
        background: #fff;
    }

    .material-table {
        font-size: 10pt;
    }
}

/* 响应式 */
@media (max-width: 1024px) {
    .material-layout {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }
    
    .material-sidebar {
        overflow: visible;
    }
    
    .material-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}
