/**
 * 前台页面统一导航栏样式 - 使用 CSS 变量适配主题切换
 * 版本：1.0.1
 * 适用于：index.html, report.html, guides.html, announcements.html
 */

/* ==================== 导航栏基础样式 ==================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 80px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 60px;
    z-index: 1000;
    border-bottom: 2px solid var(--border-color);
    box-shadow: var(--shadow-md);
    min-width: 1200px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.logo img {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    border: 3px solid var(--border-color);
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
}

.logo-text {
    color: var(--text-primary);
    font-size: 26px;
    font-weight: bold;
    text-shadow: 0 0 10px var(--primary-light);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ==================== 导航链接 - 悬浮胶囊样式 ==================== */
.nav-links {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.nav-link-item {
    position: relative;
    padding: 12px 28px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    text-decoration: none;
    overflow: hidden;
}

.nav-link-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.nav-link-item:hover::before {
    left: 100%;
}

.nav-link-item:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.nav-link-item.active {
    background: var(--btn-primary-bg);
    color: #fff;
    border-color: var(--btn-primary-border);
    box-shadow: var(--shadow-md);
}

/* ==================== 登录/注册按钮 ==================== */
.login-btn {
    padding: 10px 30px;
    background: var(--btn-primary-bg);
    color: #fff;
    border: 2px solid var(--btn-primary-border);
    border-radius: 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

.login-btn:hover {
    background: var(--btn-hover-bg);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ==================== 用户信息区域 ==================== */
.user-info {
    display: none;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.user-info.show {
    display: flex;
}

.welcome-text {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
}

.logout-btn {
    padding: 10px 24px !important;
    background: var(--bg-card) !important;
    border: 2px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    font-size: 14px !important;
    min-width: auto !important;
}

.logout-btn:hover {
    background: var(--primary-light) !important;
    border-color: var(--border-color) !important;
    transform: translateY(-2px);
}

/* ==================== 移动端菜单按钮 ==================== */
.mobile-menu-btn {
    display: none; /* PC 端默认隐藏 */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 5px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ==================== 响应式设计 ==================== */

/* 中等屏幕适配 (769px - 1200px) */
@media (max-width: 1200px) {
    .navbar {
        padding: 0 20px;
        min-width: auto;
    }

    .nav-links {
        gap: 15px;
    }

    .nav-link-item {
        padding: 10px 20px;
        font-size: 14px;
        min-width: auto;
    }

    .logo-text {
        font-size: 18px;
    }

    .login-btn {
        padding: 8px 25px !important;
        min-width: 120px;
    }

    .user-info {
        gap: 10px;
    }

    .welcome-text {
        font-size: 14px;
    }

    .logout-btn {
        padding: 8px 15px !important;
        font-size: 13px !important;
    }
}

/* 小屏幕手机适配 (max-width: 768px) */
@media (max-width: 768px) {
    .navbar {
        height: 60px;
        padding: 0 15px;
    }

    .logo img {
        width: 40px;
        height: 40px;
    }

    .logo-text {
        font-size: 14px;
    }

    .nav-links {
        display: none;
    }

    .nav-links.mobile-show {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        padding: 20px;
        gap: 10px;
        box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
    }

    .nav-links.mobile-show .nav-link-item {
        width: 100%;
        padding: 12px;
        font-size: 15px;
        text-align: center;
    }

    /* 移动端显示菜单按钮 */
    .mobile-menu-btn {
        display: block;
    }

    .user-info {
        gap: 8px;
    }

    .welcome-text {
        font-size: 12px;
    }

    .logout-btn {
        padding: 6px 12px !important;
        font-size: 12px !important;
        min-width: auto !important;
    }

    .login-btn {
        padding: 8px 20px !important;
        min-width: auto !important;
        font-size: 14px !important;
        white-space: nowrap;
    }
}

/* PC 端强制隐藏菜单按钮 */
@media (min-width: 769px) {
    .mobile-menu-btn {
        display: none;
    }
}
