/**
 * 移动端全屏菜单样式
 * Mobile Fullscreen Menu
 */

/* ==========================================
   汉堡按钮样式
   ========================================== */
.mobile-menu-toggle {
    display: none;
    position: relative;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1002;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 10px;
}

.mobile-menu-toggle:hover {
    opacity: 0.7;
}

.mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

/* 激活状态的汉堡按钮 */
.mobile-menu-toggle.active {
    background: transparent;
}

.mobile-menu-toggle.active span {
    background: #0085cd;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================
   移动端全屏菜单容器
   ========================================== */
.nav201 .list201 {
    /* 桌面端默认样式保持不变 */
}

/* ==========================================
   移动端样式
   ========================================== */
@media (max-width: 767px) {
    /* 显示汉堡按钮 */
    .mobile-menu-toggle {
        display: flex !important;
    }

    /* 全屏菜单容器 */
    .nav201 .list201 {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100vh;
        background: linear-gradient(135deg, #0085cd 0%, #006ba1 100%);
        z-index: 1001;
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 80px 30px 30px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        
        /* 默认隐藏 */
        opacity: 0;
        visibility: hidden;
        transform: scale(0.95);
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* 激活状态 */
    .nav201 .list201.active {
        opacity: 1;
        visibility: visible;
        transform: scale(1);
    }

    /* 菜单项样式 */
    .nav201 .list201 > li {
        width: 100%;
        max-width: 400px;
        margin: 0 0 15px 0 !important;
        text-align: center;
        animation: slideInUp 0.5s ease forwards;
        opacity: 0;
    }

    /* 逐个菜单项动画延迟 */
    .nav201 .list201.active > li:nth-child(1) { animation-delay: 0.1s; }
    .nav201 .list201.active > li:nth-child(2) { animation-delay: 0.15s; }
    .nav201 .list201.active > li:nth-child(3) { animation-delay: 0.2s; }
    .nav201 .list201.active > li:nth-child(4) { animation-delay: 0.25s; }
    .nav201 .list201.active > li:nth-child(5) { animation-delay: 0.3s; }
    .nav201 .list201.active > li:nth-child(6) { animation-delay: 0.35s; }
    .nav201 .list201.active > li:nth-child(7) { animation-delay: 0.4s; }
    .nav201 .list201.active > li:nth-child(8) { animation-delay: 0.45s; }

    @keyframes slideInUp {
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .nav201 .list201 > li {
        transform: translateY(20px);
    }

    /* 主菜单链接 */
    .nav201 .list201 > li > a {
        display: block;
        padding: 18px 25px;
        background: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(10px);
        border-radius: 12px;
        color: white !important;
        font-size: 16px;
        font-weight: 600;
        text-align: center;
        border: 1px solid rgba(255, 255, 255, 0.2);
        transition: all 0.3s;
    }

    .nav201 .list201 > li > a:hover,
    .nav201 .list201 > li > a.hover {
        background: rgba(255, 255, 255, 0.25);
        border-color: rgba(255, 255, 255, 0.4);
        transform: translateX(5px);
    }

    .nav201 .list201 > li > a span {
        display: block;
        font-size: 11px;
        opacity: 0.8;
        margin-top: 4px;
        font-weight: 400;
    }

    .nav201 .list201 > li > a i {
        display: none;
    }

    /* 子菜单样式 */
    .nav201 .list201 > li dl {
        position: static;
        display: none;
        width: 100%;
        background: transparent;
        box-shadow: none;
        padding: 10px 0 0 0;
        margin: 0;
    }

    .nav201 .list201 > li.has-submenu > a:after {
        content: '▼';
        position: absolute;
        right: 20px;
        font-size: 10px;
        transition: transform 0.3s;
    }

    .nav201 .list201 > li.has-submenu.open > a:after {
        transform: rotate(180deg);
    }

    .nav201 .list201 > li.has-submenu.open dl {
        display: block;
        animation: expandMenu 0.3s ease forwards;
    }

    @keyframes expandMenu {
        from {
            opacity: 0;
            max-height: 0;
        }
        to {
            opacity: 1;
            max-height: 500px;
        }
    }

    .nav201 .list201 > li dl dd {
        margin: 0;
        padding: 0;
    }

    .nav201 .list201 > li dl dd a {
        display: block;
        padding: 12px 25px;
        color: rgba(255, 255, 255, 0.9) !important;
        font-size: 14px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        margin: 5px 0;
        transition: all 0.3s;
    }

    .nav201 .list201 > li dl dd a:hover {
        background: rgba(255, 255, 255, 0.2);
        padding-left: 30px;
    }

    /* 关闭按钮区域 */
    .menu-close-hint {
        position: absolute;
        bottom: 30px;
        left: 50%;
        transform: translateX(-50%);
        color: rgba(255, 255, 255, 0.7);
        font-size: 13px;
        text-align: center;
    }

    .menu-close-hint:before {
        content: '点击屏幕或按ESC关闭';
        display: block;
    }

    /* 防止背景滚动 */
    body.menu-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }

    /* 导航栏容器调整 */
    .nav201 {
        position: relative;
        z-index: 1000;
    }

    .nav201 .na201 {
        position: relative;
    }

    /* Logo区域调整（确保汉堡按钮不遮挡） */
    .h201_main .head201 {
        position: relative;
        z-index: 999;
    }
}

/* ==========================================
   平板竖屏适配
   ========================================== */
@media (max-width: 991px) and (min-width: 768px) {
    /* 平板可选择使用全屏菜单或保持桌面布局 */
    /* 如需启用，取消以下注释 */
    /*
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav201 .list201 {
        // 同移动端样式
    }
    */
}

/* ==========================================
   横屏适配
   ========================================== */
@media (max-width: 767px) and (orientation: landscape) {
    .nav201 .list201 {
        justify-content: flex-start;
        padding-top: 70px;
    }

    .nav201 .list201 > li > a {
        padding: 12px 20px;
        font-size: 14px;
    }

    .nav201 .list201 > li {
        margin: 0 0 8px 0 !important;
    }
}

/* ==========================================
   动画性能优化
   ========================================== */
.nav201 .list201,
.mobile-menu-toggle,
.mobile-menu-toggle span {
    will-change: transform, opacity;
}

/* 减弱动画（用户偏好设置） */
@media (prefers-reduced-motion: reduce) {
    .nav201 .list201,
    .nav201 .list201 > li,
    .mobile-menu-toggle span {
        animation: none !important;
        transition: none !important;
    }
}

/* ==========================================
   打印样式
   ========================================== */
@media print {
    .mobile-menu-toggle {
        display: none !important;
    }

    .nav201 .list201 {
        position: static;
        display: block;
        background: none;
    }
}
