/* 音频播放器样式 */

/* 页面基础样式 */
body {
    margin: 0;
    padding: 0;
    background: #000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    height: 100vh;
    overflow: hidden;
}

/* 音频播放器 */
.music-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: #171717;
    color: white;
    padding: 0.75rem 1rem;
    border-top: 1px solid #404040;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.player-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* 左侧：专辑封面和歌曲信息 */
.player-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 25%;
    max-width: 50%;
    min-width: 200px;
}

.album-art {
    width: 4rem;
    height: 4rem;
    border-radius: 0.375rem;
    object-fit: cover;
    background: #404040;
}

.song-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.song-title {
    font-size: 1rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.song-artist {
    font-size: 1rem;
    color: #a3a3a3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 中间：播放控制和进度条 */
.player-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    padding: 0 1rem;
    max-width: 32rem;
}

.controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.control-btn {
    background: none;
    border: none;
    color: #a3a3a3;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: #262626;
    color: white;
}

.control-btn.active {
    color: #ef4444;
}

.play-btn {
    background: white !important;
    color: black !important;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-btn:hover {
    background: #e5e5e5 !important;
}

.play-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.play-btn.playing::after {
    content: "⏸";
    font-size: 1rem;
}

.progress-container {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0.5rem;
}

.time-current,
.time-total {
    font-size: 1rem;
    color: #a3a3a3;
    min-width: 2.5rem;
    text-align: center;
}

.progress-bar {
    flex: 1;
    height: 0.25rem;
    cursor: pointer;
}

.progress-track {
    position: relative;
    width: 100%;
    height: 100%;
    background: #404040;
    border-radius: 0.125rem;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #ef4444;
    border-radius: 0.125rem;
    width: 5%;
    transition: width 0.1s ease;
}

.progress-thumb {
    position: absolute;
    top: 50%;
    left: 5%;
    width: 0.75rem;
    height: 0.75rem;
    background: #ef4444;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: all 0.2s ease;
}

.progress-bar:hover .progress-thumb {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
}

/* 右侧：音量和其他操作 */
.player-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 25%;
    justify-content: flex-end;
    min-width: 200px;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.volume-bar {
    width: 6rem;
    height: 0.25rem;
    cursor: pointer;
}

.volume-track {
    position: relative;
    width: 100%;
    height: 100%;
    background: #404040;
    border-radius: 0.125rem;
}

.volume-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #a3a3a3;
    border-radius: 0.125rem;
    width: 70%;
    transition: width 0.1s ease;
}

.volume-thumb {
    position: absolute;
    top: 50%;
    left: 70%;
    width: 0.75rem;
    height: 0.75rem;
    background: #a3a3a3;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: all 0.2s ease;
}

.volume-bar:hover .volume-thumb {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
}

/* 桌面端隐藏移动端容器 */
.mobile-top-row {
    display: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .music-player {
        padding: 0.5rem 0.75rem;
    }
    
    .player-container {
        flex-direction: column;
        height: auto;
        gap: 0.75rem;
        padding: 0.5rem 0;
    }
    
    /* 显示移动端水平对齐容器 */
    .mobile-top-row {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        gap: 1rem;
    }
    
    /* 隐藏PC端的player-left */
    .player-container > .player-left {
        display: none;
    }
    
    /* 隐藏PC端player-center中的controls */
    .player-center > .controls {
        display: none;
    }
    
    /* 移动端容器内的player-left样式 */
    .mobile-top-row .player-left {
        width: auto;
        min-width: auto;
        justify-content: flex-start;
        gap: 0.5rem;
        flex: 1;
        display: flex;
    }
    
    .album-art {
        width: 3rem;
        height: 3rem;
    }
    
    .player-center {
        width: 100%;
        max-width: none;
        padding: 0;
        gap: 0.5rem;
    }
    
    /* 移动端容器内的controls样式 */
    .mobile-top-row .controls {
        gap: 0.75rem;
        margin-bottom: 0;
        width: auto;
        flex-shrink: 0;
        display: flex;
    }
    
    .player-right {
        width: 100%;
        min-width: auto;
        justify-content: center;
    }
    
    .volume-container,
    #volume-btn {
        display: none;
    }
    
    .progress-bar {
        height: 0.25rem;
    }
    
    .progress-thumb {
        width: 0.75rem;
        height: 0.75rem;
    }
}

@media (max-width: 480px) {
    .music-player {
        padding: 0.375rem 0.5rem;
    }
    
    .player-container {
        gap: 0.5rem;
        padding: 0.25rem 0;
    }
    
    .album-art {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .controls {
        gap: 0.5rem;
        margin-bottom: 0.25rem;
    }
    
    .control-btn {
        padding: 0.25rem;
        width: 2.75rem;
        height: 2.75rem;
    }
    
    .play-btn {
        width: 3rem;
        height: 3rem;
    }
    
    .play-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .song-title {
        font-size: 1rem;
        margin-bottom: 0.125rem;
    }
    
    .song-artist {
        font-size: 1rem;
    }
    
    .time-current,
    .time-total {
        font-size: 1rem;
    }
    
    .progress-container {
        gap: 0.375rem;
    }
    
    .progress-bar {
        height: 0.2rem;
    }
    
    .progress-thumb {
        width: 0.65rem;
        height: 0.65rem;
    }
    
    .volume-container,
    #volume-btn {
        display: none;
    }
}

@media (max-width: 360px) {
    .music-player {
        padding: 0.25rem 0.375rem;
    }
    
    .album-art {
        width: 2rem;
        height: 2rem;
    }
    
    .controls {
        gap: 0.375rem;
    }
    
    .control-btn {
        width: 2.75rem;
        height: 2.75rem;
        padding: 0.125rem;
    }
    
    .play-btn {
        width: 3rem;
        height: 3rem;
    }
    
    .play-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .song-title {
        font-size: 1rem;
    }
    
    .song-artist {
        font-size: 1rem;
    }
    
    .time-current,
    .time-total {
        font-size: 1rem;
    }
    
    .progress-container {
        gap: 0.25rem;
    }
    
    .volume-container,
    #volume-btn {
        display: none;
    }
}