* {
    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: 25px;
}

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

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

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

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

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

.system-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: 20px;
    border-radius: 10px;
    border-left: 4px solid #28a745;
}

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

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

.slider-item {
    flex: 1;
    min-width: 200px;
    background: white;
    padding: 15px;
    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: 10px;
}

.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: 20px;
    font-weight: bold;
    color: #1a365d;
    margin-top: 8px;
}

/* 推导展示区 */
.derivation-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #1a365d;
}

.derivation-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 18px;
}

.derivation-steps {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.step-card {
    flex: 1;
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #d4a853;
    transition: all 0.3s ease;
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.step-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.step-number {
    background: #1a365d;
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.step-title {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.step-content {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: visible;
}

.step-note {
    font-size: 11px;
    color: #888;
    font-style: italic;
    text-align: center;
}

.step-arrow {
    font-size: 24px;
    color: #d4a853;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 0;
}

/* 右侧面板样式 */
.block-diagram-section,
.image-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #d4a853;
}

.block-diagram-section h3,
.image-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 16px;
}

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

.image-container {
    width: 100%;
    min-height: 200px;
    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: 300px;
}

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

.image-caption {
    text-align: center;
    color: #666;
    font-size: 13px;
    margin-top: 10px;
    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: 22px;
    }

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

    .step-card {
        min-width: 100%;
    }

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

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

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