22@tailwind components;
33@tailwind utilities;
44
5- /* Light mode (default) */
6- : root {
7- --surface-dim : # DED8E1 ;
8- --surface : # FFFBFE ;
9- --surface-container : # F3EDF7 ;
10- --surface-container-high : # ECE6F0 ;
11- --surface-container-highest : # E6E0E9 ;
12- --primary : # 6750A4 ;
13- --primary-container : # EADDFF ;
14- --primary-container-high : # D0BCFF ;
15- --on-primary : # 21005D ;
16- --on-surface : # 1C1B1F ;
17- --on-surface-variant : # 49454F ;
18- --outline : # 79747E ;
19- --outline-variant : # CAC4D0 ;
20- --success : # 006C4E ;
21- --danger : # BA1A1A ;
22- --warning : # 8B5000 ;
23- --body-bg : # FFFBFE ;
24- --body-color : # 1C1B1F ;
5+ /* ===== 基础样式 ===== */
6+ html {
7+ scroll-behavior : smooth;
258}
269
27- /* Dark mode */
28- .dark {
29- --surface-dim : # 0f0f0f ;
30- --surface : # 1C1B1F ;
31- --surface-container : # 211F26 ;
32- --surface-container-high : # 2B2930 ;
33- --surface-container-highest : # 36343B ;
34- --primary : # d0bcff ;
35- --primary-container : # 4F378B ;
36- --primary-container-high : # 5A4694 ;
37- --on-primary : # 381E72 ;
38- --on-surface : # E6E1E5 ;
39- --on-surface-variant : # CAC4D0 ;
40- --outline : # 938F99 ;
41- --outline-variant : # 49454F ;
42- --success : # 8BD3A8 ;
43- --danger : # F2B8B5 ;
44- --warning : # F9CB9C ;
45- --body-bg : # 0f0f0f ;
46- --body-color : # E6E1E5 ;
10+ body {
11+ background-color : # 141218 ;
12+ color : # E6E1E5 ;
13+ font-feature-settings : 'kern' 1 , 'liga' 1 ;
14+ -webkit-font-smoothing : antialiased;
15+ -moz-osx-font-smoothing : grayscale;
4716}
4817
49- html {
50- scroll-behavior : smooth;
18+ /* ===== 选中文字样式 ===== */
19+ ::selection {
20+ background-color : rgba (208 , 188 , 255 , 0.3 );
21+ color : # E8DEF8 ;
5122}
5223
53- body {
54- background-color : var (--body-bg );
55- color : var (--body-color );
56- transition : background-color 0.3s ease, color 0.2s ease;
24+ /* ===== M3 Elevation ===== */
25+ @layer utilities {
26+ .elevation-0 { box-shadow : none; }
27+ .elevation-1 { box-shadow : 0 1px 3px 1px rgba (0 , 0 , 0 , 0.15 ), 0 1px 2px 0 rgba (0 , 0 , 0 , 0.3 ); }
28+ .elevation-2 { box-shadow : 0 2px 6px 2px rgba (0 , 0 , 0 , 0.15 ), 0 1px 2px 0 rgba (0 , 0 , 0 , 0.3 ); }
29+ .elevation-3 { box-shadow : 0 4px 8px 3px rgba (0 , 0 , 0 , 0.15 ), 0 1px 3px 0 rgba (0 , 0 , 0 , 0.3 ); }
5730}
5831
32+ /* ===== 动画 ===== */
5933@keyframes shimmer {
6034 0% { background-position : -200% 0 ; }
6135 100% { background-position : 200% 0 ; }
@@ -65,15 +39,100 @@ body {
6539 animation : shimmer 1.5s infinite;
6640 background : linear-gradient (
6741 90deg ,
68- rgba (128 , 128 , 128 , 0.1 ) 25% ,
69- rgba (128 , 128 , 128 , 0.2 ) 50% ,
70- rgba (128 , 128 , 128 , 0.1 ) 75%
42+ rgba (255 , 255 , 255 , 0.04 ) 25% ,
43+ rgba (255 , 255 , 255 , 0.1 ) 50% ,
44+ rgba (255 , 255 , 255 , 0.04 ) 75%
7145 );
7246 background-size : 200% 100% ;
7347}
7448
75- /* M3 Elevation */
76- .elevation-0 { box-shadow : none; }
77- .elevation-1 { box-shadow : 0 1px 3px rgba (0 , 0 , 0 , 0.12 ); }
78- .elevation-2 { box-shadow : 0 4px 8px rgba (0 , 0 , 0 , 0.12 ); }
79- .elevation-3 { box-shadow : 0 8px 24px rgba (0 , 0 , 0 , 0.16 ); }
49+ /* ===== 标题样式优化 ===== */
50+ h1 , h2 , h3 , h4 , h5 , h6 {
51+ text-wrap : balance;
52+ }
53+
54+ /* ===== 段落样式优化 ===== */
55+ p {
56+ text-wrap : pretty;
57+ }
58+
59+ /* ===== 响应式字体(按比例缩放)=====
60+ * 使用 clamp(min, preferred, max) 实现动态缩放
61+ * preferred 使用 vw 单位,让字体随视口宽度缩放
62+ *
63+ * 示例:clamp(32px, 4vw, 64px)
64+ * → 最小 32px,最大 64px,中间值按视口宽度 4% 缩放
65+ */
66+ @layer utilities {
67+ /* Hero 标题:32px - 80px */
68+ .text-responsive-hero {
69+ font-size : clamp (2rem , 5vw , 5rem );
70+ line-height : 1.15 ;
71+ }
72+
73+ /* 章节标题:28px - 48px */
74+ .text-responsive-section {
75+ font-size : clamp (1.75rem , 3.5vw , 3rem );
76+ line-height : 1.2 ;
77+ }
78+
79+ /* 副标题:16px - 24px */
80+ .text-responsive-subtitle {
81+ font-size : clamp (1rem , 2vw , 1.5rem );
82+ line-height : 1.6 ;
83+ }
84+
85+ /* 正文:14px - 18px */
86+ .text-responsive-body {
87+ font-size : clamp (0.875rem , 1.5vw , 1.125rem );
88+ line-height : 1.7 ;
89+ }
90+
91+ /* 按钮:16px - 20px */
92+ .text-responsive-button {
93+ font-size : clamp (1rem , 1.8vw , 1.25rem );
94+ }
95+
96+ /* 卡片标题:16px - 20px */
97+ .text-responsive-card {
98+ font-size : clamp (1rem , 1.8vw , 1.25rem );
99+ }
100+
101+ /* 小字:12px - 14px */
102+ .text-responsive-small {
103+ font-size : clamp (0.75rem , 1.2vw , 0.875rem );
104+ }
105+ }
106+
107+ /* ===== 响应式间距(按比例缩放)===== */
108+ @layer utilities {
109+ /* 章节上下间距:64px - 128px */
110+ .py-responsive-section {
111+ padding-top : clamp (4rem , 8vw , 8rem );
112+ padding-bottom : clamp (4rem , 8vw , 8rem );
113+ }
114+
115+ /* 卡片内边距:24px - 48px */
116+ .p-responsive-card {
117+ padding : clamp (1.5rem , 3vw , 3rem );
118+ }
119+
120+ /* 按钮内边距:16px - 32px */
121+ .px-responsive-button {
122+ padding-left : clamp (1rem , 2vw , 2rem );
123+ padding-right : clamp (1rem , 2vw , 2rem );
124+ }
125+
126+ .py-responsive-button {
127+ padding-top : clamp (0.75rem , 1.5vw , 1.25rem );
128+ padding-bottom : clamp (0.75rem , 1.5vw , 1.25rem );
129+ }
130+ }
131+
132+ /* ===== 响应式容器宽度 ===== */
133+ @layer utilities {
134+ /* 自适应容器:600px - 1200px */
135+ .max-w-responsive {
136+ max-width : clamp (37.5rem , 75vw , 75rem );
137+ }
138+ }
0 commit comments