@w-run/wdesign-ui 0.0.0-stage → 1.0.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.
Files changed (70) hide show
  1. package/README.md +174 -2
  2. package/dist/index.d.ts +83 -0
  3. package/dist/style/ai-msg.css +187 -0
  4. package/dist/style/alert.css +64 -0
  5. package/dist/style/audio.css +1363 -0
  6. package/dist/style/avatar.css +88 -0
  7. package/dist/style/badge.css +48 -0
  8. package/dist/style/breadcrumb.css +54 -0
  9. package/dist/style/button.css +234 -0
  10. package/dist/style/card.css +71 -0
  11. package/dist/style/carousel.css +101 -0
  12. package/dist/style/checkbox.css +129 -0
  13. package/dist/style/chevron.css +33 -0
  14. package/dist/style/collapse.css +69 -0
  15. package/dist/style/command.css +201 -0
  16. package/dist/style/container.css +7 -0
  17. package/dist/style/datepicker.css +205 -0
  18. package/dist/style/descriptions.css +119 -0
  19. package/dist/style/divider.css +62 -0
  20. package/dist/style/dot.css +30 -0
  21. package/dist/style/drawer.css +145 -0
  22. package/dist/style/dropdown.css +83 -0
  23. package/dist/style/empty.css +36 -0
  24. package/dist/style/explorer.css +336 -0
  25. package/dist/style/file-list.css +92 -0
  26. package/dist/style/form.css +96 -0
  27. package/dist/style/grid.css +4 -0
  28. package/dist/style/group.css +478 -0
  29. package/dist/style/icon-btn.css +75 -0
  30. package/dist/style/image-preview.css +81 -0
  31. package/dist/style/input.css +119 -0
  32. package/dist/style/list.css +81 -0
  33. package/dist/style/markdown.css +312 -0
  34. package/dist/style/modal.css +164 -0
  35. package/dist/style/notification.css +52 -0
  36. package/dist/style/otp.css +139 -0
  37. package/dist/style/pagination.css +120 -0
  38. package/dist/style/popconfirm.css +87 -0
  39. package/dist/style/popover.css +110 -0
  40. package/dist/style/post-item.css +134 -0
  41. package/dist/style/progress.css +34 -0
  42. package/dist/style/radio.css +126 -0
  43. package/dist/style/rate.css +44 -0
  44. package/dist/style/result.css +54 -0
  45. package/dist/style/segmented-picker.css +120 -0
  46. package/dist/style/segmented.css +190 -0
  47. package/dist/style/select.css +281 -0
  48. package/dist/style/skeleton.css +31 -0
  49. package/dist/style/slider.css +81 -0
  50. package/dist/style/sortable.css +128 -0
  51. package/dist/style/space.css +25 -0
  52. package/dist/style/spinner.css +27 -0
  53. package/dist/style/statistic.css +44 -0
  54. package/dist/style/steps.css +100 -0
  55. package/dist/style/switch.css +95 -0
  56. package/dist/style/table.css +379 -0
  57. package/dist/style/tabs.css +167 -0
  58. package/dist/style/tag.css +97 -0
  59. package/dist/style/timeline.css +521 -0
  60. package/dist/style/toast.css +37 -0
  61. package/dist/style/tooltip.css +45 -0
  62. package/dist/style/tree.css +189 -0
  63. package/dist/style/typography.css +66 -0
  64. package/dist/style/upload.css +169 -0
  65. package/dist/style/vlist.css +49 -0
  66. package/dist/style/vplayer.css +846 -0
  67. package/dist/wdesign-ui.css +10300 -0
  68. package/dist/wdesign-ui.esm.js +16333 -0
  69. package/package.json +47 -3
  70. package/tokens.json +385 -0
@@ -0,0 +1,1363 @@
1
+ @charset "UTF-8";
2
+ .wd-audio {
3
+ /*
4
+ * accent 是"强调色",浅色卡片上应该是**深色**(ink),不是白色。
5
+ *
6
+ * ⚠️ 之前默认 --wd-card(白色):那是给反色深卡片用的,
7
+ * 浅底上直接等同于背景色 —— 细进度条的已播放部分因此完全看不见。
8
+ * 反色卡片会在 .wd-audio--inverse 里单独覆盖成白色。
9
+ */
10
+ --wd-audio-accent: var(--wd-ink);
11
+ position: relative;
12
+ color: var(--wd-ink);
13
+ user-select: none;
14
+ font-size: 13px;
15
+ }
16
+
17
+ /* =============================================================
18
+ * card —— 竖版卡片
19
+ * ============================================================= */
20
+ /*
21
+ * card —— 遵循本设计系统的「无边框」语言:
22
+ * 白底 + 大圆角 + 单层浅阴影 + 足够留白,不用任何 border。
23
+ *
24
+ * ⚠️ 之前我在这里加了 inset 1px 描边,与本库「无边框风」冲突。
25
+ * 整个组件的层次只靠阴影和留白建立(同 .wd-card 的做法)。
26
+ *
27
+ * 间距设计(原来 18/20 挤在一起,缺少呼吸感):
28
+ * 上下 20 / 左右 22 —— 与 .wd-card 的 22px 内距对齐
29
+ * 内部区块间距 16px —— 比 14 更松,让波形/时间/控件各自成组
30
+ */
31
+ .wd-audio--card {
32
+ display: flex;
33
+ flex-direction: column;
34
+ width: 100%;
35
+ box-sizing: border-box;
36
+ /* 元素本身放大了,垂直间距相应收缩 —— 否则整卡被撑高、读起来散 */
37
+ gap: 14px;
38
+ /*
39
+ * 内距:卡片是「留白型」组件,四周必须给足。
40
+ *
41
+ * 演进过程:18/20 → 24/26 → 32/34 → **36/40**。
42
+ * 卡片宽度同时收到 380px,内宽 300px —— 内距占卡宽 10.5%,
43
+ * 元素明显被"边框往里推",不再是贴着边漂浮。
44
+ * 底部 34 略小于顶部 36:视觉重心稍上移,与标题居中的光学习惯一致。
45
+ */
46
+ padding: 36px 40px 34px;
47
+ border-radius: var(--wd-radius-xl);
48
+ background: var(--wd-card);
49
+ box-shadow: var(--wd-shadow);
50
+ container-type: inline-size;
51
+ container-name: wd-audio;
52
+ }
53
+
54
+ /*
55
+ * 反色卡片:整卡用深色(不是大红大绿)。
56
+ *
57
+ * ⚠️ 之前的 accent 直接把传入色铺满整卡 —— 传个 #1db954 就是一大片绿,
58
+ * 非常刺眼,且与组件的红色主色系统打架。
59
+ *
60
+ * 改为**反色**方案:底色用 --wd-dark(深灰黑),文字反白,
61
+ * 强调色只用在「进度、播放键」这些真正需要强调的点上。
62
+ * 这样既能做出深色卡片的质感,又不会变成一块色板。
63
+ */
64
+ .wd-audio--card.wd-audio--inverse {
65
+ background: var(--wd-dark);
66
+ color: var(--wd-dark-text);
67
+ /* 深色卡片同样只用阴影,不加描边 */
68
+ box-shadow: var(--wd-shadow-lg);
69
+ }
70
+
71
+ .wd-audio--inverse .wd-audio__subtitle {
72
+ color: var(--wd-on-dark);
73
+ }
74
+
75
+ .wd-audio--inverse .wd-audio__times {
76
+ color: var(--wd-on-dark-2);
77
+ }
78
+
79
+ .wd-audio--inverse .wd-audio__remain {
80
+ color: var(--wd-on-dark);
81
+ }
82
+
83
+ .wd-audio--inverse .wd-audio__ctl {
84
+ color: var(--wd-on-dark-2);
85
+ }
86
+
87
+ .wd-audio--inverse .wd-audio__ctl:hover {
88
+ background: rgba(255, 255, 255, 0.12);
89
+ color: #fff;
90
+ }
91
+
92
+ /*
93
+ * 反色卡片是**固定深色面**,不跟随主题翻转。
94
+ * ⚠️ 不能用 --wd-red-on-dark —— 它在深色主题下会变成浅粉,
95
+ * 在深底上既不够亮也失去"品牌红"的意味。
96
+ * 这里直接用一个固定的亮红:深底上足够醒目,浅深主题下表现一致。
97
+ */
98
+ .wd-audio--inverse .wd-audio__wave-bar {
99
+ background: rgba(255, 255, 255, 0.3);
100
+ }
101
+
102
+ .wd-audio--inverse .wd-audio__wave-bar.is-on {
103
+ background: #FF5A65;
104
+ }
105
+
106
+ .wd-audio--inverse .wd-audio__main-btn {
107
+ background: var(--wd-dark-text);
108
+ color: var(--wd-dark);
109
+ box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
110
+ }
111
+
112
+ .wd-audio--inverse .wd-audio__hero-cover {
113
+ background: rgba(255, 255, 255, 0.06);
114
+ }
115
+
116
+ .wd-audio--inverse .wd-audio__rate-menu--card {
117
+ background: var(--wd-dark);
118
+ box-shadow: var(--wd-shadow-lg);
119
+ color: var(--wd-dark-text);
120
+ }
121
+
122
+ .wd-audio--inverse .wd-audio__rate-menu--card button {
123
+ color: var(--wd-on-dark-2);
124
+ }
125
+
126
+ @media (hover: hover) {
127
+ .wd-audio--inverse .wd-audio__rate-menu--card button:hover {
128
+ background: rgba(255, 255, 255, 0.1);
129
+ }
130
+ }
131
+ .wd-audio--inverse .wd-audio__rate-menu--card button.is-on {
132
+ background: var(--wd-dark-text);
133
+ color: var(--wd-dark);
134
+ }
135
+
136
+ /*
137
+ * 主题色底上的次级文字。
138
+ * .78 在 #1db954 这类中亮绿上对比不足,提到 .88;
139
+ * 倒计时更弱一档但仍需可读。
140
+ */
141
+ /*
142
+ * 主题色底上的次级文本必须接近纯白 ——
143
+ * .78 / .88 在中亮绿(#1db954)上对比都不够,实测读起来发灰。
144
+ * 用 .92 起步,只有倒计时保留 .72 做层级区分。
145
+ */
146
+ .wd-audio--accent .wd-audio__subtitle,
147
+ .wd-audio--accent .wd-audio__ctl {
148
+ color: rgba(255, 255, 255, 0.92);
149
+ }
150
+
151
+ .wd-audio--accent .wd-audio__title {
152
+ color: #fff;
153
+ }
154
+
155
+ .wd-audio--accent .wd-audio__times {
156
+ color: rgba(255, 255, 255, 0.82);
157
+ }
158
+
159
+ .wd-audio--accent .wd-audio__remain {
160
+ color: rgba(255, 255, 255, 0.68);
161
+ }
162
+
163
+ .wd-audio--accent .wd-audio__wave-bar {
164
+ background: rgba(255, 255, 255, 0.45);
165
+ }
166
+
167
+ .wd-audio--accent .wd-audio__wave-bar.is-on {
168
+ background: #fff;
169
+ }
170
+
171
+ .wd-audio--accent .wd-audio__main-btn {
172
+ background: rgba(255, 255, 255, 0.18);
173
+ color: #fff;
174
+ }
175
+
176
+ /*
177
+ * 有封面时:封面 + 标题区横向排列。
178
+ * 用一个 wrapper 包住,避免封面孤立在第一行。
179
+ */
180
+ .wd-audio--card.has-cover .wd-audio__top {
181
+ align-items: center;
182
+ }
183
+
184
+ /* ---------------- 顶部标题区 ---------------- */
185
+ .wd-audio__top {
186
+ display: flex;
187
+ align-items: flex-start;
188
+ gap: 10px;
189
+ }
190
+
191
+ .wd-audio__head {
192
+ flex: 1;
193
+ min-width: 0;
194
+ display: flex;
195
+ flex-direction: column;
196
+ gap: 3px;
197
+ }
198
+
199
+ .wd-audio--card .wd-audio__title {
200
+ font-size: 19px;
201
+ font-weight: 800;
202
+ letter-spacing: -0.01em;
203
+ line-height: 1.3;
204
+ overflow: hidden;
205
+ text-overflow: ellipsis;
206
+ white-space: nowrap;
207
+ }
208
+
209
+ .wd-audio--card .wd-audio__subtitle {
210
+ font-size: 13px;
211
+ color: var(--wd-ink-2);
212
+ overflow: hidden;
213
+ text-overflow: ellipsis;
214
+ white-space: nowrap;
215
+ }
216
+
217
+ .wd-audio__top-extra {
218
+ flex: none;
219
+ display: flex;
220
+ align-items: center;
221
+ gap: 4px;
222
+ }
223
+
224
+ /* ---------------- 主体:封面 ---------------- */
225
+ /*
226
+ * 有封面时:横向排布(封面在左,标题在右)。
227
+ *
228
+ * ⚠️ 不能用移动端那种 1:1 大正方形 —— web 里卡片宽度由父容器决定,
229
+ * 在宽屏上会撑出一个占满半屏的巨大方块,把页面撑得极高。
230
+ * 横向排布在任何宽度下都稳定。
231
+ */
232
+ .wd-audio__hero-cover {
233
+ position: relative;
234
+ flex: none;
235
+ width: 88px;
236
+ height: 88px;
237
+ border-radius: var(--wd-radius-md);
238
+ overflow: hidden;
239
+ background: var(--wd-field);
240
+ }
241
+
242
+ /* 窄容器(< 300px)时缩到 64px,避免挤压文字 */
243
+ @container wd-audio (max-width: 300px) {
244
+ .wd-audio__hero-cover {
245
+ width: 64px;
246
+ height: 64px;
247
+ }
248
+ }
249
+ .wd-audio__hero-cover img {
250
+ width: 100%;
251
+ height: 100%;
252
+ object-fit: cover;
253
+ display: block;
254
+ }
255
+
256
+ /* 播放中角标:三根跳动条 */
257
+ .wd-audio__hero-badge {
258
+ position: absolute;
259
+ right: 10px;
260
+ bottom: 10px;
261
+ display: flex;
262
+ align-items: flex-end;
263
+ gap: 2px;
264
+ padding: 5px 7px;
265
+ border-radius: 999px;
266
+ background: rgba(0, 0, 0, 0.45);
267
+ backdrop-filter: blur(6px);
268
+ }
269
+
270
+ .wd-audio__hero-badge i {
271
+ width: 2.5px;
272
+ border-radius: 1px;
273
+ background: #fff;
274
+ animation: wd-audio-eq 0.9s ease-in-out infinite;
275
+ }
276
+
277
+ .wd-audio__hero-badge i:nth-child(1) {
278
+ height: 8px;
279
+ animation-delay: -0.15s;
280
+ }
281
+
282
+ .wd-audio__hero-badge i:nth-child(2) {
283
+ height: 13px;
284
+ animation-delay: -0.45s;
285
+ }
286
+
287
+ .wd-audio__hero-badge i:nth-child(3) {
288
+ height: 10px;
289
+ animation-delay: -0.3s;
290
+ }
291
+
292
+ @keyframes wd-audio-eq {
293
+ 0%, 100% {
294
+ transform: scaleY(0.4);
295
+ }
296
+ 50% {
297
+ transform: scaleY(1);
298
+ }
299
+ }
300
+ /* ---------------- 波形 ---------------- */
301
+ /*
302
+ * 波形:**以中线上下对称**。
303
+ *
304
+ * ⚠️ 参考图里柱子是从中线向上下两端生长,不是我原来那样从底部长起。
305
+ * 底部生长看起来像柱状图,对称生长才像"音频波形"。
306
+ *
307
+ * 柱子用固定宽度(不 flex 撑开)—— flex:1 会让柱宽随容器变化,
308
+ * 宽屏上变成一片粗棒,窄屏上又细如针,与参考的等宽细柱不符。
309
+ */
310
+ /*
311
+ * 波形容器。
312
+ *
313
+ * ⚠️ 柱数和间距现在都由 JS 按容器宽度算好(见 WdAudioPlayer 的 waveCount),
314
+ * 这里用 `justify-content: space-between` + 固定柱宽,
315
+ * 让柱子在容器内**均匀铺满**,而不是靠 gap 固定值。
316
+ *
317
+ * 原因:写死 gap 时,容器变宽只会让间距越拉越大;
318
+ * 改成 space-between 后,柱数变多、间距恒定,密度才是稳定的。
319
+ */
320
+ .wd-audio__wave {
321
+ display: flex;
322
+ align-items: center;
323
+ justify-content: space-between;
324
+ gap: 0;
325
+ cursor: pointer;
326
+ outline: none;
327
+ /* 允许溢出隐藏:极端窄容器下柱子不撑破布局 */
328
+ overflow: hidden;
329
+ }
330
+
331
+ /*
332
+ * 主体形态(无封面):波形取代封面,高度必须够。
333
+ * 30 根粗柱,间距 3px —— 接近参考图绿色版的比例。
334
+ */
335
+ /*
336
+ * 波形是主体,但高度要跟着容器宽度走 ——
337
+ * 桌面宽卡里 92px 会显得过重,窄卡里 48px 又太薄。
338
+ * 容器查询让它在 48~84px 之间自适应。
339
+ */
340
+ .wd-audio__wave--hero {
341
+ height: 68px;
342
+ gap: 3px;
343
+ /*
344
+ * 左右各内缩 2px 做视觉补偿(上下保持 2px)。
345
+ *
346
+ * 波形是 `justify-content: space-between`,首末两根柱子紧贴容器边缘,
347
+ * 而上下两行是纯文本 —— 文本有字形侧边距(side bearing),视觉上不贴边。
348
+ * 柱状图是实心矩形,没有这层自然留白,几何对齐时**看起来更宽**。
349
+ *
350
+ * ⚠️ 曾试过 4px,在真机上偏窄(波形比标题内缩太多、显得缩进去)。
351
+ * 2px 刚好抵消 side bearing,与视觉边界齐平。
352
+ */
353
+ padding: 2px 2px;
354
+ justify-content: space-between;
355
+ }
356
+
357
+ @container wd-audio (max-width: 420px) {
358
+ .wd-audio__wave--hero {
359
+ height: 64px;
360
+ }
361
+ }
362
+ @container wd-audio (max-width: 320px) {
363
+ .wd-audio__wave--hero {
364
+ height: 52px;
365
+ gap: 2px;
366
+ }
367
+ }
368
+ /*
369
+ * 辅助形态(有封面):细密一条,高度收到 42px。
370
+ * 90 根,间距 1.5px,像白噪声一样铺满 —— 参考白色版。
371
+ */
372
+ .wd-audio__wave--fine {
373
+ height: 44px;
374
+ gap: 2px;
375
+ /* 与 --hero 用同一套视觉补偿:左右 2px。漏掉这里会导致带封面的卡片贴边。 */
376
+ padding: 0 2px;
377
+ justify-content: space-between;
378
+ }
379
+
380
+ @container wd-audio (max-width: 320px) {
381
+ .wd-audio__wave--fine {
382
+ height: 32px;
383
+ }
384
+ }
385
+ .wd-audio__wave:focus-visible {
386
+ box-shadow: 0 0 0 3px var(--wd-focus-ring-soft);
387
+ border-radius: 6px;
388
+ }
389
+
390
+ /*
391
+ * 柱子宽度:优先按容器自适应,但设上下限。
392
+ *
393
+ * 完全固定 2px 在窄卡里撑不满(波形只占 40% 宽,像被截断);
394
+ * 完全 flex:1 在宽卡里又变成粗棒。
395
+ * 折中:flex 分配 + min/max 夹住,2px 是下限、4px 是上限。
396
+ */
397
+ /*
398
+ * 柱子宽度:**由柱数决定**。
399
+ *
400
+ * ⚠️ 柱数现在由 JS 按容器宽度算(见 WdAudioPlayer 的 waveCount),
401
+ * 所以这里不需要 flex 分配宽度 —— 用固定宽度 + space-between,
402
+ * 柱数变多时自动变密,而不是「柱子变粗」或「间距被拉开」。
403
+ *
404
+ * 之前是 `flex: 1 1 auto` + min/max 夹住:
405
+ * 容器变宽时 30 根柱子只会被撑到 max-width(4px),
406
+ * 剩下的空间全变成间距 → 看起来像稀疏栅栏。
407
+ */
408
+ .wd-audio__wave-bar {
409
+ flex: 0 0 auto;
410
+ width: 3px;
411
+ border-radius: 1px;
412
+ /*
413
+ * 未播用中间调灰(约 78% 明度的灰),不是最浅的 ink-5 ——
414
+ * 参考图的未播段是清晰可见的浅灰,太浅会"消失",
415
+ * 整条波形就只剩左侧一截,看不出总长度。
416
+ */
417
+ background: var(--wd-ink-3);
418
+ transition: background var(--wd-dur-fast) ease;
419
+ /* 关键:柱子自中线向两端生长 —— 由 transform: scaleY 驱动,不用 height */
420
+ align-self: center;
421
+ }
422
+
423
+ /*
424
+ * 进度用明度区分,不用颜色 ——
425
+ * 主题红在波形上过重,会把「进度」变成「警告」。
426
+ */
427
+ .wd-audio__wave-bar.is-on {
428
+ background: var(--wd-ink);
429
+ }
430
+
431
+ .wd-audio__wave--hero .wd-audio__wave-bar {
432
+ border-radius: 2px;
433
+ }
434
+
435
+ .wd-audio__wave--fine .wd-audio__wave-bar {
436
+ border-radius: 1px;
437
+ }
438
+
439
+ /* ---------------- 时间 ---------------- */
440
+ .wd-audio__times {
441
+ display: flex;
442
+ justify-content: space-between;
443
+ align-items: center;
444
+ /* 参考图里时间字号明显大于常规说明文字,且加粗 */
445
+ font-size: 13px;
446
+ font-weight: 700;
447
+ font-variant-numeric: tabular-nums;
448
+ color: var(--wd-ink);
449
+ margin-top: 2px;
450
+ min-height: 18px;
451
+ }
452
+
453
+ /* 未加载时右侧不显示占位符(`-:--` 比空白更干扰) */
454
+ .wd-audio__remain:empty {
455
+ visibility: hidden;
456
+ }
457
+
458
+ .wd-audio__remain {
459
+ color: var(--wd-ink-2);
460
+ font-weight: 600;
461
+ }
462
+
463
+ /* ---------------- 控件行 ---------------- */
464
+ /*
465
+ * 控件行。
466
+ *
467
+ * ⚠️ 曾经溢出:5 个控件 34+34+56+34+34 = 192px,加 4×6px 间隔 = 216px,
468
+ * 而 251px 宽的卡片内宽只有 199px —— 溢出 17px。
469
+ * `space-between` 在溢出时首项贴左、末项冲出右边界,
470
+ * 表现为「整排控件偏右」(末位右留白 8.7px,本该 26px,和左侧不对称)。
471
+ *
472
+ * 修法:先让内容能装下 —— 46×4 + 64 = 248,内宽 300px 有余量。
473
+ * 保留 space-between:间隙按剩余空间均分 ——
474
+ * (300 - 248) / 4 = **13px**,控件紧凑不散。
475
+ */
476
+ .wd-audio__controls {
477
+ display: flex;
478
+ align-items: center;
479
+ justify-content: space-between;
480
+ gap: 4px;
481
+ margin-top: 2px;
482
+ }
483
+
484
+ .wd-audio__ctl {
485
+ flex: none;
486
+ display: inline-flex;
487
+ align-items: center;
488
+ justify-content: center;
489
+ width: 46px;
490
+ height: 46px;
491
+ padding: 0;
492
+ border: 0;
493
+ border-radius: 50%;
494
+ /*
495
+ * 不加背景(设计语言是「无边框」,控件底会引入新色阶)。
496
+ *
497
+ * ⚠️ 由此带来的关键认知:**无底控件的「视觉尺寸」= 图标尺寸,不是盒子尺寸**。
498
+ * 之前写 44px 盒子配 19px 图标,算出 44/66=66.7%,
499
+ * 但用户看到的只有 19px 图标 → 19/66 = **29%**,所以"看着像 1/3"。
500
+ * 要放大观感,唯一有效的旋钮是**图标**,盒子只负责点击热区。
501
+ *
502
+ * 现在:盒子 46px(热区舒适),图标 22px(相对主键 64px 圆的观感明显提升)。
503
+ */
504
+ background: transparent;
505
+ color: var(--wd-ink-2);
506
+ font: inherit;
507
+ font-size: 14px;
508
+ font-weight: 700;
509
+ cursor: pointer;
510
+ transition: background var(--wd-dur-fast) ease, color var(--wd-dur-fast) ease;
511
+ }
512
+
513
+ @media (hover: hover) {
514
+ .wd-audio__ctl:hover {
515
+ background: var(--wd-field-hover);
516
+ color: var(--wd-ink);
517
+ }
518
+ }
519
+ .wd-audio__ctl--text {
520
+ font-variant-numeric: tabular-nums;
521
+ }
522
+
523
+ /*
524
+ * 占位符必须和 .wd-audio__ctl 同宽,否则缺失控件的行会重新错位。
525
+ * ⚠️ 改 .wd-audio__ctl 的宽高时,这里要同步。
526
+ */
527
+ .wd-audio__ctl-spacer {
528
+ width: 46px;
529
+ height: 46px;
530
+ flex: none;
531
+ }
532
+
533
+ /*
534
+ * 播放键:视觉主体,但用 web 的尺度。
535
+ * 44px(不是移动端的 52px)—— web 页面里控件过大会抢走焦点,
536
+ * 44px 已足够与 34px 的次级控件拉开层级。
537
+ */
538
+ .wd-audio__main-btn {
539
+ flex: none;
540
+ display: inline-flex;
541
+ align-items: center;
542
+ justify-content: center;
543
+ /*
544
+ * 主键 64px / 次级 38px = **59.4% ≈ 60%**。
545
+ *
546
+ * ⚠️ 关键教训:之前写 44/66 算出 66.7%,"数字上"接近 2/3,
547
+ * 但截图里看着像 1/3 —— 因为次级控件是 **background: transparent**,
548
+ * 用户看到的不是 44px 的圆,而是里面 19px 的图标。
549
+ * 图标/主键 = 19/66 = 29%,正是"差不多 1/3"的来源。
550
+ *
551
+ * 所以比例必须按**可见尺寸**算:给次级控件加浅底,
552
+ * 让它有真实边界,38px 才会被读成 38px 而不是 19px。
553
+ */
554
+ width: 64px;
555
+ height: 64px;
556
+ padding: 0;
557
+ border: 0;
558
+ border-radius: 50%;
559
+ background: var(--wd-ink);
560
+ color: var(--wd-card);
561
+ cursor: pointer;
562
+ box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
563
+ transition: transform var(--wd-dur-fast) var(--wd-ease-out), box-shadow var(--wd-dur-fast) ease, background var(--wd-dur-fast) ease;
564
+ }
565
+
566
+ .wd-audio__main-btn:hover {
567
+ transform: scale(1.05);
568
+ box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
569
+ }
570
+
571
+ .wd-audio__main-btn:active {
572
+ transform: scale(0.97);
573
+ }
574
+
575
+ /*
576
+ * 注:播放三角的视觉补偿已修正到**图标本身**(play.svg 内部平移 12.4 单位),
577
+ * 不再依赖使用方写 transform hack。
578
+ * 原则:图标的视觉重心属于图标自身的责任,不该由每个使用方各自补偿。
579
+ */
580
+ /* ---------------- 倍速菜单(card) ---------------- */
581
+ /*
582
+ * 倍速菜单的定位上下文。
583
+ *
584
+ * ⚠️ 之前菜单直接挂在卡片上,用 `left:50% / bottom:74px` 定位 ——
585
+ * 那是相对**整张卡片**算的:水平在卡片正中、垂直在距底 74px 处。
586
+ * 结果菜单出现在卡片中央偏上,而不是「1× 按钮的上方」,
587
+ * 视觉上像是飘到了卡片的另一个区域。
588
+ *
589
+ * 修法:给按钮套一个 position:relative 的 wrapper,
590
+ * 菜单相对它绝对定位 —— 锚点就真正落在按钮上了。
591
+ */
592
+ .wd-audio__rate-anchor {
593
+ position: relative;
594
+ flex: none;
595
+ display: inline-flex;
596
+ }
597
+
598
+ .wd-audio__rate-menu--card {
599
+ position: absolute;
600
+ left: 50%;
601
+ bottom: calc(100% + 6px);
602
+ transform: translateX(-50%);
603
+ /* 纵向排列:5 个选项竖着放,横向并排会撑成一条长条越过卡片边界 */
604
+ display: flex;
605
+ flex-direction: column;
606
+ gap: 2px;
607
+ padding: 6px;
608
+ border-radius: var(--wd-radius-md);
609
+ background: var(--wd-card);
610
+ box-shadow: var(--wd-shadow-pop);
611
+ z-index: 5;
612
+ /* 菜单可能比按钮宽:用 min-content 保证每个选项不换行 */
613
+ white-space: nowrap;
614
+ }
615
+
616
+ .wd-audio__rate-menu--card button {
617
+ padding: 6px 9px;
618
+ border: 0;
619
+ border-radius: 6px;
620
+ background: transparent;
621
+ color: var(--wd-ink-2);
622
+ font: inherit;
623
+ font-size: 12px;
624
+ font-weight: 700;
625
+ cursor: pointer;
626
+ }
627
+
628
+ @media (hover: hover) {
629
+ .wd-audio__rate-menu--card button:hover {
630
+ background: var(--wd-field-hover);
631
+ }
632
+ }
633
+ .wd-audio__rate-menu--card button.is-on {
634
+ background: var(--wd-ink);
635
+ color: var(--wd-card);
636
+ }
637
+
638
+ /* =============================================================
639
+ * bar —— 横条(封面 + 标题 + 细进度)
640
+ * ============================================================= */
641
+ /* bar:同样是白底 + 阴影的无边框卡片,内距略放松 */
642
+ .wd-audio--bar {
643
+ display: flex;
644
+ align-items: center;
645
+ gap: 14px;
646
+ padding: 12px 16px;
647
+ border-radius: var(--wd-radius-md);
648
+ background: var(--wd-card);
649
+ box-shadow: var(--wd-shadow-sm);
650
+ }
651
+
652
+ /*
653
+ * bar:封面与播放键**二合一**。
654
+ *
655
+ * ⚠️ 之前是「封面方块 + 红色圆按钮」并排两个元素,
656
+ * 既占宽度又显得零碎(两个都在左边,视觉重心堆在一起)。
657
+ *
658
+ * 现在合并成一块:封面(或占位图)本身是可点击的播放区,
659
+ * 播放时在封面上叠加半透明遮罩 + 图标。
660
+ * 没有封面时用深色占位块 + 图标,依然是一个整体。
661
+ */
662
+ .wd-audio__cover {
663
+ position: relative;
664
+ flex: none;
665
+ width: 52px;
666
+ height: 52px;
667
+ border-radius: var(--wd-radius-sm);
668
+ background: var(--wd-dark);
669
+ color: var(--wd-dark-text);
670
+ overflow: hidden;
671
+ display: flex;
672
+ align-items: center;
673
+ justify-content: center;
674
+ border: 0;
675
+ padding: 0;
676
+ cursor: pointer;
677
+ transition: transform var(--wd-dur-fast) var(--wd-ease-out);
678
+ }
679
+
680
+ .wd-audio__cover img {
681
+ width: 100%;
682
+ height: 100%;
683
+ object-fit: cover;
684
+ }
685
+
686
+ /* 播放/暂停图标:叠在封面上,带一层暗色遮罩保证任何封面都看得清 */
687
+ .wd-audio__cover-play {
688
+ position: absolute;
689
+ inset: 0;
690
+ display: flex;
691
+ align-items: center;
692
+ justify-content: center;
693
+ background: rgba(0, 0, 0, 0.32);
694
+ color: #fff;
695
+ transition: background var(--wd-dur-fast) ease;
696
+ }
697
+
698
+ @media (hover: hover) {
699
+ .wd-audio__cover:hover .wd-audio__cover-play {
700
+ background: rgba(0, 0, 0, 0.46);
701
+ }
702
+ }
703
+ @media (hover: hover) {
704
+ .wd-audio__cover:hover {
705
+ transform: scale(1.03);
706
+ }
707
+ }
708
+ /* 无封面时占位图标(降低存在感,不要和播放键打架) */
709
+ .wd-audio__cover-placeholder {
710
+ /* 无封面时占位图标:作为背景纹理存在,但要比 .35 更可辨 */
711
+ opacity: 0.5;
712
+ color: var(--wd-dark-text);
713
+ }
714
+
715
+ .wd-audio__pulse {
716
+ position: absolute;
717
+ right: 4px;
718
+ bottom: 4px;
719
+ display: flex;
720
+ align-items: flex-end;
721
+ gap: 1.5px;
722
+ padding: 2px 3px;
723
+ border-radius: 3px;
724
+ background: rgba(0, 0, 0, 0.45);
725
+ }
726
+
727
+ .wd-audio__pulse i {
728
+ width: 2.5px;
729
+ border-radius: 1px;
730
+ background: #fff;
731
+ animation: wd-audio-eq 0.9s ease-in-out infinite;
732
+ }
733
+
734
+ .wd-audio__pulse i:nth-child(1) {
735
+ height: 30%;
736
+ animation-delay: -0.15s;
737
+ }
738
+
739
+ .wd-audio__pulse i:nth-child(2) {
740
+ height: 60%;
741
+ animation-delay: -0.45s;
742
+ }
743
+
744
+ .wd-audio__pulse i:nth-child(3) {
745
+ height: 42%;
746
+ animation-delay: -0.3s;
747
+ }
748
+
749
+ .wd-audio__main {
750
+ flex: 1;
751
+ min-width: 0;
752
+ display: flex;
753
+ flex-direction: column;
754
+ gap: 7px;
755
+ }
756
+
757
+ /* 让 main 与右侧控件之间有呼吸,不然 1× 会贴着总时长 */
758
+ .wd-audio--bar {
759
+ gap: 16px;
760
+ }
761
+
762
+ .wd-audio__meta {
763
+ display: flex;
764
+ align-items: baseline;
765
+ gap: 8px;
766
+ min-width: 0;
767
+ }
768
+
769
+ .wd-audio--bar .wd-audio__title {
770
+ min-width: 0;
771
+ overflow: hidden;
772
+ text-overflow: ellipsis;
773
+ white-space: nowrap;
774
+ font-weight: 700;
775
+ font-size: 13px;
776
+ }
777
+
778
+ .wd-audio--bar .wd-audio__subtitle {
779
+ flex: none;
780
+ font-size: 11.5px;
781
+ color: var(--wd-ink-2);
782
+ overflow: hidden;
783
+ text-overflow: ellipsis;
784
+ white-space: nowrap;
785
+ }
786
+
787
+ /*
788
+ * bar 里的波形:柱子数量多(有 waveform 数据时按数据长度),
789
+ * 用 justify-content: space-between + 固定柱宽会让它散成一片"梳子"。
790
+ * 这里改成居中且不撑满,柱子紧挨着,视觉上是一条连续的波形带。
791
+ */
792
+ .wd-audio--bar .wd-audio__wave {
793
+ height: 24px;
794
+ gap: 1.5px;
795
+ flex: 1 1 auto;
796
+ min-width: 0;
797
+ justify-content: center;
798
+ padding: 0;
799
+ }
800
+
801
+ .wd-audio--bar .wd-audio__wave .wd-audio__wave-bar {
802
+ flex: 0 0 2px;
803
+ max-width: 2px;
804
+ }
805
+
806
+ .wd-audio__scrub {
807
+ position: relative;
808
+ height: 14px;
809
+ display: flex;
810
+ align-items: center;
811
+ cursor: pointer;
812
+ outline: none;
813
+ flex: 1 1 auto;
814
+ min-width: 0;
815
+ }
816
+
817
+ .wd-audio__scrub:focus-visible {
818
+ box-shadow: 0 0 0 2px var(--wd-focus-ring);
819
+ border-radius: 4px;
820
+ }
821
+
822
+ .wd-audio__track,
823
+ .wd-audio__buffer,
824
+ .wd-audio__played {
825
+ position: absolute;
826
+ left: 0;
827
+ height: 3px;
828
+ border-radius: 2px;
829
+ }
830
+
831
+ .wd-audio__track {
832
+ width: 100%;
833
+ background: var(--wd-ink-5);
834
+ }
835
+
836
+ .wd-audio__buffer {
837
+ background: var(--wd-tint-3);
838
+ }
839
+
840
+ .wd-audio__played {
841
+ background: var(--wd-red);
842
+ }
843
+
844
+ .wd-audio__knob {
845
+ position: absolute;
846
+ top: 50%;
847
+ width: 10px;
848
+ height: 10px;
849
+ margin-left: -5px;
850
+ border-radius: 50%;
851
+ background: var(--wd-red);
852
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
853
+ transform: translateY(-50%) scale(0);
854
+ transition: transform var(--wd-dur-fast) var(--wd-ease-out);
855
+ }
856
+
857
+ .wd-audio__scrub:hover .wd-audio__knob,
858
+ .wd-audio__scrub:focus-visible .wd-audio__knob {
859
+ transform: translateY(-50%) scale(1);
860
+ }
861
+
862
+ /*
863
+ * 进度行:已播时间 / 进度条 / 总时长,三者同一行且垂直居中。
864
+ *
865
+ * ⚠️ 之前时间单独占一行,右侧比左侧封面高两行,整条重心偏上、封面显矮。
866
+ * 现在用 flex + align-items:center 让它们在一条基线上。
867
+ */
868
+ .wd-audio__progress-row {
869
+ display: flex;
870
+ align-items: center;
871
+ gap: 8px;
872
+ min-width: 0;
873
+ }
874
+
875
+ .wd-audio__time-cur,
876
+ .wd-audio__time-total {
877
+ flex: none;
878
+ font-size: 11.5px;
879
+ color: var(--wd-ink-2);
880
+ font-variant-numeric: tabular-nums;
881
+ white-space: nowrap;
882
+ }
883
+
884
+ .wd-audio__time-total {
885
+ color: var(--wd-ink-3);
886
+ }
887
+
888
+ /* 进度条在中间,占满剩余宽度 */
889
+ .wd-audio__progress-row > .wd-audio__scrub,
890
+ .wd-audio__progress-row > .wd-audio__wave {
891
+ flex: 1 1 auto;
892
+ min-width: 0;
893
+ }
894
+
895
+ /*
896
+ * 波形模式下,时间不要被推到两端。
897
+ * 波形本身 flex:1 会吃掉所有空间,时间自然贴住它 ——
898
+ * 但如果波形是 space-between 布局,柱子会散开、时间也离得远。
899
+ * 这里给波形一点内边距,让视觉上更紧凑。
900
+ */
901
+ .wd-audio--bar .wd-audio__wave {
902
+ padding: 0 2px;
903
+ }
904
+
905
+ .wd-audio__err {
906
+ color: var(--wd-red-text);
907
+ font-weight: 600;
908
+ font-size: 12px;
909
+ }
910
+
911
+ /* ---------------- 侧栏控件 ---------------- */
912
+ .wd-audio__side {
913
+ flex: none;
914
+ display: flex;
915
+ align-items: center;
916
+ gap: 4px;
917
+ }
918
+
919
+ .wd-audio__ibtn {
920
+ display: inline-flex;
921
+ align-items: center;
922
+ justify-content: center;
923
+ min-width: 28px;
924
+ height: 28px;
925
+ padding: 0 5px;
926
+ border: 0;
927
+ border-radius: var(--wd-radius-xs);
928
+ background: transparent;
929
+ color: var(--wd-ink-2);
930
+ font: inherit;
931
+ font-size: 11.5px;
932
+ font-weight: 700;
933
+ cursor: pointer;
934
+ text-decoration: none;
935
+ transition: background var(--wd-dur-fast) ease, color var(--wd-dur-fast) ease;
936
+ }
937
+
938
+ @media (hover: hover) {
939
+ .wd-audio__ibtn:hover {
940
+ background: var(--wd-field-hover);
941
+ color: var(--wd-ink);
942
+ }
943
+ }
944
+ .wd-audio__ibtn--text {
945
+ font-variant-numeric: tabular-nums;
946
+ }
947
+
948
+ .wd-audio__vol {
949
+ display: flex;
950
+ align-items: center;
951
+ }
952
+
953
+ .wd-audio__vol-track {
954
+ width: 0;
955
+ height: 3px;
956
+ border-radius: 2px;
957
+ background: var(--wd-ink-5);
958
+ cursor: pointer;
959
+ overflow: hidden;
960
+ transition: width var(--wd-dur-fast) var(--wd-ease-out), margin var(--wd-dur-fast) ease;
961
+ }
962
+
963
+ .wd-audio__vol:hover .wd-audio__vol-track {
964
+ width: 52px;
965
+ margin: 0 6px 0 2px;
966
+ }
967
+
968
+ .wd-audio__vol-fill {
969
+ display: block;
970
+ height: 100%;
971
+ background: var(--wd-red);
972
+ }
973
+
974
+ .wd-audio__rate {
975
+ position: relative;
976
+ }
977
+
978
+ .wd-audio__rate-menu {
979
+ position: absolute;
980
+ right: 0;
981
+ bottom: calc(100% + 6px);
982
+ display: flex;
983
+ flex-direction: column;
984
+ min-width: 64px;
985
+ padding: 4px;
986
+ border-radius: var(--wd-radius-sm);
987
+ background: var(--wd-card);
988
+ box-shadow: var(--wd-shadow-pop);
989
+ z-index: 5;
990
+ }
991
+
992
+ .wd-audio__rate-menu button {
993
+ padding: 6px 9px;
994
+ border: 0;
995
+ border-radius: 5px;
996
+ background: transparent;
997
+ color: var(--wd-ink-2);
998
+ font: inherit;
999
+ font-size: 12px;
1000
+ text-align: left;
1001
+ cursor: pointer;
1002
+ white-space: nowrap;
1003
+ }
1004
+
1005
+ @media (hover: hover) {
1006
+ .wd-audio__rate-menu button:hover {
1007
+ background: var(--wd-field-hover);
1008
+ }
1009
+ }
1010
+ .wd-audio__rate-menu button.is-on {
1011
+ color: var(--wd-red-text);
1012
+ font-weight: 700;
1013
+ }
1014
+
1015
+ /* =============================================================
1016
+ * mini —— 单行迷你横条
1017
+ * ============================================================= */
1018
+ /*
1019
+ * mini:胶囊形状。
1020
+ * 左右两端完全圆角(pill),与内部的圆形播放键呼应 ——
1021
+ * 方角容器 + 圆按钮会很割裂。
1022
+ */
1023
+ /*
1024
+ * mini:胶囊 + 卡片色。
1025
+ * 与其他卡片同一套语言:白底 + 阴影,无边框、无 tint 底色。
1026
+ * 内距左右不对称(8 / 16)—— 让圆形播放键贴紧左端,视觉上更稳。
1027
+ */
1028
+ .wd-audio--mini {
1029
+ display: flex;
1030
+ align-items: center;
1031
+ gap: 10px;
1032
+ padding: 7px 16px 7px 8px;
1033
+ border-radius: var(--wd-radius-pill);
1034
+ background: var(--wd-card);
1035
+ box-shadow: var(--wd-shadow-sm);
1036
+ }
1037
+
1038
+ .wd-audio__mini-play {
1039
+ flex: none;
1040
+ display: flex;
1041
+ align-items: center;
1042
+ justify-content: center;
1043
+ width: 30px;
1044
+ height: 30px;
1045
+ padding: 0;
1046
+ border: 0;
1047
+ border-radius: 50%;
1048
+ background: var(--wd-ink);
1049
+ color: var(--wd-card);
1050
+ cursor: pointer;
1051
+ transition: transform var(--wd-dur-fast) var(--wd-ease-out);
1052
+ }
1053
+
1054
+ @media (hover: hover) {
1055
+ .wd-audio__mini-play:hover {
1056
+ transform: scale(1.06);
1057
+ }
1058
+ }
1059
+ .wd-audio__mini-main {
1060
+ flex: 1;
1061
+ min-width: 0;
1062
+ display: flex;
1063
+ flex-direction: column;
1064
+ gap: 5px;
1065
+ }
1066
+
1067
+ .wd-audio__mini-text {
1068
+ display: flex;
1069
+ align-items: baseline;
1070
+ gap: 8px;
1071
+ min-width: 0;
1072
+ }
1073
+
1074
+ .wd-audio--mini .wd-audio__title {
1075
+ min-width: 0;
1076
+ overflow: hidden;
1077
+ text-overflow: ellipsis;
1078
+ white-space: nowrap;
1079
+ font-weight: 700;
1080
+ font-size: 12.5px;
1081
+ }
1082
+
1083
+ .wd-audio--mini .wd-audio__subtitle {
1084
+ flex: none;
1085
+ font-size: 11px;
1086
+ color: var(--wd-ink-3);
1087
+ overflow: hidden;
1088
+ text-overflow: ellipsis;
1089
+ white-space: nowrap;
1090
+ }
1091
+
1092
+ .wd-audio__mini-progress {
1093
+ cursor: pointer;
1094
+ outline: none;
1095
+ padding: 2px 0 0;
1096
+ }
1097
+
1098
+ .wd-audio__mini-progress:focus-visible {
1099
+ box-shadow: 0 0 0 2px var(--wd-focus-ring);
1100
+ border-radius: 3px;
1101
+ }
1102
+
1103
+ .wd-audio__mini-track {
1104
+ display: block;
1105
+ height: 2.5px;
1106
+ border-radius: 2px;
1107
+ background: var(--wd-ink-5);
1108
+ overflow: hidden;
1109
+ }
1110
+
1111
+ .wd-audio__mini-fill {
1112
+ display: block;
1113
+ height: 100%;
1114
+ border-radius: 2px;
1115
+ background: var(--wd-ink);
1116
+ }
1117
+
1118
+ .wd-audio__mini-time {
1119
+ flex: none;
1120
+ margin-left: 4px;
1121
+ font-size: 11px;
1122
+ color: var(--wd-ink-3);
1123
+ font-variant-numeric: tabular-nums;
1124
+ white-space: nowrap;
1125
+ }
1126
+
1127
+ /* =============================================================
1128
+ * 动效降级
1129
+ * ============================================================= */
1130
+ @media (prefers-reduced-motion: reduce) {
1131
+ .wd-audio__pulse i,
1132
+ .wd-audio__hero-badge i {
1133
+ animation: none;
1134
+ }
1135
+ .wd-audio__main-btn:hover,
1136
+ .wd-audio__play:active,
1137
+ .wd-audio__mini-play:hover {
1138
+ transform: none;
1139
+ }
1140
+ }
1141
+ /* 窄容器:card 的音量键让位 */
1142
+ @media (max-width: 320px) {
1143
+ .wd-audio--card .wd-audio__ctl {
1144
+ width: 30px;
1145
+ height: 30px;
1146
+ }
1147
+ .wd-audio--card .wd-audio__ctl-spacer {
1148
+ width: 30px;
1149
+ height: 30px;
1150
+ }
1151
+ .wd-audio__main-btn {
1152
+ width: 46px;
1153
+ height: 46px;
1154
+ }
1155
+ }
1156
+ /* =============================================================
1157
+ * 音量弹层
1158
+ *
1159
+ * 点音量按钮弹出纵向浮层:静音键 + 滑块 + 数值。
1160
+ * ⚠️ 之前按钮直接绑 toggleMute —— 一次点击就全静音,
1161
+ * 想微调音量必须先静音,交互反直觉。
1162
+ * ============================================================= */
1163
+ .wd-audio__vol {
1164
+ position: relative;
1165
+ flex: none;
1166
+ display: inline-flex;
1167
+ }
1168
+
1169
+ .wd-audio__vol-pop {
1170
+ position: absolute;
1171
+ bottom: calc(100% + 10px);
1172
+ left: 50%;
1173
+ transform: translateX(-50%);
1174
+ z-index: 8;
1175
+ /*
1176
+ * 弹出动效:从按钮方向"长出"。
1177
+ * 用 scale + 位移 + 透明度组合,曲线带一点回弹
1178
+ * (--wd-ease-spring-soft),比线性淡入更有物理感。
1179
+ * ⚠️ transform-origin 设在底部居中 —— 动画从按钮处展开而非凭空出现。
1180
+ */
1181
+ transform-origin: bottom center;
1182
+ animation: wd-audio-vol-in var(--wd-dur-pop) var(--wd-ease-spring-soft);
1183
+ display: flex;
1184
+ flex-direction: column;
1185
+ align-items: center;
1186
+ gap: 8px;
1187
+ padding: 10px 8px;
1188
+ border-radius: var(--wd-radius-md);
1189
+ background: var(--wd-card);
1190
+ box-shadow: var(--wd-shadow-pop);
1191
+ }
1192
+
1193
+ /* 反色卡片(深底)上的浮层保持深色 */
1194
+ .wd-audio--inverse .wd-audio__vol-pop {
1195
+ background: rgba(28, 28, 30, 0.96);
1196
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
1197
+ }
1198
+
1199
+ .wd-audio__vol-mute {
1200
+ display: inline-flex;
1201
+ align-items: center;
1202
+ justify-content: center;
1203
+ width: 26px;
1204
+ height: 26px;
1205
+ border: 0;
1206
+ border-radius: 50%;
1207
+ background: transparent;
1208
+ color: var(--wd-ink-2);
1209
+ cursor: pointer;
1210
+ transition: background var(--wd-dur-fast) ease;
1211
+ }
1212
+
1213
+ @media (hover: hover) {
1214
+ .wd-audio__vol-mute:hover {
1215
+ background: var(--wd-field);
1216
+ }
1217
+ }
1218
+ .wd-audio--inverse .wd-audio__vol-mute {
1219
+ color: var(--wd-on-dark-2);
1220
+ }
1221
+
1222
+ @media (hover: hover) {
1223
+ .wd-audio--inverse .wd-audio__vol-mute:hover {
1224
+ background: rgba(255, 255, 255, 0.12);
1225
+ }
1226
+ }
1227
+ /*
1228
+ * 纵向滑块:用 writing-mode 把原生 range 转成竖直。
1229
+ * ⚠️ 不要用 transform: rotate(-90deg) —— 那会让点击区域也旋转,
1230
+ * 拖动方向和视觉方向对不上。writing-mode 是标准做法。
1231
+ */
1232
+ .wd-audio__vol-slider {
1233
+ display: flex;
1234
+ align-items: center;
1235
+ justify-content: center;
1236
+ height: 96px;
1237
+ width: 26px;
1238
+ }
1239
+
1240
+ .wd-audio__vol-slider input[type=range] {
1241
+ writing-mode: vertical-lr;
1242
+ direction: rtl;
1243
+ width: 4px;
1244
+ height: 92px;
1245
+ margin: 0;
1246
+ appearance: none;
1247
+ -webkit-appearance: none;
1248
+ border-radius: 999px;
1249
+ background: var(--wd-field);
1250
+ cursor: pointer;
1251
+ }
1252
+
1253
+ .wd-audio__vol-slider input[type=range]::-webkit-slider-thumb {
1254
+ -webkit-appearance: none;
1255
+ appearance: none;
1256
+ width: 13px;
1257
+ height: 13px;
1258
+ border-radius: 50%;
1259
+ background: var(--wd-ink);
1260
+ box-shadow: 0 0 0 2px var(--wd-card);
1261
+ cursor: grab;
1262
+ }
1263
+
1264
+ .wd-audio--inverse .wd-audio__vol-slider input[type=range] {
1265
+ background: rgba(255, 255, 255, 0.2);
1266
+ }
1267
+
1268
+ .wd-audio--inverse .wd-audio__vol-slider input[type=range]::-webkit-slider-thumb {
1269
+ background: #fff;
1270
+ box-shadow: 0 0 0 2px rgba(28, 28, 30, 0.9);
1271
+ }
1272
+
1273
+ .wd-audio__vol-num {
1274
+ font-size: 10.5px;
1275
+ font-weight: 700;
1276
+ color: var(--wd-ink-3);
1277
+ font-variant-numeric: tabular-nums;
1278
+ }
1279
+
1280
+ .wd-audio--inverse .wd-audio__vol-num {
1281
+ color: var(--wd-on-dark-3);
1282
+ }
1283
+
1284
+ /* =============================================================
1285
+ * 细进度条风格(progressStyle="bar")
1286
+ *
1287
+ * 与波形是两种视觉语言:
1288
+ * 波形 = 内容可视化(让人"看见"音频的起伏)
1289
+ * 进度条 = 纯粹的位置读取(信息密度高的场景更合适)
1290
+ * 两条在同一个卡片里不并存,由 progressStyle 二选一。
1291
+ * ============================================================= */
1292
+ .wd-audio__pbar {
1293
+ position: relative;
1294
+ width: 100%;
1295
+ height: 6px;
1296
+ border-radius: var(--wd-radius-pill);
1297
+ background: var(--wd-field);
1298
+ cursor: pointer;
1299
+ overflow: visible;
1300
+ outline: none;
1301
+ }
1302
+
1303
+ .wd-audio__pbar:focus-visible {
1304
+ box-shadow: 0 0 0 3px var(--wd-focus-ring-soft);
1305
+ }
1306
+
1307
+ .wd-audio__pbar-fill {
1308
+ position: absolute;
1309
+ left: 0;
1310
+ top: 0;
1311
+ bottom: 0;
1312
+ border-radius: var(--wd-radius-pill);
1313
+ background: var(--wd-audio-accent, var(--wd-ink));
1314
+ transition: width 0.12s linear;
1315
+ }
1316
+
1317
+ /*
1318
+ * 拖拽把手:hover 时才出现。
1319
+ * 常驻会让 6px 的细条看起来很脏(一个圆点挂在线上)。
1320
+ */
1321
+ .wd-audio__pbar-thumb {
1322
+ position: absolute;
1323
+ top: 50%;
1324
+ width: 12px;
1325
+ height: 12px;
1326
+ margin-left: -6px;
1327
+ border-radius: 50%;
1328
+ background: var(--wd-audio-accent, var(--wd-ink));
1329
+ box-shadow: 0 0 0 3px var(--wd-card);
1330
+ transform: translateY(-50%) scale(0);
1331
+ transition: transform var(--wd-dur-fast) var(--wd-ease-out);
1332
+ pointer-events: none;
1333
+ }
1334
+
1335
+ .wd-audio__pbar:hover .wd-audio__pbar-thumb,
1336
+ .wd-audio__pbar:focus-visible .wd-audio__pbar-thumb {
1337
+ transform: translateY(-50%) scale(1);
1338
+ }
1339
+
1340
+ /* 反色卡片:轨道和填充换成深底配色 */
1341
+ .wd-audio--inverse .wd-audio__pbar {
1342
+ background: rgba(255, 255, 255, 0.18);
1343
+ }
1344
+
1345
+ .wd-audio--inverse .wd-audio__pbar-fill,
1346
+ .wd-audio--inverse .wd-audio__pbar-thumb {
1347
+ background: #fff;
1348
+ }
1349
+
1350
+ .wd-audio--inverse .wd-audio__pbar-thumb {
1351
+ box-shadow: 0 0 0 3px rgba(28, 28, 30, 0.9);
1352
+ }
1353
+
1354
+ @keyframes wd-audio-vol-in {
1355
+ from {
1356
+ opacity: 0;
1357
+ transform: translateX(-50%) translateY(6px) scale(0.9);
1358
+ }
1359
+ to {
1360
+ opacity: 1;
1361
+ transform: translateX(-50%) translateY(0) scale(1);
1362
+ }
1363
+ }