* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
}

.tabs {
    display: flex;
    gap: 10px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: #ecf0f1;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: #bdc3c7;
}

.tab-btn.active {
    background: #3498db;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}


.section h2 {
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    font-size: 18px;
    font-weight: 600;
}

.toolbar {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

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

.data-table th {
    background: #34495e;
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.data-table th.th-check,
.data-table td.td-check {
    width: 44px;
    text-align: center;
    vertical-align: middle;
}

.data-table .quote-price-input {
    width: 100%;
    min-width: 80px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* 备注列样式 - 限制宽度和显示长度 */
.data-table td.remark-cell,
.data-table td:nth-child(5) {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: break-all;
    cursor: help;
}

.loading {
    text-align: center;
    color: #7f8c8d;
    padding: 20px;
}

.sync-section {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.sync-section select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#sync-status {
    color: #27ae60;
    font-weight: 500;
}

.filter-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.filter-section select,
.filter-section input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.filter-section input[type="date"] {
    height: 38px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: white;
    margin: 3% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
}

/* 类目管理模态框 - 更大的宽度 */
.modal-content:has(.categories-modal-content) {
    max-width: 1400px;
    width: 95%;
}

/* 类目管理模态框样式 */
.categories-modal-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    min-width: 1000px;
}

.category-modal-section {
    display: flex;
    flex-direction: column;
}

.category-modal-section h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    font-size: 18px;
    font-weight: 600;
}

.category-modal-section .toolbar {
    margin-bottom: 15px;
}

.table-container {
    flex: 1;
    overflow-y: auto;
    max-height: 500px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

.table-container .data-table {
    margin: 0;
}

.table-container .data-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.actions {
    display: flex;
    gap: 5px;
}

.actions .btn {
    padding: 4px 8px;
    font-size: 12px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .categories-modal-content {
        grid-template-columns: 1fr;
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .sync-section {
        grid-template-columns: 1fr;
    }
    
    .filter-section {
        grid-template-columns: 1fr;
    }
    
    .data-table {
        font-size: 13px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px;
    }
    
    .categories-modal-content {
        min-width: auto;
    }
    
    .table-container {
        max-height: 300px;
    }
}
