/* 柏克森官网全站联系入口：微信 / 电话悬浮组件
 * 独立于原有样式，不覆盖任何站点样式；页面原有 .totop 回到顶部保留，不重复添加。
 */
.bks-contact {
  position: fixed;
  right: 0;
  bottom: 110px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  font-family: "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.5;
}

.bks-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #d1a954;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: background 0.2s ease, transform 0.2s ease;
  text-decoration: none;
}

.bks-btn:hover,
.bks-btn:focus-visible,
.bks-contact.is-open .bks-wechat {
  background: #b8923c;
  transform: translateX(-2px);
  outline: none;
}

.bks-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.bks-wechat-wrap {
  position: relative;
}

/* 微信二维码卡片：默认隐藏，PC 悬停或手机点击展开 */
.bks-wx-card {
  position: absolute;
  right: 52px;
  bottom: -4px;
  width: 240px;
  max-width: calc(100vw - 64px);
  padding: 14px;
  background: #fff;
  border: 1px solid #e6dfcd;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  color: #333;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  box-sizing: border-box;
  text-align: center;
}

.bks-contact.is-open .bks-wx-card {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

@media (hover: hover) and (pointer: fine) {
  .bks-wechat-wrap:hover .bks-wx-card,
  .bks-wechat-wrap:focus-within .bks-wx-card {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }
}

/* 用户手动收起后，本次悬停不再自动展开；移开指针后恢复悬停行为 */
.bks-contact.is-dismissed .bks-wx-card {
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  pointer-events: none;
}

.bks-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #8a6d2f;
  margin-bottom: 8px;
}

.bks-qr {
  display: block;
  width: 170px;
  height: 170px;
  max-width: 100%;
  margin: 0 auto 8px;
  border: 1px solid #eee;
  background: #fff;
  object-fit: contain;
}

.bks-card-text {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.6;
  color: #555;
  text-align: left;
}

.bks-card-text strong {
  color: #b8923c;
  word-break: break-all;
}

.bks-copy {
  display: block;
  width: 100%;
  padding: 7px 6px;
  border: 0;
  border-radius: 4px;
  background: #d1a954;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}

.bks-copy:hover,
.bks-copy:focus-visible {
  background: #b8923c;
  outline: none;
}

.bks-copy-status {
  margin: 6px 0 0;
  min-height: 16px;
  font-size: 11px;
  line-height: 1.4;
  color: #888;
  text-align: left;
}

.bks-copy-status.is-copied {
  color: #2e8b57;
  font-weight: 700;
}

/* 电话按钮悬停提示 */
.bks-tip {
  position: absolute;
  right: 52px;
  top: 50%;
  transform: translateY(-50%);
  padding: 5px 9px;
  border-radius: 4px;
  background: rgba(40, 40, 40, 0.88);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .bks-tel:hover .bks-tip,
  .bks-tel:focus-visible .bks-tip {
    opacity: 1;
    visibility: visible;
  }
}

/* 小屏适配：按钮更小，卡片向左展开，不遮挡正文与表单 */
@media (max-width: 768px) {
  .bks-contact {
    bottom: 108px;
    gap: 7px;
  }

  .bks-btn {
    width: 38px;
    height: 38px;
  }

  .bks-btn svg {
    width: 20px;
    height: 20px;
  }

  .bks-wx-card {
    right: 46px;
    bottom: -2px;
    width: 220px;
    padding: 12px;
  }

  .bks-qr {
    width: 150px;
    height: 150px;
  }
}
