/* =====================================================================
   右侧「在线咨询」悬浮组件 + 咨询弹窗
   参照 www.tianfangke.cn 主页右侧悬浮栏：右侧垂直居中，圆形按钮，
   下滑后在「微信咨询」下方出现回到顶部圆形箭头。
   命名空间约定（避免与站点原有 .wfk-consult-*（更多咨询专栏）冲突）：
     .wfk-fc-*   悬浮组件（在线咨询 / 微信咨询 / 回到顶部 / 二维码气泡）
     .wfk-cx-*   咨询面板（遮罩 / 面板 / 表单 / 成功视图 / 底栏）
   ===================================================================== */

/* ---------- 右侧悬浮栏 ---------- */
.wfk-float-consult {
  position: fixed;
  right: 40px;
  top: 70%;
  transform: translateY(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.wfk-fc-btn {
  position: relative;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #fff;
  box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}
.wfk-fc-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px 0 rgba(0, 0, 0, 0.14);
}
.wfk-fc-btn:focus-visible {
  outline: 2px solid #056afc;
  outline-offset: 2px;
}

.wfk-fc-ico {
  font-size: 20px;
  line-height: 1;
}
.wfk-fc-txt {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0;
}

/* 在线咨询：蓝底白字，柔和径向渐变 + 多层阴影，浮起质感（主色与站点 #056afc 一致） */
.wfk-fc-btn-primary {
  background: radial-gradient(circle at 32% 26%, #5cb0ff 0%, #0b74fe 52%, #0452cf 100%);
  box-shadow:
    0 8px 20px rgba(5, 106, 252, 0.35),
    0 2px 5px rgba(5, 106, 252, 0.22),
    inset 0 1px 1px rgba(255, 255, 255, 0.35),
    inset 0 -2px 6px rgba(2, 40, 110, 0.22);
}
.wfk-fc-btn-primary:hover {
  background: radial-gradient(circle at 32% 26%, #6ebbff 0%, #1279fe 52%, #0452cf 100%);
  box-shadow:
    0 12px 26px rgba(5, 106, 252, 0.42),
    0 3px 8px rgba(5, 106, 252, 0.28),
    inset 0 1px 1px rgba(255, 255, 255, 0.4),
    inset 0 -2px 6px rgba(2, 40, 110, 0.24);
}
.wfk-fc-btn-primary .wfk-fc-ico,
.wfk-fc-btn-primary .wfk-fc-txt { color: #fff; }
.wfk-fc-btn-primary:focus-visible { outline-color: #056afc; }

/* 微信咨询：白底灰图标（悬停变微信绿），同款浮起阴影 + 边缘淡渐变 */
.wfk-fc-btn-plain {
  background: radial-gradient(circle at 32% 26%, #ffffff 0%, #fbfcfe 48%, #f2f5fa 100%);
  box-shadow:
    0 8px 20px rgba(23, 26, 29, 0.12),
    0 2px 6px rgba(23, 26, 29, 0.07),
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    inset 0 -2px 6px rgba(23, 26, 29, 0.05);
}
.wfk-fc-btn-plain:hover {
  background: radial-gradient(circle at 32% 26%, #ffffff 0%, #f9fbfe 48%, #eef2f8 100%);
  box-shadow:
    0 12px 26px rgba(23, 26, 29, 0.16),
    0 3px 8px rgba(23, 26, 29, 0.09),
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    inset 0 -2px 6px rgba(23, 26, 29, 0.06);
}
.wfk-fc-btn-plain .wfk-fc-ico {
  color: #9aa3b2;
  transition: color 0.2s ease;
}
.wfk-fc-btn-plain .wfk-fc-txt { color: #596178; transition: color 0.2s ease; }
.wfk-fc-btn-plain:hover .wfk-fc-ico,
.wfk-fc-btn-plain.wfk-fc-on .wfk-fc-ico { color: #2aae67; }
.wfk-fc-btn-plain:hover .wfk-fc-txt,
.wfk-fc-btn-plain.wfk-fc-on .wfk-fc-txt { color: #2aae67; }
.wfk-fc-btn-plain:focus-visible { outline-color: #056afc; }

/* ---------- 回到顶部圆形按钮（下滑后出现在「微信咨询」下方，参照 tianfangke.cn） ---------- */
.wfk-fc-top {
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #fff;
  color: #596178;
  font-size: 20px;
  line-height: 1;
  box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}
.wfk-fc-top.wfk-show {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  pointer-events: auto;
}
.wfk-fc-top:hover { background: #f5f7fa; color: #056afc; }
.wfk-fc-top:focus-visible { outline: 2px solid #056afc; outline-offset: 2px; }

/* ---------- 微信二维码气泡（桌面端悬停显示） ---------- */
.wfk-fc-pop {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  width: 150px;
  padding: 12px 12px 8px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(23, 26, 29, 0.16);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-50%) translateX(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 1001;
}
.wfk-fc-pop:before {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 2px;
  transform: translateY(-50%) rotate(45deg);
}
.wfk-fc-pop img {
  display: block;
  width: 126px;
  height: 126px;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 6px;
}
.wfk-fc-pop p {
  margin: 6px 0 2px;
  font-size: 12px;
  line-height: 18px;
  color: #666e82;
  text-align: center;
  white-space: nowrap;
}
.wfk-fc-btn-plain:hover .wfk-fc-pop,
.wfk-fc-btn-plain:focus-within .wfk-fc-pop {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

/* ---------- 点按微信咨询：二维码保持显示在按钮左侧（与悬停位置一致），点空白关闭 ---------- */
.wfk-fc-qr-open .wfk-fc-pop {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
  pointer-events: auto;
  z-index: 1001;
}

/* ---------- 咨询面板（右侧滑出） ---------- */
.wfk-cx-mask {
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.wfk-cx-mask.wfk-show { opacity: 1; }

.wfk-cx-panel {
  position: fixed;
  top: 0; right: 0;
  height: 100%;
  width: 400px;
  max-width: 100%;
  background: #fff;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
  transform: translateX(102%);
  transition: transform 0.28s ease;
  visibility: hidden;
}
.wfk-cx-panel.wfk-show { transform: translateX(0); visibility: visible; }

.wfk-cx-head {
  flex: 0 0 auto;
  padding: 20px 22px 18px;
  background: linear-gradient(152deg, #056afc 0%, #50adff 100%);
  color: #fff;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.wfk-cx-head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 28px;
  color: #fff;
}
.wfk-cx-head p {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 20px;
  color: #fff;
}
.wfk-cx-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  margin: -2px -6px 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 15px;
  line-height: 32px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease;
}
.wfk-cx-close:hover { background: rgba(255, 255, 255, 0.3); }

.wfk-cx-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 22px 22px 26px;
  -webkit-overflow-scrolling: touch;
}

/* 表单 */
.wfk-cx-form .wfk-cx-field { margin-bottom: 16px; }
.wfk-cx-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #2e3d62;
}
.wfk-cx-form label .wfk-cx-optional {
  font-weight: 400;
  font-size: 12px;
  color: #a8b0bf;
}
.wfk-cx-form label .wfk-cx-req { color: #f43f5e; margin-left: 2px; }
.wfk-cx-form input,
.wfk-cx-form textarea {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 22px;
  color: #202635;
  background: #f8fafd;
  border: 1px solid #dfe4ee;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.wfk-cx-form textarea { min-height: 96px; resize: vertical; }
.wfk-cx-form input:focus,
.wfk-cx-form textarea:focus {
  border-color: #056afc;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(5, 106, 252, 0.12);
}
.wfk-cx-form input.wfk-cx-invalid,
.wfk-cx-form textarea.wfk-cx-invalid { border-color: #f43f5e; }
.wfk-cx-form input::placeholder,
.wfk-cx-form textarea::placeholder { color: #a8b0bf; }

/* 蜜罐字段：防机器人，正常用户不可见 */
.wfk-cx-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.wfk-cx-submit {
  display: block;
  width: 100%;
  margin-top: 22px;
  padding: 12px 0;
  border: 0;
  border-radius: 24px;
  background: linear-gradient(152deg, #056afc 0%, #50adff 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 4px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(5, 106, 252, 0.28);
  transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.wfk-cx-submit:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(5, 106, 252, 0.34); }
.wfk-cx-submit[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; }

.wfk-cx-msg {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 20px;
  text-align: center;
  color: #f43f5e;
  min-height: 20px;
}
.wfk-cx-msg.wfk-cx-msg-ok { color: #16a34a; }

/* 提交成功视图：图标 + 标题在面板内容区上下居中 */
.wfk-cx-done {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 26px 6px;
}
.wfk-cx-done .wfk-cx-done-ico {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #e8f8ef;
  color: #16a34a;
  font-size: 30px;
  line-height: 64px;
  text-align: center;
}
.wfk-cx-done h4 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: #202635;
}
.wfk-cx-done > p {
  margin: 0;
  font-size: 13px;
  line-height: 22px;
  color: #666e82;
}

/* 面板底部：其他咨询方式 */
.wfk-cx-foot {
  flex: 0 0 auto;
  border-top: 1px solid #eef1f6;
  padding: 14px 22px 18px;
  background: #fafbff;
}
.wfk-cx-foot .wfk-cx-foot-title {
  margin: 0 0 10px;
  font-size: 12px;
  color: #a8b0bf;
  text-align: center;
}
.wfk-cx-foot-row { display: flex; gap: 12px; }
.wfk-cx-foot-row a {
  flex: 1 1 0;
  padding: 9px 0;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.wfk-cx-foot-row a:hover { opacity: 0.85; text-decoration: none; }
.wfk-cx-foot-tel { background: #056afc; color: #fff !important; }
.wfk-cx-foot-wx {
  background: #fff;
  color: #2aae67 !important;
  border: 1px solid #bfe8d2;
  cursor: pointer;
}

/* ---------- 移动端适配 ---------- */
@media (max-width: 767px) {
  .wfk-float-consult {
    right: 10px;
    gap: 12px;
  }
  .wfk-fc-btn { width: 56px; height: 56px; }
  .wfk-fc-ico { font-size: 16px; }
  .wfk-fc-txt { margin-top: 2px; font-size: 10px; line-height: 14px; }
  .wfk-fc-top { width: 48px; height: 48px; font-size: 17px; }
  /* 移动端二维码气泡略放大，方便扫码 */
  .wfk-fc-pop { width: 168px; padding: 12px 12px 8px; }
  .wfk-fc-pop img { width: 144px; height: 144px; }
  .wfk-cx-panel { width: 100%; }
  .wfk-cx-body { padding: 18px 16px 22px; }
  .wfk-cx-head { padding: 16px 18px 14px; }
}

/* 尊重系统「减少动效」设置 */
@media (prefers-reduced-motion: reduce) {
  .wfk-fc-btn,
  .wfk-fc-top,
  .wfk-fc-pop,
  .wfk-cx-mask,
  .wfk-cx-panel { transition: none; }
}
