/* style.css 全局基础样式修改 */

:root {
  /* ... 保持原有的 css 变量不变 ... */
  --bg-dark: #0a0a0f;
  --bg-card: #1c1c24;
  --bg-detail-card: #2a2a35;
  --text-main: #ffffff;
  --text-muted: #888899;
  --primary-gradient: linear-gradient(90deg, #ff9a00, #ffcc00);
  --accent-pink: #ff4785;
  --accent-purple: #8a2be2;
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 20px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 1. 给 PC 端外层加上深色背景（也可以替换成游戏相关的平铺底图） */
html {
  background-color: #e0e0e3;
  /* 比 H5 背景更深一点的颜色，或自定义外色背景  #e0e0e3 #050508 */
}

/* 2. 限制 body 宽度并居中 */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-main);
  line-height: 1.5;
  padding-bottom: 80px;

  /* PC端适配核心逻辑 */
  max-width: 540px;
  /* 设定 H5 容器的最大宽度，一般 480px 或 540px 比较合适 */
  margin: 0 auto;
  /* 水平居中 */
  min-height: 100vh;
  /* 保证哪怕内容很少，背景也能撑满一屏高度 */
  background-color: var(--bg-dark);
  /* H5 区域的真实背景色 */
  position: relative;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
  /* 给边缘加点阴影，让 H5 区域更有立体感，不至于和外层背景死板贴合 */
  overflow-x: hidden;
  /* 防止内部横向滚动条撑破容器 */
  display: flex;
  flex-direction: column;
  /* 让 body 里的 header, main, footer 垂直排列 */
}

/* 核心：让 main 占据所有剩余空间 */
main {
  flex: 1;
  margin-bottom: 60px;
}

/* 头部导航 */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background-color: rgba(59, 59, 62, 0.9);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header .logo {
  font-size: 20px;
  font-weight: 900;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header .icon {
  width: 24px;
  height: 24px;
}

/* 通用区块设置 */
.section {
  margin: 20px 15px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-title {
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title.clickable {
  cursor: pointer;
}

.section-title img{
  width:20px;
  height:20px;
}

.view-more {
  font-size: 12px;
  color: #000000;
  background: linear-gradient(90deg, #FCF1B2 0%, #F8E2C8 12%, #F4C5C1 22%, #EEC2EA 40%, #C0C8F9 58%, #C9F2FC 75%, #CDFBD1 84%, #E7FCC5 100%);
  padding: 4px 10px;
  border-radius: 12px;
  text-decoration: none;
}

/* 布局网格 */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px 15px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.scroll-x {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  padding-bottom: 5px;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  /* 优化移动端惯性滚动 */
  scrollbar-width: none;
  /* 隐藏滚动条 Firefox */
}

.scroll-x::-webkit-scrollbar {
  display: none;
}

/* --- 2. PC 端逻辑：当屏幕宽度大于移动端阈值（如 1024px）时显示 --- */
@media (min-width: 1024px) {
  .scroll-x::-webkit-scrollbar {
    display: block;
    /* 重新显示 */
    height: 6px;
    /* 横向滚动条的高度 */
  }

  .scroll-x::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    /* 半透明滚动条滑块 */
    border-radius: 10px;
  }

  .scroll-x::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.4);
    /* 鼠标悬停时变亮 */
  }

  .scroll-x::-webkit-scrollbar-track {
    background: transparent;
    /* 滚动条轨道透明 */
  }

  /* 针对 Firefox 的 PC 端显示 */
  .scroll-x {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  }
}




/* 游戏卡片组件 */
.game-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
}

.game-card.vertical img {
  width: 100%;
  aspect-ratio: 0.792;
  border-radius: var(--border-radius-md);
  object-fit: cover;
}

.game-card.vertical #imgHotItem {
	display: flex;
}


.game-card.square img {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: var(--border-radius-md);
  object-fit: cover;
}

.game-card.square .game-title {
  font-size: 13px;
  white-space: normal;
  
}

.game-card.scroll-item {
  width: 80px;
  flex-shrink: 0;
}

.game-card.scroll-item img {
  width: 80px;
  height: 80px;
  border-radius: var(--border-radius-md);
}

.game-card.scroll-c-item {
  width: 80px;
  flex-shrink: 0;
  border-radius: var(--border-radius-md);
  background: rgba(255, 255, 255, 0.15);
}

.game-card.scroll-c-item img {
  width: 42px;
  height: 42px;
  margin-top: 15px;
}

.game-card.scroll-c-item.select {
  background: #5145F4;
}

/* 确保容器是定位基准 */
.game-card-img-wrap {
  position: relative;
  width: 100%;
  border-radius: var(--border-radius-md);
  overflow: hidden;
}

/* 信息遮罩层：位于图片底部，向上延伸 */
.card-info-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 20px 4px 8px;
  /* 底部留一点间距，顶部较多用于承载渐变 */
  z-index: 5;
  /* 高于图片(z-index:2)，低于Hot标签(z-index:10) */

  /* 黑色半透明渐变，防止文字看不清 */
  /*background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);*/

  display: flex;
  flex-direction: column;
  align-items: center;
  /* 文字左对齐 */
  pointer-events: none;
  /* 让点击依然能穿透到图片或容器上 */
}

/* 标题样式 */
.game-title {
  color: #ffffff;
  font-size: 13px;
  margin: 0;
  width: 100%;
  display: block;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
  text-align: center;
  font-family: Plus Jakarta Sans;
  font-variation-settings: "opsz" auto;
  font-feature-settings: "kern" on;
}

/* 默认情况下，.game-title 在下方（原本的样式） */
.game-title {
  padding-top: 6px;
  color: var(--text-main);
  /* ... */
}

.game-title.c-title {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 8px;
}

.game-card.vertical .game-title {
  font-weight: bold;
  font-size: 16px;
}

/* 仅在 .vertical (Hot区域) 或是特定容器内启用悬浮效果 */
.game-card.vertical .card-info-overlay {
  display: flex;
  /* 启用悬浮层 */
}


.game-card.square .card-info-overlay {
  display: none;
  /* 普通方块卡片可以保持文字在下方的简约风格 */
}



/* 分类标签样式 */
.game-category {
  color: #ffffff;
  font-size: 12px;
  margin-bottom: 2px;
  padding: 2px 6px;
  border-radius: 4px;
}

.badge-hot {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 2;
  pointer-events: none;
}



/* 轮播容器 */
.hero-banner.slider {
  position: relative;
  overflow: hidden;
  width: calc(100% - 30px);
  margin: 10px auto;
  border-radius: var(--border-radius-lg);
  touch-action: pan-y;
  /* 允许纵向滚动页面，拦截横向拖拽 */
  cursor: grab;
  pointer-events: none;
}

.hero-banner.slider:active {
  cursor: grabbing;
}

.slider-wrapper {
  display: flex;
  width: 100%;
  height: 100%;
}

.slide {
  min-width: 100%;
  aspect-ratio: 2 / 1;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  user-select: none;
  /* 防止图片被拖拽蓝选 */
  pointer-events: auto;
}

/* 当父容器处于拖拽状态时，暂时禁用内部所有的点击/指针事件 */
.slider-wrapper.dragging a, 
.slider-wrapper.dragging button {
    pointer-events: none !important;
}

.slide a {
    /* 确保按钮可以点击 */
    display: inline-block;
    z-index: 20;
    position: relative;
}

/* 轮播指示点 */
.slider-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  transition: background 0.3s;
}

.dot.active {
  background: var(--primary-gradient);
  width: 12px;
  height: 12px;
}

.detail-banner {
  width: 100%;
  aspect-ratio: 16 / 9;
  /* 或者根据设计图固定高度 */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  /* 增加一个半透明压暗效果，确保 Play Now 按钮清晰 */
  background-image: linear-gradient(to bottom, transparent 60%, rgba(0, 0, 0, 0.6)), url('default.jpg');
  text-align: center;
}

.play-btn-wrapper {
  background: none;
  border: none;
  padding: 0;
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  cursor: pointer;
}

.play-btn-wrapper img {
  width: 220px;
  /* 控制图片宽度 */
  display: block;
}

/* 详情页专用样式 */
.game-info-header {
  display: flex;
  gap: 15px;
  margin: 20px 15px;
}

.game-info-header img {
  width: 80px;
  height: 80px;
  border-radius: 16px;
}

.game-info-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.game-info-text h1 {
  font-size: 20px;
  margin: 0;
}

.game-stats {
  display: flex;
  gap: 30px;
  font-size: 12px;
  color: var(--text-muted);
  align-items: center;
  font-family: Plus Jakarta Sans;
}

.game-stats img {
  width: 14px;
  height: 14px;
  margin-right: 6px;
}

.game-category img {
  width: 14px;
  height: 14px;
  margin-right: 6px;
  margin-left: -4px;
}

.detail-card {
  background-color: var(--bg-detail-card);
  border-radius: var(--border-radius-md);
  padding: 20px;
  margin: 20px 15px;
  margin-bottom: 80px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
}

.detail-row span:first-child {
  color: var(--text-muted);
}

.detail-desc {
  font-size: 14px;
  color: #ccc;
  margin-top: 15px;
  line-height: 1.6;
}

/* 底部区域 */
.footer {
  text-align: center;
  padding: 30px 15px;
  background-color: #00000091;
  font-size: 14px;
  color: #ffffff;
  width: 100%;
  position: absolute;
  bottom: 0;
  background-image: url('img/footer-bg.png');
  background-blend-mode: overlay;
  background-size: cover;
}

.footer a {
  color: #ffffff;
  text-decoration: none;
  margin: 0 5px;
}

.floating-btn {
  position: absolute;
  /*position: fixed;*/
  bottom: 160px;
  left: 50%;
  transform: translateX(-50%);
  /*background: var(--primary-gradient);*/
  color: #000;
  font-weight: bold;
  padding: 12px 20px;
  border-radius: 30px;
  text-decoration: none;
  /*box-shadow: 0 4px 15px rgba(255, 154, 0, 0.4);*/
  z-index: 1000;
}

/* --- 覆盖层全局基础设置 --- */
.overlay-container {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 540px;
  height: 100vh;
  z-index: 2000;
  display: none;
  /* 核心：默认隐藏 */
  overflow: hidden;
}

/* 显示覆盖层时激活此 class */
.overlay-container.active {
  display: flex;

}

/* --- 1. 左侧分类弹出层 --- */
.category-overlay {
  flex-direction: row;

}

/* 分类菜单本体（左侧）- 带有半透明黑色透视效果 */
.category-sidebar {
  width: 75%;
  height: 100%;
  /* 修改为带透明度的黑色背景，并加入高斯模糊实现透视 */
  background-color: rgba(10, 10, 15, 1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  animation: slideInLeft 0.3s ease forwards;
  box-shadow: 2px 0 15px rgba(0, 0, 0, 0.5);
  /* 增加边缘阴影，层次感更好 */
}

/* 右侧剩余区域（点击可关闭）- 纯黑半透明遮罩 */
.category-backdrop {
  width: 25%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  /* 黑色半透明背景 */
  cursor: pointer;
  animation: slideInRight 0.3s ease forwards;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
}

.category-close {
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
}

.category-list {
  list-style: none;
  padding: 10px 0;
  overflow-y: auto;
}

.category-list li {
  display: flex;
  align-items: center;
  padding: 18px 20px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.category-list li:hover,
.category-list li:active {
  background-color: rgba(255, 255, 255, 0.05);
  border-left-color: var(--accent-purple);
}

.category-list .cat-icon {
  margin-right: 15px;
  width: 24px;
  height: 24px;
}

.category-list .cat-icon img {
  width: 100%;
  height: 100%;
}

/* --- 2. 搜索弹出层 --- */
.search-overlay {
  /* 全屏纯黑背景，也可以用 rgba(0,0,0,0.95) 加一点点透视 */
  background-color: #000000;
  flex-direction: column;
  overflow-y: auto;
  animation: fadeIn 0.2s ease forwards;
}

/* (以下搜索层的其余 CSS 保持不变) */
.search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
}

.search-back {
  font-size: 20px;
  cursor: pointer;
  color: var(--text-main);
}

.search-bar-wrap {
  padding: 0 20px 15px;
}

.search-input-box {
  display: flex;
  align-items: center;
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 20px;
  padding: 8px 15px;
}

.search-input-box img{
  width: 16px;
  height: 16px;
}

.search-input-box input {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 14px;
  width: 100%;
  margin-left: 10px;
  outline: none;
}

.search-input-box input::placeholder {
  color: #666;
}

.search-suggestions {
  padding: 10px 20px;
}

.suggestion-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
  cursor: pointer;
}

.suggestion-item img {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  margin-right: 15px;
}

.suggestion-text {
  font-size: 14px;
  font-weight: bold;
}

.text-highlight {
  color: #ffcc00;
  font-style: italic;
}

.search-results-wrap {
  padding: 10px 20px;
  display: none;
}

.search-results-header {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 15px;
}

.search-results-count {
  color: #ffcc00;
}

/* 动画保持不变 */
@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}


/* --- 游戏加载遮罩层 --- */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 540px;
  height: 100vh;
  background-color: var(--bg-dark);
  z-index: 3000;
  display: none;
  /* 默认隐藏 */
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.loader {
  width: 48px;
  height: 48px;
  border: 5px solid #FFF;
  border-bottom-color: var(--accent-pink);
  border-radius: 50%;
  display: inline-block;
  animation: rotation 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* --- 游戏运行容器 --- */
#game-container {
  display: none;
  /* 初始隐藏 */
  flex-direction: column;
  height: 100vh;
  width: 100%;
  background: #000;
}

#game-iframe {
  width: 100%;
  flex: 1;
  /* 占据除去 Header 后的所有高度 */
  border: none;
}


/* --- 悬浮分类导航栏容器 --- */
.category-nav-bar {
  display: flex; /* 保持 flex 布局 */
  display: none; /* 初始状态隐藏，等 JS 激活时再显示 */
  flex-direction: row;
  padding: 12px 15px;
  background-color: var(--bg-dark, #0a0a0f);
  
  /* 初始隐藏状态 */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px); /* 稍微向上位移，做入场动画 */
  transition: all 0.3s ease-in-out;
  
  /* 吸顶逻辑保持不变 */
  position: -webkit-sticky;
  position: sticky;
  top: 60px; /* 假设 header 高度是 60px */
  z-index: 99;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05); /* 底部加一点极暗的分割线 */
}

/* 当激活 .visible 类时显示 */
.category-nav-bar.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  display: flex;
}


/* --- 胶囊/药丸 按钮样式 --- */
.nav-pill {
  display: flex;
  align-items: center;
  gap: 8px; /* 图标和文字的间距 */
  background-color: #2a2a2a; /* 未选中的深灰色背景 */
  color: #ffffff;
  border: none;
  border-radius: 10px; /* 圆角胶囊 */
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap; /* 强制文字不换行 */
  flex-shrink: 0; /* 保证在 scroll-x 容器中不被挤压变形 */
  transition: all 0.2s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

/* 激活状态下的颜色 (图中的紫蓝色) */
.nav-pill.active {
  background-color: #5c4dff; 
  box-shadow: 0 4px 10px rgba(92, 77, 255, 0.3); /* 加一点发光效果更现代 */
}

/* PC 端悬停效果 */
@media (hover: hover) {
  .nav-pill:not(.active):hover {
    background-color: #3a3a3a;
  }
}

 .deatil-return{
	position: fixed;
	display: flex;
	top: 60px;
	z-index: 99;
	transform: translateY(0);
	flex-direction: row;
 }
 
 .deatil-return button{
	align-items: center;
	background-color: rgb(32 32 34 / 0%);
	border: none;
	padding: 8px 18px;
	cursor: pointer;
 }
 
 .deatil-return button img{
	width: 13px;
 }
