/* PC 打包页用户登录态模块样式 */

/* 公共页头和 DIY 打包页都从整个页头底部展开全宽菜单。 */
@media (min-width: 768px) {
    [data-system-header="true"] .dropdown-w-full > .dropdown-menu-w-full {
        top: var(--pc-header-menu-top, 100%) !important;
        margin-top: 0 !important;
        transform: none !important;
    }

    [data-system-header="true"] .dropdown-w-full::after {
        content: "";
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        height: var(--pc-header-menu-gap, 0px);
    }
}

.pc-user-state {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

/* 未登录状态 - 登录/注册按钮（对齐打包页原按钮外观：50px 胶囊、36px 高） */
.pc-user-state .pc-user-login,
.pc-user-state .pc-user-register {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 16px;
    border-radius: 50px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: all 200ms;
    white-space: nowrap;
    box-sizing: border-box;
}

.pc-user-state .pc-user-login {
    color: #333;
    border: 1px solid rgba(193, 193, 193, 1);
    background: transparent;
    margin-right: 20px;
}

.pc-user-state .pc-user-login:hover {
    border-color: rgba(13, 110, 253, 1);
    color: rgba(13, 110, 253, 1);
}

.pc-user-state .pc-user-register {
    color: #fff;
    background-color: rgba(58, 130, 248, 1);
    border: 1px solid rgba(58, 130, 248, 1);
}

.pc-user-state .pc-user-register:hover {
    background-color: rgba(58, 130, 248, 0.9);
    border-color: rgba(58, 130, 248, 0.9);
    color: #fff;
}

/* 已登录状态 - 用户头像 */
.pc-user-profile {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 40px;
}

.pc-user-avatar {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    outline: none;
}

.pc-user-avatar img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.pc-user-avatar .pc-arrowhead {
    width: 12px;
    height: 8px;
    margin-left: 8px;
    transition: transform 200ms;
}

.pc-user-profile:hover .pc-arrowhead,
.pc-user-profile.pc-user-open .pc-arrowhead,
.pc-user-profile:focus-within .pc-arrowhead {
    transform: rotate(180deg);
}

/* 用户弹窗 */
.pc-user-popup {
    position: absolute;
    top: 40px;
    right: -20px;
    width: 198px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    overflow: visible;
}

.pc-user-profile:hover .pc-user-popup,
.pc-user-profile.pc-user-open .pc-user-popup,
.pc-user-profile:focus-within .pc-user-popup {
    display: block;
}

.pc-user-popup .pc-popup-trigon {
    position: absolute;
    top: -6px;
    right: 30px;
    width: 12px;
    height: 12px;
    background: #fff;
    transform: rotate(45deg);
    box-shadow: -2px -2px 3px rgba(0, 0, 0, 0.1);
}

/* 用户信息区域 */
.pc-user-info {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #EEEEEE;
}

.pc-user-info img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.pc-user-info .pc-user-name {
    font-size: 14px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
}

/* 菜单项 */
.pc-user-popup .pc-popup-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #333;
    font-size: 14px;
    text-decoration: none;
    transition: color 200ms;
    cursor: pointer;
}

.pc-user-popup .pc-popup-link:hover {
    color: rgba(13, 110, 253, 1);
    background: #f8f9ff;
}

.pc-user-popup .pc-popup-link:first-of-type {
    margin-top: 8px;
}

/* 退出按钮 */
.pc-user-popup .pc-logout-btn {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 12px 20px;
    color: #999;
    font-size: 14px;
    border: none;
    background: none;
    cursor: pointer;
    width: 100%;
    text-align: right;
    transition: color 200ms;
}

.pc-user-popup .pc-logout-btn:hover {
    color: rgba(13, 110, 253, 1);
}

/* 默认头像图标 */
.pc-default-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

[data-system-header] .pc-user-state a {
    text-decoration: none;
}

[data-system-header] .pc-user-state .pc-user-register {
    color: #fff;
}

.pc-user-avatar:focus-visible {
    outline: 2px solid #3a82f8;
    outline-offset: 4px;
}

@media (max-width: 767px) {
    [data-system-header] .pc-user-state {
        margin: 12px 0;
    }

    .pc-user-popup {
        left: 0;
        right: auto;
    }
}
