/* 轮播图容器 */
.xn-carousel-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 20px;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background: #f0f0f0;  /* 加载前背景色 */
}

/* 轮播轨道 */
.xn-carousel-track {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;  /* 顶部对齐 */
    transition: transform 0.5s ease;
}

/* 轮播项 */
.xn-carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    position: relative;
    line-height: 0;  /* 消除间隙 */
}

.xn-carousel-slide a {
    display: block;
    width: 100%;
    position: relative;
}

/* 图片自适应 */
.xn-carousel-slide img {
    width: 100%;
    height: auto;
    display: block;
}

/* 标题定位在图片底部 */
.xn-carousel-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: #fff;
    padding: 40px 20px 15px;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.4;
}

/* 指示器 - 固定在底部 */
.xn-carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.xn-carousel-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.6);
    cursor: pointer;
}

.xn-carousel-dots .dot.active {
    background: #fff;
}

/* 箭头 */
.xn-carousel-prev,
.xn-carousel-next {
    position: absolute;
    top: 40%;  /* 稍微靠上 */
    transform: translateY(-50%);
    width: 40px;
    height: 60px;
    background: rgba(0,0,0,0.4);
    color: #fff;
    text-align: center;
    line-height: 60px;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s;
}

.xn-carousel-container:hover .xn-carousel-prev,
.xn-carousel-container:hover .xn-carousel-next {
    opacity: 1;
}

.xn-carousel-prev { left: 0; border-radius: 0 4px 4px 0; }
.xn-carousel-next { right: 0; border-radius: 4px 0 0 4px; }

/* 移动端 */
@media (max-width: 768px) {
    .xn-carousel-container {
        border-radius: 0;
    }
    .xn-carousel-prev,
    .xn-carousel-next {
        opacity: 1;
        width: 30px;
        height: 50px;
        line-height: 50px;
    }
}