/* ============ 迷你音乐播放条 ============ */
.mini-music-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #FFFFFF;
    border-top: 1px solid #DCE5EE;
    z-index: 990;
    display: flex;
    align-items: center;
    padding: 0 16px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

/* 左侧封面+歌名区域（可点击展开） */
.mini-music-cover-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
    padding: 8px 0;
    -webkit-tap-highlight-color: transparent;
}

.mini-music-cover-wrap:active {
    opacity: 0.7;
}

/* 封面 40x40 圆形 */
.mini-music-cover {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #F6F9FC;
}

/* 播放时封面旋转 */
.mini-music-cover.is-playing {
    animation: coverSpin 8s linear infinite;
}

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

/* 歌曲信息 */
.mini-music-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.mini-music-title {
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

/* 右侧控制按钮 */
.mini-music-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

.mini-music-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #333333;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.mini-music-btn:active {
    transform: scale(0.9);
}

/* 播放/暂停按钮 36x36 */
#miniMusicToggle {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #4A8DB7, #6BAED6);
    color: #FFFFFF;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(74, 141, 183, 0.3);
}

#miniMusicToggle:active {
    background: linear-gradient(135deg, #3A7A9E, #4A8DB7);
}

/* 下一首按钮 32x32 */
.mini-music-next {
    width: 32px;
    height: 32px;
    font-size: 13px;
    color: #666666;
}

.mini-music-next:hover {
    color: #4A8DB7;
}

/* 迷你条底部进度条 */
.mini-music-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: transparent;
}

.mini-music-progress-fill {
    height: 100%;
    background: #4A8DB7;
    width: 0%;
    transition: width 0.1s linear;
}

/* ============ 展开面板 ============ */
.music-expand-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 991;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.music-expand-overlay.active {
    display: block;
    opacity: 1;
}

.music-expand-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 400px;
    background: #F0F5FA;
    z-index: 992;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.music-expand-panel.active {
    transform: translateY(0);
}

/* 展开面板头部 */
.music-expand-header {
    display: flex;
    justify-content: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.music-expand-close {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    color: #888888;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.music-expand-close:active {
    background: rgba(0, 0, 0, 0.05);
    color: #333333;
}

/* 展开面板主体 */
.music-expand-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 24px 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 大封面 120x120 */
.music-expand-cover {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    object-fit: cover;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    background: #E4EAF0;
}

.music-expand-cover.is-playing {
    animation: coverSpin 8s linear infinite;
}

/* 歌名歌手 */
.music-expand-title {
    font-size: 18px;
    font-weight: 600;
    color: #333333;
    text-align: center;
    margin-bottom: 6px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 20px;
}

.music-expand-artist {
    font-size: 14px;
    color: #888888;
    text-align: center;
    margin-bottom: 24px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 20px;
}

/* 进度条区域 */
.music-expand-progress-wrap {
    width: 100%;
    max-width: 320px;
    margin-bottom: 24px;
}

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

.music-expand-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4A8DB7, #6BAED6);
    border-radius: 2px;
    width: 0%;
    position: relative;
}

.music-expand-progress-dot {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: #4A8DB7;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(74, 141, 183, 0.4);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.music-expand-progress:hover .music-expand-progress-dot,
.music-expand-progress.is-dragging .music-expand-progress-dot {
    opacity: 1;
}

.music-expand-progress.is-dragging .music-expand-progress-dot {
    transform: translate(-50%, -50%) scale(1.2);
}

/* 时间显示 */
.music-expand-time {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #888888;
    font-variant-numeric: tabular-nums;
}

/* 控制按钮 */
.music-expand-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    margin-bottom: 24px;
}

.music-expand-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #666666;
    font-size: 20px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.music-expand-btn:active {
    transform: scale(0.9);
    background: rgba(0, 0, 0, 0.05);
}

.music-expand-play {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #4A8DB7, #6BAED6);
    color: #FFFFFF;
    font-size: 22px;
    box-shadow: 0 4px 16px rgba(74, 141, 183, 0.35);
}

.music-expand-play:active {
    background: linear-gradient(135deg, #3A7A9E, #4A8DB7);
}

/* 歌词区域 */
.music-expand-lyrics {
    flex: 1;
    width: 100%;
    max-width: 320px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    text-align: center;
    padding: 10px 0;
    mask-image: linear-gradient(to bottom, transparent 0%, black 10%, black 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 10%, black 90%, transparent 100%);
}

.music-expand-lyrics::-webkit-scrollbar {
    display: none;
}

.music-lyric-line {
    font-size: 14px;
    line-height: 2.2;
    color: #888888;
    transition: all 0.3s ease;
    padding: 4px 0;
}

.music-lyric-line.active {
    color: #4A8DB7;
    font-size: 16px;
    font-weight: 600;
}

.music-lyric-line.empty {
    color: #AAAAAA;
    font-style: italic;
}

/* ============ 移动端适配 ============ */
@media (max-width: 768px) {
    .music-expand-panel {
        height: 70vh;
    }
    
    .music-expand-body {
        padding: 16px 20px 20px;
    }
    
    .music-expand-cover {
        width: 100px;
        height: 100px;
        margin-bottom: 16px;
    }
    
    .music-expand-title {
        font-size: 16px;
        margin-bottom: 4px;
    }
    
    .music-expand-artist {
        font-size: 13px;
        margin-bottom: 20px;
    }
    
    .music-expand-progress-wrap {
        margin-bottom: 20px;
    }
    
    .music-expand-controls {
        gap: 24px;
        margin-bottom: 20px;
    }
    
    .music-expand-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .music-expand-play {
        width: 52px;
        height: 52px;
        font-size: 20px;
    }
    
    .music-expand-lyrics {
        max-width: 100%;
    }
}

/* ============ 减少动画偏好 ============ */
@media (prefers-reduced-motion: reduce) {
    .mini-music-cover.is-playing,
    .music-expand-cover.is-playing {
        animation: none;
    }
    
    .music-expand-panel {
        transition: none;
    }
    
    .music-expand-overlay {
        transition: none;
    }
}
