/**
 * 动画效果
 * 三端共用，橙色主题
 */

/* ========== 基础动画 ========== */

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

.fade-in {
    animation: fadeIn var(--transition-base) ease;
}

/* 淡入上移 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp var(--transition-slow) ease;
}

/* 淡入下移 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-down {
    animation: fadeInDown var(--transition-slow) ease;
}

/* 淡入左移 */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in-left {
    animation: fadeInLeft var(--transition-slow) ease;
}

/* 淡入右移 */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in-right {
    animation: fadeInRight var(--transition-slow) ease;
}

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

.scale-in {
    animation: scaleIn var(--transition-base) ease;
}

/* ========== 主题动画 ========== */

/* 橙色脉冲 */
@keyframes orangePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.4);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(255, 107, 53, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0);
    }
}

.orange-pulse {
    animation: orangePulse 2s infinite;
}

/* 橙色发光 */
@keyframes orangeGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 107, 53, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 107, 53, 0.6);
    }
}

.orange-glow {
    animation: orangeGlow 2s ease-in-out infinite;
}

/* 渐变流动 */
@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-flow {
    background-size: 200% 200%;
    animation: gradientFlow 3s ease infinite;
}

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

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

.spin {
    animation: spin 1s linear infinite;
}

/* 弹跳 */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.bounce {
    animation: bounce 1s ease infinite;
}

/* 点加载 */
@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-primary);
    animation: dotPulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* 骨架屏 */
@keyframes skeleton {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200px 100%;
    animation: skeleton 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

/* ========== 交互动画 ========== */

/* 悬停上浮 */
.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* 悬停发光 */
.hover-glow {
    transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
    box-shadow: var(--shadow-primary-lg);
}

/* 点击波纹 */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.ripple:active::after {
    width: 200%;
    height: 200%;
}

/* ========== 页面过渡 ========== */

/* 页面进入 */
.page-enter {
    opacity: 0;
    transform: translateY(10px);
}

.page-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

/* 页面离开 */
.page-exit {
    opacity: 1;
}

.page-exit-active {
    opacity: 0;
    transition: opacity var(--transition-base);
}

/* ========== 列表动画 ========== */

/* 列表项依次进入 */
.list-enter-item {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp var(--transition-slow) ease forwards;
}

.list-enter-item:nth-child(1) { animation-delay: 0.05s; }
.list-enter-item:nth-child(2) { animation-delay: 0.1s; }
.list-enter-item:nth-child(3) { animation-delay: 0.15s; }
.list-enter-item:nth-child(4) { animation-delay: 0.2s; }
.list-enter-item:nth-child(5) { animation-delay: 0.25s; }
.list-enter-item:nth-child(6) { animation-delay: 0.3s; }
.list-enter-item:nth-child(7) { animation-delay: 0.35s; }
.list-enter-item:nth-child(8) { animation-delay: 0.4s; }
.list-enter-item:nth-child(9) { animation-delay: 0.45s; }
.list-enter-item:nth-child(10) { animation-delay: 0.5s; }

/* ========== 数字滚动 ========== */

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.count-up {
    animation: countUp var(--transition-slow) ease;
}

/* ========== 通知动画 ========== */

/* 滑入通知 */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-right {
    animation: slideInRight var(--transition-base) ease;
}

/* 滑出通知 */
@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.slide-out-right {
    animation: slideOutRight var(--transition-base) ease forwards;
}

/* ========== 心跳动画 ========== */

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.1);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.1);
    }
    70% {
        transform: scale(1);
    }
}

.heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

/* ========== 摇晃动画 ========== */

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* ========== 动画延迟工具类 ========== */

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }
.delay-900 { animation-delay: 0.9s; }
.delay-1000 { animation-delay: 1s; }

/* ========== 动画持续时间工具类 ========== */

.duration-fast { animation-duration: 0.15s; }
.duration-base { animation-duration: 0.25s; }
.duration-slow { animation-duration: 0.35s; }
.duration-slower { animation-duration: 0.5s; }
