/* Tipsy Ad Zones — 唯一正式：slot 决定比例与边界，creative 在 slot 内适配 */
.tipsy-ad-zone {
  display: block;
  contain: layout style;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* Phase H1：无广告即塌缩，不占布局空间 */
.tipsy-ad-zone.tipsy-ad-zone--empty {
  display: none;
  height: 0;
  min-height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

/* 空槽坍塌：无子节点即整槽坍塌，覆盖 Builder inline min-height（未解锁/蜘蛛/无交互） */
.tipsy-ad-zone:empty {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
}

.tipsy-ad-zone > a {
  display: block;
  width: 100%;
  max-width: 100%;
}

.tipsy-ad-zone img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  vertical-align: top;
}

/* ========== Banner-fit：横幅位，插槽先保留比例，素材 contain，不挤版 ========== */
.tipsy-zone-content_banner_stack,
.tipsy-zone-bottom_banner_stack {
  aspect-ratio: 1200 / 300;
}

/* top_banner_stack：纵向堆叠 + 紧贴导流条节奏（内 1–2px，外 4–6px） */
/* 首屏预算预留高度，减少 CLS；JS 会按条数写入 min-height */
.tipsy-zone-top_banner_stack[data-tipsy-banner-budget="1"] {
  min-height: 80px;
}
.tipsy-zone-top_banner_stack[data-tipsy-banner-budget="2"] {
  min-height: 160px;
}
@media (min-width: 769px) {
  .tipsy-zone-top_banner_stack[data-tipsy-banner-budget="1"] {
    min-height: 100px;
  }
  .tipsy-zone-top_banner_stack[data-tipsy-banner-budget="2"] {
    min-height: 200px;
  }
}
.tipsy-zone-top_banner_stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: visible;
  aspect-ratio: auto;
  margin: 5px 0;
}

.tipsy-zone-top_banner_stack > a {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: var(--tipsy-ad-ar, 1200 / 300);
}

.tipsy-zone-top_banner_stack > a,
.tipsy-zone-content_banner_stack > a,
.tipsy-zone-bottom_banner_stack > a {
  height: 100%;
  min-height: 0;
}

.tipsy-zone-top_banner_stack > a {
  height: auto;
}

.tipsy-zone-top_banner_stack img,
.tipsy-zone-content_banner_stack img,
.tipsy-zone-bottom_banner_stack img {
  height: 100%;
  object-fit: contain;
}

@media (max-width: 768px) {
  .tipsy-zone-content_banner_stack,
  .tipsy-zone-bottom_banner_stack {
    aspect-ratio: 320 / 100;
  }
  .tipsy-zone-top_banner_stack {
    gap: 1px;
    margin: 4px 0;
  }

  .tipsy-zone-top_banner_stack > a {
    aspect-ratio: var(--tipsy-ad-ar, 320 / 100);
  }
}

/* ========== Card-fill：卡片/宫格位，固定比例，素材 cover，可裁切 ========== */
.tipsy-zone-lead_card_grid,
.tipsy-zone-top_pinned_trio,
.tipsy-zone-home_card_grid_stack,
.tipsy-zone-list_card_grid_stack {
  aspect-ratio: 1 / 1;
}

.tipsy-zone-lead_card_grid > a,
.tipsy-zone-top_pinned_trio > a,
.tipsy-zone-home_card_grid_stack > a,
.tipsy-zone-list_card_grid_stack > a {
  height: 100%;
  min-height: 0;
}

.tipsy-zone-lead_card_grid img,
.tipsy-zone-top_pinned_trio img,
.tipsy-zone-home_card_grid_stack img,
.tipsy-zone-list_card_grid_stack img {
  height: 100%;
  object-fit: cover;
}

/* ========== Float-capped：浮层位，安全上限 ========== */
.tipsy-zone-left_float_stack,
.tipsy-zone-right_float_stack {
  aspect-ratio: 1 / 1;
  max-width: 120px;
  max-height: 120px;
}

.tipsy-zone-left_float_stack > a,
.tipsy-zone-right_float_stack > a {
  height: 100%;
  min-height: 0;
}

.tipsy-zone-left_float_stack img,
.tipsy-zone-right_float_stack img {
  height: 100%;
  object-fit: contain;
}

/* ========== tag_text_wall：发现词/推荐词墙，固定栅格短标签墙，暗色融合 ========== */
.tipsy-zone-tag_text_wall {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px;
  background: #1b1b1d;
  border: 1px solid #2d2d2d;
  border-radius: 10px;
  box-sizing: border-box;
}

.tipsy-zone-tag_text_wall > a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 0;
  min-height: 36px;
  padding: 6px 12px;
  background: #252528;
  border: 1px solid #333;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  line-height: 22px;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
  transition: background 0.2s, border-color 0.2s;
}

.tipsy-zone-tag_text_wall > a:hover {
  background: #2d2d30;
  border-color: #404040;
}

.tipsy-zone-tag_text_wall > a:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.tipsy-zone-tag_text_wall > a:active {
  background: #222224;
}

@media (max-width: 1024px) {
  .tipsy-zone-tag_text_wall {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .tipsy-zone-tag_text_wall {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 12px;
  }
  .tipsy-zone-tag_text_wall > a {
    font-size: 12px;
    line-height: 20px;
    min-height: 32px;
    padding: 5px 10px;
  }
}

.missav-sidebar .tipsy-zone-tag_text_wall {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 14px;
}

.missav-sidebar .tipsy-zone-tag_text_wall > a {
  font-size: 12px;
  padding: 5px 10px;
  min-height: 32px;
}

@media (max-width: 768px) {
  .missav-sidebar .tipsy-zone-tag_text_wall {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 10px 12px;
  }
  .missav-sidebar .tipsy-zone-tag_text_wall > a {
    padding: 5px 8px;
  }
}
