/* 轮播容器：高度按宽度的1/3来设置，接近图片比例 */
#homeCarousel.carousel {
    height: 25vw;          /* 宽度的1/3，高度随屏幕宽度变化 */
    max-height: 300px;     /* 不超过图片原始高度 */
    min-height: 200px;     /* 保证在小屏幕下也有高度 */
    width: 100%;
    position: relative;
    overflow: hidden;
}

/* 轮播内层 */
#homeCarousel .carousel-inner {
    height: 100%;
    width: 100%;
}

/* 轮播项 */
#homeCarousel .carousel-item {
    height: 100%;
    width: 100%;
    position: relative;
}

/* Banner背景层 */
#homeCarousel .banner-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-size: cover;          /* 填满容器 */
    background-position: center;     /* 居中显示 */
    background-repeat: no-repeat;
}

/* 设置各个Banner的具体背景图 */
#homeCarousel .banner-tech .banner-bg {
    background-image:
        linear-gradient(rgba(26, 41, 128, 0.7), rgba(38, 208, 206, 0.7)),
        url('/static/images/banner/banner-tech.png');
}

#homeCarousel .banner-data .banner-bg {
    background-image:
        linear-gradient(rgba(15, 32, 39, 0.7), rgba(44, 83, 100, 0.7)),
        url('/static/images/banner/banner-data.png');
}

#homeCarousel .banner-tools .banner-bg {
    background-image:
        linear-gradient(rgba(35, 37, 38, 0.7), rgba(65, 67, 69, 0.7)),
        url('/static/images/banner/banner-tools.png');
}

/* 可选的额外叠加层（如果需要更暗） */
#homeCarousel .banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background-color: rgba(0, 0, 0, 0.3); /* 可调整透明度 */
}

/* 内容区域 */
#homeCarousel .banner-content {
    position: relative;
    z-index: 3;
    color: white;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

#homeCarousel .banner-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.3;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8);
}

#homeCarousel .banner-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

#homeCarousel .banner-buttons {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

#homeCarousel .banner-buttons .btn {
    padding: 0.6rem 2rem;
    font-size: 1rem;
    font-weight: 600;
}

/* 轮播控制（保持原样） */
#homeCarousel .carousel-indicators {
    margin-bottom: 1.5rem;
    z-index: 4;
}

#homeCarousel .carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 6px;
    background-color: rgba(255, 255, 255, 0.6);
}

#homeCarousel .carousel-indicators button.active {
    background-color: #ffffff;
    transform: scale(1.2);
}

#homeCarousel .carousel-control-prev,
#homeCarousel .carousel-control-next {
    width: 5%;
    opacity: 0.8;
    z-index: 4;
}

#homeCarousel .carousel-control-prev:hover,
#homeCarousel .carousel-control-next:hover {
    opacity: 1;
}

#homeCarousel .carousel-control-prev-icon,
#homeCarousel .carousel-control-next-icon {
    width: 2.5rem;
    height: 2.5rem;
}

/* 响应式 */
@media (max-width: 768px) {
    #homeCarousel.carousel {
        height: 22vh;       /* 在小屏幕下改用视口高度 */
        min-height: 160px;
    }

    #homeCarousel .banner-title {
        font-size: 1.8rem;
    }

    #homeCarousel .banner-subtitle {
        font-size: 1rem;
    }

    #homeCarousel .banner-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    #homeCarousel .banner-buttons .btn {
        width: 100%;
        max-width: 280px;
    }
}
