/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.2);
}

.header h1 {
    font-size: 24px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-buttons {
    display: flex;
    gap: 15px;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #f44336 0%, #ef5350 100%);
    color: white;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.3s;
    font-size: 14px;
}

.btn-edit {
    color: #2196f3;
}

.btn-edit:hover {
    background: #e3f2fd;
}

.btn-delete {
    color: #f44336;
}

.btn-delete:hover {
    background: #ffebee;
}

.btn-clone {
    color: #9c27b0;
}

.btn-clone:hover {
    background: #f3e5f5;
}

/* 筛选区域 */
.filters {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.search-box input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.filter-options select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    min-width: 150px;
}

/* 表格样式 */
.table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1600px;
}

thead {
    background: #f8f9fa;
}

th {
    padding: 16px;
    text-align: left;
    font-weight: 500;
    color: #262626;
    border-bottom: 2px solid #e8e8e8;
    white-space: nowrap;
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid #e8e8e8;
    vertical-align: middle;
}

tbody tr:hover {
    background: #fafafa;
}

/* 特殊行样式 */
tr.overdue {
    background: #fff1f0 !important;
}

tr.overdue:hover {
    background: #ffccc7 !important;
}

tr.continued {
    background: #f6ffed !important;
}

tr.continued:hover {
    background: #d9f7be !important;
}

/* 间隔天数样式 */
.interval-days.overdue-text {
    color: #f5222d;
    font-weight: bold;
}

.badge {
    background: #f5222d;
    color: white;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

/* 状态徽章 */
.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
    min-width: 40px;
    text-align: center;
}

.status-yes {
    background: #52c41a;
    color: white;
}

.status-no {
    background: #f5f5f5;
    color: #595959;
    border: 1px solid #d9d9d9;
}

/* 操作列 */
.actions {
    white-space: nowrap;
    min-width: 120px;
}

.actions .btn-icon {
    margin: 0 4px;
}

/* 保养项目列 */
.maintenance-items {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: help;
}

/* 统计栏 */
.stats-bar {
    display: flex;
    gap: 30px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-item {
    font-size: 14px;
}

.stat-item strong {
    font-size: 18px;
    margin-left: 8px;
}

.overdue-text {
    color: #f5222d;
}

.continued-text {
    color: #52c41a;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 50px auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 30px;
    background: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
    color: white;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0.8;
}

.close:hover {
    opacity: 1;
}

.modal-body {
    padding: 30px;
}

/* 表单样式 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #262626;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    transition: border 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
}

/* 导入说明 */
.import-instructions {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #1a73e8;
}

.import-instructions ul {
    margin-top: 10px;
    padding-left: 20px;
}

.import-instructions li {
    margin-bottom: 5px;
    font-size: 13px;
    color: #666;
}

.result-box {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    border-radius: 6px;
    padding: 15px;
}

.result-box h4 {
    color: #52c41a;
    margin-bottom: 10px;
}

#errorMessages {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 10px;
    padding-left: 20px;
}

#errorMessages li {
    color: #f5222d;
    margin-bottom: 5px;
    font-size: 13px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .header-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    .filters {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .filter-options select {
        width: 100%;
    }
    
    .stats-bar {
        flex-direction: column;
        gap: 15px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px auto;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}