/* 广告投放单元 — 强制明显「广告」角标 */

.b2-ad-unit {
    position: relative;
    box-sizing: border-box;
}

.b2-ad-unit__link {
    display: block;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(42, 24, 16, 0.08);
}

.b2-ad-unit__badge {
    position: absolute;
    z-index: 3;
    top: 8px;
    left: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 22px;
    padding: 0 8px;
    border-radius: 4px;
    background: #6f0718;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1;
    box-shadow: 0 1px 4px rgba(42, 24, 16, 0.25);
    pointer-events: none;
}

.b2-ad-unit__cover {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #f3f0ed;
    overflow: hidden;
}

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

.b2-ad-unit__body {
    padding: 10px 12px 12px;
}

.b2-ad-unit__title {
    font-size: 14px;
    font-weight: 650;
    color: #2a1810;
    line-height: 1.35;
}

.b2-ad-unit__sub {
    margin-top: 4px;
    font-size: 12px;
    color: #8a7368;
    line-height: 1.4;
}

/* 信息流插卡：占满一列 */
.b2-ad-feed-item {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
    width: 100%;
    grid-column: 1 / -1;
}

.b2-ad-feed-item .b2-ad-unit__link {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: stretch;
    min-height: 84px;
}

.b2-ad-feed-item .b2-ad-unit__cover {
    aspect-ratio: auto;
    height: 100%;
    min-height: 84px;
}

.b2-ad-feed-item .b2-ad-unit__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 文章底横幅 */
.b2-ad-single-bottom {
    margin: 16px 12px 20px;
    max-width: 720px;
}

.b2-ad-unit--banner .b2-ad-unit__link {
    display: block;
}

.b2-ad-unit--banner .b2-ad-unit__cover {
    aspect-ratio: 2.4 / 1;
    max-height: 160px;
}

.b2-ad-unit--banner .b2-ad-unit__badge {
    top: 10px;
    left: 10px;
    height: 24px;
    min-width: 42px;
    font-size: 12px;
    padding: 0 10px;
}

@media (min-width: 769px) {
    .b2-ad-single-bottom {
        margin: 20px auto;
        padding: 0 20px;
    }

    .b2-ad-feed-item .b2-ad-unit__link {
        grid-template-columns: 160px 1fr;
        min-height: 100px;
    }
}

/* 双列首页：广告通栏 */
#home-row-new .b2-ad-feed-item,
.post-list .b2-ad-feed-item,
ul.b2_gap > .b2-ad-feed-item {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
}
