pi-hub-server 0.0.0-stage → 0.3.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/web/style.css ADDED
@@ -0,0 +1,782 @@
1
+ /* pi hub 网页端样式:暗色为主,移动端 dvh + 安全区。无外部字体/图标资源。 */
2
+
3
+ /* `hidden` 属性必须赢过 .screen/.field 的 display:flex,否则登录页与主界面会同时渲染。 */
4
+ [hidden] { display: none !important; }
5
+ :root {
6
+ color-scheme: dark;
7
+ --bg: #0f1115;
8
+ --bg-soft: #151922;
9
+ --bg-raise: #1b2130;
10
+ --line: #262d3b;
11
+ --fg: #e6e9ef;
12
+ --fg-dim: #97a0b3;
13
+ --accent: #5aa9ff;
14
+ --accent-dim: #1d3a5c;
15
+ --danger: #ff6b6b;
16
+ --ok: #4ade80;
17
+ --warn: #fbbf24;
18
+ --radius: 12px;
19
+ --safe-top: env(safe-area-inset-top, 0px);
20
+ --safe-bottom: env(safe-area-inset-bottom, 0px);
21
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", system-ui, sans-serif;
22
+ }
23
+
24
+ * {
25
+ box-sizing: border-box;
26
+ }
27
+
28
+ html,
29
+ body {
30
+ margin: 0;
31
+ padding: 0;
32
+ height: 100%;
33
+ background: var(--bg);
34
+ color: var(--fg);
35
+ -webkit-text-size-adjust: 100%;
36
+ }
37
+
38
+ body {
39
+ overflow: hidden;
40
+ }
41
+
42
+ .sr {
43
+ position: absolute;
44
+ width: 1px;
45
+ height: 1px;
46
+ overflow: hidden;
47
+ clip: rect(0 0 0 0);
48
+ }
49
+
50
+ .screen {
51
+ position: fixed;
52
+ inset: 0;
53
+ }
54
+
55
+ /* ---------- 登录 ---------- */
56
+ .login {
57
+ display: flex;
58
+ align-items: center;
59
+ justify-content: center;
60
+ padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
61
+ background: radial-gradient(1200px 600px at 50% -10%, #1b2436 0%, var(--bg) 60%);
62
+ }
63
+
64
+ .login-card {
65
+ width: min(420px, 100%);
66
+ background: var(--bg-soft);
67
+ border: 1px solid var(--line);
68
+ border-radius: 18px;
69
+ padding: 22px;
70
+ display: flex;
71
+ flex-direction: column;
72
+ gap: 14px;
73
+ }
74
+
75
+ .login-card h1 {
76
+ margin: 0;
77
+ font-size: 22px;
78
+ letter-spacing: 0.02em;
79
+ }
80
+
81
+ .hint {
82
+ margin: 0;
83
+ color: var(--fg-dim);
84
+ font-size: 13px;
85
+ line-height: 1.5;
86
+ }
87
+
88
+ .hint.small {
89
+ font-size: 12px;
90
+ }
91
+
92
+ .field {
93
+ display: flex;
94
+ flex-direction: column;
95
+ gap: 6px;
96
+ font-size: 12px;
97
+ color: var(--fg-dim);
98
+ }
99
+
100
+ input,
101
+ textarea,
102
+ select,
103
+ button {
104
+ font: inherit;
105
+ color: inherit;
106
+ }
107
+
108
+ input[type="password"],
109
+ input[type="search"],
110
+ input[type="text"],
111
+ input:not([type]),
112
+ textarea,
113
+ select {
114
+ background: var(--bg-raise);
115
+ border: 1px solid var(--line);
116
+ border-radius: 10px;
117
+ padding: 10px 12px;
118
+ font-size: 15px;
119
+ outline: none;
120
+ width: 100%;
121
+ }
122
+
123
+ input:focus,
124
+ textarea:focus,
125
+ select:focus {
126
+ border-color: var(--accent);
127
+ }
128
+
129
+ .btn {
130
+ border: 1px solid var(--line);
131
+ background: var(--bg-raise);
132
+ border-radius: 10px;
133
+ padding: 10px 14px;
134
+ font-size: 15px;
135
+ cursor: pointer;
136
+ touch-action: manipulation;
137
+ }
138
+
139
+ .btn.primary {
140
+ background: #1d4ed8;
141
+ border-color: #2563eb;
142
+ color: #fff;
143
+ }
144
+
145
+ .btn.danger {
146
+ background: #3a1d1d;
147
+ border-color: #6b2b2b;
148
+ color: #ffd7d7;
149
+ }
150
+
151
+ .btn:disabled {
152
+ opacity: 0.55;
153
+ }
154
+
155
+ .error {
156
+ margin: 0;
157
+ color: var(--danger);
158
+ font-size: 13px;
159
+ }
160
+
161
+ /* ---------- 主界面 ---------- */
162
+ .app {
163
+ display: grid;
164
+ grid-template-rows: auto 1fr auto;
165
+ height: 100dvh;
166
+ }
167
+
168
+ .topbar {
169
+ display: flex;
170
+ align-items: center;
171
+ gap: 8px;
172
+ padding: calc(8px + var(--safe-top)) 10px 8px;
173
+ background: var(--bg-soft);
174
+ border-bottom: 1px solid var(--line);
175
+ }
176
+
177
+ .icon-btn {
178
+ border: none;
179
+ background: transparent;
180
+ color: var(--fg-dim);
181
+ font-size: 18px;
182
+ padding: 6px 8px;
183
+ border-radius: 8px;
184
+ cursor: pointer;
185
+ touch-action: manipulation;
186
+ line-height: 1;
187
+ }
188
+
189
+ .icon-btn:active {
190
+ background: var(--bg-raise);
191
+ }
192
+
193
+ .title-block {
194
+ flex: 1;
195
+ min-width: 0;
196
+ display: flex;
197
+ flex-direction: column;
198
+ }
199
+
200
+ .title {
201
+ font-size: 15px;
202
+ font-weight: 600;
203
+ white-space: nowrap;
204
+ overflow: hidden;
205
+ text-overflow: ellipsis;
206
+ }
207
+
208
+ .sub {
209
+ font-size: 11px;
210
+ color: var(--fg-dim);
211
+ white-space: nowrap;
212
+ overflow: hidden;
213
+ text-overflow: ellipsis;
214
+ }
215
+
216
+ .dot {
217
+ width: 8px;
218
+ height: 8px;
219
+ border-radius: 50%;
220
+ background: var(--ok);
221
+ }
222
+
223
+ .dot.off {
224
+ background: #4b5563;
225
+ }
226
+
227
+ .dot.busy {
228
+ background: var(--warn);
229
+ }
230
+
231
+ .menu {
232
+ position: absolute;
233
+ top: calc(48px + var(--safe-top));
234
+ right: 8px;
235
+ z-index: 30;
236
+ background: var(--bg-raise);
237
+ border: 1px solid var(--line);
238
+ border-radius: 12px;
239
+ padding: 6px;
240
+ display: flex;
241
+ flex-direction: column;
242
+ min-width: 170px;
243
+ box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
244
+ }
245
+
246
+ .menu button {
247
+ border: none;
248
+ background: transparent;
249
+ text-align: left;
250
+ padding: 10px 12px;
251
+ border-radius: 8px;
252
+ font-size: 14px;
253
+ cursor: pointer;
254
+ }
255
+
256
+ .menu button:hover {
257
+ background: var(--bg-soft);
258
+ }
259
+
260
+ .menu button.danger {
261
+ color: var(--danger);
262
+ }
263
+
264
+ /* ---------- 消息 ---------- */
265
+ .messages {
266
+ overflow-y: auto;
267
+ overscroll-behavior: contain;
268
+ padding: 12px 12px 4px;
269
+ display: flex;
270
+ flex-direction: column;
271
+ gap: 12px;
272
+ scrollbar-width: thin;
273
+ }
274
+
275
+ .msg {
276
+ display: flex;
277
+ flex-direction: column;
278
+ gap: 6px;
279
+ max-width: 100%;
280
+ }
281
+
282
+ .msg.user {
283
+ align-items: flex-end;
284
+ }
285
+
286
+ .bubble {
287
+ padding: 10px 12px;
288
+ border-radius: var(--radius);
289
+ background: var(--bg-soft);
290
+ border: 1px solid var(--line);
291
+ font-size: 15px;
292
+ line-height: 1.6;
293
+ overflow-wrap: anywhere;
294
+ }
295
+
296
+ .msg.user .bubble {
297
+ background: #1c2a44;
298
+ border-color: #263d63;
299
+ max-width: 88%;
300
+ }
301
+
302
+ .meta {
303
+ font-size: 11px;
304
+ color: var(--fg-dim);
305
+ display: flex;
306
+ gap: 8px;
307
+ flex-wrap: wrap;
308
+ }
309
+
310
+ .empty {
311
+ margin: auto;
312
+ color: var(--fg-dim);
313
+ font-size: 14px;
314
+ text-align: center;
315
+ padding: 24px;
316
+ line-height: 1.7;
317
+ }
318
+
319
+ /* markdown */
320
+ .md > *:first-child {
321
+ margin-top: 0;
322
+ }
323
+
324
+ .md > *:last-child {
325
+ margin-bottom: 0;
326
+ }
327
+
328
+ .md p,
329
+ .md ul,
330
+ .md ol,
331
+ .md blockquote,
332
+ .md pre,
333
+ .md table {
334
+ margin: 0 0 8px;
335
+ }
336
+
337
+ .md h1,
338
+ .md h2,
339
+ .md h3,
340
+ .md h4 {
341
+ margin: 12px 0 6px;
342
+ line-height: 1.3;
343
+ }
344
+
345
+ .md h1 {
346
+ font-size: 19px;
347
+ }
348
+
349
+ .md h2 {
350
+ font-size: 17px;
351
+ }
352
+
353
+ .md h3 {
354
+ font-size: 16px;
355
+ }
356
+
357
+ .md code {
358
+ background: #0b0e14;
359
+ border: 1px solid var(--line);
360
+ border-radius: 5px;
361
+ padding: 1px 5px;
362
+ font-size: 13px;
363
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
364
+ }
365
+
366
+ .md pre {
367
+ background: #0b0e14;
368
+ border: 1px solid var(--line);
369
+ border-radius: 10px;
370
+ padding: 10px;
371
+ overflow-x: auto;
372
+ }
373
+
374
+ .md pre code {
375
+ background: none;
376
+ border: none;
377
+ padding: 0;
378
+ font-size: 12.5px;
379
+ line-height: 1.55;
380
+ display: block;
381
+ white-space: pre;
382
+ }
383
+
384
+ .md blockquote {
385
+ border-left: 3px solid var(--line);
386
+ padding-left: 10px;
387
+ color: var(--fg-dim);
388
+ }
389
+
390
+ .md ul,
391
+ .md ol {
392
+ padding-left: 20px;
393
+ }
394
+
395
+ .md a {
396
+ color: var(--accent);
397
+ }
398
+
399
+ .md hr {
400
+ border: none;
401
+ border-top: 1px solid var(--line);
402
+ margin: 10px 0;
403
+ }
404
+
405
+ .code-card {
406
+ border: 1px solid var(--line);
407
+ border-radius: 10px;
408
+ overflow: hidden;
409
+ margin-bottom: 8px;
410
+ background: #0b0e14;
411
+ }
412
+
413
+ .code-head {
414
+ display: flex;
415
+ justify-content: space-between;
416
+ align-items: center;
417
+ padding: 4px 8px;
418
+ background: var(--bg-raise);
419
+ font-size: 11px;
420
+ color: var(--fg-dim);
421
+ }
422
+
423
+ .code-head button {
424
+ border: none;
425
+ background: transparent;
426
+ color: var(--accent);
427
+ font-size: 11px;
428
+ cursor: pointer;
429
+ }
430
+
431
+ /* 思考 / 工具 */
432
+ .thinking-block {
433
+ border: 1px dashed var(--line);
434
+ border-radius: 10px;
435
+ background: #12161f;
436
+ font-size: 13px;
437
+ color: var(--fg-dim);
438
+ }
439
+
440
+ .thinking-block > summary {
441
+ padding: 6px 10px;
442
+ cursor: pointer;
443
+ font-size: 12px;
444
+ color: var(--fg-dim);
445
+ list-style: none;
446
+ }
447
+
448
+ .thinking-block > summary::-webkit-details-marker {
449
+ display: none;
450
+ }
451
+
452
+ .thinking-body {
453
+ padding: 0 10px 8px;
454
+ white-space: pre-wrap;
455
+ line-height: 1.55;
456
+ }
457
+
458
+ .tool-card {
459
+ border: 1px solid var(--line);
460
+ border-radius: 10px;
461
+ background: #12161f;
462
+ font-size: 12.5px;
463
+ overflow: hidden;
464
+ }
465
+
466
+ .tool-card > summary {
467
+ padding: 6px 10px;
468
+ cursor: pointer;
469
+ display: flex;
470
+ gap: 8px;
471
+ align-items: center;
472
+ list-style: none;
473
+ }
474
+
475
+ .tool-card > summary::-webkit-details-marker {
476
+ display: none;
477
+ }
478
+
479
+ .tool-name {
480
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
481
+ color: var(--accent);
482
+ }
483
+
484
+ .tool-state {
485
+ color: var(--fg-dim);
486
+ font-size: 11px;
487
+ }
488
+
489
+ .tool-state.err {
490
+ color: var(--danger);
491
+ }
492
+
493
+ .tool-body {
494
+ border-top: 1px solid var(--line);
495
+ padding: 8px 10px;
496
+ max-height: 320px;
497
+ overflow: auto;
498
+ }
499
+
500
+ .tool-body pre {
501
+ margin: 0;
502
+ white-space: pre-wrap;
503
+ word-break: break-word;
504
+ font-size: 11.5px;
505
+ color: var(--fg-dim);
506
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
507
+ }
508
+
509
+ .typing::after {
510
+ content: "▌";
511
+ animation: blink 1s steps(2) infinite;
512
+ color: var(--accent);
513
+ }
514
+
515
+ @keyframes blink {
516
+ 0%,
517
+ 50% {
518
+ opacity: 1;
519
+ }
520
+ 50.01%,
521
+ 100% {
522
+ opacity: 0;
523
+ }
524
+ }
525
+
526
+ .jump {
527
+ position: absolute;
528
+ right: 14px;
529
+ bottom: calc(96px + var(--safe-bottom));
530
+ z-index: 20;
531
+ border: 1px solid var(--line);
532
+ background: var(--bg-raise);
533
+ color: var(--fg);
534
+ border-radius: 999px;
535
+ padding: 6px 12px;
536
+ font-size: 12px;
537
+ cursor: pointer;
538
+ }
539
+
540
+ /* ---------- 输入区 ---------- */
541
+ .composer {
542
+ border-top: 1px solid var(--line);
543
+ background: var(--bg-soft);
544
+ padding: 8px 10px calc(8px + var(--safe-bottom));
545
+ display: flex;
546
+ flex-direction: column;
547
+ gap: 8px;
548
+ }
549
+
550
+ .composer textarea {
551
+ resize: none;
552
+ max-height: 40dvh;
553
+ min-height: 42px;
554
+ line-height: 1.45;
555
+ }
556
+
557
+ .composer-row {
558
+ display: flex;
559
+ gap: 6px;
560
+ align-items: center;
561
+ }
562
+
563
+ .select {
564
+ flex: 1;
565
+ min-width: 0;
566
+ }
567
+
568
+ .select select {
569
+ padding: 7px 8px;
570
+ font-size: 12px;
571
+ border-radius: 8px;
572
+ text-overflow: ellipsis;
573
+ }
574
+
575
+ .icon-btn.file {
576
+ cursor: pointer;
577
+ display: inline-flex;
578
+ align-items: center;
579
+ justify-content: center;
580
+ font-size: 16px;
581
+ }
582
+
583
+ .send {
584
+ padding: 8px 16px;
585
+ font-size: 14px;
586
+ white-space: nowrap;
587
+ }
588
+
589
+ .usage-bar {
590
+ display: flex;
591
+ justify-content: space-between;
592
+ gap: 10px;
593
+ font-size: 11px;
594
+ color: var(--fg-dim);
595
+ padding: 0 2px;
596
+ }
597
+
598
+ .attachments {
599
+ display: flex;
600
+ gap: 8px;
601
+ flex-wrap: wrap;
602
+ }
603
+
604
+ .chip {
605
+ display: inline-flex;
606
+ align-items: center;
607
+ gap: 6px;
608
+ background: var(--bg-raise);
609
+ border: 1px solid var(--line);
610
+ border-radius: 999px;
611
+ padding: 3px 8px;
612
+ font-size: 11px;
613
+ max-width: 220px;
614
+ }
615
+
616
+ .chip img {
617
+ width: 22px;
618
+ height: 22px;
619
+ border-radius: 6px;
620
+ object-fit: cover;
621
+ }
622
+
623
+ .chip span {
624
+ overflow: hidden;
625
+ text-overflow: ellipsis;
626
+ white-space: nowrap;
627
+ }
628
+
629
+ .chip button {
630
+ border: none;
631
+ background: transparent;
632
+ color: var(--fg-dim);
633
+ cursor: pointer;
634
+ font-size: 12px;
635
+ padding: 0;
636
+ }
637
+
638
+ .ui-request {
639
+ border: 1px solid #3b4a63;
640
+ border-radius: 10px;
641
+ padding: 10px;
642
+ background: #16202f;
643
+ display: flex;
644
+ flex-direction: column;
645
+ gap: 8px;
646
+ font-size: 13px;
647
+ }
648
+
649
+ .ui-request .row {
650
+ display: flex;
651
+ gap: 6px;
652
+ flex-wrap: wrap;
653
+ }
654
+
655
+ /* ---------- 抽屉 ---------- */
656
+ .drawer {
657
+ position: fixed;
658
+ top: 0;
659
+ left: 0;
660
+ bottom: 0;
661
+ width: min(86vw, 360px);
662
+ background: var(--bg-soft);
663
+ border-right: 1px solid var(--line);
664
+ z-index: 40;
665
+ display: flex;
666
+ flex-direction: column;
667
+ padding-top: var(--safe-top);
668
+ padding-bottom: var(--safe-bottom);
669
+ transform: translateX(0);
670
+ }
671
+
672
+ .drawer[hidden] {
673
+ display: none;
674
+ }
675
+
676
+ .drawer-head {
677
+ display: flex;
678
+ align-items: center;
679
+ gap: 8px;
680
+ padding: 10px;
681
+ }
682
+
683
+ .session-list {
684
+ flex: 1;
685
+ overflow-y: auto;
686
+ padding: 0 8px 8px;
687
+ }
688
+
689
+ .group-title {
690
+ font-size: 11px;
691
+ color: var(--fg-dim);
692
+ padding: 10px 6px 4px;
693
+ text-transform: uppercase;
694
+ letter-spacing: 0.04em;
695
+ overflow: hidden;
696
+ text-overflow: ellipsis;
697
+ white-space: nowrap;
698
+ }
699
+
700
+ .session-item {
701
+ display: flex;
702
+ flex-direction: column;
703
+ gap: 2px;
704
+ padding: 8px 10px;
705
+ border-radius: 10px;
706
+ cursor: pointer;
707
+ }
708
+
709
+ .session-item.active {
710
+ background: #1c2a44;
711
+ }
712
+
713
+ .session-item:active {
714
+ background: var(--bg-raise);
715
+ }
716
+
717
+ .session-item .name {
718
+ font-size: 14px;
719
+ white-space: nowrap;
720
+ overflow: hidden;
721
+ text-overflow: ellipsis;
722
+ }
723
+
724
+ .session-item .line {
725
+ font-size: 11px;
726
+ color: var(--fg-dim);
727
+ white-space: nowrap;
728
+ overflow: hidden;
729
+ text-overflow: ellipsis;
730
+ }
731
+
732
+ .badge {
733
+ font-size: 10px;
734
+ border: 1px solid var(--line);
735
+ border-radius: 999px;
736
+ padding: 0 6px;
737
+ color: var(--fg-dim);
738
+ }
739
+
740
+ .badge.live {
741
+ border-color: #2f6b3f;
742
+ color: var(--ok);
743
+ }
744
+
745
+ .new-session {
746
+ border-top: 1px solid var(--line);
747
+ padding: 8px 10px 12px;
748
+ display: flex;
749
+ flex-direction: column;
750
+ gap: 8px;
751
+ }
752
+
753
+ .scrim {
754
+ position: fixed;
755
+ inset: 0;
756
+ background: rgba(0, 0, 0, 0.5);
757
+ z-index: 35;
758
+ }
759
+
760
+ .toast {
761
+ position: fixed;
762
+ left: 50%;
763
+ bottom: calc(90px + var(--safe-bottom));
764
+ transform: translateX(-50%);
765
+ background: #22293a;
766
+ border: 1px solid var(--line);
767
+ color: var(--fg);
768
+ padding: 8px 14px;
769
+ border-radius: 999px;
770
+ font-size: 13px;
771
+ z-index: 50;
772
+ max-width: 90vw;
773
+ }
774
+
775
+ @media (min-width: 760px) {
776
+ .messages {
777
+ padding: 16px max(16px, calc((100% - 900px) / 2));
778
+ }
779
+ .msg.user .bubble {
780
+ max-width: 70%;
781
+ }
782
+ }