-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
3583 lines (3383 loc) · 189 KB
/
index.html
File metadata and controls
3583 lines (3383 loc) · 189 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover" />
<meta name="theme-color" content="#0F172A" />
<meta name="description" content="码流(CodeFlow)——AI 驱动的人机协作中枢,用手机轻松驾驭 AI,让指令高效流转、直达团队。 CodeFlow — AI-powered human-machine collaboration hub. Master AI from your mobile device, make commands flow efficiently and reach your team directly." />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<link rel="manifest" href="./manifest.json?v=2.0.1" />
<link rel="apple-touch-icon" href="./logo-192.png" />
<link rel="apple-touch-icon" sizes="192x192" href="./logo-192.png" />
<link rel="apple-touch-icon" sizes="512x512" href="./logo-512.png" />
<title>码流 CodeFlow · 工作台</title>
<script src="https://cdn.jsdelivr.net/npm/jsqr@1.4.0/dist/jsQR.min.js" async></script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@500;600;700&family=Fira+Sans:wght@400;500;600;700&display=swap');
:root {
--bg: #141e30;
--bg2: #243447;
--bg3: #3a4d63;
--card: linear-gradient(145deg, rgba(40,55,78,.94) 0%, rgba(30,44,64,.96) 50%, rgba(48,65,88,.92) 100%);
--card-flat: rgba(36,52,71,.92);
--card-border: rgba(180,200,220,.18);
--card-shine: rgba(255,255,255,.06);
--card-hover: rgba(180,200,220,.28);
--blue: #3b82f6;
--blue-hi: #60a5fa;
--blue-glow: rgba(59,130,246,.3);
--green: #22c55e;
--red: #ef4444;
--amber: #fbbf24;
--text: #F8FAFC;
--text2: #CBD5E1;
--text3: #94A3B8;
--header-h: 78px;
--safe-top: env(safe-area-inset-top, 0px);
--r: 16px;
--r2: 12px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
html, body {
width: 100%; height: 100%;
margin: 0; padding: 0;
overflow: hidden;
overscroll-behavior: none;
-webkit-overflow-scrolling: touch;
touch-action: pan-y;
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: transparent;
user-select: none; -webkit-user-select: none;
font-family: -apple-system, "SF Pro Display", "Helvetica Neue", "Fira Sans", "Segoe UI", Arial, sans-serif;
font-size: 14px; color: var(--text);
-webkit-font-smoothing: antialiased;
position: fixed; inset: 0;
}
body {
background: linear-gradient(160deg, #1c2e4a 0%, #162540 35%, #1a3050 65%, #142238 100%);
position: fixed; inset: 0; width: 100%; height: 100%;
}
input, textarea, select { user-select: text; -webkit-user-select: text; touch-action: manipulation; }
.app-shell {
position: fixed; inset: 0;
width: 100%; height: 100%;
display: flex; flex-direction: column;
overflow: hidden;
background: linear-gradient(160deg, #1c2e4a 0%, #162540 35%, #1a3050 65%, #142238 100%);
box-shadow: 0 0 60px rgba(0,0,0,.5);
}
/* ══ 固定顶部 Header(金属拉丝) ══ */
.app-header {
flex-shrink: 0;
padding: calc(var(--safe-top) + 10px) 14px 8px;
display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
background: linear-gradient(180deg, #263e5c 0%, #1e3250 50%, #182a44 100%);
border-bottom: 1px solid rgba(200,218,235,.18);
box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 2px 16px rgba(0,0,0,.3);
position: relative; z-index: 20;
}
.header-row1 {
display: flex; align-items: center; gap: 10px; width: 100%;
}
.header-logo { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 1px 3px rgba(0,0,0,.5)); }
.header-brand { font-family:"Fira Code",monospace; font-weight:700; font-size:16px; color:#F8FAFC; letter-spacing:.05em; white-space:nowrap; text-shadow:0 0 12px rgba(96,165,250,.2), 0 1px 3px rgba(0,0,0,.5); flex:1; }
.header-right { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.status-light { width:11px; height:11px; border-radius:50%; background:var(--red); box-shadow:0 0 0 2px rgba(15,23,42,.8),0 0 8px rgba(239,68,68,.4); transition:background .3s,box-shadow .3s; }
.status-light.ok { background:var(--green); box-shadow:0 0 0 2px rgba(15,23,42,.8),0 0 12px rgba(34,197,94,.5); animation:pulse-green 2s ease-in-out infinite; }
@keyframes pulse-green { 0%,100%{box-shadow:0 0 0 2px rgba(15,23,42,.8),0 0 12px rgba(34,197,94,.5);} 50%{box-shadow:0 0 0 2px rgba(15,23,42,.8),0 0 20px rgba(34,197,94,.7);} }
.header-my-btn {
background: linear-gradient(180deg,#3b82f6,#2563eb); border:1px solid rgba(96,165,250,.3); border-radius:20px;
color:#fff; font-size:12px; font-weight:700; padding:5px 13px;
cursor:pointer; white-space:nowrap; margin-top:0; width:auto;
box-shadow: 0 2px 8px rgba(37,99,235,.4), inset 0 1px 0 rgba(255,255,255,.15);
}
.header-my-btn:hover { background:linear-gradient(180deg,#60a5fa,#3b82f6); }
.header-my-btn:active { transform:translateY(1px); box-shadow: 0 1px 4px rgba(37,99,235,.3); }
.header-refresh-btn {
background: none; border: none; color: var(--text3); font-size: 16px; padding: 4px 6px;
cursor: pointer; line-height: 1; width: auto; margin: 0; opacity: 0.7; transition: opacity .2s, transform .4s;
}
.header-refresh-btn:hover { opacity: 1; color: #60a5fa; }
.header-refresh-btn.spin { animation: spin 0.6s linear; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.header-rail-btn {
display: none;
width: auto;
margin: 0;
padding: 5px 10px;
min-width: 40px;
font-size: 15px;
line-height: 1;
background: rgba(36, 52, 71, 0.9);
border: 1px solid rgba(200, 218, 235, 0.22);
border-radius: 10px;
color: var(--text2);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.header-rail-btn:hover { border-color: rgba(96, 165, 250, 0.35); color: var(--text); }
@media (min-width: 720px) {
.header-rail-btn { display: inline-block; }
}
.header-slogan {
width: 100%; font-size:11px; color:var(--text3); text-align:center;
padding: 3px 0 0; letter-spacing: .04em;
opacity:.75;
}
/* ══ 滚动内容区 ══ */
/* ══ 工作台分栏:宽屏侧栏 Agent,窄屏纵向堆叠 ══ */
.workspace-split {
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
min-width: 0;
}
.workspace-top {
flex-shrink: 0;
padding: 12px 14px 8px;
padding-top: 12px;
}
.agent-rail {
flex-shrink: 0;
padding: 0 14px 10px;
}
.agent-rail-inner.card {
margin-bottom: 0;
}
.workspace-main-column {
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
overflow: hidden;
}
.app-content {
flex: 1;
overflow-y: auto;
overflow-x: hidden;
-webkit-overflow-scrolling: touch;
overscroll-behavior-y: contain;
overscroll-behavior-x: none;
padding: 4px 14px calc(env(safe-area-inset-bottom, 0px) + 24px);
}
@media (min-width: 720px) {
.workspace-split {
display: grid;
grid-template-columns: 118px minmax(0, 1fr);
grid-template-rows: auto minmax(0, 1fr);
}
.workspace-split.rail-right {
grid-template-columns: minmax(0, 1fr) 118px;
}
.agent-rail {
grid-column: 1;
grid-row: 1 / -1;
padding: 12px 0 12px 12px;
overflow-y: auto;
border-right: 1px solid rgba(200, 218, 235, 0.14);
align-self: stretch;
}
.workspace-split.rail-right .agent-rail {
grid-column: 2;
border-right: none;
border-left: 1px solid rgba(200, 218, 235, 0.14);
padding: 12px 12px 12px 0;
}
.workspace-top {
grid-column: 2;
grid-row: 1;
padding: 12px 14px 8px 12px;
}
.workspace-split.rail-right .workspace-top {
grid-column: 1;
padding: 12px 12px 8px 14px;
}
.workspace-main-column {
grid-column: 2;
grid-row: 2;
min-height: 0;
}
.workspace-split.rail-right .workspace-main-column {
grid-column: 1;
}
.role-grid.is-agent-rail {
grid-template-columns: 1fr;
gap: 8px;
}
.role-grid.is-agent-rail .team-icon-card {
padding: 10px 6px 8px;
}
.role-grid.is-agent-rail .team-icon {
width: 36px;
height: 36px;
font-size: 12px;
}
.role-grid.is-agent-rail .team-role-state {
font-size: 9px;
line-height: 1.2;
}
}
.app-content::-webkit-scrollbar,
.agent-rail::-webkit-scrollbar { width: 4px; }
.app-content::-webkit-scrollbar-track,
.agent-rail::-webkit-scrollbar-track { background: rgba(148, 163, 184, 0.08); }
.app-content::-webkit-scrollbar-thumb,
.agent-rail::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.25); border-radius: 2px; }
/* ══ 通用卡片(金属感) ══ */
.card {
position:relative; overflow:hidden;
background: linear-gradient(180deg, #324a68 0%, #283e5a 50%, #223450 100%);
border:1px solid rgba(200,218,235,.22); border-radius:var(--r);
padding:16px; margin-bottom:12px;
box-shadow:
inset 0 1px 0 rgba(255,255,255,.18),
inset 0 -1px 0 rgba(0,0,0,.12),
0 3px 0 #182838,
0 5px 16px rgba(0,0,0,.22);
color:var(--text);
transition: border-color .2s ease, box-shadow .2s ease, transform .15s ease;
}
.card:hover { border-color: rgba(200,218,235,.3); transform:translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), inset 0 -1px 0 rgba(0,0,0,.12), 0 4px 0 #182838, 0 7px 20px rgba(0,0,0,.25); }
.card::before {
content:""; position:absolute; inset:0; border-radius:inherit;
background: linear-gradient(180deg, rgba(255,255,255,.1) 0%, transparent 40%);
pointer-events:none;
}
.card-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:8px; }
.card-title { font-family:"Fira Code",monospace; font-size:13px; font-weight:700; color:var(--text); margin:0; }
.muted { color:var(--text3); font-size:12px; }
.note { color:var(--text3); font-size:11px; margin-top:6px; }
/* ══ 0. 绑定提示横幅 ══ */
.bind-banner {
display:flex; align-items:center; justify-content:space-between; gap:8px;
background:linear-gradient(135deg, rgba(251,191,36,.18) 0%, rgba(245,158,11,.12) 100%);
border:1px solid rgba(251,191,36,.4); border-radius:var(--r2);
padding:10px 14px; margin-bottom:12px;
font-size:13px; color:var(--amber);
animation: banner-pulse 2s ease-in-out infinite;
}
.bind-banner-btn {
background:var(--amber); color:#000; border:none; border-radius:6px;
padding:5px 12px; font-size:12px; font-weight:600; cursor:pointer;
white-space:nowrap; flex-shrink:0;
}
@keyframes banner-pulse {
0%,100% { opacity:1; } 50% { opacity:.75; }
}
/* ══ 1. 看板区:4个统计卡片 ══ */
.stat-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:14px; }
.stat-btn {
display:flex; align-items:center; justify-content:space-between;
background: linear-gradient(180deg, #3a5575 0%, #2e4662 40%, #263a54 100%);
border:1px solid rgba(200,218,235,.25); border-radius:var(--r2);
padding:12px 14px; cursor:pointer; margin:0; width:auto;
box-shadow:
inset 0 1px 0 rgba(255,255,255,.2),
inset 0 -1px 0 rgba(0,0,0,.15),
0 4px 0 #1a2a40,
0 6px 12px rgba(0,0,0,.25);
transition:all .15s ease; color:var(--text);
position:relative; overflow:hidden;
}
.stat-btn::after { content:""; position:absolute; inset:0; background:linear-gradient(180deg, rgba(255,255,255,.1) 0%, transparent 40%); pointer-events:none; border-radius:inherit; }
.stat-btn:hover { border-color:rgba(96,165,250,.4); box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 -1px 0 rgba(0,0,0,.15), 0 4px 0 #1a2a40, 0 6px 12px rgba(0,0,0,.25), 0 0 20px rgba(59,130,246,.1); transform:translateY(-1px); }
.stat-btn:active { transform:translateY(3px); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 #1a2a40, 0 2px 4px rgba(0,0,0,.2); }
.stat-label { font-size:11px; color:#e2e8f0; font-weight:700; letter-spacing:.02em; text-shadow:0 1px 2px rgba(0,0,0,.4); }
.stat-num { font-size:22px; font-weight:800; color:#1a6ef5; font-family:"Fira Code",monospace; text-shadow: 0 0 12px rgba(26,110,245,.5); }
/* ══ 2. 团队4图标 ══ */
.team-section { margin-bottom:12px; }
.role-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
.team-icon-card {
text-align:center;
background: linear-gradient(180deg, #3a5575 0%, #2e4662 50%, #263a54 100%);
border:1px solid rgba(200,218,235,.22); border-radius:var(--r);
padding:12px 4px 10px; cursor:pointer;
box-shadow:
inset 0 1px 0 rgba(255,255,255,.18),
inset 0 -1px 0 rgba(0,0,0,.1),
0 3px 0 #1a2a3e,
0 5px 12px rgba(0,0,0,.2);
transition:all .15s ease;
}
.team-icon-card:hover { border-color:rgba(96,165,250,.35); transform:translateY(-2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), inset 0 -1px 0 rgba(0,0,0,.1), 0 4px 0 #1a2a3e, 0 7px 16px rgba(0,0,0,.22); }
.team-icon-card:active { transform:translateY(2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 #1a2a3e, 0 2px 4px rgba(0,0,0,.15); }
.team-icon-card.active { border-color:var(--blue); background:linear-gradient(160deg, rgba(30,50,80,.95) 0%, rgba(20,35,65,.98) 60%, rgba(40,60,90,.9) 100%); box-shadow:inset 0 1px 0 rgba(255,255,255,.06), 0 0 28px rgba(59,130,246,.12), 0 4px 16px rgba(0,0,0,.25); }
.team-icon { width:44px; height:44px; margin:0 auto 6px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-weight:800; font-size:12px; color:#fff; background:linear-gradient(145deg,#5c9cf5 0%,#3b82f6 50%,#2563eb 100%); box-shadow:inset 0 1px 0 rgba(255,255,255,.3), 0 4px 12px rgba(59,130,246,.4); transition:box-shadow .25s ease-out; letter-spacing:-0.5px; line-height:1.1; text-align:center; padding:2px; }
.team-icon-label { font-size:9px; color:var(--text2); margin-top:1px; text-align:center; max-width:60px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.team-leader-star { font-size:10px; color:#fbbf24; vertical-align:super; margin-left:1px; line-height:1; }
.team-icon-card:hover .team-icon { box-shadow:0 4px 16px rgba(59,130,246,.55); }
.team-icon-card.active .team-icon { box-shadow:0 0 22px rgba(59,130,246,.5), 0 4px 12px rgba(59,130,246,.4); }
.team-role-state { margin-top:4px; font-size:10px; color:var(--text3); }
/* ══ 3. 任务列表 ══ */
.task-section {}
.section-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:8px; }
.section-title { font-family:"Fira Code",monospace; font-size:13px; font-weight:700; color:var(--text); margin:0; }
.task-stack { display:grid; gap:6px; }
.task-card {
cursor:pointer; position:relative; overflow:hidden;
background: linear-gradient(180deg, #344e6e 0%, #2a4260 40%, #243a54 100%);
border:1px solid rgba(200,218,235,.2); border-radius:var(--r2); padding:12px;
box-shadow:
inset 0 1px 0 rgba(255,255,255,.16),
inset 0 -1px 0 rgba(0,0,0,.1),
0 3px 0 #1a2a3e,
0 5px 12px rgba(0,0,0,.2);
transition:all .15s ease; color:var(--text);
}
.task-card:hover { border-color:rgba(96,165,250,.35); transform:translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), inset 0 -1px 0 rgba(0,0,0,.1), 0 4px 0 #1a2a3e, 0 6px 16px rgba(0,0,0,.22); }
.task-card:active { transform:translateY(2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 #1a2a3e, 0 2px 4px rgba(0,0,0,.15); }
.task-card.active { border-color:var(--blue); background:linear-gradient(180deg, #2e4e78 0%, #264270 40%, #1e3660 100%); box-shadow:inset 0 1px 0 rgba(255,255,255,.14), 0 3px 0 #162840, 0 0 20px rgba(59,130,246,.12), 0 5px 12px rgba(0,0,0,.2); }
.task-head { display:flex; align-items:center; justify-content:space-between; gap:6px; }
.task-title { font-size:13px; font-weight:700; color:var(--text); flex:1; line-height:1.3; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.task-meta { display:flex; flex-wrap:wrap; gap:4px; margin-top:5px; }
.task-line { margin-top:4px; font-size:11px; color:var(--text3); }
.badge { display:inline-block; font-size:10px; padding:3px 8px; border-radius:99px; background:rgba(148,163,184,.12); border:1px solid rgba(148,163,184,.2); color:var(--text2); font-weight:600; letter-spacing:.02em; }
.badge.priority { background:rgba(239,68,68,.15); border-color:rgba(239,68,68,.3); color:#fca5a5; }
.badge.type { background:rgba(129,140,248,.15); border-color:rgba(129,140,248,.3); color:#a5b4fc; }
.badge.doing { background:rgba(251,191,36,.15); border-color:rgba(251,191,36,.3); color:#fcd34d; }
.badge.done { background:rgba(34,197,94,.15); border-color:rgba(34,197,94,.3); color:#86efac; }
.badge.reply { background:rgba(34,197,94,.15); border-color:rgba(34,197,94,.3); color:#86efac; }
.badge.todo { background:rgba(129,140,248,.12); border-color:rgba(129,140,248,.25); color:#a5b4fc; }
.badge.status-published { background:rgba(96,165,250,.15); border-color:rgba(96,165,250,.3); color:#93c5fd; }
.badge.status-received { background:rgba(34,197,94,.15); border-color:rgba(34,197,94,.3); color:#86efac; }
.badge.status-doing { background:rgba(251,191,36,.15); border-color:rgba(251,191,36,.3); color:#fcd34d; }
.badge.status-waiting { background:rgba(251,191,36,.12); border-color:rgba(251,191,36,.25); color:#fde68a; }
.badge.status-done { background:rgba(34,197,94,.15); border-color:rgba(34,197,94,.3); color:#86efac; }
.badge.status-offline { background:rgba(148,163,184,.12); border-color:rgba(148,163,184,.25); color:#94a3b8; }
.role-card.offline .team-icon { opacity:.4; filter:grayscale(1); }
.role-card.offline .team-role-state { opacity:.5; }
.pair-summary { margin-top:6px; padding:6px 8px; border-radius:8px; background:rgba(59,130,246,.1); border-left:3px solid var(--blue); font-size:11px; color:var(--text2); }
/* ══ Agent 实时状态 ══ */
.agent-live-hint { margin-top:3px; font-size:9px; color:var(--text3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:72px; }
.agent-live-dot { display:inline-block; width:6px; height:6px; border-radius:50%; margin-right:3px; vertical-align:middle; }
.agent-live-dot.running { background:#22c55e; box-shadow:0 0 6px rgba(34,197,94,.6); animation:pulse-dot 1.2s ease-in-out infinite; }
.agent-live-dot.idle { background:#94a3b8; }
.agent-live-dot.waiting { background:#fbbf24; box-shadow:0 0 6px rgba(251,191,36,.5); animation:pulse-dot 2s ease-in-out infinite; }
@keyframes pulse-dot { 0%,100%{opacity:1;} 50%{opacity:.4;} }
/* ══ Agent 工作实况面板(底部弹出浮层) ══ */
.agent-monitor-panel {
position:fixed; left:0; right:0; bottom:0; z-index:900;
max-height:70vh; background:rgba(14,20,36,.97); backdrop-filter:blur(16px);
border-top:1px solid rgba(180,200,220,.18); border-radius:16px 16px 0 0;
box-shadow:0 -4px 24px rgba(0,0,0,.4);
transform:translateY(100%); transition:transform .28s cubic-bezier(.4,0,.2,1);
overflow:hidden; display:flex; flex-direction:column;
pointer-events:none; opacity:0;
}
.agent-monitor-panel.visible { transform:translateY(0); pointer-events:auto; opacity:1; }
.agent-monitor-header { display:flex; align-items:center; justify-content:space-between; padding:12px 16px 8px; flex-shrink:0; }
.agent-monitor-title { font-size:14px; font-weight:700; color:var(--text); }
.agent-monitor-status { font-size:11px; color:var(--text2); }
.agent-monitor-meta { display:flex; flex-wrap:wrap; gap:8px; padding:4px 16px 8px; font-size:10px; color:var(--text3); flex-shrink:0; border-bottom:1px solid rgba(180,200,220,.1); }
.agent-monitor-messages { flex:1; overflow-y:auto; padding-bottom:env(safe-area-inset-bottom,12px); }
.agent-msg { padding:8px 12px 8px 12px; font-size:12px; line-height:1.6; display:flex; flex-direction:column; }
.agent-msg.user { align-items:flex-end; }
.agent-msg.assistant { align-items:flex-start; }
.agent-msg-role { font-size:10px; font-weight:600; margin-bottom:3px; }
.agent-msg-role.user { color:#60a5fa; }
.agent-msg-role.assistant { color:#a78bfa; }
.agent-msg-type { display:inline-block; font-size:9px; padding:1px 5px; border-radius:4px; margin-left:6px; background:rgba(148,163,184,.15); color:var(--text3); }
.agent-msg-body { max-width:92%; word-break:break-word; color:var(--text2); padding:7px 10px; border-radius:10px; }
.agent-msg.user .agent-msg-body { background:rgba(96,165,250,.13); border-radius:10px 10px 2px 10px; }
.agent-msg.assistant .agent-msg-body { background:rgba(139,92,246,.10); border-radius:10px 10px 10px 2px; }
/* Markdown 元素 */
.agent-msg-body strong { color:var(--text); }
.agent-msg-body em { color:var(--text3); font-style:italic; }
.agent-msg-body .am-heading { font-weight:700; color:var(--text); margin:4px 0 2px; font-size:13px; }
.agent-msg-body .am-li { padding-left:10px; color:var(--text2); }
.agent-msg-body .am-li::before { content:"• "; color:#60a5fa; }
.agent-msg-body .am-gap { height:6px; }
.agent-msg-body .am-pre { background:rgba(0,0,0,.3); border-radius:6px; padding:6px 8px; font-size:10px; font-family:monospace; overflow-x:auto; white-space:pre-wrap; margin:4px 0; color:#86efac; }
.agent-msg-body .am-code { background:rgba(0,0,0,.25); border-radius:3px; padding:1px 4px; font-family:monospace; font-size:10px; color:#fbbf24; }
.agent-monitor-empty { padding:32px 16px; text-align:center; font-size:13px; color:var(--text3); }
.agent-monitor-close { background:none; border:none; color:var(--text3); cursor:pointer; font-size:16px; padding:4px 8px; min-height:auto; min-width:auto; box-shadow:none; }
.agent-monitor-close:hover { color:var(--text); }
.agent-monitor-overlay { position:fixed; inset:0; z-index:899; background:rgba(0,0,0,.45); opacity:0; pointer-events:none; transition:opacity .25s; }
.agent-monitor-overlay.visible { opacity:1; pointer-events:auto; }
.agent-monitor-drag-bar { width:36px; height:4px; margin:8px auto 0; border-radius:2px; background:rgba(180,200,220,.25); flex-shrink:0; }
/* 任务详情展开区 */
.detail-expand { display:none; margin-top:10px; padding-top:10px; border-top:1px solid rgba(148,163,184,.1); }
.detail-expand.open { display:block; }
.detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.detail-field { background:rgba(20,30,48,.55); border:1px solid rgba(180,200,220,.12); border-radius:var(--r2); padding:8px 10px; box-shadow:inset 0 1px 3px rgba(0,0,0,.1); }
.detail-label { font-size:10px; color:var(--text3); text-transform:uppercase; letter-spacing:.05em; }
.detail-value { margin-top:4px; font-size:12px; color:var(--text); word-break:break-all; }
/* 任务详情压缩头部 */
.detail-compact-header { padding:8px 10px; background:rgba(20,30,48,.55); border:1px solid rgba(180,200,220,.12); border-radius:var(--r2); margin-bottom:4px; }
.detail-compact-id { font-size:11px; color:var(--text3); font-family:"Fira Code",monospace; }
.detail-compact-file { font-size:12px; color:var(--text); font-family:"Fira Code",monospace; font-weight:600; margin-top:2px; word-break:break-all; }
.detail-compact-pills { display:flex; flex-wrap:wrap; gap:4px; margin-top:6px; }
.detail-pill { display:inline-flex; align-items:center; gap:3px; background:rgba(255,255,255,.06); border:1px solid rgba(180,200,220,.12); border-radius:20px; padding:2px 7px; font-size:10px; color:var(--text3); white-space:nowrap; }
.detail-pill b { color:var(--text2); font-weight:600; }
.detail-section { margin-top:8px; background:rgba(20,30,48,.55); border:1px solid rgba(180,200,220,.12); border-radius:var(--r); padding:10px; box-shadow:inset 0 1px 3px rgba(0,0,0,.1); }
.detail-section h4 { margin:0 0 6px; font-size:12px; font-family:"Fira Code",monospace; color:var(--text2); }
.detail-body-text { white-space:pre-wrap; line-height:1.7; color:var(--text2); font-size:12px; max-height:260px; overflow-y:auto; }
.detail-tabs { display:flex; gap:6px; margin-top:8px; }
.detail-tab-btn { width:auto; margin-top:0; padding:6px 14px; border-radius:99px; background:rgba(20,30,48,.55); color:var(--text3); font-size:11px; font-weight:700; border:1px solid rgba(180,200,220,.12); box-shadow:inset 0 1px 2px rgba(0,0,0,.08); }
.detail-tab-btn.active { background:var(--blue); border-color:var(--blue); color:#fff; }
.detail-view { display:none; margin-top:8px; }
.detail-view.active { display:block; }
.detail-markdown { white-space:pre-wrap; line-height:1.7; color:var(--text2); font-size:12px; background:rgba(20,30,48,.55); border:1px solid rgba(180,200,220,.12); border-radius:var(--r2); padding:10px; overflow:auto; box-shadow:inset 0 1px 3px rgba(0,0,0,.1); user-select:text; -webkit-user-select:text; }
/* 任务详情页里的 MD 原文:撑满卡片,覆盖 max-height */
.fp-markdown-body { max-height:none !important; }
.detail-file-line { margin-top:5px; font-size:11px; color:var(--text3); }
.task-record-list { display:grid; gap:6px; }
.task-record-item { max-width:92%; padding:8px 10px; border-radius:var(--r2); background:rgba(20,30,48,.55); border:1px solid rgba(180,200,220,.12); color:var(--text); font-size:12px; box-shadow:inset 0 1px 2px rgba(0,0,0,.08); }
.task-record-item.mine { margin-left:auto; background:rgba(59,130,246,.12); border-color:rgba(96,165,250,.25); }
.task-record-meta { font-size:10px; color:var(--text3); margin-bottom:3px; }
/* ══ 4. 发送任务区 ══ */
.composer-section {}
input, textarea, select {
width:100%; box-sizing:border-box; margin-top:6px; padding:10px 12px;
border-radius:var(--r2); font-size:13px; font-family:inherit;
background:rgba(20,30,48,.65); border:1px solid rgba(180,200,220,.15); color:var(--text);
box-shadow: inset 0 2px 4px rgba(0,0,0,.15);
outline:none; transition:all .25s ease-out;
}
input:focus,textarea:focus,select:focus { border-color:var(--blue); box-shadow:0 0 0 3px rgba(59,130,246,.15), 0 0 16px rgba(59,130,246,.08); }
textarea { min-height:88px; resize:vertical; }
select option { background:var(--bg2); color:var(--text); }
.row2 { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
button {
width:100%; box-sizing:border-box; margin-top:6px; padding:9px 14px;
border-radius:var(--r2); font-size:13px; font-family:inherit; font-weight:700;
background: linear-gradient(180deg, #3a5575 0%, #2e4662 50%, #263a54 100%);
border:1px solid rgba(200,218,235,.22); color:var(--text);
cursor:pointer;
box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 3px 0 #1a2a3e, 0 4px 10px rgba(0,0,0,.2);
transition:all .15s ease;
}
button:hover { border-color:rgba(96,165,250,.35); }
button:active { transform:translateY(2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 1px 0 #1a2a3e, 0 2px 4px rgba(0,0,0,.15); }
button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible { outline:2px solid rgba(96,165,250,.5); outline-offset:2px; }
#sendBtn { background:linear-gradient(180deg,#4a92f7 0%,#3b82f6 40%,#2563eb 100%); border-color:rgba(96,165,250,.5); color:#fff; font-size:14px; font-weight:700; min-height:48px; min-width:44px; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 4px 0 #1a4eb8, 0 6px 16px rgba(37,99,235,.4); letter-spacing:.02em; }
#sendBtn:hover { background:linear-gradient(180deg,#60a5fa 0%,#4a92f7 40%,#3b82f6 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 4px 0 #1a4eb8, 0 6px 20px rgba(59,130,246,.5); }
#sendBtn:active { transform:translateY(3px); box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 0 #1a4eb8, 0 2px 6px rgba(37,99,235,.3); }
button.secondary { background:var(--bg2); color:var(--text3); border-color:var(--card-border); }
button.success { background:#059669; color:#fff; border-color:rgba(34,197,94,.4); }
button.warning { background:#d97706; color:#fff; border-color:rgba(251,191,36,.4); }
/* ══ 全屏覆盖页(通用) ══ */
.fullscreen-page {
display:none; position:fixed; inset:0; z-index:100;
width:100%; height:100%;
background: linear-gradient(160deg, #1c2e4a 0%, #162540 35%, #1a3050 65%, #142238 100%);
flex-direction:column; overflow:hidden;
overscroll-behavior:none;
}
.fullscreen-page.open { display:flex; }
.fullscreen-page-header {
flex-shrink:0;
padding: calc(var(--safe-top) + 6px) 14px 8px;
display:flex; align-items:center; gap:10px;
background: linear-gradient(180deg, #263e5c 0%, #1e3250 50%, #182a44 100%);
border-bottom:1px solid rgba(200,218,235,.18);
box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 2px 16px rgba(0,0,0,.25);
}
.fullscreen-back-btn {
background:linear-gradient(180deg, #3a5575 0%, #2e4662 100%); border:1px solid rgba(200,218,235,.22); border-radius:20px;
color:#fff; font-size:12px; font-weight:700; padding:4px 12px; cursor:pointer; margin:0; width:auto;
box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 2px 0 #1a2a3e, 0 3px 8px rgba(0,0,0,.18);
}
.fullscreen-back-btn:hover { background:rgba(59,130,246,.2); border-color:rgba(96,165,250,.4); }
.fullscreen-page-title { font-family:"Fira Code",monospace; font-weight:700; font-size:15px; color:var(--text); flex:1; }
.fullscreen-refresh-btn { background:none; border:1px solid rgba(200,218,235,.22); border-radius:20px; color:#58a6ff; font-size:16px; font-weight:700; padding:4px 10px; cursor:pointer; }
.fullscreen-refresh-btn:hover { background:rgba(59,130,246,.2); }
.fullscreen-refresh-btn.spinning { animation: spin 0.6s linear; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
/* 普通全屏页(任务列表等):整体滚动 */
.fullscreen-page-content { flex:1; min-height:0; overflow-y:auto; -webkit-overflow-scrolling:touch; padding:10px 12px 24px; }
/* 任务详情页:覆盖 content 样式,变成 flex 竖排,MD原文撑满剩余 */
.fp-detail-content { overflow-y:hidden; padding:10px 12px 0; display:flex; flex-direction:column; }
.fp-detail-content .card { flex-shrink:0; margin-bottom:8px; }
.fp-detail-content .fp-markdown-card { flex:1; display:flex; flex-direction:column; min-height:0; margin-bottom:0; }
/* 胶囊标签:block + fit-content,不被 flex 拉伸 */
.fp-section-title { display:block; width:fit-content; font-size:11px; font-weight:700; color:#fff; letter-spacing:0; margin-bottom:8px; padding:3px 12px; border-radius:99px; background:linear-gradient(90deg,#2563eb 0%,#3b82f6 100%); box-shadow:0 2px 8px rgba(59,130,246,.35); }
.fp-markdown-file { font-weight:400; font-size:10px; color:var(--text3); margin-left:6px; }
.fp-markdown-body { flex:1; min-height:0; overflow-y:auto; -webkit-overflow-scrolling:touch; }
.task-list-tabs { display:flex; gap:0; margin-bottom:10px; border-radius:10px; overflow:hidden; background:rgba(30,40,60,.5); }
.tl-tab { flex:1; padding:8px 0; text-align:center; font-size:12px; font-weight:600; color:var(--text3); background:transparent; border:none; cursor:pointer; transition:all .2s; }
.tl-tab.active { color:var(--blue); background:rgba(59,130,246,.15); }
/* ══ 我的:全屏覆盖页 ══ */
.my-page {
display:none; position:fixed; inset:0; z-index:100;
width:100%; height:100%;
background: linear-gradient(160deg, #1c2e4a 0%, #162540 35%, #1a3050 65%, #142238 100%);
flex-direction:column; overflow:hidden;
overscroll-behavior:none;
}
.my-page.open { display:flex; }
.my-page-header {
flex-shrink:0;
padding: calc(var(--safe-top) + 6px) 14px 8px;
display:flex; align-items:center; gap:10px;
background: linear-gradient(180deg, #263e5c 0%, #1e3250 50%, #182a44 100%);
border-bottom:1px solid rgba(200,218,235,.18);
box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 2px 16px rgba(0,0,0,.25);
}
.my-back-btn { background:linear-gradient(180deg, #3a5575 0%, #2e4662 100%); border:1px solid rgba(200,218,235,.22); border-radius:20px; color:#fff; font-size:12px; font-weight:700; padding:4px 12px; cursor:pointer; margin:0; width:auto; box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 2px 0 #1a2a3e, 0 3px 8px rgba(0,0,0,.18); }
.my-back-btn:hover { border-color:rgba(96,165,250,.35); }
.my-page-title { font-family:"Fira Code",monospace; font-weight:700; font-size:15px; color:var(--text); flex:1; }
.my-page-content { flex:1; overflow-y:auto; -webkit-overflow-scrolling:touch; padding:10px 12px 24px; }
.my-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:8px; }
.action-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px; margin-top:8px; }
.slot-label { font-size:10px; font-weight:700; color:var(--text3); margin-bottom:4px; text-transform:uppercase; letter-spacing:.04em; }
.lang-switch { display:inline-flex; gap:4px; padding:3px; background:rgba(10,18,35,.5); border:1px solid var(--card-border); border-radius:99px; margin-top:10px; box-shadow:inset 0 1px 3px rgba(0,0,0,.15); }
.lang-btn { cursor:pointer; width:auto; margin-top:0; min-width:36px; padding:5px 10px; border-radius:99px; background:transparent; color:var(--text3); border:none; font-size:12px; box-shadow:none; }
.lang-btn:hover { color:var(--text); }
.lang-btn.active { background:var(--blue); color:#fff; }
#connectInfo { font-size:11px; color:var(--text3); line-height:1.6; }
#systemLog { white-space:pre-wrap; font-size:11px; color:var(--text3); line-height:1.6; max-height:200px; overflow:auto; margin-top:6px; }
details>summary { cursor:pointer; font-weight:700; color:var(--text2); font-size:13px; }
details>summary:focus-visible { outline:2px solid rgba(96,165,250,.5); outline-offset:2px; }
#status,#meta,#heroTitle,#heroSubMinor { display:none; }
.tab-panel { display:block; }
#qrScanModal { position:fixed; inset:0; background:rgba(0,0,0,.88); z-index:999; display:none; flex-direction:column; align-items:center; justify-content:center; }
/* 全屏任务列表页中的任务行 */
.full-task-row {
display:flex; flex-wrap:wrap; align-items:center; gap:4px;
padding:10px 12px; margin-bottom:6px; cursor:pointer;
background: linear-gradient(180deg, #344e6e 0%, #2a4260 40%, #243a54 100%);
border:1px solid rgba(200,218,235,.2); border-radius:var(--r2);
box-shadow: inset 0 1px 0 rgba(255,255,255,.16), inset 0 -1px 0 rgba(0,0,0,.1), 0 3px 0 #1a2a3e, 0 4px 10px rgba(0,0,0,.18);
transition:all .15s ease;
}
.full-task-row:hover { border-color:rgba(96,165,250,.35); transform:translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), inset 0 -1px 0 rgba(0,0,0,.1), 0 4px 0 #1a2a3e, 0 6px 14px rgba(0,0,0,.2); }
.full-task-row:active { transform:translateY(2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 #1a2a3e, 0 2px 4px rgba(0,0,0,.15); }
.full-task-row:active { background:linear-gradient(145deg, rgba(30,50,80,.95) 0%, rgba(20,35,65,.98) 100%); transform:translateY(0); }
.full-task-row .task-title { flex:1 1 100%; font-size:13px; font-weight:700; color:var(--text); margin-bottom:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.full-task-time { font-size:10px; color:var(--text3); margin-left:auto; }
@media (max-width:400px) {
.detail-grid { grid-template-columns:1fr; }
.my-grid { grid-template-columns:1fr; }
}
.toast-container { position:fixed; top:env(safe-area-inset-top,16px); left:50%; transform:translateX(-50%); z-index:9999; display:flex; flex-direction:column; align-items:center; gap:8px; pointer-events:none; padding-top:8px; }
.toast-msg { background:rgba(0,0,0,.82); color:#fff; padding:10px 22px; border-radius:20px; font-size:13px; line-height:1.4; max-width:80vw; text-align:center; pointer-events:auto; box-shadow:0 4px 16px rgba(0,0,0,.3); animation: toastIn .25s ease, toastOut .3s ease 2.2s forwards; }
.toast-msg.toast-warn { background:rgba(220,80,40,.9); }
.toast-msg.toast-ok { background:rgba(34,150,80,.9); }
@keyframes toastIn { from { opacity:0; transform:translateY(-12px); } to { opacity:1; transform:translateY(0); } }
@keyframes toastOut { from { opacity:1; } to { opacity:0; transform:translateY(-8px); } }
/* ── 新版本提示条 ── */
#updateBar {
display: none;
position: fixed;
top: 0; left: 0; right: 0;
z-index: 9999;
background: linear-gradient(90deg, #1d4ed8 0%, #2563eb 60%, #0ea5e9 100%);
color: #fff;
font-size: 14px;
font-weight: 600;
text-align: center;
padding: 10px 16px;
cursor: pointer;
box-shadow: 0 2px 12px rgba(37,99,235,.5);
letter-spacing: .3px;
animation: slideDown .35s ease;
}
#updateBar.visible { display: block; }
#updateBar .ub-close {
position: absolute;
right: 14px; top: 50%;
transform: translateY(-50%);
font-size: 18px;
opacity: .7;
line-height: 1;
cursor: pointer;
padding: 0 4px;
}
@keyframes slideDown {
from { transform: translateY(-100%); opacity: 0; }
to { transform: translateY(0); opacity: 1; }
}
</style>
</head>
<body>
<!-- 新版本提示条:检测到 SW 更新后显示 -->
<div id="updateBar" onclick="doForceUpdate()">
🆕 发现新版本,点击立即更新
<span class="ub-close" onclick="event.stopPropagation();document.getElementById('updateBar').classList.remove('visible')" title="关闭">✕</span>
</div>
<div id="toastContainer" class="toast-container"></div>
<div class="app-shell">
<!-- ════ 固定顶部 Header(两行) ════ -->
<header class="app-header">
<div class="header-row1">
<img class="header-logo" src="./logo-64.png" alt="logo" />
<span id="headerBrand" class="header-brand">码流 CodeFlow</span>
<div class="header-right">
<span id="statusLight" class="status-light"></span>
<span id="statusText" style="font-size:11px;color:var(--text3);white-space:nowrap;">巡检器离线</span>
<button id="headerRefreshBtn" class="header-refresh-btn" type="button" title="刷新数据" style="display:none">↻</button>
<button id="agentRailSideBtn" class="header-rail-btn" type="button" title="切换 Agent 栏左右">⇄</button>
<button id="myQuickBtn" class="header-my-btn" type="button">我的</button>
</div>
</div>
<span id="heroSub" class="header-slogan"></span>
</header>
<!-- ════ 主区:侧栏 Agent + 内容(宽屏);窄屏纵向堆叠 ════ -->
<div id="workspaceSplit" class="workspace-split rail-left">
<div class="workspace-top">
<!-- ── 0. 未绑定提示 ── -->
<div id="bindBanner" class="bind-banner" style="display:none;">
<span id="bindBannerText">未绑定 PC,请点击「我的」扫码绑定</span>
<button id="bindBannerBtn" type="button" class="bind-banner-btn">去绑定 →</button>
</div>
<!-- ── 1. 看板:4个统计(紧凑) ── -->
<div class="stat-grid">
<button class="stat-btn" type="button" data-filter="today">
<span id="labelTodayTasks" class="stat-label">今日任务</span>
<strong id="todayTasks" class="stat-num">0</strong>
</button>
<button class="stat-btn" type="button" data-filter="reply">
<span id="labelTodayReplies" class="stat-label">今日回复</span>
<strong id="todayReplies" class="stat-num">0</strong>
</button>
<button class="stat-btn" type="button" data-filter="progress">
<span id="labelInProgress" class="stat-label">进行中任务</span>
<strong id="inProgressThreads" class="stat-num">0</strong>
</button>
<button class="stat-btn" type="button" data-filter="done">
<span id="labelReplied" class="stat-label">已完成任务</span>
<strong id="repliedThreads" class="stat-num">0</strong>
</button>
</div>
</div>
<aside class="agent-rail" id="agentRail" aria-label="团队角色">
<div class="card team-section agent-rail-inner">
<div class="card-head">
<h3 id="teamTitle" class="card-title">我的团队</h3>
<span id="teamCount" class="muted">4 人</span>
</div>
<div id="teamDesc" class="muted" style="display:none;"></div>
<div id="teamList" class="role-grid is-agent-rail"></div>
</div>
</aside>
<div class="workspace-main-column">
<main class="app-content">
<!-- ── 2. 任务清单(只显示2条,点击标题进列表) ── -->
<div class="card task-section">
<div class="card-head" id="taskSectionHead" style="cursor:pointer;">
<h3 id="listTitle" class="card-title">任务清单</h3>
<span id="listDesc" class="muted" style="display:flex;align-items:center;gap:4px;">默认显示 PM <span style="font-size:14px;opacity:.6;">›</span></span>
</div>
<div id="workspaceRoleStrip" style="display:none;"></div>
<div id="taskList" class="task-stack"></div>
</div>
<!-- 当前任务详情(点击任务后展开,首页保留兼容) -->
<div id="taskDetailCard" class="card" style="display:none;">
<div class="card-head">
<h3 id="detailTitle" class="card-title">任务详情</h3>
<span id="detailMeta" class="muted">未选择任务</span>
</div>
<div class="detail-compact-header">
<div class="detail-compact-id" id="detailTaskId">--</div>
<div class="detail-compact-file" id="detailFileName">--</div>
<div class="detail-compact-pills">
<span class="detail-pill"><span id="detailPriorityLabel" style="display:none"></span><b id="detailPriorityValue">--</b></span>
<span class="detail-pill"><span id="detailTypeLabel" style="display:none"></span><b id="detailTypeValue">--</b></span>
<span class="detail-pill">👤 <b id="detailSenderValue">--</b></span>
<span class="detail-pill">→ <b id="detailRecipientValue">--</b></span>
<span class="detail-pill">🕐 <b id="detailTimeValue">--</b></span>
<span class="detail-pill" id="detailStatusPill">⬤ <b id="detailStatusValue">--</b></span>
</div>
</div>
<div class="detail-section"><h4 id="detailFlowLabel">流转路径</h4><div id="detailFlowValue" class="detail-body-text">--</div></div>
<div class="detail-section"><h4 id="detailBodyLabel">任务正文</h4><div id="detailBody" class="detail-body-text">请选择任务查看详情。</div></div>
<div class="detail-tabs">
<button id="detailRecordTabBtn" class="detail-tab-btn active" type="button">任务记录</button>
<button id="detailMarkdownTabBtn" class="detail-tab-btn" type="button">MD原文</button>
</div>
<div id="detailRecordView" class="detail-view active"><div id="detailMessages" class="task-record-list"></div></div>
<div id="detailMarkdownView" class="detail-view"><div id="detailMarkdown" class="detail-markdown">请选择任务后查看 MD 原文。</div><div id="detailMarkdownFile" class="detail-file-line"></div></div>
</div>
<!-- ── 4. 发送任务区 ── -->
<div class="card composer-section">
<div class="card-head">
<h3 id="sendTitle" class="card-title">发送任务</h3>
</div>
<div id="sendDesc" class="muted">选中团队角色后,任务将发送给该角色。</div>
<select id="targetRole"></select>
<input id="threadKey" type="hidden" />
<textarea id="message" rows="4" placeholder="输入任务内容..."></textarea>
<div class="row2">
<select id="priority">
<option value="P0">P0 紧急</option>
<option value="P1" selected>P1 高</option>
<option value="P2">P2 中</option>
<option value="P3">P3 低</option>
</select>
<button id="sendBtn" type="button">发送任务</button>
</div>
<div id="sendHint" class="note">未选任务时立为新任务;已选时追加到记录。</div>
</div>
</main>
</div>
</div>
</div>
<!-- ════ 全屏任务列表页 ════ -->
<div id="taskListPage" class="fullscreen-page">
<header class="fullscreen-page-header">
<button id="taskListBackBtn" class="fullscreen-back-btn" type="button">← 返回</button>
<span id="taskListPageTitle" class="fullscreen-page-title">任务列表</span>
</header>
<div class="fullscreen-page-content">
<div id="taskListTabs" class="task-list-tabs">
<button class="tl-tab active" data-dir="tasks">任务单</button>
<button class="tl-tab" data-dir="reports">报告</button>
<button class="tl-tab" data-dir="issues">问题</button>
<button class="tl-tab" data-dir="log">归档</button>
</div>
<div id="fullTaskList" class="task-stack"></div>
</div>
</div>
<!-- ════ 全屏任务详情页 ════ -->
<div id="taskDetailPage" class="fullscreen-page">
<header class="fullscreen-page-header">
<button id="taskDetailBackBtn" class="fullscreen-back-btn" type="button">← 返回</button>
<span id="taskDetailPageTitle" class="fullscreen-page-title">任务详情</span>
</header>
<div class="fullscreen-page-content fp-detail-content">
<div class="detail-compact-header" style="margin:0 0 6px;">
<div class="detail-compact-id" id="fpDetailTaskId">--</div>
<div class="detail-compact-file" id="fpDetailFileName">--</div>
<div class="detail-compact-pills">
<span class="detail-pill"><b id="fpDetailPriority">--</b></span>
<span class="detail-pill"><b id="fpDetailType">--</b></span>
<span class="detail-pill">👤 <b id="fpDetailSender">--</b></span>
<span class="detail-pill">→ <b id="fpDetailRecipient">--</b></span>
<span class="detail-pill">🕐 <b id="fpDetailTime">--</b></span>
<span class="detail-pill">⬤ <b id="fpDetailStatus">--</b></span>
</div>
</div>
<!-- 任务记录 -->
<div class="card" style="margin-bottom:8px;">
<div class="fp-section-title">任务记录</div>
<div id="fpMessages" class="task-record-list"></div>
</div>
<!-- MD原文:撑满剩余高度 -->
<div class="card fp-markdown-card">
<div class="fp-section-title">MD原文</div>
<div id="fpMarkdownFile" style="display:none;"></div>
<div id="fpMarkdown" class="detail-markdown fp-markdown-body"></div>
</div>
</div>
</div>
<!-- ════ 我的:全屏覆盖页 ════ -->
<div id="myPage" class="my-page">
<header class="my-page-header">
<button id="myBackBtn" class="my-back-btn" type="button">← 返回</button>
<span id="myPageTitle" class="my-page-title">我的</span>
</header>
<div class="my-page-content">
<div class="card">
<div class="card-head">
<h3 id="myTitle" class="card-title">我的</h3>
<span id="myIdentity" class="muted">当前操作人:ADMIN</span>
</div>
<div id="myDesc" class="muted">配置、日志、语言、绑定设备、版本号都在这里。</div>
<div class="lang-switch">
<button id="langZhBtn" class="lang-btn active" type="button">中</button>
<button id="langEnBtn" class="lang-btn" type="button">EN</button>
</div>
</div>
<div class="card">
<div class="card-head"><h3 id="myDeviceTitle" class="card-title">绑定设备</h3></div>
<div id="myDeviceDesc" class="muted">手机扫 PC 端二维码完成绑定。</div>
<div class="detail-grid" style="margin-top:8px;">
<div class="detail-field"><div id="myDeviceNameLabel" class="detail-label">当前设备名</div><div id="myDeviceNameValue" class="detail-value">--</div></div>
<div class="detail-field"><div id="myDeviceIdLabel" class="detail-label">当前设备ID</div><div id="myDeviceIdValue" class="detail-value">--</div></div>
<div class="detail-field"><div id="myBindStatusLabel" class="detail-label">绑定状态</div><div id="myBindStatusValue" class="detail-value">--</div></div>
<div class="detail-field"><div id="myBoundPcLabel" class="detail-label">已绑定电脑</div><div id="myBoundPcValue" class="detail-value">--</div></div>
</div>
<div class="action-grid">
<button id="scanQrBtn" type="button" style="grid-column:1/-1;background:var(--blue);border-color:rgba(96,165,250,.4);color:#fff;">📷 扫码绑定 PC</button>
<button id="unbindPcBtn" type="button" style="grid-column:1/-1;background:rgba(239,68,68,.15);border-color:rgba(239,68,68,.4);color:#f87171;display:none;">解除绑定</button>
</div>
</div>
<div class="card">
<div class="card-head"><h3 id="deployTitle" class="card-title">配置与版本</h3></div>
<div class="my-grid">
<div class="detail-field">
<div style="display:flex;justify-content:space-between;align-items:center;gap:8px;">
<span id="relayStatusLabel" class="slot-label" style="margin:0;">中继服务器</span>
<span id="relayStatusValue" class="detail-value" style="margin:0;display:flex;align-items:center;gap:5px;">
<span id="relayStatusLight" class="status-light" style="width:7px;height:7px;"></span>
<span id="relayStatusText" style="font-size:12px;">未连接</span>
</span>
</div>
</div>
<div class="detail-field"><div class="slot-label">配置</div><div id="deployInfo" class="detail-value" style="font-size:11px;line-height:1.6;"></div><div id="deployDesc" class="muted" style="margin-top:4px;"></div></div>
<div class="detail-field">
<div style="display:flex;justify-content:space-between;align-items:center;gap:8px;">
<span id="versionTitle" class="slot-label" style="margin:0;">版本号</span>
<span id="versionInfo" class="detail-value" style="margin:0;font-family:'Fira Code',monospace;font-weight:600;">--</span>
</div>
<div style="display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:8px;">
<span id="languageTitle" class="slot-label" style="margin:0;">语言</span>
<span id="currentLanguageValue" class="detail-value" style="margin:0;">--</span>
</div>
</div>
</div>
</div>
<div class="card">
<div id="firstBindDesc" class="pair-summary" style="margin-top:10px;">任务+回复是一对。手机端发布任务,PC 端回执后形成完整记录。</div>
<div class="detail-section" style="margin-top:8px;"><h4 id="firstBindStepsTitle">首次使用步骤</h4><div id="firstBindSteps" class="detail-body-text">1. PC 双击 bfstart.bat 启动
2. 浏览器自动打开仪表盘,显示二维码
3. 手机打开 PWA → 点「我的」
4. 点「📷 扫码绑定 PC」对准二维码
5. 扫描成功,连接灯变绿,绑定完成</div></div>
</div>
<div class="card">
<div class="card-head"><h3 id="patrolTitle" class="card-title">PC 巡检</h3></div>
<div id="patrolDesc" class="muted">远程控制 PC 端巡检器,日志实时同步。</div>
<div style="display:flex;gap:8px;margin:10px 0;">
<button id="patrolStartBtn" type="button" style="flex:1;padding:8px;border-radius:8px;background:var(--green);border:1px solid rgba(34,197,94,.4);color:#fff;font-size:13px;cursor:pointer;">开始巡检</button>
<button id="patrolStopBtn" type="button" style="flex:1;padding:8px;border-radius:8px;background:var(--red);border:1px solid rgba(239,68,68,.4);color:#fff;font-size:13px;cursor:pointer;" disabled>停止巡检</button>
<button id="pcResetBtn" type="button" style="flex:1;padding:8px;border-radius:8px;background:var(--amber);border:1px solid rgba(251,191,36,.4);color:#1e293b;font-size:13px;cursor:pointer;font-weight:600;">重置 PC</button>
</div>
<div style="display:flex;align-items:center;gap:8px;margin-bottom:6px;">
<span class="muted" style="font-size:12px;">巡检状态:</span>
<span id="patrolStatusBadge" class="badge status-offline" style="font-size:11px;">未启动</span>
<span class="muted" style="font-size:12px;margin-left:auto;">轮次:</span>
<span id="patrolRoundValue" style="font-size:12px;color:var(--text);">0</span>
</div>
<div id="patrolLogBox" style="display:none;background:rgba(0,0,0,.3);border:1px solid var(--card-border);border-radius:8px;padding:8px;font-family:'Fira Code',monospace;font-size:11px;line-height:1.5;color:var(--text3);max-height:120px;overflow-y:auto;white-space:pre-wrap;min-height:40px;"></div>
<!-- 巡检轨迹列表 -->
<div style="display:flex;align-items:center;justify-content:space-between;margin:8px 0 4px;">
<span style="font-size:12px;color:var(--text2);font-weight:600;">巡检轨迹</span>
<button id="traceRefreshBtn" type="button" style="font-size:11px;padding:2px 8px;border-radius:6px;background:rgba(255,255,255,.07);border:1px solid var(--card-border);color:var(--text3);cursor:pointer;">刷新</button>
</div>
<div id="patrolTraceList" style="background:rgba(0,0,0,.25);border:1px solid var(--card-border);border-radius:8px;max-height:280px;overflow-y:auto;min-height:48px;"></div>
</div>
<div class="card">
<div class="card-head"><h3 id="msgHistoryTitle" class="card-title">指令日志</h3></div>
<div id="msgHistoryDesc" class="muted">PC 和手机之间的任务指令收发记录。</div>
<div id="msgHistoryList" style="background:rgba(0,0,0,.2);border:1px solid var(--card-border);border-radius:8px;padding:8px;max-height:240px;overflow-y:auto;min-height:40px;">
<div class="muted" style="font-size:12px;text-align:center;padding:12px 0;">暂无指令</div>
</div>
</div>
<div class="card">
<div class="card-head"><h3 id="connectTitle" class="card-title">连接状态</h3></div>
<div id="connectInfo" class="muted">最近连接:无 | 最近断开:无 | 重连状态:未启动</div>
</div>
<div class="card">
<details><summary id="logTitle">系统日志</summary><div id="systemLog"></div></details>
</div>
</div>
</div>
<!-- QR 扫码弹窗 -->
<div id="qrScanModal" style="display:none;position:fixed;inset:0;background:rgba(0,0,0,.88);z-index:999;flex-direction:column;align-items:center;justify-content:center;">
<div style="background:var(--bg2);border:1px solid var(--card-border);border-radius:16px;padding:20px;width:92%;max-width:380px;text-align:center;">
<div id="scanQrTitle" style="font-weight:700;font-size:16px;color:var(--text);margin-bottom:12px;">扫描 PC 端二维码</div>
<video id="qrVideo" autoplay playsinline style="width:100%;border-radius:10px;background:#000;max-height:260px;"></video>
<canvas id="qrCanvas" style="display:none;"></canvas>
<div id="qrScanStatus" style="color:var(--text3);font-size:13px;margin:10px 0;">正在启动摄像头…</div>
<button id="qrScanClose" type="button" style="margin-top:8px;padding:10px 28px;border-radius:8px;background:rgba(255,255,255,.08);color:#e3f0ff;border:1px solid rgba(150,200,255,.2);font-size:14px;cursor:pointer;width:auto;">取消</button>
</div>
</div>
<!-- JS 兼容占位 -->
<div id="status" style="display:none;"></div>
<div id="meta" style="display:none;"></div>
<div id="heroTitle" style="display:none;"></div>
<div id="heroSubMinor" style="display:none;"></div>
<div id="tabWorkspace" style="display:none;"></div>
<div id="tabTeam" style="display:none;"></div>
<div id="tabMy" style="display:none;"></div>
<div id="tabWorkspaceBtn" style="display:none;"></div>
<div id="tabTeamBtn" style="display:none;"></div>
<div id="tabMyBtn" style="display:none;"></div>
<div id="roleTaskList" style="display:none;"></div>
<div id="roleDetailTitle" style="display:none;"></div>
<div id="roleDetailMeta" style="display:none;"></div>
<div id="roleTaskDetailTitle" style="display:none;"></div>
<div id="roleConversationMeta" style="display:none;"></div>
<div id="roleConversationBody" style="display:none;"></div>
<div id="roleConversationMessages" style="display:none;"></div>
<div id="roleConversationTitle" style="display:none;"></div>
<div id="roleDetailTaskId" style="display:none;"></div>
<div id="roleDetailFileName" style="display:none;"></div>
<div id="roleDetailPriorityValue" style="display:none;"></div>
<div id="roleDetailTypeValue" style="display:none;"></div>
<div id="roleDetailSenderValue" style="display:none;"></div>
<div id="roleDetailRecipientValue" style="display:none;"></div>
<div id="roleDetailTimeValue" style="display:none;"></div>
<div id="roleDetailStatusValue" style="display:none;"></div>
<div id="roleDetailFlowValue" style="display:none;"></div>
<div id="roleMarkdown" style="display:none;"></div>
<div id="roleMarkdownFile" style="display:none;"></div>
<div id="roleRecordTabBtn" style="display:none;"></div>
<div id="roleMarkdownTabBtn" style="display:none;"></div>
<div id="roleRecordView" style="display:none;"></div>
<div id="roleMarkdownView" style="display:none;"></div>
<div id="roleDetailIdLabel" style="display:none;"></div>
<div id="roleDetailFileLabel" style="display:none;"></div>
<div id="roleDetailPriorityLabel" style="display:none;"></div>
<div id="roleDetailTypeLabel" style="display:none;"></div>
<div id="roleDetailSenderLabel" style="display:none;"></div>
<div id="roleDetailRecipientLabel" style="display:none;"></div>
<div id="roleDetailTimeLabel" style="display:none;"></div>
<div id="roleDetailStatusLabel" style="display:none;"></div>
<div id="roleDetailFlowLabel" style="display:none;"></div>
<div id="roleDetailBodyLabel" style="display:none;"></div>
<div id="currentTaskTitle" style="display:none;"></div>
<div id="currentTaskMeta" style="display:none;"></div>
<div id="currentTaskBody" style="display:none;"></div>
<div id="currentTaskStatus" style="display:none;"></div>
<div id="currentTaskTitleLabel" style="display:none;"></div>
<div id="adminTaskList" style="display:none;"></div>
<div id="metaBar" style="display:none;"></div>
<script src="./config.js"></script>
<script>
let ws = null;
let taskItems = [];
let pendingItems = [];
let selectedFilename = "";
let selectedRole = localStorage.getItem("codeflow_selected_role") || "PM";
let agentRailSide = localStorage.getItem("codeflow_agent_rail_side") || "left";
let currentTab = localStorage.getItem("codeflow_current_tab") || "workspace";
let reconnectTimer = null;
let reconnectAttempts = 0;
let manualDisconnect = false;
let shouldReconnect = false;