@tailwind base; @tailwind components; @tailwind utilities; @layer base { :root { /* 更新为毛玻璃风格的颜色变量 */ --background: 240 10% 98%; --foreground: 240 10% 3.9%; --card: 240 10% 100%; --card-foreground: 240 10% 3.9%; --popover: 240 10% 100%; --popover-foreground: 240 10% 3.9%; --primary: 240 5.9% 10%; --primary-foreground: 240 5.9% 98%; --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: 240 5.9% 10%; --radius: 0.75rem; } .dark { --background: 240 10% 3.9%; --foreground: 240 5.9% 98%; --card: 240 10% 3.9%; --card-foreground: 240 5.9% 98%; --popover: 240 10% 3.9%; --popover-foreground: 240 5.9% 98%; --primary: 240 5.9% 98%; --primary-foreground: 240 5.9% 10%; --secondary: 240 3.7% 15.9%; --secondary-foreground: 240 5.9% 98%; --muted: 240 3.7% 15.9%; --muted-foreground: 240 5% 64.9%; --accent: 240 3.7% 15.9%; --accent-foreground: 240 5.9% 98%; --destructive: 0 62.8% 30.6%; --destructive-foreground: 240 5.9% 98%; --border: 240 3.7% 15.9%; --input: 240 3.7% 15.9%; --ring: 240 4.9% 83.9%; } } @layer base { * { @apply border-border; } html { @apply scroll-smooth; } body { @apply bg-gradient-to-br from-blue-50 via-white to-purple-50 text-foreground min-h-screen; background-attachment: fixed; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .dark body { @apply bg-gradient-to-br from-gray-900 via-gray-800 to-gray-900; } /* 移动端优化 */ @media (max-width: 768px) { body { background-attachment: scroll; } } } @layer components { /* 毛玻璃效果基础类 */ .glass { @apply backdrop-blur-md bg-white/10 border border-white/20; box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37); } .glass-light { @apply backdrop-blur-sm bg-white/20 border border-white/30; box-shadow: 0 4px 16px 0 rgba(31, 38, 135, 0.2); } .glass-heavy { @apply backdrop-blur-xl bg-white/30 border border-white/40; box-shadow: 0 16px 64px 0 rgba(31, 38, 135, 0.5); } .glass-dark { @apply backdrop-blur-md bg-black/10 border border-white/10; box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3); } /* 移动端毛玻璃效果优化 */ @media (max-width: 768px) { .glass { @apply backdrop-blur-sm bg-white/15; } .glass-light { @apply backdrop-blur-sm bg-white/25; } .glass-heavy { @apply backdrop-blur-md bg-white/35; } } /* 卡片毛玻璃效果 */ .glass-card { @apply glass rounded-2xl p-6 transition-all duration-300 hover:bg-white/20 hover:shadow-glass-lg; } /* 移动端卡片优化 */ @media (max-width: 768px) { .glass-card { @apply p-4 rounded-xl; } } /* 导航栏毛玻璃效果 */ .glass-nav { @apply glass-light rounded-2xl transition-all duration-300; } /* 按钮毛玻璃效果 */ .glass-button { @apply glass-light rounded-xl px-4 py-2 transition-all duration-300 hover:bg-white/30 hover:scale-105; } /* 移动端按钮优化 */ @media (max-width: 768px) { .glass-button { @apply px-6 py-3 text-base; min-height: 44px; /* iOS推荐的最小触摸目标 */ } } /* 输入框毛玻璃效果 */ .glass-input { @apply glass-light rounded-xl px-4 py-2 transition-all duration-300 focus:bg-white/30 focus:ring-2 focus:ring-white/50; } /* 移动端输入框优化 */ @media (max-width: 768px) { .glass-input { @apply px-4 py-3 text-base; min-height: 44px; } } /* 安全区域适配 */ .safe-area-top { padding-top: env(safe-area-inset-top); } .safe-area-bottom { padding-bottom: env(safe-area-inset-bottom); } .safe-area-left { padding-left: env(safe-area-inset-left); } .safe-area-right { padding-right: env(safe-area-inset-right); } } /* 移动端滚动优化 */ @media (max-width: 768px) { .overflow-scroll { -webkit-overflow-scrolling: touch; } }