/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    padding: 20px;
}

.player-container {
    width: 100%;
    max-width: 550px;
    background: rgba(26, 32, 44, 0.8);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

/* 播放器头部 */
.player-header {
    text-align: center;
    margin-bottom: 30px;
}

.program-info h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
    background: linear-gradient(90deg, #e6a919, #ff6b6b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.program-info h2 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 15px;
    color: #e2e8f0;
}

.episode-description {
    font-size: 14px;
    line-height: 1.5;
    color: #a0aec0;
    margin-bottom: 20px;
}

/* 可视化区域 */
.visualization-container {
    width: 100%;
    height: 120px;
    margin-bottom: 30px;
    border-radius: 10px;
    overflow: hidden;
    background: transparent;
    position: relative;
}

#visualizer {
    width: 100%;
    height: 100%;
    display: block;
}

/* 播放控制区域 */
.player-controls {
    width: 100%;
}

.time-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #a0aec0;
    margin-bottom: 10px;
}

.progress-container {
    width: 100%;
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    cursor: pointer;
    position: relative;
}

.progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #e6a919, #ff6b6b);
    border-radius: 5px;
    width: 0%;
    transition: width 0.1s linear;
}

.progress-fill::after {
    content: '';
    position: absolute;
    right: -5px;
    top: -3.5px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-bar:hover .progress-fill::after {
    opacity: 1;
}

.control-buttons {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.control-btn {
    background: none;
    border: none;
    color: #e2e8f0;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    color: #fff;
    transform: scale(1.1);
}

.play-btn {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #e6a919, #ff6b6b);
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    box-shadow: 0 3px 10px rgba(230, 169, 25, 0.3);
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(230, 169, 25, 0.4);
}

/* 音量控制 */
.volume-container {
    display: flex;
    align-items: center;
    position: relative;
}

.volume-slider {
    width: 0;
    overflow: hidden;
    transition: width 0.3s ease;
    margin-left: 5px;
}

.volume-container:hover .volume-slider {
    width: 80px;
}

.volume-bar {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.volume-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #e2e8f0;
    border-radius: 2px;
    width: 80%;
}

/* 设置面板 */
.settings-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(17, 24, 39, 0.95);
    padding: 20px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 10;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
}

.settings-panel.active {
    transform: translateY(0);
}

.settings-panel h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #e2e8f0;
    text-align: center;
}

.equalizer {
    margin-bottom: 20px;
}

.eq-control {
    margin-bottom: 15px;
}

.eq-control label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #a0aec0;
}

.slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #e6a919;
    cursor: pointer;
    transition: all 0.2s;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #ff6b6b;
}

.playback-speed label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    color: #a0aec0;
}

.speed-buttons {
    display: flex;
    justify-content: space-between;
}

.speed-buttons button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #a0aec0;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.speed-buttons button:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.speed-buttons button.active {
    background: linear-gradient(90deg, #e6a919, #ff6b6b);
    color: #fff;
}

.hidden {
    display: none;
}

/* 剧集徽章 */
.episode-badge {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 5px;
}

.episode-badge span {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: #a0aec0;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* 主题选择器 */
.theme-selector {
    margin-top: 25px;
    padding: 15px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-selector h4 {
    font-size: 14px;
    color: #a0aec0;
    margin-bottom: 10px;
}

.theme-options {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.theme-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.theme-option.active {
    border-color: #fff;
    transform: scale(1.1);
}

.theme-option:hover {
    transform: scale(1.1);
}

.theme-default {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.theme-purple {
    background: linear-gradient(135deg, #4a1d96 0%, #312e81 100%);
}

.theme-dark {
    background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
}

.theme-ocean {
    background: linear-gradient(135deg, #0c4a6e 0%, #0e7490 100%);
}

.theme-sunset {
    background: linear-gradient(135deg, #7c2d12 0%, #b45309 100%);
}

/* 播放列表面板 */
.playlist-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 24, 39, 0.98);
    padding: 20px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 20;
    overflow-y: auto;
    backdrop-filter: blur(10px);
}

.playlist-panel.active {
    transform: translateX(0);
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.playlist-header h3 {
    font-size: 18px;
    color: #e2e8f0;
}

.close-playlist {
    background: none;
    border: none;
    color: #a0aec0;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.close-playlist:hover {
    color: #fff;
}

.playlist-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.playlist-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s;
}

.playlist-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.playlist-item.active {
    background: linear-gradient(90deg, rgba(230, 169, 25, 0.2), rgba(255, 107, 107, 0.2));
    border-left: 3px solid #e6a919;
}

.playlist-item-info {
    flex: 1;
}

.playlist-item-title {
    font-size: 14px;
    font-weight: 500;
    color: #e2e8f0;
    margin-bottom: 3px;
}

.playlist-item-duration {
    font-size: 12px;
    color: #a0aec0;
}

.playlist-item-play {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e2e8f0;
    font-size: 12px;
}

/* 设置面板 */
.settings-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(17, 24, 39, 0.95);
    padding: 20px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 10;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
    /* 模糊 */
    backdrop-filter: blur(5px);
}

.settings-panel.active {
    transform: translateY(0);
}

.settings-panel h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #e2e8f0;
    text-align: center;
}

/* 添加音频效果按钮样式 */
.effect-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.effect-buttons button {
    background: rgba(230, 169, 25, 0.12);
    border: none;
    color: #e2e8f0;
    padding: 8px 20px;
    border-radius: 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    outline: none;
    font-weight: 500;
}

.effect-buttons button:hover {
    background: #e6a919;
    color: #22223b;
    transform: scale(1.07);
}

.effect-buttons button.active {
    background: linear-gradient(135deg, #e6a919, #ff6b6b);
    color: #fff;
    box-shadow: 0 2px 8px rgba(230, 169, 25, 0.25);
}

.equalizer {
    margin-bottom: 20px;
}



/* 响应式设计 */
@media (max-width: 600px) {
    body {
        padding: 15px;
    }
    
    .player-container {
        padding: 25px 20px;
        max-width: 100%;
        border-radius: 20px;
    }
    
    .player-header {
        margin-bottom: 25px;
    }
    
    .program-info h1 {
        font-size: 22px;
        line-height: 1.3;
    }
    
    .program-info h2 {
        font-size: 17px;
        margin-bottom: 12px;
    }
    
    .episode-description {
        font-size: 14px;
        max-width: 100%;
    }
    
    .visualization-container {
        height: 110px;
        margin-bottom: 25px;
    }
    
    .control-buttons {
        justify-content: space-around;
        gap: 5px;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .play-btn {
        width: 55px;
        height: 55px;
    }
    
    .volume-container:hover .volume-slider {
        width: 70px;
    }
    
    .volume-bar {
        width: 70px;
    }
    
    .settings-panel {
        padding: 20px 15px;
    }
    
    .effect-buttons {
        display: flex;
        gap: 10px;
        margin-bottom: 15px;
    }
    .effect-buttons button {
        background: rgba(230, 169, 25, 0.12);
        border: none;
        color: #e2e8f0;
        padding: 7px 18px;
        border-radius: 16px;
        font-size: 13px;
        cursor: pointer;
        transition: background 0.2s, color 0.2s, transform 0.2s;
        outline: none;
        font-weight: 500;
    }
    .effect-buttons button:hover {
        background: #e6a919;
        color: #22223b;
        transform: scale(1.07);
    }
    .effect-buttons button.active {
        background: linear-gradient(135deg, #e6a919, #ff6b6b);
        color: #fff;
        box-shadow: 0 2px 8px rgba(230, 169, 25, 0.25);
    }
}

.settings-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(17, 24, 39, 0.95);
    padding: 20px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 10;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
}

.settings-panel.active {
    transform: translateY(0);
}

.settings-panel h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #e2e8f0;
    text-align: center;
}

/* 添加关闭按钮样式 */
.close-settings {
    background: none;
    border: none;
    color: #e2e8f0;
    font-size: 24px;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 10px;
    transition: color 0.2s;
}

.close-settings:hover {
    color: #fff;
}

@media (max-width: 400px) {
    .player-container {
        padding: 20px 15px;
    }
    
    .program-info h1 {
        font-size: 20px;
    }
    
    .program-info h2 {
        font-size: 16px;
    }
    
    .control-buttons {
        gap: 2px;
    }
    
    .control-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .play-btn {
        width: 48px;
        height: 48px;
    }
}

.rest-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* 半透明黑色背景 */
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 24px;
    z-index: 100; /* 确保遮罩在最上层 */
    transition: opacity 0.3s ease;
}

.rest-overlay.hidden {
    opacity: 0;
    pointer-events: none; /* 禁止鼠标事件 */
}

.rest-overlay p {
    margin: 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.2); /* 半透明白色背景 */
    border-radius: 10px;
}
