/* =====================
公共头部样式
===================== */
.app-header-mobile {
    display: none;
}

@media screen and (max-width: 768px) {
    .app-header {
        display: none;
    }

    .app-header-mobile {
        display: block;
    }
}

/* ========== PC ========== */
.app-header {
    width: 100%;
    background: var(--primary);
    height: 68px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}


.header-box {
    height: 68px;
    display: flex;
    justify-content: space-between;
}


.header-logo img {
    height: 68px;
    display: block;
    margin-left: var(--space-8);
    /* box-shadow: var(--shadow-sm); */
}


.header-nav {
    height: 100%;
    display: flex;
    gap: var(--space-lg);
    list-style: none;
    margin: 0;
    padding: 0;
}

@media (max-width: 1024px) {
    .header-nav {
        gap: var(--space-12);
    }
}


.header-nav li {
    position: relative;
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: 0.05rem;
    display: flex;
    align-items: center;
    gap: var(--space-1);
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-nav li a {
    color: var(--white);
}


.header-nav li.active {
    font-weight: 600;
    font-size: 1.375rem;
    /* 稍微变大 */
}

.header-nav li img {
    width: 1.6rem;
}

/* 激活菜单下方的三角形指示 */
.header-nav li.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 0.75rem solid transparent;
    border-right: 0.75rem solid transparent;
    border-bottom: 0.75rem solid var(--highlight);
}


/* 鼠标悬停效果 */
.header-nav li:hover {
    opacity: 0.9;
}


/* 用户下拉容器 */
.header-nav li .user-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
}

/* 用户名文字 */
.header-nav li .user-dropdown .user-name {
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 500;
}

/* 箭头图标 */
.header-nav li .user-dropdown .arrow {
    width: 0;
    height: 0;
    border-left: 0.5rem solid transparent;
    border-right: 0.5rem solid transparent;
    border-top: 0.5rem solid var(--white);
    margin-top: 0.75rem;
    transition: transform 0.2s ease;
}

/* 下拉菜单 */
.header-nav li .user-dropdown .dropdown-menu {
    display: none;
    position: absolute;
    top: 130%;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    min-width: 120px;
    border-radius: var(--radius-s);
    box-shadow: var(--shadow-sm);
    padding: var(--space-2) 0;
    z-index: 200;
    -webkit-border-radius: var(--radius-s);
    -moz-border-radius: var(--radius-s);
    -ms-border-radius: var(--radius-s);
    -o-border-radius: var(--radius-s);
}

/* 下拉菜单小箭头 */
.header-nav li .user-dropdown .dropdown-menu::before {
    content: "";
    position: absolute;
    top: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 0.3rem solid transparent;
    border-right: 0.4rem solid transparent;
    border-bottom: 0.5rem solid #fff;
}

/* 下拉菜单项 */
.header-nav li .user-dropdown .dropdown-menu a {
    display: block;
    padding: var(--space-2);
    font-size: 1rem;
    color: var(--fg);
    text-align: center;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

/* 鼠标悬停在下拉项 */
.header-nav li .user-dropdown .dropdown-menu a:hover {
    background: var(--primary-light);
    color: var(--primary-deep);
}

/* 悬停用户区域时显示菜单 */
/* .header-nav li .user-dropdown:hover .dropdown-menu {
    display: block;
} */


/* ========== mobile ========== */
.app-header-mobile {
    background: var(--primary);
    padding: var(--space-2);
}

.header-box-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo-mobile {
    display: flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
}

.header-logo-mobile img {
    height: 40px;
    margin-right: 0.5rem;
}

.app-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    
}

/* 菜单按钮 */
.menu-toggle img {
    width: 28px;
    cursor: pointer;
}

/* 移动菜单 */
.mobile-menu {
    display: none;
    flex-direction: column;
    background: var(--primary);
    text-align: center;
    margin-top: var(--space-2);
}

.mobile-menu a.menu-link {
    color: #fff;
    padding: var(--space-2);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-decoration: none;
    transition: background 0.2s ease, font-weight 0.2s ease;
}

/* 当前高亮 */
.mobile-menu a.active {
    color: var(--primary);
    font-weight: 600;
    background: var(--primary-light);
}

/* 登录后用户名与退出 */
.mobile-user-menu {
    display: inline-block;
}