/* ══════════════════════════════════════════
   wz_ad 广告插件 - 前台样式
   原则：仅 .wz-ad- 前缀类名，绝对不污染外部
   ══════════════════════════════════════════ */

/* === 隔离容器（所有广告最外层以此包裹）=== */
.wz-ad-root {
    display: block;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    text-align: initial;
}

/* === 广告容器通用 === */
.wz-ad-container {
    margin: 14px 0;
}
.wz-ad-container a {
    display: block;
}
.wz-ad-container img {
    display: inline-block;
    max-width: 100%;
    vertical-align: top;
}

/* === 广告标识 === */
.wz-ad-badge-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
}
.wz-ad-badge-label {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    line-height: 1.4;
    pointer-events: none;
    z-index: 2;
}
/* === 关闭按钮 === */
.wz-ad-close {
    position: absolute;
    top: 0;
    left: 0;
    width: 22px;
    height: 22px;
    line-height: 20px;
    text-align: center;
    font-size: 16px;
    color: #666;
    background: rgba(255,255,255,0.85);
    border-radius: 0 0 4px 0;
    cursor: pointer;
    z-index: 10;
    transition: color 0.15s, background 0.15s;
}
.wz-ad-close:hover {
    color: #fff;
    background: #e74c3c;
}

/* === 弹窗广告 === */
.wz-ad-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99990;
    align-items: center;
    justify-content: center;
}
.wz-ad-popup-box {
    position: relative;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    max-width: 90vw;
    max-height: 85vh;
    overflow: auto;
    box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}
.wz-ad-popup-box .wz-ad-container {
    margin: 0;
}
.wz-ad-popup-close {
    position: absolute;
    top: 6px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    z-index: 1;
}
.wz-ad-popup-close:hover {
    color: #333;
}

/* === 右下角广告 === */
.wz-ad-corner-wrapper {
    position: fixed;
    bottom: 20px;
    right: 50px;
    z-index: 9995;
    max-width: 260px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    overflow: hidden;
}
.wz-ad-corner-wrapper:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.22);
}
.wz-ad-corner-wrapper .wz-ad-container {
    margin: 0;
}

/* === 侧栏广告 === */
.wz-ad-sidebar-wrapper {
    margin-bottom: 16px;
    border-radius: 4px;
}

/* === 侧边跟随广告 === */
.wz-ad-sticky-wrapper {
    margin-bottom: 16px;
    border-radius: 4px;
}

/* === 评论区广告 === */
.wz-ad-comment-wrapper {
    margin: 16px 0;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 4px;
    text-align: center;
}

/* === 左右对联广告 === */
.wz-ad-couplet-left,
.wz-ad-couplet-right {
    position: fixed;
    top: 30%;
    z-index: 9990;
    width: 120px;
    transform: translateY(-50%);
    pointer-events: none;
}
.wz-ad-couplet-left  { left: 5px; }
.wz-ad-couplet-right { right: 5px; }
.wz-ad-couplet-left .wz-ad-container,
.wz-ad-couplet-right .wz-ad-container {
    margin: 0;
}
.wz-ad-couplet-left  a,
.wz-ad-couplet-right a,
.wz-ad-couplet-left  .wz-ad-close,
.wz-ad-couplet-right .wz-ad-close,
.wz-ad-couplet-left  .wz-ad-badge-label,
.wz-ad-couplet-right .wz-ad-badge-label {
    pointer-events: auto;
}
.wz-ad-couplet-left  img,
.wz-ad-couplet-right img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}
@media (max-width: 1024px) {
    .wz-ad-couplet-left,
    .wz-ad-couplet-right {
        display: none;
    }
}

/* === 顶部通栏 === */
.wz-ad-headerbar-wrapper {
    width: 100%;
    max-width: 100vw;
    padding: 10px 0;
    background: #f8f8f8;
    overflow: hidden;
    contain: layout style;
}
.wz-ad-headerbar-wrapper .wz-ad-container {
    margin: 0 auto;
    display: block;
}

/* === 底部通栏 === */
.wz-ad-footer-wrapper {
    margin: 20px auto;
    max-width: 1200px;
    padding: 0 16px;
}
.wz-ad-footer-wrapper .wz-ad-container {
    display: block;
}

/* === 全屏插屏广告 === */
.wz-ad-interstitial-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,0.85);
    align-items: center;
    justify-content: center;
}
.wz-ad-interstitial-box {
    position: relative;
    max-width: 100vw;
    max-height: 100vh;
}
.wz-ad-interstitial-box .wz-ad-container {
    margin: 0;
}
.wz-ad-interstitial-box img {
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain;
}
.wz-ad-interstitial-countdown {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
}
.wz-ad-interstitial-skip {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}
.wz-ad-interstitial-skip:hover {
    background: rgba(0,0,0,0.8);
}
.wz-ad-interstitial-close {
    position: absolute;
    top: 10px;
    right: 16px;
    z-index: 2;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
}
.wz-ad-interstitial-close:hover {
    background: rgba(0,0,0,0.8);
}

/* === 滚动触发滑入广告 === */
.wz-ad-scrollin-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99990;
    transform: translateY(100%);
    transition: transform 0.4s ease;
    background: #fff;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.12);
    padding: 12px;
}
.wz-ad-scrollin-wrapper .wz-ad-container {
    margin: 0;
    display: block;
}
.wz-ad-scrollin-show {
    transform: translateY(0);
}
.wz-ad-scrollin-close {
    position: absolute;
    top: 6px;
    right: 12px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    z-index: 1;
}
.wz-ad-scrollin-close:hover {
    color: #333;
}

/* === 原生推荐广告 === */
.wz-ad-native {
    margin: 24px 0;
    padding: 16px;
    background: #fafafa;
    border-radius: 8px;
}
.wz-ad-native-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}
.wz-ad-native-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s;
}
.wz-ad-native-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}
.wz-ad-native-card img {
    width: 80px;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
}

/* === 404页面广告 === */
.wz-ad-404 {
    text-align: center;
    padding: 20px;
}

/* === 归档页/列表页信息流广告 === */
.wz-ad-archive,
.wz-ad-list-insert {
    margin: 16px 0;
    padding: 12px;
    border-radius: 6px;
    background: #fafafa;
    text-align: center;
}

/* === 搜索页广告 === */
.wz-ad-search {
    margin: 12px 0;
    text-align: center;
}

/* === 图片适配 === */
.wz-ad-img-fit-contain    { object-fit: contain !important; }
.wz-ad-img-fit-cover      { object-fit: cover !important; }
.wz-ad-img-fit-fill       { object-fit: fill !important; }
.wz-ad-img-fit-none       { object-fit: none !important; }
.wz-ad-img-fit-scale-down { object-fit: scale-down !important; }
