2025-09-11 10:55:59 +08:00

264 lines
5.4 KiB
CSS

@tailwind base;
@tailwind components;
@tailwind utilities;
/* 全局样式 */
html {
scroll-behavior: smooth;
}
body {
font-family: 'Inter', 'Noto Sans SC', system-ui, sans-serif;
@apply text-gray-800 bg-white;
}
/* 语言切换过渡效果 */
body[i18n-in-progress] h1,
body[i18n-in-progress] h2,
body[i18n-in-progress] h3,
body[i18n-in-progress] p,
body[i18n-in-progress] .text-transition {
opacity: 0;
transition: opacity 0.3s ease;
}
/* 为特定内容设置最小高度,防止布局抖动 */
section h1, .text-4xl, .text-5xl, .text-6xl {
min-height: 1.2em;
}
section p, .text-xl, .text-2xl {
min-height: 1.5em;
}
/* 若项目使用暗色模式,则添加以下样式 */
@media (prefers-color-scheme: dark) {
body {
@apply bg-gray-900 text-gray-100;
}
}
:root {
--primary-color: #1E40AF;
--secondary-color: #F97316;
--accent-color: #059669;
--text-color: #1F2937;
--light-gray: #F8FAFC;
--white: #FFFFFF;
}
@layer components {
.container {
@apply max-w-7xl mx-auto px-6 lg:px-8;
}
.section {
@apply py-16;
}
/* 按钮样式现代化 - 修复焦点环颜色 */
.btn-primary {
@apply inline-flex items-center justify-center bg-primary text-white px-6 py-3 rounded-lg shadow-md hover:bg-blue-700 focus:ring-2 focus:ring-blue-200 focus:outline-none transition-all duration-300 font-medium;
}
.btn-secondary {
@apply inline-flex items-center justify-center bg-secondary text-white px-6 py-3 rounded-lg shadow-md hover:bg-orange-600 focus:ring-2 focus:ring-orange-200 focus:outline-none transition-all duration-300 font-medium;
}
.btn-outline {
@apply inline-flex items-center justify-center border border-primary text-primary bg-transparent px-6 py-3 rounded-lg hover:bg-primary hover:text-white transition-all duration-300 font-medium;
}
/* 卡片样式 */
.card {
@apply bg-white rounded-xl shadow-md p-6 transition-all duration-300;
}
.card-hover {
@apply transition-all duration-300 hover:-translate-y-1 hover:shadow-lg;
}
/* 科技感元素 */
.tech-gradient {
@apply bg-gradient-tech;
}
.glass-effect {
@apply bg-white/70 backdrop-blur-md;
}
}
/* 页面加载动画 */
.page-loader {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: white;
display: flex;
justify-content: center;
align-items: center;
z-index: 9999;
transition: opacity 0.5s;
}
.loader-spinner {
width: 50px;
height: 50px;
border: 4px solid #E5E7EB;
border-top: 4px solid #1E40AF;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* 导航栏样式 */
.nav-scrolled {
@apply bg-white/90 backdrop-blur-md shadow-md border-b border-gray-200;
}
/* 导航栏科技感渐变背景 */
.bg-gradient-tech {
background: linear-gradient(120deg, #1E40AF, #2563EB);
}
/* 页脚科技感渐变背景 */
.bg-gradient-footer {
background: linear-gradient(to bottom right, #1E40AF, #1E3A8A);
}
/* 导航栏社交媒体图标弹出框样式 */
.social-icon-popup {
opacity: 0;
visibility: hidden;
transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
transform: translateY(-10px);
z-index: 100;
}
.group:hover .social-icon-popup {
opacity: 1;
visibility: visible;
transform: translateY(0);
}
/* 二维码弹出框动画 */
.qr-popup-enter-active,
.qr-popup-leave-active {
transition: opacity 0.3s, transform 0.3s;
}
.qr-popup-enter-from,
.qr-popup-leave-to {
opacity: 0;
transform: translateY(-10px);
}
/* 科技感发光效果 */
.glow-effect {
position: relative;
overflow: hidden;
}
.glow-effect::after {
content: '';
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 60%);
opacity: 0;
transition: opacity 0.3s;
pointer-events: none;
}
.glow-effect:hover::after {
opacity: 1;
}
/* 特殊交互效果 */
.hover-float {
transition: transform 0.3s ease;
}
.hover-float:hover {
transform: translateY(-5px);
}
/* 悬浮联系菜单样式 */
.floating-contact-wrapper {
z-index: 999;
}
/* 二维码弹出样式 */
.floating-contact-popup-left {
position: absolute;
top: 50%;
right: 60px;
transform: translateY(-50%) translateX(10px);
background-color: white;
border-radius: 8px;
padding: 10px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
opacity: 0;
visibility: hidden;
transition: all 0.3s ease;
z-index: 100;
}
.qr-code-container {
width: 160px;
height: 160px;
display: flex;
align-items: center;
justify-content: center;
}
.qr-code-image {
max-width: 100%;
height: auto;
}
.group:hover .floating-contact-popup-left {
opacity: 1;
visibility: visible;
transform: translateY(-50%) translateX(0);
}
/* 防止固定悬浮菜单在移动设备上遮挡内容 */
@media (max-width: 767px) {
.floating-contact-wrapper {
z-index: 39;
}
/* 避免与底部导航栏冲突 */
body.has-bottom-nav .floating-contact-wrapper {
bottom: 80px;
}
.floating-contact-popup-left {
display: none;
}
}
/* 响应式调整 */
@media (max-width: 767px) {
.nav-social-icons {
display: none;
}
}
@layer utilities {
.hover\:bg-primary-dark:hover {
background-color: #1a365d;
/* 或使用 CSS 变量 */
background-color: var(--color-primary-dark);
}
}