@keyframes bounce-down {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}
.animate-bounce-down {
    animation: bounce-down 2s infinite;
}

/* 现代化按钮样式 */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e3a8a 100%);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

/* 导航项动态移动效果 */
.nav-item {
    padding-top: 0.5rem;
    padding-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.nav-item:hover {
    padding-top: 0;
    padding-bottom: 1.25rem;
}

/* 视频背景样式 */
.video-container {
    position: relative;
    height: 100vh;
    overflow: hidden;
}

.video-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2;
}

/* 从右上到左下的深色细线纹理效果 */
.video-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 3px,
            rgba(30, 35, 50, 0.1) 2px,
            rgba(30, 35, 50, 0.1) 4px,
            transparent 4px,
            transparent 6px
        );
    z-index: 1;
    pointer-events: none;
}


/* 可选：添加动画效果，让斜线有轻微的闪烁 */
@keyframes diagonal-glow {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.8;
    }
}

.diagonal-pattern.animated {
    animation: diagonal-glow 4s ease-in-out infinite;
}

.video-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: 1;
}

.video-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
                      url('/images/tech-background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: 1;
}


.hero-message {
    position: relative;
    z-index: 10;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 0 1rem;
}

.hero-text h1 {
    font-size: clamp(2rem, 5vw, 4.5rem);
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: clamp(1.25rem, 3vw, 2rem);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
}

.rotate {
    display: inline-block;
    animation: fadeInUp 1s ease-out;
    transition: opacity 0.5s ease-in-out;
}

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

.local-scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.scroll-down {
    display: inline-block;
    width: 3rem;
    height: 3rem;
    border: 2px solid white;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: bounce-down 2s infinite;
}

.scroll-down:hover {
    background: white;
    color: #333;
}

.code-bg {
    background-image: url('https://images.unsplash.com/photo-1461749280684-dccba630e2f6?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80');
}

/* 移动端优化 */
@media (max-width: 768px) {
    .video-bg {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }

    /* 移动设备默认显示背景图片，节省流量 */
    .video-bg {
        display: none;
    }

    .video-fallback {
        display: block;
    }
}

/* 确保视频在所有屏幕比例下都能铺满 */
@media (orientation: portrait) {
    .video-bg {
        object-fit: cover;
        object-position: center;
    }
}

@media (orientation: landscape) {
    .video-bg {
        object-fit: cover;
        object-position: center;
    }
}

/* 减少动画以节省性能 */
@media (prefers-reduced-motion: reduce) {
    .animate-bounce-down,
    .scroll-down,
    .rotate {
        animation: none;
    }

    /* 保持文字轮播的透明度过渡，但移除其他动画 */
    .rotate {
        transition: opacity 0.3s ease-in-out;
    }
}

/* 涟漪特效动画 */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* 联系我们区块的新动画效果 */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes pulse-gentle {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes floating {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* 应用动画的CSS类 */
.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

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

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

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

/* 延迟动画类 */
.animate-delay-100 {
    animation-delay: 0.1s;
}

.animate-delay-200 {
    animation-delay: 0.2s;
}

.animate-delay-300 {
    animation-delay: 0.3s;
}

.animate-delay-400 {
    animation-delay: 0.4s;
}


/* 视频加载提示 */
.video-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1rem;
    text-align: center;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-loading.show {
    opacity: 1;
}

/* 预加载优化 */
.video-bg[data-loaded="true"] {
    opacity: 1;
    transition: opacity 0.5s ease;
}

.video-bg[data-loaded="false"] {
    opacity: 0;
}

/* JavaScript控制的无缝滚动 */
.scroll-container {
    overflow: hidden;
    position: relative;
    width: 100%;
    max-width: 100vw; /* 防止超出视口 */
    height: 60px;
    contain: layout style; /* 提升性能并防止溢出 */
}

.scroll-container::before,
.scroll-container::after {
    content: '';
    position: absolute;
    top: 0;
    width: 60px;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

.scroll-container::before {
    left: 0;
    background: linear-gradient(90deg, white 0%, transparent 100%);
}

.scroll-container::after {
    right: 0;
    background: linear-gradient(270deg, white 0%, transparent 100%);
}

.scroll-content {
    display: flex;
    align-items: center;
    height: 100%;
    white-space: nowrap;
    max-width: none; /* 允许内容正常滚动 */
}

.scroll-item {
    flex-shrink: 0;
    margin-right: 20px;
}

/* 移动端优化滚动容器 */
@media (max-width: 768px) {
    .scroll-container {
        height: 50px;
    }

    .scroll-container::before,
    .scroll-container::after {
        width: 40px;
    }

    .scroll-item {
        margin-right: 15px;
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
}