/* XB 登录弹窗 & Toast —— 参考 website-collect 项目风格 */

/* Toast 提示 */
.xb-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    z-index: 4000;
    max-width: 80%;
    padding: 12px 22px;
    background: rgba(24, 33, 49, 0.92);
    color: #fff;
    border-radius: 24px;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-20px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    pointer-events: none;
}

.xb-toast.xb-toast-show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* 登录弹窗 */
.xb-login-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

.xb-login-modal.xb-login-modal-show {
    display: flex;
}

.xb-login-mask {
    position: absolute;
    inset: 0;
    background: rgba(9, 22, 42, 0.48);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.xb-login-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    justify-content: center;
}

.xb-login-card {
    position: relative;
    width: min(100%, 460px);
    padding: 34px 30px;
    border: 1px solid rgba(24, 33, 49, 0.08);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-sizing: border-box;
}

.xb-login-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(21, 58, 107, 0.08);
    color: #555;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.25s ease;
}

.xb-login-close:hover {
    color: #156ac3;
    background: rgba(21, 58, 107, 0.12);
}

.xb-login-header {
    margin-bottom: 28px;
}

.xb-login-title {
    margin: 0 0 8px;
    font-size: 1.9rem;
    color: #153a6b;
    line-height: 1.3;
}

.xb-login-desc {
    margin: 0;
    color: #555;
    font-size: 0.92rem;
    line-height: 1.8;
}

.xb-login-form {
    display: grid;
    gap: 18px;
}

.xb-form-field {
    display: grid;
    gap: 10px;
}

.xb-form-field > span {
    color: #182131;
    font-size: 0.92rem;
    font-weight: 600;
}

.xb-input {
    height: 46px;
    padding: 0 16px;
    border: 1px solid rgba(24, 33, 49, 0.12);
    border-radius: 14px;
    outline: none;
    color: #182131;
    background: rgba(255, 255, 255, 0.96);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    font-size: 14px;
    box-sizing: border-box;
}

.xb-input:focus {
    border-color: rgba(21, 58, 107, 0.34);
    box-shadow: 0 0 0 4px rgba(21, 58, 107, 0.08);
}

.xb-code-field {
    display: flex;
    gap: 10px;
}

.xb-code-field .xb-input {
    flex: 1;
    min-width: 0;
}

.xb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.25s ease, color 0.25s ease, opacity 0.25s ease;
    box-sizing: border-box;
}

.xb-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.xb-btn-outline {
    min-width: 118px;
    padding: 0 16px;
    height: 46px;
    background: transparent;
    border: 1px solid rgba(21, 58, 107, 0.3);
    color: #156ac3;
    white-space: nowrap;
}

.xb-btn-outline:hover:not(:disabled) {
    background: rgba(21, 58, 107, 0.06);
}

.xb-btn-primary {
    height: 46px;
    width: 100%;
    background: #156ac3;
    color: #fff;
}

.xb-btn-primary:hover:not(:disabled) {
    background: #125ab5;
}

.xb-login-tips {
    margin: 22px 0 0;
    padding-top: 18px;
    border-top: 1px solid rgba(24, 33, 49, 0.08);
    color: #555;
    font-size: 0.88rem;
    line-height: 1.8;
}

.xb-cancel-btn {
    display: block;
    margin: 16px auto 0;
    border: 0;
    background: none;
    color: #888;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.25s ease;
}

.xb-cancel-btn:hover {
    color: #156ac3;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .xb-login-modal {
        padding: 18px;
    }
    .xb-login-card {
        padding: 28px 22px;
    }
    .xb-code-field {
        flex-direction: column;
    }
    .xb-btn-outline {
        width: 100%;
    }
    .xb-login-title {
        font-size: 1.6rem;
    }
}

/* ============ 顶部导航栏登录入口 ============ */
/* 仅注入登录按钮，保持原导航 li 样式完全不变 */
.header_m {
    width: auto !important;
    max-width: 1280px;
    padding: 0 24px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header_m > img {
    flex-shrink: 0;
}

.header ul {
    white-space: nowrap;
    float: none !important;
}

.header ul li.xb-nav-auth {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: auto;
    min-width: 0;
    padding: 0 0 0 12px;
    box-sizing: border-box;
    vertical-align: middle;
}

.xb-nav-login,
.xb-nav-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 18px;
    border: 0;
    border-radius: 17px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, opacity 0.25s ease;
    box-sizing: border-box;
    white-space: nowrap;
}

.xb-nav-login {
    background: #FF5750;
    color: #fff;
}

.xb-nav-login:hover {
    background: #ff443d;
}

.xb-nav-logout {
    background: rgba(24, 33, 49, 0.06);
    color: #333;
}

.xb-nav-logout:hover {
    background: rgba(24, 33, 49, 0.12);
    color: #FF5750;
}

.xb-nav-user {
    display: inline-block;
    max-width: 140px;
    color: #333;
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    padding: 0 4px;
}

/* 手机模式：导航栏通常隐藏或紧凑布局，登录入口缩窄 */
.header-phone .xb-nav-auth {
    min-width: 70px;
    padding: 0 8px;
}

.header-phone .xb-nav-user {
    max-width: 80px;
}

.xb-nav-login:disabled,
.xb-nav-logout:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
