/* ===== FOSO AI 客服悬浮窗 ===== */
#fchat-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 99990;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
#fchat-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: #F2CA6B;
  color: #231815;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(35, 24, 21, 0.25);
  transition: transform 0.15s ease;
}
#fchat-btn:hover { transform: scale(1.06); }
#fchat-btn.open { background: #231815; color: #F2CA6B; }
#fchat-dot {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #B4453C;
  border: 2px solid #fff;
}

#fchat-panel {
  position: absolute;
  right: 0;
  bottom: 70px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(35, 24, 21, 0.12);
  box-shadow: 0 12px 40px rgba(35, 24, 21, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#fchat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 12px;
  background: #231815;
  color: #fff;
  flex: 0 0 auto;
}
.fchat-ava {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #F2CA6B;
  color: #231815;
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fchat-title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.fchat-sub { font-size: 11px; opacity: 0.65; line-height: 1.3; }
#fchat-close {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
}
#fchat-close:hover { color: #fff; }

#fchat-msgs {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 12px;
  background: #FAF7F1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fchat-msg { display: flex; }
.fchat-user { justify-content: flex-end; }
.fchat-bubble {
  max-width: 84%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.65;
  word-break: break-word;
}
.fchat-bot .fchat-bubble {
  background: #fff;
  color: #231815;
  border: 1px solid rgba(35, 24, 21, 0.1);
  border-top-left-radius: 4px;
}
.fchat-user .fchat-bubble {
  background: #F2CA6B;
  color: #231815;
  border-top-right-radius: 4px;
}
.fchat-hint .fchat-bubble {
  background: transparent;
  border: none;
  color: #8a8378;
  font-size: 12px;
  text-align: center;
  max-width: 100%;
}

.fchat-dots { display: inline-flex; gap: 4px; padding: 4px 2px; }
.fchat-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b9b2a4;
  animation: fchatBlink 1.2s infinite ease-in-out;
}
.fchat-dots i:nth-child(2) { animation-delay: 0.2s; }
.fchat-dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes fchatBlink {
  0%, 80%, 100% { opacity: 0.35; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}
.fchat-caret {
  display: inline-block;
  width: 2px;
  height: 13px;
  background: #F2CA6B;
  margin-left: 2px;
  vertical-align: -2px;
  animation: fchatBlink 0.9s infinite;
}

#fchat-chips {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  overflow-x: auto;
  background: #FAF7F1;
  border-top: 1px solid rgba(35, 24, 21, 0.06);
}
.fchat-chip {
  flex: 0 0 auto;
  border: 1px solid rgba(35, 24, 21, 0.25);
  background: #fff;
  color: #231815;
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.fchat-chip:hover { background: #F2CA6B; border-color: #F2CA6B; }

#fchat-inputbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid rgba(35, 24, 21, 0.1);
}
#fchat-input {
  flex: 1 1 auto;
  border: 1px solid rgba(35, 24, 21, 0.2);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
  outline: none;
  color: #231815;
  min-width: 0;
}
#fchat-input:focus { border-color: #F2CA6B; }
#fchat-send {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: #F2CA6B;
  color: #231815;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
#fchat-send:hover { background: #e6ba4f; }
#fchat-send:disabled { opacity: 0.5; cursor: default; }

@media (max-width: 480px) {
  #fchat-root { right: 14px; bottom: 14px; }
  #fchat-panel { height: calc(100vh - 90px); }
}

@media (prefers-reduced-motion: reduce) {
  #fchat-btn, .fchat-dots i, .fchat-caret { animation: none; transition: none; }
}
