.lx-ai-cs {
  --lx-ai-blue: #2b88ff;
  --lx-ai-blue-deep: #177ff9;
  --lx-ai-blue-soft: #eaf3ff;
  --lx-ai-text: #1f2a37;
  --lx-ai-muted: #6b7280;
  --lx-ai-line: #e5eaf0;
  --lx-ai-panel: #ffffff;
  --lx-ai-shadow: 0 12px 40px rgba(23, 127, 249, 0.18), 0 2px 10px rgba(15, 23, 42, 0.08);
  position: relative;
  z-index: 10050;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.lx-ai-cs__fab {
  position: fixed;
  right: 32px;
  bottom: 100px;
  width: 68px;
  height: 68px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 10051;
  border-radius: 50%;
  overflow: hidden;
  transition: transform 0.22s ease, filter 0.22s ease;
  filter: drop-shadow(0 8px 18px rgba(43, 136, 255, 0.35));
}

.lx-ai-cs__fab img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
  border-radius: 50%;
}

.lx-ai-cs__fab:hover {
  transform: translateY(-3px) scale(1.04);
}

.lx-ai-cs__fab:active {
  transform: scale(0.97);
}

.lx-ai-cs__fab.is-open {
  transform: scale(0.92);
  opacity: 0;
  pointer-events: none;
}

.lx-ai-cs__panel {
  position: fixed;
  right: 32px;
  bottom: 100px;
  width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  background: var(--lx-ai-panel);
  border-radius: 18px;
  box-shadow: var(--lx-ai-shadow);
  overflow: hidden;
  z-index: 10052;
  border: 1px solid rgba(43, 136, 255, 0.12);
  transform-origin: bottom right;
  animation: lx-ai-cs-in 0.22s ease;
}

.lx-ai-cs__panel[hidden] {
  display: none !important;
}

@keyframes lx-ai-cs-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.lx-ai-cs__header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 12px;
  background: linear-gradient(135deg, #2b88ff 0%, #177ff9 100%);
  color: #fff;
}

.lx-ai-cs__header-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.lx-ai-cs__avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2);
  object-fit: contain;
  flex-shrink: 0;
}

.lx-ai-cs__titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.lx-ai-cs__titles strong {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

.lx-ai-cs__titles span {
  font-size: 12px;
  opacity: 0.88;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lx-ai-cs__close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.lx-ai-cs__close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.lx-ai-cs__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #f7f9fc;
  padding: 14px 12px;
  scroll-behavior: smooth;
}

.lx-ai-cs__messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lx-ai-cs__bubble {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
}

.lx-ai-cs__bubble a,
.lx-ai-cs__bubble .lx-ai-cs__link {
  color: var(--lx-ai-blue-deep);
  text-decoration: underline;
  word-break: normal;
  cursor: pointer;
  pointer-events: auto;
  font-weight: 600;
}

.lx-ai-cs__bubble a:hover,
.lx-ai-cs__bubble .lx-ai-cs__link:hover {
  opacity: 0.85;
}

.lx-ai-cs__bubble--bot {
  align-self: flex-start;
  background: #fff;
  color: var(--lx-ai-text);
  border: 1px solid var(--lx-ai-line);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.lx-ai-cs__bubble--user {
  align-self: flex-end;
  background: var(--lx-ai-blue);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.lx-ai-cs__bubble--meta {
  align-self: center;
  max-width: 100%;
  background: transparent;
  color: var(--lx-ai-muted);
  font-size: 12px;
  padding: 4px 0;
  border: 0;
  box-shadow: none;
  white-space: normal;
}

.lx-ai-cs__typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 4px 2px;
}

.lx-ai-cs__typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9ca3af;
  animation: lx-ai-dot 1s infinite ease-in-out;
}

.lx-ai-cs__typing i:nth-child(2) {
  animation-delay: 0.15s;
}

.lx-ai-cs__typing i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes lx-ai-dot {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.lx-ai-cs__suggest {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  overflow-x: auto;
  background: #fff;
  border-top: 1px solid var(--lx-ai-line);
  scrollbar-width: thin;
}

.lx-ai-cs__suggest::-webkit-scrollbar {
  height: 4px;
}

.lx-ai-cs__chip {
  flex-shrink: 0;
  max-width: 180px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(43, 136, 255, 0.28);
  background: var(--lx-ai-blue-soft);
  color: var(--lx-ai-blue-deep);
  font-size: 12px;
  line-height: 1.3;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.lx-ai-cs__chip:hover {
  background: #dcebff;
  border-color: var(--lx-ai-blue);
}

.lx-ai-cs__composer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 12px;
  background: #fff;
  border-top: 1px solid var(--lx-ai-line);
}

.lx-ai-cs__input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--lx-ai-line);
  border-radius: 12px;
  background: #f7f9fc;
  color: var(--lx-ai-text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lx-ai-cs__input:focus {
  border-color: var(--lx-ai-blue);
  box-shadow: 0 0 0 3px rgba(43, 136, 255, 0.15);
  background: #fff;
}

.lx-ai-cs__send {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: var(--lx-ai-blue);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}

.lx-ai-cs__send:hover {
  background: var(--lx-ai-blue-deep);
}

.lx-ai-cs__send:active {
  transform: scale(0.96);
}

.lx-ai-cs__send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.lx-ai-cs__related {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lx-ai-cs__related-btn {
  text-align: left;
  border: 1px solid var(--lx-ai-line);
  background: #f7f9fc;
  color: var(--lx-ai-blue-deep);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12.5px;
  cursor: pointer;
  line-height: 1.4;
}

.lx-ai-cs__related-btn:hover {
  border-color: rgba(43, 136, 255, 0.4);
  background: var(--lx-ai-blue-soft);
}

@media (max-width: 768px) {
  .lx-ai-cs__fab {
    right: 4.267vw;
    bottom: calc(14.667vw + 16vw);
    width: 68px;
    height: 68px;
    max-width: 68px;
    max-height: 68px;
  }

  .lx-ai-cs__panel {
    right: 4.267vw;
    bottom: 4vw;
    width: calc(100vw - 8.534vw);
    height: min(72vh, 560px);
    border-radius: 16px;
  }
}
