/**
 * Mobile Header - Modern Design
 * 移动端页眉现代设计
 * @version 1.0.0
 */

/* ==================== 移动端顶部页眉 ==================== */
@media (max-width: 768px) {
    /* 基础页眉样式 */
    .site-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        transition: all 0.3s ease;
    }

    .site-header.scrolled {
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
        border-bottom-color: transparent;
    }

    .header-container {
        padding: 0 16px;
    }

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

    /* Logo样式 */
    .site-branding {
        flex: 0 0 auto;
    }

    .site-branding a {
        display: flex;
        align-items: center;
        text-decoration: none;
    }

    .site-branding img {
        height: 28px;
        width: auto;
        display: block;
    }

    /* 右侧工具栏 */
    .header-tools {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* CTA按钮 */
    .header-tools .header-cta {
        display: inline-flex;
        align-items: center;
        padding: 8px 16px;
        background: var(--es-primary, #FF6B35);
        color: white;
        font-size: 13px;
        font-weight: 600;
        border-radius: 20px;
        text-decoration: none;
        white-space: nowrap;
        box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
    }

    /* 汉堡菜单按钮 */
    .menu-toggle {
        width: 40px;
        height: 40px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        position: relative;
    }

    .menu-icon-bar {
        width: 20px;
        height: 2px;
        background: #1a1a2e;
        border-radius: 2px;
        transition: all 0.3s ease;
        transform-origin: center;
    }

    /* 汉堡菜单动画 */
    .menu-toggle[aria-expanded="true"] .menu-icon-bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .menu-toggle[aria-expanded="true"] .menu-icon-bar:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }

    .menu-toggle[aria-expanded="true"] .menu-icon-bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* 主导航（桌面端隐藏） */
    .main-navigation {
        display: none;
    }

    /* ==================== 移动端全屏菜单 ==================== */
    .mobile-menu-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1001;
    }

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

    .mobile-menu-panel {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 85%;
        max-width: 320px;
        background: white;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1002;
        display: flex;
        flex-direction: column;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    }

    .mobile-menu-panel.active {
        transform: translateX(0);
    }

    /* 菜单头部 */
    .mobile-menu-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        border-bottom: 1px solid #f0f0f0;
    }

    .mobile-menu-title {
        font-size: 18px;
        font-weight: 700;
        color: #1a1a2e;
    }

    .mobile-menu-close {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f5f5f5;
        border: none;
        border-radius: 50%;
        font-size: 24px;
        color: #666;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .mobile-menu-close:hover {
        background: #eee;
        color: #333;
    }

    /* 菜单内容 */
    .mobile-menu-content {
        flex: 1;
        overflow-y: auto;
        padding: 16px 0;
    }

    .mobile-menu-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .mobile-menu-list li {
        border-bottom: 1px solid #f5f5f5;
    }

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

    .mobile-menu-list a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 16px 20px;
        color: #1a1a2e;
        text-decoration: none;
        font-size: 15px;
        font-weight: 500;
        transition: all 0.2s ease;
    }

    .mobile-menu-list a:hover,
    .mobile-menu-list a:active {
        background: #fafafa;
        color: var(--es-primary, #FF6B35);
    }

    .mobile-menu-list a svg {
        width: 20px;
        height: 20px;
        color: #999;
        flex-shrink: 0;
    }

    /* 子菜单 */
    .mobile-menu-list .has-children > a {
        justify-content: space-between;
    }

    .mobile-menu-list .has-children > a::after {
        content: '';
        width: 8px;
        height: 8px;
        border-right: 2px solid #999;
        border-bottom: 2px solid #999;
        transform: rotate(-45deg);
        transition: transform 0.3s ease;
    }

    .mobile-menu-list .has-children.open > a::after {
        transform: rotate(45deg);
    }

    .mobile-submenu {
        list-style: none;
        padding: 0;
        margin: 0;
        background: #fafafa;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .mobile-submenu.open {
        max-height: 300px;
    }

    .mobile-submenu a {
        padding-left: 52px;
        font-size: 14px;
        color: #666;
    }

    /* 菜单底部 */
    .mobile-menu-footer {
        padding: 20px;
        border-top: 1px solid #f0f0f0;
    }

    .mobile-menu-cta {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 14px 24px;
        background: var(--es-primary, #FF6B35);
        color: white;
        font-size: 15px;
        font-weight: 600;
        border-radius: 12px;
        text-decoration: none;
        box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
    }

    /* 已登录用户信息 */
    .mobile-user-info {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 16px 20px;
        border-bottom: 1px solid #f0f0f0;
    }

    .mobile-user-info img {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        object-fit: cover;
    }

    .mobile-user-info .user-details {
        flex: 1;
    }

    .mobile-user-info .user-name {
        font-size: 15px;
        font-weight: 600;
        color: #1a1a2e;
        display: block;
    }

    .mobile-user-info .user-email {
        font-size: 12px;
        color: #999;
        display: block;
        margin-top: 2px;
    }

    /* ==================== 底部固定导航栏优化 ==================== */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        display: flex;
        justify-content: space-around;
        padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
        z-index: 999;
    }

    .mobile-bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 4px 12px;
        color: #999;
        text-decoration: none;
        font-size: 11px;
        font-weight: 500;
        transition: all 0.2s ease;
        position: relative;
    }

    .mobile-bottom-nav-item svg {
        width: 24px;
        height: 24px;
        stroke-width: 1.8;
        transition: all 0.2s ease;
    }

    .mobile-bottom-nav-item.active {
        color: var(--es-primary, #FF6B35);
    }

    .mobile-bottom-nav-item.active svg {
        stroke-width: 2.2;
    }

    /* 中间按钮特殊样式 */
    .mobile-bottom-nav-item.nav-resume {
        position: relative;
        margin-top: -20px;
    }

    .mobile-bottom-nav-item.nav-resume::before {
        content: '';
        position: absolute;
        top: -6px;
        left: 50%;
        transform: translateX(-50%);
        width: 52px;
        height: 52px;
        background: var(--es-primary, #FF6B35);
        border-radius: 50%;
        box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
        z-index: -1;
    }

    .mobile-bottom-nav-item.nav-resume svg {
        color: white;
        stroke-width: 2;
    }

    .mobile-bottom-nav-item.nav-resume span {
        color: var(--es-primary, #FF6B35);
        font-weight: 600;
    }

    /* 页面内容避免被遮挡 */
    .site-main {
        padding-top: 56px;
        padding-bottom: 64px;
    }

    /* 搜索弹窗移动端优化 */
    .search-modal-content {
        padding: 60px 20px 20px;
    }

    .search-modal-close {
        top: 16px;
        right: 16px;
        width: 36px;
        height: 36px;
        font-size: 28px;
    }

    .search-form input {
        font-size: 18px;
        padding: 16px 48px 16px 20px;
    }
}

/* ==================== 平板设备优化 ==================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .mobile-bottom-nav {
        display: none;
    }
    
    .site-main {
        padding-bottom: 0;
    }
}
