/* 广告位：顶栏中间广告 + 灵感广场横幅 + 右侧竖幅；后台「广告位管理」维护 */

/* ===== 通用：渐变配色 ===== */
.ad-slide.grad-blue    { background: linear-gradient(90deg, #3b6cf6 0%, #6d4df2 55%, #9333ea 100%); }
.ad-slide.grad-violet  { background: linear-gradient(90deg, #6d28d9 0%, #c026d3 100%); }
.ad-slide.grad-cyan    { background: linear-gradient(90deg, #0ea5e9 0%, #6366f1 100%); }
.ad-slide.grad-amber   { background: linear-gradient(90deg, #d97706 0%, #b45309 100%); }
.ad-slide.grad-emerald { background: linear-gradient(90deg, #059669 0%, #0d9488 100%); }
.ad-slide.grad-rose    { background: linear-gradient(90deg, #e11d48 0%, #9d174d 100%); }

/* ===== 通用轮播骨架：横向轨道，支持按住拖动 ===== */
.ad-carousel { position: relative; overflow: hidden; }
.ad-carousel .ad-track {
  display: flex; width: 100%; height: 100%;
  will-change: transform;
  transition: transform .42s cubic-bezier(.22, .61, .36, 1);
  touch-action: pan-y;
}
.ad-carousel .ad-track.dragging { transition: none; }
.ad-carousel .ad-track.no-anim { transition: none; }
.ad-carousel .ad-slide {
  position: relative; flex: 0 0 100%; width: 100%; height: 100%;
  display: block; text-decoration: none;
}
.ad-carousel .ad-slide img { display: block; width: 100%; height: 100%; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.ad-carousel.dragging, .ad-carousel.dragging * { user-select: none; cursor: grabbing; }

/* 通用关闭按钮 */
.ad-x {
  position: absolute; z-index: 6; display: grid; place-items: center;
  width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(6, 10, 17, .34); color: #fff; font-size: 14px; line-height: 1;
  cursor: pointer; opacity: .6; transition: opacity .18s ease, background .18s ease;
}
.ad-x:hover { opacity: 1; background: rgba(0, 0, 0, .62); }

/* ===== 顶栏中间广告位：夹在「页面标题」和右侧按钮之间，宽度随窗口自适应 ===== */
.sh-admid {
  position: relative; flex: 1 1 auto; min-width: 0; height: 40px;
  margin: 0 20px; display: flex; align-items: center; justify-content: center;
}
.sh-admid[hidden] { display: none !important; }
.sh-admid.ad-narrow { display: none !important; }
.sh-admid .ad-carousel { width: 100%; margin: 0 auto; height: 40px; cursor: grab; }
.sh-admid .ad-slide img { object-fit: contain; object-position: center; border-radius: 8px; }
.sh-admid .ad-slide.ad-text {
  display: flex; align-items: center; justify-content: center;
  padding: 0 104px 0 60px; border-radius: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .01em; color: #fff;
}
.sh-admid .ad-cap { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-admid .ad-cap::before { content: '⚡'; font-size: 12px; flex: none; opacity: .95; }
.sh-admid .ad-btn {
  position: absolute; right: 34px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 14px;
  border-radius: 999px; background: #fff; color: #2b2a7a;
  font-size: 12px; font-weight: 800; white-space: nowrap;
  box-shadow: 0 4px 12px -6px rgba(0, 0, 0, .5);
}
.sh-admid .ad-btn::after { content: '→'; font-size: 12px; }
.sh-admid .ad-x { top: 50%; transform: translateY(-50%); right: 8px; }
.sh-admid .ad-dots {
  position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px; z-index: 3;
}
.sh-admid .ad-dots i {
  display: block; width: 4px; height: 4px; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, .42); transition: background .2s ease, transform .2s ease;
}
.sh-admid .ad-dots i.on { background: #fff; transform: scale(1.3); }

/* ===== 灵感广场横幅：位于「灵感广场」标题上方 ===== */
.hm-adslot { position: relative; margin: 6px 0 4px; }
.hm-adslot[hidden] { display: none !important; }
.hm-adslot .ad-carousel {
  width: 100%; height: 100px; border-radius: 14px;
  background: #0b0f16; border: 1px solid rgba(255, 255, 255, .07); cursor: grab;
}
.hm-adslot .ad-slide img { object-fit: cover; object-position: center; }
.hm-adslot .ad-slide.ad-text {
  display: flex; align-items: center; justify-content: center;
  padding: 0 170px 0 80px;
  font-size: 15.5px; font-weight: 700; letter-spacing: .01em; color: #fff;
}
.hm-adslot .ad-cap { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-adslot .ad-cap::before { content: '⚡'; font-size: 15px; flex: none; opacity: .95; }
.hm-adslot .ad-btn {
  position: absolute; right: 60px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 20px;
  border-radius: 999px; background: #fff; color: #2b2a7a;
  font-size: 13px; font-weight: 800; white-space: nowrap;
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .55);
}
.hm-adslot .ad-btn::after { content: '→'; font-size: 14px; }
.hm-adslot .ad-x { top: 8px; right: 8px; }
.hm-adslot .ad-dots {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px;
  background: rgba(6, 10, 17, .42); z-index: 3;
}
.hm-adslot .ad-dots i {
  display: block; width: 6px; height: 6px; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, .5); transition: background .2s ease, transform .2s ease;
}
.hm-adslot .ad-dots i.on { background: #fff; transform: scale(1.3); }
@media (max-width: 760px) {
  .hm-adslot .ad-carousel { height: 76px; }
  .hm-adslot .ad-slide.ad-text { padding: 0 60px; font-size: 13px; }
  .hm-adslot .ad-btn { display: none; }
}

/* ===== 右侧竖幅：190×300，只在页面顶部显示，往下滚淡出 ===== */
.ad-rail {
  position: fixed; right: 20px; top: 300px; width: 190px; height: 300px; z-index: 40;
  border-radius: 14px; overflow: hidden; background: #0b0f16;
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 18px 44px -20px rgba(0, 0, 0, .85);
  transition: opacity .25s ease, transform .25s ease;
}
.ad-rail[hidden] { display: none !important; }
.ad-rail.is-scrolled { opacity: 0; transform: translateY(-12px); pointer-events: none; }
.ad-rail .ad-carousel { width: 100%; height: 100%; background: #0b0f16; cursor: grab; }
.ad-rail .ad-slide img { object-fit: cover; }
.ad-rail .ad-x { top: 6px; right: 6px; }
.ad-rail .ad-dots {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  display: flex; gap: 6px; padding: 4px 7px; border-radius: 999px;
  background: rgba(6, 10, 17, .45); z-index: 3;
}
.ad-rail .ad-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .5); cursor: pointer; }
.ad-rail .ad-dots i.on { background: #fff; }

/* 窄屏：右侧竖幅和顶栏中间位都不显示，避免挤压 */
@media (max-width: 1719px) { .ad-rail { display: none !important; } }
@media (max-width: 760px) { .sh-admid { display: none !important; } }

/* 顶栏「首页」标题隐藏（2026-11-21 站长要求）：广告位占满标题与按钮之间的空间 */
#shTopTitle { display: none !important; }
