/* 网页容器 - 宽高填充满 */
.page-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex-shrink: 0;
  background: #F2F3F5;
  width: 100%;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* 背景图揭示层 - 覆盖整个窗口，在最底层 */
.bg-reveal-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* 导航容器 */
.nav-container {
  display: flex;
  padding: 24px 80px;
  justify-content: space-between;
  align-items: flex-start;
  align-self: stretch;
  position: relative;
  z-index: 1;
}

/* Logo容器 */
.logo-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Logo文本 */
.logo-text {
  color: var(---text-5, #1D2129);
  font-family: 'MiSans', sans-serif;
  font-size: 24px;
  font-style: normal;

  line-height: 100%;
}

/* 菜单容器 */
.menu-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 64px;
}

/* 菜单文本 - 默认样式 */
.menu-item {
  color: var(---text-5, #1D2129);
  font-family: 'MiSans', sans-serif;
  font-size: 20px;
  font-style: normal;

  line-height: 100%;
  opacity: 0.3;
  cursor: pointer;
  transition: all 0.3s ease;
  background: none;
  border: none;
  padding: 0;
  outline: none;
}

/* 菜单文本 - 选中样式 */
.menu-item.active {

  opacity: 1;
}

.menu-item:hover {
  opacity: 0.6;
}

/* 内容容器 */
.content-container {
  display: flex;
  padding: 0 80px;
  align-items: flex-start;
  gap: 24px;
  flex: 1 0 0;
  align-self: stretch;
  position: relative;
  z-index: 1;
  /* 允许收缩（flex 默认 min-height:auto 会被内容撑高）：配合各标签页内滚动，超高内容不撑破页面 */
  min-height: 0;
}

/* 背景图片层 - bg-v2.png填充 */
.bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../assets/bg-v2.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* 遮罩画布层 - 与页面背景色一致，光标划过时擦除 */
.bg-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* 内容标签页 */
.content-tab {
  display: none;
  flex: 1;
}

/* 内容标签页 - 激活状态 */
.content-tab.active {
  display: flex;
  gap: 24px;
}

/* 游戏入口卡片 */
.game-entry {
  flex: 1;
  border-radius: 12px;
  padding: 48px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.game-entry:hover {
  background: rgba(29, 33, 41, 0.04);
}

/* 图标容器：统一固定 64px 尺寸（锁死显示大小，不再受图片原始大小/字体行高影响），图片与字符均居中 */
/* margin: 0 auto 让 64px 宽的块级容器在卡片内水平居中（text-align:center 对块级元素无效） */
.game-entry .game-icon,
.coming-soon .coming-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

/* 图标为图片：锁死 64px 显示区域，原图按比例等比例缩放（不裁剪、不拉伸变形） */
.game-entry .game-icon img,
.coming-soon .coming-icon img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

/* 文件缺失的小玩意卡片：半透明提示，点击仍可触发错误提示 */
.game-entry.widget-missing {
  opacity: 0.55;
}

.game-entry h3 {
  color: var(---text-5, #1D2129);
  font-family: 'MiSans', sans-serif;
  font-size: 28px;
  font-style: normal;

  line-height: 100%;
  margin-bottom: 8px;
}

.game-entry p {
  color: var(---text-5, #1D2129);
  font-family: 'MiSans', sans-serif;
  font-size: 16px;
  font-style: normal;

  line-height: 100%;
  opacity: 0.5;
  margin-bottom: 24px;
}

.game-entry .entry-tag {
  display: inline-block;
  padding: 8px 24px;
  border: 1px solid var(---text-5, #1D2129);
  color: var(---text-5, #1D2129);
  font-family: 'MiSans', sans-serif;
  font-size: 16px;
  font-style: normal;

  line-height: 100%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.game-entry .entry-tag:hover {
  background: var(---text-5, #1D2129);
  border-color: transparent; /* 保持边框占位，避免盒模型变化导致抖动 */
  color: #FFFFFF;
}

/* 敬请期待卡片 */
.coming-soon {
  flex: 1;
  border-radius: 12px;
  padding: 48px;
  text-align: center;
}

/* 敬请期待图标：使用图片（/assets/coming-soon.png），尺寸/居中由上方统一图标容器规则控制，无需额外样式 */

.coming-soon h3 {
  color: var(---text-5, #1D2129);
  font-family: 'MiSans', sans-serif;
  font-size: 28px;
  font-style: normal;

  line-height: 100%;
  margin-bottom: 8px;
}

.coming-soon p {
  color: var(---text-5, #1D2129);
  font-family: 'MiSans', sans-serif;
  font-size: 16px;
  font-style: normal;

  line-height: 100%;
  opacity: 0.5;
  margin-bottom: 24px;
}

.coming-soon .coming-tag {
  display: inline-block;
  padding: 8px 24px;
  border: 1px solid var(---text-5, #1D2129);
  color: var(---text-5, #1D2129);
  font-family: 'MiSans', sans-serif;
  font-size: 16px;
  font-style: normal;

  line-height: 100%;
  opacity: 0.5;
}

/* 浏览器占位内容 */
.content-tab.browser-tab.active {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

.browser-placeholder {
  text-align: center;
}

.browser-placeholder .browser-icon {
  font-size: 80px;
  margin-bottom: 24px;
  opacity: 0.3;
}

.browser-placeholder h3 {
  color: var(---text-5, #1D2129);
  font-family: 'MiSans', sans-serif;
  font-size: 32px;
  font-style: normal;

  line-height: 100%;
  margin-bottom: 12px;
}

.browser-placeholder p {
  color: var(---text-5, #1D2129);
  font-family: 'MiSans', sans-serif;
  font-size: 18px;
  font-style: normal;

  line-height: 100%;
  opacity: 0.5;
}

/* ========== 小玩意网格（每行数量由后台配置，通过 CSS 变量注入） ========== */
.game-tab.active {
  display: grid;
  grid-template-columns: repeat(var(--widget-per-row, 3), 1fr);
  gap: 24px;
  align-content: start;
}

/* ========== 导航页：左侧分类 + 右侧网站卡片 ========== */
/* 整体保持左右两栏布局，间距收紧 */
.nav-tab.active {
  display: flex;
  gap: 24px;
  /* 覆盖 content-container 的 flex-start：导航页填满剩余高度，
     内容超高时不撑破页面（page-container 是 overflow:hidden），滚动交给右侧详情区 */
  align-self: stretch;
  min-height: 0;
  overflow: hidden;
}

/* 左侧分类导航栏 */
.nav-sidebar {
  width: 160px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* 左侧顶部全局搜索框 */
.nav-search {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  margin-bottom: 8px;
  border: 1px solid rgba(29, 33, 41, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  font-family: 'MiSans', sans-serif;
  font-size: 14px;
  color: #1D2129;
  outline: none;
  transition: border-color 0.3s ease;
}

.nav-search:focus {
  border-color: rgba(29, 33, 41, 0.4);
}

.nav-search::placeholder {
  color: rgba(29, 33, 41, 0.3);
}

/* 分类按钮 */
.nav-cat {
  padding: 8px 14px;
  border: none;
  background: none;
  text-align: left;
  font-family: 'MiSans', sans-serif;
  font-size: 16px;
  color: var(---text-5, #1D2129);
  opacity: 0.4;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.nav-cat:hover {
  opacity: 0.7;
  background: rgba(29, 33, 41, 0.05);
}

/* 选中分类 */
.nav-cat.active {
  opacity: 1;
  background: rgba(29, 33, 41, 0.08);
  font-weight: 500;
}

/* 右侧详情区 */
.nav-detail {
  flex: 1;
  min-width: 0;
  /* 允许收缩，内容超高（"全部"/搜索结果）时在详情区内滚动，不再截断看不到底部 */
  min-height: 0;
  overflow-y: auto;
  /* Firefox 细滚动条：滑块浅灰、轨道透明，与站点浅色风格一致 */
  scrollbar-width: thin;
  scrollbar-color: rgba(29, 33, 41, 0.15) transparent;
}

/* 右侧详情区滚动条美化（WebKit/Chromium：细条、圆角、浅灰滑块，悬停加深） */
.nav-detail::-webkit-scrollbar {
  width: 6px;
}

.nav-detail::-webkit-scrollbar-track {
  background: transparent;
}

.nav-detail::-webkit-scrollbar-thumb {
  background: rgba(29, 33, 41, 0.15);
  border-radius: 3px;
}

.nav-detail::-webkit-scrollbar-thumb:hover {
  background: rgba(29, 33, 41, 0.3);
}

/* 导航卡片网格：最小宽度自适应（auto-fill + minmax） */
/* 用 auto-fill（而非 auto-fit）：不满一行的卡片保持按整行可容纳的最大列数均分宽度，
   剩余列留空占位，不会被拉伸填满（如一行最多 5 个、实际 3 个时，3 张卡仍占 3/5 宽） */
.nav-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

/* 网站卡片 */
.nav-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.nav-card:hover {
  background: rgba(29, 33, 41, 0.04);
}

/* 站点图标：32*32 */
.nav-card-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 8px;
  object-fit: contain;
}

/* 卡片文字 */
.nav-card-body {
  min-width: 0;
}

/* 标题：14px，与标签行间距 8px */
.nav-card-title {
  color: #1D2129;
  font-family: 'MiSans', sans-serif;
  font-size: 14px;
  line-height: 100%;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 标题下的标签行：需要VPN（手动勾选）+ 热度（访问量缩写），与简介间距 8px */
.nav-card-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  min-height: 16px;
}

/* 标签基础样式 */
.nav-card-tag {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

/* 需要VPN标签：深色黑色（与标题颜色一致） */
.nav-card-tag-vpn {
  color: #1D2129;
  background: rgba(29, 33, 41, 0.08);
}

/* 热度标签：橙色系 */
.nav-card-tag-hot {
  color: #FF7D00;
  background: rgba(255, 125, 0, 0.12);
}

/* 简介：12px 灰色，固定占两行空间（所有卡片等高对齐），最多显示两行，超出在第2行末尾省略 */
.nav-card-intro {
  color: #4E5969;
  font-family: 'MiSans', sans-serif;
  font-size: 12px;
  line-height: 18px;
  height: 36px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-all;
}

/* "全部"/搜索视图：按分类分组展示（每组含分类标题 + 卡片网格） */
.nav-cat-section {
  margin-bottom: 24px;
}

.nav-cat-section:last-child {
  margin-bottom: 0;
}

.nav-cat-title {
  color: #1D2129;
  font-family: 'MiSans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  opacity: 0.5;
  margin-bottom: 10px;
}

/* 导航空状态提示 */
.nav-empty {
  color: var(---text-5, #1D2129);
  font-family: 'MiSans', sans-serif;
  font-size: 16px;
  opacity: 0.4;
  padding: 48px 0;
  text-align: center;
}