-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathindex.html
More file actions
3169 lines (3048 loc) · 111 KB
/
index.html
File metadata and controls
3169 lines (3048 loc) · 111 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" data-theme="light">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- ── SEO: primary ────────────────────────────── -->
<title>
SQL 转 ER 图在线工具 · Chen 模型生成器 | SQL / DBML to ER Diagram — sql2er
</title>
<meta
name="description"
content="免费在线 SQL 转 ER 图工具:把 CREATE TABLE 建表语句或 DBML 一键生成 Chen 模型实体-关系图。纯前端运行,数据不出浏览器,无需登录、不埋点;支持 PostgreSQL / MySQL / SQLite 语法,节点可拖动、双击改名,可导出 SVG / PNG。Free online tool to convert SQL & DBML into Chen-model ER diagrams, 100% client-side and open source."
/>
<meta
name="keywords"
content="SQL 转 ER 图, SQL 转 ER 图在线工具, 免费 SQL 转 ER 图,ER 图生成器, ER图在线生成, 实体关系图, Chen 模型, 陈氏模型, 数据库建模工具, CREATE TABLE 可视化, DBML 转 ER 图, 数据库 ER 图, PostgreSQL ER 图, MySQL ER 图, SQLite ER 图, 开源 ER 工具, sql2er, SQL to ER diagram, ER diagram generator, Chen model ERD, DBML to ER, database diagram, entity relationship diagram, free ER tool, open source ERD, PostgreSQL ER diagram, MySQL ER diagram"
/>
<meta name="author" content="ystemsrx" />
<meta
name="robots"
content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1"
/>
<meta
name="googlebot"
content="index, follow, max-image-preview:large, max-snippet:-1"
/>
<meta name="bingbot" content="index, follow" />
<meta
name="theme-color"
content="#ECE9E0"
media="(prefers-color-scheme: light)"
/>
<meta
name="theme-color"
content="#1A1916"
media="(prefers-color-scheme: dark)"
/>
<meta name="format-detection" content="telephone=no" />
<meta name="referrer" content="strict-origin-when-cross-origin" />
<meta name="application-name" content="sql2er" />
<meta name="apple-mobile-web-app-title" content="sql2er" />
<link rel="canonical" href="https://ystemsrx.github.io/sql_to_ER/" />
<link
rel="alternate"
hreflang="zh-CN"
href="https://ystemsrx.github.io/sql_to_ER/"
/>
<link
rel="alternate"
hreflang="en"
href="https://ystemsrx.github.io/sql_to_ER/"
/>
<link
rel="alternate"
hreflang="x-default"
href="https://ystemsrx.github.io/sql_to_ER/"
/>
<!-- ── SEO: Open Graph ─────────────────────────── -->
<meta property="og:type" content="website" />
<meta property="og:site_name" content="sql2er · SQL 转 ER 图" />
<meta
property="og:title"
content="SQL 转 ER 图在线工具 · Chen 模型生成器 | SQL / DBML to ER Diagram"
/>
<meta
property="og:description"
content="把 SQL CREATE TABLE 或 DBML 一键转成 Chen 模型 ER 图,纯前端、开源、免登录。Turn SQL / DBML into Chen-model ER diagrams — free, open source, 100% client-side."
/>
<meta property="og:url" content="https://ystemsrx.github.io/sql_to_ER/" />
<meta
property="og:image"
content="https://ystemsrx.github.io/sql_to_ER/assets/eg1.png"
/>
<meta
property="og:image:alt"
content="sql2er 生成的 Chen 模型 ER 图示例 / Example Chen-model ER diagram produced by sql2er"
/>
<meta property="og:locale" content="zh_CN" />
<meta property="og:locale:alternate" content="en_US" />
<!-- ── SEO: Twitter Card ────────────────────────── -->
<meta name="twitter:card" content="summary_large_image" />
<meta
name="twitter:title"
content="SQL 转 ER 图在线工具 · Chen 模型生成器 | sql2er"
/>
<meta
name="twitter:description"
content="把 SQL / DBML 一键生成 Chen 模型 ER 图,纯前端、开源、免登录。Free online SQL & DBML → Chen-model ER diagram generator."
/>
<meta
name="twitter:image"
content="https://ystemsrx.github.io/sql_to_ER/assets/eg1.png"
/>
<meta
name="twitter:image:alt"
content="sql2er 生成的 Chen 模型 ER 图示例"
/>
<meta name="twitter:creator" content="@ystemsrx" />
<!-- ── SEO: Schema.org JSON-LD ──────────────────── -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
"name": "sql2er · SQL 转 ER 图",
"alternateName": [
"sql2er",
"SQL to ER diagram",
"SQL / DBML → ER Diagram Generator",
"SQL 转 ER 图在线工具",
"Chen 模型 ER 图生成器",
"数据库 ER 图生成器"
],
"description": "免费开源、纯前端的 SQL / DBML 转 Chen 模型 ER 图在线工具。Free, open-source, pure front-end tool that converts SQL CREATE TABLE statements and DBML into Chen-model ER diagrams.",
"url": "https://ystemsrx.github.io/sql_to_ER/",
"image": "https://ystemsrx.github.io/sql_to_ER/assets/eg1.png",
"applicationCategory": "DeveloperApplication",
"applicationSubCategory": "Database tool",
"operatingSystem": "Any (browser)",
"browserRequirements": "Requires JavaScript. Requires HTML5.",
"offers": { "@type": "Offer", "price": "0", "priceCurrency": "USD" },
"license": "https://www.gnu.org/licenses/agpl-3.0.html",
"author": {
"@type": "Person",
"name": "ystemsrx",
"url": "https://github.com/ystemsrx"
},
"codeRepository": "https://github.com/ystemsrx/sql_to_ER",
"inLanguage": ["zh-CN", "en"],
"keywords": "SQL 转 ER 图, ER 图生成器, Chen 模型, DBML, 数据库建模, CREATE TABLE 可视化, SQL to ER diagram, DBML to ER, entity relationship diagram, open source ERD",
"featureList": [
"解析 SQL CREATE TABLE 建表语句 / Parse SQL CREATE TABLE statements",
"解析 DBML(Database Markup Language)/ Parse DBML",
"生成 Chen 模型 ER 图(实体 / 关系 / 属性)/ Generate Chen-model ER diagrams",
"力导向自动布局(force2)/ Force-directed auto layout",
"节点拖拽编辑 / Drag-and-drop node editing",
"双击重命名 / Double-click rename",
"智能布局与对齐 / Smart layout and force-align",
"导出 SVG / 图片 / Export as SVG / image",
"100% 浏览器本地运行,不上传数据 / 100% client-side, no upload"
]
}
</script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebSite",
"name": "sql2er · SQL 转 ER 图",
"url": "https://ystemsrx.github.io/sql_to_ER/",
"inLanguage": ["zh-CN", "en"],
"publisher": {
"@type": "Person",
"name": "ystemsrx",
"url": "https://github.com/ystemsrx"
}
}
</script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "sql2er 是什么?/ What is sql2er?",
"acceptedAnswer": {
"@type": "Answer",
"text": "sql2er 是一个免费开源、纯前端的在线工具,可以把 SQL CREATE TABLE 建表语句或 DBML 一键转换成 Chen 模型的实体-关系(ER)图。sql2er is a free, open-source, pure front-end tool that turns SQL or DBML into Chen-model ER diagrams."
}
},
{
"@type": "Question",
"name": "数据会被上传到服务器吗?/ Is my SQL uploaded anywhere?",
"acceptedAnswer": {
"@type": "Answer",
"text": "不会。所有解析和渲染都在浏览器本地完成,SQL 内容不会离开你的设备。No. All parsing and rendering happen in your browser — your SQL never leaves your device."
}
},
{
"@type": "Question",
"name": "支持哪些数据库方言?/ Which SQL dialects are supported?",
"acceptedAnswer": {
"@type": "Answer",
"text": "支持常见的 PostgreSQL、MySQL、SQLite 等 CREATE TABLE 语法,也支持 DBML。Common PostgreSQL / MySQL / SQLite CREATE TABLE syntax is supported, as well as DBML."
}
}
]
}
</script>
<!-- ── GEO: AI / LLM crawler policy ─────────────── -->
<!--
Generative Engine Optimization (GEO):显式允许主流 AI 检索 / 训练爬虫抓取,
让 ChatGPT / Claude / Perplexity / Gemini / You.com / Arc Search 等
生成式引擎可以正确引用本页内容。
-->
<meta name="GPTBot" content="index, follow" />
<meta name="ChatGPT-User" content="index, follow" />
<meta name="OAI-SearchBot" content="index, follow" />
<meta name="ClaudeBot" content="index, follow" />
<meta name="Claude-Web" content="index, follow" />
<meta name="anthropic-ai" content="index, follow" />
<meta name="PerplexityBot" content="index, follow" />
<meta name="Perplexity-User" content="index, follow" />
<meta name="Google-Extended" content="index, follow" />
<meta name="GoogleOther" content="index, follow" />
<meta name="Applebot" content="index, follow" />
<meta name="Applebot-Extended" content="index, follow" />
<meta name="Amazonbot" content="index, follow" />
<meta name="CCBot" content="index, follow" />
<meta name="Bytespider" content="index, follow" />
<meta name="DuckAssistBot" content="index, follow" />
<meta name="YouBot" content="index, follow" />
<meta name="cohere-ai" content="index, follow" />
<meta name="Diffbot" content="index, follow" />
<meta name="Meta-ExternalAgent" content="index, follow" />
<meta name="MistralAI-User" content="index, follow" />
<!-- ── GEO: AI 引用 / 抽取友好型摘要 ────────────── -->
<!--
下列 meta 提供给生成式引擎一份「直接可引用」的事实陈述,
包含产品名、能力、隐私属性、协议、维护者、规范链接。
-->
<meta
name="abstract"
content="sql2er 是一个免费、开源(AGPL-3.0)、纯前端的在线工具,可将 SQL CREATE TABLE 语句或 DBML 一键转换为 Chen 模型的实体-关系(ER)图。所有解析与渲染均在浏览器本地完成,SQL 不上传任何服务器,支持 PostgreSQL / MySQL / SQLite 语法以及 DBML,可导出 SVG / PNG。"
/>
<meta
name="summary"
content="sql2er = 在线 SQL/DBML → Chen 模型 ER 图生成器;100% 客户端运行;开源 AGPL-3.0;作者 ystemsrx;仓库 https://github.com/ystemsrx/sql_to_ER。"
/>
<meta name="topic" content="数据库建模, ER 图, Chen 模型, SQL 可视化, DBML" />
<meta name="category" content="Developer Tools / Database Modeling" />
<meta name="audience" content="软件工程师, 数据库设计师, 学生, 教师, 数据分析师" />
<meta name="rating" content="general" />
<meta name="distribution" content="global" />
<meta name="coverage" content="worldwide" />
<meta name="language" content="zh-CN, en" />
<meta
name="ai-content-declaration"
content="human-authored; open-source project; safe to cite; canonical URL https://ystemsrx.github.io/sql_to_ER/"
/>
<meta
name="generative-ai-policy"
content="allow-indexing; allow-citation; require-attribution-to=ystemsrx; canonical=https://ystemsrx.github.io/sql_to_ER/"
/>
<meta
name="usage-terms"
content="Source code is licensed under AGPL-3.0. The hosted web app is free to use without registration; no data is collected."
/>
<!-- ── GEO: Schema.org HowTo(步骤化指南,便于 AI 引用「怎么用」) ── -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "HowTo",
"name": "如何用 sql2er 把 SQL 转成 Chen 模型 ER 图 / How to convert SQL to a Chen-model ER diagram with sql2er",
"description": "使用 sql2er 在浏览器中把 CREATE TABLE 语句或 DBML 转换为 Chen 模型实体-关系图的完整步骤。Step-by-step guide to turn SQL CREATE TABLE statements or DBML into a Chen-model ER diagram entirely in the browser.",
"inLanguage": ["zh-CN", "en"],
"totalTime": "PT1M",
"tool": [
{ "@type": "HowToTool", "name": "现代浏览器 / Modern web browser" }
],
"supply": [
{
"@type": "HowToSupply",
"name": "SQL CREATE TABLE 建表语句或 DBML 文本 / SQL CREATE TABLE statements or DBML text"
}
],
"step": [
{
"@type": "HowToStep",
"position": 1,
"name": "打开 sql2er / Open sql2er",
"text": "在浏览器中访问 https://ystemsrx.github.io/sql_to_ER/ 。无需注册或登录。Open https://ystemsrx.github.io/sql_to_ER/ in any modern browser. No sign-up required.",
"url": "https://ystemsrx.github.io/sql_to_ER/"
},
{
"@type": "HowToStep",
"position": 2,
"name": "粘贴 SQL 或 DBML / Paste SQL or DBML",
"text": "把 CREATE TABLE 建表语句或 DBML 粘贴到左侧编辑器。支持 PostgreSQL / MySQL / SQLite 常见方言。Paste your CREATE TABLE statements or DBML into the left-hand editor. PostgreSQL / MySQL / SQLite syntax and DBML are supported."
},
{
"@type": "HowToStep",
"position": 3,
"name": "生成 ER 图 / Generate the ER diagram",
"text": "工具会在本地解析并以力导向布局自动渲染 Chen 模型 ER 图,节点可拖动、双击重命名。The tool parses your input locally and renders a Chen-model ER diagram with force-directed layout; nodes are draggable and can be renamed by double-clicking."
},
{
"@type": "HowToStep",
"position": 4,
"name": "导出 SVG / PNG / Export as SVG or PNG",
"text": "通过工具栏导出按钮把图保存为 SVG 或 PNG。Use the export button in the toolbar to save the diagram as SVG or PNG."
}
]
}
</script>
<!-- ── GEO: BreadcrumbList ─────────────────────── -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "https://ystemsrx.github.io/"
},
{
"@type": "ListItem",
"position": 2,
"name": "sql2er · SQL 转 ER 图",
"item": "https://ystemsrx.github.io/sql_to_ER/"
}
]
}
</script>
<!-- ── GEO: TechArticle(让 LLM 把本页当作可引用的技术参考) ── -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "TechArticle",
"headline": "把 SQL / DBML 转成 Chen 模型 ER 图:sql2er 使用与原理 / Convert SQL & DBML to Chen-model ER Diagrams with sql2er",
"description": "sql2er 是一个免费、开源、纯前端的在线工具,把 SQL CREATE TABLE 语句或 DBML 转换为 Chen 模型的实体-关系图,支持力导向布局、节点编辑与 SVG / PNG 导出。",
"url": "https://ystemsrx.github.io/sql_to_ER/",
"image": "https://ystemsrx.github.io/sql_to_ER/assets/eg1.png",
"inLanguage": ["zh-CN", "en"],
"isAccessibleForFree": true,
"keywords": "SQL 转 ER 图, Chen 模型, DBML, 数据库建模, ER diagram, entity relationship diagram, ERD, sql2er",
"about": [
{ "@type": "Thing", "name": "实体-关系模型 / Entity–relationship model" },
{ "@type": "Thing", "name": "Chen 模型 / Chen notation" },
{ "@type": "Thing", "name": "DBML / Database Markup Language" },
{ "@type": "Thing", "name": "SQL CREATE TABLE" }
],
"audience": {
"@type": "Audience",
"audienceType": "software engineers, database designers, students, data analysts"
},
"author": {
"@type": "Person",
"name": "ystemsrx",
"url": "https://github.com/ystemsrx",
"sameAs": ["https://github.com/ystemsrx"]
},
"publisher": {
"@type": "Person",
"name": "ystemsrx",
"url": "https://github.com/ystemsrx"
},
"license": "https://www.gnu.org/licenses/agpl-3.0.html",
"citation": [
{
"@type": "CreativeWork",
"name": "Chen, Peter Pin-Shan. The Entity-Relationship Model—Toward a Unified View of Data. ACM TODS, 1976.",
"url": "https://doi.org/10.1145/320434.320440"
},
{
"@type": "SoftwareSourceCode",
"name": "DBML — Database Markup Language",
"url": "https://dbml.dbdiagram.io/"
}
],
"mainEntityOfPage": "https://ystemsrx.github.io/sql_to_ER/"
}
</script>
<!-- ── GEO: Organization / Person sameAs(知识图谱锚点) ── -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Person",
"name": "ystemsrx",
"url": "https://github.com/ystemsrx",
"sameAs": [
"https://github.com/ystemsrx",
"https://github.com/ystemsrx/sql_to_ER"
],
"knowsAbout": [
"SQL",
"DBML",
"Entity-Relationship Modeling",
"Chen Notation",
"Data Visualization",
"Front-end Engineering"
]
}
</script>
<!-- ── Favicon (inline SVG, network/diagram icon) ── -->
<link
rel="icon"
type="image/svg+xml"
href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23D97757' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='16' y='16' width='6' height='6' rx='1'/%3E%3Crect x='2' y='16' width='6' height='6' rx='1'/%3E%3Crect x='9' y='2' width='6' height='6' rx='1'/%3E%3Cpath d='M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3'/%3E%3Cpath d='M12 12V8'/%3E%3C/svg%3E"
/>
<!-- 先字体,后 base -->
<link rel="stylesheet" href="./assets/fonts/fonts.css" />
<link rel="stylesheet" href="./assets/base.css" />
<style>
/* ─── 主题变量 ───────────────── */
[data-theme="light"] {
--bg: var(--color-bg-base);
--bg-raised: var(--color-bg-raised);
--bg-overlay: var(--color-bg-overlay);
--ink: var(--color-text-primary);
--ink-2: var(--color-text-secondary);
--ink-3: var(--color-text-muted);
--hair: var(--color-border-subtle);
--rule: var(--color-border-default);
--invert-bg: #141413;
--invert-ink: #faf9f5;
--invert-ink-2: #a9a69c;
--invert-hair: #2b2a26;
}
[data-theme="dark"] {
--bg: #1a1916;
--bg-raised: #222119;
--bg-overlay: #2a2822;
--ink: #eae7dc;
--ink-2: #a9a69c;
--ink-3: #6b6860;
--hair: #2e2d27;
--rule: #3a3830;
--invert-bg: #faf9f5;
--invert-ink: #141413;
--invert-ink-2: #4f4c45;
--invert-hair: #d8d5cc;
}
html,
body {
background: var(--bg);
color: var(--ink);
font-family: var(--font-heading-cn);
transition:
background var(--duration-slow) var(--ease-default),
color var(--duration-slow) var(--ease-default);
}
::selection {
background: var(--color-accent-orange);
color: #fff;
}
/* 单一暖色晕染,克制 */
body::before {
content: "";
position: fixed;
inset: 0;
z-index: -1;
pointer-events: none;
background: radial-gradient(
ellipse 60% 50% at 15% 0%,
rgba(217, 119, 87, 0.09) 0%,
transparent 55%
);
}
[data-theme="dark"] body::before {
background: radial-gradient(
ellipse 60% 50% at 15% 0%,
rgba(217, 119, 87, 0.12) 0%,
transparent 55%
);
}
/* 排版 */
.display {
font-family: var(--font-display-cn);
font-weight: var(--weight-regular);
line-height: var(--leading-cn-tight);
letter-spacing: -0.01em;
}
.display em {
font-style: italic;
color: var(--color-accent-warm);
}
.eyebrow {
font-family: var(--font-heading);
font-size: var(--text-xs);
font-weight: var(--weight-medium);
letter-spacing: 0.14em;
text-transform: uppercase;
color: var(--ink-2);
display: inline-flex;
align-items: center;
gap: 10px;
}
.eyebrow::before {
content: "";
width: 24px;
height: 1px;
background: var(--rule);
}
/* ─── 导航 ───────────── */
.nav {
position: sticky;
top: 0;
z-index: 50;
backdrop-filter: saturate(180%) blur(14px);
-webkit-backdrop-filter: saturate(180%) blur(14px);
background: color-mix(in srgb, var(--bg) 80%, transparent);
border-bottom: 1px solid transparent;
transition: border-color var(--duration-normal) var(--ease-default);
}
.nav.is-scrolled {
border-bottom-color: var(--hair);
}
.nav-row {
max-width: var(--max-width-full);
margin: 0 auto;
padding: 16px clamp(var(--space-6), 5vw, var(--space-16));
display: grid;
grid-template-columns: auto 1fr auto;
align-items: center;
gap: 24px;
}
.brand {
display: inline-flex;
align-items: center;
gap: 10px;
color: var(--ink);
}
.brand-mark {
width: 32px;
height: 32px;
border-radius: 50%;
background: var(--color-accent-orange);
display: grid;
place-items: center;
color: #fff;
box-shadow: 0 4px 10px rgba(217, 119, 87, 0.28);
transition: transform var(--duration-normal) var(--ease-bounce);
}
.brand:hover .brand-mark {
transform: rotate(-8deg) scale(1.05);
}
.brand-mark svg {
width: 16px;
height: 16px;
}
.brand-name {
font-family: var(--font-display);
font-style: italic;
font-size: 1.15rem;
letter-spacing: -0.01em;
white-space: nowrap;
}
.nav-links {
justify-self: center;
display: flex;
gap: 4px;
}
.nav-links a {
font-family: var(--font-heading);
font-size: 0.88rem;
font-weight: 500;
color: var(--ink-2);
padding: 8px 14px;
border-radius: 999px;
transition:
color var(--duration-fast) var(--ease-default),
background var(--duration-fast) var(--ease-default);
}
.nav-links a:hover {
color: var(--ink);
background: var(--bg-raised);
}
.nav-actions {
display: flex;
gap: 8px;
align-items: center;
}
.icon-btn {
width: 36px;
height: 36px;
border-radius: 999px;
border: 1px solid var(--rule);
color: var(--ink-2);
cursor: pointer;
display: grid;
place-items: center;
background: transparent;
transition: all var(--duration-fast) var(--ease-default);
}
.icon-btn:hover {
color: var(--ink);
border-color: var(--color-accent-orange);
background: var(--bg-raised);
}
.icon-btn svg {
width: 15px;
height: 15px;
}
@media (max-width: 820px) {
.nav-links {
display: none;
}
}
/* ─── 按钮 ───────────── */
.btn {
display: inline-flex;
align-items: center;
gap: 10px;
padding: 13px 22px;
border-radius: 999px;
font-family: var(--font-heading);
font-weight: 500;
font-size: 0.95rem;
letter-spacing: 0.01em;
border: 1px solid transparent;
cursor: pointer;
transition:
transform var(--duration-fast) var(--ease-default),
background var(--duration-normal) var(--ease-default),
color var(--duration-normal) var(--ease-default),
box-shadow var(--duration-normal) var(--ease-default);
}
.btn svg {
width: 16px;
height: 16px;
}
.btn-primary {
background: var(--color-accent-orange);
color: #fff;
box-shadow: 0 6px 18px rgba(217, 119, 87, 0.28);
}
.btn-primary:hover {
transform: translateY(-2px);
background: var(--color-accent-warm);
box-shadow: 0 10px 26px rgba(201, 100, 66, 0.4);
}
.btn-ghost {
background: transparent;
color: var(--ink);
border-color: var(--rule);
}
.btn-ghost:hover {
transform: translateY(-2px);
border-color: var(--ink);
background: var(--bg-raised);
}
/* ─── Hero ───────────── */
.hero {
padding-block: clamp(32px, 4vw, 56px) clamp(40px, 5vw, 72px);
}
.hero-grid {
max-width: var(--max-width-full);
margin: 0 auto;
padding-inline: clamp(var(--space-6), 5vw, var(--space-16));
display: grid;
grid-template-columns: 1fr 1fr;
gap: clamp(32px, 5vw, 64px);
align-items: center;
}
@media (max-width: 960px) {
.hero-grid {
grid-template-columns: 1fr;
}
}
.hero-title {
font-size: clamp(2.2rem, 5.4vw, 4.2rem);
margin-top: var(--space-6);
margin-bottom: var(--space-5);
}
.hero-title .line-2 {
display: block;
margin-left: clamp(0px, 3vw, 36px);
}
.hero-lead {
font-family: var(--font-body-cn);
font-size: clamp(1.02rem, 1.4vw, 1.18rem);
color: var(--ink-2);
line-height: var(--leading-cn-loose);
max-width: 28em;
margin-bottom: var(--space-8);
}
.hero-cta {
display: flex;
flex-wrap: wrap;
gap: 12px;
}
/* ─── Hero 右侧:真实 ER 图 ─── */
.er-stage {
position: relative;
aspect-ratio: 5 / 4;
background: var(--bg-raised);
border: 1px solid var(--hair);
border-radius: var(--radius-xl);
overflow: hidden;
box-shadow: var(--shadow-elevated);
}
.er-chip {
position: absolute;
top: 14px;
left: 14px;
z-index: 2;
pointer-events: none; /* 不拦截画布交互 */
font-family: var(--font-heading);
font-size: 0.72rem;
font-weight: 500;
letter-spacing: 0.08em;
color: var(--ink-2);
display: inline-flex;
align-items: center;
gap: 8px;
padding: 6px 12px;
border-radius: 999px;
background: color-mix(in srgb, var(--bg-overlay) 85%, transparent);
border: 1px solid var(--hair);
backdrop-filter: blur(8px);
}
.er-chip::before {
content: "";
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--color-accent-orange);
box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.22);
animation: blink 1.8s ease-in-out infinite;
}
@keyframes blink {
0%,
100% {
opacity: 1;
transform: scale(1);
}
50% {
opacity: 0.4;
transform: scale(0.85);
}
}
.er-reset {
position: absolute;
top: 14px;
right: 14px;
z-index: 2;
width: 34px;
height: 34px;
border-radius: 50%;
background: color-mix(in srgb, var(--bg-overlay) 85%, transparent);
border: 1px solid var(--hair);
color: var(--ink-2);
cursor: pointer;
display: grid;
place-items: center;
backdrop-filter: blur(8px);
transition:
color var(--duration-fast) var(--ease-default),
border-color var(--duration-fast) var(--ease-default),
transform 500ms var(--ease-default);
}
.er-reset:hover {
color: var(--color-accent-warm);
border-color: var(--color-accent-orange);
transform: rotate(-180deg);
}
.er-reset:active {
transform: rotate(-360deg);
}
.er-reset > svg {
width: 13px;
height: 13px;
display: block;
fill: currentColor;
}
#hero-er {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
opacity: 1;
transition: opacity 260ms var(--ease-default);
}
#hero-er canvas {
display: block;
}
/* 构建期间:瞬间隐藏,避免用户看到未 fit 的大图一闪;
移除该类后走 transition 平滑淡入 */
.er-stage.is-building #hero-er {
opacity: 0;
transition: none;
}
.er-fallback {
position: absolute;
inset: 0;
display: grid;
place-items: center;
color: var(--ink-3);
font-family: var(--font-heading);
font-size: 0.85rem;
opacity: 0;
pointer-events: none; /* 关键:opacity:0 不会自动禁用 pointer-events,必须显式加 */
transition: opacity var(--duration-normal) var(--ease-default);
}
.er-stage.is-failed .er-fallback {
opacity: 1;
pointer-events: auto;
}
/* ─── 区块 ───────────── */
section {
padding-block: clamp(40px, 5vw, 72px) clamp(48px, 6vw, 88px);
position: relative;
}
.container {
max-width: var(--max-width-layout);
margin: 0 auto;
padding-inline: clamp(var(--space-6), 5vw, var(--space-16));
}
.section-head {
margin-bottom: clamp(28px, 3.5vw, 48px);
max-width: 36em;
}
.section-head h2 {
font-family: var(--font-display-cn);
font-weight: var(--weight-regular);
font-size: clamp(1.9rem, 4vw, 2.8rem);
line-height: var(--leading-cn-tight);
letter-spacing: -0.01em;
margin-top: var(--space-3);
margin-bottom: var(--space-4);
}
.section-head h2 em {
font-style: italic;
color: var(--color-accent-warm);
}
.section-head p {
font-family: var(--font-body-cn);
color: var(--ink-2);
font-size: 1.05rem;
line-height: var(--leading-cn-loose);
max-width: 28em;
}
/* ─── 特性(四条,编辑式)─── */
.features {
display: grid;
grid-template-columns: repeat(2, 1fr);
column-gap: clamp(32px, 4vw, 64px);
row-gap: clamp(28px, 3.5vw, 48px);
}
@media (max-width: 720px) {
.features {
grid-template-columns: 1fr;
}
}
.feat {
display: grid;
grid-template-columns: auto 1fr;
gap: 20px;
padding-top: var(--space-5);
border-top: 1px solid var(--hair);
}
.feat-num {
font-family: var(--font-display);
font-style: italic;
font-size: 1.2rem;
color: var(--color-accent-warm);
line-height: 1;
padding-top: 4px;
}
.feat h3 {
font-family: var(--font-heading-cn);
font-weight: var(--weight-semibold);
font-size: 1.1rem;
margin-bottom: 8px;
letter-spacing: -0.005em;
}
.feat p {
font-family: var(--font-body-cn);
color: var(--ink-2);
font-size: 0.98rem;
line-height: var(--leading-cn-loose);
}
/* ─── Demo ─── */
.demo-card {
background: var(--bg-raised);
border: 1px solid var(--hair);
border-radius: var(--radius-xl);
overflow: hidden;
}
.demo-bar {
display: flex;
align-items: center;
gap: 6px;
padding: 12px 16px;
background: var(--bg-overlay);
border-bottom: 1px solid var(--hair);
}
.tab {
padding: 7px 14px;
border-radius: 999px;
font-family: var(--font-heading);
font-size: 0.85rem;
font-weight: 500;
color: var(--ink-2);
cursor: pointer;
background: transparent;
border: 1px solid transparent;
transition: all var(--duration-fast) var(--ease-default);
display: inline-flex;
align-items: center;
gap: 8px;
}
.tab:hover {
color: var(--ink);
}
.tab.is-active {
color: var(--color-accent-warm);
background: color-mix(
in srgb,
var(--color-accent-orange) 10%,
transparent
);
border-color: color-mix(
in srgb,
var(--color-accent-orange) 30%,
transparent
);
}
.demo-actions {
margin-left: auto;
display: flex;
gap: 8px;
}
.mini-btn {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 6px 12px;
border-radius: 999px;
font-family: var(--font-heading);
font-size: 0.8rem;
font-weight: 500;
color: var(--ink-2);
background: transparent;
border: 1px solid var(--rule);
cursor: pointer;
transition: all var(--duration-fast) var(--ease-default);
}
.mini-btn:hover {
color: var(--color-accent-warm);
border-color: var(--color-accent-orange);
}
.mini-btn svg {
width: 13px;
height: 13px;
}
.code-panel {
display: none;
}
.code-panel.is-active {
display: block;
}
.code-panel pre {
margin: 0 !important;
padding: clamp(20px, 2.5vw, 32px) clamp(20px, 3vw, 36px) !important;
background: transparent !important;
font-family: var(--font-mono) !important;
font-size: 0.9rem !important;
line-height: 1.7 !important;
max-height: 360px;
overflow: auto;
}
.code-panel code {
font-family: var(--font-mono) !important;
}
.demo-foot {
padding: 12px 20px;
border-top: 1px solid var(--hair);
background: color-mix(
in srgb,
var(--color-accent-orange) 5%,
transparent
);
font-family: var(--font-body-cn);
font-size: 0.9rem;
color: var(--ink-2);
display: flex;
align-items: center;
gap: 10px;
}
/* Prism 覆写(暖色)*/