/**
 * 专业增强样式
 * Professional Enhancements
 * 让网站看起来更加专业和精致
 */

/* ==========================================================================
   平滑滚动和动画基础
   ========================================================================== */
html {
    scroll-behavior: smooth;
}

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   返回顶部按钮
   ========================================================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #0066cc;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #0052a3;
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
}

.back-to-top::before {
    content: "↑";
    font-size: 24px;
    font-weight: bold;
}

/* ==========================================================================
   卡片悬停效果增强
   ========================================================================== */
.product-card,
.solution-card,
.news-card,
.business-item {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card::before,
.solution-card::before,
.news-card::before,
.business-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.product-card:hover::before,
.solution-card:hover::before,
.news-card:hover::before,
.business-item:hover::before {
    left: 100%;
}

/* ==========================================================================
   图片悬停效果
   ========================================================================== */
.product-image img,
.solution-image img,
.news-image img {
    transition: transform 0.5s ease, filter 0.3s ease;
}

.product-card:hover .product-image img,
.solution-card:hover .solution-image img,
.news-card:hover .news-image img {
    transform: scale(1.1);
    filter: brightness(1.1);
}

/* ==========================================================================
   按钮增强效果
   ========================================================================== */
.btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: -1;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* ==========================================================================
   标题下划线动画
   ========================================================================== */
.section-title {
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #0066cc, #ff6600);
    transform: translateX(-50%);
    transition: width 0.5s ease;
}

.section-header:hover .section-title::after {
    width: 100%;
}

/* ==========================================================================
   导航菜单增强
   ========================================================================== */
.primary-menu-container a {
    position: relative;
}

.primary-menu-container a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #0066cc;
    transition: width 0.3s ease;
}

.primary-menu-container a:hover::after,
.primary-menu-container .current-menu-item a::after {
    width: 100%;
}

/* ==========================================================================
   页脚链接悬停效果
   ========================================================================== */
.footer-links .footer-menu a {
    position: relative;
    padding-left: 0;
    transition: padding-left 0.3s ease, color 0.3s ease;
}

.footer-links .footer-menu a::before {
    content: '→';
    position: absolute;
    left: -20px;
    opacity: 0;
    transition: left 0.3s ease, opacity 0.3s ease;
}

.footer-links .footer-menu a:hover::before {
    left: 0;
    opacity: 1;
}

.footer-links .footer-menu a:hover {
    padding-left: 25px;
}

/* ==========================================================================
   社交媒体图标脉冲效果
   ========================================================================== */
.footer-social .social-link,
.contact-social .social-link {
    animation: pulse 2s infinite;
}

.footer-social .social-link:hover,
.contact-social .social-link:hover {
    animation: none;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 102, 204, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(0, 102, 204, 0);
    }
}

/* ==========================================================================
   数字统计动画
   ========================================================================== */
.stat-number {
    display: inline-block;
    transition: transform 0.3s ease;
}

.stat-item:hover .stat-number {
    transform: scale(1.2);
}

/* ==========================================================================
   表单输入增强
   ========================================================================== */
.contact-form input:focus,
.contact-form textarea:focus {
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
    transform: translateY(-2px);
}

/* ==========================================================================
   面包屑导航增强
   ========================================================================== */
.breadcrumb a {
    position: relative;
    transition: color 0.3s ease;
}

.breadcrumb a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #0066cc;
    transition: width 0.3s ease;
}

.breadcrumb a:hover::after {
    width: 100%;
}

/* ==========================================================================
   产品分类徽章动画
   ========================================================================== */
.product-category-badge,
.category-badge {
    transition: all 0.3s ease;
}

.product-category-badge:hover,
.category-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.2);
}

/* ==========================================================================
   时间线动画 - 优雅的淡入效果
   ========================================================================== */
.timeline-item {
    opacity: 1;
    transform: translateX(0);
}

/* 只在 JavaScript 检测后启用动画 */
.js-timeline-item {
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.timeline-item.left.js-timeline-item {
    transform: translateX(-30px);
}

.timeline-item.right.js-timeline-item {
    transform: translateX(30px);
}

.js-timeline-item.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* 延迟动画 */
.js-timeline-item:nth-child(1) { transition-delay: 0.1s; }
.js-timeline-item:nth-child(2) { transition-delay: 0.2s; }
.js-timeline-item:nth-child(3) { transition-delay: 0.3s; }
.js-timeline-item:nth-child(4) { transition-delay: 0.4s; }
.js-timeline-item:nth-child(5) { transition-delay: 0.5s; }

/* ==========================================================================
   联系信息卡片悬停
   ========================================================================== */
.contact-info-item {
    transition: all 0.3s ease;
}

.contact-info-item:hover {
    background: #fff;
    border-left: 4px solid #0066cc;
}

/* ==========================================================================
   Hero 区域动画 - 微妙的淡入效果
   ========================================================================== */
.hero-content {
    animation: fadeIn 0.8s ease;
}

.hero-title {
    animation: slideInDown 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-subtitle {
    animation: slideInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.15s both;
}

.hero-buttons {
    animation: fadeIn 0.6s ease 0.3s both;
}

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

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ==========================================================================
   加载时淡入效果 - 保留
   ========================================================================== */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

.fade-in-delay-1 { animation-delay: 0.1s; }
.fade-in-delay-2 { animation-delay: 0.2s; }
.fade-in-delay-3 { animation-delay: 0.3s; }
.fade-in-delay-4 { animation-delay: 0.4s; }

/* ==========================================================================
   滚动显示动画 - 安全的高性能版本
   ========================================================================== */
.scroll-reveal {
    /* 不设置初始隐藏状态，避免闪屏 */
    opacity: 1;
    transform: translateY(0);
}

/* 只在支持 Intersection Observer 时启用动画 */
.js-scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.js-scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* 延迟动画，创造波浪效果 */
.js-scroll-reveal:nth-child(1) { transition-delay: 0.05s; }
.js-scroll-reveal:nth-child(2) { transition-delay: 0.1s; }
.js-scroll-reveal:nth-child(3) { transition-delay: 0.15s; }
.js-scroll-reveal:nth-child(4) { transition-delay: 0.2s; }
.js-scroll-reveal:nth-child(5) { transition-delay: 0.25s; }
.js-scroll-reveal:nth-child(6) { transition-delay: 0.3s; }

/* ==========================================================================
   Logo 悬停效果
   ========================================================================== */
.custom-logo {
    transition: all 0.3s ease;
    filter: brightness(1);
}

.custom-logo-link:hover .custom-logo {
    filter: brightness(1.1);
    transform: scale(1.05);
}

/* ==========================================================================
   搜索框增强
   ========================================================================== */
.search-form input[type="search"] {
    transition: all 0.3s ease;
}

.search-form input[type="search"]:focus {
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.2);
    transform: translateY(-2px);
}

/* ==========================================================================
   分页按钮增强
   ========================================================================== */
.pagination .page-numbers {
    transition: all 0.3s ease;
}

.pagination .page-numbers:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 102, 204, 0.2);
}

/* ==========================================================================
   标签云效果
   ========================================================================== */
.post-tags .tag {
    transition: all 0.3s ease;
}

.post-tags .tag:hover {
    transform: scale(1.1);
}

/* ==========================================================================
   响应式优化
   ========================================================================== */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    .page-loader {
        font-size: 14px;
    }
}

/* ==========================================================================
   打印样式优化
   ========================================================================== */
@media print {
    .back-to-top,
    .page-loader,
    .site-header,
    .site-footer {
        display: none !important;
    }
}

/* ==========================================================================
   高对比度模式支持
   ========================================================================== */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }
    
    .product-card,
    .solution-card,
    .news-card {
        border: 1px solid #000;
    }
}

/* ==========================================================================
   减少动画模式支持
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* ==========================================================================
   高质感微交互动画 - 提升网站质感
   ========================================================================== */

/* 卡片3D悬停效果 */
.product-card,
.solution-card,
.news-card {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.product-card:hover,
.solution-card:hover,
.news-card:hover {
    transform: translateY(-8px) rotateX(2deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 图片缩放优化 - 使用 GPU 加速 */
.product-image img,
.solution-image img,
.news-image img {
    will-change: transform;
    backface-visibility: hidden;
}

/* 按钮波纹效果增强 */
.btn {
    position: relative;
    overflow: hidden;
}

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

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

/* 链接下划线动画 */
.footer-menu a,
.primary-menu-container a {
    position: relative;
}

.footer-menu a::before,
.primary-menu-container a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-menu a:hover::before,
.primary-menu-container a:hover::before {
    width: 100%;
}

/* 统计数字计数动画 */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.stat-number {
    animation: countUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 社交图标悬停动画 */
.footer-social .social-link,
.contact-social .social-link {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-social .social-link:hover,
.contact-social .social-link:hover {
    transform: translateY(-4px) scale(1.1);
}

/* 表单输入聚焦动画 */
.contact-form input:focus,
.contact-form textarea:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(25, 118, 210, 0.15);
}

/* 面包屑导航动画 */
.breadcrumb a {
    transition: all 0.2s ease;
}

.breadcrumb a:hover {
    transform: translateX(3px);
}

/* 返回顶部按钮脉冲 */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(25, 118, 210, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(25, 118, 210, 0);
    }
}

.back-to-top.show {
    animation: pulse 2s infinite;
}

/* 加载进度条 */
@keyframes progress {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.page-loader::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #1976d2, transparent);
    animation: progress 1.5s ease-in-out infinite;
}

/* 卡片内容淡入 */
.product-card .product-content,
.solution-card .solution-content,
.news-card .news-content {
    transition: opacity 0.3s ease;
}

.product-card:hover .product-content,
.solution-card:hover .solution-content,
.news-card:hover .news-content {
    opacity: 0.95;
}

/* 标题装饰线动画 */
.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #1976d2, #42a5f5);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-header:hover .section-title::before {
    width: 100%;
}

/* 图片加载淡入 */
img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.loaded,
img[src] {
    opacity: 1;
}

/* 平滑滚动增强 */
html {
    scroll-behavior: smooth;
}

/* 性能优化 - 使用 GPU 加速 */
.product-card,
.solution-card,
.news-card,
.btn,
.back-to-top {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .js-scroll-reveal,
    .js-timeline-item {
        opacity: 1 !important;
        transform: none !important;
    }
}
