/* ==========================================================================
 * [v38-fix10] 登录/注册/找回密码弹窗：左侧背景图 + 双列布局（参考技术巢 js.vmccc.com）
 * 依赖：JS 注入 .b2child-login-bg 到 .login-box-content 首子之前，并加 .b2child-login-bg-active
 * 关闭开关（login_bg_enable=false）时，下面的样式不生效
 * ========================================================================== */

/* 注入的左侧背景区块 */
.b2child-login-bg {
    display: none;
}

/* 仅当子主题开关打开且 JS 已注入时启用样式 */
.b2child-login-bg-active .b2child-login-bg {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;  /* 内容贴底部 */
    flex: 0 0 50% !important;
    width: 50% !important;
    max-width: 400px !important;
    min-height: 0 !important;
    align-self: auto !important;           /* 跟随父容器 stretch（左右等高） */
    height: auto !important;
    position: relative !important;
    overflow: hidden !important;
    background-color: #1f2330 !important;
    background-size: cover !important;
    background-position: center 0 !important;   /* 顶部对齐（参考技术巢） */
    background-repeat: no-repeat !important;
}

/* 左列底部渐变遮罩（对齐参考 .wxlogin-sidebar）：顶部透明 → 底部 0.8 黑 */
.b2child-login-bg-active .b2child-login-bg::after {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: 100% !important;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,.8) 100%) !important;
    pointer-events: none !important;
    z-index: 2 !important;
}

.b2child-login-bg-active .login-box-content .login-box-top {
    flex: 1 1 55% !important;
    width: 55% !important;
    min-width: 280px !important;
    box-sizing: border-box !important;
    background: #fff !important;
}

.b2child-login-bg-active .login-box-content {
    display: flex !important;
    width: auto !important;
    max-width: 750px !important;           /* 参考：750px */
    flex-direction: row !important;
    /* 左右等高（stretch）——左列背景图完整铺满整列，参考站效果 */
    align-items: stretch !important;
    padding: 0 !important;
    background: #fff !important;
    border-radius: 15px !important;        /* 参考：圆角 15px */
    overflow: hidden !important;           /* 内容不溢出圆角 */
}

/* 强制让父主题 .modal-content 容器不限制宽度（双列需要更宽） */
.b2child-login-bg-active #login-box .modal-content.login-box-content {
    width: 750px !important;
    max-width: 95vw !important;
}

/* .login-bg-image: 全覆盖背景图 */
.b2child-login-bg .b2child-login-bg-image {
    position: absolute !important;
    inset: 0 !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    transform: scale(1.02);
    transition: transform .6s ease !important;
}

.b2child-login-bg-active .b2child-login-bg:hover .b2child-login-bg-image {
    transform: scale(1.06) !important;
}

/* 可选遮罩 */
.b2child-login-bg .b2child-login-bg-overlay {
    position: absolute !important;
    inset: 0 !important;
    pointer-events: none !important;
    z-index: 2 !important;
}

/* 文字层（在遮罩之上） */
.b2child-login-bg .b2child-login-bg-content {
    position: relative !important;
    z-index: 3 !important;
    padding: 32px 24px 24px !important;
    color: #fff !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.b2child-login-bg .b2child-login-bg-title {
    font-size: 20px !important;
    font-weight: 600 !important;
    line-height: 1.5 !important;          /* 参考 h3：1.5 行高 */
    margin: 0 0 10px 0 !important;        /* 参考 h3：下间距 10px */
    color: #fff !important;
    text-shadow: 0 1px 3px rgba(0,0,0,.4) !important;
    word-break: break-word !important;
}

.b2child-login-bg .b2child-login-bg-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.b2child-login-bg .b2child-login-bg-list li {
    display: flex !important;
    align-items: flex-start !important;
    gap: 8px !important;
    font-size: 14px !important;           /* 参考 p：14px */
    line-height: 1.8 !important;          /* 参考 p：1.8 行高 */
    color: rgba(255,255,255,.8) !important; /* 参考 p：0.8 透明度 */
    margin-bottom: 8px !important;        /* 参考 p：段间距 8px */
    text-shadow: 0 1px 2px rgba(0,0,0,.3) !important;
}

.b2child-login-bg .b2child-login-bg-list .b2child-login-bg-icon {
    flex: 0 0 auto !important;
    font-style: normal !important;
    font-size: 14px !important;
    line-height: 1.7 !important;
}

/* 移动端：彻底关掉双列效果，回到 B2 原生单列弹窗 */
@media (max-width: 768px) {
    .b2child-login-bg-active .b2child-login-bg,
    .b2child-login-bg-active .b2child-login-bg * {
        display: none !important;
    }
    .b2child-login-bg-active .login-box-content {
        display: block !important;
        flex-direction: column !important;
        max-width: 360px !important;
        width: auto !important;
        padding: 40px 24px 24px !important;
    }
    .b2child-login-bg-active .login-box-content .login-box-top {
        width: 100% !important;
        min-width: 0 !important;
        flex: 0 0 auto !important;
    }
    .b2child-login-bg-active #login-box .modal-content.login-box-content {
        width: 360px !important;
        max-width: 95vw !important;
    }
    .b2child-login-bg-active .login-box-content .login-social-button {
        width: 100% !important;
        padding: 0 !important;
    }
}

/* 关闭按钮：参考技术巢的简洁圆角 ×（不要 B2 默认的圆形灰底） */
.b2child-login-bg-active .login-box-content .close-button,
.b2child-login-bg-active #login-box .close-button,
.b2child-login-bg-active .login-box-content .login-box-close,
.b2child-login-bg-active .login-box-content [class*="close"] {
    z-index: 10 !important;
    color: #999 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 6px !important;
    width: 28px !important;
    height: 28px !important;
    line-height: 28px !important;
    font-size: 18px !important;
    font-weight: 300 !important;
    text-align: center !important;
    top: 10px !important;
    right: 10px !important;
    box-shadow: none !important;
    transition: color .2s ease, background .2s ease !important;
}
.b2child-login-bg-active .login-box-content .close-button:hover,
.b2child-login-bg-active .login-box-content .login-box-close:hover,
.b2child-login-bg-active .login-box-content [class*="close"]:hover {
    color: #333 !important;
    background: rgba(0,0,0,.06) !important;
}

@media (max-width: 768px) {
    .b2child-login-bg-active .login-box-content .close-button,
    .b2child-login-bg-active .login-box-content .login-box-close,
    .b2child-login-bg-active .login-box-content [class*="close"] {
        top: 4px !important;
        right: 4px !important;
    }
}

/* 兼容：将 B2 默认 .login-social-button（底部社交按钮）整体移到右侧表单底部 */
.b2child-login-bg-active .login-box-content .login-social-button {
    flex: 0 0 100% !important;
    width: 100% !important;
    padding: 0 24px 16px !important;
    box-sizing: border-box !important;
}

/* ===== 夜间模式适配（B2 body.night） =====
 * B2 夜间模式已处理登录框内部元素（input/logo/社交按钮），
 * 这里只覆盖被强制成白色的容器背景为夜间背景色 var(--beijing) */
body.night .b2child-login-bg-active .modal-content.login-box-content,
body.night .b2child-login-bg-active .login-box-content,
body.night .b2child-login-bg-active .login-box-content .login-box-top {
    background: var(--beijing) !important;
}
