/*
 * Modern Interactive Effects CSS
 * 现代化交互效果样式表
 * Version: 1.0
 * Last Updated: 2024
 */

/* ===== 现代化交互效果 ===== */

/* 滚动进度条 */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    z-index: 9999;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.5);
}

/* 鼠标跟随效果 */
.mouse-follower {
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(var(--primary-rgb), 0.3);
    pointer-events: none;
    z-index: 9998;
    transition: transform 0.1s ease;
    mix-blend-mode: difference;
}

.mouse-follower.hover {
    transform: scale(2);
    background: rgba(var(--primary-rgb), 0.5);
}

/* 懒加载图片效果 */
.lazy-image {
    filter: blur(5px);
    transition: filter 0.3s ease;
}

.lazy-image.loaded {
    filter: blur(0);
}

/* 视差滚动效果 */
.parallax {
    transform: translateZ(0);
    will-change: transform;
}

.parallax-slow {
    transform: translate3d(0, var(--parallax-offset, 0), 0);
}

.parallax-fast {
    transform: translate3d(0, calc(var(--parallax-offset, 0) * 1.5), 0);
}

/* 页面加载动画 */
.page-load-animation {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.page-load-animation.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* 滚动触发动画 */
.scroll-animation {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-animation.animate {
    opacity: 1;
    transform: translateY(0);
}

.scroll-animation.fade-left {
    transform: translateX(-50px);
}

.scroll-animation.fade-left.animate {
    transform: translateX(0);
}

.scroll-animation.fade-right {
    transform: translateX(50px);
}

.scroll-animation.fade-right.animate {
    transform: translateX(0);
}

.scroll-animation.scale-in {
    transform: scale(0.8);
}

.scroll-animation.scale-in.animate {
    transform: scale(1);
}

/* 高级悬浮效果 */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(var(--primary-rgb), 0.4);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* 渐变边框效果 */
.gradient-border {
    position: relative;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    padding: 2px;
    border-radius: 8px;
}

.gradient-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: inherit;
    z-index: -1;
    filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gradient-border:hover::before {
    opacity: 0.7;
}

.gradient-border-content {
    background: var(--bg-color);
    border-radius: 6px;
    padding: 20px;
}

/* 3D 卡片效果 */
.card-3d {
    perspective: 1000px;
    transform-style: preserve-3d;
}

.card-3d-inner {
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}

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

/* 文字打字机效果 */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--primary-color);
    white-space: nowrap;
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--primary-color); }
}

/* 粒子背景效果 */
.particles-bg {
    position: relative;
    overflow: hidden;
}

.particles-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(var(--primary-rgb), 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(var(--secondary-rgb), 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(var(--accent-rgb), 0.1) 0%, transparent 50%);
    animation: particles-float 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes particles-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(120deg); }
    66% { transform: translateY(20px) rotate(240deg); }
}

/* 波浪动画 */
.wave-animation {
    position: relative;
    overflow: hidden;
}

.wave-animation::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100px;
    background: linear-gradient(90deg, transparent, rgba(var(--primary-rgb), 0.1), transparent);
    animation: wave 3s ease-in-out infinite;
}

@keyframes wave {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(0%); }
}

/* 磁性按钮效果 */
.magnetic-btn {
    position: relative;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.magnetic-btn:hover {
    transform: scale(1.05);
}

.magnetic-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(var(--primary-rgb), 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

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

/* 霓虹灯效果 */
.neon-text {
    color: var(--primary-color);
    text-shadow: 
        0 0 5px var(--primary-color),
        0 0 10px var(--primary-color),
        0 0 15px var(--primary-color),
        0 0 20px var(--primary-color);
    animation: neon-flicker 2s ease-in-out infinite alternate;
}

@keyframes neon-flicker {
    0%, 100% {
        text-shadow: 
            0 0 5px var(--primary-color),
            0 0 10px var(--primary-color),
            0 0 15px var(--primary-color),
            0 0 20px var(--primary-color);
    }
    50% {
        text-shadow: 
            0 0 2px var(--primary-color),
            0 0 5px var(--primary-color),
            0 0 8px var(--primary-color),
            0 0 12px var(--primary-color);
    }
}

/* 液体按钮效果 */
.liquid-btn {
    position: relative;
    overflow: hidden;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.liquid-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: -1;
}

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

/* 玻璃态效果 */
.glassmorphism {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* 新态拟物化效果 */
.neumorphism {
    background: var(--bg-color);
    border-radius: 20px;
    box-shadow: 
        8px 8px 16px rgba(0, 0, 0, 0.1),
        -8px -8px 16px rgba(255, 255, 255, 0.1);
    transition: box-shadow 0.3s ease;
}

.neumorphism:hover {
    box-shadow: 
        12px 12px 24px rgba(0, 0, 0, 0.15),
        -12px -12px 24px rgba(255, 255, 255, 0.15);
}

.neumorphism.inset {
    box-shadow: 
        inset 8px 8px 16px rgba(0, 0, 0, 0.1),
        inset -8px -8px 16px rgba(255, 255, 255, 0.1);
}

/* 响应式优化 */
@media (max-width: 768px) {
    .mouse-follower {
        display: none;
    }
    
    .parallax {
        transform: none !important;
    }
    
    .hover-lift:hover {
        transform: none;
    }
    
    .card-3d:hover .card-3d-inner {
        transform: none;
    }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    .scroll-progress,
    .mouse-follower,
    .page-load-animation,
    .scroll-animation,
    .hover-lift,
    .hover-glow,
    .hover-scale,
    .gradient-border::before,
    .card-3d-inner,
    .typewriter,
    .particles-bg::before,
    .wave-animation::before,
    .magnetic-btn,
    .magnetic-btn::before,
    .neon-text,
    .liquid-btn::before,
    .neumorphism {
        animation: none !important;
        transition: none !important;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .glassmorphism {
        background: rgba(0, 0, 0, 0.8);
        border: 2px solid #fff;
    }
    
    .neumorphism {
        border: 1px solid #000;
    }
}

/* 暗色主题适配 */
@media (prefers-color-scheme: dark) {
    .glassmorphism {
        background: rgba(0, 0, 0, 0.3);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .neumorphism {
        background: #1a1a1a;
        box-shadow: 
            8px 8px 16px rgba(0, 0, 0, 0.3),
            -8px -8px 16px rgba(255, 255, 255, 0.05);
    }
    
    .neumorphism:hover {
        box-shadow: 
            12px 12px 24px rgba(0, 0, 0, 0.4),
            -12px -12px 24px rgba(255, 255, 255, 0.08);
    }
}