/* =========================================================
   首页广告位（轮播 / 文字广告）与广告投放页样式
   依赖 style.css 的 CSS 变量（--blue / --line / --muted 等）
   ========================================================= */

/* ---------- 首页轮播 ---------- */
.adband { padding: 16px 0 2px; }

.ad-slider {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(120deg, #0d2a63, #1a5cff);
  aspect-ratio: 10 / 3;
  box-shadow: var(--shadow);
}

.ad-slide {
  position: absolute;
  inset: 0;
  display: block;
  opacity: 0;
  pointer-events: none;
  transition: opacity .55s ease;
  color: #fff;
  text-decoration: none;
}

.ad-slide.is-active { opacity: 1; pointer-events: auto; z-index: 1; }

.ad-slide__img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ad-slide__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(5, 16, 38, .78) 0%, rgba(5, 16, 38, .35) 56%, rgba(5, 16, 38, .04) 100%);
}

.ad-slide__body {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
  max-width: 76%;
  padding: 22px 26px;
  display: block;
}

.ad-slide__body strong {
  display: block;
  font-size: 22px;
  line-height: 1.35;
  color: #fff;
  letter-spacing: .01em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}

.ad-slide__body small {
  display: block;
  margin-top: 6px;
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .86);
}

.ad-slide__cta {
  display: inline-block;
  margin-top: 10px;
  font-style: normal;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .28);
  padding: 4px 11px;
  border-radius: 999px;
  backdrop-filter: blur(2px);
}

.ad-flag {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 3;
  font-size: 11px;
  line-height: 1.6;
  color: #fff;
  background: rgba(0, 0, 0, .42);
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: .08em;
}

.ad-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .84);
  color: #0d1b2a;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  opacity: .82;
  transition: opacity .2s ease;
}

.ad-arrow:hover { opacity: 1; }
.ad-arrow--prev { left: 10px; }
.ad-arrow--next { right: 10px; }

.ad-dots {
  position: absolute;
  right: 18px;
  bottom: 12px;
  z-index: 4;
  display: flex;
  gap: 6px;
}

.ad-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .45);
  cursor: pointer;
  transition: width .2s ease, background .2s ease;
}

.ad-dot.is-active { width: 20px; border-radius: 999px; background: #fff; }

.adband__note { margin: 8px 2px 0; font-size: 12px; color: var(--muted); }
.adband__note a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- 空广告位占位（广告位招租） ---------- */
.ad-slide--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(120deg, #f2f6ff, #dfe9ff);
  color: #1a5cff;
}

.ad-slide--empty .ad-slide__shade,
.ad-slide--empty .ad-slide__body { display: none; }

.ad-slide__empty { display: block; text-align: center; padding: 10px 20px; }
.ad-slide__empty strong {
  display: block;
  font-size: 20px;
  letter-spacing: .1em;
  color: #1a5cff;
}
.ad-slide__empty small { display: block; margin-top: 6px; font-size: 12.5px; color: #5b6b85; }
.ad-slide__empty .ad-slide__cta {
  margin-top: 9px;
  color: #1a5cff;
  background: rgba(26, 92, 255, .1);
  border-color: rgba(26, 92, 255, .26);
}
.ad-slide--empty .ad-flag { background: rgba(26, 92, 255, .12); color: #1a5cff; }

/* ---------- 文字广告条 ---------- */
.adtext { padding: 10px 0 0; }

.adtext__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  background: #fbfcff;
  border-radius: 12px;
  padding: 9px 12px;
}

.adtext__label {
  flex: 0 0 auto;
  font-size: 11px;
  line-height: 1.7;
  color: #fff;
  background: #94a7c6;
  padding: 1px 7px;
  border-radius: 5px;
  letter-spacing: .08em;
}

.adtext__list { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 auto; min-width: 0; }

.adtext__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  background: var(--ad-bg, #eef4ff);
  color: var(--ad-fg, #1a5cff);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: transform .15s ease;
}

.adtext__item:hover { transform: translateY(-1px); }
.adtext__item strong { font-weight: 600; white-space: nowrap; }
.adtext__item span { font-weight: 400; font-size: 12.5px; opacity: .78; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adtext__item i { font-style: normal; opacity: .55; }

/* 空文字位：白底虚线圈出，提示可租 */
.adtext__item--empty {
  background: #fff;
  color: #5b6b85;
  border: 1px dashed #b9c8e4;
  font-weight: 600;
}
.adtext__item--empty strong { color: #1a5cff; }

.adtext__more { flex: 0 0 auto; font-size: 12.5px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.adtext__more:hover { color: var(--blue); }

/* ---------- 广告投放页 ---------- */
.page-head--ad { background: linear-gradient(180deg, #eef4ff, #fff); }

.adslot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.adslot-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 14px;
  box-shadow: var(--shadow);
}

.adslot-card h2 { font-size: 17px; margin: 12px 0 6px; color: var(--ink); }
.adslot-card p { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.65; }
.adslot-card__price { margin-top: 8px !important; font-weight: 700; color: var(--blue) !important; }

.adslot-card__preview {
  position: relative;
  height: 104px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12.5px;
  letter-spacing: .06em;
  overflow: hidden;
}

.adslot-card__preview--banner { background: linear-gradient(120deg, #0d2a63, #1a5cff 70%, #6aa7ff); }
.adslot-card__preview--text { background: linear-gradient(120deg, #eef4ff, #dbe7ff); color: #1a5cff; }

.adslot-card__flag {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 10.5px;
  background: rgba(0, 0, 0, .32);
  padding: 1px 7px;
  border-radius: 5px;
}

.adslot-card__preview--text .adslot-card__flag { background: rgba(26, 92, 255, .16); color: #1a5cff; }

.form-card__title { font-size: 17px; margin: 0 0 14px; color: var(--ink); }

/* 套餐卡片在广告投放页沿用 .plan-card，仅移除“承诺时效”占位高度差异 */
#planList .plan-card[hidden] { display: none; }

/* =========================================================
   首页广告三段式（公告下方滚动条 / 顶部横幅竖排 / 彩色方块）
   ========================================================= */

/* ---------- 滚动文字条 ---------- */
.adline { padding: 12px 0 0; }

.adline__box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(79, 123, 255, .95), rgba(255, 122, 192, .95));
  box-shadow: 0 6px 18px rgba(79, 123, 255, .16);
}

.adline__tag {
  flex: 0 0 auto;
  font-size: 11px;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 5px;
  color: #4f7bff;
  background: rgba(255, 255, 255, .92);
  letter-spacing: .06em;
}

.adline__viewport { flex: 1 1 auto; min-width: 0; overflow: hidden; }

.adline__track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  will-change: transform;
  animation: adline-scroll 28s linear infinite;
}

.adline:hover .adline__track { animation-play-state: paused; }

.adline__item {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  line-height: 42px;
  color: #fff;
  text-decoration: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .14);
}

.adline__item--rent { font-weight: 600; }

@keyframes adline-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- 顶部横幅（竖排堆叠，不做轮播） ---------- */
.adbanners { padding: 10px 0 0; }

.adbanners .container { display: flex; flex-direction: column; gap: 10px; }

.adbanner {
  position: relative;
  display: block;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(120deg, #0d2a63, #1a5cff);
  text-decoration: none;
  transition: filter .15s ease;
}

.adbanner:hover { filter: brightness(1.03); }
.adbanner__img { display: block; width: 100%; height: auto; }

.adbanner__text { display: block; padding: 20px 22px; color: #fff; }
.adbanner__text strong { display: block; font-size: 20px; line-height: 1.35; }
.adbanner__text small { display: block; margin-top: 5px; font-size: 13px; color: rgba(255, 255, 255, .84); }

.adbanner .ad-flag {
  position: absolute;
  top: 8px;
  right: 10px;
  font-style: normal;
  font-size: 11px;
  line-height: 1.6;
  color: #fff;
  background: rgba(0, 0, 0, .4);
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: .06em;
}

.adbanner--empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 26px 16px;
  border: 1px dashed #b9c8e4;
  background: linear-gradient(120deg, #f5f8ff, #eef3ff);
  text-align: center;
}

.adbanner--empty strong { font-size: 18px; letter-spacing: .08em; color: #1a5cff; }
.adbanner--empty small { font-size: 12.5px; color: #5b6b85; }

/* ---------- 文字广告：彩色方块网格 ---------- */
.adgrid { padding: 12px 0 0; }

.adgrid__box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.adgrid__cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 62px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--cell-bg, #2563eb);
  color: var(--cell-fg, #fff);
  text-align: center;
  text-decoration: none;
  transition: transform .15s ease, filter .15s ease;
}

.adgrid__cell:hover { transform: translateY(-1px); filter: brightness(1.06); }

.adgrid__cell strong {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.adgrid__cell small {
  font-size: 12px;
  font-weight: 400;
  opacity: .86;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.adgrid__cell--rent strong { letter-spacing: .02em; }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  .adline__box { height: 38px; padding: 0 10px; border-radius: 9px; }
  .adline__item { font-size: 13px; line-height: 38px; }
  .adbanner__text strong { font-size: 16.5px; }
  .adbanner__text small { font-size: 12px; }
  .adbanner--empty { padding: 20px 14px; }
  .adgrid__cell { min-height: 56px; }
  .adgrid__cell strong { font-size: 13.5px; }
  .adgrid__cell small { font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .ad-slide, .ad-dot, .adtext__item, .adgrid__cell { transition: none !important; }
  .adline__track { animation: none !important; }
}

@media (max-width: 760px) {
  .ad-slider { aspect-ratio: 16 / 9; border-radius: 14px; }
  .ad-slide__body { max-width: 86%; padding: 14px 16px; }
  .ad-slide__body strong { font-size: 16.5px; }
  .ad-slide__body small { font-size: 12px; margin-top: 4px; }
  .ad-slide__cta { margin-top: 7px; font-size: 11.5px; padding: 3px 9px; }
  .ad-arrow { width: 28px; height: 28px; font-size: 17px; }
  .ad-arrow--prev { left: 6px; }
  .ad-arrow--next { right: 6px; }
  .ad-flag { top: 7px; right: 8px; font-size: 10px; }
  .ad-dots { right: 10px; bottom: 8px; }
  .adslot-grid { grid-template-columns: 1fr; }
  .adslot-card__preview { height: 88px; }
  .adtext__bar { padding: 8px 10px; gap: 8px; }
  .adtext__list { gap: 6px; }
  .adtext__item { font-size: 12.5px; padding: 4px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .ad-slide, .ad-dot, .adtext__item { transition: none !important; }
}