/* 数智邦 PC AI 客服 — 浅色官网风格；头像固定圆形尺寸 */
.szb-ai-fab {
  z-index: 60;
  color: #111827;
  cursor: pointer;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 999px;
  align-items: center;
  gap: 10px;
  padding: 6px 16px 6px 6px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  position: fixed;
  bottom: 24px;
  right: 24px;
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.08);
}
.szb-ai-fab:hover {
  transform: translateY(-2px);
  border-color: #4D7CFE;
}

/* 圆形头像：强制 36px，防止原图撑破 */
.szb-ai-fab img.szb-ai-fab-avatar,
img.szb-ai-fab-avatar {
  width: 36px !important;
  height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block !important;
  flex: none !important;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #E5E7EB;
  background: #EEF2FF;
}

.szb-ai-panel {
  z-index: 60;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 18px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  width: min(380px, 100vw - 32px);
  height: min(520px, 100vh - 96px);
  position: fixed;
  bottom: 20px;
  right: 20px;
  overflow: hidden;
  box-shadow: 0 24px 64px -8px rgba(0, 0, 0, 0.12);
}
.szb-ai-panel.is-hidden { display: none; }

.szb-ai-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #F8FAFC;
  border-bottom: 1px solid #E5E7EB;
}
.szb-ai-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.szb-ai-header img.szb-ai-avatar,
img.szb-ai-avatar {
  width: 42px !important;
  height: 42px !important;
  max-width: 42px !important;
  max-height: 42px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block !important;
  flex: none !important;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #E5E7EB;
  background: #EEF2FF;
}
.szb-ai-identity strong {
  color: #111827;
  font-size: 15px;
  display: block;
}
.szb-ai-identity small {
  color: #6B7280;
  font-size: 11px;
}
.szb-ai-close {
  color: #4B5563;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.szb-ai-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  background: #F5F7FB;
  border-bottom: 1px solid #F3F4F6;
}
.szb-ai-quick button {
  color: #4B5563;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  cursor: pointer;
}
.szb-ai-quick button:hover {
  color: #4D7CFE;
  border-color: #4D7CFE;
  background: #EEF2FF;
}

.szb-ai-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  overflow: auto;
  background: #F5F7FB;
}
.szb-ai-msg {
  white-space: pre-wrap;
  border-radius: 12px;
  max-width: 92%;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.55;
}
.szb-ai-msg.user {
  color: #fff;
  background: linear-gradient(135deg, #4D7CFE 0%, #6E92FF 100%);
  align-self: flex-end;
}
.szb-ai-msg.assistant {
  color: #111827;
  background: #fff;
  border: 1px solid #E5E7EB;
  align-self: flex-start;
}
.szb-ai-msg.assistant strong {
  font-weight: 650;
  color: #1f2937;
}
.szb-ai-msg .szb-ai-link {
  color: #4D7CFE;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}
.szb-ai-msg .szb-ai-link:hover {
  color: #3563e0;
}

.szb-ai-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border-top: 1px solid #E5E7EB;
}
.szb-ai-input input {
  color: #111827;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  outline: none;
  height: 40px;
  padding: 0 12px;
}
.szb-ai-input input:focus {
  border-color: #4D7CFE;
}
.szb-ai-input button {
  color: #fff;
  background: linear-gradient(135deg, #4D7CFE 0%, #6E92FF 100%);
  border: 0;
  border-radius: 10px;
  height: 40px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
}
.szb-ai-input button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 760px) {
  .szb-ai-fab {
    top: 72%;
    bottom: auto;
    right: 16px;
  }
  .szb-ai-panel {
    width: min(100vw - 20px, 380px);
    height: min(68vh, 520px);
    bottom: 10px;
    right: 10px;
  }
}
