/* 导航栏样式 */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 15px 30px;
    background: rgba(2,2,2,0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
    font-weight: 600;
    font-size: 18px;
}

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

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-link {
    color: #94A3B8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: white;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 80%;
}



.nav-btn {
    padding: 8px 20px;
    border-radius: 99px; 
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid transparent;
}

.nav-btn.console { 
    color: #94A3B8; 
    background: transparent; 
}

.nav-btn.console:hover { 
    color: white; 
    background: rgba(255, 255, 255, 0.05); 
}

.nav-btn.register { 
    color: white; 
    background: rgba(255, 255, 255, 0.1); 
    border: 1px solid rgba(255, 255, 255, 0.05); 
}

.nav-btn.register:hover { 
    background: rgba(255, 255, 255, 0.15); 
    border-color: rgba(255, 255, 255, 0.2); 
}

.nav-btn.login { 
    background: #F8FAFC; 
    color: black; 
    font-weight: 600; 
    box-shadow: 0 0 10px rgba(255,255,255,0.1); 
}

.nav-btn.login:hover { 
    background: #e2e8f0; 
    box-shadow: 0 0 15px rgba(255,255,255,0.2); 
    transform: translateY(-1px); 
}

.nav-user {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: white;
    font-size: 13px;
    border: 1px solid rgba(255,255,255,0.12);
}

.nav-user .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 6px rgba(52,211,153,0.15);
}

/* --- 汉堡菜单 --- */
.hamburger-menu {
    display: none;
    position: absolute;
    right: 30px;
    width: 28px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1002;
    padding: 0;
}

.hamburger-menu span {
    display: block;
    width: 100%;
    height: 2px;
    background: white;
    margin: 6px 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

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

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

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

/* --- 移动端菜单遮罩 --- */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* 默认不拦截点击，避免遮挡 logo 等元素 */
}

.mobile-menu-overlay.active {
    opacity: 1;
    pointer-events: auto; /* 只有激活时才接收点击，用于点击关闭菜单 */
}

/* --- 移动端菜单 --- */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    max-width: 100%;
    height: 100vh;
    background: linear-gradient(180deg, #1E293B 0%, #0F172A 100%);
    z-index: 1001;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-content {
    padding: 80px 24px 40px;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-link {
    display: block;
    padding: 16px 20px;
    color: #94A3B8;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.mobile-link:hover,
.mobile-link:active {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.mobile-link-btn {
    width: 100%;
    padding: 16px 20px;
    color: #94A3B8;
    background: transparent;
    border: none;
    font-size: 16px;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.mobile-link-btn:hover,
.mobile-link-btn:active {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.mobile-link-btn.primary {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    color: white;
    font-weight: 600;
}

.mobile-link-btn.primary:hover {
    opacity: 0.9;
}

.mobile-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 8px 0;
}

.mobile-user-info {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-user-email {
    padding: 16px 20px;
    color: white;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-user-email::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(52,211,153,0.15);
}

/* --- 移动端响应式 --- */
@media (max-width: 768px) {
    nav {
        padding: 16px 24px; /* 与业务页导航保持一致的高度和左右边距 */
    }

    .hamburger-menu {
        display: block;
    }

    .nav-links,
    .nav-actions {
        display: none;
    }

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

    .mobile-menu {
        display: block;
    }

    .logo {
        font-size: 16px;
    }

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