.banner-container {
    max-width: 1200px;
    /* 新增：限制容器最大宽度 */
    margin: 0 auto;
    /* 确保居中 */
}

.banner-slider {
    max-width: 1200px;
    /* 新增：限制轮播最大宽度 */
    margin: 0 auto;
    /* 确保居中 */
}

/* 轮播图基础样式 */
.carousel-simple {
    margin: 20px auto;
    /* 居中显示 */
    position: relative;
    width: 100%;
    max-width: 1200px;
    overflow: hidden;
    background-color: #f5f5f5;
    /* 添加背景色以防图片加载前的空白 */
    aspect-ratio: 1200 / 400;
    /* 3:1比例 */
    border-radius: 12px;
    /* 与服务容器相同的圆角 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    /* 与服务容器相同的阴影 */
}

/* 幻灯片容器 - 保持宽高比 */
.slide-container {
    position: relative;
    width: 100%;
    border-radius: 12px;
    /* 继承父元素的圆角 */
    overflow: hidden;
    /* 确保图片不会超出圆角边界 */
    padding-top: 33.33%;
    /* 1200:400 = 3:1 的比例 (400/1200=0.3333) */
}

/* 幻灯片容器 */
.carousel-simple .slides {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
    border-radius: 12px;
    /* 继承父元素的圆角 */
}

/* 幻灯片容器 */
.slides {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease;
    border-radius: 12px;
    /* 继承父元素的圆角 */
}

/* 图片容器 - 绝对定位填满父元素 */
.slide {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    /* 继承父元素的圆角 */
}

/* 单个幻灯片 */
.carousel-simple .slide {
    min-width: 100%;
    position: relative;
}

/* 图片样式 - 完整显示 */
.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 裁剪图片保持比例 */
    object-position: center center;
    /* 关键：从中心向四周均匀裁剪 */
    background-color: white;
    /* 图片周围背景色 */
    border-radius: 12px;
    /* 继承父元素的圆角 */
}

.carousel-simple .slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 标题样式 - 精简版 */
.caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    border-radius: 4px;
    max-width: 100%;
    text-align: center;

}

.caption h3 {
    border-radius: 8px;
    /* 小圆角 */
    margin: 0;
    color: var(--primary);
    font-size: 2rem;
    background-color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .carousel-simple {
        aspect-ratio: 16/9;
        /* 移动端使用更常见的比例 */
        border-radius: 8px;
        /* 移动端圆角稍小 */
    }

    .slide-container {
        padding-top: 56.25%;
        /* 16:9 的比例 */
    }

    .caption h3 {
        font-size: 1rem;
    }
}

/* 控制按钮 */
.carousel-simple .controls {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
}

.carousel-simple .controls button {
    background: rgba(255, 255, 255, 0.5);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    margin: 0 10px;
    transition: background 0.3s;
}

.carousel-simple .controls button:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* 指示器 */
.carousel-simple .indicators {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.carousel-simple .indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s;
}

.carousel-simple .indicator.active {
    background: white;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.modal-content img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    margin: 0 auto;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}