-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTableCheck.html
More file actions
2993 lines (2823 loc) · 167 KB
/
Copy pathTableCheck.html
File metadata and controls
2993 lines (2823 loc) · 167 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.0" />
<title>表格内容确认工具 v3</title>
<link rel="preload" href="tailwind.css" as="style" />
<link rel="preload" href="alpine.min.js" as="script" />
<link rel="stylesheet" href="tailwind.css" media="print" onload="this.media='all'" />
<noscript><link rel="stylesheet" href="tailwind.css" /></noscript>
<script src="alpine.min.js" defer></script>
<style>
[x-cloak] { display: none !important; }
body {
background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
min-height: 100vh;
font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
color: #e2e8f0;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #1e293b; }
::-webkit-scrollbar-thumb { background: #475569; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #64748b; }
.glass-card {
background: rgba(30,41,59,0.85);
backdrop-filter: blur(16px);
border: 1px solid rgba(99,102,241,0.2);
box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
}
.neon-title {
background: linear-gradient(90deg, #818cf8, #38bdf8, #34d399);
-webkit-background-clip: text; -webkit-text-fill-color: transparent;
background-clip: text; filter: drop-shadow(0 0 20px rgba(129,140,248,0.4));
}
.input-area {
background: rgba(15,23,42,0.8); border: 1px solid rgba(99,102,241,0.3);
color: #e2e8f0; transition: all 0.3s; resize: vertical;
}
.input-area:focus { outline:none; border-color:#818cf8; box-shadow:0 0 0 3px rgba(129,140,248,0.15); }
.input-area-amber { background:rgba(15,23,42,0.8); border:1px solid rgba(245,158,11,0.3); color:#e2e8f0; transition:all .3s; resize:vertical; }
.input-area-amber:focus { outline:none; border-color:#f59e0b; box-shadow:0 0 0 3px rgba(245,158,11,0.15); }
.input-area-cyan { background:rgba(15,23,42,0.8); border:1px solid rgba(6,182,212,0.3); color:#e2e8f0; transition:all .3s; resize:vertical; }
.input-area-cyan:focus { outline:none; border-color:#06b6d4; box-shadow:0 0 0 3px rgba(6,182,212,0.15); }
.input-area::placeholder,.input-area-amber::placeholder,.input-area-cyan::placeholder { color:#94a3b8; opacity:1; }
.input-area,.input-area-amber,.input-area-cyan { color:#e2e8f0; }
select.input-area, select.input-area-amber, select.input-area-cyan { color:#e2e8f0; }
select.input-area option, select.input-area-amber option, select.input-area-cyan option { background:#1e293b; color:#e2e8f0; }
/* 公共表格单元格:强制深色背景,避免新增行等场景下显示白底 */
.common-table-cell input { background: rgba(15,23,42,0.95) !important; color: #e2e8f0 !important; border: none; }
.common-table-cell input::placeholder { color: #64748b; }
.common-table-cell input:focus { outline: none; box-shadow: 0 0 0 1px rgba(99,102,241,0.6); }
.drop-zone { border:2px dashed rgba(99,102,241,0.4); background:rgba(15,23,42,0.5); border-radius:12px; transition:all .3s; cursor:pointer; position:relative; }
.drop-zone:hover,.drop-zone.drag-over { border-color:#818cf8; background:rgba(99,102,241,0.08); box-shadow:0 0 24px rgba(129,140,248,0.2); }
.drop-zone-amber { border:2px dashed rgba(245,158,11,0.4); background:rgba(15,23,42,0.5); border-radius:12px; transition:all .3s; cursor:pointer; position:relative; }
.drop-zone-amber:hover,.drop-zone-amber.drag-over { border-color:#f59e0b; background:rgba(245,158,11,0.07); }
.drop-zone-cyan { border:2px dashed rgba(6,182,212,0.4); background:rgba(15,23,42,0.5); border-radius:12px; transition:all .3s; cursor:pointer; position:relative; }
.drop-zone-cyan:hover,.drop-zone-cyan.drag-over { border-color:#06b6d4; background:rgba(6,182,212,0.07); }
.file-input-hidden { position:absolute; inset:0; opacity:0; cursor:pointer; width:100%; height:100%; }
.btn-primary { background:linear-gradient(135deg,#6366f1,#4f46e5); border:1px solid rgba(129,140,248,0.4); transition:all .3s; box-shadow:0 4px 15px rgba(99,102,241,0.3); }
.btn-primary:hover { background:linear-gradient(135deg,#818cf8,#6366f1); box-shadow:0 6px 25px rgba(99,102,241,0.5); transform:translateY(-1px); }
.btn-success { background:linear-gradient(135deg,#059669,#047857); border:1px solid rgba(52,211,153,0.4); transition:all .3s; box-shadow:0 4px 15px rgba(5,150,105,0.3); }
.btn-success:hover { background:linear-gradient(135deg,#10b981,#059669); box-shadow:0 6px 25px rgba(5,150,105,0.5); transform:translateY(-1px); }
.btn-warning { background:linear-gradient(135deg,#d97706,#b45309); border:1px solid rgba(251,191,36,0.4); transition:all .3s; box-shadow:0 4px 15px rgba(217,119,6,0.3); }
.btn-warning:hover { background:linear-gradient(135deg,#f59e0b,#d97706); box-shadow:0 6px 25px rgba(217,119,6,0.5); transform:translateY(-1px); }
.btn-danger { background:linear-gradient(135deg,#dc2626,#b91c1c); border:1px solid rgba(248,113,113,0.4); transition:all .3s; box-shadow:0 4px 15px rgba(220,38,38,0.3); }
.btn-danger:hover { background:linear-gradient(135deg,#ef4444,#dc2626); box-shadow:0 6px 25px rgba(220,38,38,0.5); transform:translateY(-1px); }
.btn-cyan { background:linear-gradient(135deg,#0891b2,#0e7490); border:1px solid rgba(34,211,238,0.4); transition:all .3s; box-shadow:0 4px 15px rgba(8,145,178,0.3); }
.btn-cyan:hover { background:linear-gradient(135deg,#06b6d4,#0891b2); box-shadow:0 6px 25px rgba(8,145,178,0.5); transform:translateY(-1px); }
.btn-amber { background:linear-gradient(135deg,#d97706,#92400e); border:1px solid rgba(251,191,36,0.4); transition:all .3s; box-shadow:0 4px 15px rgba(217,119,6,0.3); }
.btn-amber:hover { background:linear-gradient(135deg,#f59e0b,#d97706); box-shadow:0 6px 25px rgba(217,119,6,0.5); transform:translateY(-1px); }
.btn-rose { background:linear-gradient(135deg,#e11d48,#be123c); border:1px solid rgba(251,113,133,0.4); transition:all .3s; box-shadow:0 4px 15px rgba(225,29,72,0.3); }
.btn-rose:hover { background:linear-gradient(135deg,#f43f5e,#e11d48); box-shadow:0 6px 25px rgba(225,29,72,0.5); transform:translateY(-1px); }
.btn-purple { background:linear-gradient(135deg,#7c3aed,#6d28d9); border:1px solid rgba(167,139,250,0.4); transition:all .3s; box-shadow:0 4px 15px rgba(124,58,237,0.3); }
.btn-purple:hover { background:linear-gradient(135deg,#8b5cf6,#7c3aed); box-shadow:0 6px 25px rgba(124,58,237,0.5); transform:translateY(-1px); }
.btn-sm { padding:4px 12px; font-size:12px; border-radius:6px; font-weight:600; color:white; cursor:pointer; border:none; transition:all .2s; }
button:disabled { opacity:0.6; cursor:not-allowed; }
.tab-btn { padding:8px 18px; border-radius:8px; font-size:13px; font-weight:700; transition:all .25s; cursor:pointer; border:none; }
.tab-active-indigo { background:linear-gradient(135deg,#6366f1,#4f46e5); color:white; box-shadow:0 4px 15px rgba(99,102,241,0.35); }
.tab-active-amber { background:linear-gradient(135deg,#d97706,#92400e); color:white; box-shadow:0 4px 15px rgba(217,119,6,0.35); }
.tab-active-cyan { background:linear-gradient(135deg,#0891b2,#0e7490); color:white; box-shadow:0 4px 15px rgba(8,145,178,0.35); }
.tab-inactive { background:rgba(15,23,42,0.6); color:#94a3b8; border:1px solid rgba(99,102,241,0.2); }
.tab-inactive:hover { color:#a5b4fc; border-color:rgba(129,140,248,0.4); }
/* ── 表格 ── */
.table-container { overflow-x:auto; overflow-y:auto; max-height:580px; border-radius:12px; border:1px solid rgba(99,102,241,0.2); content-visibility:auto; contain-intrinsic-size:auto 400px; contain:layout style; }
table { border-collapse:separate; border-spacing:0; width:100%; min-width:900px; }
thead { position:sticky; top:0; z-index:20; }
thead th {
background:linear-gradient(180deg,#1e1b4b,#1a1a3e); color:#a5b4fc;
font-size:12px; font-weight:700; padding:10px 12px; text-align:left;
white-space:nowrap; border-bottom:2px solid rgba(129,140,248,0.4);
letter-spacing:.05em; text-transform:uppercase;
}
.th-inner { display:flex; align-items:center; gap:6px; }
.th-del-btn {
opacity:0; width:16px; height:16px; border-radius:4px;
background:rgba(220,38,38,0.7); color:white; font-size:10px; font-weight:800;
display:flex; align-items:center; justify-content:center;
cursor:pointer; border:none; transition:all .2s; flex-shrink:0; line-height:1;
}
thead th:hover .th-del-btn { opacity:1; }
.th-del-btn:hover { background:#ef4444; transform:scale(1.15); }
.th-edit-input {
background:rgba(15,23,42,0.9); border:1px solid #818cf8; color:#e2e8f0;
border-radius:5px; padding:2px 6px; font-size:11px; font-weight:700;
width:100px; outline:none; letter-spacing:.02em;
}
tbody tr { transition:background .2s; }
tbody td {
padding:8px 12px; font-size:13px; border-bottom:1px solid rgba(255,255,255,0.05);
color:#cbd5e1; vertical-align:middle; background:rgba(15,23,42,0.5);
transition:background .2s; position:relative;
}
tbody tr:nth-child(even) td { background:rgba(30,41,59,0.5); }
tbody tr:hover td { background:rgba(99,102,241,0.08) !important; }
.row-confirmed td { background:rgba(5,150,105,0.12) !important; border-left:3px solid #059669; }
.row-confirmed:hover td { background:rgba(5,150,105,0.18) !important; }
.row-appended td { border-left:3px solid #f59e0b !important; }
@keyframes rowFlash { 0%{background:rgba(245,158,11,0.35)!important;} 100%{background:transparent;} }
.row-new-flash td { animation:rowFlash 2s ease-out; }
.cell-view { display:flex; align-items:flex-start; gap:4px; min-height:20px; cursor:text; }
.cell-text { flex:1; word-break:break-all; line-height:1.5; }
.cell-edit-icon { opacity:0; font-size:10px; color:#94a3b8; transition:opacity .15s; flex-shrink:0; margin-top:2px; cursor:pointer; }
tbody td:hover .cell-edit-icon { opacity:1; }
.cell-input {
background:rgba(15,23,42,0.95); border:1px solid #818cf8;
box-shadow:0 0 0 2px rgba(129,140,248,0.2),0 4px 12px rgba(0,0,0,0.4);
color:#e2e8f0; border-radius:6px; padding:5px 8px; font-size:12px;
width:100%; min-width:120px; outline:none; resize:none;
line-height:1.5; font-family:inherit; transition:box-shadow .2s; display:block;
}
.cell-input:focus { box-shadow:0 0 0 3px rgba(129,140,248,0.3),0 4px 16px rgba(0,0,0,0.5); }
.cell-edit-hint { font-size:10px; color:#94a3b8; margin-top:3px; display:flex; gap:8px; }
.cell-edit-hint kbd { background:rgba(99,102,241,0.2); border:1px solid rgba(129,140,248,0.3); border-radius:3px; padding:0 4px; font-size:9px; color:#818cf8; }
/* 单元格标注:需特别关注,悬停显示提示 */
.cell-annotated { background: rgba(168,85,247,0.15) !important; border-left: 3px solid #a855f7 !important; }
.cell-annotated:hover { background: rgba(168,85,247,0.22) !important; }
tbody tr:nth-child(even) .cell-annotated { background: rgba(168,85,247,0.12) !important; }
tbody tr:nth-child(even) .cell-annotated:hover { background: rgba(168,85,247,0.2) !important; }
.cell-annotated .cell-annotated-dot { color: #a855f7; font-size: 10px; margin-left: 4px; flex-shrink: 0; cursor: help; }
/* 标注悬停提示:字体约为正文两倍 */
.annotation-tooltip-popup {
position: fixed; z-index: 600; pointer-events: none;
max-width: 420px; padding: 12px 16px; border-radius: 10px;
background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
border: 1px solid rgba(168,85,247,0.5); box-shadow: 0 8px 32px rgba(0,0,0,0.5);
color: #e2e8f0; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
font-size: 2em; font-weight: 500;
}
.badge-confirmed { background:linear-gradient(135deg,#059669,#047857); color:white; font-size:11px; padding:3px 10px; border-radius:20px; font-weight:600; box-shadow:0 2px 8px rgba(5,150,105,0.4); white-space:nowrap; }
.badge-pending { background:rgba(71,85,105,0.6); color:#94a3b8; font-size:11px; padding:3px 10px; border-radius:20px; font-weight:600; white-space:nowrap; }
.badge-new { background:linear-gradient(135deg,#d97706,#92400e); color:white; font-size:10px; padding:2px 7px; border-radius:12px; font-weight:700; vertical-align:middle; }
.badge-custom { background:linear-gradient(135deg,#4f46e5,#4338ca); color:white; font-size:9px; padding:1px 5px; border-radius:8px; font-weight:700; vertical-align:middle; margin-left:3px; }
.badge-schema { font-size:10px; padding:2px 8px; border-radius:10px; font-weight:700; display:inline-flex; align-items:center; gap:3px; }
.progress-bar-bg { background:rgba(15,23,42,0.6); border-radius:999px; height:8px; overflow:hidden; }
.progress-bar-fill { height:100%; border-radius:999px; background:linear-gradient(90deg,#059669,#34d399); transition:width .5s; box-shadow:0 0 10px rgba(52,211,153,0.4); }
.inline-input { background:rgba(15,23,42,0.7); border:1px solid rgba(99,102,241,0.3); color:#e2e8f0; border-radius:6px; padding:4px 8px; font-size:12px; width:100%; min-width:80px; transition:all .2s; }
.inline-input:focus { outline:none; border-color:#818cf8; box-shadow:0 0 0 2px rgba(129,140,248,0.2); }
.edit-mode-bar { background:linear-gradient(90deg,rgba(99,102,241,0.15),rgba(6,182,212,0.1)); border:1px solid rgba(129,140,248,0.35); border-radius:10px; padding:8px 16px; font-size:12px; color:#a5b4fc; display:flex; align-items:center; gap:10px; }
.edit-mode-dot { width:8px; height:8px; border-radius:50%; background:#818cf8; animation:pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1);} 50%{opacity:.5;transform:scale(1.3);} }
.toast { position:fixed; bottom:30px; right:30px; z-index:9999; padding:13px 22px; border-radius:12px; font-weight:600; font-size:14px; box-shadow:0 8px 30px rgba(0,0,0,0.5); pointer-events:none; animation:toastIn .35s ease,toastOut .4s ease 2.6s forwards; }
.toast-success { background:linear-gradient(135deg,#059669,#047857); color:white; }
.toast-info { background:linear-gradient(135deg,#6366f1,#4f46e5); color:white; }
.toast-warning { background:linear-gradient(135deg,#d97706,#b45309); color:white; }
.toast-error { background:linear-gradient(135deg,#dc2626,#b91c1c); color:white; }
@keyframes toastIn { from{opacity:0;transform:translateY(18px);} to{opacity:1;transform:translateY(0);} }
@keyframes toastOut { from{opacity:1;} to{opacity:0;} }
.section-label { color:#94a3b8; font-size:11px; text-transform:uppercase; letter-spacing:.1em; font-weight:700; margin-bottom:6px; display:block; }
.search-input { background:rgba(15,23,42,0.7); border:1px solid rgba(99,102,241,0.3); color:#e2e8f0; border-radius:8px; padding:8px 14px 8px 36px; font-size:13px; transition:all .3s; }
.search-input:focus { outline:none; border-color:#818cf8; box-shadow:0 0 0 3px rgba(129,140,248,0.15); }
.search-input::placeholder { color:#94a3b8; }
.tab-edit-input { background:#1e293b !important; color:#e2e8f0 !important; border:1px solid rgba(99,102,241,0.5); }
.tab-edit-input::placeholder { color:#94a3b8; }
.tab-edit-input:focus { outline:none; box-shadow:0 0 0 2px rgba(129,140,248,0.4); }
.modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.75); backdrop-filter:blur(6px); z-index:200; display:flex; align-items:center; justify-content:center; padding:16px; }
.modal-box { background:linear-gradient(135deg,#1e293b,#0f172a); border:1px solid rgba(129,140,248,0.3); border-radius:16px; padding:28px 32px; width:100%; box-shadow:0 20px 60px rgba(0,0,0,0.6); max-height:90vh; overflow-y:auto; }
.stat-card { background:rgba(15,23,42,0.6); border:1px solid rgba(99,102,241,0.2); border-radius:10px; padding:12px 18px; }
.info-bar { background:rgba(99,102,241,0.08); border:1px solid rgba(99,102,241,0.2); border-radius:8px; padding:10px 14px; font-size:12px; color:#94a3b8; }
.info-bar-amber { background:rgba(245,158,11,0.08); border:1px solid rgba(245,158,11,0.25); border-radius:8px; padding:10px 14px; font-size:12px; color:#fbbf24; }
.info-bar-cyan { background:rgba(6,182,212,0.08); border:1px solid rgba(6,182,212,0.25); border-radius:8px; padding:10px 14px; font-size:12px; color:#38bdf8; }
.info-bar-rose { background:rgba(225,29,72,0.08); border:1px solid rgba(225,29,72,0.25); border-radius:8px; padding:10px 14px; font-size:12px; color:#fb7185; }
.file-badge { display:inline-flex; align-items:center; gap:6px; background:rgba(99,102,241,0.15); border:1px solid rgba(129,140,248,0.3); border-radius:8px; padding:5px 12px; font-size:12px; color:#a5b4fc; }
.file-badge-amber { background:rgba(245,158,11,0.12); border-color:rgba(245,158,11,0.3); color:#fbbf24; }
.file-badge-cyan { background:rgba(6,182,212,0.12); border-color:rgba(6,182,212,0.3); color:#38bdf8; }
.preview-box { background:rgba(15,23,42,0.8); border:1px solid rgba(99,102,241,0.2); border-radius:8px; padding:10px 14px; font-size:11px; font-family:monospace; color:#94a3b8; max-height:110px; overflow-y:auto; white-space:pre-wrap; word-break:break-all; }
.toggle-track { width:44px; height:24px; border-radius:999px; transition:background .3s; position:relative; cursor:pointer; flex-shrink:0; }
.toggle-thumb { position:absolute; top:3px; left:3px; width:18px; height:18px; border-radius:50%; background:white; box-shadow:0 1px 4px rgba(0,0,0,0.4); transition:transform .3s; }
.del-col-preview { background:rgba(220,38,38,0.08); border:1px solid rgba(248,113,113,0.25); border-radius:8px; padding:10px 14px; font-size:12px; color:#fca5a5; }
.section-title { display:flex; align-items:center; gap:8px; margin-bottom:16px; }
.section-title .bar { width:3px; height:20px; border-radius:2px; }
.history-item { background:rgba(15,23,42,0.6); border:1px solid rgba(99,102,241,0.15); border-radius:8px; padding:8px 12px; font-size:12px; color:#94a3b8; display:flex; align-items:center; gap:8px; }
.history-dot { width:6px; height:6px; border-radius:50%; flex-shrink:0; }
.ctx-menu { position:fixed; z-index:500; background:linear-gradient(135deg,#1e293b,#0f172a); border:1px solid rgba(129,140,248,0.3); border-radius:10px; padding:6px 0; box-shadow:0 12px 40px rgba(0,0,0,0.6); min-width:170px; animation:ctxIn .15s ease; }
@keyframes ctxIn { from{opacity:0;transform:scale(.95);} to{opacity:1;transform:scale(1);} }
.ctx-item { padding:8px 16px; font-size:13px; color:#cbd5e1; cursor:pointer; transition:background .15s; display:flex; align-items:center; gap:8px; white-space:nowrap; }
.ctx-item:hover { background:rgba(99,102,241,0.15); color:white; }
.ctx-item.danger:hover { background:rgba(220,38,38,0.15); color:#fca5a5; }
.ctx-divider { border:none; border-top:1px solid rgba(99,102,241,0.15); margin:4px 0; }
/* 表头格式(schema)色带 */
.schema-colors { --s0:#818cf8; --s1:#38bdf8; --s2:#34d399; --s3:#f59e0b; --s4:#f43f5e; --s5:#a78bfa; --s6:#fb923c; --s7:#2dd4bf; }
.schema-tag { display:inline-flex; align-items:center; gap:4px; font-size:10px; padding:2px 8px; border-radius:10px; font-weight:700; white-space:nowrap; }
/* 表头格式统计卡片 */
.schema-stat-card {
background:rgba(15,23,42,0.6); border:1px solid rgba(99,102,241,0.15);
border-radius:10px; padding:10px 14px; display:flex; align-items:center; gap:10px;
transition:all .2s;
}
.schema-stat-card:hover { border-color:rgba(99,102,241,0.35); }
.schema-stat-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.schema-stat-bar { height:6px; border-radius:3px; transition:width .4s; }
</style>
</head>
<body x-data="tableApp()" x-cloak @click="closeCtxMenu()" @keydown.escape.window="closeCtxMenu();stopCellEdit()">
<!-- ══ Toast ══ -->
<template x-if="toast.show">
<div class="toast" :class="'toast-'+toast.type" x-text="toast.msg"></div>
</template>
<!-- ══ 标注悬停提示(字体放大一倍显示) ══ -->
<div class="annotation-tooltip-popup" x-show="annotationTooltip.show" x-transition
:style="'left:'+annotationTooltip.x+'px;top:'+annotationTooltip.y+'px'"
x-text="annotationTooltip.text"></div>
<!-- ══ 右键菜单 ══ -->
<div class="ctx-menu" x-show="ctxMenu.show" style="display:none;"
:style="'top:'+ctxMenu.y+'px;left:'+ctxMenu.x+'px'" @click.stop>
<div class="ctx-item" @click="ctxConfirmRow()">✅ <span x-text="ctxMenu.row&&ctxMenu.row.__confirmed?'撤销确认':'确认此行'"></span></div>
<div class="ctx-item" @click="ctxEditRow()">✏️ 编辑此行</div>
<div class="ctx-item" @click="ctxDuplicateRow()">📋 复制此行</div>
<hr class="ctx-divider"/>
<div class="ctx-item" @click="ctxDeleteRow()">🗑️ 删除此行</div>
<template x-if="ctxMenu.ci!==null">
<div>
<hr class="ctx-divider"/>
<div class="ctx-item" @click="openAnnotationModal()">📌 <span x-text="getCellAnnotation(ctxMenu.row,ctxMenu.ci)?'编辑标注':'添加标注'"></span></div>
<div class="ctx-item" x-show="getCellAnnotation(ctxMenu.row,ctxMenu.ci)" @click="clearCellAnnotation(); closeCtxMenu();">🗑️ 清除标注</div>
<hr class="ctx-divider"/>
<div class="ctx-item danger" @click="ctxDeleteCol()">❌ 删除列「<span x-text="ctxMenu.ci!==null?headers[ctxMenu.ci]:''"></span>」</div>
</div>
</template>
</div>
<!-- ══════ 弹窗:单元格标注 ══════ -->
<template x-if="showAnnotationModal">
<div class="modal-overlay" @click.self="showAnnotationModal=false">
<div class="modal-box" style="max-width:480px;">
<h3 class="text-lg font-bold text-purple-300 mb-4">📌 单元格标注</h3>
<p class="text-slate-400 text-sm mb-3">为当前单元格添加需特别关注的说明,鼠标悬停时将显示此提示内容。</p>
<div class="mb-4">
<span class="section-label">标注内容</span>
<textarea x-model="annotationInput" rows="4" placeholder="例如:需与硬件版本对齐、需二次确认…" class="input-area w-full rounded-lg px-4 py-3 text-sm"></textarea>
</div>
<div class="flex gap-3 justify-end">
<button @click="showAnnotationModal=false" class="px-5 py-2 rounded-lg text-sm font-semibold text-slate-400 hover:text-slate-200 border border-slate-600 hover:border-slate-400 transition-all">取消</button>
<button @click="saveCellAnnotation(); showAnnotationModal=false;" class="btn-primary px-5 py-2 rounded-lg text-sm font-semibold text-white">保存标注</button>
</div>
</div>
</div>
</template>
<!-- ══════ 弹窗:添加自定义列 ══════ -->
<template x-if="showAddColModal">
<div class="modal-overlay" @click.self="showAddColModal=false">
<div class="modal-box" style="max-width:460px;">
<h3 class="text-lg font-bold text-indigo-300 mb-5">➕ 添加自定义列</h3>
<div class="mb-4">
<span class="section-label">列名称</span>
<input x-model="newColName" @keydown.enter="addCustomColumn()" type="text" placeholder="请输入列名..." class="input-area w-full rounded-lg px-4 py-2 text-sm"/>
</div>
<div class="mb-4">
<span class="section-label">默认值(可选)</span>
<input x-model="newColDefault" @keydown.enter="addCustomColumn()" type="text" placeholder="空白则留空..." class="input-area w-full rounded-lg px-4 py-2 text-sm"/>
</div>
<div class="mb-4">
<span class="section-label">插入位置</span>
<select x-model.number="newColPosition" class="input-area w-full rounded-lg px-4 py-2 text-sm">
<option value="-1">末尾</option>
<template x-for="(h,i) in headers" :key="'pos'+i"><option :value="i" x-text="'在「'+h+'」之前'"></option>
</template>
</select>
</div>
<div class="flex gap-3 justify-end">
<button @click="showAddColModal=false" class="px-5 py-2 rounded-lg text-sm font-semibold text-slate-400 hover:text-slate-200 border border-slate-600 hover:border-slate-400 transition-all">取消</button>
<button @click="addCustomColumn()" class="btn-primary px-5 py-2 rounded-lg text-sm font-semibold text-white">确认添加</button>
</div>
</div>
</div>
</template>
<!-- ══════ 弹窗:删除列确认 ══════ -->
<template x-if="showDelColModal">
<div class="modal-overlay" @click.self="showDelColModal=false">
<div class="modal-box" style="max-width:500px;">
<h3 class="text-lg font-bold text-red-400 mb-4">🗑️ 删除列确认</h3>
<div class="del-col-preview mb-4">
<div class="mb-2">⚠️ 即将删除列:<strong class="text-white" x-text="delColTarget.name"></strong></div>
<div class="text-xs text-red-300/70">此操作不可撤销。</div>
</div>
<div class="mb-4 info-bar text-xs">
📊 影响 <strong class="text-white" x-text="rows.length"></strong> 行
<template x-if="delColTarget.isCustom"><span class="badge-custom ml-1">自定义列</span></template>
<template x-if="!delColTarget.isCustom"><span class="text-amber-400 font-semibold ml-1">原始列</span></template>
</div>
<div class="mb-5">
<span class="section-label">该列前5行预览</span>
<div class="del-col-preview text-xs font-mono" style="max-height:100px;overflow-y:auto;">
<template x-for="(row,i) in rows.slice(0,5)" :key="'dcp'+i">
<div class="mb-0.5"><span class="text-slate-400" x-text="'#'+(i+1)+' '"></span><span class="text-slate-300" x-text="getCellValue(row,delColTarget.ci)"></span></div>
</template>
<div x-show="rows.length>5" class="text-slate-400 mt-1">... 还有 <span x-text="rows.length-5"></span> 行</div>
</div>
</div>
<div class="flex gap-3 justify-end">
<button @click="showDelColModal=false" class="px-5 py-2 rounded-lg text-sm font-semibold text-slate-400 hover:text-slate-200 border border-slate-600 hover:border-slate-400 transition-all">取消</button>
<button @click="doDeleteColumn()" class="btn-danger px-5 py-2 rounded-lg text-sm font-semibold text-white">确认删除</button>
</div>
</div>
</div>
</template>
<!-- ══════ 弹窗:导出设置 ══════ -->
<template x-if="showExportModal">
<div class="modal-overlay" @click.self="showExportModal=false">
<div class="modal-box" style="max-width:520px;">
<h3 class="text-lg font-bold text-emerald-300 mb-4">📤 导出设置</h3>
<div class="stat-card mb-5">
<div class="flex gap-6 text-sm flex-wrap">
<div><span class="text-slate-400">总记录:</span><span class="text-white font-bold" x-text="rows.length"></span></div>
<div><span class="text-slate-400">已确认:</span><span class="text-emerald-400 font-bold" x-text="confirmedCount"></span></div>
<div><span class="text-slate-400">未确认:</span><span class="text-amber-400 font-bold" x-text="rows.length-confirmedCount"></span></div>
</div>
</div>
<div class="flex flex-col gap-4 mb-5">
<label class="flex items-center gap-3 cursor-pointer">
<div class="toggle-track" :style="exportOnlyConfirmed?'background:#4f46e5':'background:#334155'" @click="exportOnlyConfirmed=!exportOnlyConfirmed">
<div class="toggle-thumb" :style="exportOnlyConfirmed?'transform:translateX(20px)':''"></div>
</div>
<span class="text-slate-300 text-sm">仅导出已确认的行</span>
</label>
<label class="flex items-center gap-3 cursor-pointer">
<div class="toggle-track" :style="exportShowCustom?'background:#4f46e5':'background:#334155'" @click="exportShowCustom=!exportShowCustom">
<div class="toggle-thumb" :style="exportShowCustom?'transform:translateX(20px)':''"></div>
</div>
<span class="text-slate-300 text-sm">包含自定义列</span>
</label>
<div x-show="schemas.length>1">
<span class="section-label mb-2">按表头格式过滤导出</span>
<div class="flex flex-wrap gap-2">
<label class="flex items-center gap-2 cursor-pointer" x-for="(s,si) in schemas" :key="'exps'+si">
<input type="checkbox" :checked="exportSchemaFilter.includes(si)" @change="toggleExportSchema(si)" class="accent-indigo-500"/>
<span class="schema-tag" :style="'background:'+getSchemaColor(si)+'22;color:'+getSchemaColor(si)+';border:1px solid'+getSchemaColor(si)+'55'">
<span class="inline-block w-2 h-2 rounded-full" :style="'background:'+getSchemaColor(si)"></span>
<span x-text="s.name"></span>
<span class="text-[9px] opacity-70" x-text="'('+getSchemaRowCount(si)+'行)'"></span>
</span>
</label>
</div>
</div>
</div>
<div class="flex gap-3 justify-end">
<button @click="showExportModal=false" class="px-5 py-2 rounded-lg text-sm font-semibold text-slate-400 hover:text-slate-200 border border-slate-600 hover:border-slate-400 transition-all">取消</button>
<button @click="doExport()" class="btn-success px-5 py-2 rounded-lg text-sm font-semibold text-white">⬇️ 导出 HTML</button>
</div>
</div>
</div>
</template>
<!-- ══════ 弹窗:在当前表追加 ══════ -->
<template x-if="showAppendModal && appendTarget==='current'">
<div class="modal-overlay" @click.self="closeAppendModal()">
<div class="modal-box" style="max-width:720px;">
<div class="flex items-center justify-between mb-1">
<h3 class="text-lg font-bold text-amber-300">📎 在当前表追加</h3>
<button @click="closeAppendModal()" class="text-slate-400 hover:text-slate-200 text-xl leading-none transition-colors">✕</button>
</div>
<p class="text-slate-400 text-xs mb-5">按现有表头格式,将新记录追加到当前表格末尾。</p>
<div class="mb-5" x-show="schemas.length>0">
<span class="section-label">选择表头格式</span>
<div class="flex flex-wrap gap-2 mb-3">
<template x-for="(s,si) in schemas" :key="'as'+si">
<button class="tab-btn text-xs px-3 py-1.5"
:class="appendSchemaIdx===si ? 'tab-active-amber' : 'tab-inactive'"
@click="appendSchemaIdx=si">
<span x-text="s.name"></span>
<span class="text-[9px] opacity-60 ml-1" x-text="'('+s.headers.length+'列)'"></span>
</button>
</template>
</div>
<div x-show="appendSchemaIdx>=0 && schemas[appendSchemaIdx]" class="info-bar-amber text-xs">
📋 使用「<strong class="text-amber-200" x-text="schemas[appendSchemaIdx]?.name||''"></strong>」格式,
<strong class="text-amber-200" x-text="schemas[appendSchemaIdx]?.headers.length||0"></strong> 列,
每条记录 = 连续 <strong class="text-amber-200" x-text="schemas[appendSchemaIdx]?.headers.length||0"></strong> 行
</div>
</div>
<div x-show="schemas.length===0" class="info-bar-rose text-xs mb-5">当前无表头格式,请先导入数据或使用「新建表追加」。</div>
<div class="mb-4">
<span class="section-label">数据来源</span>
<div class="flex gap-2 mb-3">
<button @click="appendMode='text'" class="tab-btn text-xs" :class="appendMode==='text'?'tab-active-amber':'tab-inactive'">✏️ 文本</button>
<button @click="appendMode='file'" class="tab-btn text-xs" :class="appendMode==='file'?'tab-active-amber':'tab-inactive'">📁 文件</button>
</div>
<div x-show="appendMode==='text'">
<textarea x-model="appendValInput" class="input-area-amber w-full rounded-xl px-4 py-3 text-sm font-mono" rows="8" placeholder="粘贴数据...每列一行,多记录连续填写"></textarea>
</div>
<div x-show="appendMode==='file'">
<div class="drop-zone-amber p-6 text-center" :class="appendDragOver?'drag-over':''"
@dragover.prevent="appendDragOver=true" @dragleave="appendDragOver=false" @drop.prevent="onDropAppend($event)">
<input type="file" accept=".txt" class="file-input-hidden" @change="onSelectAppendFile($event)"/>
<div class="text-3xl mb-2">📄</div>
<div class="text-slate-300 text-xs">拖拽/点击选择数据TXT</div>
<div x-show="appendFileName" class="mt-2"><span class="file-badge file-badge-amber text-xs">📄 <span x-text="appendFileName"></span></span></div>
</div>
</div>
</div>
<div x-show="appendEstimate>0" class="info-bar mt-3 text-xs">
📊 预计追加 <strong class="text-slate-200" x-text="appendEstimate"></strong> 条记录
</div>
<div class="flex gap-3 justify-end mt-5">
<button @click="closeAppendModal()" class="px-5 py-2 rounded-lg text-sm font-semibold text-slate-400 hover:text-slate-200 border border-slate-600 hover:border-slate-400 transition-all">取消</button>
<button @click="doAppend()" class="btn-amber px-5 py-2 rounded-lg text-sm font-semibold text-white" :disabled="schemas.length===0">➕ 执行追加</button>
</div>
</div>
</div>
</template>
<!-- ══════ 弹窗:新建表追加 ══════ -->
<template x-if="showAppendModal && appendTarget==='new'">
<div class="modal-overlay" @click.self="closeAppendModal()">
<div class="modal-box" style="max-width:720px;">
<div class="flex items-center justify-between mb-1">
<h3 class="text-lg font-bold text-cyan-300">📋 新建表追加</h3>
<button @click="closeAppendModal()" class="text-slate-400 hover:text-slate-200 text-xl leading-none transition-colors">✕</button>
</div>
<p class="text-slate-400 text-xs mb-5">新建一种表头格式,并将数据按该格式追加到当前表格。</p>
<div class="mb-5 p-4 rounded-xl" style="background:rgba(6,182,212,0.06);border:1px solid rgba(6,182,212,0.2);">
<span class="section-label">新建表头</span>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-4">
<div>
<span class="section-label">格式名称</span>
<input x-model="appendNewSchemaName" type="text" placeholder="例:Format-B" class="input-area-cyan w-full rounded-lg px-3 py-2 text-sm"/>
</div>
<div>
<span class="section-label">表头来源</span>
<div class="flex flex-wrap gap-2 items-center">
<button @click="appendNewHeadMode='text'" class="tab-btn text-xs px-3 py-1"
:class="appendNewHeadMode==='text'?'tab-active-cyan':'tab-inactive'">✏️ 文本</button>
<button @click="appendNewHeadMode='file'" class="tab-btn text-xs px-3 py-1"
:class="appendNewHeadMode==='file'?'tab-active-cyan':'tab-inactive'">📁 文件</button>
<button @click="applyDefaultNewHead()" class="text-xs px-3 py-1.5 rounded-lg font-semibold transition-all border border-cyan-500/50 text-cyan-300 hover:bg-cyan-500/20" title="填入默认表头:Name, Bits, Permission 等">📋 默认表头</button>
</div>
</div>
</div>
<div x-show="appendNewHeadMode==='text'" class="mt-3">
<textarea x-model="appendNewHeadInput" class="input-area-cyan w-full rounded-xl px-4 py-3 text-sm font-mono" rows="5" placeholder="每行一个列名,或点击「默认表头」填入预设列名"></textarea>
</div>
<div x-show="appendNewHeadMode==='file'" class="mt-3">
<div class="drop-zone-cyan p-5 text-center" :class="appendNewHeadDragOver?'drag-over':''"
@dragover.prevent="appendNewHeadDragOver=true" @dragleave="appendNewHeadDragOver=false"
@drop.prevent="onDropAppendNewHead($event)">
<input type="file" accept=".txt" class="file-input-hidden" @change="onSelectAppendNewHeadFile($event)"/>
<div class="text-3xl mb-2">📋</div>
<div class="text-slate-300 text-xs">拖拽/点击选择列头TXT</div>
<div x-show="appendNewHeadFileName" class="mt-2"><span class="file-badge file-badge-cyan text-xs">📄 <span x-text="appendNewHeadFileName"></span></span></div>
</div>
</div>
<div x-show="parsedNewHeadPreview.length>0" class="info-bar-cyan mt-3 text-xs">
🔍 解析到 <strong class="text-cyan-200" x-text="parsedNewHeadPreview.length"></strong> 列:<span class="text-slate-300" x-text="parsedNewHeadPreview.join(' | ')"></span>
</div>
</div>
<div class="mb-4">
<span class="section-label">数据来源</span>
<div class="flex gap-2 mb-3">
<button @click="appendMode='text'" class="tab-btn text-xs" :class="appendMode==='text'?'tab-active-cyan':'tab-inactive'">✏️ 文本</button>
<button @click="appendMode='file'" class="tab-btn text-xs" :class="appendMode==='file'?'tab-active-cyan':'tab-inactive'">📁 文件</button>
</div>
<div x-show="appendMode==='text'">
<textarea x-model="appendValInput" class="input-area-cyan w-full rounded-xl px-4 py-3 text-sm font-mono" rows="8" placeholder="粘贴数据...每列一行,多记录连续填写"></textarea>
</div>
<div x-show="appendMode==='file'">
<div class="drop-zone-cyan p-6 text-center" :class="appendDragOver?'drag-over':''"
@dragover.prevent="appendDragOver=true" @dragleave="appendDragOver=false" @drop.prevent="onDropAppend($event)">
<input type="file" accept=".txt" class="file-input-hidden" @change="onSelectAppendFile($event)"/>
<div class="text-3xl mb-2">📄</div>
<div class="text-slate-300 text-xs">拖拽/点击选择数据TXT</div>
<div x-show="appendFileName" class="mt-2"><span class="file-badge file-badge-cyan text-xs">📄 <span x-text="appendFileName"></span></span></div>
</div>
</div>
</div>
<div x-show="appendEstimate>0" class="info-bar-cyan mt-3 text-xs">
📊 预计追加 <strong class="text-cyan-200" x-text="appendEstimate"></strong> 条记录
</div>
<div class="flex gap-3 justify-end mt-5">
<button @click="closeAppendModal()" class="px-5 py-2 rounded-lg text-sm font-semibold text-slate-400 hover:text-slate-200 border border-slate-600 hover:border-slate-400 transition-all">取消</button>
<button @click="doAppend()" class="btn-cyan px-5 py-2 rounded-lg text-sm font-semibold text-white">📋 新建并追加</button>
</div>
</div>
</div>
</template>
<!-- ══════ 弹窗:编辑整行 ══════ -->
<template x-if="showEditRowModal">
<div class="modal-overlay" @click.self="showEditRowModal=false">
<div class="modal-box" style="max-width:640px;">
<h3 class="text-lg font-bold text-indigo-300 mb-4">✏️ 编辑行 #<span x-text="editRowTarget?editRowTarget.__displayIndex:''"></span></h3>
<div class="flex flex-col gap-3 mb-5">
<template x-for="(col,ci) in headers" :key="'er'+ci">
<div>
<span class="section-label" x-text="col" style="margin-bottom:3px;"></span>
<textarea class="input-area w-full rounded-lg px-3 py-2 text-sm font-mono" rows="2"
:value="editRowTarget?getCellValue(editRowTarget,ci):''"
@input="editRowData[ci]=$event.target.value"></textarea>
</div>
</template>
</div>
<div class="flex gap-3 justify-end">
<button @click="showEditRowModal=false" class="px-5 py-2 rounded-lg text-sm font-semibold text-slate-400 hover:text-slate-200 border border-slate-600 hover:border-slate-400 transition-all">取消</button>
<button @click="saveEditRow()" class="btn-primary px-5 py-2 rounded-lg text-sm font-semibold text-white">💾 保存</button>
</div>
</div>
</div>
</template>
<!-- ══════ 弹窗:列数确认(首次解析时弹出) ══════ -->
<template x-if="showColCountModal">
<div class="modal-overlay" @click.self="showColCountModal=false">
<div class="modal-box" style="max-width:520px;">
<h3 class="text-lg font-bold text-cyan-300 mb-4">🔢 确认列数</h3>
<div class="info-bar-cyan mb-4 text-xs">
从列头文件解析到 <strong class="text-white" x-text="parsedHeadLines.length"></strong> 个非空行。
数据文件共 <strong class="text-white" x-text="parsedValLineCount"></strong> 个非空行。
</div>
<div class="mb-4">
<span class="section-label">列头预览</span>
<div class="preview-box" style="max-height:130px;">
<template x-for="(h,i) in parsedHeadLines" :key="'phd'+i">
<div class="mb-0.5">
<span class="text-indigo-400 font-bold" x-text="'['+i+'] '"></span>
<span class="text-slate-300" x-text="h"></span>
</div>
</template>
</div>
</div>
<div class="mb-4">
<span class="section-label">列数(可手动调整)</span>
<input x-model.number="confirmedColCount" type="number" min="1" :max="parsedHeadLines.length"
class="input-area w-full rounded-lg px-4 py-2 text-sm"/>
<div class="text-xs text-slate-400 mt-1">
以此列数计算:每 <span x-text="confirmedColCount"></span> 行 = 1条记录,
预计 <strong class="text-indigo-300" x-text="confirmedColCount>0?Math.floor(parsedValLineCount/confirmedColCount):0"></strong> 条记录
<span x-show="parsedValLineCount%confirmedColCount!==0" class="text-amber-400">(末尾有余行将补空)</span>
</div>
</div>
<div class="mb-4">
<span class="section-label">表头格式名称</span>
<input x-model="colCountSchemaName" type="text" placeholder="例:Format-A" class="input-area w-full rounded-lg px-4 py-2 text-sm"/>
</div>
<div class="flex gap-3 justify-end">
<button @click="showColCountModal=false" class="px-5 py-2 rounded-lg text-sm font-semibold text-slate-400 hover:text-slate-200 border border-slate-600 hover:border-slate-400 transition-all">取消</button>
<button @click="doConfirmedParse()" class="btn-cyan px-5 py-2 rounded-lg text-sm font-semibold text-white">🚀 确认并生成表格</button>
</div>
</div>
</div>
</template>
<!-- ══════════════════════════════════════════
主体
════════════════════════════════════════════ -->
<div class="max-w-screen-2xl mx-auto px-4 py-8">
<div class="text-center mb-8">
<h1 class="text-3xl font-black neon-title mb-2">📋 表格内容确认工具</h1>
<p class="text-slate-400 text-sm">导入 · 多表头格式 · 在线编辑 · 增删列 · 逐行确认 · 导出</p>
</div>
<!-- ═══ 导入区域 ═══ -->
<div class="glass-card rounded-2xl p-6 mb-6">
<div class="section-title mb-4 flex-wrap gap-2">
<div class="bar" style="background:#818cf8;"></div>
<span class="text-indigo-300 font-bold text-[15px]">数据导入</span>
<button type="button" @click="$refs.importModificationsInputInit&&$refs.importModificationsInputInit.click()" class="btn-rose text-white text-sm font-bold px-4 py-2 rounded-xl ml-auto" title="从之前导出的 JSON 文件恢复数据继续编辑">📂 导入历史数据</button>
<button x-show="undoSnapshot !== null" @click="undoLastImport()" class="btn-warning text-white text-sm font-bold px-4 py-2 rounded-xl" title="恢复到本次导入前的状态">↩️ 撤消上一步</button>
<input type="file" accept=".json,application/json" x-ref="importModificationsInputInit" @change="doImportModifications($event)" style="display:none">
<span x-show="rows.length>0" class="text-xs text-slate-400">已有 <span class="text-indigo-300 font-bold" x-text="rows.length"></span> 条</span>
</div>
<div class="flex gap-2 mb-5 flex-wrap">
<button @click="importTab='manual'" class="tab-btn" :class="importTab==='manual'?'tab-active-indigo':'tab-inactive'">✏️ 手动输入</button>
<button @click="importTab='file'" class="tab-btn" :class="importTab==='file'?'tab-active-indigo':'tab-inactive'">📁 TXT 文件</button>
<button @click="importTab='table'" class="tab-btn" :class="importTab==='table'?'tab-active-cyan':'tab-inactive'">📊 表格样式</button>
</div>
<!-- Tab1: 手动输入 -->
<div x-show="importTab==='manual'">
<div class="grid grid-cols-1 lg:grid-cols-2 gap-5 mb-5">
<div>
<span class="section-label">列头(每行一个列名)</span>
<textarea x-model="headInput" class="input-area w-full rounded-xl px-4 py-3 text-sm font-mono" rows="8"
placeholder="例: Address Name Copies Number Short Description Reset On For De"></textarea>
</div>
<div>
<span class="section-label">数据(每列一行,多条记录连续填写)</span>
<textarea x-model="valInput" class="input-area w-full rounded-xl px-4 py-3 text-sm font-mono" rows="8"
placeholder="若列头有6列,则每6行=1条记录: 0x170 CFG_RLM 1 RLM config grst [0:22](RW)"></textarea>
</div>
</div>
<div class="flex flex-wrap gap-3">
<button @click="startParse()" class="btn-primary text-white text-sm font-bold px-6 py-2.5 rounded-xl">🚀 解析</button>
<button @click="loadSampleData()" class="btn-cyan text-white text-sm font-semibold px-5 py-2.5 rounded-xl">📂 示例</button>
<button @click="clearAll()" class="btn-danger text-white text-sm font-semibold px-5 py-2.5 rounded-xl">🗑️ 清空</button>
</div>
</div>
<!-- Tab2: TXT 文件 -->
<div x-show="importTab==='file'">
<div class="grid grid-cols-1 lg:grid-cols-2 gap-5 mb-5">
<div>
<span class="section-label mb-2">列头 TXT</span>
<div class="drop-zone p-7 text-center" :class="headDragOver?'drag-over':''"
@dragover.prevent="headDragOver=true" @dragleave="headDragOver=false" @drop.prevent="onDropHead($event)">
<input type="file" accept=".txt" class="file-input-hidden" @change="onSelectHeadFile($event)"/>
<div class="text-4xl mb-2">📋</div>
<div class="text-slate-300 text-sm font-semibold mb-1">拖拽列头TXT</div>
<div class="text-slate-400 text-xs">或点击选择</div>
<div x-show="headFileName" class="mt-3 flex justify-center"><span class="file-badge">📄 <span x-text="headFileName"></span></span></div>
</div>
<div x-show="headInput" class="mt-2"><span class="section-label mb-1">预览</span><div class="preview-box" x-text="headPreview"></div></div>
</div>
<div>
<span class="section-label mb-2">数据 TXT</span>
<div class="drop-zone p-7 text-center" :class="valDragOver?'drag-over':''"
@dragover.prevent="valDragOver=true" @dragleave="valDragOver=false" @drop.prevent="onDropVal($event)">
<input type="file" accept=".txt" class="file-input-hidden" @change="onSelectValFile($event)"/>
<div class="text-4xl mb-2">📄</div>
<div class="text-slate-300 text-sm font-semibold mb-1">拖拽数据TXT</div>
<div class="text-slate-400 text-xs">或点击选择</div>
<div x-show="valFileName" class="mt-3 flex justify-center"><span class="file-badge">📄 <span x-text="valFileName"></span></span></div>
</div>
<div x-show="valInput" class="mt-2"><span class="section-label mb-1">预览</span><div class="preview-box" x-text="valPreview"></div></div>
</div>
</div>
<div class="flex flex-wrap gap-3">
<button @click="startParse()" class="btn-primary text-white text-sm font-bold px-6 py-2.5 rounded-xl">🚀 解析</button>
<button @click="clearAll()" class="btn-danger text-white text-sm font-semibold px-5 py-2.5 rounded-xl">🗑️ 清空</button>
</div>
</div>
<!-- Tab3: 表格样式 -->
<div x-show="importTab==='table'">
<div class="info-bar-cyan mb-4">📌 支持Tab/CSV/竖线表格,第一行自动识别为列头。</div>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-5 mb-5">
<div>
<span class="section-label">粘贴表格内容</span>
<textarea x-model="tableStyleInput" class="input-area-cyan w-full rounded-xl px-4 py-3 text-sm font-mono" rows="12" placeholder="粘贴TSV/CSV/Excel内容..."></textarea>
</div>
<div>
<span class="section-label mb-2">或拖拽文件</span>
<div class="drop-zone-cyan p-7 text-center" :class="tableStyleDragOver?'drag-over':''"
@dragover.prevent="tableStyleDragOver=true" @dragleave="tableStyleDragOver=false" @drop.prevent="onDropTableStyle($event)">
<input type="file" accept=".txt,.tsv,.csv" class="file-input-hidden" @change="onSelectTableStyleFile($event)"/>
<div class="text-4xl mb-2">📊</div>
<div class="text-slate-300 text-sm font-semibold">拖拽表格文件</div>
<div x-show="tableStyleFileName" class="mt-3"><span class="file-badge file-badge-cyan">📄 <span x-text="tableStyleFileName"></span></span></div>
</div>
<div x-show="tableStyleInput.trim()" class="info-bar-cyan mt-3 text-xs">
🔍 分隔符:<strong x-text="detectedDelimiter"></strong> | 列数:<strong x-text="detectedColCount"></strong> | 行数:<strong x-text="detectedRowCount"></strong>
</div>
</div>
</div>
<div class="flex flex-wrap gap-3">
<button @click="parseTableStyle()" class="btn-cyan text-white text-sm font-bold px-6 py-2.5 rounded-xl">📊 解析</button>
<button @click="clearAll()" class="btn-danger text-white text-sm font-semibold px-5 py-2.5 rounded-xl">🗑️ 清空</button>
</div>
</div>
</div>
<!-- ═══ 导出报告备注(与数据导入模块同风格,主页面默认显示) ═══ -->
<div class="glass-card rounded-2xl p-6 mb-6">
<div class="section-title mb-4">
<div class="bar" style="background:#34d399;"></div>
<span class="text-emerald-300 font-bold text-[15px]">导出报告备注</span>
<span class="ml-2 text-xs text-slate-400">导出 HTML 时显示在报告中</span>
</div>
<div class="mb-4">
<span class="section-label mb-2">报告标题</span>
<input type="text" x-model="exportReportTitle" placeholder="表格内容确认报告(全部)" class="input-area w-full rounded-xl px-4 py-3 text-sm"/>
</div>
<div class="mb-4">
<span class="section-label mb-2">备注</span>
<textarea x-model="exportRemark" class="input-area w-full rounded-xl px-4 py-3 text-sm font-mono" rows="8"
placeholder="可选。多行备注将显示在导出 HTML 报告的标题下方,支持换行。"></textarea>
</div>
<div>
<span class="section-label mb-2">公共表格</span>
<span class="ml-2 text-xs text-slate-400">可添加多个,导出 HTML 时全部显示在备注下方</span>
<div class="mt-2 flex flex-wrap gap-2 mb-2">
<template x-for="(ct, cti) in commonTables" :key="'ctab'+ct.id">
<div class="flex items-center rounded-xl overflow-hidden gap-0" :class="activeCommonTableIndex===cti ? 'tab-active-indigo' : 'tab-inactive'">
<button type="button" @click="activeCommonTableIndex=cti" class="px-3 py-1.5 text-sm font-medium truncate max-w-[140px]" x-text="ct.name || ('公共表格'+(cti+1))"></button>
<button type="button" @click="removeCommonTable(cti)" class="px-2 py-1.5 text-slate-400 hover:text-red-400 text-xs" title="删除此公共表格">×</button>
</div>
</template>
<button type="button" @click="addCommonTable()" class="tab-inactive px-3 py-1.5 text-sm rounded-xl">+ 新增公共表格</button>
</div>
<div x-show="commonTables.length===0" class="py-4 text-center text-slate-400 text-sm rounded-xl border border-slate-600/50 border-dashed">暂无公共表格,点击「新增公共表格」添加</div>
<template x-if="currentCommonTable">
<div class="overflow-x-auto rounded-xl border border-slate-600/50 bg-slate-800/30">
<div class="p-2 border-b border-slate-600/50 flex items-center gap-2 flex-wrap">
<span class="text-slate-400 text-sm">表格名称</span>
<input type="text" x-model="currentCommonTable.name" class="input-area rounded-lg px-3 py-1.5 text-sm flex-1 min-w-[120px]" placeholder="公共表格名称"/>
</div>
<table class="w-full text-sm border-collapse min-w-[200px]">
<thead>
<tr>
<template x-for="(h, hi) in currentCommonTable.headers" :key="'ch'+hi">
<th class="border border-slate-600/50 px-2 py-1.5 text-left bg-slate-700/50 text-slate-200 font-semibold group">
<div class="flex items-center gap-0.5">
<button type="button" x-show="hi>0" @click="moveCommonTableColLeft(activeCommonTableIndex, hi)" class="text-slate-400 hover:text-indigo-300 text-xs p-0.5 opacity-0 group-hover:opacity-100" title="左移列">←</button>
<input type="text" x-model="currentCommonTable.headers[hi]" class="bg-transparent border-0 flex-1 min-w-[50px] text-slate-200 focus:ring-0 p-0 text-sm" placeholder="列名"/>
<button type="button" x-show="hi<currentCommonTable.headers.length-1" @click="moveCommonTableColRight(activeCommonTableIndex, hi)" class="text-slate-400 hover:text-indigo-300 text-xs p-0.5 opacity-0 group-hover:opacity-100" title="右移列">→</button>
<button type="button" @click="removeCommonTableCol(activeCommonTableIndex, hi)" class="text-slate-400 hover:text-red-400 text-xs p-0.5 opacity-0 group-hover:opacity-100" title="删除此列">✕</button>
</div>
</th>
</template>
<th class="border border-slate-600/50 px-1 py-1 w-20 bg-slate-700/50 text-slate-400 text-xs font-normal">操作</th>
</tr>
</thead>
<tbody>
<template x-for="(row, ri) in currentCommonTable.rows" :key="'cr'+ri">
<tr class="bg-slate-800/40 hover:bg-slate-700/40">
<template x-for="(cell, ci) in row" :key="'cc'+ri+'-'+ci">
<td class="common-table-cell border border-slate-600/50 px-2 py-1 bg-slate-800/40">
<input type="text" x-model="currentCommonTable.rows[ri][ci]" class="w-full min-w-[60px] rounded px-1 py-0.5 text-sm" placeholder=""/>
</td>
</template>
<td class="border border-slate-600/50 px-1 py-1 w-20 text-center bg-slate-800/40 align-middle">
<div class="flex items-center justify-center gap-0.5 flex-wrap">
<button type="button" x-show="ri>0" @click="moveCommonTableRowUp(activeCommonTableIndex, ri)" class="text-slate-400 hover:text-indigo-300 text-xs p-0.5" title="上移">↑</button>
<button type="button" x-show="ri<currentCommonTable.rows.length-1" @click="moveCommonTableRowDown(activeCommonTableIndex, ri)" class="text-slate-400 hover:text-indigo-300 text-xs p-0.5" title="下移">↓</button>
<button type="button" @click="removeCommonTableRow(activeCommonTableIndex, ri)" class="text-slate-400 hover:text-red-400 text-xs p-0.5" title="删除此行">✕</button>
</div>
</td>
</tr>
</template>
</tbody>
</table>
<div class="p-2 flex flex-wrap gap-2 border-t border-slate-600/50">
<button type="button" @click="addCommonTableRow(activeCommonTableIndex)" class="text-xs px-3 py-1.5 rounded-lg bg-slate-600/60 hover:bg-slate-500/60 text-slate-200">+ 添加行</button>
<button type="button" @click="addCommonTableCol(activeCommonTableIndex)" class="text-xs px-3 py-1.5 rounded-lg bg-slate-600/60 hover:bg-slate-500/60 text-slate-200">+ 添加列</button>
<button type="button" @click="openCommonTableAppendModal()" class="text-xs px-3 py-1.5 rounded-lg bg-emerald-600/60 hover:bg-emerald-500/60 text-white" title="一次性粘贴表头与内容并解析追加">📥 一键追加</button>
<button type="button" @click="clearCommonTable(activeCommonTableIndex)" class="text-xs px-3 py-1.5 rounded-lg bg-amber-600/50 hover:bg-amber-500/50 text-amber-100" title="清空当前表的所有行,保留表头">🗑️ 清空当前表</button>
</div>
</div>
</template>
</div>
</div>
<!-- 公共表格 · 一键追加 弹窗 -->
<template x-if="showCommonTableAppendModal">
<div class="fixed inset-0 z-[100] flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm" @click.self="closeCommonTableAppendModal()">
<div class="glass-card rounded-2xl p-6 w-full max-w-2xl max-h-[90vh] overflow-y-auto" @click.stop>
<div class="section-title mb-4">
<div class="bar" style="background:#34d399;"></div>
<span class="text-emerald-300 font-bold text-[15px]">公共表格 · 一键追加</span>
<span class="ml-2 text-xs text-slate-400">与主表追加方式一致:表头 + 内容</span>
</div>
<p class="text-slate-400 text-xs mb-2" x-show="currentCommonTable && currentCommonTable.headers && currentCommonTable.headers.length">当前表头列数:<span x-text="currentCommonTable ? currentCommonTable.headers.length : 0"></span>。留空表头则仅追加数据行(按当前列数解析)。</p>
<div class="mb-4">
<span class="section-label mb-2">表头</span>
<textarea x-model="commonTableAppendHeadInput" class="input-area w-full rounded-xl px-4 py-3 text-sm font-mono" rows="4" placeholder="每行一个列名,或一行内用 Tab 分隔。留空则使用当前表头仅追加数据。"></textarea>
</div>
<div class="mb-4">
<span class="section-label mb-2">内容</span>
<textarea x-model="commonTableAppendValInput" class="input-area w-full rounded-xl px-4 py-3 text-sm font-mono" rows="8" placeholder="粘贴数据:每列一行,多记录连续填写(与主表「在当前表追加」格式相同)。"></textarea>
</div>
<div class="flex flex-wrap gap-3">
<button type="button" @click="doCommonTableAppend()" class="btn-success text-white text-sm font-bold px-5 py-2 rounded-xl">📥 解析并追加</button>
<button type="button" @click="closeCommonTableAppendModal()" class="btn-secondary text-sm px-5 py-2 rounded-xl">取消</button>
</div>
</div>
</div>
</template>
<!-- ═══ 有数据时显示(每个表独立一块,新建表追加后新表出现在下方) ═══ -->
<div x-show="hasAnyTableData" x-cloak>
<!-- 搜索/过滤(全局共用) -->
<div class="glass-card rounded-2xl px-5 py-3 mb-5 flex flex-wrap items-center gap-3">
<div class="relative flex-1" style="min-width:200px;">
<span class="absolute left-3 top-1/2 -translate-y-1/2 text-slate-400 text-sm select-none">🔍</span>
<input x-model="searchText" type="text" placeholder="搜索任意字段..." class="search-input w-full"/>
</div>
<div class="flex gap-2 flex-wrap">
<button @click="filterMode='all'" class="tab-btn text-xs px-3 py-1.5" :class="filterMode==='all'?'tab-active-indigo':'tab-inactive'">全部</button>
<button @click="filterMode='confirmed'" class="tab-btn text-xs px-3 py-1.5" :class="filterMode==='confirmed'?'tab-active-indigo':'tab-inactive'">已确认</button>
<button @click="filterMode='pending'" class="tab-btn text-xs px-3 py-1.5" :class="filterMode==='pending'?'tab-active-indigo':'tab-inactive'">未确认</button>
<button @click="filterMode='appended'" class="tab-btn text-xs px-3 py-1.5" :class="filterMode==='appended'?'tab-active-amber':'tab-inactive'">追加行</button>
</div>
<button @click="exportAllModifications()" class="btn-purple text-white text-sm font-bold px-4 py-2 rounded-xl whitespace-nowrap" title="将所有表的修改导出为一份 JSON">💾 导出所有修改</button>
<button @click="doExportAllTables()" class="btn-success text-white text-sm font-bold px-4 py-2 rounded-xl whitespace-nowrap" title="将所有表格合并导出为一份 HTML 报告">📤 导出所有表格</button>
<button x-show="undoSnapshot !== null" @click="undoLastImport()" class="btn-warning text-white text-sm font-bold px-4 py-2 rounded-xl whitespace-nowrap" title="恢复到本次导入前的状态">↩️ 撤消上一步</button>
</div>
<input type="file" accept=".json,application/json" x-ref="importModificationsInputMulti" @change="doImportModifications($event)" style="display:none">
<!-- 所有表确认统计 -->
<div class="glass-card rounded-2xl px-5 py-4 mb-4" x-show="hasAnyTableData">
<div class="section-title mb-2">
<div class="bar" style="background:#34d399;"></div>
<span class="text-emerald-300 font-bold text-[15px]">所有表确认统计</span>
</div>
<div class="flex flex-wrap gap-4">
<div class="stat-card flex-1" style="min-width:100px;">
<div class="section-label" style="margin-bottom:2px;">表数量</div>
<div class="text-2xl font-black text-white" x-text="tables.filter(t=>t.rows&&t.rows.length>0).length"></div>
</div>
<div class="stat-card flex-1" style="min-width:100px;">
<div class="section-label" style="margin-bottom:2px;">总记录</div>
<div class="text-2xl font-black text-white" x-text="allTablesTotalRows"></div>
</div>
<div class="stat-card flex-1" style="min-width:100px;">
<div class="section-label" style="margin-bottom:2px;">已确认</div>
<div class="text-2xl font-black text-emerald-400" x-text="allTablesConfirmedCount"></div>
</div>
<div class="stat-card flex-1" style="min-width:100px;">
<div class="section-label" style="margin-bottom:2px;">未确认</div>
<div class="text-2xl font-black text-amber-400" x-text="allTablesTotalRows - allTablesConfirmedCount"></div>
</div>
<div class="stat-card flex-1" style="min-width:160px;">
<div class="section-label" style="margin-bottom:4px;">总确认率</div>
<div class="progress-bar-bg mb-1"><div class="progress-bar-fill" :style="'width:'+allTablesProgressPct+'%'"></div></div>
<div class="text-right text-xs text-slate-400" x-text="allTablesProgressPct+'%'"></div>
</div>
</div>
</div>
<!-- 表 Tab 切换(双击表名可编辑,× 删除整表) -->
<div class="flex flex-wrap gap-2 mb-4 border-b border-slate-700/40 pb-3">
<template x-for="(t, ti) in tables" :key="'tab'+t.id">
<div class="flex items-center rounded-xl overflow-hidden gap-0" :class="activeTableIndex===ti && editingTabIndex!==ti ? 'tab-active-indigo' : (editingTabIndex===ti ? '' : 'tab-inactive')">
<template x-if="editingTabIndex !== ti">
<button type="button" @click="activeTableIndex=ti" @dblclick.prevent="editingTabIndex=ti"
class="tab-btn text-sm px-4 py-2 font-bold text-left min-w-0 rounded-l-xl"
:class="tables.length>1 ? 'rounded-r-none' : 'rounded-r-xl'"
:title="'双击编辑表名 · '+((t.rows?t.rows.length:0))+' 条'"
x-text="(t.name||('表'+t.id)) + ' (' + (t.rows?t.rows.length:0) + ' 条)'"></button>
</template>
<template x-if="editingTabIndex === ti">
<input type="text" x-model="t.name"
@blur="if(!(t.name||'').trim()) t.name='表'+t.id; editingTabIndex=-1"
@keydown.enter.prevent="if(!(t.name||'').trim()) t.name='表'+t.id; editingTabIndex=-1;$el.blur()"
@keydown.escape.prevent="editingTabIndex=-1;$el.blur()"
@click.stop
class="tab-edit-input text-sm px-3 py-2 font-bold min-w-0 rounded-l-xl rounded-r-none"
style="min-width:80px;max-width:180px;"
placeholder="表名"
x-init="$nextTick(()=>$el.focus();$el.select())"/>
</template>
<button type="button" x-show="tables.length>1" @click.stop="removeTableByIndex(ti)"
class="flex-shrink-0 w-7 h-8 flex items-center justify-center rounded-r-xl text-slate-400 hover:text-white hover:bg-red-500/30 transition-colors"
title="删除此表(整表移除)">×</button>
</div>
</template>
</div>
<!-- 当前表内容(仅显示选中的表) -->
<div class="mb-10" x-show="currentTable">
<div class="section-title mb-3 flex items-center gap-2">
<div class="bar" style="background:#818cf8;"></div>
<span class="text-indigo-300 font-bold text-base" x-text="currentTable.name"></span>
<span class="text-slate-400 text-xs" x-text="'('+(currentTable.rows?currentTable.rows.length:0)+' 条)'"></span>
</div>
<!-- 表头格式统计(当前表) -->
<div class="glass-card rounded-2xl p-5 mb-5" x-show="currentTable.schemas&¤tTable.schemas.length>0">
<div class="section-title mb-3">
<div class="bar" style="background:#a78bfa;"></div>
<span class="text-purple-300 font-bold text-[15px]">表头格式统计</span>
<span class="ml-2 text-xs text-slate-400">共 <span x-text="currentTable.schemas.length"></span> 种格式</span>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3 mb-4">
<template x-for="(s,si) in currentTable.schemas" :key="'sc'+currentTable.id+'_'+si">
<div class="schema-stat-card">
<div class="schema-stat-dot" :style="'background:'+getSchemaColor(si)"></div>
<div class="flex-1 min-w-0">
<div class="flex items-center gap-2 mb-1">
<template x-if="editingSchemaIndex !== si">
<span class="text-white font-bold text-sm truncate cursor-pointer select-none flex-1 min-w-0"
x-text="s.name||('Format-'+String.fromCharCode(65+si))"
@dblclick="editingSchemaIndex=si"
title="双击编辑格式名"></span>
</template>
<template x-if="editingSchemaIndex === si">
<input type="text" x-model="s.name"
@blur="if(!(s.name||'').trim()) s.name='Format-'+String.fromCharCode(65+si); editingSchemaIndex=-1"
@keydown.enter.prevent="if(!(s.name||'').trim()) s.name='Format-'+String.fromCharCode(65+si); editingSchemaIndex=-1;$el.blur()"
@keydown.escape.prevent="editingSchemaIndex=-1;$el.blur()"
@click.stop
class="tab-edit-input text-sm px-2 py-1 rounded-lg font-bold flex-1 min-w-0"
style="max-width:140px;"
placeholder="格式名"
x-init="$nextTick(()=>$el.focus();$el.select())"/>
</template>
<span class="schema-tag text-[10px] flex-shrink-0" :style="'background:'+getSchemaColor(si)+'22;color:'+getSchemaColor(si)+';border:1px solid'+getSchemaColor(si)+'44'">
<span x-text="s.headers.length+'列'"></span>
</span>
</div>
<div class="flex items-center gap-2 mb-1">
<div class="flex-1 progress-bar-bg" style="height:5px;">
<div class="schema-stat-bar" :style="'width:'+getSchemaRowPctForTable(si,currentTable)+'%;background:'+getSchemaColor(si)"></div>
</div>
<span class="text-xs text-slate-400 flex-shrink-0">
<span class="font-bold text-white" x-text="getSchemaRowCountForTable(si,currentTable)"></span> 行
<span class="text-slate-400 ml-1" x-text="'('+getSchemaRowPctForTable(si,currentTable)+'%)'"></span>
</span>
</div>
<div class="flex items-center gap-3 text-[11px] text-slate-400">
<span>✅ <span class="text-emerald-400 font-semibold" x-text="getSchemaConfirmedCountForTable(si,currentTable)"></span> 已确认</span>
<span>⏳ <span class="text-amber-400 font-semibold" x-text="getSchemaRowCountForTable(si,currentTable)-getSchemaConfirmedCountForTable(si,currentTable)"></span> 未确认</span>
</div>
<div class="mt-1 text-[10px] text-slate-400 truncate" x-text="s.headers.slice(0,4).join(' · ')+(s.headers.length>4?' …':'')"></div>
</div>
</div>
</template>
</div>
<div class="flex flex-wrap gap-4 pt-3 border-t border-slate-700/50">
<div class="stat-card flex-1" style="min-width:120px;">
<div class="section-label" style="margin-bottom:2px;">总记录</div>
<div class="text-2xl font-black text-white" x-text="currentTable.rows?currentTable.rows.length:0"></div>
</div>
<div class="stat-card flex-1" style="min-width:120px;">
<div class="section-label" style="margin-bottom:2px;">已确认</div>
<div class="text-2xl font-black text-emerald-400" x-text="getTableConfirmedCount(currentTable)"></div>
</div>
<div class="stat-card flex-1" style="min-width:120px;">
<div class="section-label" style="margin-bottom:2px;">未确认</div>
<div class="text-2xl font-black text-amber-400" x-text="(currentTable.rows?currentTable.rows.length:0)-getTableConfirmedCount(currentTable)"></div>
</div>
<div class="stat-card flex-1" style="min-width:200px;">
<div class="section-label" style="margin-bottom:4px;">总进度</div>
<div class="progress-bar-bg mb-1"><div class="progress-bar-fill" :style="'width:'+getTableProgressPct(currentTable)+'%'"></div></div>
<div class="text-right text-xs text-slate-400" x-text="getTableProgressPct(currentTable)+'%'"></div>
</div>
</div>
</div>
<!-- 操作栏(当前表) -->
<div class="glass-card rounded-2xl p-4 mb-5">
<div class="flex flex-wrap items-center gap-2">
<button @click="exportModifications()" class="btn-purple text-white text-sm font-bold px-4 py-2 rounded-xl" title="导出此表">💾 导出当前修改</button>
<button @click="$refs.importModificationsInputMulti&&$refs.importModificationsInputMulti.click()" class="btn-rose text-white text-sm font-bold px-4 py-2 rounded-xl" title="导入到此表">📂 导入历史数据</button>
<button @click="confirmAll()" class="btn-success text-white text-sm font-bold px-4 py-2 rounded-xl">✅ 全部确认</button>
<button @click="cancelAllConfirm()" class="btn-warning text-white text-sm font-bold px-4 py-2 rounded-xl">↩️ 取消全部</button>
<button @click="openAppendModal('current')" class="btn-amber text-white text-sm font-bold px-4 py-2 rounded-xl">📎 在当前表追加</button>
<button @click="openAppendModal('new')" class="btn-cyan text-white text-sm font-bold px-4 py-2 rounded-xl">📋 新建表追加</button>
<button @click="showAddColModal=true;newColPosition=-1;" class="btn-primary text-white text-sm font-bold px-4 py-2 rounded-xl">➕ 添加列</button>
<button @click="showExportModal=true;initExportSchemaFilter();" class="btn-cyan text-white text-sm font-bold px-4 py-2 rounded-xl">📤 导出</button>
<button @click="clearTableByIndex(activeTableIndex)" class="btn-danger text-white text-sm font-bold px-4 py-2 rounded-xl ml-auto">🗑️ 清空此表</button>
</div>
</div>
<!-- 编辑提示 -->
<div class="edit-mode-bar mb-4">
<div class="edit-mode-dot"></div>
<span>💡 <strong>在线编辑</strong>:双击单元格编辑 · 右键快捷菜单 · <kbd style="background:rgba(99,102,241,0.2);border:1px solid rgba(129,140,248,0.3);border-radius:3px;padding:0 4px;font-size:10px;color:#818cf8;">Enter</kbd> 保存 · <kbd style="background:rgba(99,102,241,0.2);border:1px solid rgba(129,140,248,0.3);border-radius:3px;padding:0 4px;font-size:10px;color:#818cf8;">Esc</kbd> 取消</span>
</div>
<div class="text-slate-400 text-xs whitespace-nowrap mb-2">显示 <span class="text-slate-200 font-bold" x-text="currentFilteredRows.length"></span> 条</div>
<!-- 表格主体(当前表) -->
<div class="glass-card rounded-2xl overflow-hidden mb-6">
<div class="table-container">
<table>
<thead>
<tr>