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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 播放器容器 */
.music-player-container {
    max-width: 800px;
    margin: 50px auto;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 播放器头部 */
.player-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-header h1 {
    font-size: 24px;
    font-weight: 600;
}

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

.btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* 播放器主体 */
.player-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

/* 播放列表部分 */
.playlist-section {
    display: flex;
    flex-direction: column;
}

.playlist-section h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #555;
}

#playlist-container {
    flex: 1;
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    overflow-y: auto;
    max-height: 400px;
}

.empty-message {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-style: italic;
}

/* 音乐项样式 */
.song-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 5px;
}

.song-item:hover {
    background-color: #e8e8e8;
}

.song-item.active {
    background-color: #667eea;
    color: white;
}

.song-item .song-number {
    width: 30px;
    font-size: 14px;
    color: #999;
}

.song-item.active .song-number {
    color: white;
}

.song-item .song-info {
    flex: 1;
}

.song-item .song-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}

.song-item .song-path {
    font-size: 12px;
    color: #999;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.song-item.active .song-path {
    color: rgba(255, 255, 255, 0.8);
}

/* 播放器控制部分 */
.player-section {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.current-song-info {
    text-align: center;
    margin-bottom: 30px;
}

#current-song-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

#current-song-artist {
    font-size: 14px;
    color: #999;
}

/* 进度条容器 */
.progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
}

.progress-container span {
    font-size: 12px;
    color: #666;
    min-width: 45px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    transition: all 0.2s ease;
}

.progress-bar::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #764ba2;
}

/* 播放控制按钮 */
.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.control-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
}

.control-btn:hover {
    background-color: #f0f0f0;
    transform: scale(1.1);
}

.play-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 28px;
}

.play-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: scale(1.1);
}

/* 音量控制 */
.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
}

.volume-bar {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.volume-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.volume-bar::-webkit-slider-thumb:hover {
    background: #333;
    transform: scale(1.2);
}

/* 滚动条样式 */
#playlist-container::-webkit-scrollbar {
    width: 6px;
}

#playlist-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#playlist-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#playlist-container::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .music-player-container {
        margin: 20px;
    }
    
    .player-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .player-main {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    
    .playlist-section {
        order: 2;
    }
    
    .player-section {
        order: 1;
    }
    
    #playlist-container {
        max-height: 300px;
    }
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.loading::after {
    content: '';
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}