@import "tailwindcss"; /** * Tailwind CSS v4 主题配置 * 使用 @theme 指令定义主题变量 */ @theme { --color-primary-50: var(--primary-50); --color-primary-100: var(--primary-100); --color-primary-200: var(--primary-200); --color-primary-300: var(--primary-300); --color-primary-400: var(--primary-400); --color-primary-500: var(--primary-500); --color-primary-600: var(--primary-600); --color-primary-700: var(--primary-700); --color-primary-800: var(--primary-800); --color-primary-900: var(--primary-900); --color-primary-950: var(--primary-950); /* 中性色 */ --color-gray-50: #f9fafb; --color-gray-100: #f3f4f6; --color-gray-200: #e5e7eb; --color-gray-300: #d1d5db; --color-gray-400: #9ca3af; --color-gray-500: #6b7280; --color-gray-600: #4b5563; --color-gray-700: #374151; --color-gray-800: #1f2937; --color-gray-900: #111827; --color-gray-950: #030712; /* 语义色 - Success */ --color-success-50: #f0fdf4; --color-success-100: #dcfce7; --color-success-200: #bbf7d0; --color-success-300: #86efac; --color-success-400: #4ade80; --color-success-500: #22c55e; --color-success-600: #16a34a; --color-success-700: #15803d; --color-success-800: #166534; --color-success-900: #14532d; --color-success-950: #052e16; /* 语义色 - Warning */ --color-warning-50: #fffbeb; --color-warning-100: #fef3c7; --color-warning-200: #fde68a; --color-warning-300: #fcd34d; --color-warning-400: #fbbf24; --color-warning-500: #f59e0b; --color-warning-600: #d97706; --color-warning-700: #b45309; --color-warning-800: #92400e; --color-warning-900: #78350f; --color-warning-950: #451a03; /* 语义色 - Error */ --color-error-50: #fef2f2; --color-error-100: #fee2e2; --color-error-200: #fecaca; --color-error-300: #fca5a5; --color-error-400: #f87171; --color-error-500: #ef4444; --color-error-600: #dc2626; --color-error-700: #b91c1c; --color-error-800: #991b1b; --color-error-900: #7f1d1d; --color-error-950: #450a0a; /* 语义色 - Info */ --color-info-50: #eff6ff; --color-info-100: #dbeafe; --color-info-200: #bfdbfe; --color-info-300: #93c5fd; --color-info-400: #60a5fa; --color-info-500: #3b82f6; --color-info-600: #2563eb; --color-info-700: #1d4ed8; --color-info-800: #1e40af; --color-info-900: #1e3a8a; --color-info-950: #172554; /* 圆角 - 更小的圆角 */ --radius-xs: 0.125rem; --radius-sm: 0.25rem; --radius-md: 0.375rem; --radius-lg: 0.5rem; --radius-xl: 0.625rem; --radius-2xl: 0.75rem; --radius-3xl: 1rem; --radius-full: 9999px; } /** * Design System CSS 变量 * * 定义全局 CSS 变量用于主题切换和动态样式 */ :root { /* 主题色 - 默认 Teal */ --primary-50: #f0f9f8; --primary-100: #e0f2f0; --primary-200: #bce6e1; --primary-300: #8dd4cc; --primary-400: #5ec2b7; --primary-500: #35786f; --primary-600: #2a605b; --primary-700: #1f4844; --primary-800: #183835; --primary-900: #122826; --primary-950: #0a1413; /* 基础颜色 */ --background: #ffffff; --foreground: #111827; --foreground-secondary: #4b5563; --foreground-tertiary: #6b7280; --foreground-disabled: #9ca3af; /* 背景 */ --background-secondary: #f3f4f6; --background-tertiary: #e5e7eb; /* 边框 */ --border: #d1d5db; --border-secondary: #e5e7eb; --border-focus: #35786f; /* 圆角 - 更小的圆角 */ --radius-xs: 0.125rem; --radius-sm: 0.25rem; --radius-md: 0.375rem; --radius-lg: 0.5rem; --radius-xl: 0.625rem; --radius-2xl: 0.75rem; --radius-3xl: 1rem; --radius-full: 9999px; /* 阴影 */ --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05); --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1); --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25); --shadow-primary: 0 4px 14px 0 rgba(53, 120, 111, 0.39); /* 间距 */ --spacing-xs: 0.25rem; --spacing-sm: 0.5rem; --spacing-md: 1rem; --spacing-lg: 1.5rem; --spacing-xl: 2rem; --spacing-2xl: 3rem; /* 过渡 */ --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1); --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1); --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1); } /** * 全局基础样式 */ * { box-sizing: border-box; } html { height: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } body { height: 100%; margin: 0; padding: 0; background: var(--primary-50); color: var(--foreground); font-family: var(--font-geist-sans), -apple-system, BlinkMacSystemFont, system-ui, sans-serif; font-size: 1rem; line-height: 1.5; text-rendering: optimizeLegibility; } /** * 代码块字体 */ .code-block, code, kbd, pre, samp { font-family: var(--font-geist-mono), ui-monospace, SFMono-Regular, Monaco, Consolas, monospace; } /** * 导航栏按钮样式 */ .navbar-btn { @apply border-0 bg-transparent hover:bg-black/30 shadow-none; transition: background-color var(--transition-fast); } /** * 焦点可见性优化 */ :focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; } /** * 选择文本样式 */ ::selection { background-color: var(--color-primary-200); color: var(--color-primary-900); } /** * 滚动条样式 */ ::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-track { background: var(--background-secondary); } ::-webkit-scrollbar-thumb { background: var(--foreground-tertiary); border-radius: var(--radius-full); } ::-webkit-scrollbar-thumb:hover { background: var(--foreground-secondary); }