/* 守护者V5 - 高级交互动画 */

/* ========== 滚动触发动画 ========== */
[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: 
        opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-animate].animated {
    opacity: 1;
    transform: translateY(0);
}

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

[data-animate="fade-left"].animated {
    transform: translateX(0);
}

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

[data-animate="fade-right"].animated {
    transform: translateX(0);
}

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

[data-animate="scale"].animated {
    transform: scale(1);
}

/* 延迟动画 */
[data-delay="1"] { transition-delay: 0.1s; }
[data-delay="2"] { transition-delay: 0.2s; }
[data-delay="3"] { transition-delay: 0.3s; }
[data-delay="4"] { transition-delay: 0.4s; }
[data-delay="5"] { transition-delay: 0.5s; }

/* ========== 卡片悬停效果 ========== */
.feature-card,
.pricing-card,
.case-card,
.story-card {
    transition: 
        transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.3s ease;
}

.feature-card:hover,
.pricing-card:hover,
.case-card:hover,
.story-card:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(0, 210, 106, 0.1);
}

/* ========== 图标动画 ========== */
.feature-icon {
    transition: 
        transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.4s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 40px rgba(0, 210, 106, 0.3);
}

/* ========== 按钮光泽效果 ========== */
.btn-primary,
.btn-secondary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after,
.btn-secondary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    transform: translateX(-100%) rotate(45deg);
    transition: transform 0.6s;
}

.btn-primary:hover::after,
.btn-secondary:hover::after {
    transform: translateX(100%) rotate(45deg);
}

/* ========== 导航链接下划线动画 ========== */
.nav-links a {
    position: relative;
}

.nav-links a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--matrix-green), transparent);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
    border-radius: 1px;
}

.nav-links a:hover::before {
    width: 100%;
}

/* ========== 数字计数动画 ========== */
@keyframes countUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat-value.animated {
    animation: countUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ========== 脉冲发光效果 ========== */
@keyframes softPulse {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(0, 210, 106, 0.2);
    }
    50% { 
        box-shadow: 0 0 20px 5px rgba(0, 210, 106, 0);
    }
}

.pulse-glow {
    animation: softPulse 3s infinite;
}

/* ========== 悬浮按钮增强 ========== */
.float-btn {
    animation: floatPulse 3s ease-in-out infinite;
}

@keyframes floatPulse {
    0%, 100% { 
        box-shadow: 
            0 4px 20px rgba(0, 210, 106, 0.3),
            0 0 0 0 rgba(0, 210, 106, 0.2);
    }
    50% { 
        box-shadow: 
            0 8px 30px rgba(0, 210, 106, 0.4),
            0 0 0 10px rgba(0, 210, 106, 0);
    }
}

.float-btn:hover {
    animation: none;
    transform: scale(1.1) translateY(-5px);
    box-shadow: 
        0 12px 40px rgba(0, 210, 106, 0.5),
        0 0 30px rgba(0, 210, 106, 0.2);
}

/* ========== 二维码悬停 ========== */
.qr-code,
.qr-code-large {
    transition: 
        transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.4s ease;
}

.qr-code:hover,
.qr-code-large:hover {
    transform: scale(1.05) rotate(1deg);
    box-shadow: 
        0 0 40px rgba(0, 210, 106, 0.4),
        0 0 80px rgba(0, 210, 106, 0.2);
}

/* ========== 表格行悬停 ========== */
.compare-table tr {
    transition: background 0.3s ease;
}

.compare-table tr:hover {
    background: rgba(0, 210, 106, 0.03);
}

/* ========== 统计项悬停 ========== */
.stat-item {
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-item:hover .stat-value {
    text-shadow: 0 0 30px rgba(0, 255, 65, 0.6);
}

/* ========== 故事图标弹跳 ========== */
.story-card:hover .story-icon {
    animation: iconBounce 0.6s ease;
}

@keyframes iconBounce {
    0%, 100% { transform: scale(1.2) translateY(0); }
    50% { transform: scale(1.2) translateY(-10px); }
}

/* ========== 平滑滚动优化 ========== */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* ========== 焦点状态 ========== */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--matrix-green);
    outline-offset: 2px;
}

/* ========== 加载动画 ========== */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.loading {
    background: linear-gradient(
        90deg,
        var(--bg-card) 25%,
        rgba(0, 210, 106, 0.05) 50%,
        var(--bg-card) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* ========== 顶部信息条闪烁 ========== */
@keyframes gentleGlow {
    0%, 100% { 
        opacity: 0.85;
        text-shadow: 0 0 10px rgba(0, 210, 106, 0.2);
    }
    50% { 
        opacity: 1;
        text-shadow: 0 0 25px rgba(0, 210, 106, 0.5);
    }
}

.top-bar-text {
    animation: gentleGlow 4s ease-in-out infinite;
}

/* ========== 响应式动画优化 ========== */
@media (max-width: 768px) {
    [data-animate] {
        transition-duration: 0.6s;
    }
    
    .feature-card:hover,
    .pricing-card:hover,
    .case-card:hover {
        transform: translateY(-4px);
    }
}