/**
 * 手机端导航样式 - 全新编写
 */

/* 手机端菜单按钮 */
.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* 手机端遮罩层 */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.mobile-overlay.active {
    display: block;
}

/* 平板和手机端适配 */
@media (max-width: 1024px) {
    .mobile-menu-btn {
        display: flex;
    }
    
    /* 主导航菜单 - 侧边滑出 */
    .main-nav {
        position: fixed;
        top: 70px;
        left: 0;
        width: 280px;
        height: calc(100vh - 70px);
        background: white;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
        display: block !important;
    }
    
    .main-nav.active {
        transform: translateX(0);
    }
    
    /* 导航列表 */
    .nav-list {
        flex-direction: column;
        padding: 0;
        margin: 0;
        list-style: none;
    }
    
    .nav-item {
        border-bottom: 1px solid #eee;
    }
    
    .nav-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        color: var(--text-primary);
        text-decoration: none;
        font-size: 16px;
    }
    
    .nav-link i {
        font-size: 12px;
        transition: transform 0.3s ease;
    }
    
    /* 下拉菜单 */
    .dropdown-menu {
        display: none;
        background: #f8f8f8;
        padding: 0;
        margin: 0;
        list-style: none;
    }
    
    .nav-item.has-dropdown.active .dropdown-menu {
        display: block;
    }
    
    .nav-item.has-dropdown.active .nav-link i {
        transform: rotate(180deg);
    }
    
    .dropdown-menu li {
        border-top: 1px solid #eee;
    }
    
    .dropdown-menu li a {
        display: flex;
        align-items: center;
        padding: 14px 20px 14px 40px;
        color: var(--text-secondary);
        text-decoration: none;
        font-size: 14px;
    }
    
    .dropdown-menu li a i {
        margin-right: 10px;
        width: 20px;
        text-align: center;
    }
    
    /* 防止body滚动 */
    body.menu-open {
        overflow: hidden;
    }
}

/* 小屏幕手机适配 */
@media (max-width: 375px) {
    .main-nav {
        width: 260px;
    }
}
