/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 深色主题背景 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

/* 波形切换按钮 */
.toggle-waves-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 100;
}

.toggle-waves-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.toggle-waves-btn.hidden-waves {
    opacity: 0.5;
}

/* 标题区域 */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 20px;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.emoji {
    font-size: 80px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3));
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

h1 {
    font-size: 48px;
    font-weight: 700;
    background: linear-gradient(135deg, #00d4ff, #9b59b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
    letter-spacing: 2px;
}

.subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 10px;
}

/* 控制面板 */
.control-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* 强度选择区域 */
.intensity-section {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
}

.label {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.intensity-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.intensity-btn {
    padding: 10px 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.intensity-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.intensity-btn.active {
    background: linear-gradient(135deg, #00d4ff, #9b59b6);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

/* 模式选择区域 */
.mode-section {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
}

.mode-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 15px 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-3px);
}

.mode-btn.active {
    background: linear-gradient(135deg, #9b59b6, #e74c3c);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 20px rgba(155, 89, 182, 0.5);
}

.mode-number {
    font-size: 24px;
    font-weight: 700;
}

.mode-name {
    font-size: 12px;
    opacity: 0.9;
}

/* 操作按钮区域 */
.action-section {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.start-btn, .stop-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 40px;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.start-btn {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: #fff;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0, 212, 255, 0.6);
}

.stop-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    box-shadow: 0 4px 20px rgba(231, 76, 60, 0.4);
}

.stop-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(231, 76, 60, 0.6);
}

.btn-icon {
    font-size: 24px;
}

/* 状态指示器 */
.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2ecc71;
    animation: pulse 2s infinite;
}

.status-indicator.active .status-dot {
    background: #e74c3c;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 波形显示区域 */
.waveform-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    transition: all 0.3s ease;
}

.waveform-container.hidden {
    display: none;
}

.waveform-box {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.waveform-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.waveform-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.waveform-icon {
    font-size: 20px;
}

.waveform-canvas {
    width: 100%;
    height: 150px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.5);
}

/* 错误消息 */
.error-message {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.5);
    color: #ff6b6b;
    padding: 15px 20px;
    border-radius: 10px;
    text-align: center;
    margin-top: 20px;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* 工具类 */
.hidden {
    display: none !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 36px;
    }

    .emoji {
        font-size: 60px;
    }

    .control-panel {
        padding: 20px;
    }

    .intensity-section, .mode-section {
        flex-direction: column;
        text-align: center;
    }

    .intensity-buttons, .mode-buttons {
        justify-content: center;
    }

    .mode-btn {
        min-width: 80px;
        padding: 12px 15px;
    }

    .mode-name {
        font-size: 10px;
    }

    .waveform-container {
        grid-template-columns: 1fr;
    }

    .waveform-canvas {
        height: 120px;
    }

    .start-btn, .stop-btn {
        padding: 12px 30px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 28px;
    }

    .emoji {
        font-size: 50px;
    }

    .intensity-btn {
        padding: 8px 15px;
        font-size: 12px;
    }

    .mode-btn {
        min-width: 70px;
        padding: 10px 12px;
    }

    .mode-number {
        font-size: 18px;
    }

    .toggle-waves-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}
