/* ============================================================
   悬浮客服 · 名片弹层 · 咨询弹窗 样式（v3）
   注意：悬浮条本体（.float-service / .fs-btn）的样式
        已全部迁移到 float-service-v7.css，此处不再重复定义，
        避免 bottom/top 冲突导致容器高度塌陷。
   ============================================================ */

/* ---------- 名片弹层（悬停左侧滑出） ---------- */
.fs-card {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translate(8px, -50%) scale(.97);
  transform-origin: right center;
  width: 232px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .06);
  border-radius: 16px;
  box-shadow: 0 20px 50px -18px rgba(15, 23, 42, .32), 0 2px 8px rgba(15, 23, 42, .05);
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s, transform .24s cubic-bezier(.2, .8, .2, 1), visibility .24s;
  text-align: center;
  box-sizing: border-box;
}
.fs-item:hover .fs-card,
.fs-card.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(0, -50%) scale(1);
}
.fs-card::after {
  content: "";
  position: absolute;
  right: -5.5px;
  top: 50%;
  width: 11px;
  height: 11px;
  background: #fff;
  border-right: 1px solid rgba(15, 23, 42, .07);
  border-bottom: 1px solid rgba(15, 23, 42, .07);
  transform: translateY(-50%) rotate(-45deg);
}
.fs-card-head {
  display: flex; align-items: center; gap: 9px;
  padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px solid #f1f5f9; text-align: left;
}
.fs-card-head .fs-card-ic {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(183, 64, 47, .08), rgba(192, 154, 94, .10));
  color: #B7402F;
}
.fs-card-tt { display: flex; flex-direction: column; min-width: 0; }
.fs-card-tt b { font-size: 13px; font-weight: 700; color: #0f172a; line-height: 1.3; }
.fs-card-tt small { font-size: 10.5px; color: #94a3b8; margin-top: 1px; }

.fs-qr-wrap {
  position: relative; width: 148px; height: 148px; margin: 0 auto 10px;
  padding: 6px; border-radius: 12px;
  background: #fff; border: 1px solid #eef2f8;
  box-shadow: 0 4px 14px -6px rgba(15, 23, 42, .14);
}
.fs-card .fs-qr {
  width: 100%; height: 100%;
  border-radius: 8px;
  object-fit: contain;
  display: block;
  background: #fff;
}
.fs-card .fs-qr-empty {
  width: 148px; height: 148px;
  border-radius: 12px;
  margin: 0 auto 10px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 11px;
  flex-direction: column;
  gap: 6px;
}
.fs-card .fs-name {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 4px;
  word-break: break-all;
}
.fs-card .fs-phone {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .02em;
  color: #B7402F;
  margin: 2px 0 4px;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}
.fs-card .fs-tip {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 8px;
  padding-top: 9px;
  border-top: 1px dashed #eef2f8;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.fs-card .fs-actions { display: flex; gap: 8px; margin-top: 10px; }
.fs-card .fs-card-btn {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; border-radius: 9px;
  background: linear-gradient(135deg, #C0483A, #B7402F);
  color: #fff; font-size: 12.5px; font-weight: 600;
  box-shadow: 0 6px 16px -8px rgba(183, 64, 47, .28);
  transition: transform .2s, box-shadow .2s;
  white-space: nowrap;
}
.fs-card .fs-card-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -10px rgba(183, 64, 47, .32); }

/* ---------- 回到顶部 ---------- */
.back-top {
  position: fixed;
  right: 18px;
  bottom: 26px;
  z-index: 890;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, .07);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px -4px rgba(15, 23, 42, .16);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: all .25s;
}
.back-top.show { opacity: 1; transform: none; pointer-events: auto; }
.back-top:hover { background: linear-gradient(135deg, #C0483A, #B7402F); color: #fff; border-color: transparent; }

/* 折叠按钮暂不需要额外定义，样式见 float-service-v7.css */

/* ============================================================
   咨询弹窗（居中）
   ============================================================ */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
}
.modal-mask.open { display: flex; }
.modal-box {
  width: 100%;
  max-width: 620px;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .28);
  position: relative;
  animation: modalIn .3s cubic-bezier(.34, 1.4, .64, 1) both;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(24px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
.modal-head {
  padding: 26px 30px 18px;
  border-bottom: 1px solid #f1f5f9;
  position: relative;
  flex-shrink: 0;
}
.modal-head h3 { font-size: 20px; font-weight: 700; color: #0f172a; margin-bottom: 6px; padding-right: 40px; }
.modal-head p { font-size: 13.5px; color: #94a3b8; line-height: 1.6; }
.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  padding: 0;
}
.modal-close:hover { background: #e2e8f0; color: #0f172a; transform: rotate(90deg); }
.modal-body {
  padding: 22px 30px 26px;
  overflow-y: auto;
  flex: 1;
}
.modal-loading {
  padding: 46px 0;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
}

/* 弹窗内表单 */
.modal-body .form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
}
.modal-body .form-group { margin: 0; }
.modal-body .form-group.full { grid-column: 1 / -1; }
.modal-body .form-group label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 7px;
}
.modal-body .form-group label .req { color: #ef4444; margin-left: 2px; }
.modal-body .form-group input,
.modal-body .form-group textarea,
.modal-body .form-group select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14.5px;
  font-family: inherit;
  color: #0f172a;
  background: #f8fafc;
  transition: all .2s;
  box-sizing: border-box;
}
.modal-body .form-group input:focus,
.modal-body .form-group textarea:focus,
.modal-body .form-group select:focus {
  outline: none;
  border-color: #B7402F;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(183, 64, 47, .1);
}
.modal-body .form-group textarea { min-height: 96px; resize: vertical; line-height: 1.65; }
.modal-foot { margin-top: 20px; }
.modal-foot .btn-submit {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #C0483A, #B7402F);
  color: #fff;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(183, 64, 47, .3);
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.modal-foot .btn-submit:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(183, 64, 47, .4); }
.modal-foot .btn-submit:disabled { opacity: .65; cursor: not-allowed; transform: none; }
.modal-msg {
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  margin-bottom: 14px;
  display: none;
}
.modal-msg.ok { background: #dcfce7; color: #15803d; display: block; }
.modal-msg.err { background: #fee2e2; color: #b91c1c; display: block; }
.modal-success {
  text-align: center;
  padding: 30px 10px 20px;
}
.modal-success .ok-icon {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}
.modal-success h4 { font-size: 18px; margin-bottom: 8px; }
.modal-success p { color: #94a3b8; font-size: 14px; }

/* ============================================================
   移动端适配（统一）
   ============================================================ */
@media (max-width: 860px) {
  /* 悬浮条本体（.float-service / .fs-btn / .float-toggle）的移动样式
     统一由 float-service-v7.css 管理，此处不再定义，避免 bottom/top 冲突 */

  /* 名片改为覆盖式（避免超出屏幕左边界） */
  .fs-card {
    right: calc(100% + 10px);
    left: auto;
    top: 50%;
    width: 214px;
    padding: 14px;
    transform: translate(6px, -50%) scale(.97);
  }
  .fs-item:hover .fs-card, .fs-item.open .fs-card { transform: translate(0, -50%) scale(1); }
  .fs-card::after {
    right: -5px; left: auto;
    border-right: 1px solid rgba(15,23,42,.07);
    border-bottom: 1px solid rgba(15,23,42,.07);
    border-left: none;
    transform: translateY(-50%) rotate(-45deg);
  }
  .fs-card .fs-qr, .fs-card .fs-qr-empty, .fs-qr-wrap { width: 132px; height: 132px; }
  .fs-card .fs-phone { font-size: 17px; }
  .fs-card .fs-tip { font-size: 10.5px; }

  .back-top { right: 8px; bottom: 22px; width: 38px; height: 38px; }

  /* 弹窗 */
  .modal-box { max-width: 100%; border-radius: 18px; }
  .modal-head { padding: 22px 20px 16px; }
  .modal-head h3 { font-size: 18px; }
  .modal-body { padding: 18px 20px 22px; }
  .modal-body .form-grid-2 { grid-template-columns: 1fr; gap: 14px; }

  /* 旧版首页 hero 兼容 */
  .hero-content { padding: 0 18px; }
  .hero-actions { gap: 10px; }
  .hero-actions .btn { flex: 1 1 42%; max-width: 47%; padding: 12px 8px; font-size: 14px; }
}

@media (min-width: 861px) {
  .fs-item-collapse { display: none; }
}
