@hao0311/dsh-toolbox 0.0.0-stage → 0.5.2

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.css ADDED
@@ -0,0 +1,1101 @@
1
+ /* dsh-toolbox — 客户端样式(0.5.0)
2
+ *
3
+ * 规则(沿用《DSH 维护手册》手机端约定):
4
+ * · 所有规则都挂在 #dsh-toolbox-root 下,或唯一类名 button.tbx-navrow;
5
+ * · 不写全局选择器、不改 DSH 布局变量;
6
+ * · 颜色优先取 DSH 主题变量,取不到才退回深色兜底值;
7
+ * · 桌面端 = 右侧抽屉(不压黑、不挡聊天);粗指针 / 窄屏 = 全屏面板,可随时退出。
8
+ */
9
+
10
+ /* ------------------------------------------------------------------ 入口:导航栏一行 */
11
+
12
+ button.tbx-navrow {
13
+ position: relative;
14
+ display: flex;
15
+ align-items: center;
16
+ gap: 8px;
17
+ width: auto;
18
+ margin: 0 2px;
19
+ flex: 0 0 auto;
20
+ height: 36px;
21
+ min-height: 36px;
22
+ padding: 0 8px;
23
+ border: 0;
24
+ border-radius: 12px;
25
+ background: transparent;
26
+ color: var(--dsw-alias-label-primary, #f9fafb);
27
+ font-size: 14px;
28
+ font-family: inherit;
29
+ text-align: left;
30
+ cursor: pointer;
31
+ -webkit-tap-highlight-color: transparent;
32
+ }
33
+
34
+ button.tbx-navrow:hover {
35
+ background: rgba(128, 128, 128, 0.14);
36
+ }
37
+
38
+ button.tbx-navrow:focus-visible {
39
+ outline: 2px solid var(--tbx-accent, #5b8cff);
40
+ outline-offset: 1px;
41
+ }
42
+
43
+ button.tbx-navrow svg {
44
+ flex: none;
45
+ opacity: 1;
46
+ }
47
+
48
+ /* 侧栏收起成图标轨时:只留图标,文字不竖排 */
49
+ button.tbx-navrow[data-collapsed="1"] {
50
+ width: 36px;
51
+ margin: 0 auto;
52
+ padding: 0;
53
+ justify-content: center;
54
+ gap: 0;
55
+ }
56
+
57
+ button.tbx-navrow[data-collapsed="1"] span:not(.tbx-navdot) {
58
+ display: none;
59
+ }
60
+
61
+ button.tbx-navrow[data-collapsed="1"] .tbx-navdot {
62
+ position: absolute;
63
+ top: 8px;
64
+ right: 7px;
65
+ margin: 0;
66
+ }
67
+
68
+ /* 运行 / 巡检异常的小圆点 */
69
+ .tbx-navdot {
70
+ width: 6px;
71
+ height: 6px;
72
+ margin-left: auto;
73
+ flex: none;
74
+ border-radius: 50%;
75
+ background: transparent;
76
+ transition: background 0.15s;
77
+ }
78
+
79
+ .tbx-navdot[data-state="running"] {
80
+ background: #5b8cff;
81
+ animation: tbx-pulse 1.1s ease-in-out infinite;
82
+ }
83
+
84
+ .tbx-navdot[data-state="alert"] {
85
+ background: #f87171;
86
+ }
87
+
88
+ @keyframes tbx-pulse {
89
+ 0%, 100% { opacity: 1; transform: scale(1); }
90
+ 50% { opacity: 0.45; transform: scale(0.8); }
91
+ }
92
+
93
+ /* ------------------------------------------------------------------ 变量 / 基础 */
94
+
95
+ #dsh-toolbox-root {
96
+ --tbx-accent: #5b8cff;
97
+ --tbx-accent-soft: rgba(91, 140, 255, 0.16);
98
+ --tbx-bg: var(--dsw-alias-bg-elevated, #232325);
99
+ --tbx-fg: var(--dsw-alias-label-primary, #f9fafb);
100
+ --tbx-fg-2: var(--dsw-alias-label-secondary, rgba(249, 250, 251, 0.64));
101
+ --tbx-fg-3: rgba(249, 250, 251, 0.42);
102
+ --tbx-line: var(--dsw-alias-border-l3, rgba(255, 255, 255, 0.10));
103
+ --tbx-line-2: rgba(255, 255, 255, 0.06);
104
+ --tbx-surface: rgba(255, 255, 255, 0.04);
105
+ --tbx-surface-2: rgba(255, 255, 255, 0.07);
106
+ --tbx-ok: #4ade80;
107
+ --tbx-warn: #fbbf24;
108
+ --tbx-bad: #f87171;
109
+ --tbx-ok-soft: rgba(74, 222, 128, 0.12);
110
+ --tbx-warn-soft: rgba(251, 191, 36, 0.12);
111
+ --tbx-bad-soft: rgba(248, 113, 113, 0.13);
112
+ font-family: var(--dsw-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif);
113
+ color: var(--tbx-fg);
114
+ -webkit-font-smoothing: antialiased;
115
+ }
116
+
117
+ #dsh-toolbox-root *,
118
+ #dsh-toolbox-root *::before,
119
+ #dsh-toolbox-root *::after {
120
+ box-sizing: border-box;
121
+ }
122
+
123
+ #dsh-toolbox-root button {
124
+ font-family: inherit;
125
+ color: inherit;
126
+ -webkit-tap-highlight-color: transparent;
127
+ }
128
+
129
+ #dsh-toolbox-root button:focus-visible {
130
+ outline: 2px solid var(--tbx-accent);
131
+ outline-offset: 1px;
132
+ }
133
+
134
+ /* ------------------------------------------------------------------ 面板外壳 */
135
+
136
+ #dsh-toolbox-root .tbx-panel {
137
+ position: fixed;
138
+ top: 0;
139
+ right: 0;
140
+ bottom: 0;
141
+ z-index: 320;
142
+ display: flex;
143
+ flex-direction: column;
144
+ width: var(--tbx-panel-w, 424px);
145
+ max-width: 100vw;
146
+ background: var(--tbx-bg);
147
+ border-left: 1px solid var(--tbx-line);
148
+ box-shadow: -28px 0 70px rgba(0, 0, 0, 0.46);
149
+ transform: translateX(102%);
150
+ visibility: hidden;
151
+ transition: transform 0.22s cubic-bezier(0.22, 0.61, 0.36, 1), visibility 0s linear 0.22s;
152
+ will-change: transform;
153
+ }
154
+
155
+ #dsh-toolbox-root[data-open="1"] .tbx-panel {
156
+ transform: none;
157
+ visibility: visible;
158
+ transition: transform 0.22s cubic-bezier(0.22, 0.61, 0.36, 1);
159
+ }
160
+
161
+ @media (prefers-reduced-motion: reduce) {
162
+ #dsh-toolbox-root .tbx-panel {
163
+ transition: none;
164
+ }
165
+ }
166
+
167
+ #dsh-toolbox-root .tbx-hd {
168
+ display: flex;
169
+ align-items: center;
170
+ gap: 10px;
171
+ flex: none;
172
+ padding: 14px 14px 12px 16px;
173
+ border-bottom: 1px solid var(--tbx-line-2);
174
+ }
175
+
176
+ #dsh-toolbox-root .tbx-hd-main {
177
+ display: flex;
178
+ align-items: center;
179
+ gap: 10px;
180
+ min-width: 0;
181
+ flex: 1;
182
+ }
183
+
184
+ #dsh-toolbox-root .tbx-hd-icon {
185
+ display: grid;
186
+ place-items: center;
187
+ width: 30px;
188
+ height: 30px;
189
+ flex: none;
190
+ border-radius: 9px;
191
+ background: var(--tbx-accent-soft);
192
+ color: var(--tbx-accent);
193
+ }
194
+
195
+ #dsh-toolbox-root .tbx-hd-titles {
196
+ min-width: 0;
197
+ }
198
+
199
+ #dsh-toolbox-root .tbx-hd-title {
200
+ font-size: 14.5px;
201
+ font-weight: 600;
202
+ letter-spacing: 0.01em;
203
+ line-height: 1.25;
204
+ }
205
+
206
+ #dsh-toolbox-root .tbx-hd-sub {
207
+ margin-top: 2px;
208
+ font-size: 11px;
209
+ color: var(--tbx-fg-3);
210
+ white-space: nowrap;
211
+ overflow: hidden;
212
+ text-overflow: ellipsis;
213
+ }
214
+
215
+ #dsh-toolbox-root .tbx-hd-actions {
216
+ display: flex;
217
+ align-items: center;
218
+ gap: 6px;
219
+ flex: none;
220
+ }
221
+
222
+ #dsh-toolbox-root .tbx-pill {
223
+ padding: 3px 8px;
224
+ border-radius: 999px;
225
+ background: var(--tbx-surface-2);
226
+ color: var(--tbx-fg-2);
227
+ font-size: 11px;
228
+ line-height: 1.5;
229
+ white-space: nowrap;
230
+ }
231
+
232
+ #dsh-toolbox-root .tbx-pill[data-scope="lan"] { color: #86efac; background: var(--tbx-ok-soft); }
233
+ #dsh-toolbox-root .tbx-pill[data-scope="loopback"] { color: #fde68a; background: var(--tbx-warn-soft); }
234
+ #dsh-toolbox-root .tbx-pill[data-scope="tailnet"] { color: #fde68a; background: var(--tbx-warn-soft); }
235
+ #dsh-toolbox-root .tbx-pill[data-scope="wan"] { color: #fca5a5; background: var(--tbx-bad-soft); }
236
+ #dsh-toolbox-root .tbx-pill[data-scope="running"] { color: #bfdbfe; background: var(--tbx-accent-soft); }
237
+
238
+ #dsh-toolbox-root .tbx-iconbtn {
239
+ display: grid;
240
+ place-items: center;
241
+ width: 30px;
242
+ height: 30px;
243
+ flex: none;
244
+ padding: 0;
245
+ border: 0;
246
+ border-radius: 9px;
247
+ background: transparent;
248
+ color: var(--tbx-fg-2);
249
+ font-size: 20px;
250
+ line-height: 1;
251
+ cursor: pointer;
252
+ }
253
+
254
+ #dsh-toolbox-root .tbx-iconbtn:hover {
255
+ background: var(--tbx-surface-2);
256
+ color: var(--tbx-fg);
257
+ }
258
+
259
+ #dsh-toolbox-root .tbx-refresh {
260
+ display: grid;
261
+ place-items: center;
262
+ color: inherit;
263
+ }
264
+
265
+ #dsh-toolbox-root .tbx-body {
266
+ flex: 1;
267
+ min-height: 0;
268
+ overflow-y: auto;
269
+ overscroll-behavior: contain;
270
+ padding: 14px 16px 18px;
271
+ scrollbar-width: thin;
272
+ scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
273
+ }
274
+
275
+ #dsh-toolbox-root .tbx-body::-webkit-scrollbar { width: 8px; }
276
+ #dsh-toolbox-root .tbx-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 4px; }
277
+ #dsh-toolbox-root .tbx-body::-webkit-scrollbar-track { background: transparent; }
278
+
279
+ #dsh-toolbox-root .tbx-ft {
280
+ display: flex;
281
+ align-items: center;
282
+ justify-content: space-between;
283
+ gap: 8px;
284
+ flex: none;
285
+ padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px));
286
+ border-top: 1px solid var(--tbx-line-2);
287
+ color: var(--tbx-fg-3);
288
+ font-size: 10.5px;
289
+ }
290
+
291
+ /* ------------------------------------------------------------------ 区块 / 标题 */
292
+
293
+ #dsh-toolbox-root .tbx-sec {
294
+ margin-bottom: 22px;
295
+ }
296
+
297
+ #dsh-toolbox-root .tbx-sec:last-child {
298
+ margin-bottom: 4px;
299
+ }
300
+
301
+ #dsh-toolbox-root .tbx-sechd {
302
+ display: flex;
303
+ align-items: baseline;
304
+ gap: 8px;
305
+ margin-bottom: 10px;
306
+ }
307
+
308
+ #dsh-toolbox-root .tbx-sechd h3 {
309
+ margin: 0;
310
+ font-size: 13px;
311
+ font-weight: 600;
312
+ letter-spacing: 0.01em;
313
+ }
314
+
315
+ #dsh-toolbox-root .tbx-sechd-actions {
316
+ margin-left: auto;
317
+ }
318
+
319
+ #dsh-toolbox-root .tbx-hint {
320
+ font-size: 11.5px;
321
+ color: var(--tbx-fg-3);
322
+ line-height: 1.45;
323
+ }
324
+
325
+ #dsh-toolbox-root .tbx-note {
326
+ font-size: 11px;
327
+ color: var(--tbx-fg-3);
328
+ line-height: 1.5;
329
+ }
330
+
331
+ #dsh-toolbox-root .tbx-empty {
332
+ padding: 10px 12px;
333
+ border-radius: 11px;
334
+ background: var(--tbx-surface);
335
+ color: var(--tbx-fg-3);
336
+ font-size: 12px;
337
+ line-height: 1.6;
338
+ }
339
+
340
+ /* ------------------------------------------------------------------ 连接状态 */
341
+
342
+ #dsh-toolbox-root .tbx-kv {
343
+ display: flex;
344
+ flex-direction: column;
345
+ }
346
+
347
+ #dsh-toolbox-root .tbx-kvrow {
348
+ display: flex;
349
+ align-items: baseline;
350
+ gap: 10px;
351
+ padding: 7px 0;
352
+ border-bottom: 1px solid var(--tbx-line-2);
353
+ font-size: 12.5px;
354
+ }
355
+
356
+ #dsh-toolbox-root .tbx-kvrow:last-child {
357
+ border-bottom: 0;
358
+ }
359
+
360
+ #dsh-toolbox-root .tbx-k {
361
+ flex: none;
362
+ width: 62px;
363
+ color: var(--tbx-fg-3);
364
+ font-size: 11.5px;
365
+ }
366
+
367
+ #dsh-toolbox-root .tbx-v {
368
+ flex: 1;
369
+ min-width: 0;
370
+ word-break: break-word;
371
+ font-variant-numeric: tabular-nums;
372
+ }
373
+
374
+ #dsh-toolbox-root .tbx-v .tbx-pill {
375
+ margin-right: 6px;
376
+ }
377
+
378
+ #dsh-toolbox-root .tbx-v .tbx-note {
379
+ margin-left: 4px;
380
+ }
381
+
382
+ /* ------------------------------------------------------------------ 结论 / 指标 */
383
+
384
+ #dsh-toolbox-root .tbx-verdict {
385
+ display: flex;
386
+ gap: 10px;
387
+ align-items: flex-start;
388
+ margin: 10px 0;
389
+ padding: 11px 12px;
390
+ border-radius: 12px;
391
+ background: var(--tbx-ok-soft);
392
+ }
393
+
394
+ #dsh-toolbox-root .tbx-verdict[data-level="warn"] { background: var(--tbx-warn-soft); }
395
+ #dsh-toolbox-root .tbx-verdict[data-level="bad"] { background: var(--tbx-bad-soft); }
396
+
397
+ #dsh-toolbox-root .tbx-verdict-ico {
398
+ display: grid;
399
+ place-items: center;
400
+ width: 18px;
401
+ height: 18px;
402
+ margin-top: 1px;
403
+ flex: none;
404
+ border-radius: 50%;
405
+ background: rgba(74, 222, 128, 0.22);
406
+ color: #86efac;
407
+ font-size: 11px;
408
+ font-weight: 700;
409
+ }
410
+
411
+ #dsh-toolbox-root .tbx-verdict[data-level="warn"] .tbx-verdict-ico { background: rgba(251, 191, 36, 0.22); color: #fde68a; }
412
+ #dsh-toolbox-root .tbx-verdict[data-level="bad"] .tbx-verdict-ico { background: rgba(248, 113, 113, 0.22); color: #fecaca; }
413
+
414
+ #dsh-toolbox-root .tbx-verdict-txt {
415
+ min-width: 0;
416
+ }
417
+
418
+ #dsh-toolbox-root .tbx-verdict-txt b {
419
+ font-size: 12.5px;
420
+ font-weight: 600;
421
+ }
422
+
423
+ #dsh-toolbox-root .tbx-verdict-txt p {
424
+ margin: 2px 0 0;
425
+ color: var(--tbx-fg-2);
426
+ font-size: 11.5px;
427
+ line-height: 1.55;
428
+ }
429
+
430
+ #dsh-toolbox-root .tbx-metrics {
431
+ display: grid;
432
+ grid-template-columns: 1fr 1fr;
433
+ gap: 8px;
434
+ margin: 10px 0;
435
+ }
436
+
437
+ #dsh-toolbox-root .tbx-metric {
438
+ padding: 9px 10px;
439
+ border-radius: 11px;
440
+ background: var(--tbx-surface);
441
+ min-width: 0;
442
+ }
443
+
444
+ #dsh-toolbox-root .tbx-metric .l {
445
+ color: var(--tbx-fg-3);
446
+ font-size: 11px;
447
+ line-height: 1.35;
448
+ }
449
+
450
+ #dsh-toolbox-root .tbx-metric .v {
451
+ margin-top: 3px;
452
+ font-size: 16px;
453
+ font-weight: 600;
454
+ line-height: 1.25;
455
+ font-variant-numeric: tabular-nums;
456
+ word-break: break-word;
457
+ }
458
+
459
+ #dsh-toolbox-root .tbx-metric .s {
460
+ margin-top: 1px;
461
+ color: var(--tbx-fg-3);
462
+ font-size: 10.5px;
463
+ line-height: 1.4;
464
+ word-break: break-word;
465
+ }
466
+
467
+ #dsh-toolbox-root .tbx-metric--hero {
468
+ background: var(--tbx-surface-2);
469
+ }
470
+
471
+ #dsh-toolbox-root .tbx-metric--hero .v {
472
+ font-size: 19px;
473
+ letter-spacing: -0.01em;
474
+ }
475
+
476
+ /* ------------------------------------------------------------------ 按钮 / 分段 / chips */
477
+
478
+ #dsh-toolbox-root .tbx-btn {
479
+ display: flex;
480
+ align-items: center;
481
+ justify-content: center;
482
+ gap: 6px;
483
+ width: 100%;
484
+ min-height: 38px;
485
+ padding: 0 12px;
486
+ border: 0;
487
+ border-radius: 10px;
488
+ background: var(--tbx-accent);
489
+ color: #fff;
490
+ font-size: 13px;
491
+ font-weight: 600;
492
+ cursor: pointer;
493
+ transition: filter 0.15s;
494
+ touch-action: manipulation;
495
+ }
496
+
497
+ #dsh-toolbox-root .tbx-btn:hover { filter: brightness(1.08); }
498
+ #dsh-toolbox-root .tbx-btn:active { filter: brightness(0.94); }
499
+ #dsh-toolbox-root .tbx-btn:disabled { opacity: 0.5; cursor: default; filter: none; }
500
+
501
+ #dsh-toolbox-root .tbx-btn--ghost {
502
+ background: var(--tbx-surface-2);
503
+ color: var(--tbx-fg);
504
+ }
505
+
506
+ #dsh-toolbox-root .tbx-btn--danger {
507
+ background: var(--tbx-bad-soft);
508
+ color: #fca5a5;
509
+ }
510
+
511
+ #dsh-toolbox-root .tbx-btn--sm {
512
+ width: auto;
513
+ min-height: 28px;
514
+ padding: 0 10px;
515
+ font-size: 12px;
516
+ border-radius: 8px;
517
+ }
518
+
519
+ #dsh-toolbox-root .tbx-link {
520
+ padding: 0;
521
+ border: 0;
522
+ background: none;
523
+ color: var(--tbx-accent);
524
+ font-size: 11.5px;
525
+ cursor: pointer;
526
+ }
527
+
528
+ #dsh-toolbox-root .tbx-link:hover { text-decoration: underline; }
529
+
530
+ #dsh-toolbox-root .tbx-seg {
531
+ display: flex;
532
+ gap: 2px;
533
+ padding: 3px;
534
+ margin-bottom: 10px;
535
+ border-radius: 10px;
536
+ background: var(--tbx-surface);
537
+ }
538
+
539
+ #dsh-toolbox-root .tbx-seg button {
540
+ flex: 1;
541
+ min-width: 0;
542
+ height: 28px;
543
+ padding: 0 4px;
544
+ border: 0;
545
+ border-radius: 8px;
546
+ background: transparent;
547
+ color: var(--tbx-fg-2);
548
+ font-size: 12px;
549
+ cursor: pointer;
550
+ white-space: nowrap;
551
+ touch-action: manipulation;
552
+ }
553
+
554
+ #dsh-toolbox-root .tbx-seg button[data-on="true"] {
555
+ background: var(--tbx-surface-2);
556
+ color: var(--tbx-fg);
557
+ font-weight: 600;
558
+ box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
559
+ }
560
+
561
+ #dsh-toolbox-root .tbx-chips {
562
+ display: flex;
563
+ flex-wrap: wrap;
564
+ gap: 6px;
565
+ }
566
+
567
+ #dsh-toolbox-root .tbx-chip {
568
+ height: 27px;
569
+ padding: 0 10px;
570
+ border: 1px solid var(--tbx-line);
571
+ border-radius: 8px;
572
+ background: transparent;
573
+ color: var(--tbx-fg-2);
574
+ font-size: 12px;
575
+ cursor: pointer;
576
+ touch-action: manipulation;
577
+ }
578
+
579
+ #dsh-toolbox-root .tbx-chip[data-on="true"] {
580
+ border-color: var(--tbx-accent);
581
+ background: var(--tbx-accent-soft);
582
+ color: var(--tbx-fg);
583
+ }
584
+
585
+ #dsh-toolbox-root .tbx-chip--sm {
586
+ height: 24px;
587
+ padding: 0 8px;
588
+ font-size: 11.5px;
589
+ }
590
+
591
+ #dsh-toolbox-root .tbx-custom {
592
+ display: flex;
593
+ flex-direction: column;
594
+ gap: 8px;
595
+ margin-bottom: 10px;
596
+ padding: 10px;
597
+ border-radius: 11px;
598
+ background: var(--tbx-surface);
599
+ }
600
+
601
+ #dsh-toolbox-root .tbx-custom-row {
602
+ display: flex;
603
+ align-items: center;
604
+ gap: 8px;
605
+ flex-wrap: wrap;
606
+ }
607
+
608
+ #dsh-toolbox-root .tbx-custom-row .tbx-k {
609
+ width: 32px;
610
+ }
611
+
612
+ #dsh-toolbox-root .tbx-row-actions {
613
+ display: flex;
614
+ align-items: center;
615
+ gap: 8px;
616
+ margin-top: 8px;
617
+ }
618
+
619
+ #dsh-toolbox-root .tbx-row-actions > .tbx-btn {
620
+ width: auto;
621
+ flex: none;
622
+ }
623
+
624
+ #dsh-toolbox-root .tbx-row-actions > .tbx-hint {
625
+ flex: 1;
626
+ min-width: 0;
627
+ }
628
+
629
+ #dsh-toolbox-root .tbx-row-actions--top {
630
+ margin: 0;
631
+ }
632
+
633
+ /* ------------------------------------------------------------------ 运行中 / 进度 */
634
+
635
+ #dsh-toolbox-root .tbx-card {
636
+ padding: 10px 12px;
637
+ margin-bottom: 10px;
638
+ border-radius: 12px;
639
+ background: var(--tbx-surface);
640
+ }
641
+
642
+ #dsh-toolbox-root .tbx-jobline {
643
+ display: flex;
644
+ align-items: center;
645
+ gap: 8px;
646
+ }
647
+
648
+ #dsh-toolbox-root .tbx-jobline-txt {
649
+ flex: 1;
650
+ min-width: 0;
651
+ color: var(--tbx-fg-2);
652
+ font-size: 12px;
653
+ white-space: nowrap;
654
+ overflow: hidden;
655
+ text-overflow: ellipsis;
656
+ }
657
+
658
+ #dsh-toolbox-root .tbx-spin {
659
+ width: 12px;
660
+ height: 12px;
661
+ flex: none;
662
+ border-radius: 50%;
663
+ border: 2px solid rgba(255, 255, 255, 0.18);
664
+ border-top-color: var(--tbx-accent);
665
+ animation: tbx-spin 0.8s linear infinite;
666
+ }
667
+
668
+ @keyframes tbx-spin {
669
+ to { transform: rotate(360deg); }
670
+ }
671
+
672
+ #dsh-toolbox-root .tbx-prog {
673
+ height: 4px;
674
+ margin: 8px 0;
675
+ border-radius: 2px;
676
+ background: rgba(255, 255, 255, 0.09);
677
+ overflow: hidden;
678
+ }
679
+
680
+ #dsh-toolbox-root .tbx-prog i {
681
+ display: block;
682
+ height: 100%;
683
+ border-radius: 2px;
684
+ background: var(--tbx-accent);
685
+ transition: width 0.18s linear;
686
+ }
687
+
688
+ /* 面板关掉时的顶部细进度线(不挡任何操作) */
689
+ #dsh-toolbox-root .tbx-progress-top {
690
+ position: fixed;
691
+ top: 0;
692
+ left: 0;
693
+ right: 0;
694
+ height: 2px;
695
+ z-index: 319;
696
+ display: none;
697
+ pointer-events: none;
698
+ }
699
+
700
+ #dsh-toolbox-root .tbx-progress-top[data-on="1"] {
701
+ display: block;
702
+ }
703
+
704
+ #dsh-toolbox-root .tbx-progress-top i {
705
+ display: block;
706
+ height: 100%;
707
+ width: 2%;
708
+ background: linear-gradient(90deg, #5b8cff, #8fb0ff);
709
+ transition: width 0.18s linear;
710
+ }
711
+
712
+ /* ------------------------------------------------------------------ 实时读数 / 曲线 */
713
+
714
+ #dsh-toolbox-root .tbx-live {
715
+ margin-bottom: 10px;
716
+ }
717
+
718
+ #dsh-toolbox-root .tbx-live-num {
719
+ display: flex;
720
+ align-items: baseline;
721
+ gap: 6px;
722
+ font-variant-numeric: tabular-nums;
723
+ }
724
+
725
+ #dsh-toolbox-root .tbx-live-num b {
726
+ font-size: 30px;
727
+ font-weight: 650;
728
+ letter-spacing: -0.02em;
729
+ line-height: 1.1;
730
+ }
731
+
732
+ #dsh-toolbox-root .tbx-live-unit {
733
+ color: var(--tbx-fg-3);
734
+ font-size: 11.5px;
735
+ }
736
+
737
+ #dsh-toolbox-root .tbx-live-sub {
738
+ margin-top: 2px;
739
+ color: var(--tbx-fg-3);
740
+ font-size: 11.5px;
741
+ font-variant-numeric: tabular-nums;
742
+ }
743
+
744
+ #dsh-toolbox-root .tbx-chartwrap {
745
+ margin: 8px 0 10px;
746
+ padding: 6px 8px 2px;
747
+ border-radius: 11px;
748
+ background: var(--tbx-surface);
749
+ }
750
+
751
+ #dsh-toolbox-root .tbx-chart {
752
+ display: block;
753
+ width: 100%;
754
+ height: 86px;
755
+ }
756
+
757
+ #dsh-toolbox-root .tbx-chart--mini {
758
+ height: 64px;
759
+ }
760
+
761
+ /* ------------------------------------------------------------------ 体检明细 */
762
+
763
+ #dsh-toolbox-root .tbx-details {
764
+ margin: 6px 0 4px;
765
+ border-radius: 10px;
766
+ }
767
+
768
+ #dsh-toolbox-root .tbx-details > summary {
769
+ cursor: pointer;
770
+ list-style: none;
771
+ padding: 6px 2px;
772
+ color: var(--tbx-fg-2);
773
+ font-size: 12px;
774
+ user-select: none;
775
+ }
776
+
777
+ #dsh-toolbox-root .tbx-details > summary::-webkit-details-marker {
778
+ display: none;
779
+ }
780
+
781
+ #dsh-toolbox-root .tbx-details > summary::before {
782
+ content: "▸";
783
+ display: inline-block;
784
+ width: 14px;
785
+ color: var(--tbx-fg-3);
786
+ transition: transform 0.15s;
787
+ }
788
+
789
+ #dsh-toolbox-root .tbx-details[open] > summary::before {
790
+ transform: rotate(90deg);
791
+ }
792
+
793
+ #dsh-toolbox-root .tbx-detail-list {
794
+ display: flex;
795
+ flex-direction: column;
796
+ gap: 2px;
797
+ padding: 2px 0 6px;
798
+ }
799
+
800
+ #dsh-toolbox-root .tbx-detail-row {
801
+ display: flex;
802
+ align-items: baseline;
803
+ gap: 8px;
804
+ padding: 5px 2px;
805
+ font-size: 12px;
806
+ }
807
+
808
+ #dsh-toolbox-root .tbx-detail-dot {
809
+ width: 6px;
810
+ height: 6px;
811
+ flex: none;
812
+ align-self: center;
813
+ border-radius: 50%;
814
+ background: var(--tbx-ok);
815
+ }
816
+
817
+ #dsh-toolbox-root .tbx-detail-row[data-level="warn"] .tbx-detail-dot { background: var(--tbx-warn); }
818
+ #dsh-toolbox-root .tbx-detail-row[data-level="bad"] .tbx-detail-dot { background: var(--tbx-bad); }
819
+
820
+ #dsh-toolbox-root .tbx-detail-label {
821
+ flex: none;
822
+ width: 56px;
823
+ color: var(--tbx-fg-3);
824
+ font-size: 11.5px;
825
+ }
826
+
827
+ #dsh-toolbox-root .tbx-detail-value {
828
+ flex: 1;
829
+ min-width: 0;
830
+ font-variant-numeric: tabular-nums;
831
+ word-break: break-word;
832
+ }
833
+
834
+ #dsh-toolbox-root .tbx-detail-hint {
835
+ flex: none;
836
+ max-width: 44%;
837
+ color: var(--tbx-fg-3);
838
+ font-size: 10.5px;
839
+ text-align: right;
840
+ }
841
+
842
+ /* ------------------------------------------------------------------ 历史 */
843
+
844
+ #dsh-toolbox-root .tbx-hlist {
845
+ display: flex;
846
+ flex-direction: column;
847
+ }
848
+
849
+ #dsh-toolbox-root .tbx-hrow {
850
+ display: flex;
851
+ align-items: center;
852
+ gap: 10px;
853
+ padding: 8px 0;
854
+ border-bottom: 1px solid var(--tbx-line-2);
855
+ }
856
+
857
+ #dsh-toolbox-root .tbx-hrow:last-child {
858
+ border-bottom: 0;
859
+ }
860
+
861
+ #dsh-toolbox-root .tbx-hico {
862
+ display: grid;
863
+ place-items: center;
864
+ width: 24px;
865
+ height: 24px;
866
+ flex: none;
867
+ border-radius: 8px;
868
+ background: var(--tbx-surface-2);
869
+ color: var(--tbx-fg-2);
870
+ font-size: 12px;
871
+ }
872
+
873
+ #dsh-toolbox-root .tbx-hmid {
874
+ flex: 1;
875
+ min-width: 0;
876
+ }
877
+
878
+ #dsh-toolbox-root .tbx-hsum {
879
+ font-size: 12px;
880
+ line-height: 1.45;
881
+ white-space: nowrap;
882
+ overflow: hidden;
883
+ text-overflow: ellipsis;
884
+ }
885
+
886
+ #dsh-toolbox-root .tbx-htime {
887
+ margin-top: 1px;
888
+ color: var(--tbx-fg-3);
889
+ font-size: 10.5px;
890
+ }
891
+
892
+ #dsh-toolbox-root .tbx-badge {
893
+ flex: none;
894
+ padding: 2px 7px;
895
+ border-radius: 999px;
896
+ background: var(--tbx-surface-2);
897
+ color: var(--tbx-fg-2);
898
+ font-size: 10.5px;
899
+ }
900
+
901
+ #dsh-toolbox-root .tbx-badge[data-level="ok"] { color: #86efac; background: var(--tbx-ok-soft); }
902
+ #dsh-toolbox-root .tbx-badge[data-level="warn"] { color: #fde68a; background: var(--tbx-warn-soft); }
903
+ #dsh-toolbox-root .tbx-badge[data-level="bad"] { color: #fca5a5; background: var(--tbx-bad-soft); }
904
+
905
+ /* ------------------------------------------------------------------ 自动巡检 / 开关 */
906
+
907
+ #dsh-toolbox-root .tbx-switchrow {
908
+ display: flex;
909
+ align-items: center;
910
+ gap: 12px;
911
+ padding: 10px 12px;
912
+ border-radius: 12px;
913
+ background: var(--tbx-surface);
914
+ }
915
+
916
+ #dsh-toolbox-root .tbx-switchrow-txt {
917
+ flex: 1;
918
+ min-width: 0;
919
+ }
920
+
921
+ #dsh-toolbox-root .tbx-switchrow-title {
922
+ font-size: 12.5px;
923
+ line-height: 1.4;
924
+ }
925
+
926
+ #dsh-toolbox-root .tbx-switchrow .tbx-hint {
927
+ margin-top: 1px;
928
+ }
929
+
930
+ #dsh-toolbox-root .tbx-switch {
931
+ position: relative;
932
+ width: 38px;
933
+ height: 22px;
934
+ flex: none;
935
+ padding: 0;
936
+ border: 0;
937
+ border-radius: 11px;
938
+ background: rgba(255, 255, 255, 0.16);
939
+ cursor: pointer;
940
+ transition: background 0.16s;
941
+ }
942
+
943
+ #dsh-toolbox-root .tbx-switch::after {
944
+ content: "";
945
+ position: absolute;
946
+ top: 2px;
947
+ left: 2px;
948
+ width: 18px;
949
+ height: 18px;
950
+ border-radius: 50%;
951
+ background: #fff;
952
+ transition: transform 0.16s;
953
+ }
954
+
955
+ #dsh-toolbox-root .tbx-switch[data-on="true"] {
956
+ background: var(--tbx-accent);
957
+ }
958
+
959
+ #dsh-toolbox-root .tbx-switch[data-on="true"]::after {
960
+ transform: translateX(16px);
961
+ }
962
+
963
+ #dsh-toolbox-root .tbx-inline {
964
+ display: flex;
965
+ align-items: center;
966
+ gap: 6px;
967
+ flex-wrap: wrap;
968
+ margin: 8px 2px 0;
969
+ font-size: 11.5px;
970
+ color: var(--tbx-fg-3);
971
+ }
972
+
973
+ #dsh-toolbox-root .tbx-inline--warn {
974
+ color: #fde68a;
975
+ }
976
+
977
+ /* ------------------------------------------------------------------ toast */
978
+
979
+ #dsh-toolbox-root .tbx-toast {
980
+ position: fixed;
981
+ left: 50%;
982
+ bottom: 34px;
983
+ z-index: 321;
984
+ max-width: min(78vw, 420px);
985
+ padding: 8px 14px;
986
+ border: 1px solid var(--tbx-line);
987
+ border-radius: 10px;
988
+ background: rgba(40, 40, 45, 0.97);
989
+ color: var(--tbx-fg);
990
+ font-size: 12px;
991
+ line-height: 1.5;
992
+ text-align: center;
993
+ opacity: 0;
994
+ transform: translate(-50%, 10px);
995
+ pointer-events: none;
996
+ transition: opacity 0.16s ease, transform 0.16s ease;
997
+ }
998
+
999
+ #dsh-toolbox-root .tbx-toast[data-on="1"] {
1000
+ opacity: 1;
1001
+ transform: translate(-50%, 0);
1002
+ }
1003
+
1004
+ /* ------------------------------------------------------------------ 手机 / 粗指针 */
1005
+
1006
+ @media (pointer: coarse), (max-width: 1023px) {
1007
+ #dsh-toolbox-root .tbx-panel {
1008
+ left: 0;
1009
+ width: auto;
1010
+ border-left: 0;
1011
+ border-radius: 0;
1012
+ box-shadow: none;
1013
+ transform: translateX(100%);
1014
+ }
1015
+
1016
+ #dsh-toolbox-root[data-open="1"] .tbx-panel {
1017
+ transform: none;
1018
+ }
1019
+
1020
+ #dsh-toolbox-root .tbx-hd {
1021
+ padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px 16px;
1022
+ }
1023
+
1024
+ #dsh-toolbox-root .tbx-hd-titles {
1025
+ flex: 1;
1026
+ }
1027
+
1028
+ #dsh-toolbox-root .tbx-hd-title {
1029
+ font-size: 16px;
1030
+ }
1031
+
1032
+ #dsh-toolbox-root .tbx-hd-sub {
1033
+ font-size: 11.5px;
1034
+ }
1035
+
1036
+ #dsh-toolbox-root .tbx-iconbtn {
1037
+ width: 36px;
1038
+ height: 36px;
1039
+ border-radius: 10px;
1040
+ }
1041
+
1042
+ #dsh-toolbox-root .tbx-body {
1043
+ padding: 14px 16px calc(20px + env(safe-area-inset-bottom, 0px));
1044
+ }
1045
+
1046
+ #dsh-toolbox-root .tbx-ft {
1047
+ display: none;
1048
+ }
1049
+
1050
+ #dsh-toolbox-root .tbx-btn {
1051
+ min-height: 44px;
1052
+ font-size: 14px;
1053
+ }
1054
+
1055
+ #dsh-toolbox-root .tbx-btn--sm {
1056
+ min-height: 32px;
1057
+ font-size: 12.5px;
1058
+ }
1059
+
1060
+ #dsh-toolbox-root .tbx-seg button {
1061
+ height: 34px;
1062
+ font-size: 13px;
1063
+ }
1064
+
1065
+ #dsh-toolbox-root .tbx-chip {
1066
+ height: 32px;
1067
+ padding: 0 12px;
1068
+ font-size: 13px;
1069
+ }
1070
+
1071
+ #dsh-toolbox-root .tbx-chip--sm {
1072
+ height: 28px;
1073
+ font-size: 12px;
1074
+ }
1075
+
1076
+ #dsh-toolbox-root .tbx-metric--hero .v {
1077
+ font-size: 21px;
1078
+ }
1079
+
1080
+ #dsh-toolbox-root .tbx-live-num b {
1081
+ font-size: 38px;
1082
+ }
1083
+
1084
+ #dsh-toolbox-root .tbx-chart {
1085
+ height: 104px;
1086
+ }
1087
+
1088
+ #dsh-toolbox-root .tbx-toast {
1089
+ top: calc(env(safe-area-inset-top, 0px) + 64px);
1090
+ bottom: auto;
1091
+ transform: translate(-50%, -8px);
1092
+ }
1093
+
1094
+ #dsh-toolbox-root .tbx-toast[data-on="1"] {
1095
+ transform: translate(-50%, 0);
1096
+ }
1097
+
1098
+ #dsh-toolbox-root .tbx-detail-hint {
1099
+ max-width: 40%;
1100
+ }
1101
+ }