/* 官网 AI 客服浮层 — ChatGPT 风格 */

.site-support-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 150;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #10a37f 0%, #0d8f6e 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(16, 163, 127, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.site-support-fab:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 28px rgba(16, 163, 127, 0.45), 0 4px 12px rgba(0, 0, 0, 0.25);
}

.site-support-fab.hidden {
  display: none;
}

.site-support-fab svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.site-support-panel {
  position: fixed;
  right: 24px;
  bottom: 92px;
  z-index: 150;
  width: min(400px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 120px));
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.92) translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.site-support-panel.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.site-support-panel.hidden {
  display: none;
}

.site-support-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #f7f7f8;
  border-bottom: 1px solid #ececf1;
  flex-shrink: 0;
}

.site-support-header-title {
  font-size: 15px;
  font-weight: 600;
  color: #202123;
  margin: 0;
}

.site-support-header-actions {
  display: flex;
  gap: 4px;
}

.site-support-icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #6e6e80;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-support-icon-btn:hover {
  background: #ececf1;
  color: #202123;
}

.site-support-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #fff;
}

.site-support-msg {
  display: flex;
  gap: 10px;
  max-width: 100%;
}

.site-support-msg.user {
  flex-direction: row-reverse;
}

.site-support-avatar {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.site-support-msg.assistant .site-support-avatar {
  background: #10a37f;
  color: #fff;
}

.site-support-msg.user .site-support-avatar {
  background: #5436da;
  color: #fff;
}

.site-support-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
  max-width: calc(100% - 38px);
}

.site-support-msg.assistant .site-support-bubble {
  background: #f7f7f8;
  color: #353740;
  border-top-left-radius: 4px;
}

.site-support-msg.user .site-support-bubble {
  background: #f0f0f0;
  color: #202123;
  border-top-right-radius: 4px;
}

.site-support-msg.error .site-support-bubble {
  background: #fef2f2;
  color: #b91c1c;
}

.site-support-typing {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.site-support-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #acacbe;
  animation: site-support-dot 1.2s infinite ease-in-out;
}

.site-support-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.site-support-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes site-support-dot {
  0%, 80%, 100% { opacity: 0.35; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}

.site-support-composer {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 12px 14px;
  border-top: 1px solid #ececf1;
  background: #fff;
  flex-shrink: 0;
}

.site-support-input {
  flex: 1;
  min-height: 42px;
  max-height: 120px;
  resize: none;
  border: 1px solid #d9d9e3;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.4;
  outline: none;
  background: #fff;
  color: #202123;
}

.site-support-input:focus {
  border-color: #10a37f;
  box-shadow: 0 0 0 2px rgba(16, 163, 127, 0.15);
}

.site-support-send {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 10px;
  background: #10a37f;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.site-support-send:hover:not(:disabled) {
  background: #0d8f6e;
}

.site-support-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .site-support-fab {
    right: 16px;
    bottom: 16px;
  }

  .site-support-panel {
    right: 8px;
    bottom: 80px;
    width: calc(100vw - 16px);
    height: calc(100vh - 100px);
    border-radius: 12px;
  }
}
