/* 轮播图样式修复 */
.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    justify-content: center;
    padding: 0;
    margin: 0;
    list-style: none;
}

.carousel-indicators li {
    box-sizing: content-box;
    flex: 0 1 auto;
    width: 12px;
    height: 12px;
    margin: 0 6px;
    text-indent: -999px;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.5);
    background-clip: padding-box;
    border: 2px solid transparent;
    border-radius: 50%;
    opacity: 0.5;
    transition: opacity 0.6s ease;
}

.carousel-indicators li.active {
    opacity: 1;
    background-color: #fff;
}

.carousel-indicators li:hover {
    opacity: 0.75;
}

/* 确保轮播图容器正确显示 */
.carousel {
    position: relative;
}

.carousel-inner {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.carousel-item {
    position: relative;
    display: none;
    float: left;
    width: 100%;
    margin-right: -100%;
    backface-visibility: hidden;
    transition: transform 0.6s ease-in-out;
}

.carousel-item.active,
.carousel-item-next,
.carousel-item-prev {
    display: block;
}

.carousel-item-next:not(.carousel-item-start),
.carousel-item-prev:not(.carousel-item-end) {
    transform: translateX(0);
}

.carousel-item-next,
.carousel-item-prev {
    position: absolute;
    top: 0;
}

.carousel-item-prev.carousel-item-end,
.carousel-item-next.carousel-item-start {
    transform: translateX(0);
}

.carousel-fade .carousel-item {
    opacity: 0;
    transition-property: opacity;
    transform: none;
}

.carousel-fade .carousel-item.active,
.carousel-fade .carousel-item-next.carousel-item-start,
.carousel-fade .carousel-item-prev.carousel-item-end {
    z-index: 1;
    opacity: 1;
}

.carousel-fade .active.carousel-item-start,
.carousel-fade .active.carousel-item-end {
    z-index: 0;
    opacity: 0;
    transition: opacity 0s 0.6s;
}

/* 轮播图控制按钮样式 */
.carousel-control-prev,
.carousel-control-next {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 15%;
    padding: 0;
    color: #fff;
    text-align: center;
    background: none;
    border: 0;
    opacity: 0.5;
    transition: opacity 0.15s ease;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    color: #fff;
    text-decoration: none;
    outline: 0;
    opacity: 0.9;
}

.carousel-control-prev {
    left: 0;
}

.carousel-control-next {
    right: 0;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    background-repeat: no-repeat;
    background-position: 50%;
    background-size: 100% 100%;
}

.carousel-control-prev-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z'/%3e%3c/svg%3e");
}

.carousel-control-next-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

/* 隐藏视觉上隐藏但屏幕阅读器可见的文本 */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* 轮播图背景图片样式 */
.slider-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    opacity: 1;
    display: block;
}

/* 确保轮播图项正确显示 */
.carousel-item {
    position: relative;
    display: none;
    float: left;
    width: 100%;
    margin-right: -100%;
    backface-visibility: hidden;
    transition: transform 0.6s ease-in-out;
}

.carousel-item.active {
    display: block;
}



/* 确保轮播图高度合适 */
.homepage-slider {
    height: 400px;
    overflow: hidden;
    position: relative;
    background-color: #f8f9fa; /* 添加默认背景色 */
}

.homepage-slider .carousel-item {
    height: 400px;
    position: relative;
}

.homepage-slider .slider-background {
    height: 100%;
    width: 100%;
    object-fit: cover;
    display: block;
}

/* 确保轮播图链接正确显示 */
.homepage-slider .carousel-item a {
    display: block;
    height: 100%;
    width: 100%;
    text-decoration: none;
    cursor: pointer;
}

/* 修复轮播图指示器位置 */
.homepage-slider .carousel-indicators {
    z-index: 10;
    margin-bottom: 0;
}

/* 确保轮播图控制按钮可见性 */
.homepage-slider .carousel-control-prev,
.homepage-slider .carousel-control-next {
    z-index: 11;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .homepage-slider {
        height: 300px;
    }
    
    .homepage-slider .carousel-item {
        height: 300px;
    }
    
    .carousel-indicators {
        bottom: 15px;
    }
    
    .carousel-indicators li {
        width: 10px;
        height: 10px;
        margin: 0 4px;
    }
}

@media (max-width: 480px) {
    .homepage-slider {
        height: 250px;
    }
    
    .homepage-slider .carousel-item {
        height: 250px;
    }
    
    .carousel-indicators {
        bottom: 10px;
    }
    
    .carousel-indicators li {
        width: 8px;
        height: 8px;
        margin: 0 3px;
    }
}