/* ============================================
   Demo8 — Japanese Sakura 风格 (日式和风樱花)
   主题: 樱花、和风、日式庭院、淡雅水墨
   ============================================ */

/* ---- 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: #1a1005;
  font-family: 'Torus', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #2a1a05;
}
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 85% 10%, rgba(255, 192, 203, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 15% 80%, rgba(255, 218, 185, 0.1) 0%, transparent 40%),
    linear-gradient(180deg, #1a1005 0%, #2e1c0d 50%, #604020 100%);
  z-index: -1;
  pointer-events: none;
}

.gh-page { max-width: 480px; margin: 0 auto; background: rgba(255, 252, 250, 0.97); min-height: 100vh; position: relative; }

/* ---- 和风顶部栏 ---- */
.gh-topbar {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 159, 67, 0.25);
  background: rgba(255, 252, 250, 0.95);
  backdrop-filter: blur(10px);
}
.gh-topbar-item {
  flex: 1;
  text-align: center;
  padding: 9px 4px;
  border: 1px solid rgba(200, 160, 160, 0.3);
  border-radius: 8px;
  font-size: 13px;
  background: rgba(255, 248, 244, 0.8);
  color: #a06030;
}
.gh-topbar-item.gh-brand {
  font-weight: 700;
  color: #d35400;
  background: rgba(255, 230, 230, 0.5);
  border-color: rgba(200, 100, 100, 0.3);
}

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

/* ---- 和风分区标题 ---- */
.gh-section { margin: 0 0 14px; }
.gh-section-title {
  display: inline-block;
  margin: 0 12px 8px;
  font-size: 13px;
  border: 1px solid rgba(200, 160, 160, 0.3);
  border-radius: 8px;
  padding: 5px 12px;
  background: rgba(255, 248, 244, 0.6);
  color: #a06030;
  position: relative;
}
.gh-section-title::before {
  content: "❀";
  margin-right: 4px;
  color: #ff9f43;
}

/* ---- 和风轮播 ---- */
.gh-carousel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 0 10px;
  gap: 0;
}
.gh-carousel::-webkit-scrollbar { display: none; }
.gh-carousel .gh-card {
  flex: 0 0 auto;
  width: 62%;
  scroll-snap-align: center;
  margin: 0 -14px;
  border: 1px solid rgba(255, 159, 67, 0.2);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 16px rgba(100, 60, 60, 0.06);
  transition: all 0.3s ease;
}
.gh-carousel .gh-card:active {
  transform: scale(0.97);
  box-shadow: 0 8px 24px rgba(100, 60, 60, 0.1);
}
.gh-carousel .gh-card-thumb { width: 100%; aspect-ratio: 1/1; background: #3d220d; }
.gh-carousel .gh-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gh-carousel .gh-card-name {
  display: block;
  text-align: center;
  font-size: 13px;
  padding: 8px 10px 10px;
  color: #604020;
}

/* ---- 和风圆点 ---- */
.gh-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 4px; }
.gh-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(200, 160, 160, 0.3); }
.gh-dot:first-child { background: #ff9f43; width: 16px; border-radius: 4px; }

/* ---- 和风底部 ---- */
.gh-footer {
  text-align: center;
  font-size: 12px;
  color: rgba(139, 105, 105, 0.5);
  padding: 14px 12px;
  border-top: 1px solid rgba(255, 159, 67, 0.2);
  background: rgba(255, 252, 250, 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(255, 159, 67, 0.2); border-radius: 10px; padding: 8px 4px 10px; background: #fff; }
#search-result .gh-card-thumb { width: 100%; aspect-ratio: 1/1; border-radius: 8px; overflow: hidden; background: #3d220d; }
#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: #604020; }
.gh-empty { text-align: center; color: rgba(139, 105, 105, 0.5); font-size: 13px; padding: 20px 0; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #1a1005; }
::-webkit-scrollbar-thumb { background: rgba(200, 160, 160, 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(255,252,250,0.95);
  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: #a06030;
  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: #a06030;
}
.search-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #a06030;
  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;
}

/* ---- Active dot ---- */
.gh-dot.gh-active {
  background: #d35400;
  transform: scale(1.3);
}

/* ---- 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;
}