/* 前台统一弹窗：系统消息 / 弹窗公告共用一套样式；广告弹窗另见文末 */

/* 遮罩：铺满网页可视区；系统状态栏/浏览器底栏属于浏览器壳，网页无法覆盖 */
html.wb-popup-open .layui-layer-shade.wb-pop-shade,
body.wb-popup-open .layui-layer-shade.wb-pop-shade,
.layui-layer-shade.wb-pop-shade{
  z-index: 99999990 !important;
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  margin: 0 !important;
  /* 外扩阴影填安全区缝隙，避免顶底露白（不同弹窗表现不一致时尤其明显） */
  box-shadow:
    0 0 0 env(safe-area-inset-top, 0px) #000,
    0 0 0 env(safe-area-inset-bottom, 0px) #000,
    0 0 0 100vmax #000 !important;
}
html.wb-popup-open .wb-statusbar{
  background: #000 !important;
  z-index: 1 !important;
}
html.wb-popup-open .layui-layer.wb-pop-layer,
html.wb-popup-open .layui-layer.myui-popup-layer,
html.wb-popup-open .layui-layer.wb-ads-pop-layer,
body.wb-popup-open .layui-layer.wb-pop-layer,
body.wb-popup-open .layui-layer.myui-popup-layer,
body.wb-popup-open .layui-layer.wb-ads-pop-layer{
  z-index: 99999991 !important;
}

/* —— 统一卡片壳（关闭钮在卡片下方，同广告弹窗） —— */
.layui-layer.wb-pop-layer,
.layui-layer.wb-pop-layer--shell{
  border: 0 !important;
  border-radius: 0 !important;
  overflow: visible !important;
  box-shadow: none !important;
  background: transparent !important;
  transform-origin: 50% 20%;
}
.layui-layer.wb-pop-layer .layui-layer-content,
.layui-layer.wb-pop-layer--shell .layui-layer-content{
  padding: 0 !important;
  background: transparent !important;
  overflow: visible !important;
  height: auto !important;
}
.layui-layer.wb-pop-layer.wb-pop-anim{
  animation: wbPopupIn .28s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes wbPopupIn{
  0%{ opacity:0; transform: translateY(14px) scale(.97); }
  100%{ opacity:1; transform: translateY(0) scale(1); }
}

.wb-pop-shell{
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
  overflow: visible;
  background: transparent;
}
.wb-pop{
  --accent: var(--wb-accent, #2563eb);
  --accent2: var(--wb-accent2, #4f46e5);
  width: 100%;
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 24px 64px -20px rgba(15, 23, 42, 0.42);
  background: #ffffff !important;
  color: #0f172a;
}
html.theme-dark .wb-pop{
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 64px -16px rgba(0, 0, 0, 0.7);
  background: #141824 !important;
  color: #f1f5f9;
}

.wb-pop__head{
  flex: 0 0 auto;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 12px 18px 10px;
  box-sizing: border-box;
  background: #ffffff;
}
.wb-pop__head-title{
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: var(--wb-text, #0f172a);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
html.theme-dark .wb-pop__head-title{ color: var(--wb-text, #f1f5f9); }

.wb-pop__x{ display: none !important; }
.wb-pop-ext-close{
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #fff;
  background: transparent;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
  box-shadow: none;
  outline: none;
}
.wb-pop-ext-close:hover{ background: rgba(0, 0, 0, 0.28); }

/* 兼容旧顶栏关闭样式（若仍有残留） */
.wb-pop__close{ display: none !important; }

.wb-pop__accent{ display: none !important; }

.wb-pop__body{
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 14px 16px 16px;
  -webkit-overflow-scrolling: touch;
  background: #ffffff;
}
.wb-pop__title{
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 10px;
  color: var(--wb-text, #0f172a);
  position: relative;
  padding-left: 12px;
}
html.theme-dark .wb-pop__title{ color: var(--wb-text, #f1f5f9); }
.wb-pop__title:before{
  content: '';
  position: absolute;
  left: 0;
  top: 0.3em;
  width: 3px;
  height: 1.05em;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent2));
}

.wb-pop__content{
  font-size: 14px;
  line-height: 1.75;
  color: var(--wb-muted, #475569);
  word-break: break-word;
}
html.theme-dark .wb-pop__content{ color: var(--wb-muted, #cbd5e1); }
.wb-pop__content img{
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
}
.wb-pop__img{
  text-align: center;
}
.wb-pop__img img{
  margin: 0 auto;
}
.wb-pop__empty{
  color: var(--wb-muted, rgba(100, 116, 139, 0.85));
}
.wb-pop__content a{
  color: var(--wb-accent, #2563eb);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.wb-pop__content pre,
.wb-pop__content code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.wb-pop__content pre{
  background: var(--wb-surface-2, rgba(15, 23, 42, 0.04));
  border-radius: 10px;
  padding: 10px 12px;
  overflow: auto;
}
.wb-pop__content code{
  background: var(--wb-surface-2, rgba(15, 23, 42, 0.04));
  padding: 1px 6px;
  border-radius: 6px;
}

.wb-pop__foot{
  flex: 0 0 auto;
  display: none;
  gap: 8px;
  padding: 12px 16px 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: #ffffff;
}
.wb-pop__foot.is-on{ display: flex; }
.wb-pop__foot[hidden]{ display: none !important; }
html.theme-dark .wb-pop__foot{
  border-top-color: rgba(255, 255, 255, 0.08);
  background: var(--wb-surface, #141824);
}
.wb-pop__btn{
  flex: 1 1 0;
  min-width: 0;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  border: none;
  box-sizing: border-box;
  transition: transform .14s ease, filter .14s ease, background .14s ease;
}
.wb-pop__btn:active{ transform: scale(.98); }
.wb-pop__btn--ghost{
  background: var(--wb-surface-2, rgba(15, 23, 42, 0.05));
  color: var(--wb-text, #0f172a) !important;
}
html.theme-dark .wb-pop__btn--ghost{
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92) !important;
}
.wb-pop__btn--ghost:hover{
  background: rgba(15, 23, 42, 0.08);
}
html.theme-dark .wb-pop__btn--ghost:hover{
  background: rgba(255, 255, 255, 0.12);
}
.wb-pop__btn--primary{
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff !important;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 28%, transparent);
}
.wb-pop__btn--primary:hover{ filter: brightness(1.04); }

/* 兼容旧按钮类名（若缓存未刷新） */
.wb-pop__btn--accent{
  background: var(--wb-surface-2, rgba(15, 23, 42, 0.05));
  color: var(--wb-text, #0f172a) !important;
}

/* 广告弹窗：图片态透明壳 + 底部关闭钮 */
.layui-layer.wb-ads-pop-layer{
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  overflow: visible !important;
  height: auto !important;
  animation: none !important;
  /* 强制视口居中（避免滚动条/图片加载后高度变化导致偏移） */
  left: 50% !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  margin: 0 !important;
  transform: translate(-50%, -50%) !important;
}
.layui-layer.wb-ads-pop-layer .layui-layer-content{
  background: transparent !important;
  overflow: visible !important;
  padding: 0 !important;
  height: auto !important;
}
.wb-ads-pop-shell{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  overflow: visible;
}
.wb-ads-pop-wrap{
  border-radius: var(--wb-radius-card, 8px) !important;
  overflow: hidden;
}
.wb-ads-pop-wrap img{
  border-radius: inherit;
}
.wb-ads-pop-close{
  width: 40px;
  height: 40px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 2px solid #fff;
  background: transparent;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: none;
  outline: none;
}
.wb-ads-pop-close:hover{ background: rgba(0, 0, 0, 0.28); }
