/**
 * 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
 */

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

@media (min-width: 640px) {
    .header-wrapper {
        margin: 0 1.5rem;
    }
}

@media (min-width: 1024px) {
    .header-wrapper {
        margin: 0 2rem;
    }
}

/* 导航栏主容器样式
 * ------------------------------------------------
 * 创建一个半透明的导航栏，带有背景模糊效果
 * 应用圆角和阴影增强视觉层次感
 * 固定在原来的位置
 */
.site-header {
    background-color: rgba(31, 41, 55, 0.5); /* 降低不透明度到50% */
    backdrop-filter: blur(8px); /* 保持模糊效果 */
    margin: 0.75rem 1rem 0 1rem; /* 上右下左，将底部间距设为0，通过外部容器控制 */
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem; /* 添加圆角，与how-to-play区域一致 */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 响应式边距，与其他区域保持一致 */
@media (min-width: 640px) {
    .site-header {
        margin-left: 1.5rem;
        margin-right: 1.5rem;
        margin-bottom: 0; /* 确保底部边距在各种屏幕尺寸下保持一致为0 */
    }
}

@media (min-width: 1024px) {
    .site-header {
        margin-left: 2rem;
        margin-right: 2rem;
        margin-bottom: 0; /* 确保底部边距在各种屏幕尺寸下保持一致为0 */
    }
}

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

/* Logo链接容器
 * ------------------------------------------------
 * 定义Logo区域的布局，包含SVG图标和文字
 */
.nav-logo {
    display: flex;
    align-items: center;
    color: #f5f5f7;
    text-decoration: none;
    margin-right: 6.5rem; /* 再次增加logo与菜单之间的间距 */
}

/* 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;
  
  /* 移除原有的渐变背景和文字裁剪效果 */
  display: inline-flex;
  gap: 0.4rem; /* 为三个单词之间添加适当间距 */
}

/* 站点名称分色样式 - 全局使用
 * ------------------------------------------------
 * 这些样式类用于导航栏和页脚中的站点名称多色显示
 */

/* 站点名称中"Best"的样式 */
.site-name-best {
  color: #f5f5f7; /* 白色 */
  font-family: 'Russo One', sans-serif;
  font-size: inherit;
  letter-spacing: inherit;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* 站点名称中"Game"的样式 */
.site-name-game {
  color: #f5f5f7; /* 白色 */
  font-family: 'Russo One', sans-serif;
  font-size: inherit;
  letter-spacing: inherit;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* 站点名称中"Playground"的样式 */
.site-name-playground {
  color: #f7ce55; /* 黄色 */
  font-family: 'Russo One', sans-serif;
  font-size: inherit;
  letter-spacing: inherit;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* 导航菜单
 * ------------------------------------------------
 * 定义导航菜单的整体布局
 */
.nav-menu {
    display: flex;
    align-items: center;
}

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

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

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

/* 导航链接
 * ------------------------------------------------
 * 定义导航链接的样式
 */
.nav-link,
.nav-link.home-link,
.nav-link.random-game-link,
.nav-link.category-link,
.nav-link.guide-link {
    padding: 0.5rem 1rem; /* 缩小左右内边距，让菜单更紧凑 */
    min-width: unset; /* 取消最小宽度限制 */
}

/* Home链接特殊样式
 * ------------------------------------------------
 * 定义Home菜单按钮的特殊样式，包括线框边框
 */
.nav-link.home-link {
    color: #a0aec0; /* 默认时使用与正文一致的颜色 */
    border: none; /* 默认时无边框 */
    border-radius: 0.4rem;
    padding: 0.25rem 0.50rem; /* 与random-game-link保持一致的内边距 */
    font-family: 'Nunito', sans-serif; /* 使用Nunito字体 */
    font-weight: 700;
    font-size: 1.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: 0.5rem;
}

/* 创建动画效果 */
@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: #a0aec0;
    border: none;
    border-radius: 0.4rem;
    padding: 0.25rem 0.50rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1.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: #a0aec0; /* 默认时使用与正文一致的颜色 */
    border: none; /* 默认时无边框 */
    border-radius: 0.4rem;
    padding: 0.25rem 0.50rem; /* 与home-link保持一致的内边距 */
    font-family: 'Nunito', sans-serif; /* 使用Nunito字体 */
    font-weight: 700;
    font-size: 1.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: 0.95rem; /* 与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);
} 