/* ============================================================
   樱梨 Minecraft Server - 动画效果（增强版）
   配合 style.css 中的关键帧使用
   ============================================================ */

/* 页面加载时立即播放的动画 */
.hero-text {
    animation: fadeInUp 1s ease-out;
}

.small-title {
    animation: slideInLeft 0.6s ease-out 0.1s both;
}

.hero-text h2 {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-text h3 {
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.hero-text p {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-buttons {
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

.hero-quick-info span {
    display: inline-block;
    animation: scaleIn 0.4s ease-out backwards;
}
.hero-quick-info span:nth-child(1) { animation-delay: 0.6s; }
.hero-quick-info span:nth-child(2) { animation-delay: 0.7s; }
.hero-quick-info span:nth-child(3) { animation-delay: 0.8s; }
.hero-quick-info span:nth-child(4) { animation-delay: 0.9s; }

/* 滚动触发动画 */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 缩放淡入 */
.animate-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.animate-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* 从左滑入 */
.animate-slide-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.animate-slide-left.visible {
    opacity: 1;
    transform: translateX(0);
}

/* 从右滑入 */
.animate-slide-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.animate-slide-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* 子元素错开出现 */
.animate-stagger > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.animate-stagger.visible > *:nth-child(1) { transition-delay: 0s; }
.animate-stagger.visible > *:nth-child(2) { transition-delay: 0.1s; }
.animate-stagger.visible > *:nth-child(3) { transition-delay: 0.2s; }
.animate-stagger.visible > *:nth-child(4) { transition-delay: 0.3s; }
.animate-stagger.visible > *:nth-child(5) { transition-delay: 0.4s; }
.animate-stagger.visible > *:nth-child(6) { transition-delay: 0.5s; }
.animate-stagger.visible > *:nth-child(7) { transition-delay: 0.6s; }
.animate-stagger.visible > *:nth-child(8) { transition-delay: 0.7s; }
.animate-stagger.visible > *:nth-child(9) { transition-delay: 0.8s; }
.animate-stagger.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* 导航栏交互 */
.navbar {
    transition: background 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}

/* 按钮悬停 */
.main-btn, .join-btn, .copy-btn, .second-btn {
    transition: all 0.3s ease;
}
.main-btn:hover, .join-btn:hover, .copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(251, 205, 208, 0.3);
}
.main-btn:active, .join-btn:active, .copy-btn:active {
    transform: translateY(0) scale(0.97);
}

/* 卡片悬停 */
.feature-card, .gameplay-item, .info-card, .news-card,
.spec-card, .guarantee-card, .plugin-card, .event-card,
.tip-card, .step-guide-card, .user-menu-card {
    transition: all 0.3s ease;
}

/* Toast */
.toast {
    animation: fadeInUp 0.3s ease-out;
}

/* 加载旋转 */
.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #F5F5F5;
    border-top-color: #FBCDD0;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* 页面过渡 */
.page-transition {
    animation: fadeIn 0.5s ease-out;
}

/* 数字跳动 */
.counter {
    transition: color 0.3s ease;
}
.counter.updating {
    animation: pulse 0.3s ease-out;
}

/* 波纹效果 */
.ripple-effect {
    position: relative;
    overflow: hidden;
}
.ripple-effect .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(251, 205, 208, 0.4);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}