/* ==========================================================================
   前台导航栏右上角用户状态与登录注册组件（Impeccable 高端商务白 & 商务红定制）
   ========================================================================== */

/* 容器与基础排版 */
.horizontal-menu-right-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* --------------------------------------------------------------------------
   1. 未登录状态：【登录平台】&【注册平台】
   -------------------------------------------------------------------------- */
.auth-nav-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 18px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none !important;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    white-space: nowrap;
}

/* 登录平台：温润雅致商务白 */
.auth-btn-login {
    background: #ffffff;
    color: #4b3832 !important;
    border: 1px solid #ebdcd5;
    box-shadow: 0 2px 6px rgba(90, 40, 20, 0.04);
}

.auth-btn-login:hover {
    color: #b91c1c !important;
    border-color: #fca5a5;
    background: #fffcfb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(185, 28, 28, 0.08);
}

/* 注册平台：高端商务红高光胶囊 */
.auth-btn-register {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
    color: #ffffff !important;
    border: 1px solid rgba(185, 28, 28, 0.2);
    box-shadow: 0 4px 14px rgba(185, 28, 28, 0.24);
}

.auth-btn-register:hover {
    background: linear-gradient(135deg, #991b1b 0%, #b91c1c 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(185, 28, 28, 0.36);
}

.auth-btn-register svg {
    margin-left: 5px;
    transition: transform 0.2s ease;
}

.auth-btn-register:hover svg {
    transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   2. 已登录状态：用户悬浮卡片与微交互下拉（修复“鼠标悬浮无反应”问题）
   -------------------------------------------------------------------------- */
.user-menu-wrapper {
    position: relative;
    padding: 10px 0; /* 扩展悬浮感应热区 */
}

/* 触发器胶囊条 */
.user-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 8px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #ebdcd5;
    border-radius: 999px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(112, 55, 17, 0.05);
}

.user-menu-wrapper:hover .user-menu-trigger,
.user-menu-trigger.is-active {
    background: #ffffff;
    border-color: #f87171;
    box-shadow: 0 4px 14px rgba(185, 28, 28, 0.12);
}

/* 头像徽标 */
.user-badge-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(185, 28, 28, 0.25);
    flex-shrink: 0;
}

/* 用户名称 */
.user-name-label {
    font-size: 13.5px;
    font-weight: 600;
    color: #382823;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1;
}

/* 箭头微动效 */
.user-arrow-icon {
    width: 14px;
    height: 14px;
    color: #8c766e;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
    flex-shrink: 0;
}

.user-menu-wrapper:hover .user-arrow-icon {
    transform: rotate(180deg);
    color: #b91c1c;
}

/* --------------------------------------------------------------------------
   3. 高端下拉浮层面板 (User Dropdown Menu)
   -------------------------------------------------------------------------- */
.user-dropdown-panel {
    display: none;
    position: absolute;
    top: calc(100% - 2px);
    right: 0;
    width: 250px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid #ebdcd5;
    border-radius: 14px;
    box-shadow: 0 16px 36px -4px rgba(45, 25, 20, 0.14), 0 4px 12px rgba(0, 0, 0, 0.04);
    padding: 10px;
    z-index: 999999;
    box-sizing: border-box;
    animation: userMenuPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* CSS 原生安全 Hover 展开，确保无论 JS 状态如何鼠标放上去立即弹出 */
.user-menu-wrapper:hover .user-dropdown-panel,
.user-menu-wrapper:focus-within .user-dropdown-panel,
.user-dropdown-panel.show-force {
    display: block !important;
}

@keyframes userMenuPop {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 浮层头部：用户信息卡片 */
.user-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px 12px;
    border-bottom: 1px solid #f3ece8;
    margin-bottom: 6px;
}

.user-panel-info {
    overflow: hidden;
    flex: 1;
}

.user-panel-title {
    font-size: 14px;
    font-weight: 700;
    color: #2b1f1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-panel-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    color: #059669;
    font-weight: 500;
    margin-top: 2px;
}

.user-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* 菜单项列表 */
.user-panel-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: #4b3b35 !important;
    text-decoration: none !important;
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.16s ease;
}

.user-nav-item:hover {
    background: #fff5f5;
    color: #b91c1c !important;
    transform: translateX(2px);
}

.user-nav-item.highlight-action {
    background: #fef2f2;
    color: #b91c1c !important;
    font-weight: 600;
}

.user-nav-item.highlight-action:hover {
    background: #fee2e2;
}

.user-nav-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    color: #9c837b;
    transition: color 0.16s ease;
}

.user-nav-item:hover .user-nav-icon,
.user-nav-item.highlight-action .user-nav-icon {
    color: #b91c1c;
}

.user-nav-tag {
    margin-left: auto;
    font-size: 10.5px;
    padding: 1px 6px;
    border-radius: 99px;
    background: #fee2e2;
    color: #b91c1c;
    font-weight: 600;
}

/* 分隔线与退出操作 */
.user-panel-divider {
    height: 1px;
    background: #f3ece8;
    margin: 6px 0;
}

.user-nav-item-logout {
    color: #dc2626 !important;
}

.user-nav-item-logout .user-nav-icon {
    color: #dc2626;
}

.user-nav-item-logout:hover {
    background: #fef2f2;
    color: #991b1b !important;
}
