/* 门户右下角智能客服：与药海 XandaCsChat 同款 */
.xd-cs-wrap {
  position: relative;
  z-index: 10050;
}

.xd-cs-fab {
  position: fixed;
  right: 18px;
  bottom: 32px;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.38);
  cursor: pointer;
  overflow: hidden;
  z-index: 10051;
  display: flex;
  align-items: center;
  justify-content: center;
}

.xd-cs-fab:hover {
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.48);
}

.xd-cs-fab.is-hidden {
  display: none;
}

.xd-cs-fab-logo {
  width: 38px;
  height: 38px;
  color: #fff;
  display: block;
}

.xd-cs-top {
  position: fixed;
  right: 25px;
  bottom: 98px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #38bdf8;
  color: #fff;
  box-shadow: 0 3px 12px rgba(2, 132, 199, 0.28);
  cursor: pointer;
  z-index: 10051;
  display: none;
  align-items: center;
  justify-content: center;
}

.xd-cs-top.is-visible {
  display: flex;
}

.xd-cs-top:hover {
  background: #0284c7;
}

.xd-cs-top svg {
  width: 18px;
  height: 18px;
  display: block;
}

.xd-cs-panel {
  position: fixed;
  top: 80px;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 100vw;
  background: #fff;
  box-shadow: -6px 0 20px rgba(15, 23, 42, 0.1);
  display: flex;
  flex-direction: column;
  transform: translateX(110%);
  transition: transform 0.2s ease;
  z-index: 10052;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.xd-cs-panel.is-open {
  transform: translateX(0);
}

.xd-cs-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  background: #165d8a;
  color: #fff;
  flex-shrink: 0;
  min-height: 48px;
}

.xd-cs-header-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.xd-cs-header-logo {
  width: 18px;
  height: 18px;
  color: #fff;
  display: block;
}

.xd-cs-header-text {
  flex: 1;
  min-width: 0;
}

.xd-cs-header-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.xd-cs-header-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.78);
}

.xd-cs-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
}

.xd-cs-header-link,
.xd-cs-header-close {
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  padding: 3px 6px;
  line-height: 1;
}

.xd-cs-header-link {
  font-size: 11px;
  opacity: 0.85;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 3px;
  padding: 3px 7px;
}

.xd-cs-header-link:hover,
.xd-cs-header-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
}

.xd-cs-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  background: #f3f5f7;
}

.xd-cs-bubble {
  max-width: 92%;
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  word-break: break-word;
}

.xd-cs-bubble-user {
  margin-left: auto;
  background: #165d8a;
  color: #fff;
  border-bottom-right-radius: 3px;
}

.xd-cs-bubble-bot {
  margin-right: auto;
  background: #fff;
  color: #1e293b;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  border-bottom-left-radius: 3px;
}

.xd-cs-bubble-bot a {
  color: #165d8a;
  text-decoration: underline;
  cursor: pointer;
  word-break: break-all;
}

.xd-cs-bubble-error {
  color: #b91c1c;
}

.xd-cs-bubble-wait {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 12px;
}

.xd-cs-typing {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 12px;
}

.xd-cs-typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #165d8a;
  opacity: 0.28;
  animation: xdCsTyping 1.15s ease-in-out infinite;
}

.xd-cs-typing i:nth-child(2) {
  animation-delay: 0.18s;
}

.xd-cs-typing i:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes xdCsTyping {
  0%,
  70%,
  100% {
    opacity: 0.28;
    transform: translateY(0);
  }
  35% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.xd-cs-bubble-streaming::after {
  content: "▍";
  margin-left: 2px;
  color: #165d8a;
  animation: xdCsCaret 1s step-end infinite;
}

@keyframes xdCsCaret {
  50% {
    opacity: 0;
  }
}

.xd-cs-session-split {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 8px;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1;
}

.xd-cs-session-split::before,
.xd-cs-session-split::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.xd-cs-composer {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 8px 10px 10px;
  border-top: 1px solid #e8edf2;
  background: #fff;
  flex-shrink: 0;
}

.xd-cs-input {
  flex: 1;
  min-height: 32px;
  max-height: 96px;
  border: 1px solid #d7dee6;
  border-radius: 6px;
  resize: none;
  font-size: 13px;
  line-height: 1.45;
  padding: 6px 10px;
  font-family: inherit;
  outline: none;
}

.xd-cs-input:focus {
  border-color: #165d8a;
  box-shadow: 0 0 0 2px rgba(22, 93, 138, 0.12);
}

.xd-cs-send {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: 0;
  border-radius: 6px;
  background: #165d8a;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.xd-cs-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .xd-cs-panel {
    top: 0;
    width: 100%;
  }
}

/* 旧浮条若残留则隐藏 */
.onlineService,
.box_os {
  display: none !important;
}
