/* ==========================================
   通用动画效果库 - Animations.css
   包含可复用的公共动画效果
   ========================================== */

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

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

    to {
        opacity: 1;
    }
}

/* 从上滑入 */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 从下滑入 */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 放大动画 */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 旋转动画 */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* 弹跳动画 */
@keyframes bounce {

    0%,
    20%,
    53%,
    80%,
    100% {
        transform: translate3d(0, 0, 0);
    }

    40%,
    43% {
        transform: translate3d(0, -30px, 0);
    }

    70% {
        transform: translate3d(0, -15px, 0);
    }

    90% {
        transform: translate3d(0, -4px, 0);
    }
}

/* 脉冲动画 */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* 抖动动画 */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-10px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(10px);
    }
}

/* ==========================================
     2. 通用动画类
     ========================================== */

/* 淡入动画类 */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-fade-in-delay {
    animation: fadeIn 0.6s ease-out 0.3s both;
}

/* 滑入动画类 */
.animate-slide-in-down {
    animation: slideInDown 0.6s ease-out;
}

.animate-slide-in-up {
    animation: slideInUp 0.6s ease-out;
}

/* 放大动画类 */
.animate-zoom-in {
    animation: zoomIn 0.5s ease-out;
}

/* 悬浮动画类 */
.hover-lift {
    transition: all 0.1s linear;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* 滚动动画与悬浮动画的组合 */
.scroll-animate-scale.hover-lift:hover,
.scroll-animate-left.hover-lift:hover,
.scroll-animate-right.hover-lift:hover,
.scroll-animate-rotate.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* 当滚动动画激活后，悬浮效果应该基于最终状态 */
.scroll-animate-scale.animate-in.hover-lift:hover {
    transform: scale(1) translateY(-5px);
}

.scroll-animate-left.animate-in.hover-lift:hover {
    transform: translateX(0) translateY(-5px);
}

.scroll-animate-right.animate-in.hover-lift:hover {
    transform: translateX(0) translateY(-5px);
}

.scroll-animate-rotate.animate-in.hover-lift:hover {
    transform: rotate(0deg) scale(1) translateY(-5px);
}

/* ==========================================
     6. 更多组合动画样式
     ========================================== */

/* 悬浮旋转组合 */
.hover-lift.hover-rotate:hover {
    transform: translateY(-5px) rotate(5deg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* 滚动动画与悬浮旋转组合 */
.scroll-animate-scale.hover-lift.hover-rotate:hover {
    transform: translateY(-5px) rotate(5deg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.scroll-animate-scale.animate-in.hover-lift.hover-rotate:hover {
    transform: scale(1) translateY(-5px) rotate(5deg);
}

/* 脉冲悬浮组合 */
.hover-lift.animate-pulse:hover {
    animation: pulse 2s infinite;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* 弹跳悬浮组合 */
.hover-lift.animate-bounce:hover {
    animation: bounce 1s infinite;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* 缩放悬浮组合 */
.hover-lift:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

/* 特殊悬浮效果 */
.hover-lift.hover-scale:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

/* 发光悬浮效果 */
.hover-lift.hover-glow:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 0 20px rgba(255, 255, 255, 0.3);
}

/* 边框发光效果 */
.hover-lift.hover-border-glow:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15),
        0 0 0 2px rgba(255, 255, 255, 0.5);
}

/* 3D悬浮效果 */
.hover-lift.hover-3d:hover {
    transform: translateY(-5px) rotateX(5deg) rotateY(5deg);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

/* 弹性悬浮效果 */
.hover-lift.hover-bounce:hover {
    animation: hoverBounce 0.6s ease-out;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* 弹性悬浮关键帧 */
@keyframes hoverBounce {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }

    100% {
        transform: translateY(-5px);
    }
}

/* 渐变悬浮效果 */
.hover-lift.hover-gradient:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    background: linear-gradient(45deg,
            rgba(255, 255, 255, 0.1),
            rgba(255, 255, 255, 0.05));
}

/* 波纹悬浮效果 */
.hover-lift.hover-ripple:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.hover-lift.hover-ripple:hover::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    to {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

/* 滚动动画与特殊悬浮效果组合 */
.scroll-animate-scale.animate-in.hover-lift.hover-scale:hover {
    transform: scale(1) translateY(-5px) scale(1.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.scroll-animate-left.animate-in.hover-lift.hover-glow:hover {
    transform: translateX(0) translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 0 20px rgba(255, 255, 255, 0.3);
}

.scroll-animate-right.animate-in.hover-lift.hover-3d:hover {
    transform: translateX(0) translateY(-5px) rotateX(5deg) rotateY(5deg);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

/* 延迟悬浮效果 */
.hover-lift.hover-delay:hover {
    transition-delay: 0.1s;
}

/* 快速悬浮效果 */
.hover-lift.hover-fast:hover {
    transition-duration: 0.15s;
}

/* 慢速悬浮效果 */
.hover-lift.hover-slow:hover {
    transition-duration: 0.5s;
}

/* 悬浮时的文字效果 */
.hover-lift.hover-text-lift:hover .text-content {
    transform: translateY(-2px);
    transition: transform 0.3s ease;
}

/* 悬浮时的图片效果 */
.hover-lift.hover-image-scale:hover img {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

/* 悬浮时的边框效果 */
.hover-lift.hover-border:hover {
    border: 2px solid rgba(255, 255, 255, 0.3);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* 悬浮时的背景效果 */
.hover-lift.hover-bg-change:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* 癌症防治区域的"更多"链接特殊样式 */
.con_4_right_bottom.hover-lift {
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.con_4_right_bottom.hover-lift:hover {
    transform: translateY(-2px) translateX(3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.08),
            rgba(255, 255, 255, 0.03));
}

.con_4_right_bottom.hover-lift:hover a {
    color: #007bff;
    font-weight: 500;
    transform: translateX(2px);
    transition: all 0.3s ease;
}

.con_4_right_bottom.hover-lift::after {
    content: "→";
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: all 0.3s ease;
    color: #007bff;
    font-size: 0.8em;
    font-weight: bold;
}

.con_4_right_bottom.hover-lift:hover::after {
    opacity: 1;
    right: 10px;
}

/* 按钮点击动画 */
.btn-click {
    transition: all 0.2s ease;
}

.btn-click:active {
    transform: scale(0.95);
}

/* 旋转悬浮动画 */
.hover-rotate {
    transition: transform 0.3s ease;
}

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

/* 脉冲动画类 */
.animate-pulse {
    animation: pulse 2s infinite;
}

/* 弹跳动画类 */
.animate-bounce {
    animation: bounce 1s infinite;
}

/* 减少动画以提高性能（适用于移动设备） */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 移动设备动画优化 */
@media (max-width: 768px) {
    .hover-lift:hover {
        transform: none;
    }
}

/* ==========================================
     5. 滚动触发动画
     ========================================== */

/* 初始隐藏状态 */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

/* 滚动触发后的显示状态 */
.scroll-animate.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* 从左侧滑入 */
.scroll-animate-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s ease-out;
}

.scroll-animate-left.animate-in {
    opacity: 1;
    transform: translateX(0);
}

/* 从右侧滑入 */
.scroll-animate-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s ease-out;
}

.scroll-animate-right.animate-in {
    opacity: 1;
    transform: translateX(0);
}

/* 缩放进入 */
.scroll-animate-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s ease-out;
}

.scroll-animate-scale.animate-in {
    opacity: 1;
    transform: scale(1);
}

/* 旋转进入 */
.scroll-animate-rotate {
    opacity: 0;
    transform: rotate(-10deg) scale(0.8);
    transition: all 0.6s ease-out;
}

.scroll-animate-rotate.animate-in {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* 延迟动画 */
.scroll-animate-delay-1 {
    transition-delay: 0.1s;
}

.scroll-animate-delay-2 {
    transition-delay: 0.2s;
}

.scroll-animate-delay-3 {
    transition-delay: 0.3s;
}

.scroll-animate-delay-4 {
    transition-delay: 0.4s;
}

.scroll-animate-delay-5 {
    transition-delay: 0.5s;
}

/* 交错动画容器 */
.stagger-container .scroll-animate:nth-child(1) {
    transition-delay: 0.1s;
}

.stagger-container .scroll-animate:nth-child(2) {
    transition-delay: 0.2s;
}

.stagger-container .scroll-animate:nth-child(3) {
    transition-delay: 0.3s;
}

.stagger-container .scroll-animate:nth-child(4) {
    transition-delay: 0.4s;
}

.stagger-container .scroll-animate:nth-child(5) {
    transition-delay: 0.5s;
}

.stagger-container .scroll-animate:nth-child(6) {
    transition-delay: 0.6s;
}

/* 确保stagger-container中的元素在动画前是隐藏的 */
.stagger-container .scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

/* stagger-container中的元素显示状态 */
.stagger-container .scroll-animate.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* 确保stagger-container中的元素在动画前是隐藏的 */
.stagger-container .scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
  }
  
  /* stagger-container中的元素显示状态 */
  .stagger-container .scroll-animate.animate-in {
    opacity: 1;
    transform: translateY(0);
  }