/* ===== 全局共享动画效果 ===== */

/* ---------- 渐变标题流动 ---------- */
.anim-gradient-title {
    background: linear-gradient(90deg, #fff, var(--primary-color), var(--secondary-color), #fff);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: animGradientFlow 6s ease-in-out infinite;
}

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

/* ---------- 3D Tilt 悬停 ---------- */
.anim-tilt {
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
    transform-style: preserve-3d;
    will-change: transform;
}

.anim-tilt:hover {
    box-shadow: 0 16px 48px rgba(147, 51, 234, 0.18);
}

/* JS 控制 --tilt-x / --tilt-y, 这里提供 fallback */
.anim-tilt[style*="--tilt-x"] {
    transform: perspective(800px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
}

/* ---------- 按钮波纹效果 ---------- */
.anim-btn-ripple {
    position: relative;
    overflow: hidden;
}

.anim-btn-ripple .ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0);
    animation: animRipple 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes animRipple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ---------- 图标弹跳 ---------- */
.anim-icon-bounce i,
.anim-icon-bounce .fas,
.anim-icon-bounce .fab,
.anim-icon-bounce svg {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-block;
}

.anim-icon-bounce:hover i,
.anim-icon-bounce:hover .fas,
.anim-icon-bounce:hover .fab,
.anim-icon-bounce:hover svg {
    transform: scale(1.25) rotate(-8deg);
}

/* ---------- 发光边框脉冲 ---------- */
.anim-glow-border {
    position: relative;
}

.anim-glow-border::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), transparent, var(--primary-color));
    background-size: 300% 300%;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.4s ease;
    animation: animGlowBorderRotate 3s linear infinite paused;
}

.anim-glow-border:hover::before {
    opacity: 1;
    animation-play-state: running;
}

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

/* ---------- 交错子元素入场 ---------- */
.anim-stagger > *:nth-child(1)  { transition-delay: 0s; }
.anim-stagger > *:nth-child(2)  { transition-delay: 0.06s; }
.anim-stagger > *:nth-child(3)  { transition-delay: 0.12s; }
.anim-stagger > *:nth-child(4)  { transition-delay: 0.18s; }
.anim-stagger > *:nth-child(5)  { transition-delay: 0.24s; }
.anim-stagger > *:nth-child(6)  { transition-delay: 0.30s; }
.anim-stagger > *:nth-child(7)  { transition-delay: 0.36s; }
.anim-stagger > *:nth-child(8)  { transition-delay: 0.42s; }
.anim-stagger > *:nth-child(9)  { transition-delay: 0.48s; }
.anim-stagger > *:nth-child(10) { transition-delay: 0.54s; }
.anim-stagger > *:nth-child(n+11) { transition-delay: 0.60s; }

/* ---------- data-reveal 新变体: scale-rotate ---------- */
[data-reveal="scale-rotate"] {
    opacity: 0;
    transform: scale(0.85) rotate(-3deg);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-reveal="scale-rotate"].is-revealed {
    opacity: 1;
    transform: none;
}

/* ---------- Eyebrow 文字闪光扫描 ---------- */
.page-eyebrow,
.sponsor-eyebrow {
    position: relative;
    overflow: hidden;
}

.page-eyebrow::after,
.sponsor-eyebrow::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.3), transparent);
    animation: animEyebrowShine 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes animEyebrowShine {
    0%, 100% { left: -100%; }
    50%      { left: 140%; }
}

/* ---------- 数字计数器样式 ---------- */
[data-count-target] {
    font-variant-numeric: tabular-nums;
}

/* ---------- 悬停卡片浮起 ---------- */
.anim-float-up {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.4s ease;
}

.anim-float-up:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 36px rgba(147, 51, 234, 0.15);
}

/* ---------- 响应式：减少动画偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
    .anim-gradient-title {
        animation: none;
    }

    .anim-tilt:hover {
        transform: none;
    }

    .anim-btn-ripple .ripple-effect {
        animation: none;
        display: none;
    }

    .anim-icon-bounce:hover i,
    .anim-icon-bounce:hover .fas,
    .anim-icon-bounce:hover svg {
        transform: none;
    }

    .anim-glow-border::before {
        display: none;
    }

    .page-eyebrow::after,
    .sponsor-eyebrow::after {
        display: none;
    }

    .anim-float-up:hover {
        transform: none;
    }

    [data-reveal="scale-rotate"] {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
