/* ============================================
   Demo7 — Space Sci-Fi 风格 (太空科幻)
   主题: 星际航行、星云、未来科技、飞船
   ============================================ */

/* ---- 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: #e0d0ff;
}
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(0, 240, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 20% 30%, rgba(100, 50, 255, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(0, 150, 255, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, #0a0014 0%, #120824 50%, #0a0014 100%);
  background-size: 20px 20px, 20px 20px, auto, auto, auto;
  z-index: -1;
  pointer-events: none;
}

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

/* ---- 太空顶部栏 ---- */
.gh-topbar {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.15);
  background: rgba(10, 0, 20, 0.9);
  backdrop-filter: blur(10px);
}
.gh-topbar-item {
  flex: 1;
  text-align: center;
  padding: 9px 4px;
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 4px;
  font-size: 12px;
  background: rgba(15, 0, 35, 0.8);
  color: #c084fc;
  letter-spacing: 0.5px;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  text-shadow: 0 0 8px rgba(0, 230, 255, 0.25);
}
.gh-topbar-item.gh-brand {
  font-weight: 700;
  color: #fff;
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(0, 240, 255, 0.4);
  text-shadow: 0 0 12px rgba(0, 230, 255, 0.4);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

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

/* ---- 太空分区标题 ---- */
.gh-section { margin: 0 12px 12px; }
.gh-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.gh-section-title {
  display: inline-block;
  font-size: 11px;
  height: 32px;
  line-height: 32px;
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 8px;
  padding: 0px 12px;
  background: rgba(15, 0, 35, 0.8);
  color: #00f0ff;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ---- 太空大图+双小图组合 ---- */
.gh-combo { display: flex; gap: 8px; }
.gh-combo-main {
  flex: 1 1 55%;
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: rgba(15, 0, 35, 0.6);
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
}
.gh-combo-main:active {
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}
.gh-combo-main .gh-card-thumb { width: 100%; aspect-ratio: 1/1; background: #0f0830; flex: 0 0 auto; }
.gh-combo-main .gh-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gh-combo-main .gh-card-name { font-size: 12px; padding: 6px 8px 8px; color: #d8b4fe; }

.gh-combo-side { flex: 1 1 45%; display: flex; flex-direction: column; gap: 8px; }
.gh-combo-side .gh-card {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 10px;
  overflow: hidden;
  flex: 1;
  background: rgba(15, 0, 35, 0.6);
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
}
.gh-combo-side .gh-card:active {
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
}
.gh-combo-side .gh-card-thumb { width: 100%; aspect-ratio: 16/10; background: #0f0830; flex: 0 0 auto; }
.gh-combo-side .gh-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gh-combo-side .gh-card-name { font-size: 11px; padding: 4px 6px 6px; color: #d8b4fe; }

/* ---- 太空查看更多 ---- */
.gh-more-col {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  flex: 0 0 28px;
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 8px;
  background: rgba(15, 0, 35, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #c084fc;
  transition: all 0.2s ease;
}
.gh-more-col:active {
  background: rgba(168, 85, 247, 0.1);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}

.gh-more-row {
  display: flex;
  justify-content: flex-end;
}
.gh-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 8px;
  background: rgba(15, 0, 35, 0.6);
  color: #c084fc;
  transition: all 0.2s ease;
}
.gh-more-btn:active {
  background: rgba(168, 85, 247, 0.1);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}

/* ---- 太空底部 ---- */
.gh-footer {
  text-align: center;
  font-size: 12px;
  color: rgba(0, 240, 255, 0.4);
  padding: 14px 12px;
  border-top: 1px solid rgba(0, 240, 255, 0.1);
  background: rgba(10, 0, 20, 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: 1px solid rgba(0, 240, 255, 0.15); border-radius: 8px; padding: 8px 4px 10px; background: rgba(15, 0, 35, 0.6); }
#search-result .gh-card-thumb { width: 100%; aspect-ratio: 1/1; border-radius: 6px; overflow: hidden; background: #0f0830; }
#search-result .gh-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
#search-result .gh-card-name { font-size: 12px; text-align: center; color: #d8b4fe; }
.gh-empty { text-align: center; color: rgba(0, 240, 255, 0.4); font-size: 13px; padding: 20px 0; }

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

/* ---- Unified App Header ---- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.12);
  background: rgba(8,12,26,0.9);
  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: #00f0ff;
  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: #c084fc;
}
.search-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #c084fc;
  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-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;
}
/* 首页grid卡片正方形 */
#sec1-grid .gh-card-thumb,
#sec2-grid .gh-card-thumb,
#sec3-grid .gh-card-thumb {
  aspect-ratio: 1/1;
}
.masonry-grid .gh-card-thumb img {
  width: 100%;
  height: 100%;
  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;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 200;
}
.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}
.drawer-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100%;
  background: #0f0520;
  border-right: 1px solid rgba(0, 240, 255, 0.25);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 201;
  display: flex;
  flex-direction: column;
  padding: 16px 0;
}
.drawer-panel.open {
  transform: translateX(0);
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 12px;
  border-bottom: 1px solid rgba(100, 200, 255, 0.1);
  margin-bottom: 8px;
}
.drawer-header span {
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(90deg, #00f0ff, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.drawer-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8899bb;
  cursor: pointer;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 8px;
}
.drawer-close:active { background: rgba(0, 240, 255, 0.2); }
.drawer-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  overflow-y: auto;
}
.drawer-nav li {
  margin: 2px 0;
}
.drawer-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  font-size: 14px;
  color: #c4b5fd;
  transition: background 0.15s ease;
  text-decoration: none;
}
.drawer-nav a:hover,
.drawer-nav a:active {
  background: rgba(0, 230, 255, 0.12);
  color: #00f0ff;
}
.drawer-nav a .drawer-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.drawer-nav a .drawer-icon svg {
  width: 20px;
  height: 20px;
}
.menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 8px;
  color: #00f0ff;
  cursor: pointer;
  flex-shrink: 0;
}
.menu-btn:active { background: rgba(0, 240, 255, 0.2); }
.menu-btn svg { width: 20px; height: 20px; }


/* ---- Enhanced Card Styles ---- */
.gh-card {
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 4px;
  background: rgba(15, 0, 35, 0.7);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.08);
  transition: all 0.3s ease;
}
.gh-card:hover {
  border-color: rgba(0, 240, 255, 0.4);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.15);
}

/* ===== Enhanced Space Sci-Fi Styles ===== */
.app-header {
  background: rgba(10, 0, 20, 0.92);
  border-bottom: 1px solid rgba(0, 240, 255, 0.15);
}
.brand {
  color: #00f0ff;
  text-shadow: 0 0 10px rgba(0, 230, 255, 0.3);
}
.search-trigger {
  color: #c084fc;
  border: 1px solid rgba(0, 240, 255, 0.15);
}
.gh-section-title {
  border: 1px solid rgba(0, 240, 255, 0.35);
  background: rgba(15, 0, 35, 0.85);
  color: #00f0ff;
  text-shadow: 0 0 10px rgba(0, 230, 255, 0.4);
  border-radius: 4px;
}
.gh-footer {
  color: rgba(0, 240, 255, 0.4);
  border-top: 1px solid rgba(0, 240, 255, 0.1);
}

/* ===== Container Overrides ===== */
.gh-combo-main {
  border-radius: 4px;
}
.gh-combo-side .gh-card {
  border-radius: 4px;
}
.gh-card-thumb {
  border-radius: 4px;
}
.search-bar input {
  border-radius: 4px;
}

/* ===== Sci-Fi Text Enhancements ===== */
.gh-topbar-item {
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.gh-section-title {
  letter-spacing: 2px;
}