/* ==============================================
   百杏云 - 增强动画效果
   ============================================== */

/* ==============================================
   基础动画关键帧
   ============================================== */

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

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

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

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

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

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

/* ==============================================
   悬浮和移动动画
   ============================================== */

/* 上下浮动 */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

/* 左右摆动 */
@keyframes sway {
    0%, 100% {
        transform: rotate(-3deg);
    }
    50% {
        transform: rotate(3deg);
    }
}

/* 轻微弹跳 */
@keyframes bounceGentle {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

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

/* 脉冲缩放 */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* 呼吸效果 */
@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.9;
    }
}

/* 心跳效果 */
@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);
    }
}

/* ==============================================
   旋转和循环动画
   ============================================== */

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

/* 逆时针旋转 */
@keyframes rotateReverse {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

/* 轨道旋转 */
@keyframes orbit {
    from { transform: rotate(0deg) translateX(50px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(50px) rotate(-360deg); }
}

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

/* 旋转加载器 */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 弹性加载器 */
@keyframes elasticSpin {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(90deg); }
    50% { transform: rotate(180deg); }
    75% { transform: rotate(270deg); }
    100% { transform: rotate(360deg); }
}

/* 波纹加载器 */
@keyframes wave {
    0%, 100% {
        height: 20%;
        transform: translateY(0);
    }
    50% {
        height: 100%;
        transform: translateY(-40%);
    }
}

/* 点脉冲加载 */
@keyframes dotPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.5);
        opacity: 1;
    }
}

/* 圆弧加载 */
@keyframes circularReveal {
    0% {
        stroke-dashoffset: 100;
    }
    50% {
        stroke-dashoffset: 25;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

/* ==============================================
   交互反馈动画
   ============================================== */

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

/* 成功打钩 */
@keyframes successCheck {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 弹出效果 */
@keyframes pop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 弹性弹出 */
@keyframes elasticPop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    60% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 滑入 */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 滑出 */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 展开 */
@keyframes expand {
    from {
        transform: scaleY(0);
        opacity: 0;
    }
    to {
        transform: scaleY(1);
        opacity: 1;
    }
}

/* 收缩 */
@keyframes contract {
    from {
        transform: scaleY(1);
        opacity: 1;
    }
    to {
        transform: scaleY(0);
        opacity: 0;
    }
}

/* ==============================================
   高级特效
   ============================================== */

/* 闪光效果 */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* 霓虹闪烁 */
@keyframes neonFlicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        opacity: 1;
        text-shadow: 
            0 0 5px currentColor,
            0 0 10px currentColor,
            0 0 20px currentColor;
    }
    20%, 24%, 55% {
        opacity: 0.5;
        text-shadow: none;
    }
}

/* 渐变边框流动 */
@keyframes borderGlow {
    0%, 100% {
        border-color: var(--primary-color);
    }
    50% {
        border-color: var(--secondary-color);
    }
}

/* 脉动阴影 */
@keyframes shadowPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(102, 126, 234, 0.6);
    }
}

/* 内部发光 */
@keyframes innerGlow {
    0%, 100% {
        box-shadow: inset 0 0 20px rgba(102, 126, 234, 0.1);
    }
    50% {
        box-shadow: inset 0 0 40px rgba(102, 126, 234, 0.3);
    }
}

/* ==============================================
   过渡和悬停效果
   ============================================== */

/* 淡入淡出过渡 */
.fade-enter {
    opacity: 0;
}
.fade-enter-active {
    opacity: 1;
    transition: opacity 300ms ease-in;
}
.fade-exit {
    opacity: 1;
}
.fade-exit-active {
    opacity: 0;
    transition: opacity 300ms ease-in;
}

/* 滑入滑出过渡 */
.slide-enter {
    transform: translateX(-100%);
    opacity: 0;
}
.slide-enter-active {
    transform: translateX(0);
    opacity: 1;
    transition: all 300ms ease-out;
}
.slide-exit {
    transform: translateX(0);
    opacity: 1;
}
.slide-exit-active {
    transform: translateX(-100%);
    opacity: 0;
    transition: all 300ms ease-in;
}

/* 缩放入过渡 */
.zoom-enter {
    transform: scale(0.8);
    opacity: 0;
}
.zoom-enter-active {
    transform: scale(1);
    opacity: 1;
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}
.zoom-exit {
    transform: scale(1);
    opacity: 1;
}
.zoom-exit-active {
    transform: scale(0.8);
    opacity: 0;
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==============================================
   动画应用类
   ============================================== */

/* 基础动画 */
.animate-fade-in {
    animation: fadeIn 0.5s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

.animate-fade-in-down {
    animation: fadeInDown 0.5s ease-out;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.5s ease-out;
}

.animate-fade-in-right {
    animation: fadeInRight 0.5s ease-out;
}

.animate-fade-in-scale {
    animation: fadeInScale 0.5s ease-out;
}

/* 悬浮动画 */
.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-sway {
    animation: sway 2s ease-in-out infinite;
}

.animate-bounce-gentle {
    animation: bounceGentle 1.5s ease-in-out infinite;
}

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

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-breathe {
    animation: breathe 3s ease-in-out infinite;
}

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

/* 旋转动画 */
.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-spin-slow {
    animation: spin 3s linear infinite;
}

.animate-spin-fast {
    animation: spin 0.5s linear infinite;
}

.animate-spin-reverse {
    animation: rotateReverse 1s linear infinite;
}

/* 加载动画 */
.animate-wave {
    animation: wave 1s ease-in-out infinite;
}

.animate-dot-pulse {
    animation: dotPulse 1.5s ease-in-out infinite;
}

.animate-elastic-spin {
    animation: elasticSpin 1s ease-in-out infinite;
}

/* 交互反馈 */
.animate-shake {
    animation: shake 0.5s ease-in-out;
}

.animate-success-check {
    animation: successCheck 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.animate-pop {
    animation: pop 0.4s ease-out;
}

.animate-elastic-pop {
    animation: elasticPop 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.animate-slide-up {
    animation: slideUp 0.4s ease-out;
}

.animate-slide-down {
    animation: slideDown 0.4s ease-out;
}

.animate-expand {
    animation: expand 0.3s ease-out;
}

.animate-contract {
    animation: contract 0.3s ease-out;
}

/* 特效动画 */
.animate-shimmer {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 0%,
        var(--bg-tertiary) 50%,
        var(--bg-secondary) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.animate-shadow-pulse {
    animation: shadowPulse 2s ease-in-out infinite;
}

.animate-inner-glow {
    animation: innerGlow 3s ease-in-out infinite;
}

/* ==============================================
   延迟和持续时间
   ============================================== */

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

.animation-duration-fast { animation-duration: 0.2s; }
.animation-duration-normal { animation-duration: 0.3s; }
.animation-duration-slow { animation-duration: 0.5s; }
.animation-duration-very-slow { animation-duration: 1s; }

/* ==============================================
   SVG图标动画
   ============================================== */

/* 图标容器 */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: all var(--transition-base);
}

.icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 图标悬停效果 */
.icon-hover {
    cursor: pointer;
}

.icon-hover:hover {
    transform: scale(1.1);
}

.icon-hover:hover svg {
    stroke: var(--primary-color);
}

/* 旋转图标 */
.icon-spin {
    animation: spin 1s linear infinite;
}

/* 脉冲图标 */
.icon-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ==============================================
   悬停交互效果
   ============================================== */

/* 提升效果 */
.hover-lift {
    transition: all var(--transition-base);
}

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

/* 放大效果 */
.hover-scale {
    transition: all var(--transition-base);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* 旋转效果 */
.hover-rotate {
    transition: all var(--transition-base);
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* 发光效果 */
.hover-glow {
    transition: all var(--transition-base);
}

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

/* 边框效果 */
.hover-border {
    transition: all var(--transition-base);
}

.hover-border:hover {
    border-color: var(--primary-color);
}

/* 文字颜色效果 */
.hover-text-primary {
    transition: all var(--transition-base);
}

.hover-text-primary:hover {
    color: var(--primary-color);
}

/* 背景效果 */
.hover-bg-primary {
    transition: all var(--transition-base);
}

.hover-bg-primary:hover {
    background: var(--bg-secondary);
}

/* ==============================================
   波纹效果
   ============================================== */

.ripple {
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
}

.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, opacity 0.6s ease;
    opacity: 0;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
    opacity: 1;
    transition: 0s;
}

/* 暗色模式波纹 */
.ripple-dark::after {
    background: rgba(0, 0, 0, 0.1);
}

/* ==============================================
   玻璃拟态效果
   ============================================== */

.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-lg);
}

.glass-dark {
    background: var(--bg-glass-dark);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==============================================
   渐变边框
   ============================================== */

.gradient-border {
    position: relative;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    z-index: 1;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--gradient-primary);
    border-radius: calc(var(--radius-lg) + 2px);
    z-index: -1;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.gradient-border:hover::before {
    opacity: 1;
}

/* ==============================================
   3D效果
   ============================================== */

.perspective-1000 {
    perspective: 1000px;
}

.transform-3d {
    transform-style: preserve-3d;
}

.backface-hidden {
    backface-visibility: hidden;
}

/* ==============================================
   骨架屏
   ============================================== */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 25%,
        var(--bg-tertiary) 50%,
        var(--bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-title {
    height: 24px;
    width: 40%;
    margin-bottom: 12px;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-button {
    width: 120px;
    height: 40px;
    border-radius: var(--radius-md);
}

.skeleton-card {
    border-radius: var(--radius-lg);
    padding: 20px;
}

.skeleton-image {
    width: 100%;
    height: 200px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

/* ==============================================
   状态指示器
   ============================================== */

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}

.status-dot::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0.3;
}

.status-success {
    background: var(--success-color);
    color: var(--success-color);
}

.status-success::after {
    border-color: var(--success-color);
    animation: pulse 2s ease-in-out infinite;
}

.status-warning {
    background: var(--warning-color);
    color: var(--warning-color);
}

.status-warning::after {
    border-color: var(--warning-color);
    animation: pulse 2s ease-in-out infinite;
}

.status-error {
    background: var(--error-color);
    color: var(--error-color);
}

.status-error::after {
    border-color: var(--error-color);
    animation: pulse 2s ease-in-out infinite;
}

.status-info {
    background: var(--info-color);
    color: var(--info-color);
}

.status-info::after {
    border-color: var(--info-color);
    animation: pulse 2s ease-in-out infinite;
}

/* ==============================================
   滚动动画
   ============================================== */

/* 滚动显示动画 - 使用Intersection Observer触发 */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* 滚动淡入 */
.reveal-fade {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.reveal-fade.active {
    opacity: 1;
}

/* 滚动缩放 */
.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* 滚动滑入 */
.reveal-slide {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-slide.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-slide-right {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-slide-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* 延迟加载效果 */
.reveal-delay-100 { transition-delay: 0.1s; }
.reveal-delay-200 { transition-delay: 0.2s; }
.reveal-delay-300 { transition-delay: 0.3s; }
.reveal-delay-400 { transition-delay: 0.4s; }
.reveal-delay-500 { transition-delay: 0.5s; }
