/**
 * navbar.css
 * ================================================
 * 导航栏样式定义文件
 * ------------------------------------------------
 * 功能说明：
 * 1. 定义网站顶部导航栏的视觉样式
 * 2. 实现响应式布局适配不同设备屏幕
 * 3. 定义导航元素的交互动画效果
 * 4. 实现导航栏在页面滚动时固定在原位置
 * 
 * 样式组织：
 * - 导航栏容器 (.site-header)
 * - 导航内容容器 (.nav-container)
 * - 网站Logo区域 (.nav-logo, .nav-logo-text)
 * - 导航菜单 (.nav-menu, .nav-links, .nav-item, .nav-link)
 * - 动画效果定义 (@keyframes)
 * 
 * 响应式断点：
 * - 移动设备：默认样式
 * - 平板设备：min-width: 640px
 * - 桌面设备：min-width: 1024px
 * 
 * 配色方案：
 * - 背景色：rgba(31, 41, 55, 0.8)（半透明深灰）
 * - 文字颜色：#f5f5f7（白色）
 * - 强调色：通过SVG内部定义
 * 
 * 版本: 1.0.4
 * 最后更新: 2023-05-22
 */

/* CSS变量定义 - 可调节的间距 */
:root {
    --logo-menu-spacing: 3rem; /* 可调节：LOGO与菜单间的间距 */
}

/* 导航栏容器包装
 * ------------------------------------------------
 * 创建一个固定高度的容器来承载导航栏
 * 确保滚动时页面布局不会跳动
 */
.header-wrapper {
    height: calc(40px + 1.5rem); /* 导航栏总高度：导航栏高度 + 内边距 */
    margin: 0; /* 移除左右边距，让导航条铺满页面 */
    position: relative;
    margin-bottom: 1.5rem; /* 与游戏区和more games区域间距一致，等于gap-6 */
}

/* 导航栏主容器样式
 * ------------------------------------------------
 * 创建一个半透明的导航栏，带有背景模糊效果
 * 应用圆角和阴影增强视觉层次感
 * 固定在页面顶部
 */
.site-header {
    background-color: rgba(34, 34, 34, 0.5);  /* rgba(45, 45, 45, 1); */
    backdrop-filter: blur(8px); /* 保持模糊效果 */
    margin: 0; /* 移除所有边距，让导航条铺满页面 */
    padding: 0.75rem 1.5rem; /* 左右内边距1.5rem */
    border-radius: 0; /* 移除圆角，让导航条完全铺满 */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    /* border-bottom: 0.5px solid #4a4a4a;  移除底边线 */
    position: fixed; /* 改为固定定位 */
    top: 0; /* 固定在页面顶部 */
    left: 0; /* 从左侧开始 */
    right: 0; /* 延伸到右侧 */
    z-index: 200 !important; /* 确保在其他元素之上 */
    padding-left: 1rem !important; /* 侧边菜单栏的右内边距1rem */
    margin-left: 0 !important;
}

/* 导航内容容器
 * ------------------------------------------------
 * 创建一个水平布局的容器，用于放置导航元素
 * 设置最大宽度确保在大屏幕上内容不会过宽
 */
.nav-container {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* 改为左对齐，让logo和菜单更靠近 */
    max-width: 88rem;
    margin: 0 auto;
    margin-left: 0 !important;
    padding-left: 0 !important;
}

/* Logo链接容器
 * ------------------------------------------------
 * 定义Logo区域的布局，包含SVG图标和文字
 */
.nav-logo {
    display: flex;
    align-items: center;
    color: #f5f5f7;
    text-decoration: none;
    margin-right: var(--logo-menu-spacing); /* 使用CSS变量控制与菜单的间距 */
}

/* Logo SVG图标
 * ------------------------------------------------
 * 设置SVG图标的尺寸和间距
 */
.nav-logo svg {
    width: 40px;
    height: 40px;
    margin-right: 0.75rem;
}

/* Logo文字样式
 * ------------------------------------------------
 * 定义网站名称文字的字体、大小和其他样式
 *  
 */
.nav-logo-text {
  /* --- 字体设置 --- */
  /* 使用 'Russo One' 字体，具有现代、科技感强的风格 */
  font-family: 'Russo One', sans-serif;
  /* 恢复为更适合导航栏的字体大小 */
  font-size: 1.6rem; 
  /* 恢复为原始的字间距 */
  letter-spacing: 0.5px;

  /* --- 渐变背景 --- */
  /* 创建一个从亮灰到深灰的垂直线性渐变，模拟金属光泽 */
  background: linear-gradient(180deg, #F0F0F0, hwb(0 91% 8%), #F0F0F0);

  /* --- 文字裁剪效果 --- */
  /* (核心) 将背景裁剪为文字的形状 */
  -webkit-background-clip: text;
  background-clip: text;

  /* (核心) 将文字颜色设为透明，以显示裁剪后的背景 */
  color: transparent;

  /* --- 视觉增强 --- */
  /* 添加一个细微的阴影来增加立体感 */
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* 导航菜单
 * ------------------------------------------------
 * 定义导航菜单的整体布局
 */
.nav-menu {
    display: flex;
    align-items: center;
    flex: none; /* 不占据中间空间 */
    margin-left: auto !important; /* 推到最右侧 */
    margin-right: 0.5rem !important; /* 与手柄图标间距 */
}

/* 导航链接列表
 * ------------------------------------------------
 * 定义导航链接的列表布局
 */
.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* 导航项
 * ------------------------------------------------
 * 定义每个导航项的样式
 */
.nav-item {
    margin-left: 0; /* 移除左侧间距 */
}

/* 为除第一个之外的所有导航项添加左侧间距 */
.nav-item + .nav-item {
    margin-left: 0.9rem;
}

/* 导航链接
 * ------------------------------------------------
 * 定义导航链接的样式
 */
.nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #B0B0B0;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    margin: 0; /* 移除基础margin，让间距完全由.nav-item + .nav-item控制 */
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

/* Home链接特殊样式
 * ------------------------------------------------
 * 定义Home菜单按钮的特殊样式，包括线框边框
 */
.nav-link.home-link {
    color: #B0B0B0; /* 默认时使用与正文一致的颜色 */
    border: none; /* 默认时无边框 */
    border-radius: 0.4rem;
    padding: 0.25rem 0.50rem; /* 恢复内边距以保持悬停绿色边框的大小 */
    font-family: 'Nunito', sans-serif; /* 使用Nunito字体 */
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer; /* 添加与random-game-link一致的鼠标指针样式 */
}

/* Home链接悬停效果
 * ------------------------------------------------
 */
.nav-link.home-link:hover {
    color: #f5f5f7; /* 悬停时文字变为白色 */
    border: 1px solid #d6fe51; /* 悬停时显示绿色边框 */
    background-color: transparent; /* 覆盖通用的nav-link:hover样式的背景色 */
}

/* 导航链接hover效果
 * ------------------------------------------------
 */
.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 激活状态的导航链接
 * ------------------------------------------------
 */
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

/* 导航链接图标
 * ------------------------------------------------
 */
.nav-link i {
    margin-right: 0rem; 
    margin-right: 0.2rem; /* 缩小图标与文字间的间距 */
    transition: color 0.2s ease; /* 添加颜色过渡动画 */
}

/* 导航链接悬停时图标变绿色 */
.nav-link:hover i {
    color: #d6fe51; /* 悬停时图标变为绿色 */
}

/* 创建动画效果 */
@keyframes carPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.car-pulse-anim {
    animation: carPulse 2s ease-in-out infinite;
    transform-origin: center;
}

/* Random Game链接特殊样式
 * 让Random Game菜单按钮和Home一致，包括线框边框和字体
 */
.nav-link.random-game-link {
    color: #B0B0B0;
    border: none;
    border-radius: 0.4rem;
    padding: 0.25rem 0.50rem; /* 恢复内边距以保持悬停绿色边框的大小 */
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-link.random-game-link:hover {
    color: #f5f5f7;
    border: 1px solid #d6fe51;
    background-color: transparent;
}

/* 只保留ready类的样式，用于显示初始化状态 */
.nav-link.random-game-link.ready {
    position: relative;
}

.nav-link.random-game-link.ready:before {
    content: "";  /* 移除🎲图标 */
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8em;
    opacity: 0.8;
}

.nav-link.guide-link {
    color: #a0aec0;
    border: none;
    border-radius: 0.4rem;
    padding: 0.25rem 0.50rem; /* 恢复内边距以保持悬停绿色边框的大小 */
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}
.nav-link.guide-link:hover {
    color: #f5f5f7;
    border: 1px solid #d6fe51;
    background-color: transparent;
}

/* 分类菜单链接样式
 * ------------------------------------------------
 * 定义分类菜单按钮的样式，与home菜单保持一致
 */
.nav-link.category-link {
    color: #B0B0B0; /* 默认时使用与正文一致的颜色 */
    border: none; /* 默认时无边框 */
    border-radius: 0.4rem;
    padding: 0.25rem 0.50rem; /* 恢复内边距以保持悬停绿色边框的大小 */
    font-family: 'Nunito', sans-serif; /* 使用Nunito字体 */
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

/* 分类菜单链接悬停效果
 * ------------------------------------------------
 */
.nav-link.category-link:hover {
    color: #f5f5f7; /* 悬停时文字变为白色 */
    border: 1px solid #d6fe51; /* 悬停时显示绿色边框 */
    background-color: transparent; /* 覆盖通用的nav-link:hover样式的背景色 */
}

/* 工具栏Guide链接样式
 * ------------------------------------------------
 * 游戏工具栏中的Guide链接样式，与导航栏Home链接保持一致
 */
.toolbar-guide-link {
    color: #a0aec0; /* 默认使用与导航栏Home一致的颜色 */
    text-decoration: none;
    font-family: 'Nunito', sans-serif; /* 与Home链接一致 */
    font-weight: 600; /* 与Home链接一致 */
    font-size: 1rem; /* 与Home链接一致 */
    border: none; /* 默认时无边框 */
    border-radius: 0.4rem; /* 与Home链接一致 */
    margin: 0.3rem 0.3rem; /* 统一所有菜单的水平左右边距 */
    text-align: center; /* 与Home链接一致 */
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative; /* 为下划线定位 */
    display: inline-block; /* 确保伪元素正确显示 */
}

/* 添加下划线效果 */
.toolbar-guide-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 1.5px;
    background-color: #f5f5f7;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

/* 工具栏Guide链接悬停效果 */
.toolbar-guide-link:hover {
    font-weight: 700; /* 悬停时字体加粗 */
    color: #f5f5f7; /* 悬停时文字变为白色 */
    background-color: transparent;
}

/* 悬停时下划线动画 */
.toolbar-guide-link:hover::after {
    width: 90%;
    background-color: #d6fe51; /* 悬停时下划线变为绿色 */
}

/* 工具栏分隔符样式
 * ------------------------------------------------
 * 用于星级评分和Guide菜单之间的分隔符
 */
.toolbar-separator {
    height: 20px;
    margin-right: 3px; /* 增加右侧间距 */
    margin-left: 3px; /* 增加左侧间距 */
    border-right: 1px solid rgb(63, 65, 92);
} 

.toolbar-separator-left-more {
    height: 20px;
    margin-right: 3px; /* 增加右侧间距 */
    margin-left: 6px; /* 增加左侧间距 */
    border-right: 1px solid rgb(63, 65, 92);
} 

/* 搜索框容器
 * ------------------------------------------------
 * 定义搜索框的样式，位于游戏手柄图标左侧
 */
.nav-search {
    display: flex;
    align-items: center;
    margin-left: auto; /* 推送到右侧 */
    margin-right: 1rem; /* 与游戏手柄图标的间距 */
    position: relative;
}

.nav-search-input {
    background-color: #1a1a1a;
    border: 1px solid #4a4a4a;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    padding-left: 2.5rem; /* 为搜索图标留出空间 */
    color: #f5f5f7;
    font-size: 0.9rem;
    font-family: 'Nunito', sans-serif;
    width: 400px;
    height: 36px; /* 添加明确的高度 */
    transition: all 0.3s ease;
    outline: none;
}

.nav-search-input::placeholder {
    color: #B0B0B0;
    opacity: 0.7;
}

.nav-search-input:hover {
    border-color: #d6fe51;
}

.nav-search-input:focus {
    background-color: #1a1a1a;
    border-color: #d6fe51;
    box-shadow: 0 0 0 2px rgba(214, 254, 81, 0.2);
    width: 400px; /* 固定宽度，不增加 */
}

.nav-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #B0B0B0;
    font-size: 0.9rem;
    pointer-events: none;
    transition: color 0.3s ease;
}

.nav-search-input:focus + .nav-search-icon {
    color: #d6fe51;
}

/* 游戏手柄图标容器
 * ------------------------------------------------
 * 定义右侧游戏手柄图标的样式
 */
.nav-gamepad {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #f5f5f7;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-left: 1rem; /* 移除auto，因为现在由nav-search控制位置 */
}

.nav-gamepad:hover {
    color: #d6fe51; /* 悬停时变为绿色 */
    transform: scale(1.05); /* 轻微放大效果 */
}

.nav-gamepad svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* 响应式搜索框样式 */
@media (max-width: 1024px) {
    .nav-search-input {
        width: 160px;
    }
    
    .nav-search-input:focus {
        width: 160px; /* 固定宽度，不增加 */
    }
}

@media (max-width: 768px) {
    .nav-search {
        display: none; /* 在移动端隐藏搜索框 */
    }
    
    .nav-gamepad {
        margin-left: auto; /* 在移动端恢复游戏手柄的auto margin */
    }

    .nav-menu {
        margin-right: 0 !important;
        /* 如需移动端隐藏Random Game菜单可加 display: none; */
    }
}

@media (max-width: 1024px) {
  .nav-menu,
  .nav-gamepad {
    display: none !important;
  }
}

/* Left Sidebar Menu - 极简收缩样式 */
#sidebar-menu {
    position: fixed;
    top: calc(40px + 1.5rem);
    left: 0;
    width: 56px;
    min-width: 56px;
    max-width: 56px;
    height: calc(100vh - (40px + 1.5rem));
    padding: 16px 0;
    background: #1a1a1a !important;
    transition: width 0.2s cubic-bezier(.4,0,.2,1), transform 0.3s cubic-bezier(.4,0,.2,1);
    overflow-x: hidden;
    overflow-y: auto;
    border-right: none;
    z-index: 1100;
    transform: translateX(-100%);
}

#sidebar-menu::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, rgba(63, 65, 92, 0.8) 0%, rgba(63, 65, 92, 0.4) 50%, rgba(63, 65, 92, 0.8) 100%);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    border-radius: 1px;
    z-index: 10;
}

#sidebar-menu.open {
    transform: translateX(0);
    width: 68px;
    min-width: 68px;
    max-width: 68px;
}

#sidebar-menu.open:hover {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
}

#sidebar-menu:hover:not(.open) {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
}

.sidebar-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-menu-item {
    position: relative;
    display: flex;
    align-items: center;
    height: 38px;
    cursor: pointer;
    color: #B0B0B0;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    padding: 0 8px;
    transition: background 0.15s, color 0.2s;
    margin-bottom: 0;
}

.sidebar-menu-item:last-child {
    margin-bottom: 0;
}

.sidebar-menu-item i {
    font-size: 18px;
    color: #f5f5f7;
    width: 48px;
    min-width: 48px;
    text-align: center;
    transition: color 0.2s;
    flex-shrink: 0;
    z-index: 1;
}

.sidebar-menu-label {
    position: absolute;
    left: 56px;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    opacity: 0;
    max-width: 0;
    margin-left: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.2s, max-width 0.2s, margin-left 0.2s, color 0.2s, transform 0.15s;
    color: #B0B0B0;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    pointer-events: none;
    background: none;
    z-index: 2;
    padding-left: 8px;
    border-radius: 6px;
}

#sidebar-menu:hover .sidebar-menu-label {
    opacity: 1;
    max-width: 120px;
    margin-left: 0;
    pointer-events: auto;
}

.sidebar-menu-item:hover .sidebar-menu-label {
    color: #f5f5f7;
    background: none;
    transform: translateX(10px) scale(0.96);
}

.sidebar-menu-item:hover i {
    color: #d6fe51;
}

.sidebar-menu-item.active i {
    color: #d6fe51;
}

.sidebar-menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 4px;
    border-radius: 2px;
    background: #d6fe51;
}

.sidebar-menu-item.active .sidebar-menu-label {
    color: #d6fe51;
}

/* Left Sidebar Menu */
#sidebar-toggle-btn {
    margin-right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1101;
    min-width: 40px;
    min-height: 40px;
}
#sidebar-toggle-btn:focus {
    outline: none !important;
    box-shadow: none !important;
}
#sidebar-toggle-btn:hover {
    background: none;
}
#sidebar-toggle-btn svg {
    width: 24px;
    height: 24px;
    fill: #f5f5f7;
    transition: fill 0.2s;
}
#sidebar-toggle-btn:hover svg {
    fill: #d6fe51;
}

/* Sidebar Overlay */
#sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.3);
    z-index: 1099;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(.4,0,.2,1);
}
#sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* 侧边栏分隔线，参考footer-middle-separator */
.sidebar-middle-separator {
    height: 1px;
    margin: 0.25rem 20px;
    width: auto;
    background: linear-gradient(90deg, rgba(63, 65, 92, 0.8) 0%, rgba(63, 65, 92, 0.4) 50%, rgba(63, 65, 92, 0.8) 100%);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    border-radius: 1px;
    border: none;
} 

/* 主内容区、footer、分类页等统一用 transform 推动 */
.sidebar-pushed {
  transform: translateX(68px);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}
@media (max-width: 768px) {
  .sidebar-pushed {
    transform: none !important;
  }
}

/* Left Sidebar Menu - 极简收缩样式 */
@media (max-width: 1024px) {
  #sidebar-toggle-btn {
    display: none !important;
  }
}

/* 响应式：移动端和平板导航条左右内边距为1rem，PC端为1.5rem */
/* Responsive: Navbar horizontal padding 1rem on mobile/tablet, 1.5rem on PC */

/* ================================================
 * 移动端融合搜索和按钮侧边菜单栏样式 - START
 * ================================================ */

/* PC端隐藏移动端按钮容器 */
.mobile-search-menu-container {
  display: none;
}

/* PC端隐藏移动端侧边栏 */
#mobile-sidebar {
  display: none !important;
}

@media (max-width: 1024px) {
  /* 移动端导航条内边距调整 */
  .site-header {
    padding: 0.75rem 1rem; /* 左右内边距1rem，比PC端的1.5rem小 */
  }
  
  /* 移动端显示按钮容器 */
  .mobile-search-menu-container {
    display: block;
  }
  
  /* ================================================
   * 移动端融合按钮样式
   * ================================================
   * 设计理念：与PC端Random Game菜单按钮保持一致
   * 视觉效果：默认灰色边框，悬停时绿色边框
   * 交互反馈：SVG图标颜色变化 + 边框动画
   * ================================================ */
  .mobile-search-menu-btn {
    background: none; /* 透明背景 */
    border: none; /* 默认无边框 */
    padding: 0.25rem 0.50rem; /* 与Random Game按钮一致的内边距 */
    cursor: pointer; /* 手型指针 */
    display: flex; /* 弹性布局 */
    align-items: center; /* 垂直居中 */
    border-radius: 0.4rem; /* 圆角边框 */
    transition: all 0.2s ease; /* 平滑过渡动画 */
    outline: none !important; /* 移除焦点轮廓 */
    color: #B0B0B0; /* 默认文字颜色（对SVG无效，仅备用） */
  }
  
  /* SVG图像默认颜色 - 灰色 */
  .mobile-search-menu-btn img {
    filter: brightness(0) saturate(100%) invert(70%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%); /* 转换为灰色 */
    transition: filter 0.2s ease; /* 颜色过渡动画 */
  }
  
  /* 悬停效果：绿色边框 + 白色文字 */
  .mobile-search-menu-btn:hover {
    background-color: transparent; /* 保持透明背景 */
    border: 1px solid #d6fe51; /* 绿色边框 */
    color: #f5f5f7; /* 白色文字 */
  }
  
  /* SVG图像悬停时变白色 */
  .mobile-search-menu-btn:hover img {
    filter: brightness(0) saturate(100%) invert(96%) sepia(7%) saturate(157%) hue-rotate(183deg) brightness(107%) contrast(96%); /* 转换为白色 */
  }
  
  /* 焦点状态：移除默认焦点样式 */
  .mobile-search-menu-btn:focus {
    outline: none !important;
    box-shadow: none !important;
  }

  /* ================================================
   * 移动端侧边栏样式
   * ================================================
   * 布局：固定定位，左侧滑出
   * 背景：半透明深色 + 模糊效果
   * 动画：transform滑入/滑出
   * 层级：z-index 1000，确保在其他元素之上
   * ================================================ */
  #mobile-sidebar {
    display: none; /* 默认隐藏 */
    position: fixed; /* 固定定位 */
    left: 0; /* 左侧对齐 */
    top: 0; /* 顶部对齐 */
    width: 280px; /* 固定宽度 */
    height: 100%; /* 全屏高度 */
    background: rgba(26, 26, 26, 0.9); /* 半透明深色背景 */
    backdrop-filter: blur(8px); /* 背景模糊效果 */
    z-index: 1000; /* 层级控制 */
    box-shadow: 2px 0 8px rgba(0,0,0,0.2); /* 右侧阴影 */
    flex-direction: column; /* 垂直布局 */
    transform: translateX(-100%); /* 初始位置：完全隐藏 */
    transition: transform 0.3s; /* 滑入/滑出动画 */
  }
  
  /* 激活状态：显示并滑入 */
  #mobile-sidebar.active {
    display: flex !important; /* 强制显示 */
    transform: translateX(0); /* 滑入到可见位置 */
  }

  /* ================================================
   * 侧边栏头部样式
   * ================================================
   * 布局：水平弹性布局，包含关闭按钮和搜索框
   * 定位：sticky定位，始终在顶部
   * 背景：比侧边栏更深的背景色
   * ================================================ */
  .mobile-sidebar-header {
    padding: 0.125rem 1rem; /* 上下0.125rem，左右1rem */
    display: flex; /* 水平弹性布局 */
    align-items: center; /* 垂直居中 */
    gap: 0.75rem; /* 元素间距 */
    position: sticky; /* 粘性定位 */
    top: 0; /* 顶部对齐 */
    background: rgba(26, 26, 26, 0.95); /* 更深的背景色 */
    backdrop-filter: blur(8px); /* 背景模糊 */
    z-index: 10; /* 在侧边栏内容之上 */
  }
  
  /* ================================================
   * 关闭按钮样式
   * ================================================
   * 位置：搜索框左侧
   * 图标：左箭头（fas fa-arrow-left）
   * 交互：悬停时变绿色
   * ================================================ */
  .mobile-sidebar-close-btn {
    background: none; /* 透明背景 */
    border: none; /* 无边框 */
    color: #f5f5f7; /* 白色图标 */
    font-size: 1.5rem; /* 图标大小 */
    cursor: pointer; /* 手型指针 */
    padding: 0.5rem; /* 内边距 */
    border-radius: 4px; /* 圆角 */
    transition: all 0.2s; /* 过渡动画 */
    outline: none !important; /* 移除焦点轮廓 */
    flex-shrink: 0; /* 防止收缩 */
  }
  
  /* 关闭按钮悬停效果 */
  .mobile-sidebar-close-btn:hover {
    color: #d6fe51; /* 绿色图标 */
    background: none; /* 保持透明背景 */
  }
  
  /* ================================================
   * 移动端搜索框容器
   * ================================================
   * 功能：完全复用PC端导航条搜索框样式
   * 布局：相对定位，弹性增长
   * ================================================ */
  .mobile-sidebar-search-container {
    position: relative; /* 相对定位，为搜索图标定位 */
    flex: 1; /* 弹性增长，占据剩余空间 */
  }
  
  /* ================================================
   * 移动端搜索框样式
   * ================================================
   * 设计理念：与PC端导航条搜索框完全一致
   * 样式复用：使用相同的.nav-search-input类名
   * 尺寸调整：高度从36px调整为30px，适应移动端
   * ================================================ */
  #mobile-sidebar .nav-search-input {
    background-color: #2d2d2d; /* 深色背景 */
    border: 1px solid #4a4a4a; /* 灰色边框 */
    border-radius: 20px; /* 圆角边框 */
    padding: 0.5rem 1rem; /* 内边距 */
    padding-left: 2.5rem; /* 左侧内边距，为搜索图标留空间 */
    color: #f5f5f7; /* 白色文字 */
    font-size: 0.9rem; /* 字体大小 */
    font-family: 'Nunito', sans-serif; /* 字体族 */
    width: 100%; /* 全宽度 */
    height: 32px; /* 移动端专用高度，比PC端的36px小 */
    transition: all 0.3s ease; /* 过渡动画 */
    outline: none; /* 移除焦点轮廓 */
  }
  
  /* 搜索框占位符样式 */
  #mobile-sidebar .nav-search-input::placeholder {
    color: #B0B0B0; /* 灰色占位符 */
    opacity: 0.7; /* 透明度 */
  }
  
  /* 搜索框悬停效果 */
  #mobile-sidebar .nav-search-input:hover {
    border-color: #d6fe51; /* 绿色边框 */
  }
  
  /* 搜索框焦点效果 */
  #mobile-sidebar .nav-search-input:focus {
    background-color: #1a1a1a; /* 更深的背景色 */
    border-color: #d6fe51; /* 绿色边框 */
    box-shadow: 0 0 0 2px rgba(214, 254, 81, 0.2); /* 绿色光晕 */
  }
  
  /* ================================================
   * 移动端搜索图标样式
   * ================================================
   * 位置：搜索框内部左侧
   * 交互：焦点时变绿色
   * ================================================ */
  #mobile-sidebar .nav-search-icon {
    position: absolute; /* 绝对定位 */
    left: 0.75rem; /* 左侧位置 */
    top: 50%; /* 垂直居中 */
    transform: translateY(-50%); /* 精确居中 */
    color: #B0B0B0; /* 默认灰色 */
    font-size: 0.9rem; /* 图标大小 */
    pointer-events: none; /* 不响应鼠标事件 */
    transition: color 0.3s ease; /* 颜色过渡 */
  }
  
  /* 搜索框焦点时图标变绿色 */
  #mobile-sidebar .nav-search-input:focus + .nav-search-icon {
    color: #d6fe51; /* 绿色图标 */
  }

  /* ================================================
   * 移动端菜单列表样式
   * ================================================
   * 设计理念：直接复用PC端侧边栏样式类
   * 布局调整：垂直布局，可滚动
   * 样式覆盖：针对移动端特殊需求进行调整
   * ================================================ */
  #mobile-sidebar .sidebar-menu-list {
    list-style: none; /* 移除列表样式 */
    margin: 0; /* 移除外边距 */
    padding: 0.25rem 0 1rem 0; /* 上下内边距 */
    display: flex; /* 弹性布局 */
    flex-direction: column; /* 垂直方向 */
    overflow-y: auto; /* 垂直滚动 */
    flex: 1; /* 占据剩余空间 */
  }
  
  /* ================================================
   * 移动端菜单项样式覆盖
   * ================================================
   * 目标：让标签始终显示，而不是悬停时才显示
   * 方法：覆盖PC端的absolute定位和opacity设置
   * 布局：左侧8px为active状态绿色条留空间，右侧1.5rem
   * ================================================ */
  #mobile-sidebar .sidebar-menu-item {
    padding: 0 1.5rem 0 8px; /* 左侧保持8px，为active状态的绿色条留空间；右侧1.5rem */
    position: relative; /* 确保::before伪元素能正确定位 */
  }
  
  /* 移动端菜单标签样式覆盖 */
  #mobile-sidebar .sidebar-menu-label {
    position: static; /* 覆盖absolute定位，改为静态定位 */
    opacity: 1; /* 始终显示，覆盖PC端的opacity: 0 */
    max-width: none; /* 移除宽度限制 */
    margin-left: 8px; /* 与图标的间距 */
    pointer-events: auto; /* 可交互，覆盖PC端的pointer-events: none */
    background: none; /* 无背景 */
    padding-left: 0; /* 移除左侧内边距 */
    /* 保留PC端的transform效果，让后退动画正常工作 */
  }
  
  /* ================================================
   * 移动端菜单项悬停效果
   * ================================================
   * 设计理念：与PC端完全一致
   * 效果：标签变白色 + 图标变绿色 + 后退动画
   * ================================================ */
  #mobile-sidebar .sidebar-menu-item:hover .sidebar-menu-label {
    color: #f5f5f7; /* 白色文字 */
    background: none; /* 无背景 */
    transform: translateX(10px) scale(0.96); /* 后退效果：右移10px并缩小到96% */
  }
  
  /* 移动端菜单项图标悬停效果 */
  #mobile-sidebar .sidebar-menu-item:hover i {
    color: #d6fe51; /* 绿色图标 */
  }
  

}

/* ================================================
 * 移动端融合搜索和按钮侧边菜单栏样式 - END
 * ================================================ */

