/* 基础样式 */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* SEO隐藏H1 */
.seo-h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  white-space: nowrap;
}

/* ========== 客服外链样式 ========== */
.cs-link {
  position: fixed;
  bottom: 100px;
  right: 16px;
  z-index: 10000;
  text-decoration: none;
  display: block;
}

/* ========== 客服组件 - 优化移动端误触 ========== */
.cs-container {
  display: inline-block;
}

/* 触发按钮区域 - 增加可点击区域防止误触 */
.cs-trigger {
  position: relative;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 扩大点击热区 - 防止误触 */
.cs-trigger::before {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border-radius: 50%;
  background: transparent;
}

.cs-trigger img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: block;
  transition: transform 0.2s ease;
}

.cs-trigger:hover img {
  transform: scale(1.05);
}

/* 提示标签 */
.cs-label {
  position: absolute;
  top: 50%;
  right: 52px;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  backdrop-filter: blur(4px);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.cs-trigger:hover .cs-label {
  opacity: 1;
  visibility: visible;
}

/* ========== 移动端优化 ========== */
@media (max-width: 768px) {
  .cs-link {
    bottom: 80px;
    right: 12px;
  }
  
  /* 移动端稍微缩小，减少误触区域但保持可点 */
  .cs-trigger {
    width: 40px;
    height: 40px;
  }
  
  .cs-trigger img {
    width: 36px;
    height: 36px;
  }
  
  /* 移动端扩大热区但视觉上不大 */
  .cs-trigger::before {
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
  }
  
  /* 移动端标签显示方式：点击时显示（通过JS）或悬停不可用就用点击 */
  .cs-label {
    right: 48px;
    font-size: 12px;
    padding: 4px 10px;
  }
  
  /* 移动端使用 active 状态 */
  .cs-trigger:active img {
    transform: scale(0.95);
  }
}

/* 小屏手机进一步优化 */
@media (max-width: 480px) {
  .cs-link {
    bottom: 70px;
    right: 10px;
  }
  
  .cs-trigger {
    width: 36px;
    height: 36px;
  }
  
  .cs-trigger img {
    width: 32px;
    height: 32px;
  }
}

/* ========== 弹窗模式（如需使用） ========== */
.cs-popup {
  display: none;
  position: absolute;
  right: 50px;
  bottom: 0;
  width: 350px;
  height: 550px;
  background-color: #fff;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  border-radius: 8px;
  overflow: hidden;
}

.cs-container.cs-open .cs-popup {
  display: block;
}

.cs-container.cs-open .cs-label {
  display: none !important;
}

.cs-popup iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* 移动端弹窗适配 */
@media (max-width: 480px) {
  .cs-popup {
    width: calc(100vw - 40px);
    height: calc(100vh - 100px);
    right: 0;
    bottom: 60px;
  }
}

/* 触摸优化 - 减少移动端300ms延迟 */
.cs-trigger {
  touch-action: manipulation;
}