* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    min-height: 100vh;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

header h1 {
    margin-bottom: 15px;
    text-align: center;
}

.tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.tab-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.tab-btn.active {
    background-color: white;
    color: #667eea;
    font-weight: bold;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-section, .statistics-section, .management-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

h2 {
    color: #667eea;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

h3 {
    color: #555;
    margin-bottom: 15px;
    font-size: 18px;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.form-group label {
    min-width: 100px;
    font-weight: bold;
    color: #555;
}

.form-group input,
.form-group select {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    min-width: 200px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

.parts-section {
    margin-top: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

/* 图片上传样式 */
.image-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 100px));
    gap: 15px;
    margin-top: 15px;
    margin-bottom: 20px;
}

.image-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid #e0e0e0;
    background: #f5f5f5;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.btn-remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.btn-remove-image:hover {
    background-color: rgba(192, 57, 43, 1);
    transform: scale(1.1);
}

.part-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 10px;
    background: white;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

.part-row select,
.part-row input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.part-row .part-name {
    flex: 2;
    min-width: 150px;
}

.part-row .part-quantity {
    flex: 1;
    min-width: 80px;
}

.part-row .part-supplier {
    flex: 2;
    min-width: 150px;
}

.part-row .part-supplier-quantity {
    flex: 1;
    min-width: 80px;
}

.btn-remove {
    padding: 8px 15px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-remove:hover {
    background-color: #c0392b;
}

.form-actions {
    margin-top: 30px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-primary {
    padding: 12px 30px;
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-primary:hover {
    background-color: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    padding: 12px 30px;
    background-color: #95a5a6;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-small {
    padding: 6px 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.btn-small:hover {
    background-color: #2980b9;
}

.filter-group {
    margin-bottom: 30px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-group label {
    font-weight: bold;
}

.filter-group input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #667eea;
}

.stat-card h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 16px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    margin-bottom: 8px;
    background-color: #f9f9f9;
    border-radius: 5px;
    border-left: 3px solid #667eea;
}

.stat-item strong {
    color: #667eea;
}

.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

th {
    font-weight: bold;
}

tbody tr:hover {
    background-color: #f5f5f5;
}

.btn-delete {
    padding: 6px 12px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.btn-delete:hover {
    background-color: #c0392b;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #667eea;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* 详细统计样式（手机友好） */
.detailed-stats-section {
    margin-bottom: 30px;
}

.detailed-stats-section h3 {
    margin-bottom: 20px;
    color: #667eea;
    font-size: 18px;
}

#detailedStatsContainer {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.date-group {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.date-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    font-weight: bold;
    font-size: 16px;
}

.date-header h4 {
    margin: 0;
    color: white;
}

.engineer-card {
    border-bottom: 2px solid #f0f0f0;
    padding: 15px;
}

.engineer-card:last-child {
    border-bottom: none;
}

.engineer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: linear-gradient(135deg, #90EE90 0%, #98FB98 100%);
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: bold;
}

.engineer-name {
    font-size: 16px;
    color: #333;
}

.engineer-total {
    font-size: 14px;
    color: #333;
    background: rgba(255, 255, 255, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
}

.customer-card {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    border-left: 4px solid #667eea;
}

.customer-card:last-child {
    margin-bottom: 0;
}

.customer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.customer-name {
    font-weight: bold;
    font-size: 15px;
    color: #333;
}

.customer-total {
    font-size: 14px;
    color: #667eea;
    font-weight: bold;
    background: #e8f0fe;
    padding: 4px 10px;
    border-radius: 12px;
}

.machines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.machine-item {
    background: white;
    border-radius: 6px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.machine-name {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    text-align: center;
}

.machine-count {
    font-size: 18px;
    font-weight: bold;
    color: #667eea;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.empty-state p {
    font-size: 16px;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .tabs {
        flex-direction: column;
    }

    .tab-btn {
        width: 100%;
    }

    .form-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-group label {
        min-width: auto;
    }

    .form-group input,
    .form-group select {
        width: 100%;
        min-width: auto;
    }

    .part-row {
        flex-direction: column;
    }

    .part-row select,
    .part-row input {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

