/* =========================
   kefu.css（合并优化版 v4）
   说明：CSS 默认贴近内容卡片右侧，内联 JS 再按真实 .container 坐标校准；不隐藏挂件，避免 JS 延迟时消失。
   ========================= */

.layui-card-header {
  background: #404553 !important;
}

.main-im {
  position: fixed;
  right: calc((100vw - 1140px) / 2 - 90px);
  top: auto;
  bottom: 320px;
  z-index: 100;
  width: 110px;
  height: 270px;
}

@media (min-width: 576px) {
  .main-im {
    right: calc((100vw - 540px) / 2 - 110px);
  }
}

@media (min-width: 768px) {
  .main-im {
    right: calc((100vw - 720px) / 2 - 110px);
  }
}

@media (min-width: 992px) {
  .main-im {
    right: calc((100vw - 960px) / 2 - 110px);
  }
}

@media (min-width: 1200px) {
  .main-im {
    right: calc((100vw - 1140px) / 2 - 90px);
  }
}

@media (min-width: 1400px) {
  .main-im {
    right: calc((100vw - 1320px) / 2 - 90px);
  }
}

@media (max-width: 700px) {
  .main-im {
    right: 2px;
    bottom: 80px;
  }
}

.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;
}

.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;
  border-bottom-left-radius: 10px;
  background: #f5f5f5 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,
.main-im .im_main .weixing-show .weixing-sanjiao-big {
  width: 0;
  height: 0;
  border-style: solid;
  position: absolute;
}

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

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

.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;
  border-bottom-right-radius: 10px;
  background: #f5f5f5 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: 0 !important;
  width: 0 !important;
  overflow: hidden;
  opacity: 0 !important;
}

/* WebChat 面板 */
#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;
  opacity: 1;
  transform: translateY(0);
}

#webchat_overlay {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 2147482999;
  display: none;
  touch-action: none;
  overscroll-behavior: none;
}

#webchat_overlay.show {
  display: block;
}

#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);
}

#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);
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}

#webchat_panel .wc-icon:hover {
  background: rgba(255, 255, 255, .24);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
}

#webchat_panel .wc-icon svg,
#webchat_panel .wc-contact-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  fill: #fff;
  opacity: .95;
}

#webchat_panel .wc-contact-icon {
  filter: none;
}

#webchat_panel .wc-contact-link--disabled {
  cursor: default;
  opacity: .62;
}

#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;
}

#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;
  }
}

.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;
}

.wc-badge--hidden,
.weixing-show--hidden {
  display: none;
}

.im-link-icon {
  width: 25px;
  height: 25px;
  min-width: 25px;
  max-width: 25px;
  object-fit: contain;
  vertical-align: middle;
}

.im-footer {
  position: relative;
}

.im-clear {
  clear: both;
}

.main-im.is-mobile .open-im,
.main-im:not(.is-mobile) .im_main {
  display: block;
}

.main-im.is-mobile .im_main,
.main-im:not(.is-mobile) .open-im {
  display: none;
}
