/* ===========================================
   动画样式库 (Animations Styles)
   蓝色主题动画效果 - #0052CC
   =========================================== */

/* ===========================================
   基础设置
   =========================================== */

/* 为支持动画的元素添加初始状态 */
[data-animate] {
    opacity: 0;
    transition: all 0.6s ease-out;
}

[data-animate].animated {
    opacity: 1;
}

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

    [data-animate] {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ===========================================
   淡入动画 (Fade In)
   =========================================== */

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

[data-animate="fade-in"] {
    animation: fadeIn 0.8s ease-out forwards;
}

[data-animate="fade-in"].animated {
    opacity: 1;
}

/* ===========================================
   滑入动画 (Slide In)
   =========================================== */

/* 从下方滑入 */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

[data-animate="slide-up"] {
    transform: translateY(40px);
}

[data-animate="slide-up"].animated {
    animation: slideUp 0.6s ease-out forwards;
}

/* 从上方滑入 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

[data-animate="slide-down"] {
    transform: translateY(-40px);
}

[data-animate="slide-down"].animated {
    animation: slideDown 0.6s ease-out forwards;
}

/* 从左侧滑入 */
@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

[data-animate="slide-right"] {
    transform: translateX(-40px);
}

[data-animate="slide-right"].animated {
    animation: slideRight 0.6s ease-out forwards;
}

/* 从右侧滑入 */
@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

[data-animate="slide-left"] {
    transform: translateX(40px);
}

[data-animate="slide-left"].animated {
    animation: slideLeft 0.6s ease-out forwards;
}

/* ===========================================
   缩放动画 (Scale)
   =========================================== */

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

[data-animate="scale-in"] {
    transform: scale(0.9);
}

[data-animate="scale-in"].animated {
    animation: scaleIn 0.5s ease-out forwards;
}

/* ===========================================
   脉动效果 (Pulse)
   =========================================== */

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 82, 204, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(0, 82, 204, 0);
    }
}

.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

/* ===========================================
   渐变背景动画 (Gradient Animation)
   =========================================== */

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animation {
    background: linear-gradient(135deg, #0052cc, #0066ff, #0052cc);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* ===========================================
   卡片悬停效果
   =========================================== */

.card-hover-effect {
    transition: all 0.3s ease;
    position: relative;
}

.card-hover-effect::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    box-shadow: 0 4px 20px rgba(0, 82, 204, 0);
    transition: box-shadow 0.3s ease;
    pointer-events: none;
}

.card-hover-effect:hover {
    transform: translateY(-8px);
}

.card-hover-effect:hover::before {
    box-shadow: 0 12px 40px rgba(0, 82, 204, 0.15);
}

/* ===========================================
   按钮悬停效果
   =========================================== */

.button-hover-effect {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.button-hover-effect::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.button-hover-effect:hover::before {
    width: 300px;
    height: 300px;
}

.button-hover-effect:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 82, 204, 0.3);
}

/* ===========================================
   图标动画效果
   =========================================== */

/* 图标跳动 */
@keyframes iconBounce {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

.icon-bounce:hover {
    animation: iconBounce 0.6s ease;
}

/* 图标旋转 */
@keyframes iconRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.icon-rotate:hover {
    animation: iconRotate 0.6s ease;
}

/* 图标脉冲 */
@keyframes iconPulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.icon-pulse:hover {
    animation: iconPulse 0.4s ease;
}

/* ===========================================
   3D倾斜效果
   =========================================== */

.tilt-3d {
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
}

.tilt-3d:hover {
    transform: perspective(1000px) rotateX(2deg) rotateY(2deg) scale(1.02);
}

/* ===========================================
   数字递增动画
   =========================================== */

.counter-animation {
    transition: all 0.3s ease;
}

/* ===========================================
   下划线展开动画
   =========================================== */

.underline-expand {
    position: relative;
    display: inline-block;
}

.underline-expand::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #0052cc, #0066ff);
    transition: width 0.6s ease;
}

.underline-expand.animated::after {
    width: 100%;
}

/* ===========================================
   导航栏滚动效果
   =========================================== */

.nav-scroll-effect {
    transition: all 0.3s ease;
}

.nav-scroll-effect.scrolled {
    box-shadow: 0 2px 20px rgba(0, 82, 204, 0.08);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
}

/* ===========================================
   边框高亮动画
   =========================================== */

@keyframes borderGlow {
    0%,
    100% {
        border-color: rgba(0, 82, 204, 0.3);
        box-shadow: 0 0 0 0 rgba(0, 82, 204, 0.2);
    }
    50% {
        border-color: rgba(0, 82, 204, 0.8);
        box-shadow: 0 0 20px 0 rgba(0, 82, 204, 0.3);
    }
}

.border-glow-effect {
    animation: borderGlow 2s ease-in-out infinite;
}

/* ===========================================
   输入框聚焦效果
   =========================================== */

.input-focus-effect {
    transition: all 0.3s ease;
}

.input-focus-effect:focus {
    border-color: #0052cc;
    box-shadow: 0 0 0 4px rgba(0, 82, 204, 0.1);
    outline: none;
}

/* ===========================================
   延迟效果
   =========================================== */

[data-delay="100"] {
    animation-delay: 0.1s;
}
[data-delay="200"] {
    animation-delay: 0.2s;
}
[data-delay="300"] {
    animation-delay: 0.3s;
}
[data-delay="400"] {
    animation-delay: 0.4s;
}
[data-delay="500"] {
    animation-delay: 0.5s;
}
[data-delay="600"] {
    animation-delay: 0.6s;
}
[data-delay="700"] {
    animation-delay: 0.7s;
}
[data-delay="800"] {
    animation-delay: 0.8s;
}

/* ===========================================
   加载动画
   =========================================== */

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer-effect {
    background: linear-gradient(90deg, rgba(0, 82, 204, 0.05) 0%, rgba(0, 82, 204, 0.15) 50%, rgba(0, 82, 204, 0.05) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ===========================================
   波浪式显示效果
   =========================================== */

.stagger-animation:nth-child(1) {
    animation-delay: 0s;
}
.stagger-animation:nth-child(2) {
    animation-delay: 0.1s;
}
.stagger-animation:nth-child(3) {
    animation-delay: 0.2s;
}
.stagger-animation:nth-child(4) {
    animation-delay: 0.3s;
}
.stagger-animation:nth-child(5) {
    animation-delay: 0.4s;
}
.stagger-animation:nth-child(6) {
    animation-delay: 0.5s;
}
.stagger-animation:nth-child(7) {
    animation-delay: 0.6s;
}
.stagger-animation:nth-child(8) {
    animation-delay: 0.7s;
}

/* ===========================================
   性能优化
   =========================================== */

.will-animate {
    will-change: transform, opacity;
}

/* 动画完成后移除will-change */
.animation-complete {
    will-change: auto;
}
