/* 电脑端导航菜单样式 - 确保正常显示 */
.nav__menu {
    /* 默认桌面端样式 */
    display: flex;
    justify-content: flex-end;
    gap: 3rem;
    margin-left: auto;
}

.nav__toggle {
    /* 默认隐藏汉堡按钮 */
    display: none;
}

/* 移除移动端特有元素在桌面端的显示 */
.nav__overlay,
.nav__menu-header,
.nav__close {
    display: none;
}

/* 桌面端导航容器样式 */
.nav__container {
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background-color: var(--bg-white);
}

/* 桌面端导航链接样式 */
.nav__link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.nav__link:hover {
    color: var(--secondary);
}

.nav__link--active {
    color: var(--secondary);
    font-weight: 600;
    position: relative;
}

.nav__link--active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--secondary);
}

/* 移动端导航栏 - 汉堡菜单实现 */
@media (max-width: 768px) {
    /* 重置桌面端样式 */
    .nav__menu {
        display: none;
        /* 默认完全隐藏 */
    }
    
    /* 移动端导航容器 */
    .nav__container {
        padding: 0.8rem 1rem;
        height: auto;
        min-height: 70px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        background-color: var(--bg-white);
        box-shadow: var(--shadow-sm);
    }
    
    /* 汉堡菜单按钮显示 */
    .nav__toggle {
        display: block;
        font-size: 1.5rem;
        color: var(--primary);
        background: none;
        border: none;
        cursor: pointer;
        padding: 0.5rem;
        z-index: 1001;
        transition: transform 0.3s ease;
    }
    
    .nav__toggle.active {
        transform: rotate(90deg);
    }
    
    /* 导航遮罩层 */
    .nav__overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 999;
    }
    
    .nav__overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* 导航菜单 - 侧边弹出样式 */
    .nav__menu.active {
        display: flex;
        position: fixed;
        top: 0;
        right: 0;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: var(--primary);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0 !important;
        margin: 0 !important;
        z-index: 1000;
        animation: slideInRight 0.3s ease forwards;
        /* 强制内容从顶部开始 */
        justify-content: flex-start !important;
        overflow-y: auto;
    }
    
    @keyframes slideInRight {
        from {
            transform: translateX(100%);
        }
        to {
            transform: translateX(0);
        }
    }
    
    /* 菜单顶部样式 */
    .nav__menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 1.5rem 0.5rem;
        margin-bottom: 0 !important;
        border-bottom: none;
    }
    
    .nav__menu-title {
        color: var(--bg-white);
        font-size: 1.2rem;
        font-weight: 600;
    }
    
    .nav__close {
        display: block;
        color: var(--bg-white);
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.5rem;
    }
    
    /* 导航链接样式 - 强制置顶 */
    .nav__link {
        display: block !important;
        padding: 1rem 1.5rem;
        color: var(--bg-white) !important;
        text-decoration: none !important;
        font-size: 1.1rem;
        transition: all 0.3s ease;
        position: relative;
        text-decoration-line: none !important;
        margin: 0 !important;
        /* 确保链接在顶部显示 */
        order: 1;
    }
    
    /* 导航链接悬停状态 */
    .nav__link:hover {
        background-color: var(--primary-light);
    }
    
    /* 活动链接样式 */
    .nav__link--active {
        color: var(--secondary-light) !important;
        font-weight: 600;
        background-color: var(--primary-dark);
    }
}

/* 小屏移动设备优化 */
@media (max-width: 480px) {
    .nav__container {
        padding: 0 0.8rem;
        height: 65px;
    }
    

    
    .nav-tab {
        grid-template-columns: 1fr !important;
        font-size: 0.85rem !important;
        padding: 10px 8px !important;
    }
    
    .section__title {
        font-size: 1.8rem !important;
    }
    
    /* 修复服务详情页面的布局 */
    .service-header {
        flex-direction: column !important;
        text-align: center !important;
        gap: 15px !important;
    }
    
    .service-info h2 {
        font-size: 1.8rem !important;
    }
    
    .service-description {
        font-size: 0.95rem !important;
    }
    
    /* 优化内容区域 */
    .service-content {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }
    
    .content-sidebar {
        position: static !important;
        margin-top: 0 !important;
    }
    
    /* 优化表格在移动端的显示 */
    .service-table {
        width: 100% !important;
        font-size: 0.9rem !important;
    }
    
    .service-table td {
        padding: 10px !important;
    }
    
    /* 优化法律税务页面布局 */
    .legal-tax-content {
        flex-direction: column !important;
        gap: 30px !important;
    }
    
    .legal-tax-table {
        width: 100% !important;
    }
}