* { 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: 1200px;
    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: 28px; letter-spacing: 4px; }
.header .subtitle { font-size: 13px; margin-top: 5px; opacity: 0.9; }

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

.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;
}

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

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

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

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

.param-item { font-size: 13px; color: #475569; }
.param-item .sym { font-weight: 700; color: #1a3c6e; }
.param-item .val { font-weight: 600; color: #d97706; }
.param-item .desc { color: #64748b; }

/* 方框图面板 */
.block-diagram-panel {
    margin: 10px 25px;
    padding: 12px 18px;
    background: #f0f4ff;
    border-radius: 8px;
    border: 1px solid #dbeafe;
}

.block-diagram-panel h4 {
    color: #1a3c6e;
    font-size: 14px;
    margin-bottom: 8px;
}

#blockDiagramCanvas {
    width: 100%;
    height: 120px;
    display: block;
}

/* 主内容区 */
.main-row {
    display: flex;
    gap: 20px;
    padding: 15px 25px;
}

.left-panel { flex: 0 0 45%; }
.right-panel { flex: 1; }

/* 分析卡片 */
.analysis-card, .coeff-card {
    background: #f5f7fa;
    border-radius: 10px;
    padding: 20px;
    height: 100%;
}

.analysis-card h3, .coeff-card h3 {
    color: #1a3c6e;
    font-size: 16px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #d4a853;
}

.analysis-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e8e8e8;
}

.analysis-item .label { color: #555; font-size: 14px; }
.analysis-item .value { font-weight: 600; font-size: 16px; color: #1a3c6e; }

.ess-value { font-size: 20px !important; }
.ess-value.zero { color: #16a34a; }
.ess-value.finite { color: #d97706; }
.ess-value.infinite { color: #dc2626; }

.analysis-status {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
}

.analysis-status.green { background: #dcfce7; color: #16a34a; }
.analysis-status.orange { background: #fef3c7; color: #d97706; }
.analysis-status.red { background: #fee2e2; color: #dc2626; }

.analysis-tip {
    margin-top: 10px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* 误差系数 */
.coeff-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 15px;
}

.coeff-item {
    background: white;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.coeff-label { font-size: 11px; color: #666; margin-bottom: 5px; }
.coeff-value { font-size: 18px; font-weight: bold; color: #1a3c6e; }

.coeff-info {
    font-size: 13px;
    color: #555;
    margin-bottom: 12px;
}

.formula-box {
    background: white;
    padding: 12px;
    border-radius: 6px;
    min-height: 60px;
    border: 1px solid #e8e8e8;
}

/* 时域面板 */
.time-domain-panel {
    margin: 0 25px 15px;
    padding: 18px;
    background: #f0f4ff;
    border: 2px solid #dbeafe;
    border-radius: 10px;
}

.time-domain-panel h3 {
    color: #1a3c6e;
    font-size: 15px;
    margin-bottom: 12px;
}

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

.cl-label { font-weight: 600; color: #333; font-size: 13px; white-space: nowrap; }

.cl-info div {
    background: white;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 13px;
}

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

.response-info {
    margin-top: 10px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}

.response-info.green { color: #16a34a; }
.response-info.orange { color: #d97706; }
.response-info.red { color: #dc2626; }

/* 页脚 */
.footer { padding: 15px 40px 20px; 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;
}

@media (max-width: 800px) {
    .main-row { flex-direction: column; }
    .left-panel, .right-panel { flex: 1; }
    .control-panel { flex-direction: column; }
    .coeff-grid { grid-template-columns: 1fr; }
}

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