
/* 音乐播放器样式 */
#music-player {
    position: fixed;
    top: 50%;
    right: 30px;
    transform: translateY(-50%);
    z-index: 99;
    cursor: grab;
}

/* 拖动后清除 transform，避免跳动 */
#music-player.dragged {
    transform: none;
}

/* 自动播放被拦截时的脉冲动画 */
@keyframes musicPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

#music-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: box-shadow 0.3s ease;
}

/* 拖动功能样式 */
#music-player.dragging {
    opacity: 0.8;
}

#music-player.dragging #music-icon {
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

#music-icon:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

#music-panel {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    width: 280px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: none;
    animation: slideLeft 0.3s ease;
}

@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

#music-panel h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 16px;
    text-align: center;
}

#playlist {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
    -webkit-overflow-scrolling: touch;
}

#playlist li {
    padding: 8px 12px;
    margin-bottom: 5px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 14px;
}

#playlist li:hover {
    background: #f0f0f0;
}

#audio-player {
    display: block;
    width: 100%;
    margin-top: 10px;
}

/* 适配平板设备 */
@media (max-width: 1024px) {
    #music-player {
        top: 50%;
        right: 15px;
        transform: translateY(-50%);
    }
    
    #music-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    #music-panel {
        width: 220px;
        padding: 10px;
        right: 60px;
        top: 50%;
        transform: translateY(-50%);
    }
}

/* 适配移动端 */
@media (max-width: 768px) {
    #music-player {
        top: 50%;
        right: 10px;
        transform: translateY(-50%);
    }
    
    #music-icon {
        width: 50px;
        height: 50px;
        font-size: 22px;
    }
    
    #music-panel {
        width: 190px;
        padding: 8px;
        right: 60px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    #music-panel h3 {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    #playlist li {
        padding: 4px 8px;
        font-size: 13px;
    }
}