+ <>
+
+
+ {resolvingCount > 0 && (
+
+
+
+
+
+
解析中
+
{resolvingCount}
+
+
+
+ )}
+ {/* Header */}
+
+
+
+
+
+
+
音乐
+
+
+
+
+
+ {musicSources.map((source) => (
+
+ ))}
+
+
+
+ {(currentView === 'songs' || currentView === 'search' || currentView === 'myPlaylists') && (
+
+ )}
+
+
+
setSearchKeyword(e.target.value)}
+ onKeyDown={handleSearchKeyDown}
+ className="w-full h-full appearance-none border-0 bg-transparent pl-9 pr-4 text-sm text-white outline-none focus:outline-none focus:ring-0 font-mono placeholder:text-zinc-500"
+ placeholder="搜索歌曲或艺术家..."
+ />
+
+
+
+
+
+
+ {/* Main Content */}
+
+
+ {loading && (
+
+ )}
+
+ {/* Playlists View */}
+ {currentView === 'playlists' && !loading && (
+
+
+
排行榜
+
+
+ {playlists.length > 0 ? (
+
+ {playlists.map((playlist, index) => (
+
+ ))}
+
+ ) : (
+
+
当前音源暂无排行榜
+
+ 你可以切换其它音源,或使用上方搜索继续找歌。
+
+
+ )}
+
+ )}
+
+ {/* Songs View */}
+ {(currentView === 'songs' || currentView === 'search') && !loading && (
+
+ {currentView === 'search' && (
+
+
+
+
setSearchKeyword(e.target.value)}
+ onKeyDown={handleSearchKeyDown}
+ className="h-full w-full border-0 bg-transparent pl-10 pr-4 text-sm text-white outline-none placeholder:text-zinc-500"
+ placeholder="搜索歌曲或艺术家..."
+ />
+
+
+
+ )}
+
+
+
+ {currentPlaylistTitle}
+
+ {songs[0]?.platform ? : null}
+
+ {songs.length} 首歌曲
+
+
+
+
+
+ {songs.map((song, index) => (
+
+
playSong(song, index)}
+ >
+ {index + 1}
+
+
playSong(song, index)}
+ >
+
{song.name}
+
{song.artist}
+
+
playSong(song, index)}
+ >
+ {song.artist}
+
+
playSong(song, index)}
+ >
+
+
+
+
+
+
+
+ ))}
+
+ {currentView === 'search' && activeSearchKeyword && (
+
+ {searchHasMore ? (
+ loadingMoreSearch ? (
+
+
+
+ ) : (
+
+ 继续向下滚动加载更多
+
+ )
+ ) : songs.length > 0 ? (
+
没有更多搜索结果了
+ ) : null}
+
+ )}
+
+ )}
+ {/* My Playlists View */}
+ {currentView === 'myPlaylists' && (
+
+ {/* Playlists List */}
+
+
+
歌单列表
+ {loadingUserPlaylists ? (
+
+ ) : userPlaylists.length === 0 ? (
+
+ 还没有歌单
+
+
+
+ ) : (
+
+ {userPlaylists.map((playlist) => (
+
handleSelectUserPlaylist(playlist)}
+ >
+
+ {playlist.cover ? (
+

+ ) : (
+
+ )}
+
+
{playlist.name}
+ {playlist.description && (
+
{playlist.description}
+ )}
+
+
+
+ ))}
+
+ )}
+
+
+
+ {/* Playlist Songs */}
+
+ {selectedUserPlaylist ? (
+
+
+
+
{selectedUserPlaylist.name}
+ {selectedUserPlaylist.description && (
+
{selectedUserPlaylist.description}
+ )}
+
+
+
+
+
+
+
+ {loadingUserPlaylistSongs ? (
+
+ ) : userPlaylistSongs.length === 0 ? (
+
歌单为空
+ ) : (
+
+ {userPlaylistSongs.map((song, index) => (
+
+
{index + 1}
+ {song.pic && (
+

+ )}
+
+
+
+
+ ))}
+
+ )}
+
+ ) : (
+
+ )}
+
+
+ )}
+
+
+
+ {/* Player */}
+ {showPlayer && currentSong && (
+
+ {showSpectrum && (
+
+ )}
+
+
+ {/* Progress Bar */}
+
+
+ {showStreamBuffering && (
+
+ )}
+
+
+
+
+ {/* Song Info */}
+
+
setShowLyrics(true)}
+ >
+ {currentSong.pic ? (
+

{
+ // 图片加载失败时显示默认图标
+ e.currentTarget.style.display = 'none';
+ }}
+ />
+ ) : (
+
+ )}
+
+
+
+
{currentSong.name}
+
+ {showStreamBuffering && (
+
+
+ 缓冲中
+
+ )}
+
+
{currentSong.artist}
+
+
+
+ {/* Controls */}
+
+
+
+
+
+
+ {/* Right Controls */}
+
+
+
+
+
+
+
+
+
+
+
+ )}
+
+ {/* Audio Element */}
+
+
+ {/* Lyrics Modal */}
+ {showLyrics && currentSong && (
+
{
+ // 点击背景关闭音量条
+ if (e.target === e.currentTarget) {
+ setShowVolumeSlider(false);
+ }
+ }}
+ >
+
setShowVolumeSlider(false)}
+ >
+
+
+ {/* Cover / Meta */}
+
+ {currentSong.pic && (
+
+

+
+ )}
+
+
{
+ e.stopPropagation();
+ setMobileLyricsView((view) => (view === 'lyrics' ? 'vinyl' : 'lyrics'));
+ }}
+ className="w-16 h-16 md:hidden rounded-xl overflow-hidden shadow-2xl mb-2"
+ >
+ {currentSong.pic ? (
+

+ ) : (
+
+ )}
+
+
+
+
+
+
{currentSong.name}
+
+
+
{currentSong.artist}
+
+
+
+ {mobileLyricsView === 'vinyl' && (
+
+ {currentSong.pic && (
+
+

+
+ )}
+
+
+
+
+ )}
+
+ {/* Lyrics Content */}
+
+ {lyrics.length > 0 ? (
+
+ {lyrics.map((line, index) => (
+
+
{line.text}
+ {line.translation && (
+
+ {line.translation}
+
+ )}
+
+ ))}
+
+ ) : (
+
+ )}
+
+
+
+ {/* Mini Player Controls */}
+
+ {/* 上排:播放控制按钮 */}
+
+
+
+
+
+
+ {/* 下排:其他按钮(小一号) */}
+
+
+
+
+
+ {/* 音量控制 */}
+
setShowVolumeSlider(true)}
+ onMouseLeave={() => setShowVolumeSlider(false)}
+ >
+
+ {/* 垂直音量条 - 桌面悬浮/移动端点击 */}
+
e.stopPropagation()}
+ >
+
+
+
+ {/* PiP 歌词按钮 */}
+
+
+ {/* 添加到歌单按钮 */}
+
+
+
+ {/* 进度条 */}
+
+ {showStreamBuffering && (
+
+
+
+ 缓冲中
+
+
+ )}
+ {showSpectrum && (
+
+
{formatTime(currentTime)}
+
+
{formatTime(duration)}
+
+ )}
+
+
{formatTime(currentTime)}
+
+
+ {showStreamBuffering && (
+
+ )}
+
+
+
{formatTime(duration)}
+
+
+
+
+
+ )}
+
+ {/* Playlist Modal */}
+ {showPlaylist && (
+
+
+ {/* Header */}
+
+
+
播放列表
+ ({playlist.length})
+
+
+ {playlist.length > 0 && (
+
+ )}
+
+
+
+
+ {/* Playlist */}
+
+ {playlist.length > 0 ? (
+
+ {playlist.map((song, index) => (
+
+
{
+ setPlaylistIndex(index);
+ playSong(song, -1);
+ setShowPlaylist(false);
+ }}
+ className="flex items-center gap-3 flex-1 min-w-0 cursor-pointer"
+ >
+
+ {song.pic ? (
+

+ ) : (
+
+ )}
+
+
+ {index === playlistIndex ? (
+
+ ) : (
+
+ )}
+
+
+
+ ))}
+
+ ) : (
+
+
+
播放列表为空
+
播放歌曲后会自动添加到列表
+
+ )}
+
+
+
+ )}
+
+ {/* Quality Selection Menu */}
+ {showQualityMenu && (
+
setShowQualityMenu(false)}
+ >
+
e.stopPropagation()}
+ >
+ {/* Header */}
+
+
选择音质
+
+
+ {/* Quality Options */}
+
+
+
+
+
+
+
+
+
+
+ {/* Cancel Button */}
+
+
+
+
+
+ )}
+
+
+ {showSidebarDrawer && (
+
+
+ )}
+
+ {showSourceMenu && (
+
+
+ )}
+
+ {/* Add to Playlist Modal */}
+
{
+ setShowAddToPlaylistModal(false);
+ setSongToAddToPlaylist(null);
+ }}
+ onSuccess={() => {
+ setToast({
+ message: '已添加到歌单',
+ type: 'success',
+ onClose: () => setToast(null),
+ });
+ }}
+ onError={(message) => {
+ setToast({
+ message,
+ type: 'error',
+ onClose: () => setToast(null),
+ });
+ }}
+ />
+
+ {/* Toast */}
+ {toast && }
+
+ {/* Confirm Modal */}
+ {confirmModal.isOpen &&
+ createPortal(
+
+
e.stopPropagation()}
+ >
+
+
+
+ {confirmModal.title}
+
+
+
+
+
+
+
+
+ {confirmModal.message}
+
+
+
+
+
+ 取消
+
+
+ {deletingPlaylistId !== null ? (
+ <>
+
+ 删除中...
+ >
+ ) : (
+ '确定'
+ )}
+
+
+
+
+
,
+ document.body
+ )}
+
+ {/* PiP Lyrics Window */}
+ {showPiPLyrics && (
+ {
+ setPipOpacity(opacity);
+ localStorage.setItem('lyricsPiPOpacity', opacity.toString());
+ }}
+ onMinimizedChange={(minimized) => {
+ setPipMinimized(minimized);
+ localStorage.setItem('lyricsPiPMinimized', minimized.toString());
+ }}
+ onClose={() => setShowPiPLyrics(false)}
+ />
+ )}
+
+ >
+
+ );
+}
diff --git a/src/app/music/layout.tsx b/src/app/music/layout.tsx
new file mode 100644
index 0000000..0964e6c
--- /dev/null
+++ b/src/app/music/layout.tsx
@@ -0,0 +1,5 @@
+import MusicClient from './MusicClient';
+
+export default function MusicLayout({ children }: { children: React.ReactNode }) {
+ return