File size: 71,196 Bytes
dffbff8
 
 
 
 
79b596e
e731832
 
 
 
dffbff8
e731832
 
 
 
dffbff8
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dffbff8
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dffbff8
e731832
 
 
dffbff8
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dffbff8
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dffbff8
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dffbff8
 
e731832
dffbff8
e731832
 
dffbff8
e731832
dffbff8
 
e731832
 
dffbff8
e731832
dffbff8
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
dffbff8
e731832
 
 
 
 
 
4958130
e731832
 
 
 
 
dffbff8
e731832
 
 
 
 
 
 
 
 
dffbff8
e731832
 
 
 
 
 
 
 
 
 
 
4958130
e731832
 
 
 
dffbff8
e731832
 
 
 
 
 
 
dffbff8
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4958130
e731832
 
 
 
 
 
 
 
 
 
dffbff8
e731832
 
 
dffbff8
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dffbff8
e731832
 
 
 
dffbff8
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dffbff8
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
dffbff8
e731832
 
 
dffbff8
e731832
 
dffbff8
e731832
 
 
 
 
 
 
 
dffbff8
e731832
 
 
 
 
 
 
 
dffbff8
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dffbff8
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dffbff8
 
e731832
dffbff8
 
 
e731832
dffbff8
e731832
dffbff8
 
e731832
dffbff8
 
e731832
dffbff8
e731832
dffbff8
 
 
 
e731832
dffbff8
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dffbff8
 
e731832
 
 
 
4958130
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4958130
e731832
 
 
 
 
 
 
 
 
 
4958130
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4958130
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4958130
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4958130
dffbff8
 
 
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79b596e
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
4958130
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dffbff8
e731832
 
 
 
 
 
 
 
4958130
 
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4958130
dffbff8
 
 
4958130
 
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
4958130
 
e731832
 
 
 
 
 
 
 
 
4958130
 
 
e731832
 
 
 
 
 
 
 
 
4958130
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4958130
dffbff8
 
 
e731832
 
 
 
 
 
dffbff8
 
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dffbff8
e731832
 
 
 
dffbff8
 
e731832
 
 
 
 
 
4958130
 
 
e731832
4958130
 
e731832
 
 
 
 
4958130
e731832
dffbff8
 
 
 
 
 
 
 
 
e731832
 
 
dffbff8
4958130
e731832
4958130
e731832
4958130
 
 
e731832
 
 
 
dffbff8
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4958130
dffbff8
e731832
 
 
 
4958130
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4958130
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dffbff8
e731832
 
 
 
4958130
e731832
 
 
 
 
 
4958130
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4958130
 
dffbff8
e731832
 
 
4958130
e731832
 
 
 
4958130
 
e731832
 
 
 
dffbff8
4958130
e731832
 
 
 
4958130
e731832
4958130
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4958130
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4958130
 
e731832
 
 
 
4958130
e731832
 
 
 
 
 
4958130
e731832
 
 
 
 
4958130
e731832
 
 
 
4958130
e731832
 
 
 
 
 
4958130
 
 
e731832
 
 
 
 
4958130
e731832
4958130
 
e731832
 
 
4958130
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4958130
 
 
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4958130
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cc931c8
 
 
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cc931c8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e731832
4958130
e731832
4958130
cc931c8
4958130
e731832
 
cc931c8
e731832
4958130
e731832
4958130
cc931c8
4958130
 
e731832
 
 
 
 
 
 
 
 
 
 
 
cc931c8
 
 
4958130
 
dffbff8
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dffbff8
 
e731832
 
 
 
 
dffbff8
e731832
 
 
 
 
dffbff8
 
 
 
e731832
 
 
 
 
 
 
 
dffbff8
 
 
e731832
dffbff8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e731832
dffbff8
e731832
dffbff8
 
 
 
e731832
dffbff8
e731832
dffbff8
 
e731832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dffbff8
e731832
 
 
 
 
 
 
dffbff8
 
 
e731832
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
<!DOCTYPE html>
<html lang="zh-TW">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>SignView - Neural Sign Recognition Lab</title>
    
    <!-- 字體和圖標 -->
    <link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700;900&family=Rajdhani:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <script src="https://cdn.socket.io/4.6.0/socket.io.min.js"></script>
    
    <!-- 動畫庫 -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js"></script>
    
    <style>
        :root {
            /* 賽博朋克配色系統 */
            --neon-blue: #00d4ff;
            --neon-cyan: #00ffff;
            --neon-green: #00ff88;
            --neon-purple: #d400ff;
            --neon-pink: #ff0084;
            --neon-yellow: #ffdc00;
            --neon-red: #ff0055;
            
            /* 背景色彩 */
            --bg-primary: #0a0a0a;
            --bg-secondary: #1a1a1a;
            --bg-tertiary: #2a2a2a;
            --bg-glass: rgba(0, 212, 255, 0.05);
            --bg-glow: rgba(0, 212, 255, 0.1);
            
            /* 文字顏色 */
            --text-primary: #ffffff;
            --text-secondary: #b0b0b0;
            --text-tertiary: #808080;
            --text-neon: var(--neon-cyan);
            
            /* 邊框和陰影 */
            --border-neon: 1px solid var(--neon-blue);
            --border-glow: 0 0 20px rgba(0, 212, 255, 0.5);
            --shadow-neon: 0 0 30px rgba(0, 212, 255, 0.3);
            --shadow-deep: 0 10px 50px rgba(0, 0, 0, 0.8);
            
            /* 漸變 */
            --gradient-neon: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
            --gradient-bg: linear-gradient(45deg, #0a0a0a, #1a1a1a, #0a0a0a);
            --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02));
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Rajdhani', monospace;
            background: var(--bg-primary);
            color: var(--text-primary);
            overflow-x: hidden;
            height: 100vh;
            position: relative;
        }
        
        /* 粒子背景動畫 */
        #particle-canvas {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -1;
            opacity: 0.6;
        }
        
        /* 掃描線效果 */
        .scan-line {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 2px;
            background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
            z-index: 1000;
            animation: scan 3s linear infinite;
        }
        
        @keyframes scan {
            0% { top: 0; opacity: 1; }
            50% { opacity: 0.3; }
            100% { top: 100vh; opacity: 1; }
        }
        
        /* 主容器 */
        .cyber-container {
            display: grid;
            grid-template-columns: 300px 1fr 350px;
            grid-template-rows: 80px 1fr;
            height: 100vh;
            gap: 2px;
            background: var(--gradient-bg);
        }
        
        /* 頂部標題欄 */
        .header-bar {
            grid-column: 1 / -1;
            background: var(--bg-secondary);
            border-bottom: var(--border-neon);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 2rem;
            position: relative;
            overflow: hidden;
        }
        
        .header-bar::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
            animation: sweep 4s ease-in-out infinite;
        }
        
        @keyframes sweep {
            0% { left: -100%; }
            50% { left: 100%; }
            100% { left: -100%; }
        }
        
        .logo-section {
            display: flex;
            align-items: center;
            gap: 1rem;
        }
        
        .logo-icon {
            font-size: 2rem;
            color: var(--neon-cyan);
            filter: drop-shadow(0 0 10px var(--neon-cyan));
            animation: pulse-glow 2s ease-in-out infinite alternate;
        }
        
        @keyframes pulse-glow {
            from { filter: drop-shadow(0 0 10px var(--neon-cyan)); }
            to { filter: drop-shadow(0 0 20px var(--neon-cyan)); }
        }
        
        .logo-text {
            font-family: 'Orbitron', monospace;
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--text-primary);
            text-shadow: 0 0 15px var(--neon-blue);
        }
        
        .status-indicators {
            display: flex;
            gap: 1rem;
            align-items: center;
        }
        
        .status-dot {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: var(--neon-green);
            box-shadow: 0 0 15px var(--neon-green);
            animation: blink 1.5s ease-in-out infinite;
        }
        
        .status-dot.warning { 
            background: var(--neon-yellow); 
            box-shadow: 0 0 15px var(--neon-yellow);
        }
        
        .status-dot.error { 
            background: var(--neon-red); 
            box-shadow: 0 0 15px var(--neon-red);
        }
        
        @keyframes blink {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.3; }
        }
        
        /* 左側面板 */
        .left-panel {
            background: var(--bg-secondary);
            border-right: var(--border-neon);
            padding: 2rem;
            overflow-y: auto;
        }
        
        .panel-section {
            margin-bottom: 2rem;
            padding: 1rem;
            background: var(--bg-glass);
            border: 1px solid rgba(0, 212, 255, 0.2);
            border-radius: 8px;
            backdrop-filter: blur(10px);
        }
        
        .panel-title {
            font-family: 'Orbitron', monospace;
            font-size: 0.9rem;
            color: var(--neon-cyan);
            margin-bottom: 1rem;
            text-transform: uppercase;
            letter-spacing: 2px;
        }
        
        .neural-activity {
            height: 100px;
            background: var(--bg-primary);
            border: 1px solid var(--neon-blue);
            border-radius: 4px;
            position: relative;
            overflow: hidden;
        }
        
        .wave {
            position: absolute;
            width: 100%;
            height: 2px;
            background: var(--neon-cyan);
            box-shadow: 0 0 10px var(--neon-cyan);
            animation: wave 2s ease-in-out infinite;
        }
        
        .wave:nth-child(2) { animation-delay: 0.5s; }
        .wave:nth-child(3) { animation-delay: 1s; }
        
        @keyframes wave {
            0%, 100% { transform: translateX(-100%); }
            50% { transform: translateX(100%); }
        }
        
        .system-stats {
            list-style: none;
        }
        
        .stat-item {
            display: flex;
            justify-content: space-between;
            margin-bottom: 0.5rem;
            font-size: 0.9rem;
        }
        
        .stat-label {
            color: var(--text-secondary);
        }
        
        .stat-value {
            color: var(--neon-green);
            font-weight: 600;
        }
        
        /* 主要工作區域 */
        .main-workspace {
            background: var(--bg-primary);
            padding: 2rem;
            display: flex;
            flex-direction: column;
            position: relative;
        }
        
        .workspace-grid {
            display: grid;
            grid-template-rows: auto 1fr auto;
            height: 100%;
            gap: 2rem;
        }
        
        /* 環境指示器 */
        .environment-indicator {
            background: var(--bg-glass);
            border: 1px solid rgba(255, 220, 0, 0.3);
            border-radius: 8px;
            padding: 1rem;
            margin-bottom: 1rem;
            text-align: center;
            border-left: 4px solid var(--neon-yellow);
            backdrop-filter: blur(10px);
        }
        
        /* 上傳區域 */
        .upload-terminal {
            background: var(--bg-secondary);
            border: 2px dashed var(--neon-blue);
            border-radius: 12px;
            padding: 3rem;
            text-align: center;
            position: relative;
            cursor: pointer;
            transition: all 0.3s ease;
            overflow: hidden;
        }
        
        .upload-terminal::before {
            content: '';
            position: absolute;
            top: -2px;
            left: -2px;
            right: -2px;
            bottom: -2px;
            background: var(--gradient-neon);
            border-radius: 12px;
            z-index: -1;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .upload-terminal:hover::before {
            opacity: 1;
            animation: border-flow 2s linear infinite;
        }
        
        @keyframes border-flow {
            0% { background-position: 0% 50%; }
            100% { background-position: 100% 50%; }
        }
        
        .upload-terminal.dragover {
            border-color: var(--neon-green);
            box-shadow: var(--border-glow);
        }
        
        .upload-icon {
            font-size: 4rem;
            color: var(--neon-cyan);
            margin-bottom: 1rem;
            filter: drop-shadow(0 0 20px var(--neon-cyan));
        }
        
        .upload-text {
            font-family: 'Orbitron', monospace;
            font-size: 1.2rem;
            color: var(--text-primary);
            margin-bottom: 0.5rem;
        }
        
        .upload-hint {
            color: var(--text-secondary);
            font-size: 0.9rem;
        }
        
        /* 攝像頭區域 */
        .camera-terminal {
            background: var(--bg-secondary);
            border: var(--border-neon);
            border-radius: 12px;
            padding: 2rem;
            position: relative;
        }
        
        .video-container {
            position: relative;
            border-radius: 8px;
            overflow: hidden;
            margin-bottom: 2rem;
            background: #000;
        }
        
        #video-display {
            width: 100%;
            height: auto;
            min-height: 300px;
            display: block;
            border-radius: 8px;
        }
        
        .camera-status {
            position: absolute;
            top: 15px;
            right: 15px;
            padding: 8px 15px;
            border-radius: 20px;
            color: white;
            font-weight: bold;
            font-size: 0.8rem;
            font-family: 'Orbitron', monospace;
            z-index: 100;
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.2);
        }
        
        .camera-status.active {
            background: rgba(0, 255, 136, 0.2);
            border-color: var(--neon-green);
            color: var(--neon-green);
            box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
        }
        
        .camera-status.inactive {
            background: rgba(128, 128, 128, 0.2);
            border-color: var(--text-tertiary);
            color: var(--text-tertiary);
        }
        
        /* 視頻預覽區域 */
        .video-analyzer {
            display: none;
            background: var(--bg-secondary);
            border: var(--border-neon);
            border-radius: 12px;
            padding: 2rem;
            position: relative;
        }
        
        .video-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(45deg, transparent 48%, var(--neon-cyan) 49%, var(--neon-cyan) 51%, transparent 52%);
            opacity: 0;
            pointer-events: none;
            animation: scan-overlay 3s ease-in-out infinite;
        }
        
        @keyframes scan-overlay {
            0%, 90%, 100% { opacity: 0; }
            5%, 85% { opacity: 0.1; }
        }
        
        /* 控制按鈕 */
        .cyber-controls {
            display: flex;
            gap: 1rem;
            justify-content: center;
            margin-bottom: 2rem;
        }
        
        .cyber-btn {
            background: var(--bg-secondary);
            border: 1px solid var(--neon-blue);
            color: var(--text-primary);
            padding: 1rem 2rem;
            border-radius: 8px;
            font-family: 'Orbitron', monospace;
            font-weight: 600;
            cursor: pointer;
            position: relative;
            overflow: hidden;
            transition: all 0.3s ease;
            text-transform: uppercase;
            letter-spacing: 1px;
            font-size: 0.9rem;
        }
        
        .cyber-btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.4), transparent);
            transition: left 0.5s ease;
        }
        
        .cyber-btn:hover::before {
            left: 100%;
        }
        
        .cyber-btn:hover {
            border-color: var(--neon-cyan);
            box-shadow: 0 0 25px rgba(0, 212, 255, 0.5);
            transform: translateY(-2px);
        }
        
        .cyber-btn.primary {
            background: var(--gradient-neon);
            border-color: var(--neon-cyan);
            box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
        }
        
        .cyber-btn.danger {
            border-color: var(--neon-red);
            color: var(--neon-red);
        }
        
        .cyber-btn.danger:hover {
            border-color: var(--neon-red);
            box-shadow: 0 0 25px rgba(255, 0, 85, 0.5);
        }
        
        .cyber-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        
        /* 結果顯示區域 */
        .result-panel {
            background: var(--bg-glass);
            border: 1px solid rgba(0, 212, 255, 0.2);
            border-radius: 12px;
            padding: 2rem;
            margin-top: 1rem;
            backdrop-filter: blur(10px);
        }
        
        .result-title {
            font-family: 'Orbitron', monospace;
            color: var(--neon-cyan);
            font-size: 1rem;
            margin-bottom: 1rem;
            text-transform: uppercase;
            letter-spacing: 2px;
        }
        
        .result-content {
            font-size: 1.2rem;
            color: var(--text-primary);
            padding: 1rem;
            background: var(--bg-primary);
            border: 1px solid rgba(0, 212, 255, 0.1);
            border-radius: 8px;
            min-height: 60px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        /* 進度分析器 */
        .progress-analyzer {
            display: none;
            background: var(--bg-secondary);
            border: var(--border-neon);
            border-radius: 12px;
            padding: 2rem;
            margin-top: 1rem;
        }
        
        .progress-display {
            background: var(--bg-primary);
            border-radius: 8px;
            padding: 1rem;
            margin-bottom: 1rem;
        }
        
        .progress-track {
            height: 6px;
            background: var(--bg-tertiary);
            border-radius: 3px;
            overflow: hidden;
            position: relative;
            margin-bottom: 1rem;
        }
        
        .progress-fill {
            height: 100%;
            background: var(--gradient-neon);
            border-radius: 3px;
            width: 0%;
            transition: width 0.5s ease;
            box-shadow: 0 0 15px var(--neon-cyan);
        }
        
        .progress-text {
            text-align: center;
            color: var(--neon-cyan);
            font-family: 'Orbitron', monospace;
            font-size: 0.9rem;
        }
        
        /* 右側數據面板 */
        .data-panel {
            background: var(--bg-secondary);
            border-left: var(--border-neon);
            padding: 2rem;
            overflow-y: auto;
        }
        
        .data-section {
            background: var(--bg-glass);
            border: 1px solid rgba(0, 212, 255, 0.2);
            border-radius: 8px;
            padding: 1.5rem;
            margin-bottom: 2rem;
            backdrop-filter: blur(10px);
        }
        
        .data-title {
            font-family: 'Orbitron', monospace;
            color: var(--neon-cyan);
            font-size: 1rem;
            margin-bottom: 1rem;
            text-transform: uppercase;
            letter-spacing: 2px;
        }
        
        .result-metric {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.75rem;
            background: var(--bg-primary);
            border: 1px solid rgba(0, 212, 255, 0.1);
            border-radius: 6px;
            margin-bottom: 0.75rem;
        }
        
        .metric-label {
            color: var(--text-secondary);
            font-size: 0.9rem;
        }
        
        .metric-value {
            color: var(--neon-green);
            font-family: 'Orbitron', monospace;
            font-weight: 600;
        }
        
        .confidence-meter {
            height: 4px;
            background: var(--bg-tertiary);
            border-radius: 2px;
            overflow: hidden;
            margin-top: 0.5rem;
        }
        
        .confidence-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--neon-red), var(--neon-yellow), var(--neon-green));
            border-radius: 2px;
            width: 0%;
            transition: width 1s ease;
            box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
        }
        
        /* 機率條 */
        .prob-bar-container {
            height: 25px;
            background-color: var(--bg-tertiary);
            border-radius: 5px;
            margin-bottom: 10px;
            overflow: hidden;
            position: relative;
        }
        
        .prob-bar {
            height: 100%;
            background: var(--gradient-neon);
            border-radius: 5px;
            transition: width 0.3s ease;
            box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
        }
        
        .prob-label {
            display: flex;
            justify-content: space-between;
            margin-bottom: 5px;
            font-size: 0.8rem;
        }
        
        /* 通知系統 */
        .cyber-notification {
            position: fixed;
            top: 2rem;
            right: 2rem;
            background: var(--bg-secondary);
            border: var(--border-neon);
            border-radius: 8px;
            padding: 1rem 1.5rem;
            color: var(--text-primary);
            box-shadow: var(--shadow-neon);
            z-index: 1000;
            display: none;
            backdrop-filter: blur(10px);
            font-family: 'Orbitron', monospace;
            font-size: 0.9rem;
        }
        
        .cyber-notification.success {
            border-color: var(--neon-green);
            box-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
        }
        
        .cyber-notification.error {
            border-color: var(--neon-red);
            box-shadow: 0 0 30px rgba(255, 0, 85, 0.3);
        }
        
        /* 加載動畫 */
        .cyber-loader {
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 2px solid var(--bg-tertiary);
            border-top: 2px solid var(--neon-cyan);
            border-radius: 50%;
            animation: cyber-spin 1s linear infinite;
            margin-right: 0.5rem;
        }
        
        @keyframes cyber-spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        
        /* 數據流動畫 */
        .data-stream {
            position: fixed;
            top: 0;
            right: 0;
            width: 200px;
            height: 100vh;
            pointer-events: none;
            z-index: -1;
        }
        
        .stream-line {
            position: absolute;
            width: 1px;
            height: 100px;
            background: linear-gradient(to bottom, transparent, var(--neon-cyan), transparent);
            animation: stream 4s linear infinite;
        }
        
        .stream-line:nth-child(2) { left: 50px; animation-delay: 1s; }
        .stream-line:nth-child(3) { left: 100px; animation-delay: 2s; }
        .stream-line:nth-child(4) { left: 150px; animation-delay: 3s; }
        
        @keyframes stream {
            0% { top: -100px; opacity: 0; }
            20% { opacity: 1; }
            80% { opacity: 1; }
            100% { top: 100vh; opacity: 0; }
        }
        
        /* 響應式設計 */
        @media (max-width: 1200px) {
            .cyber-container {
                grid-template-columns: 250px 1fr 300px;
            }
        }
        
        @media (max-width: 1024px) {
            .cyber-container {
                grid-template-columns: 1fr;
                grid-template-rows: 80px 1fr;
            }
            
            .left-panel,
            .data-panel {
                display: none;
            }
            
            .main-workspace {
                padding: 1rem;
            }
        }
        
        @media (max-width: 768px) {
            .header-bar {
                padding: 0 1rem;
            }
            
            .logo-text {
                font-size: 1.2rem;
            }
            
            .cyber-controls {
                flex-direction: column;
                gap: 0.5rem;
            }
            
            .cyber-btn {
                padding: 0.8rem 1.5rem;
            }
        }
    </style>
</head>
<body>
    <!-- 粒子背景 -->
    <canvas id="particle-canvas"></canvas>
    
    <!-- 掃描線 -->
    <div class="scan-line"></div>
    
    <!-- 數據流 -->
    <div class="data-stream">
        <div class="stream-line"></div>
        <div class="stream-line"></div>
        <div class="stream-line"></div>
        <div class="stream-line"></div>
    </div>
    
    <!-- 主容器 -->
    <div class="cyber-container">
        <!-- 頂部標題欄 -->
        <header class="header-bar">
            <div class="logo-section">
                <i class="fas fa-brain logo-icon"></i>
                <div class="logo-text">SignView</div>
                <div style="color: var(--text-secondary); font-size: 0.8rem; margin-left: 1rem;">
                    Neural Sign Recognition Lab
                </div>
            </div>
            
            <div class="status-indicators">
                <div class="status-dot" id="system-status" title="系統狀態"></div>
                <div class="status-dot warning" id="ai-status" title="AI模型狀態"></div>
                <div class="status-dot" id="network-status" title="網路連接"></div>
                <span id="environment-info" style="color: var(--text-secondary); font-size: 0.8rem; margin-left: 1rem;">
                    檢測中...
                </span>
            </div>
        </header>
        
        <!-- 左側控制面板 -->
        <aside class="left-panel">
            <div class="panel-section">
                <div class="panel-title">神經網路活動</div>
                <div class="neural-activity">
                    <div class="wave"></div>
                    <div class="wave"></div>
                    <div class="wave"></div>
                </div>
            </div>
            
            <div class="panel-section">
                <div class="panel-title">系統狀態</div>
                <ul class="system-stats">
                    <li class="stat-item">
                        <span class="stat-label">處理器使用率</span>
                        <span class="stat-value" id="cpu-usage">23%</span>
                    </li>
                    <li class="stat-item">
                        <span class="stat-label">記憶體使用</span>
                        <span class="stat-value" id="memory-usage">2.1GB</span>
                    </li>
                    <li class="stat-item">
                        <span class="stat-label">幀率</span>
                        <span class="stat-value" id="fps-display">30.0</span>
                    </li>
                    <li class="stat-item">
                        <span class="stat-label">延遲</span>
                        <span class="stat-value" id="latency-display">12ms</span>
                    </li>
                </ul>
            </div>
            
            <div class="panel-section">
                <div class="panel-title">AI 模型狀態</div>
                <ul class="system-stats">
                    <li class="stat-item">
                        <span class="stat-label">模型版本</span>
                        <span class="stat-value">v3.4.1</span>
                    </li>
                    <li class="stat-item">
                        <span class="stat-label">辨識類別</span>
                        <span class="stat-value" id="num-classes">4</span>
                    </li>
                    <li class="stat-item">
                        <span class="stat-label">準確率</span>
                        <span class="stat-value">94.36%</span>
                    </li>
                </ul>
            </div>
        </aside>
        
        <!-- 主要工作區域 -->
        <main class="main-workspace">
            <div class="workspace-grid">
                <!-- 環境指示器 -->
                <div class="environment-indicator">
                    <strong>🌐 執行環境:</strong><span id="detailed-environment-info">檢測中...</span>
                </div>
                
                <!-- 即時攝像頭區域 (本地環境) -->
                <div id="camera-section" style="display: none;">
                    <div class="camera-terminal">
                        <div class="data-title">即時神經網路分析</div>
                        <div class="video-container">
                            <div id="hand-status" class="camera-status inactive">未偵測</div>
                            <img id="video-display" src="" alt="即時視頻畫面">
                            <div class="video-overlay"></div>
                        </div>
                        
                        <div class="cyber-controls">
                            <button id="start-btn" class="cyber-btn primary">
                                <i class="fas fa-play"></i>
                                啟動分析
                            </button>
                            <button id="stop-btn" class="cyber-btn danger" disabled>
                                <i class="fas fa-stop"></i>
                                停止分析
                            </button>
                        </div>
                    </div>
                </div>
                
                <!-- 影片上傳區域 (雲端環境) -->
                <div id="upload-section">
                    <!-- 上傳終端 -->
                    <div id="upload-terminal" class="upload-terminal">
                        <i class="fas fa-upload upload-icon"></i>
                        <div class="upload-text">拖拽或點擊上傳影片</div>
                        <div class="upload-hint">支援 MP4, AVI, MOV, WMV | 最大 100MB</div>
                        <input type="file" id="video-file" accept="video/*" style="display: none;">
                    </div>
                    
                    <!-- 視頻分析器 -->
                    <div id="video-analyzer" class="video-analyzer">
                        <div class="data-title">視頻神經網路分析器</div>
                        <div class="video-container">
                            <video id="preview-video" controls style="width: 100%; border-radius: 8px;"></video>
                            <div class="video-overlay"></div>
                        </div>
                        
                        <div class="cyber-controls">
                            <button id="process-video-btn" class="cyber-btn primary">
                                <i class="fas fa-brain"></i>
                                開始AI分析
                            </button>
                            <button id="clear-video-btn" class="cyber-btn danger">
                                <i class="fas fa-trash"></i>
                                清除數據
                            </button>
                        </div>
                    </div>
                    
                    <!-- 進度分析器 -->
                    <div id="progress-analyzer" class="progress-analyzer">
                        <div class="data-title">神經網路處理進度</div>
                        <div class="progress-display">
                            <div class="progress-track">
                                <div class="progress-fill"></div>
                            </div>
                            <div id="upload-status" class="progress-text">等待初始化...</div>
                        </div>
                    </div>
                </div>
                
                <!-- 結果顯示區域 -->
                <div class="result-panel">
                    <div class="result-title">辨識結果</div>
                    <div id="video-word-sequence-display" class="result-content">尚無辨識結果</div>
                </div>
                
                <div class="result-panel">
                    <div class="result-title">AI翻譯結果</div>
                    <div id="video-sentence-display" class="result-content">等待神經網路處理...</div>
                </div>
                
                <!-- 即時辨識結果 (本地環境) -->
                <div id="realtime-results" class="result-panel" style="display: none;">
                    <div class="result-title">即時單詞序列</div>
                    <div id="word-sequence-display" class="result-content">尚無偵測結果</div>
                </div>
                
                <div id="realtime-sentence" class="result-panel" style="display: none;">
                    <div class="result-title">AI生成句子</div>
                    <div id="sentence-display" class="result-content">等待手語輸入完成...</div>
                </div>
            </div>
        </main>
        
        <!-- 右側數據面板 -->
        <aside class="data-panel">
            <div class="data-section">
                <div class="data-title">即時監控</div>
                <ul class="system-stats">
                    <li class="stat-item">
                        <span class="stat-label">處理幀數</span>
                        <span class="stat-value" id="frame-count">0</span>
                    </li>
                    <li class="stat-item">
                        <span class="stat-label">手部狀態</span>
                        <span class="stat-value" id="hand-detection-status">未偵測</span>
                    </li>
                    <li class="stat-item">
                        <span class="stat-label">神經網路</span>
                        <span class="stat-value" id="neural-status">待機</span>
                    </li>
                </ul>
            </div>
            
            <div class="data-section" id="results-display">
                <div class="data-title">分析結果</div>
                
                <div class="result-metric">
                    <div class="metric-label">當前預測</div>
                    <div class="metric-value" id="result-label">未開始</div>
                </div>
                
                <div class="result-metric">
                    <div class="metric-label">信心度</div>
                    <div>
                        <div class="metric-value" id="result-confidence">0%</div>
                        <div class="confidence-meter">
                            <div class="confidence-fill"></div>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="data-section">
                <div class="data-title">類別機率</div>
                <div id="probabilities-container">
                    <div class="metric-label" style="text-align: center; color: var(--text-tertiary);">
                        等待分析開始...
                    </div>
                </div>
            </div>
            
            <div class="data-section">
                <div class="data-title">模型指標</div>
                <ul class="system-stats">
                    <li class="stat-item">
                        <span class="stat-label">推理時間</span>
                        <span class="stat-value" id="inference-time">0ms</span>
                    </li>
                    <li class="stat-item">
                        <span class="stat-label">特徵維度</span>
                        <span class="stat-value">225</span>
                    </li>
                    <li class="stat-item">
                        <span class="stat-label">模型大小</span>
                        <span class="stat-value">15.2MB</span>
                    </li>
                </ul>
            </div>
        </aside>
    </div>
    
    <!-- 通知系統 -->
    <div id="cyber-notification" class="cyber-notification"></div>
    
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // 全域變數
            let selectedVideoFile = null;
            let isProcessing = false;
            let animationId = null;
            let socket = null;
            
            // 環境檢測
            const isHuggingFace = window.location.hostname.includes('hf.space') || window.location.hostname.includes('huggingface.co');
            const environmentInfo = document.getElementById('environment-info');
            const detailedEnvironmentInfo = document.getElementById('detailed-environment-info');
            const cameraSection = document.getElementById('camera-section');
            const uploadSection = document.getElementById('upload-section');
            const realtimeResults = document.getElementById('realtime-results');
            const realtimeSentence = document.getElementById('realtime-sentence');
            const systemStatus = document.getElementById('system-status');
            const aiStatus = document.getElementById('ai-status');
            const networkStatus = document.getElementById('network-status');
            
            // DOM 元素
            const videoDisplay = document.getElementById('video-display');
            const startBtn = document.getElementById('start-btn');
            const stopBtn = document.getElementById('stop-btn');
            const resultLabel = document.getElementById('result-label');
            const resultConfidence = document.getElementById('result-confidence');
            const probabilitiesContainer = document.getElementById('probabilities-container');
            const wordSequenceDisplay = document.getElementById('word-sequence-display');
            const sentenceDisplay = document.getElementById('sentence-display');
            const handStatus = document.getElementById('hand-status');
            const handDetectionStatus = document.getElementById('hand-detection-status');
            const neuralStatus = document.getElementById('neural-status');
            const frameCountDisplay = document.getElementById('frame-count');
            
            // 影片上傳相關元素
            const uploadTerminal = document.getElementById('upload-terminal');
            const videoFile = document.getElementById('video-file');
            const videoAnalyzer = document.getElementById('video-analyzer');
            const previewVideo = document.getElementById('preview-video');
            const processVideoBtn = document.getElementById('process-video-btn');
            const clearVideoBtn = document.getElementById('clear-video-btn');
            const progressAnalyzer = document.getElementById('progress-analyzer');
            const videoWordSequenceDisplay = document.getElementById('video-word-sequence-display');
            const videoSentenceDisplay = document.getElementById('video-sentence-display');
            const notification = document.getElementById('cyber-notification');
            
            // 初始化
            initParticleSystem();
            setupEnvironment();
            setupEventListeners();
            animateEntry();
            updateSystemStats();
            
            // 環境設置
            function setupEnvironment() {
                if (isHuggingFace) {
                    environmentInfo.innerHTML = '☁️ HuggingFace Spaces';
                    detailedEnvironmentInfo.innerHTML = '☁️ HuggingFace Spaces (雲端) - 使用影片上傳功能';
                    cameraSection.style.display = 'none';
                    uploadSection.style.display = 'block';
                    realtimeResults.style.display = 'none';
                    realtimeSentence.style.display = 'none';
                    
                    // 更新狀態指示器
                    systemStatus.className = 'status-dot';
                    aiStatus.className = 'status-dot warning';
                    networkStatus.className = 'status-dot';
                } else {
                    environmentInfo.innerHTML = '💻 本地環境';
                    detailedEnvironmentInfo.innerHTML = '💻 本地環境 - 支援即時攝像頭辨識';
                    cameraSection.style.display = 'block';
                    uploadSection.style.display = 'none';
                    realtimeResults.style.display = 'block';
                    realtimeSentence.style.display = 'block';
                    
                    // 初始化WebSocket
                    socket = io();
                    setupWebSocketEvents();
                }
            }
            
            // 粒子系統
            function initParticleSystem() {
                const canvas = document.getElementById('particle-canvas');
                const ctx = canvas.getContext('2d');
                
                canvas.width = window.innerWidth;
                canvas.height = window.innerHeight;
                
                const particles = [];
                const particleCount = 80;
                
                class Particle {
                    constructor() {
                        this.x = Math.random() * canvas.width;
                        this.y = Math.random() * canvas.height;
                        this.vx = (Math.random() - 0.5) * 0.3;
                        this.vy = (Math.random() - 0.5) * 0.3;
                        this.size = Math.random() * 2 + 1;
                        this.opacity = Math.random() * 0.5 + 0.2;
                    }
                    
                    update() {
                        this.x += this.vx;
                        this.y += this.vy;
                        
                        if (this.x < 0 || this.x > canvas.width) this.vx *= -1;
                        if (this.y < 0 || this.y > canvas.height) this.vy *= -1;
                    }
                    
                    draw() {
                        ctx.globalAlpha = this.opacity;
                        ctx.fillStyle = '#00d4ff';
                        ctx.shadowBlur = 10;
                        ctx.shadowColor = '#00d4ff';
                        ctx.beginPath();
                        ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);
                        ctx.fill();
                    }
                }
                
                // 初始化粒子
                for (let i = 0; i < particleCount; i++) {
                    particles.push(new Particle());
                }
                
                function animate() {
                    ctx.clearRect(0, 0, canvas.width, canvas.height);
                    
                    particles.forEach(particle => {
                        particle.update();
                        particle.draw();
                    });
                    
                    // 繪製連接線
                    ctx.globalAlpha = 0.1;
                    ctx.strokeStyle = '#00d4ff';
                    ctx.lineWidth = 1;
                    
                    for (let i = 0; i < particles.length; i++) {
                        for (let j = i + 1; j < particles.length; j++) {
                            const dx = particles[i].x - particles[j].x;
                            const dy = particles[i].y - particles[j].y;
                            const distance = Math.sqrt(dx * dx + dy * dy);
                            
                            if (distance < 100) {
                                ctx.beginPath();
                                ctx.moveTo(particles[i].x, particles[i].y);
                                ctx.lineTo(particles[j].x, particles[j].y);
                                ctx.stroke();
                            }
                        }
                    }
                    
                    animationId = requestAnimationFrame(animate);
                }
                
                animate();
                
                // 視窗調整
                window.addEventListener('resize', () => {
                    canvas.width = window.innerWidth;
                    canvas.height = window.innerHeight;
                });
            }
            
            // WebSocket 事件設置
            function setupWebSocketEvents() {
                if (!socket) return;
                
                socket.on('connect', function() {
                    console.log('已連接到神經網路服務');
                    showNotification('神經網路連接已建立', 'success');
                    networkStatus.className = 'status-dot';
                });
                
                socket.on('disconnect', function() {
                    console.log('神經網路連接已斷開');
                    showNotification('神經網路連接已斷開', 'error');
                    networkStatus.className = 'status-dot error';
                });
                
                // 接收幀更新
                socket.on('update_frame', function(data) {
                    if (videoDisplay) {
                        videoDisplay.src = `data:image/jpeg;base64,${data.image}`;
                    }
                    updateRealtimeStatus(data.status);
                });
            }
            
            // 設置事件監聽器
            function setupEventListeners() {
                // 攝像頭控制 (本地環境)
                if (!isHuggingFace && socket) {
                    startBtn?.addEventListener('click', function() {
                        socket.emit('start_stream', {}, function(response) {
                            if (response.status === 'success') {
                                startBtn.disabled = true;
                                stopBtn.disabled = false;
                                resultLabel.textContent = '神經網路分析中...';
                                resultConfidence.textContent = '信心度: 0%';
                                neuralStatus.textContent = '分析中';
                                aiStatus.className = 'status-dot';
                                showNotification('攝像頭神經網路分析已啟動', 'success');
                            } else {
                                showNotification('啟動失敗: ' + (response.message || '未知錯誤'), 'error');
                            }
                        });
                    });
                    
                    stopBtn?.addEventListener('click', function() {
                        socket.emit('stop_stream', {}, function(response) {
                            if (response.status === 'success') {
                                startBtn.disabled = false;
                                stopBtn.disabled = true;
                                resultLabel.textContent = '未開始';
                                resultConfidence.textContent = '信心度: 0%';
                                handStatus.textContent = '未偵測';
                                handStatus.className = 'camera-status inactive';
                                handDetectionStatus.textContent = '未偵測';
                                neuralStatus.textContent = '待機';
                                aiStatus.className = 'status-dot warning';
                                showNotification('神經網路分析已停止', 'success');
                            }
                        });
                    });
                }
                
                // 影片上傳功能 (雲端環境)
                if (isHuggingFace) {
                    // 點擊上傳
                    uploadTerminal?.addEventListener('click', () => videoFile?.click());
                    
                    // 檔案選擇
                    videoFile?.addEventListener('change', function(e) {
                        if (e.target.files.length > 0) {
                            handleVideoFile(e.target.files[0]);
                        }
                    });
                    
                    // 拖拽支援
                    uploadTerminal?.addEventListener('dragover', function(e) {
                        e.preventDefault();
                        uploadTerminal.classList.add('dragover');
                    });
                    
                    uploadTerminal?.addEventListener('dragleave', function(e) {
                        e.preventDefault();
                        uploadTerminal.classList.remove('dragover');
                    });
                    
                    uploadTerminal?.addEventListener('drop', function(e) {
                        e.preventDefault();
                        uploadTerminal.classList.remove('dragover');
                        const files = e.dataTransfer.files;
                        if (files.length > 0) {
                            handleVideoFile(files[0]);
                        }
                    });
                    
                    // 處理影片按鈕
                    processVideoBtn?.addEventListener('click', function() {
                        if (!selectedVideoFile) {
                            showNotification('請先選擇影片檔案!', 'error');
                            return;
                        }
                        uploadVideo(selectedVideoFile);
                    });
                    
                    // 清除影片按鈕
                    clearVideoBtn?.addEventListener('click', function() {
                        clearVideo();
                    });
                }
            }
            
            // 處理影片檔案
            function handleVideoFile(file) {
                if (!file.type.startsWith('video/')) {
                    showNotification('請選擇影片檔案!', 'error');
                    return;
                }
                
                if (file.size > 100 * 1024 * 1024) {
                    showNotification('檔案大小不能超過 100MB', 'error');
                    return;
                }
                
                selectedVideoFile = file;
                
                // 顯示預覽
                const url = URL.createObjectURL(file);
                if (previewVideo) {
                    previewVideo.src = url;
                }
                
                // 動畫切換到分析器
                if (uploadTerminal && videoAnalyzer) {
                    anime({
                        targets: uploadTerminal,
                        opacity: 0,
                        scale: 0.8,
                        duration: 500,
                        complete: () => {
                            uploadTerminal.style.display = 'none';
                            videoAnalyzer.style.display = 'block';
                            
                            anime({
                                targets: videoAnalyzer,
                                opacity: [0, 1],
                                scale: [0.8, 1],
                                duration: 800,
                                easing: 'easeOutCubic'
                            });
                        }
                    });
                }
                
                showNotification('影片載入成功,神經網路已準備就緒', 'success');
            }
            
            // 上傳影片
            function uploadVideo(file) {
                if (isProcessing) return;
                
                isProcessing = true;
                
                // 顯示進度分析器
                if (progressAnalyzer) {
                    progressAnalyzer.style.display = 'block';
                    anime({
                        targets: progressAnalyzer,
                        opacity: [0, 1],
                        translateY: [-30, 0],
                        duration: 600
                    });
                }
                
                // 更新按鈕狀態
                if (processVideoBtn) {
                    processVideoBtn.innerHTML = '<div class="cyber-loader"></div>神經網路運算中...';
                    processVideoBtn.disabled = true;
                }
                if (clearVideoBtn) {
                    clearVideoBtn.disabled = true;
                }
                
                // 更新狀態
                aiStatus.className = 'status-dot';
                neuralStatus.textContent = '深度學習中';
                
                const formData = new FormData();
                formData.append('video', file);
                
                // 模擬進度更新
                simulateProgress();
                
                fetch('/process_video', {
                    method: 'POST',
                    body: formData
                })
                .then(response => {
                    if (!response.ok) {
                        throw new Error(`HTTP ${response.status}: ${response.statusText}`);
                    }
                    return response.json();
                })
                .then(result => {
                    displayVideoResult(result);
                })
                .catch(error => {
                    console.error('神經網路處理錯誤:', error);
                    showNotification('神經網路處理失敗: ' + error.message, 'error');
                })
                .finally(() => {
                    resetProcessingState();
                });
            }
            
            // 模擬進度更新
            function simulateProgress() {
                let progress = 0;
                const phases = [
                    '初始化神經網路...',
                    '載入預訓練模型...',
                    '提取關鍵點特徵...',
                    '深度學習推理...',
                    '生成預測結果...'
                ];
                let currentPhase = 0;
                
                const interval = setInterval(() => {
                    if (progress < 90 && isProcessing) {
                        progress += Math.random() * 15;
                        if (progress > 90) progress = 90;
                        
                        // 更新階段
                        if (progress > (currentPhase + 1) * 18 && currentPhase < phases.length - 1) {
                            currentPhase++;
                        }
                        
                        updateProgress(progress, phases[currentPhase]);
                    } else {
                        clearInterval(interval);
                    }
                }, 1200);
            }
            
            // 更新進度
            function updateProgress(percentage, phase) {
                const progressFill = document.querySelector('.progress-fill');
                const uploadStatus = document.getElementById('upload-status');
                
                if (progressFill) {
                    anime({
                        targets: progressFill,
                        width: percentage + '%',
                        duration: 800,
                        easing: 'easeOutCubic'
                    });
                }
                
                if (uploadStatus) {
                    uploadStatus.textContent = `${phase} ${Math.round(percentage)}%`;
                }
            }
            
            // 顯示影片辨識結果
            function displayVideoResult(result) {
                console.log('收到神經網路分析結果:', result);
                
                if (result.status === 'success') {
                    // 完成進度
                    updateProgress(100, '神經網路分析完成!');
                    
                    // 顯示當前預測 (模型預測的類別)
                    const predictedLabel = result.predicted_label || '未知';
                    if (resultLabel) resultLabel.textContent = predictedLabel;
                    
                    // 顯示信心度
                    const confidence = result.confidence || 0;
                    if (resultConfidence) resultConfidence.textContent = `信心度: ${(confidence * 100).toFixed(1)}%`;
                    
                    // 更新信心度條
                    const confidenceFill = document.querySelector('.confidence-fill');
                    if (confidenceFill) {
                        anime({
                            targets: confidenceFill,
                            width: (confidence * 100) + '%',
                            duration: 1500,
                            easing: 'easeOutCubic'
                        });
                    }
                    
                    // 更新類別機率顯示
                    if (result.probabilities && probabilitiesContainer) {
                        probabilitiesContainer.innerHTML = '';
                        result.probabilities.forEach(function(item) {
                            const probContainer = document.createElement('div');
                            probContainer.className = 'mb-3';
                            
                            const probLabel = document.createElement('div');
                            probLabel.className = 'prob-label';
                            probLabel.innerHTML = `<span>${item.label}</span><span>${(item.probability * 100).toFixed(1)}%</span>`;
                            
                            const barContainer = document.createElement('div');
                            barContainer.className = 'prob-bar-container';
                            
                            const bar = document.createElement('div');
                            bar.className = 'prob-bar';
                            bar.style.width = `${item.probability * 100}%`;
                            
                            barContainer.appendChild(bar);
                            probContainer.appendChild(probLabel);
                            probContainer.appendChild(barContainer);
                            probabilitiesContainer.appendChild(probContainer);
                        });
                    }
                    
                    // 顯示辨識結果 (模型識別的單詞序列)
                    if (videoWordSequenceDisplay) {
                        if (result.word_sequence && result.word_sequence.length > 0) {
                            videoWordSequenceDisplay.textContent = result.word_sequence.join(' ');
                        } else {
                            videoWordSequenceDisplay.textContent = '低於辨識閾值';
                        }
                    }
                    
                    // 顯示AI翻譯結果 (GPT生成的句子)
                    if (videoSentenceDisplay) {
                        if (result.generated_sentence) {
                            videoSentenceDisplay.textContent = result.generated_sentence;
                        } else {
                            videoSentenceDisplay.textContent = '無法生成翻譯';
                        }
                    }
                    
                    showNotification('神經網路分析完成!', 'success');
                    
                } else {
                    console.error('神經網路分析失敗:', result);
                    showNotification('神經網路分析失敗: ' + (result.message || result.error || '未知錯誤'), 'error');
                    
                    // 重置顯示
                    if (resultLabel) resultLabel.textContent = '分析失敗';
                    if (resultConfidence) resultConfidence.textContent = '信心度: 0%';
                    if (videoWordSequenceDisplay) videoWordSequenceDisplay.textContent = '分析失敗';
                    if (videoSentenceDisplay) videoSentenceDisplay.textContent = '分析失敗';
                    if (probabilitiesContainer) {
                        probabilitiesContainer.innerHTML = '<div class="metric-label" style="text-align: center; color: var(--text-tertiary);">分析失敗</div>';
                    }
                }
            }
            
            // 重置處理狀態
            function resetProcessingState() {
                isProcessing = false;
                
                if (processVideoBtn) {
                    processVideoBtn.innerHTML = '<i class="fas fa-brain"></i> 開始AI分析';
                    processVideoBtn.disabled = false;
                }
                if (clearVideoBtn) {
                    clearVideoBtn.disabled = false;
                }
                
                aiStatus.className = 'status-dot warning';
                neuralStatus.textContent = '待機';
                
                setTimeout(() => {
                    if (progressAnalyzer) {
                        progressAnalyzer.style.display = 'none';
                        const progressFill = document.querySelector('.progress-fill');
                        if (progressFill) progressFill.style.width = '0%';
                    }
                }, 3000);
            }
            
            // 清除影片
            function clearVideo() {
                selectedVideoFile = null;
                if (videoFile) videoFile.value = '';
                if (previewVideo) previewVideo.src = '';
                
                // 隱藏進度和分析器
                if (progressAnalyzer) progressAnalyzer.style.display = 'none';
                
                // 動畫切換回上傳終端
                if (videoAnalyzer && uploadTerminal) {
                    anime({
                        targets: videoAnalyzer,
                        opacity: 0,
                        scale: 0.8,
                        duration: 500,
                        complete: () => {
                            videoAnalyzer.style.display = 'none';
                            uploadTerminal.style.display = 'block';
                            
                            anime({
                                targets: uploadTerminal,
                                opacity: [0, 1],
                                scale: [0.8, 1],
                                duration: 800,
                                easing: 'easeOutCubic'
                            });
                        }
                    });
                }
                
                // 重置結果顯示
                if (resultLabel) resultLabel.textContent = '未開始';
                if (resultConfidence) resultConfidence.textContent = '信心度: 0%';
                if (probabilitiesContainer) {
                    probabilitiesContainer.innerHTML = '<div class="metric-label" style="text-align: center; color: var(--text-tertiary);">等待分析開始...</div>';
                }
                if (videoWordSequenceDisplay) videoWordSequenceDisplay.textContent = '尚無辨識結果';
                if (videoSentenceDisplay) videoSentenceDisplay.textContent = '等待神經網路處理...';
                
                showNotification('數據已清除,神經網路已重置', 'success');
            }
            
            // 更新即時狀態 (本地環境)
            function updateRealtimeStatus(status) {
                if (isHuggingFace) return;
                
                // 更新手部狀態
                if (status.hand_present) {
                    if (handStatus) {
                        handStatus.textContent = '已偵測到手部';
                        handStatus.className = 'camera-status active';
                    }
                    if (handDetectionStatus) handDetectionStatus.textContent = '已偵測';
                } else {
                    if (handStatus) {
                        handStatus.textContent = '未偵測到手部';
                        handStatus.className = 'camera-status inactive';
                    }
                    if (handDetectionStatus) handDetectionStatus.textContent = '未偵測';
                }
                
                // 更新當前預測結果
                if (status.current_prediction) {
                    if (resultLabel) resultLabel.textContent = status.current_prediction.label;
                    if (resultConfidence) resultConfidence.textContent = `信心度: ${(status.current_prediction.confidence * 100).toFixed(1)}%`;
                    
                    // 更新信心度條
                    const confidenceFill = document.querySelector('.confidence-fill');
                    if (confidenceFill) {
                        confidenceFill.style.width = `${status.current_prediction.confidence * 100}%`;
                    }
                }
                
                // 更新機率條
                if (status.probabilities && probabilitiesContainer) {
                    probabilitiesContainer.innerHTML = '';
                    status.probabilities.forEach(function(item) {
                        const probContainer = document.createElement('div');
                        probContainer.className = 'mb-3';
                        
                        const probLabel = document.createElement('div');
                        probLabel.className = 'prob-label';
                        probLabel.innerHTML = `<span>${item.label}</span><span>${(item.probability * 100).toFixed(1)}%</span>`;
                        
                        const barContainer = document.createElement('div');
                        barContainer.className = 'prob-bar-container';
                        
                        const bar = document.createElement('div');
                        bar.className = 'prob-bar';
                        bar.style.width = `${item.probability * 100}%`;
                        
                        barContainer.appendChild(bar);
                        probContainer.appendChild(probLabel);
                        probContainer.appendChild(barContainer);
                        probabilitiesContainer.appendChild(probContainer);
                    });
                }
                
                // 更新單詞序列
                if (status.word_sequence && status.word_sequence.length > 0 && wordSequenceDisplay) {
                    wordSequenceDisplay.textContent = status.word_sequence.join(' ');
                } else if (wordSequenceDisplay) {
                    wordSequenceDisplay.textContent = '尚無偵測結果';
                }
                
                // 更新生成的句子
                if (status.generated_sentence && status.display_sentence && sentenceDisplay) {
                    sentenceDisplay.textContent = status.generated_sentence;
                } else if (sentenceDisplay && !status.display_sentence) {
                    sentenceDisplay.textContent = '等待手語輸入完成...';
                }
                
                // 更新幀數
                if (status.frame_count && frameCountDisplay) {
                    frameCountDisplay.textContent = status.frame_count;
                }
            }
            
            // 入場動畫
            function animateEntry() {
                if (typeof anime === 'undefined') return;
                
                anime.timeline()
                    .add({
                        targets: '.header-bar',
                        opacity: [0, 1],
                        translateY: [-50, 0],
                        duration: 1000,
                        easing: 'easeOutCubic'
                    })
                    .add({
                        targets: '.left-panel',
                        opacity: [0, 1],
                        translateX: [-100, 0],
                        duration: 800,
                        easing: 'easeOutCubic'
                    }, '-=500')
                    .add({
                        targets: '.main-workspace',
                        opacity: [0, 1],
                        scale: [0.9, 1],
                        duration: 800,
                        easing: 'easeOutCubic'
                    }, '-=600')
                    .add({
                        targets: '.data-panel',
                        opacity: [0, 1],
                        translateX: [100, 0],
                        duration: 800,
                        easing: 'easeOutCubic'
                    }, '-=600');
            }
            
            // 更新系統統計
            function updateSystemStats() {
                setInterval(() => {
                    if (isProcessing) {
                        // 處理中的動態數據
                        const cpuUsage = document.getElementById('cpu-usage');
                        const memoryUsage = document.getElementById('memory-usage');
                        const fpsDisplay = document.getElementById('fps-display');
                        const latencyDisplay = document.getElementById('latency-display');
                        const inferenceTime = document.getElementById('inference-time');
                        
                        if (cpuUsage) cpuUsage.textContent = Math.floor(Math.random() * 30 + 40) + '%';
                        if (memoryUsage) memoryUsage.textContent = (Math.random() * 1.5 + 2.5).toFixed(1) + 'GB';
                        if (fpsDisplay) fpsDisplay.textContent = (Math.random() * 5 + 25).toFixed(1);
                        if (latencyDisplay) latencyDisplay.textContent = Math.floor(Math.random() * 20 + 5) + 'ms';
                        if (inferenceTime) inferenceTime.textContent = Math.floor(Math.random() * 50 + 10) + 'ms';
                    } else {
                        // 待機狀態的穩定數據
                        const cpuUsage = document.getElementById('cpu-usage');
                        const memoryUsage = document.getElementById('memory-usage');
                        const fpsDisplay = document.getElementById('fps-display');
                        const latencyDisplay = document.getElementById('latency-display');
                        const inferenceTime = document.getElementById('inference-time');
                        
                        if (cpuUsage) cpuUsage.textContent = Math.floor(Math.random() * 10 + 15) + '%';
                        if (memoryUsage) memoryUsage.textContent = (Math.random() * 0.5 + 2.0).toFixed(1) + 'GB';
                        if (fpsDisplay) fpsDisplay.textContent = (Math.random() * 2 + 29).toFixed(1);
                        if (latencyDisplay) latencyDisplay.textContent = Math.floor(Math.random() * 10 + 8) + 'ms';
                        if (inferenceTime) inferenceTime.textContent = Math.floor(Math.random() * 20 + 5) + 'ms';
                    }
                }, 2000);
            }
            
            // 顯示通知
            function showNotification(message, type = 'success', duration = 4000) {
                if (!notification) return;
                
                notification.textContent = message;
                notification.className = `cyber-notification ${type}`;
                notification.style.display = 'block';
                
                if (typeof anime !== 'undefined') {
                    anime({
                        targets: notification,
                        opacity: [0, 1],
                        translateX: [50, 0],
                        duration: 500,
                        easing: 'easeOutCubic'
                    });
                    
                    setTimeout(() => {
                        anime({
                            targets: notification,
                            opacity: 0,
                            translateX: 50,
                            duration: 500,
                            complete: () => {
                                notification.style.display = 'none';
                            }
                        });
                    }, duration);
                } else {
                    setTimeout(() => {
                        notification.style.display = 'none';
                    }, duration);
                }
            }
            
            // 清理資源
            window.addEventListener('beforeunload', () => {
                if (animationId) {
                    cancelAnimationFrame(animationId);
                }
            });
        });
    </script>
</body>
</html>