/* ================= 广告位样式：视觉重量与普通 ui card 保持一致 ================= */

.mt-ad-card {
    border: 1px solid rgba(34, 36, 38, .15) !important;
    border-radius: .28571429rem !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .03) !important;
    background: #fff !important;
    padding: 0 !important;
    overflow: hidden;
    transition: box-shadow .25s ease, border-color .25s ease;
}

.mt-ad-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, .07) !important;
    border-color: rgba(34, 36, 38, .22) !important;
}

/* ---- A 位：限高裁切，底部自然淡出 ---- */
.mt-ad-crop {
    position: relative;
    height: 238px;
    overflow: hidden;
    cursor: pointer;
    background: #f6f8fa;
}

.mt-ad-crop img {
    display: block;
    width: 100%;
    height: auto;
    border: 0;
    transition: transform .45s ease;
}

.mt-ad-card:hover .mt-ad-crop img {
    transform: scale(1.03);
}

.mt-ad-crop::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 52px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, .96));
    pointer-events: none;
}

/* 图片角标：白底小胶囊，从页面里看更像一条提示而不是硬广 */
.mt-ad-badge {
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 2;
    font-size: 11px;
    line-height: 1.2;
    color: #185fa5;
    background: rgba(255, 255, 255, .95);
    border: 1px solid rgba(24, 95, 165, .18);
    border-radius: 11px;
    padding: 3px 9px;
    letter-spacing: .2px;
}

/* ---- 底部说明行 ---- */
.mt-ad-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px 9px;
    font-size: 11px;
    line-height: 1.4;
    background: #fff;
}

.mt-ad-label {
    color: #b9bdc2;
}

.mt-ad-more {
    color: #5f6368;
    cursor: pointer;
    transition: color .2s ease;
}

.mt-ad-card:hover .mt-ad-more {
    color: #00b5ad;
}

/* ---- B 位：整图不裁切，二维码完整 ---- */
.mt-ad-full {
    padding: 8px 8px 0;
    cursor: pointer;
    background: #fff;
}

.mt-ad-full img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 3px;
}

/* ---- 完整海报弹层 ---- */
.mt-ad-mask[hidden] {
    display: none !important;
}

.mt-ad-mask {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0, 0, 0, .5);
    animation: mtAdFade .18s ease;
}

@keyframes mtAdFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.mt-ad-dialog {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 400px;
    max-height: 86vh;
    overflow: auto;
    padding: 12px;
    background: #fff;
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
}

.mt-ad-dialog img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.mt-ad-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .35);
    color: #fff;
    font-size: 18px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
}

.mt-ad-close:hover {
    background: rgba(0, 0, 0, .5);
}

.mt-ad-dialog-tip {
    margin: 10px 2px 2px;
    font-size: 12px;
    line-height: 1.5;
    color: #8a8f94;
    text-align: center;
}

/* ---- 移动端 ---- */
@media screen and (max-width: 768px) {
    .mt-ad-crop {
        height: 200px;
    }

    .mt-ad-dialog {
        max-width: 340px;
    }
}

@media screen and (max-width: 480px) {
    .mt-ad-crop {
        height: 176px;
    }

    .mt-ad-crop::after {
        height: 40px;
    }

    .mt-ad-dialog {
        max-width: 100%;
        padding: 8px;
    }

    .mt-ad-close {
        top: 14px;
        right: 14px;
    }
}
