/**
 * 右侧浮动客服图标区样式
 * 兼容Bootstrap 3.4.1，但不强制依赖
 * 支持IE9+，现代浏览器完美支持
 */

/* ============================================
   基础容器 - 右侧居中定位
   ============================================ */
.kf-float-bar {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center; /* 确保所有子元素（.kf-group）水平居中 */
  gap: 5px; /* 进一步减小组之间的间距：从8px改为5px，使整体高度约占总高度的62% */
  font-family: "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  /* 确保不影响页面其他元素 */
  pointer-events: none;
}

.kf-float-bar > * {
  pointer-events: auto;
}

/* ============================================
   分组容器
   ============================================ */
.kf-group {
  display: flex;
  flex-direction: column;
  align-items: center; /* 确保组内所有内容水平居中 */
  gap: 4px; /* 进一步减小组内图标之间的间距：从6px改为4px */
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
  padding: 6px 5px; /* 进一步减小组的内边距：从8px 6px改为6px 5px */
  min-width: 56px;
  width: auto; /* 确保宽度自适应内容 */
  transition: box-shadow 0.3s ease;
  margin: 0 auto; /* 额外的水平居中保障 */
}

.kf-group:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.1);
}

.kf-group-title {
  font-size: 12px; /* 增大字体：从11px改为12px，更清晰易读 */
  color: #666; /* 加深颜色：从#999改为#666，提高对比度 */
  text-align: center;
  padding: 2px 0; /* 适当增加内边距，提升可读性 */
  border-bottom: 1px solid #e8e8e8; /* 稍微加深边框颜色 */
  margin-bottom: 2px; /* 适当增加下边距 */
  margin-top: 0; /* 明确设置上边距为0 */
  font-weight: 500; /* 增加字重：从normal改为500，使文字更粗更醒目 */
  line-height: 1.3; /* 增加行高：从1.1改为1.3，提升可读性 */
  letter-spacing: 0.3px; /* 增加字间距，使文字更清晰 */
}

/* ============================================
   单个图标项
   ============================================ */
.kf-item {
  position: relative;
  width: 48px; /* 略微减小图标尺寸：从50px改为48px */
  height: 48px; /* 略微减小图标尺寸：从50px改为48px */
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e8e8e8;
  overflow: visible; /* 改为 visible，确保悬停面板不被裁剪 */
  /* 确保内容完全居中 */
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.kf-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(18, 183, 245, 0.05) 0%, rgba(15, 160, 214, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.kf-item:hover::before {
  opacity: 1;
}

.kf-item:hover,
.kf-item:focus {
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 8px 24px rgba(18, 183, 245, 0.25), 0 2px 8px rgba(0, 0, 0, 0.1);
  border-color: #12b7f5;
  outline: none;
  background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
}

/* 电话图标悬停特殊效果 - 深橙红色系 */
.kf-item.kf-phone:hover,
.kf-item.kf-phone:focus {
  border-color: #ff5722;
  box-shadow: 0 8px 24px rgba(255, 87, 34, 0.4), 0 2px 8px rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, #ffffff 0%, #ffe0d6 100%);
}

.kf-item.kf-phone:hover::before {
  background: linear-gradient(135deg, rgba(255, 87, 34, 0.12) 0%, rgba(230, 74, 25, 0.12) 100%);
}

/* 微信图标悬停特殊效果 */
.kf-item.kf-wechat:hover,
.kf-item.kf-wechat:focus {
  border-color: #09bb07;
  box-shadow: 0 8px 24px rgba(9, 187, 7, 0.25), 0 2px 8px rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf0 100%);
}

.kf-item.kf-wechat:hover::before {
  background: linear-gradient(135deg, rgba(9, 187, 7, 0.08) 0%, rgba(8, 165, 6, 0.08) 100%);
}

/* QQ图标悬停特殊效果 */
.kf-item.kf-qq:hover,
.kf-item.kf-qq:focus {
  border-color: #12b7f5;
  box-shadow: 0 8px 24px rgba(18, 183, 245, 0.3), 0 2px 8px rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
}

.kf-item.kf-qq:hover::before {
  background: linear-gradient(135deg, rgba(18, 183, 245, 0.08) 0%, rgba(15, 160, 214, 0.08) 100%);
}

.kf-item:active {
  transform: translateY(0) scale(0.98);
}

/* 图标容器 */
.kf-icon-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1; /* 确保图标在面板之上，但不遮挡悬停检测 */
  pointer-events: none; /* 允许点击穿透到父元素 */
  /* 确保水平和垂直都完全居中 */
  margin: 0;
  padding: 0;
}

/* 图标样式 */
.kf-icon {
  display: block; /* 改为 block，确保更好的居中控制 */
  width: 30px; /* 图标尺寸：30px，占父容器48px的62.5% */
  height: 30px; /* 图标尺寸：30px，占父容器48px的62.5% */
  background-size: contain;
  background-position: center center; /* 明确指定水平和垂直居中 */
  background-repeat: no-repeat;
  margin: 0; /* 移除所有外边距，由 flex 容器控制居中 */
  padding: 0; /* 移除所有内边距 */
  flex-shrink: 0; /* 防止图标被压缩 */
  flex-grow: 0; /* 防止图标被拉伸 */
  /* 确保图标内容完全居中 */
  text-align: center;
  line-height: 30px; /* 与高度一致，确保垂直居中 */
}

/* QQ图标 */
.kf-icon-qq {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%2312b7f5" d="M12 2C6.48 2 2 6.48 2 12c0 1.54.36 2.98.97 4.29L1 23l6.71-1.97c1.31.61 2.75.97 4.29.97 5.52 0 10-4.48 10-10S17.52 2 12 2zm-1.5 14.5h-1v-6h1v6zm2.5 0h-1v-6h1v6zm2.5 0h-1v-6h1v6z"/></svg>');
}

/* 微信图标 - 使用SVG图标（如果需要在/UploadFiles/weixin-pic/放置wechat-icon.png，可替换此行） */
.kf-icon-wechat {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%2309bb07" d="M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 0 1 .213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 0 0 .167-.054l1.903-1.114a.864.864 0 0 1 .717-.098 10.16 10.16 0 0 0 2.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.597-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18 0 .653-.52 1.18-1.162 1.18-.642 0-1.162-.527-1.162-1.18 0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18 0 .653-.52 1.18-1.162 1.18-.642 0-1.162-.527-1.162-1.18 0-.651.52-1.18 1.162-1.18zm5.34 3.48c-2.604 0-4.714 2.11-4.714 4.713 0 2.602 2.11 4.712 4.714 4.712.578 0 1.127-.106 1.637-.296a.722.722 0 0 1 .598.084l1.531.896a.26.26 0 0 0 .135.043c.13 0 .235-.105.235-.234a.443.443 0 0 0-.033-.17l-.312-1.178a.472.472 0 0 1 .17-.558 7.112 7.112 0 0 0 2.15-5.113c0-2.603-2.11-4.713-4.714-4.713zm-2.407 3.48c.52 0 .94.421.94.94 0 .52-.42.94-.94.94-.519 0-.94-.42-.94-.94 0-.519.421-.94.94-.94zm2.407 0c.52 0 .94.421.94.94 0 .52-.42.94-.94.94-.519 0-.94-.42-.94-.94 0-.519.421-.94.94-.94z"/></svg>');
  /* 如需使用外部图标文件，取消注释下面一行，并注释上面一行 */
  /* background-image: url('/UploadFiles/weixin-pic/wechat-icon.png'); */
}

/* 到顶图标 - 彩色渐变箭头，更大更醒目 */
.kf-icon-top {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><linearGradient id="gradTop" x1="0%" y1="0%" x2="0%" y2="100%"><stop offset="0%" style="stop-color:%2312b7f5;stop-opacity:1" /><stop offset="100%" style="stop-color:%230fa0d6;stop-opacity:1" /></linearGradient></defs><path fill="url(%23gradTop)" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z" stroke="%23fff" stroke-width="0.5" stroke-linecap="round" stroke-linejoin="round"/></svg>');
  filter: drop-shadow(0 2px 4px rgba(18, 183, 245, 0.3));
  transition: all 0.3s ease;
  width: 32px !important; /* 增大箭头图标 */
  height: 32px !important;
}

/* 到底图标 - 彩色渐变箭头，更大更醒目 */
.kf-icon-bottom {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><linearGradient id="gradBottom" x1="0%" y1="0%" x2="0%" y2="100%"><stop offset="0%" style="stop-color:%2312b7f5;stop-opacity:1" /><stop offset="100%" style="stop-color:%230fa0d6;stop-opacity:1" /></linearGradient></defs><path fill="url(%23gradBottom)" d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6z" stroke="%23fff" stroke-width="0.5" stroke-linecap="round" stroke-linejoin="round"/></svg>');
  filter: drop-shadow(0 2px 4px rgba(18, 183, 245, 0.3));
  transition: all 0.3s ease;
  width: 32px !important; /* 增大箭头图标 */
  height: 32px !important;
}

/* 电话图标 - 深橙红色系，经典听筒样式 */
.kf-icon-phone {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23ff5722" d="M6.62 10.79a15.053 15.053 0 0 0 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V21c0 .55-.45 1-1 1C10.4 22 2 13.6 2 3c0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z"/></svg>');
}

/* ============================================
   悬浮面板（悬停/点击时显示）
   ============================================ */
.kf-panel {
  position: absolute;
  right: 62px;
  top: 50%;
  transform: translateY(-50%) scale(0.95);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 0;
  min-width: 190px;
  max-width: 300px; /* 添加最大宽度，防止面板过宽 */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 10001; /* 提高 z-index，确保面板显示在最上层 */
  border: 1px solid rgba(0, 0, 0, 0.05);
  white-space: nowrap; /* 防止内容换行 */
  word-wrap: break-word; /* 如果内容过长，允许换行 */
  overflow-wrap: break-word; /* 兼容性更好的换行属性 */
}

/* 面板内容区域允许换行（针对长文本） */
.kf-panel-body {
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal; /* 覆盖父元素的nowrap */
}

/* 在图标和面板之间添加连接区域，防止鼠标移动时面板消失 */
.kf-item::after {
  content: '';
  position: absolute;
  right: -60px;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 200%;
  background: transparent;
  pointer-events: auto;
  z-index: 10000;
  opacity: 0;
}

/* 当面板激活时，连接区域也激活 */
.kf-item.active::after {
  opacity: 1;
}

.kf-item:hover .kf-panel,
.kf-item:focus .kf-panel,
.kf-item.active .kf-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto !important;
  transform: translateY(-50%) translateX(-10px) scale(1);
  transition: opacity 0.1s ease, visibility 0.1s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 当鼠标在面板上时，保持面板显示 */
.kf-panel:hover {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(-50%) translateX(-10px) scale(1) !important;
}

/* 面板显示时立即启用pointer-events，确保可以接收鼠标事件 */
.kf-item.active .kf-panel {
  pointer-events: auto !important;
}

/* 面板箭头 */
.kf-panel::before {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 8px solid #fff;
}

.kf-panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  text-align: center;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: 12px 12px 0 0;
}

.kf-panel-body {
  padding: 16px;
  text-align: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal; /* 允许内容换行 */
}

/* 面板提示文字 */
.kf-panel-tip {
  font-size: 11px;
  color: #999;
  margin-top: 8px;
  margin-bottom: 4px;
  line-height: 1.4;
}

/* ============================================
   微信二维码面板 - 悬停放大效果
   ============================================ */
.kf-panel-wechat .kf-qr-img {
  width: 170px;
  height: 170px;
  display: block;
  margin: 0 auto;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid #f0f0f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

.kf-panel-wechat .kf-qr-img:hover {
  transform: scale(1.15);
  box-shadow: 0 8px 24px rgba(9, 187, 7, 0.2), 0 2px 8px rgba(0, 0, 0, 0.1);
  border-color: #09bb07;
}

.kf-item.kf-wechat:hover .kf-qr-img,
.kf-item.kf-wechat.active .kf-qr-img {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(9, 187, 7, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
  border-color: #09bb07;
}

/* ============================================
   QQ面板样式
   ============================================ */
.kf-qq-number {
  font-size: 14px;
  color: #666;
  margin-bottom: 12px;
}

.kf-qq-value {
  font-size: 16px;
  font-weight: 600;
  color: #12b7f5;
  font-family: "Courier New", monospace;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: inline-block;
}

.kf-qq-value:hover {
  background: rgba(18, 183, 245, 0.1);
  color: #0fa0d6;
  transform: scale(1.05);
}

.kf-qq-value:active {
  transform: scale(0.98);
  background: rgba(18, 183, 245, 0.15);
}

/* QQ操作按钮组 */
.kf-qq-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

/* .kf-btn-qq-copy 样式已移除（当前未使用） */

/* "启动QQ聊天"按钮 - 使用橙色系，更醒目，表示"启动/行动" */
.kf-btn-qq-chat {
  background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%) !important;
  box-shadow: 0 2px 8px rgba(255, 152, 0, 0.35) !important;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.kf-btn-qq-chat:hover {
  background: linear-gradient(135deg, #f57c00 0%, #e65100 100%) !important;
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.45) !important;
  transform: translateY(-1px);
}

.kf-btn-qq-chat:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(255, 152, 0, 0.35) !important;
}

/* "启动QQ聊天"按钮禁用状态 - 灰色+横线，表示功能不可用 */
.kf-btn-qq-chat-disabled {
  background: linear-gradient(135deg, #b0b0b0 0%, #999999 100%) !important;
  box-shadow: 0 2px 8px rgba(158, 158, 158, 0.25) !important;
  cursor: not-allowed !important;
  opacity: 0.75;
  position: relative;
}

.kf-btn-qq-chat-disabled:hover {
  background: linear-gradient(135deg, #999999 0%, #808080 100%) !important;
  box-shadow: 0 2px 8px rgba(158, 158, 158, 0.25) !important;
  transform: none !important;
}

.kf-btn-qq-chat-disabled:active {
  transform: none !important;
}

/* 禁用按钮上的删除线效果 */
.kf-btn-qq-chat-disabled::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 10%;
  right: 10%;
  height: 2px;
  background: rgba(102, 102, 102, 0.7);
  transform: translateY(-50%);
  pointer-events: none;
}

/* .kf-btn-qq-add 和 .kf-btn-qq-try 样式已移除（当前未使用） */

.kf-btn {
  display: inline-block;
  padding: 10px 20px;
  background: linear-gradient(135deg, #12b7f5 0%, #0fa0d6 100%);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(18, 183, 245, 0.3);
  position: relative;
  overflow: hidden;
}

.kf-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.kf-btn:hover::before {
  width: 300px;
  height: 300px;
}

.kf-btn:hover,
.kf-btn:focus {
  background: linear-gradient(135deg, #0fa0d6 0%, #0d8fc0 100%);
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(18, 183, 245, 0.4);
}

.kf-btn:active {
  transform: translateY(0);
}

/* ============================================
   电话面板样式
   ============================================ */
.kf-phone-number {
  font-size: 14px;
  color: #666;
  margin-bottom: 12px;
}

.kf-phone-value {
  font-size: 16px;
  font-weight: 600;
  color: #ff5722;
  font-family: "Courier New", monospace;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: inline-block;
}

.kf-phone-value:hover {
  background: rgba(255, 87, 34, 0.18);
  color: #e64a19;
  transform: scale(1.05);
}

/* 电话拨打按钮样式 - 深橙红色系 */
.kf-btn-phone {
  background: linear-gradient(135deg, #ff5722 0%, #e64a19 100%) !important;
  box-shadow: 0 2px 8px rgba(255, 87, 34, 0.4) !important;
  border: none;
  cursor: pointer;
}

.kf-btn-phone:hover {
  background: linear-gradient(135deg, #e64a19 0%, #d84315 100%) !important;
  box-shadow: 0 4px 12px rgba(255, 87, 34, 0.5) !important;
  transform: translateY(-1px);
}

.kf-btn-phone:active {
  transform: translateY(0);
}

/* 电话拨打按钮禁用状态 */
.kf-btn-phone-disabled {
  background: linear-gradient(135deg, #cccccc 0%, #b0b0b0 100%) !important;
  box-shadow: 0 2px 8px rgba(158, 158, 158, 0.2) !important;
  cursor: not-allowed !important;
  opacity: 0.7;
  position: relative;
}

.kf-btn-phone-disabled:hover {
  background: linear-gradient(135deg, #b0b0b0 0%, #999999 100%) !important;
  box-shadow: 0 2px 8px rgba(158, 158, 158, 0.2) !important;
  transform: none !important;
}

.kf-btn-phone-disabled:active {
  transform: none !important;
}

/* 禁用按钮上的删除线效果（可选，更直观） */
.kf-btn-phone-disabled::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 10%;
  right: 10%;
  height: 2px;
  background: rgba(102, 102, 102, 0.6);
  transform: translateY(-50%);
  pointer-events: none;
}

/* ============================================
   滚动按钮组特殊样式
   ============================================ */
.kf-group-scroll {
  padding: 3px; /* 减小滚动按钮组的内边距：从4px改为3px */
}

.kf-scroll-top,
.kf-scroll-bottom {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-color: #dee2e6;
  /* 移除transition，确保显示/隐藏无延迟 */
  transition: none !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.kf-scroll-top:hover,
.kf-scroll-bottom:hover {
  background: linear-gradient(135deg, #12b7f5 0%, #0fa0d6 100%);
  border-color: #12b7f5;
  box-shadow: 0 4px 12px rgba(18, 183, 245, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px) scale(1.05);
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.kf-scroll-top:active,
.kf-scroll-bottom:active {
  transform: translateY(0) scale(1);
  box-shadow: 0 2px 6px rgba(18, 183, 245, 0.25);
}

.kf-scroll-top:hover .kf-icon-top,
.kf-scroll-bottom:hover .kf-icon-bottom {
  filter: brightness(1.2) drop-shadow(0 3px 6px rgba(255, 255, 255, 0.4)) drop-shadow(0 2px 4px rgba(18, 183, 245, 0.5));
  transform: scale(1.15);
}

.kf-scroll-top .kf-icon-top,
.kf-scroll-bottom .kf-icon-bottom {
  transition: filter 0.3s ease, transform 0.3s ease;
}

/* ============================================
   响应式设计 - 移动端适配
   ============================================ */
@media (max-width: 768px) {
  .kf-float-bar {
    right: 10px;
    gap: 4px; /* 移动端进一步减小组之间的间距：从6px改为4px */
  }

  .kf-group {
    padding: 4px 3px; /* 移动端进一步减小组的内边距：从5px 4px改为4px 3px */
    min-width: 48px;
  }

  .kf-item {
    width: 44px;
    height: 44px;
  }

  .kf-icon {
    width: 28px; /* 移动端图标尺寸：28px，占父容器44px的63.6% */
    height: 28px;
  }
  
  /* 移动端箭头图标也增大 */
  .kf-icon-top,
  .kf-icon-bottom {
    width: 30px !important; /* 移动端箭头图标：30px */
    height: 30px !important;
  }

  .kf-panel {
    right: 56px;
    min-width: 160px;
  }

  .kf-panel-wechat .kf-qr-img {
    width: 140px;
    height: 140px;
  }
}

@media (max-width: 576px) {
  /* 移动端可选择性隐藏或改为底部悬浮 */
  .kf-float-bar {
    right: 8px;
    transform: translateY(-50%) scale(0.9);
  }

  .kf-group-title {
    font-size: 11px; /* 移动端也适当增大：从10px改为11px */
    color: #666; /* 移动端也使用更深的颜色 */
    font-weight: 500; /* 移动端也使用更粗的字重 */
  }

  .kf-panel {
    right: 52px;
    min-width: 140px;
  }
}

/* ============================================
   无障碍支持 - 键盘导航
   ============================================ */
.kf-item:focus {
  outline: 2px solid #12b7f5;
  outline-offset: 2px;
}

/* ============================================
   打印时隐藏
   ============================================ */
@media print {
  .kf-float-bar {
    display: none !important;
  }
}

/* ============================================
   兼容Bootstrap 3.4.1工具类（如果已引入）
   ============================================ */
.kf-float-bar .text-center {
  text-align: center;
}

/* 如果全局已引入Bootstrap 3.4.1，可以使用以下方式增强样式 */
/* 注意：保持独立样式，避免版本冲突 */
/* .kf-float-bar .btn { } */

/* Bootstrap响应式断点兼容 */
@media (max-width: 767px) {
  /* Bootstrap 3.4.1 的 sm 断点 */
  .kf-float-bar {
    right: 10px;
  }
}

@media (max-width: 991px) {
  /* Bootstrap 3.4.1 的 md 断点 */
  /* 可在此添加中等屏幕的样式调整 */
}

/* ============================================
   加载动画（可选，提升体验）
   ============================================ */
@keyframes kfFadeIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.kf-group {
  animation: kfFadeIn 0.4s ease-out;
}

.kf-group:nth-child(1) { animation-delay: 0.1s; }
.kf-group:nth-child(2) { animation-delay: 0.2s; }
.kf-group:nth-child(3) { animation-delay: 0.3s; }
.kf-group:nth-child(4) { animation-delay: 0.4s; }
