/* 思文力得官网全站 AI 在线客服浮窗（深海蓝 v3 品牌系，全限定在 #swl-ai-root 作用域） */
#swl-ai-root, #swl-ai-root * { box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Malgun Gothic", sans-serif; }

#swl-ai-callout {
  position: fixed; right: 24px; bottom: 84px; z-index: 99991;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 12px;
  background: #ffffff; color: #061224;
  border: 1px solid rgba(11, 95, 255, 0.22);
  box-shadow: 0 10px 28px rgba(6, 18, 36, 0.16);
  font-size: 13px; font-weight: 600; line-height: 1.3;
  cursor: pointer; opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .28s ease, transform .28s ease;
}
#swl-ai-callout.show { opacity: 1; transform: translateY(0); pointer-events: auto; animation: swlFloat 3.4s ease-in-out infinite; }
#swl-ai-callout::after {
  content: ""; position: absolute; right: 26px; bottom: -6px;
  width: 10px; height: 10px; background: #fff;
  border-right: 1px solid rgba(11, 95, 255, 0.22); border-bottom: 1px solid rgba(11, 95, 255, 0.22);
  transform: rotate(45deg);
}
#swl-ai-callout .swl-callout-x {
  border: 0; background: transparent; color: #64748b; cursor: pointer;
  font-size: 15px; line-height: 1; padding: 0 2px;
}
#swl-ai-callout .swl-callout-x:hover { color: #061224; }

#swl-ai-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 99990;
  display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 18px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.16);
  background: linear-gradient(135deg, #061224 0%, #0b4fd6 100%);
  color: #ffffff; font-size: 14px; font-weight: 600; letter-spacing: 0.2px;
  cursor: pointer; box-shadow: 0 10px 28px rgba(6, 18, 36, 0.30);
  transition: transform .18s ease, box-shadow .18s ease;
}
#swl-ai-fab::before {
  content: ""; position: absolute; inset: -4px; border-radius: 999px;
  border: 2px solid rgba(11, 95, 255, 0.45); pointer-events: none;
  animation: swlPulseRing 2.6s ease-out infinite;
}
#swl-ai-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(11, 95, 255, 0.38); }
#swl-ai-fab .swl-fab-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.28); flex-shrink: 0;
}

#swl-ai-panel {
  position: fixed; right: 24px; bottom: 84px; z-index: 99992;
  width: 396px; max-width: calc(100vw - 24px); height: 576px; max-height: calc(100vh - 110px);
  display: none; flex-direction: column; overflow: hidden;
  background: #ffffff; border-radius: 16px;
  border: 1px solid rgba(6, 18, 36, 0.12);
  box-shadow: 0 22px 56px rgba(6, 18, 36, 0.26);
}
#swl-ai-panel.open { display: flex; }

.swl-ai-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, #061224 0%, #0d3b9e 100%);
  color: #ffffff; flex-shrink: 0;
}
.swl-ai-hd-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.swl-ai-dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.3); flex-shrink: 0; }
.swl-ai-hd-l b { display: block; font-size: 15px; font-weight: 700; line-height: 1.25; color: #fff; }
.swl-ai-hd-l small { display: block; font-size: 11.5px; color: rgba(255,255,255,0.8); margin-top: 2px; }
.swl-ai-hd-r { display: flex; align-items: center; gap: 6px; }
.swl-ai-ibtn {
  border: 1px solid rgba(255,255,255,0.22); background: rgba(255,255,255,0.1);
  color: #fff; font-size: 12px; padding: 4px 9px; border-radius: 8px; cursor: pointer;
}
.swl-ai-ibtn:hover { background: rgba(255,255,255,0.22); }

.swl-ai-body {
  flex: 1; overflow-y: auto; padding: 14px; background: #f8fafc;
  display: flex; flex-direction: column; gap: 11px;
}
.swl-msg { max-width: 88%; padding: 10px 13px; border-radius: 13px; font-size: 13.5px; line-height: 1.6; word-break: break-word; }
.swl-msg.bot { align-self: flex-start; background: #ffffff; color: #0f172a; border: 1px solid #e2e8f0; border-top-left-radius: 4px; }
.swl-msg.user { align-self: flex-end; background: #0b5fff; color: #ffffff; border-top-right-radius: 4px; }
.swl-msg a { color: #0b5fff; text-decoration: underline; }
.swl-msg.user a { color: #ffffff; }
.swl-msg code { background: #f1f5f9; color: #0f172a; padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }

.swl-quick-wrap { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.swl-quick-btn {
  text-align: left; font-size: 12.5px; line-height: 1.35;
  padding: 7px 11px; border-radius: 10px; cursor: pointer;
  background: #ffffff; color: #0b4fd6; border: 1px solid rgba(11, 95, 255, 0.24);
  transition: background .15s ease, border-color .15s ease;
}
.swl-quick-btn:hover { background: #eff6ff; border-color: #0b5fff; }

.swl-ai-foot {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 12px; background: #ffffff; border-top: 1px solid #e2e8f0; flex-shrink: 0;
}
#swl-ai-input {
  flex: 1; resize: none; min-height: 38px; max-height: 96px;
  padding: 8px 11px; border-radius: 10px; border: 1px solid #cbd5e1;
  font-size: 13.5px; line-height: 1.45; color: #0f172a; background: #f8fafc; outline: none;
}
#swl-ai-input:focus { border-color: #0b5fff; background: #ffffff; }
#swl-ai-send {
  height: 38px; padding: 0 15px; border-radius: 10px; border: 0;
  background: #0b5fff; color: #ffffff; font-size: 13.5px; font-weight: 600; cursor: pointer; flex-shrink: 0;
}
#swl-ai-send:disabled { opacity: 0.55; cursor: not-allowed; }

.swl-ai-tip {
  padding: 6px 12px 8px; text-align: center; font-size: 11px; color: #64748b;
  background: #ffffff; border-top: 1px solid #f1f5f9;
}
.swl-ai-tip a { color: #0b5fff; text-decoration: none; }

@keyframes swlPulseRing {
  0% { opacity: 0.65; transform: scale(1); }
  70% { opacity: 0; transform: scale(1.12); }
  100% { opacity: 0; transform: scale(1.12); }
}
@keyframes swlFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@media (prefers-reduced-motion: reduce) {
  #swl-ai-fab::before, #swl-ai-callout.show { animation: none !important; }
}
@media (max-width: 600px) {
  #swl-ai-fab { right: 14px; bottom: 16px; height: 44px; padding: 0 15px; font-size: 13.5px; }
  #swl-ai-callout { right: 14px; bottom: 70px; font-size: 12.5px; }
  #swl-ai-panel { right: 8px; left: 8px; bottom: 70px; width: auto; max-width: none; height: min(74vh, 540px); }
}
