/* ========================================
   全面美化升级 - 视觉层次/动画/色彩/响应式/交互
   ======================================== */

/* 1. 视觉层次优化 - 增强深度感 */
.section {
    position: relative;
}

/* 背景装饰元素 */
.section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,107,53,0.03) 0%, transparent 70%);
    /* 移除旋转动画以避免滚动卡顿 */
    /* animation: bgRotate 60s linear infinite; */
    pointer-events: none;
    z-index: 0;
}

@keyframes bgRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.container {
    position: relative;
    z-index: 1;
}

/* 2. 滚动视差效果 */
.parallax-section {
    position: relative;
    overflow: hidden;
}

.parallax-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
    background-size: cover;
    background-position: center;
    will-change: transform;
    z-index: 0;
}

/* 3. 色彩与渐变优化 - 霓虹光晕主题 */
.neon-glow {
    position: relative;
}

.neon-glow::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff6b35, #ff8c42, #1a3c6e, #2855a3, #ff6b35);
    background-size: 400% 400%;
    border-radius: inherit;
    z-index: -1;
    filter: blur(20px);
    opacity: 0;
    transition: opacity 0.3s ease;
    /* 移除无限循环动画以避免滚动卡顿 */
    /* animation: gradientShift 3s ease infinite; */
}

.neon-glow:hover::after {
    opacity: 0.6;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* 4. 按钮点击波纹效果增强 */
.btn-ripple-enhanced {
    position: relative;
    overflow: hidden;
}

.btn-ripple-enhanced::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.8), rgba(255,255,255,0));
    transform: translate(-50%, -50%);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-ripple-enhanced:active::after {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0), rgba(255,255,255,0));
}

/* 5. 卡片翻转效果 */
.card-flip {
    perspective: 1000px;
}

.card-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.card-flip:hover .card-flip-inner {
    transform: rotateY(180deg);
}

.card-flip-front,
.card-flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: inherit;
}

.card-flip-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* 6. 加载骨架屏动画 */
.skeleton-loading {
    background: linear-gradient(90deg, 
        rgba(255,255,255,0.05) 25%, 
        rgba(255,255,255,0.1) 50%, 
        rgba(255,255,255,0.05) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 7. 鼠标跟随光晕效果 */
.mouse-glow {
    position: relative;
    overflow: hidden;
}

.mouse-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
        rgba(255,107,53,0.15) 0%, 
        transparent 50%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mouse-glow:hover::before {
    opacity: 1;
}

/* 8. 渐进式淡入动画增强 */
.fade-in-up {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-up.show {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-left.show {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-right.show {
    opacity: 1;
    transform: translateX(0);
}

.zoom-fade {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.zoom-fade.show {
    opacity: 1;
    transform: scale(1);
}

/* 9. 延迟动画类 */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }
.delay-500 { transition-delay: 0.5s; }
.delay-600 { transition-delay: 0.6s; }
.delay-700 { transition-delay: 0.7s; }
.delay-800 { transition-delay: 0.8s; }

/* 10. 悬浮粒子效果 */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255,255,255,0.4);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
    animation: particle-float 15s infinite;
}

@keyframes particle-float {
    0%, 100% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

/* 11. 文字渐变流光效果 */
.text-gradient-animated {
    background: linear-gradient(90deg, 
        #ff6b35, #ff8c42, #1a3c6e, #2855a3, #ff6b35
    );
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: text-gradient-flow 4s linear infinite;
}

@keyframes text-gradient-flow {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

/* 12. 卡片光影扫过效果 */
.card-sweep-light {
    position: relative;
    overflow: hidden;
}

.card-sweep-light::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255,255,255,0.4) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    transition: all 0.8s ease;
}

.card-sweep-light:hover::before {
    left: 100%;
    top: 100%;
}

/* 13. 响应式体验提升 - 移动端优化 */
@media (max-width: 768px) {
    /* 增大触摸区域 */
    button, a, .nav-link, .nav-link-en {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* 优化字体大小 */
    body {
        font-size: 16px;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .banner-title-large {
        font-size: 2.2rem;
    }
    
    .banner-title-small {
        font-size: 1.5rem;
    }
    
    /* 确保内容不溢出 */
    .container {
        padding: 0 15px;
        max-width: 100%;
    }
    
    /* 优化卡片布局 */
    .services-grid,
    .products-grid,
    .advantages-grid,
    .showcase-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* 禁用部分动画提升性能 */
    .parallax-bg {
        will-change: auto;
    }
}

/* 14. 平板设备优化 */
@media (min-width: 769px) and (max-width: 1024px) {
    .services-grid,
    .products-grid,
    .showcase-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .advantages-grid {
        grid-template-columns: 1fr;
    }
}

/* 15. 深色模式支持（可选） */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(to bottom, #1a1a2e 0%, #16213e 100%);
        color: #e0e0e0;
    }
    
    .service-item,
    .product-category,
    .advantage-card,
    .showcase-item {
        background: rgba(255,255,255,0.05);
        backdrop-filter: blur(10px);
        border-color: rgba(255,255,255,0.1);
    }
}

/* 16. 减少动画偏好设置 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 17. 打印优化 */
@media print {
    .navbar,
    .language-switch,
    .back-to-top,
    .hamburger {
        display: none !important;
    }
    
    .section {
        page-break-inside: avoid;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        background: white !important;
    }
}

/* 18. 高对比度模式 */
@media (forced-colors: active) {
    .neon-glow::after {
        display: none;
    }
    
    .btn-ripple-enhanced::after {
        display: none;
    }
}

/* 19. 焦点可见性增强 */
button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 3px solid #ff6b35;
    outline-offset: 2px;
    border-radius: 4px;
}

/* 20. 选择文本高亮 */
::selection {
    background: rgba(255,107,53,0.3);
    color: #fff;
}

::-moz-selection {
    background: rgba(255,107,53,0.3);
    color: #fff;
}

/* 21. 图片懒加载占位符 */
.lazy-load {
    background: linear-gradient(135deg, #f5f5f5 25%, #e8e8e8 50%, #f5f5f5 75%);
    background-size: 200% 100%;
    animation: lazy-pulse 1.5s infinite;
}

@keyframes lazy-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 22. 数据可视化进度条 */
.progress-bar-animated {
    position: relative;
    height: 8px;
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-animated::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #ff6b35, #ff8c42);
    border-radius: 4px;
    animation: progress-grow 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    transform-origin: left;
    transform: scaleX(0);
}

@keyframes progress-grow {
    to {
        transform: scaleX(var(--progress, 1));
    }
}

/* 23. 时间轴样式 */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #ff6b35, #1a3c6e);
    border-radius: 3px;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -34px;
    top: 5px;
    width: 12px;
    height: 12px;
    background: #ff6b35;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(255,107,53,0.2);
}

/* 24. Logo 墙网格 */
.logo-wall {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 30px;
    align-items: center;
    justify-items: center;
}

.logo-item {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    filter: grayscale(100%);
    opacity: 0.6;
}

.logo-item:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

/* 25. 客户评价轮播容器 */
.testimonial-slider {
    position: relative;
    overflow: hidden;
    padding: 40px 20px;
}

.testimonial-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-card {
    min-width: 100%;
    padding: 30px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
