/**
 * 统一导航栏样式
 * 包含顶部主导航栏和系统功能导航栏的所有样式
 */

/* ==== 主导航栏 ==== */
header {
    background: linear-gradient(135deg, var(--dark-color) 0%, #191919 100%);
    color: #fff;
    padding: 0.9rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
    transition: all 0.4s ease-in-out;
}

header.system-active {
    padding: 0.7rem 0;
    background: linear-gradient(135deg, #003366 0%, #001a33 100%);
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    transition: all 0.4s ease-in-out;
}

header.system-active nav {
    justify-content: flex-start;
    gap: 40px;
}

/* Logo 样式 */
header .logo {
    font-size: 1.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    letter-spacing: 0.5px;
    transition: all 0.4s ease;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    text-decoration: none;
}

header.system-active .logo {
    font-size: 1.35rem;
    font-weight: 600;
}

header .logo i {
    margin-right: 12px;
    color: var(--accent-color);
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

/* 修改SVG图标样式 */
header .logo .logo-icon-svg {
    margin-right: 12px;
    color: var(--accent-color);
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
    transition: transform 0.3s ease;
}

header.system-active .logo .logo-icon-svg {
    width: 24px;
    height: 24px;
}

header .logo:hover .logo-icon-svg {
    transform: rotate(10deg);
}

/* 导航链接列表 */
header nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    gap: 8px;
    transition: all 0.3s ease;
}

header.system-active nav ul {
    flex-grow: 1;
    justify-content: flex-start;
    gap: 4px;
}

header nav ul li {
    margin: 0;
    position: relative;
}

/* 导航链接样式 */
header nav ul li a.nav-link {
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    padding: 10px 18px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

header.system-active nav ul li a.nav-link {
    font-size: 0.95rem;
    padding: 8px 15px;
    font-weight: 500;
}

/* 导航链接悬停效果 */
header nav ul li a.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.12);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.25s ease-out;
    z-index: -1;
    border-radius: 8px;
}

header nav ul li a.nav-link:hover::before,
header nav ul li a.nav-link.active::before {
    transform: scaleX(1);
    transform-origin: left;
}

header nav ul li a.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--accent-color);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

header nav ul li a.nav-link:hover {
    color: var(--accent-color);
    transform: translateY(-2px);
}

header nav ul li a.nav-link i {
    margin-right: 8px;
    font-size: 0.95rem;
    transition: transform 0.3s ease;
}

header nav ul li a.nav-link:hover i {
    transform: translateY(-1px);
}

header.system-active nav ul li a.nav-link i {
    font-size: 0.9rem;
    margin-right: 6px;
}

/* 导航下拉菜单 */
.nav-dropdown {
    position: relative;
}

.dropdown-icon {
    font-size: 0.8rem;
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.nav-dropdown:hover .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #003366;
    min-width: 180px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border-radius: var(--border-radius);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(5px);
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #fff;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background-color 0.2s;
}

.dropdown-menu a i {
    margin-right: 10px;
    width: 16px;
    text-align: center;
}

.dropdown-menu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
}

.dropdown-menu a.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--accent-color);
    font-weight: 600;
}

/* 系统导航 */
header nav ul li.system-nav-item a.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background-color: var(--accent-color);
    border-radius: 3px;
}

/* ==== 功能导航栏 ==== */
.system-nav {
    background: transparent;
    padding: 0 0 20px 0;
    text-align: center;
    margin: 0 auto 30px auto;
    position: relative;
    overflow: visible;
    transition: all 0.3s ease;
    max-width: 800px;
    width: 100%;
}

.system-nav ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    list-style: none; 
    padding-left: 0;
    margin: 0;
    width: 100%;
}

.system-nav ul li {
    margin: 0;
    flex: 1 1 auto;
    border-right: none;
}

/* 功能导航按钮 */
.system-nav .nav-btn {
    padding: 14px 20px;
    background: #ffffff;
    color: var(--text-color, #333);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    font-weight: 500;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
    border: none;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    letter-spacing: 0.3px;
    min-width: 160px;
    width: 100%;
}

.system-nav .nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color, #0077cc), #0065ad);
    z-index: -1;
    transition: opacity 0.3s ease;
    opacity: 0;
    border-radius: inherit;
}

.system-nav .nav-btn:hover::before,
.system-nav .nav-btn.active::before {
    opacity: 1;
}

.system-nav .nav-btn.active {
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 119, 204, 0.25);
}

.system-nav .nav-btn:hover {
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.system-nav .nav-btn i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.system-nav .nav-btn:hover i,
.system-nav .nav-btn.active i {
    color: #fff;
}

/* 返回首页按钮 */
#return-home-btn {
    background: var(--primary-color, #0077cc);
    color: white;
    border-radius: 50px;
    padding: 0.9rem 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 119, 204, 0.25);
    font-size: 1rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 20px auto;
    text-decoration: none;
}

#return-home-btn:hover {
    background-color: var(--primary-dark, #0065ad);
    box-shadow: 0 6px 15px rgba(0, 119, 204, 0.4);
    transform: translateY(-2px);
}

#return-home-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(0, 119, 204, 0.3);
}

#return-home-btn i {
    margin-right: 10px;
    font-size: 1rem;
    transition: transform 0.3s ease;
}

#return-home-btn:hover i {
    transform: translateX(-3px);
}

/* 响应式调整 */
@media (max-width: 992px) {
    header.system-active nav {
        gap: 20px;
    }
    
    header .logo {
        font-size: 1.6rem;
    }
    
    header.system-active .logo {
        font-size: 1.2rem;
    }
    
    .dropdown-menu {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        width: 100%;
        text-align: center;
    }
    
    .dropdown-menu a {
        justify-content: center;
    }
    
    .system-nav {
        max-width: 700px;
    }
    
    .system-nav ul {
        gap: 12px;
    }
    
    .system-nav .nav-btn {
        padding: 12px 20px;
        font-size: 0.95rem;
        min-width: 140px;
    }
}

@media (max-width: 768px) {
    header .logo {
        font-size: 1.5rem; 
    }
    
    header.system-active .logo {
        font-size: 1.2rem;
    }
    
    header nav {
        flex-direction: column;
        gap: 12px; 
        padding: 8px 15px; 
    }
    
    header.system-active nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    header nav ul {
        width: 100%;
        justify-content: space-between; 
        padding-left: 0;
    }
    
    header nav ul li {
        margin-left: 5px; 
    }
    
    header nav ul li:first-child {
        margin-left: 0;
    }
    
    header nav ul li a.nav-link {
        font-size: 0.9rem;
        padding: 8px 12px;
    }
    
    .system-nav {
        padding: 0 10px 15px 10px;
        margin-bottom: 25px;
        max-width: 95%;
    }
    
    .system-nav ul {
        justify-content: center;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .system-nav ul li {
        flex: 0 0 calc(50% - 8px);
        min-width: unset;
    }
    
    .system-nav .nav-btn {
        padding: 12px 15px;
        font-size: 0.9rem;
        min-width: 0;
        width: 100%;
    }
    
    #return-home-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    header .logo {
        font-size: 1.2rem;
    }
    
    header nav ul li a.nav-link {
        font-size: 0.85rem;
        padding: 6px 10px;
    }
    
    header nav ul li a.nav-link i {
        font-size: 0.8rem;
        margin-right: 5px;
    }
    
    .system-nav {
        padding: 0 5px 12px 5px;
        margin-bottom: 20px;
    }
    
    .system-nav ul {
        gap: 8px;
    }
    
    .system-nav ul li {
        flex: 0 0 calc(50% - 4px);
    }
    
    .system-nav .nav-btn {
        padding: 10px;
        font-size: 0.85rem;
        min-height: 50px;
    }
    
    .system-nav .nav-btn span {
        display: inline-block;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    .system-nav .nav-btn i {
        margin-right: 6px;
        font-size: 0.9rem;
    }
    
    #return-home-btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.85rem;
        margin: 15px auto;
    }
}
