/* 卓越红点 · 官网 AI 客服 */
.site-chat-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.site-chat-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.site-chat-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2001;
  max-width: 480px;
  margin: 0 auto;
  height: min(60dvh, 520px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 40px rgba(28, 42, 58, 0.18);
  transform: translateY(100%);
  transition: transform 0.28s ease;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.site-chat-panel.is-open {
  transform: translateY(0);
}

.site-chat-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e6eb;
}

.site-chat-panel__head span {
  font-size: 15px;
  font-weight: 600;
  color: #1c2a3a;
}

.site-chat-panel__close {
  border: none;
  background: transparent;
  padding: 6px 12px;
  font-size: 14px;
  color: #86909c;
  cursor: pointer;
  border-radius: 999px;
}

.site-chat-panel__close:hover {
  background: #f7f8fa;
}

.site-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.site-chat-welcome {
  padding: 10px 12px;
  background: #f7f8fa;
  border-radius: 8px;
  font-size: 14px;
  color: #4e5969;
  line-height: 1.5;
}

.site-chat-bubble {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.site-chat-bubble--user {
  align-self: flex-end;
  background: #c41e1e;
  color: #fff;
}

.site-chat-bubble--ai {
  align-self: flex-start;
  background: #f2f3f5;
  color: #1d2129;
}

.site-chat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 8px;
}

.site-chat-quick button {
  border: 1px solid #e5e6eb;
  background: #f7f8fa;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  color: #4e5969;
  cursor: pointer;
}

.site-chat-quick button:hover {
  border-color: #c41e1e;
  color: #c41e1e;
}

.site-chat-foot {
  border-top: 1px solid #e5e6eb;
  padding: 12px 16px;
}

.site-chat-input-row {
  display: flex;
  gap: 8px;
}

.site-chat-input-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid #e5e6eb;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
}

.site-chat-input-row input:focus {
  border-color: rgba(196, 30, 30, 0.45);
}

.site-chat-input-row button {
  flex-shrink: 0;
  border: none;
  background: #c41e1e;
  color: #fff;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.site-chat-input-row button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.site-chat-material {
  display: block;
  margin-top: 8px;
  text-align: center;
  font-size: 12px;
  color: #c41e1e;
}

.site-chat-material:hover {
  text-decoration: underline;
}

@media (min-width: 768px) {
  .site-chat-panel {
    left: auto;
    right: 24px;
    bottom: 24px;
    border-radius: 16px;
    height: min(520px, 70vh);
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.28s ease, opacity 0.28s ease, visibility 0.28s ease;
  }

  .site-chat-panel.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
}
