/* ============================================
   Demo6 — Pixel Retro 风格 (像素游戏复古)
   主题: 8-bit像素、复古游戏机、CRT显示器、经典街机
   ============================================ */

/* ---- 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: #1a1a2e;
  font-family: 'Torus', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #e8e8f0;
}
a { text-decoration: none; color: inherit; }
input { font-family: 'Torus'; }
img { display: block; max-width: 100%; }

/* ---- 像素复古背景 ---- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.15) 0px,
      rgba(0, 0, 0, 0.15) 1px,
      transparent 1px,
      transparent 2px
    ),
    linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  z-index: -1;
  pointer-events: none;
}

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

/* ---- 像素顶部栏 ---- */
.gh-topbar {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 2px solid #e94560;
  background: rgba(20, 20, 40, 0.95);
}
.gh-topbar-item {
  flex: 1;
  text-align: center;
  padding: 9px 4px;
  border: 2px solid #0f3460;
  border-radius: 0;
  font-size: 13px;
  background: #16213e;
  color: #e94560;
  text-transform: uppercase;
  letter-spacing: 1px;
  image-rendering: pixelated;
}
.gh-topbar-item.gh-brand {
  font-weight: 700;
  color: #fff;
  background: #e94560;
  border-color: #e94560;
  text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
}

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

/* ---- 像素药丸分类 ---- */
.gh-pill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px;
}
.gh-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 2px solid #0f3460;
  border-radius: 0;
  padding: 4px;
  background: #16213e;
  transition: all 0.1s ease;
}
.gh-pill:active {
  transform: translate(2px, 2px);
  box-shadow: -2px -2px 0 #e94560;
}
.gh-pill-icon {
  width: 100%;
  height: auto;
  border-radius: 0;
  object-fit: contain;
  background: #0f3460;
  image-rendering: pixelated;
}
.gh-pill-name { display: none !important; }

/* ---- 像素底部 ---- */
.gh-footer {
  text-align: center;
  font-size: 12px;
  color: rgba(233, 69, 96, 0.5);
  padding: 14px 12px;
  border-top: 2px solid #0f3460;
  background: rgba(20, 20, 40, 0.5);
}

#search-result { display: none; margin: 0 12px 12px; }
#search-result.gh-active { display: block; }
#search-result .gh-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}
#search-result .gh-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 2px solid #0f3460;
  border-radius: 0;
  padding: 8px 4px 10px;
  background: #16213e;
}
#search-result .gh-card-thumb { width: 100%; aspect-ratio: 1/1; border-radius: 0; overflow: hidden; background: #0f3460; }
#search-result .gh-card-thumb img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
#search-result .gh-card-name { font-size: 12px; text-align: center; color: #e8e8f0; font-weight: 700; }
.gh-empty { text-align: center; color: rgba(233, 69, 96, 0.5); font-size: 13px; padding: 20px 0; }

/* 像素滚动条 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #1a1a2e; }
::-webkit-scrollbar-thumb { background: #e94560; border-radius: 0; }

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

/* ---- Hide card names, remove borders ---- */
.gh-card-name { display: none !important; }
.gh-card, .gh-masonry .gh-card {
  border: none !important;
  background: transparent;
}


/* ---- Masonry / Search results grid ---- */
.masonry-grid {
  display: flex;
  gap: 10px;
  padding: 0 12px;
}
.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;
}
.masonry-grid .gh-card-thumb img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}
/* ---- Loading indicator ---- */
.gh-load-indicator {
  text-align: center;
  color: #556080;
  font-size: 13px;
  padding: 16px 12px;
}
.gh-reached-bottom {
  color: #8899bb;
  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;
}