/**
 * mobile-fix.css - 移动端导航菜单样式
 * 修复汉堡菜单的显示和动画效果
 */

/* ========================================
   移动端导航容器
   ======================================== */

/* 默认隐藏汉堡菜单容器(PC端) */
.nav-menu-toggle {
    display: none;
}

/* ========================================
   汉堡菜单图标样式
   ======================================== */

.hamburger {
    display: none;
    cursor: pointer;
    padding: 10px;
    background: none;
    border: none;
    position: relative;
    z-index: 9999;
}

.hamburger-line {
    width: 30px;
    height: 3px;
    background: #00b0ff;
    margin: 6px 0;
    transition: all 0.3s ease;
    border-radius: 3px;
    display: block;
}

/* 汉堡菜单激活状态(变为X) */
.hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* ========================================
   移动端菜单样式
   ======================================== */

.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(13, 13, 61, 0.98);
    padding: 20px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 9998;
    backdrop-filter: blur(10px);
}

/* 菜单打开状态 */
.mobile-menu.open {
    display: block;
    animation: slideDown 0.3s ease-out;
}

/* 菜单隐藏状态 */
.mobile-menu[aria-hidden="true"] {
    display: none;
}

.mobile-menu[aria-hidden="false"] {
    display: block;
}

/* 菜单列表样式 */
.mobile-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.mobile-menu li {
    display: block;
    margin: 0;
}

.mobile-menu a {
    display: block;
    padding: 15px 30px;
    text-align: left;
    color: #00b0ff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.mobile-menu a:hover,
.mobile-menu a:active {
    background: rgba(0, 176, 255, 0.1);
    border-left-color: #00b0ff;
    padding-left: 35px;
}

/* ========================================
   动画效果
   ======================================== */

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   移动端响应式样式
   ======================================== */

@media (max-width: 768px) {
    /* 显示汉堡菜单容器 */
    .nav-menu-toggle {
        display: block !important;
    }
    
    /* 显示汉堡菜单图标 */
    .hamburger {
        display: block !important;
    }
    
    /* 隐藏PC端导航 */
    .site-nav {
        display: none !important;
    }
    
    /* 确保header布局正确 */
    .header-inner {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    /* 确保site-header固定在顶部 */
    .site-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: rgba(13, 13, 61, 0.95);
        backdrop-filter: blur(10px);
    }
    
    /* 为固定header添加body padding */
    body {
        padding-top: 60px;
    }
}

/* PC端样式 */
@media (min-width: 769px) {
    /* 隐藏汉堡菜单 */
    .nav-menu-toggle {
        display: none !important;
    }
    
    .hamburger {
        display: none !important;
    }
    
    /* 显示PC端导航 */
    .site-nav {
        display: flex !important;
    }
    
    /* 隐藏移动菜单 */
    .mobile-menu {
        display: none !important;
    }
}

/* ========================================
   触摸优化
   ======================================== */

@media (max-width: 768px) {
    /* 增大触摸区域 */
    .hamburger {
        padding: 15px;
        -webkit-tap-highlight-color: rgba(0, 176, 255, 0.2);
    }
    
    .mobile-menu a {
        padding: 18px 30px;
        -webkit-tap-highlight-color: rgba(0, 176, 255, 0.2);
    }
    
    /* 防止文本选择 */
    .hamburger,
    .mobile-menu a {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
}

/* ========================================
   可访问性增强
   ======================================== */

/* 键盘焦点样式 */
.hamburger:focus {
    outline: 2px solid #00b0ff;
    outline-offset: 2px;
}

.mobile-menu a:focus {
    outline: 2px solid #00b0ff;
    outline-offset: -2px;
    background: rgba(0, 176, 255, 0.1);
}

/* 减少动画(用户偏好) */
@media (prefers-reduced-motion: reduce) {
    .hamburger-line,
    .mobile-menu,
    .mobile-menu a {
        transition: none;
    }
    
    .mobile-menu.open {
        animation: none;
    }
}
