返回 AiToEarn
globals.css
根目录 / project / aitoearn-web / src / app / globals.css
1 @import 'tailwindcss';
2 @import '../assets/fonts/font.css';
3
4 @plugin 'tailwindcss-animate';
5
6 @custom-variant dark (&:is(.dark *));
7
8 html,
9 body {
10 height: 100%;
11 overflow: hidden;
12 }
13
14 /* Welcome 页面样式隔离 - 防止全局污染 */
15 html:not(.welcome-page-active) {
16 font-size: 100% !important;
17 }
18
19 body {
20 font-family: Suisseintl, sans-serif;
21 }
22
23 button {
24 cursor: pointer;
25 }
26
27 @theme inline {
28 --breakpoint-3xl: 1400px;
29 --radius-sm: calc(var(--radius) - 4px);
30 --radius-md: calc(var(--radius) - 2px);
31 --radius-lg: var(--radius);
32 --radius-xl: calc(var(--radius) + 4px);
33 --radius-2xl: calc(var(--radius) + 8px);
34 --radius-3xl: calc(var(--radius) + 12px);
35 --radius-4xl: calc(var(--radius) + 16px);
36 --color-background: var(--background);
37 --color-foreground: var(--foreground);
38 --color-card: var(--card);
39 --color-card-foreground: var(--card-foreground);
40 --color-popover: var(--popover);
41 --color-popover-foreground: var(--popover-foreground);
42 --color-primary: var(--primary);
43 --color-primary-foreground: var(--primary-foreground);
44 --color-secondary: var(--secondary);
45 --color-secondary-foreground: var(--secondary-foreground);
46 --color-muted: var(--muted);
47 --color-muted-foreground: var(--muted-foreground);
48 --color-accent: var(--accent);
49 --color-accent-foreground: var(--accent-foreground);
50 --color-destructive: var(--destructive);
51 --color-destructive-foreground: var(--destructive-foreground);
52 --color-success: var(--success);
53 --color-success-foreground: var(--success-foreground);
54 --color-warning: var(--warning);
55 --color-warning-foreground: var(--warning-foreground);
56 --color-info: var(--info);
57 --color-info-foreground: var(--info-foreground);
58 --color-brand-purple: var(--brand-purple);
59 --color-brand-cyan: var(--brand-cyan);
60 --color-gradient-foreground: var(--gradient-foreground);
61 --color-border: var(--border);
62 --color-input: var(--input);
63 --color-ring: var(--ring);
64 --background-image-gradient-back: var(--gradientBackColor);
65 --color-chart-1: var(--chart-1);
66 --color-chart-2: var(--chart-2);
67 --color-chart-3: var(--chart-3);
68 --color-chart-4: var(--chart-4);
69 --color-chart-5: var(--chart-5);
70 --color-sidebar: var(--sidebar);
71 --color-sidebar-foreground: var(--sidebar-foreground);
72 --color-sidebar-primary: var(--sidebar-primary);
73 --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
74 --color-sidebar-accent: var(--sidebar-accent);
75 --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
76 --color-sidebar-border: var(--sidebar-border);
77 --color-sidebar-ring: var(--sidebar-ring);
78 }
79
80 :root {
81 --gradientBackColor: linear-gradient(to right in oklch, var(--brand-purple), var(--brand-cyan));
82 /* 品牌色 */
83 --brand-purple: oklch(0.74 0.17 3);
84 --brand-cyan: oklch(0.71 0.17 294);
85 --gradient-foreground: oklch(0.985 0 0);
86 /* Section 交替背景色 */
87 --section-alt-bg: #f8f9fa;
88
89 --radius: 0.625rem;
90 --background: oklch(1 0 0);
91 --foreground: oklch(0.145 0 0);
92 --card: oklch(1 0 0);
93 --card-foreground: oklch(0.145 0 0);
94 --popover: oklch(1 0 0);
95 --popover-foreground: oklch(0.145 0 0);
96 --primary: var(--brand-cyan);
97 --primary-foreground: var(--gradient-foreground);
98 --secondary: oklch(0.97 0 0);
99 --secondary-foreground: oklch(0.205 0 0);
100 --muted: oklch(0.97 0 0);
101 --muted-foreground: oklch(0.556 0 0);
102 --accent: oklch(0.97 0 0);
103 --accent-foreground: oklch(0.205 0 0);
104 --destructive: oklch(0.577 0.245 27.325);
105 --destructive-foreground: oklch(0.985 0 0);
106 --success: oklch(0.65 0.2 145);
107 --success-foreground: oklch(0.985 0 0);
108 --warning: oklch(0.75 0.18 70);
109 --warning-foreground: oklch(0.2 0 0);
110 --info: oklch(0.6 0.18 250);
111 --info-foreground: oklch(0.985 0 0);
112 --border: oklch(0.922 0 0);
113 --input: oklch(0.922 0 0);
114 --ring: var(--brand-cyan);
115 --chart-1: oklch(0.646 0.222 41.116);
116 --chart-2: oklch(0.6 0.118 184.704);
117 --chart-3: oklch(0.398 0.07 227.392);
118 --chart-4: oklch(0.828 0.189 84.429);
119 --chart-5: oklch(0.769 0.188 70.08);
120 --sidebar: color-mix(in oklch, var(--brand-cyan) 3%, var(--background));
121 --sidebar-foreground: var(--foreground);
122 --sidebar-primary: var(--brand-cyan);
123 --sidebar-primary-foreground: var(--gradient-foreground);
124 --sidebar-accent: color-mix(in oklch, var(--brand-cyan) 10%, var(--background));
125 --sidebar-accent-foreground: var(--foreground);
126 --sidebar-border: color-mix(in oklch, var(--border) 50%, transparent);
127 --sidebar-ring: var(--brand-cyan);
128 }
129
130 .dark {
131 --gradient-foreground: oklch(0.985 0 0);
132 --section-alt-bg: rgba(255, 255, 255, 0.03);
133 --background: oklch(0.145 0 0);
134 --foreground: oklch(0.985 0 0);
135 --card: oklch(0.205 0 0);
136 --card-foreground: oklch(0.985 0 0);
137 --popover: oklch(0.205 0 0);
138 --popover-foreground: oklch(0.985 0 0);
139 --primary: var(--brand-purple);
140 --primary-foreground: var(--gradient-foreground);
141 --secondary: oklch(0.269 0 0);
142 --secondary-foreground: oklch(0.985 0 0);
143 --muted: oklch(0.269 0 0);
144 --muted-foreground: oklch(0.708 0 0);
145 --accent: oklch(0.269 0 0);
146 --accent-foreground: oklch(0.985 0 0);
147 --destructive: oklch(0.704 0.191 22.216);
148 --destructive-foreground: oklch(0.985 0 0);
149 --success: oklch(0.7 0.2 145);
150 --success-foreground: oklch(0.15 0 0);
151 --warning: oklch(0.8 0.18 70);
152 --warning-foreground: oklch(0.15 0 0);
153 --info: oklch(0.65 0.18 250);
154 --info-foreground: oklch(0.985 0 0);
155 --border: oklch(1 0 0 / 10%);
156 --input: oklch(1 0 0 / 15%);
157 --ring: var(--brand-cyan);
158 --chart-1: oklch(0.488 0.243 264.376);
159 --chart-2: oklch(0.696 0.17 162.48);
160 --chart-3: oklch(0.769 0.188 70.08);
161 --chart-4: oklch(0.627 0.265 303.9);
162 --chart-5: oklch(0.645 0.246 16.439);
163 --sidebar: color-mix(in oklch, var(--brand-cyan) 7%, var(--background));
164 --sidebar-foreground: var(--foreground);
165 --sidebar-primary: var(--brand-cyan);
166 --sidebar-primary-foreground: var(--gradient-foreground);
167 --sidebar-accent: color-mix(in oklch, var(--brand-cyan) 14%, var(--background));
168 --sidebar-accent-foreground: var(--foreground);
169 --sidebar-border: color-mix(in oklch, var(--border) 50%, transparent);
170 --sidebar-ring: var(--brand-cyan);
171 }
172
173 @layer base {
174 * {
175 @apply border-border;
176 }
177 body {
178 @apply bg-background text-foreground text-sm;
179 }
180 *:focus-visible {
181 @apply outline-2 outline-offset-2 outline-ring;
182 }
183 }
184
185 @layer components {
186 .publish-topic-mention {
187 display: inline;
188 align-items: center;
189 margin-inline: 0.0625rem;
190 padding: 0 0.0625rem 0.0625rem;
191 vertical-align: baseline;
192 color: color-mix(in oklch, var(--brand-cyan) 76%, var(--foreground));
193 border-radius: calc(var(--radius-sm) + 1px);
194 background: linear-gradient(90deg, var(--brand-cyan), var(--brand-purple)) 0 100% / 100% 0.08em
195 no-repeat;
196 -webkit-box-decoration-break: clone;
197 box-decoration-break: clone;
198 line-height: inherit;
199 transition:
200 background 0.18s ease,
201 color 0.18s ease;
202 }
203
204 .publish-topic-mention_trigger {
205 color: color-mix(in oklch, var(--brand-purple) 62%, var(--brand-cyan));
206 font-weight: 700;
207 }
208
209 .publish-topic-mention_value {
210 color: color-mix(in oklch, var(--brand-cyan) 76%, var(--foreground));
211 font-weight: 600;
212 }
213
214 .publish-topic-mention-focused {
215 padding-inline: 0.25rem;
216 background:
217 linear-gradient(var(--background), var(--background)) padding-box,
218 var(--gradientBackColor) border-box;
219 box-shadow: 0 0 0 1px color-mix(in oklch, var(--brand-cyan) 34%, transparent);
220 }
221
222 .publish-topic-mention-focused .publish-topic-mention_trigger,
223 .publish-topic-mention-focused .publish-topic-mention_value {
224 color: color-mix(in oklch, var(--brand-cyan) 82%, var(--foreground));
225 }
226 }
227
228 body > div {
229 pointer-events: auto;
230 }
231
232 /* 添加账号Modal响应式优化 */
233 .add-account-responsive-modal {
234 /* 移动端优化 - 确保内容占满宽度 */
235 @media (max-width: 640px) {
236 /* 针对 shadcn Dialog 的移动端样式 */
237 & [role='dialog'] {
238 padding: 16px !important;
239 }
240 }
241 }
242
243 /* 自定义滚动条 - 细节优化 */
244 @layer utilities {
245 .scrollbar-thin {
246 scrollbar-width: thin;
247 }
248
249 .scrollbar-thumb-gray-300 {
250 scrollbar-color: #d1d5db #f3f4f6;
251 }
252
253 .scrollbar-track-gray-100 {
254 /* 用于scrollbar-color的第二个值 */
255 }
256
257 .scrollbar-none {
258 scrollbar-width: none;
259 -ms-overflow-style: none;
260 &::-webkit-scrollbar {
261 display: none;
262 }
263 }
264 }
265
266 /* Webkit浏览器滚动条优化 */
267 .add-account-responsive-modal ::-webkit-scrollbar {
268 width: 6px;
269 height: 6px;
270 }
271
272 .add-account-responsive-modal ::-webkit-scrollbar-track {
273 background: #f3f4f6;
274 border-radius: 10px;
275 }
276
277 .add-account-responsive-modal ::-webkit-scrollbar-thumb {
278 background: #d1d5db;
279 border-radius: 10px;
280 transition: background 0.2s;
281 }
282
283 .add-account-responsive-modal ::-webkit-scrollbar-thumb:hover {
284 background: #9ca3af;
285 }
286
287 /* 定价页面响应式布局 - 1400px 以上显示4列 */
288 @media (min-width: 1400px) {
289 .pricing-grid-4 {
290 grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
291 }
292 }
293
294 /* Shimmer 渐变动画 - 用于骨架屏 loading 效果 */
295 @keyframes shimmer {
296 0% {
297 background-position: 200% 0;
298 }
299 100% {
300 background-position: -200% 0;
301 }
302 }
303
304 .animate-shimmer {
305 animation: shimmer 2s ease-in-out infinite;
306 }
307
308 /* 隐藏浏览器默认的密码显示按钮 */
309 input::-ms-reveal,
310 input::-ms-clear {
311 display: none;
312 }
313
314 /* TaskDetail 动画 */
315 @keyframes pulse-ring {
316 0% {
317 opacity: 0.6;
318 transform: scale(0.8);
319 }
320 100% {
321 opacity: 0;
322 transform: scale(2);
323 }
324 }
325
326 @keyframes fade-in-up {
327 from {
328 opacity: 0;
329 transform: translateY(12px);
330 }
331 to {
332 opacity: 1;
333 transform: translateY(0);
334 }
335 }
336
337 @keyframes td-shimmer {
338 0% {
339 transform: translateX(-100%);
340 }
341 100% {
342 transform: translateX(100%);
343 }
344 }
345
345 lines CSS