/* ==========================================================================
   consult-modal.css — 右下角浮动咨询弹窗
   杭州链动跨境科技有限公司
   ========================================================================== */

/* 浮动按钮（未展开状态） */
.consult-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 998;
  background: linear-gradient(135deg, var(--color-primary, #1d4ed8), var(--color-primary-dark, #173a9e));
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(29, 78, 216, 0.35);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.3s ease, box-shadow 0.25s ease, opacity 0.3s ease;
}

.consult-fab:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(29, 78, 216, 0.45);
}

.consult-fab svg {
  width: 14px;
  height: 14px;
}

/* 滚动时自动隐藏（向下滑出屏幕） */
.consult-fab.is-hidden {
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
}

/* 遮罩层 */
.consult-overlay {
  position: fixed;
  /* 显式四边（不用 inset 缩写，兼容老版微信 X5 / 旧安卓 WebView） */
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(8, 19, 49, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  /* 关键：z-index 必须高于页面所有元素（.header.sticky / .menu-toggle z-index 1001），
     否则弹窗头部会被顶部导航栏的菜单按钮遮挡，导致"看不到关闭按钮" */
  z-index: 10000;
  display: none;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 24px;
  animation: consult-fade-in 0.25s ease;
}

.consult-overlay.show {
  display: flex;
}

@keyframes consult-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes consult-pop-in {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* 弹窗本体 */
.consult-modal {
  position: relative;
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  animation: consult-pop-in 0.32s cubic-bezier(0.16, 0.84, 0.44, 1);
}

/* 头部（深色带） */
.consult-head {
  background: linear-gradient(135deg, var(--color-primary, #1d4ed8), var(--color-primary-dark, #173a9e));
  padding: 22px 24px 24px;
  color: #fff;
  position: relative;
}

.consult-head h3 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* 副标题增强：原 13px / opacity 0.85 在深蓝底色上几乎看不清 */
.consult-head p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.95;
  letter-spacing: 0.2px;
  font-weight: 400;
  /* 轻微高光描边，确保深色背景可读 */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.consult-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 50%;
  font-size: 0;          /* 防止任何文字字形残留（兼容无 × 字形的设备字体） */
  line-height: 1;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transition: background 0.2s, transform 0.2s;
}

.consult-close svg {
  width: 15px;
  height: 15px;
  display: block;
  flex-shrink: 0;
}

.consult-close:hover {
  background: rgba(255, 255, 255, 0.42);
  transform: scale(1.06);
}

/* 底部「暂时不需要，关闭」文字按钮（移动端明确的关闭入口） */
.consult-close-bottom {
  display: block;
  width: 100%;
  padding: 11px 16px;
  border: 0;
  border-top: 1px solid var(--color-border, #e5eaf3);
  background: #f8fafc;
  color: var(--color-text-light, #94a3b8);
  font-size: 13px;
  letter-spacing: 1px;
  text-align: center;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  font-family: inherit;
}

.consult-close-bottom:hover {
  color: var(--color-primary, #1d4ed8);
  background: var(--color-bg-light, #f6f8fc);
}

/* 表单区 */
.consult-body {
  padding: 20px 24px 18px;
}

.consult-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.consult-form input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--color-border, #e5eaf3);
  border-radius: 10px;
  font-size: 14px;
  background: var(--color-bg-light, #f6f8fc);
  box-sizing: border-box;
  transition: border-color 0.2s, background 0.2s;
  font-family: inherit;
}

.consult-form input:focus {
  outline: 0;
  border-color: var(--color-primary, #1d4ed8);
  background: #fff;
}

.consult-form input.error {
  border-color: #dc2626;
  background: #fef2f2;
}

.consult-field-error {
  color: #dc2626;
  font-size: 12px;
  margin-top: -4px;
  min-height: 16px;
}

.consult-submit {
  margin-top: 6px;
  padding: 13px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--color-accent, #f5a623), var(--color-accent-dark, #d98a06));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 1px;
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.consult-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(245, 166, 35, 0.32);
}

.consult-submit:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 成功提示 */
.consult-success {
  display: none;
  padding: 22px 16px;
  text-align: center;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border-radius: 12px;
  color: #065f46;
  font-weight: 600;
  font-size: 15px;
}

.consult-success.show { display: block; }

.consult-success-icon {
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto 10px;
  background: #10b981;
  border-radius: 50%;
  color: #fff;
  font-size: 28px;
  line-height: 48px;
}

/* 二维码区（弹窗底部） */
.consult-qr {
  text-align: center;
  padding: 14px 24px 22px;
  border-top: 1px dashed var(--color-border, #e5eaf3);
  margin-top: 6px;
}

.consult-qr-img {
  width: 128px;
  height: 128px;
  border: 4px solid #fff;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  display: block;
  margin: 0 auto 8px;
  background: #fff;
}

.consult-qr-tip {
  font-size: 12px;
  color: var(--color-text-secondary, #4b586e);
  font-weight: 500;
  margin: 0;
}

.consult-qr-tip strong {
  color: var(--color-primary, #1d4ed8);
}

/* 隐私小字 */
.consult-privacy {
  font-size: 11px;
  color: var(--color-text-light, #94a3b8);
  text-align: center;
  margin: 4px 0 0;
}

/* 直接拨打条（隐私小字下方） */
.consult-call {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border-radius: 10px;
  font-size: 12px;
  color: #9a3412;
}

.consult-call-num {
  color: var(--color-accent, #f5a623);
  font-weight: 700;
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.consult-call-num:hover {
  text-decoration: underline;
}

/* ===== 移动端适配 ===== */
@media (max-width: 480px) {
  .consult-overlay {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }
  .consult-modal {
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }
  /* 防止 flex 压缩头部/二维码区（否则关闭按钮可能被挤出可视区） */
  .consult-head { flex-shrink: 0; }
  .consult-qr { flex-shrink: 0; }
  .consult-body { flex: 1; overflow-y: auto; }
  .consult-close { top: 12px; right: 12px; }
}

/* ===== 浮动按钮在弹窗打开时隐藏 ===== */
.consult-fab.hidden { display: none; }
