-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtech.html
More file actions
1688 lines (1603 loc) · 95.5 KB
/
Copy pathtech.html
File metadata and controls
1688 lines (1603 loc) · 95.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- ============================================
SEO Meta 标签
============================================ -->
<title>MathMate 技术详解 | Flutter + AI | 几何可视化引擎</title>
<meta name="description" content="深入剖析 MathMate 的技术架构:Flutter 跨平台、多 AI 模型协作(DeepSeek、火山引擎、Qwen)、自研几何可视化引擎、GeoGebra 集成、60fps Canvas 渲染。">
<meta name="keywords" content="MathMate技术,Flutter,DeepSeek,AI数学,几何引擎,Canvas渲染,技术架构,开源项目">
<meta name="author" content="AK完全队">
<meta name="robots" content="index, follow">
<!-- Open Graph -->
<meta property="og:type" content="article">
<meta property="og:url" content="https://mathmate.top/tech.html">
<meta property="og:title" content="MathMate 技术详解">
<meta property="og:description" content="Flutter + AI 驱动的智能数学学习应用技术架构">
<meta property="og:image" content="https://mathmate.top/images/architecture.png">
<!-- Canonical URL -->
<link rel="canonical" href="https://mathmate.top/tech.html">
<!-- Favicon -->
<link rel="icon" type="image/png" href="/icon.png">
<link rel="apple-touch-icon" href="/icon.png">
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
<style>
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');
:root {
--primary: #6C5CE7;
--primary-light: #A29BFE;
--primary-dark: #5A4BD1;
--accent: #00CEC9;
--accent-light: #81ECEC;
--gradient-1: linear-gradient(135deg, #6C5CE7 0%, #A29BFE 50%, #00CEC9 100%);
--gradient-2: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
--gradient-3: linear-gradient(135deg, #00CEC9 0%, #6C5CE7 100%);
--bg: #0F0F1A;
--bg-card: #1A1A2E;
--bg-card-hover: #222240;
--text: #E8E8F0;
--text-secondary: #A0A0C0;
--border: rgba(108, 92, 231, 0.2);
--shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
--radius: 16px;
--font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
background: var(--bg); color: var(--text); line-height: 1.7; overflow-x: hidden;
}
/* ===== Reading Progress Bar ===== */
.reading-progress {
position: fixed; top: 0; left: 0; height: 3px; z-index: 200;
background: var(--gradient-1); width: 0%; transition: width 0.1s linear;
}
/* ===== Matrix Grid Background ===== */
.matrix-bg {
position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.03;
background-image:
linear-gradient(rgba(108,92,231,0.4) 1px, transparent 1px),
linear-gradient(90deg, rgba(108,92,231,0.4) 1px, transparent 1px);
background-size: 60px 60px;
}
/* ===== Floating Symbols ===== */
.floating-symbols {
position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}
.float-sym {
position: absolute; font-family: var(--font-mono); color: rgba(108,92,231,0.07);
animation: symbolDrift linear infinite; font-size: 14px; user-select: none;
}
@keyframes symbolDrift {
0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
10% { opacity: 1; }
90% { opacity: 1; }
100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}
/* ===== Cursor Glow ===== */
.cursor-glow {
position: fixed; pointer-events: none; z-index: 998;
width: 300px; height: 300px; border-radius: 50%;
background: radial-gradient(circle, rgba(108,92,231,0.06) 0%, rgba(0,206,201,0.03) 40%, transparent 70%);
transform: translate(-50%, -50%);
transition: left 0.08s ease-out, top 0.08s ease-out;
}
/* ===== Nav ===== */
nav {
position: fixed; top: 0; left: 0; right: 0; z-index: 100;
padding: 0.8rem 2rem; display: flex; justify-content: space-between; align-items: center;
backdrop-filter: blur(20px); background: rgba(15,15,26,0.85);
border-bottom: 1px solid var(--border); transition: all 0.3s;
}
nav.scrolled { padding: 0.5rem 2rem; background: rgba(15,15,26,0.95); }
.nav-logo {
display: flex; align-items: center; gap: 0.75rem; font-size: 1.3rem; font-weight: 700;
background: var(--gradient-1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-decoration: none;
}
.nav-logo svg { width: 30px; height: 30px; }
.nav-links { display: flex; gap: 1.5rem; list-style: none; flex-wrap: wrap; }
.nav-links a {
color: var(--text-secondary); text-decoration: none; font-size: 0.88rem; transition: color 0.3s; position: relative;
}
.nav-links a:hover { color: var(--primary-light); }
.nav-links a::after {
content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px;
background: var(--gradient-1); transition: width 0.3s; border-radius: 1px;
}
.nav-links a:hover::after { width: 100%; }
.nav-back {
display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 1rem;
background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
color: var(--text); text-decoration: none; font-size: 0.85rem; transition: all 0.3s;
}
.nav-back:hover { border-color: var(--primary); background: var(--bg-card-hover); }
/* ===== Section Common ===== */
.section { padding: 5rem 2rem; position: relative; }
.section-bg-glow {
position: absolute; inset: 0;
background: linear-gradient(180deg, transparent, rgba(108,92,231,0.03), transparent);
pointer-events: none;
}
.container { max-width: 1100px; margin: 0 auto; position: relative; }
.section-header { text-align: center; margin-bottom: 1rem; }
.section-label {
display: inline-block; font-size: 0.78rem; font-weight: 600; color: var(--accent);
text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.6rem;
}
.section-header h2 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); font-weight: 700; margin-bottom: 0.8rem; }
.section-header p { color: var(--text-secondary); max-width: 620px; margin: 0 auto; font-size: 0.95rem; }
/* ===== Hero ===== */
.tech-hero {
min-height: 55vh; display: flex; align-items: center; justify-content: center;
text-align: center; padding: 7rem 2rem 3rem; position: relative; overflow: hidden;
}
.tech-hero::before {
content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
background:
radial-gradient(circle at 25% 40%, rgba(108,92,231,0.1) 0%, transparent 40%),
radial-gradient(circle at 75% 60%, rgba(0,206,201,0.08) 0%, transparent 40%),
radial-gradient(circle at 50% 50%, rgba(108,92,231,0.04) 0%, transparent 60%);
animation: heroFloat 20s ease-in-out infinite;
}
.tech-hero::after {
content: ''; position: absolute; inset: 0;
background: repeating-linear-gradient(
0deg, transparent, transparent 2px, rgba(108,92,231,0.015) 2px, rgba(108,92,231,0.015) 4px
);
pointer-events: none; animation: scanlines 8s linear infinite;
}
@keyframes scanlines { 0%{transform:translateY(0)} 100%{transform:translateY(4px)} }
@keyframes heroFloat { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-2%,-2%)} }
.tech-hero-content { position: relative; z-index: 1; max-width: 750px; }
.tech-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.15; margin-bottom: 1rem; }
.tech-hero h1 .gradient-text { background: var(--gradient-1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.tech-hero p { font-size: 1.1rem; color: var(--text-secondary); max-width: 600px; margin: 0 auto 1.5rem; line-height: 1.8; }
.tech-hero-links { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }
.btn-primary {
display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.85rem 1.8rem;
background: var(--gradient-2); color: white; border: none; border-radius: 12px;
font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: all 0.3s;
text-decoration: none; box-shadow: 0 4px 20px rgba(108,92,231,0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 30px rgba(108,92,231,0.5); }
.btn-secondary {
display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.85rem 1.8rem;
background: transparent; color: var(--text); border: 1px solid var(--border);
border-radius: 12px; font-size: 0.95rem; font-weight: 500; cursor: pointer;
transition: all 0.3s; text-decoration: none;
}
.btn-secondary:hover { border-color: var(--primary); background: rgba(108,92,231,0.1); transform: translateY(-2px); }
/* ===== Quick Nav ===== */
.quick-nav {
display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center;
margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border);
}
.quick-nav a {
padding: 0.4rem 1rem; background: var(--bg-card); border: 1px solid var(--border);
border-radius: 8px; color: var(--text-secondary); text-decoration: none; font-size: 0.82rem;
transition: all 0.3s;
}
.quick-nav a:hover { border-color: var(--primary); color: var(--primary-light); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(108,92,231,0.2); }
/* ===== Philosophy Cards ===== */
.philosophy-grid {
display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 1.5rem; margin-top: 2rem;
}
.philosophy-card {
padding: 2rem; background: var(--bg-card); border: 1px solid var(--border);
border-radius: var(--radius); position: relative; overflow: hidden; transition: all 0.4s;
}
.philosophy-card::before {
content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
opacity: 0; transition: opacity 0.3s;
}
.philosophy-card:nth-child(1)::before { background: #6C5CE7; }
.philosophy-card:nth-child(2)::before { background: #00CEC9; }
.philosophy-card:nth-child(3)::before { background: #FF6B6B; }
.philosophy-card:nth-child(4)::before { background: #FDCB6E; }
.philosophy-card:nth-child(5)::before { background: #A29BFE; }
.philosophy-card:hover { transform: translateY(-4px); border-color: rgba(108,92,231,0.4); box-shadow: var(--shadow); }
.philosophy-card:hover::before { opacity: 1; }
.philosophy-card h3 { font-size: 1.1rem; margin-bottom: 0.8rem; display: flex; align-items: center; gap: 0.5rem; }
.philosophy-card p { color: var(--text-secondary); font-size: 0.88rem; line-height: 1.8; }
.philosophy-icon { font-size: 1.4rem; }
/* ===== Pipeline Deep Dive ===== */
.pipeline-detail {
display: grid; grid-template-columns: 1fr; gap: 0; margin-top: 2rem; position: relative;
}
.pipeline-detail::before {
content: ''; position: absolute; left: 28px; top: 70px; bottom: 20px; width: 2px;
background: linear-gradient(180deg, var(--primary) 0%, var(--accent) 50%, #FF6B6B 100%); opacity: 0.2;
}
.pipeline-stage {
padding: 2rem; background: var(--bg-card); border: 1px solid var(--border);
border-radius: var(--radius); display: grid; grid-template-columns: auto 1fr; gap: 1.5rem; transition: all 0.3s;
margin-bottom: 1.5rem; position: relative;
}
.pipeline-stage:last-child { margin-bottom: 0; }
.pipeline-stage:hover { border-color: rgba(108,92,231,0.4); }
.stage-num {
width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center;
justify-content: center; font-weight: 800; font-size: 1.3rem; color: white; flex-shrink: 0;
}
.stage-num.s1 { background: linear-gradient(135deg, #6C5CE7, #A29BFE); }
.stage-num.s2 { background: linear-gradient(135deg, #00CEC9, #81ECEC); }
.stage-num.s3 { background: linear-gradient(135deg, #FF6B6B, #FDCB6E); }
.stage-content h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.stage-content p { color: var(--text-secondary); font-size: 0.88rem; line-height: 1.7; margin-bottom: 0.6rem; }
.stage-tech { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.stage-tech span {
padding: 0.2rem 0.6rem; background: rgba(108,92,231,0.1); border: 1px solid rgba(108,92,231,0.2);
border-radius: 6px; font-size: 0.75rem; color: var(--primary-light);
}
/* ===== Code Block ===== */
.code-block {
background: #0c0c18; border: 1px solid var(--border); border-radius: 12px;
padding: 1.5rem; margin-top: 1rem; overflow-x: auto; font-family: var(--font-mono);
font-size: 0.78rem; line-height: 1.8; color: var(--text-secondary); position: relative;
box-shadow: inset 0 0 30px rgba(0,0,0,0.3);
}
.code-block::before {
content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
background: linear-gradient(90deg, transparent, var(--primary), transparent); opacity: 0.4;
}
.code-block .code-label {
font-size: 0.72rem; color: var(--accent); margin-bottom: 0.8rem; font-weight: 600;
display: flex; align-items: center; gap: 0.5rem;
}
.code-block .code-label::before {
content: ''; display: inline-flex; gap: 3px;
width: 8px; height: 8px; border-radius: 50%; background: #FF6B6B;
box-shadow: 14px 0 0 #FDCB6E, 28px 0 0 #00CEC9;
}
.code-key { color: #A29BFE; }
.code-str { color: #00CEC9; }
.code-comment { color: #555580; font-style: italic; }
.code-num { color: #FDCB6E; }
/* ===== Library Table ===== */
.lib-table {
width: 100%; border-collapse: collapse; margin-top: 2rem; font-size: 0.85rem;
background: var(--bg-card); border-radius: var(--radius); overflow: hidden;
}
.lib-table th {
text-align: left; padding: 1rem; background: rgba(108,92,231,0.1);
border-bottom: 2px solid var(--primary); font-size: 0.82rem; color: var(--primary-light);
}
.lib-table td {
padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); color: var(--text-secondary); vertical-align: top;
}
.lib-table tr:last-child td { border-bottom: none; }
.lib-table tr:hover td { background: rgba(108,92,231,0.03); }
.lib-name { color: var(--text); font-weight: 500; font-family: var(--font-mono); font-size: 0.82rem; }
.lib-version { color: var(--accent); font-size: 0.78rem; font-family: var(--font-mono); }
/* ===== Timeline ===== */
.timeline { max-width: 800px; margin: 2rem auto 0; position: relative; padding-left: 2rem; }
.timeline::before {
content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px;
background: linear-gradient(180deg, var(--primary), var(--accent)); opacity: 0.3;
}
.timeline-item { position: relative; padding: 0 0 2.5rem 2.2rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
position: absolute; left: -2px; top: 4px; width: 18px; height: 18px;
border-radius: 50%; background: var(--bg); border: 3px solid var(--primary); z-index: 1;
}
.timeline-item:first-child .timeline-dot { background: var(--primary); box-shadow: 0 0 12px rgba(108,92,231,0.5); }
.timeline-version { font-size: 0.78rem; font-weight: 700; color: var(--primary-light); margin-bottom: 0.2rem; }
.timeline-date { font-size: 0.72rem; color: var(--text-secondary); opacity: 0.7; margin-bottom: 0.2rem; }
.timeline-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.3rem; }
.timeline-desc { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.7; }
.timeline-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.4rem; }
.timeline-tag {
padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.7rem; font-weight: 500;
}
.timeline-tag.new { background: rgba(0,206,201,0.15); color: #00CEC9; }
.timeline-tag.fix { background: rgba(255,107,107,0.15); color: #FF6B6B; }
.timeline-tag.refactor { background: rgba(253,203,110,0.15); color: #FDCB6E; }
.timeline-tag.perf { background: rgba(108,92,231,0.15); color: #A29BFE; }
/* ===== Test Data Grid ===== */
.test-grid {
display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1.2rem; margin-top: 2rem;
}
.test-card {
padding: 1.8rem; background: var(--bg-card); border: 1px solid var(--border);
border-radius: var(--radius); text-align: center; transition: all 0.3s; position: relative; overflow: hidden;
}
.test-card::after {
content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
background: var(--gradient-1); opacity: 0; transition: opacity 0.3s;
}
.test-card:hover { transform: translateY(-3px); border-color: var(--primary); }
.test-card:hover::after { opacity: 1; }
.test-value { font-size: 2.2rem; font-weight: 800; background: var(--gradient-1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.test-label { font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.3rem; }
.test-desc { font-size: 0.75rem; color: var(--text-secondary); opacity: 0.7; margin-top: 0.2rem; }
/* ===== Open Source Cards ===== */
.oss-grid {
display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 1.2rem; margin-top: 2rem;
}
.oss-card {
padding: 1.5rem; background: var(--bg-card); border: 1px solid var(--border);
border-radius: var(--radius); transition: all 0.3s; display: block; text-decoration: none; color: var(--text);
}
.oss-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow); }
.oss-card h4 { font-size: 0.95rem; margin-bottom: 0.3rem; display: flex; align-items: center; gap: 0.4rem; }
.oss-source { font-size: 0.75rem; color: var(--accent); margin-bottom: 0.5rem; }
.oss-card p { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.7; }
/* ===== Video Section ===== */
.video-container {
max-width: 800px; margin: 2rem auto 0; background: var(--bg-card);
border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.video-embed { position: relative; padding-bottom: 56.25%; height: 0; }
.video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.video-info { padding: 1.5rem 2rem; }
.video-info h3 { font-size: 1.1rem; margin-bottom: 0.4rem; }
.video-info p { color: var(--text-secondary); font-size: 0.88rem; }
/* ===== Link Cards ===== */
.link-grid {
display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
gap: 1.2rem; margin-top: 2rem;
}
.link-card {
padding: 1.8rem; background: var(--bg-card); border: 1px solid var(--border);
border-radius: var(--radius); text-align: center; transition: all 0.4s;
text-decoration: none; color: var(--text); display: block; position: relative; overflow: hidden;
}
.link-card::before {
content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
opacity: 0; transition: opacity 0.3s;
}
.link-card:nth-child(1)::before { background: #FF6B6B; }
.link-card:nth-child(2)::before { background: #00CEC9; }
.link-card:nth-child(3)::before { background: #6C5CE7; }
.link-card:nth-child(4)::before { background: #FDCB6E; }
.link-card:hover { transform: translateY(-4px); border-color: rgba(108,92,231,0.4); box-shadow: var(--shadow); }
.link-card:hover::before { opacity: 1; }
.link-icon { font-size: 2.5rem; margin-bottom: 0.8rem; display: block; }
.link-card h3 { font-size: 1.05rem; margin-bottom: 0.3rem; }
.link-card p { color: var(--text-secondary); font-size: 0.82rem; }
.link-url { font-size: 0.78rem; color: var(--accent); margin-top: 0.5rem; font-family: monospace; }
/* ===== AI Model Cards ===== */
.compare-grid {
display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
gap: 1.8rem; margin-top: 2rem;
}
.compare-card {
padding: 0; background: rgba(26,26,46,0.6);
backdrop-filter: blur(10px);
border: 1px solid rgba(108,92,231,0.15);
border-radius: var(--radius); transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
overflow: hidden; position: relative;
}
.compare-card:hover {
border-color: rgba(108,92,231,0.4);
transform: translateY(-4px);
box-shadow: 0 12px 40px rgba(108,92,231,0.12);
}
.compare-card .card-header {
padding: 1.2rem 1.5rem;
border-bottom: 1px solid rgba(108,92,231,0.1);
display: flex; align-items: center; gap: 0.8rem;
}
.compare-card .card-header .icon-wrap {
width: 38px; height: 38px; border-radius: 10px;
display: flex; align-items: center; justify-content: center;
font-size: 1.2rem; flex-shrink: 0;
}
.compare-card:nth-child(1) .icon-wrap { background: rgba(108,92,231,0.15); }
.compare-card:nth-child(2) .icon-wrap { background: rgba(0,206,201,0.15); }
.compare-card:nth-child(3) .icon-wrap { background: rgba(253,203,110,0.15); }
.compare-card .card-header .title-group h4 {
font-size: 1rem; font-weight: 700; margin: 0;
background: linear-gradient(135deg, #E8E8F0, #A29BFE);
-webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.compare-card .card-header .title-group .subtitle {
font-size: 0.75rem; color: var(--accent); font-weight: 600; margin-top: 0.15rem;
}
.compare-card .card-body {
padding: 1.2rem 1.5rem 1.5rem;
}
.compare-card .field {
margin-bottom: 0.9rem;
}
.compare-card .field:last-child { margin-bottom: 0; }
.compare-card .field-label {
font-size: 0.72rem; font-weight: 700; color: var(--primary-light);
text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.3rem;
}
.compare-card .field-value {
font-size: 0.85rem; color: var(--text-secondary); line-height: 1.65;
}
.compare-card .field-value code {
font-family: var(--font-mono); font-size: 0.78em;
background: rgba(108,92,231,0.1); padding: 0.15rem 0.4rem;
border-radius: 4px; color: var(--accent);
}
.compare-card .tag-row {
display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.3rem;
}
.compare-card .tag {
padding: 0.2rem 0.55rem; background: rgba(108,92,231,0.1);
border: 1px solid rgba(108,92,231,0.15); border-radius: 6px;
font-size: 0.72rem; color: var(--primary-light);
}
.compare-card:nth-child(2) .tag {
background: rgba(0,206,201,0.08); border-color: rgba(0,206,201,0.15); color: var(--accent);
}
.compare-card:nth-child(3) .tag {
background: rgba(253,203,110,0.08); border-color: rgba(253,203,110,0.15); color: #FDCB6E;
}
/* ===== Divider ===== */
.section-divider {
max-width: 120px; height: 1px; margin: 0 auto; padding: 3rem 0;
background: linear-gradient(90deg, transparent, var(--primary), var(--accent), transparent);
opacity: 0.4; position: relative;
}
.section-divider::before {
content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
width: 6px; height: 6px; background: var(--primary); border-radius: 50%;
box-shadow: 0 0 12px rgba(108,92,231,0.5);
}
/* ===== Footer ===== */
footer {
padding: 2rem; text-align: center; border-top: 1px solid var(--border);
color: var(--text-secondary); font-size: 0.82rem;
}
footer a { color: var(--primary-light); text-decoration: none; }
footer a:hover { text-decoration: underline; }
/* ===== Animations ===== */
.fade-in { opacity: 0; transform: translateY(25px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }
/* ===== Inline Code ===== */
code {
font-family: var(--font-mono); font-size: 0.82em;
padding: 0.15rem 0.45rem; background: rgba(108,92,231,0.12);
border: 1px solid rgba(108,92,231,0.15); border-radius: 4px;
color: var(--primary-light);
}
.compare-card li code { font-size: 0.78em; }
/* ===== HERO Neural Network SVG ===== */
.hero-neural-net {
position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}
.hero-neural-net svg { width: 100%; height: 100%; }
.neural-node { animation: neuralPulse 3s ease-in-out infinite; }
.neural-node:nth-child(odd) { animation-delay: 0.5s; }
.neural-node:nth-child(3n) { animation-delay: 1.2s; }
@keyframes neuralPulse {
0%,100% { opacity: 0.15; r: 3; }
50% { opacity: 0.5; r: 4.5; }
}
.neural-edge { animation: edgeGlow 4s ease-in-out infinite; }
.neural-edge:nth-child(even) { animation-delay: 1s; }
@keyframes edgeGlow {
0%,100% { stroke-opacity: 0.04; }
50% { stroke-opacity: 0.12; }
}
/* ===== Holographic shimmer on hero h1 ===== */
.tech-hero h1 {
position: relative; display: inline-block;
}
.tech-hero h1 .gradient-text {
background: linear-gradient(
90deg,
#6C5CE7 0%, #A29BFE 20%, #00CEC9 40%,
#81ECEC 50%, #00CEC9 60%, #A29BFE 80%, #6C5CE7 100%
);
background-size: 200% 100%;
-webkit-background-clip: text; background-clip: text;
-webkit-text-fill-color: transparent;
animation: holoShift 4s linear infinite;
}
@keyframes holoShift {
0% { background-position: 0% 50%; }
100% { background-position: 200% 50%; }
}
/* ===== Section header glow particles ===== */
.section-header { position: relative; }
.header-glow {
position: absolute; width: 6px; height: 6px; border-radius: 50%;
background: var(--primary); box-shadow: 0 0 10px var(--primary), 0 0 20px rgba(108,92,231,0.3);
animation: glowFloat 6s ease-in-out infinite;
pointer-events: none;
}
.header-glow:nth-child(1) { top: -8px; left: 30%; animation-delay: 0s; background: var(--primary); box-shadow: 0 0 10px var(--primary), 0 0 20px rgba(108,92,231,0.3); }
.header-glow:nth-child(2) { top: 50%; right: 25%; animation-delay: 2s; background: var(--accent); box-shadow: 0 0 10px var(--accent), 0 0 20px rgba(0,206,201,0.3); }
.header-glow:nth-child(3) { bottom: -5px; left: 50%; animation-delay: 4s; background: #A29BFE; box-shadow: 0 0 10px #A29BFE, 0 0 20px rgba(162,155,254,0.3); }
@keyframes glowFloat {
0%,100% { transform: translate(0, 0) scale(1); opacity: 0.6; }
25% { transform: translate(8px, -6px) scale(1.3); opacity: 1; }
50% { transform: translate(-4px, 4px) scale(0.8); opacity: 0.4; }
75% { transform: translate(6px, 2px) scale(1.1); opacity: 0.8; }
}
/* ===== Animated gradient border on pipeline stages ===== */
.pipeline-stage {
position: relative;
background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
linear-gradient(135deg, rgba(108,92,231,0.3), rgba(0,206,201,0.1), rgba(108,92,231,0.3)) border-box;
border: 1px solid transparent;
}
.pipeline-stage::after {
content: ''; position: absolute; inset: -1px; border-radius: var(--radius); padding: 1px;
background: linear-gradient(135deg, var(--primary), var(--accent), var(--primary));
background-size: 300% 300%;
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
-webkit-mask-composite: xor; mask-composite: exclude;
animation: borderShift 6s linear infinite;
pointer-events: none; opacity: 0.35;
}
.pipeline-stage:hover::after { opacity: 0.7; }
@keyframes borderShift {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
/* ===== Circuit board code block ===== */
.code-block {
position: relative;
border: 1px solid transparent;
background:
linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
linear-gradient(135deg, var(--primary), rgba(0,206,201,0.5), var(--primary)) border-box;
border-radius: 12px;
}
.code-block::after {
content: ''; position: absolute; top: -8px; right: -8px; bottom: -8px; width: 40px;
border-right: 2px dashed rgba(108,92,231,0.15);
border-top: 2px dashed rgba(108,92,231,0.15);
border-radius: 0 12px 0 0;
pointer-events: none;
}
/* ===== Math formula section background ===== */
.section-formula-bg {
position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0;
}
.formula-watermark {
position: absolute; font-family: var(--font-mono); color: rgba(108,92,231,0.025);
font-size: clamp(10px, 1.5vw, 16px); white-space: nowrap; user-select: none;
animation: formulaSlide 40s linear infinite;
}
.formula-watermark:nth-child(2) { top: 25%; animation-delay: -10s; color: rgba(0,206,201,0.02); }
.formula-watermark:nth-child(3) { top: 50%; animation-delay: -20s; }
.formula-watermark:nth-child(4) { top: 75%; animation-delay: -30s; color: rgba(0,206,201,0.02); }
@keyframes formulaSlide {
0% { transform: translateX(100vw); }
100% { transform: translateX(-200%); }
}
/* ===== Responsive ===== */
@media (max-width: 768px) {
.nav-links { display: none; }
.philosophy-grid, .compare-grid { grid-template-columns: 1fr; }
.pipeline-stage { grid-template-columns: 1fr; }
.stage-num { width: 48px; height: 48px; font-size: 1.1rem; }
.test-grid { grid-template-columns: repeat(2, 1fr); }
.tech-hero { min-height: 45vh; padding: 6rem 2rem 2rem; }
}
@media (max-width: 480px) {
.test-grid { grid-template-columns: 1fr; }
.link-grid { grid-template-columns: 1fr; }
}
</style>
</head>
<body>
<!-- Reading Progress -->
<div class="reading-progress" id="readingProgress"></div>
<!-- Matrix Grid Background -->
<div class="matrix-bg"></div>
<!-- Floating Math Symbols -->
<div class="floating-symbols" id="floatingSymbols"></div>
<!-- Cursor Glow -->
<div class="cursor-glow" id="cursorGlow"></div>
<!-- Navigation -->
<nav id="navbar">
<a href="index.html" class="nav-logo">
<svg viewBox="0 0 32 32" fill="none"><rect width="32" height="32" rx="8" fill="url(#g1)"/><path d="M8 22L16 10L24 22" stroke="white" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/><circle cx="16" cy="17" r="2" fill="white"/><defs><linearGradient id="g1" x1="0" y1="0" x2="32" y2="32"><stop stop-color="#6C5CE7"/><stop offset="1" stop-color="#00CEC9"/></linearGradient></defs></svg>
MathMate
</a>
<ul class="nav-links">
<li><a href="#philosophy">设计思路</a></li>
<li><a href="#pipeline-deep">技术路径</a></li>
<li><a href="#libraries">外源库</a></li>
<li><a href="#models">AI 模型选型</a></li>
<li><a href="#iteration">迭代过程</a></li>
<li><a href="#testing">测试数据</a></li>
<li><a href="#opensource">开源参考</a></li>
<li><a href="#links">视频与链接</a></li>
</ul>
<a href="index.html" class="nav-back">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M19 12H5M12 19l-7-7 7-7"/></svg>
返回首页
</a>
</nav>
<!-- ====== Hero ====== -->
<section class="tech-hero" id="top">
<!-- Neural Network SVG Decoration -->
<div class="hero-neural-net">
<svg viewBox="0 0 1200 600" preserveAspectRatio="xMidYMid slice" xmlns="http://www.w3.org/2000/svg">
<!-- Layer 1 (left) -->
<circle class="neural-node" cx="120" cy="100" r="3" fill="#6C5CE7"/>
<circle class="neural-node" cx="120" cy="200" r="3" fill="#6C5CE7"/>
<circle class="neural-node" cx="120" cy="300" r="3" fill="#6C5CE7"/>
<circle class="neural-node" cx="120" cy="400" r="3" fill="#6C5CE7"/>
<circle class="neural-node" cx="120" cy="500" r="3" fill="#6C5CE7"/>
<!-- Layer 2 -->
<circle class="neural-node" cx="300" cy="80" r="3" fill="#A29BFE"/>
<circle class="neural-node" cx="300" cy="180" r="3" fill="#A29BFE"/>
<circle class="neural-node" cx="300" cy="300" r="3" fill="#A29BFE"/>
<circle class="neural-node" cx="300" cy="420" r="3" fill="#A29BFE"/>
<circle class="neural-node" cx="300" cy="520" r="3" fill="#A29BFE"/>
<!-- Layer 3 -->
<circle class="neural-node" cx="500" cy="150" r="3" fill="#00CEC9"/>
<circle class="neural-node" cx="500" cy="300" r="3" fill="#00CEC9"/>
<circle class="neural-node" cx="500" cy="450" r="3" fill="#00CEC9"/>
<!-- Layer 4 (right) -->
<circle class="neural-node" cx="720" cy="120" r="3" fill="#81ECEC"/>
<circle class="neural-node" cx="720" cy="250" r="3" fill="#81ECEC"/>
<circle class="neural-node" cx="720" cy="380" r="3" fill="#81ECEC"/>
<circle class="neural-node" cx="720" cy="500" r="3" fill="#81ECEC"/>
<!-- Output -->
<circle class="neural-node" cx="920" cy="200" r="3" fill="#6C5CE7"/>
<circle class="neural-node" cx="920" cy="400" r="3" fill="#00CEC9"/>
<!-- Edges L1→L2 -->
<line class="neural-edge" x1="120" y1="100" x2="300" y2="80" stroke="#6C5CE7" stroke-width="0.5" stroke-opacity="0.06"/>
<line class="neural-edge" x1="120" y1="100" x2="300" y2="180" stroke="#6C5CE7" stroke-width="0.5" stroke-opacity="0.04"/>
<line class="neural-edge" x1="120" y1="200" x2="300" y2="180" stroke="#6C5CE7" stroke-width="0.5" stroke-opacity="0.06"/>
<line class="neural-edge" x1="120" y1="200" x2="300" y2="300" stroke="#6C5CE7" stroke-width="0.5" stroke-opacity="0.04"/>
<line class="neural-edge" x1="120" y1="300" x2="300" y2="300" stroke="#A29BFE" stroke-width="0.5" stroke-opacity="0.06"/>
<line class="neural-edge" x1="120" y1="300" x2="300" y2="420" stroke="#A29BFE" stroke-width="0.5" stroke-opacity="0.04"/>
<line class="neural-edge" x1="120" y1="400" x2="300" y2="420" stroke="#A29BFE" stroke-width="0.5" stroke-opacity="0.06"/>
<line class="neural-edge" x1="120" y1="400" x2="300" y2="520" stroke="#A29BFE" stroke-width="0.5" stroke-opacity="0.04"/>
<line class="neural-edge" x1="120" y1="500" x2="300" y2="520" stroke="#6C5CE7" stroke-width="0.5" stroke-opacity="0.06"/>
<line class="neural-edge" x1="120" y1="100" x2="300" y2="300" stroke="#6C5CE7" stroke-width="0.5" stroke-opacity="0.03"/>
<line class="neural-edge" x1="120" y1="500" x2="300" y2="300" stroke="#6C5CE7" stroke-width="0.5" stroke-opacity="0.03"/>
<!-- Edges L2→L3 -->
<line class="neural-edge" x1="300" y1="80" x2="500" y2="150" stroke="#00CEC9" stroke-width="0.5" stroke-opacity="0.05"/>
<line class="neural-edge" x1="300" y1="180" x2="500" y2="150" stroke="#00CEC9" stroke-width="0.5" stroke-opacity="0.05"/>
<line class="neural-edge" x1="300" y1="180" x2="500" y2="300" stroke="#00CEC9" stroke-width="0.5" stroke-opacity="0.04"/>
<line class="neural-edge" x1="300" y1="300" x2="500" y2="300" stroke="#00CEC9" stroke-width="0.5" stroke-opacity="0.06"/>
<line class="neural-edge" x1="300" y1="300" x2="500" y2="450" stroke="#00CEC9" stroke-width="0.5" stroke-opacity="0.04"/>
<line class="neural-edge" x1="300" y1="420" x2="500" y2="450" stroke="#00CEC9" stroke-width="0.5" stroke-opacity="0.05"/>
<line class="neural-edge" x1="300" y1="520" x2="500" y2="450" stroke="#00CEC9" stroke-width="0.5" stroke-opacity="0.05"/>
<line class="neural-edge" x1="300" y1="80" x2="500" y2="300" stroke="#00CEC9" stroke-width="0.5" stroke-opacity="0.03"/>
<line class="neural-edge" x1="300" y1="520" x2="500" y2="300" stroke="#00CEC9" stroke-width="0.5" stroke-opacity="0.03"/>
<!-- Edges L3→L4 -->
<line class="neural-edge" x1="500" y1="150" x2="720" y2="120" stroke="#81ECEC" stroke-width="0.5" stroke-opacity="0.05"/>
<line class="neural-edge" x1="500" y1="150" x2="720" y2="250" stroke="#81ECEC" stroke-width="0.5" stroke-opacity="0.04"/>
<line class="neural-edge" x1="500" y1="300" x2="720" y2="250" stroke="#81ECEC" stroke-width="0.5" stroke-opacity="0.05"/>
<line class="neural-edge" x1="500" y1="300" x2="720" y2="380" stroke="#81ECEC" stroke-width="0.5" stroke-opacity="0.05"/>
<line class="neural-edge" x1="500" y1="450" x2="720" y2="380" stroke="#81ECEC" stroke-width="0.5" stroke-opacity="0.04"/>
<line class="neural-edge" x1="500" y1="450" x2="720" y2="500" stroke="#81ECEC" stroke-width="0.5" stroke-opacity="0.05"/>
<!-- Edges L4→Output -->
<line class="neural-edge" x1="720" y1="120" x2="920" y2="200" stroke="#6C5CE7" stroke-width="0.5" stroke-opacity="0.05"/>
<line class="neural-edge" x1="720" y1="250" x2="920" y2="200" stroke="#6C5CE7" stroke-width="0.5" stroke-opacity="0.04"/>
<line class="neural-edge" x1="720" y1="380" x2="920" y2="400" stroke="#00CEC9" stroke-width="0.5" stroke-opacity="0.05"/>
<line class="neural-edge" x1="720" y1="500" x2="920" y2="400" stroke="#00CEC9" stroke-width="0.5" stroke-opacity="0.04"/>
<!-- Floating math annotations -->
<text x="60" y="60" fill="rgba(108,92,231,0.08)" font-family="monospace" font-size="11">f(x)=ax²+bx+c</text>
<text x="380" y="50" fill="rgba(0,206,201,0.07)" font-family="monospace" font-size="11">∇×E = -∂B/∂t</text>
<text x="800" y="60" fill="rgba(108,92,231,0.07)" font-family="monospace" font-size="11">∫₀^∞ e^(-x²) dx = √π/2</text>
<text x="100" y="580" fill="rgba(0,206,201,0.06)" font-family="monospace" font-size="10">σ(z) = 1/(1+e^(-z))</text>
<text x="550" y="580" fill="rgba(108,92,231,0.06)" font-family="monospace" font-size="10">∂L/∂w = ∑(ŷ-y)x</text>
<text x="900" y="560" fill="rgba(0,206,201,0.06)" font-family="monospace" font-size="10">P(A|B) = P(B|A)P(A)/P(B)</text>
</svg>
</div>
<div class="tech-hero-content fade-in">
<div class="section-label">Technical Deep Dive</div>
<h1>技术<span class="gradient-text">详解</span></h1>
<p>深入剖析 MathMate 的技术选型、设计思路、核心路径、迭代过程与开源参考。从 Flutter 原生可视化引擎到多模型协作 AI 流水线,完整呈现技术全貌。</p>
<div class="quick-nav">
<a href="#philosophy">设计思路</a>
<a href="#pipeline-deep">技术路径</a>
<a href="#libraries">外源库引用</a>
<a href="#models">AI 模型选型</a>
<a href="#iteration">迭代历程</a>
<a href="#testing">测试数据</a>
<a href="#opensource">开源参考</a>
<a href="#links">视频与链接</a>
</div>
<a href="https://github.com/mzk-C4/mathmate" target="_blank" rel="noopener" id="starBadge" style="display:inline-flex;align-items:center;gap:0.7rem;margin-top:1.8rem;padding:0.65rem 1.4rem;background:linear-gradient(135deg,rgba(108,92,231,0.18),rgba(0,206,201,0.12));border:1px solid rgba(108,92,231,0.4);border-radius:50px;text-decoration:none;color:var(--text);font-size:0.92rem;font-weight:600;transition:all 0.3s;backdrop-filter:blur(8px);box-shadow:0 4px 24px rgba(108,92,231,0.2);">
<svg width="18" height="18" viewBox="0 0 24 24" fill="#FDCB6E"><path d="M12 .587l3.668 7.431 8.2 1.192-5.934 5.787 1.401 8.168L12 18.896l-7.335 3.869 1.401-8.168L.132 9.21l8.2-1.192z"/></svg>
<span><b id="ghStars" style="color:#FDCB6E;font-size:1.05rem;">19</b> Stars</span>
<span style="color:var(--text-secondary);opacity:0.35;">·</span>
<span><b id="ghForks">2</b> Forks</span>
<span style="color:var(--text-secondary);opacity:0.35;">·</span>
<span style="padding:0.18rem 0.55rem;background:rgba(0,206,201,0.18);border-radius:6px;color:var(--accent);font-size:0.8rem;font-weight:700;">v2.3.1 Latest</span>
</a>
</div>
</section>
<script>
(function(){
fetch('https://api.github.com/repos/mzk-C4/mathmate')
.then(function(r){return r.json();})
.then(function(d){
if(d&&d.stargazers_count!=null){
var s=document.getElementById('ghStars'),f=document.getElementById('ghForks');
if(s)s.textContent=d.stargazers_count;
if(f)f.textContent=d.forks_count;
}
}).catch(function(){});
})();
</script>
<!-- ====== Section 1: 设计思路 ====== -->
<section class="section" id="philosophy">
<div class="section-formula-bg">
<div class="formula-watermark">E = mc² ∫ sin(x)dx = -cos(x)+C ∑(n=0→∞) xⁿ/n! = eˣ det(A) = |a₁₁ a₁₂; a₂₁ a₂₂| ∀ε>0 ∃δ>0 lim(n→∞) (1+1/n)ⁿ = e</div>
<div class="formula-watermark">Δ = b²-4ac cos²θ+sin²θ = 1 ∮ F·ds = ∫∫ (∇×F)·dA aⁿ·aᵐ = aⁿ⁺ᵐ log(ab) = log(a)+log(b) ∑(k=1→n) k = n(n+1)/2</div>
<div class="formula-watermark">dy/dx = lim(Δx→0) [f(x+Δx)-f(x)]/Δx |x| = √(x²) C(n,r) = n!/(r!(n-r)!) eⁱᶿ = cosθ+i·sinθ</div>
<div class="formula-watermark">∇f = (∂f/∂x, ∂f/∂y, ∂f/∂z) ∫∫∫ ρ dV = M P(A∪B) = P(A)+P(B)-P(A∩B) λ = h/p S = k·ln(W)</div>
</div>
<div class="container">
<div class="section-header fade-in">
<div class="header-glow"></div><div class="header-glow"></div><div class="header-glow"></div>
<div class="section-label">Design Philosophy</div>
<h2>设计思路与核心决策</h2>
<p>每一个技术选型背后都有明确的取舍逻辑</p>
</div>
<div class="philosophy-grid">
<div class="philosophy-card fade-in">
<h3><span class="philosophy-icon">🎯</span> Flutter 原生优先</h3>
<p>选择 Flutter 作为唯一前端框架,而非 React Native 或原生开发。核心考量:Canvas 绘图能力是几何可视化引擎的基石,Flutter 的 <code>CustomPaint</code> + <code>Canvas</code> API 提供了 60fps 的原生渲染性能,无需 WebView 中间层。一套代码覆盖 Android、iOS、Web、桌面全平台。</p>
</div>
<div class="philosophy-card fade-in">
<h3><span class="philosophy-icon">🧩</span> 无外部状态管理</h3>
<p>不引入 Provider、Riverpod、Bloc 等状态管理框架。全部使用 <code>StatefulWidget</code> + <code>setState</code>。理由:MathMate 的页面间数据流是单向的(拍照 → 识别 → 解题 → 展示),没有复杂的全局状态共享需求。减少依赖、降低复杂度、提升可维护性。</p>
</div>
<div class="philosophy-card fade-in">
<h3><span class="philosophy-icon">🔗</span> 自研可视化引擎</h3>
<p>拒绝使用现成图表库,从零构建 <code>GeometryPainter</code>。原因:通用图表库无法理解数学语义(如"动点在圆上滑动"的约束关系)。自研引擎实现了 <strong>GeometryJSON 协议</strong>——AI 输出结构化 JSON,引擎解析并渲染为交互式几何图形,形成"语义-图形"的完整闭环。</p>
</div>
<div class="philosophy-card fade-in">
<h3><span class="philosophy-icon">🤖</span> 多模型协作流水线</h3>
<p>没有将所有 AI 任务绑定到单一模型,而是根据各模型的优势分配任务:<strong>DeepSeek</strong> 负责数学推理(解题+可视化),<strong>火山引擎</strong> 负责多模态 OCR(手写/印刷识别),<strong>Qwen-PLUS</strong> 负责流式对话。每个模型在各自领域做到最优,整体效果超越单模型方案。</p>
</div>
<div class="philosophy-card fade-in">
<h3><span class="philosophy-icon">💾</span> 纯本地数据架构</h3>
<p>不依赖云数据库或后端服务器。全部数据存储在本地:<strong>Hive</strong> 用于结构化数据(搜题历史、对话记录),<strong>SharedPreferences</strong> 用于键值偏好(主题、年级、用户设置)。优势:零服务器成本、用户数据完全本地化、离线可用、隐私安全。</p>
</div>
</div>
</div>
</section>
<div class="section-divider"></div>
<!-- ====== Section 2: 技术路径 ====== -->
<section class="section" id="pipeline-deep">
<div class="section-bg-glow"></div>
<div class="container">
<div class="section-header fade-in">
<div class="header-glow"></div><div class="header-glow"></div><div class="header-glow"></div>
<div class="section-label">Technical Path</div>
<h2>核心技术路径</h2>
<p>从拍照到交互式可视化的三阶段 AI 流水线</p>
</div>
<div class="pipeline-detail">
<!-- Stage 1 -->
<div class="pipeline-stage fade-in">
<div class="stage-num s1">1</div>
<div class="stage-content">
<h3>多模态 OCR 识别</h3>
<p>用户拍照后,图片经过裁剪与预处理(自动透视校正、自适应锐化、背景二值化),送入火山引擎多模态 API。AI 将手写或印刷的数学公式、文字识别为结构化的 Markdown + LaTeX 文本。<code>SafeJsonParser</code> 容错处理 AI 返回的非标准 JSON(如 <code>Infinity</code>、<code>NaN</code>)。</p>
<div class="stage-tech">
<span>Volc Engine API</span>
<span>OcrService</span>
<span>SafeJsonParser</span>
<span>图像预处理管线</span>
</div>
</div>
</div>
<!-- Stage 2 -->
<div class="pipeline-stage fade-in">
<div class="stage-num s2">2</div>
<div class="stage-content">
<h3>AI 分步解题推理</h3>
<p>OCR 识别的数学文本送入 DeepSeek API,配合专门设计的解题 System Prompt(<code>solve_prompt.dart</code>)。AI 执行分步推理,输出完整的 Markdown 解题过程,包含 LaTeX 公式、步骤说明和最终答案。支持小学到大学各难度层级的数学题。</p>
<div class="stage-tech">
<span>DeepSeek API</span>
<span>SolverService</span>
<span>Chain-of-Thought 推理</span>
<span>专用 Prompt 模板</span>
</div>
</div>
</div>
<!-- Stage 3 -->
<div class="pipeline-stage fade-in">
<div class="stage-num s3">3</div>
<div class="stage-content">
<h3>GeometryJSON 可视化生成与渲染</h3>
<p>这是 MathMate 的技术核心。AI 将题目中的几何语义转化为结构化的 <strong>GeometryJSON</strong> 协议——定义视口(viewport)、几何元素(点、线、圆、椭圆、双曲线、抛物线)、动态约束(动点在曲线上滑动)。<code>GeometryValidator</code> 校验 JSON 合法性,<code>GeometryPainter</code> 使用纯 Dart Canvas 渲染为 60fps 交互式图形,支持手势拖拽动点。</p>
<div class="stage-tech">
<span>GeometryJSON 协议</span>
<span>VisualizationService</span>
<span>GeometryPainter</span>
<span>GeometryValidator</span>
<span>Constraint Solver</span>
<span>GestureDetector</span>
</div>
</div>
</div>
</div>
<!-- GeometryJSON Protocol Example -->
<div class="code-block fade-in" style="margin-top:2rem;">
<div class="code-label">// GeometryJSON 协议示例 — AI 输出的结构化几何描述</div>
<span class="code-key">{</span>
<span class="code-str">"viewport"</span>: { <span class="code-str">"xMin"</span>: <span class="code-num">-5</span>, <span class="code-str">"xMax"</span>: <span class="code-num">5</span>, <span class="code-str">"yMin"</span>: <span class="code-num">-5</span>, <span class="code-str">"yMax"</span>: <span class="code-num">5</span> },
<span class="code-str">"elements"</span>: [
{ <span class="code-str">"type"</span>: <span class="code-str">"point"</span>, <span class="code-str">"id"</span>: <span class="code-str">"A"</span>, <span class="code-str">"x"</span>: <span class="code-num">-3</span>, <span class="code-str">"y"</span>: <span class="code-num">0</span> },
{ <span class="code-str">"type"</span>: <span class="code-str">"point"</span>, <span class="code-str">"id"</span>: <span class="code-str">"B"</span>, <span class="code-str">"x"</span>: <span class="code-num">3</span>, <span class="code-str">"y"</span>: <span class="code-num">0</span> },
{ <span class="code-str">"type"</span>: <span class="code-str">"circle"</span>, <span class="code-str">"id"</span>: <span class="code-str">"c1"</span>, <span class="code-str">"cx"</span>: <span class="code-num">0</span>, <span class="code-str">"cy"</span>: <span class="code-num">0</span>, <span class="code-str">"r"</span>: <span class="code-num">3</span> },
{
<span class="code-str">"type"</span>: <span class="code-str">"dynamic_point"</span>, <span class="code-str">"id"</span>: <span class="code-str">"P"</span>,
<span class="code-str">"constraint"</span>: { <span class="code-str">"target"</span>: <span class="code-str">"c1"</span>, <span class="code-str">"param"</span>: <span class="code-num">0.785</span> }
<span class="code-comment">// 动点P约束在圆c1上,可拖拽交互</span>
}
]
<span class="code-key">}</span>
</div>
<!-- Visualization Engine Architecture -->
<div class="section-header fade-in" style="margin-top:4rem;">
<div class="section-label">Visualization Engine</div>
<h2>自研可视化引擎架构</h2>
<p>纯 Dart + Flutter Canvas,零 WebView 依赖,原生 60fps</p>
</div>
<div class="compare-grid">
<div class="compare-card fade-in">
<h4>📐 数据模型层</h4>
<ul>
<li>抽象 <code>GeoElement</code> 基类</li>
<li><code>GeoPoint</code> — 静态点(固定坐标)</li>
<li><code>GeoCircle</code> — 圆(圆心+半径)</li>
<li><code>DynamicPoint</code> — 动点(含约束目标 ID + 参数化位置)</li>
<li>支持:线、椭圆、双曲线、抛物线</li>
</ul>
</div>
<div class="compare-card accent fade-in">
<h4>🔄 约束求解器</h4>
<ul>
<li>用户拖拽动点时触发约束求解</li>
<li>计算动点在约束目标上的最近合法位置</li>
<li>投影到圆弧 / 线段 / 曲线</li>
<li>纯 Dart 数学计算,无外部依赖</li>
<li>实时 <code>setState</code> 触发重绘</li>
</ul>
</div>
<div class="compare-card fade-in">
<h4>🎨 交互式渲染器</h4>
<ul>
<li><code>CustomPaint</code> + <code>GestureDetector</code></li>
<li>触摸查找最近动点 → 拖拽 → 约束求解 → 重绘</li>
<li>坐标系自动缩放适配 viewport</li>
<li>60fps 原生帧率</li>
<li>支持缩放、平移手势</li>
</ul>
</div>
</div>
<!-- Four-phase implementation -->
<div style="margin-top:3rem;" class="fade-in">
<h3 style="text-align:center;font-size:1.1rem;margin-bottom:1.5rem;">可视化引擎四阶段实现路径</h3>
<div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:1rem;">
<div style="padding:1.5rem;background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);border-top:3px solid #6C5CE7;">
<div style="font-size:0.75rem;color:var(--primary-light);font-weight:700;margin-bottom:0.3rem;">Phase 1</div>
<h4 style="font-size:0.95rem;margin-bottom:0.3rem;">JSON 协议定义</h4>
<p style="font-size:0.82rem;color:var(--text-secondary);">设计 LLM 友好的 GeometryJSON Schema,包含 viewport、elements、constraint 语义</p>
</div>
<div style="padding:1.5rem;background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);border-top:3px solid #00CEC9;">
<div style="font-size:0.75rem;color:var(--accent);font-weight:700;margin-bottom:0.3rem;">Phase 2</div>
<h4 style="font-size:0.95rem;margin-bottom:0.3rem;">Prompt 工程</h4>
<p style="font-size:0.82rem;color:var(--text-secondary);">注入"几何翻译家"System Prompt,强制 AI 输出严格格式的 GeometryJSON</p>
</div>
<div style="padding:1.5rem;background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);border-top:3px solid #FF6B6B;">
<div style="font-size:0.75rem;color:#FF6B6B;font-weight:700;margin-bottom:0.3rem;">Phase 3</div>
<h4 style="font-size:0.95rem;margin-bottom:0.3rem;">Flutter 引擎实现</h4>
<p style="font-size:0.82rem;color:var(--text-secondary);">CustomPainter 渲染 + GestureDetector 交互 + 约束求解器</p>
</div>
<div style="padding:1.5rem;background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);border-top:3px solid #FDCB6E;">
<div style="font-size:0.75rem;color:#FDCB6E;font-weight:700;margin-bottom:0.3rem;">Phase 4</div>
<h4 style="font-size:0.95rem;margin-bottom:0.3rem;">UI/UX 打磨</h4>
<p style="font-size:0.82rem;color:var(--text-secondary);">流式渲染、触觉反馈、实时 LaTeX 标签、异常降级处理</p>
</div>
</div>
</div>
</div>
</section>
<div class="section-divider"></div>
<!-- ====== Section 3: 外源库引用 ====== -->
<section class="section" id="libraries">
<div class="container">
<div class="section-header fade-in">
<div class="header-glow"></div><div class="header-glow"></div><div class="header-glow"></div>
<div class="section-label">External Libraries</div>
<h2>外源库引用清单</h2>
<p>所有第三方依赖均经过选型评估,按需引入</p>
</div>
<h3 class="fade-in" style="font-size:1.05rem;margin-top:2rem;margin-bottom:0.8rem;display:flex;align-items:center;gap:0.5rem;">
<span style="width:8px;height:8px;border-radius:50%;background:#6C5CE7;"></span>
核心框架
</h3>
<table class="lib-table fade-in">
<thead>
<tr><th>库名</th><th>版本</th><th>用途</th></tr>
</thead>
<tbody>
<tr><td class="lib-name">Flutter SDK</td><td class="lib-version">Dart ^3.11.3</td><td>跨平台 UI 框架,Android / iOS / Web / Desktop 全平台构建</td></tr>
<tr><td class="lib-name">flutter_localizations</td><td class="lib-version">SDK 内置</td><td>多语言本地化支持(zh_CN / en_US)</td></tr>
<tr><td class="lib-name">cupertino_icons</td><td class="lib-version">^1.0.8</td><td>iOS 风格图标集(CupertinoIcons)</td></tr>
<tr><td class="lib-name">http</td><td class="lib-version">^1.1.0</td><td>HTTP 客户端,调用 DeepSeek / 火山引擎 / Qwen API</td></tr>
<tr><td class="lib-name">path</td><td class="lib-version">^1.9.1</td><td>跨平台路径操作工具(文件路径拼接、解析)</td></tr>
<tr><td class="lib-name">flutter_dotenv</td><td class="lib-version">^5.2.1</td><td>从 <code>.env</code> 文件加载 API 密钥,安全隔离敏感配置</td></tr>
</tbody>
</table>
<h3 class="fade-in" style="font-size:1.05rem;margin-top:2rem;margin-bottom:0.8rem;display:flex;align-items:center;gap:0.5rem;">
<span style="width:8px;height:8px;border-radius:50%;background:#00CEC9;"></span>
AI 与数据处理
</h3>
<table class="lib-table fade-in">
<thead>
<tr><th>库名</th><th>版本</th><th>用途</th></tr>
</thead>
<tbody>
<tr><td class="lib-name">flutter_math_fork</td><td class="lib-version">^0.7.2+1</td><td>LaTeX / MathML 数学公式渲染(计划迁移至 flutter_tex)</td></tr>
<tr><td class="lib-name">flutter_markdown_plus</td><td class="lib-version">^1.0.7</td><td>Markdown 内容渲染,支持代码高亮和 LaTeX 行内公式</td></tr>
<tr><td class="lib-name">image</td><td class="lib-version">^4.5.4</td><td>图像处理库,用于拍照后的裁剪、缩放、预处理</td></tr>
</tbody>
</table>
<h3 class="fade-in" style="font-size:1.05rem;margin-top:2rem;margin-bottom:0.8rem;display:flex;align-items:center;gap:0.5rem;">