* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
}

body {
    min-height: 100vh;
    color: #1a365d;
    overflow-x: hidden;
}

.bg-animation {
    position: fixed;
    inset: 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.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.9);
    padding: 20px;
}

.container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 25px;
}

.top-bar {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
}

.back-btn {
    text-decoration: none;
    background: linear-gradient(135deg, #e0f2fe, #bfdbfe);
    color: #1d4ed8;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    margin-right: 20px;
    border: 1px solid #93c5fd;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s;
}

.back-btn:hover {
    background: #3b82f6;
    color: #fff;
    transform: translateX(-4px);
}

.top-bar h1 {
    font-size: 23px;
    color: #0f4c81;
    display: flex;
    align-items: center;
    gap: 8px;
}

.experiment-area {
    display: flex;
    align-items: flex-start;
    gap: 25px;
}

.control-panel {
    width: 400px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.control-panel h2 {
    color: #0f4c81;
    font-size: 17px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hint {
    color: #64748b;
    font-size: 13px;
    line-height: 1.7;
}

.input-box,
.slider-box {
    background: rgba(241, 245, 249, 0.9);
    border-radius: 10px;
    padding: 14px;
    border: 1px solid #e2e8f0;
}

.input-box label {
    display: block;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.input-box input {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 10px;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    outline: none;
    background: #fff;
    color: #334155;
    font-size: 14px;
    font-family: Consolas, 'Courier New', monospace;
}

.input-box input:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.14);
}

.small-btn {
    width: 100%;
    border: none;
    border-radius: 8px;
    padding: 10px 12px;
    color: #fff;
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
}

.small-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(124, 58, 237, 0.3);
}

.slider-header {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 7px;
    color: #64748b;
    font-size: 12px;
}

.slider-hint {
    margin-top: 8px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.65;
}

.current-val {
    color: #7c3aed;
    font-size: 13px;
    font-weight: 700;
}

.select-box {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    outline: none;
    background: #fff;
    color: #334155;
    font-size: 14px;
}

.select-box:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.14);
}

input[type="range"] {
    width: 100%;
    height: 6px;
    appearance: none;
    -webkit-appearance: none;
    background: linear-gradient(90deg, #ddd6fe, #7c3aed);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #fff;
    border: 3px solid #7c3aed;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #fff;
    border: 3px solid #7c3aed;
    border-radius: 50%;
    cursor: pointer;
}

.status-info {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.05), rgba(124, 58, 237, 0.1));
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 10px;
    padding: 12px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 11px;
    padding: 6px 0;
    color: #475569;
    font-size: 13px;
    border-bottom: 1px dashed rgba(124, 58, 237, 0.15);
}

.info-row:last-child {
    border-bottom: none;
}

.info-value {
    color: #6d28d9;
    font-family: Consolas, 'Courier New', monospace;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.theory-box {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.05), rgba(124, 58, 237, 0.1));
    border-left: 4px solid #7c3aed;
    border-radius: 0 10px 10px 0;
    padding: 12px;
}

.theory-box h3 {
    margin-bottom: 8px;
    color: #6d28d9;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.theory-box p {
    color: #4c1d95;
    font-size: 12px;
    line-height: 1.72;
    margin-bottom: 6px;
}

.theory-box .formula {
    padding: 8px;
    margin: 8px 0;
    text-align: center;
    background: rgba(255, 255, 255, 0.76);
    border-radius: 6px;
    color: #6d28d9;
    font-family: 'Times New Roman', serif;
    font-size: 15px;
    font-weight: 600;
}

.sigma {
    font-size: 20px;
    vertical-align: middle;
}

.theory-note {
    padding: 8px;
    margin-top: 8px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.72);
}

.contact-box {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(59, 130, 246, 0.1));
    border: 1px dashed #3b82f6;
    border-radius: 10px;
    padding: 12px;
}

.contact-box h3 {
    color: #1d4ed8;
    font-size: 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.contact-info {
    background: rgba(255, 255, 255, 0.82);
    padding: 10px;
    border-radius: 8px;
}

.contact-info p {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #0f4c81;
    font-size: 13px;
    margin-bottom: 4px;
}

.contact-info p:last-child {
    color: #dc2626;
    font-weight: 700;
    margin-bottom: 0;
}

.chart-panel {
    flex: 1;
    min-width: 0;
}

.chart-header {
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

.chart-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #0f4c81;
    font-size: 18px;
}

.charts-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chart-section {
    padding: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.chart-title {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 5px;
}

.chart-description {
    color: #64748b;
    font-size: 11px;
    line-height: 1.55;
    margin: 0 0 8px 16px;
}

.dot {
    display: inline-block;
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.blue { background: #3b82f6; }
.dot.green { background: #22c55e; }
.dot.orange { background: #f59e0b; }
.dot.purple { background: #7c3aed; }
.dot.red { background: #ef4444; }

.chart-box {
    width: 100%;
}

.constellation-chart {
    height: 310px;
    background: #1e293b;
    border-radius: 8px;
}

.time-chart {
    height: 300px;
}

.cp-chart {
    height: 305px;
}

.spectrum-chart {
    height: 345px;
}

.bit-display {
    min-height: 108px;
    padding: 14px;
    color: #e2e8f0;
    background: #1e293b;
    border-radius: 8px;
}

.bit-tip {
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 9px;
}

.bit-used-info {
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.6;
    margin-bottom: 10px;
    word-break: break-all;
}

.bit-group-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bit-group {
    min-width: 67px;
    padding: 8px 10px;
    text-align: center;
    background: rgba(124, 58, 237, 0.16);
    border: 1px solid rgba(124, 58, 237, 0.46);
    border-radius: 8px;
}

.bit-group span {
    display: block;
    margin-bottom: 3px;
    color: #94a3b8;
    font-size: 11px;
}

.bit-group strong {
    color: #67e8f9;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 15px;
    letter-spacing: 1px;
}

/* 第四张频谱图：不加宽、不横向滚动，保留放缩条 */
.spectrum-section {
    overflow: hidden;
}

.spectrum-scroll-hint {
    display: none !important;
}

.spectrum-scroll-wrap {
    width: 100% !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    padding-bottom: 0 !important;
    border-radius: 8px;
}

.spectrum-chart-inner {
    width: 100% !important;
    min-width: 0 !important;
}

.spectrum-section.scroll-enabled .spectrum-scroll-hint {
    display: none !important;
}

.spectrum-section.scroll-enabled .spectrum-scroll-wrap {
    width: 100% !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    padding-bottom: 0 !important;
}

.spectrum-section.scroll-enabled .spectrum-chart-inner {
    width: 100% !important;
    min-width: 0 !important;
}

.spectrum-section.scroll-enabled .spectrum-chart {
    height: 345px !important;
    touch-action: auto !important;
}

/* 第四张图 tooltip 两列显示，避免 k15 被挤出 */
.ofdm-tooltip-table {
    border-collapse: collapse;
    margin-top: 4px;
}

.ofdm-tooltip-table td {
    padding: 2px 12px 2px 0;
    white-space: nowrap;
    font-size: 12px;
    line-height: 1.35;
    color: #334155;
}

.ofdm-tooltip-table td:last-child {
    padding-right: 0;
}

.ofdm-tooltip-title {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 4px;
}

@media (max-width: 1060px) {
    .experiment-area {
        flex-direction: column;
    }

    .control-panel {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 16px 10px;
    }

    .glass-box {
        padding: 13px;
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .back-btn {
        margin-right: 0;
    }

    .top-bar h1 {
        font-size: 19px;
        line-height: 1.5;
    }

    .chart-section {
        padding: 9px;
    }

    .chart-title {
        line-height: 1.55;
    }

    .chart-description {
        margin-left: 0;
    }

    .constellation-chart {
        height: 335px;
    }

    .time-chart {
        height: 315px;
    }

    .cp-chart {
        height: 320px;
    }

    .spectrum-chart {
        height: 355px;
    }

    .spectrum-section.scroll-enabled .spectrum-chart {
        height: 355px !important;
    }

    .info-row {
        align-items: flex-start;
    }

    .info-value {
        max-width: 56%;
        white-space: normal;
        word-break: break-word;
    }

    .bit-group {
        min-width: 60px;
        padding: 7px;
    }

    .bit-group strong {
        font-size: 13px;
    }

    .ofdm-tooltip-table td {
        padding-right: 7px;
        font-size: 10px;
    }

    .ofdm-tooltip-title {
        font-size: 11px;
    }
}
/* v16.0：让图表更充分占据白色卡片，不改变图形数据 */
.chart-section {
    overflow: hidden;
}

/* 手机端减少卡片内边距，让图横向空间更大 */
@media (max-width: 600px) {
    .chart-section {
        padding: 7px;
    }

    .chart-description {
        margin-left: 0;
        margin-bottom: 6px;
        line-height: 1.45;
    }

    .constellation-chart {
        height: 360px !important;
    }

    .time-chart {
        height: 360px !important;
    }

    .cp-chart {
        height: 360px !important;
    }

    .spectrum-chart {
        height: 390px !important;
    }

    /* 第四张图不加宽、不横向滚动，保留 ECharts 自带放缩条 */
    .spectrum-section .spectrum-scroll-wrap,
    .spectrum-section.scroll-enabled .spectrum-scroll-wrap {
        width: 100% !important;
        overflow-x: hidden !important;
        overflow-y: hidden !important;
        padding-bottom: 0 !important;
    }

    .spectrum-section .spectrum-chart-inner,
    .spectrum-section.scroll-enabled .spectrum-chart-inner {
        width: 100% !important;
        min-width: 0 !important;
    }

    .spectrum-section.scroll-enabled .spectrum-scroll-hint,
    .spectrum-section .spectrum-scroll-hint {
        display: none !important;
    }
}

/* 第四张图 tooltip 两列显示，保证 k=0~k=15 都能看到 */
.ofdm-tooltip-title {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 4px;
}

.ofdm-tooltip-table {
    border-collapse: collapse;
    margin-top: 4px;
}

.ofdm-tooltip-table td {
    padding: 2px 12px 2px 0;
    white-space: nowrap;
    font-size: 12px;
    line-height: 1.35;
    color: #334155;
}

.ofdm-tooltip-table td:last-child {
    padding-right: 0;
}

@media (max-width: 600px) {
    .ofdm-tooltip-title {
        font-size: 11px;
    }

    .ofdm-tooltip-table td {
        font-size: 10px;
        padding-right: 7px;
    }
}
