/* ==================== 悬浮播放器样式 ==================== */
.global-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to right, #1a1a1a, #2d2d2d);
    border-top: 1px solid #3d3d3d;
    padding: 12px 24px;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

/* 播放器隐藏状态（滚动时） */
.global-player.hidden {
    transform: translateY(100%);
}

/* 迷你模式 */
.global-player.mini {
    transform: translateY(calc(100% - 80px));
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
}

.global-player.mini:hover {
    transform: translateY(0);
}

/* 播放器内容 */
.player-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    gap: 20px;
}

/* 歌曲信息 */
.player-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.player-info:hover {
    opacity: 0.9;
}

.player-cover {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

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

.player-info .song-title {
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.player-info .song-artist {
    font-size: 14px;
    color: #b3b3b3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* 播放控制 */
.player-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    max-width: 600px;
}

.control-btn {
    background: none;
    border: none;
    color: #b3b3b3;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.control-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.control-btn.primary {
    background: #fff;
    color: #000;
    font-size: 24px;
}

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

.control-btn.active {
    color: #8B5CF6;
}

/* 进度条 */
.progress-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.time {
    font-size: 12px;
    color: #b3b3b3;
    min-width: 40px;
    font-variant-numeric: tabular-nums;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: #4d4d4d;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, #8B5CF6, #EC4899);
    border-radius: 2px;
    position: relative;
    transition: width 0.1s linear;
}

.progress-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: -4px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-bar:hover .progress-fill::after {
    opacity: 1;
}

/* 右侧控制 */
.player-right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 120px;
    justify-content: flex-end;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-btn {
    background: none;
    border: none;
    color: #b3b3b3;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.volume-btn:hover {
    color: #fff;
}

.volume-slider {
    width: 80px;
    height: 4px;
    background: #4d4d4d;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.volume-fill {
    height: 100%;
    background: linear-gradient(to right, #8B5CF6, #EC4899);
    border-radius: 2px;
}

/* 迷你模式切换按钮 */
.mini-toggle {
    background: none;
    border: none;
    color: #b3b3b3;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.mini-toggle:hover,
.mini-toggle.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* 播放列表弹窗 */
.playlist-modal {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 360px;
    max-width: calc(100vw - 40px);
    background: #2d2d2d;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    display: none;
    border: 1px solid #3d3d3d;
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.playlist-modal.active {
    display: block;
}

.playlist-header {
    padding: 16px;
    border-bottom: 1px solid #3d3d3d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.playlist-header h3 {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

.playlist-close {
    background: none;
    border: none;
    color: #b3b3b3;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.playlist-close:hover {
    color: #fff;
}

.playlist-queue {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
}

/* 自定义滚动条 */
.playlist-queue::-webkit-scrollbar {
    width: 6px;
}

.playlist-queue::-webkit-scrollbar-track {
    background: #3d3d3d;
    border-radius: 3px;
}

.playlist-queue::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 3px;
}

.playlist-queue::-webkit-scrollbar-thumb:hover {
    background: #888;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.queue-item:hover {
    background: #3d3d3d;
}

.queue-item.playing {
    background: rgba(139, 92, 246, 0.2);
}

.queue-item.playing .queue-title {
    color: #8B5CF6;
}

.queue-item img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
}

.queue-info {
    flex: 1;
    overflow: hidden;
}

.queue-title {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-artist {
    color: #b3b3b3;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-remove {
    background: none;
    border: none;
    color: #b3b3b3;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    opacity: 0;
    transition: all 0.2s;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.queue-item:hover .queue-remove {
    opacity: 1;
}

.queue-remove:hover {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

.empty-queue {
    text-align: center;
    padding: 32px 16px;
    color: #b3b3b3;
    font-size: 14px;
}

.playlist-footer {
    padding: 12px 16px;
    border-top: 1px solid #3d3d3d;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #b3b3b3;
    font-size: 14px;
}

.clear-queue-btn {
    background: none;
    border: none;
    color: #f44336;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.clear-queue-btn:hover {
    background: rgba(244, 67, 54, 0.1);
}

/* Toast提示 */
.toast-container {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1002;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 24px;
    border-radius: 30px;
    background: #2d2d2d;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    max-width: 300px;
    text-align: center;
    border: 1px solid #3d3d3d;
}

.toast.success {
    background: linear-gradient(to right, #10b981, #059669);
    border-color: #34d399;
}

.toast.error {
    background: linear-gradient(to right, #ef4444, #dc2626);
    border-color: #f87171;
}

.toast.warning {
    background: linear-gradient(to right, #f59e0b, #d97706);
    border-color: #fbbf24;
}

.toast.info {
    background: linear-gradient(to right, #3b82f6, #2563eb);
    border-color: #60a5fa;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .global-player {
        padding: 8px 16px;
    }
    
    .global-player.mini {
        transform: translateY(calc(100% - 60px));
    }
    
    .player-content {
        gap: 8px;
    }
    
    .player-controls {
        gap: 4px;
    }
    
    .control-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .control-btn.primary {
        font-size: 20px;
    }
    
    .volume-control {
        display: none;
    }
    
    .player-info {
        min-width: auto;
        max-width: 120px;
    }
    
    .player-info .song-title {
        font-size: 14px;
        max-width: 80px;
    }
    
    .player-info .song-artist {
        font-size: 12px;
        max-width: 80px;
    }
    
    .player-cover {
        width: 40px;
        height: 40px;
    }
    
    .time {
        font-size: 10px;
        min-width: 30px;
    }
    
    .player-right {
        min-width: auto;
        gap: 4px;
    }
    
    .mini-toggle {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .playlist-modal {
        bottom: 70px;
        right: 10px;
        width: calc(100vw - 20px);
        max-width: none;
    }
    
    .playlist-queue {
        max-height: 300px;
    }
    
    .toast-container {
        bottom: 80px;
    }
    
    .toast {
        padding: 8px 16px;
        font-size: 13px;
        max-width: 250px;
    }
}

/* 播放状态指示器 */
.playing-indicator {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    gap: 3px;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 6px;
    border-radius: 12px;
}

.playing-indicator span {
    width: 3px;
    height: 12px;
    background: #8B5CF6;
    border-radius: 1.5px;
    animation: playing 1s ease infinite;
}

.playing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.playing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes playing {
    0%, 100% {
        height: 12px;
    }
    50% {
        height: 20px;
    }
}

/* 加载动画 */
.skeleton {
    background: linear-gradient(90deg, #2d2d2d 25%, #3d3d3d 50%, #2d2d2d 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 图片加载状态 */
.image-loading {
    opacity: 0;
}

.image-loaded {
    opacity: 1;
    transition: opacity 0.3s;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #b3b3b3;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #fff;
}

.empty-desc {
    font-size: 14px;
    color: #b3b3b3;
    margin-bottom: 24px;
}

.empty-btn {
    background: linear-gradient(to right, #8B5CF6, #EC4899);
    border: none;
    color: #fff;
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s;
}

.empty-btn:hover {
    transform: scale(1.05);
}

/* 加载更多 */
.load-more {
    text-align: center;
    padding: 20px;
}

.load-more-btn {
    background: #3d3d3d;
    border: 1px solid #4d4d4d;
    color: #fff;
    padding: 8px 24px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.load-more-btn:hover {
    background: #4d4d4d;
    border-color: #666;
}