/**
 * Enhanced Animations CSS
 * 补充动画效果和交互样式
 */

/* 页面加载动画 */
@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeInScale {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* 悬停动画 */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -30px, 0);
    }
    70% {
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.33);
    }
    40%, 50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: scale(1.2);
    }
}

/* 文字动画 */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blinkCursor {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: #c223c1;
    }
}

/* 背景动画 */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes floatUpDown {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* 加载器动画 */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dots {
    0%, 20% {
        color: rgba(0, 0, 0, 0);
        text-shadow: 0.25em 0 0 rgba(0, 0, 0, 0),
                     0.5em 0 0 rgba(0, 0, 0, 0);
    }
    40% {
        color: #c223c1;
        text-shadow: 0.25em 0 0 rgba(0, 0, 0, 0),
                     0.5em 0 0 rgba(0, 0, 0, 0);
    }
    60% {
        text-shadow: 0.25em 0 0 #c223c1,
                     0.5em 0 0 rgba(0, 0, 0, 0);
    }
    80%, 100% {
        text-shadow: 0.25em 0 0 #c223c1,
                     0.5em 0 0 #c223c1;
    }
}

/* 工具类 */
.animate-slideInUp {
    animation: slideInUp 0.8s ease-out forwards;
}

.animate-slideInLeft {
    animation: slideInLeft 0.8s ease-out forwards;
}

.animate-slideInRight {
    animation: slideInRight 0.8s ease-out forwards;
}

.animate-fadeInScale {
    animation: fadeInScale 0.8s ease-out forwards;
}

.animate-bounce {
    animation: bounce 2s infinite;
}

.animate-shake {
    animation: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.animate-pulse-ring {
    animation: pulse-ring 1.25s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.animate-float {
    animation: floatUpDown 6s ease-in-out infinite;
}

.animate-gradient {
    background: linear-gradient(-45deg, #fa165f, #c223c1, #fa165f, #c223c1);
    background-size: 400% 400%;
    animation: gradientShift 3s ease infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-dots::after {
    content: '...';
    animation: dots 1.5s steps(5, end) infinite;
}

/* 3D 效果 */
.transform-3d {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.card-flip {
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card-flip:hover {
    transform: rotateY(180deg);
}

.card-flip-front,
.card-flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.card-flip-back {
    transform: rotateY(180deg);
}

/* 磁性效果 */
.magnetic {
    transition: transform 0.3s ease;
}

.magnetic:hover {
    transform: translate3d(0, -5px, 0);
}

/* 霓虹灯效果 */
.neon-glow {
    text-shadow: 0 0 5px #c223c1,
                 0 0 10px #c223c1,
                 0 0 15px #c223c1,
                 0 0 20px #c223c1;
}

.neon-border {
    border: 2px solid #c223c1;
    box-shadow: 0 0 5px #c223c1,
                inset 0 0 5px #c223c1;
}

/* 粒子效果背景 */
.particles-bg {
    position: relative;
    overflow: hidden;
}

.particles-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #c223c1, transparent),
        radial-gradient(2px 2px at 40px 70px, #fa165f, transparent),
        radial-gradient(1px 1px at 90px 40px, #c223c1, transparent),
        radial-gradient(1px 1px at 130px 80px, #fa165f, transparent),
        radial-gradient(2px 2px at 160px 30px, #c223c1, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: floatUpDown 20s linear infinite;
    opacity: 0.3;
}

/* 波浪效果 */
.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(194, 35, 193, 0.1), transparent);
    animation: wave 3s ease-in-out infinite;
}

@keyframes wave {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(0%);
    }
}

/* 进度条动画 */
.progress-bar {
    position: relative;
    background: #f3f3f3;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fa165f, #c223c1);
    border-radius: 10px;
    transition: width 1s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 50px 50px;
    animation: move 2s linear infinite;
}

@keyframes move {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 50px 50px;
    }
}

/* 滚动指示器 */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #fa165f, #c223c1);
    transform-origin: left;
    z-index: 9999;
}

/* 视差滚动优化 */
.parallax-container {
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    perspective: 1px;
}

.parallax-element {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.parallax-back {
    transform: translateZ(-1px) scale(2);
}

.parallax-base {
    transform: translateZ(0);
}

/* 响应式动画 */
@media (max-width: 768px) {
    .animate-slideInUp,
    .animate-slideInLeft,
    .animate-slideInRight,
    .animate-fadeInScale {
        animation-duration: 0.5s;
    }
    
    .card-3d:hover {
        transform: none;
    }
    
    .magnetic:hover {
        transform: none;
    }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .gradient-text-animated,
    .font--gradient {
        background: none;
        color: #000;
        -webkit-text-fill-color: #000;
    }
    
    .bg--gradient {
        background: #000;
    }
    
    .neon-glow {
        text-shadow: none;
        color: #000;
    }
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    .particles-bg::before {
        background-image: 
            radial-gradient(2px 2px at 20px 30px, #c223c1, transparent),
            radial-gradient(2px 2px at 40px 70px, #fa165f, transparent),
            radial-gradient(1px 1px at 90px 40px, #c223c1, transparent),
            radial-gradient(1px 1px at 130px 80px, #fa165f, transparent),
            radial-gradient(2px 2px at 160px 30px, #c223c1, transparent);
        opacity: 0.5;
    }
}

/* 打印样式 */
@media print {
    .animate-slideInUp,
    .animate-slideInLeft,
    .animate-slideInRight,
    .animate-fadeInScale,
    .animate-bounce,
    .animate-shake,
    .animate-pulse-ring,
    .animate-float,
    .animate-gradient,
    .animate-spin {
        animation: none !important;
    }
    
    .card-3d,
    .magnetic,
    .neon-glow,
    .neon-border {
        transform: none !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
}

/* 性能优化 */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.will-change-scroll {
    will-change: scroll-position;
}

/* GPU 加速 */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000;
}

/* 自定义滚动条 */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #fa165f, #c223c1);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #c223c1, #fa165f);
}

/* 选择文本样式 */
::selection {
    /* background-color: rgb(255 204 254); */
    background-color: rgb(59 113 223);
    color: #fff;

    /* 限制背景只在文字区域 */
    text-decoration-color: transparent;
}

::-moz-selection {
    /* background-color: rgb(255 204 254); */
    background-color: rgb(59 113 223);
    color: #fff;

    /* 限制背景只在文字区域 */
    text-decoration-color: transparent;
}

/* 焦点样式 */
.focus-visible:focus {
    outline: 2px solid #c223c1;
    outline-offset: 2px;
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 120px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}


        /* 自定义动画类 */
        .hero-title { opacity: 0; }
        .hero-subtitle { opacity: 0; }
        .hero-buttons { opacity: 0; }
        .nav-item { opacity: 0; }
        
        /* 3D卡片效果 */
        .card-3d {
            transform-style: preserve-3d;
            transition: transform 0.3s ease;
        }
        
        /* 加载动画 */
        @keyframes pulse-glow {
            0%, 100% { box-shadow: 0 0 10px rgba(194, 35, 193, 0.2); }
            50% { box-shadow: 0 0 12px rgba(194, 35, 193, 0.3); }
        }
        
        .btn-enhanced:hover {
            animation: pulse-glow 2s infinite;
        }
        
        /* 视差背景 */
        .parallax-bg {
            will-change: transform;
        }
        
        /* 打字机效果光标 */
        .typewriter-text::after {
            content: '|';
            animation: blink 1s infinite;
        }
        
        @keyframes blink {
            0%, 50% { opacity: 1; }
            51%, 100% { opacity: 0; }
        }
        
        /* 渐变文字动画 */
        .gradient-text-animated {
            background: linear-gradient(-45deg, #fa165f, #c223c1, #fa165f, #c223c1);
            background-size: 400% 400%;
            animation: gradient-shift 3s ease infinite;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        
        @keyframes gradient-shift {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }
        
        /* 浮动动画 */
        .float-animation {
            animation: float 6s ease-in-out infinite;
        }
        
        @keyframes float {
            0%, 100% { transform: translateY(0px); }
            50% { transform: translateY(-20px); }
        }
        
        /* 脉冲动画 */
        .pulse-slow {
            animation: pulse-slow 4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
        }
        
        @keyframes pulse-slow {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.7; }
        }
        
        /* .btn-zoom {
            /* transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease; */
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }

        .btn-zoom:hover {
            transform: scale(1.05);
            box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
        } */