/* 顶部导航栏 */
.navbar {
    background: var(--glass-bg-ultra);
    backdrop-filter: var(--glass-backdrop-strong);
    -webkit-backdrop-filter: var(--glass-backdrop-strong);
    border-bottom: 1px solid var(--border-light);
    padding: 0.75rem 0;
    position: fixed;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset, var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* 增加微妙的渐变边框效果 */
    left: 0;
    right: 0;
    width: 100%;
}

.navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--border-medium) 50%, transparent 100%);
    opacity: 0.6;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

.menu-toggle:hover {
    background: var(--hover-bg);
    transform: scale(1.05);
}

.menu-toggle:focus {
    outline: none;
    box-shadow: none;
}

.menu-icon {
    width: 24px;
    height: 18px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.menu-icon span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text-primary);
    border-radius: 1px;
    transition: all 0.3s ease;
}

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

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

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

/* 中间标签导航区域 */
.nav-center {
    flex: 1;
    display: flex;
    max-width: none;
    overflow: hidden;
}

/* 标签导航样式 */
.tab-navigation {
    width: 100%;
    max-width: none;
    position: relative;
}

.tab-scroll-container {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    mask-image: linear-gradient(to right, transparent 0%, black 5%, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 85%, transparent 100%);
}

.tab-scroll-container::-webkit-scrollbar {
    display: none;
}

.tab-list {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0 0.125rem;
    min-width: max-content;
    padding-right: 0.125rem;
}

.tab-item {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    border-radius: 20px;
    white-space: nowrap;
    position: relative;
}

.tab-item:hover {
    color: var(--text-primary);
    background: var(--hover-bg);
}

.tab-item.active {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.tab-item.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.tab-text {
    display: block;
    transition: transform 0.2s ease;
}

.tab-item:hover .tab-text {
    transform: scale(1.05);
}




/* 右侧功能区域 */
.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* 用户认证区域 */
.auth-section {
    position: relative;
}

/* 登录按钮样式 */
.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 60px;
    height: 36px;
}

.login-btn:hover {
    background: var(--tertiary-color);
    transform: translateY(-1px);
}

.login-text {
    font-weight: 500;
}

/* 用户头像按钮样式 */
.user-avatar-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.user-avatar-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.user-avatar-btn img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-btn.show {
    display: flex;
}

/* 移除通知按钮相关样式 */
.notification-btn,
.notification-icon,
.notification-badge {
    display: none;
}



@media (max-width: 768px) {
    .menu-toggle {
        padding: 0.25rem;
        /* 减少按钮内边距 */
        width: 32px;
        height: 32px;
    }

    /* 中间标签导航区域 */
    .nav-center {
        flex: 1;
        margin: 0 0.5rem;
        max-width: none;
        overflow: hidden;
    }




    .login-btn {
        padding: 0.25rem 0.5rem;
        /* 减少登录按钮内边距 */
        font-size: 0.8rem;
        min-width: 50px;
        height: 32px;
    }

    .tab-item {
        padding: 0.4rem 0.6rem;
        /* 适当的内边距 */
        font-size: 0.85rem;
        /* 稍微缩小字体避免重叠 */
        flex-shrink: 0;
        /* 防止被压缩 */
        text-align: center;
        min-width: auto;
        /* 自适应宽度 */
        white-space: nowrap;
        /* 确保文字不换行 */
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .nav-container {
        padding: 0 0.5rem;
    }
    
    .nav-center {
        margin: 0 0.25rem;
    }
    
    .tab-item {
        padding: 0.3rem 0.4rem;
        font-size: 0.8rem;
    }
    
    .login-btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.75rem;
        min-width: 45px;
    }
}

/* 侧边栏样式 */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.15);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.1s ease;
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    position: fixed;
    top: 80px; /* 避免与固定导航栏重叠 */
    left: -220px;
    width: 220px;
    height: calc(100% - 80px); /* 调整高度以适应导航栏 */
    background: rgba(255, 255, 255, 0.95); /* 恢复浅色背景 */
    z-index: 999;
    transition: left 0.1s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    overflow-x: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(0, 0, 0, 0.1); /* 恢复浅色边框 */
    /* 优化滚动体验 */
    scroll-behavior: smooth;
}



.sidebar.active {
    left: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1); /* 恢复浅色边框 */
    background: rgba(248, 250, 252, 0.9); /* 恢复浅色背景 */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary); /* 恢复主题文字颜色 */
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary); /* 恢复主题文字颜色 */
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    outline: none;
}

.sidebar-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.sidebar-close:focus {
    outline: none;
    box-shadow: none;
}

.sidebar-content {
    padding: 1.25rem;
    /* 确保内容区域可以正常滚动 */
    min-height: calc(100vh - 80px);
    /* 减去header高度 */
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
}



/* 用户状态区域 */
.user-status-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar-placeholder {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
}

.user-details {
    flex: 1;
}

.username {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.user-type {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* 功能区域 */
.feature-section {
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

.feature-section:last-child {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary); /* 恢复主题文字颜色 */
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding-left: 0.5rem;
    border-left: 3px solid var(--accent-color);
}

.feature-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.feature-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
    background: rgba(0, 0, 0, 0.05); /* 浅色背景的半透明效果 */
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.85rem;
    color: var(--text-primary); /* 恢复主题文字颜色 */
    text-align: left;
}

.feature-btn:hover {
    background: rgba(99, 102, 241, 0.1); /* 主题色半透明背景 */
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateX(3px) scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.feature-btn:focus {
    outline: none;
    box-shadow: none;
}

.feature-btn span {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
        left: -200px;
        height: 75vh;
        max-height: 600px;
        top: 10vh;
        border-radius: 0 16px 16px 0;
        /* 移动端滚动优化 */
        -webkit-overflow-scrolling: touch;
    }



    .sidebar-content {
        padding: 1rem;
        /* 移动端内容高度调整 - 适应新的侧边栏高度 */
        min-height: auto;
        max-height: calc(75vh - 70px);
        overflow-y: auto;
    }

    .feature-btn {
        padding: 0.5rem 0.7rem;
        font-size: 0.8rem;
    }
    
    .user-status-section {
        padding: 0.8rem;
    }
    
    .avatar-placeholder {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}
