/* PC 打包页用户登录态模块样式 */

/* 按导航结构设置悬停色，避免打包后节点类名与页面样式不一致。 */
[data-system-header="true"] .navbar-nav > .nav-item:hover {
    color: rgba(0, 82, 217, 1);
}

/* 当前页面及其所属下拉栏目在两类页头中保持蓝色选中状态。 */
[data-system-header="true"] .navbar-nav > .nav-item.pc-nav-active > .nav-link,
[data-system-header="true"] .navbar-nav > .diy-dropdown > .dropdown-toggle.pc-nav-active,
[data-system-header="true"] .navbar-nav > .diy-dropdown > .dropdown-toggle.pc-nav-active > div,
[data-system-header="true"] .navbar-nav > .diy-dropdown > .dropdown-toggle.pc-nav-active .diy-text-span-wapper {
    color: #0052d9 !important;
}

[data-system-header="true"] .navbar-nav > .diy-dropdown > .dropdown-toggle.pc-nav-active > svg {
    fill: #0052d9;
}

/* 首页与公共页头共用导航间距，给菜单及登录区域留出独立空间。 */
@media (min-width: 768px) {
    [data-system-header="true"] .navbar-brand {
        flex-shrink: 0;
        margin-right: 24px;
    }

    [data-system-header="true"] .navbar-collapse {
        min-width: 0;
    }

    [data-system-header="true"] .navbar-nav {
        flex-wrap: nowrap;
        justify-content: flex-end;
        align-items: center;
        gap: 8px;
    }

    [data-system-header="true"] .navbar-nav > .nav-item,
    [data-system-header="true"] .navbar-nav > .diy-dropdown {
        flex-shrink: 0;
        width: auto;
        height: 40px;
        margin: 0;
    }

    [data-system-header="true"] .navbar-nav > .nav-item > .nav-link,
    [data-system-header="true"] .navbar-nav > .diy-dropdown > .dropdown-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: auto;
        min-height: 40px;
        padding: 0 10px;
        font-size: inherit;
        font-weight: 700;
        white-space: nowrap;
    }

    [data-system-header="true"] .navbar-nav > .diy-dropdown > .dropdown-toggle > div {
        font-size: inherit;
        font-weight: inherit;
    }

    [data-system-header="true"] .navbar-nav > .diy-dropdown > .dropdown-toggle::after {
        display: none;
    }

    [data-system-header="true"] .navbar-nav > .diy-dropdown > .dropdown-toggle > svg {
        flex-shrink: 0;
        width: 16px;
        height: 16px;
        margin-left: 4px;
    }

    [data-system-header="true"] .navbar-nav > .pc-user-state {
        align-self: center;
        margin: 0;
        padding-left: 16px;
        transform: none;
    }

    [data-system-header="true"] .pc-user-state .pc-user-login {
        margin-right: 8px;
    }
}

@media (min-width: 1200px) {
    [data-system-header="true"] .navbar-brand {
        margin-right: 48px;
    }

    [data-system-header="true"] .navbar-nav {
        gap: 12px;
    }

    [data-system-header="true"] .navbar-nav > .nav-item > .nav-link,
    [data-system-header="true"] .navbar-nav > .diy-dropdown > .dropdown-toggle {
        padding-right: 16px;
        padding-left: 16px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    [data-system-header="true"] .navbar-brand {
        margin-right: 16px;
    }

    [data-system-header="true"] .navbar-nav {
        gap: 4px;
    }

    [data-system-header="true"] .navbar-nav > .nav-item > .nav-link,
    [data-system-header="true"] .navbar-nav > .diy-dropdown > .dropdown-toggle {
        padding-right: 6px;
        padding-left: 6px;
    }

    [data-system-header="true"] .navbar-nav > .pc-user-state {
        padding-left: 8px;
    }

    [data-system-header="true"] .pc-user-state .pc-user-login,
    [data-system-header="true"] .pc-user-state .pc-user-register {
        padding-right: 12px;
        padding-left: 12px;
    }
}

/* 公共页头和 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;
    }
}
