@vicyangorg/dsh-music 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/client/index.js CHANGED
@@ -48,9 +48,18 @@ window.__ModuleLoader__.load({
48
48
  panel: '音乐',
49
49
  welcomeTitle: '欢迎使用 dsh-music',
50
50
  welcomeSub: '本地优先的音乐库与推荐。花一分钟告诉我你想听什么,我把界面调到合你口味。',
51
- welcomeStart: '开始设置',
51
+ settingsTitle: '设置',
52
+ settingsHint: '喜欢列表同步 · 推荐口味 · 音乐库',
53
+ settingsBack: '返回界面',
54
+ settingsSave: '保存设置',
55
+ settingsSaved: '已保存',
56
+ settingsFirstRunNote: '第一次来?先把下面三项过一遍,之后随时能回来改。',
57
+ setLikedTitle: '喜欢列表同步',
58
+ setTasteTitle: '推荐口味',
59
+ setLibTitle: '音乐库',
60
+ setLibSubReturning: '已经配置好了;要换目录或改用 starter 曲库就在这里改,保存后生效。',
61
+ settingsFinishHint: '完成后随时能从右上角「设置」回来修改',
52
62
  welcomeSkip: '先随便看看',
53
- welcomeBack: '返回界面',
54
63
  welcomePoint1: '播放本地曲库,歌词与歌手资料齐全',
55
64
  welcomePoint2: '按你的口味推荐,喜欢的歌才入库',
56
65
  welcomePoint3: '所有数据只留在这台电脑上',
@@ -58,8 +67,6 @@ window.__ModuleLoader__.load({
58
67
  welcomeTasteSub: '可以多选,也可以跳过;之后随时能在推荐里调整。',
59
68
  welcomeGenres: '流派',
60
69
  welcomeLanguages: '语言',
61
- welcomePrev: '上一步',
62
- welcomeNext: '下一步',
63
70
  welcomeLibTitle: '从哪里开始?',
64
71
  welcomeLibSub: '已经有本地音乐就选第一个;没有的话,我准备了一个免费的公共版权 starter 曲库。',
65
72
  welcomeLocalTitle: '使用我已有的音乐库',
@@ -75,7 +82,6 @@ window.__ModuleLoader__.load({
75
82
  welcomeCredits: '曲目与许可',
76
83
  welcomeEnter: '进入推荐',
77
84
  welcomeSaveFail: '保存失败,请重试',
78
- welcomePreview: '预览欢迎页',
79
85
  genre_jazz: '爵士',
80
86
  genre_classical: '古典',
81
87
  genre_electronic: '电子',
@@ -146,9 +152,6 @@ window.__ModuleLoader__.load({
146
152
  emptyAddDirHint: '默认扫描目录(支持 mp3 / flac / m4a / wav 等):',
147
153
  emptyRescanCta: '重新扫描曲库',
148
154
  emptyDirNote: '也可以在插件配置里用 directories 自定义扫描目录。',
149
- syncOptional: 'Spotify 同步(可选)',
150
- syncOptionalHint: '可选功能:需要机器上已安装 spotify-sync CLI,没有也不影响听歌',
151
- syncUnavailableHint: '未检测到 spotify-sync CLI,同步功能暂不可用(可跳过,不影响听歌)',
152
155
  exploreChip: '探索批次',
153
156
  recoColdTitle: '还没有收听历史',
154
157
  recoColdBody: '先搜歌手或歌名试听,喜欢的歌会自动入库;听过几首后这里会按你的口味推荐。',
@@ -203,7 +206,7 @@ window.__ModuleLoader__.load({
203
206
  lyricsSourceLrclib: 'LRCLIB',
204
207
  lyricsSourceWeb: '联网补齐',
205
208
  lyricsSource: '歌词来源',
206
- artistOpen: '查看歌手卡片',
209
+ artistOpen: '查看歌手',
207
210
  artistIntro: '简介',
208
211
  artistNews: '近期动态',
209
212
  artistTrivia: '逸闻趣事',
@@ -236,9 +239,8 @@ window.__ModuleLoader__.load({
236
239
  recoSectionEmpty: '这一栏还没有内容,点「换一批」生成。',
237
240
  deleteTrack: '删除',
238
241
  revealTrack: '在 Finder 显示',
239
- deleteConfirm: '从曲库删除这首歌?本地文件会被移除。',
240
- deleteLikedConfirm: '这是 Spotify 收藏里的歌。删除只会去掉本地文件,不会取消云端收藏。确定继续?',
241
- deleteLikedConfirm2: '再次确认:本地文件删除后无法从插件恢复。',
242
+ deleteConfirm: '从曲库移除「{title}」?本地文件会被删除,无法撤销。',
243
+ deleteLikedConfirm: '这是 Spotify 收藏里的歌。删除只会移除本地文件(无法从插件恢复),不会取消云端收藏。',
242
244
  deleteFailed: '删除失败',
243
245
  searchTypeSong: '歌曲',
244
246
  searchTypeArtist: '歌手',
@@ -294,6 +296,19 @@ window.__ModuleLoader__.load({
294
296
  downloadDone: '已入库',
295
297
  downloadFail: '失败',
296
298
  downloadPlay: '已入库,曲库已刷新,可直接播放。',
299
+ downloadClose: '关闭下载面板',
300
+ downloadCollapse: '收起',
301
+ downloadExpand: '展开',
302
+ downloadQueued: '排队中',
303
+ downloadSkip: '已存在',
304
+ downloadFinished: '已结束',
305
+ downloadPillRunning: '入库中 {done}/{total}',
306
+ downloadPillDone: '已入库 {ok} 首',
307
+ downloadPillDoneFail: '已入库 {ok} 首,{fail} 首失败',
308
+ downloadSummary: '完成:{ok} 首入库,{fail} 首失败',
309
+ downloadSummaryAll: '全部 {ok} 首已入库',
310
+ downloadOpenLibrary: '打开曲库',
311
+ downloadPlayOne: '播放这首',
297
312
  downloadError: '入库失败',
298
313
  downloadIdle: '暂无入库任务',
299
314
  syncBtn: '同步 Spotify',
@@ -305,6 +320,92 @@ window.__ModuleLoader__.load({
305
320
  syncFail: '失败',
306
321
  syncMissing: '本地缺失',
307
322
  syncError: '同步失败',
323
+ /* 喜欢列表导入(网易云 / QQ 音乐,只读) */
324
+ importBtn: '导入喜欢列表',
325
+ importBtnHint: '从网易云音乐 / QQ 音乐的「我喜欢」只读导入到本地(不下载)',
326
+ importTabNetease: '网易云音乐',
327
+ importTabQq: 'QQ 音乐',
328
+ importQrLoading: '正在生成二维码…',
329
+ importQrWaiting: '等待扫码…',
330
+ importQrConfirmed: '已扫码,请在手机上确认登录',
331
+ importQrDone: '登录成功',
332
+ importQrExpired: '二维码已过期,请重新生成',
333
+ importQrRegenerate: '重新生成',
334
+ importQrHint: '打开网易云音乐 App → 左侧菜单「我的」→ 右上角「+」或设置里的「扫一扫」,对准二维码,登录后自动完成连接。',
335
+ importQqConnect: '连接',
336
+ importConnecting: '连接中…',
337
+ importSyncNow: '导入到「我喜欢」',
338
+ importSyncing: '导入中…',
339
+ importReQr: '重新扫码登录',
340
+ importDisconnect: '断开连接',
341
+ importResDisliked: '本地 👎 跳过',
342
+ importResUnavailable: '云端已下架',
343
+ importResRemoved: '云端已移除',
344
+ importResRemovedHint: '仅提示:不会取消本地 ♥,也不会删除文件',
345
+ importDoneLine: '已导入 {total} 首到「我喜欢」:新增 {added},之前已有 {existed}',
346
+ importViewLikes: '查看「我喜欢」',
347
+ importQrStep1: '用手机扫码登录',
348
+ importQrStep2: '登录后自动导入到「我喜欢」',
349
+ importAutoNote: '扫码并在手机上确认后会立刻导入一次。登录凭据只保存在本机、不上传;插件只读你的「我喜欢的音乐」,不改云端任何内容。',
350
+ importQqPrivacy: '登录凭据只保存在本机(~/.dsh/dsh-music/accounts.json,权限 0600),不上传;可随时断开连接。',
351
+ importQqQrStep1: '用手机 QQ 扫一扫登录',
352
+ importQqQrHint: '打开手机 QQ → 右上角「+」→「扫一扫」,对准二维码,在手机上确认登录。',
353
+ importQqBusyHint: '手机提示「登录频繁」?今天扫码次数太多,等 30 分钟~2 小时再试,期间别反复扫。',
354
+ importQqQrNote: '登录后自动导入到「我喜欢」。用微信登录 QQ 音乐的账号扫不了,请改用 Cookie。',
355
+ importQqUseCookie: '用 Cookie 连接(微信登录的账号)',
356
+ importQqUseQr: '改用手机 QQ 扫码',
357
+ importQrReportHint: '重新生成后再扫一次;还是不行的话,把括号里的内容发给我们。',
358
+ prvQqHowCookie: '扫码或粘贴 Cookie',
359
+ importQqStep1: '在浏览器登录 QQ 音乐网页版',
360
+ importQqOpen: '打开 y.qq.com',
361
+ importQqLoginHint: 'QQ 或微信登录都可以,登录后别关这个标签页。',
362
+ importQqStep2: '复制登录凭据到剪贴板',
363
+ importQqCopy: '复制命令',
364
+ importQqCopied: '已复制',
365
+ importQqStep2Hint: '在 y.qq.com 页面打开开发者工具({keys})→ Console,粘贴命令并回车',
366
+ importQqFallback: '命令不好用?在 y.qq.com 打开开发者工具({keys})→ Network → 刷新页面 → 点任意一个请求 → 复制 Request Headers 里的 Cookie 整行。',
367
+ importQqStep3: '粘贴到这里,自动连接并导入',
368
+ importQqPlaceholder: '粘贴 Cookie,例如 qm_keyst=…; uin=…',
369
+ importQqNeedKey: '没拿到登录凭据(qm_keyst)。请先在 y.qq.com 登录,再按上面的方法复制一次。',
370
+ importKnownLine: '已导入 {n} 首',
371
+ importLastSyncLine: '上次 {time}',
372
+ prvNeteaseHow: '扫码连接',
373
+ prvQqHow: '扫码连接',
374
+ spStep1: '安装 spotify-sync 命令行(可选)',
375
+ spStep1Ok: '已检测到 spotify-sync,这一步不用管。',
376
+ spStep1Hint: '还没检测到 spotify-sync 命令。这是可选功能,没有它也能听歌;装好后点「重新检测」,或在插件配置里指定 syncCommand / syncScriptPath。',
377
+ spRecheck: '重新检测',
378
+ spStep2: '完成 Spotify 授权',
379
+ spStep2Ok: '已找到授权凭据。',
380
+ spStep2Hint: '还没找到授权凭据。登录凭据由 spotify-sync 自己保管(~/.config/spotify-sync/refresh_token),本插件只检查文件在不在、从不读取。按 spotify-sync 的说明登录授权一次,再点「重新检测」。',
381
+ spStep3: '同步收藏到本地曲库',
382
+ spBody: '新增的收藏会下载到 ~/Music/spotify-liked 并并入曲库;已有的不重复下载。',
383
+ spStateNoCli: '未安装',
384
+ spStateNoAuth: '待授权',
385
+ spStateReady: '已就绪',
386
+ spStateChecking: '检测中…',
387
+ setLikedSub: '把你在音乐 App 里「喜欢」的歌带进来:只读、不改云端;导入的歌先进「我喜欢」,想听再入库。',
388
+ addMissing: '入库(联网核实后下载)',
389
+ addMissingQueued: '已加入入库队列,完成后自动出现在曲库',
390
+ addMissingQueuedFront: '「{title}」已置顶到入库队列,下载完成后自动出现在曲库',
391
+ nowLikesLabel: '喜欢 / 不喜欢',
392
+ addMissingSearching: '还没入库:正在找已核实的音源,找到就加入下载队列…',
393
+ addMissingSearchingBatch: '正在为没入库的歌逐首找已核实的音源…',
394
+ addMissingBatch: '入库 {n} 首',
395
+ addMissingBatchQueued: '已把 {n} 首加入入库队列(每批最多 20 首,串行下载),{m} 首暂时没找到可靠音源',
396
+ addMissingNoneBatch: '这些歌暂时都没找到可靠音源',
397
+ addMissingNone: '没找到可靠的音源,去曲库搜「{title}」试试',
398
+ likesMissingCount: '{n} 首还没入库',
399
+ addReady: '已找到可靠音源,点击入库',
400
+ addReadyShort: '可入库',
401
+ addNone: '暂未找到可靠音源,点击再找一次',
402
+ scanProgress: '查找音源 {done}/{total} · 已找到 {found}',
403
+ scanHint: '导入后会在后台逐首查找已核实的音源(MusicBrainz);找到的行会亮起「可入库」,点歌也会直接入库',
404
+ addMissingHint: '这些歌只标记了 ♥、还没下载。点歌后面的入库按钮会先联网核实再下载。',
405
+ importEnabledOff: '主机已关闭喜欢列表导入(配置项 likedSync = false)',
406
+ importCookieEmpty: '请先粘贴 Cookie',
407
+ srcNetease: '网易云',
408
+ srcQq: 'QQ 音乐',
308
409
  tabHistory: '历史',
309
410
  historyTitle: '收听历史',
310
411
  historyEmpty: '还没有播放记录,去曲库放几首歌吧。',
@@ -313,14 +414,44 @@ window.__ModuleLoader__.load({
313
414
  historySkipped: '跳过',
314
415
  historyComplete: '完整度',
315
416
  verified: '已核实',
417
+ statDaily: '最近 7 天播放',
418
+ playsUnitN: '{n} 次',
419
+ miniToggle: '迷你条',
420
+ miniMore: '更多操作',
421
+ miniFabPlaying: '正在播放:{title} — {artist}(点击展开)',
422
+ miniFabPaused: '已暂停:{title} — {artist}(点击展开)',
423
+ backTo: '返回{target}',
424
+ artistPageTitle: '歌手',
425
+ confirmDeleteTitle: '删除本地音频',
426
+ confirmDeleteBtn: '永久删除',
427
+ cancelBtn: '取消',
428
+ durationHours: '{h} 小时 {m} 分',
429
+ durationMins: '{m} 分',
430
+ dayToday: '今天',
431
+ dayYesterday: '昨天',
432
+ lyricsClickHint: '点击歌词跳转',
433
+ tabNowQueue: '接下来播放',
434
+ searchMatchedCount: '匹配 {shown} / {total} 首',
435
+ histSummaryFoot: '{songs} 首歌 · {artists} 位歌手 · 平均完整度 {pct}%',
436
+ histSummarySkip: '{n} 次跳过',
437
+ histSummaryDislike: '{n} 首不喜欢',
316
438
  };
317
439
  const en = {
318
440
  panel: 'Music',
319
441
  welcomeTitle: 'Welcome to dsh-music',
320
442
  welcomeSub: 'A local-first music library and recommender. Tell me what you like and I will tune the panel to you.',
321
- welcomeStart: 'Set it up',
443
+ settingsTitle: 'Settings',
444
+ settingsHint: 'Liked-list sync · taste · library',
445
+ settingsBack: 'Back to the app',
446
+ settingsSave: 'Save settings',
447
+ settingsSaved: 'Saved',
448
+ settingsFirstRunNote: 'First time here? Walk through the three sections below — you can change everything later.',
449
+ setLikedTitle: 'Liked-list sync',
450
+ setTasteTitle: 'Taste',
451
+ setLibTitle: 'Library',
452
+ setLibSubReturning: 'Already set up. Change the folder or switch to the starter library here; takes effect after saving.',
453
+ settingsFinishHint: 'You can come back any time via “Settings” in the top-right corner',
322
454
  welcomeSkip: 'Just browse',
323
- welcomeBack: 'Back to the app',
324
455
  welcomePoint1: 'Play your local library with lyrics and artist profiles',
325
456
  welcomePoint2: 'Recommendations tuned to your taste; only liked songs are saved',
326
457
  welcomePoint3: 'Everything stays on this computer',
@@ -328,8 +459,6 @@ window.__ModuleLoader__.load({
328
459
  welcomeTasteSub: 'Pick as many as you want, or skip; you can change this later in Recommendations.',
329
460
  welcomeGenres: 'Genres',
330
461
  welcomeLanguages: 'Languages',
331
- welcomePrev: 'Back',
332
- welcomeNext: 'Next',
333
462
  welcomeLibTitle: 'Where should we start?',
334
463
  welcomeLibSub: 'Already have local music? Pick the first one. Otherwise I prepared a free public-domain starter library.',
335
464
  welcomeLocalTitle: 'Use my existing music',
@@ -345,7 +474,6 @@ window.__ModuleLoader__.load({
345
474
  welcomeCredits: 'Tracks & licences',
346
475
  welcomeEnter: 'Open Recommendations',
347
476
  welcomeSaveFail: 'Could not save — please try again',
348
- welcomePreview: 'Preview welcome',
349
477
  genre_jazz: 'Jazz',
350
478
  genre_classical: 'Classical',
351
479
  genre_electronic: 'Electronic',
@@ -416,9 +544,6 @@ window.__ModuleLoader__.load({
416
544
  emptyAddDirHint: 'Default scanned folders (mp3 / flac / m4a / wav…):',
417
545
  emptyRescanCta: 'Rescan library',
418
546
  emptyDirNote: 'You can also set custom folders with `directories` in the plugin config.',
419
- syncOptional: 'Spotify sync (optional)',
420
- syncOptionalHint: 'Optional: needs the spotify-sync CLI installed; music works without it',
421
- syncUnavailableHint: 'spotify-sync CLI not found — sync is unavailable (safe to skip)',
422
547
  exploreChip: 'Exploration batch',
423
548
  recoColdTitle: 'No listening history yet',
424
549
  recoColdBody: 'Search and preview some songs first — liked songs are added automatically, and recommendations will follow your taste.',
@@ -473,7 +598,7 @@ window.__ModuleLoader__.load({
473
598
  lyricsSourceLrclib: 'LRCLIB',
474
599
  lyricsSourceWeb: 'Web lookup',
475
600
  lyricsSource: 'Lyrics source',
476
- artistOpen: 'Open artist card',
601
+ artistOpen: 'View artist',
477
602
  artistIntro: 'Intro',
478
603
  artistNews: 'Recent news',
479
604
  artistTrivia: 'Trivia',
@@ -506,9 +631,8 @@ window.__ModuleLoader__.load({
506
631
  recoSectionEmpty: 'Nothing in this section yet. Generate a new batch.',
507
632
  deleteTrack: 'Delete',
508
633
  revealTrack: 'Show in Finder',
509
- deleteConfirm: 'Remove this track from the library? The local file will be deleted.',
510
- deleteLikedConfirm: 'This is a Spotify liked track. Deleting removes only the local file, not the cloud like. Continue?',
511
- deleteLikedConfirm2: 'Confirm again: the local file cannot be restored from the plugin.',
634
+ deleteConfirm: 'Remove "{title}" from the library? The local file will be deleted. This cannot be undone.',
635
+ deleteLikedConfirm: 'This is a Spotify liked track. Deleting removes only the local file (it cannot be restored from the plugin), not your cloud like.',
512
636
  deleteFailed: 'Delete failed',
513
637
  searchTypeSong: 'Songs',
514
638
  searchTypeArtist: 'Artists',
@@ -564,6 +688,19 @@ window.__ModuleLoader__.load({
564
688
  downloadDone: 'In library',
565
689
  downloadFail: 'Failed',
566
690
  downloadPlay: 'Added — the library was refreshed; play it from Library.',
691
+ downloadClose: 'Close download panel',
692
+ downloadCollapse: 'Collapse',
693
+ downloadExpand: 'Expand',
694
+ downloadQueued: 'Queued',
695
+ downloadSkip: 'Already in library',
696
+ downloadFinished: 'Finished',
697
+ downloadPillRunning: 'Adding {done}/{total}',
698
+ downloadPillDone: '{ok} added',
699
+ downloadPillDoneFail: '{ok} added, {fail} failed',
700
+ downloadSummary: 'Done: {ok} added, {fail} failed',
701
+ downloadSummaryAll: 'All {ok} added',
702
+ downloadOpenLibrary: 'Open library',
703
+ downloadPlayOne: 'Play this track',
567
704
  downloadError: 'Could not add to library',
568
705
  downloadIdle: 'Nothing queued',
569
706
  syncBtn: 'Sync Spotify',
@@ -575,6 +712,92 @@ window.__ModuleLoader__.load({
575
712
  syncFail: 'Failed',
576
713
  syncMissing: 'Missing locally',
577
714
  syncError: 'Sync failed',
715
+ /* Liked-list import (NetEase / QQ Music, read-only) */
716
+ importBtn: 'Import liked',
717
+ importBtnHint: 'Read-only import of your NetEase Cloud Music / QQ Music liked list (no downloads)',
718
+ importTabNetease: 'NetEase Cloud Music',
719
+ importTabQq: 'QQ Music',
720
+ importQrLoading: 'Generating QR code…',
721
+ importQrWaiting: 'Waiting for scan…',
722
+ importQrConfirmed: 'Scanned — confirm the login on your phone',
723
+ importQrDone: 'Signed in',
724
+ importQrExpired: 'QR code expired — generate a new one',
725
+ importQrRegenerate: 'Regenerate',
726
+ importQrHint: 'Open the NetEase Cloud Music app → “Mine” → the “+” / scan entry, point it at the QR code; the connection completes right after login.',
727
+ importQqConnect: 'Connect',
728
+ importConnecting: 'Connecting…',
729
+ importSyncNow: 'Import into “Liked”',
730
+ importSyncing: 'Importing…',
731
+ importReQr: 'Sign in again (QR)',
732
+ importDisconnect: 'Disconnect',
733
+ importResDisliked: 'Skipped (local 👎)',
734
+ importResUnavailable: 'Unavailable in cloud',
735
+ importResRemoved: 'Removed in cloud',
736
+ importResRemovedHint: 'Informational only: local ♥ marks and files are kept',
737
+ importDoneLine: 'Imported {total} songs into “Liked”: {added} new, {existed} already there',
738
+ importViewLikes: 'View Liked',
739
+ importQrStep1: 'Scan the QR code with your phone',
740
+ importQrStep2: 'Imports into “Liked” right after sign-in',
741
+ importAutoNote: 'Once you confirm on your phone the first import starts right away. Your login stays on this machine and is never uploaded; the plugin only reads “My Favorite Music” and changes nothing in the cloud.',
742
+ importQqPrivacy: 'Your login stays on this machine (~/.dsh/dsh-music/accounts.json, mode 0600) and is never uploaded; disconnect any time.',
743
+ importQqQrStep1: 'Scan with the QQ app on your phone',
744
+ importQqQrHint: 'Open the QQ app → “+” at the top right → “Scan”, point it at the QR code and confirm on your phone.',
745
+ importQqBusyHint: 'Phone says “logging in too frequently”? Too many scans today — wait 30 minutes to 2 hours and don’t retry repeatedly.',
746
+ importQqQrNote: 'Once you confirm, the first import starts right away. Accounts that sign in to QQ Music with WeChat cannot scan here — use the cookie instead.',
747
+ importQqUseCookie: 'Connect with a cookie (WeChat accounts)',
748
+ importQqUseQr: 'Scan with the QQ app instead',
749
+ importQrReportHint: 'Regenerate and scan again; if it still fails, send us the text in brackets.',
750
+ prvQqHowCookie: 'Scan or paste cookie',
751
+ importQqStep1: 'Sign in to QQ Music on the web',
752
+ importQqOpen: 'Open y.qq.com',
753
+ importQqLoginHint: 'QQ or WeChat sign-in both work; leave that tab open afterwards.',
754
+ importQqStep2: 'Copy the sign-in cookie to the clipboard',
755
+ importQqCopy: 'Copy command',
756
+ importQqCopied: 'Copied',
757
+ importQqStep2Hint: 'On the y.qq.com tab open DevTools ({keys}) → Console, paste the command and press Enter',
758
+ importQqFallback: 'Command didn’t work? On y.qq.com open DevTools ({keys}) → Network → reload → pick any request → copy the whole Cookie line under Request Headers.',
759
+ importQqStep3: 'Paste it here — it connects and imports automatically',
760
+ importQqPlaceholder: 'Paste the cookie, e.g. qm_keyst=…; uin=…',
761
+ importQqNeedKey: 'No sign-in cookie (qm_keyst) yet. Sign in at y.qq.com first, then copy again.',
762
+ importKnownLine: '{n} songs imported',
763
+ importLastSyncLine: 'last {time}',
764
+ prvNeteaseHow: 'Scan to connect',
765
+ prvQqHow: 'Scan to connect',
766
+ spStep1: 'Install the spotify-sync CLI (optional)',
767
+ spStep1Ok: 'spotify-sync detected — nothing to do here.',
768
+ spStep1Hint: 'spotify-sync was not found. It’s optional: everything else works without it. After installing, click Re-check, or set syncCommand / syncScriptPath in the plugin config.',
769
+ spRecheck: 'Re-check',
770
+ spStep2: 'Authorize Spotify',
771
+ spStep2Ok: 'Credentials found.',
772
+ spStep2Hint: 'No credentials yet. spotify-sync keeps its own login (~/.config/spotify-sync/refresh_token); this plugin only checks that the file exists and never reads it. Authorize once as spotify-sync describes, then click Re-check.',
773
+ spStep3: 'Sync Liked Songs into your library',
774
+ spBody: 'New likes are downloaded to ~/Music/spotify-liked and added to the library; existing files are skipped.',
775
+ spStateNoCli: 'Not installed',
776
+ spStateNoAuth: 'Authorize',
777
+ spStateReady: 'Ready',
778
+ spStateChecking: 'Checking…',
779
+ setLikedSub: 'Bring in the songs you liked in other music apps: read-only, nothing changes in the cloud; imported songs land in Liked first, and you add them to the library when you want to listen.',
780
+ addMissing: 'Add to library (verified download)',
781
+ addMissingQueued: 'Queued — it appears in the library when done',
782
+ addMissingQueuedFront: '“{title}” moved to the top of the queue — it appears in the library when done',
783
+ nowLikesLabel: 'Like / dislike',
784
+ addMissingSearching: 'Not in your library yet — looking for a verified source, it gets queued automatically…',
785
+ addMissingSearchingBatch: 'Looking up verified sources for the songs that are not in your library yet…',
786
+ addMissingBatch: 'Download {n}',
787
+ addMissingBatchQueued: 'Queued {n} songs (up to 20 per batch, one at a time); no reliable source found for {m} yet',
788
+ addMissingNoneBatch: 'No reliable source found for these songs yet',
789
+ addMissingNone: 'No reliable source found — try searching “{title}” in the library',
790
+ likesMissingCount: '{n} not in library yet',
791
+ addReady: 'Verified source found — click to add',
792
+ addReadyShort: 'Ready',
793
+ addNone: 'No verified source yet — click to search again',
794
+ scanProgress: 'Finding sources {done}/{total} · {found} found',
795
+ scanHint: 'Imported tracks are matched against verified sources (MusicBrainz) in the background; rows light up “Ready” and clicking them adds them directly',
796
+ addMissingHint: 'These songs are only marked ♥ and not downloaded yet. The add-to-library button verifies online first, then downloads.',
797
+ importEnabledOff: 'Liked-list import is disabled on this host (config likedSync = false)',
798
+ importCookieEmpty: 'Paste the cookie first',
799
+ srcNetease: 'NetEase',
800
+ srcQq: 'QQ Music',
578
801
  tabHistory: 'History',
579
802
  historyTitle: 'Listening history',
580
803
  historyEmpty: 'No plays yet — go play something from the library.',
@@ -583,6 +806,27 @@ window.__ModuleLoader__.load({
583
806
  historySkipped: 'Skipped',
584
807
  historyComplete: 'Completion',
585
808
  verified: 'Verified',
809
+ statDaily: 'Plays in the last 7 days',
810
+ playsUnitN: '{n} plays',
811
+ miniToggle: 'Mini bar',
812
+ miniMore: 'More actions',
813
+ miniFabPlaying: 'Playing: {title} — {artist} (click to expand)',
814
+ miniFabPaused: 'Paused: {title} — {artist} (click to expand)',
815
+ backTo: 'Back to {target}',
816
+ artistPageTitle: 'Artist',
817
+ confirmDeleteTitle: 'Delete local file',
818
+ confirmDeleteBtn: 'Delete',
819
+ cancelBtn: 'Cancel',
820
+ durationHours: '{h}h {m}m',
821
+ durationMins: '{m}m',
822
+ dayToday: 'Today',
823
+ dayYesterday: 'Yesterday',
824
+ lyricsClickHint: 'Click a line to seek',
825
+ tabNowQueue: 'Up next',
826
+ searchMatchedCount: '{shown} / {total} matched',
827
+ histSummaryFoot: '{songs} songs · {artists} artists · {pct}% avg completion',
828
+ histSummarySkip: '{n} skipped',
829
+ histSummaryDislike: '{n} disliked',
586
830
  };
587
831
 
588
832
  /* ================================================================
@@ -668,6 +912,226 @@ window.__ModuleLoader__.load({
668
912
  };
669
913
  }
670
914
 
915
+ /* ================================================================
916
+ * 2b. Minimal QR encoder (Model 2, byte mode, v1–10, EC level M) — renders the
917
+ * NetEase login URL as SVG modules. Zero deps; verified with zxing-cpp + OpenCV.
918
+ * ================================================================ */
919
+ /* QR-BEGIN:极简 QR Code 编码器(Model 2,byte 模式,版本 1–10,纠错级 M,自动选版 + 8 掩码择优)。
920
+ 只用于把网易云登录 URL 渲染成二维码;零依赖、纯函数,返回扁平模块矩阵供 SVG 渲染。 */;
921
+ const QR_EC_LEVEL = 'M';
922
+ const QR_EC_BITS = { L: 1, M: 0, Q: 3, H: 2 }
923
+ // [每块纠错码字, 组1块数, 组1数据码字, 组2块数, 组2数据码字](版本 1–10 × L/M/Q/H,ISO/IEC 18004 表 9)
924
+ const QR_EC_TABLE = [
925
+ [[7, 1, 19, 0, 0], [10, 1, 16, 0, 0], [13, 1, 13, 0, 0], [17, 1, 9, 0, 0]],
926
+ [[10, 1, 34, 0, 0], [16, 1, 28, 0, 0], [22, 1, 22, 0, 0], [28, 1, 16, 0, 0]],
927
+ [[15, 1, 55, 0, 0], [26, 1, 44, 0, 0], [18, 2, 17, 0, 0], [22, 2, 13, 0, 0]],
928
+ [[20, 1, 80, 0, 0], [18, 2, 32, 0, 0], [26, 2, 24, 0, 0], [16, 4, 9, 0, 0]],
929
+ [[26, 1, 108, 0, 0], [24, 2, 43, 0, 0], [18, 2, 15, 2, 16], [22, 2, 11, 2, 12]],
930
+ [[18, 2, 68, 0, 0], [16, 4, 27, 0, 0], [24, 4, 19, 0, 0], [28, 4, 15, 0, 0]],
931
+ [[20, 2, 78, 0, 0], [18, 4, 31, 0, 0], [18, 2, 14, 4, 15], [26, 4, 13, 1, 14]],
932
+ [[24, 2, 97, 0, 0], [22, 2, 38, 2, 39], [22, 4, 18, 2, 19], [26, 4, 14, 2, 15]],
933
+ [[30, 2, 116, 0, 0], [22, 3, 36, 2, 37], [20, 4, 16, 4, 17], [24, 4, 12, 4, 13]],
934
+ [[18, 2, 68, 2, 69], [26, 4, 43, 1, 44], [24, 6, 19, 2, 20], [28, 6, 15, 2, 16]],
935
+ ];
936
+ // 校正图形中心坐标(版本 1–10)
937
+ // 总码字数(版本 1–10)
938
+ const QR_TOTAL = [26, 44, 70, 100, 134, 172, 196, 242, 292, 346];
939
+ const QR_ALIGN = [[], [6, 18], [6, 22], [6, 26], [6, 30], [6, 34], [6, 22, 38], [6, 24, 42], [6, 26, 46], [6, 28, 50]];
940
+ const QR_GF_EXP = new Uint8Array(512);
941
+ const QR_GF_LOG = new Uint8Array(256);
942
+ for (let i = 0, x = 1; i < 255; i++) { QR_GF_EXP[i] = x; QR_GF_LOG[x] = i; x <<= 1; if (x & 0x100) x ^= 0x11d }
943
+ for (let i = 255; i < 512; i++) QR_GF_EXP[i] = QR_GF_EXP[i - 255];
944
+ const qrGfMul = (a, b) => (a && b ? QR_GF_EXP[QR_GF_LOG[a] + QR_GF_LOG[b]] : 0);
945
+ // RS 生成多项式 ∏(x - α^i),降幂系数,首项为 1
946
+ function qrRsGenerator(degree) {
947
+ let poly = [1];
948
+ for (let i = 0; i < degree; i++) {
949
+ const next = new Array(poly.length + 1).fill(0);
950
+ for (let j = 0; j < poly.length; j++) { next[j] ^= poly[j]; next[j + 1] ^= qrGfMul(poly[j], QR_GF_EXP[i]) }
951
+ poly = next;
952
+ }
953
+ return poly;
954
+ }
955
+ function qrRsRemainder(data, degree) {
956
+ const gen = qrRsGenerator(degree);
957
+ const rem = new Uint8Array(degree);
958
+ for (const d of data) {
959
+ const factor = d ^ rem[0];
960
+ rem.copyWithin(0, 1);
961
+ rem[degree - 1] = 0;
962
+ if (factor) for (let i = 0; i < degree; i++) rem[i] ^= qrGfMul(gen[i + 1], factor);
963
+ }
964
+ return rem;
965
+ }
966
+ /** 把字节编成数据码字:模式指示 0100 + 8/16 位长度 + 数据 + 终止符 + 0xEC/0x11 填充 */
967
+ function qrCodewords(bytes, version, dataCodewords) {
968
+ const capacityBits = dataCodewords * 8;
969
+ const bits = [];
970
+ const push = (value, n) => { for (let i = n - 1; i >= 0; i--) bits.push((value >>> i) & 1) }
971
+ push(4, 4);
972
+ push(bytes.length, version <= 9 ? 8 : 16);
973
+ for (const b of bytes) push(b, 8);
974
+ push(0, Math.min(4, capacityBits - bits.length));
975
+ if (bits.length % 8) push(0, 8 - (bits.length % 8));
976
+ for (let pad = 0xec; bits.length < capacityBits; pad ^= 0xec ^ 0x11) push(pad, 8);
977
+ const out = new Uint8Array(dataCodewords);
978
+ for (let i = 0; i < dataCodewords; i++) { let v = 0; for (let j = 0; j < 8; j++) v = (v << 1) | bits[i * 8 + j]; out[i] = v }
979
+ return out;
980
+ }
981
+ /** 分块 + RS 纠错 + 交织 */
982
+ function qrInterleave(data, spec) {
983
+ const [ecPerBlock, g1Count, g1Data, g2Count, g2Data] = spec;
984
+ const blocks = [];
985
+ let offset = 0;
986
+ for (let i = 0; i < g1Count; i++) { blocks.push(Array.from(data.slice(offset, offset + g1Data))); offset += g1Data }
987
+ for (let i = 0; i < g2Count; i++) { blocks.push(Array.from(data.slice(offset, offset + g2Data))); offset += g2Data }
988
+ const ecc = blocks.map((b) => Array.from(qrRsRemainder(Uint8Array.from(b), ecPerBlock)));
989
+ const maxData = Math.max(g1Data, g2Data);
990
+ const out = [];
991
+ for (let i = 0; i < maxData; i++) for (const b of blocks) if (i < b.length) out.push(b[i]);
992
+ for (let i = 0; i < ecPerBlock; i++) for (const e of ecc) out.push(e[i]);
993
+ return Uint8Array.from(out);
994
+ }
995
+ function qrBuildBase(version) {
996
+ const size = version * 4 + 17;
997
+ const modules = new Uint8Array(size * size);
998
+ const isFunction = new Uint8Array(size * size);
999
+ const set = (r, c, v) => { modules[r * size + c] = v; isFunction[r * size + c] = 1 }
1000
+ const finder = (r0, c0) => {
1001
+ for (let r = -1; r <= 7; r++) for (let c = -1; c <= 7; c++) {
1002
+ const rr = r0 + r, cc = c0 + c;
1003
+ if (rr < 0 || cc < 0 || rr >= size || cc >= size) continue;
1004
+ const dark = r >= 0 && r <= 6 && c >= 0 && c <= 6 && (r === 0 || r === 6 || c === 0 || c === 6 || (r >= 2 && r <= 4 && c >= 2 && c <= 4));
1005
+ set(rr, cc, dark ? 1 : 0);
1006
+ }
1007
+ }
1008
+ finder(0, 0); finder(0, size - 7); finder(size - 7, 0);
1009
+ for (let i = 8; i < size - 8; i++) { const v = i % 2 === 0 ? 1 : 0; set(6, i, v); set(i, 6, v) }
1010
+ const centers = QR_ALIGN[version - 1];
1011
+ const last = centers.length - 1;
1012
+ for (const ci of centers.keys()) for (const cj of centers.keys()) {
1013
+ if ((ci === 0 && cj === 0) || (ci === 0 && cj === last) || (ci === last && cj === 0)) continue;
1014
+ const cr = centers[ci], cc = centers[cj];
1015
+ for (let r = -2; r <= 2; r++) for (let c = -2; c <= 2; c++) set(cr + r, cc + c, Math.max(Math.abs(r), Math.abs(c)) !== 1 ? 1 : 0);
1016
+ }
1017
+ set(size - 8, 8, 1);
1018
+ for (let i = 0; i <= 8; i++) if (i !== 6) { isFunction[8 * size + i] = 1; isFunction[i * size + 8] = 1 }
1019
+ for (let i = 0; i < 8; i++) isFunction[8 * size + size - 1 - i] = 1;
1020
+ for (let i = 0; i < 7; i++) isFunction[(size - 1 - i) * size + 8] = 1;
1021
+ if (version >= 7) {
1022
+ let rem = version << 12;
1023
+ for (let i = 17; i >= 12; i--) if ((rem >>> i) & 1) rem ^= 0x1f25 << (i - 12);
1024
+ const bits = (version << 12) | (rem & 0xfff);
1025
+ for (let i = 0; i < 18; i++) {
1026
+ const bit = (bits >>> i) & 1;
1027
+ const a = size - 11 + (i % 3), b = Math.floor(i / 3);
1028
+ set(b, a, bit);
1029
+ set(a, b, bit);
1030
+ }
1031
+ }
1032
+ return { size, modules, isFunction }
1033
+ }
1034
+ const QR_MASKS = [
1035
+ (x, y) => (x + y) % 2 === 0,
1036
+ (x, y) => y % 2 === 0,
1037
+ (x, y) => x % 3 === 0,
1038
+ (x, y) => (x + y) % 3 === 0,
1039
+ (x, y) => (Math.floor(x / 3) + Math.floor(y / 2)) % 2 === 0,
1040
+ (x, y) => ((x * y) % 2) + ((x * y) % 3) === 0,
1041
+ (x, y) => (((x * y) % 2) + ((x * y) % 3)) % 2 === 0,
1042
+ (x, y) => (((x + y) % 2) + ((x * y) % 3)) % 2 === 0,
1043
+ ];
1044
+ function qrWriteFormat(base, mask) {
1045
+ const { size, modules } = base;
1046
+ const data = QR_EC_BITS[QR_EC_LEVEL] << 3 | mask;
1047
+ let rem = data << 10;
1048
+ for (let i = 14; i >= 10; i--) if ((rem >>> i) & 1) rem ^= 0x537 << (i - 10);
1049
+ const bits = ((data << 10) | (rem & 0x3ff)) ^ 0x5412;
1050
+ const put = (r, c, i) => { modules[r * size + c] = (bits >>> i) & 1 }
1051
+ for (let i = 0; i <= 5; i++) put(i, 8, i);
1052
+ put(7, 8, 6); put(8, 8, 7); put(8, 7, 8);
1053
+ for (let i = 9; i < 15; i++) put(8, 14 - i, i);
1054
+ for (let i = 0; i < 8; i++) put(8, size - 1 - i, i);
1055
+ for (let i = 8; i < 15; i++) put(size - 15 + i, 8, i);
1056
+ modules[(size - 8) * size + 8] = 1;
1057
+ }
1058
+ function qrPenalty(base) {
1059
+ const { size, modules } = base;
1060
+ let score = 0;
1061
+ const at = (r, c) => modules[r * size + c];
1062
+ // N1:行/列连续同色 ≥5
1063
+ for (let r = 0; r < size; r++) for (let c = 0; c < size; c++) {
1064
+ let runH = 1;
1065
+ while (c + runH < size && at(r, c + runH) === at(r, c)) runH++
1066
+ let runV = 1;
1067
+ while (r + runV < size && at(r + runV, c) === at(r, c)) runV++
1068
+ if (runH >= 5) score += 3 + runH - 5;
1069
+ if (runV >= 5) score += 3 + runV - 5;
1070
+ }
1071
+ // N2:2×2 同色块
1072
+ for (let r = 0; r < size - 1; r++) for (let c = 0; c < size - 1; c++) {
1073
+ const v = at(r, c);
1074
+ if (at(r, c + 1) === v && at(r + 1, c) === v && at(r + 1, c + 1) === v) score += 3;
1075
+ }
1076
+ // N3:1011101 且一侧有 0000(行与列)
1077
+ const P1 = 0b00001011101, P2 = 0b10111010000;
1078
+ const scan = (get) => {
1079
+ let acc = 0;
1080
+ for (let i = 0; i < size; i++) {
1081
+ acc = ((acc << 1) | get(i)) & 0x7ff;
1082
+ if (i >= 10 && (acc === P1 || acc === P2)) score += 40;
1083
+ }
1084
+ }
1085
+ for (let r = 0; r < size; r++) { scan((c) => at(r, c)); scan((c) => at(c, r)) }
1086
+ // N4:暗模块比例偏离 50%
1087
+ let dark = 0;
1088
+ for (let i = 0; i < modules.length; i++) dark += modules[i];
1089
+ score += 10 * Math.floor(Math.abs((dark * 100) / modules.length - 50) / 5);
1090
+ return score;
1091
+ }
1092
+ /** 入口:文本 → { version, size, mask, modules: Uint8Array(size*size) };超出容量返回 null */
1093
+ function qrEncode(text, encoder = new TextEncoder()) {
1094
+ const bytes = encoder.encode(String(text ?? ''));
1095
+ let version = 0;
1096
+ let spec = null;
1097
+ let dataCodewords = 0;
1098
+ for (let v = 1; v <= 10; v++) {
1099
+ const s = QR_EC_TABLE[v - 1][['L', 'M', 'Q', 'H'].indexOf(QR_EC_LEVEL)];
1100
+ const dc = QR_TOTAL[v - 1] - s[0] * (s[1] + s[3]);
1101
+ const countBits = v <= 9 ? 8 : 16;
1102
+ if (4 + countBits + bytes.length * 8 <= dc * 8) { version = v; spec = s; dataCodewords = dc; break }
1103
+ }
1104
+ if (!version) return null;
1105
+ const base = qrBuildBase(version);
1106
+ const codewords = qrInterleave(qrCodewords(bytes, version, dataCodewords), spec);
1107
+ const { size, modules, isFunction } = base;
1108
+ let bit = 0;
1109
+ const totalBits = codewords.length * 8;
1110
+ for (let right = size - 1; right >= 1; right -= 2) {
1111
+ if (right === 6) right = 5;
1112
+ for (let vert = 0; vert < size; vert++) for (let j = 0; j < 2; j++) {
1113
+ const x = right - j;
1114
+ const upward = ((right + 1) & 2) === 0;
1115
+ const y = upward ? size - 1 - vert : vert;
1116
+ if (isFunction[y * size + x] || bit >= totalBits) continue;
1117
+ modules[y * size + x] = (codewords[bit >>> 3] >>> (7 - (bit & 7))) & 1;
1118
+ bit++
1119
+ }
1120
+ }
1121
+ // 8 个掩码择优:在未掩码副本上逐个试
1122
+ const clean = Uint8Array.from(modules);
1123
+ let best = null;
1124
+ for (let m = 0; m < 8; m++) {
1125
+ modules.set(clean);
1126
+ for (let y = 0; y < size; y++) for (let x = 0; x < size; x++) if (!isFunction[y * size + x] && QR_MASKS[m](x, y)) modules[y * size + x] ^= 1;
1127
+ qrWriteFormat(base, m);
1128
+ const score = qrPenalty(base);
1129
+ if (!best || score < best.score) best = { mask: m, score, modules: Uint8Array.from(modules) }
1130
+ }
1131
+ return { version, size, mask: best.mask, modules: best.modules }
1132
+ }
1133
+ /* QR-END */
1134
+
671
1135
  /* ================================================================
672
1136
  * 3. Original icon set (hand-drawn paths, currentColor, 24 viewBox)
673
1137
  * ================================================================ */
@@ -767,6 +1231,30 @@ window.__ModuleLoader__.load({
767
1231
  ['path', { d: 'M8 10.5 12 14.5 16 10.5' }],
768
1232
  ['path', { d: 'M5 18.5h14' }],
769
1233
  ]);
1234
+ /* 喜欢列表导入:箭头进入一个盒(区别于下载的“落入托盘”)。 */
1235
+ const IconExternal = makeIcon([['path', { d: 'M14 4h6v6' }], ['path', { d: 'M20 4l-9 9' }], ['path', { d: 'M19 14v4.5a1.5 1.5 0 0 1-1.5 1.5h-12A1.5 1.5 0 0 1 4 18.5v-12A1.5 1.5 0 0 1 5.5 5H10' }]]);
1236
+ const IconSpotify = makeIcon([['path', { d: 'M6 9.5a12 12 0 0 1 12 0' }], ['path', { d: 'M7.5 12.8a9 9 0 0 1 9 0' }], ['path', { d: 'M9 16a5.5 5.5 0 0 1 6 0' }]]);
1237
+ const IconImport = makeIcon([
1238
+ ['path', { d: 'M19 13v4.5a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 5 17.5v-11A1.5 1.5 0 0 1 6.5 5H11' }],
1239
+ ['path', { d: 'M20 4l-8.5 8.5' }],
1240
+ ['path', { d: 'M11.5 7.5v5h5' }],
1241
+ ]);
1242
+ const IconTrash = makeIcon([
1243
+ ['path', { d: 'M4 7h16' }],
1244
+ ['path', { d: 'M9.5 7V4.8a.8.8 0 0 1 .8-.8h3.4a.8.8 0 0 1 .8.8V7' }],
1245
+ ['path', { d: 'M6.5 7l.8 11.4a1.6 1.6 0 0 0 1.6 1.6h6.2a1.6 1.6 0 0 0 1.6-1.6L17.5 7' }],
1246
+ ['path', { d: 'M10 11v5M14 11v5' }],
1247
+ ]);
1248
+ const IconMore = makeIcon([
1249
+ ['circle', { cx: 5.5, cy: 12, r: 1.4, ...FILLED }],
1250
+ ['circle', { cx: 12, cy: 12, r: 1.4, ...FILLED }],
1251
+ ['circle', { cx: 18.5, cy: 12, r: 1.4, ...FILLED }],
1252
+ ]);
1253
+ /* 设置:齿轮(喜欢列表同步 / 推荐口味 / 音乐库 都收在这一个入口里)。 */
1254
+ const IconGear = makeIcon([
1255
+ ['circle', { cx: 12, cy: 12, r: 3 }],
1256
+ ['path', { d: 'M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33h.01a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51h.01a1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82v.01a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z' }],
1257
+ ]);
770
1258
  const IconHeart = makeIcon([
771
1259
  ['path', { d: 'M12 20s-7.4-4.6-9.3-9C1.4 7.6 3.4 4.5 6.6 4.5c2 0 3.4 1.1 4.2 2.4l1.2 2 1.2-2c.8-1.3 2.2-2.4 4.2-2.4 3.2 0 5.2 3.1 3.9 6.5-1.9 4.4-9.3 9-9.3 9z' }],
772
1260
  ], { 'data-heart': 1 });
@@ -781,25 +1269,28 @@ window.__ModuleLoader__.load({
781
1269
  * 4. Styles — every color is a host theme token (--dsw-alias-*)
782
1270
  * ================================================================ */
783
1271
  const CSS = `
784
- .dshm-panel{position:relative;display:flex;flex-direction:column;height:100%;min-height:0;background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-primary);font-size:13px;}
785
- .dshm-welcome{position:relative;height:100%;display:flex;align-items:center;justify-content:center;overflow:auto;background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-primary);font-size:13px;animation:dshm-fade-in .28s ease-out;}
786
- .dshm-welcome-inner{position:relative;width:min(540px,calc(100% - 48px));padding:32px 0;text-align:center;}
787
- .dshm-welcome-preview .dshm-wclose{position:absolute;right:0;top:6px;appearance:none;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;}
788
- .dshm-welcome-preview .dshm-wclose:hover{background:var(--dsw-alias-interactive-bg-hover);}
789
- .dshm-welcome-hero{position:relative;}
790
- .dshm-welcome-glow{position:absolute;left:50%;top:0;width:330px;height:300px;transform:translateX(-50%);border-radius:50%;background:radial-gradient(circle,var(--dsw-alias-brand-primary),transparent 70%);opacity:.16;filter:blur(18px);pointer-events:none;}
791
- .dshm-welcome-fish{position:relative;display:flex;justify-content:center;animation:dshm-float 4.5s ease-in-out infinite;}
792
- .dshm-welcome-title{font-size:26px;font-weight:700;margin:12px 0 6px;letter-spacing:-.2px;}
793
- .dshm-welcome-sub{color:var(--dsw-alias-label-secondary);font-size:13px;line-height:1.65;max-width:430px;margin:0 auto;}
794
- .dshm-welcome-actions{display:flex;gap:10px;justify-content:center;margin-top:22px;flex-wrap:wrap;}
1272
+ .dshm-panel{--dshm-axis:1160px;--dshm-pad:clamp(16px,2.4vw,32px);--dshm-love:#e5485b;position:relative;display:flex;flex-direction:column;height:100%;min-height:0;background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-primary);font-size:13px;}
1273
+ .dshm-panel :is(button,[role="button"],a,[tabindex]):focus{outline:none;}
1274
+ .dshm-panel :is(button,[role="button"],a,[tabindex]):focus-visible,.dshm-mini :is(button,[role="button"]):focus-visible,.dshm-mini-fab:focus-visible,.dshm-modal :is(button,[tabindex]):focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px;}
1275
+ .dshm-panel :is(input,select):focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px;}
1276
+ .dshm-welcome-hero{position:relative;display:block;}
1277
+ .dshm-welcome-glow{display:none;}
1278
+ .dshm-set-masthead{display:flex;align-items:center;gap:14px;}
1279
+ .dshm-welcome-fish{position:relative;display:flex;flex:none;}
1280
+ .dshm-set-masthead-text{min-width:0;}
1281
+ .dshm-welcome-title{font-size:23px;font-weight:700;margin:0 0 4px;letter-spacing:-.2px;text-align:left;line-height:1.2;}
1282
+ .dshm-welcome-sub{color:var(--dsw-alias-label-secondary);font-size:13px;line-height:1.65;max-width:480px;margin:0;text-align:left;}
1283
+ .dshm-welcome-actions{display:flex;gap:10px;justify-content:flex-start;margin-top:22px;flex-wrap:wrap;}
795
1284
  .dshm-wbtn{appearance:none;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;padding:9px 18px;border-radius:10px;cursor:pointer;display:inline-flex;align-items:center;gap:7px;transition:background .15s,border-color .15s,transform .15s;}
796
1285
  .dshm-wbtn:hover{background:var(--dsw-alias-interactive-bg-hover);}
797
1286
  .dshm-wbtn:active{transform:translateY(1px);}
798
1287
  .dshm-wbtn:disabled{opacity:.55;cursor:not-allowed;}
799
1288
  .dshm-wbtn-primary{background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-inverted);border-color:transparent;}
800
1289
  .dshm-wbtn-primary:hover{background:var(--dsw-alias-button-primary-hover);}
801
- .dshm-welcome-points{display:flex;flex-direction:column;gap:7px;margin:26px auto 0;width:fit-content;text-align:left;}
802
- .dshm-wpoint{display:flex;align-items:center;gap:7px;color:var(--dsw-alias-label-secondary);font-size:12px;}
1290
+ .dshm-welcome-points{display:flex;flex-wrap:wrap;gap:4px 14px;margin:14px 0 0;text-align:left;max-width:560px;}
1291
+ .dshm-wpoint{display:inline-flex;align-items:center;gap:6px;color:var(--dsw-alias-label-secondary);font-size:12.5px;line-height:1.5;}
1292
+ .dshm-wpoint-dot{width:4px;height:4px;border-radius:50%;background:var(--dsw-alias-label-tertiary);flex:none;}
1293
+ .dshm-wpoint svg{color:var(--dsw-alias-label-tertiary);flex:none;}
803
1294
  .dshm-welcome-panel{width:100%;}
804
1295
  .dshm-wstep-title{font-size:18px;font-weight:650;margin:0 0 6px;}
805
1296
  .dshm-wstep-sub{color:var(--dsw-alias-label-secondary);font-size:12.5px;line-height:1.6;margin:0 auto 18px;max-width:440px;}
@@ -814,10 +1305,10 @@ window.__ModuleLoader__.load({
814
1305
  .dshm-wcard:hover{background:var(--dsw-alias-interactive-bg-hover);}
815
1306
  .dshm-wcard-on{border-color:var(--dsw-alias-brand-primary);box-shadow:0 0 0 1px var(--dsw-alias-brand-primary) inset;}
816
1307
  .dshm-wcard-icon{flex:none;width:34px;height:34px;border-radius:9px;display:flex;align-items:center;justify-content:center;background:var(--dsw-alias-bg-layer-2);}
817
- .dshm-wcard-text{display:flex;flex-direction:column;gap:3px;}
1308
+ .dshm-wcard-text{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1;}
818
1309
  .dshm-wcard-title{font-size:13px;font-weight:600;}
819
1310
  .dshm-wcard-body{font-size:12px;color:var(--dsw-alias-label-secondary);line-height:1.5;}
820
- .dshm-whint{font-size:11.5px;color:var(--dsw-alias-label-secondary);margin:12px 0 0;line-height:1.55;}
1311
+ .dshm-whint{font-size:12px;color:var(--dsw-alias-label-secondary);margin:12px 0 0;line-height:1.55;}
821
1312
  .dshm-wpath{text-align:left;margin-top:14px;}
822
1313
  .dshm-winput{width:100%;box-sizing:border-box;font:inherit;font-size:12.5px;padding:9px 11px;border-radius:9px;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);outline:none;transition:border-color .15s;}
823
1314
  .dshm-winput:focus{border-color:var(--dsw-alias-brand-primary);}
@@ -830,45 +1321,53 @@ window.__ModuleLoader__.load({
830
1321
  .dshm-wprogress-track{flex:1;height:6px;border-radius:99px;background:var(--dsw-alias-bg-layer-2);overflow:hidden;}
831
1322
  .dshm-wprogress-fill{height:100%;border-radius:99px;background:var(--dsw-alias-brand-primary);transition:width .3s;}
832
1323
  .dshm-wtracks{text-align:left;display:flex;flex-direction:column;gap:5px;margin-bottom:16px;}
833
- .dshm-wtrack{display:flex;align-items:center;gap:8px;font-size:11.5px;color:var(--dsw-alias-label-secondary);}
834
- .dshm-wtrack-lic{margin-left:auto;font-size:10.5px;color:var(--dsw-alias-label-tertiary);flex:none;}
1324
+ .dshm-wtrack{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--dsw-alias-label-secondary);}
1325
+ .dshm-wtrack-lic{margin-left:auto;font-size:11px;color:var(--dsw-alias-label-tertiary);flex:none;}
835
1326
  @keyframes dshm-float{0%,100%{transform:translateY(0);}50%{transform:translateY(-7px);}}
836
1327
  @keyframes dshm-fade-in{from{opacity:0;transform:translateY(6px);}to{opacity:1;transform:none;}}
1328
+ @keyframes dshm-fade{from{opacity:0;}to{opacity:1;}}
1329
+ @keyframes dshm-pop{from{opacity:0;transform:translateY(8px) scale(.985);}to{opacity:1;transform:none;}}
837
1330
  .dshm-panel *{box-sizing:border-box;}
838
- .dshm-header{flex:none;padding:14px 20px 0;border-bottom:1px solid var(--dsw-alias-border-l1);}
839
- .dshm-title-row{display:flex;align-items:center;gap:10px;margin-bottom:14px;}
1331
+ .dshm-header{flex:none;padding:14px var(--dshm-pad) 0;border-bottom:1px solid var(--dsw-alias-border-l1);}
1332
+ .dshm-header-inner{max-width:var(--dshm-axis);margin:0 auto;}
1333
+ .dshm-header-inner .dshm-title-row{padding-bottom:8px;}
1334
+ .dshm-header-inner .dshm-tabs{margin-top:0;}
1335
+ .dshm-title-row{display:flex;align-items:center;gap:10px;margin-bottom:10px;}
840
1336
  .dshm-title{font-size:17px;font-weight:650;margin:0;letter-spacing:.2px;}
841
1337
  .dshm-count{color:var(--dsw-alias-label-tertiary);font-size:12px;}
842
- .dshm-header-actions{margin-left:auto;display:flex;gap:8px;align-items:center;}
1338
+ .dshm-header-actions{margin-left:auto;display:flex;gap:4px;align-items:center;}
843
1339
  .dshm-tabs{display:flex;gap:4px;}
844
1340
  .dshm-tab{position:relative;appearance:none;border:0;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:13px;padding:8px 12px 10px;cursor:pointer;border-radius:8px 8px 0 0;display:inline-flex;align-items:center;gap:6px;transition:color .15s;}
845
1341
  .dshm-tab:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover);}
846
1342
  .dshm-tab[aria-selected="true"]{color:var(--dsw-alias-brand-text);font-weight:600;}
847
1343
  .dshm-tab[aria-selected="true"]::after{content:"";position:absolute;left:10px;right:10px;bottom:-1px;height:2px;border-radius:2px;background:var(--dsw-alias-brand-primary);}
1344
+ .dshm-tab:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px;border-radius:8px;}
848
1345
  .dshm-tab-dot{width:6px;height:6px;border-radius:50%;background:var(--dsw-alias-brand-primary);animation:dshm-pulse 1.6s ease-in-out infinite;}
849
1346
  .dshm-body{flex:1;min-height:0;display:flex;flex-direction:column;container-type:inline-size;}
850
- .dshm-toolbar{flex:none;display:flex;align-items:center;gap:8px;padding:10px 20px;border-bottom:1px solid var(--dsw-alias-border-l1);flex-wrap:wrap;width:100%;max-width:1120px;margin:0 auto;}
851
- .dshm-libtabs{display:flex;align-items:center;gap:4px;padding:8px 20px 0;width:100%;max-width:1120px;margin:0 auto;flex:none;}
1347
+ .dshm-toolbar{flex:none;display:flex;align-items:center;gap:8px;padding:10px var(--dshm-pad);border-bottom:1px solid var(--dsw-alias-border-l1);flex-wrap:wrap;width:100%;max-width:var(--dshm-axis);margin:0 auto;}
1348
+ .dshm-libtabs{display:flex;align-items:center;gap:4px;padding:8px var(--dshm-pad) 0;width:100%;max-width:var(--dshm-axis);margin:0 auto;flex:none;}
852
1349
  .dshm-libtabs-btn{appearance:none;border:1px solid transparent;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:12.5px;padding:5px 12px;border-radius:8px;cursor:pointer;display:inline-flex;align-items:center;gap:6px;transition:background .12s,color .12s,border-color .12s;white-space:nowrap;}
853
1350
  .dshm-libtabs-btn:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary);}
1351
+ .dshm-libtabs-btn:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-1px;}
854
1352
  .dshm-libtabs-on{background:var(--dsw-alias-interactive-bg-active);color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-border-l2);font-weight:600;}
855
- .dshm-libtabs-count{font-size:10.5px;color:var(--dsw-alias-label-tertiary);background:var(--dsw-alias-bg-layer-1);border-radius:999px;padding:0 6px;line-height:16px;}
856
- .dshm-favs{padding:10px 20px 2px;width:100%;max-width:1120px;margin:0 auto;flex:none;box-sizing:border-box;}
1353
+ .dshm-libtabs-count{font-size:11px;color:var(--dsw-alias-label-tertiary);background:var(--dsw-alias-bg-layer-1);border-radius:999px;padding:0 6px;line-height:16px;}
1354
+ .dshm-favs{padding:12px var(--dshm-pad) 2px;width:100%;max-width:var(--dshm-axis);margin:0 auto;flex:none;box-sizing:border-box;}
857
1355
  .dshm-favs-head{display:flex;align-items:center;gap:8px;margin-bottom:8px;}
858
1356
  .dshm-favs-title{font-size:12.5px;font-weight:600;color:var(--dsw-alias-label-primary);}
859
1357
  .dshm-favs-all{margin-left:auto;}
860
1358
  .dshm-favs-empty{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--dsw-alias-label-tertiary);padding:10px 12px;border:1px dashed var(--dsw-alias-border-l1);border-radius:10px;}
861
- .dshm-favs-rail{display:flex;gap:10px;overflow-x:auto;padding:2px 0 10px;scrollbar-width:thin;}
862
- .dshm-favcard{appearance:none;border:0;background:transparent;padding:0;width:104px;flex:none;display:flex;flex-direction:column;gap:6px;cursor:pointer;text-align:left;color:inherit;font:inherit;}
1359
+ .dshm-favs-rail{display:flex;gap:12px;overflow-x:auto;padding:2px 0 10px;scrollbar-width:thin;}
1360
+ .dshm-favcard{appearance:none;border:0;background:transparent;padding:0;width:104px;flex:none;display:flex;flex-direction:column;gap:6px;cursor:pointer;text-align:left;color:inherit;font:inherit;border-radius:12px;}
863
1361
  .dshm-favcard-cover{position:relative;display:block;width:104px;height:104px;border-radius:12px;overflow:hidden;background:var(--dsw-alias-bg-layer-2);}
864
- .dshm-favcard-heart{position:absolute;top:6px;right:6px;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-state-error-primary);}
1362
+ .dshm-favcard-heart{position:absolute;top:6px;right:6px;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;background:var(--dsw-alias-bg-layer-1);color:var(--dshm-love);}
865
1363
  .dshm-favcard-title{font-size:12px;font-weight:600;color:var(--dsw-alias-label-primary);}
866
- .dshm-favcard-sub{font-size:11px;color:var(--dsw-alias-label-tertiary);}
1364
+ .dshm-favcard-sub{font-size:12px;color:var(--dsw-alias-label-tertiary);}
867
1365
  .dshm-favcard:hover .dshm-favcard-cover{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px;}
1366
+ .dshm-favcard:focus-visible .dshm-favcard-cover{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px;}
868
1367
  .dshm-favcard-off{opacity:.5;cursor:not-allowed;}
869
1368
  .dshm-favcard-more{height:104px;justify-content:center;align-items:center;gap:6px;border-radius:12px;border:1px dashed var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);}
870
- .dshm-favcard-more-label{font-size:11.5px;}
871
- .dshm-toast{position:fixed;right:20px;bottom:96px;z-index:1000;display:flex;align-items:center;gap:8px;padding:8px 10px 8px 12px;border-radius:10px;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1);box-shadow:0 6px 20px var(--dsw-alias-border-l2);font-size:12.5px;color:var(--dsw-alias-label-primary);animation:dshm-fade-in .18s ease-out;}
1369
+ .dshm-favcard-more-label{font-size:12px;}
1370
+ .dshm-toast{position:fixed;right:20px;bottom:96px;z-index:1200;display:flex;align-items:center;gap:8px;padding:8px 10px 8px 12px;border-radius:10px;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1);box-shadow:0 6px 20px var(--dsw-alias-bg-mask-2);font-size:12.5px;color:var(--dsw-alias-label-primary);animation:dshm-fade-in .18s ease-out;}
872
1371
  .dshm-toast-icon{display:inline-flex;color:var(--dsw-alias-state-success-primary);}
873
1372
  .dshm-toast-main{appearance:none;border:0;background:transparent;color:var(--dsw-alias-brand-text);font:inherit;cursor:pointer;padding:2px 4px;border-radius:6px;}
874
1373
  .dshm-toast-main:hover{background:var(--dsw-alias-interactive-bg-hover);}
@@ -877,34 +1376,47 @@ window.__ModuleLoader__.load({
877
1376
  .dshm-search:focus-within{border-color:var(--dsw-alias-brand-primary);color:var(--dsw-alias-label-secondary);}
878
1377
  .dshm-search input{flex:1;min-width:0;border:0;background:transparent;color:var(--dsw-alias-label-primary);font:inherit;outline:none;}
879
1378
  .dshm-search input::placeholder{color:var(--dsw-alias-label-tertiary);}
880
- .dshm-select{appearance:none;border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;border-radius:9px;padding:6px 26px 6px 10px;cursor:pointer;outline:none;background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);background-position:calc(100% - 14px) 55%,calc(100% - 9px) 55%;background-size:5px 5px;background-repeat:no-repeat;}
1379
+ .dshm-select{appearance:none;border:1px solid var(--dsw-alias-border-l1);background-color:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;border-radius:9px;padding:6px 26px 6px 10px;cursor:pointer;outline:none;background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);background-position:calc(100% - 14px) 55%,calc(100% - 9px) 55%;background-size:5px 5px;background-repeat:no-repeat;}
881
1380
  .dshm-select:focus-visible{border-color:var(--dsw-alias-brand-primary);}
882
1381
  .dshm-chipbtn{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;border-radius:9px;padding:6px 12px;cursor:pointer;transition:background .15s,color .15s,border-color .15s,transform .1s;}
883
1382
  .dshm-chipbtn:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary);}
884
1383
  .dshm-chipbtn:active:not(:disabled){transform:scale(.97);}
885
1384
  .dshm-chipbtn:disabled{opacity:.5;cursor:default;}
1385
+ /* 行内「试听」:无边框幽灵按钮,hover 才浮出来(让位给歌名) */
1386
+ .dshm-chipbtn-ghost{border-color:transparent;background:transparent;padding:6px;opacity:0;}
1387
+ .dshm-row:hover .dshm-chipbtn-ghost,.dshm-row:focus-within .dshm-chipbtn-ghost{opacity:1;}
1388
+ .dshm-chipbtn-ghost:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);}
886
1389
  .dshm-chipbtn-primary{background:var(--dsw-alias-button-primary-fill);border-color:transparent;color:var(--dsw-alias-label-primary-inverted);}
887
1390
  .dshm-chipbtn-primary:hover:not(:disabled){background:var(--dsw-alias-button-primary-hover);color:var(--dsw-alias-label-primary-inverted);}
888
- .dshm-list{flex:1;min-height:0;overflow-y:auto;padding:6px 16px 20px;scrollbar-width:thin;scrollbar-color:var(--dsw-alias-scrollbar-bg-l2) transparent;width:100%;max-width:1120px;margin:0 auto;}
1391
+ .dshm-chipbtn-on{background:var(--dsw-alias-interactive-bg-active);border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary);}
1392
+ .dshm-chipbtn-icon{width:32px;height:32px;padding:0;justify-content:center;border-color:transparent;background:transparent;color:var(--dsw-alias-label-secondary);}
1393
+ .dshm-chipbtn-icon:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary);}
1394
+ .dshm-chipbtn-icon[aria-pressed="true"]{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-active);border-color:var(--dsw-alias-border-l1);}
1395
+ .dshm-list{flex:1;min-height:0;overflow-y:auto;padding:6px 16px 24px;scrollbar-width:thin;scrollbar-color:var(--dsw-alias-scrollbar-bg-l2) transparent;width:100%;max-width:var(--dshm-axis);margin:0 auto;}
889
1396
  .dshm-list::-webkit-scrollbar{width:10px;}
890
1397
  .dshm-list::-webkit-scrollbar-track{background:transparent;}
891
1398
  .dshm-list::-webkit-scrollbar-thumb{background:var(--dsw-alias-scrollbar-bg-l2);border-radius:6px;border:2px solid var(--dsw-alias-bg-base);}
892
1399
  .dshm-list::-webkit-scrollbar-thumb:hover{background:var(--dsw-alias-scrollbar-hover-l2);}
893
1400
  .dshm-group-head{position:sticky;top:0;z-index:1;display:flex;align-items:center;gap:6px;padding:10px 8px 6px;background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:600;}
894
1401
  .dshm-group-head .dshm-group-count{color:var(--dsw-alias-label-tertiary);font-weight:400;}
895
- .dshm-row{display:grid;grid-template-columns:40px minmax(0,1fr) auto auto auto auto 26px;align-items:center;gap:12px;padding:7px 8px;border-radius:10px;cursor:pointer;transition:background .12s;outline:none;}
896
- .dshm-row-actions{display:flex;gap:2px;opacity:0;}
1402
+ .dshm-row{display:flex;align-items:center;gap:12px;padding:7px 8px;border-radius:10px;cursor:pointer;transition:background .12s;outline:none;}
1403
+ .dshm-row-actions{display:flex;gap:2px;opacity:0;transition:opacity .15s;}
897
1404
  .dshm-row:hover .dshm-row-actions,.dshm-row:focus-within .dshm-row-actions{opacity:1;}
898
1405
  .dshm-row:hover{background:var(--dsw-alias-interactive-bg-hover);}
899
1406
  .dshm-row:focus-visible{box-shadow:0 0 0 2px var(--dsw-alias-brand-primary);}
900
1407
  .dshm-row-current{background:var(--dsw-alias-interactive-bg-active);}
901
1408
  .dshm-row-current .dshm-row-title{color:var(--dsw-alias-brand-text);}
902
- .dshm-row-info{min-width:0;}
903
- .dshm-row-title{display:flex;align-items:center;gap:7px;font-size:13px;font-weight:520;color:var(--dsw-alias-label-primary);}
904
- .dshm-row-sub{font-size:11.5px;color:var(--dsw-alias-label-tertiary);margin-top:2px;}
905
- .dshm-row-dur{font-size:11.5px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;}
906
- .dshm-row-play{display:flex;align-items:center;justify-content:center;color:var(--dsw-alias-label-secondary);opacity:0;transition:opacity .12s;}
907
- .dshm-row:hover .dshm-row-play,.dshm-row:focus-visible .dshm-row-play{opacity:1;}
1409
+ .dshm-row-info{min-width:0;flex:1;}
1410
+ .dshm-row-title{display:flex;align-items:center;gap:7px;font-size:13.5px;font-weight:520;color:var(--dsw-alias-label-primary);}
1411
+ .dshm-row-sub{font-size:12px;color:var(--dsw-alias-label-tertiary);margin-top:2px;}
1412
+ .dshm-row-dur{font-size:12px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;flex:none;}
1413
+ .dshm-row-tail{display:flex;align-items:center;gap:2px;margin-left:auto;flex:none;}
1414
+ /* 搜索结果里的歌手行:整行可点,右侧一枚安静 › */
1415
+ .dshm-row-chev{color:var(--dsw-alias-label-tertiary);opacity:.6;transition:opacity .15s,transform .15s;}
1416
+ .dshm-row:hover .dshm-row-chev{opacity:1;transform:translateX(2px);}
1417
+ .dshm-row-play{appearance:none;border:0;background:transparent;padding:0;width:28px;height:28px;border-radius:7px;cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--dsw-alias-label-secondary);opacity:0;transition:opacity .12s,background .12s;}
1418
+ .dshm-row:hover .dshm-row-play,.dshm-row:focus-within .dshm-row-play,.dshm-row-play:focus-visible{opacity:1;}
1419
+ .dshm-row-play:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary);}
908
1420
  .dshm-row-current .dshm-row-play{opacity:0;}
909
1421
  .dshm-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;}
910
1422
  .dshm-cover{flex:none;position:relative;border-radius:8px;overflow:hidden;background:linear-gradient(145deg,var(--dsw-alias-bg-layer-2),var(--dsw-alias-bg-layer-3));display:flex;align-items:center;justify-content:center;border:1px solid var(--dsw-alias-border-l1);}
@@ -924,6 +1436,7 @@ window.__ModuleLoader__.load({
924
1436
  .dshm-iconbtn:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px;}
925
1437
  .dshm-iconbtn-active{color:var(--dsw-alias-brand-text);}
926
1438
  .dshm-iconbtn-active:hover:not(:disabled){color:var(--dsw-alias-brand-text);}
1439
+ .dshm-iconbtn-danger:hover:not(:disabled){color:var(--dsw-alias-state-error-primary);background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 10%,transparent);}
927
1440
  .dshm-spin{animation:dshm-spin 1s linear infinite;}
928
1441
  @keyframes dshm-spin{to{transform:rotate(360deg);}}
929
1442
  .dshm-state{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:40px 24px;text-align:center;color:var(--dsw-alias-label-secondary);min-height:0;}
@@ -932,24 +1445,25 @@ window.__ModuleLoader__.load({
932
1445
  .dshm-empty-ctas{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-top:12px;}
933
1446
  .dshm-empty-dirs{display:flex;flex-direction:column;gap:4px;align-items:flex-start;text-align:left;max-width:440px;margin:14px auto 0;padding:12px 14px;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);border-radius:10px;font-size:12px;color:var(--dsw-alias-label-secondary);}
934
1447
  .dshm-empty-dirs-head{line-height:1.5;}
935
- .dshm-empty-dir{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1);border-radius:5px;padding:1px 6px;}
1448
+ .dshm-empty-dir{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1);border-radius:5px;padding:1px 6px;}
936
1449
  .dshm-chipbtn-off{opacity:.55;}
937
1450
  .dshm-state-body{font-size:12.5px;line-height:1.7;max-width:420px;color:var(--dsw-alias-label-tertiary);}
938
1451
  .dshm-state-error{color:var(--dsw-alias-state-error-primary);}
939
1452
  .dshm-skel{padding:8px 16px;}
940
1453
  .dshm-skel-row{display:flex;gap:12px;align-items:center;padding:8px;}
941
1454
  .dshm-skel-box{border-radius:8px;background:var(--dsw-alias-bg-skeleton);animation:dshm-pulse 1.4s ease-in-out infinite;}
942
- .dshm-now{flex:1;min-height:0;overflow-y:auto;padding:18px 20px;scrollbar-width:thin;scrollbar-color:var(--dsw-alias-scrollbar-bg-l2) transparent;width:100%;max-width:980px;margin:0 auto;}
943
- .dshm-now::-webkit-scrollbar{width:10px;}
944
- .dshm-now::-webkit-scrollbar-thumb{background:var(--dsw-alias-scrollbar-bg-l2);border-radius:6px;border:2px solid var(--dsw-alias-bg-base);}
945
- .dshm-now-hero{display:grid;grid-template-columns:240px minmax(0,1fr);gap:28px;align-items:center;max-width:860px;margin:0 auto;}
946
- .dshm-now-cover{width:240px;height:240px;border-radius:16px;box-shadow:0 12px 32px var(--dsw-alias-bg-mask-2);}
1455
+ .dshm-now{position:relative;flex:1;min-height:0;display:flex;flex-direction:column;width:100%;max-width:var(--dshm-axis);margin:0 auto;padding:0 var(--dshm-pad);overflow:hidden;}
1456
+ .dshm-now-glow{position:absolute;inset:-40px;pointer-events:none;z-index:0;opacity:.085;filter:blur(72px) saturate(1.15);transform:scale(1.15);background-position:center;background-size:cover;mask-image:radial-gradient(ellipse 68% 64% at 28% 46%,#000 0%,transparent 74%);}
1457
+ .dshm-now-stage{position:relative;z-index:1;flex:1;min-height:0;display:grid;grid-template-columns:minmax(280px,380px) minmax(0,1fr);gap:clamp(20px,3vw,40px);align-items:stretch;padding:18px 0 8px;}
1458
+ .dshm-now-side{display:flex;flex-direction:column;gap:14px;min-width:0;align-self:center;position:sticky;top:0;}
1459
+ .dshm-now-hero{display:flex;flex-direction:column;gap:16px;min-width:0;}
1460
+ .dshm-now-cover{width:100%;max-width:340px;aspect-ratio:1;height:auto;border-radius:14px;box-shadow:0 14px 38px var(--dsw-alias-bg-mask-2);border:1px solid var(--dsw-alias-border-l1);}
947
1461
  .dshm-now-meta{min-width:0;display:flex;flex-direction:column;gap:10px;}
948
- .dshm-now-title{font-size:20px;font-weight:680;margin:0;line-height:1.3;}
1462
+ .dshm-now-title{font-size:22px;font-weight:680;margin:0;line-height:1.28;letter-spacing:-.2px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
949
1463
  .dshm-now-sub{font-size:13px;color:var(--dsw-alias-label-secondary);margin:0;}
950
- .dshm-source-chip{display:inline-flex;align-items:center;gap:5px;align-self:flex-start;font-size:11px;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);padding:3px 9px;border-radius:99px;}
951
- .dshm-seekrow{display:flex;align-items:center;gap:10px;margin-top:6px;}
952
- .dshm-time{font-size:11px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;flex:none;min-width:38px;}
1464
+ .dshm-source-chip{display:inline-flex;align-items:center;gap:5px;align-self:flex-start;font-size:12px;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);padding:3px 9px;border-radius:99px;}
1465
+ .dshm-seekrow{display:flex;align-items:center;gap:10px;margin-top:2px;}
1466
+ .dshm-time{font-size:12px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;flex:none;min-width:38px;}
953
1467
  .dshm-time-end{text-align:right;}
954
1468
  .dshm-slider{position:relative;flex:1;height:20px;display:flex;align-items:center;cursor:pointer;touch-action:none;outline:none;min-width:40px;}
955
1469
  .dshm-slider-track{position:relative;width:100%;height:4px;border-radius:2px;background:var(--dsw-alias-bg-layer-3);overflow:visible;}
@@ -958,71 +1472,104 @@ window.__ModuleLoader__.load({
958
1472
  .dshm-slider:hover .dshm-slider-thumb,.dshm-slider:focus-visible .dshm-slider-thumb,.dshm-slider-drag .dshm-slider-thumb{transform:translate(-50%,-50%) scale(1);}
959
1473
  .dshm-slider:focus-visible .dshm-slider-track{box-shadow:0 0 0 2px var(--dsw-alias-brand-primary);}
960
1474
  .dshm-slider-disabled{opacity:.4;cursor:default;}
961
- .dshm-transport{display:flex;align-items:center;gap:10px;margin-top:4px;}
962
- .dshm-playbtn{width:48px;height:48px;border-radius:50%;border:0;background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-inverted);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:background .15s,transform .12s;box-shadow:0 4px 14px var(--dsw-alias-bg-mask-2);flex:none;padding:0;}
1475
+ .dshm-transport{display:flex;align-items:center;gap:6px;margin-top:4px;}
1476
+ .dshm-transport-gap{width:6px;}
1477
+ .dshm-playbtn{width:46px;height:46px;border-radius:50%;border:0;background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-inverted);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:background .15s,transform .12s;box-shadow:0 4px 14px var(--dsw-alias-bg-mask-2);flex:none;padding:0;}
963
1478
  .dshm-playbtn:hover{background:var(--dsw-alias-button-primary-hover);transform:scale(1.05);}
964
1479
  .dshm-playbtn:active{transform:scale(.96);}
965
1480
  .dshm-playbtn:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px;}
966
1481
  .dshm-volumerow{display:flex;align-items:center;gap:8px;max-width:240px;}
967
1482
  .dshm-volumerow .dshm-slider{flex:1;}
968
- .dshm-volume-pct{font-size:11px;color:var(--dsw-alias-label-tertiary);min-width:32px;font-variant-numeric:tabular-nums;}
1483
+ .dshm-volume-pct{font-size:12px;color:var(--dsw-alias-label-tertiary);min-width:32px;font-variant-numeric:tabular-nums;}
969
1484
  .dshm-errorline{display:flex;align-items:center;gap:7px;color:var(--dsw-alias-state-error-primary);font-size:12px;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);border-radius:9px;padding:8px 12px;}
970
- .dshm-queue{max-width:860px;margin:28px auto 0;}
971
- .dshm-queue-head{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:600;color:var(--dsw-alias-label-secondary);padding:0 8px 8px;border-bottom:1px solid var(--dsw-alias-border-l1);margin-bottom:6px;}
1485
+ .dshm-now-main{flex:1;min-height:0;display:flex;flex-direction:column;min-width:0;gap:10px;}
1486
+ .dshm-now-tabs{display:inline-flex;align-items:center;gap:4px;align-self:flex-start;padding:3px;border-radius:10px;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);flex:none;}
1487
+ .dshm-now-tab{appearance:none;border:0;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:12.5px;font-weight:500;padding:5px 12px;border-radius:7px;cursor:pointer;display:inline-flex;align-items:center;gap:6px;transition:background .15s,color .15s;}
1488
+ .dshm-now-tab:hover{color:var(--dsw-alias-label-primary);}
1489
+ .dshm-now-tab[aria-selected="true"]{background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font-weight:600;box-shadow:0 1px 3px var(--dsw-alias-bg-mask-2);}
1490
+ .dshm-now-tab .dshm-count{font-size:11px;font-weight:500;}
1491
+ .dshm-queue{flex:1;min-height:0;display:flex;flex-direction:column;}
1492
+ .dshm-queue-head{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:600;color:var(--dsw-alias-label-secondary);padding:0 8px 8px;border-bottom:1px solid var(--dsw-alias-border-l1);margin-bottom:6px;flex:none;}
972
1493
  .dshm-queue-head .dshm-count{font-weight:400;}
973
- @container (max-width:680px){
974
- .dshm-now-hero{grid-template-columns:1fr;justify-items:center;text-align:center;gap:18px;}
975
- .dshm-now-cover{width:190px;height:190px;}
1494
+ .dshm-queue-list{flex:1;min-height:0;overflow-y:auto;scrollbar-width:thin;}
1495
+ @container (max-width:760px){
1496
+ .dshm-now-stage{grid-template-columns:1fr;gap:14px;}
1497
+ .dshm-now-side{position:static;align-self:auto;}
1498
+ .dshm-now-cover{max-width:200px;}
1499
+ .dshm-now-hero{align-items:center;text-align:center;}
976
1500
  .dshm-now-meta{align-items:center;width:100%;}
977
1501
  .dshm-source-chip{align-self:center;}
978
1502
  .dshm-transport{justify-content:center;}
979
1503
  .dshm-volumerow{margin:0 auto;}
980
1504
  }
981
- .dshm-mini{position:fixed;right:16px;bottom:16px;z-index:2147483000;width:min(380px,calc(100% - 32px));background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);border-radius:14px;box-shadow:0 10px 30px var(--dsw-alias-bg-mask-2);overflow:hidden;animation:dshm-mini-in .22s ease-out;}
982
- .dshm-mini-fab{position:fixed;right:16px;bottom:16px;z-index:2147483000;width:48px;height:48px;border-radius:50%;padding:0;overflow:hidden;display:flex;align-items:center;justify-content:center;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);box-shadow:0 10px 30px var(--dsw-alias-bg-mask-2);cursor:grab;touch-action:none;animation:dshm-mini-in .18s ease-out;}
1505
+ .dshm-mini{position:fixed;right:16px;bottom:16px;z-index:1100;width:min(440px,calc(100% - 32px));background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);border-radius:14px;box-shadow:0 10px 30px var(--dsw-alias-bg-mask-2);animation:dshm-mini-in .22s ease-out;}
1506
+ .dshm-mini-fab{position:fixed;right:16px;bottom:16px;z-index:1100;width:48px;height:48px;border-radius:50%;padding:0;overflow:hidden;display:flex;align-items:center;justify-content:center;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);box-shadow:0 10px 30px var(--dsw-alias-bg-mask-2);cursor:grab;touch-action:none;animation:dshm-mini-in .18s ease-out;}
983
1507
  .dshm-mini-fab:hover{box-shadow:0 12px 34px var(--dsw-alias-bg-mask-2);}
984
1508
  .dshm-mini-fab:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px;}
985
1509
  .dshm-mini-fab-dragging{cursor:grabbing;animation:none;box-shadow:0 16px 40px var(--dsw-alias-bg-mask-2);}
986
1510
  .dshm-mini-fab-badge{position:absolute;right:1px;bottom:1px;width:19px;height:19px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-inverted);border:2px solid var(--dsw-alias-bg-layer-1);pointer-events:none;}
987
1511
  .dshm-mini-dragging{box-shadow:0 16px 40px var(--dsw-alias-bg-mask-2);transition:none;animation:none;}
1512
+ .dshm-mini{touch-action:none;user-select:none;-webkit-user-select:none;cursor:default;}
988
1513
  @keyframes dshm-mini-in{from{opacity:0;transform:translateY(10px);}to{opacity:1;transform:none;}}
989
- .dshm-mini-inner{display:flex;align-items:center;gap:6px;padding:8px 10px 8px 20px;}
1514
+ .dshm-mini-inner{display:flex;align-items:center;gap:4px;padding:8px 8px 8px 22px;}
990
1515
  .dshm-mini-main{display:flex;align-items:center;gap:10px;flex:1;min-width:0;border:0;background:transparent;color:inherit;font:inherit;cursor:pointer;padding:2px;border-radius:9px;text-align:left;}
991
1516
  .dshm-mini-main:hover{background:var(--dsw-alias-interactive-bg-hover);}
992
1517
  .dshm-mini-main:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px;}
993
1518
  .dshm-mini-text{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1;}
994
1519
  .dshm-mini-title{font-size:12.5px;font-weight:600;color:var(--dsw-alias-label-primary);}
995
- .dshm-mini-sub{font-size:11px;color:var(--dsw-alias-label-tertiary);}
1520
+ .dshm-mini-sub{font-size:12px;color:var(--dsw-alias-label-tertiary);}
996
1521
  .dshm-mini-sub-error{color:var(--dsw-alias-state-error-primary);}
997
- .dshm-mini-grip{position:absolute;left:3px;top:50%;transform:translateY(-50%);width:14px;height:44px;display:flex;align-items:center;justify-content:center;color:var(--dsw-alias-label-tertiary);cursor:grab;border-radius:6px;touch-action:none;opacity:.6;}
1522
+ .dshm-mini-grip{position:absolute;left:3px;top:10px;width:14px;height:44px;display:flex;align-items:center;justify-content:center;color:var(--dsw-alias-label-tertiary);cursor:grab;border-radius:6px;touch-action:none;opacity:.6;}
998
1523
  .dshm-mini-grip:hover,.dshm-mini-grip:focus-visible{opacity:1;background:var(--dsw-alias-interactive-bg-hover);outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px;}
999
1524
  .dshm-mini-grip:active{cursor:grabbing;}
1000
- .dshm-mini-artist{display:inline-flex;align-items:center;gap:4px;max-width:100%;border:0;background:transparent;padding:0;margin:0;font:inherit;font-size:11px;line-height:14px;color:var(--dsw-alias-label-tertiary);cursor:pointer;text-align:left;border-radius:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
1525
+ .dshm-mini-artist{display:inline-flex;align-items:center;gap:4px;max-width:100%;border:0;background:transparent;padding:0;margin:0;font:inherit;font-size:12px;line-height:14px;color:var(--dsw-alias-label-tertiary);cursor:pointer;text-align:left;border-radius:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
1001
1526
  .dshm-mini-artist:hover{color:var(--dsw-alias-brand-text);text-decoration:underline;}
1002
1527
  .dshm-mini-artist:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px;}
1003
- .dshm-mini-seek{padding:0 12px 0 20px;}
1004
- .dshm-mini-seek .dshm-slider{height:16px;}
1005
- .dshm-mini-lyrics{display:flex;flex-direction:column;gap:1px;padding:2px 14px 8px 20px;overflow:hidden;}
1006
- .dshm-mini-lyric{font-size:11.5px;line-height:16px;color:var(--dsw-alias-label-tertiary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;opacity:.5;transition:opacity .25s ease,color .25s ease;}
1528
+ .dshm-mini-seek{padding:0 12px 0 22px;}
1529
+ .dshm-mini-seek .dshm-slider{height:20px;}
1530
+ .dshm-mini-lyrics{display:flex;flex-direction:column;gap:1px;padding:2px 14px 8px 22px;overflow:hidden;}
1531
+ .dshm-mini-lyric{font-size:12px;line-height:16px;color:var(--dsw-alias-label-tertiary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;opacity:.5;transition:opacity .25s ease,color .25s ease;}
1007
1532
  .dshm-mini-lyric-on{color:var(--dsw-alias-label-primary);opacity:1;font-weight:600;}
1008
1533
  .dshm-mode-cycle{min-width:32px;}
1009
1534
  .dshm-chipbtn.dshm-mode-cycle{padding:0 9px;}
1010
- .dshm-mini-controls{display:flex;align-items:center;gap:2px;flex:none;}
1535
+ .dshm-mini-controls{display:flex;align-items:center;gap:4px;flex:none;}
1536
+ .dshm-mini-controls .dshm-iconbtn{width:30px;height:30px;}
1537
+ .dshm-mini-controls .dshm-mini-play{width:32px;height:32px;}
1538
+ .dshm-mini-like{width:28px;height:28px;margin:0 1px;}
1539
+ .dshm-mini-like:hover{background:var(--dsw-alias-interactive-bg-hover);}
1540
+ .dshm-mini-like.dshm-like-btn-on{color:var(--dshm-love);}
1541
+ .dshm-mini-titlebtn{appearance:none;border:0;background:transparent;padding:0;margin:0;color:inherit;font:inherit;text-align:left;cursor:pointer;max-width:100%;border-radius:4px;}
1542
+ .dshm-mini-titlebtn:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px;}
1543
+ /* ··· 菜单:默认向上展开(贴底停靠不被裁切),拖到视口上半部时自动切为向下 */
1544
+ .dshm-mini-more{position:relative;display:flex;}
1545
+ .dshm-mini-menu{position:absolute;right:0;bottom:calc(100% + 8px);top:auto;min-width:208px;padding:5px;border-radius:11px;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);box-shadow:0 12px 32px var(--dsw-alias-bg-mask-2);z-index:1200;display:flex;flex-direction:column;gap:2px;}
1546
+ .dshm-mini-menu-down{top:calc(100% + 8px);bottom:auto;}
1547
+ .dshm-mini-menuitem{display:flex;align-items:center;gap:10px;padding:7px 10px;border:0;border-radius:7px;background:transparent;color:var(--dsw-alias-label-primary);font:inherit;font-size:12.5px;text-align:left;cursor:pointer;white-space:nowrap;}
1548
+ .dshm-mini-menuitem:hover,.dshm-mini-menuitem:focus-visible{background:var(--dsw-alias-interactive-bg-hover);}
1549
+ .dshm-mini-menuitem .dshm-count{margin-left:auto;padding-left:10px;font-size:11px;color:var(--dsw-alias-label-tertiary);}
1011
1550
  .dshm-mini-play{background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-inverted);border-radius:50%;width:34px;height:34px;}
1012
1551
  .dshm-mini-play:hover:not(:disabled){background:var(--dsw-alias-button-primary-hover);color:var(--dsw-alias-label-primary-inverted);}
1552
+ .dshm-now-actions{display:inline-flex;align-self:flex-start;align-items:center;gap:2px;padding:0;border:0;background:transparent;box-shadow:none;margin:0;}
1553
+ .dshm-now-like{width:34px;height:34px;border-radius:50%;}
1554
+ .dshm-now-like:hover{background:var(--dsw-alias-interactive-bg-hover);}
1555
+ .dshm-now-like.dshm-like-btn-on{background:transparent;}
1556
+ .dshm-transport>.dshm-now-actions{margin:0 4px 0 auto;}
1557
+ .dshm-transport>.dshm-now-actions .dshm-now-like{width:30px;height:30px;color:var(--dsw-alias-label-tertiary);}
1558
+ .dshm-transport>.dshm-now-actions .dshm-now-like:hover{color:var(--dsw-alias-label-primary);}
1559
+ .dshm-transport>.dshm-now-actions .dshm-now-like.dshm-like-btn-on{color:var(--dshm-love);}
1013
1560
  .dshm-reco{max-width:560px;margin:0 auto;}
1014
1561
  .dshm-reco-tags{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin-top:6px;}
1015
- .dshm-reco-tag{font-size:11px;color:var(--dsw-alias-label-secondary);border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:99px;padding:4px 10px;}
1016
- .dshm-reco-page{flex:1;min-height:0;overflow-y:auto;padding:12px 20px;scrollbar-width:thin;scrollbar-color:var(--dsw-alias-scrollbar-bg-l2) transparent;width:100%;max-width:1280px;margin:0 auto;}
1562
+ .dshm-reco-tag{font-size:12px;color:var(--dsw-alias-label-secondary);border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:99px;padding:4px 10px;}
1563
+ .dshm-reco-page{flex:1;min-height:0;overflow-y:auto;padding:12px var(--dshm-pad) 20px;scrollbar-width:thin;scrollbar-color:var(--dsw-alias-scrollbar-bg-l2) transparent;width:100%;max-width:var(--dshm-axis);margin:0 auto;}
1017
1564
  .dshm-reco-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:12px;margin-top:14px;}
1018
1565
  .dshm-reco-card{background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1);border-radius:12px;padding:14px 16px;display:flex;flex-direction:column;gap:8px;transition:border-color .15s,box-shadow .15s;}
1019
1566
  .dshm-reco-card:hover{border-color:var(--dsw-alias-border-l3);box-shadow:0 2px 10px var(--dsw-alias-bg-mask-2);}
1020
1567
  .dshm-reco-card-head{display:flex;align-items:center;gap:6px;flex-wrap:wrap;}
1021
- .dshm-cat-chip{font-size:11px;padding:2px 9px;border-radius:99px;border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);}
1568
+ .dshm-cat-chip{font-size:12px;padding:2px 9px;border-radius:99px;border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);}
1022
1569
  .dshm-cat-explore{color:var(--dsw-alias-brand-text);border-color:var(--dsw-alias-brand-primary);}
1023
- .dshm-axis-chip{font-size:11px;padding:2px 9px;border-radius:99px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-tertiary);}
1570
+ .dshm-axis-chip{font-size:12px;padding:2px 9px;border-radius:99px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-tertiary);}
1024
1571
  .dshm-reco-title{font-size:13.5px;font-weight:600;color:var(--dsw-alias-label-primary);}
1025
- .dshm-reco-sub{font-size:11.5px;color:var(--dsw-alias-label-tertiary);}
1572
+ .dshm-reco-sub{font-size:12px;color:var(--dsw-alias-label-tertiary);}
1026
1573
  .dshm-reco-reason{font-size:12px;line-height:1.6;color:var(--dsw-alias-label-secondary);}
1027
1574
  .dshm-reco-foot{margin-top:auto;display:flex;align-items:center;gap:8px;padding-top:4px;}
1028
1575
  .dshm-dl{background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1);border-radius:12px;padding:12px 14px;display:flex;flex-direction:column;gap:6px;}
@@ -1030,153 +1577,326 @@ window.__ModuleLoader__.load({
1030
1577
  .dshm-dl-dot{width:8px;height:8px;border-radius:50%;background:var(--dsw-alias-label-tertiary);flex:none;}
1031
1578
  .dshm-dl-ok{background:var(--dsw-alias-state-success-primary);}
1032
1579
  .dshm-dl-fail{background:var(--dsw-alias-state-error-primary);}
1033
- .dshm-dl-status{font-size:11px;color:var(--dsw-alias-label-tertiary);flex:none;}
1580
+ .dshm-dl-status{font-size:12px;color:var(--dsw-alias-label-tertiary);flex:none;}
1034
1581
  .dshm-dl-bar{height:3px;border-radius:2px;background:var(--dsw-alias-bg-layer-3);overflow:hidden;margin:2px 0 4px;}
1035
1582
  .dshm-dl-bar>div{height:100%;background:var(--dsw-alias-brand-primary);transition:width .4s ease;}
1036
- .dshm-sync{margin:12px 24px 0;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1);border-radius:12px;padding:12px 16px;display:flex;flex-direction:column;gap:10px;}
1583
+ .dshm-dl-float{position:fixed;right:16px;bottom:16px;z-index:1100;width:min(340px,calc(100% - 32px));background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);border-radius:14px;box-shadow:0 10px 30px var(--dsw-alias-bg-mask-2);padding:10px 12px;display:flex;flex-direction:column;gap:8px;animation:dshm-mini-in .22s ease-out;}
1584
+ .dshm-dl-head{display:flex;align-items:center;gap:8px;min-width:0;}
1585
+ .dshm-dl-title{font-size:13px;font-weight:600;}
1586
+ .dshm-dl-list{display:flex;flex-direction:column;gap:4px;max-height:min(40vh,320px);overflow:auto;padding-right:2px;}
1587
+ .dshm-dl-wait{background:var(--dsw-alias-brand-primary);opacity:.45;}
1588
+ .dshm-dl-note{font-size:12px;color:var(--dsw-alias-label-tertiary);max-width:40%;flex:none;}
1589
+ .dshm-dl-foot{display:flex;align-items:center;gap:8px;border-top:1px solid var(--dsw-alias-border-l1);padding-top:8px;}
1590
+ .dshm-dl-sum{font-size:12px;flex:1;min-width:0;}
1591
+ .dshm-dl-sum-ok{color:var(--dsw-alias-state-success-primary);}
1592
+ .dshm-dl-sum-warn{color:var(--dsw-alias-state-warn-primary);}
1593
+ .dshm-dl-pill{position:fixed;right:16px;bottom:16px;z-index:1100;display:flex;align-items:center;gap:8px;padding:8px 12px;border-radius:999px;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);box-shadow:0 6px 20px var(--dsw-alias-bg-mask-2);font-size:12.5px;color:var(--dsw-alias-label-primary);cursor:pointer;max-width:calc(100% - 32px);}
1594
+ .dshm-dl-pill:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px;}
1595
+ .dshm-dl-pill-bar{width:56px;height:3px;border-radius:2px;background:var(--dsw-alias-bg-layer-3);overflow:hidden;flex:none;}
1596
+ .dshm-dl-pill-bar>span{display:block;height:100%;background:var(--dsw-alias-brand-primary);transition:width .4s ease;}
1597
+ .dshm-sync{margin:12px 0 0;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1);border-radius:12px;padding:12px 16px;display:flex;flex-direction:column;gap:10px;}
1037
1598
  .dshm-sync-chips{display:flex;gap:8px;flex-wrap:wrap;}
1038
- .dshm-sync-chip{font-size:11.5px;border:1px solid var(--dsw-alias-border-l1);border-radius:99px;padding:4px 12px;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-2);}
1039
- .dshm-sync-detail{font-size:11.5px;color:var(--dsw-alias-label-tertiary);line-height:1.7;}
1040
- .dshm-hrow{display:grid;grid-template-columns:40px minmax(0,1fr) auto auto auto;gap:10px;align-items:center;padding:6px 8px;border-radius:10px;}
1041
- .dshm-hrow-click{cursor:pointer;}
1599
+ .dshm-sync-chip{font-size:12px;border:1px solid var(--dsw-alias-border-l1);border-radius:99px;padding:4px 12px;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-2);}
1600
+ .dshm-sync-detail{font-size:12px;color:var(--dsw-alias-label-tertiary);line-height:1.7;}
1601
+ .dshm-sync-chip-ok{color:var(--dsw-alias-state-success-primary);border-color:currentColor;}
1602
+ .dshm-sync-chip-warn{color:var(--dsw-alias-state-warn-primary);border-color:currentColor;}
1603
+ .dshm-imp-result{display:flex;flex-direction:column;gap:8px;}
1604
+ .dshm-state-actions{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;}
1605
+ .dshm-chipbtn-plain{background:transparent;}
1606
+ .dshm-src-chips{display:inline-flex;gap:4px;margin-left:6px;vertical-align:middle;}
1607
+ .dshm-src-chip{font-size:11px;line-height:1;border:1px solid var(--dsw-alias-border-l1);border-radius:99px;padding:2px 6px;color:var(--dsw-alias-label-tertiary);background:var(--dsw-alias-bg-layer-2);}
1608
+ .dshm-src-netease{color:var(--dsw-alias-state-error-primary);}
1609
+ .dshm-src-qq{color:var(--dsw-alias-label-secondary);}
1610
+ .dshm-imp-account{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:13px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);border-radius:10px;padding:8px 12px;}
1611
+ .dshm-imp-nick{font-weight:600;}
1612
+ .dshm-imp-time{font-size:12px;color:var(--dsw-alias-label-tertiary);}
1613
+ .dshm-imp-qr{display:flex;gap:16px;align-items:flex-start;}
1614
+ .dshm-imp-qr-box{flex:none;width:196px;height:196px;border-radius:10px;overflow:hidden;display:flex;align-items:center;justify-content:center;color:var(--dsw-alias-label-tertiary);}
1615
+ .dshm-imp-qr-fallback{display:flex;flex-direction:column;align-items:center;gap:8px;font-size:12px;color:var(--dsw-alias-label-tertiary);text-align:center;padding:12px;}
1616
+ .dshm-imp-qr-side{flex:1;display:flex;flex-direction:column;gap:10px;min-width:0;}
1617
+ .dshm-imp-step{font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary);}
1618
+ .dshm-imp-hint{font-size:12px;line-height:1.7;color:var(--dsw-alias-label-tertiary);}
1619
+ .dshm-imp-cookie{font:12px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);border-radius:9px;padding:9px 11px;box-sizing:border-box;width:100%;outline:none;}
1620
+ .dshm-imp-actions{display:flex;gap:8px;flex-wrap:wrap;}
1621
+ .dshm-qr{display:block;}
1622
+ .dshm-sync-bare{margin:0;padding:10px 0 0;border-top:1px dashed var(--dsw-alias-border-l1);border-radius:0;background:transparent;border-left:0;border-right:0;border-bottom:0;}
1623
+ .dshm-prvs{display:flex;flex-direction:column;gap:8px;}
1624
+ .dshm-prv{background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1);border-radius:12px;overflow:hidden;transition:border-color .15s ease;}
1625
+ .dshm-prv:hover{border-color:var(--dsw-alias-border-l2);}
1626
+ .dshm-prv-open,.dshm-prv-open:hover{border-color:var(--dsw-alias-border-l3);}
1627
+ .dshm-prv-head{display:flex;align-items:center;gap:12px;width:100%;padding:11px 14px;background:transparent;border:0;color:var(--dsw-alias-label-primary);text-align:left;cursor:pointer;font:inherit;min-width:0;}
1628
+ .dshm-prv-head:hover{background:var(--dsw-alias-bg-layer-2);}
1629
+ .dshm-prv-head:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px;}
1630
+ .dshm-prv-icon{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:10px;flex:none;color:var(--dsw-alias-brand-primary);background:color-mix(in srgb,var(--dsw-alias-brand-primary) 12%,transparent);}
1631
+ .dshm-prv-netease .dshm-prv-icon{color:var(--dsw-alias-state-error-primary);background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 12%,transparent);}
1632
+ .dshm-prv-spotify .dshm-prv-icon{color:var(--dsw-alias-state-success-primary);background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 12%,transparent);}
1633
+ .dshm-prv-name{font-size:13.5px;font-weight:600;flex:none;}
1634
+ .dshm-prv-state{margin-left:auto;display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--dsw-alias-label-tertiary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;}
1635
+ .dshm-prv-state::before{content:'';width:7px;height:7px;border-radius:50%;background:currentColor;flex:none;}
1636
+ .dshm-prv-state-ok{color:var(--dsw-alias-state-success-primary);}
1637
+ .dshm-prv-state-busy{color:var(--dsw-alias-brand-primary);}
1638
+ .dshm-prv-state-off::before{opacity:.45;}
1639
+ .dshm-prv-chev{flex:none;color:var(--dsw-alias-label-tertiary);transition:transform .18s ease;}
1640
+ .dshm-prv-open .dshm-prv-chev{transform:rotate(180deg);}
1641
+ .dshm-prv-body{padding:4px 16px 16px;border-top:1px solid var(--dsw-alias-border-l1);}
1642
+ .dshm-prv-body p{margin:0;}
1643
+ .dshm-steps{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;}
1644
+ .dshm-step{display:grid;grid-template-columns:24px 1fr;gap:10px;padding:10px 0;position:relative;}
1645
+ .dshm-step:not(:last-child)::before{content:'';position:absolute;left:11px;top:36px;bottom:-2px;width:2px;border-radius:1px;background:var(--dsw-alias-border-l1);}
1646
+ .dshm-step-n{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;font-size:12px;font-weight:600;color:var(--dsw-alias-label-secondary);border:1.5px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);}
1647
+ .dshm-step-done .dshm-step-n{color:var(--dsw-alias-state-success-primary);border-color:currentColor;background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 12%,transparent);}
1648
+ .dshm-step-active .dshm-step-n{color:var(--dsw-alias-brand-primary);border-color:currentColor;}
1649
+ .dshm-step-miss .dshm-step-n{color:var(--dsw-alias-state-error-primary);border-color:currentColor;}
1650
+ .dshm-step-todo{opacity:.55;}
1651
+ .dshm-step-done .dshm-step-title{color:var(--dsw-alias-label-secondary);}
1652
+ .dshm-step-body{display:flex;flex-direction:column;gap:8px;min-width:0;padding-top:2px;}
1653
+ .dshm-step-title{font-size:13px;font-weight:600;line-height:20px;color:var(--dsw-alias-label-primary);}
1654
+ .dshm-step-content{display:flex;flex-direction:column;gap:8px;min-width:0;}
1655
+ .dshm-step-content>.dshm-chipbtn,.dshm-step-content>.dshm-linkbtn{align-self:flex-start;}
1656
+ .dshm-step-content>.dshm-imp-cookie{align-self:stretch;}
1657
+ .dshm-step-content p{margin:0;}
1658
+ .dshm-imp-summary{display:flex;align-items:flex-start;gap:6px;font-size:13px;font-weight:600;line-height:1.5;color:var(--dsw-alias-state-success-primary);}
1659
+ .dshm-imp-summary svg{flex:none;margin-top:3px;}
1660
+ .dshm-ava{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;flex:none;font-size:12.5px;font-weight:700;color:var(--dsw-alias-brand-primary);background:color-mix(in srgb,var(--dsw-alias-brand-primary) 14%,transparent);}
1661
+ .dshm-imp-nick{max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
1662
+ .dshm-linkbtn{display:inline-flex;align-items:center;gap:4px;padding:0;border:0;background:transparent;color:var(--dsw-alias-brand-primary);font:inherit;font-size:12.5px;cursor:pointer;align-self:flex-start;}
1663
+ .dshm-linkbtn:hover{text-decoration:underline;}
1664
+ .dshm-linkbtn:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px;}
1665
+ .dshm-imp-hint-more{font-size:12px;padding-top:8px;border-top:1px dashed var(--dsw-alias-border-l1);}
1666
+ .dshm-imp-cookie:focus-visible{border-color:var(--dsw-alias-brand-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--dsw-alias-brand-primary) 18%,transparent);}
1667
+ .dshm-row-add-ready{width:auto;height:24px;padding:0 9px 0 7px;gap:3px;border-radius:999px;background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-inverted);}
1668
+ .dshm-row-add-ready:hover{filter:brightness(1.08);background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-inverted);}
1669
+ .dshm-row-add-text{font-size:11px;font-weight:600;line-height:1;}
1670
+ .dshm-row-add-none{opacity:.6;border:1px dashed var(--dsw-alias-border-l3);}
1671
+ .dshm-missing-chip.dshm-scan-chip{display:inline-flex;align-items:center;gap:4px;color:var(--dsw-alias-brand-primary);border-color:color-mix(in srgb,var(--dsw-alias-brand-primary) 35%,transparent);}
1672
+ .dshm-missing-chip{font-size:12px;color:var(--dsw-alias-state-warn-primary);border:1px solid currentColor;border-radius:99px;padding:2px 9px;white-space:nowrap;}
1673
+ .dshm-settings{position:relative;height:100%;overflow:auto;background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-primary);font-size:13px;animation:dshm-fade-in .28s ease-out;}
1674
+ .dshm-settings-inner{max-width:760px;margin:0 auto;padding:28px 24px 150px;width:100%;box-sizing:border-box;display:flex;flex-direction:column;gap:20px;}
1675
+ .dshm-settings-narrow{max-width:540px;}
1676
+ .dshm-set-hero{margin:4px 0 4px;text-align:left;}
1677
+ .dshm-logo{display:block;width:56px;height:56px;object-fit:contain;filter:drop-shadow(0 4px 10px var(--dsw-alias-bg-mask-2));user-select:none;margin:0;}
1678
+ .dshm-set-first-note{margin:4px 0 0;font-size:12.5px;line-height:1.7;color:var(--dsw-alias-label-tertiary);text-align:left;}
1679
+ .dshm-set-top{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding-bottom:12px;border-bottom:1px solid var(--dsw-alias-border-l1);}
1680
+ .dshm-set-top-title{display:flex;align-items:center;gap:8px;color:var(--dsw-alias-label-primary);}
1681
+ .dshm-set-top-title h1{margin:0;font-size:18px;}
1682
+ .dshm-set-top .dshm-count{margin-left:auto;}
1683
+ .dshm-set-sections{display:flex;flex-direction:column;gap:28px;}
1684
+ .dshm-set-section{display:flex;flex-direction:column;gap:12px;scroll-margin-top:12px;}
1685
+ .dshm-set-head{display:flex;flex-wrap:wrap;align-items:center;gap:8px;color:var(--dsw-alias-label-primary);}
1686
+ .dshm-set-head-icon{display:inline-flex;width:26px;height:26px;border-radius:8px;align-items:center;justify-content:center;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-brand-primary);flex:none;}
1687
+ .dshm-set-head .dshm-wstep-title{margin:0;font-size:15px;}
1688
+ .dshm-set-head .dshm-wstep-sub{flex-basis:100%;margin:0;max-width:none;padding-left:34px;line-height:1.55;}
1689
+ .dshm-imp-logged{display:flex;flex-direction:column;gap:10px;min-width:0;}
1690
+ .dshm-imp-account{max-width:100%;}
1691
+ .dshm-set-foot{position:sticky;bottom:0;z-index:2;display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:4px -24px -150px;padding:14px 24px 28px;background:var(--dsw-alias-bg-base);border-top:1px solid var(--dsw-alias-border-l1);}
1692
+ .dshm-set-foot-hint{font-size:12px;color:var(--dsw-alias-label-tertiary);margin-left:auto;}
1693
+ .dshm-set-saved{display:inline-flex;align-items:center;gap:4px;font-size:12px;color:var(--dsw-alias-state-success-primary);}
1694
+ @media (max-width:520px){.dshm-imp-qr{flex-direction:column;align-items:center;}.dshm-settings-inner{padding:20px 16px 88px;}.dshm-set-foot{margin:4px -16px -88px;padding:10px 16px 18px;}}
1695
+ .dshm-hrow{display:flex;align-items:center;gap:12px;padding:7px 10px;border-radius:10px;}
1696
+ .dshm-hrow-play{appearance:none;border:0;background:transparent;padding:0;margin:0;cursor:pointer;flex:none;border-radius:8px;display:inline-flex;}
1697
+ .dshm-hrow-play:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px;}
1698
+ .dshm-hrow-click{cursor:pointer;outline:none;}
1042
1699
  .dshm-hrow-click:hover{background:var(--dsw-alias-interactive-bg-hover);}
1043
1700
  .dshm-hrow-click:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px;}
1044
- .dshm-row-sub-btn{appearance:none;background:none;border:0;padding:0;margin:0;cursor:pointer;text-align:left;font-family:inherit;font-size:12px;color:var(--dsw-alias-label-tertiary);max-width:100%;overflow:hidden;display:inline-flex;align-items:center;gap:4px;vertical-align:middle;}
1701
+ .dshm-row-sub-btn{appearance:none;background:none;border:0;padding:0;margin:0;cursor:pointer;text-align:left;font-family:inherit;font-size:12px;color:var(--dsw-alias-label-tertiary);max-width:100%;overflow:hidden;display:inline-flex;align-items:center;gap:4px;vertical-align:middle;border-radius:3px;}
1045
1702
  .dshm-row-sub-btn:hover{color:var(--dsw-alias-brand-text);text-decoration:underline;text-underline-offset:3px;}
1703
+ .dshm-row-sub-btn:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px;}
1046
1704
  .dshm-hrow:hover{background:var(--dsw-alias-interactive-bg-hover);}
1047
- .dshm-hbar{height:4px;border-radius:2px;background:var(--dsw-alias-bg-layer-3);overflow:hidden;}
1048
- .dshm-hbar>div{height:100%;background:var(--dsw-alias-brand-primary);}
1049
- .dshm-hskip{font-size:10.5px;color:var(--dsw-alias-label-tertiary);border:1px solid var(--dsw-alias-border-l2);border-radius:99px;padding:1px 8px;flex:none;}
1050
- .dshm-htime{font-size:11px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;flex:none;}
1051
- .dshm-hlist{max-width:960px;margin:0 auto;padding:10px 8px 20px;}
1052
- .dshm-explore-chip{flex:none;font-size:11px;font-weight:600;padding:1px 6px;border-radius:99px;background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-primary);border:1px solid var(--dsw-alias-border-l1);}
1053
- .dshm-explore-note{display:flex;align-items:flex-start;gap:7px;margin:10px 18px 0;padding:8px 11px;border-radius:9px;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.5;}
1705
+ .dshm-hrow-meta{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex:none;}
1706
+ .dshm-hbar{height:3px;border-radius:2px;background:var(--dsw-alias-bg-layer-3);overflow:hidden;}
1707
+ .dshm-hbar>div{height:100%;background:var(--dsw-alias-label-tertiary);}
1708
+ .dshm-hskip{font-size:11px;color:var(--dsw-alias-label-tertiary);border:1px solid var(--dsw-alias-border-l2);border-radius:99px;padding:1px 7px;line-height:1.4;flex:none;}
1709
+ .dshm-htime{font-size:12px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;width:44px;text-align:right;flex:none;}
1710
+ .dshm-hlist{margin-top:22px;padding:0 0 24px;}
1711
+ .dshm-hlist .dshm-queue-head{padding:0 10px 10px;margin-bottom:4px;}
1712
+ .dshm-hlist .dshm-queue-head .dshm-col-play{margin-left:auto;}
1713
+ .dshm-explore-chip{flex:none;font-size:12px;font-weight:600;padding:1px 6px;border-radius:99px;background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-primary);border:1px solid var(--dsw-alias-border-l1);}
1714
+ .dshm-explore-note{display:flex;align-items:flex-start;gap:7px;margin:10px 0 0;padding:8px 11px;border-radius:9px;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.5;}
1054
1715
  .dshm-columns{flex:1;min-height:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;}
1055
1716
  .dshm-column{min-height:0;display:flex;flex-direction:column;border-right:1px solid var(--dsw-alias-border-l1);}
1056
1717
  .dshm-column:last-child{border-right:0;}
1057
- .dshm-col-head{flex:none;display:flex;align-items:center;gap:8px;padding:12px 14px 8px;}
1718
+ .dshm-col-head{flex:none;display:flex;align-items:center;gap:8px;padding:12px 10px 8px;}
1058
1719
  .dshm-col-title{font-size:13.5px;font-weight:680;color:var(--dsw-alias-label-primary);display:flex;align-items:center;gap:6px;}
1059
- .dshm-col-count{font-size:11px;color:var(--dsw-alias-label-tertiary);}
1720
+ .dshm-col-count{font-size:12px;color:var(--dsw-alias-label-tertiary);}
1060
1721
  .dshm-col-play{margin-left:0;}
1061
1722
  .dshm-col-actions{display:flex;align-items:center;gap:6px;margin-left:auto;}
1062
1723
  .dshm-col-refresh{width:26px;height:26px;padding:0;justify-content:center;color:var(--dsw-alias-label-secondary);}
1063
1724
  .dshm-col-refresh:hover{color:var(--dsw-alias-label-primary);}
1064
- .dshm-col-loading{display:flex;align-items:center;gap:6px;padding:0 14px 6px;font-size:12px;color:var(--dsw-alias-label-secondary);}
1725
+ .dshm-col-refresh:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-1px;}
1726
+ .dshm-col-loading{display:flex;align-items:center;gap:6px;padding:0 10px 6px;font-size:12px;color:var(--dsw-alias-label-secondary);}
1065
1727
  .dshm-refresh-note{color:var(--dsw-alias-label-secondary);}
1066
1728
  .dshm-playround-busy{background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-inverted);opacity:.7;}
1067
1729
  .dshm-playround .dshm-spin,.dshm-col-refresh .dshm-spin,.dshm-col-loading .dshm-spin,.dshm-row-play .dshm-spin{display:inline-block;width:12px;height:12px;border-radius:50%;border:2px solid currentColor;border-top-color:transparent;box-sizing:border-box;}
1068
- .dshm-col-list{flex:1;min-height:0;overflow-y:auto;padding:2px 8px 16px;scrollbar-width:thin;scrollbar-color:var(--dsw-alias-scrollbar-bg-l2) transparent;}
1069
- .dshm-srow{display:grid;grid-template-columns:38px minmax(0,1fr) auto auto auto;align-items:center;gap:10px;padding:6px;border-radius:10px;transition:background .12s;}
1730
+ .dshm-col-list{flex:1;min-height:0;overflow-y:auto;padding:2px 6px 16px;scrollbar-width:thin;scrollbar-color:var(--dsw-alias-scrollbar-bg-l2) transparent;}
1731
+ .dshm-srow{display:grid;grid-template-columns:40px minmax(0,1fr) auto;align-items:center;gap:10px;padding:6px;border-radius:10px;transition:background .12s;}
1070
1732
  .dshm-srow:hover{background:var(--dsw-alias-interactive-bg-hover);}
1071
- .dshm-srow-main{min-width:0;display:flex;flex-direction:column;gap:1px;border:0;background:transparent;font:inherit;color:inherit;text-align:left;padding:0;cursor:pointer;}
1072
- .dshm-srow-title{font-size:12.5px;font-weight:560;color:var(--dsw-alias-label-primary);}
1073
- .dshm-srow-sub{font-size:11px;color:var(--dsw-alias-label-tertiary);}
1733
+ .dshm-srow-main{min-width:0;display:flex;flex-direction:column;gap:1px;border:0;background:transparent;font:inherit;color:inherit;text-align:left;padding:0;cursor:pointer;outline:none;}
1734
+ .dshm-srow-main:focus-within .dshm-srow-artist{color:var(--dsw-alias-brand-text);}
1735
+ .dshm-srow-title{font-size:13px;font-weight:560;color:var(--dsw-alias-label-primary);}
1736
+ .dshm-srow-sub{font-size:12px;color:var(--dsw-alias-label-tertiary);}
1074
1737
  .dshm-srow-artist{appearance:none;background:none;border:0;padding:0;margin:0;font:inherit;color:inherit;cursor:pointer;border-radius:4px;}
1075
1738
  .dshm-srow-artist:hover{color:var(--dsw-alias-brand-text);text-decoration:underline;text-underline-offset:3px;}
1076
1739
  .dshm-srow-artist:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px;}
1077
- .dshm-srow-reason{font-size:10.5px;color:var(--dsw-alias-label-tertiary);line-height:1.5;margin-top:2px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
1740
+ .dshm-srow-reason{font-size:12px;color:var(--dsw-alias-label-secondary);line-height:1.45;margin-top:3px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
1741
+ .dshm-srow-tail{display:flex;align-items:center;gap:0;opacity:0;transition:opacity .15s;}
1742
+ .dshm-srow:hover .dshm-srow-tail,.dshm-srow:focus-within .dshm-srow-tail{opacity:1;}
1743
+ .dshm-srow-tail .dshm-like-btn-on{opacity:1;}
1744
+ .dshm-srow:has(.dshm-like-btn-on) .dshm-srow-tail{opacity:1;}
1745
+ .dshm-srow-tail .dshm-like-btn-on{color:var(--dshm-love);}
1746
+ .dshm-srow .dshm-playcover{position:relative;flex:none;width:40px;height:40px;border-radius:8px;overflow:hidden;padding:0;border:0;background:transparent;cursor:pointer;}
1747
+ .dshm-srow .dshm-playcover .dshm-tile{width:40px;height:40px;border-radius:0;border:0;}
1748
+ .dshm-srow .dshm-playcover::after{content:"";position:absolute;inset:0;background:var(--dsw-alias-bg-mask-1);opacity:0;transition:opacity .15s;display:flex;align-items:center;justify-content:center;}
1749
+ .dshm-srow .dshm-playcover-ico{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#fff;opacity:0;transition:opacity .15s;z-index:1;}
1750
+ .dshm-srow .dshm-playcover:hover::after,.dshm-srow .dshm-playcover:focus-visible::after{opacity:.35;}
1751
+ .dshm-srow .dshm-playcover:hover .dshm-playcover-ico,.dshm-srow .dshm-playcover:focus-visible .dshm-playcover-ico,.dshm-srow .dshm-playcover[data-on="true"] .dshm-playcover-ico{opacity:1;}
1752
+ .dshm-srow .dshm-playcover[data-on="true"]::after{opacity:.45;}
1753
+ .dshm-srow .dshm-playcover:focus-visible{outline:2px solid #fff;outline-offset:-2px;border-radius:8px;}
1078
1754
  .dshm-like-btn{appearance:none;border:0;background:transparent;color:var(--dsw-alias-label-tertiary);width:30px;height:30px;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:0;flex:none;transition:transform .12s,color .12s;}
1079
1755
  .dshm-like-btn:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover);}
1080
1756
  .dshm-like-btn:active{transform:scale(1.18);}
1081
- .dshm-like-btn-on{color:var(--dsw-alias-state-error-primary);}
1757
+ .dshm-like-btn:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px;}
1758
+ .dshm-like-btn-on,.dshm-like-btn-on:hover{color:var(--dshm-love);}
1082
1759
  .dshm-row-off{opacity:.55;cursor:not-allowed;}
1083
1760
  .dshm-row-off:hover{background:transparent;}
1084
1761
  .dshm-dislike-btn-on{color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-interactive-bg-hover);}
1085
- .dshm-dislikes{margin-top:14px;}
1762
+ .dshm-dislikes{margin-top:16px;padding:14px 12px 10px;border-radius:14px;background:var(--dsw-alias-bg-base);border:1px solid var(--dsw-alias-border-l1);}
1086
1763
  .dshm-dislike-row{display:flex;align-items:center;gap:10px;padding:6px 8px;border-radius:9px;font-size:12.5px;color:var(--dsw-alias-label-secondary);}
1087
1764
  .dshm-dislike-row:hover{background:var(--dsw-alias-interactive-bg-hover);}
1765
+ .dshm-dislike-name{flex:1;min-width:0;color:var(--dsw-alias-label-primary);}
1766
+ .dshm-dislike-date{flex:none;font-variant-numeric:tabular-nums;}
1088
1767
  .dshm-dislike-undo{flex:none;}
1089
1768
  .dshm-playround{appearance:none;border:0;width:30px;height:30px;border-radius:50%;background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-inverted);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:0;flex:none;transition:background .13s,transform .1s;}
1090
1769
  .dshm-playround:hover{background:var(--dsw-alias-button-primary-hover);transform:scale(1.06);}
1770
+ .dshm-playround:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px;}
1091
1771
  .dshm-playround:disabled{opacity:.45;cursor:default;transform:none;}
1772
+ .dshm-chipbtn.dshm-col-play{width:26px;height:26px;padding:0;justify-content:center;border-color:transparent;background:transparent;color:var(--dsw-alias-label-secondary);}
1773
+ .dshm-chipbtn.dshm-col-play:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary);}
1774
+ .dshm-chipbtn.dshm-col-play:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-1px;}
1092
1775
  .dshm-tile{border-radius:8px;overflow:hidden;background:linear-gradient(145deg,var(--dsw-alias-bg-layer-2),var(--dsw-alias-bg-layer-3));border:1px solid var(--dsw-alias-border-l1);display:flex;align-items:center;justify-content:center;color:var(--dsw-alias-label-tertiary);flex:none;}
1093
1776
  .dshm-tile img{width:100%;height:100%;object-fit:cover;display:block;}
1094
- .dshm-arow{display:grid;grid-template-columns:44px minmax(0,1fr) 18px;align-items:center;gap:10px;width:100%;padding:6px;border:0;background:transparent;font:inherit;color:inherit;text-align:left;border-radius:10px;cursor:pointer;transition:background .12s;}
1777
+ .dshm-arow{display:grid;grid-template-columns:44px minmax(0,1fr) 18px;align-items:center;gap:10px;width:100%;padding:6px;border:0;background:transparent;font:inherit;color:inherit;text-align:left;border-radius:10px;cursor:pointer;transition:background .12s;outline:none;}
1095
1778
  .dshm-arow:hover{background:var(--dsw-alias-interactive-bg-hover);}
1779
+ .dshm-arow:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px;}
1096
1780
  .dshm-arow-text{display:flex;flex-direction:column;gap:1px;min-width:0;}
1097
1781
  .dshm-arow-arrow{color:var(--dsw-alias-label-tertiary);font-size:16px;line-height:1;}
1098
- .dshm-apage-banner{position:relative;height:132px;border-radius:16px;overflow:hidden;background:linear-gradient(135deg,var(--dsw-alias-bg-layer-2),var(--dsw-alias-bg-module-platform));margin-bottom:-38px;display:flex;align-items:center;justify-content:flex-end;padding:0 14px;color:var(--dsw-alias-label-tertiary);}
1099
- .dshm-apage-banner img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:.85;}
1100
- .dshm-apage-banner-mask{position:absolute;inset:0;background:linear-gradient(180deg,transparent 30%,var(--dsw-alias-bg-base));}
1101
- .dshm-apage-hero{position:relative;display:flex;align-items:flex-end;gap:16px;margin-bottom:16px;padding:0 8px;}
1102
- .dshm-apage-ava-wrap{width:96px;height:96px;border-radius:50%;border:2px solid var(--dsw-alias-bg-base);box-shadow:0 6px 18px var(--dsw-alias-bg-mask-2);overflow:hidden;flex:none;background:var(--dsw-alias-bg-module-platform);}
1782
+ .dshm-apage{flex:1;min-height:0;overflow-y:auto;padding:16px var(--dshm-pad) 28px;scrollbar-width:thin;scrollbar-color:var(--dsw-alias-scrollbar-bg-l2) transparent;width:100%;max-width:var(--dshm-axis);margin:0 auto;}
1783
+ .dshm-apage-banner{position:relative;height:180px;border-radius:16px;overflow:hidden;background:linear-gradient(135deg,var(--dsw-alias-bg-layer-2),var(--dsw-alias-bg-module-platform));margin-bottom:-56px;display:flex;align-items:center;justify-content:flex-end;padding:0 14px;color:var(--dsw-alias-label-tertiary);}
1784
+ .dshm-apage-banner img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:.9;}
1785
+ .dshm-apage-banner-mask{position:absolute;inset:0;background:linear-gradient(180deg,transparent 20%,var(--dsw-alias-bg-base) 96%);}
1786
+ .dshm-apage-hero{position:relative;display:flex;align-items:flex-end;gap:18px;margin-bottom:18px;padding:0 4px;}
1787
+ .dshm-apage-ava-wrap{width:112px;height:112px;border-radius:50%;border:2px solid var(--dsw-alias-bg-base);box-shadow:0 6px 18px var(--dsw-alias-bg-mask-2);overflow:hidden;flex:none;background:var(--dsw-alias-bg-module-platform);}
1103
1788
  .dshm-apage-ava-wrap .dshm-tile{width:100%!important;height:100%!important;border:0;border-radius:0;}
1789
+ .dshm-apage-name{font-size:24px;font-weight:700;margin:0;letter-spacing:-.2px;}
1790
+ .dshm-apage-sub{font-size:12.5px;color:var(--dsw-alias-label-secondary);margin:2px 0 0;}
1791
+ .dshm-apage-back{margin-bottom:12px;}
1104
1792
  .dshm-agrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:10px;padding:4px 6px;}
1105
- .dshm-artcard{appearance:none;border:0;background:transparent;font:inherit;color:inherit;display:flex;flex-direction:column;align-items:center;gap:7px;padding:10px 6px;border-radius:12px;cursor:pointer;transition:background .13s;}
1793
+ .dshm-artcard{appearance:none;border:0;background:transparent;font:inherit;color:inherit;display:flex;flex-direction:column;align-items:center;gap:7px;padding:10px 6px;border-radius:12px;cursor:pointer;transition:background .13s;outline:none;}
1106
1794
  .dshm-artcard:hover{background:var(--dsw-alias-interactive-bg-hover);}
1795
+ .dshm-artcard:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px;}
1107
1796
  .dshm-artcard:hover .dshm-artava{box-shadow:0 4px 14px var(--dsw-alias-bg-mask-2);}
1108
1797
  .dshm-artava{width:62px;height:62px;border-radius:50%;background:var(--dsw-alias-bg-module-platform);border:1px solid var(--dsw-alias-border-l2);display:flex;align-items:center;justify-content:center;font-size:22px;font-weight:700;color:var(--dsw-alias-label-secondary);transition:box-shadow .15s;}
1109
1798
  .dshm-artname{font-size:12px;font-weight:600;text-align:center;max-width:100%;}
1110
- .dshm-arthint{font-size:10.5px;color:var(--dsw-alias-label-tertiary);text-align:center;line-height:1.45;}
1799
+ .dshm-arthint{font-size:12px;color:var(--dsw-alias-label-tertiary);text-align:center;line-height:1.45;}
1111
1800
  .dshm-mode-group{display:inline-flex;align-items:center;gap:2px;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);border-radius:99px;padding:2px;}
1112
1801
  .dshm-mode-btn{appearance:none;border:0;background:transparent;color:var(--dsw-alias-label-tertiary);width:30px;height:28px;border-radius:99px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:0;}
1113
1802
  .dshm-mode-btn:hover{color:var(--dsw-alias-label-primary);}
1803
+ .dshm-mode-btn:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px;}
1114
1804
  .dshm-mode-btn-on{background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-inverted);}
1115
1805
  .dshm-mode-btn-on:hover{color:var(--dsw-alias-label-primary-inverted);}
1116
- .dshm-mode-hint{font-size:11px;color:var(--dsw-alias-label-tertiary);margin-top:6px;}
1117
- .dshm-apage{flex:1;min-height:0;overflow-y:auto;padding:16px 20px 28px;scrollbar-width:thin;scrollbar-color:var(--dsw-alias-scrollbar-bg-l2) transparent;width:100%;max-width:1120px;margin:0 auto;}
1118
- .dshm-apage-hero{display:flex;align-items:center;gap:16px;margin-bottom:16px;}
1806
+ .dshm-mode-hint{font-size:12px;color:var(--dsw-alias-label-tertiary);margin-top:6px;}
1119
1807
  .dshm-apage-ava{width:76px;height:76px;border-radius:50%;background:var(--dsw-alias-bg-module-platform);border:1px solid var(--dsw-alias-border-l2);display:flex;align-items:center;justify-content:center;font-size:28px;font-weight:700;color:var(--dsw-alias-label-secondary);flex:none;}
1120
- .dshm-apage-name{font-size:20px;font-weight:700;margin:0;}
1121
1808
  @media (max-width:980px){
1122
1809
  .dshm-columns{grid-template-columns:1fr;}
1123
- .dshm-toolbar{padding:10px 12px;}
1124
1810
  .dshm-header{padding:12px 12px 0;}
1125
1811
  .dshm-reco-page{padding:10px 12px;}
1126
1812
  .dshm-apage{padding:14px 12px 24px;}
1127
- .dshm-now{padding:14px 12px;}
1813
+ .dshm-now{padding:0 12px;}
1128
1814
  .dshm-column{border-right:0;border-bottom:1px solid var(--dsw-alias-border-l1);max-height:46vh;}
1129
1815
  }
1130
- .dshm-history-page{width:100%;max-width:960px;margin:0 auto;padding:12px 8px 24px;}
1131
- .dshm-stats-wrap{display:flex;flex-direction:column;gap:12px;margin-bottom:8px;}
1132
- .dshm-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(118px,1fr));gap:8px;}
1133
- .dshm-stat{background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1);border-radius:12px;padding:10px 12px;min-width:0;}
1134
- .dshm-stat-value{font-size:16px;font-weight:700;color:var(--dsw-alias-label-primary);}
1135
- .dshm-stat-label{font-size:11px;color:var(--dsw-alias-label-tertiary);margin-top:2px;}
1136
- .dshm-trend{background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1);border-radius:12px;padding:10px 12px;display:flex;flex-direction:column;gap:6px;}
1137
- .dshm-bars{display:flex;align-items:flex-end;gap:6px;height:88px;}
1138
- .dshm-bar-col{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:4px;height:100%;min-width:0;}
1139
- .dshm-bar{width:100%;max-width:34px;border-radius:6px 6px 2px 2px;background:linear-gradient(180deg,var(--dsw-alias-brand-primary),var(--dsw-alias-bg-layer-3));min-height:3px;}
1140
- .dshm-bar-label{font-size:10px;color:var(--dsw-alias-label-tertiary);}
1141
- .dshm-tops{display:grid;grid-template-columns:1fr 1fr;gap:16px;}
1142
- .dshm-top-col{display:flex;flex-direction:column;gap:2px;min-width:0;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1);border-radius:12px;padding:10px 12px;}
1143
- .dshm-top-row{display:flex;align-items:center;gap:8px;padding:4px 6px;border-radius:8px;font-size:12px;min-width:0;}
1816
+ .dshm-history-page{width:100%;max-width:var(--dshm-axis);margin:0 auto;padding:16px 0 28px;}
1817
+ .dshm-hist-hero{display:grid;grid-template-columns:minmax(260px,1fr) minmax(300px,420px);gap:20px 32px;align-items:stretch;padding:20px 24px;border-radius:14px;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);}
1818
+ .dshm-hist-hero-solo{grid-template-columns:1fr;}
1819
+ .dshm-hist-overview{display:flex;flex-direction:column;justify-content:space-between;min-width:0;}
1820
+ .dshm-hist-main{display:flex;align-items:flex-end;gap:36px;flex-wrap:wrap;}
1821
+ .dshm-hist-big-item{display:flex;flex-direction:column;gap:5px;}
1822
+ .dshm-hist-big-label{font-size:12px;font-weight:500;letter-spacing:0;color:var(--dsw-alias-label-tertiary);}
1823
+ .dshm-hist-big{font-size:32px;font-weight:700;letter-spacing:-.6px;color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;line-height:1.05;display:inline-flex;align-items:baseline;}
1824
+ .dshm-hist-big-unit{font-size:13.5px;font-weight:500;letter-spacing:0;color:var(--dsw-alias-label-secondary);margin:0 6px 0 3px;}
1825
+ .dshm-hist-big-unit:last-child{margin-right:0;}
1826
+ .dshm-hist-foot{font-size:12.5px;color:var(--dsw-alias-label-secondary);margin:14px 0 0;line-height:1.5;}
1827
+ .dshm-hist-foot b{font-weight:600;color:var(--dsw-alias-label-primary);}
1828
+ .dshm-trend-wrap{display:flex;flex-direction:column;min-width:0;}
1829
+ .dshm-trend-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:10px;}
1830
+ .dshm-trend-title{font-size:12px;font-weight:500;color:var(--dsw-alias-label-tertiary);}
1831
+ .dshm-trend-sum{font-size:12px;color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;}
1832
+ .dshm-trend-bars{display:grid;grid-template-columns:repeat(7,1fr);gap:8px;height:78px;align-items:end;border-bottom:1px solid var(--dsw-alias-border-l2);}
1833
+ .dshm-bar-col{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:4px;height:100%;min-width:0;}
1834
+ .dshm-bar-val{font-size:11px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;line-height:1;}
1835
+ .dshm-bar-col-today .dshm-bar-val{color:var(--dsw-alias-brand-primary);font-weight:600;}
1836
+ .dshm-bar{width:24px;max-width:100%;border-radius:5px 5px 0 0;background:var(--dsw-alias-label-tertiary);opacity:.42;min-height:3px;transition:opacity .15s;}
1837
+ .dshm-bar-col:hover .dshm-bar{opacity:.72;}
1838
+ .dshm-bar-today,.dshm-bar-col:hover .dshm-bar-today{background:var(--dsw-alias-brand-primary);opacity:1;}
1839
+ .dshm-bar-zero{background:var(--dsw-alias-border-l2);opacity:1;min-height:2px;height:2px!important;}
1840
+ .dshm-trend-axis{display:grid;grid-template-columns:repeat(7,1fr);gap:8px;margin-top:6px;}
1841
+ .dshm-bar-label{font-size:11px;color:var(--dsw-alias-label-tertiary);text-align:center;font-variant-numeric:tabular-nums;}
1842
+ .dshm-bar-label-today{color:var(--dsw-alias-brand-primary);font-weight:600;}
1843
+ .dshm-tops{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:16px;}
1844
+ .dshm-top-col{display:flex;flex-direction:column;gap:2px;min-width:0;padding:14px 12px 10px;border-radius:14px;background:var(--dsw-alias-bg-base);border:1px solid var(--dsw-alias-border-l1);}
1845
+ .dshm-top-title{height:28px;font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary);padding:0 6px;margin-bottom:6px;display:flex;align-items:center;gap:6px;}
1846
+ .dshm-top-title .dshm-col-play{margin-left:auto;}
1847
+ .dshm-top-row{display:flex;align-items:center;gap:10px;height:44px;padding:0 8px;border-radius:9px;font-size:13px;min-width:0;outline:none;}
1144
1848
  .dshm-top-row-click{cursor:pointer;}
1145
1849
  .dshm-top-row-click:hover{background:var(--dsw-alias-interactive-bg-hover);}
1146
1850
  .dshm-top-row-click:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px;}
1147
- .dshm-top-row-artist{appearance:none;border:0;background:transparent;font:inherit;color:inherit;text-align:left;width:100%;cursor:pointer;}
1851
+ .dshm-top-row-artist{appearance:none;border:0;background:transparent;font:inherit;color:inherit;text-align:left;width:100%;cursor:pointer;outline:none;}
1148
1852
  .dshm-top-row-artist:hover{background:var(--dsw-alias-interactive-bg-hover);}
1853
+ .dshm-top-row-artist:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px;}
1149
1854
  .dshm-top-row-off{opacity:.55;cursor:not-allowed;}
1150
1855
  .dshm-top-row-off:hover{background:transparent;}
1151
1856
  .dshm-top-row:hover{background:var(--dsw-alias-interactive-bg-hover);}
1152
- .dshm-top-rank{width:18px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:11px;flex:none;}
1153
- .dshm-hgroup{margin-top:10px;}
1154
- .dshm-hgroup-label{position:sticky;top:0;z-index:1;display:flex;align-items:center;gap:8px;padding:6px 8px;background:var(--dsw-alias-bg-base);font-size:12px;font-weight:600;color:var(--dsw-alias-label-secondary);}
1155
- .dshm-hbadge{font-size:10.5px;border-radius:99px;padding:1px 8px;border:1px solid var(--dsw-alias-border-l2);flex:none;font-variant-numeric:tabular-nums;}
1156
- .dshm-hbadge-good{color:var(--dsw-alias-state-success-primary);border-color:var(--dsw-alias-state-success-primary);}
1157
- .dshm-hbadge-mid{color:var(--dsw-alias-state-warn-primary);border-color:var(--dsw-alias-state-warn-primary);}
1857
+ .dshm-top-rank{width:18px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:12px;flex:none;text-align:right;}
1858
+ .dshm-top-rank-hi{color:var(--dsw-alias-label-secondary);font-weight:600;}
1859
+ .dshm-top-info{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:center;gap:1px;}
1860
+ .dshm-top-name{color:var(--dsw-alias-label-primary);font-weight:500;line-height:1.25;}
1861
+ .dshm-top-row-artist .dshm-top-name{flex:1;min-width:0;}
1862
+ .dshm-top-sub{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:1.25;}
1863
+ .dshm-top-meter{width:44px;height:4px;border-radius:99px;background:var(--dsw-alias-bg-layer-3);overflow:hidden;flex:none;}
1864
+ .dshm-top-meter>span{display:block;height:100%;border-radius:99px;background:var(--dsw-alias-label-tertiary);opacity:.55;}
1865
+ .dshm-top-row .dshm-count{margin-left:auto;min-width:44px;text-align:right;flex:none;font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-secondary);}
1866
+ .dshm-top-meter+.dshm-count{margin-left:0;}
1867
+ .dshm-hgroup{margin-top:12px;}
1868
+ .dshm-hgroup-label{position:sticky;top:0;z-index:1;display:flex;align-items:center;gap:8px;padding:7px 10px;background:var(--dsw-alias-bg-base);border-bottom:1px solid var(--dsw-alias-border-l1);margin-bottom:4px;font-size:12px;font-weight:600;color:var(--dsw-alias-label-secondary);}
1869
+ .dshm-hbadge{font-size:12px;min-width:40px;text-align:right;flex:none;font-variant-numeric:tabular-nums;}
1870
+ .dshm-hbadge-good{color:var(--dsw-alias-label-secondary);}
1871
+ .dshm-hbadge-mid{color:var(--dsw-alias-state-warn-primary);font-weight:500;}
1158
1872
  .dshm-hbadge-low{color:var(--dsw-alias-label-tertiary);}
1873
+ .dshm-hrow-info{flex:1;min-width:0;}
1874
+ @media (max-width:860px){
1875
+ .dshm-hist-hero{grid-template-columns:1fr;padding:16px 18px;}
1876
+ .dshm-top-meter{display:none;}
1877
+ }
1159
1878
  @media (max-width:680px){
1160
1879
  .dshm-tops{grid-template-columns:1fr;}
1161
- .dshm-hrow{grid-template-columns:40px minmax(0,1fr) auto;}
1162
- .dshm-hskip,.dshm-htime{display:none;}
1880
+ .dshm-hrow .dshm-hskip,.dshm-hrow .dshm-htime{display:none;}
1163
1881
  }
1164
1882
  .dshm-state-spin{animation:dshm-spin 1.4s linear infinite;}
1165
1883
  .dshm-toolbar-flat{margin:0;padding:8px 0;border-bottom:0;}
1166
1884
  @media (max-width:560px){
1167
- .dshm-hrow{grid-template-columns:40px minmax(0,1fr) auto;}
1168
- .dshm-hbar,.dshm-hskip,.dshm-htime{display:none;}
1885
+ .dshm-hrow .dshm-hbar,.dshm-hrow .dshm-hskip,.dshm-hrow .dshm-htime{display:none;}
1169
1886
  .dshm-sync{margin:12px 12px 0;}
1170
1887
  .dshm-reco-page{padding:16px 12px;}
1171
1888
  }
1172
- .dshm-lyrics{max-width:860px;margin:24px auto 0;display:flex;flex-direction:column;gap:8px;}
1173
- .dshm-lyrics-head{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:600;color:var(--dsw-alias-label-secondary);padding:0 8px;}
1174
- .dshm-lyrics-scroll{position:relative;max-height:300px;overflow-y:auto;padding:4px 8px;display:flex;flex-direction:column;gap:2px;scrollbar-width:thin;scrollbar-color:var(--dsw-alias-scrollbar-bg-l2) transparent;}
1175
- .dshm-lyric-line{padding:5px 10px;border-radius:8px;color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:1.6;transition:color .2s,background .2s;}
1889
+ .dshm-lyrics{flex:1;min-height:0;display:flex;flex-direction:column;gap:6px;}
1890
+ .dshm-lyrics-head{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:600;color:var(--dsw-alias-label-secondary);padding:0 8px;}
1891
+ .dshm-lyrics-hint{color:var(--dsw-alias-label-tertiary);font-size:12px;margin-left:auto;font-weight:400;}
1892
+ .dshm-lyrics-scroll{position:relative;flex:1;min-height:120px;overflow-y:auto;padding:8px;display:flex;flex-direction:column;gap:2px;scrollbar-width:thin;scrollbar-color:var(--dsw-alias-scrollbar-bg-l2) transparent;mask-image:linear-gradient(180deg,transparent,#000 28px,#000 calc(100% - 28px),transparent);}
1893
+ .dshm-lyric-line{appearance:none;border:0;background:transparent;font:inherit;text-align:left;width:100%;padding:6px 10px;border-radius:8px;color:var(--dsw-alias-label-tertiary);font-size:14px;line-height:1.6;transition:color .2s,background .2s,transform .2s;cursor:pointer;opacity:.55;}
1894
+ .dshm-lyric-line:hover{background:var(--dsw-alias-interactive-bg-hover);opacity:.85;color:var(--dsw-alias-label-secondary);}
1895
+ .dshm-lyric-line:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px;}
1176
1896
  .dshm-lyric-line-past{color:var(--dsw-alias-label-secondary);}
1177
- .dshm-lyric-line-active{color:var(--dsw-alias-label-primary);font-weight:600;background:var(--dsw-alias-interactive-bg-hover);}
1897
+ .dshm-lyric-line-active{color:var(--dsw-alias-label-primary);font-weight:600;font-size:17px;background:transparent;opacity:1;transform:translateX(2px);}
1178
1898
  .dshm-plain-lyrics{white-space:pre-wrap;color:var(--dsw-alias-label-secondary);line-height:1.8;padding:6px 10px;font-size:13px;}
1179
- .dshm-lyrics-hint{color:var(--dsw-alias-label-tertiary);font-size:12px;padding:6px 10px;}
1899
+ .dshm-lyrics-tip{color:var(--dsw-alias-label-tertiary);font-size:12px;padding:6px 10px;}
1180
1900
  .dshm-drawer-mask{position:absolute;inset:0;background:var(--dsw-alias-bg-mask-1);z-index:5;}
1181
1901
  .dshm-drawer{position:absolute;top:0;right:0;bottom:0;width:min(430px,92%);background:var(--dsw-alias-bg-layer-1);border-left:1px solid var(--dsw-alias-border-l2);box-shadow:-12px 0 32px var(--dsw-alias-bg-mask-2);z-index:6;display:flex;flex-direction:column;animation:dshm-drawer-in .2s ease-out;}
1182
1902
  @keyframes dshm-drawer-in{from{opacity:0;transform:translateX(16px);}to{opacity:1;transform:translateX(0);}}
@@ -1187,20 +1907,30 @@ window.__ModuleLoader__.load({
1187
1907
  .dshm-asec-title{font-size:12px;font-weight:600;color:var(--dsw-alias-label-secondary);display:flex;align-items:center;gap:6px;}
1188
1908
  .dshm-acard{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);border-radius:10px;padding:10px 12px;display:flex;flex-direction:column;gap:6px;}
1189
1909
  .dshm-acard-text{font-size:12.5px;line-height:1.7;color:var(--dsw-alias-label-primary);word-break:break-word;}
1190
- .dshm-acard-meta{font-size:11px;color:var(--dsw-alias-label-tertiary);display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
1910
+ .dshm-acard-meta{font-size:12px;color:var(--dsw-alias-label-tertiary);display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
1191
1911
  .dshm-acard-meta a{color:var(--dsw-alias-link);text-decoration:none;}
1192
1912
  .dshm-acard-meta a:hover{text-decoration:underline;}
1193
- .dshm-kind-chip{font-size:10px;padding:1px 8px;border-radius:99px;border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);}
1913
+ .dshm-kind-chip{font-size:11px;padding:1px 8px;border-radius:99px;border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);}
1194
1914
  .dshm-sim{display:flex;flex-direction:column;gap:6px;}
1195
- .dshm-sim-chip{display:inline-flex;align-items:center;gap:5px;display:inline-flex;flex-direction:column;align-items:flex-start;gap:2px;border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:10px;padding:7px 12px;font-size:12.5px;color:var(--dsw-alias-label-primary);cursor:pointer;text-align:left;font:inherit;}
1915
+ .dshm-sim-chip{display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:10px;padding:8px 12px;color:var(--dsw-alias-label-primary);cursor:pointer;text-align:left;font:inherit;font-size:12.5px;}
1196
1916
  .dshm-sim-chip:hover{background:var(--dsw-alias-interactive-bg-hover);}
1197
- .dshm-sim-chip-reason{font-size:11px;color:var(--dsw-alias-label-tertiary);}
1198
- .dshm-artist-btn{appearance:none;background:none;border:0;color:inherit;font:inherit;padding:0;cursor:pointer;text-align:left;display:inline-flex;align-items:center;gap:5px;max-width:100%;vertical-align:middle;}
1917
+ .dshm-sim-chip:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px;}
1918
+ .dshm-sim-chip-reason{font-size:12px;color:var(--dsw-alias-label-tertiary);}
1919
+ .dshm-artist-btn{appearance:none;background:none;border:0;color:inherit;font:inherit;padding:0;cursor:pointer;text-align:left;display:inline-flex;align-items:center;gap:5px;max-width:100%;vertical-align:middle;border-radius:4px;}
1199
1920
  .dshm-artist-btn:hover{text-decoration:underline;text-underline-offset:3px;}
1921
+ .dshm-artist-btn:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px;}
1922
+ .dshm-modal-mask{position:fixed;inset:0;z-index:1300;background:var(--dsw-alias-bg-mask-2);display:flex;align-items:center;justify-content:center;animation:dshm-fade .15s ease-out;}
1923
+ .dshm-modal{width:min(420px,calc(100% - 32px));background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);border-radius:14px;box-shadow:0 20px 50px var(--dsw-alias-bg-mask-2);padding:22px 22px 18px;display:flex;flex-direction:column;gap:12px;animation:dshm-pop .18s ease-out;}
1924
+ .dshm-modal-title{margin:0;font-size:15px;font-weight:650;color:var(--dsw-alias-label-primary);}
1925
+ .dshm-modal-body{margin:0;font-size:13px;line-height:1.65;color:var(--dsw-alias-label-secondary);}
1926
+ .dshm-modal-body b{color:var(--dsw-alias-label-primary);font-weight:600;}
1927
+ .dshm-modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:4px;}
1928
+ .dshm-wbtn-danger{background:var(--dsw-alias-state-error-primary);border-color:transparent;color:var(--dsw-alias-label-primary-inverted);}
1929
+ .dshm-wbtn-danger:hover{background:var(--dsw-alias-state-error-primary);filter:brightness(1.08);color:var(--dsw-alias-label-primary-inverted);}
1200
1930
  @media (prefers-reduced-motion:reduce){
1201
- .dshm-eq-on i,.dshm-tab-dot,.dshm-skel-box,.dshm-spin,.dshm-state-spin,.dshm-mini,.dshm-mini-fab,.dshm-drawer,.dshm-welcome,.dshm-welcome-fish{animation:none;}
1202
- .dshm-mini{animation:none;}
1203
- .dshm-row,.dshm-iconbtn,.dshm-chipbtn,.dshm-playbtn,.dshm-slider-thumb,.dshm-mini-progress>div,.dshm-reco-card,.dshm-dl-bar>div,.dshm-like-btn,.dshm-playround,.dshm-artcard,.dshm-mode-btn{transition:none;}
1931
+ .dshm-eq-on i,.dshm-tab-dot,.dshm-skel-box,.dshm-spin,.dshm-state-spin,.dshm-mini,.dshm-mini-fab,.dshm-drawer,.dshm-welcome-fish,.dshm-settings,.dshm-logo,.dshm-toast,.dshm-dl-float,.dshm-dl-pill,.dshm-modal,.dshm-modal-mask{animation:none;}
1932
+ .dshm-row,.dshm-iconbtn,.dshm-chipbtn,.dshm-playbtn,.dshm-slider-thumb,.dshm-mini-progress>div,.dshm-reco-card,.dshm-dl-bar>div,.dshm-dl-pill-bar>span,.dshm-like-btn,.dshm-playround,.dshm-artcard,.dshm-mode-btn,.dshm-prv,.dshm-prv-chev,.dshm-lyric-line,.dshm-row-actions,.dshm-srow-tail,.dshm-playcover::after,.dshm-playcover-ico{transition:none;}
1933
+ .dshm-lyric-line{transform:none;}
1204
1934
  }
1205
1935
  `;
1206
1936
 
@@ -1267,13 +1997,15 @@ window.__ModuleLoader__.load({
1267
1997
  }),
1268
1998
  reco: (taste) => request('/dsh-music/api/reco' + tasteQuery(taste)),
1269
1999
  recoStatus: () => request('/dsh-music/api/reco/status'),
1270
- download: (items) => request('/dsh-music/api/download', {
1271
- method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ items }),
2000
+ /* opts.front:运行中也接收,并置顶到待下载列表顶部(用户点了想先听的歌) */
2001
+ download: (items, opts) => request('/dsh-music/api/download', {
2002
+ method: 'POST', headers: { 'Content-Type': 'application/json' },
2003
+ body: JSON.stringify(opts && opts.front ? { items, front: true } : { items }),
1272
2004
  }),
1273
2005
  downloadStatus: () => request('/dsh-music/api/download/status'),
1274
2006
  sync: () => request('/dsh-music/api/sync', { method: 'POST' }),
1275
2007
  syncStatus: () => request('/dsh-music/api/sync/status'),
1276
- syncAvailability: () => request('/dsh-music/api/sync/availability'),
2008
+ syncAvailability: (refresh) => request('/dsh-music/api/sync/availability' + (refresh ? '?refresh=1' : '')),
1277
2009
  history: (limit) => request('/dsh-music/api/history?limit=' + (limit || 50)),
1278
2010
  historyStats: () => request('/dsh-music/api/history/stats'),
1279
2011
  onboardingState: () => request('/dsh-music/api/onboarding/state'),
@@ -1302,6 +2034,16 @@ window.__ModuleLoader__.load({
1302
2034
  method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body),
1303
2035
  }),
1304
2036
  previewStatus: () => request('/dsh-music/api/library/preview/status'),
2037
+ /* 喜欢列表导入(网易云 / QQ 音乐,只读) */
2038
+ likedSyncStatus: () => request('/dsh-music/api/liked-sync/status'),
2039
+ likedSyncNeteaseQr: () => request('/dsh-music/api/liked-sync/netease/qr', { method: 'POST' }),
2040
+ likedSyncNeteaseQrPoll: (key) => request('/dsh-music/api/liked-sync/netease/qr/poll?key=' + encodeURIComponent(key || '')),
2041
+ likedSyncQqQr: () => request('/dsh-music/api/liked-sync/qq/qr', { method: 'POST' }),
2042
+ likedSyncQqQrPoll: (key) => request('/dsh-music/api/liked-sync/qq/qr/poll?key=' + encodeURIComponent(key || '')),
2043
+ likedSyncQqConnect: (cookie) => request('/dsh-music/api/liked-sync/qq/connect', {
2044
+ method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ cookie }),
2045
+ }),
2046
+ likedSyncAction: (provider, action) => request('/dsh-music/api/liked-sync/' + encodeURIComponent(provider) + '/' + encodeURIComponent(action), { method: 'POST' }),
1305
2047
  };
1306
2048
  }
1307
2049
 
@@ -1506,7 +2248,7 @@ window.__ModuleLoader__.load({
1506
2248
  mode: (data && data.mode) || null,
1507
2249
  libraryConfigured: !!(data && data.libraryConfigured),
1508
2250
  libraryPath: (data && data.libraryPath) || null,
1509
- starter, taste: (data && data.taste) || null, error: null,
2251
+ starter, taste: (data && (data.taste || data.prefs)) || null, error: null,
1510
2252
  });
1511
2253
  return data;
1512
2254
  } catch (err) {
@@ -1676,9 +2418,9 @@ window.__ModuleLoader__.load({
1676
2418
  };
1677
2419
  tick();
1678
2420
  }
1679
- async function start(items) {
2421
+ async function start(items, opts) {
1680
2422
  try {
1681
- await api.download(items);
2423
+ await api.download(items, opts);
1682
2424
  store.set({ error: null, finishedAt: 0 });
1683
2425
  } catch (err) {
1684
2426
  store.set({ error: (err && err.message) || String(err) });
@@ -1693,17 +2435,20 @@ window.__ModuleLoader__.load({
1693
2435
  }
1694
2436
 
1695
2437
  function createSyncService(api) {
1696
- const store = createStore({ phase: 'idle', result: null, error: null, available: null, hint: null });
2438
+ /* authorized:null 未知 / true 已找到 spotify-sync 的授权凭据文件 / false 还没授权(主机只查文件存在) */
2439
+ const store = createStore({ phase: 'idle', result: null, error: null, available: null, hint: null, authorized: null });
1697
2440
  let timer = null;
1698
2441
  /* Host probe endpoint: sync is optional, so a failed probe means "unavailable". */
1699
- async function probe() {
2442
+ async function probe(force) {
1700
2443
  try {
1701
- const a = await api.syncAvailability();
1702
- store.set({ available: !!(a && a.available), hint: (a && a.hint) || null });
2444
+ const a = await api.syncAvailability(!!force);
2445
+ store.set({ available: !!(a && a.available), hint: (a && a.hint) || null, authorized: a && a.authorized != null ? !!a.authorized : null });
1703
2446
  } catch {
1704
2447
  store.set({ available: false, hint: null });
1705
2448
  }
1706
2449
  }
2450
+ /* 用户装好 CLI / 完成授权后点「重新检测」:让主机重探(不执行 CLI) */
2451
+ async function recheck() { await probe(true); return store.getSnapshot(); }
1707
2452
  function noteAvailable(s) {
1708
2453
  if (s && typeof s.available === 'boolean') store.set({ available: s.available, hint: s.hint || null });
1709
2454
  }
@@ -1742,7 +2487,7 @@ window.__ModuleLoader__.load({
1742
2487
  }
1743
2488
  async function warm() { await probe(); const r = await refresh(); if (r) poll(); }
1744
2489
  function dispose() { if (timer) { clearTimeout(timer); timer = null; } }
1745
- return { source: store, start, warm, dispose, probe };
2490
+ return { source: store, start, warm, dispose, probe, recheck };
1746
2491
  }
1747
2492
 
1748
2493
  function createHistoryService(api) {
@@ -1778,13 +2523,13 @@ window.__ModuleLoader__.load({
1778
2523
  function createLikesService(api, onAutoDownload) {
1779
2524
  /* keys/dislikes are mutually exclusive on the host: a dislike clears the
1780
2525
  * like and vice versa, so both maps are refreshed after every action. */
1781
- const store = createStore({ keys: {}, dislikes: {}, items: [], dislikeItems: [], loaded: false, error: null });
2526
+ const store = createStore({ keys: {}, dislikes: {}, items: [], dislikeItems: [], loaded: false, error: null, scan: null });
1782
2527
  async function load() {
1783
2528
  try {
1784
2529
  const data = await api.likes();
1785
2530
  const keys = {};
1786
2531
  for (const it of (data && data.items) || []) if (it.liked !== false) keys[likeKey(it)] = it;
1787
- store.set({ keys, items: (data && data.items) || [], loaded: true, error: null });
2532
+ store.set({ keys, items: (data && data.items) || [], loaded: true, error: null, scan: (data && data.scan) || null });
1788
2533
  } catch (err) {
1789
2534
  store.set({ loaded: true, error: (err && err.message) || String(err) });
1790
2535
  }
@@ -1841,6 +2586,213 @@ window.__ModuleLoader__.load({
1841
2586
  return { source: store, toggle, setDislike, isLiked, isDisliked, load };
1842
2587
  }
1843
2588
 
2589
+ /* ================================================================
2590
+ * 6d-2. 喜欢列表导入服务:网易云扫码 / QQ 音乐扫码或 Cookie → 本地「我喜欢」
2591
+ * 只读契约(host/liked-sync.js):不改云端、不下载,只标记 ♥。
2592
+ * store 字段:open/tab/enabled/providers/loaded/error/errorProvider(错误归属的平台,设置页分卡展示)·
2593
+ * qr{provider,key,url,matrix,png}/qrPhase(idle|loading|waiting|confirmed|done|expired|error)/qrMessage ·
2594
+ * qqMode(qr|cookie)/qqCookie/connecting · syncing/provider · result · notice
2595
+ * ================================================================ */
2596
+ function createLikedSyncService(api, onChange) {
2597
+ const store = createStore({
2598
+ open: false, tab: null, enabled: true, providers: {}, loaded: false, error: null, errorProvider: null,
2599
+ qr: null, qrPhase: 'idle', qrMessage: '', qqMode: 'qr', qqCookie: '', connecting: false, syncing: null, result: null, notice: null, copied: false,
2600
+ });
2601
+ let pollTimer = null;
2602
+ let copiedTimer = null;
2603
+ /* 二维码到期能自动换一张:每次打开设置只自动续一次(风控 804 不自动续,要用户亲自点) */
2604
+ const qrAutoRetries = { netease: 0, qq: 0 };
2605
+ let pollSeq = 0;
2606
+ function stopPolling() {
2607
+ if (pollTimer) { clearTimeout(pollTimer); pollTimer = null; }
2608
+ pollSeq++;
2609
+ return pollSeq;
2610
+ }
2611
+ function isConnected(provider) {
2612
+ const p = store.getSnapshot().providers[provider];
2613
+ return !!(p && p.connected);
2614
+ }
2615
+ async function load() {
2616
+ try {
2617
+ const s = await api.likedSyncStatus();
2618
+ /* 不碰 error:同步/连接失败后紧跟的 load() 不能把主机文案冲掉 */
2619
+ store.set({ enabled: !s || s.enabled !== false, providers: (s && s.providers) || {}, loaded: true });
2620
+ } catch (err) {
2621
+ store.set({ loaded: true, error: (err && err.message) || String(err), errorProvider: null });
2622
+ }
2623
+ }
2624
+ function open(tab) {
2625
+ const next = tab || store.getSnapshot().tab || 'netease';
2626
+ stopPolling();
2627
+ qrAutoRetries.netease = 0;
2628
+ qrAutoRetries.qq = 0;
2629
+ store.set({ open: true, tab: next, qr: null, qrPhase: 'idle', qrMessage: '', result: null, notice: null, error: null, errorProvider: null, copied: false });
2630
+ load();
2631
+ autoStartQr(next);
2632
+ }
2633
+ function close() {
2634
+ stopPolling();
2635
+ store.set({ open: false });
2636
+ }
2637
+ function selectTab(tab) {
2638
+ stopPolling();
2639
+ const fresh = qrProviderFor(tab);
2640
+ if (fresh) qrAutoRetries[fresh] = 0; /* 用户亲自切到这家 = 新会话,重新给一次自动续码机会 */
2641
+ store.set({ tab, qr: null, qrPhase: 'idle', qrMessage: '', result: null, notice: null, error: null, errorProvider: null });
2642
+ autoStartQr(tab);
2643
+ }
2644
+ /* 当前展开的平台若处于扫码模式且未登录,就自动取一张二维码(同一时刻只有一个二维码会话) */
2645
+ function qrProviderFor(tab) {
2646
+ if (tab === 'netease') return 'netease';
2647
+ if (tab === 'qq' && (store.getSnapshot().qqMode || 'qr') === 'qr') return 'qq';
2648
+ return null;
2649
+ }
2650
+ function autoStartQr(tab) {
2651
+ const provider = qrProviderFor(tab);
2652
+ if (provider && !isConnected(provider)) startQr(provider);
2653
+ }
2654
+ async function startQr(provider = 'netease') {
2655
+ const seq = stopPolling();
2656
+ store.set({ qr: null, qrPhase: 'loading', qrMessage: '', error: null, errorProvider: null });
2657
+ try {
2658
+ let qr;
2659
+ if (provider === 'qq') {
2660
+ /* QQ 的二维码是 ptlogin 下发的图片:主机已解成模块矩阵(解不出就退回 PNG data URL) */
2661
+ const res = await api.likedSyncQqQr();
2662
+ const matrix = res && res.matrix && Array.isArray(res.matrix.modules) && res.matrix.size > 0
2663
+ ? { size: res.matrix.size, modules: Uint8Array.from(res.matrix.modules) } : null;
2664
+ if (!res || !res.key || (!matrix && !res.png)) throw new Error('QR unavailable');
2665
+ qr = { provider, key: res.key, matrix, png: res.png || null };
2666
+ } else {
2667
+ const res = await api.likedSyncNeteaseQr();
2668
+ const matrix = qrEncode(res && res.url);
2669
+ if (!matrix) throw new Error('QR too long');
2670
+ qr = { provider, key: res.key, url: res.url, matrix };
2671
+ }
2672
+ if (seq !== pollSeq) return;
2673
+ store.set({ qr, qrPhase: 'waiting', qrMessage: '' });
2674
+ pollQr(provider, qr.key, seq);
2675
+ } catch (err) {
2676
+ if (seq !== pollSeq) return;
2677
+ store.set({ qrPhase: 'error', qrMessage: (err && err.message) || String(err) });
2678
+ }
2679
+ }
2680
+ async function pollQr(provider, key, seq) {
2681
+ try {
2682
+ const r = provider === 'qq' ? await api.likedSyncQqQrPoll(key) : await api.likedSyncNeteaseQrPoll(key);
2683
+ if (seq !== pollSeq) return;
2684
+ const code = r && r.code;
2685
+ if (code === 803) {
2686
+ store.set({ qrPhase: 'done', qrMessage: (r && r.message) || '', notice: r && r.account ? { provider, nickname: r.account.nickname || '' } : null });
2687
+ await load();
2688
+ /* 新用户路径:扫码成功 = 登录完成 → 不用再点一次,直接导入 */
2689
+ await sync(provider);
2690
+ return;
2691
+ }
2692
+ if (code === 800 && qrAutoRetries[provider] < 1 && isConnected(provider) === false) {
2693
+ /* 二维码 2 分钟到期是常态(新用户 often 来不及):不打扰用户,自动换一张;每家只自动续一次 */
2694
+ qrAutoRetries[provider]++;
2695
+ store.set({ qrPhase: 'loading', qrMessage: '', qr: null });
2696
+ startQr(provider);
2697
+ return;
2698
+ }
2699
+ if (code === 800 || code === 804) {
2700
+ /* 800 = 服务端说过期(文案通用即可);804 = 风控等,把服务端原话带给用户 */
2701
+ store.set({ qrPhase: 'expired', qrMessage: code === 804 ? ((r && r.message) || '') : '' });
2702
+ return;
2703
+ }
2704
+ store.set({ qrPhase: code === 802 ? 'confirmed' : 'waiting', qrMessage: (r && r.message) || '' });
2705
+ pollTimer = setTimeout(() => { pollTimer = null; pollQr(provider, key, seq); }, 2000);
2706
+ } catch (err) {
2707
+ if (seq !== pollSeq) return;
2708
+ /* 主机只对未知/过期 key 返回 404;其余按过期处理,让用户重新生成。 */
2709
+ store.set({ qrPhase: 'expired', qrMessage: (err && err.message) || String(err) });
2710
+ }
2711
+ }
2712
+ /* QQ 登录方式切换:手机 QQ 扫码(默认)/ 粘贴 Cookie(微信登录的账号) */
2713
+ function setQqMode(mode) {
2714
+ const next = mode === 'cookie' ? 'cookie' : 'qr';
2715
+ const s = store.getSnapshot();
2716
+ if (s.qqMode === next) return;
2717
+ stopPolling();
2718
+ qrAutoRetries.qq = 0;
2719
+ store.set({ qqMode: next, qr: null, qrPhase: 'idle', qrMessage: '', result: null, notice: null, error: null, errorProvider: null });
2720
+ if (s.open && s.tab === 'qq' && next === 'qr') startQr('qq');
2721
+ }
2722
+ function setQqCookie(value) {
2723
+ store.set({ qqCookie: String(value || ''), error: null, errorProvider: null });
2724
+ }
2725
+ async function connectQq() {
2726
+ const cookie = (store.getSnapshot().qqCookie || '').trim();
2727
+ if (!cookie) { store.set({ error: 'importCookieEmpty', errorProvider: 'qq' }); return; }
2728
+ /* connecting 一直保持到自动导入结束:粘贴即连接期间不能再触发一次 */
2729
+ store.set({ connecting: true, error: null, errorProvider: null, result: null });
2730
+ try {
2731
+ const res = await api.likedSyncQqConnect(cookie);
2732
+ store.set({ qqCookie: '', notice: { provider: 'qq', nickname: (res && res.account && res.account.nickname) || '' } });
2733
+ await load();
2734
+ await sync('qq');
2735
+ } catch (err) {
2736
+ store.set({ error: (err && err.message) || String(err), errorProvider: 'qq' });
2737
+ } finally {
2738
+ store.set({ connecting: false });
2739
+ }
2740
+ }
2741
+ async function sync(provider) {
2742
+ if (store.getSnapshot().syncing) return;
2743
+ store.set({ syncing: provider, error: null, errorProvider: null, result: null, notice: null });
2744
+ try {
2745
+ const res = await api.likedSyncAction(provider, 'sync');
2746
+ store.set({ syncing: null, result: Object.assign({ provider }, res || {}) });
2747
+ if (onChange) onChange(provider, res);
2748
+ } catch (err) {
2749
+ store.set({ syncing: null, error: (err && err.message) || String(err), errorProvider: provider });
2750
+ }
2751
+ await load();
2752
+ }
2753
+ async function disconnect(provider) {
2754
+ store.set({ error: null, errorProvider: null, result: null });
2755
+ try { await api.likedSyncAction(provider, 'disconnect'); } catch (err) { store.set({ error: (err && err.message) || String(err), errorProvider: provider }); }
2756
+ await load();
2757
+ if (store.getSnapshot().open && qrProviderFor(provider) === provider) startQr(provider);
2758
+ }
2759
+ /* QQ:「复制命令」把 copy(document.cookie) 写进剪贴板,用户到 y.qq.com 的 Console 里粘贴执行 */
2760
+ async function copyCookieCommand() {
2761
+ const cmd = 'copy(document.cookie)';
2762
+ try {
2763
+ if (typeof navigator !== 'undefined' && navigator.clipboard && navigator.clipboard.writeText) {
2764
+ await navigator.clipboard.writeText(cmd);
2765
+ } else {
2766
+ const ta = typeof document !== 'undefined' && document.createElement ? document.createElement('textarea') : null;
2767
+ if (!ta) return false;
2768
+ ta.value = cmd;
2769
+ ta.setAttribute('readonly', '');
2770
+ ta.style.position = 'fixed';
2771
+ ta.style.opacity = '0';
2772
+ document.body.appendChild(ta);
2773
+ ta.select();
2774
+ const ok = typeof document.execCommand === 'function' ? document.execCommand('copy') : false;
2775
+ document.body.removeChild(ta);
2776
+ if (!ok) return false;
2777
+ }
2778
+ } catch {
2779
+ return false;
2780
+ }
2781
+ store.set({ copied: true });
2782
+ if (copiedTimer) clearTimeout(copiedTimer);
2783
+ copiedTimer = setTimeout(() => store.set({ copied: false }), 2000);
2784
+ return true;
2785
+ }
2786
+ /* 在新标签页打开外部网址(QQ 音乐网页版登录) */
2787
+ function openUrl(url) {
2788
+ try {
2789
+ if (typeof window !== 'undefined' && typeof window.open === 'function') window.open(url, '_blank', 'noopener,noreferrer');
2790
+ } catch { /* 宿主禁止弹窗时静默:用户可手动打开 */ }
2791
+ }
2792
+ function dispose() { stopPolling(); if (copiedTimer) { clearTimeout(copiedTimer); copiedTimer = null; } }
2793
+ return { source: store, load, open, close, selectTab, startQr, setQqMode, setQqCookie, connectQq, sync, disconnect, copyCookieCommand, openUrl, dispose };
2794
+ }
2795
+
1844
2796
  function createPreviewService(api) {
1845
2797
  const store = createStore({ status: 'idle', item: null, error: null });
1846
2798
  let timer = null;
@@ -2082,19 +3034,34 @@ window.__ModuleLoader__.load({
2082
3034
  if (!list.length) return;
2083
3035
  if (snap().track) report(snap().track, true);
2084
3036
  /* D1:播放全部必须跟随当前模式——随机态先打乱队列再随机起播,
2085
- * 顺序/单曲态从首曲开始(单曲由 repeat=one 循环当前首)。 */
3037
+ * 顺序/单曲态从首曲开始(单曲由 repeat=one 循环当前首)。
3038
+ * 十三期修复:点某一首(行 / 队列 / 歌手页)必须从**这一首**开始——随机态只打乱
3039
+ * 它后面的队列(这首排第一),绝不随机起播;只有 playAll 显式要 shuffleStart 才随机起播。 */
2086
3040
  const wantShuffle = opts && typeof opts.shuffle === 'boolean' ? opts.shuffle : snap().shuffle;
3041
+ const randomStart = !!(opts && opts.shuffleStart);
2087
3042
  let queue = list;
2088
- let index = Math.min(Math.max(0, startIndex | 0), list.length - 1);
3043
+ /* 行点击的 startIndex 指向调用方给的列表(可能含无音频项),过滤后要用同一首重新定位 */
3044
+ const picked = tracks ? tracks[startIndex | 0] : null;
3045
+ let index = picked ? list.indexOf(picked) : -1;
3046
+ if (index < 0) index = Math.min(Math.max(0, startIndex | 0), list.length - 1);
2089
3047
  if (wantShuffle && queue.length > 1) {
2090
- queue = [...list];
2091
- for (let i = queue.length - 1; i > 0; i -= 1) {
2092
- const j = Math.floor(Math.random() * (i + 1));
2093
- const tmp = queue[i];
2094
- queue[i] = queue[j];
2095
- queue[j] = tmp;
3048
+ const shuffled = (arr) => {
3049
+ const out = [...arr];
3050
+ for (let i = out.length - 1; i > 0; i -= 1) {
3051
+ const j = Math.floor(Math.random() * (i + 1));
3052
+ const tmp = out[i];
3053
+ out[i] = out[j];
3054
+ out[j] = tmp;
3055
+ }
3056
+ return out;
3057
+ };
3058
+ if (randomStart) {
3059
+ queue = shuffled(list);
3060
+ index = Math.floor(Math.random() * queue.length);
3061
+ } else {
3062
+ queue = [list[index], ...shuffled(list.filter((_, i) => i !== index))];
3063
+ index = 0;
2096
3064
  }
2097
- index = Math.floor(Math.random() * queue.length);
2098
3065
  }
2099
3066
  set({ queue, queueIndex: index, shuffle: wantShuffle });
2100
3067
  if (opts && typeof opts.shuffle === 'boolean') writePrefs({ shuffle: wantShuffle });
@@ -2293,7 +3260,7 @@ window.__ModuleLoader__.load({
2293
3260
  source: store,
2294
3261
  playTracks,
2295
3262
  appendTrack,
2296
- playAll: (tracks, opts) => playTracks(tracks, 0, opts),
3263
+ playAll: (tracks, opts) => playTracks(tracks, 0, { ...(opts || {}), shuffleStart: true }),
2297
3264
  jumpTo,
2298
3265
  toggle,
2299
3266
  next: () => advance(false),
@@ -2311,15 +3278,65 @@ window.__ModuleLoader__.load({
2311
3278
  /* ================================================================
2312
3279
  * 8. Shared UI atoms
2313
3280
  * ================================================================ */
2314
- function IconButton({ label, onClick, active, disabled, className, children }) {
3281
+ function IconButton({ label, title, onClick, active, disabled, className, children, ...rest }) {
2315
3282
  return h('button', {
2316
3283
  type: 'button',
2317
3284
  className: cx('dshm-iconbtn', active && 'dshm-iconbtn-active', className),
2318
- 'aria-label': label, title: label, onClick, disabled,
3285
+ 'aria-label': label, title: title || label, onClick, disabled,
2319
3286
  'aria-pressed': active === undefined ? undefined : !!active,
3287
+ ...rest,
2320
3288
  }, children);
2321
3289
  }
2322
3290
 
3291
+ /* 行内确认弹窗:替代浏览器原生 window.confirm(它会把 DSH 的暗色主题
3292
+ * 撕开一道灰色系统对话框)。一次说清、一次决定 —— Spotify 曲目把两段
3293
+ * 警告合并成一句,不再连环追问。 */
3294
+ function ConfirmDialog({ t, title, body, confirmLabel, danger, onConfirm, onCancel }) {
3295
+ const cancelRef = useRef(null);
3296
+ useEffect(() => {
3297
+ if (cancelRef.current && cancelRef.current.focus) cancelRef.current.focus();
3298
+ const onKey = (e) => {
3299
+ if (e.key === 'Escape') { e.stopPropagation(); onCancel(); }
3300
+ if (e.key === 'Tab') { /* 焦点锁在弹窗内:只有两个按钮,手动轮转 */ e.preventDefault(); }
3301
+ };
3302
+ window.addEventListener('keydown', onKey, true);
3303
+ return () => window.removeEventListener('keydown', onKey, true);
3304
+ }, [onCancel]);
3305
+ return h('div', {
3306
+ className: 'dshm-modal-mask', role: 'presentation',
3307
+ onClick: (e) => { if (e.target === e.currentTarget) onCancel(); },
3308
+ }, h('div', { className: 'dshm-modal', role: 'alertdialog', 'aria-modal': true, 'aria-label': title },
3309
+ h('h3', { className: 'dshm-modal-title' }, title),
3310
+ h('p', { className: 'dshm-modal-body' }, body),
3311
+ h('div', { className: 'dshm-modal-actions' },
3312
+ h('button', { ref: cancelRef, type: 'button', className: 'dshm-wbtn', onClick: onCancel }, t('cancelBtn')),
3313
+ h('button', {
3314
+ type: 'button', className: cx('dshm-wbtn', danger ? 'dshm-wbtn-danger' : 'dshm-wbtn-primary'),
3315
+ onClick: onConfirm,
3316
+ }, confirmLabel))));
3317
+ }
3318
+
3319
+ /* `const ask = useConfirm(t)` → `ask({...})` 返回 Promise<boolean>;
3320
+ * 组件树里渲染 `{dialog}` 即可。 */
3321
+ function useConfirm(t) {
3322
+ const [req, setReq] = useState(null);
3323
+ const resolveRef = useRef(null);
3324
+ const ask = useCallback((opts) => new Promise((resolve) => {
3325
+ resolveRef.current = resolve;
3326
+ setReq(opts);
3327
+ }), []);
3328
+ const close = useCallback((val) => {
3329
+ setReq(null);
3330
+ if (resolveRef.current) { resolveRef.current(val); resolveRef.current = null; }
3331
+ }, []);
3332
+ const dialog = req ? h(ConfirmDialog, {
3333
+ t, ...req,
3334
+ onCancel: () => close(false),
3335
+ onConfirm: () => close(true),
3336
+ }) : null;
3337
+ return [ask, dialog];
3338
+ }
3339
+
2323
3340
  function Cover({ track, size, className }) {
2324
3341
  const [failed, setFailed] = useState(false);
2325
3342
  const id = track && track.id;
@@ -2403,15 +3420,61 @@ window.__ModuleLoader__.load({
2403
3420
 
2404
3421
  /* First-run welcome flow: hero -> taste -> library choice -> starter progress.
2405
3422
  * The host owns starter provisioning; this view only reflects its status. */
2406
- function WelcomeView({ t, onboarding, useOnboarding, preview, onExitPreview, onRoute }) {
2407
- const snap = useOnboarding((st) => st);
2408
- const [step, setStep] = useState(0);
2409
- const [genres, setGenres] = useState([]);
2410
- const [langs, setLangs] = useState([]);
2411
- const [mode, setMode] = useState('starter');
2412
- const [dirPath, setDirPath] = useState('');
3423
+ /* ================================================================
3424
+ * 11d. 设置页(首启欢迎流程的继任者):一个页面收齐「喜欢列表同步 / 推荐口味 / 音乐库」。
3425
+ * - 首启(onboarding 未完成):顶部是真实 Logo 的欢迎区,底部「先随便看看 / 完成」;
3426
+ * 「完成」= 原欢迎流程的收尾(口味 + 曲库选择 → 选 starter 则展示进度 → 进入推荐)。
3427
+ * - 老用户:右上角「设置」进来,改完「保存设置」;section 可让入口直接滚到某个区块。
3428
+ * Logo 走主机 /dsh-music/icon.png(包内真实图标),取不到时退回内嵌 FishLogo。
3429
+ * ================================================================ */
3430
+ function PluginLogo({ size = 160 }) {
3431
+ const [failed, setFailed] = useState(false);
3432
+ if (failed) return h(FishLogo, { size });
3433
+ return h('img', {
3434
+ className: 'dshm-logo', src: resolveUrl('/dsh-music/icon.png'), width: size, height: size,
3435
+ alt: 'dsh-music', draggable: false, decoding: 'async',
3436
+ onError: () => setFailed(true),
3437
+ });
3438
+ }
3439
+
3440
+ function SettingsView({ t, onboarding, useOnboarding, sync, useSync, likedSync, useLikedSync, section, onExit, onRoute, onViewLikes }) {
3441
+ const snap = useOnboarding((st) => st) || {};
3442
+ const firstRun = snap.completed !== true;
3443
+ const taste = snap.taste || {};
3444
+ const [genres, setGenres] = useState(() => (taste.genres || []).slice());
3445
+ const [langs, setLangs] = useState(() => (taste.languages || []).slice());
3446
+ const [mode, setMode] = useState(snap.mode === 'starter' || snap.mode === 'none' ? 'starter' : (snap.completed === true ? 'local' : 'starter'));
3447
+ const [dirPath, setDirPath] = useState(snap.libraryPath || '');
2413
3448
  const [busy, setBusy] = useState(false);
2414
3449
  const [failed, setFailed] = useState(false);
3450
+ const [savedAt, setSavedAt] = useState(0);
3451
+ const [starterPhase, setStarterPhase] = useState(false);
3452
+ const likedRef = useRef(null);
3453
+ const tasteRef = useRef(null);
3454
+ const libRef = useRef(null);
3455
+
3456
+ /* 喜欢列表区块挂载期间保持登录态:首启自动展开网易云扫码;老用户仅静默加载状态,默认收起三家卡片、按需点击才取码。 */
3457
+ useEffect(() => {
3458
+ if (!likedSync) return undefined;
3459
+ if (firstRun) {
3460
+ if (!likedSync.source.getSnapshot().open) likedSync.open('netease');
3461
+ } else if (!likedSync.source.getSnapshot().loaded) {
3462
+ likedSync.load();
3463
+ }
3464
+ return () => likedSync.close();
3465
+ }, [likedSync, firstRun]);
3466
+ /* 入口可指定区块(「我喜欢」页的导入按钮 → 直接滚到喜欢列表同步) */
3467
+ useEffect(() => {
3468
+ const el = section === 'liked' ? likedRef.current : section === 'taste' ? tasteRef.current : section === 'lib' ? libRef.current : null;
3469
+ if (el && typeof el.scrollIntoView === 'function') el.scrollIntoView({ block: 'start' });
3470
+ }, [section]);
3471
+ /* 首启选了 starter:进度由 onboarding 服务轮询,就绪后刷新曲库 */
3472
+ useEffect(() => {
3473
+ if (!starterPhase || !onboarding) return undefined;
3474
+ const st = onboarding.source.getSnapshot().starter;
3475
+ if (!st || st.status !== 'downloading') onboarding.pollStarter();
3476
+ return undefined;
3477
+ }, [starterPhase, onboarding]);
2415
3478
 
2416
3479
  const genreOptions = ['pop', 'rock', 'electronic', 'hip hop', 'jazz', 'classical', 'folk', 'blues', 'soul', 'funk', 'reggae', 'metal', 'punk', 'country', 'ambient'];
2417
3480
  const genreLabel = (g) => 'genre_' + g.replace(/[^a-z]/g, '');
@@ -2430,29 +3493,42 @@ window.__ModuleLoader__.load({
2430
3493
  const starterStatus = starter ? starter.status : 'idle';
2431
3494
  const starterPct = starterTotal > 0 ? Math.min(100, Math.round((starterDone / starterTotal) * 100)) : (starterStatus === 'ready' ? 100 : 0);
2432
3495
 
3496
+ function payloadFor() {
3497
+ const payload = { taste: { genres, languages: langs }, libraryMode: mode };
3498
+ if (mode === 'starter') payload.useStarter = true;
3499
+ else if (dirPath.trim()) payload.libraryPath = dirPath.trim();
3500
+ return payload;
3501
+ }
3502
+ /* 首启「完成」:口味 + 曲库一起落盘;选 starter 则进入进度面板 */
2433
3503
  async function finish() {
2434
- /* Preview mode must never touch real state: no POST, no prefs, no route. */
2435
- if (preview) { onExitPreview(); return; }
2436
3504
  if (busy) return;
2437
3505
  setBusy(true);
2438
3506
  setFailed(false);
2439
3507
  try {
2440
- const payload = { taste: { genres, languages: langs }, libraryMode: mode };
2441
- if (mode === 'starter') payload.useStarter = true;
2442
- else if (dirPath.trim()) payload.libraryPath = dirPath.trim();
2443
- await onboarding.complete(payload);
3508
+ await onboarding.complete(payloadFor());
2444
3509
  } catch (err) {
2445
3510
  setFailed(true);
2446
3511
  setBusy(false);
2447
3512
  return;
2448
3513
  }
2449
3514
  setBusy(false);
2450
- if (mode === 'starter') setStep(3);
3515
+ if (mode === 'starter' && starterStatus !== 'ready') setStarterPhase(true);
2451
3516
  else onRoute('library');
2452
3517
  }
2453
-
3518
+ /* 老用户「保存设置」:口味 / 目录改动落盘(主机对已就绪的 starter 不会重复下载) */
3519
+ async function save() {
3520
+ if (busy) return;
3521
+ setBusy(true);
3522
+ setFailed(false);
3523
+ try {
3524
+ await onboarding.complete(payloadFor());
3525
+ setSavedAt(Date.now());
3526
+ } catch (err) {
3527
+ setFailed(true);
3528
+ }
3529
+ setBusy(false);
3530
+ }
2454
3531
  function skipAll() {
2455
- if (preview) { onExitPreview(); return; }
2456
3532
  onRoute('reco');
2457
3533
  }
2458
3534
 
@@ -2463,40 +3539,6 @@ window.__ModuleLoader__.load({
2463
3539
  onClick: () => toggle(list, setList, value),
2464
3540
  }, label);
2465
3541
 
2466
- const dots = h('div', { className: 'dshm-wdots', 'aria-hidden': true },
2467
- [0, 1, 2, 3].map((i) => h('span', { key: i, className: cx('dshm-wdot', i === step && 'dshm-wdot-on') })));
2468
-
2469
- const hero = h('div', { className: 'dshm-welcome-hero' },
2470
- h('div', { className: 'dshm-welcome-glow', 'aria-hidden': true }),
2471
- h('div', { className: 'dshm-welcome-fish' }, h(FishLogo, { size: 176 })),
2472
- h('h1', { className: 'dshm-welcome-title' }, t('welcomeTitle')),
2473
- h('p', { className: 'dshm-welcome-sub' }, t('welcomeSub')),
2474
- h('div', { className: 'dshm-welcome-actions' },
2475
- h('button', {
2476
- type: 'button', className: 'dshm-wbtn dshm-wbtn-primary',
2477
- onClick: () => setStep(1),
2478
- }, h(IconSparkles, { size: 16 }), t('welcomeStart')),
2479
- preview
2480
- ? h('button', { type: 'button', className: 'dshm-wbtn', onClick: onExitPreview }, t('welcomeBack'))
2481
- : h('button', { type: 'button', className: 'dshm-wbtn', onClick: skipAll }, t('welcomeSkip'))),
2482
- h('div', { className: 'dshm-welcome-points' },
2483
- [t('welcomePoint1'), t('welcomePoint2'), t('welcomePoint3')]
2484
- .map((text, i) => h('div', { className: 'dshm-wpoint', key: i }, h(IconCheck, { size: 13 }), h('span', null, text)))));
2485
-
2486
- const taste = h('div', { className: 'dshm-welcome-panel' },
2487
- h('h2', { className: 'dshm-wstep-title' }, t('welcomeTasteTitle')),
2488
- h('p', { className: 'dshm-wstep-sub' }, t('welcomeTasteSub')),
2489
- h('div', { className: 'dshm-wgroup' },
2490
- h('div', { className: 'dshm-wlabel' }, t('welcomeGenres')),
2491
- h('div', { className: 'dshm-wchips' }, genreOptions.map((g) => tasteChip(g, t(genreLabel(g)), genres, setGenres)))),
2492
- h('div', { className: 'dshm-wgroup' },
2493
- h('div', { className: 'dshm-wlabel' }, t('welcomeLanguages')),
2494
- h('div', { className: 'dshm-wchips' }, langOptions.map((o) => tasteChip(o.value, t(o.key), langs, setLangs)))),
2495
- h('p', { className: 'dshm-whint' }, t('welcomeTasteNote')),
2496
- h('div', { className: 'dshm-welcome-actions' },
2497
- h('button', { type: 'button', className: 'dshm-wbtn', onClick: () => setStep(0) }, t('welcomePrev')),
2498
- h('button', { type: 'button', className: 'dshm-wbtn dshm-wbtn-primary', onClick: () => setStep(2) }, t('welcomeNext'))));
2499
-
2500
3542
  const pickCard = (value, icon, title, body) => h('button', {
2501
3543
  key: value, type: 'button',
2502
3544
  className: cx('dshm-wcard', mode === value && 'dshm-wcard-on'),
@@ -2508,9 +3550,31 @@ window.__ModuleLoader__.load({
2508
3550
  h('span', { className: 'dshm-wcard-title' }, title),
2509
3551
  h('span', { className: 'dshm-wcard-body' }, body)));
2510
3552
 
2511
- const library = h('div', { className: 'dshm-welcome-panel' },
2512
- h('h2', { className: 'dshm-wstep-title' }, t('welcomeLibTitle')),
2513
- h('p', { className: 'dshm-wstep-sub' }, t('welcomeLibSub')),
3553
+ const sectionHead = (ref, id, icon, title, sub, extra) => h('div', { className: 'dshm-set-head' },
3554
+ h('span', { className: 'dshm-set-head-icon' }, h(icon, { size: 16 })),
3555
+ h('h2', { className: 'dshm-wstep-title', id }, title),
3556
+ extra || null,
3557
+ sub ? h('p', { className: 'dshm-wstep-sub' }, sub) : null);
3558
+
3559
+ /* ── ① 喜欢列表同步:网易云 / QQ 音乐 / Spotify 各一行手风琴(新用户分步引导) ── */
3560
+ const likedSection = h('section', { className: 'dshm-set-section', ref: likedRef, 'aria-label': t('setLikedTitle') },
3561
+ sectionHead(null, 'dshm-set-liked', IconHeart, t('setLikedTitle'), t('setLikedSub')),
3562
+ h(LikedProviders, { t, sync, useSync, likedSync, useLikedSync, firstRun, onViewLikes }));
3563
+
3564
+ /* ── ② 推荐口味 ── */
3565
+ const tasteSection = h('section', { className: 'dshm-set-section', ref: tasteRef, 'aria-label': t('setTasteTitle') },
3566
+ sectionHead(null, 'dshm-set-taste', IconSparkles, t('setTasteTitle'), t('welcomeTasteSub')),
3567
+ h('div', { className: 'dshm-wgroup' },
3568
+ h('div', { className: 'dshm-wlabel' }, t('welcomeGenres')),
3569
+ h('div', { className: 'dshm-wchips' }, genreOptions.map((g) => tasteChip(g, t(genreLabel(g)), genres, setGenres)))),
3570
+ h('div', { className: 'dshm-wgroup' },
3571
+ h('div', { className: 'dshm-wlabel' }, t('welcomeLanguages')),
3572
+ h('div', { className: 'dshm-wchips' }, langOptions.map((o) => tasteChip(o.value, t(o.key), langs, setLangs)))),
3573
+ h('p', { className: 'dshm-whint' }, t('welcomeTasteNote')));
3574
+
3575
+ /* ── ③ 音乐库 ── */
3576
+ const libSection = h('section', { className: 'dshm-set-section', ref: libRef, 'aria-label': t('setLibTitle') },
3577
+ sectionHead(null, 'dshm-set-lib', IconFolder, t('setLibTitle'), firstRun ? t('welcomeLibSub') : t('setLibSubReturning')),
2514
3578
  h('div', { className: 'dshm-wcards' },
2515
3579
  pickCard('local', IconFolder, t('welcomeLocalTitle'), t('welcomeLocalBody')),
2516
3580
  pickCard('starter', IconSparkles, t('welcomeStarterTitle'), t('welcomeStarterBody'))),
@@ -2523,16 +3587,10 @@ window.__ModuleLoader__.load({
2523
3587
  placeholder: t('welcomePathPlaceholder'), value: dirPath,
2524
3588
  onChange: (e) => setDirPath(e.target.value),
2525
3589
  }),
2526
- h('p', { className: 'dshm-whint' }, t('welcomePathHint'))),
2527
- failed ? h('p', { className: 'dshm-whint dshm-whint-err' }, t('welcomeSaveFail')) : null,
2528
- h('div', { className: 'dshm-welcome-actions' },
2529
- h('button', { type: 'button', className: 'dshm-wbtn', onClick: () => setStep(1) }, t('welcomePrev')),
2530
- h('button', {
2531
- type: 'button', className: 'dshm-wbtn dshm-wbtn-primary', disabled: busy,
2532
- onClick: finish,
2533
- }, h(IconCheck, { size: 15 }), t('welcomeFinish'))));
3590
+ h('p', { className: 'dshm-whint' }, t('welcomePathHint'))));
2534
3591
 
2535
- const starterPanel = h('div', { className: 'dshm-welcome-panel' },
3592
+ /* ── 首启选 starter 后的进度面板(原欢迎流程第 4 步) ── */
3593
+ const starterPanel = h('div', { className: 'dshm-welcome-panel dshm-set-section' },
2536
3594
  h('h2', { className: 'dshm-wstep-title' }, t('welcomeStarterTitle')),
2537
3595
  h('p', { className: 'dshm-wstep-sub' },
2538
3596
  starterStatus === 'ready' ? t('welcomeStarterReady')
@@ -2552,17 +3610,62 @@ window.__ModuleLoader__.load({
2552
3610
  h('div', { className: 'dshm-welcome-actions' },
2553
3611
  h('button', {
2554
3612
  type: 'button', className: 'dshm-wbtn dshm-wbtn-primary',
2555
- onClick: () => (preview ? onExitPreview() : onRoute('reco')),
3613
+ onClick: () => onRoute('reco'),
2556
3614
  }, h(IconSparkles, { size: 15 }), t('welcomeEnter'))));
2557
3615
 
2558
- const panels = [hero, taste, library, starterPanel];
2559
- return h('div', { className: cx('dshm-welcome', preview && 'dshm-welcome-preview') },
2560
- h('div', { className: 'dshm-welcome-inner' },
2561
- panels[step] || hero,
2562
- step > 0 && step < 3 ? dots : null,
2563
- preview
2564
- ? h('button', { type: 'button', className: 'dshm-wclose', title: t('welcomeBack'), onClick: onExitPreview }, h(IconClose, { size: 14 }))
2565
- : null));
3616
+ if (firstRun && starterPhase) {
3617
+ return h('div', { className: 'dshm-settings' },
3618
+ h('div', { className: 'dshm-settings-inner dshm-settings-narrow' }, starterPanel));
3619
+ }
3620
+
3621
+ const hero = firstRun
3622
+ /* 杂志式左对齐报头:小徽标 + 标题 + 一句不兜售的副文。没有光晕、没有漂浮、没有打勾卖点墙。 */
3623
+ ? h('header', { className: 'dshm-welcome-hero dshm-set-hero' },
3624
+ h('div', { className: 'dshm-set-masthead' },
3625
+ h('div', { className: 'dshm-welcome-fish' }, h(PluginLogo, { size: 56 })),
3626
+ h('div', { className: 'dshm-set-masthead-text' },
3627
+ h('h1', { className: 'dshm-welcome-title' }, t('welcomeTitle')),
3628
+ h('p', { className: 'dshm-welcome-sub' }, t('welcomeSub')))),
3629
+ /* 三条要点改成一行安静的脚注(用 · 分隔),不再是一列打勾 */
3630
+ h('p', { className: 'dshm-welcome-points' },
3631
+ [t('welcomePoint1'), t('welcomePoint2'), t('welcomePoint3')]
3632
+ .map((text, i) => h('span', { className: 'dshm-wpoint', key: i }, h('span', { className: 'dshm-wpoint-dot', 'aria-hidden': true }), text))),
3633
+ h('p', { className: 'dshm-set-first-note' }, t('settingsFirstRunNote')))
3634
+ : null;
3635
+
3636
+ const statusLine = failed
3637
+ ? h('span', { className: 'dshm-whint dshm-whint-err', role: 'alert' }, t('welcomeSaveFail'))
3638
+ : savedAt && Date.now() - savedAt < 4000
3639
+ ? h('span', { className: 'dshm-set-saved', role: 'status' }, h(IconCheck, { size: 13 }), t('settingsSaved'))
3640
+ : null;
3641
+
3642
+ const foot = firstRun
3643
+ ? h('div', { className: 'dshm-set-foot' },
3644
+ h('button', { type: 'button', className: 'dshm-wbtn', onClick: skipAll }, t('welcomeSkip')),
3645
+ h('button', {
3646
+ type: 'button', className: 'dshm-wbtn dshm-wbtn-primary', disabled: busy,
3647
+ onClick: finish,
3648
+ }, h(IconCheck, { size: 15 }), t('welcomeFinish')),
3649
+ h('span', { className: 'dshm-set-foot-hint' }, t('settingsFinishHint')))
3650
+ : h('div', { className: 'dshm-set-foot' },
3651
+ h('button', { type: 'button', className: 'dshm-wbtn', onClick: onExit }, h(IconChevronUp, { size: 14, style: { transform: 'rotate(-90deg)' } }), t('settingsBack')),
3652
+ statusLine,
3653
+ h('button', {
3654
+ type: 'button', className: 'dshm-wbtn dshm-wbtn-primary', disabled: busy,
3655
+ onClick: save,
3656
+ }, h(IconCheck, { size: 15 }), t('settingsSave')));
3657
+
3658
+ return h('div', { className: cx('dshm-settings', firstRun && 'dshm-settings-first') },
3659
+ h('div', { className: 'dshm-settings-inner' },
3660
+ hero,
3661
+ !firstRun ? h('div', { className: 'dshm-set-top' },
3662
+ h('div', { className: 'dshm-set-top-title' }, h(IconGear, { size: 16 }), h('h1', { className: 'dshm-wstep-title' }, t('settingsTitle'))),
3663
+ h('span', { className: 'dshm-count' }, t('settingsHint'))) : null,
3664
+ h('div', { className: 'dshm-set-sections' },
3665
+ likedSection,
3666
+ tasteSection,
3667
+ libSection),
3668
+ foot));
2566
3669
  }
2567
3670
 
2568
3671
  function Slider({ value, onChange, label, disabled, className }) {
@@ -2632,39 +3735,35 @@ window.__ModuleLoader__.load({
2632
3735
  return source || '';
2633
3736
  }
2634
3737
 
2635
- function LikeButton({ t, item, likes, useLikes }) {
3738
+ function LikeButton({ t, item, likes, useLikes, size = 15, className }) {
2636
3739
  const liked = useLikes((st) => !!st.keys[likeKey(item)]);
2637
3740
  return h('button', {
2638
3741
  type: 'button',
2639
- className: cx('dshm-like-btn', liked && 'dshm-like-btn-on'),
3742
+ className: cx('dshm-like-btn', liked && 'dshm-like-btn-on', className),
2640
3743
  'aria-label': liked ? t('unlikeBtn') : t('likeBtn'),
2641
3744
  'aria-pressed': !!liked,
2642
3745
  title: liked ? t('likedBtn') : t('likeBtn'),
2643
3746
  onClick: (e) => { e.stopPropagation(); likes.toggle(item, !liked); },
2644
- }, h(IconHeart, { size: 15, style: liked ? { fill: 'currentColor' } : undefined }));
3747
+ }, h(IconHeart, { size, style: liked ? { fill: 'currentColor' } : undefined }));
2645
3748
  }
2646
3749
 
2647
- function DislikeButton({ t, item, likes, useLikes }) {
3750
+ function DislikeButton({ t, item, likes, useLikes, size = 15, className }) {
2648
3751
  const disliked = useLikes((st) => !!((st.dislikes || {})[likeKey(item)]));
2649
3752
  return h('button', {
2650
3753
  type: 'button',
2651
- className: cx('dshm-like-btn', 'dshm-dislike-btn', disliked && 'dshm-dislike-btn-on'),
3754
+ className: cx('dshm-like-btn', 'dshm-dislike-btn', disliked && 'dshm-dislike-btn-on', className),
2652
3755
  'aria-label': disliked ? t('undislikeBtn') : t('dislikeBtn'),
2653
3756
  'aria-pressed': !!disliked,
2654
3757
  title: disliked ? t('undislikedBtn') : t('dislikeBtn'),
2655
3758
  onClick: (e) => { e.stopPropagation(); likes.setDislike(item, !disliked); },
2656
- }, h(IconThumbDown, { size: 15, style: disliked ? { fill: 'currentColor' } : undefined }));
3759
+ }, h(IconThumbDown, { size, style: disliked ? { fill: 'currentColor' } : undefined }));
2657
3760
  }
2658
3761
 
2659
- function TrackRow({ track, index, isCurrent, playing, onPlay, onDelete, onReveal, onOpenArtist, likes, useLikes, t, muted, pending }) {
3762
+ function TrackRow({ track, index, isCurrent, playing, onPlay, onDelete, onReveal, onOpenArtist, likes, useLikes, t, muted, pending, onAdd }) {
2660
3763
  return h('div', {
2661
3764
  className: cx('dshm-row', isCurrent && 'dshm-row-current', muted && 'dshm-row-off'),
2662
- role: 'button', tabIndex: 0,
2663
- 'aria-label': t('playTrack') + ': ' + track.title,
3765
+ role: 'listitem',
2664
3766
  onClick: () => onPlay(track, index),
2665
- onKeyDown: (e) => {
2666
- if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onPlay(track, index); }
2667
- },
2668
3767
  },
2669
3768
  h(Cover, { track, size: 40 }),
2670
3769
  h('div', { className: 'dshm-row-info' },
@@ -2679,21 +3778,47 @@ window.__ModuleLoader__.load({
2679
3778
  onClick: (e) => { e.stopPropagation(); onOpenArtist(track.artist); },
2680
3779
  }, track.artist)
2681
3780
  : (track.artist || t('unknownArtist')),
2682
- track.album ? ' · ' + track.album : '')),
3781
+ track.album ? ' · ' + track.album : '',
3782
+ track.sources
3783
+ ? h('span', { className: 'dshm-src-chips' }, Object.keys(track.sources).map((p) => {
3784
+ const label = p === 'netease' ? t('srcNetease') : p === 'qq' ? t('srcQq') : p;
3785
+ return h('span', { key: p, className: 'dshm-src-chip dshm-src-' + p, title: label }, label);
3786
+ }))
3787
+ : null)),
2683
3788
  h('span', { className: 'dshm-row-dur' }, formatTime(track.duration)),
3789
+ h('span', { className: 'dshm-row-tail' },
2684
3790
  likes ? h(LikeButton, { t, item: track, likes, useLikes }) : null,
2685
- likes ? h(DislikeButton, { t, item: track, likes, useLikes }) : null,
3791
+ /* 「不喜欢」只属于推荐 / 正在播放 —— 曲库里想移除一首歌,取消 ♥ 或删除文件即可。 */
3792
+ (likes && !onDelete) ? h(DislikeButton, { t, item: track, likes, useLikes }) : null,
3793
+ /* 十三期:后台扫描结果决定样式——found → 实心「可入库」药丸;none → 虚线淡色(点了会再找一次);未扫描 → 普通图标 */
3794
+ onAdd && track.inLibrary === false
3795
+ ? (() => {
3796
+ const addState = track.source ? (track.source.status === 'found' && track.source.hit ? 'ready' : 'none') : 'unknown';
3797
+ return h(IconButton, {
3798
+ key: 'add',
3799
+ label: t(addState === 'ready' ? 'addReady' : addState === 'none' ? 'addNone' : 'addMissing'),
3800
+ className: cx('dshm-row-add', addState === 'ready' && 'dshm-row-add-ready', addState === 'none' && 'dshm-row-add-none'),
3801
+ onClick: (e) => { e.stopPropagation(); onAdd(track); },
3802
+ }, h(IconDownload, { size: addState === 'ready' ? 12 : 14 }), addState === 'ready' ? h('span', { className: 'dshm-row-add-text' }, t('addReadyShort')) : null);
3803
+ })()
3804
+ : null,
2686
3805
  onDelete ? h('span', { className: 'dshm-row-actions', onClick: (e) => e.stopPropagation() },
2687
- h(IconButton, { label: t('revealTrack'), onClick: (e) => { e.stopPropagation(); onReveal(track); } }, h(IconDisc, { size: 14 })),
2688
- h(IconButton, { label: t('deleteTrack'), onClick: (e) => { e.stopPropagation(); onDelete(track); } }, h(IconClose, { size: 14 }))) : null,
2689
- h('span', { className: cx('dshm-row-play', pending && 'dshm-playround-busy'), 'aria-hidden': true },
2690
- pending ? h('span', { className: 'dshm-spin' }) : h(IconPlay, { size: 15 })));
3806
+ h(IconButton, { label: t('revealTrack'), onClick: (e) => { e.stopPropagation(); onReveal(track); } }, h(IconFolder, { size: 15 })),
3807
+ h(IconButton, { label: t('deleteTrack'), className: 'dshm-iconbtn-danger', onClick: (e) => { e.stopPropagation(); onDelete(track); } }, h(IconTrash, { size: 15 }))) : null,
3808
+ h('button', {
3809
+ type: 'button', className: cx('dshm-row-play', pending && 'dshm-playround-busy'),
3810
+ 'aria-label': t('playTrack') + ': ' + (track.title || t('untitled')),
3811
+ title: t('playTrack'),
3812
+ onClick: (e) => { e.stopPropagation(); onPlay(track, index); },
3813
+ },
3814
+ pending ? h('span', { className: 'dshm-spin' }) : h(IconPlay, { size: 15 }))),
3815
+ );
2691
3816
  }
2692
3817
 
2693
3818
  /* ================================================================
2694
3819
  * 9. Library view — search, grouping, play-all / shuffle
2695
3820
  * ================================================================ */
2696
- function LibraryView({ t, player, library, sync, download, preview, likes, openArtistPage, artistImages, useSync, useDownload, useLibrary, usePlayer, useLikes, useArtistImages }) {
3821
+ function LibraryView({ t, player, library, sync, download, preview, likes, openArtistPage, artistImages, likedSync, openSettings, useSync, useDownload, useLibrary, usePlayer, useLikes, useArtistImages, tabWish, onTabWishDone }) {
2697
3822
  const status = useLibrary((s) => s.status);
2698
3823
  const tracks = useLibrary((s) => s.tracks);
2699
3824
  const error = useLibrary((s) => s.error);
@@ -2702,28 +3827,56 @@ window.__ModuleLoader__.load({
2702
3827
  const [query, setQuery] = useState('');
2703
3828
  const [searchState, setSearchState] = useState({ status: 'idle', local: [], remote: [] });
2704
3829
  const [groupBy, setGroupBy] = useState('none');
2705
- const [libTab, setLibTab] = useState('library');
3830
+ const [libTab, setLibTab] = useState(tabWish || 'library');
3831
+ /* 入口指定子页(设置页「查看我喜欢」):挂载后或 wish 变化时切过去,用完即清 */
3832
+ useEffect(() => {
3833
+ if (!tabWish) return;
3834
+ setLibTab(tabWish);
3835
+ if (onTabWishDone) onTabWishDone();
3836
+ }, [tabWish]);
2706
3837
  const [rowError, setRowError] = useState('');
2707
3838
  const [playNotice, setPlayNotice] = useState('');
2708
3839
  const searchRef = useRef(null);
3840
+ useEffect(() => {
3841
+ if (typeof window === 'undefined') return undefined;
3842
+ const onClear = () => setQuery('');
3843
+ window.addEventListener('dshm:clear-search', onClear);
3844
+ return () => window.removeEventListener('dshm:clear-search', onClear);
3845
+ }, []);
3846
+ const [askConfirm, confirmDialog] = useConfirm(t);
2709
3847
  const shuffle = usePlayer((s) => s.shuffle);
2710
3848
  const repeat = usePlayer((s) => s.repeat);
2711
3849
  const mode = modeMeta(t, shuffle, repeat);
2712
- const syncAvail = useSync ? useSync((st) => st.available) : null;
2713
- const syncHint = useSync ? useSync((st) => st.hint) : null;
2714
- const syncUsable = syncAvail !== false;
2715
3850
  const syncState = useSync ? useSync((st) => st.phase) : 'idle';
2716
3851
  const likeItems = useLikes((st) => st.items || []);
2717
3852
  /* Liked rows reuse the library row layout; host resolves trackId/audioUrl
2718
3853
  * for everything inside the library, so those rows are directly playable. */
2719
3854
  const likedTracks = useMemo(() => likeItems.map((it) => ({
2720
3855
  id: it.trackId || ('liked::' + it.key),
3856
+ key: it.key,
2721
3857
  title: it.title, artist: it.artist, album: it.album,
2722
3858
  duration: it.durationMs ? Math.round(it.durationMs / 1000) : (it.duration || 0),
2723
3859
  audioUrl: it.audioUrl || null, coverUrl: it.coverUrl || null,
2724
3860
  muted: !it.audioUrl,
3861
+ inLibrary: it.inLibrary == null ? !!it.audioUrl : !!it.inLibrary,
3862
+ /* 来自网易云 / QQ 音乐导入的条目带 sources,行内显示来源小标 */
3863
+ sources: it.sources && Object.keys(it.sources).length ? it.sources : null,
3864
+ /* 后台音源扫描结果:{ status: 'found'|'none', hit } */
3865
+ source: it.source && typeof it.source === 'object' ? it.source : null,
2725
3866
  })), [likeItems]);
3867
+ const likesScan = useLikes((st) => st.scan) || null;
3868
+ /* 扫描进行中每 5 s 刷一次列表(本地读,便宜),让「可入库」按钮陆续亮起来 */
3869
+ const scanTimer = useRef(null);
3870
+ const scanRunning = !!(likesScan && likesScan.running);
3871
+ useEffect(() => {
3872
+ if (libTab !== 'likes' || !scanRunning || typeof setTimeout !== 'function') return undefined;
3873
+ const tickScan = () => { scanTimer.current = null; likes.load(); };
3874
+ scanTimer.current = setTimeout(tickScan, 5000);
3875
+ return () => { if (scanTimer.current) clearTimeout(scanTimer.current); scanTimer.current = null; };
3876
+ }, [libTab, scanRunning, likes]);
2726
3877
  const likedPlayable = useMemo(() => likedTracks.filter((tr) => !!tr.audioUrl), [likedTracks]);
3878
+ /* 导入但还没入库的数量(行尾给「入库」按钮) */
3879
+ const likedMissing = useMemo(() => likedTracks.filter((tr) => !tr.inLibrary).length, [likedTracks]);
2727
3880
 
2728
3881
  /* Backend search (local filter + MusicBrainz completion), debounced.
2729
3882
  * Empty query keeps the pure client-side browse below. */
@@ -2791,10 +3944,13 @@ window.__ModuleLoader__.load({
2791
3944
 
2792
3945
  async function onDelete(track) {
2793
3946
  const liked = track.source === 'spotify-liked';
2794
- if (liked) {
2795
- if (!window.confirm(t('deleteLikedConfirm'))) return;
2796
- if (!window.confirm(t('deleteLikedConfirm2'))) return;
2797
- } else if (!window.confirm(t('deleteConfirm'))) return;
3947
+ const ok = await askConfirm({
3948
+ title: t('confirmDeleteTitle'),
3949
+ body: liked ? t('deleteLikedConfirm') : fmt(t('deleteConfirm'), { title: track.title || t('untitled') }),
3950
+ confirmLabel: t('confirmDeleteBtn'),
3951
+ danger: true,
3952
+ });
3953
+ if (!ok) return;
2798
3954
  try {
2799
3955
  setRowError('');
2800
3956
  await library.remove(track.id, true);
@@ -2806,12 +3962,107 @@ window.__ModuleLoader__.load({
2806
3962
  try { setRowError(''); await library.reveal(track.id); }
2807
3963
  catch (err) { setRowError((err && err.message) || t('deleteFailed')); }
2808
3964
  }
3965
+ /* 导入的 ♥ 还没有本地音频:点一下 = 先入库(走核实下载管线),而不是只报「无法播放」 */
3966
+ const knownHit = (item) => (item && item.source && item.source.status === 'found' && item.source.hit ? item.source.hit : null);
2809
3967
  function playLiked(track) {
2810
- if (!track.audioUrl) { setPlayNotice(t('topUnplayable')); return; }
3968
+ if (!track.audioUrl) {
3969
+ if (track.inLibrary === false && download) {
3970
+ /* 后台已找到可靠音源 → 直接置顶入库,不再当场搜(也就不会"没找到") */
3971
+ if (!knownHit(track)) setPlayNotice(fmt(t('addMissingSearching'), { title: track.title }));
3972
+ addMissing(track, { front: true });
3973
+ return;
3974
+ }
3975
+ setPlayNotice(t('topUnplayable'));
3976
+ return;
3977
+ }
2811
3978
  setPlayNotice('');
2812
3979
  const idx = likedPlayable.indexOf(track);
2813
3980
  player.playTracks(likedPlayable, idx >= 0 ? idx : 0);
2814
3981
  }
3982
+ /* 「入库」:导入的喜欢条目还不在本地 → 曲库搜索找带核实记录的候选,交给既有下载管线
3983
+ * (每批 ≤20、串行、先核实再下载,只写 ~/Music/dsh-music)。歌名对不上就不下载。 */
3984
+ /* 匹配用繁→简补充(MusicBrainz 中文条目常是港台繁体;t2s.js 的常用表缺 費/麗/華 之类)——只用于打分,不改展示 */
3985
+ const T2S_MATCH = { '傑':'杰','劉':'刘','吳':'吴','嚴':'严','場':'场','塗':'涂','孫':'孙','島':'岛','嶼':'屿','帥':'帅','師':'师','擊':'击','東':'东','楊':'杨','橋':'桥','歐':'欧','湯':'汤','溫':'温','滅':'灭','澤':'泽','無':'无','獨':'独','盧':'卢','竇':'窦','簡':'简','練':'练','縉':'缙','繆':'缪','華':'华','萬':'万','葉':'叶','蔣':'蒋','蕭':'萧','蘇':'苏','蘭':'兰','衛':'卫','訓':'训','許':'许','諸':'诸','譚':'谭','費':'费','賀':'贺','賈':'贾','賴':'赖','趙':'赵','軍':'军','連':'连','進':'进','達':'达','遲':'迟','鄒':'邹','鄧':'邓','鄭':'郑','錢':'钱','鍾':'钟','閔':'闵','閻':'阎','陰':'阴','陸':'陆','陽':'阳','雲':'云','霑':'沾','鞏':'巩','韓':'韩','響':'响','頔':'𬱖','顏':'颜','顧':'顾','風':'风','馬':'马','馮':'冯','麗':'丽','黃':'黄','龍':'龙','龐':'庞','龔':'龚' };
3986
+ const normKey = (x) => normalizeZh(String(x || '')).replace(/[\u3400-\u9fff]/g, (c) => T2S_MATCH[c] || c).toLowerCase().replace(/\s+/g, '');
3987
+ /* 候选打分:歌名完全一致 > 包含;同分看歌手覆盖数(导入条目的歌手出现在候选歌手里的个数)。
3988
+ * 搜索结果里翻唱/同名曲很多(「千里之外」会混着 費玉清 单曲、刘芳 翻唱),不按歌手挑会入错。 */
3989
+ /* 当场找音源(后台没扫到的):歌名一致 + 歌手至少对上一个才要(与主机 source-scan.js 同一规则)——翻唱 / 同名歌不算 */
3990
+ function pickMissingHit(item, remote) {
3991
+ const want = normKey(item.title);
3992
+ const artists = String(item.artist || '').split(/\s*(?:\/|、|,|,|;|;|&|\+|feat\.?|ft\.?)\s*/i).map(normKey).filter((x) => x.length > 0);
3993
+ const unknownArtist = artists.length === 0 || /^(未知歌手|未知|unknown( artist)?|artist|群星|暂无|无|-)?$/i.test(String(item.artist || '').trim());
3994
+ const covers = (x) => artists.reduce((n, a) => n + (a && normKey(x.artist).includes(a) ? 1 : 0), 0);
3995
+ const near = (a, b) => a && b && a.length >= b.length * 0.8 && b.length >= a.length * 0.8;
3996
+ let best = null;
3997
+ for (const x of remote) {
3998
+ if (!x || !x.verification || x.kind === 'artist' || !x.title) continue;
3999
+ const nt = normKey(x.title);
4000
+ const titleScore = nt === want ? 3 : (near(nt, want) && (nt.includes(want) || want.includes(nt))) ? 1 : 0;
4001
+ if (!titleScore) continue;
4002
+ const c = covers(x);
4003
+ if (!unknownArtist && c === 0) continue;
4004
+ const score = titleScore * 10 + (unknownArtist ? 1 : c + (c === artists.length ? 1 : 0));
4005
+ if (!best || score > best.score) best = { x, score };
4006
+ }
4007
+ return best ? best.x : null;
4008
+ }
4009
+ async function addMissing(item, opts) {
4010
+ try {
4011
+ /* 后台扫描已命中的直接用(不联网);否则当场搜一次(none/未扫描的条目) */
4012
+ const hit = knownHit(item);
4013
+ if (!hit) {
4014
+ const r = await library.searchRemote((item.artist ? item.artist + ' ' : '') + item.title);
4015
+ const remote = (r && Array.isArray(r.remote) ? r.remote : []);
4016
+ const found = pickMissingHit(item, remote);
4017
+ if (!found) { setPlayNotice(fmt(t('addMissingNone'), { title: item.title })); return null; }
4018
+ return enqueueHit(item, found, opts);
4019
+ }
4020
+ return enqueueHit(item, hit, opts);
4021
+ } catch (err) {
4022
+ setPlayNotice((err && err.message) || t('downloadError'));
4023
+ return null;
4024
+ }
4025
+ }
4026
+ /* 单首点击 → front:置顶到待下载列表(正在下载的那首相让不了);批量 → 排队尾 */
4027
+ async function enqueueHit(item, hit, opts) {
4028
+ const ok = await download.start([hit], opts);
4029
+ setPlayNotice(ok
4030
+ ? (opts && opts.front ? fmt(t('addMissingQueuedFront'), { title: item.title }) : t('addMissingQueued'))
4031
+ : (download.source.getSnapshot().error || t('downloadError')));
4032
+ return ok ? hit : null;
4033
+ }
4034
+ /* 「入库 N 首」:后台已命中的直接拿(不联网);其余逐个找核实候选(最多当场找 30 首),凑一批(≤20)一起交给下载队列 */
4035
+ const [adding, setAdding] = useState(false);
4036
+ async function addMissingBatch() {
4037
+ if (adding) return;
4038
+ const missing = likedTracks.filter((tr) => !tr.inLibrary);
4039
+ const items = missing.slice(0, 60);
4040
+ if (!items.length) return;
4041
+ setAdding(true);
4042
+ setPlayNotice(t('addMissingSearchingBatch'));
4043
+ const hits = [];
4044
+ let searched = 0;
4045
+ try {
4046
+ for (const item of items) {
4047
+ if (hits.length >= 20) break;
4048
+ const known = knownHit(item);
4049
+ if (known) { hits.push(known); continue; }
4050
+ if (searched >= 30) continue;
4051
+ searched += 1;
4052
+ const r = await library.searchRemote((item.artist ? item.artist + ' ' : '') + item.title).catch(() => null);
4053
+ const hit = pickMissingHit(item, (r && Array.isArray(r.remote) ? r.remote : []));
4054
+ if (hit) hits.push(hit);
4055
+ }
4056
+ } finally {
4057
+ setAdding(false);
4058
+ }
4059
+ if (!hits.length) { setPlayNotice(t('addMissingNoneBatch')); return; }
4060
+ const ok = await download.start(hits);
4061
+ const miss = items.length - hits.length;
4062
+ setPlayNotice(ok
4063
+ ? fmt(t('addMissingBatchQueued'), { n: hits.length, m: miss })
4064
+ : (download.source.getSnapshot().error || t('downloadError')));
4065
+ }
2815
4066
 
2816
4067
  const renderRow = (tr, i) => h(TrackRow, {
2817
4068
  key: tr.id || i, track: tr, index: i,
@@ -2822,17 +4073,16 @@ window.__ModuleLoader__.load({
2822
4073
  function RemoteRow(item, i) {
2823
4074
  const isArtist = item.kind === 'artist';
2824
4075
  const name = isArtist ? (item.name || item.artist || '') : (item.title || '');
4076
+ /* 歌手结果:整行就是入口(右侧只留一枚安静的 ›),不再每行一颗「查看歌手」按钮,也不再重复「歌手 · 歌手」 */
2825
4077
  const sub = isArtist
2826
- ? t('searchTypeArtist')
4078
+ ? (item.profile || t('searchTypeArtist'))
2827
4079
  : (item.artist || '') + (item.album ? ' · ' + item.album : '');
2828
- return h('div', { className: 'dshm-row', key: 'r' + i, role: 'listitem' },
4080
+ const body = h(React.Fragment, null,
2829
4081
  isArtist
2830
4082
  ? h(ArtistAvatar, { name, size: 40, service: artistImages, useArtistImages })
2831
4083
  : h('div', { className: 'dshm-tile', style: { width: 40, height: 40 } }, h(IconNote, { size: 15 })),
2832
4084
  h('div', { className: 'dshm-row-info' },
2833
- h('div', { className: 'dshm-row-title' },
2834
- isArtist ? h('span', { className: 'dshm-cat-chip' }, t('searchTypeArtist')) : null,
2835
- h('span', { className: 'dshm-ellipsis' }, name)),
4085
+ h('div', { className: 'dshm-row-title dshm-ellipsis' }, name),
2836
4086
  h('div', { className: 'dshm-row-sub dshm-ellipsis' },
2837
4087
  isArtist || !item.artist
2838
4088
  ? sub
@@ -2840,19 +4090,24 @@ window.__ModuleLoader__.load({
2840
4090
  h('button', {
2841
4091
  type: 'button', className: 'dshm-row-sub-btn',
2842
4092
  title: t('artistOpen'), 'aria-label': t('artistOpen'),
2843
- onClick: () => openArtistPage(item.artist),
4093
+ onClick: (e) => { e.stopPropagation(); openArtistPage(item.artist); },
2844
4094
  }, item.artist),
2845
4095
  item.album ? ' · ' + item.album : ''))),
2846
4096
  isArtist
2847
- ? h('button', {
2848
- type: 'button', className: 'dshm-chipbtn',
2849
- onClick: () => openArtistPage(name),
2850
- }, h(IconNote, { size: 13 }), t('artistOpen'))
4097
+ ? h('span', { className: 'dshm-row-tail dshm-row-chev', 'aria-hidden': true }, h(IconChevronUp, { size: 14, style: { transform: 'rotate(90deg)' } }))
2851
4098
  : h('button', {
2852
- type: 'button', className: 'dshm-chipbtn',
4099
+ type: 'button', className: 'dshm-chipbtn dshm-chipbtn-ghost',
2853
4100
  onClick: () => playRemote(item),
2854
- title: t('previewLabel'),
2855
- }, h(IconPlay, { size: 13 }), t('previewLabel')));
4101
+ title: t('previewLabel'), 'aria-label': t('previewLabel'),
4102
+ }, h(IconPlay, { size: 13 })));
4103
+ return isArtist
4104
+ ? h('div', {
4105
+ className: 'dshm-row dshm-row-click', key: 'r' + i, role: 'button', tabIndex: 0,
4106
+ title: t('artistOpen'),
4107
+ onClick: () => openArtistPage(name),
4108
+ onKeyDown: (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); openArtistPage(name); } },
4109
+ }, body)
4110
+ : h('div', { className: 'dshm-row', key: 'r' + i, role: 'listitem' }, body);
2856
4111
  }
2857
4112
 
2858
4113
  let content;
@@ -2862,10 +4117,15 @@ window.__ModuleLoader__.load({
2862
4117
  ? h(EmptyState, {
2863
4118
  icon: h(IconHeart, { size: 28 }),
2864
4119
  title: t('likesEmptyTitle'), body: t('likesEmptyBody'),
2865
- }, h('button', {
2866
- type: 'button', className: 'dshm-chipbtn dshm-chipbtn-primary',
2867
- onClick: () => setLibTab('library'),
2868
- }, h(IconNote, { size: 14 }), t('goLibrary')))
4120
+ }, h('div', { className: 'dshm-state-actions' },
4121
+ likedSync ? h('button', {
4122
+ type: 'button', className: 'dshm-chipbtn dshm-chipbtn-primary',
4123
+ onClick: () => openSettings('liked'),
4124
+ }, h(IconImport, { size: 14 }), t('importBtn')) : null,
4125
+ h('button', {
4126
+ type: 'button', className: cx('dshm-chipbtn', likedSync && 'dshm-chipbtn-plain'),
4127
+ onClick: () => setLibTab('library'),
4128
+ }, h(IconNote, { size: 14 }), t('goLibrary'))))
2869
4129
  : likedFiltered.length === 0
2870
4130
  ? h(EmptyState, {
2871
4131
  icon: h(IconSearch, { size: 28 }),
@@ -2876,6 +4136,8 @@ window.__ModuleLoader__.load({
2876
4136
  key: tr.id || ('liked' + i), track: tr, index: i,
2877
4137
  isCurrent: currentId === tr.id, playing, muted: tr.muted,
2878
4138
  onPlay: playLiked, onOpenArtist: openArtistPage, likes, useLikes, t,
4139
+ /* 行尾「入库」只给「导入且不在曲库」的条目(有 audioUrl 的已在曲库) */
4140
+ onAdd: download && !tr.inLibrary && !tr.audioUrl ? (tr2) => addMissing(tr2, { front: true }) : null,
2879
4141
  })));
2880
4142
  } else if (status === 'loading' && tracks.length === 0) {
2881
4143
  content = h('div', { className: 'dshm-list' }, h(SkeletonRows));
@@ -2899,13 +4161,11 @@ window.__ModuleLoader__.load({
2899
4161
  type: 'button', className: 'dshm-chipbtn',
2900
4162
  onClick: () => library.rescan(),
2901
4163
  }, h(IconRefresh, { size: 14 }), t('emptyRescanCta')),
2902
- sync ? h('button', {
2903
- type: 'button',
2904
- className: cx('dshm-chipbtn', !syncUsable && 'dshm-chipbtn-off'),
2905
- disabled: !syncUsable || syncState === 'running',
2906
- title: syncUsable ? (syncHint || t('syncOptionalHint')) : (syncHint || t('syncUnavailableHint')),
2907
- onClick: () => sync.start(),
2908
- }, h(IconRefresh, { size: 14, className: syncState === 'running' ? 'dshm-spin' : undefined }), t('syncOptional')) : null),
4164
+ /* Spotify 同步 / 导入喜欢列表 都在「设置」里 */
4165
+ h('button', {
4166
+ type: 'button', className: 'dshm-chipbtn', title: t('settingsHint'),
4167
+ onClick: () => openSettings('liked'),
4168
+ }, h(IconGear, { size: 14 }), t('settingsTitle'))),
2909
4169
  h('div', { className: 'dshm-empty-dirs' },
2910
4170
  h('div', { className: 'dshm-empty-dirs-head' }, t('emptyAddDirHint')),
2911
4171
  ['~/Music/dsh-music', '~/Music/spotify-liked', '~/Music/Music/Media.localized']
@@ -2955,10 +4215,30 @@ window.__ModuleLoader__.load({
2955
4215
  onClick: () => setLibTab('library'),
2956
4216
  }, '← ' + t('favsBack')),
2957
4217
  h('span', { className: 'dshm-favs-title', style: { marginLeft: '4px' } }, t('libTabLikes')),
2958
- h('span', { className: 'dshm-count' }, likeItems.length + ' ' + t('tracksUnit')))
4218
+ h('span', { className: 'dshm-count' }, likeItems.length + ' ' + t('tracksUnit')),
4219
+ likedMissing > 0
4220
+ ? h('span', { className: 'dshm-missing-chip', title: t('addMissingHint'), role: 'status' }, fmt(t('likesMissingCount'), { n: likedMissing }))
4221
+ : null,
4222
+ /* 后台找音源进行中:进度 chip(done 已处理 / found 已找到;列表会自动刷新,找到的行会亮起「可入库」) */
4223
+ scanRunning
4224
+ ? h('span', { className: 'dshm-missing-chip dshm-scan-chip', title: t('scanHint'), role: 'status' },
4225
+ h(IconRefresh, { size: 11, className: 'dshm-spin' }),
4226
+ fmt(t('scanProgress'), { done: likesScan.done || 0, total: (likesScan.done || 0) + (likesScan.pending || 0), found: likesScan.found || 0 }))
4227
+ : null,
4228
+ likedMissing > 0 && download
4229
+ ? h('button', {
4230
+ type: 'button', className: 'dshm-chipbtn', disabled: adding, title: t('addMissingHint'),
4231
+ onClick: () => addMissingBatch(),
4232
+ }, adding ? h(IconRefresh, { size: 12, className: 'dshm-spin' }) : h(IconDownload, { size: 12 }),
4233
+ fmt(t('addMissingBatch'), { n: Math.min(20, likedMissing) }))
4234
+ : null,
4235
+ likedSync ? h('button', {
4236
+ type: 'button', className: 'dshm-chipbtn', style: { marginLeft: 'auto' },
4237
+ title: t('importBtnHint'), onClick: () => openSettings('liked'),
4238
+ }, h(IconGear, { size: 13 }), t('setLikedTitle')) : null)
2959
4239
  : h('div', { className: 'dshm-favs' },
2960
4240
  h('div', { className: 'dshm-favs-head' },
2961
- h(IconHeart, { size: 14, style: { color: 'var(--dsw-alias-state-error-primary)' } }),
4241
+ h(IconHeart, { size: 14, style: { color: 'var(--dshm-love)' } }),
2962
4242
  h('span', { className: 'dshm-favs-title' }, t('favsTitle')),
2963
4243
  likeItems.length ? h('span', { className: 'dshm-count' }, likeItems.length + ' ' + t('tracksUnit')) : null,
2964
4244
  likeItems.length
@@ -2977,17 +4257,20 @@ window.__ModuleLoader__.load({
2977
4257
  onClick: () => playLiked(tr),
2978
4258
  },
2979
4259
  h('span', { className: 'dshm-favcard-cover' },
2980
- h(Thumb, { src: tr.coverUrl, size: 96 }),
4260
+ h(Thumb, { src: tr.coverUrl, size: 104 }),
2981
4261
  h('span', { className: 'dshm-favcard-heart' }, h(IconHeart, { size: 11, style: { fill: 'currentColor' } }))),
2982
4262
  h('span', { className: 'dshm-favcard-title dshm-ellipsis' }, tr.title || t('untitled')),
2983
4263
  h('span', { className: 'dshm-favcard-sub dshm-ellipsis' }, tr.artist || t('unknownArtist')))),
2984
- h('button', {
2985
- type: 'button', className: 'dshm-favcard dshm-favcard-more',
2986
- onClick: () => setLibTab('likes'),
2987
- },
2988
- h(IconQueue, { size: 18 }),
2989
- h('span', { className: 'dshm-favcard-more-label' }, t('favsViewAll')),
2990
- h('span', { className: 'dshm-count' }, likeItems.length)))),
4264
+ /* 末尾「查看全部」卡只在真的有折叠(>12)时出现;否则顶部「查看全部 ›」已足够 */
4265
+ likeItems.length > 12
4266
+ ? h('button', {
4267
+ type: 'button', className: 'dshm-favcard dshm-favcard-more',
4268
+ onClick: () => setLibTab('likes'),
4269
+ },
4270
+ h(IconQueue, { size: 18 }),
4271
+ h('span', { className: 'dshm-favcard-more-label' }, t('favsViewAll')),
4272
+ h('span', { className: 'dshm-count' }, likeItems.length))
4273
+ : null)),
2991
4274
  h('div', { className: 'dshm-toolbar' },
2992
4275
  h('label', { className: 'dshm-search' },
2993
4276
  h(IconSearch, { size: 15 }),
@@ -2995,15 +4278,18 @@ window.__ModuleLoader__.load({
2995
4278
  type: 'search', value: query, placeholder: t('searchPlaceholder'), ref: searchRef,
2996
4279
  'aria-label': t('searchPlaceholder'),
2997
4280
  onChange: (e) => setQuery(e.target.value),
4281
+ onKeyDown: (e) => { if (e.key === 'Escape' && query) { e.preventDefault(); setQuery(''); } },
2998
4282
  })),
2999
- h('select', {
3000
- className: 'dshm-select', value: groupBy, 'aria-label': t('groupLabel'),
3001
- onChange: (e) => setGroupBy(e.target.value),
3002
- },
3003
- libTab === 'library' ? h(React.Fragment, null,
4283
+ /* 「我喜欢」页没有分组概念:整个下拉都不渲染,而不是渲染一个空壳 */
4284
+ libTab === 'library'
4285
+ ? h('select', {
4286
+ className: 'dshm-select', value: groupBy, 'aria-label': t('groupLabel'),
4287
+ onChange: (e) => setGroupBy(e.target.value),
4288
+ },
3004
4289
  h('option', { value: 'none' }, t('groupNone')),
3005
4290
  h('option', { value: 'artist' }, t('groupArtist')),
3006
- h('option', { value: 'album' }, t('groupAlbum'))) : null),
4291
+ h('option', { value: 'album' }, t('groupAlbum')))
4292
+ : null,
3007
4293
  h('button', {
3008
4294
  type: 'button', className: 'dshm-chipbtn dshm-chipbtn-primary',
3009
4295
  disabled: busy || (libTab === 'likes' ? likedPlayable.length === 0 : shownList.length === 0),
@@ -3014,26 +4300,31 @@ window.__ModuleLoader__.load({
3014
4300
  'aria-label': mode.label, title: mode.hint + ' · ' + t('modeCycleHint'),
3015
4301
  onClick: () => player.cycleMode(),
3016
4302
  }, h(mode.icon, { size: 14 })),
3017
- sync ? h('button', {
3018
- type: 'button', className: cx('dshm-chipbtn', !syncUsable && 'dshm-chipbtn-off'),
3019
- disabled: syncState === 'running' || busy || !syncUsable,
3020
- title: syncUsable ? (syncHint || t('syncOptionalHint')) : (syncHint || t('syncUnavailableHint')),
3021
- onClick: () => sync.start(),
3022
- }, h(IconRefresh, { size: 13, className: syncState === 'running' ? 'dshm-spin' : undefined }),
3023
- syncState === 'running' ? t('syncing') : t('syncBtn')) : null,
3024
- h('span', { className: 'dshm-count', style: { marginLeft: 'auto' } },
3025
- busy && tracks.length === 0 ? t('rescanning')
3026
- : (libTab === 'likes' ? likedFiltered.length : shownList.length) + ' ' + t('tracksUnit'))),
4303
+ /* Spotify 同步 / 喜欢列表导入 都收在「设置」里;同步进行中给一个回到设置页的状态钮 */
4304
+ sync && syncState === 'running'
4305
+ ? h('button', {
4306
+ type: 'button', className: 'dshm-chipbtn', title: t('settingsHint'),
4307
+ onClick: () => openSettings('liked'),
4308
+ }, h(IconRefresh, { size: 13, className: 'dshm-spin' }), t('syncing'))
4309
+ : null,
4310
+ (query || (busy && tracks.length === 0) || libTab === 'likes')
4311
+ ? h('span', { className: 'dshm-count', style: { marginLeft: 'auto' } },
4312
+ busy && tracks.length === 0 ? t('rescanning')
4313
+ : query
4314
+ ? fmt(t('searchMatchedCount'), { shown: (libTab === 'likes' ? likedFiltered.length : shownList.length), total: (libTab === 'likes' ? likeItems.length : tracks.length) })
4315
+ : likedFiltered.length + ' ' + t('tracksUnit'))
4316
+ : null),
3027
4317
  playNotice
3028
4318
  ? h('div', { className: 'dshm-mode-hint', style: { margin: '0 20px 6px', textAlign: 'right' }, role: 'status' }, playNotice)
3029
4319
  : null,
3030
- content);
4320
+ content,
4321
+ confirmDialog);
3031
4322
  }
3032
4323
 
3033
4324
  /* ================================================================
3034
4325
  * 10. Now-playing view — hero + transport + queue
3035
4326
  * ================================================================ */
3036
- function NowPlayingView({ t, player, lyrics, usePlayer, useLyrics, openView, openArtistPage, artistImages, useArtistImages }) {
4327
+ function NowPlayingView({ t, player, lyrics, usePlayer, useLyrics, openView, openArtistPage, artistImages, useArtistImages, likes, useLikes }) {
3037
4328
  const track = usePlayer((s) => s.track);
3038
4329
  const playing = usePlayer((s) => s.playing);
3039
4330
  const position = usePlayer((s) => s.position);
@@ -3046,6 +4337,11 @@ window.__ModuleLoader__.load({
3046
4337
  const error = usePlayer((s) => s.error);
3047
4338
  const queue = usePlayer((s) => s.queue);
3048
4339
  const queueIndex = usePlayer((s) => s.queueIndex);
4340
+ const trackId = track ? track.id : null;
4341
+ const lyrSnap = useLyrics((s) => (trackId && s.trackId === trackId ? s : null));
4342
+ const [rightTab, setRightTab] = useState(null);
4343
+ useEffect(() => { setRightTab(null); }, [trackId]);
4344
+ useEffect(() => { if (trackId) lyrics.load(trackId); }, [trackId, lyrics]);
3049
4345
 
3050
4346
  if (!track) {
3051
4347
  return h(EmptyState, {
@@ -3057,90 +4353,93 @@ window.__ModuleLoader__.load({
3057
4353
  const frac = duration > 0 ? position / duration : 0;
3058
4354
  const RepeatIcon = repeat === 'one' ? IconRepeatOne : IconRepeat;
3059
4355
  const repeatLabel = repeat === 'one' ? t('repeatOne') : repeat === 'all' ? t('repeatAll') : t('repeatOff');
4356
+ const lyricsEmpty = !!(lyrSnap && lyrSnap.status === 'ready' && lyrSnap.data && (lyrSnap.data.source === 'none' || (!lyrSnap.data.synced && !lyrSnap.data.plain)));
4357
+ const activeRightTab = rightTab || (lyricsEmpty ? 'queue' : 'lyrics');
3060
4358
 
4359
+ const sourceName = sourceLabel(track.source, t);
3061
4360
  return h('div', { className: 'dshm-now' },
3062
- h('div', { className: 'dshm-now-hero' },
3063
- h(Cover, { track, className: 'dshm-now-cover' }),
3064
- h('div', { className: 'dshm-now-meta' },
3065
- h('span', { className: 'dshm-source-chip' }, h(IconDisc, { size: 12 }), sourceLabel(track.source, t)),
3066
- h('h2', { className: 'dshm-now-title dshm-ellipsis' }, track.title),
3067
- h('p', { className: 'dshm-now-sub dshm-ellipsis' },
4361
+ track.coverUrl ? h('div', {
4362
+ className: 'dshm-now-glow', 'aria-hidden': true,
4363
+ style: { backgroundImage: 'url("' + imgUrl(track.coverUrl) + '")' },
4364
+ }) : null,
4365
+ h('div', { className: 'dshm-now-stage' },
4366
+ /* 左栏:封面 + 标题 + 控台。粘滞垂直居中,宽屏下像一台独立的唱机。 */
4367
+ h('div', { className: 'dshm-now-side' },
4368
+ h('div', { className: 'dshm-now-hero' },
4369
+ h(Cover, { track, className: 'dshm-now-cover' }),
4370
+ h('div', { className: 'dshm-now-meta' },
4371
+ sourceName
4372
+ ? h('span', { className: 'dshm-source-chip' }, h(IconDisc, { size: 12 }), sourceName)
4373
+ : null,
4374
+ h('h2', { className: 'dshm-now-title' }, track.title || t('untitled')),
4375
+ h('p', { className: 'dshm-now-sub dshm-ellipsis' },
4376
+ h('button', {
4377
+ type: 'button', className: 'dshm-artist-btn',
4378
+ title: t('artistOpen'), 'aria-label': t('artistOpen'),
4379
+ onClick: () => openArtistPage(track.artist || ''),
4380
+ },
4381
+ h(ArtistAvatar, { name: track.artist || '', size: 18, service: artistImages, useArtistImages }),
4382
+ h('span', null, track.artist || t('unknownArtist'))),
4383
+ track.album ? ' · ' + track.album : ''),
4384
+ error ? h('div', { className: 'dshm-errorline', role: 'alert' }, h(IconAlert, { size: 15 }), error) : null,
4385
+ h('div', { className: 'dshm-seekrow' },
4386
+ h('span', { className: 'dshm-time' }, formatTime(position)),
4387
+ h(Slider, {
4388
+ value: frac, label: t('seekLabel'), disabled: !(duration > 0),
4389
+ onChange: (f) => player.seek(f * duration),
4390
+ }),
4391
+ h('span', { className: 'dshm-time dshm-time-end' }, formatTime(duration))),
4392
+ /* ♥ / 👎 收进控制条右端:与播放键同属「对这首歌的态度」,不再单独悬一枚白药丸 */
4393
+ h('div', { className: 'dshm-transport' },
4394
+ h(IconButton, {
4395
+ label: mode.label, title: mode.hint + ' · ' + t('modeCycleHint'),
4396
+ className: cx((shuffle || repeat === 'one') && 'dshm-iconbtn-active'),
4397
+ onClick: () => player.cycleMode(),
4398
+ }, h(mode.icon, { size: 17 })),
4399
+ h(IconButton, { label: t('prev'), onClick: () => player.prev() }, h(IconPrev, { size: 20 })),
4400
+ h('button', {
4401
+ type: 'button', className: 'dshm-playbtn',
4402
+ 'aria-label': playing ? t('pause') : t('play'),
4403
+ onClick: () => player.toggle(),
4404
+ }, h(playing ? IconPause : IconPlay, { size: 22 })),
4405
+ h(IconButton, { label: t('next'), onClick: () => player.next() }, h(IconNext, { size: 20 })),
4406
+ likes ? h('div', { className: 'dshm-now-actions', role: 'group', 'aria-label': t('nowLikesLabel') },
4407
+ h(LikeButton, { t, item: track, likes, useLikes, size: 17, className: 'dshm-now-like' }),
4408
+ h(DislikeButton, { t, item: track, likes, useLikes, size: 17, className: 'dshm-now-like' })) : null),
4409
+ h('div', { className: 'dshm-volumerow' },
4410
+ h(IconButton, { label: muted ? t('unmute') : t('mute'), onClick: () => player.toggleMute() },
4411
+ h(muted || volume === 0 ? IconMute : IconVolume, { size: 17 })),
4412
+ h(Slider, { value: muted ? 0 : volume, label: t('volume'), onChange: (f) => player.setVolume(f) }),
4413
+ h('span', { className: 'dshm-volume-pct' }, Math.round((muted ? 0 : volume) * 100) + '%'))))),
4414
+ /* 右栏:轻量切换「歌词 / 接下来播放」,让歌词独占全高呼吸;无歌词时自动切到队列 */
4415
+ h('div', { className: 'dshm-now-main' },
4416
+ h('div', { className: 'dshm-now-tabs', role: 'tablist', 'aria-label': t('tabNow') },
3068
4417
  h('button', {
3069
- type: 'button', className: 'dshm-artist-btn',
3070
- title: t('artistOpen'), 'aria-label': t('artistOpen'),
3071
- onClick: () => openArtistPage(track.artist || ''),
3072
- },
3073
- h(ArtistAvatar, { name: track.artist || '', size: 18, service: artistImages, useArtistImages }),
3074
- h('span', null, track.artist || t('unknownArtist'))),
3075
- track.album ? ' · ' + track.album : ''),
3076
- error ? h('div', { className: 'dshm-errorline', role: 'alert' }, h(IconAlert, { size: 15 }), error) : null,
3077
- h('div', { className: 'dshm-seekrow' },
3078
- h('span', { className: 'dshm-time' }, formatTime(position)),
3079
- h(Slider, {
3080
- value: frac, label: t('seekLabel'), disabled: !(duration > 0),
3081
- onChange: (f) => player.seek(f * duration),
3082
- }),
3083
- h('span', { className: 'dshm-time dshm-time-end' }, formatTime(duration))),
3084
- h('div', { className: 'dshm-transport' },
3085
- h(IconButton, {
3086
- label: mode.label, title: mode.hint + ' · ' + t('modeCycleHint'),
3087
- className: cx((shuffle || repeat === 'one') && 'dshm-iconbtn-active'),
3088
- onClick: () => player.cycleMode(),
3089
- }, h(mode.icon, { size: 17 })),
3090
- h(IconButton, { label: t('prev'), onClick: () => player.prev() }, h(IconPrev, { size: 20 })),
4418
+ type: 'button', role: 'tab', className: 'dshm-now-tab',
4419
+ 'aria-selected': activeRightTab === 'lyrics',
4420
+ onClick: () => setRightTab('lyrics'),
4421
+ }, h(IconNote, { size: 13 }), t('lyricsTitle')),
3091
4422
  h('button', {
3092
- type: 'button', className: 'dshm-playbtn',
3093
- 'aria-label': playing ? t('pause') : t('play'),
3094
- onClick: () => player.toggle(),
3095
- }, h(playing ? IconPause : IconPlay, { size: 22 })),
3096
- h(IconButton, { label: t('next'), onClick: () => player.next() }, h(IconNext, { size: 20 }))),
3097
- h('div', { className: 'dshm-volumerow' },
3098
- h(IconButton, { label: muted ? t('unmute') : t('mute'), onClick: () => player.toggleMute() },
3099
- h(muted || volume === 0 ? IconMute : IconVolume, { size: 17 })),
3100
- h(Slider, { value: muted ? 0 : volume, label: t('volume'), onChange: (f) => player.setVolume(f) }),
3101
- h('span', { className: 'dshm-volume-pct' }, Math.round((muted ? 0 : volume) * 100) + '%')))),
3102
- h(LyricsPanel, { t, lyrics, useLyrics, usePlayer }),
3103
- h('div', { className: 'dshm-queue' },
3104
- h('div', { className: 'dshm-queue-head' },
3105
- h(IconQueue, { size: 15 }), t('queue'),
3106
- h('span', { className: 'dshm-count' }, queue.length + ' ' + t('tracksUnit'))),
3107
- queue.length === 0
3108
- ? h('div', { className: 'dshm-state-body', style: { padding: '12px 8px' } }, t('queueEmpty'))
3109
- : queue.map((tr, i) => h(TrackRow, {
3110
- key: (tr.id || '') + ':' + i, track: tr, index: i,
3111
- isCurrent: i === queueIndex, playing: playing && i === queueIndex,
3112
- onPlay: (_tr, idx) => player.jumpTo(idx), onOpenArtist: openArtistPage, t,
3113
- }))));
4423
+ type: 'button', role: 'tab', className: 'dshm-now-tab',
4424
+ 'aria-selected': activeRightTab === 'queue',
4425
+ onClick: () => setRightTab('queue'),
4426
+ }, h(IconQueue, { size: 13 }), t('tabNowQueue'), h('span', { className: 'dshm-count' }, String(queue.length)))),
4427
+ activeRightTab === 'lyrics'
4428
+ ? h(LyricsPanel, { t, lyrics, player, useLyrics, usePlayer })
4429
+ : h('div', { className: 'dshm-queue' },
4430
+ queue.length === 0
4431
+ ? h('div', { className: 'dshm-state-body', style: { padding: '12px 8px' } }, t('queueEmpty'))
4432
+ : h('div', { className: 'dshm-queue-list' },
4433
+ queue.map((tr, i) => h(TrackRow, {
4434
+ key: (tr.id || '') + ':' + i, track: tr, index: i,
4435
+ isCurrent: i === queueIndex, playing: playing && i === queueIndex,
4436
+ onPlay: (_tr, idx) => player.jumpTo(idx), onOpenArtist: openArtistPage, t,
4437
+ })))))));
3114
4438
  }
3115
4439
 
3116
4440
  /* ================================================================
3117
4441
  * 11. Recommendations view (S3 live): batch cards + download queue
3118
4442
  * ================================================================ */
3119
- function DownloadPanel({ t, download, useDownload }) {
3120
- const s = useDownload((st) => st);
3121
- if (!s.running && s.items.length === 0 && !s.error) return null;
3122
- const anyOk = s.items.some((it) => it.status === 'ok');
3123
- return h('div', { className: 'dshm-dl' },
3124
- h('div', { className: 'dshm-asec-title' },
3125
- h(IconDownload, { size: 13 }), t('downloadTitle'),
3126
- s.running ? h('span', { className: 'dshm-count' }, s.done + ' / ' + s.total) : null),
3127
- s.total > 0 ? h('div', { className: 'dshm-dl-bar', 'aria-hidden': true },
3128
- h('div', { style: { width: Math.round((s.done / s.total) * 100) + '%' } })) : null,
3129
- s.error
3130
- ? h('div', { className: 'dshm-errorline', role: 'alert' }, h(IconAlert, { size: 14 }), t('downloadError') + ':' + s.error)
3131
- : null,
3132
- s.items.map((it, i) => h('div', { className: 'dshm-dl-row', key: i },
3133
- h('span', { className: cx('dshm-dl-dot', it.status === 'ok' && 'dshm-dl-ok', it.status === 'fail' && 'dshm-dl-fail') }),
3134
- h('span', { className: 'dshm-ellipsis', style: { flex: 1 } },
3135
- (it.artist || '') + ' - ' + (it.title || '')),
3136
- h('span', { className: 'dshm-dl-status' },
3137
- it.status === 'ok' ? t('downloadDone')
3138
- : it.status === 'fail' ? t('downloadFail')
3139
- : t('downloading')),
3140
- it.status === 'fail' && it.note ? h('span', { className: 'dshm-sim-chip-reason' }, it.note) : null)),
3141
- !s.running && anyOk ? h('div', { className: 'dshm-lyrics-hint' }, t('downloadPlay')) : null);
3142
- }
3143
-
3144
4443
  /* V3 helpers: shared play-or-preview flow (preview never enters the
3145
4444
  * library; only ♥-like downloads it — the Host handles that on like). */
3146
4445
  function playSong(item, player, tracks, preview, setNotice, t, warm) {
@@ -3213,13 +4512,26 @@ window.__ModuleLoader__.load({
3213
4512
  const liked = useLikes((st) => !!st.keys[likeKey(item)]);
3214
4513
  /* 十期②:该行的缓存转圈态由 warm store 驱动(整栏播放时整栏一起转)。 */
3215
4514
  const pending = warm && useWarm ? !!useWarm((st) => !!(st.pending && st.pending[likeKey(item)])) : false;
4515
+ const playLabel = pending ? t('previewLoading') : (isCurrent && playing ? t('pause') : t('previewLabel'));
4516
+ /* 播放键隐入封面:整行不再以实心黑圆结尾,封面 hover / 当前播放时才浮出播放标。 */
3216
4517
  return h('div', { className: cx('dshm-srow', isCurrent && 'dshm-row-current') },
3217
- h(Thumb, { src: item.coverUrl, size: 38 }),
4518
+ h('button', {
4519
+ type: 'button', className: cx('dshm-playcover', pending && 'dshm-playround-busy'),
4520
+ 'data-on': isCurrent && playing ? 'true' : undefined,
4521
+ 'aria-label': pending ? t('previewLoading') : (isCurrent && playing ? t('pause') : t('play')),
4522
+ 'aria-busy': pending ? 'true' : undefined,
4523
+ disabled: !!pending,
4524
+ title: playLabel,
4525
+ onClick: () => onPlay(item),
4526
+ },
4527
+ h(Thumb, { src: item.coverUrl, size: 40 }),
4528
+ pending
4529
+ ? h('span', { className: 'dshm-spin', 'aria-hidden': true })
4530
+ : h('span', { className: 'dshm-playcover-ico', 'aria-hidden': true }, h(isCurrent && playing ? IconPause : IconPlay, { size: 16 }))),
3218
4531
  h('div', {
3219
- className: 'dshm-srow-main', role: 'button', tabIndex: 0,
3220
- 'aria-label': t('playTrack') + ': ' + (item.title || ''),
4532
+ className: 'dshm-srow-main', role: 'group',
4533
+ 'aria-label': (item.title || t('untitled')) + (item.artist ? ' · ' + item.artist : ''),
3221
4534
  onClick: () => onPlay(item),
3222
- onKeyDown: (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onPlay(item); } },
3223
4535
  },
3224
4536
  h('span', { className: 'dshm-srow-title dshm-ellipsis' }, item.title || t('untitled')),
3225
4537
  h('span', { className: 'dshm-srow-sub dshm-ellipsis' },
@@ -3232,25 +4544,16 @@ window.__ModuleLoader__.load({
3232
4544
  : (item.artist || t('unknownArtist')),
3233
4545
  item.album ? ' · ' + item.album : ''),
3234
4546
  showReason && item.reason ? h('span', { className: 'dshm-srow-reason' }, item.reason) : null),
3235
- h('button', {
3236
- type: 'button',
3237
- className: cx('dshm-like-btn', liked && 'dshm-like-btn-on'),
3238
- 'aria-label': liked ? t('unlikeBtn') : t('likeBtn'),
3239
- 'aria-pressed': !!liked,
3240
- title: liked ? t('likedBtn') : t('likeBtn'),
3241
- onClick: () => likes.toggle(item, !liked),
3242
- }, h(IconHeart, { size: 15, style: liked ? { fill: 'currentColor' } : undefined })),
3243
- likes ? h(DislikeButton, { t, item, likes, useLikes }) : null,
3244
- h('button', {
3245
- type: 'button', className: cx('dshm-playround', pending && 'dshm-playround-busy'),
3246
- 'aria-label': pending ? t('previewLoading') : (isCurrent && playing ? t('pause') : t('play')),
3247
- 'aria-busy': pending ? 'true' : undefined,
3248
- disabled: !!pending,
3249
- title: pending ? t('previewLoading') : (isCurrent && playing ? t('pause') : t('previewLabel')),
3250
- onClick: () => onPlay(item),
3251
- }, pending
3252
- ? h('span', { className: 'dshm-spin', 'aria-hidden': true })
3253
- : h(isCurrent && playing ? IconPause : IconPlay, { size: 13 })));
4547
+ h('span', { className: 'dshm-srow-tail' },
4548
+ h('button', {
4549
+ type: 'button',
4550
+ className: cx('dshm-like-btn', liked && 'dshm-like-btn-on'),
4551
+ 'aria-label': liked ? t('unlikeBtn') : t('likeBtn'),
4552
+ 'aria-pressed': !!liked,
4553
+ title: liked ? t('likedBtn') : t('likeBtn'),
4554
+ onClick: () => likes.toggle(item, !liked),
4555
+ }, h(IconHeart, { size: 15, style: liked ? { fill: 'currentColor' } : undefined })),
4556
+ likes ? h(DislikeButton, { t, item, likes, useLikes }) : null));
3254
4557
  }
3255
4558
 
3256
4559
  /* Artist column row: real artist/band image + name + genre hint + chevron. */
@@ -3446,7 +4749,6 @@ window.__ModuleLoader__.load({
3446
4749
  }
3447
4750
  return h('div', { className: 'dshm-reco-page', style: { padding: '12px 16px 0', display: 'flex', flexDirection: 'column' } },
3448
4751
  toolbar,
3449
- h(DownloadPanel, { t, download, useDownload }),
3450
4752
  s.bootstrapNote
3451
4753
  ? h('div', { className: 'dshm-explore-note', role: 'note' },
3452
4754
  h(IconSparkles, { size: 13 }),
@@ -3462,9 +4764,9 @@ window.__ModuleLoader__.load({
3462
4764
  column('colToday', IconSparkles, sections.today || [],
3463
4765
  h('button', {
3464
4766
  type: 'button', className: 'dshm-chipbtn dshm-col-play',
3465
- disabled: !(sections.today || []).length,
4767
+ disabled: !(sections.today || []).length, title: t('playColumn'), 'aria-label': t('playColumn'),
3466
4768
  onClick: () => playColumn(sections.today || []),
3467
- }, h(IconPlay, { size: 12 }), t('playColumn')), 'today'),
4769
+ }, h(IconPlay, { size: 13 })), 'today'),
3468
4770
  h('section', { className: 'dshm-column', key: 'colArtist' },
3469
4771
  h('div', { className: 'dshm-col-head' },
3470
4772
  h('div', { className: 'dshm-col-title' }, h(IconNote, { size: 14 }), t('colArtist')),
@@ -3478,9 +4780,9 @@ window.__ModuleLoader__.load({
3478
4780
  column('colNew', IconDisc, sections.new || [],
3479
4781
  h('button', {
3480
4782
  type: 'button', className: 'dshm-chipbtn dshm-col-play',
3481
- disabled: !(sections.new || []).length,
4783
+ disabled: !(sections.new || []).length, title: t('playColumn'), 'aria-label': t('playColumn'),
3482
4784
  onClick: () => playColumn(sections.new || []),
3483
- }, h(IconPlay, { size: 12 }), t('playColumn')), 'new')));
4785
+ }, h(IconPlay, { size: 13 })), 'new')));
3484
4786
  }
3485
4787
 
3486
4788
  /* Shared artist profile block (intro / news / trivia / similar), reused by
@@ -3537,7 +4839,7 @@ window.__ModuleLoader__.load({
3537
4839
  /* ================================================================
3538
4840
  * 11a2. Artist page (V3): profile + songs, play/preview + like
3539
4841
  * ================================================================ */
3540
- function ArtistPageView({ t, reco, player, likes, preview, library, openView, openArtistPage, artistImages, artistPage, useUi, useLikes, useLibrary, usePlayer, useArtistImages, useArtistPage }) {
4842
+ function ArtistPageView({ t, reco, player, likes, preview, library, openView, openArtistPage, goBack, backLabel, artistImages, artistPage, useUi, useLikes, useLibrary, usePlayer, useArtistImages, useArtistPage }) {
3541
4843
  const name = useUi((s) => s.artistName);
3542
4844
  const tracks = useLibrary((st) => st.tracks);
3543
4845
  const currentId = usePlayer((st) => (st.track ? st.track.id : null));
@@ -3590,7 +4892,7 @@ window.__ModuleLoader__.load({
3590
4892
  }
3591
4893
  return h('div', { className: 'dshm-apage' },
3592
4894
  h('div', { className: 'dshm-toolbar dshm-toolbar-flat' },
3593
- h('button', { type: 'button', className: 'dshm-chipbtn', onClick: () => openView('reco') }, '← ' + t('artistPageBack')),
4895
+ h('button', { type: 'button', className: 'dshm-chipbtn dshm-apage-back', onClick: () => (goBack ? goBack() : openView('reco')) }, h(IconChevronUp, { size: 14, style: { transform: 'rotate(-90deg)' } }), backLabel ? backLabel(t) : t('artistPageBack')),
3594
4896
  notice ? h('span', { className: 'dshm-mode-hint', style: { marginLeft: '8px' } }, notice) : null,
3595
4897
  library && ready ? h('button', {
3596
4898
  type: 'button', className: 'dshm-chipbtn', disabled: !songs.length,
@@ -3638,7 +4940,8 @@ window.__ModuleLoader__.load({
3638
4940
  /* ================================================================
3639
4941
  * 11b. Spotify sync panel (S3): trigger + result chips
3640
4942
  * ================================================================ */
3641
- function SyncPanel({ t, sync, useSync }) {
4943
+ /* bare:设置页卡片里已有平台标题,不再重复一行“同步 Spotify” */
4944
+ function SyncPanel({ t, sync, useSync, bare }) {
3642
4945
  const s = useSync((st) => st);
3643
4946
  if (s.phase === 'idle' && !s.result && !s.error) return null;
3644
4947
  const r = s.result || {};
@@ -3647,9 +4950,11 @@ window.__ModuleLoader__.load({
3647
4950
  ['syncOk', r.ok], ['syncFail', r.fail], ['syncMissing', r.missing],
3648
4951
  ];
3649
4952
  const problems = (s.tracks || []).filter((tr) => tr && (tr.status === 'fail' || tr.status === 'missing'));
3650
- return h('div', { className: 'dshm-sync', role: 'status' },
3651
- h('div', { className: 'dshm-asec-title' }, h(IconRefresh, { size: 13, className: s.phase === 'running' ? 'dshm-spin' : undefined }),
3652
- s.phase === 'running' ? t('syncing') : s.phase === 'error' ? t('syncError') : t('syncBtn')),
4953
+ return h('div', { className: cx('dshm-sync', bare && 'dshm-sync-bare'), role: 'status' },
4954
+ bare
4955
+ ? (s.phase === 'running' ? h('div', { className: 'dshm-imp-hint' }, t('syncing')) : null)
4956
+ : h('div', { className: 'dshm-asec-title' }, h(IconRefresh, { size: 13, className: s.phase === 'running' ? 'dshm-spin' : undefined }),
4957
+ s.phase === 'running' ? t('syncing') : s.phase === 'error' ? t('syncError') : t('syncBtn')),
3653
4958
  s.error ? h('div', { className: 'dshm-errorline', role: 'alert' }, h(IconAlert, { size: 14 }), s.error) : null,
3654
4959
  s.phase !== 'running' && s.result
3655
4960
  ? h('div', { className: 'dshm-sync-chips' },
@@ -3664,19 +4969,341 @@ window.__ModuleLoader__.load({
3664
4969
  : null);
3665
4970
  }
3666
4971
 
4972
+ /* ================================================================
4973
+ * 11b-2. 喜欢列表同步卡片(设置页):网易云扫码 / QQ 音乐 Cookie → 只读导入「我喜欢」
4974
+ * 二维码由本地 qrEncode 生成,以 SVG 渲染(静区 4 模块,crispEdges)。
4975
+ * ================================================================ */
4976
+ /* 上次同步时间:本地区域短格式,跨年才带年份(zh → 2025/12/31 23:59) */
4977
+ function formatSyncTime(ts) {
4978
+ const d = new Date(ts);
4979
+ if (!(d instanceof Date) || Number.isNaN(d.getTime())) return '';
4980
+ const sameYear = d.getFullYear() === new Date().getFullYear();
4981
+ return d.toLocaleString(undefined, Object.assign(
4982
+ sameYear ? {} : { year: 'numeric' },
4983
+ { month: 'numeric', day: 'numeric', hour: '2-digit', minute: '2-digit' },
4984
+ ));
4985
+ }
4986
+
4987
+ function QrSvg({ matrix, size = 196, label }) {
4988
+ if (!matrix) return null;
4989
+ const n = matrix.size;
4990
+ const quiet = 4;
4991
+ const cells = [];
4992
+ for (let y = 0; y < n; y++) {
4993
+ for (let x = 0; x < n; x++) {
4994
+ if (matrix.modules[y * n + x]) cells.push(h('rect', { key: y + ':' + x, x: quiet + x, y: quiet + y, width: 1, height: 1 }));
4995
+ }
4996
+ }
4997
+ return h('svg', {
4998
+ className: 'dshm-qr', viewBox: '-' + quiet + ' -' + quiet + ' ' + (n + 2 * quiet) + ' ' + (n + 2 * quiet),
4999
+ width: size, height: size, shapeRendering: 'crispEdges', role: 'img', 'aria-label': label,
5000
+ },
5001
+ h('rect', { x: -quiet, y: -quiet, width: n + 2 * quiet, height: n + 2 * quiet, fill: '#fff' }),
5002
+ h('g', { fill: '#000' }, cells));
5003
+ }
5004
+ /* 二维码区(网易云 / QQ 共用):左侧图(矩阵 → SVG;主机没解出矩阵就退回 PNG)+ 右侧状态与「重新生成」 */
5005
+ function QrBox({ t, s, provider, likedSync, hint }) {
5006
+ const qr = s.qr && s.qr.provider === provider ? s.qr : null;
5007
+ const alive = !!qr && (s.qrPhase === 'waiting' || s.qrPhase === 'confirmed');
5008
+ const loading = s.qrPhase === 'loading' || (s.qrPhase === 'idle' && !s.loaded);
5009
+ const text = {
5010
+ loading: t('importQrLoading'), waiting: t('importQrWaiting'), confirmed: t('importQrConfirmed'),
5011
+ done: t('importQrDone'), expired: s.qrMessage ? `${t('importQrExpired')}(${s.qrMessage})` : t('importQrExpired'),
5012
+ error: s.qrMessage || t('importQrExpired'),
5013
+ }[s.qrPhase] || '';
5014
+ return h('div', { className: 'dshm-imp-qr' },
5015
+ h('div', { className: 'dshm-imp-qr-box' },
5016
+ loading
5017
+ ? h(IconRefresh, { size: 24, className: 'dshm-spin' })
5018
+ : alive
5019
+ ? (qr.matrix
5020
+ ? h(QrSvg, { matrix: qr.matrix, label: t('importQrWaiting') })
5021
+ : h('img', { className: 'dshm-qr dshm-qr-img', src: qr.png, alt: t('importQrWaiting') }))
5022
+ : h('div', { className: 'dshm-imp-qr-fallback' }, h(IconAlert, { size: 22 }), h('div', null, text),
5023
+ (s.qrPhase === 'expired' || s.qrPhase === 'error') && s.qrMessage
5024
+ ? h('p', { className: 'dshm-imp-hint dshm-imp-hint-more' }, t('importQrReportHint'))
5025
+ : null)),
5026
+ h('div', { className: 'dshm-imp-qr-side' },
5027
+ h('p', { className: 'dshm-imp-hint' }, hint),
5028
+ h('div', { className: 'dshm-imp-step', role: 'status' }, text),
5029
+ h('div', null, h('button', {
5030
+ type: 'button', className: 'dshm-chipbtn', disabled: s.qrPhase === 'loading', onClick: () => likedSync.startQr(provider),
5031
+ }, h(IconRefresh, { size: 13 }), t('importQrRegenerate')))));
5032
+ }
5033
+
5034
+ /* ================================================================
5035
+ * 11b-3. 「喜欢列表同步」区块(设置页):三个平台各占一行(手风琴)。
5036
+ * 行头 = 图标 / 名称 / 状态;展开后是给新用户的分步引导(①②③)。
5037
+ * 连接成功即自动导入一次;结果只留一行主结论 + 异常项。
5038
+ * ================================================================ */
5039
+ function fmt(str, vars) {
5040
+ return String(str || '').replace(/\{(\w+)\}/g, (m, k) => (vars && vars[k] != null ? String(vars[k]) : m));
5041
+ }
5042
+ function devtoolsKeys() {
5043
+ return typeof navigator !== 'undefined' && /Mac/i.test(navigator.platform || '') ? '⌘⌥I' : 'F12';
5044
+ }
5045
+
5046
+ /* 分步引导:state = done(已完成)| active(进行中)| todo(还没轮到)| miss(没满足,可补救) */
5047
+ function Steps({ children }) { return h('ol', { className: 'dshm-steps' }, children); }
5048
+ function Step({ n, state, title, children }) {
5049
+ return h('li', { className: cx('dshm-step', 'dshm-step-' + state) },
5050
+ h('span', { className: 'dshm-step-n', 'aria-hidden': true }, state === 'done' ? h(IconCheck, { size: 12 }) : n),
5051
+ h('div', { className: 'dshm-step-body' },
5052
+ h('div', { className: 'dshm-step-title' }, title),
5053
+ children ? h('div', { className: 'dshm-step-content' }, children) : null));
5054
+ }
5055
+
5056
+ /* 导入结果:一行主结论;移除 / 下架 / 跳过 👎 这类异常才单独出 chip */
5057
+ function ImportResult({ t, result, onViewLikes }) {
5058
+ if (!result || result.total == null) return null;
5059
+ const extras = [
5060
+ ['importResRemoved', result.removed, 'dshm-sync-chip-warn', 'importResRemovedHint'],
5061
+ ['importResUnavailable', result.unavailable, '', null],
5062
+ ['importResDisliked', result.skippedDisliked, '', null],
5063
+ ].filter(([, v]) => v > 0);
5064
+ const removed = Array.isArray(result.removedItems) ? result.removedItems : [];
5065
+ return h('div', { className: 'dshm-imp-result', role: 'status' },
5066
+ h('div', { className: 'dshm-imp-summary' },
5067
+ h(IconCheck, { size: 14 }),
5068
+ h('span', null, fmt(t('importDoneLine'), { total: result.total, added: result.added || 0, existed: result.existed || 0 }))),
5069
+ extras.length
5070
+ ? h('div', { className: 'dshm-sync-chips' }, extras.map(([key, v, cls, hint]) => h('span', {
5071
+ key, className: cx('dshm-sync-chip', cls), title: hint ? t(hint) : undefined,
5072
+ }, t(key) + ' ' + v)))
5073
+ : null,
5074
+ removed.length
5075
+ ? h('div', { className: 'dshm-sync-detail' },
5076
+ removed.slice(0, 6).map((it, i) => h('div', { key: i }, '· ' + (it.artist || '') + ' - ' + (it.title || ''))),
5077
+ removed.length > 6 ? h('div', null, '… +' + (removed.length - 6)) : null)
5078
+ : null,
5079
+ onViewLikes
5080
+ ? h('button', { type: 'button', className: 'dshm-linkbtn', onClick: onViewLikes }, t('importViewLikes'),
5081
+ h(IconChevronUp, { size: 12, style: { transform: 'rotate(90deg)' } }))
5082
+ : null);
5083
+ }
5084
+
5085
+ /* 平台行:整行是展开/收起按钮;stateTone = ok | busy | off */
5086
+ function ProviderRow({ provider, icon, title, stateText, stateTone, expanded, onToggle, children }) {
5087
+ return h('div', { className: cx('dshm-prv', 'dshm-prv-' + provider, expanded && 'dshm-prv-open'), 'data-provider': provider, role: 'listitem' },
5088
+ h('button', { type: 'button', className: 'dshm-prv-head', 'aria-expanded': expanded, onClick: onToggle },
5089
+ h('span', { className: 'dshm-prv-icon' }, h(icon, { size: 18 })),
5090
+ h('span', { className: 'dshm-prv-name' }, title),
5091
+ h('span', { className: cx('dshm-prv-state', stateTone && 'dshm-prv-state-' + stateTone) }, stateText),
5092
+ h(IconChevronDown, { size: 14, className: 'dshm-prv-chev' })),
5093
+ expanded ? h('div', { className: 'dshm-prv-body' }, children) : null);
5094
+ }
5095
+
5096
+ function LikedProviders({ t, sync, useSync, likedSync, useLikedSync, firstRun, onViewLikes }) {
5097
+ /* useLikedSync 由宿主 hooks 注入;直接读取服务 store 作为兜底(独立渲染/测试场景) */
5098
+ const s = (useLikedSync ? useLikedSync((st) => st) : (likedSync && likedSync.source ? likedSync.source.getSnapshot() : {})) || {};
5099
+ const ss = sync ? (useSync ? useSync((st) => st) : sync.source.getSnapshot()) : { phase: 'idle' };
5100
+ /* 展开的行(null = 全部收起);store 初值就是 'netease',新用户一进来先看到扫码 */
5101
+ const tab = s.tab || null;
5102
+ const providers = s.providers || {};
5103
+ const ne = providers.netease || null;
5104
+ const qq = providers.qq || null;
5105
+ const neOn = !!(ne && ne.connected);
5106
+ const qqOn = !!(qq && qq.connected);
5107
+ const enabled = !(s.loaded && !s.enabled);
5108
+ const spAvail = ss.available;
5109
+ const spAuth = ss.authorized;
5110
+ const spRunning = ss.phase === 'running';
5111
+ const toggle = (id) => likedSync.selectTab(tab === id ? null : id);
5112
+
5113
+ /* 错误按归属平台分行展示;主机文案里的「缺 qm_keyst」换成给新用户的说法 */
5114
+ const errLine = (provider) => {
5115
+ if (!s.error || s.errorProvider !== provider) return null;
5116
+ const text = s.error === 'importCookieEmpty' ? t('importCookieEmpty')
5117
+ : /qm_keyst|qqmusic_key/.test(s.error) ? t('importQqNeedKey') : s.error;
5118
+ return h('div', { className: 'dshm-errorline', role: 'alert' }, h(IconAlert, { size: 14 }), text);
5119
+ };
5120
+ const resOf = (provider) => (s.result && s.result.provider === provider ? s.result : null)
5121
+ || (s.syncing === provider ? null : (providers[provider] && providers[provider].lastResult) || null);
5122
+ const nameOf = (prov) => (prov && prov.account && (prov.account.nickname || prov.account.uid)) || '';
5123
+ const accountLine = (prov) => h('div', { className: 'dshm-imp-account' },
5124
+ h('span', { className: 'dshm-ava', 'aria-hidden': true }, nameOf(prov).slice(0, 1) || '·'),
5125
+ h('span', { className: 'dshm-imp-nick' }, nameOf(prov)),
5126
+ prov && prov.knownCount != null ? h('span', { className: 'dshm-imp-time' }, fmt(t('importKnownLine'), { n: prov.knownCount })) : null,
5127
+ prov && prov.lastSyncAt ? h('span', { className: 'dshm-imp-time' }, fmt(t('importLastSyncLine'), { time: formatSyncTime(prov.lastSyncAt) })) : null);
5128
+ const syncActions = (provider, prov) => h('div', { className: 'dshm-imp-actions' },
5129
+ h('button', {
5130
+ type: 'button', className: 'dshm-chipbtn dshm-chipbtn-primary',
5131
+ disabled: !!s.syncing || !!(prov && prov.busy),
5132
+ onClick: () => likedSync.sync(provider),
5133
+ }, s.syncing === provider ? h(IconRefresh, { size: 13, className: 'dshm-spin' }) : h(IconHeart, { size: 13 }),
5134
+ s.syncing === provider ? t('importSyncing') : t('importSyncNow')),
5135
+ provider === 'netease'
5136
+ ? h('button', { type: 'button', className: 'dshm-chipbtn', onClick: () => likedSync.startQr('netease') }, t('importReQr'))
5137
+ : null,
5138
+ h('button', { type: 'button', className: 'dshm-chipbtn', onClick: () => likedSync.disconnect(provider) }, t('importDisconnect')));
5139
+ const recheck = h('button', { type: 'button', className: 'dshm-chipbtn', onClick: () => sync.recheck() },
5140
+ h(IconRefresh, { size: 13 }), t('spRecheck'));
5141
+
5142
+ /* 展开的平台处于扫码模式且未登录 → 自动取码(同一时刻只有一个二维码会话) */
5143
+ const qqQr = (s.qqMode || 'qr') === 'qr';
5144
+ const qrProvider = tab === 'netease' ? 'netease' : (tab === 'qq' && qqQr ? 'qq' : null);
5145
+ const qrOn = qrProvider ? (qrProvider === 'netease' ? neOn : qqOn) : true;
5146
+ useEffect(() => {
5147
+ /* 只有面板真的展开(open)且未登录才自动取码;折叠状态下 tab 仍可能是 netease,不能因此在后台拉码轮询 */
5148
+ if (!s.open || !enabled || !qrProvider || qrOn || s.qrPhase !== 'idle') return undefined;
5149
+ likedSync.startQr(qrProvider);
5150
+ return undefined;
5151
+ }, [enabled, qrProvider, qrOn, s.qrPhase]);
5152
+
5153
+ /* ── 网易云:扫码 → 自动导入 ── */
5154
+ let neteaseBody;
5155
+ if (!enabled) {
5156
+ neteaseBody = h('p', { className: 'dshm-imp-hint' }, t('importEnabledOff'));
5157
+ } else if (neOn) {
5158
+ neteaseBody = h('div', { className: 'dshm-imp-logged' }, accountLine(ne), syncActions('netease', ne),
5159
+ h(ImportResult, { t, result: resOf('netease'), onViewLikes: firstRun ? null : onViewLikes }), errLine('netease'));
5160
+ } else {
5161
+ const neRes = resOf('netease');
5162
+ const neBusy = s.syncing === 'netease';
5163
+ neteaseBody = h(Steps, null,
5164
+ h(Step, { n: 1, state: neRes ? 'done' : 'active', title: t('importQrStep1') },
5165
+ h(QrBox, { t, s, provider: 'netease', likedSync, hint: t('importQrHint') })),
5166
+ h(Step, { n: 2, state: neRes ? 'done' : neBusy ? 'active' : 'todo', title: t('importQrStep2') },
5167
+ h('p', { className: 'dshm-imp-hint' }, t('importAutoNote')),
5168
+ errLine('netease')));
5169
+ }
5170
+
5171
+ /* ── QQ 音乐:手机 QQ 扫码(默认)→ 自动导入;微信登录的账号改走 Cookie 三步 ── */
5172
+ let qqBody;
5173
+ if (!enabled) {
5174
+ qqBody = h('p', { className: 'dshm-imp-hint' }, t('importEnabledOff'));
5175
+ } else if (qqOn) {
5176
+ qqBody = h('div', { className: 'dshm-imp-logged' }, accountLine(qq), syncActions('qq', qq),
5177
+ h(ImportResult, { t, result: resOf('qq'), onViewLikes: firstRun ? null : onViewLikes }), errLine('qq'));
5178
+ } else if (qqQr) {
5179
+ const qqRes = resOf('qq');
5180
+ const qqBusy = s.syncing === 'qq';
5181
+ qqBody = h(Steps, null,
5182
+ h(Step, { n: 1, state: qqRes ? 'done' : 'active', title: t('importQqQrStep1') },
5183
+ h(QrBox, { t, s, provider: 'qq', likedSync, hint: t('importQqQrHint') }),
5184
+ h('p', { className: 'dshm-imp-hint dshm-imp-hint-more' }, t('importQqBusyHint'))),
5185
+ h(Step, { n: 2, state: qqRes ? 'done' : qqBusy ? 'active' : 'todo', title: t('importQrStep2') },
5186
+ h('p', { className: 'dshm-imp-hint' }, t('importQqQrNote')),
5187
+ h('div', { className: 'dshm-imp-actions' }, h('button', {
5188
+ type: 'button', className: 'dshm-linkbtn', onClick: () => likedSync.setQqMode('cookie'),
5189
+ }, t('importQqUseCookie'), h(IconChevronUp, { size: 12, style: { transform: 'rotate(90deg)' } }))),
5190
+ errLine('qq')));
5191
+ } else {
5192
+ const onCookieInput = (e) => {
5193
+ const v = e.target.value;
5194
+ likedSync.setQqCookie(v);
5195
+ /* 粘贴即连接:像 Cookie 的内容(够长且含 =)直接发起,省掉一次「连接」 */
5196
+ if (v.trim().length > 20 && v.indexOf('=') > 0 && !s.connecting) likedSync.connectQq();
5197
+ };
5198
+ qqBody = h(Steps, null,
5199
+ h(Step, { n: 1, state: 'active', title: t('importQqStep1') },
5200
+ h('div', { className: 'dshm-imp-actions' }, h('button', {
5201
+ type: 'button', className: 'dshm-chipbtn', onClick: () => likedSync.openUrl('https://y.qq.com/'),
5202
+ }, t('importQqOpen'), h(IconExternal, { size: 12 }))),
5203
+ h('p', { className: 'dshm-imp-hint' }, t('importQqLoginHint'))),
5204
+ h(Step, { n: 2, state: s.copied ? 'done' : 'active', title: t('importQqStep2') },
5205
+ h('div', { className: 'dshm-imp-actions' }, h('button', {
5206
+ type: 'button', className: 'dshm-chipbtn', onClick: () => likedSync.copyCookieCommand(),
5207
+ }, s.copied ? h(IconCheck, { size: 13 }) : null, s.copied ? t('importQqCopied') : t('importQqCopy'))),
5208
+ h('p', { className: 'dshm-imp-hint' }, fmt(t('importQqStep2Hint'), { keys: devtoolsKeys() })),
5209
+ h('p', { className: 'dshm-imp-hint dshm-imp-hint-more' }, fmt(t('importQqFallback'), { keys: devtoolsKeys() }))),
5210
+ h(Step, { n: 3, state: 'active', title: t('importQqStep3') },
5211
+ h('input', {
5212
+ className: 'dshm-imp-cookie', type: 'text', spellCheck: false, autoComplete: 'off', autoCapitalize: 'off',
5213
+ placeholder: t('importQqPlaceholder'), value: s.qqCookie, 'aria-label': t('importQqStep3'),
5214
+ onChange: onCookieInput,
5215
+ }),
5216
+ h('div', { className: 'dshm-imp-actions' }, h('button', {
5217
+ type: 'button', className: 'dshm-chipbtn dshm-chipbtn-primary',
5218
+ disabled: s.connecting || !s.qqCookie.trim(),
5219
+ onClick: () => likedSync.connectQq(),
5220
+ }, s.connecting ? h(IconRefresh, { size: 13, className: 'dshm-spin' }) : h(IconImport, { size: 13 }),
5221
+ s.connecting ? t('importConnecting') : t('importQqConnect'))),
5222
+ h('p', { className: 'dshm-imp-hint' }, t('importQqPrivacy')),
5223
+ h('div', { className: 'dshm-imp-actions' }, h('button', {
5224
+ type: 'button', className: 'dshm-linkbtn', onClick: () => likedSync.setQqMode('qr'),
5225
+ }, t('importQqUseQr'), h(IconChevronUp, { size: 12, style: { transform: 'rotate(90deg)' } }))),
5226
+ errLine('qq')));
5227
+ }
5228
+
5229
+ /* ── Spotify 收藏(可选):装 CLI → 授权 → 同步 ── */
5230
+ let spBody = null;
5231
+ if (sync) {
5232
+ const st1 = spAvail === true ? 'done' : spAvail === false ? 'miss' : 'active';
5233
+ const st2 = spAvail !== true ? 'todo' : spAuth === true ? 'done' : spAuth === false ? 'miss' : 'active';
5234
+ const st3 = spRunning ? 'active' : ss.result ? 'done' : spAvail === false ? 'todo' : 'active';
5235
+ spBody = h(Steps, null,
5236
+ h(Step, { n: 1, state: st1, title: t('spStep1') },
5237
+ h('p', { className: 'dshm-imp-hint' }, spAvail === true ? t('spStep1Ok') : t('spStep1Hint')),
5238
+ spAvail === true ? null : recheck),
5239
+ h(Step, { n: 2, state: st2, title: t('spStep2') },
5240
+ h('p', { className: 'dshm-imp-hint' }, spAuth === true ? t('spStep2Ok') : t('spStep2Hint')),
5241
+ spAvail === true ? recheck : null),
5242
+ h(Step, { n: 3, state: st3, title: t('spStep3') },
5243
+ h('p', { className: 'dshm-imp-hint' }, t('spBody')),
5244
+ h('div', { className: 'dshm-imp-actions' }, h('button', {
5245
+ type: 'button', className: cx('dshm-chipbtn', 'dshm-chipbtn-primary', spAvail === false && 'dshm-chipbtn-off'),
5246
+ disabled: spRunning || spAvail === false,
5247
+ onClick: () => sync.start(),
5248
+ }, h(IconRefresh, { size: 13, className: spRunning ? 'dshm-spin' : undefined }),
5249
+ spRunning ? t('syncing') : t('syncBtn'))),
5250
+ h(SyncPanel, { t, sync, useSync, bare: true })));
5251
+ }
5252
+
5253
+ const neQrAlive = !!s.qr && s.qr.provider === 'netease' && (s.qrPhase === 'waiting' || s.qrPhase === 'confirmed');
5254
+ const qqQrAlive = !!s.qr && s.qr.provider === 'qq' && (s.qrPhase === 'waiting' || s.qrPhase === 'confirmed');
5255
+ const neState = neOn ? nameOf(ne) : (neQrAlive ? t('importQrWaiting') : t('prvNeteaseHow'));
5256
+ const qqState = qqOn ? nameOf(qq) : (qqQrAlive ? t('importQrWaiting') : t(qqQr ? 'prvQqHow' : 'prvQqHowCookie'));
5257
+ const spState = spAvail === false ? t('spStateNoCli') : spAvail === true ? (spAuth === false ? t('spStateNoAuth') : t('spStateReady')) : t('spStateChecking');
5258
+ return h('div', { className: 'dshm-prvs', role: 'list' },
5259
+ h(ProviderRow, {
5260
+ provider: 'netease', icon: IconDisc, title: t('importTabNetease'), stateText: neState,
5261
+ stateTone: neOn ? 'ok' : (neQrAlive ? 'busy' : 'off'),
5262
+ expanded: tab === 'netease', onToggle: () => toggle('netease'),
5263
+ }, neteaseBody),
5264
+ h(ProviderRow, {
5265
+ provider: 'qq', icon: IconNote, title: t('importTabQq'), stateText: qqState, stateTone: qqOn ? 'ok' : (qqQrAlive ? 'busy' : 'off'),
5266
+ expanded: tab === 'qq', onToggle: () => toggle('qq'),
5267
+ }, qqBody),
5268
+ sync ? h(ProviderRow, {
5269
+ provider: 'spotify', icon: IconSpotify, title: 'Spotify', stateText: spState,
5270
+ stateTone: spAvail === true && spAuth !== false ? 'ok' : spAvail === false ? 'off' : 'busy',
5271
+ expanded: tab === 'spotify', onToggle: () => toggle('spotify'),
5272
+ }, spBody) : null);
5273
+ }
5274
+
3667
5275
  /* ================================================================
3668
5276
  * 11c. History view (S3): plays, completion, skips
3669
5277
  * ================================================================ */
3670
- function fmtDuration(sec) {
5278
+ function fmtDuration(sec, t) {
3671
5279
  const v = Math.max(0, Math.round(sec || 0));
3672
5280
  const hh = Math.floor(v / 3600), mm = Math.floor((v % 3600) / 60);
3673
- return hh > 0 ? hh + ' 小时 ' + mm + ' 分' : mm + ' 分 ' + (v % 60) + ' 秒';
5281
+ if (t) return hh > 0 ? fmt(t('durationHours'), { h: hh, m: mm }) : fmt(t('durationMins'), { m: mm });
5282
+ return hh > 0 ? hh + 'h ' + mm + 'm' : mm + 'm';
3674
5283
  }
3675
5284
 
5285
+ /* 本地日期键 + 人话标签:今天 / 昨天 / 4月17日(不再是 2026-4-17) */
3676
5286
  function dayKeyOf(ts) {
3677
- const d = new Date(ts || Date.now());
5287
+ const d = ts ? new Date(ts) : new Date();
3678
5288
  return d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate();
3679
5289
  }
5290
+ function fmtDay(ts) {
5291
+ const d = ts ? new Date(ts) : new Date();
5292
+ return d.getFullYear() + '-' + String(d.getMonth() + 1).padStart(2, '0') + '-' + String(d.getDate()).padStart(2, '0');
5293
+ }
5294
+ function dayLabel(ts, t) {
5295
+ const d = ts ? new Date(ts) : new Date();
5296
+ if (t) {
5297
+ if (dayKeyOf(d.getTime()) === dayKeyOf(Date.now())) return t('dayToday');
5298
+ const y = new Date(); y.setDate(y.getDate() - 1);
5299
+ if (dayKeyOf(d.getTime()) === dayKeyOf(y.getTime())) return t('dayYesterday');
5300
+ }
5301
+ const now = new Date();
5302
+ /* 中日文用「4月17日」;其他语言用 4/17 —— 只看当前文案是不是中文,而不是硬编码 */
5303
+ const zh = t && /[\u4e00-\u9fff]/.test(String(t('dayToday') || ''));
5304
+ const md = zh ? (d.getMonth() + 1) + '月' + d.getDate() + '日' : (d.getMonth() + 1) + '/' + d.getDate();
5305
+ return d.getFullYear() === now.getFullYear() ? md : (zh ? d.getFullYear() + '年' + md : d.getFullYear() + '/' + md);
5306
+ }
3680
5307
 
3681
5308
  function HistoryView({ t, history, player, openArtistPage, artistImages, likes, useHistory, useLibrary, useArtistImages, useLikes }) {
3682
5309
  const s = useHistory((st) => st);
@@ -3688,9 +5315,6 @@ window.__ModuleLoader__.load({
3688
5315
  const tr = ev.trackId && tracks.find((x) => x.id === ev.trackId);
3689
5316
  return tr && tr.coverUrl ? tr.coverUrl : null;
3690
5317
  };
3691
- const statCard = (label, value) => h('div', { className: 'dshm-stat', key: label },
3692
- h('div', { className: 'dshm-stat-value dshm-ellipsis' }, value),
3693
- h('div', { className: 'dshm-stat-label' }, label));
3694
5318
  const trackForTop = (it) => (it && ((it.trackId && tracks.find((x) => x.id === it.trackId)) || (it.id && tracks.find((x) => x.id === it.id)))) || null;
3695
5319
  const topTracks = [];
3696
5320
  for (const it of (stats && stats.topSongs) || []) {
@@ -3704,97 +5328,143 @@ window.__ModuleLoader__.load({
3704
5328
  player.playTracks(topTracks, idx >= 0 ? idx : 0);
3705
5329
  };
3706
5330
  const daily = (stats && stats.daily) || [];
3707
- const maxPlays = Math.max(1, ...daily.map((d) => d.plays || 0));
3708
- const statsBlock = stats
3709
- ? h('div', { className: 'dshm-stats-wrap' },
3710
- h('div', { className: 'dshm-stats' },
3711
- statCard(t('statPlays'), String(stats.totalPlays || 0)),
3712
- statCard(t('statSeconds'), fmtDuration(stats.totalSeconds)),
3713
- statCard(t('statSongs'), String(stats.uniqueSongs || 0)),
3714
- statCard(t('statArtists'), String(stats.uniqueArtists || 0)),
3715
- statCard(t('statSkipped'), String(stats.skippedCount || 0)),
3716
- statCard(t('statCompletion'), Math.round((stats.avgCompletion || 0) * 100) + '%'),
3717
- statCard(t('statDislikes'), String((stats.dislikes && stats.dislikes.count) || 0))),
3718
- h('div', { className: 'dshm-trend' },
3719
- h('div', { className: 'dshm-asec-title' }, h(IconQueue, { size: 13 }), t('trendTitle')),
3720
- h('div', { className: 'dshm-bars' }, daily.map((d, i) => h('div', { className: 'dshm-bar-col', key: i },
3721
- h('div', { className: 'dshm-bar', title: (d.date || '') + ' · ' + (d.plays || 0) + ' ' + t('playsUnit'), style: { height: Math.max(3, Math.round(((d.plays || 0) / maxPlays) * 100)) + '%' } }),
3722
- h('div', { className: 'dshm-bar-label' }, String(d.date || '').slice(5)))))),
3723
- h('div', { className: 'dshm-tops' },
3724
- h('div', { className: 'dshm-top-col' },
3725
- h('div', { className: 'dshm-asec-title' }, h(IconNote, { size: 13 }), t('topSongs'),
3726
- h('button', {
3727
- type: 'button', className: 'dshm-chipbtn dshm-col-play', style: { marginLeft: 'auto' },
3728
- disabled: topTracks.length === 0, title: t('playList'),
3729
- onClick: () => player.playTracks(topTracks, 0),
3730
- }, h(IconPlay, { size: 12 }), t('playList'))),
3731
- ((stats.topSongs || []).length
3732
- ? stats.topSongs.map((it, i) => {
3733
- const tr = trackForTop(it);
3734
- const play = () => { setNotice(''); playTopSong(it); };
3735
- const explain = () => setNotice(t('topUnplayable'));
3736
- return h('div', {
3737
- className: cx('dshm-top-row', tr ? 'dshm-top-row-click' : 'dshm-top-row-off'), key: i,
3738
- role: 'button', tabIndex: 0,
3739
- 'aria-disabled': tr ? undefined : true,
3740
- title: tr ? t('playTrack') : t('topUnplayable'),
3741
- onClick: tr ? play : explain,
3742
- onKeyDown: (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); if (tr) play(); else explain(); } },
3743
- },
3744
- h('span', { className: 'dshm-top-rank' }, String(i + 1)),
3745
- h('span', { className: 'dshm-ellipsis', style: { flex: 1 } }, (it.title || '') + (it.artist ? ' · ' + it.artist : '')),
3746
- h('span', { className: 'dshm-count' }, (it.plays || 0) + ' ' + t('playsUnit')));
3747
- })
3748
- : h('div', { className: 'dshm-lyrics-hint' }, t('noSection')))),
3749
- h('div', { className: 'dshm-top-col' },
3750
- h('div', { className: 'dshm-asec-title' }, h(IconDisc, { size: 13 }), t('topArtists')),
3751
- ((stats.topArtists || []).length
3752
- ? stats.topArtists.map((it, i) => h('button', {
3753
- key: i, type: 'button', className: 'dshm-top-row dshm-top-row-artist',
3754
- title: t('artistOpen'), onClick: () => openArtistPage(it.name || ''),
3755
- },
3756
- h('span', { className: 'dshm-top-rank' }, String(i + 1)),
3757
- h('span', { className: 'dshm-ellipsis', style: { flex: 1 } }, it.name || ''),
3758
- h('span', { className: 'dshm-count' }, (it.plays || 0) + ' ' + t('playsUnit'))))
3759
- : h('div', { className: 'dshm-lyrics-hint' }, t('noSection')))),
3760
- h('div', { className: 'dshm-dislikes' },
3761
- h('div', { className: 'dshm-asec-title' }, h(IconThumbDown, { size: 13 }), t('dislikesTitle')),
3762
- ((stats.dislikes && stats.dislikes.songs) || []).length
3763
- ? stats.dislikes.songs.map((it, i) => h('div', { className: 'dshm-dislike-row', key: i },
3764
- h('span', { className: 'dshm-ellipsis', style: { flex: 1 } },
3765
- (it.title || '') + (it.artist ? ' · ' + it.artist : '')),
3766
- h('span', { className: 'dshm-count' }, it.dislikedAt ? new Date(it.dislikedAt).toISOString().slice(0, 10) : ''),
3767
- likes ? h('button', {
3768
- type: 'button', className: 'dshm-chipbtn dshm-dislike-undo',
3769
- title: t('undislikeBtn'),
3770
- onClick: () => likes.setDislike({ artist: it.artist, title: it.title }, false),
3771
- }, t('undislikeBtn')) : null))
3772
- : h('div', { className: 'dshm-lyrics-hint' }, t('dislikesEmpty')))))
5331
+ const maxDaily = Math.max(1, ...daily.map((d) => d.plays || 0));
5332
+ const dailySum = daily.reduce((acc, d) => acc + (d.plays || 0), 0);
5333
+ /* 宿主 /history/stats 的真实字段 */
5334
+ const plays = (stats && stats.totalPlays) || 0;
5335
+ const totalSeconds = (stats && stats.totalSeconds) || 0;
5336
+ const songs = (stats && stats.uniqueSongs) || 0;
5337
+ const artists = (stats && stats.uniqueArtists) || 0;
5338
+ const skipped = (stats && stats.skippedCount) || 0;
5339
+ const completion = Math.round(((stats && stats.avgCompletion) || 0) * 100);
5340
+ const dislikes = (stats && stats.dislikes && stats.dislikes.songs) || [];
5341
+ const maxTopSong = Math.max(1, ...((stats && stats.topSongs) || []).map((x) => x.plays || 0));
5342
+ const maxTopArtist = Math.max(1, ...((stats && stats.topArtists) || []).map((x) => x.plays || 0));
5343
+ const showPlaysUnit = t('playsUnit') && t('playsUnit').toLowerCase() !== String(t('statPlays') || '').toLowerCase();
5344
+ const renderDuration = (sec) => fmtDuration(sec, t).split(/(\d+)/).map((part, idx) => {
5345
+ if (!part) return null;
5346
+ if (/^\d+$/.test(part)) return part;
5347
+ const unit = part.trim();
5348
+ return unit ? h('span', { key: idx, className: 'dshm-hist-big-unit' }, unit) : null;
5349
+ });
5350
+ const todayKey = fmtDay(Date.now());
5351
+
5352
+ /* 三幕结构:顶部浅底总览带(左主角数字 + 右 7 天趋势)→ 等高双卡排行 → 账本式对齐时间线 */
5353
+ const statsBlock = stats ? h(React.Fragment, null,
5354
+ h('section', { className: cx('dshm-hist-hero', !daily.length && 'dshm-hist-hero-solo') },
5355
+ h('div', { className: 'dshm-hist-overview' },
5356
+ h('div', { className: 'dshm-hist-main' },
5357
+ h('div', { className: 'dshm-hist-big-item' },
5358
+ h('span', { className: 'dshm-hist-big-label' }, t('statPlays')),
5359
+ h('span', { className: 'dshm-hist-big' }, String(plays), showPlaysUnit ? h('span', { className: 'dshm-hist-big-unit' }, t('playsUnit')) : null)),
5360
+ h('div', { className: 'dshm-hist-big-item' },
5361
+ h('span', { className: 'dshm-hist-big-label' }, t('statSeconds')),
5362
+ h('span', { className: 'dshm-hist-big' }, renderDuration(totalSeconds)))),
5363
+ h('p', { className: 'dshm-hist-foot' },
5364
+ fmt(t('histSummaryFoot'), { songs, artists, pct: completion }),
5365
+ skipped ? ' · ' + fmt(t('histSummarySkip'), { n: skipped }) : '',
5366
+ dislikes.length ? ' · ' + fmt(t('histSummaryDislike'), { n: dislikes.length }) : '')),
5367
+ daily.length ? h('div', { className: 'dshm-trend-wrap', role: 'img', 'aria-label': t('statDaily') || '7 days' },
5368
+ h('div', { className: 'dshm-trend-head' },
5369
+ h('span', { className: 'dshm-trend-title' }, t('statDaily')),
5370
+ h('span', { className: 'dshm-trend-sum' }, dailySum + ' ' + t('playsUnit'))),
5371
+ h('div', { className: 'dshm-trend-bars' },
5372
+ daily.map((d) => {
5373
+ const n = d.plays || 0;
5374
+ const isToday = d.date === todayKey;
5375
+ return h('div', { key: d.date, className: cx('dshm-bar-col', isToday && 'dshm-bar-col-today'), title: d.date + ' · ' + n },
5376
+ h('span', { className: 'dshm-bar-val' }, n ? String(n) : '–'),
5377
+ h('div', { className: cx('dshm-bar', isToday && 'dshm-bar-today', !n && 'dshm-bar-zero'), style: n ? { height: Math.max(4, Math.round((n / maxDaily) * 58)) + 'px' } : undefined }));
5378
+ })),
5379
+ h('div', { className: 'dshm-trend-axis' },
5380
+ daily.map((d) => {
5381
+ const isToday = d.date === todayKey;
5382
+ return h('span', { key: d.date, className: cx('dshm-bar-label', isToday && 'dshm-bar-label-today') }, d.date.slice(5));
5383
+ }))) : null),
5384
+ h('div', { className: 'dshm-tops' },
5385
+ h('div', { className: 'dshm-top-col' },
5386
+ h('div', { className: 'dshm-top-title' }, t('topSongs'),
5387
+ h('button', {
5388
+ type: 'button', className: 'dshm-chipbtn dshm-col-play',
5389
+ disabled: topTracks.length === 0, title: t('playList'), 'aria-label': t('playList'),
5390
+ onClick: () => player.playTracks(topTracks, 0),
5391
+ }, h(IconPlay, { size: 13 }))),
5392
+ ((stats.topSongs || []).length
5393
+ ? stats.topSongs.map((it, i) => {
5394
+ const tr = trackForTop(it);
5395
+ const play = () => { setNotice(''); playTopSong(it); };
5396
+ const explain = () => setNotice(t('topUnplayable'));
5397
+ const ratio = Math.max(6, Math.round(((it.plays || 0) / maxTopSong) * 100));
5398
+ return h('div', {
5399
+ className: cx('dshm-top-row', tr ? 'dshm-top-row-click' : 'dshm-top-row-off'), key: i,
5400
+ role: 'button', tabIndex: 0,
5401
+ 'aria-disabled': tr ? undefined : true,
5402
+ title: tr ? t('playTrack') : t('topUnplayable'),
5403
+ onClick: tr ? play : explain,
5404
+ onKeyDown: (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); if (tr) play(); else explain(); } },
5405
+ },
5406
+ h('span', { className: cx('dshm-top-rank', i < 3 && 'dshm-top-rank-hi') }, String(i + 1)),
5407
+ h(Thumb, { src: tr && tr.coverUrl ? tr.coverUrl : null, size: 28 }),
5408
+ h('div', { className: 'dshm-top-info' },
5409
+ h('span', { className: 'dshm-top-name dshm-ellipsis' }, it.title || t('untitled')),
5410
+ it.artist ? h('span', { className: 'dshm-top-sub dshm-ellipsis' }, it.artist) : null),
5411
+ h('span', { className: 'dshm-top-meter', 'aria-hidden': true }, h('span', { style: { width: ratio + '%' } })),
5412
+ h('span', { className: 'dshm-count' }, (it.plays || 0) + ' ' + t('playsUnit')));
5413
+ })
5414
+ : h('div', { className: 'dshm-lyrics-hint' }, t('noSection')))),
5415
+ h('div', { className: 'dshm-top-col' },
5416
+ h('div', { className: 'dshm-top-title' }, t('topArtists')),
5417
+ ((stats.topArtists || []).length
5418
+ ? stats.topArtists.map((it, i) => {
5419
+ const ratio = Math.max(6, Math.round(((it.plays || 0) / maxTopArtist) * 100));
5420
+ return h('button', {
5421
+ key: i, type: 'button', className: 'dshm-top-row dshm-top-row-artist',
5422
+ title: t('artistOpen'), onClick: () => openArtistPage(it.name || ''),
5423
+ },
5424
+ h('span', { className: cx('dshm-top-rank', i < 3 && 'dshm-top-rank-hi') }, String(i + 1)),
5425
+ h(ArtistAvatar, { name: it.name || '', size: 28, service: artistImages, useArtistImages }),
5426
+ h('span', { className: 'dshm-top-name dshm-ellipsis' }, it.name || ''),
5427
+ h('span', { className: 'dshm-top-meter', 'aria-hidden': true }, h('span', { style: { width: ratio + '%' } })),
5428
+ h('span', { className: 'dshm-count' }, (it.plays || 0) + ' ' + t('playsUnit')));
5429
+ })
5430
+ : h('div', { className: 'dshm-lyrics-hint' }, t('noSection'))))),
5431
+ dislikes.length ? h('div', { className: 'dshm-dislikes' },
5432
+ h('div', { className: 'dshm-top-title' }, t('dislikesTitle')),
5433
+ dislikes.map((it, i) => h('div', { className: 'dshm-dislike-row', key: i },
5434
+ h('span', { className: 'dshm-ellipsis dshm-dislike-name' },
5435
+ (it.title || '') + (it.artist ? ' · ' + it.artist : '')),
5436
+ h('span', { className: 'dshm-count dshm-dislike-date' }, it.dislikedAt ? fmtDay(it.dislikedAt) : ''),
5437
+ likes ? h('button', {
5438
+ type: 'button', className: 'dshm-chipbtn dshm-dislike-undo',
5439
+ title: t('undislikeBtn'),
5440
+ onClick: () => likes.setDislike({ artist: it.artist, title: it.title }, false),
5441
+ }, t('undislikeBtn')) : null))) : null)
3773
5442
  : null;
3774
5443
 
3775
5444
  let list;
3776
- if (s.status === 'loading' && s.events.length === 0) {
5445
+ const events = s.events || [];
5446
+ if (s.status === 'loading' && events.length === 0) {
3777
5447
  list = h(React.Fragment, null,
3778
5448
  h('div', { className: 'dshm-lyrics-hint' }, t('historyLoading')),
3779
- h(SkeletonRows));
3780
- } else if (s.status === 'error' && s.events.length === 0) {
5449
+ h(SkeletonRows, { t }));
5450
+ } else if (s.status === 'error' && events.length === 0) {
3781
5451
  list = h(EmptyState, {
3782
5452
  icon: h(IconAlert, { size: 30 }), tone: 'error',
3783
5453
  title: t('historyError'), body: s.error || '',
3784
5454
  }, h('button', { type: 'button', className: 'dshm-chipbtn', onClick: () => history.load(50) }, t('lyricsRetry')));
3785
- } else if (s.events.length === 0) {
5455
+ } else if (events.length === 0) {
3786
5456
  list = h(EmptyState, { icon: h(IconQueue, { size: 30 }), title: t('historyEmpty') });
3787
5457
  } else {
3788
5458
  const groups = [];
3789
5459
  let last = null;
3790
- for (const ev of s.events) {
5460
+ for (const ev of events) {
3791
5461
  const k = dayKeyOf(ev.timestamp || Date.now());
3792
- if (k !== last) { groups.push({ key: k, label: k, items: [] }); last = k; }
5462
+ if (k !== last) { groups.push({ key: k, items: [] }); last = k; }
3793
5463
  groups[groups.length - 1].items.push(ev);
3794
5464
  }
3795
5465
  const trackById = (ev) => (ev && ev.trackId ? tracks.find((x) => x.id === ev.trackId) : null);
3796
5466
  const queue = [];
3797
- for (const ev of s.events) {
5467
+ for (const ev of events) {
3798
5468
  const tr = trackById(ev);
3799
5469
  if (tr && !queue.some((x) => x.id === tr.id)) queue.push(tr);
3800
5470
  }
@@ -3805,17 +5475,18 @@ window.__ModuleLoader__.load({
3805
5475
  player.playTracks(queue, idx >= 0 ? idx : 0);
3806
5476
  };
3807
5477
  list = h('div', { className: 'dshm-hlist' },
3808
- h('div', { className: 'dshm-queue-head' }, h(IconQueue, { size: 14 }), t('historyTitle'),
3809
- h('span', { className: 'dshm-count' }, s.total + ' ' + t('tracksUnit')),
5478
+ h('div', { className: 'dshm-queue-head' },
5479
+ h('span', { className: 'dshm-queue-title' }, t('historyTitle')),
5480
+ h('span', { className: 'dshm-count' }, s.total + ' ' + t('playsUnit')),
3810
5481
  h('button', {
3811
- type: 'button', className: 'dshm-chipbtn dshm-col-play', style: { marginLeft: 'auto' },
5482
+ type: 'button', className: 'dshm-chipbtn dshm-col-play',
3812
5483
  disabled: queue.length === 0,
3813
- title: t('playList'),
5484
+ title: t('playList'), 'aria-label': t('playList'),
3814
5485
  onClick: () => player.playTracks(queue, 0),
3815
- }, h(IconPlay, { size: 12 }), t('playList'))),
5486
+ }, h(IconPlay, { size: 13 }))),
3816
5487
  groups.map((g) => h('section', { className: 'dshm-hgroup', key: g.key },
3817
5488
  h('div', { className: 'dshm-hgroup-label' },
3818
- g.label,
5489
+ dayLabel(g.items[0].timestamp, t),
3819
5490
  h('span', { className: 'dshm-count' }, g.items.length + ' ' + t('playsUnit'))),
3820
5491
  g.items.map((ev, i) => {
3821
5492
  const pct = Math.round((ev.completion || 0) * 100);
@@ -3823,12 +5494,17 @@ window.__ModuleLoader__.load({
3823
5494
  const tr = trackById(ev);
3824
5495
  return h('div', {
3825
5496
  className: cx('dshm-hrow', tr && 'dshm-hrow-click'), key: i,
3826
- role: tr ? 'button' : undefined, tabIndex: tr ? 0 : undefined,
3827
- title: tr ? t('playTrack') : undefined,
5497
+ role: 'listitem',
3828
5498
  onClick: tr ? () => playHistory(ev) : undefined,
3829
- onKeyDown: tr ? (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); playHistory(ev); } } : undefined,
3830
5499
  },
3831
- h(Thumb, { src: coverOf(ev), size: 40 }),
5500
+ tr
5501
+ ? h('button', {
5502
+ type: 'button', className: 'dshm-hrow-play',
5503
+ 'aria-label': t('playTrack') + ': ' + (ev.title || t('untitled')),
5504
+ title: t('playTrack'),
5505
+ onClick: (e) => { e.stopPropagation(); playHistory(ev); },
5506
+ }, h(Thumb, { src: coverOf(ev), size: 40 }))
5507
+ : h(Thumb, { src: coverOf(ev), size: 40 }),
3832
5508
  h('div', { className: 'dshm-row-info' },
3833
5509
  h('div', { className: 'dshm-row-title dshm-ellipsis' }, ev.title || ev.trackId || ''),
3834
5510
  ev.artist
@@ -3839,12 +5515,14 @@ window.__ModuleLoader__.load({
3839
5515
  h(ArtistAvatar, { name: ev.artist, size: 16, service: artistImages, useArtistImages }),
3840
5516
  h('span', { className: 'dshm-ellipsis' }, ev.artist))
3841
5517
  : h('div', { className: 'dshm-row-sub dshm-ellipsis' }, '')),
3842
- h('span', { className: 'dshm-hbadge dshm-hbadge-' + tone, title: t('historyComplete') }, pct + '%'),
3843
- ev.skipped ? h('span', { className: 'dshm-hskip' }, t('historySkipped')) : h('span', null),
3844
- h('span', { className: 'dshm-htime' },
3845
- ev.timestamp ? new Date(ev.timestamp).toLocaleString(undefined, { hour: '2-digit', minute: '2-digit' }) : ''));
5518
+ h('div', { className: 'dshm-hrow-meta' },
5519
+ ev.skipped ? h('span', { className: 'dshm-hskip' }, t('historySkipped')) : null,
5520
+ h('span', { className: 'dshm-hbadge dshm-hbadge-' + tone, title: t('historyComplete') }, pct + '%'),
5521
+ h('span', { className: 'dshm-htime' },
5522
+ ev.timestamp ? new Date(ev.timestamp).toLocaleString(undefined, { hour: '2-digit', minute: '2-digit' }) : '')));
3846
5523
  }))));
3847
5524
  }
5525
+
3848
5526
  return h('div', { className: 'dshm-history-page' },
3849
5527
  notice ? h('div', { className: 'dshm-mode-hint', role: 'status', style: { margin: '6px 8px 0' } }, notice) : null,
3850
5528
  statsBlock, list);
@@ -3860,9 +5538,10 @@ window.__ModuleLoader__.load({
3860
5538
  return source || '';
3861
5539
  }
3862
5540
 
3863
- function LyricsPanel({ t, lyrics, useLyrics, usePlayer }) {
5541
+ function LyricsPanel({ t, lyrics, player, useLyrics, usePlayer }) {
3864
5542
  const track = usePlayer((s) => s.track);
3865
5543
  const position = usePlayer((s) => s.position);
5544
+ const duration = usePlayer((s) => s.duration);
3866
5545
  const trackId = track ? track.id : null;
3867
5546
  const snap = useLyrics((s) => (s.trackId === trackId ? s : null));
3868
5547
 
@@ -3870,6 +5549,8 @@ window.__ModuleLoader__.load({
3870
5549
 
3871
5550
  const scrollRef = useRef(null);
3872
5551
  const activeRef = useRef(null);
5552
+ /* 用户刚点了某一句:短暂忽略自动滚动,免得歌词框在 seek 后「抢」回位置 */
5553
+ const seekHoldRef = useRef(0);
3873
5554
  const lines = snap && snap.data && snap.data.synced ? snap.data.lines : null;
3874
5555
  let activeIdx = -1;
3875
5556
  if (lines && lines.length) {
@@ -3881,6 +5562,7 @@ window.__ModuleLoader__.load({
3881
5562
  }
3882
5563
  }
3883
5564
  useEffect(() => {
5565
+ if (Date.now() < seekHoldRef.current) return;
3884
5566
  const el = activeRef.current, box = scrollRef.current;
3885
5567
  if (el && box) {
3886
5568
  box.scrollTo({
@@ -3892,6 +5574,14 @@ window.__ModuleLoader__.load({
3892
5574
 
3893
5575
  if (!track || !snap) return null;
3894
5576
 
5577
+ /* 点击任意一句 → 跳到那句的时间。这是所有歌词界面的第一直觉。 */
5578
+ const playerApi = player || (usePlayer && usePlayer.getSnapshot ? usePlayer.getSnapshot() : null);
5579
+ function seekTo(line) {
5580
+ if (line.time == null || !playerApi || typeof playerApi.seek !== 'function') return;
5581
+ seekHoldRef.current = Date.now() + 900;
5582
+ playerApi.seek(line.time);
5583
+ }
5584
+
3895
5585
  let body;
3896
5586
  if (snap.status === 'loading') {
3897
5587
  body = h('div', { className: 'dshm-lyrics-hint' }, t('lyricsLoading'));
@@ -3902,13 +5592,18 @@ window.__ModuleLoader__.load({
3902
5592
  } else if (snap.data && snap.data.source === 'none') {
3903
5593
  body = h('div', { className: 'dshm-lyrics-hint' }, (snap.data.message || t('lyricsNone')));
3904
5594
  } else if (lines && lines.length) {
3905
- body = h('div', { className: 'dshm-lyrics-scroll', ref: scrollRef },
3906
- lines.map((line, i) => h('div', {
5595
+ body = h('div', { className: 'dshm-lyrics-scroll', ref: scrollRef, role: 'list' },
5596
+ lines.map((line, i) => h('button', {
3907
5597
  key: i,
5598
+ type: 'button',
3908
5599
  ref: i === activeIdx ? activeRef : null,
5600
+ role: 'listitem',
3909
5601
  className: cx('dshm-lyric-line',
3910
5602
  i === activeIdx && 'dshm-lyric-line-active',
3911
5603
  i < activeIdx && 'dshm-lyric-line-past'),
5604
+ 'aria-current': i === activeIdx ? 'true' : undefined,
5605
+ disabled: line.time == null,
5606
+ onClick: () => seekTo(line),
3912
5607
  }, line.text || '♪')));
3913
5608
  } else if (snap.data && snap.data.plain) {
3914
5609
  body = h('div', { className: 'dshm-plain-lyrics' }, snap.data.plain);
@@ -3916,13 +5611,15 @@ window.__ModuleLoader__.load({
3916
5611
  body = h('div', { className: 'dshm-lyrics-hint' }, t('lyricsNone'));
3917
5612
  }
3918
5613
 
5614
+ const synced = !!(lines && lines.length && snap.status !== 'loading');
3919
5615
  return h('section', { className: 'dshm-lyrics', 'aria-label': t('lyricsTitle') },
3920
5616
  h('div', { className: 'dshm-lyrics-head' },
3921
5617
  h(IconNote, { size: 14 }),
3922
5618
  t('lyricsTitle'),
3923
5619
  snap.data && snap.data.source && snap.data.source !== 'none'
3924
5620
  ? h('span', { className: 'dshm-source-chip' }, t('lyricsSource') + ' · ' + lyricsSourceLabel(snap.data.source, t))
3925
- : null),
5621
+ : null,
5622
+ synced ? h('span', { className: 'dshm-lyrics-hint' }, t('lyricsClickHint')) : null),
3926
5623
  body);
3927
5624
  }
3928
5625
 
@@ -3939,10 +5636,10 @@ window.__ModuleLoader__.load({
3939
5636
  /* ================================================================
3940
5637
  * 12. Music panel (main slot): header + tabs + per-view body
3941
5638
  * ================================================================ */
3942
- function MusicPanel({ t, player, library, lyrics, reco, download, sync, history, likes, preview, warm, openView, openArtistPage, setMiniHidden, ui, artistImages, artistPage, onboarding, useUi, useLibrary, usePlayer, useLyrics, useReco, useDownload, useSync, useHistory, useLikes, usePreview, useWarm, useArtistImages, useArtistPage, useOnboarding }) {
5639
+ function MusicPanel({ t, player, library, lyrics, reco, download, sync, history, likes, preview, warm, openView, openArtistPage, goBack, backLabel, setMiniHidden, ui, artistImages, artistPage, onboarding, likedSync, useUi, useLibrary, usePlayer, useLyrics, useReco, useDownload, useSync, useHistory, useLikes, usePreview, useWarm, useArtistImages, useArtistPage, useOnboarding, useLikedSync }) {
3943
5640
  const view = useUi((s) => s.view);
3944
- const welcomePreview = useUi((s) => s.welcomePreview);
3945
- const onboardingSnap = useOnboarding((st) => st);
5641
+ const settingsSection = useUi((s) => s.settingsSection);
5642
+ const libTabWish = useUi((s) => s.libTabWish);
3946
5643
  const miniHidden = useUi((s) => s.miniHidden);
3947
5644
  const hasTrack = usePlayer((s) => !!s.track);
3948
5645
  const status = useLibrary((s) => s.status);
@@ -3968,18 +5665,86 @@ window.__ModuleLoader__.load({
3968
5665
  return () => clearTimeout(timer);
3969
5666
  }, [toast]);
3970
5667
 
3971
- if (view === 'welcome') {
3972
- return h(WelcomeView, {
3973
- t, onboarding, useOnboarding,
3974
- preview: !!welcomePreview,
3975
- onExitPreview: () => { ui.set({ welcomePreview: false, view: 'library' }); openView('library'); },
5668
+ /* 设置页:首启(onboarding 未完成)自动进入;老用户从右上角「设置」进入。
5669
+ * section 让「我喜欢」页的入口直接滚到「喜欢列表同步」。 */
5670
+ const openSettings = (section) => {
5671
+ const cur = ui.getSnapshot();
5672
+ /* 进入设置也压栈:退出时回到进来前的那一页 */
5673
+ const stack = cur.view !== 'settings' ? [...(cur.navStack || []), { view: cur.view, artistName: cur.artistName || null }].slice(-20) : (cur.navStack || []);
5674
+ ui.set({ view: 'settings', settingsSection: section || null, navStack: stack });
5675
+ };
5676
+ const exitSettings = () => {
5677
+ const cur = ui.getSnapshot();
5678
+ const stack = cur.navStack || [];
5679
+ const top = stack[stack.length - 1];
5680
+ if (top) ui.set({ view: top.view, artistName: top.artistName, settingsSection: null, navStack: stack.slice(0, -1) });
5681
+ else ui.set({ view: 'library', settingsSection: null, navStack: [] });
5682
+ };
5683
+
5684
+ /* 全局键盘快捷键(桌面端肌肉记忆):必须放在所有条件 return 之前,严守 React Hooks 顺序。
5685
+ * Space 播放/暂停 · ←/→ 快退/快进 5 秒 · ⌘/Ctrl+K 聚焦搜索 · Esc 退回上一页或清空搜索。 */
5686
+ useEffect(() => {
5687
+ if (typeof window === 'undefined') return undefined;
5688
+ const onKey = (e) => {
5689
+ const el = e.target && e.target.tagName ? e.target : null;
5690
+ const typing = el && (/^(INPUT|TEXTAREA|SELECT)$/.test(el.tagName) || (e.target && e.target.isContentEditable));
5691
+ const mod = e.metaKey || e.ctrlKey;
5692
+ if (mod && (e.key === 'k' || e.key === 'K')) {
5693
+ const inp = document.querySelector('.dshm-panel .dshm-search input');
5694
+ if (inp) { e.preventDefault(); inp.focus(); inp.select && inp.select(); }
5695
+ return;
5696
+ }
5697
+ if (typing) return;
5698
+ if (e.code === 'Space' || e.key === ' ') {
5699
+ /* 按钮与链接上的 Space 本身就是点击:不要劫持 */
5700
+ if (el && /^(BUTTON|A)$/.test(el.tagName)) return;
5701
+ e.preventDefault();
5702
+ player.toggle();
5703
+ return;
5704
+ }
5705
+ if (e.key === 'ArrowLeft' || e.key === 'ArrowRight') {
5706
+ if (el && (/^(BUTTON|A)$/.test(el.tagName) || (el.getAttribute && el.getAttribute('role') === 'slider'))) return;
5707
+ const st = player.source && player.source.getSnapshot ? player.source.getSnapshot() : null;
5708
+ if (st && st.duration > 0) {
5709
+ e.preventDefault();
5710
+ const delta = e.key === 'ArrowRight' ? 5 : -5;
5711
+ player.seek(Math.max(0, Math.min(st.duration, (st.position || 0) + delta)));
5712
+ }
5713
+ return;
5714
+ }
5715
+ if (e.key === 'Escape') {
5716
+ if (view === 'settings') {
5717
+ const firstRun = onboarding && onboarding.source ? !onboarding.source.getSnapshot().completed : false;
5718
+ if (!firstRun) { e.preventDefault(); exitSettings(); }
5719
+ return;
5720
+ }
5721
+ if (view === 'artist') { e.preventDefault(); goBack(); return; }
5722
+ const inp = document.querySelector('.dshm-panel .dshm-search input');
5723
+ if (inp && inp.value) {
5724
+ e.preventDefault();
5725
+ window.dispatchEvent(new CustomEvent('dshm:clear-search'));
5726
+ }
5727
+ }
5728
+ };
5729
+ window.addEventListener('keydown', onKey);
5730
+ return () => window.removeEventListener('keydown', onKey);
5731
+ }, [view, player, goBack, onboarding]);
5732
+
5733
+ if (view === 'settings') {
5734
+ return h(SettingsView, {
5735
+ t, onboarding, useOnboarding, sync, useSync, likedSync, useLikedSync,
5736
+ section: settingsSection,
5737
+ /* 导入结果里的「查看我喜欢」:回曲库并直接打开「我喜欢」子页 */
5738
+ onViewLikes: () => { ui.set({ view: 'library', settingsSection: null, libTabWish: 'likes', navStack: [] }); },
5739
+ /* 退出设置 = 回到进设置之前的那一页(首启除外:首启没有上一页,回曲库) */
5740
+ onExit: exitSettings,
3976
5741
  onRoute: (target) => {
3977
- ui.set({ welcomePreview: false });
5742
+ ui.set({ settingsSection: null, navStack: [] });
3978
5743
  if (target === 'library') {
3979
5744
  library.load();
3980
5745
  setTimeout(() => library.load(), 1500);
3981
- openView('library');
3982
- } else openView('reco');
5746
+ }
5747
+ ui.set({ view: target === 'library' ? 'library' : 'reco' });
3983
5748
  },
3984
5749
  });
3985
5750
  }
@@ -3992,44 +5757,47 @@ window.__ModuleLoader__.load({
3992
5757
  ];
3993
5758
 
3994
5759
  const body = view === 'library'
3995
- ? h(LibraryView, { t, player, library, sync, download, preview, likes, openArtistPage, artistImages, useLikes, useSync, useDownload, useLibrary, usePlayer, useArtistImages })
5760
+ ? h(LibraryView, { t, player, library, sync, download, preview, likes, openArtistPage, artistImages, likedSync, openSettings, useLikes, useSync, useDownload, useLibrary, usePlayer, useArtistImages, useLikedSync, tabWish: libTabWish, onTabWishDone: () => ui.set({ libTabWish: null }) })
3996
5761
  : view === 'reco'
3997
5762
  ? h(RecoView, { t, reco, download, player, library, likes, preview, history, openArtistPage, warm, useReco, useDownload, useLibrary, useLikes, usePlayer, useHistory, useWarm })
3998
5763
  : view === 'artist'
3999
- ? h(ArtistPageView, { t, reco, player, likes, preview, library, openView, openArtistPage, artistImages, artistPage, useUi, useLikes, useLibrary, usePlayer, useArtistImages, useArtistPage })
5764
+ ? h(ArtistPageView, { t, reco, player, likes, preview, library, openView, openArtistPage, goBack, backLabel, artistImages, artistPage, useUi, useLikes, useLibrary, usePlayer, useArtistImages, useArtistPage })
4000
5765
  : view === 'history'
4001
5766
  ? h(HistoryView, { t, history, player, openArtistPage, artistImages, likes, useHistory, useLibrary, useArtistImages, useLikes })
4002
- : h(NowPlayingView, { t, player, lyrics, usePlayer, useLyrics, openView, openArtistPage, artistImages, useArtistImages });
5767
+ : h(NowPlayingView, { t, player, lyrics, usePlayer, useLyrics, openView, openArtistPage, artistImages, useArtistImages, likes, useLikes });
4003
5768
 
4004
5769
  return h(React.Fragment, null,
4005
5770
  h('div', { className: 'dshm-panel' },
4006
5771
  h('header', { className: 'dshm-header' },
4007
- h('div', { className: 'dshm-title-row' },
4008
- h('h1', { className: 'dshm-title' }, t('panel')),
4009
- h('span', { className: 'dshm-count' }, count > 0 ? count + ' ' + t('tracksUnit') : ''),
4010
- h('div', { className: 'dshm-header-actions' },
4011
- onboardingSnap && onboardingSnap.completed
4012
- ? h('button', {
4013
- type: 'button', className: 'dshm-chipbtn',
4014
- title: t('welcomePreview'), onClick: () => ui.set({ view: 'welcome', welcomePreview: true }),
4015
- }, h(IconSparkles, { size: 12 }), t('welcomePreview'))
4016
- : null,
4017
- h('button', {
4018
- type: 'button', className: cx('dshm-chipbtn', !miniHidden && 'dshm-chipbtn-primary'),
4019
- disabled: miniHidden && !hasTrack,
4020
- title: miniHidden && !hasTrack ? t('miniNeedsTrack') : (miniHidden ? t('showMini') : t('hideMini')),
4021
- onClick: () => setMiniHidden(miniHidden ? false : true),
4022
- }, h(IconNote, { size: 14 }), miniHidden ? t('showMini') : t('hideMini')),
4023
- h('button', {
4024
- type: 'button', className: 'dshm-chipbtn', disabled: busy,
4025
- onClick: () => library.rescan(),
4026
- }, h(IconRefresh, { size: 14, className: busy ? 'dshm-spin' : undefined }), busy ? t('rescanning') : t('rescan')))),
4027
- h('nav', { className: 'dshm-tabs', role: 'tablist', 'aria-label': t('panel') },
4028
- tabs.map((tab) => h('button', {
4029
- key: tab.id, type: 'button', role: 'tab',
4030
- className: 'dshm-tab', 'aria-selected': view === tab.id,
4031
- onClick: () => openView(tab.id),
4032
- }, tab.label, tab.dot ? h('span', { className: 'dshm-tab-dot', 'aria-hidden': true }) : null)))),
5772
+ h('div', { className: 'dshm-header-inner' },
5773
+ h('div', { className: 'dshm-title-row' },
5774
+ h('h1', { className: 'dshm-title' }, t('panel')),
5775
+ h('span', { className: 'dshm-count' }, count > 0 ? count + ' ' + t('tracksUnit') : ''),
5776
+ h('div', { className: 'dshm-header-actions' },
5777
+ /* 迷你条开关:状态型幽灵按钮(不是实心主 CTA),aria-pressed 说明「现在开着」 */
5778
+ h('button', {
5779
+ type: 'button', className: cx('dshm-chipbtn dshm-chipbtn-icon dshm-chipbtn-toggle', !miniHidden && 'dshm-chipbtn-on'),
5780
+ disabled: miniHidden && !hasTrack,
5781
+ 'aria-pressed': !miniHidden,
5782
+ title: miniHidden && !hasTrack ? t('miniNeedsTrack') : t('miniToggle'),
5783
+ 'aria-label': t('miniToggle'),
5784
+ onClick: () => setMiniHidden(miniHidden ? false : true),
5785
+ }, h(IconNote, { size: 14 })),
5786
+ h('button', {
5787
+ type: 'button', className: 'dshm-chipbtn dshm-chipbtn-icon',
5788
+ title: t('settingsHint'), 'aria-label': t('settingsTitle'), onClick: () => openSettings(),
5789
+ }, h(IconGear, { size: 14 })),
5790
+ /* 「重新扫描」是曲库维护动作:只在曲库页出现,不再霸占全站右上角 */
5791
+ view === 'library' ? h('button', {
5792
+ type: 'button', className: 'dshm-chipbtn', disabled: busy,
5793
+ onClick: () => library.rescan(),
5794
+ }, h(IconRefresh, { size: 14, className: busy ? 'dshm-spin' : undefined }), busy ? t('rescanning') : t('rescan')) : null)),
5795
+ h('nav', { className: 'dshm-tabs', role: 'tablist', 'aria-label': t('panel') },
5796
+ tabs.map((tab) => h('button', {
5797
+ key: tab.id, type: 'button', role: 'tab',
5798
+ className: 'dshm-tab', 'aria-selected': view === tab.id,
5799
+ onClick: () => openView(tab.id),
5800
+ }, tab.label, tab.dot ? h('span', { className: 'dshm-tab-dot', 'aria-hidden': true }) : null))))),
4033
5801
  h('div', { className: 'dshm-body', role: 'tabpanel' }, body)),
4034
5802
  toast
4035
5803
  ? h('div', { className: 'dshm-toast', role: 'status' },
@@ -4059,7 +5827,7 @@ window.__ModuleLoader__.load({
4059
5827
  /* ================================================================
4060
5828
  * 14. Mini player (shell.overlay — mounted across navigation)
4061
5829
  * ================================================================ */
4062
- function MiniPlayer({ t, player, lyrics, artistImages, usePlayer, useUi, useLyrics, useArtistImages, openNow, openArtistPage, setMiniHidden, setMiniCollapsed }) {
5830
+ function MiniPlayer({ t, player, lyrics, artistImages, likes, useLikes, usePlayer, useUi, useLyrics, useArtistImages, openNow, openArtistPage, setMiniHidden, setMiniCollapsed, publishRect }) {
4063
5831
  const track = usePlayer((s) => s.track);
4064
5832
  const playing = usePlayer((s) => s.playing);
4065
5833
  const position = usePlayer((s) => s.position);
@@ -4075,8 +5843,19 @@ window.__ModuleLoader__.load({
4075
5843
  const [pos, setPos] = useState(() => readPrefs().miniPos || null);
4076
5844
  const [fabPos, setFabPos] = useState(() => readPrefs().miniFabPos || null);
4077
5845
  const [dragging, setDragging] = useState(false);
5846
+ const [menuOpen, setMenuOpen] = useState(false);
5847
+ const menuRef = useRef(null);
4078
5848
  const boxRef = useRef(null);
4079
5849
  const dragRef = useRef(null);
5850
+ /* ··· 菜单:点外面 / Esc 关闭 */
5851
+ useEffect(() => {
5852
+ if (!menuOpen) return () => {};
5853
+ const onDoc = (e) => { if (menuRef.current && !menuRef.current.contains(e.target)) setMenuOpen(false); };
5854
+ const onKey = (e) => { if (e.key === 'Escape') { e.stopPropagation(); setMenuOpen(false); } };
5855
+ document.addEventListener('pointerdown', onDoc, true);
5856
+ document.addEventListener('keydown', onKey, true);
5857
+ return () => { document.removeEventListener('pointerdown', onDoc, true); document.removeEventListener('keydown', onKey, true); };
5858
+ }, [menuOpen]);
4080
5859
  const posRef = useRef(pos);
4081
5860
  posRef.current = pos;
4082
5861
  const fabRef = useRef(null);
@@ -4084,6 +5863,53 @@ window.__ModuleLoader__.load({
4084
5863
  const fabPosRef = useRef(fabPos);
4085
5864
  fabPosRef.current = fabPos;
4086
5865
  const fabMoved = useRef(0);
5866
+ /* 展开条的尺寸(收起时元素不在,用上次量到的值把圆标放到条的右下角) */
5867
+ const sizeRef = useRef({ w: 380, h: 72 });
5868
+ const FAB = 48;
5869
+ const inWindow = (next, w, h) => (typeof window === 'undefined'
5870
+ ? next
5871
+ : { left: Math.max(0, Math.min(next.left, window.innerWidth - w - 8)), top: Math.max(0, Math.min(next.top, window.innerHeight - h - 8)) });
5872
+ /* 收起 / 展开共用同一个锚点:圆标的右下角 = 展开条的右下角。
5873
+ * 收起时圆标落在条的右下角;再从圆标展开时,条从圆标位置向左上长出来,不会跳回默认角。 */
5874
+ function collapseToFab() {
5875
+ const el = boxRef.current;
5876
+ let base = posRef.current;
5877
+ if (el && typeof window !== 'undefined') {
5878
+ const r = el.getBoundingClientRect();
5879
+ sizeRef.current = { w: r.width, h: r.height };
5880
+ base = { left: r.left, top: r.top };
5881
+ }
5882
+ if (!base) { setFabPos(null); writePrefs({ miniFabPos: null }); return; }
5883
+ const next = inWindow({ left: base.left + sizeRef.current.w - FAB, top: base.top + sizeRef.current.h - FAB }, FAB, FAB);
5884
+ fabPosRef.current = next;
5885
+ setFabPos(next);
5886
+ writePrefs({ miniFabPos: next });
5887
+ }
5888
+ function expandFromFab() {
5889
+ const el = fabRef.current;
5890
+ let f = fabPosRef.current;
5891
+ if (el && typeof window !== 'undefined') {
5892
+ const r = el.getBoundingClientRect();
5893
+ f = { left: r.left, top: r.top };
5894
+ } else if (!f && typeof window !== 'undefined') {
5895
+ f = { left: window.innerWidth - 16 - FAB, top: window.innerHeight - 16 - FAB };
5896
+ }
5897
+ if (!f) return;
5898
+ const next = inWindow({ left: f.left + FAB - sizeRef.current.w, top: f.top + FAB - sizeRef.current.h }, sizeRef.current.w, sizeRef.current.h);
5899
+ posRef.current = next;
5900
+ setPos(next);
5901
+ writePrefs({ miniPos: next });
5902
+ }
5903
+ /* 把迷你播放条(或圆标)的位置发布到 ui store:右下角的入库悬浮窗据此叠在它上方,不互相遮挡 */
5904
+ useEffect(() => {
5905
+ if (!publishRect || typeof window === 'undefined') return;
5906
+ if (hidden || !track) { publishRect(null); return; }
5907
+ const el = collapsed ? fabRef.current : boxRef.current;
5908
+ if (!el) return;
5909
+ const r = el.getBoundingClientRect();
5910
+ if (!collapsed) sizeRef.current = { w: r.width, h: r.height };
5911
+ publishRect({ left: r.left, top: r.top, w: r.width, h: r.height, collapsed: !!collapsed });
5912
+ }, [pos, fabPos, collapsed, hidden, track ? 1 : 0]);
4087
5913
 
4088
5914
  useEffect(() => { if (trackId) lyrics.load(trackId); }, [trackId]);
4089
5915
 
@@ -4136,6 +5962,7 @@ window.__ModuleLoader__.load({
4136
5962
  const dx = e.clientX - d.px, dy = e.clientY - d.py;
4137
5963
  fabMoved.current = Math.max(fabMoved.current, Math.abs(dx) + Math.abs(dy));
4138
5964
  if (fabMoved.current < 3) return;
5965
+ if (!dragging) setDragging(true);
4139
5966
  const next = {
4140
5967
  left: Math.max(0, Math.min(d.left + dx, window.innerWidth - 56)),
4141
5968
  top: Math.max(0, Math.min(d.top + dy, window.innerHeight - 56)),
@@ -4146,7 +5973,8 @@ window.__ModuleLoader__.load({
4146
5973
  const onFabUp = (e) => {
4147
5974
  if (!fabDragRef.current) return;
4148
5975
  fabDragRef.current = null;
4149
- if (fabMoved.current < 5) { setMiniCollapsed(false); return; }
5976
+ if (fabMoved.current < 5) { expandFromFab(); setMiniCollapsed(false); return; }
5977
+ setDragging(false);
4150
5978
  if (fabPosRef.current) writePrefs({ miniFabPos: fabPosRef.current });
4151
5979
  try { if (fabRef.current) fabRef.current.releasePointerCapture(e.pointerId); } catch { /* released */ }
4152
5980
  };
@@ -4155,10 +5983,12 @@ window.__ModuleLoader__.load({
4155
5983
  ref: fabRef, style: fabStyle,
4156
5984
  className: cx('dshm-mini-fab', dragging && 'dshm-mini-fab-dragging'),
4157
5985
  role: 'button', tabIndex: 0,
4158
- title: t('miniExpand'), 'aria-label': t('miniExpand'),
5986
+ /* 悬浮球提示直接说「现在在放什么」,一眼可扫 */
5987
+ title: fmt(t(playing ? 'miniFabPlaying' : 'miniFabPaused'), { title: track.title || t('untitled'), artist: track.artist || '' }),
5988
+ 'aria-label': fmt(t(playing ? 'miniFabPlaying' : 'miniFabPaused'), { title: track.title || t('untitled'), artist: track.artist || '' }),
4159
5989
  onPointerDown: onFabDown, onPointerMove: onFabMove,
4160
5990
  onPointerUp: onFabUp, onPointerCancel: onFabUp,
4161
- onKeyDown: (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); setMiniCollapsed(false); } },
5991
+ onKeyDown: (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); expandFromFab(); setMiniCollapsed(false); } },
4162
5992
  },
4163
5993
  h(Thumb, { src: track.coverUrl, size: 48, round: true, glyph: IconNote }),
4164
5994
  h('span', { className: 'dshm-mini-fab-badge', 'aria-hidden': true },
@@ -4166,34 +5996,59 @@ window.__ModuleLoader__.load({
4166
5996
  }
4167
5997
 
4168
5998
  /* ---------------- expanded: the full mini bar ---------------- */
4169
- const gripDown = (e) => {
5999
+ /* 整条可拖:把手 / 标题 / 歌词 / 空白处按下并移动 ≥4px 即开始拖动;控件按钮、链接、滑块不参与,
6000
+ * 所以拖动不会吞掉播放/切歌/进度条的操作。指针捕获必须设在挂事件的元素上:
6001
+ * 旧实现把捕获设在 box、move/up 却挂在 grip 上,捕获后事件全部落到 box,
6002
+ * grip 收不到 move,整条只有在指针不离开把手的慢速拖动下才偶尔能动。
6003
+ * 这里统一挂在 box 上并按下即捕获(快速一甩时首个 move 可能已在条外,延迟捕获会丢拖动);
6004
+ * 捕获会让 Chrome 把 click 投递给 box,所以未拖动的轻点由我们转发给标题按钮,单击行为不变。 */
6005
+ const DRAG_THRESHOLD = 4;
6006
+ /* 只有真正的控件排除在拖动区之外;标题区(.dshm-mini-main / .dshm-mini-titlebtn)既是拖动区也保留单击 */
6007
+ const interactiveTarget = (target) => Boolean(target && typeof target.closest === 'function'
6008
+ && target.closest('button:not(.dshm-mini-main):not(.dshm-mini-titlebtn), a, input, textarea, select, [role="slider"], [role="button"]:not(.dshm-mini-grip)'));
6009
+ const barDown = (e) => {
6010
+ if (e.button !== 0 || interactiveTarget(e.target)) return;
4170
6011
  const el = boxRef.current;
4171
6012
  if (!el) return;
4172
- e.preventDefault();
4173
6013
  const box = el.getBoundingClientRect();
4174
- dragRef.current = { px: e.clientX, py: e.clientY, left: box.left, top: box.top, w: box.width, h: box.height };
4175
- setDragging(true);
6014
+ dragRef.current = { target: e.target, px: e.clientX, py: e.clientY, left: box.left, top: box.top, w: box.width, h: box.height, active: false, pointerId: e.pointerId };
6015
+ /* 按下即捕获:快速一甩时第一个 move 往往已落在条外,等越过阈值再捕获就收不到它(CDP 实测会丢拖动) */
4176
6016
  try { el.setPointerCapture(e.pointerId); } catch { /* unsupported */ }
6017
+ /* 把手没有自己的 click,按下即阻止选中文本 */
6018
+ if (typeof e.target.closest === 'function' && e.target.closest('.dshm-mini-grip')) e.preventDefault();
4177
6019
  };
4178
- const gripMove = (e) => {
6020
+ const barMove = (e) => {
4179
6021
  const d = dragRef.current;
4180
- if (!d) return;
6022
+ if (!d || e.pointerId !== d.pointerId) return;
6023
+ const dx = e.clientX - d.px, dy = e.clientY - d.py;
6024
+ if (!d.active) {
6025
+ if (Math.abs(dx) + Math.abs(dy) < DRAG_THRESHOLD) return;
6026
+ d.active = true;
6027
+ setDragging(true);
6028
+ }
4181
6029
  const next = {
4182
- left: Math.max(0, Math.min(d.left + (e.clientX - d.px), window.innerWidth - d.w - 8)),
4183
- top: Math.max(0, Math.min(d.top + (e.clientY - d.py), window.innerHeight - d.h - 8)),
6030
+ left: Math.max(0, Math.min(d.left + dx, window.innerWidth - d.w - 8)),
6031
+ top: Math.max(0, Math.min(d.top + dy, window.innerHeight - d.h - 8)),
4184
6032
  };
4185
6033
  posRef.current = next;
4186
6034
  setPos(next);
4187
6035
  };
4188
- const gripUp = (e) => {
4189
- if (!dragRef.current) return;
6036
+ const barUp = (e, cancelled) => {
6037
+ const d = dragRef.current;
6038
+ if (!d || e.pointerId !== d.pointerId) return;
4190
6039
  dragRef.current = null;
6040
+ try { if (boxRef.current) boxRef.current.releasePointerCapture(e.pointerId); } catch { /* released */ }
6041
+ if (!d.active) {
6042
+ /* 未拖动的轻点:捕获让 Chrome 把 click 投递给了 box,这里把标题按钮的单击补回去 */
6043
+ const main = !cancelled && d.target && typeof d.target.closest === 'function' ? d.target.closest('.dshm-mini-main') : null;
6044
+ if (main && boxRef.current && boxRef.current.contains(main)) main.click();
6045
+ return;
6046
+ }
4191
6047
  setDragging(false);
4192
6048
  if (posRef.current) writePrefs({ miniPos: posRef.current });
4193
- try { if (boxRef.current) boxRef.current.releasePointerCapture(e.pointerId); } catch { /* released */ }
4194
6049
  };
4195
6050
 
4196
- const frac = duration > 0 ? Math.min(1, position / duration) : 0;
6051
+ const frac = duration > 0 ? Math.min(1, position / duration) : 0;
4197
6052
  const lines = snap && snap.data && snap.data.synced ? snap.data.lines : null;
4198
6053
  let activeIdx = -1;
4199
6054
  if (lines) {
@@ -4210,26 +6065,33 @@ window.__ModuleLoader__.load({
4210
6065
  }
4211
6066
  const style = pos ? { left: pos.left, top: pos.top, right: 'auto', bottom: 'auto' } : undefined;
4212
6067
  const activeLine = activeIdx >= 0 && lines && lines[activeIdx] ? (lines[activeIdx].text || '♪') : '';
6068
+ /* .dshm-mini-main 用 <div> 容器,歌名与歌手各自是独立原生 <button>,彻底消除按钮嵌套 */
6069
+ const openArtist = (e) => { e.stopPropagation(); openArtistPage(track.artist || ''); };
4213
6070
  const artistBtn = h('button', {
4214
6071
  type: 'button', className: 'dshm-mini-artist',
4215
6072
  title: t('artistOpen'), 'aria-label': t('artistOpen'),
4216
- onClick: (e) => { e.stopPropagation(); openArtistPage(track.artist || ''); },
6073
+ onClick: openArtist,
4217
6074
  },
4218
6075
  track.artist
4219
6076
  ? h(ArtistAvatar, { name: track.artist, size: 14, service: artistImages, useArtistImages })
4220
6077
  : null,
4221
6078
  h('span', { className: 'dshm-ellipsis' }, error ? t('playError') : (track.artist || t('unknownArtist'))));
6079
+ const modeHintShort = String(mode.hint || '').replace(
6080
+ new RegExp('^' + String(mode.label || '').replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + '[::]\\s*'),
6081
+ '',
6082
+ );
6083
+ const menuDown = !!(menuOpen && boxRef.current && boxRef.current.getBoundingClientRect && boxRef.current.getBoundingClientRect().top < 180);
4222
6084
 
4223
6085
  return portalToBody(h('div', {
4224
6086
  ref: boxRef, style,
4225
6087
  className: cx('dshm-mini', dragging && 'dshm-mini-dragging'),
4226
6088
  role: 'region', 'aria-label': t('miniLabel'),
6089
+ onPointerDown: barDown, onPointerMove: barMove,
6090
+ onPointerUp: barUp, onPointerCancel: (e) => barUp(e, true),
4227
6091
  },
4228
6092
  h('div', {
4229
6093
  className: 'dshm-mini-grip', role: 'button', tabIndex: 0,
4230
6094
  title: t('miniDrag'), 'aria-label': t('miniDrag'),
4231
- onPointerDown: gripDown, onPointerMove: gripMove,
4232
- onPointerUp: gripUp, onPointerCancel: gripUp,
4233
6095
  onKeyDown: (e) => {
4234
6096
  const step = 12;
4235
6097
  const cur = posRef.current || (boxRef.current ? { left: boxRef.current.getBoundingClientRect().left, top: boxRef.current.getBoundingClientRect().top } : { left: 0, top: 0 });
@@ -4243,14 +6105,20 @@ window.__ModuleLoader__.load({
4243
6105
  },
4244
6106
  }, h(IconGrip, { size: 14 })),
4245
6107
  h('div', { className: 'dshm-mini-inner' },
4246
- h('button', {
4247
- type: 'button', className: 'dshm-mini-main',
4248
- onClick: openNow, title: t('openNow'), 'aria-label': t('openNow'),
6108
+ h('div', {
6109
+ className: 'dshm-mini-main',
6110
+ onClick: openNow, title: t('openNow'),
4249
6111
  },
4250
6112
  h(Cover, { track, size: 36 }),
4251
6113
  h('span', { className: 'dshm-mini-text' },
4252
- h('span', { className: 'dshm-mini-title dshm-ellipsis' }, track.title),
6114
+ h('button', {
6115
+ type: 'button', className: 'dshm-mini-titlebtn dshm-mini-title dshm-ellipsis',
6116
+ onClick: (e) => { e.stopPropagation(); openNow(); },
6117
+ title: t('openNow'), 'aria-label': t('openNow'),
6118
+ }, track.title),
4253
6119
  artistBtn)),
6120
+ /* 只留 4 个高频核心控制:上一首 / 播放暂停 / 下一首 / ♥。
6121
+ * 播放模式、收起、隐藏这些低频「窗口与设定」动作收进 ··· 菜单,歌名区从 93px 回到 200px+。 */
4254
6122
  h('div', { className: 'dshm-mini-controls' },
4255
6123
  h(IconButton, { label: t('prev'), onClick: () => player.prev() }, h(IconPrev, { size: 15 })),
4256
6124
  h(IconButton, {
@@ -4258,16 +6126,27 @@ window.__ModuleLoader__.load({
4258
6126
  onClick: () => player.toggle(),
4259
6127
  }, h(playing ? IconPause : IconPlay, { size: 16 })),
4260
6128
  h(IconButton, { label: t('next'), onClick: () => player.next() }, h(IconNext, { size: 15 })),
4261
- h(IconButton, {
4262
- label: mode.label, title: mode.hint + ' · ' + t('modeCycleHint'),
4263
- className: cx((shuffle || repeat === 'one') && 'dshm-iconbtn-active'),
4264
- onClick: () => player.cycleMode(),
4265
- }, h(mode.icon, { size: 15 })),
4266
- h(IconButton, {
4267
- label: t('miniCollapse'), title: t('miniCollapse'),
4268
- onClick: () => setMiniCollapsed(true),
4269
- }, h(IconChevronDown, { size: 15 })),
4270
- h(IconButton, { label: t('hideMini'), title: t('hideMini'), onClick: () => setMiniHidden(true) }, h(IconClose, { size: 13 })))),
6129
+ /* ♥:与曲库行、正在播放页同一套语义(喜欢才入库)。👎 不再挤在迷你条里 —— 它在推荐页 / 正在播放页都有,且离「下一首」太近容易误触。 */
6130
+ likes ? h(LikeButton, { t, item: track, likes, useLikes, size: 14, className: 'dshm-mini-like' }) : null,
6131
+ h('div', { className: 'dshm-mini-more', ref: menuRef },
6132
+ h(IconButton, {
6133
+ label: t('miniMore'), title: t('miniMore'), className: 'dshm-mini-morebtn',
6134
+ 'aria-haspopup': 'menu', 'aria-expanded': menuOpen,
6135
+ onClick: () => setMenuOpen((v) => !v),
6136
+ }, h(IconMore, { size: 15 })),
6137
+ menuOpen ? h('div', { className: cx('dshm-mini-menu', menuDown && 'dshm-mini-menu-down'), role: 'menu', 'aria-label': t('miniMore') },
6138
+ h('button', {
6139
+ type: 'button', role: 'menuitem', className: 'dshm-mini-menuitem',
6140
+ onClick: () => { setMenuOpen(false); player.cycleMode(); },
6141
+ }, h(mode.icon, { size: 14 }), h('span', null, mode.label), modeHintShort ? h('span', { className: 'dshm-count' }, modeHintShort) : null),
6142
+ h('button', {
6143
+ type: 'button', role: 'menuitem', className: 'dshm-mini-menuitem',
6144
+ onClick: () => { setMenuOpen(false); collapseToFab(); setMiniCollapsed(true); },
6145
+ }, h(IconChevronDown, { size: 14 }), h('span', null, t('miniCollapse'))),
6146
+ h('button', {
6147
+ type: 'button', role: 'menuitem', className: 'dshm-mini-menuitem',
6148
+ onClick: () => { setMenuOpen(false); setMiniHidden(true); },
6149
+ }, h(IconClose, { size: 13 }), h('span', null, t('hideMini')))) : null))),
4271
6150
  h('div', { className: 'dshm-mini-seek' },
4272
6151
  h(Slider, {
4273
6152
  value: frac, label: t('seekLabel'), disabled: !(duration > 0),
@@ -4283,6 +6162,87 @@ window.__ModuleLoader__.load({
4283
6162
  : null));
4284
6163
  }
4285
6164
 
6165
+ /* ================================================================
6166
+ * 14b. Download status float (shell.overlay — persistent, bottom-left)
6167
+ * 入库/下载进度悬浮面板:运行中自动弹出;结束后可收成胶囊或关闭;
6168
+ * 每行可播放已入库曲目;「打开曲库」跳回曲库。
6169
+ * ================================================================ */
6170
+ function DownloadFloat({ t, download, library, player, ui, useUi, useDownload, openLibrary }) {
6171
+ const s = useDownload((st) => st);
6172
+ const panel = useUi((st) => st.downloadFloat);
6173
+ const miniRect = useUi((st) => st.miniRect);
6174
+ /* 固定右下角;迷你播放条(或圆标)也在右侧时叠到它上方,两者互不遮挡 */
6175
+ const floatStyle = (() => {
6176
+ if (typeof window === 'undefined') return undefined;
6177
+ const width = Math.min(340, window.innerWidth - 32);
6178
+ const floatLeft = window.innerWidth - 16 - width;
6179
+ const overlapsX = !!miniRect && miniRect.left < window.innerWidth - 16 && (miniRect.left + miniRect.w) > floatLeft;
6180
+ return overlapsX ? { bottom: Math.max(16, window.innerHeight - miniRect.top + 12) + 'px' } : undefined;
6181
+ })();
6182
+ const running = !!s.running;
6183
+ useEffect(() => {
6184
+ if (running && !panel) ui.set({ downloadFloat: 'open' });
6185
+ return undefined;
6186
+ }, [running, panel]);
6187
+ if (!panel) return null;
6188
+ if (!running && s.items.length === 0 && !s.error) return null;
6189
+ const total = s.total || s.items.length;
6190
+ const done = s.done || s.items.filter((it) => it.status !== 'pending' && it.status !== 'downloading').length;
6191
+ const okN = s.items.filter((it) => it.status === 'ok' || it.status === 'skip').length;
6192
+ const failN = s.items.filter((it) => it.status === 'fail').length;
6193
+ const pct = total ? Math.min(100, Math.round((done / total) * 100)) : 0;
6194
+ const tracks = library && library.source ? (library.source.getSnapshot().tracks || []) : [];
6195
+ const playOne = (it) => {
6196
+ const tr = tracks.find((x) => x.id === it.trackId);
6197
+ if (tr && player) player.playTracks([tr], 0);
6198
+ };
6199
+ const close = () => ui.set({ downloadFloat: null });
6200
+ const statusText = (st) => (st === 'ok' ? t('downloadDone')
6201
+ : st === 'skip' ? t('downloadSkip')
6202
+ : st === 'fail' ? t('downloadFail')
6203
+ : st === 'downloading' ? t('downloading') : t('downloadQueued'));
6204
+ if (panel === 'collapsed') {
6205
+ return portalToBody(h('button', {
6206
+ type: 'button', className: 'dshm-dl-pill', style: floatStyle, title: t('downloadExpand'), 'aria-label': t('downloadTitle'),
6207
+ onClick: () => ui.set({ downloadFloat: 'open' }),
6208
+ },
6209
+ running ? h(IconRefresh, { size: 13, className: 'dshm-spin' }) : h(IconDownload, { size: 13 }),
6210
+ h('span', { className: 'dshm-ellipsis' }, running
6211
+ ? fmt(t('downloadPillRunning'), { done, total })
6212
+ : (failN ? fmt(t('downloadPillDoneFail'), { ok: okN, fail: failN }) : fmt(t('downloadPillDone'), { ok: okN }))),
6213
+ h('span', { className: 'dshm-dl-pill-bar', 'aria-hidden': true }, h('span', { style: { width: pct + '%' } }))));
6214
+ }
6215
+ return portalToBody(h('div', { className: 'dshm-dl-float', style: floatStyle, role: 'region', 'aria-label': t('downloadTitle') },
6216
+ h('div', { className: 'dshm-dl-head' },
6217
+ h(IconDownload, { size: 14 }),
6218
+ h('span', { className: 'dshm-dl-title' }, t('downloadTitle')),
6219
+ h('span', { className: 'dshm-count' }, running ? done + ' / ' + total : t('downloadFinished')),
6220
+ h('span', { style: { marginLeft: 'auto' } }),
6221
+ h(IconButton, { label: t('downloadCollapse'), onClick: () => ui.set({ downloadFloat: 'collapsed' }) }, h(IconChevronDown, { size: 14 })),
6222
+ h(IconButton, { label: t('downloadClose'), onClick: close }, h(IconClose, { size: 14 }))),
6223
+ h('div', { className: 'dshm-dl-bar', 'aria-hidden': true }, h('div', { style: { width: pct + '%' } })),
6224
+ s.error
6225
+ ? h('div', { className: 'dshm-errorline', role: 'alert' }, h(IconAlert, { size: 14 }), t('downloadError') + ':' + s.error)
6226
+ : null,
6227
+ h('div', { className: 'dshm-dl-list' },
6228
+ s.items.map((it, i) => h('div', { className: 'dshm-dl-row', key: i, title: it.note || '' },
6229
+ h('span', { className: cx('dshm-dl-dot', (it.status === 'ok' || it.status === 'skip') && 'dshm-dl-ok', it.status === 'fail' && 'dshm-dl-fail', (it.status === 'pending' || it.status === 'downloading') && 'dshm-dl-wait') }),
6230
+ h('span', { className: 'dshm-ellipsis', style: { flex: 1 } }, (it.artist || '') + ' - ' + (it.title || '')),
6231
+ it.note && it.status !== 'ok' && it.status !== 'skip'
6232
+ ? h('span', { className: 'dshm-dl-note dshm-ellipsis', title: it.note }, it.note)
6233
+ : null,
6234
+ h('span', { className: 'dshm-dl-status' }, statusText(it.status)),
6235
+ (it.status === 'ok' || it.status === 'skip') && it.trackId && !running
6236
+ ? h(IconButton, { label: t('downloadPlayOne'), onClick: () => playOne(it) }, h(IconPlay, { size: 12 }))
6237
+ : null))),
6238
+ !running
6239
+ ? h('div', { className: 'dshm-dl-foot' },
6240
+ h('span', { className: cx('dshm-dl-sum', failN ? 'dshm-dl-sum-warn' : 'dshm-dl-sum-ok') },
6241
+ failN ? fmt(t('downloadSummary'), { ok: okN, fail: failN }) : fmt(t('downloadSummaryAll'), { ok: okN })),
6242
+ h('button', { className: 'dshm-chipbtn', type: 'button', onClick: () => { close(); openLibrary(); } }, t('downloadOpenLibrary')))
6243
+ : null));
6244
+ }
6245
+
4286
6246
  /* ================================================================
4287
6247
  * 15. Plugin body
4288
6248
  * ================================================================ */
@@ -4307,17 +6267,21 @@ window.__ModuleLoader__.load({
4307
6267
  const previewService = createPreviewService(api);
4308
6268
  const warmService = createWarmService(previewService, player);
4309
6269
  const likesService = createLikesService(api, () => downloadService.warm());
6270
+ /* 喜欢列表导入(网易云 / QQ 音乐):导入完成后刷新 ♥ 列表 */
6271
+ const likedSyncService = createLikedSyncService(api, () => likesService.load());
4310
6272
  ctx.effect(() => () => {
4311
6273
  downloadService.dispose();
4312
6274
  syncService.dispose();
4313
6275
  previewService.dispose();
6276
+ likedSyncService.dispose();
4314
6277
  }, 'dsh-music: s3 poll timers');
6278
+ likedSyncService.load();
4315
6279
  downloadService.warm();
4316
6280
  syncService.warm();
4317
- /* First run: open the welcome flow only when the host explicitly says the
6281
+ /* First run: open the settings page only when the host explicitly says the
4318
6282
  * flow is not completed (a missing endpoint must never interrupt users). */
4319
6283
  onboardingService.load().then((data) => {
4320
- if (data && data.completed === false) ui.set({ view: 'welcome' });
6284
+ if (data && data.completed === false) ui.set({ view: 'settings', settingsSection: null });
4321
6285
  });
4322
6286
  ctx.effect(() => () => onboardingService.dispose(), 'dsh-music: onboarding timer');
4323
6287
  /* v6 mini-window semantics changed: close now means "hidden until shown".
@@ -4331,10 +6295,42 @@ window.__ModuleLoader__.load({
4331
6295
  miniHidden: miniPrefsOk ? !!savedPrefs.miniHidden : false,
4332
6296
  miniCollapsed: miniPrefsOk ? !!savedPrefs.miniCollapsed : false,
4333
6297
  artistName: null,
4334
- welcomePreview: false,
6298
+ settingsSection: null,
6299
+ libTabWish: null,
6300
+ downloadFloat: null,
6301
+ miniRect: null,
6302
+ /* 导航历史栈:返回 = 回到刚才的地方(不再写死「返回推荐」/「返回曲库」) */
6303
+ navStack: [],
4335
6304
  });
4336
- const openView = (view) => ui.set({ view });
4337
- const openArtistPage = (name) => ui.set({ view: 'artist', artistName: name });
6305
+ /* 主视图切换:栈里只记「能回到的」视图(带歌手名),上限 20 */
6306
+ const openView = (view, extra) => {
6307
+ const cur = ui.getSnapshot();
6308
+ const prev = cur.view === 'settings' || cur.view === 'artist' || cur.view === 'now' || cur.view === 'reco' || cur.view === 'library' || cur.view === 'history'
6309
+ ? cur.view : null;
6310
+ const stack = prev && prev !== view ? [...(cur.navStack || []), { view: prev, artistName: cur.artistName || null }].slice(-20) : (cur.navStack || []);
6311
+ ui.set({ view, navStack: stack, ...(extra || {}) });
6312
+ };
6313
+ const openArtistPage = (name) => {
6314
+ const cur = ui.getSnapshot();
6315
+ const from = { view: cur.view, artistName: cur.artistName || null };
6316
+ const stack = [...(cur.navStack || []), from].slice(-20);
6317
+ ui.set({ view: 'artist', artistName: name, navStack: stack });
6318
+ };
6319
+ /* 回退一步:没有历史就回曲库 */
6320
+ const goBack = () => {
6321
+ const cur = ui.getSnapshot();
6322
+ const stack = cur.navStack || [];
6323
+ const top = stack[stack.length - 1];
6324
+ ui.set(top
6325
+ ? { view: top.view, artistName: top.artistName, settingsSection: null, navStack: stack.slice(0, -1) }
6326
+ : { view: 'library', settingsSection: null, navStack: [] });
6327
+ };
6328
+ const backLabel = (t) => {
6329
+ const cur = ui.getSnapshot();
6330
+ const top = (cur.navStack || [])[(cur.navStack || []).length - 1];
6331
+ const names = { library: t('tabLibrary'), reco: t('tabReco'), now: t('tabNow'), history: t('tabHistory'), artist: (top && top.artistName) || t('artistPageTitle'), settings: t('settingsTitle') };
6332
+ return top ? fmt(t('backTo'), { target: names[top.view] || names.library }) : fmt(t('backTo'), { target: names.library });
6333
+ };
4338
6334
  const setMiniHidden = (hidden) => {
4339
6335
  /* Showing the mini player always restores the full bar (fab -> bar). */
4340
6336
  ui.set(hidden ? { miniHidden: true } : { miniHidden: false, miniCollapsed: false });
@@ -4373,15 +6369,15 @@ window.__ModuleLoader__.load({
4373
6369
  inject: () => ({
4374
6370
  player, library, lyrics: lyricsService, artist: artistService, artistImages: artistImageService, onboarding: onboardingService,
4375
6371
  reco: recoService, download: downloadService, sync: syncService, history: historyService,
4376
- likes: likesService, preview: previewService, warm: warmService,
4377
- openView, openArtistPage, setMiniHidden, ui, artistPage: artistPageService,
6372
+ likes: likesService, preview: previewService, warm: warmService, likedSync: likedSyncService,
6373
+ openView, openArtistPage, goBack, backLabel, setMiniHidden, ui, artistPage: artistPageService,
4378
6374
  hooks: {
4379
6375
  player: player.source, library: library.source, ui,
4380
6376
  lyrics: lyricsService.source, artist: artistService.source, artistPage: artistPageService.source, artistImages: artistImageService.source, onboarding: onboardingService.source,
4381
6377
  reco: recoService.source, download: downloadService.source,
4382
6378
  sync: syncService.source, history: historyService.source,
4383
6379
  likes: likesService.source, preview: previewService.source,
4384
- warm: warmService.source,
6380
+ warm: warmService.source, likedSync: likedSyncService.source,
4385
6381
  },
4386
6382
  }),
4387
6383
  }, MusicPanel)), 'dsh-music: main panel');
@@ -4392,13 +6388,26 @@ window.__ModuleLoader__.load({
4392
6388
  id: 'dsh-music.mini-player',
4393
6389
  locale: NS,
4394
6390
  inject: () => ({
4395
- player, lyrics: lyricsService, artistImages: artistImageService, setMiniHidden, setMiniCollapsed,
6391
+ player, lyrics: lyricsService, artistImages: artistImageService, likes: likesService, setMiniHidden, setMiniCollapsed, goBack, openView,
4396
6392
  openNow: () => { openView('now'); ctx.layout.selectPanel(PANEL_ID); },
4397
6393
  openArtistPage: (name) => { if (!name) return; openArtistPage(name); ctx.layout.selectPanel(PANEL_ID); },
4398
- hooks: { player: player.source, ui, lyrics: lyricsService.source, artistImages: artistImageService.source },
6394
+ publishRect: (rect) => ui.set({ miniRect: rect }),
6395
+ hooks: { player: player.source, ui, lyrics: lyricsService.source, artistImages: artistImageService.source, likes: likesService.source },
4399
6396
  }),
4400
6397
  }, MiniPlayer)), 'dsh-music: mini player');
4401
6398
 
6399
+ // Persistent download/add-to-library status float (bottom-right, stacked above the mini bar), above every column.
6400
+ ctx.effect(() => ctx.slots.inject('shell.overlay', () => ctx.slots.register({
6401
+ name: 'shell.overlay',
6402
+ id: 'dsh-music.download-float',
6403
+ locale: NS,
6404
+ inject: () => ({
6405
+ download: downloadService, library, player, ui,
6406
+ openLibrary: () => openView('library'),
6407
+ hooks: { download: downloadService.source, library: library.source, ui },
6408
+ }),
6409
+ }, DownloadFloat)), 'dsh-music: download float');
6410
+
4402
6411
  // Warm the library so the panel opens populated; errors surface in-view.
4403
6412
  library.load();
4404
6413
  }