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

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    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, #1a3c6e, #2c5282);
    color: white;
    padding: 25px 40px;
    text-align: center;
    border-bottom: 4px solid #d4a853;
}

.header h1 { font-size: 26px; letter-spacing: 4px; }
.header .subtitle { font-size: 13px; margin-top: 4px; opacity: 0.9; }

/* 概念说明 */
.concept-box {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    font-size: 13px;
    color: #856404;
    margin: 15px 20px 0;
    line-height: 1.8;
}
.concept-box strong { color: #664d03; }

/* 控制区 */
.control-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px 25px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    align-items: center;
}

.correction-panel {
    background: #f0f4ff;
    border-bottom: 2px solid #dbeafe;
}

.mode-panel {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.control-item { display: flex; align-items: center; gap: 6px; }
.control-item label { font-weight: 600; color: #333; font-size: 13px; white-space: nowrap; }

.control-item select {
    padding: 6px 10px;
    font-size: 13px;
    border: 2px solid #ccc;
    border-radius: 5px;
    background: white;
    cursor: pointer;
}
.control-item select:focus { outline: none; border-color: #1a3c6e; }

.control-item input[type="range"] {
    width: 120px;
    height: 5px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}
.control-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #d4a853;
    cursor: pointer;
}

.checkbox-label { cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 5px; }
.checkbox-label input { width: 14px; height: 14px; }
.radio-label { cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 4px; margin-right: 10px; }
.radio-label input { width: 14px; height: 14px; }

.tf-display, .corr-tf-display { flex: 1; min-width: 200px; }
.tf-display div, .corr-tf-display div {
    background: white;
    padding: 6px 12px;
    border-radius: 5px;
    border: 1px solid #ddd;
    font-size: 13px;
}

/* 参数说明面板 */
.param-desc-panel {
    margin: 0 25px 10px;
    padding: 12px 18px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.param-desc-panel h4 {
    color: #1a3c6e;
    font-size: 14px;
    margin-bottom: 10px;
}

.param-desc-content {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
}

.param-item {
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
}

.param-item .param-symbol {
    font-weight: 700;
    color: #1a3c6e;
}

.param-item .param-value {
    font-weight: 600;
    color: #d97706;
}

/* 图表区 */
.plots-row { padding: 8px 25px 0; }
.plot-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    border-left: 4px solid #1a3c6e;
    margin-bottom: 10px;
}
.plot-box h3 { color: #333; margin-bottom: 8px; font-size: 14px; }
.plot-box canvas {
    width: 100%;
    height: auto;
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* 指标卡片 */
.metrics-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 25px;
}

.metric-card {
    flex: 1;
    min-width: 130px;
    background: #f5f7fa;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

.metric-label { font-size: 11px; color: #666; margin-bottom: 3px; }
.metric-value { font-size: 15px; font-weight: bold; color: #1a3c6e; }
.metric-value.green { color: #16a34a; }
.metric-value.red { color: #dc2626; }
.metric-value.orange { color: #d97706; }

.improvement-card {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}
.improvement-card .metric-value {
    color: #16a34a;
}

/* 时域面板 */
.td-panel {
    margin: 12px 25px;
    padding: 18px;
    background: #f0f4ff;
    border: 2px solid #dbeafe;
    border-radius: 10px;
}
.td-panel h3 { color: #1a3c6e; margin-bottom: 12px; font-size: 15px; }

.td-content { display: flex; gap: 20px; margin-bottom: 12px; }
.td-left { flex: 0 0 35%; }
.td-right { flex: 1; }

.td-left h4, .td-right h4 {
    color: #333;
    font-size: 14px;
    margin-bottom: 8px;
}

.td-box {
    background: white;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    font-size: 14px;
    min-height: 40px;
}

.td-right canvas {
    width: 100%;
    height: auto;
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* 原理说明面板 */
.principle-panel {
    margin: 12px 25px;
    padding: 15px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
}
.principle-panel h4 {
    color: #92400e;
    font-size: 14px;
    margin-bottom: 10px;
}
.principle-content {
    font-size: 13px;
    color: #78350f;
    line-height: 1.8;
}
.principle-content strong {
    color: #92400e;
}

/* 图例 */
.legend {
    display: flex;
    gap: 15px;
    padding: 8px 25px;
    font-size: 12px;
    color: #666;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}
.legend-color {
    width: 20px;
    height: 3px;
    border-radius: 2px;
}
.legend-color.before { background: #2563eb; }
.legend-color.after { background: #dc2626; }
.legend-color.asy { background: #888; border-style: dashed; }

/* 页脚 */
.footer { padding: 18px 40px 22px; text-align: center; }

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

.footer-text {
    color: #1a3c6e;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 4px;
}

mjx-container { display: inline-block !important; }

@media (max-width: 900px) {
    .plots-row { flex-direction: column; }
    .td-content { flex-direction: column; }
    .td-left, .td-right { flex: 1; }
    .control-panel { flex-direction: column; }
}

@media (max-width: 600px) {
    body { padding: 5px; }
    .header { padding: 15px 20px; }
    .header h1 { font-size: 20px; letter-spacing: 2px; }
}