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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
609dfb4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
/* ==========================================================================
   倫敦塔益智盒 3D 模擬器 (Tower of London 3D Simulator) - 主樣式表
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Fira+Code:wght@400;600&display=swap');

:root {
    --bg-dark: #090d16;
    --bg-card: rgba(15, 23, 42, 0.85);
    --bg-card-hover: rgba(30, 41, 59, 0.9);
    --border-color: rgba(56, 189, 248, 0.2);
    --border-highlight: #38bdf8;

    --primary: #0284c7;
    --primary-hover: #0369a1;
    --primary-glow: rgba(56, 189, 248, 0.35);

    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --accent-purple: #8b5cf6;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --shadow-subtle: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.25);
    --glass-bg: rgba(15, 23, 42, 0.75);
    --glass-backdrop: blur(12px);
}

/* 基礎設定 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 19px; /* Word 14號字 (14pt ≈ 18.67px),全面清晰放大 */
    min-height: 100vh;
    line-height: 1.6;
    background-image:
        radial-gradient(circle at 15% 15%, rgba(56, 189, 248, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(139, 92, 246, 0.08) 0%, transparent 40%);
    background-attachment: fixed;
}

/* 滾動條樣式 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.6);
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* 頁首 Header */
.app-header {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: var(--glass-backdrop);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #38bdf8, #8b5cf6);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    color: #fff;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.logo-image {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1.5px solid rgba(56, 189, 248, 0.45);
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
    flex-shrink: 0;
    cursor: pointer;
}

.logo-image:hover {
    transform: scale(1.08) rotate(-2deg);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.65);
}

.app-title {
    font-size: 1.65rem;
    /* 放大從 1.35rem -> 1.65rem */
    font-weight: 800;
    background: linear-gradient(135deg, #38bdf8 0%, #a7f3d0 50%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.app-subtitle {
    font-size: 0.95rem;
    /* 放大從 0.8rem -> 0.95rem */
    color: var(--text-muted);
}

/* 模式選單 Tabs (置於畫面右上角) */
.mode-tabs {
    display: flex;
    margin-left: auto;
    background: rgba(30, 41, 59, 0.7);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    gap: 4px;
}

/* 畫面左下角:學習單懸浮按鈕標籤 */
.floating-worksheet-btn {
    position: fixed;
    left: 1.5rem;
    bottom: 1.5rem;
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(15, 23, 42, 0.85);
    border: 1.5px solid rgba(16, 185, 129, 0.5);
    color: #34d399;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.65rem 1.25rem;
    border-radius: 9999px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45), 0 0 16px rgba(16, 185, 129, 0.25);
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.floating-worksheet-btn:hover {
    background: rgba(16, 185, 129, 0.22);
    border-color: #34d399;
    color: #ffffff;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55), 0 0 22px rgba(16, 185, 129, 0.45);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.7rem 1.3rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1.05rem;
    /* 放大從 0.85rem -> 1.05rem */
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 48px;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary), #0369a1);
    color: #ffffff;
    box-shadow: var(--shadow-glow);
}

/* 主佈局 Layout (雙欄標準架構:左為主視窗 Card,右為側邊資訊與操作 Panel) */
.main-container {
    max-width: 1720px;
    margin: 1.25rem auto;
    padding: 0 1.25rem;
    display: grid;
    grid-template-columns: 1fr 480px; /* 加寬側邊欄以完美適配 Word 14號大字體 */
    gap: 1.5rem;
    align-items: start;
    transition: all 0.3s ease;
}

/* 側邊欄通用容器 */
.sidebar-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
}

.sidebar-panel.hidden,
.viewport-card.hidden,
.viewport-step3-container.hidden {
    display: none !important;
}

.viewport-step3-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
}

/* 響應式:小螢幕轉單欄 */
@media (max-width: 1200px) {
    .main-container {
        grid-template-columns: 1fr;
    }
}

/* 3D 視窗 Card */
.viewport-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-subtle);
    display: flex;
    flex-direction: column;
}

#canvas-3d-wrapper {
    width: 100%;
    height: 540px;
    position: relative;
    cursor: grab;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    overflow: hidden;
}

#canvas-3d-wrapper:active {
    cursor: grabbing;
}

/* Three.js 產生的 canvas 必須為絕對定位,避免向下擠壓溢出蓋住控制按鈕 */
#canvas-3d-wrapper canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 1;
    display: block;
}

/* Zoom 縮放按鈕列 (固定於 3D 視窗右下角) */
.zoom-controls {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 35;
}

.btn-zoom {
    width: 36px;
    height: 36px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.btn-zoom:hover {
    background: rgba(56, 189, 248, 0.6);
    border-color: #38bdf8;
    transform: scale(1.08);
}

.btn-zoom:active {
    transform: scale(0.95);
}


.section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--border-highlight);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.canvas-2d {
    width: 100%;
    max-width: 320px;
    height: 260px;
    background: #020617;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Overlay Elements on 3D Viewport */
.viewport-overlay {
    position: absolute;
    top: 1rem;
    left: 1rem;
    pointer-events: none;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.overlay-badge {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    /* 放大從 0.8rem -> 0.95rem */
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    backdrop-filter: blur(8px);
}

.overlay-badge .badge-val {
    color: #facc15;
    font-family: 'Fira Code', monospace;
    font-weight: 700;
}

/* 控制列 Action Bar Below Viewport (z-index 提高確保絕對可點擊) */
.viewport-controls {
    background: rgba(15, 23, 42, 0.95);
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    position: relative;
    z-index: 50;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    background: #1e293b;
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.65rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: 1.05rem; /* 放大至 20px (Word 14pt+) */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 48px;
}

.btn:hover {
    background: #334155;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #0369a1);
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0284c7, #075985);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.6);
}

.btn-accent {
    background: linear-gradient(135deg, #059669, #047857);
    border-color: transparent;
}

.btn-accent:hover {
    background: linear-gradient(135deg, #10b981, #059669);
}

.btn-amber {
    background: linear-gradient(135deg, #d97706, #b45309);
    border-color: transparent;
}

.btn-amber:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* 右側邊欄 Control & Info Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.35rem;
    box-shadow: var(--shadow-subtle);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.card-title {
    font-size: 1.35rem; /* 放大至 25.6px */
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 參數滑桿 Parameter Controls */
.control-group {
    margin-bottom: 1.25rem;
}

.control-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.05rem; /* 20px */
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.control-value {
    color: var(--border-highlight);
    font-family: 'Fira Code', monospace;
    font-weight: 700;
    font-size: 1.25rem; /* 23.8px */
}

.slider-input {
    width: 100%;
    height: 12px;
    border-radius: 6px;
    background: #1e293b;
    outline: none;
    accent-color: #38bdf8;
    cursor: grab;
    touch-action: none;
    margin: 8px 0;
    -webkit-appearance: none;
    appearance: none;
    transition: background 0.15s ease;
}

.slider-input:active {
    cursor: grabbing;
}

.slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #38bdf8, #0284c7);
    border: 2px solid #ffffff;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.7);
    cursor: grab;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.slider-input:active::-webkit-slider-thumb {
    cursor: grabbing;
    transform: scale(1.22);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.95);
}

.slider-input::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #38bdf8, #0284c7);
    border: 2px solid #ffffff;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.7);
    cursor: grab;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.slider-input:active::-moz-range-thumb {
    cursor: grabbing;
    transform: scale(1.22);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.95);
}

.slider-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.slider-meta {
    display: flex;
    justify-content: space-between;
    font-size: 1.0rem; /* 19px (Word 14pt) */
    color: var(--text-dim);
    margin-top: 0.35rem;
}

/* 狀態觀察儀表板 Status Readout */
.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.status-box {
    background: rgba(2, 6, 23, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.85rem;
    border-radius: var(--radius-sm);
}

.status-box-title {
    font-size: 1.05rem; /* 20px */
    color: var(--text-dim);
    margin-bottom: 0.35rem;
}

.status-box-value {
    font-family: 'Fira Code', monospace;
    font-weight: 700;
    font-size: 1.55rem; /* 29.5px */
    color: #facc15;
}

.status-box-desc {
    font-size: 1.0rem; /* 19px (Word 14pt) */
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* 研習引導說明 Workshop Steps Accordion / Content */
.workshop-step-badge {
    background: rgba(56, 189, 248, 0.15);
    color: var(--border-highlight);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 1.0rem;
    font-weight: 700;
}

.workshop-content {
    font-size: 1.05rem; /* 20px */
    color: var(--text-muted);
    line-height: 1.6;
}

.math-formula-box {
    background: rgba(2, 6, 23, 0.8);
    border-left: 3px solid var(--border-highlight);
    padding: 0.85rem 1.1rem;
    margin: 0.85rem 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    overflow-x: auto;
}

/* Notice Alerts */
.alert-box {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    font-size: 1.05rem; /* 20px */
    color: #fef08a;
    margin-top: 0.85rem;
}

/* 3D 浮動標籤 Floating Math Labels */
.math-label-3d {
    position: absolute;
    transform: translate(-50%, -50%);
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border-highlight);
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    font-weight: 600;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    transition: opacity 0.2s ease;
    z-index: 20;
}

.math-label-3d.hidden {
    opacity: 0;
}

.math-label-3d span {
    color: #facc15;
}

/* 手動牽引提示 Traversal Toast */
.toast-msg {
    position: absolute;
    bottom: 4rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid var(--border-highlight);
    color: var(--text-main);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 30;
}

.toast-msg.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

/* ==========================================================================
   第三步:2D 俯視幾何投影模擬器與動態公式推導專屬樣式
   ========================================================================== */

/* 2D 畫布容器 */
.canvas-2d-wrapper {
    width: 100%;
    height: 540px;
    position: relative;
    cursor: grab;
    background: radial-gradient(circle at center, #111827 0%, #030712 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.canvas-2d-wrapper:active {
    cursor: grabbing;
}

#canvas-interactive-2d {
    width: 540px;
    height: 540px;
    max-width: 100%;
    max-height: 540px;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    display: block;
    cursor: grab;
}

#canvas-interactive-2d:active {
    cursor: grabbing;
}

/* ==========================================================================
   第一步專屬:堆疊方式闖關提問卡片樣式
   ========================================================================== */
.quiz-question-title {
    font-size: 1.25rem; /* 23.8px */
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.5;
    margin-bottom: 0.85rem;
}

.quiz-options-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.quiz-option-btn {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    padding: 0.95rem 1.25rem;
    color: var(--text-main);
    font-size: 1.1rem; /* 21px */
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 56px;
}

.quiz-option-btn:hover {
    background: rgba(51, 65, 85, 0.85);
    border-color: var(--border-highlight);
    transform: translateX(4px);
}

.quiz-option-btn.selected-wrong {
    background: rgba(244, 63, 94, 0.2) !important;
    border-color: #f43f5e !important;
    color: #fecdd3 !important;
    animation: shake 0.4s ease;
}

.quiz-option-btn.selected-correct {
    background: rgba(16, 185, 129, 0.25) !important;
    border-color: #10b981 !important;
    color: #a7f3d0 !important;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

@keyframes quizHighlightPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.8), 0 4px 20px rgba(0, 0, 0, 0.5);
        border-color: rgba(250, 204, 21, 0.9);
        transform: scale(1);
    }
    30% {
        box-shadow: 0 0 30px 6px rgba(250, 204, 21, 0.95), 0 8px 30px rgba(0, 0, 0, 0.6);
        border-color: #facc15;
        transform: scale(1.025);
    }
    60% {
        box-shadow: 0 0 18px 3px rgba(250, 204, 21, 0.6);
        border-color: rgba(250, 204, 21, 0.8);
        transform: scale(1.01);
    }
    100% {
        box-shadow: none;
        transform: scale(1);
    }
}

.quiz-highlight-pulse {
    animation: quizHighlightPulse 1.6s ease-in-out !important;
    border-color: #facc15 !important;
    scroll-margin-top: 80px;
    scroll-margin-bottom: 80px;
}

.quiz-feedback-box {
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    font-size: 1.05rem; /* 20px (Word 14pt+) */
    line-height: 1.6;
    margin-top: 0.75rem;
    display: none;
    transition: all 0.3s ease;
}

.quiz-feedback-box.error {
    display: block;
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.4);
    color: #fecdd3;
}

.quiz-feedback-box.success {
    display: block;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #a7f3d0;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.btn-unlock-step2 {
    width: 100%;
    margin-top: 0.85rem;
    padding: 0.85rem 1.35rem;
    font-size: 1.15rem; /* 22px */
    font-weight: 700;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    transition: all 0.2s ease;
}

.btn-unlock-step2:hover {
    background: linear-gradient(135deg, #34d399, #10b981);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}


/* 勾選按鈕 / Switch 元件 */
.checkbox-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.05rem; /* 20px (Word 14pt+) */
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    user-select: none;
    min-height: 44px;
}

.checkbox-toggle-label:hover {
    border-color: var(--border-highlight);
    color: var(--text-main);
    background: #334155;
    transform: translateY(-1px);
}

.checkbox-toggle-label input[type="checkbox"] {
    accent-color: #f59e0b;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 動態數學公式推導清單與卡片 */
.formula-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.formula-item {
    background: rgba(2, 6, 23, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.9rem;
    transition: all 0.2s ease;
}

.formula-item:hover {
    background: rgba(2, 6, 23, 0.85);
    border-color: rgba(56, 189, 248, 0.25);
    border-left-color: var(--border-highlight);
    transform: translateY(-1px);
}

.formula-item.green-border { border-left-color: #10b981; }
.formula-item.red-border { border-left-color: #ef4444; }
.formula-item.amber-border { border-left-color: #f59e0b; }
.formula-item.purple-border { border-left-color: #a855f7; }

.formula-header {
    font-size: 1.05rem; /* 放大到 20px */
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.formula-math-line {
    font-size: 1.05rem; /* 放大到 20px */
    color: #38bdf8;
    overflow-x: auto;
    padding: 0.2rem 0;
    line-height: 1.5;
}

.formula-eval-line {
    font-size: 1.0rem; /* 放大到 19px */
    color: #94a3b8;
    margin-top: 0.25rem;
    overflow-x: auto;
    line-height: 1.5;
}

/* KaTeX 深色模式色彩優化 */
.katex {
    color: #e2e8f0 !important;
    font-size: 1.15em !important;
}

.katex .mord.text {
    color: #94a3b8 !important;
}

.katex .mord.mathnormal {
    color: #38bdf8 !important;
}

.katex .mbin,
.katex .mrel {
    color: #facc15 !important;
}

.katex-html {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0;
}

/* --------------------------------------------------------------------------
   第二步填空題樣式
   -------------------------------------------------------------------------- */
.quiz-fill-input {
    transition: all 0.25s ease;
}
.quiz-fill-input:focus {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.45) !important;
}

/* --------------------------------------------------------------------------
   第三步拖拉方塊 (Drag & Drop) 互動題樣式
   -------------------------------------------------------------------------- */
.drag-chips-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.drag-chip {
    background: rgba(30, 41, 59, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    font-size: 1.05rem; /* 20px */
    font-weight: 600;
    color: #f8fafc;
    cursor: grab;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.drag-chip:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
    background: rgba(51, 65, 85, 0.98);
}

.drag-chip:active {
    cursor: grabbing;
    transform: scale(0.98);
}

.drag-chip.dragging {
    opacity: 0.35;
    border-style: dashed;
}

.drag-chip.placed {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(0.6);
}

.chip-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* 判據等式放置槽區 */
.formula-slots-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    background: rgba(15, 23, 42, 0.75);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px dashed rgba(56, 189, 248, 0.35);
}

.drop-slot {
    flex: 1;
    min-height: 64px;
    background: rgba(2, 6, 23, 0.8);
    border: 2px dashed rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.drop-slot.drag-over {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.18);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
}

.drop-slot.filled {
    border-style: solid;
    border-color: rgba(56, 189, 248, 0.8);
    background: rgba(15, 23, 42, 0.98);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.slot-placeholder {
    font-size: 1.0rem;
    color: var(--text-dim);
    text-align: center;
    pointer-events: none;
}

.slot-filled-card {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    justify-content: space-between;
}

.btn-remove-slot {
    background: rgba(244, 63, 94, 0.25);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.4);
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    transition: all 0.2s;
}

.btn-remove-slot:hover {
    background: #f43f5e;
    color: #fff;
}

.operator-select-container {
    flex-shrink: 0;
}

.operator-select {
    background: rgba(30, 41, 59, 0.95);
    border: 2px solid #38bdf8;
    border-radius: var(--radius-sm);
    color: #facc15;
    font-size: 1.2rem;
    font-weight: 800;
    padding: 0.7rem 0.85rem;
    cursor: pointer;
    outline: none;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.3);
    transition: all 0.2s ease;
}

.operator-select:hover, .operator-select:focus {
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.6);
    border-color: #7dd3fc;
}

/* 3D 空間子母畫面 (Picture-in-Picture) 懸浮視窗 (可拖曳移動與邊緣縮放) */
.pip-3d-container {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 260px;
    min-width: 190px;
    min-height: 38px;
    max-width: 95%;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(56, 189, 248, 0.45);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.65), 0 0 16px rgba(56, 189, 248, 0.25);
    z-index: 25;
    overflow: hidden;
    user-select: none;
    touch-action: none;
}

.pip-3d-container.dragging {
    opacity: 0.92;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.85), 0 0 24px rgba(56, 189, 248, 0.5);
    border-color: #38bdf8;
    cursor: grabbing !important;
    transition: none !important;
}

.pip-3d-container.resizing {
    transition: none !important;
    border-color: #38bdf8;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.85), 0 0 24px rgba(56, 189, 248, 0.5);
}

.pip-3d-container.collapsed {
    height: 38px !important;
}

.pip-3d-container.collapsed .pip-resize-handle,
.pip-3d-container.collapsed .pip-canvas-wrapper,
.pip-3d-container.collapsed .pip-footer {
    display: none !important;
}

.pip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 10px;
    background: rgba(30, 41, 59, 0.92);
    border-bottom: 1px solid rgba(56, 189, 248, 0.25);
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.pip-header:active {
    cursor: grabbing;
}

.pip-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #38bdf8;
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
}

.pip-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.25); }
}

.pip-btn-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-pip-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

.btn-pip-icon:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.btn-pip-icon:active {
    transform: scale(0.95);
}

.pip-canvas-wrapper {
    width: 100%;
    height: 160px;
    min-height: 100px;
    position: relative;
    cursor: grab;
    background: radial-gradient(circle at center, #1e293b 0%, #0b0f19 100%);
    touch-action: none;
}

.pip-canvas-wrapper canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.pip-canvas-wrapper:active {
    cursor: grabbing;
}

.pip-footer {
    padding: 4px 8px;
    font-size: 0.78rem;
    color: var(--text-dim);
    text-align: center;
    background: rgba(15, 23, 42, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

/* 右下角拉曳自由縮放手柄 */
.pip-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 24px;
    height: 24px;
    cursor: nwse-resize;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 3px;
    z-index: 35;
    touch-action: none;
    border-bottom-right-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.pip-resize-handle:hover {
    background: rgba(56, 189, 248, 0.25);
    transform: scale(1.15);
}

.pip-resize-handle:active {
    background: rgba(56, 189, 248, 0.4);
}

/* 幾何全攻略總結卡樣式 - 嚴格字級標準 (Word 18號置中、16號、14號) */
.recap-main-title {
    font-size: 24px !important; /* Word 18pt = 24px */
    text-align: center !important; /* 大標題嚴格置中 */
    font-weight: 800 !important;
    width: 100%;
    letter-spacing: -0.01em;
}

.recap-step-title {
    font-size: 21.5px !important; /* Word 16pt = 21.33px -> 21.5px */
    font-weight: 700 !important;
    letter-spacing: -0.01em;
}

.recap-step-content {
    font-size: 19px !important; /* Word 14pt = 18.67px -> 19px */
    line-height: 1.8 !important;
}

.recap-math-inline {
    display: inline-block;
    vertical-align: middle;
    padding: 0 4px;
}

.recap-step-item {
    transition: all 0.25s ease;
}

.recap-step-item:hover {
    transform: translateX(4px);
    background: rgba(30, 41, 59, 0.85) !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

/* 側邊欄 hover 聯動卡片反饋 */
.status-box {
    transition: all 0.2s ease;
}

.status-box:hover {
    border-color: rgba(56, 189, 248, 0.5);
    background: rgba(30, 41, 59, 0.85);
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.2);
}

.formula-item {
    transition: all 0.2s ease;
}

.formula-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   行動平板觸控手勢防誤觸鎖定 (Tablet/iPad Gesture Lock)
   在 2D 與 3D canvas 上嚴格綁定 touch-action: none 與防止頁面縮放誤觸
   ========================================================================== */
#canvas-3d-wrapper,
#canvas-3d-wrapper canvas,
.canvas-2d-wrapper,
#canvas-interactive-2d,
.pip-canvas-wrapper,
.pip-canvas-wrapper canvas,
.drag-chips-container,
.drag-chip,
.formula-slots-wrapper,
.drop-slot,
.btn,
.btn-zoom,
.btn-pip-toggle,
.tab-btn {
    touch-action: none !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    overscroll-behavior: contain !important;
    -webkit-user-drag: none;
}

/* ==========================================================================
   手機與窄螢幕專屬響應式佈局 (Mobile Responsive Layout <= 768px)
   徹底解決手機上 3D 模擬小視窗遮擋 2D 畫布問題
   ========================================================================== */
@media (max-width: 768px) {
    /* 容器邊距收斂,預防內容溢出並保留適當呼吸空間 */
    .main-container {
        padding: 0 0.65rem !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
        margin: 0.75rem auto !important;
        gap: 1rem !important;
    }

    .card {
        padding: 1rem 0.75rem !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .sidebar-panel,
    .viewport-step3-container,
    .viewport-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    /* 頁首標題與選單調整 */
    .app-header {
        padding: 0.75rem 0.75rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .header-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }

    .title-group {
        align-items: center;
    }

    .logo-image {
        width: 38px;
        height: 38px;
    }

    .app-title {
        font-size: 1.3rem;
    }

    .mode-tabs {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
        padding: 4px;
        box-sizing: border-box;
    }

    .tab-btn {
        padding: 0.6rem 0.25rem;
        font-size: 0.88rem;
        justify-content: center;
        text-align: center;
        min-height: 52px;
        line-height: 1.3;
        min-width: 0;
    }

    /* 狀態觀察儀表板 (動態距離即時監控) 嚴格防溢出與自適應 */
    .status-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.5rem !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .status-box {
        min-width: 0 !important;
        padding: 0.65rem 0.55rem !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    .status-box-title {
        font-size: 0.85rem !important;
        line-height: 1.3 !important;
        white-space: normal !important;
        word-break: break-word !important;
    }

    .status-box-value {
        font-size: 1.35rem !important;
    }

    .status-box-desc {
        font-size: 0.8rem !important;
        line-height: 1.3 !important;
        word-break: break-word !important;
    }

    /* 數學公式推導列表與 KaTeX 橫向自適應滾動防撐爆 */
    .formula-list {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .formula-item {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: hidden !important;
        padding: 0.65rem 0.75rem !important;
        box-sizing: border-box !important;
    }

    .formula-header {
        font-size: 0.95rem !important;
        flex-wrap: wrap !important;
        word-break: break-word !important;
    }

    .formula-math-line,
    .formula-eval-line,
    .math-formula-box {
        font-size: 0.9rem !important;
        max-width: 100% !important;
        width: 100% !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        display: block !important;
        padding: 0.35rem 0 !important;
        box-sizing: border-box !important;
    }

    .formula-item .katex {
        font-size: 0.88em !important;
        max-width: 100% !important;
    }

    .katex-html {
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* 3D 視窗高度在手機上適度收斂 */
    #canvas-3d-wrapper {
        height: 360px;
    }

    /* 第三步:2D 畫布容器改為直向彈性流,完全解除覆蓋遮擋 */
    .canvas-2d-wrapper {
        height: auto !important;
        min-height: unset !important;
        padding: 0.85rem 0.5rem !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        overflow: visible !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 浮動標籤改為頂部自適應排版,不再壓在畫布上 */
    .viewport-overlay {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
        gap: 0.45rem !important;
        margin-bottom: 0.65rem !important;
        pointer-events: auto !important;
        order: -1 !important; /* 排在 2D 畫布本體之上 */
    }

    .overlay-badge {
        font-size: 0.82rem !important;
        padding: 0.35rem 0.6rem !important;
    }

    /* 2D 畫布:正方形自適應置中,無任何元件遮擋 */
    #canvas-interactive-2d {
        width: 100% !important;
        max-width: 380px !important;
        height: auto !important;
        aspect-ratio: 1 / 1 !important;
        margin: 0 auto !important;
        display: block !important;
    }

    /* 3D 子母畫面視窗:在手機上垂直排在 2D 畫布正下方,完全零遮擋 */
    .pip-3d-container {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;
        bottom: auto !important;
        width: 100% !important;
        max-width: 380px !important;
        margin: 0.85rem auto 0 auto !important;
        border-radius: var(--radius-sm) !important;
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5) !important;
        z-index: 15 !important;
        box-sizing: border-box !important;
    }

    .pip-canvas-wrapper {
        height: 180px !important;
        width: 100% !important;
    }

    /* 控制列按鈕在手機上全寬好點擊 */
    .viewport-controls {
        padding: 0.75rem 0.75rem;
    }

    .viewport-controls .btn-group {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .viewport-controls .btn {
        width: 100%;
        justify-content: center;
    }

    .checkbox-toggle-label {
        width: 100%;
        justify-content: center;
    }

    /* 第三步拖拉題在手機上自適應 */
    .drag-chips-container {
        grid-template-columns: 1fr !important;
    }

    .formula-slots-wrapper {
        flex-direction: column !important;
        gap: 0.65rem !important;
    }

    .operator-select-container {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .operator-select {
        width: 100%;
        text-align: center;
        text-align-last: center;
    }
}

/* 超窄螢幕手機 (<= 380px) 特化微調 */
@media (max-width: 380px) {
    .status-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================
   第三步:紅藍球距 vs 黃線淨距 臨界交叉折線圖專屬樣式
   ========================================================================== */
.crossover-legend-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(2, 6, 23, 0.45);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.crossover-legend-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
}

.legend-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.crossover-status-banner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
    gap: 0.5rem;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.75rem;
}

.status-banner-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.status-banner-item .banner-label {
    font-size: 0.78rem;
    color: var(--text-dim);
}

.status-banner-item .banner-val {
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
    font-weight: 700;
}

.status-banner-item.banner-verdict {
    grid-column: 1 / -1;
    margin-top: 3px;
}

.verdict-tag {
    display: block;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 700;
    text-align: center;
    transition: all 0.2s ease;
}

.verdict-tag.blocked {
    background: rgba(239, 68, 68, 0.16);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.45);
}

.verdict-tag.escaped {
    background: rgba(16, 185, 129, 0.16);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.45);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.crossover-chart-container {
    width: 100%;
    position: relative;
    background: rgba(2, 6, 23, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 0.85rem;
    user-select: none;
    cursor: crosshair;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

.crossover-chart-container svg {
    display: block;
    width: 100%;
    height: auto;
}

@keyframes crossoverPulse {
    0% {
        r: 6px;
        opacity: 0.95;
        stroke-width: 2px;
    }
    70% {
        r: 16px;
        opacity: 0;
        stroke-width: 1px;
    }
    100% {
        r: 16px;
        opacity: 0;
        stroke-width: 0;
    }
}

.pulse-ring {
    animation: crossoverPulse 2.2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.crossover-tooltip {
    position: absolute;
    pointer-events: none;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    font-size: 0.85rem;
    color: var(--text-main);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    z-index: 25;
    transform: translate(-50%, -115%);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.crossover-tooltip.visible {
    opacity: 1;
}

.crossover-insight-box {
    background: rgba(2, 6, 23, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 4px solid #facc15;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
}

.insight-title {
    font-size: 1rem;
    font-weight: 700;
    color: #facc15;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.insight-list {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--text-muted);
}

.insight-list li {
    margin-bottom: 0.45rem;
}

/* 列印樣式優化 */
@media print {
    body {
        background: #fff !important;
        color: #000 !important;
    }

    .app-header, .mode-tabs, .viewport-controls, .btn-group, #card-quiz-step1, #card-quiz-step2, #card-quiz-step3 {
        display: none !important;
    }

    #card-recap-summary {
        display: block !important;
        background: #fff !important;
        color: #000 !important;
        border: 2px solid #000 !important;
        box-shadow: none !important;
    }

    .recap-step-item {
        background: #f8fafc !important;
        color: #000 !important;
        border: 1px solid #cbd5e1 !important;
    }
}