/* ============================================
   Demo5 — Steampunk 风格 (蒸汽朋克机械)
   主题: 铜管机械、齿轮、蒸汽、维多利亚时代
   ============================================ */

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

/* ---- 蒸汽朋克背景 ---- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(200, 150, 80, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 30% 100%, rgba(139, 90, 43, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, #1a1510 0%, #2a1f15 50%, #1c1610 100%);
  z-index: -1;
  pointer-events: none;
}

.gh-page { max-width: 480px; margin: 0 auto; background: #201a12; min-height: 100vh; position: relative; }

/* ---- 蒸汽顶部栏 ---- */
.gh-topbar {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(200, 150, 80, 0.2);
  background: rgba(30, 25, 18, 0.95);
}
.gh-topbar-item {
  flex: 1;
  text-align: center;
  padding: 9px 4px;
  border: 1px solid rgba(200, 150, 80, 0.25);
  border-radius: 6px;
  font-size: 13px;
  background: rgba(40, 33, 22, 0.8);
  color: #e8c880;
}
.gh-topbar-item.gh-brand {
  font-weight: 700;
  color: #e8c880;
  background: rgba(60, 50, 30, 0.5);
  border-color: rgba(200, 150, 80, 0.4);
}

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

.list-gh-ad {
  text-align: center;
  overflow: auto;
  max-width: 100%;
}

/* ---- 蒸汽侧边栏 ---- */
.gh-split { display: flex; gap: 8px; margin: 0 12px 12px; align-items: flex-start; }
.gh-side {
  width: 84px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 80px;
  align-self: flex-start;
}
.gh-side-item {
  padding: 12px 4px;
  text-align: center;
  border: 1px solid rgba(200, 150, 80, 0.25);
  border-radius: 8px;
  font-size: 12px;
  background: rgba(40, 33, 22, 0.7);
  color: #e8c880;
  cursor: pointer;
  transition: all 0.2s ease;
}
.gh-side-item.gh-active {
  background: rgba(160, 120, 60, 0.4);
  color: #f0e0a0;
  border-color: rgba(200, 150, 80, 0.4);
  box-shadow: 0 0 8px rgba(200, 150, 80, 0.15);
}

.gh-content { flex: 1 1 auto; min-width: 0; }
.gh-content-block { display: none; }
.gh-content-block.gh-show {
  display: block;
  scroll-margin-top: 120px;
}

.gh-vlist { display: flex; flex-direction: column; gap: 8px; }
.gh-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(200, 150, 80, 0.15);
  border-radius: 8px;
  background: rgba(40, 33, 22, 0.6);
  backdrop-filter: blur(5px);
  transition: all 0.2s ease;
}
.gh-card:active {
  transform: scale(0.97);
  box-shadow: 0 0 12px rgba(200, 150, 80, 0.15);
}
.gh-card-thumb {
  display: block;
  width: 64px;
  height: 64px;
  border-radius: 6px;
  overflow: hidden;
  flex: 0 0 auto;
  background: #2a2018;
  border: 1px solid rgba(200, 150, 80, 0.1);
}
.gh-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gh-card-name { font-size: 13px; color: #d0c0a0; line-height: 1.4; }

.gh-more-row { margin-top: 8px; }
.gh-more-btn {
  display: block;
  text-align: center;
  padding: 8px 0;
  border: 1px solid rgba(200, 150, 80, 0.25);
  border-radius: 8px;
  font-size: 12px;
  background: rgba(40, 33, 22, 0.6);
  color: #e8c880;
  transition: all 0.2s ease;
}
.gh-more-btn:active {
  background: rgba(60, 50, 30, 0.4);
  box-shadow: 0 0 8px rgba(200, 150, 80, 0.15);
}

/* ---- 蒸汽底部 ---- */
.gh-footer {
  text-align: center;
  font-size: 12px;
  color: rgba(200, 150, 80, 0.4);
  padding: 14px 12px;
  border-top: 1px solid rgba(200, 150, 80, 0.1);
  background: rgba(30, 25, 18, 0.5);
}

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

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #1a1510; }
::-webkit-scrollbar-thumb { background: rgba(200, 150, 80, 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(255,255,255,0.06);
  background: rgba(30,25,18,0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.app-header .back-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
}
.app-header #catTitle {
  font-size: 18px;
  margin: 0;
  height: 40px;
  line-height: 40px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: #e8c880;
  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: #e8c880;
}
.search-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #e8c880;
  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 {
  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;
}

/* ---- gh-vlist masonry ---- */
.gh-vlist {
  column-count: 2;
  column-gap: 10px;
  padding: 0 12px;
}
.gh-vlist .gh-card {
  break-inside: avoid;
  width: 100%;
  height: auto;
}

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

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

/* ---- Top grid (2x2) layout ---- */
.gh-vlist.gh-has-grid-top {
  column-count: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
}
.gh-grid-top {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0 12px;
}
.gh-grid-top .gh-card {
  display: block;
  width: 100%;
  height: auto;
  border: none;
  background: transparent;
}
.gh-grid-top .gh-card-thumb {
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  border-radius: 10px;
  overflow: hidden;
}
.gh-grid-top .gh-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---- Remaining cards single column ---- */
.gh-vlist-rest {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px;
}
.gh-vlist-rest .gh-card {
  width: 100%;
}
.gh-vlist-rest .gh-card-thumb {
  width: 100%;
  height: auto;
}

/* ============================================
  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: #11162b;
  border-right: 1px solid rgba(100, 200, 255, 0.1);
  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, #c8a868, #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: #e8dcc8;
  cursor: pointer;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(100,200,255,0.1);
  border-radius: 8px;
}
.drawer-close:active { background: rgba(100,200,255,0.1); }
.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: #c0c8e0;
  transition: background 0.15s ease;
  text-decoration: none;
}
.drawer-nav a:hover,
.drawer-nav a:active {
  background: rgba(0, 212, 255, 0.08);
  color: #fff;
}
.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(100,200,255,0.1);
  border-radius: 8px;
  color: #c8a868;
  cursor: pointer;
  flex-shrink: 0;
}
.menu-btn:active { background: rgba(100,200,255,0.1); }
.menu-btn svg { width: 20px; height: 20px; }
