/* =========================
   kefu.css（合并最终版）
   ========================= */

/* 你原来的 */
.layui-card-header {
  background: #404553 !important;
}

.main-im {
  position: fixed;
  right: 0px;
  top: 200px;
  z-index: 100;
  width: 110px;
  height: 270px;
}

.main-im .qq-a {
  display: block;
  width: 106px;
  height: 116px;
  font-size: 14px;
  color: #0484cd;
  text-align: center;
  position: relative;
}

.main-im .qq-a span {
  bottom: 5px;
  position: absolute;
  width: 90px;
  left: 10px;
}

.main-im .qq-hover-c {
  width: 70px;
  height: 70px;
  border-radius: 35px;
  position: absolute;
  left: 18px;
  top: 10px;
  overflow: hidden;
  z-index: 9;
}

.main-im .qq-container {
  position: absolute;
  width: 109px;
  height: 118px;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  border-bottom: 1px solid #dddddd;
  background: url(/res/logo/qq-icon-bg.png) no-repeat center 8px;
}

.main-im .img-qq {
  max-width: 60px;
  display: block;
  position: absolute;
  left: 7px;
  top: 7px;
  transition: all 0.5s;
}

.main-im .im-qq:hover .img-qq {
  max-width: 70px;
  left: 1px;
  top: 8px;
  position: absolute;
}

.main-im .im_main {
  background: #F9FAFB;
  border: 1px solid #dddddd;
  border-radius: 10px;
}

.main-im .im_main .im-tel {
  color: #000000;
  text-align: center;
  width: 109px;
  height: 125px;
  border-bottom: 1px solid #dddddd;
}

.main-im .im_main .im-tel div {
  font-weight: bold;
  font-size: 13px;
  margin-top: 6px;
}

.main-im .im_main .im-tel .tel-num {
  font-family: Arial;
  font-weight: bold;
  color: #e66d15;
}

.main-im .im_main .im-tel:hover {
  background: #fafafa;
}

.main-im .im_main .weixing-container {
  width: 55px;
  height: 47px;
  border-right: 1px solid #dddddd;
  background: #f5f5f5;
  border-bottom-left-radius: 10px;
  background: url(/res/logo/weixing-icon.png) no-repeat center center;
  float: left;
}

.main-im .im_main .weixing-show {
  width: 112px;
  height: 172px;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #dddddd;
  position: absolute;
  left: -125px;
  top: -126px;
}

.main-im .im_main .weixing-show .weixing-sanjiao {
  width: 0;
  height: 0;
  border-style: solid;
  border-color: transparent transparent transparent #ffffff;
  border-width: 6px;
  left: 112px;
  top: 134px;
  position: absolute;
  z-index: 2;
}

.main-im .im_main .weixing-show .weixing-sanjiao-big {
  width: 0;
  height: 0;
  border-style: solid;
  border-color: transparent transparent transparent #dddddd;
  border-width: 8px;
  left: 112px;
  top: 132px;
  position: absolute;
}

.main-im .im_main .weixing-show .weixing-ma {
  width: 104px;
  height: 103px;
  padding-left: 5px;
  padding-top: 5px;
}

.main-im .im_main .weixing-show .weixing-txt {
  position: absolute;
  top: 110px;
  left: 7px;
  width: 100px;
  margin: 0 auto;
  text-align: center;
}

.main-im .im_main .go-top {
  width: 50px;
  height: 47px;
  background: #f5f5f5;
  border-bottom-right-radius: 10px;
  background: url(/res/logo/totop-icon.png) no-repeat center center;
  float: right;
}

.main-im .im_main .go-top a {
  display: block;
  width: 52px;
  height: 47px;
}

.main-im .close-im {
  position: absolute;
  right: 10px;
  top: -12px;
  z-index: 100;
  width: 24px;
  height: 24px;
}

.main-im .close-im a {
  display: block;
  width: 24px;
  height: 24px;
  background: url(/res/logo/close_im.png) no-repeat left top;
}

.main-im .close-im a:hover {
  text-decoration: none;
}

.main-im .open-im {
  cursor: pointer;
  margin-left: 68px;
  width: 40px;
  height: 133px;
  background: url(/res/logo/open_im.png) no-repeat left top;
}

.cc-nsge {
  height: 0px !important;
  width: 0px !important;
  overflow: hidden;
  opacity: 0 !important;
}

/* =========================================================
   ✅ 新增：WebChat 面板（避免“打不开”，使用 display 控制）
   ========================================================= */

/* 面板：默认彻底隐藏 */
#webchat_panel {
  position: fixed;
  right: 18px;
  bottom: 86px;
  width: 400px;
  height: 720px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0,0,0,.18);
  overflow: hidden;
  z-index: 2147483000;

  display: none;          /* ✅ 最稳：默认不显示 */
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .18s ease, transform .18s ease;
}

/* 打开时显示 */
#webchat_panel.show {
  display: block;         /* ✅ 关键：show 时强制显示 */
  opacity: 1;
  transform: translateY(0);
}

/* 移动端锁定遮罩 */
#webchat_overlay {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 2147482999; /* 比面板低 1 层 */
  display: none;

  touch-action: none;
  overscroll-behavior: none;
}

#webchat_overlay.show { display: block; }

/* 顶部 hero */
#webchat_panel .wc-hero {
  height: 190px;
  position: relative;
  color: #fff;
  user-select: none;
  background:
    radial-gradient(circle at 18px 18px, rgba(255,255,255,.10) 2px, transparent 3px) 0 0/22px 22px,
    radial-gradient(circle at 7px 7px, rgba(255,255,255,.08) 2px, transparent 3px) 0 0/22px 22px,
    linear-gradient(180deg, #0b5cff 0%, #0a58ef 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding-top: 56px;
  text-align: center;
  cursor: pointer;
}

/* 顶部一行 */
#webchat_panel .wc-toprow {
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  height: 36px;
  pointer-events: auto;
}

#webchat_panel .wc-toprow .wc-pill {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.18);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .5px;
  line-height: 1;
  user-select: none;
  cursor: pointer;
}

#webchat_panel .wc-toprow .wc-pill svg {
  width: 16px;
  height: 16px;
  fill: #fff;
  opacity: .95;
}

#webchat_panel .wc-toprow .wc_close {
  position: absolute;
  right: 10px;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(255,255,255,.18);
  font-weight: 900;
  line-height: 1;
}

#webchat_panel .wc-toprow .wc_close:hover {
  background: rgba(255,255,255,.28);
}

/* 3 个圆形图标 */
#webchat_panel .wc-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 2px;
}

#webchat_panel .wc-icon {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.22);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(0,0,0,.14);
}

#webchat_panel .wc-icon svg {
  width: 22px;
  height: 22px;
  fill: #fff;
  opacity: .95;
}

#webchat_panel .wc-title {
  font-size: 14px;
  font-weight: 900;
  margin-top: 2px;
}

#webchat_panel .wc-sub {
  font-size: 12px;
  opacity: .92;
  margin-top: -6px;
}

/* iframe */
#webchat_panel iframe {
  width: 100%;
  height: calc(100% - 190px);
  border: 0;
  display: block;
  background: #fff;
}

/* 移动端全屏 + 锁背景 */
@media (max-width: 700px) {
  #webchat_panel {
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    right: auto;
    bottom: auto;
    transform: translateY(0);
  }

  #webchat_panel iframe {
    height: calc(100% - 190px);
  }

  html.webchat-open,
  body.webchat-open {
    overflow: hidden !important;
    height: 100% !important;
    overscroll-behavior: none;
    touch-action: none;
  }

  body.webchat-open {
    position: fixed !important;
    width: 100% !important;
    left: 0;
    right: 0;
  }
}

/* =========================================================
   ✅ 新增：未读红点（不覆盖你原 qq-hover-c/img-qq，避免冲突）
   ========================================================= */
.main-im .qq-hover-c #wc_badge.wc-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;

  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff2d2d;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 18px;
  text-align: center;

  box-shadow: 0 6px 16px rgba(255,45,45,.45);
  border: 2px solid #fff;

  font-style: normal;
  user-select: none;
  pointer-events: none;
  z-index: 9999;
}
