/**
 * 音乐播放器页面样式
 * 与主站风格统一的科技美学设计
 */

/* 复用主站变量 */
@import url('./style.css');

/* 音乐页面容器 */
.music-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 50%, rgba(0, 212, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(100, 255, 218, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    padding-top: 80px;
    padding-bottom: 100px; /* 为底部播放条留空间 */
    position: relative;
    overflow: hidden;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* 背景光晕层 */
.music-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(124, 58, 237, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(100, 255, 218, 0.1) 0%, transparent 50%);
    z-index: 1;
    pointer-events: none;
}

/* 径向渐变遮罩层 */
.music-page::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, rgba(10, 25, 47, 0.4) 100%);
    z-index: 2;
    pointer-events: none;
}

/* 音频可视化画布 */
#audio-visualizer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.3;
    pointer-events: none;
}

/* 粒子网络画布 */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

/* 音乐容器布局 - 左右分栏 */
.music-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 4;
    align-items: center;
}

/* 左侧：专辑封面区域 */
.player-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 大屏曲目信息 */
.main-track-info {
    text-align: center;
    margin-top: 2rem;
}

.main-track-info .track-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--light-text);
    margin-bottom: 0.5rem;
}

.main-track-info .track-artist {
    font-size: 1.2rem;
    color: var(--text-color);
}

/* 专辑封面 - 加大尺寸 */
.album-art {
    width: 320px;
    height: 320px;
    margin: 0 auto;
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.art-rotate {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #00d4ff, #7c3aed);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6rem;
    color: white;
    animation: rotateArt 20s linear infinite;
    animation-play-state: paused;
}

.art-rotate.playing {
    animation-play-state: running;
}

@keyframes rotateArt {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    transition: height 0.2s;
}

.progress-bar:hover {
    height: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #64ffda);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: #64ffda;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

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

/* 控制按钮区域 */
.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.btn-control {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid var(--tech-blue);
    color: var(--tech-blue);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-control:hover {
    background: rgba(0, 212, 255, 0.1);
    transform: scale(1.1);
}

.btn-control.active {
    background: var(--tech-blue);
    color: var(--primary-dark);
}

.btn-play {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d4ff, #7c3aed);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-play:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
}

/* 音量控制 */
.volume-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 2rem;
}

.volume-control i {
    color: var(--text-color);
    font-size: 1.2rem;
}

#volume-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--tech-blue);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

#volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* 播放列表面板 */
.playlist-panel {
    background: rgba(17, 34, 64, 0.6);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 0;
    border: 1px solid rgba(100, 255, 218, 0.1);
    max-height: 600px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.playlist-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.playlist-header h3 {
    color: var(--light-text);
    margin: 0;
    font-size: 1.1rem;
}

.playlist-count {
    color: var(--text-color);
    font-size: 0.85rem;
}

.playlist {
    flex: 1;
    overflow-y: auto;
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.playlist::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.playlist::-webkit-scrollbar-thumb {
    background: var(--tech-blue);
    border-radius: 3px;
}

.playlist-item {
    padding: 1rem 1.5rem;
    background: transparent;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.playlist-item:last-child {
    border-bottom: none;
}

.playlist-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.playlist-item.active {
    background: rgba(0, 212, 255, 0.1);
}

.playlist-item.active .playlist-item-title {
    color: var(--tech-blue);
}

.playlist-item-cover {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background: linear-gradient(135deg, #00d4ff, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.playlist-item-info {
    flex: 1;
    min-width: 0;
}

.playlist-item-title {
    color: var(--light-text);
    font-weight: 500;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item-artist {
    color: var(--text-color);
    font-size: 0.9rem;
}

.playlist-item.active .playlist-item-title {
    color: var(--tech-blue);
}

/* 响应式设计 */
@media (max-width: 992px) {
    .music-container {
        grid-template-columns: 1fr;
    }

    .playlist-panel {
        max-height: 400px;
    }

    .album-art {
        width: 280px;
        height: 280px;
    }
}

@media (max-width: 768px) {
    .bottom-player {
        flex-direction: column;
        height: auto;
        padding: 0.75rem 1rem;
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0));
        gap: 0.75rem;
    }

    .bottom-player-info {
        width: 100%;
    }

    .bottom-player-controls {
        width: 100%;
    }

    .bottom-player-progress {
        max-width: 100%;
    }

    .bottom-player-volume {
        display: none;
    }
}

@media (max-width: 576px) {
    .music-page {
        padding-top: 70px;
        padding-bottom: 140px;
    }

    .album-art {
        width: 220px;
        height: 220px;
    }

    .art-rotate {
        font-size: 4rem;
    }

    .main-track-info .track-title {
        font-size: 1.5rem;
    }

    .bottom-player-buttons .btn-control {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .bottom-player-buttons .btn-play {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .bottom-player {
        min-height: calc(80px + env(safe-area-inset-bottom, 0));
    }
}

/* ============ 底部播放条样式 ============ */

/* 底部播放条容器 */
.bottom-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: rgba(20, 20, 30, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    padding-bottom: env(safe-area-inset-bottom, 0);
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

/* 左侧：歌曲信息 */
.bottom-player-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 280px;
    flex-shrink: 0;
}

.bottom-player-cover {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: linear-gradient(135deg, #00d4ff, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
    transition: var(--transition);
}

.bottom-player-cover.playing {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(0, 212, 255, 0);
    }
}

.bottom-player-text h4 {
    color: var(--light-text);
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.bottom-player-text p {
    color: var(--text-color);
    margin: 0.25rem 0 0 0;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* 中间：播放控制 */
.bottom-player-controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    max-width: 600px;
    margin: 0 2rem;
}

.bottom-player-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bottom-player-buttons .btn-control {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottom-player-buttons .btn-control:hover {
    color: var(--tech-blue);
    transform: scale(1.1);
}

.bottom-player-buttons .btn-control.active {
    color: var(--tech-blue);
}

.bottom-player-buttons .btn-play {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d4ff, #7c3aed);
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottom-player-buttons .btn-play:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

/* 底部播放条进度条 */
.bottom-player-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.bottom-player-progress .current-time,
.bottom-player-progress .duration {
    font-size: 0.75rem;
    color: var(--text-color);
    min-width: 40px;
}

/* 右侧：音量控制 */
.bottom-player-volume {
    width: 140px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.bottom-player-volume i {
    color: var(--text-color);
    font-size: 1rem;
}

.bottom-player-volume input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
}

.bottom-player-volume input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--tech-blue);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.bottom-player-volume input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}
