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

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
}

/* 播放器容器 */
.music-player-container {
    max-width: 400px;
    width: 100%;
    margin: 20px;
}

.music-player {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    position: relative;
}

/* 专辑封面 */
.album-cover {
    width: 200px;
    height: 200px;
    margin: 0 auto 30px;
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.cover-animation {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 15%;
    height: 15%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    z-index: 1;
}

/* 歌曲信息 */
.song-info {
    text-align: center;
    margin-bottom: 25px;
}

.song-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.artist-name {
    font-size: 1rem;
    color: #666;
    font-weight: 400;
}

/* 进度条 */
.progress-container {
    margin-bottom: 25px;
}

.progress-bar {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    position: relative;
    cursor: pointer;
    margin-bottom: 8px;
}

.progress {
    height: 100%;
    background: #667eea;
    border-radius: 2px;
    width: 0;
    position: relative;
    transition: width 0.1s linear;
}

.progress-handle {
    width: 12px;
    height: 12px;
    background: #667eea;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    right: -6px;
    transform: translateY(-50%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-bar:hover .progress-handle {
    opacity: 1;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #888;
}

/* 控制按钮 */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
}

.control-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 15px;
    border-radius: 50%;
    padding: 10px;
}

.control-btn:hover {
    color: #667eea;
}

.play-btn {
    width: 60px;
    height: 60px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    margin: 0 20px;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.play-btn:hover {
    background: #5a67d8;
    color: white;
    transform: scale(1.05);
}

.play-btn i {
    position: absolute;
    transition: opacity 0.2s;
}

.play-btn i.fa-pause {
    opacity: 0;
}

.repeat-btn.active {
    color: #667eea;
}

.repeat-btn.repeat-one::after {
    content: '1';
    position: absolute;
    font-size: 0.6rem;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #667eea;
    color: white;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 5px;
}

.playing .play-btn i.fa-play {
    opacity: 0;
}

.playing .play-btn i.fa-pause {
    opacity: 1;
}

/* 音量控制 */
.volume-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
}

.volume-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
    margin-right: 10px;
}

.volume-btn i {
    position: absolute;
    transition: opacity 0.2s;
}

.volume-btn i.fa-volume-off {
    opacity: 0;
}

.muted .volume-btn i.fa-volume-up {
    opacity: 0;
}

.muted .volume-btn i.fa-volume-off {
    opacity: 1;
}

.volume-slider {
    width: 100px;
}

.volume-input {
    width: 100%;
    -webkit-appearance: none;
    height: 3px;
    background: #e0e0e0;
    border-radius: 1.5px;
    outline: none;
}

.volume-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.volume-input::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: none;
}

/* 播放列表 */
.playlist-container {
    position: relative;
}

.playlist-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
    width: 100%;
    padding: 10px;
    text-align: center;
    border-radius: 30px;
    background: rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.playlist-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #667eea;
}

/* 触摸反馈样式 */
.touch-active {
    transform: scale(0.95);
    opacity: 0.8;
    transition: transform 0.1s, opacity 0.1s;
}

.playlist {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 15px 15px 0 0;
    box-shadow: 0 -10px 20px rgba(0, 0, 0, 0.1);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    z-index: 10;
}

.playlist.active {
    max-height: 300px;
}

.playlist h3 {
    padding: 15px;
    font-size: 1.1rem;
    border-bottom: 1px solid #eee;
}

.playlist-items {
    list-style: none;
    max-height: 250px;
    overflow-y: auto;
}

.playlist-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.playlist-song-title {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-artist-name {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-duration {
    font-size: 0.85rem;
    color: #999;
    min-width: 45px;
    text-align: right;
}

.playlist-item:hover {
    background: #f9f9f9;
}

.playlist-item.active {
    background: #e6ebff;
    color: #667eea;
}

/* 动画效果 */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.playing .cover-image {
    animation: rotate 20s linear infinite;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .music-player {
        padding: 20px;
        margin: 10px;
    }
    
    .album-cover {
        width: 150px;
        height: 150px;
    }
    
    .song-title {
        font-size: 1.3rem;
    }
    
    .artist-name {
        font-size: 0.9rem;
    }
    
    .play-btn {
        width: 50px;
        height: 50px;
    }
    
    .control-btn {
        margin: 0 10px;
        min-width: 40px;
        min-height: 40px;
    }
    
    .volume-slider {
        width: 80px;
    }
    
    /* 移动端播放列表优化 */
    .playlist {
        max-height: 200px;
    }
    
    .playlist-items {
        max-height: 150px;
    }
    
    .playlist-item {
        padding: 10px 12px;
    }
    
    .playlist-song-title {
        font-size: 0.9rem;
    }
    
    .playlist-artist-name {
        font-size: 0.8rem;
    }
}

/* 滚动条样式 */
.playlist-items::-webkit-scrollbar {
    width: 4px;
}

.playlist-items::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.playlist-items::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.playlist-items::-webkit-scrollbar-thumb:hover {
    background: #999;
}