/* Hero Banner 背景图样式 */
.hero-banner {
    background-image: url('../img/bg/hero-1.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    /* 背景图裁剪以填充容器 */
    background-position: right bottom;
    /* 背景图对齐右下角 */
    position: relative;
    overflow: hidden;
    /* 防止背景图超出容器 */
}

/* 手机端样式 */
@media (max-width: 767px) {
    .hero-inner {
        position: absolute;
        /* 绝对定位 */
        top: 150px;
        /* 距离上边150px */
        left: 0;
        /* 靠左 */
        right: 0;
        /* 占满宽度 */
        padding: 0 20px;
        /* 添加内边距 */
        text-align: left;
        /* 文本左对齐 */
    }

    /* 调整字体大小，缩小50% */
    .hero-inner h6 {
        font-size: 0.75rem;
        /* 50%缩小 */
    }

    .hero-inner h1 {
        font-size: 1.5rem;
        /* 50%缩小 */
    }

    .hero-inner p {
        font-size: 0.875rem;
        /* 50%缩小 */
    }
}

/* hero-inner 样式 */
.hero-inner {
    position: relative;
    z-index: 2;
    padding-top: 0px;
    padding-bottom: 60px;
    color: #fff;
}

/* Hero Particles 样式 */
#heroparticles {
    position: absolute;
    top: 200px;
    /* 贴紧顶部 */
    left: 200px;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.particles-js-canvas-el {
    position: absolute !important;
    top: 0 !important;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 1 !important;
    pointer-events: none;
}

/* Navbar 样式 */
@media (max-width: 991px) {
    .navbar-collapse {
        position: absolute;
        top: 100%;
        right: 0;
        width: 260px;
        max-width: 80vw;
        background-color: #1d358f !important;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        max-height: calc(100vh - 60px);
        /* 保证在屏幕内 */
        overflow-y: hidden !important;
        overflow-x: hidden !important;
        z-index: 9999;
        border-left: 1px solid #fff2;
    }

    .navbar-nav {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .navbar-nav .nav-link {
        color: #fff !important;
        padding: 12px 20px;
    }

    .navbar-collapse::-webkit-scrollbar {
        display: none !important;
    }

    .navbar-collapse {
        -ms-overflow-style: none !important;
        scrollbar-width: none !important;
    }
}

/* 卡片样式 */
.card-link-wrapper .blog-item {
    transition: all 0.3s ease;
    border: 1px solid transparent;
    border-radius: 8px;
}

.card-link-wrapper:hover .blog-item {
    border: 1px solid #1d358f;
    /* 蓝色边框 */
    box-shadow: 0 8px 20px rgba(29, 53, 143, 0.2);
    /* 蓝色阴影 */
    transform: translateY(-3px);
    /* 稍微上浮 */
}

/* 说明书标题栏样式 */
.section-heading {
    background-color: #f8f8f8;
    padding: 0;
    border-radius: 0;
    width: 100%;
    text-align: center;
}

/* 卡片样式 */
.card-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    padding: 5px;
    background: #f8f8f8;
    border-radius: 5px;
    overflow-x: auto;
    justify-content: center;
}

.card {
    flex: 1 1 0%;
    max-width: 300px;
    min-width: 0;
    box-sizing: border-box;
    background: #fff;
}

.image-text-container {
    width: 100%;
    max-width: 200px;
    min-width: 0;
}

.card-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.image-text-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.card-img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

.card-text {
    font-size: 16px;
    text-align: center;
    margin-top: 10px;
    color: #ff3333;
}

.download-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #ff3333;
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.download-btn:hover {
    background-color: #cc2929;
}

/* Mobile responsive card styles */
@media (max-width: 768px) {
    .card-container {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 10px;
        margin: 0;
        justify-content: center;
    }

    .card {
        flex: 0 0 30%;
        max-width: 100%;
        padding: 15px;
        box-sizing: border-box;
    }

    .image-text-container {
        max-width: 100%;
        margin-bottom: 0px;
    }

    .card-img {
        width: 150%;
        height: auto;
        max-height: 250px;
        object-fit: contain;
    }

    .download-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
}

/* 字体缩小 */
.card-text {
    font-size: 14px;
    margin-top: 8px;
}

.download-btn {
    font-size: 14px;
    padding: 8px 16px;
}

/* Gallery 样式 */
.custom-gallery .gallery-header {
    margin: 10px 0 10px;
    text-align: center;
}

.gallery-header h4 {
    font-size: 2.5rem;
    color: #333;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Lightbox 样式 */
#lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s, visibility .3s;
}

#lightbox-overlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
    cursor: zoom-in;
}

#lightbox-overlay img.zoomed {
    transform: scale(2);
    cursor: zoom-out;
}

#lightbox-overlay.lightbox-visible {
    opacity: 1;
    visibility: visible;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.7);
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 16px;
    color: #333;
}

/* 自定义画廊样式 */
.custom-gallery .gallery-scroll {
    display: flex;
    gap: 10px;
    overflow: hidden;
}

.custom-gallery .gallery-item {
    flex: 0 0 auto;
    width: 200px;
    aspect-ratio: 3 / 4;
}

.custom-gallery .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* 客户 Logo 无限跑马灯 */
.clients-marquee {
    display: flex;
    align-items: center;
    overflow: hidden;
    /* 隐藏超出部分 */
    width: 100%;
    position: relative;
}

.clients-marquee .marquee-track {
    display: flex;
    width: max-content;
    /* Ensure width fits content for correct translateX percentage */
    animation: marquee 80s linear infinite;
}

.clients-marquee img {
    flex-shrink: 0;
    /* 禁止压缩 */
    height: 100px;
    /* 固定高度 */
    width: auto;
    /* 宽度自适应 */
    display: block;
    /* 去掉底部空隙 */
    margin-right: 10px;
}

/* 无限水平滚动的关键帧动画 */
@keyframes marquee {
    0% {
        transform: translateX(0);
        /* 开始时在最左边 */
    }

    100% {
        transform: translateX(-50%);
        /* 滚动到一半，实现无缝衔接 */
    }
}

/* 给客户 Logo 加上无缝滚动效果，复制多次实现循环 */
.clients-marquee .marquee-track {
    animation: marquee 200s linear infinite;
}

@media (max-width: 768px) {

    /* 移动端：所有说明书卡片的封面图片放大 */
    .card-container .card .card-img {
        width: 180%;
        /* 根据需求调整放大比例 */
        max-height: none;
        /* 取消高度限制 */
        object-fit: cover;
        /* 保持裁剪填充效果 */
    }
}

/* =========================================
   Enable Hover Dropdown on Desktop
   Replaces JS logic for better performance and stability
   ========================================= */
@media (min-width: 992px) {
    .header .navbar-nav .dropdown:hover>.dropdown-menu {
        display: block;
        margin-top: 0;
        /* Remove potential Bootstrap margin */
    }
}