﻿


.header {
}
/* #region 头部欢迎区域 */

.header-top {
    width: 100%;
    background-color: var(--top-bg);
    padding: 10px 0;
}

.header-top .content {       
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size:var(--size)
}

.header-company b{ color:var(--text-mark);}

.header-top header-links {   
    display: flex;
    align-items: center;
}

.header-top .header-link{   
    color: var(--text-body);    
    padding: 0 12px;    
    position: relative;
}

/* 为链接添加竖线分隔符（最后一个链接除外） */
.header-top .header-link:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 10%;
    height: 90%;
    width: 2px;
    background-color: var(--text-body);
}

.header-top .header-link:hover {
    color: var(--link-hover);
}

/* #endregion */


/* #region 头部中间 */

.header-middle { 
    padding:10px 0px;
    background-color: var(--text-on-dark);
}

/* 容器使用flex布局实现三栏排列 */
.header-middle .content { 
    display: flex;
    align-items: center;
    justify-content: space-between;  
}

.header-middle .logo {
    flex: 0 0 auto; /* 不伸缩，保持自身大小 */
}
.header-middle .logo img {
    height: 80px; 
    width: auto;
}

/* 搜索框居中 */
.header-middle .search {
    flex: 1; /* 占据剩余空间，实现居中效果 */
    max-width: 500px;
    margin: 0 auto; 
    display: flex;
    width: 100%;
}

.header-middle .search-input {
    flex: 1; /* 输入框占大部分宽度 */
    padding: 8px 12px;
    border: 1px solid var(--text-primary);
    border-right: none;
    border-radius: 4px 0 0 4px;
    font-size: var(--size-small);
    outline:none;
}

.header-middle .search-btn {
    padding: 8px 20px;
    background-color:var(--text-primary);
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: var(--font-size);
}

.header-middle .search-btn:hover {
    background-color:var(--link-hover);
}

/* 用户信息靠右 */
.header-middle .user {
    flex: 0 0 auto; /* 不伸缩，保持自身大小 */
    display: flex;
    align-items: center; /* 图片和信息垂直居中对齐 */
    gap: 20px; 
}

/* Panel容器处理 - 关键修复 */
.header-middle .user > asp\:Panel,
.header-middle .user > div { /* 针对Panel生成的div */
    display: flex;
    align-items: center;
    gap: 20px;
}

/* 登录注册区域样式 */
.header-middle .user-login,
.header-middle .user-reg {
    position: relative;
    padding: 0 5px;
}

/* 登录和注册之间的竖线分隔 */
.header-middle .user-login::after {
    content: "";
    position: absolute;
    right: -8px;
    top: 20%;
    height: 60%;
    width: 1px;
    background-color:var(--text-primary);
}

/* 调整注册按钮右边距 */
.header-middle .user-reg {
    margin-right: 20px;
}

/* 用户头像 */
.header-middle .user-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    flex: 0 0 auto;
}
.header-middle .user-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 图片自适应裁剪 */
}

/* 用户信息区域 */
.header-middle .user-info {
    display: flex;
    flex-direction: column; /* 名称和链接上下排列 */
    gap: 2px; 
    font-size:var(--size-small);
}

.header-middle .user-name {        
    white-space: nowrap; /* 防止用户名换行 */
}
.header-middle .user-links {
    display: flex;
    gap: 10px; 
}


/* #endregion*/

/* #region 导航菜单基础样式 */
.header-nav {
    background-color: var(--nav-bg); 
    position: relative;
    padding:10px 0px;
}

.header-nav .content {    
    padding: 0 10px;
}

/* 一级菜单容器 */
.header-nav .nav {
    display: flex;
    justify-content: space-between; /* 最左项靠左，最右项靠右 */
    align-items: center;
    list-style: none;
    width: 100%; /* 确保容器占满可用宽度，才能平均分配空间 */
}

/* 一级菜单项 - 平均占据空间，文本居中 */
.header-nav .nav-item {
    position: relative;
    margin: 0;
    padding: 0 10px; /* 左右预留空间 */
    white-space: nowrap;
    flex: 1; /* 每个项平均分配容器空间 */
    text-align: center; /* 项内文本居中 */
}

/* 竖线定位在项的右侧边缘 */
.header-nav .nav-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0; /* 贴紧项的右侧 */
    top: 20%;
    height: 60%;
    width: 1px;
    background-color: rgba(255, 255, 255, 0.3);
}

/* 链接样式 - 确保文本在项内居中 */
.header-nav .nav-link {
    display: inline-block; /* 关键：让元素宽度与文字一致 */
    color: var(--nav-text);
    font-weight: 500;
    padding: 10px;
    font-size: var(--size-large);
}
.header-nav .nav-link:hover{color:var(--nav-text-hover);}

/* 一级菜单下划线效果 */
.header-nav .nav-item > .nav-link::after {
    content: '';
    position: absolute;
    left: 10%;    
    bottom: 0;
    width: 0;
    height: 2px;
    background-color:var(--nav-text-hover);
    transition: width 0.3s ease; /* 下划线动画 */
}

.header-nav .nav-item:hover > .nav-link::after {
    width: 80%; /* 鼠标悬停时显示下划线 */
}

/* 当前页高亮 */
.header-nav .nav-item .active {
    color: var(--nav-text-hover);
}

.header-nav .nav-item .active::after {
    width: 80%;
    background-color:var(--nav-text-hover);
}
/* #endregion */

/* #region 二级菜单样式 - 带分隔线设计 */

.header-nav .nav-child {
    position: absolute;
    left: 0;
    top: 100%; /* 定位在一级菜单正下方 */
    min-width: 150px; /* 最小宽度，确保文字不拥挤 */
    width:100%;
    background-color: var(--border-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); /* 阴影增加层次感 */
    padding: 4px 0; /* 上下内边距略微调整 */
    margin-top: 5px;
    list-style: none;
    z-index: 1000; /* 确保在其他内容上方 */
    
    /* 初始隐藏状态 */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px); /* 轻微下移 */
    transition: all 0.3s ease; /* 过渡动画 */
}

/* 鼠标滑过一级菜单时显示二级菜单 */
.header-nav .nav-item:hover .nav-child {
    opacity: 1;
    visibility: visible;
    transform: translateY(0); /* 回到正常位置 */
}

.header-nav .child-item a {
    display: block;  
    text-align: center;    
    color: var(--text-primary);  
    padding: 10px 16px;  
    font-size: var(--size-base);
    transition: all 0.2s;  
    position: relative; 
}

/* 二级菜单默认下划线（默认显示，最后一项除外） */
.header-nav .child-item:not(:last-child) a::after {
    content: '';
    position: absolute;
    left: 50%; /* 水平居中 */
    bottom: 0;
    width: 100%; /* 固定显示60%宽度 */
    height: 1px; /* 细一点的下划线，避免过于醒目 */
    background-color: rgba(0,0,0,0.1); /* 浅灰色默认下划线 */
    transform: translateX(-50%); /* 精准居中 */
}

/* hover时调整下划线样式 */
.header-nav .child-item a:hover {
    background-color: var(--nav-bg); 
    color: var(--nav-text);  
}


/* #endregion */



.bottom{
    padding:30px 0px;
    background:var(--nav-bg);
    color:var(--text-on-dark);
    text-align:center;
    line-height:30px;
}
.bottom a{color:var(--tex-on-dark);}