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

/* 遮罩：高于底栏，尽量铺满安全区；透明度由 layer shade:[0.78,'#000'] 控制，勿在此写死 opacity */
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;
  top: calc(-1 * env(safe-area-inset-top, 0px)) !important;
  left: calc(-1 * env(safe-area-inset-left, 0px)) !important;
  right: calc(-1 * env(safe-area-inset-right, 0px)) !important;
  bottom: calc(-1 * env(safe-area-inset-bottom, 0px)) !important;
  width: auto !important;
  height: auto !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: 100% !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: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
  overflow: visible;
}
.wb-pop{
  --accent: var(--wb-accent, #2563eb);
  --accent2: var(--wb-accent2, #4f46e5);
  width: 100%;
  flex: 1 1 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),
    0 0 0 1px rgba(255, 255, 255, 0.4) inset;
  background: var(--wb-surface, #ffffff);
  color: var(--wb-text, #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),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  background: var(--wb-surface, #141824);
  color: var(--wb-text, #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;
}
.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-ext-close{
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  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;
  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{
  flex: 0 0 auto;
  height: 3px;
  margin: 0 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0.9;
}

.wb-pop__body{
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 14px 16px 8px;
  -webkit-overflow-scrolling: touch;
}
.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: flex;
  gap: 8px;
  padding: 12px 16px 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: var(--wb-surface, #ffffff);
}
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;
}
.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-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); }
