/* ==========================================================================
   首页广告位（预留固定比例防 CLS，显著标注"广告"）
   ========================================================================== */

.ad-slot {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.ad-slot-inner-wrap {
    position: relative;
    width: 100%;
    /* 通过 CSS 变量设置设计宽高，移动端宽度缩小时高度按比例自动调整（CLS ≤ 0.1） */
    aspect-ratio: var(--ad-w, 1200) / var(--ad-h, 200);
    border-radius: var(--radius, 8px);
    overflow: hidden;
    background: var(--color-bg, #F8F9FA);
}

/* “广告”合规标识：左上角常驻，半透明黑底白字 */
.ad-identify-label {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
    font-size: 11px;
    line-height: 1;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    padding: 3px 7px;
    border-radius: 3px;
    pointer-events: none;
    letter-spacing: 1px;
}

/* 直客广告 */
.ad-banner {
    display: block;
    width: 100%;
    height: 100%;
}

.ad-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ad-banner-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #FFF3EE, #F8F9FA);
    color: var(--color-text-secondary, #6C757D);
    font-size: 18px;
    font-weight: 600;
}

/* 招租占位 */
.ad-slot-placeholder {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: var(--color-text-secondary, #6C757D);
    border: 1px dashed var(--color-border, #E9ECEF);
    border-radius: var(--radius, 8px);
    background: var(--color-surface, #fff);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.ad-slot-placeholder:hover {
    border-color: var(--color-primary, #FF6B35);
    color: var(--color-primary, #FF6B35);
}

.ad-placeholder-text {
    font-size: 15px;
}

.ad-placeholder-btn {
    font-size: 13px;
    color: #fff;
    background: var(--color-primary, #FF6B35);
    padding: 5px 16px;
    border-radius: 999px;
}

/* 百度联盟代码容器 */
.ad-union-code {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-union-code iframe,
.ad-union-code ins {
    max-width: 100%;
}

/* 间距：广告位 A 在今日焦点之后（2026-09-16 移位） */
#adHomeMid {
    margin-top: 0;
    margin-bottom: 24px;
}

/* 广告位 B 在热点资讯之后 */
#adHomeBottom {
    margin-top: 24px;
    margin-bottom: 24px;
}

/* 移动端：等比缩放会导致高度过小（375px 屏宽下 A 位仅 33px、B 位仅 20px，内容溢出），
   取消锁死宽高比，改用较大的最小高度保证广告可见性，图片 cover 填充、占位内容居中。
   2026-09-16 二次增大：A 位 100→160、B 位 72→140（用户反馈区域仍太小） */
@media (max-width: 768px) {
    .ad-slot {
        padding: 0 12px;
    }

    .ad-slot-inner-wrap {
        aspect-ratio: auto;
        min-height: 160px;
    }

    #adHomeBottom .ad-slot-inner-wrap {
        min-height: 140px;
    }

    .ad-placeholder-text {
        font-size: 14px;
    }
}