/* ============================================
   Demo10 — Esports Neon Arena 风格 (电竞霓虹竞技场)
   主题: 电子竞技、竞技擂台、霓虹灯牌、赛博网格地面
   结构差异化: 首页采用"层叠卡片轮播"(card-stack carousel)
   ============================================ */

/* ---- Fonts (from demo1) ---- */
@font-face {
  font-family: 'Proxima Nova';
  font-display: swap;
  font-weight: 400;
  src: url('./fonts/proxima-nova-regular-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Proxima Nova';
  font-display: swap;
  font-weight: 700;
  src: url('./fonts/proxima-nova-bold-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Torus';
  font-display: swap;
  font-weight: 700;
  src: url('./fonts/torus-bold-latin.woff2') format('woff2');
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: #0a0014;
  font-family: 'Torus', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #e8d8ff;
}
a { text-decoration: none; color: inherit; }
input { font-family: 'Torus'; }
img { display: block; max-width: 100%; }

/* ---- 电竞擂台网格地面背景 ---- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(255, 0, 200, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 30% 15%, rgba(255, 0, 180, 0.10) 0%, transparent 55%),
    radial-gradient(circle at 75% 85%, rgba(0, 230, 255, 0.08) 0%, transparent 55%),
    linear-gradient(180deg, #0a0014 0%, #140020 50%, #0a0014 100%);
  background-size: 26px 26px, 26px 26px, auto, auto, auto;
  z-index: -1;
  pointer-events: none;
}

.gh-page { max-width: 480px; margin: 0 auto; background: rgba(10, 0, 20, 0.9); min-height: 100vh; position: relative; }

/* ---- 电竞顶部导航条：功能列表入口 / 页面名称 / 搜索入口 ---- */
.gh-topbar {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 0, 200, 0.25);
  background: rgba(12, 0, 24, 0.92);
  backdrop-filter: blur(10px);
}
.gh-topbar-item {
  flex: 1;
  text-align: center;
  padding: 9px 4px;
  border: 1px solid rgba(0, 230, 255, 0.25);
  border-radius: 4px;
  font-size: 12px;
  background: rgba(20, 6, 36, 0.8);
  color: #7ce8ff;
  letter-spacing: 0.5px;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.gh-topbar-item.gh-brand {
  flex: 1.4;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, rgba(255, 0, 180, 0.25), rgba(0, 230, 255, 0.2));
  border-color: rgba(255, 0, 200, 0.4);
  text-shadow: 0 0 10px rgba(255, 0, 200, 0.5);
}

/* ---- Unified App Header ---- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 0, 200, 0.2);
  background: rgba(12, 0, 24, 0.92);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.app-header #catTitle {
  margin: 0;
  font-size: 20px;
  color: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: #ff5ce0;
  text-decoration: none;
  text-shadow: 0 0 12px rgba(255, 0, 200, 0.4);
}
.brand-icon {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  color: #7ce8ff;
}
.cancel-btn {
  color: #ff5ce0;
}
.search-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #7ce8ff;
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid rgba(0, 230, 255, 0.3);
  border-radius: 4px;
  background: rgba(0, 230, 255, 0.06);
}
.search-trigger:active { background: rgba(0, 230, 255, 0.14); }

/* ---- 电竞广告位 ---- */
.gh-ad {
  margin: 0 auto;
  width: 100%;
  text-align: center;
}

/* ---- 电竞分区标题 ---- */
.gh-section { margin: 0 12px 20px; }
.gh-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.gh-section-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  height: 30px;
  padding: 0 14px;
  background: linear-gradient(90deg, rgba(255, 0, 180, 0.18), rgba(0, 230, 255, 0.1));
  border-left: 3px solid #ff2fd0;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.gh-more-row { display: flex; justify-content: flex-end; }
.gh-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(0, 230, 255, 0.3);
  border-radius: 4px;
  background: rgba(0, 230, 255, 0.06);
  color: #7ce8ff;
  transition: all 0.2s ease;
}
.gh-more-btn:active {
  background: rgba(255, 0, 200, 0.12);
  box-shadow: 0 0 10px rgba(255, 0, 200, 0.25);
}

/* =========================================================
   核心差异化结构：层叠卡片轮播 (Card Stack Carousel)
   还原骨架图：居中主卡 + 左右露出叠影卡 + 底部圆点指示器
   ========================================================= */
.gh-stack-carousel {
  position: relative;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
  user-select: none;
}
.gh-stack-track {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gh-stack-card {
  position: absolute;
  width: 62%;
  max-width: 220px;
  aspect-ratio: 1/1;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(0, 230, 255, 0.25);
  background: #140626;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), opacity 0.35s ease, filter 0.35s ease, z-index 0s;
  cursor: pointer;
}
.gh-stack-card img { width: 100%; height: 100%; object-fit: cover; }
.gh-stack-card.gh-pos-center {
  transform: translateX(0) scale(1);
  z-index: 5;
  opacity: 1;
  filter: none;
  box-shadow: 0 0 0 1px rgba(255, 0, 200, 0.4), 0 12px 30px rgba(255, 0, 150, 0.25);
}
.gh-stack-card.gh-pos-r1 { transform: translateX(58%) scale(0.86); z-index: 4; opacity: 0.85; filter: brightness(0.7); }
.gh-stack-card.gh-pos-r2 { transform: translateX(100%) scale(0.72); z-index: 3; opacity: 0.55; filter: brightness(0.5); }
.gh-stack-card.gh-pos-l1 { transform: translateX(-58%) scale(0.86); z-index: 4; opacity: 0.85; filter: brightness(0.7); }
.gh-stack-card.gh-pos-l2 { transform: translateX(-100%) scale(0.72); z-index: 3; opacity: 0.55; filter: brightness(0.5); }
.gh-stack-card.gh-pos-hidden { transform: translateX(0) scale(0.5); z-index: 1; opacity: 0; }

.gh-stack-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}
.gh-stack-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(232, 216, 255, 0.25);
  transition: all 0.25s ease;
}
.gh-stack-dot.gh-active {
  background: #ff2fd0;
  box-shadow: 0 0 6px rgba(255, 47, 208, 0.7);
  width: 16px;
  border-radius: 3px;
}

/* ---- 电竞底部 ---- */
.gh-footer {
  text-align: center;
  font-size: 12px;
  color: rgba(124, 232, 255, 0.4);
  padding: 14px 12px;
  border-top: 1px solid rgba(255, 0, 200, 0.15);
  background: rgba(10, 0, 20, 0.6);
}

#search-result { display: none; margin: 0 12px 12px; }
#search-result.gh-active { display: block; }
.gh-empty { text-align: center; color: rgba(124, 232, 255, 0.4); font-size: 13px; padding: 20px 0; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #0a0014; }
::-webkit-scrollbar-thumb { background: rgba(255, 0, 200, 0.35); border-radius: 2px; }

/* ---- Hide card names, remove borders (masonry cards keep image-only look) ---- */
.gh-card-name { display: none !important; }
.gh-card, .gh-masonry .gh-card {
  border: none !important;
  background: transparent;
}

/* ---- Masonry / Search results / Category grid (与 demo2-9 完全一致的瀑布流实现) ---- */
.masonry-grid {
  display: flex;
  gap: 10px;
  padding: 0 12px;
}
.masonry-grid.index-grid {
  padding: 0;
}
.masonry-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.masonry-grid .gh-card {
  margin-bottom: 0;
  width: 100%;
  height: auto;
}
.masonry-grid .gh-card-thumb {
  display: block;
  width: 100%;
  aspect-ratio: auto;
  height: auto;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(0, 230, 255, 0.15);
}
.masonry-grid .gh-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---- Loading indicator ---- */
.gh-load-indicator {
  text-align: center;
  color: #7c6a9a;
  font-size: 13px;
  padding: 16px 12px;
}
.gh-reached-bottom {
  color: #a08cc0;
  font-style: italic;
}

/* ---- Scroll sentinel (outside grid) ---- */
.gh-scroll-sentinel {
  height: 1px;
  visibility: hidden;
  margin-top: 8px;
}

/* ============================================
  AdX Anchor Ad — force fixed position
  ADX 后台通常无法直接设置广告 iframe 的 position 属性，
  因此通过项目 CSS 强制覆盖 GPT 注入的样式。
  ============================================ */
ins[id^="gpt_unit_"] {
  position: fixed !important;
}
