/* ===== 用户信息气泡 ===== */
.xw_user-profile {
    position: relative;
}

.xw_user-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: -6px;
    background: var(--xw_navbar-dropdown-bg, #fff);
    border: 1px solid rgba(0,0,0,.06);
    width: 220px;
    border-radius: 8px;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: all .2s cubic-bezier(.4,0,.2,1);
    z-index: 1001;
    box-shadow: 0 8px 24px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04);
}

.xw_user-popover::before {
    content: '';
    position: absolute;
    top: -5px;
    right: 24px;
    width: 10px;
    height: 10px;
    background: var(--xw_navbar-dropdown-bg, #fff);
    border: 1px solid rgba(0,0,0,.06);
    border-right: none;
    border-bottom: none;
    transform: rotate(45deg);
}

.xw_user-profile.xw_user-open .xw_user-popover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 头部：头像 + 信息 + 设置图标 */
.xw_user-popover-top {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 12px;
    position: relative;
}

.xw_user-popover-setting {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #86909c;
    cursor: pointer;
    transition: all .15s ease;
}

.xw_user-popover-setting:hover {
    background: var(--xw-bg-hover);
    color: #4e5969;
}

.xw_user-popover-avatar img {
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    object-fit: cover;
}

.xw_user-popover-info {
    min-width: 0;
}

.xw_user-popover-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--xw_text-default-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.xw_user-popover-code {
    font-size: 11px;
    color: #86909c;
    margin-top: 2px;
}

/* 按钮 */
.xw_user-popover-actions {
    padding: 0 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.xw_user-popover-btn {
    height: 32px;
    line-height: 32px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    transition: all .15s ease;
}

.xw_user-popover-btn:first-child {
    background: var(--xw-accent, #1456f0);
    color: #fff;
}
.xw_user-popover-btn:first-child:hover {
    filter: brightness(1.15);
}

.xw_user-popover-btn:last-child {
    background: var(--xw_navbar-dropdown-hover-bg);
    color: var(--xw_text-default-color);
}
.xw_user-popover-btn:last-child:hover { background: var(--xw-bg-hover); }

/* 租户切换 */
.xw_user-popover-tenants {
    padding: 0 12px 8px;
    border-top: 1px solid rgba(0,0,0,.05);
    padding-top: 8px;
}

.xw_user-popover-tenant-label {
    font-size: 11px;
    color: #86909c;
    padding: 0 4px 6px;
}

.xw_user-popover-tenant-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 30px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--xw_text-default-color);
    cursor: pointer;
    transition: all .15s ease;
}

.xw_user-popover-tenant-item:hover {
    background: var(--xw_navbar-dropdown-hover-bg, #f2f3f5);
}

.xw_user-popover-tenant-item.active {
    background: rgba(20,86,240,.08);
    color: var(--xw-accent, #1456f0);
    font-weight: 600;
}

.xw_user-popover-tenant-item .tenant-code {
    font-size: 11px;
    color: #86909c;
    font-weight: 400;
}

/* 退出登录 */
.xw_user-popover-logout {
    padding: 8px 16px;
    text-align: center;
    font-size: 12px;
    color: #a9aeb8;
    cursor: pointer;
    border-top: 1px solid rgba(0,0,0,.05);
    transition: color .15s ease;
}

.xw_user-popover-logout:hover { color: #f53f3f; }

/* ===== 头像：无头像时展示占位图标（不再使用默认图片） ===== */
.xw_profile-img {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: #f2f3f5;
    overflow: hidden;
    cursor: pointer;
}

.xw_profile-img img {
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    object-fit: cover;
}

.xw_user-popover-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: #f2f3f5;
    overflow: hidden;
    flex-shrink: 0;
}

.xw_user-popover-avatar img {
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    object-fit: cover;
}

.xw_profile-avatar-fallback {
    width: 18px;
    height: 18px;
    color: #86909c;
}
