/* 基础样式 */
body {
    margin: 0;
    font-family: Arial, sans-serif;
}

.content {
    padding: 20px;
    min-height: 2000px; /* 模拟长页面 */
}

/* 广告容器样式 - 修改为右下角固定 */
.ad-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px; /* 默认宽度调整为更小 */
    background-color: #fff;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.12);
    border: 1px solid #e0e0e0;
    z-index: 1000;
    transition: all 0.5s ease-in-out;
    transform: translateX(120%);
    border-radius: 8px;
    overflow: hidden;
    max-height: 80vh; /* 最大高度调整为视口的80% */
}

.ad-container.show {
    transform: translateX(0);
}

.close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    transition: all 0.3s;
    z-index: 1001;
    background: rgba(255, 255, 255, 0.9);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close-btn:hover {
    color: #333;
    background: rgba(255, 255, 255, 1);
}

/* Swiper 自定义样式 */
.ad-swiper {
    width: 100%;
    height: auto;
}

.ad-slide {
    padding: 12px;
    box-sizing: border-box;
}

.ad-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
    height: auto;
}

.ad-image {
    width: 100%;
    margin-bottom: 12px;
}

.ad-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ad-text {
    width: 100%;
    text-align: center;
    padding: 0 10px;
}

.ad-text h3 {
    margin: 0 0 8px 0;
    color: var(--style-color);
    font-size: 18px;
    line-height: 1.3;
}

.ad-text p {
    margin: 0 0 12px 0;
    color: #555;
    font-size: 14px;
    line-height: 1.4;
}

.ad-button {
    display: inline-block;
    padding: 7px 20px;
    background-color: var(--style-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.3s;
    font-size: 13px;
}

.ad-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* 新增的按钮样式 */
.ad-container .btn {
    width: 140px;
    margin-top: 15px;
    padding: 8px 15px;
}

/* Swiper 导航按钮样式 */
.swiper-button-next, .swiper-button-prev {
    color: #fff;
    background: var(--style-color);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.swiper-button-prev::before, .swiper-button-next::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 80%;
    height: 80%;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
}

.swiper-button-next:after, .swiper-button-prev:after {
    font-size: 14px;
    position: relative;
    z-index: 1;
}

.swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: #ddd;
    opacity: 1;
}

.swiper-pagination-bullet-active {
    background: var(--style-color);
}

/* 响应式设计 - 移动端优先 */
@media (max-width: 480px) {
    .ad-container {
        width: 90%;
        max-width: 300px;
        right: 10px;
        bottom: 10px;
        max-height: 70vh;
    }
    
    .ad-slide {
        padding: 10px;
    }
    
    .ad-text h3 {
        font-size: 16px;
        margin-bottom: 6px;
    }
    
    .ad-text p {
        font-size: 13px;
        margin-bottom: 10px;
    }
    
    .ad-container .btn {
        width: 120px;
        padding: 6px 12px;
        font-size: 12px;
        margin-top: 10px;
    }
    
    .swiper-button-next, .swiper-button-prev {
        display: none;
    }
    
    .close-btn {
        top: 5px;
        right: 5px;
        font-size: 18px;
        width: 22px;
        height: 22px;
    }
}

/* 中等屏幕适配 */
@media (min-width: 481px) and (max-width: 767px) {
    .ad-container {
        width: 350px;
        right: 15px;
    }
}

/* 大屏幕适配 */
@media (min-width: 768px) {
    .ad-container {
        width: 380px;
        right: 20px;
    }
}

/* 超大屏幕适配 */
@media (min-width: 1200px) {
    .ad-container {
        width: 400px;
    }
    
    .swiper-button-next, .swiper-button-prev {
        width: 30px;
        height: 30px;
    }
    
    .swiper-button-next:after, .swiper-button-prev:after {
        font-size: 16px;
    }
}
@media (min-width: 1200px) {
    .prev-btn,.next-btn {
        font-size: 30px;
    }
}
.ad-container .btn {
    width: 160px;
    color: #fff;
    background: var(--style-color);
}