/* 尚选生态在线客服悬浮窗：独立样式，不依赖首页或普通页面 CSS */
#sx-customer-widget,
#sx-customer-widget * {
  box-sizing: border-box;
}

#sx-customer-widget {
  position: fixed !important;
  right: 24px !important;
  bottom: 24px !important;
  z-index: 2147483000 !important;
  width: 64px;
  height: 64px;
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.5;
}

#sx-customer-trigger {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 64px !important;
  min-width: 64px !important;
  height: 64px !important;
  min-height: 64px !important;
  margin: 0 !important;
  padding: 5px !important;
  border: 1px solid rgba(13, 74, 67, .12) !important;
  border-radius: 18px !important;
  background: #fff !important;
  box-shadow: 0 10px 30px rgba(13, 74, 67, .25) !important;
  cursor: pointer !important;
  overflow: visible !important;
  appearance: none !important;
  transition: transform .2s ease, box-shadow .2s ease !important;
}

#sx-customer-trigger:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 14px 36px rgba(13, 74, 67, .32) !important;
}

#sx-customer-trigger img {
  display: block !important;
  width: 52px !important;
  max-width: 52px !important;
  height: 52px !important;
  min-height: 52px !important;
  object-fit: contain !important;
  border-radius: 13px !important;
  background: #fff !important;
}

#sx-customer-trigger .sx-customer-label {
  position: absolute;
  right: 74px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 78px;
  padding: 8px 12px;
  border-radius: 9px;
  background: #0d4a43;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .14);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}

#sx-customer-trigger:hover .sx-customer-label,
#sx-customer-trigger:focus-visible .sx-customer-label {
  opacity: 1;
  visibility: visible;
}

#sx-customer-badge {
  position: absolute !important;
  top: -5px !important;
  right: -5px !important;
  display: none;
  align-items: center;
  justify-content: center;
  width: 22px !important;
  height: 22px !important;
  border: 2px solid #fff !important;
  border-radius: 50% !important;
  background: #d29b32 !important;
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}

#sx-customer-badge.is-visible { display: flex !important; }

#sx-customer-panel {
  position: absolute !important;
  right: 0 !important;
  bottom: 78px !important;
  display: flex !important;
  flex-direction: column !important;
  width: 380px !important;
  max-width: calc(100vw - 32px) !important;
  height: 560px !important;
  max-height: calc(100vh - 120px) !important;
  max-height: calc(100dvh - 120px) !important;
  border: 1px solid rgba(13, 74, 67, .10) !important;
  border-radius: 20px !important;
  background: #fff !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .24) !important;
  overflow: hidden !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateY(14px) scale(.96) !important;
  transform-origin: bottom right !important;
  transition: opacity .2s ease, visibility .2s ease, transform .22s ease !important;
}

#sx-customer-panel.is-open {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) scale(1) !important;
}

.sx-customer-header {
  display: flex !important;
  align-items: center !important;
  gap: 11px !important;
  flex: 0 0 auto !important;
  padding: 15px 16px !important;
  background: linear-gradient(135deg, #14756a, #0d4a43) !important;
}

.sx-customer-header-avatar {
  display: block !important;
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  border: 2px solid rgba(255,255,255,.62) !important;
  border-radius: 12px !important;
  object-fit: contain !important;
  background: #fff !important;
}

.sx-customer-header-info { flex: 1 1 auto !important; min-width: 0 !important; }
.sx-customer-name { color: #fff !important; font-size: 15px !important; font-weight: 700 !important; }
.sx-customer-status { margin-top: 2px !important; color: rgba(255,255,255,.82) !important; font-size: 12px !important; }
.sx-customer-status::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #55e28b; }

#sx-customer-close {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: rgba(255,255,255,.10) !important;
  color: #fff !important;
  font-size: 25px !important;
  line-height: 1 !important;
  cursor: pointer !important;
}

#sx-customer-close:hover { background: rgba(255,255,255,.20) !important; }

#sx-customer-messages {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  padding: 16px !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  background: #f7faf9 !important;
  scrollbar-width: thin;
}

.sx-customer-message {
  display: flex !important;
  gap: 8px !important;
  width: 100% !important;
  margin: 0 0 13px !important;
}

.sx-customer-message.is-user { justify-content: flex-end !important; }

.sx-customer-message-avatar {
  display: block !important;
  flex: 0 0 30px !important;
  width: 30px !important;
  height: 30px !important;
  border-radius: 9px !important;
  object-fit: contain !important;
  background: #fff !important;
  box-shadow: 0 2px 8px rgba(13,74,67,.12) !important;
}

.sx-customer-bubble {
  max-width: 82% !important;
  padding: 10px 13px !important;
  border-radius: 13px !important;
  font-size: 13px !important;
  line-height: 1.7 !important;
  text-align: left !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
}

.sx-customer-message.is-bot .sx-customer-bubble {
  border-bottom-left-radius: 4px !important;
  background: #fff !important;
  color: #273b38 !important;
  box-shadow: 0 4px 14px rgba(13,74,67,.08) !important;
}

.sx-customer-message.is-user .sx-customer-bubble {
  border-bottom-right-radius: 4px !important;
  background: #14756a !important;
  color: #fff !important;
}

#sx-customer-quick {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 7px !important;
  flex: 0 0 auto !important;
  padding: 10px 12px !important;
  border-top: 1px solid #edf2f0 !important;
  background: #fff !important;
}

.sx-customer-quick-btn {
  width: auto !important;
  min-width: 0 !important;
  min-height: 32px !important;
  height: 32px !important;
  margin: 0 !important;
  padding: 0 11px !important;
  border: 1px solid rgba(20,117,106,.35) !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: #12675e !important;
  font-size: 12px !important;
  cursor: pointer !important;
}

.sx-customer-quick-btn:hover { background: #14756a !important; color: #fff !important; }

.sx-customer-actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
  padding: 0 12px 10px !important;
  background: #fff !important;
}

.sx-customer-action {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 38px !important;
  padding: 8px 10px !important;
  border-radius: 10px !important;
  text-decoration: none !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

.sx-customer-action.is-phone { background: #14756a !important; color: #fff !important; }
.sx-customer-action.is-message { border: 1px solid #d8a542 !important; background: #fff9ec !important; color: #8d6517 !important; }

.sx-customer-input-row {
  display: flex !important;
  gap: 8px !important;
  align-items: flex-end !important;
  flex: 0 0 auto !important;
  padding: 11px 12px 13px !important;
  border-top: 1px solid #edf2f0 !important;
  background: #fff !important;
}

#sx-customer-input {
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 42px !important;
  max-height: 88px !important;
  margin: 0 !important;
  padding: 10px 12px !important;
  border: 1px solid #dce6e3 !important;
  border-radius: 11px !important;
  outline: 0 !important;
  resize: none !important;
  background: #fff !important;
  color: #243b37 !important;
  font: inherit !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
}

#sx-customer-input:focus { border-color: #14756a !important; box-shadow: 0 0 0 3px rgba(20,117,106,.10) !important; }

#sx-customer-send {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 42px !important;
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 11px !important;
  background: #14756a !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}

#sx-customer-send:hover { background: #0d4a43 !important; }

@media (max-width: 640px) {
  #sx-customer-widget {
    right: 14px !important;
    bottom: 14px !important;
  }

  #sx-customer-trigger {
    width: 58px !important;
    min-width: 58px !important;
    height: 58px !important;
    min-height: 58px !important;
    border-radius: 16px !important;
  }

  #sx-customer-trigger img {
    width: 48px !important;
    max-width: 48px !important;
    height: 48px !important;
    min-height: 48px !important;
  }

  #sx-customer-trigger .sx-customer-label { display: none !important; }

  #sx-customer-panel {
    position: fixed !important;
    right: 12px !important;
    bottom: 82px !important;
    width: calc(100vw - 24px) !important;
    max-width: none !important;
    height: calc(100vh - 100px) !important;
    
    max-height: calc(100vh - 100px) !important;
    max-height: calc(100dvh - 100px) !important;
    border-radius: 18px !important;
  }
}
