/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 300;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 导航样式 */
.data-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-btn {
    padding: 12px 24px;
    border: none;
    background: #f8f9fa;
    color: #495057;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.nav-btn:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.nav-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* 主内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* 区域样式 */
.data-section, .chart-section, .parameters-section, .history-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.data-section {
    grid-column: 1 / -1;
}

.parameters-section, .history-section {
    grid-column: 1 / -1;
}

h2 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 500;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

/* 表格样式 */
.data-table-container {
    overflow-x: auto;
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

.data-table td {
    cursor: pointer;
}

.data-table td.editable {
    background-color: #fff3cd;
}

/* 控件样式 */
.table-controls, .chart-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.control-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.control-btn:not(:disabled) {
    background: #667eea;
    color: white;
}

.control-btn:not(:disabled):hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.control-btn:disabled {
    background: #6c757d;
    color: white;
    cursor: not-allowed;
}

.control-select {
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    background: white;
    font-size: 14px;
}

/* 图表容器 */
.chart-container {
    height: 400px;
    margin-bottom: 20px;
    position: relative;
}

#chart-canvas {
    width: 100% !important;
    height: 100% !important;
}

/* 参数容器 */
.parameters-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.parameter-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.parameter-label {
    font-weight: 500;
    color: #495057;
}

.parameter-input {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 14px;
}

.parameter-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.25);
}

/* 历史记录 */
.history-list {
    max-height: 200px;
    overflow-y: auto;
    list-style: none;
    margin-bottom: 15px;
}

.history-item {
    padding: 10px;
    border-left: 4px solid #667eea;
    background: #f8f9fa;
    margin-bottom: 5px;
    border-radius: 0 5px 5px 0;
    font-size: 14px;
}

.history-item:hover {
    background: #e9ecef;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #333;
}

.modal-form {
    display: grid;
    gap: 15px;
    margin: 20px 0;
}

.modal-form label {
    font-weight: 500;
    color: #495057;
}

.modal-form input {
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .data-nav {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-btn {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .table-controls, .chart-controls {
        flex-direction: column;
    }
    
    .parameters-container {
        grid-template-columns: 1fr;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.data-section, .chart-section, .parameters-section, .history-section {
    animation: fadeIn 0.5s ease-out;
}