2025-09-08 15:38:06 +08:00
|
|
|
/* 引入 Tailwind v4 内建样式与工具 */
|
2025-09-06 16:21:21 +08:00
|
|
|
@import "tailwindcss";
|
|
|
|
|
|
2025-10-16 15:32:26 +08:00
|
|
|
/* 覆盖 Tailwind v4 默认的 dark 变体为"类选择器"模式 */
|
2025-09-08 15:38:06 +08:00
|
|
|
@custom-variant dark (&:where(.dark, .dark *));
|
|
|
|
|
|
2025-10-16 15:32:26 +08:00
|
|
|
/* shadcn/ui 主题变量 - 蓝色主题 */
|
|
|
|
|
@layer base {
|
|
|
|
|
:root {
|
|
|
|
|
--background: 0 0% 100%;
|
|
|
|
|
--foreground: 240 10% 3.9%;
|
|
|
|
|
--card: 0 0% 100%;
|
|
|
|
|
--card-foreground: 240 10% 3.9%;
|
|
|
|
|
--popover: 0 0% 100%;
|
|
|
|
|
--popover-foreground: 240 10% 3.9%;
|
|
|
|
|
|
|
|
|
|
/* 主色调:蓝色 (bg-blue-500) */
|
|
|
|
|
--primary: 217 91% 60%;
|
|
|
|
|
--primary-foreground: 0 0% 100%;
|
|
|
|
|
|
|
|
|
|
/* 次要色:淡蓝灰 */
|
|
|
|
|
--secondary: 240 4.8% 95.9%;
|
|
|
|
|
--secondary-foreground: 240 5.9% 10%;
|
|
|
|
|
|
|
|
|
|
/* 强调色 */
|
|
|
|
|
--muted: 240 4.8% 95.9%;
|
|
|
|
|
--muted-foreground: 240 3.8% 46.1%;
|
|
|
|
|
--accent: 240 4.8% 95.9%;
|
|
|
|
|
--accent-foreground: 240 5.9% 10%;
|
|
|
|
|
|
|
|
|
|
/* 危险色:红色 */
|
|
|
|
|
--destructive: 0 84.2% 60.2%;
|
|
|
|
|
--destructive-foreground: 0 0% 98%;
|
|
|
|
|
|
|
|
|
|
/* 边框和输入框 */
|
|
|
|
|
--border: 240 5.9% 90%;
|
|
|
|
|
--input: 240 5.9% 90%;
|
|
|
|
|
--ring: 217 91% 60%;
|
|
|
|
|
|
|
|
|
|
--radius: 0.5rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.dark {
|
|
|
|
|
--background: 240 10% 3.9%;
|
|
|
|
|
--foreground: 0 0% 98%;
|
|
|
|
|
--card: 240 10% 3.9%;
|
|
|
|
|
--card-foreground: 0 0% 98%;
|
|
|
|
|
--popover: 240 10% 3.9%;
|
|
|
|
|
--popover-foreground: 0 0% 98%;
|
|
|
|
|
|
|
|
|
|
/* 暗色模式主色调:稍深的蓝色 (bg-blue-600) */
|
|
|
|
|
--primary: 217 91% 55%;
|
|
|
|
|
--primary-foreground: 0 0% 100%;
|
|
|
|
|
|
|
|
|
|
--secondary: 240 3.7% 15.9%;
|
|
|
|
|
--secondary-foreground: 0 0% 98%;
|
|
|
|
|
|
|
|
|
|
--muted: 240 3.7% 15.9%;
|
|
|
|
|
--muted-foreground: 240 5% 64.9%;
|
|
|
|
|
--accent: 240 3.7% 15.9%;
|
|
|
|
|
--accent-foreground: 0 0% 98%;
|
|
|
|
|
|
|
|
|
|
/* 暗色模式危险色 */
|
|
|
|
|
--destructive: 0 62.8% 30.6%;
|
|
|
|
|
--destructive-foreground: 0 0% 98%;
|
|
|
|
|
|
|
|
|
|
--border: 240 3.7% 15.9%;
|
|
|
|
|
--input: 240 3.7% 15.9%;
|
|
|
|
|
--ring: 217 91% 55%;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-08 11:48:05 +08:00
|
|
|
/* 全局基础样式 */
|
2025-08-04 22:16:26 +08:00
|
|
|
* {
|
|
|
|
|
box-sizing: border-box;
|
2025-10-16 15:32:26 +08:00
|
|
|
border-color: hsl(var(--border));
|
2025-08-04 22:16:26 +08:00
|
|
|
}
|
|
|
|
|
|
2025-09-06 16:21:21 +08:00
|
|
|
html {
|
2025-09-08 11:48:05 +08:00
|
|
|
@apply font-sans antialiased;
|
2025-09-06 16:21:21 +08:00
|
|
|
line-height: 1.5;
|
2025-09-08 15:57:29 +08:00
|
|
|
/* 让原生控件与滚动条随主题切换配色 */
|
|
|
|
|
color-scheme: light;
|
2025-08-04 22:16:26 +08:00
|
|
|
}
|
|
|
|
|
|
2025-09-06 16:21:21 +08:00
|
|
|
body {
|
2025-10-16 15:32:26 +08:00
|
|
|
@apply m-0 p-0 text-sm;
|
|
|
|
|
background-color: hsl(var(--background));
|
|
|
|
|
color: hsl(var(--foreground));
|
2025-09-06 16:21:21 +08:00
|
|
|
}
|
|
|
|
|
|
2025-09-08 15:57:29 +08:00
|
|
|
/* 暗色模式下启用暗色原生控件/滚动条配色 */
|
2025-09-13 15:36:43 +08:00
|
|
|
html.dark {
|
|
|
|
|
color-scheme: dark;
|
|
|
|
|
}
|
2025-09-08 15:57:29 +08:00
|
|
|
|
2025-09-13 15:38:23 +08:00
|
|
|
/* 滚动条样式(避免在伪元素中使用自定义 dark 变体,消除构建警告) */
|
2025-09-13 15:48:14 +08:00
|
|
|
::-webkit-scrollbar {
|
|
|
|
|
width: 0.375rem;
|
|
|
|
|
height: 0.375rem;
|
|
|
|
|
}
|
|
|
|
|
::-webkit-scrollbar-track {
|
|
|
|
|
background-color: #f4f4f5;
|
|
|
|
|
}
|
|
|
|
|
html.dark ::-webkit-scrollbar-track {
|
|
|
|
|
background-color: #27272a;
|
|
|
|
|
}
|
|
|
|
|
::-webkit-scrollbar-thumb {
|
|
|
|
|
background-color: #d4d4d8;
|
|
|
|
|
border-radius: 0.25rem;
|
|
|
|
|
}
|
|
|
|
|
html.dark ::-webkit-scrollbar-thumb {
|
|
|
|
|
background-color: #52525b;
|
|
|
|
|
}
|
|
|
|
|
::-webkit-scrollbar-thumb:hover {
|
|
|
|
|
background-color: #a1a1aa;
|
|
|
|
|
}
|
|
|
|
|
html.dark ::-webkit-scrollbar-thumb:hover {
|
|
|
|
|
background-color: #71717a;
|
|
|
|
|
}
|
2025-08-10 19:13:45 +08:00
|
|
|
|
2025-09-06 16:21:21 +08:00
|
|
|
/* 焦点样式 */
|
|
|
|
|
*:focus-visible {
|
2025-09-08 11:48:05 +08:00
|
|
|
@apply outline-2 outline-blue-500 outline-offset-2;
|
2025-08-10 19:13:45 +08:00
|
|
|
}
|