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

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    color: white;
    padding: 30px 40px;
    text-align: center;
    border-bottom: 4px solid #d4a853;
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.main-content {
    display: flex;
    padding: 30px;
    gap: 30px;
}

.left-panel {
    flex: 0 0 70%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.right-panel {
    flex: 0 0 30%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 系统选择器 */
.system-selector,
.input-selector {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 10px;
    border-left: 4px solid #1a365d;
}

.system-selector label,
.input-selector label {
    font-weight: 600;
    color: #333;
    margin-right: 15px;
}

.system-selector select,
.input-selector select {
    padding: 10px 15px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.system-selector select:hover,
.input-selector select:hover {
    border-color: #1a365d;
}

.system-selector select:focus,
.input-selector select:focus {
    outline: none;
    border-color: #1a365d;
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.2);
}

/* 参数调节区域 */
.parameters-section {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 10px;
    border-left: 4px solid #d4a853;
}

.parameters-section h3 {
    color: #333;
    margin-bottom: 12px;
    font-size: 16px;
}

.sliders-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.slider-item {
    flex: 1;
    min-width: 180px;
    background: white;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.slider-item label {
    display: block;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    font-size: 14px;
}

.slider-item input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

.slider-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #d4a853;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(212, 168, 83, 0.5);
    transition: all 0.2s ease;
}

.slider-item input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #c49a48;
}

.slider-value {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #1a365d;
    margin-top: 6px;
}

/* 响应曲线区域 */
.curve-section {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 10px;
    border-left: 4px solid #1a365d;
}

.curve-section h3 {
    color: #333;
    margin-bottom: 12px;
    font-size: 16px;
}

#responseCanvas {
    width: 100%;
    height: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* 性能指标区域 */
.metrics-section {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 10px;
    border-left: 4px solid #d4a853;
}

.metrics-section h3 {
    color: #333;
    margin-bottom: 12px;
    font-size: 16px;
}

.metrics-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.metric-card {
    flex: 1;
    min-width: 120px;
    background: white;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.metric-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.metric-value {
    font-size: 16px;
    font-weight: bold;
    color: #1a365d;
}

/* 右侧面板样式 */
.transfer-function-section,
.response-formula-section,
.image-section {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 10px;
    border-left: 4px solid #1a365d;
}

.transfer-function-section h3,
.response-formula-section h3,
.image-section h3 {
    color: #333;
    margin-bottom: 12px;
    font-size: 15px;
}

.formula-box {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

/* 时域响应公式滚动容器 */
.formula-scroll-container {
    max-height: 130px;
    overflow-y: auto;
    overflow-x: auto;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #e0e0e0;
}

.formula-scroll-container .formula-box {
    background: transparent;
    box-shadow: none;
    padding: 5px;
    min-height: auto;
    font-size: 14px;
    line-height: 1.8;
    white-space: nowrap;
    justify-content: flex-start;
    display: inline-block;
}

.formula-scroll-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.formula-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.formula-scroll-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.formula-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.image-container {
    width: 100%;
    min-height: 150px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.image-container img {
    width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 200px;
}

.image-error {
    color: #999;
    font-size: 13px;
    padding: 15px;
    text-align: center;
}

.image-caption {
    text-align: center;
    color: #666;
    font-size: 12px;
    margin-top: 8px;
    font-style: italic;
}

/* 页脚样式 */
.footer {
    padding: 25px 40px 30px;
    text-align: center;
}

.footer-divider {
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, #1a365d 20%, #d4a853 50%, #1a365d 80%, transparent 100%);
    margin-bottom: 20px;
    border: none;
}

.footer-text {
    color: #1a365d;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 6px;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content {
        flex-direction: column;
    }

    .left-panel,
    .right-panel {
        flex: 0 0 100%;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 24px;
        letter-spacing: 4px;
    }

    .main-content {
        padding: 15px;
        gap: 20px;
    }

    .slider-item {
        min-width: 100%;
    }

    .metric-card {
        min-width: calc(50% - 10px);
    }
}

/* MathJax 样式覆盖 */
mjx-container {
    display: inline-block !important;
}

mjx-container[jax="CHTML"][display="true"] {
    margin: 0 !important;
}
