﻿/* TG悬浮按钮 - 终极版：手机端强制显示 | 全端右侧垂直中间 | 抗样式覆盖 | 抗渲染隐藏 */
.livechat-widget {
  /* 核心定位：强制固定定位 + 右侧垂直居中，解决父元素transform导致fixed失效的坑 */
  position: fixed !important;
  right: 20px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 999999 !important; /* 顶级层级，碾压所有页面元素 */
  /* 新增：强制取消左定位，只靠right控制水平位置，永不偏移（关键保障） */
  left: auto !important;
  /* 双重显示保障：彻底杜绝任何隐藏（display+visibility） */
  display: block !important;
  visibility: visible !important;
  /* 抗渲染隐藏：提升渲染优先级，避免浏览器优化隐藏 */
  will-change: transform !important;
  pointer-events: auto !important; /* 强制点击/显示生效 */
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  box-sizing: border-box !important;
}

/* 平板/电脑端按钮样式：60px圆形 + TG蓝主色 */
.livechat-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 60px !important;
  height: 60px !important;
  border-radius: 50% !important;
  background: #2AABEE !important; /* TG品牌蓝，不被覆盖 */
  box-shadow: 0 4px 20px rgba(42, 171, 238, 0.3) !important;
  transition: all 0.3s ease !important;
  border: none !important;
  padding: 0 !important;
  cursor: pointer !important;
  outline: none !important;
  background-clip: padding-box !important; /* 防止背景溢出 */
}

/* hover动效：轻微放大+加深阴影，保留交互 */
.livechat-btn:hover {
  transform: scale(1.08) !important;
  box-shadow: 0 6px 25px rgba(42, 171, 238, 0.4) !important;
  background: #1e9bd8 !important;
}

/* TG图标：强制显示+比例不变，防止图片隐藏 */
.livechat-btn img {
  display: block !important;
  width: 32px !important;
  height: 32px !important;
  object-fit: contain !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

/* 手机端（600px以下）：微调尺寸+右侧间距，贴合窄屏，所有样式强制 */
@media screen and (max-width: 600px) {
  .livechat-widget {
    right: 8px !important; /* 核心修改：从16px→8px，按钮完全露在手机屏幕内，适配所有机型 */
  }
  .livechat-btn {
    width: 50px !important; /* 手机端按钮缩小，更协调 */
    height: 50px !important;
  }
  .livechat-btn img {
    width: 28px !important; /* 图标同步缩小 */
    height: 28px !important;
  }
}