/* 基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', sans-serif;
}

body {
    min-height: 100vh;
    color: #1a365d;
    overflow-x: hidden;
}

/* 背景与盒子 */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(-45deg, #f0f8ff, #e0f2fe, #bae6fd, #ffffff);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    z-index: -1;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.glass-box {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 1);
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(14, 65, 136, 0.1);
    padding: 25px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* 头部与返回按钮 */
.top-bar {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.back-btn {
    text-decoration: none;
    background: #e0f2fe;
    color: #0284c7;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    margin-right: 30px;
    transition: 0.3s;
    border: 1px solid #bae6fd;
}

.back-btn:hover {
    background: #0284c7;
    color: white;
    transform: translateX(-5px);
}

.top-bar h1 {
    font-size: 26px;
    color: #0f4c81;
}

/* 左右排版 */
.experiment-area {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.control-panel {
    flex: 1;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-panel h2 {
    font-size: 20px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
    color: #0f4c81;
}

.hint {
    font-size: 14px;
    color: #64748b;
    margin-bottom: -10px;
    line-height: 1.6;
}

/* 滑块样式 */
.slider-box {
    background: #f8fafc;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.slider-box label {
    display: block;
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: bold;
    color: #334155;
}

input[type=range] {
    width: 100%;
    cursor: pointer;
    accent-color: #0284c7;
}

/* 理论知识框 */
.theory-box {
    background: #f0fdf4;
    border-left: 5px solid #22c55e;
    padding: 15px;
    border-radius: 0 10px 10px 0;
    font-size: 14px;
    line-height: 1.8;
    color: #166534;
}

.theory-box h3 {
    margin-bottom: 8px;
    color: #15803d;
}

.formula {
    font-family: 'Times New Roman', Times, serif;
    font-size: 18px;
    font-style: italic;
    text-align: center;
    font-weight: bold;
    letter-spacing: 1px;
    margin: 10px 0;
    color: #16a34a;
    word-break: break-word;
}

/* 联系卡片样式 */
.contact-box {
    background: #eff6ff;
    border: 1px dashed #93c5fd;
    padding: 15px;
    border-radius: 10px;
    margin-top: auto;
}

.contact-box h3 {
    font-size: 16px;
    color: #1d4ed8;
    margin-bottom: 8px;
}

.contact-box p {
    font-size: 13px;
    color: #475569;
    margin-bottom: 10px;
    line-height: 1.5;
}

.contact-info {
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.contact-info p {
    margin-bottom: 5px;
    font-size: 14px;
    color: #0f4c81;
}

.contact-info p:last-child {
    margin-bottom: 0;
    color: #e11d48;
    font-size: 16px;
}

/* 右侧图表区 */
.chart-panel {
    flex: 2;
    min-width: 500px;
    display: flex;
    flex-direction: column;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
    flex-wrap: wrap;
}

.chart-header h2 {
    font-size: 20px;
    color: #0f4c81;
    margin: 0;
}

.signal-status {
    font-size: 14px;
    font-weight: bold;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 120px;
}

.signal-status span {
    padding: 5px 12px;
    border-radius: 20px;
    color: white;
    transition: 0.3s;
    white-space: nowrap;
    display: inline-block;
    line-height: 1.2;
}

/* 状态颜色 */
.badge-excellent {
    background-color: #22c55e;
}

.badge-fair {
    background-color: #eab308;
}

.badge-poor {
    background-color: #ef4444;
}

/* =========================
   幅度谱美化
   ========================= */
.spectrum-box {
    margin-top: 15px;
    padding: 16px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(239, 246, 255, 0.95));
    border: 1px solid rgba(191, 219, 254, 0.8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.spectrum-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.spectrum-bar h3 {
    font-size: 16px;
    color: #0f4c81;
    margin: 0;
}

.spectrum-bar p {
    margin-top: 4px;
    font-size: 12px;
    color: #64748b;
}

.spectrum-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.spec-tag {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
}

.tag-blue {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
}

.tag-purple {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
}

#spectrumChart {
    width: 100%;
    height: 260px;
}

/* 响应式 */
@media (max-width: 900px) {
    .experiment-area {
        flex-direction: column;
    }

    .chart-panel {
        min-width: 100%;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 18px 12px;
    }

    .glass-box {
        padding: 18px;
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .back-btn {
        margin-right: 0;
    }

    .top-bar h1 {
        font-size: 22px;
    }

    .chart-header {
        align-items: flex-start;
    }

    .chart-header h2 {
        font-size: 18px;
    }

    .signal-status {
        font-size: 12px;
        width: 100%;
        justify-content: flex-start;
    }

    .signal-status span {
        font-size: 12px;
        padding: 5px 10px;
    }

    .formula {
        font-size: 15px;
        letter-spacing: 0;
    }

    .spectrum-bar h3 {
        font-size: 15px;
    }

    .spectrum-bar p {
        font-size: 11px;
    }

    #spectrumChart {
        height: 240px;
    }
}
