/* Banner广告组件样式 */
/* 全宽包装器样式 */
.banner-wrapper {
    width: 100%;
    background-color: #f5f7fa; /* 与hosting-section的背景色保持一致 */
    padding: 0;
    margin: 0;
    overflow: hidden; /* 确保内容不溢出 */
    display: none; /* 默认隐藏，与banner-ad-container保持一致 */
}

/* 当banner显示时应用于hosting-section的样式 */
.has-banner + .hosting-section {
    padding-top: 20px; /* 当有banner时，减少hosting-section的顶部填充 */
}

.banner-ad-container {
    width: 100%;
    max-width: 1000px; /* 与主容器宽度一致 */
    margin: 20px auto 0; /* 只保留顶部边距，移除底部边距 */
    overflow: hidden;
    position: relative;
    display: none; /* 默认隐藏，有广告时由JS控制显示 */
    z-index: 10;
    min-height: 120px; /* 设置最小高度 */
    max-height: 160px; /* 降低最大高度，以适应1000px宽度 */
    background-color: #f5f7fa; /* 与hosting-section的背景色保持一致 */
    border-radius: 8px; /* 圆角边框 */
    box-shadow: none; /* 移除阴影效果 */
}

.banner-ads-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden; /* 确保滑动内容不溢出 */
}

.banner-ads-slider {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease; /* 添加平滑过渡效果 */
    will-change: transform; /* 优化动画性能 */
    cursor: grab; /* 显示抓取光标，提示用户可拖动 */
}

.banner-ads-slider:active {
    cursor: grabbing; /* 拖动时显示抓取中光标 */
}

.banner-ad {
    width: 100%;
    min-width: 100%; /* 确保每个广告占据整个容器宽度 */
    flex-shrink: 0; /* 防止广告被压缩 */
    position: relative;
    height: 100%;
    min-height: 120px;
    -webkit-user-drag: none; /* 防止图片被拖拽 */
    user-select: none; /* 防止文本被选中 */
}

.banner-ad img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    min-height: 120px; /* 最小高度 */
    max-height: 160px; /* 限制最大高度 */
    border-radius: 8px; /* 与容器相同的圆角 */
}

.banner-ad a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

/* 指示器样式 */
.banner-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 20;
    background-color: rgba(0, 0, 0, 0.2); /* 半透明黑色背景 */
    padding: 5px 10px;
    border-radius: 12px;
}

.banner-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.banner-indicator.active {
    background-color: #fff;
    transform: scale(1.2);
}

/* 左右导航按钮 */
.banner-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.4);
    border: none;
    border-radius: 8px; /* 改为方形圆角样式 */
    width: 40px; /* 增加宽度 */
    height: 40px; /* 增加高度 */
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7; /* 默认显示，但透明度低 */
    transition: opacity 0.3s ease, background-color 0.3s ease;
    z-index: 30; /* 确保在最上层 */
}

.banner-prev-btn {
    left: -50px; /* 初始位置在容器外侧 */
}

.banner-next-btn {
    right: -50px; /* 初始位置在容器外侧 */
}

/* 鼠标悬停时显示导航按钮 */
.banner-ad-container:hover .banner-prev-btn {
    left: 15px; /* 鼠标悬停时移动到容器内侧 */
}

.banner-ad-container:hover .banner-next-btn {
    right: 15px; /* 鼠标悬停时移动到容器内侧 */
}

.banner-nav-btn:hover {
    background-color: rgba(0, 0, 0, 0.7);
    opacity: 1 !important;
}

/* 占位图样式 */
.banner-ad .placeholder {
    width: 100%;
    height: 100%;
    min-height: 120px;
    background-color: transparent; /* 占位图背景也改为透明 */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 16px;
    border-radius: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .banner-ad-container {
        margin: 10px auto 0; /* 保持与桌面版一致的布局，只有顶部边距 */
        min-height: 60px;
    }
    
    .has-banner + .hosting-section {
        padding-top: 20px; /* 移动设备下也减少顶部填充 */
    }
    
    .banner-ad, .banner-ad img, .banner-ad .placeholder {
        min-height: 60px; /* 移动端最小高度 */
        border-radius: 6px; /* 移动端圆角稍小 */
    }
    
    .banner-nav-btn {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .banner-indicators {
        bottom: 5px;
    }
    
    .banner-indicator {
        width: 6px;
        height: 6px;
    }
} 