/* 移动端菜单增强样式 */

/* 菜单按钮基础样式 - 电脑端默认隐藏 */
.menu-toggle {
    display: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 3000;
    padding: 12px 16px;
    border-radius: 12px;
    background-color: var(--bg-primary);
    border: 2px solid transparent;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
}

/* 导航菜单电脑端样式 */
.nav-list {
    display: flex;
    list-style: none;
    gap: 2rem;
}

/* 菜单项电脑端样式 */
.nav-list li {
    position: relative;
}

.nav-list li a {
    display: block;
    padding: 8px 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.nav-list li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-list li a:hover {
    color: var(--primary-color);
}

.nav-list li a:hover::after {
    width: 100%;
}

/* 当前活动菜单项 - 电脑端 */
.nav-list li a.active {
    color: var(--primary-color);
    font-weight: 600;
}

.nav-list li a.active::after {
    width: 100%;
    background-color: var(--primary-color);
}

/* 响应式设计 - 移动端特定样式 */
@media (max-width: 768px) {
    /* 移动端菜单按钮样式 - 覆盖电脑端的隐藏样式 */
    .menu-toggle {
        display: flex !important;
        margin-left: auto;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        z-index: 3000;
        padding: 12px 16px;
        border-radius: 12px;
        background-color: var(--bg-primary);
        border: 2px solid transparent;
        align-items: center;
        justify-content: center;
        min-width: 48px;
        height: 48px;
    }

    .menu-toggle:hover {
        background-color: var(--bg-accent);
        transform: scale(1.05);
        box-shadow: 0 2px 8px rgba(67, 97, 238, 0.1);
    }

    .menu-toggle.active {
        background-color: var(--bg-accent);
        border-color: var(--primary-color);
        box-shadow: 0 2px 12px rgba(67, 97, 238, 0.2);
    }

    .menu-toggle i {
        font-size: 1.5rem;
        color: var(--text-primary);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .menu-toggle.active i {
        color: var(--primary-color);
        transform: rotate(90deg);
    }

    /* 移动端菜单遮罩层样式 */
    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 1999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

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

    /* 移动端header样式 */
    .header {
        padding: 16px 20px;
        position: sticky;
        top: 0;
        z-index: 3000;
        background-color: var(--bg-primary);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    }

    .header-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    /* 移动端导航菜单样式 */
    .nav-list {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        border-radius: 16px 16px 0 0;
        background-color: var(--bg-primary);
        border-top: 1px solid var(--border-color);
        padding: 8px 0;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        transform-origin: top center;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        z-index: 2000;
        background-color: var(--bg-primary);
    }

    .nav-list.active {
        opacity: 1;
        transform: scaleY(1);
        visibility: visible;
    }

    .nav-list:not(.active) {
        opacity: 0;
        transform: scaleY(0.9);
        visibility: hidden;
    }

    /* 移动端菜单项样式 */
    .nav-list li {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        border-bottom: 1px solid var(--border-color);
        background-color: var(--bg-primary);
        padding: 0;
    }

    .nav-list li:last-child {
        border-bottom: none;
    }

    .nav-list li:hover {
        background-color: var(--bg-secondary);
    }

    .nav-list li a {
        padding: 16px 24px;
        font-size: 1.1rem;
        color: var(--text-primary);
        overflow: hidden;
        display: block;
        text-decoration: none;
    }

    .nav-list li a:hover {
        transform: translateX(8px);
    }
    
    /* 防止移动端导航栏干扰输入框 */
    .mobile-nav-container {
        position: relative;
        z-index: 1000;
    }
    
    .mobile-nav-item {
        cursor: pointer;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
    }
    
    /* 确保输入框在移动端导航栏之上 */
    .ai-chat-section textarea,
    .ai-chat-section input {
        position: relative;
        z-index: 1001;
    }

    /* 防止页面滚动 */
    .no-scroll {
        overflow: hidden;
    }

    /* 添加滚动条样式 */
    .nav-list::-webkit-scrollbar {
        width: 4px;
    }
    
    .nav-list::-webkit-scrollbar-track {
        background: var(--bg-secondary);
    }
    
    .nav-list::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 2px;
    }
    
    .nav-list::-webkit-scrollbar-thumb:hover {
        background: var(--text-light);
    }
}

/* 防止菜单打开时页面滚动 */
body.menu-open {
    overflow: hidden;
    touch-action: none;
}

/* 动画效果 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 为菜单添加交互动画 */
.nav-list.active {
    animation: slideDown 0.4s ease forwards;
}

.nav-list li {
    opacity: 0;
    transform: translateX(-20px);
}

.nav-list.active li {
    animation: fadeIn 0.3s ease forwards;
}

.nav-list.active li:nth-child(1) {
    animation-delay: 0.1s;
}

.nav-list.active li:nth-child(2) {
    animation-delay: 0.15s;
}

.nav-list.active li:nth-child(3) {
    animation-delay: 0.2s;
}

.nav-list.active li:nth-child(4) {
    animation-delay: 0.25s;
}