/* ============================================
   逗号CMS - 广告系统样式
   所有广告相关样式集中在此，任何模板引用此文件即可
   ============================================ */

/* ========== 广告轮播样式 ========== */
.ad-slider {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: #f5f5f5;
}
.ad-slider .ad-slider-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease;
    will-change: transform;
}
.ad-slider .ad-slide {
    flex-shrink: 0;
    flex-grow: 0;
    flex-basis: 100%;
    min-width: 100%;
    height: 100%;
    overflow: hidden;
}
.ad-slider .ad-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ad-slider .ad-slide a {
    display: block;
    width: 100%;
    height: 100%;
}
.ad-slider .ad-slide a img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ad-slider-prev,
.ad-slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 16px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}
.ad-slider-prev:hover,
.ad-slider-next:hover {
    background: rgba(0, 0, 0, 0.7);
}
.ad-slider-prev { left: 10px; }
.ad-slider-next { right: 10px; }
.ad-slider-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}
.ad-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
}
.ad-dot.active {
    background: #FF6B35;
}
.ad-dot:hover {
    background: #FF6B35;
}

/* ========== 轮播图容器 ========== */
.banner {
    margin: 0 auto 20px;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    background: #f5f5f5;
}
.banner .ad-slider {
    border-radius: 0;
    height: 100%;
}
.banner .ad-slider img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========== 网站横幅广告位 ========== */
.header-banner {
    padding: 1px;
    text-align: center;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
    overflow: hidden;
    max-width: 100%;
}
.header-banner img {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    width: auto;
    display: inline-block;
    object-fit: contain;
}
.header-banner a {
    display: inline-block;
    max-width: 100%;
}
.header-banner .ad-slider {
    height: 90px;
    max-width: 100%;
    margin: 0 auto;
}
.header-banner .ad-slider .ad-slide {
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.header-banner .ad-slider .ad-slide img {
    max-height: 90px;
    height: auto;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}
.header-banner .ad-slider .ad-slide a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    max-width: 100%;
}
.header-banner .ad-slider .ad-slider-track {
    height: 90px;
}
.header-banner .ad-slider .ad-slider-prev,
.header-banner .ad-slider .ad-slider-next {
    display: none;
}
.header-banner .ad-slider .ad-slider-dots {
    display: none;
}

/* ========== 底部悬浮广告 ========== */
.footer-float-ad {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    padding: 1px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
    box-sizing: border-box;
}
.footer-float-ad .close-btn {
    position: absolute;
    right: 10px;
    top: -12px;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 14px;
    line-height: 28px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
    transition: background 0.3s;
}
.footer-float-ad .close-btn:hover {
    background: #c0392b;
}
.footer-float-ad .ad-content {
    padding: 1px;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
}
.footer-float-ad .ad-content img {
    max-height: 80px;
    width: auto;
    max-width: 100%;
    display: inline-block;
}
.footer-float-ad .ad-content a {
    display: inline-block;
    max-width: 100%;
}
.footer-float-ad .ad-content .ad-slider {
    height: 80px;
    max-width: 100%;
    margin: 0 auto;
}
.footer-float-ad .ad-content .ad-slider .ad-slide {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.footer-float-ad .ad-content .ad-slider .ad-slide img {
    height: 80px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}
.footer-float-ad .ad-content .ad-slider .ad-slide a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* ========== 阅读全文广告弹窗 ========== */
.readmore-ad-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}
.readmore-ad-overlay.show {
    display: flex;
}
.readmore-ad-box {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    max-width: 520px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.readmore-ad-box .ad-tip {
    text-align: center;
    font-size: 15px;
    color: #555;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.readmore-ad-box .ad-tip .countdown-number {
    display: inline-block;
    font-size: 22px;
    font-weight: 700;
    color: #FF6B35;
    min-width: 30px;
    text-align: center;
    background: #fff3e0;
    padding: 0 10px;
    border-radius: 6px;
    line-height: 1.4;
}
.readmore-ad-box .ad-tip .countdown-text {
    font-size: 15px;
    color: #555;
}
.readmore-ad-box .ad-body {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}
.readmore-ad-box .ad-body img {
    max-width: 100%;
    height: auto;
}

/* ========== 随机广告包裹 ========== */
.ad-random-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .ad-slider {
        height: 220px;
    }
    .ad-slider-prev,
    .ad-slider-next {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    .banner {
        height: auto;
    }
    .banner .ad-slider img {
        height: 220px;
    }
    .header-banner .ad-slider {
        height: 60px;
    }
    .header-banner .ad-slider .ad-slide {
        height: 60px;
    }
    .header-banner .ad-slider .ad-slide img {
        max-height: 60px;
    }
    .header-banner .ad-slider .ad-slider-track {
        height: 60px;
    }
    .footer-float-ad {
        padding: 6px 10px;
    }
    .footer-float-ad .ad-content {
        padding: 0 25px;
    }
    .footer-float-ad .close-btn {
        width: 22px;
        height: 22px;
        font-size: 11px;
        line-height: 22px;
        top: -10px;
        right: 5px;
    }
    .footer-float-ad .ad-content img {
        max-height: 50px;
    }
    .footer-float-ad .ad-content .ad-slider {
        height: 50px;
    }
    .footer-float-ad .ad-content .ad-slider .ad-slide {
        height: 50px;
    }
    .footer-float-ad .ad-content .ad-slider .ad-slide img {
        height: 50px;
    }
    .readmore-ad-box {
        padding: 20px;
    }
    .readmore-ad-box .ad-tip .countdown-number {
        font-size: 18px;
        min-width: 24px;
    }
    .readmore-ad-box .ad-tip .countdown-text {
        font-size: 13px;
    }
}

@media (min-width: 769px) {
    .ad-slider {
        height: 420px;
    }
}