/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    color: #333;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 动画关键帧定义 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* 页面加载动画 */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #FF6B35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 元素进入动画 */
.entrance-fade {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

.entrance-slide-up {
    opacity: 0;
    transform: translateY(50px);
    animation: slideUp 0.8s ease forwards;
}

.entrance-slide-left {
    opacity: 0;
    transform: translateX(-50px);
    animation: slideUp 0.8s ease forwards;
}

.entrance-slide-right {
    opacity: 0;
    transform: translateX(50px);
    animation: slideUp 0.8s ease forwards;
}

/* 3D卡片悬停效果 */
.card-3d-hover {
    transition: transform 0.5s ease, box-shadow 0.5s ease;
    perspective: 1000px;
}

.card-3d-hover:hover {
    transform: translateY(-10px) rotateX(5deg);
}

/* 导航栏样式 */
#navbar {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#navbar.scrolled {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* 按钮样式 */
.btn-primary {
    background-color: #FF6B35;
    color: white;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background-color: #ff5722;
    box-shadow: 0 10px 25px -5px rgba(255, 107, 53, 0.4);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:active::after {
    width: 300px;
    height: 300px;
}

/* 表单焦点样式增强 */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
    border-color: #FF6B35;
}

/* 数据统计数字增长动画 */
.stat-number {
    transition: all 0.5s ease;
}

/* 平滑滚动设置 */
html {
    scroll-behavior: smooth;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #FF6B35;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff5722;
}

/* 备案信息样式 */
.beian-info {
    text-decoration: none;
}

.beian-info a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.beian-info a:hover {
    color: white;
}

/* 移动菜单样式 */
.mobile-menu {
    transition: all 0.3s ease-in-out;
    transform-origin: top;
    transform: scaleY(0);
    opacity: 0;
    display: none;
}

.mobile-menu.active {
    transform: scaleY(1);
    opacity: 1;
    display: block;
}

/* 返回顶部按钮 */
#backToTop {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 999;
}

#backToTop.visible {
    opacity: 1;
    visibility: visible;
}

/* 英雄区域响应式优化 */
.hero {
    background-size: cover;
    background-position: center;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 0;
}

.hero > div {
    position: relative;
    z-index: 1;
}

/* 响应式设计断点 */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }
    
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2rem !important;
    }
    
    h2 {
        font-size: 1.75rem !important;
    }
    
    .hero {
        padding-top: 10rem;
        padding-bottom: 10rem;
    }
    
    .footer-bottom {
        padding: 1rem;
    }
}

/* 平板设备响应式设计 */
@media (min-width: 481px) and (max-width: 768px) {
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero {
        padding-top: 12rem;
        padding-bottom: 12rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* 中小型桌面设备响应式设计 */
@media (min-width: 769px) and (max-width: 1024px) {
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 移动端交互优化 */
@media (max-width: 768px) {
    /* 触摸目标优化 */
    a, button {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 禁用触摸设备上的悬停效果，提高性能 */
    .hover-scale, .card-3d-hover {
        transition: none;
    }
    
    .hover-scale:active, .card-3d-hover:active {
        transform: scale(0.98);
    }
    
    /* 表单触摸体验优化 */
    input, textarea, select {
        padding: 0.75rem;
        font-size: 1rem;
    }
}

/* 打印样式 */
@media print {
    .page-loader, #navbar, #mobileMenu, #backToTop {
        display: none !important;
    }
    
    .footer-bottom {
        page-break-inside: avoid;
    }
    
    a {
        text-decoration: none;
        color: #000;
    }
}