/* ========================================
   学而升本官网 - 全局在线咨询浮窗
   ======================================== */

/* ---------- 浮动按钮 ---------- */
.chat-fab {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 9999;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #014DB2, #0066FF);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(1,77,178,0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: none;
  padding: 0;
}

.chat-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 32px rgba(1,77,178,0.45);
}

.chat-fab:active {
  transform: scale(0.95);
}

.chat-fab svg {
  width: 28px;
  height: 28px;
  fill: #fff;
}

/* 未读提示小圆点 */
.chat-fab__dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  background: #EF4444;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: chatPulse 2s ease-in-out infinite;
}

@keyframes chatPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.7; }
}

/* 展开时隐藏按钮文字/动画 */
.chat-fab--open {
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}

/* ---------- 遮罩层 ---------- */
.chat-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.15);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.chat-overlay--visible {
  opacity: 1;
  visibility: visible;
}

/* ---------- 弹窗卡片 ---------- */
.chat-popup {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 10001;
  width: 380px;
  max-height: 580px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 16px 56px rgba(0,0,0,0.18), 0 4px 12px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.96);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), opacity 0.25s ease, visibility 0.25s ease;
  transform-origin: bottom right;
}

.chat-popup--visible {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
}

/* 头部 */
.chat-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 0;
  flex-shrink: 0;
}

.chat-popup__title {
  font-size: 17px;
  font-weight: 700;
  color: #0A1628;
}

.chat-popup__close {
  width: 30px;
  height: 30px;
  border: none;
  background: #F3F4F6;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  flex-shrink: 0;
  padding: 0;
}

.chat-popup__close:hover {
  background: #E5E7EB;
}

.chat-popup__close svg {
  width: 14px;
  height: 14px;
  fill: #6B7280;
}

/* Tab 切换栏 */
.chat-tabs {
  display: flex;
  margin: 14px 20px 0;
  background: #F3F4F6;
  border-radius: 10px;
  padding: 3px;
  flex-shrink: 0;
}

.chat-tab {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 500;
  color: #6B7280;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.chat-tab:hover {
  color: #374151;
}

.chat-tab--active {
  background: #fff;
  color: #014DB2;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* 内容区 */
.chat-panels {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  position: relative;
}

.chat-panel {
  display: none;
  padding: 16px 20px 20px;
  animation: chatFadeIn 0.25s ease;
}

.chat-panel--active {
  display: block;
}

@keyframes chatFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== 快速留言表单 ===== */
.chat-form__group {
  margin-bottom: 12px;
}

.chat-form__group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 5px;
}

.chat-form__group label .req {
  color: #EF4444;
  margin-left: 2px;
}

.chat-form__input,
.chat-form__select,
.chat-form__textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  font-size: 14px;
  color: #1F2937;
  background: #FAFBFC;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
  box-sizing: border-box;
}

.chat-form__input:focus,
.chat-form__select:focus,
.chat-form__textarea:focus {
  border-color: #014DB2;
  box-shadow: 0 0 0 3px rgba(1,77,178,0.1);
  background: #fff;
}

.chat-form__textarea {
  resize: vertical;
  min-height: 72px;
}

.chat-form__submit {
  width: 100%;
  padding: 11px;
  background: linear-gradient(135deg, #014DB2, #0066FF);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease;
  margin-top: 4px;
}

.chat-form__submit:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.chat-form__submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.chat-form__msg {
  margin-top: 8px;
  font-size: 12px;
  text-align: center;
  min-height: 18px;
  border-radius: 8px;
  padding: 6px 10px;
  display: none;
}

.chat-form__msg--ok {
  display: block;
  background: #D1FAE5;
  color: #047857;
}

.chat-form__msg--err {
  display: block;
  background: #FEE2E2;
  color: #DC2626;
}

/* ===== 微信咨询面板 ===== */
.chat-wechat {
  text-align: center;
  padding: 8px 0 16px;
}

.chat-wechat__hint {
  font-size: 14px;
  font-weight: 500;
  color: #0A1628;
  margin-bottom: 4px;
}

.chat-wechat__sub {
  font-size: 12px;
  color: #6B7280;
  margin-bottom: 16px;
}

.chat-wechat__qr-wrap {
  width: 180px;
  height: 180px;
  margin: 0 auto 12px;
  border: 1.5px solid #E5E7EB;
  border-radius: 14px;
  padding: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.chat-wechat__qr {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
}

.chat-wechat__qr-placeholder {
  font-size: 12px;
  color: #9CA3AF;
}

.chat-wechat__id {
  font-size: 13px;
  color: #374151;
  margin-bottom: 10px;
}

.chat-wechat__id strong {
  color: #014DB2;
  font-weight: 600;
}

.chat-wechat__copy {
  display: inline-block;
  padding: 6px 18px;
  background: #F3F4F6;
  border: 1px solid #E5E7EB;
  border-radius: 20px;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-wechat__copy:hover {
  background: #E5E7EB;
  border-color: #D1D5DB;
}

.chat-wechat__copy--done {
  background: #D1FAE5;
  border-color: #6EE7B7;
  color: #047857;
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
  .chat-fab {
    bottom: 22px;
    right: 18px;
    width: 54px;
    height: 54px;
  }

  .chat-popup {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-height: 85vh;
    border-radius: 18px 18px 0 0;
    transform-origin: bottom center;
  }

  .chat-popup--visible {
    transform: translateY(0) scale(1);
  }
}

/* ========================================
   免费咨询居中弹窗（与浮窗视觉一致）
   ======================================== */
.consult-modal {
  position: fixed;
  inset: 0;
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.consult-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 22, 40, 0.45);
  animation: consultFade 0.25s ease;
}
.consult-modal__card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 24px;
  padding: 36px 32px 32px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
  animation: consultPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes consultPop {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@keyframes consultFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.consult-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: #F3F4F6;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  color: #6B7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.consult-modal__close:hover { background: #E5E7EB; }
.consult-modal__title {
  font-size: 22px;
  font-weight: 700;
  color: #0A1628;
  margin-bottom: 6px;
  padding-right: 30px;
}
.consult-modal__sub {
  font-size: 13px;
  color: #6B7280;
  margin-bottom: 18px;
}
.consult-modal__tabs {
  display: flex;
  gap: 4px;
  background: #F3F4F6;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
}
.consult-tab {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: transparent;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  color: #6B7280;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.consult-tab:hover { color: #374151; }
.consult-tab--active {
  background: #fff;
  color: #014DB2;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.consult-modal__panels { position: relative; }
.consult-panel { display: none; }
.consult-panel--active {
  display: block;
  animation: chatFadeIn 0.25s ease;
}
/* 弹窗内表单/微信面板直接复用 .chat-form / .chat-wechat 系列样式 */
