/* 导航栏组件样式 */

/* 导航栏容器 */
.nav-bar {
    background-color: #393D49;
    height: 50px;
    line-height: 50px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 品牌标识 */
.nav-brand {
    display: flex;
    align-items: center;
}

.nav-logo {
    color: white;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    margin-right: 20px;
    display: flex;
    align-items: center;
}

/* Logo图片样式 */
.nav-logo-img {
    height: 26px;
    width: auto;
    max-width: 96px;
    object-fit: contain;
}

/* 导航菜单容器 */
.nav-menu {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: space-between;
}

/* 导航链接容器 */
.nav-links {
    display: flex;
    align-items: center;
}

/* 引入layui-icon字体 */
@font-face {
    font-family: 'layui-icon';
    src: url('/font/iconfont.eot');
    src: url('/font/iconfont.eot?#iefix') format('embedded-opentype'),
         url('/font/iconfont.woff2') format('woff2'),
         url('/font/iconfont.woff') format('woff'),
         url('/font/iconfont.ttf') format('truetype'),
         url('/font/iconfont.svg#layui-icon') format('svg');
}

/* 图标基础样式 */
.layui-icon {
    font-family: "layui-icon" !important;
    font-size: 16px;
    font-style: normal;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 导航链接 */
.nav-link {
    color: white;
    text-decoration: none;
    font-size: 14px;
    margin-right: 20px;
    transition: all 0.3s ease;
    white-space: nowrap;
    padding: 8px 12px;
    border-radius: 4px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 导航链接中的图标 */
.nav-link i {
    font-size: 16px;
    line-height: 1;
    display: inline-block;
}

.nav-link:hover {
    color: #FFB800;
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    color: #FFB800;
    background-color: rgba(255, 184, 0, 0.2);
    font-weight: 500;
}

/* 导航链接点击效果 */
.nav-link:active {
    transform: translateY(1px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 用户信息区域 */
.nav-user {
    display: flex;
    align-items: center;
}

.user-info {
    color: white;
    margin-right: 20px;
    font-size: 14px;
}

/* 汉堡菜单按钮 */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger-line {
    width: 30px;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* 汉堡菜单激活状态 */
.nav-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.nav-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* 响应式设计 - 平板设备 */
@media screen and (max-width: 1024px) {
    .nav-link {
        font-size: 13px;
        margin-right: 15px;
    }
    
    .nav-logo {
        font-size: 15px;
    }
    
    .nav-logo-img {
        height: 22px;
        max-width: 80px;
    }
}

/* 响应式设计 - 移动设备 */
@media screen and (max-width: 768px) {
    .nav-bar {
        padding: 0 15px;
    }
    
    .nav-toggle {
        display: flex;
        transition: all 0.3s ease;
    }
    
    .nav-toggle:hover {
        transform: scale(1.05);
    }
    
    .nav-menu {
        position: fixed;
        top: 50px;
        right: -80%;
        width: 80%;
        height: calc(100vh - 50px);
        background-color: #393D49;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 20px;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        box-shadow: -4px 0 12px rgba(0, 0, 0, 0.4);
        z-index: 999;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-links {
        flex-direction: column;
        width: 100%;
        padding: 0;
    }
    
    .nav-link {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 90%;
        text-align: center;
        padding: 15px;
        margin: 5px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        font-size: 16px;
        border-radius: 8px;
        transition: all 0.3s ease;
    }
    
    .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.15);
        transform: translateX(5px);
    }
    
    .nav-link.active {
        background-color: rgba(255, 184, 0, 0.25);
        transform: translateX(10px);
    }
    
    .nav-user {
        flex-direction: column;
        width: 90%;
        margin-top: 20px;
        padding-top: 20px;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .user-info {
        display: block;
        width: 100%;
        text-align: center;
        padding: 15px;
        margin: 0 0 10px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        background-color: rgba(255, 255, 255, 0.05);
        border-radius: 8px;
    }
    
    .nav-user .nav-link {
        border-bottom: none;
    }
    
    /* 移动端菜单打开时的背景遮罩 */
    .nav-menu.active::before {
        content: '';
        position: fixed;
        top: 50px;
        left: 0;
        width: 20%;
        height: calc(100vh - 50px);
        background-color: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
}

/* 响应式设计 - 小屏移动设备 */
@media screen and (max-width: 480px) {
    .nav-bar {
        padding: 0 10px;
    }
    
    .nav-logo {
        font-size: 14px;
    }
    
    .nav-logo-img {
        height: 19px;
        max-width: 64px;
    }
    
    .nav-link {
        font-size: 15px;
    }
}

/* 下拉菜单样式 */
.nav-item {
    position: relative;
}

.nav-item.has-submenu {
    position: relative;
}

.nav-dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-arrow {
    font-size: 12px !important;
    transition: transform 0.3s ease;
    margin-left: 5px;
}

.nav-item.submenu-open .nav-arrow {
    transform: rotate(180deg);
}

/* 子菜单样式 */
.nav-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 150px;
    background-color: #393D49;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    padding: 8px 0;
    list-style: none;
    margin: 0;
    z-index: 1001;
}

.nav-item.submenu-open .nav-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-submenu-item {
    list-style: none;
    margin: 0;
}

.nav-submenu-link {
    display: block;
    padding: 10px 20px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-submenu-link:hover {
    background-color: rgba(255, 184, 0, 0.2);
    color: #FFB800;
}

.nav-submenu-item.active .nav-submenu-link {
    color: #FFB800;
    background-color: rgba(255, 184, 0, 0.15);
}

.nav-submenu-link cite {
    font-style: normal;
}

/* 响应式设计 - 移动端下拉菜单 */
@media screen and (max-width: 768px) {
    .nav-submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background-color: rgba(0, 0, 0, 0.2);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        padding: 0;
        border-radius: 0;
    }
    
    .nav-item.submenu-open .nav-submenu {
        max-height: 500px;
        padding: 8px 0;
    }
    
    .nav-submenu-link {
        padding: 12px 30px;
        font-size: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .nav-dropdown-toggle {
        width: 90%;
        justify-content: center;
    }
    
    .nav-arrow {
        margin-left: auto;
    }
}
