/* ==================== 字体声明 ==================== */
/* JetBrains Mono 本地字体 */
@font-face {
  font-family: 'JetBrains Mono Bold';
  src: url('../font/JetBrainsMono-Bold.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono Regular';
  src: url('../font/JetBrainsMono-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Noto Sans SC 本地字体 */
@font-face { font-family: 'Noto Sans SC'; src: url('../font/NotoSansSC-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Noto Sans SC'; src: url('../font/NotoSansSC-Medium.ttf') format('truetype'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Noto Sans SC'; src: url('../font/NotoSansSC-Bold.ttf') format('truetype'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Noto Sans SC'; src: url('../font/NotoSansSC-Black.ttf') format('truetype'); font-weight: 900; font-style: normal; font-display: swap; }

/* Noto Sans TC 本地字体 */
@font-face { font-family: 'Noto Sans TC'; src: url('../font/NotoSansTC-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Noto Sans TC'; src: url('../font/NotoSansTC-Medium.ttf') format('truetype'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Noto Sans TC'; src: url('../font/NotoSansTC-Bold.ttf') format('truetype'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Noto Sans TC'; src: url('../font/NotoSansTC-Black.ttf') format('truetype'); font-weight: 900; font-style: normal; font-display: swap; }

/* ==================== rpx 响应式单位变量 ==================== */
/* 1rpx = 100vw / 750（移动端）；PC 端 768px+ 屏幕限制 1rpx = 0.8px（600px 内容宽度 / 750） */
:root {
  --rpx: calc(100vw / 750);
}
@media screen and (min-width: 768px) {
  :root {
    --rpx: 0.8px;
  }
}

/* ==================== 全局重置 ==================== */
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100vh;
  background: #ffffff;
  font-family: 'Noto Sans SC', 'PingFang SC', sans-serif;
  font-size: calc(28 * var(--rpx));
  color: #1B2848;
  line-height: 1.4;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

::-webkit-scrollbar {
  width: 0;
  height: 0;
  color: transparent;
  display: none;
}

/* ==================== 语言字体 Class ==================== */
/* 简体中文 */
.lang-cn .font-regular { font-family: 'Noto Sans SC', 'PingFang SC', sans-serif; font-weight: 400; }
.lang-cn .font-medium { font-family: 'Noto Sans SC', 'PingFang SC', sans-serif; font-weight: 500; }
.lang-cn .font-bold { font-family: 'Noto Sans SC', 'PingFang SC', sans-serif; font-weight: 700; }
.lang-cn .font-heavy { font-family: 'Noto Sans SC', 'PingFang SC', sans-serif; font-weight: 900; }

/* 繁体中文 */
.lang-tc .font-regular { font-family: 'Noto Sans TC', 'PingFang TC', sans-serif; font-weight: 400; }
.lang-tc .font-medium { font-family: 'Noto Sans TC', 'PingFang TC', sans-serif; font-weight: 500; }
.lang-tc .font-bold { font-family: 'Noto Sans TC', 'PingFang TC', sans-serif; font-weight: 700; }
.lang-tc .font-heavy { font-family: 'Noto Sans TC', 'PingFang TC', sans-serif; font-weight: 900; }

/* 英文 */
.lang-en .font-regular { font-family: 'Noto Sans SC', 'PingFang SC', sans-serif; font-weight: 400; }
.lang-en .font-medium { font-family: 'Noto Sans SC', 'PingFang SC', sans-serif; font-weight: 500; }
.lang-en .font-bold { font-family: 'Noto Sans SC', 'PingFang SC', sans-serif; font-weight: 700; }
.lang-en .font-heavy { font-family: 'Noto Sans SC', 'PingFang SC', sans-serif; font-weight: 900; }

/* JetBrains Mono（不随语言变化） */
.font-mono-bold { font-family: 'JetBrains Mono Bold', monospace; }
.font-mono-regular { font-family: 'JetBrains Mono Regular', monospace; }

/* ==================== 通用 Class ==================== */
.flex { display: flex; flex-direction: column; }
.flex-1 { flex: 1; }
.flex-row { display: flex; flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
.marginR20 { margin-right: calc(20 * var(--rpx)); }
.marginR30 { margin-right: calc(30 * var(--rpx)); }
.aligncenter { align-items: center; }
.justifyCenter { justify-content: center; }
.padding30 { padding: calc(30 * var(--rpx)); }

.lineOne {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  word-break: break-all;
}

.lineTwo {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  word-break: break-all;
}

/* ==================== 按钮点击特效 ==================== */
.btn-effect {
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-effect:active {
  transform: scale(0.94);
}

/* ==================== 页面通用动效 ==================== */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(calc(40 * var(--rpx))); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-fade-up { animation: fadeSlideUp 0.5s ease-out both; }
.animate-fade-up-delay { animation: fadeSlideUp 0.5s ease-out 0.1s both; }
.animate-fade-up-delay2 { animation: fadeSlideUp 0.5s ease-out 0.2s both; }
.animate-fade-up-delay3 { animation: fadeSlideUp 0.5s ease-out 0.3s both; }
.animate-fade-up-custom { animation: fadeSlideUp 0.5s ease-out var(--enter-delay, 0s) both; }

.press-effect {
  transition: transform 0.15s ease;
}
.press-effect:active {
  transform: scale(0.97);
}

@keyframes pulseLoop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}
.pulse-loop {
  display: inline-block;
  animation: pulseLoop 2s ease-in-out infinite;
}

@keyframes contentFadeIn {
  from { opacity: 0; transform: translateY(calc(12 * var(--rpx))); }
  to   { opacity: 1; transform: translateY(0); }
}
.content-fade-in {
  animation: contentFadeIn 0.3s ease-out;
}

/* ==================== 首页布局 ==================== */
.page-container {
  position: relative;
  min-height: 100vh;
  background: url('../img/index/all-search.png') no-repeat center top;
  background-size: 100% 100%;
  padding-bottom: calc(160 * var(--rpx));
}

/* PC 端适配：内容居中，最大宽度 600px */
@media screen and (min-width: 768px) {
  .page-container {
    max-width: 600px;
    margin: 0 auto;
  }
}

/* ==================== 模块二：轮播图 + 快捷入口 ==================== */
.banner-section {
  position: relative;
  display: flex;
  margin: calc(30 * var(--rpx));
}

.banner-wrapper {
  border-radius: calc(33 * var(--rpx));
  overflow: hidden;
  width: calc(546 * var(--rpx));
  height: calc(388 * var(--rpx));
  border: calc(6 * var(--rpx)) solid #1B2848;
  box-shadow: calc(4 * var(--rpx)) calc(4 * var(--rpx)) 0px 0px #7C5DFF;
  box-sizing: border-box;
  position: relative;
  flex-shrink: 0;
}

.banner-swiper {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.banner-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
}

.banner-slide {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-dots {
  position: absolute;
  bottom: calc(16 * var(--rpx));
  left: 0;
  right: 0;
  width: calc(546 * var(--rpx));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(12 * var(--rpx));
}

.banner-dot {
  width: calc(16 * var(--rpx));
  height: calc(16 * var(--rpx));
  border-radius: calc(8 * var(--rpx));
  background: rgba(255, 255, 255, 0.5);
  border: calc(2 * var(--rpx)) solid #7C5DFF;
  transition: all 0.3s;
  cursor: pointer;
}

.banner-dot.active {
  width: calc(48 * var(--rpx));
  background: #FFFFFF;
}

.quick-actions {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  margin-left: calc(24 * var(--rpx));
  padding-top: calc(2 * var(--rpx));
}

.quick-item {
  width: calc(120 * var(--rpx));
  height: calc(120 * var(--rpx));
  margin-bottom: calc(16 * var(--rpx));
  cursor: pointer;
  transition: transform 0.15s ease;
}
.quick-item:last-of-type {
  margin-bottom: 0;
}
.quick-item:active {
  transform: scale(0.94);
}
.quick-item img {
  width: 100%;
  height: 100%;
}

/* ==================== 区块标题 ==================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: calc(24 * var(--rpx));
}

.section-title {
  font-size: calc(36 * var(--rpx));
  font-weight: bold;
  color: #1B2848;
}

.more-btn {
  display: flex;
  align-items: center;
  gap: calc(8 * var(--rpx));
  font-size: calc(28 * var(--rpx));
  color: #1B2848;
  font-weight: 400;
  cursor: pointer;
}

.more-arrow {
  width: calc(40 * var(--rpx));
  height: calc(40 * var(--rpx));
}

/* ==================== top_third 模块：顶部前三游戏卡片 ==================== */
.top-third-section {
  margin-top: calc(32 * var(--rpx));
  padding: 0 calc(24 * var(--rpx));
}

/* ==================== 模块三：本周热门 ==================== */
.hot-section {
  margin-top: calc(32 * var(--rpx));
  padding: 0 calc(24 * var(--rpx));
}

.hot-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.hot-list {
  display: flex;
  gap: calc(24 * var(--rpx));
  margin-bottom: calc(6 * var(--rpx));
  padding-right: calc(10 * var(--rpx));
}

.hot-item {
  position: relative;
  flex-shrink: 0;
  width: calc(500 * var(--rpx));
  height: calc(280 * var(--rpx));
  box-shadow: calc(4 * var(--rpx)) calc(4 * var(--rpx)) 0px 0px #4FBDDE;
  border-radius: calc(21 * var(--rpx));
  border: calc(4 * var(--rpx)) solid #1B2848;
  box-sizing: border-box;
  overflow: hidden;
  cursor: pointer;
}

.hot-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==================== 模块四：新游首发 ==================== */
.new-game-section {
  margin-top: calc(32 * var(--rpx));
  padding: 0 calc(24 * var(--rpx));
}

.new-game-list {
  background: #FFFFFF;
  border-radius: calc(24 * var(--rpx));
  padding: calc(32 * var(--rpx)) calc(16 * var(--rpx));
  display: flex;
  flex-direction: column;
}

/* ==================== 模块五：跑马灯 ==================== */
.marquee-section {
  margin-top: calc(32 * var(--rpx));
}

.marquee-scroll {
  width: 100%;
  border-radius: calc(24 * var(--rpx));
  background: #FFFFFF;
  padding: calc(24 * var(--rpx)) 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: calc(24 * var(--rpx));
  white-space: nowrap;
  padding: 0 calc(16 * var(--rpx));
}

.marquee-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(16 * var(--rpx));
  flex-shrink: 0;
  cursor: pointer;
}

.marquee-icon {
  width: calc(152 * var(--rpx));
  height: calc(152 * var(--rpx));
  box-shadow: calc(4 * var(--rpx)) calc(4 * var(--rpx)) 0px 0px #4F7CE5;
  border-radius: calc(23 * var(--rpx));
  border: calc(4 * var(--rpx)) solid #1B2848;
  object-fit: cover;
}

.marquee-name {
  font-size: calc(30 * var(--rpx));
  color: #1B2848;
  max-width: calc(152 * var(--rpx));
  font-weight: 500;
}

/* ==================== 更多游戏按钮 ==================== */
.more-game-btn {
  width: calc(666 * var(--rpx));
  height: calc(80 * var(--rpx));
  background: #FFFFFF;
  box-shadow: calc(4 * var(--rpx)) calc(4 * var(--rpx)) 0px 0px #9FA5B2;
  border-radius: calc(24 * var(--rpx));
  border: calc(4 * var(--rpx)) solid #9FA5B2;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: calc(20 * var(--rpx)) auto;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.more-game-btn:active {
  transform: scale(0.94);
}
.more-game-btn span {
  font-size: calc(30 * var(--rpx));
  color: #1F2937;
  font-weight: 500;
}

/* ==================== SEO 隐藏内容 ==================== */
.seo-h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==================== 加载骨架 ==================== */
.skeleton-loading {
  display: flex;
  flex-direction: column;
  gap: calc(16 * var(--rpx));
  padding: calc(24 * var(--rpx));
}

.skeleton-item {
  height: calc(112 * var(--rpx));
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: calc(16 * var(--rpx));
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==================== Toast 提示 ==================== */
.toast-container,
.ss-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: calc(20 * var(--rpx)) calc(32 * var(--rpx));
  border-radius: calc(12 * var(--rpx));
  font-size: calc(28 * var(--rpx));
  z-index: 99999;
  max-width: 80%;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.toast-container.show,
.ss-toast.ss-toast-show {
  opacity: 1;
}
