/**
 * B2 微信验证码登录弹窗专属样式
 */

/* 弹窗整体容器（采用独立ID与独立类名，彻底杜绝被B2主题全局.modal隐藏） */
#b2-wx-code-login-modal,
.b2-wx-custom-modal,
.b2-wx-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999999 !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

#b2-wx-code-login-modal.b2-wx-visible {
    display: flex !important;
}

/* 黑色半透明背景遮罩 */
.b2-wx-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1;
    animation: b2WxFadeIn 0.25s ease-out;
}

/* 弹窗核心白底卡片 */
.b2-wx-modal-box {
    position: relative;
    z-index: 2;
    background: #ffffff;
    width: 100%;
    max-width: 380px;
    padding: 30px 24px 26px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
    border-radius: 12px;
    animation: b2WxScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    text-align: center;
}

/* 暗色模式适配 */
body.dark-theme .b2-wx-modal-box,
.dark .b2-wx-modal-box {
    background: #23272e;
    color: #e6edf3;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

/* 关闭按钮 */
.b2-wx-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #999;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.b2-wx-close:hover {
    color: #ff3b30;
    background-color: rgba(0, 0, 0, 0.05);
    transform: rotate(90deg);
}

body.dark-theme .b2-wx-close:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

/* 顶部标题区 */
.b2-wx-header {
    margin-bottom: 18px;
}

.b2-wx-icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: rgba(7, 193, 96, 0.12);
    margin-bottom: 8px;
}

.b2-wx-title {
    font-size: 19px;
    font-weight: 600;
    color: #1f2328;
    margin: 0 0 4px;
}

body.dark-theme .b2-wx-title {
    color: #f0f6fc;
}

.b2-wx-subtitle {
    font-size: 13px;
    color: #656d76;
    margin: 0;
}

body.dark-theme .b2-wx-subtitle {
    color: #8b949e;
}

/* 二维码区域 */
.b2-wx-qrcode-wrapper {
    margin: 0 auto 20px;
}

.b2-wx-qrcode-box {
    display: inline-block;
    padding: 8px;
    background: #ffffff;
    border: 1px solid #eaeef2;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.b2-wx-qrcode-img {
    display: block;
    width: 170px;
    height: 170px;
    object-fit: cover;
    border-radius: 6px;
}

.b2-wx-empty-qrcode {
    width: 170px;
    height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 13px;
    background: #f7f9fa;
}

/* 操作步骤指引 */
.b2-wx-step-tip {
    margin-top: 10px;
    font-size: 12px;
    color: #57606a;
    line-height: 1.5;
}

body.dark-theme .b2-wx-step-tip {
    color: #8b949e;
}

.b2-wx-step-badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    color: #07C160;
    background: rgba(7, 193, 96, 0.1);
    border-radius: 4px;
    margin-right: 4px;
}

/* 表单与输入框 */
.b2-wx-form {
    margin-top: 15px;
}

.b2-wx-input-group {
    margin-bottom: 12px;
}

.b2-wx-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 2px;
    text-align: center;
    color: #1f2328;
    background-color: #f6f8fa;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.b2-wx-input:focus {
    border-color: #07C160;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.2);
}

body.dark-theme .b2-wx-input {
    background-color: #161b22;
    border-color: #30363d;
    color: #c9d1d9;
}

body.dark-theme .b2-wx-input:focus {
    background-color: #0d1117;
    border-color: #07C160;
}

/* 消息提示框 */
.b2-wx-msg-box {
    font-size: 13px;
    padding: 6px 10px;
    margin-bottom: 12px;
    border-radius: 6px;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.b2-wx-msg-box.is-error {
    background-color: #ffebe9;
    color: #cf222e;
    border: 1px solid rgba(255, 129, 130, 0.4);
}

.b2-wx-msg-box.is-success {
    background-color: #dafbe1;
    color: #1a7f37;
    border: 1px solid rgba(74, 194, 107, 0.4);
}

/* 提交登录按钮 */
.b2-wx-submit-btn {
    width: 100%;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #07C160 !important;
    color: #ffffff !important;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.25);
    transition: all 0.2s ease;
}

.b2-wx-submit-btn:hover {
    background-color: #06ad56 !important;
    box-shadow: 0 6px 16px rgba(7, 193, 96, 0.35);
    transform: translateY(-1px);
}

.b2-wx-submit-btn:active {
    transform: translateY(0);
}

.b2-wx-submit-btn[disabled] {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* 动画定义 */
@keyframes b2WxFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes b2WxScaleUp {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
