/* ===========================================
   动画样式库 - 自然清新绿主题
   =========================================== */

[data-animate] {
    opacity: 0;
    transition: all 0.4s 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;
    }
}

/* 淡入 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* 缩放淡入 */
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

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

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

/* 卡片悬停 */
.card-hover-effect {
    transition: transform 0.25s ease-out, box-shadow 0.25s ease-out;
}

.card-hover-effect:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* 按钮悬停 */
.button-hover-effect {
    transition: all 0.25s ease-out;
}

/* 下划线展开 */
.underline-expand {
    position: relative;
    display: inline-block;
}

.underline-expand::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.25s ease-out;
}

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

/* 输入框聚焦 */
.input-focus-effect {
    transition: border-color 0.2s ease-out, box-shadow 0.2s ease-out;
}

.input-focus-effect:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 155, 111, 0.15);
    outline: none;
}

/* 延迟 */
[data-delay="100"] { animation-delay: 0.05s; }
[data-delay="200"] { animation-delay: 0.1s; }
[data-delay="300"] { animation-delay: 0.15s; }
[data-delay="400"] { animation-delay: 0.2s; }
[data-delay="500"] { animation-delay: 0.25s; }
[data-delay="600"] { animation-delay: 0.3s; }
[data-delay="700"] { animation-delay: 0.35s; }
[data-delay="800"] { animation-delay: 0.4s; }

/* 波浪式 */
.stagger-animation:nth-child(1) { animation-delay: 0s; }
.stagger-animation:nth-child(2) { animation-delay: 0.06s; }
.stagger-animation:nth-child(3) { animation-delay: 0.12s; }
.stagger-animation:nth-child(4) { animation-delay: 0.18s; }
.stagger-animation:nth-child(5) { animation-delay: 0.24s; }
.stagger-animation:nth-child(6) { animation-delay: 0.3s; }
.stagger-animation:nth-child(7) { animation-delay: 0.36s; }
.stagger-animation:nth-child(8) { animation-delay: 0.42s; }
.stagger-animation:nth-child(9) { animation-delay: 0.48s; }
.stagger-animation:nth-child(10) { animation-delay: 0.54s; }
.stagger-animation:nth-child(11) { animation-delay: 0.6s; }
.stagger-animation:nth-child(12) { animation-delay: 0.66s; }

/* 数字递增 */
.counter-animation {
    transition: all 0.3s ease-out;
}

/* 性能 */
.will-animate {
    will-change: transform, opacity;
}

.animation-complete {
    will-change: auto;
}
