* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    padding: 20px;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

h2 {
    margin-bottom: 15px;
    color: #444;
}

.form-container {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

input[type="file"] {
    padding: 8px;
}

.image-preview {
    margin-top: 10px;
    max-width: 150px;
    max-height: 150px;
    overflow: hidden;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    cursor: pointer;
}

button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #45a049;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.products-container {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.product-actions {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.product-item {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    position: relative;
}

.product-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 20px;
    height: 20px;
}

.product-qr {
    text-align: center;
    margin-bottom: 10px;
}

.product-image {
    text-align: center;
    margin: 10px auto;
    max-width: 150px;
    max-height: 150px;
    cursor: pointer;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
}

.product-info {
    text-align: center;
}

.product-header {
    font-weight: bold;
    font-size: 14px;
    margin: 5px 0 10px 0;
    text-align: center;
}

.product-details {
    text-align: left;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.product-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.edit-btn {
    background-color: #2196F3;
}

.edit-btn:hover {
    background-color: #0b7dda;
}

.delete-btn {
    background-color: #f44336;
}

.delete-btn:hover {
    background-color: #da190b;
}

/* 图片查看器 */
.image-viewer {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
}

.enlarged-image {
    max-width: 90%;
    max-height: 90%;
}

.close-viewer {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

/* 打印样式 */
.print-template {
    display: none;
    width: 100%;
    max-width: 100%;
}

@media print {
    body * {
        visibility: hidden;
    }
    
    .print-template, .print-template * {
        visibility: visible;
    }
    
    .print-template {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: auto;
        padding: 20px;
        box-sizing: border-box;
        display: block;
    }
    
    .print-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
        width: 100%;
    }
    
    .print-item {
        text-align: center;
        padding: 10px;
        border: 1px solid #ddd;
        page-break-inside: avoid;
        height: 230px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    
    .print-item canvas {
        max-width: 100%;
        height: auto;
        margin-bottom: 5px;
    }
    
    .print-info {
        width: 100%;
        text-align: center;
        font-size: 12px;
    }
    
    .print-id {
        font-weight: bold;
        margin-top: 5px;
        font-size: 12px;
    }
    
    .print-image {
        max-width: 150px;
        max-height: 150px;
        margin: 0 auto 5px;
    }
    
    .print-image img {
        max-width: 100%;
        max-height: 100%;
    }
    
    @page {
        size: A4;
        margin: 1cm;
    }
}

@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}

/* 添加新按钮的样式 */
#exportDataBtn {
    background-color: #FF9800;
}

#exportDataBtn:hover {
    background-color: #F57C00;
}

#importDataBtn {
    background-color: #9C27B0;
}

#importDataBtn:hover {
    background-color: #7B1FA2;
}

/* 添加这些样式到styles.css文件中 */

.project-info-container {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.project-info-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.half-width {
    flex: 1;
    margin-bottom: 0;
}

#updateProjectInfoBtn {
    align-self: flex-start;
    background-color: #3F51B5;
}

#updateProjectInfoBtn:hover {
    background-color: #303F9F;
}

/* 打印头部样式 */
.print-header {
    margin-bottom: 20px;
}

.print-project-info {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.print-project-info table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.print-project-info th {
    text-align: left;
    font-weight: bold;
    padding: 5px 10px;
    background-color: #f2f2f2;
    border: 1px solid #ddd;
}

.print-project-info td {
    padding: 5px 10px;
    border: 1px solid #ddd;
}

@media print {
    .print-header {
        margin-bottom: 30px;
    }
    
    .print-project-info {
        border-top: 1px solid #ddd;
        border-bottom: 1px solid #ddd;
        padding: 10px 0;
        margin: 10px 0 20px;
    }
}

/* 添加Excel导入相关样式 */
.excel-import-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed #ccc;
}

.excel-import-section h3 {
    margin-bottom: 15px;
    color: #555;
}

.excel-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#importExcelBtn {
    background-color: #009688;
}

#importExcelBtn:hover {
    background-color: #00796b;
}

#generateAllBtn {
    background-color: #673AB7;
}

#generateAllBtn:hover {
    background-color: #512DA8;
}

.import-info {
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f8f8;
    border-radius: 4px;
    color: #555;
    font-size: 14px;
    display: none;
}

.import-info.show {
    display: block;
}

.import-info.success {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.import-info.error {
    background-color: #ffebee;
    color: #c62828;
}

#saveAllQRBtn {
    background-color: #E91E63;
}

#saveAllQRBtn:hover {
    background-color: #C2185B;
} 