/* ----------------------------------------------------------------------
 * 首页图片弹框（广告位）—— 全屏半透明暗色遮罩 + 居中大图
 * ----------------------------------------------------------------------
 * 作用域：所有选择器均以 .home-popup 前缀命名，对既有样式零副作用。
 * z-index：10001 —— 高于右侧悬浮栏(9999) 与 微信二维码遮罩(10000)，
 *          见 app/index/view/public/float.html。
 * 仅当后台存在「启用」记录时，模板才输出 #homePopup DOM 并加载本样式相关行为。
 * ---------------------------------------------------------------------- */

/* 遮罩容器：默认不占位，由 JS 加 .is-ready 显示、加 .is-open 淡入 */
.home-popup {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .28s ease;
}

.home-popup.is-ready { display: flex; }
.home-popup.is-open  { opacity: 1; }

/* 半透明暗色遮罩层（点击其空白区域可关闭） */
.home-popup__mask {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, .6);
}

/* 居中弹层：承载大图与关闭按钮，带轻微缩放入场 */
.home-popup__layer {
    position: relative;
    max-width: 90vw;
    max-height: 80vh;
    line-height: 0;
    transform: scale(.94);
    transition: transform .28s ease;
}

.home-popup.is-open .home-popup__layer { transform: scale(1); }

/* 大图：等比缩放，不超出视口 */
.home-popup__link {
    display: block;
    line-height: 0;
    cursor: pointer;
}

/* url 为空时仅展示、不可点 */
.home-popup__link.is-static { cursor: default; }

.home-popup__img {
    display: block;
    width: auto;
    height: auto;
    max-width: 90vw;
    max-height: 80vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .45);
}

/* 关闭按钮：置于弹层右上角内侧，任何图片尺寸/视口下都不会被裁切 */
.home-popup__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .5);
    color: #fff;
    font-size: 26px;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
    transition: background .2s ease;
}

.home-popup__close:hover { background: #dc291e; }

/* 移动端自适应：收紧最大尺寸并缩小关闭按钮 */
@media (max-width: 768px) {
    .home-popup__layer,
    .home-popup__img {
        max-width: 92vw;
        max-height: 74vh;
    }

    .home-popup__close {
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
        font-size: 22px;
        line-height: 30px;
    }
}
