/**
 * 广告位样式（独立文件，不覆盖任何现有类）
 * 阚荣浩 2026-11-14
 *
 * 变体：v-bar（顶部横幅）/ v-slim（底部条）/ v-card（左侧竖卡）/ v-hero（登录页大图）/ v-rail（官网侧边竖幅）
 */

.bs-ad { display: none; }
.bs-ad.on { display: block; }

.bs-ad-box { position: relative; }
.bs-ad-stage { position: relative; overflow: hidden; }
.bs-ad-slide {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transition: opacity .45s ease, visibility .45s;
}
.bs-ad-slide.on { opacity: 1; visibility: visible; }

/* 通用小元素 */
.bs-ad-tag {
  flex: 0 0 auto;
  padding: 0 5px; height: 17px; line-height: 17px;
  font-size: 11px; border-radius: 4px;
  color: #0d9488; background: #dcf3ee;
}
.bs-ad-x {
  position: absolute; top: 6px; right: 8px; z-index: 3;
  width: 20px; height: 20px; line-height: 20px; text-align: center;
  font-size: 11px; font-style: normal; color: #9fb0ac;
  border-radius: 50%; cursor: pointer; transition: .16s;
}
.bs-ad-x:hover { color: #5b6b68; background: rgba(0, 0, 0, .06); }

/* 圆点 */
.bs-ad-dots {
  position: absolute; z-index: 3; left: 50%; transform: translateX(-50%);
  bottom: 5px; display: flex; align-items: center; gap: 5px;
}
.bs-ad-dots i {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(13, 148, 136, .28); cursor: pointer; transition: .2s;
}
.bs-ad-dots i.on { width: 13px; border-radius: 3px; background: #16baaa; }

/* ============ v-bar：播音台顶部横幅 ============ */
.v-bar .bs-ad-stage { min-height: 46px; }
.v-bar { background: linear-gradient(90deg, #f1fbf9, #eef8f6 55%, #f8fdfc); border-bottom: 1px solid #ddf0eb; }
.v-bar .bs-ad-slide {
  display: flex; align-items: center; gap: 11px;
  padding: 7px 40px 7px 18px;
  font-size: 13px; color: #1f2d2b; line-height: 1.45;
}
.v-bar .bs-ad-img {
  width: 46px; height: 32px; flex: 0 0 auto;
  border-radius: 6px; object-fit: cover; display: block; background: #e8f4f1;
}
.v-bar .bs-ad-ico {
  flex: 0 0 auto; width: 26px; height: 26px; line-height: 26px; text-align: center;
  border-radius: 8px; font-size: 15px; color: #0d9488; background: #dcf3ee;
}
.bs-ad-body { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; }
.bs-ad-title {
  min-width: 0; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bs-ad-cta {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 2px;
  height: 27px; padding: 0 11px; border-radius: 999px;
  background: #16baaa; color: #fff; font-size: 12.5px;
}
.bs-ad-cta .layui-icon { font-size: 11px; }

/* ============ v-slim：播音台底部条 ============ */
.v-slim .bs-ad-stage { min-height: 38px; }
.v-slim { background: #f7fdfc; border-top: 1px solid #ddf0eb; }
.v-slim .bs-ad-slide {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 40px 5px 16px;
  font-size: 12.5px; color: #1f2d2b;
}
.v-slim .bs-ad-img { width: 34px; height: 24px; border-radius: 5px; object-fit: cover; flex: 0 0 auto; }
.v-slim .bs-ad-ico { flex: 0 0 auto; font-size: 14px; color: #0d9488; }
.v-slim .bs-ad-cta { height: 24px; padding: 0 9px; font-size: 12px; }
.v-slim .bs-ad-dots { bottom: 2px; }

/* ============ v-card：播音台左侧竖卡 ============ */
/* 阚荣浩 2026-11-20：
   原来卡片紧贴导航项下方、下面是三百多像素空白（上下失衡），
   宽度又被 margin 缩进 10px，比导航项窄一圈（左右也显得缩）。
   现在：
     · 容器 #ad-side 撑满「导航项」与「底部快捷项」之间的空白，卡片在其中左右 + 上下居中；
     · 卡片高度 clamp(180px, 26vh, 260px)，比原来的 132px 高一截，图片区随之变高；
     · 圆点从卡片底部（压着标题）挪到图片左上角。 */
#ad-side.on {
  flex: 1 1 auto;          /* 吃掉导航与底部快捷项之间的全部空白 */
  min-height: 0;
  display: flex;
  align-items: center;     /* 上下居中 */
  justify-content: center; /* 左右居中 */
}

#ad-side.v-card { margin: 0; }   /* 去掉 10px 缩进，与导航项同宽 */

#ad-side .bs-ad-box {
  width: 100%;
  height: clamp(180px, 26vh, 260px);
  max-height: 100%;       /* 矮屏收着放，不越界压到导航项/底部快捷项 */
}

#ad-side .bs-ad-stage { height: 100%; min-height: 0; }

#ad-side .bs-ad-slide {
  display: flex; flex-direction: column;
  border: 1px solid #e2eeeb; border-radius: 12px; overflow: hidden; background: #fff;
}

/* 图片吃掉「除标题区以外」的全部高度，卡片变高时图跟着变高 */
#ad-side .bs-ad-img {
  width: 100%; height: auto; flex: 1 1 auto; min-height: 0;
  object-fit: cover; display: block;
}
#ad-side .bs-ad-ico {
  flex: 1 1 auto; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #0d9488; background: linear-gradient(135deg, #eafaf7, #dcf3ee);
}
#ad-side .bs-ad-body { flex: 0 0 auto; display: block; padding: 8px 10px 9px; }
#ad-side .bs-ad-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 4px;
  font-size: 13px; font-weight: 600; line-height: 1.4; white-space: normal;
}

/* 圆点移到图片顶部居中：原来在卡片底部，正好压住标题文字；
   不放左上角是因为示例图的角标也在这里，容易叠字 */
#ad-side .bs-ad-dots {
  left: 50%; right: auto; top: 8px; bottom: auto;
  transform: translateX(-50%); z-index: 3;
}
#ad-side .bs-ad-dots i { background: rgba(255, 255, 255, .62); box-shadow: 0 0 0 1px rgba(0, 0, 0, .10); }
#ad-side .bs-ad-dots i.on { background: #fff; }

/* 关闭按钮落在图片上，给个白底才看得清 */
#ad-side .bs-ad-x {
  color: #5b6b68; background: rgba(255, 255, 255, .86);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}

/* 卡片整体可点，不再放按钮（放了会和标题抢位置） */
.v-card .bs-ad-cta { display: none; }
.v-card .bs-ad-slide { cursor: pointer; }
#ad-side .bs-ad-slide:hover { border-color: #bfe4df; box-shadow: 0 6px 18px rgba(13, 148, 136, .12); }

/* 侧栏收成 74px 图标栏（≤1180）时，卡片只剩一条窄缝，文字全挤碎 → 直接不展示 */
@media (max-width: 1180px) {
  #ad-side.on { display: none !important; }
}
/* 视口太矮（≤690）时导航项 + 底部快捷项已占满，卡片连 180 都放不下 → 不展示 */
@media (max-height: 690px) {
  #ad-side.on { display: none !important; }
}

/* ============ v-hero：登录/注册页左侧图片卡 ============ */
/* 阚荣浩 2026-11-15：不再整块覆盖左栏。
   原来这一层是 z-index:2 的不透明卡片，把左栏原有的 logo / 标题 / 卖点 / 页脚全盖掉了，
   登录页默认文案一个字都看不到。现在改成「品牌文案在上 + 广告图在下方一张卡」的流式布局，
   文案默认完整展示，广告图退化成一块图卡（自带标题与圆点）。 */
#ad-login.v-hero, .v-hero { position: relative; inset: auto; z-index: 1; }
.v-hero .bs-ad-box { position: relative; margin-top: 26px; }
.v-hero .bs-ad-stage {
  position: relative; overflow: hidden;
  height: clamp(160px, 27vh, 320px);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(4, 20, 24, .30);
}
.v-hero .bs-ad-slide { display: block; }
.v-hero .bs-ad-cover {
  width: 100%; height: 100%; display: block;
  object-fit: cover; object-position: center 42%;
}
.v-hero .bs-ad-cover-ph { background: linear-gradient(135deg, #0f766e, #134e4a 60%, #0b3b38); }
.v-hero .bs-ad-hero-body {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 34px 16px 13px;
  background: linear-gradient(180deg, rgba(6, 22, 22, 0), rgba(6, 22, 22, .84));
  color: #fff;
}
.v-hero .bs-ad-hero-body b {
  display: block; margin-top: 5px;
  font-size: 15px; line-height: 1.4; font-weight: 600; letter-spacing: .1px;
}
.v-hero .bs-ad-tag { background: rgba(22, 186, 170, .22); color: #7ff0e2; }
.v-hero .bs-ad-more {
  display: inline-flex; align-items: center; gap: 2px;
  margin-top: 6px; font-size: 12px; color: #7ff0e2;
}
.v-hero .bs-ad-more .layui-icon { font-size: 11px; }
.v-hero .bs-ad-x { color: rgba(255, 255, 255, .72); }
.v-hero .bs-ad-x:hover { color: #fff; background: rgba(255, 255, 255, .16); }
/* 圆点放右上角，避开底部标题与 CTA */
.v-hero .bs-ad-dots {
  left: auto; right: 34px; top: 6px; bottom: auto; transform: none;
  height: 20px; z-index: 3;
}
.v-hero .bs-ad-dots i { background: rgba(255, 255, 255, .38); }
.v-hero .bs-ad-dots i.on { background: #fff; }

/* 矮屏（笔记本）空间紧张：图卡压扁一点，保证原来的版权行不被挤出可视区 */
@media (max-height: 820px) {
  .v-hero .bs-ad-stage { height: 160px; }
  .v-hero .bs-ad-box { margin-top: 16px; }
  .v-hero .bs-ad-hero-body { padding: 28px 15px 11px; }
  .v-hero .bs-ad-hero-body b { font-size: 14px; }
}
/* 更扁的屏（≤700 高）：只留「推广 + 标题」，点击整卡也能跳 */
@media (max-height: 700px) {
  .v-hero .bs-ad-stage { height: 108px; }
  .v-hero .bs-ad-box { margin-top: 10px; }
  .v-hero .bs-ad-cover { object-position: center 68%; }
  .v-hero .bs-ad-hero-body { padding: 20px 13px 8px; }
  .v-hero .bs-ad-hero-body b { font-size: 12.5px; margin-top: 2px; }
  .v-hero .bs-ad-more { display: none; }
}

/* ============ v-rail：官网首页左右竖幅 ============ */
/* 阚荣浩 2026-11-19：竖幅原来 110×420，图被裁成细条、标题挤到 3 行还被切掉末字。
   现在改成 130×392（约 1:3 竖幅），标题最多 2 行、12px，底部留白也收紧一点。 */
.v-rail .bs-ad-stage { min-height: 392px; height: 392px; }
.v-rail .bs-ad-slide { display: block; border-radius: 12px; overflow: hidden; }
.v-rail .bs-ad-cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.v-rail .bs-ad-cover-ph { background: linear-gradient(160deg, #eafaf7, #cdeee8 70%, #dcf3ee); }
.v-rail .bs-ad-hero-body {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 11px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .97) 34%);
}
.v-rail .bs-ad-hero-body b {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 5px;
  font-size: 12px; line-height: 1.38; font-weight: 600; color: #1f2d2b;
}
.v-rail .bs-ad-more { display: none; }
.v-rail .bs-ad-x { background: rgba(255, 255, 255, .82); }
/* 竖幅点击是「放大看」，鼠标给个放大镜手势，客户才知道能点 */
.v-rail .bs-ad-slide { cursor: zoom-in; }

/* 官网两侧竖幅容器（≥1500px 才出现，避免压内容）
   阚荣浩 2026-11-19（二改）：原来 top:116 贴顶、left: calc(50vw - 732px) 贴正文，
   屏幕越宽竖幅越靠正文、离屏幕边缘越远，看着像贴在正文边上的补丁。
   现在：
     上下 —— 视口垂直居中（translateY(-50%)），不再头顶一条、下面空一大截；
     左右 —— 居中于「正文与屏幕边缘之间那条空白带」，不再跟正文粘在一起。
   空白带中心 = 25vw - 290（正文 1160 + 两侧留白），竖幅半宽 65 → left = 25vw - 355。
     1500 宽：20px ｜ 1920 宽：125px ｜ 2560 宽：285px，两侧留白永远对称。 */
.bs-ad-side-rail {
  position: fixed;
  top: 50%;
  width: 130px;
  z-index: 20;
  transform: translateY(-50%);
  display: none !important;
}
.bs-ad-side-rail.left  { left: max(24px, calc(25vw - 355px)); }
.bs-ad-side-rail.right { right: max(24px, calc(25vw - 355px)); }

/* 柔和阴影 + 1px 描边（用 box-shadow 画，不改盒宽），让它像页面上的一块卡，不是贴上去的补丁 */
.bs-ad-side-rail .bs-ad-slide {
  box-shadow: 0 12px 32px rgba(23, 35, 61, .07), 0 0 0 1px rgba(23, 35, 61, .05);
}

@media (min-width: 1500px) {
  .bs-ad-side-rail.on { display: block !important; }
}

/* 1500~1559：空白带只有 170~200px，130 宽塞进去只剩 20px 余量、看着贴正文。
   这一段单独收窄到 112（半宽 56 → left = 25vw - 346），两侧留白回到 29px 起；
   1560 以上再回到 130 宽。 */
@media (min-width: 1500px) and (max-width: 1559px) {
  .bs-ad-side-rail { width: 112px; }
  .bs-ad-side-rail.left  { left: calc(25vw - 346px); }
  .bs-ad-side-rail.right { right: calc(25vw - 346px); }
}

/* 竖屏不够高时，竖幅跟着缩短，保证上下留白还在 */
@media (max-height: 780px) {
  .v-rail .bs-ad-stage { min-height: 320px; height: 320px; }
}
@media (max-height: 620px) {
  /* 必须带 .on 才能盖过 min-width 那条 block!important（特异性相同才会失效） */
  .bs-ad-side-rail.on { display: none !important; }
}

/* ============ 窄屏 ============ */
@media (max-width: 640px) {
  .v-bar .bs-ad-slide { padding: 7px 34px 7px 12px; gap: 8px; flex-wrap: wrap; }
  .v-bar .bs-ad-img { width: 38px; height: 26px; }
  .v-bar .bs-ad-title { white-space: normal; }
  .v-bar .bs-ad-body { flex-wrap: wrap; gap: 5px; }
  .v-bar .bs-ad-cta { height: 25px; padding: 0 9px; font-size: 12px; }
  #ad-side, .bs-ad-side-rail { display: none !important; }
}

/* ============ 竖幅点击放大浮层 ============
   阚荣浩 2026-12-04：官网两侧竖幅只有 130px 宽，广告图上的字看不清。
   点一下铺成一张大图；同一位置配了多条时，左右箭头 / 键盘 ← → / 手机左右滑切换。 */
.bs-ad-lb {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 18, 26, .9);
}

.bs-ad-lb.on { display: flex; }

.bs-ad-lb-body {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bs-ad-lb-body img {
  display: block;
  max-width: min(86vw, 460px);
  max-height: 76vh;
  width: auto;
  height: auto;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .55);
}

.bs-ad-lb-cap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  color: #dfe8ee;
  font-size: 13px;
}

.bs-ad-lb-cap b { font-size: 14px; font-weight: 600; color: #fff; }

.bs-ad-lb-go {
  display: inline-block;
  padding: 6px 14px;
  color: #0d9488;
  background: #fff;
  border-radius: 999px;
  font-size: 12.5px;
  text-decoration: none;
}

.bs-ad-lb-go:hover { color: #fff; background: #0d9488; }
.bs-ad-lb-go[hidden] { display: none !important; }

.bs-ad-lb-x {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 3;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(255, 255, 255, .16);
  border: 0;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.bs-ad-lb-x:hover { background: rgba(255, 255, 255, .3); }

.bs-ad-lb-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(255, 255, 255, .14);
  border: 0;
  border-radius: 50%;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background .18s;
}

.bs-ad-lb-nav:hover { background: rgba(255, 255, 255, .3); }
.bs-ad-lb-nav.prev { left: 16px; }
.bs-ad-lb-nav.next { right: 16px; }

.bs-ad-lb-dots {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 22px;
  z-index: 3;
  display: flex;
  gap: 7px;
  justify-content: center;
}

.bs-ad-lb-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .38);
  cursor: pointer;
  transition: .2s;
}

.bs-ad-lb-dots i.on { background: #fff; transform: scale(1.18); }

@media (max-width: 640px) {
  .bs-ad-lb { padding: 16px; }
  .bs-ad-lb-body img { max-width: 100%; max-height: 68vh; }
  .bs-ad-lb-nav { width: 38px; height: 38px; }
  .bs-ad-lb-nav.prev { left: 6px; }
  .bs-ad-lb-nav.next { right: 6px; }
}
