/* 公共导航栏样式 */

/* CSS 变量 - 与 community.html 保持一致 */
:root {
    --sky-top: #87CEEB;
    --sky-bottom: #E0F6FF;
    --water-top: #4A90D9;
    --water-bottom: #1E5799;
    --sun: #FFD700;
    --shrimp-pink: #FF6B6B;
    --shrimp-orange: #FF8E53;
    --sand: #F4E4C1;
    --grass-dark: #558B2F;
    --text-dark: #2C3E50;
    --pixel-shadow: 4px 4px 0 rgba(0,0,0,0.2);
}

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--sand);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
    box-shadow: 0 4px 0 var(--grass-dark);
}

.nav-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 24px;
}

.nav-brand-text {
    font-weight: bold;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    padding: 8px 16px;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 18px;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-link:hover {
    background: rgba(0,0,0,0.1);
}

.nav-link.active {
    background: var(--sand);
}

/* 用户菜单 */
.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-dark);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--water-top);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    overflow: hidden;
}

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

.user-name {
    font-size: 16px;
}

.logout-btn {
    padding: 6px 12px;
    background: var(--shrimp-pink);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: none;
}

.logout-btn:hover {
    background: #ff5252;
}

/* 汉堡菜单按钮 */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: all 0.3s ease;
}

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

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

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

/* 导航遮罩层 */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

.nav-overlay.active {
    display: block;
}

/* 响应式 */
@media (max-width: 768px) {
    .navbar {
        padding: 0 10px;
    }

    .nav-brand-text {
        font-size: 1.25rem;
    }

    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background: var(--sand);
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 20px 20px;
        gap: 15px;
        transition: right 0.3s ease;
        z-index: 1000;
        box-shadow: -4px 0 10px rgba(0,0,0,0.1);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-link {
        padding: 12px 16px;
        width: 100%;
        text-align: left;
    }

    .user-menu {
        flex-direction: column;
        align-items: flex-start;
        margin-top: 20px;
        padding-top: 20px;
        border-top: 2px dashed var(--grass-dark);
        width: 100%;
    }

    .logout-btn {
        margin-top: 10px;
    }
}
