/* 导航修复覆盖样式（仅修复布局与断行，不改变主题配色与动效） */

/* 1) LOGO 区域防止竖排折行 */
.logo-section,
.game-logo,
.logo-text,
.logo-text h1,
.logo-text span {
  white-space: nowrap !important;
  word-break: keep-all !important;
  writing-mode: horizontal-tb !important;
}
.logo-section {
  flex: 0 0 auto !important;
  min-width: 220px !important; /* 给LOGO留出足够宽度，避免标题竖排 */
}

/* 保证外层容器不换行 */
.nav-wrapper {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
}

/* 2) 导航容器保持单行，避免中文拆字 */
.navigation .nav-links {
  display: flex !important;
  flex-wrap: nowrap !important;          /* 不换行 */
  align-items: center !important;
  gap: 24px;
  white-space: nowrap !important;
  word-break: keep-all !important;
  letter-spacing: normal !important;
}

/* 3) 每个菜单项使用 inline-flex，图标+文字横向对齐，不被压缩 */
.navigation .nav-links li {
  display: inline-flex !important;
  align-items: center !important;
  flex: 0 0 auto !important;             /* 不压缩不换行 */
  white-space: nowrap !important;
  word-break: keep-all !important;
}

/* 4) 链接不拆字，图标与文字同排；裁切伪元素溢出；禁用大写 */
.nav-link,
.navigation .nav-links a {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;                   /* 图标与文字间距 */
  white-space: nowrap !important;
  word-break: keep-all !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  text-transform: none !important;       /* 防止大写影响间距 */
  line-height: 1.2 !important;
  overflow: hidden !important;           /* 避免 ::before 外溢遮挡相邻项 */
  position: relative !important;
  letter-spacing: normal !important;
  flex-direction: row !important;
}

/* 5) 收敛胶囊背景伪元素边界，禁止超出当前链接 */
.nav-link::before,
.navigation .nav-links a::before {
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 25px !important;
  z-index: -1 !important;
}

/* 6) 下载按钮不遮挡邻近元素 */
.download-btn {
  position: relative !important;
  z-index: 0 !important;
}

/* 7) 桌面端在较窄宽度(>768且<=1100)时缩小间距，保持一行 */
@media (max-width: 1100px) and (min-width: 769px) {
  .navigation .nav-links { gap: 16px !important; }
  .nav-link,
  .navigation .nav-links a { padding: 8px 14px !important; }
}

/* 8) 移动端抽屉菜单定位与层级修复，确保覆盖内容且可滚动 */
@media (max-width: 768px) {
  .hamburger { display: flex !important; }

  .navigation .nav-links {
    position: fixed !important;
    top: 80px !important;                   /* 与 header 高度一致 */
    left: -100% !important;
    width: 100% !important;
    height: calc(100vh - 80px) !important;  /* 占满可视高度 */
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    padding: 40px 20px 60px !important;
    gap: 20px !important;
    transition: left 0.3s cubic-bezier(0.68,-0.55,0.265,1.55) !important;
    z-index: 1100 !important;               /* 高于 header 内其他元素 */
    overflow-y: auto !important;            /* 菜单滚动 */
    -webkit-overflow-scrolling: touch !important;
  }

  .navigation .nav-links.active { left: 0 !important; }

  .nav-link,
  .navigation .nav-links a {
    width: auto !important;
    max-width: 90vw !important;
    justify-content: center !important;
    font-size: 1.05rem !important;
    padding: 10px 18px !important;
  }

  .download-btn { margin-top: 10px !important; }
}

/* 9) 防止任何全局写法影响导航文本布局（兜底） */
.header .navigation,
.header .navigation * {
  word-break: keep-all !important;
  white-space: nowrap !important;
  writing-mode: horizontal-tb !important;
  letter-spacing: normal !important;
}

/* 10) 进一步收敛 hover 放大，避免胶囊压到相邻项（桌面） */
@media (min-width: 769px) {
  .nav-link:hover,
  .nav-link.active {
    transform: translateY(-2px) scale(1.01) !important;
  }
}