/* 
 * 简块LED滚动广告
 * 流畅、美观、高性能的LED滚动效果
 */

/* LED容器 */
.simled-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    border-radius: 8px;
    margin: 20px 0;
    /* 高度、背景色、边框等通过内联样式设置 */
}

/* 滚动文字 - 性能优化 */
.simled-scroll {
    position: absolute;
    white-space: nowrap;
    text-decoration: none !important;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    padding: 0 20px;
    /* 性能优化 */
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    /* 颜色、字体、行高等通过内联样式设置 */
}

.simled-scroll:hover {
    text-decoration: none !important;
    color: #ffffff !important;
    /* 悬浮增强效果 */
    transition: all 0.3s ease;
    /* 悬停时暂停动画 */
    animation-play-state: paused !important;
}

/* 发光扫描效果 */
.simled-container:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
    animation: simled-shine 3s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes simled-shine {

    0%,
    100% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }
}

/* 滚动动画 */
@keyframes simled-scroll-ltr {
    0% { 
        transform: translateX(calc(100% + 100px)); /* 确保短文字也能从完全看不见的右侧进入 */
    }
    100% { 
        transform: translateX(calc(-100% - 100px)); /* 完全从左侧消失 */
    }
}

/* 从左到右滚动 */
@keyframes simled-scroll-rtl {
    0% { 
        transform: translateX(calc(-100% - 100px)); /* 确保短文字也能从完全看不见的左侧进入 */
    }
    100% { 
        transform: translateX(calc(100% + 100px)); /* 完全从右侧消失 */
    }
}

/* 从下到上滚动 - 文字居中显示 */
.simled-scroll.scroll-up {
    width: 100%;
    text-align: center;
    padding: 0 10px;
    will-change: transform;
    transform: translateZ(0);
    left: 0 !important;
    right: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes simled-scroll-up {
    0% { 
        transform: translateY(calc(100% + 50px)); /* 确保文字从完全看不见的下方进入 */
    }
    100% { 
        transform: translateY(calc(-100% - 50px)); /* 完全从上方消失 */
    }
}

/* 从上到下滚动 - 文字居中显示 */
.simled-scroll.scroll-down {
    width: 100%;
    text-align: center;
    padding: 0 10px;
    will-change: transform;
    transform: translateZ(0);
    left: 0 !important;
    right: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes simled-scroll-down {
    0% { 
        transform: translateY(calc(-100% - 50px)); /* 确保文字从完全看不见的上方进入 */
    }
    100% { 
        transform: translateY(calc(100% + 50px)); /* 完全从下方消失 */
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .simled-container {
        margin: 15px 0;
    }
}

@media (max-width: 480px) {
    .simled-container {
        margin: 10px 0;
    }
}

/* 扩展动画效果 */
@keyframes simled-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

@keyframes simled-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 simled-fade {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

@keyframes simled-glow {
    0%, 100% { 
        text-shadow: 0 0 10px currentColor, 0 0 20px currentColor; 
    }
    50% { 
        text-shadow: 0 0 20px currentColor, 0 0 30px currentColor, 0 0 40px currentColor; 
    }
}

/* 新增动画类 */
.simled-scroll.animate-pulse {
    animation: simled-pulse 2s ease-in-out infinite;
}

.simled-scroll.animate-bounce {
    animation: simled-bounce 2s infinite;
}

.simled-scroll.animate-fade {
    animation: simled-fade 2s ease-in-out infinite;
}

.simled-scroll.animate-glow {
    animation: simled-glow 2s ease-in-out infinite;
}

/* 无障碍支持 */
@media (prefers-reduced-motion: reduce) {
    .simled-scroll {
        animation: none !important;
        position: static !important;
        transform: none !important;
        text-align: center !important;
        width: 100% !important;
        padding: 10px !important;
    }

    .simled-container:before {
        animation: none !important;
    }
}

/* 打印时隐藏 */
@media print {
    .simled-container {
        display: none;
    }
}