/* ================= 导航栏 ================= */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 80px;
    background: var(--bg-nav);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 100;
    display: flex;
    align-items: center;
}

.nav-container {
    max-width: 100%; /* 取消最大宽度限制，让其贴近最左和最右 */
    width: 100%;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--color-red);
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 1px;
}

.logo-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(255, 51, 51, 0.5));
}

.logo-text {
    background: linear-gradient(to right, #ff3333, #ff7b00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 40px;
}

.nav-item {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    position: relative;
    padding: 8px 0;
}

.nav-item:hover {
    color: var(--text-main);
}

/* 激活状态样式 */
.nav-item.active {
    color: var(--color-red);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background-color: var(--color-red);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--color-red);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-size: 0.95rem;
    font-weight: 500;
}

.user-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.avatar-container {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: border-color 0.3s;
}

.avatar-container:hover {
    border-color: var(--color-blue);
}

.avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* 导航栏响应式 */
@media (max-width: 1024px) {
    .nav-links {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background: rgba(6, 9, 19, 0.95);
        backdrop-filter: blur(12px);
        padding: 20px 0;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nav-links.active {
        display: flex;
    }

    .user-profile {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    /* 统一移动端菜单项居中 */
    .nav-item {
        width: 100%;
        justify-content: center;
        padding: 15px 0;
    }

    /* 移动端下拉菜单修复 */
    .nav-dropdown {
        flex-direction: column;
        width: 100%;
    }

    .dropdown-menu {
        position: static;
        width: 100%;
        min-width: 100%;
        box-shadow: none;
        background: transparent;
        border: none;
        padding: 0;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .dropdown-menu a {
        text-align: center;
        padding: 12px 20px;
    }

    .dropdown-menu a:hover {
        padding-left: 20px;
        /* 移动端取消 hover 左侧偏移，保持居中 */
    }

    .dropdown-menu.show {
        display: block;
        animation: fadeIn 0.3s ease;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ================= 导航下拉菜单 ================= */
.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

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

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    background: rgba(15, 20, 35, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 200;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.dropdown-menu a:hover {
    background: rgba(51, 136, 255, 0.1);
    color: var(--color-blue);
    padding-left: 25px;
}