/* ========================================
   用户信息卡 (登录成功后) - 仿 SDK media/index/index2.html:208-265
   颜色按 5ss_gw 主题适配（蓝主色 #018FFF）

   颜色映射表：
   | SDK 颜色        | 5ss_gw 替换色           | 用途                          |
   |-----------------|------------------------|-------------------------------|
   | #FFA200         | #018FFF                | 余额数字 colorNum              |
   | #FFF5E1         | #E6F4FF                | VIP 进度底/余额卡底            |
   | #FCD28A         | 蓝色渐变 #018FFF→#5BB0FF | VIP 进度填充 progressLineWidth |
   | #75440E         | #666                   | VIP 文字/余额标签              |
   | rgba(0,90,255,0.2) | rgba(1,143,255,0.20) | 卡片阴影                      |
   | rgba(126,167,249,0.3) | rgba(1,143,255,0.25) | 头像阴影                   |
======================================== */

/* 面板容器 - 与 #loginpop 同位置/同尺寸，无缝切换 */
#userInfoPanel, #userInfoPanel * { box-sizing: border-box; }
#userInfoPanel {
    position: absolute !important;
    right: 20px !important;
    top: 42% !important;
    transform: translateY(-50%) !important;
    -webkit-transform: translateY(-50%) !important;
    display: none;          /* JS 切到 show */
    z-index: 10 !important;
    visibility: visible !important;
    opacity: 1 !important;
}
#userInfoPanel.show { display: block !important; }

/* 强制覆盖 register.css 中 #loginpop 的 display: block !important（否则 jQuery .hide() 无效）*/
#loginpop.hide { display: none !important; }

/* ===== 卡片本体（沿用 SDK .hasLoginViewDialog）===== */
.hasLoginViewDialog {
    width: 380px;            /* 与 #loginpop 卡片同宽（5ss_gw: 380 vs SDK 296） */
    min-height: 230px;
    background: #FFFFFF;
    box-shadow: 0 4px 20px rgba(1,143,255,0.20);
    border-radius: 5px;     /* 与现有登录面板一致 */
    margin: 0;
    box-sizing: border-box;
    padding: 18px 20px 20px 20px;
}
.hasLoginViewDialog .closeRightbox { display: none; }

/* ===== 头像行 ===== */
.avatarInfoBox { display: flex; align-items: center; }
.avatarInfoBox img {
    display: inline-block;
    width: 56px; height: 56px;
    box-shadow: 0 0 5px rgba(1,143,255,0.25);
    border-radius: 50%;
    margin-right: 14px;
    object-fit: cover;
    background: #F0F4F8;
}

/* ===== 右侧账号 + [退出] ===== */
.rightMainAccount { position: relative; flex: 1; min-width: 0; }
.rightMainAccount .name { font-size: 15px; font-weight: bold; color: #333; margin: 0; line-height: 1.4; }
.rightMainAccount .name a { color: #333; text-decoration: none; }
.rightMainAccount .out {
    margin-left: 6px; color: #018FFF;
    font-size: 12px; font-weight: normal;
    text-decoration: none; cursor: pointer;
}
.rightMainAccount .out:hover { text-decoration: underline; }

/* ===== VIP 等级 + 进度条 ===== */
.rightMainAccount .levelNum {
    color: #018FFF; font-size: 12px; font-weight: bold;
    margin-top: 6px; cursor: default;
    display: flex; align-items: center;
}
.rightMainAccount .progressBox {
    display: inline-block;
    width: 120px; height: 4px;
    background: #E6F4FF;
    border-radius: 2px;
    margin-left: 8px;
    position: relative; top: 0;
    flex: 1;
}
.progressLineWidth {
    display: inline-block; height: 100%;
    border-radius: 2px;
    position: absolute; left: 0; top: 0;
    background: linear-gradient(90deg, #018FFF, #5BB0FF);
    transition: width .3s ease;
}
.rightMainAccount .levelDetailBox { display: none; }

/* ===== 余额 5 列卡片 ===== */
.rechargeIntegral {
    width: 100%; min-height: 56px;
    background: #E6F4FF;
    border-radius: 4px;
    margin-top: 14px;
    display: flex; justify-content: space-between;
    box-sizing: border-box; padding: 10px 8px 8px;
}
.rechargeIntegral .fl { text-align: center; flex: 1; min-width: 0; }
.colorIntegral { color: #666; font-size: 11px; margin: 0; line-height: 1.3; }
.colorNum { color: #018FFF; font-size: 14px; font-weight: bold; margin: 2px 0 0; line-height: 1.2; }

/* ===== 退出按钮 .logout_js（5ss_gw 蓝色链接，与现有 .blue 类一致）===== */
.logout_js { color: #018FFF !important; text-decoration: none; }
.logout_js:hover { text-decoration: underline !important; }

/* ===== 图2：顶栏用户区（融入现有 .common-nav 白色半透明顶栏）===== */
.common-nav .nav-user-info {
    display: none;
    align-items: center; gap: 8px;
    margin-left: auto;
    color: #333;
}
.common-nav .nav-user-info.show { display: inline-flex; }
.common-nav .nav-user-info .nav-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 1px solid #eee;
    object-fit: cover;
    background: #F0F4F8;
}
.common-nav .nav-user-info .nav-name {
    color: #333; font-size: 14px;
    max-width: 140px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
    font-weight: 500;
}
.common-nav .nav-user-info .nav-logout_js {
    color: #018FFF; font-size: 12px;
    text-decoration: none; cursor: pointer;
}
.common-nav .nav-user-info .nav-logout_js:hover { text-decoration: underline; }

/* 顶栏原菜单与新用户区需要同列对齐 - 把 .main 改为 flex，nav-inner 居中 */
.common-nav .nav-menu .main { display: flex; align-items: center; }
.common-nav .nav-menu .nav-inner { display: flex; flex: 1; justify-content: center; margin: 0; padding: 0; }

/* ===== 响应式 ===== */
@media screen and (max-width: 600px) and (min-width: 481px) {
    #userInfoPanel {
        left: 50% !important;
        right: auto !important;
        transform: translate(-50%, -50%) !important;
    }
    .hasLoginViewDialog { width: 90% !important; max-width: 400px; }
    .rechargeIntegral { padding: 8px 4px 6px; }
    .colorNum { font-size: 13px; }
    .common-nav .nav-user-info .nav-name { max-width: 80px; }
}

@media screen and (max-width: 480px) {
    #userInfoPanel {
        left: 50% !important;
        right: auto !important;
        transform: translate(-50%, -50%) !important;
        top: 45% !important;
    }
    .hasLoginViewDialog { width: calc(100vw - 32px) !important; max-width: 380px; min-width: 300px; }
    .avatarInfoBox img { width: 48px; height: 48px; }
    .rightMainAccount .name { font-size: 14px; }
    .rightMainAccount .levelNum { font-size: 11px; }
    .rightMainAccount .progressBox { width: 80px; }
    /* 小屏余额改为 2 行布局：第一行 3 列，第二行 2 列 */
    .rechargeIntegral { flex-wrap: wrap; }
    .rechargeIntegral .fl { flex: 0 0 33.333%; margin-bottom: 4px; }
    .rechargeIntegral .fl:nth-child(4),
    .rechargeIntegral .fl:nth-child(5) { flex: 0 0 50%; }
    .colorIntegral { font-size: 10px; }
    .colorNum { font-size: 12px; }
    /* 小屏隐藏顶栏用户区（避免挤压 nav 菜单）*/
    .common-nav .nav-user-info { display: none !important; }
}
