/* 羽信安官网全站右下角 AI 客服悬浮组件样式（暗色金蓝视觉体系，零全局样式污染） */
#yx-ai-root, #yx-ai-root * {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}
@keyframes yxPulseRing {
  0%   { box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 0 0 rgba(245, 195, 99, 0.55); }
  70%  { box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 0 14px rgba(245, 195, 99, 0); }
  100% { box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 0 0 rgba(245, 195, 99, 0); }
}
@keyframes yxFloatTip {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}
@keyframes yxPopIn {
  from { opacity: 0; transform: translateY(8px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes yxIconWiggle {
  0%, 82%, 100% { transform: rotate(0deg); }
  86% { transform: rotate(-10deg); }
  92% { transform: rotate(10deg); }
  96% { transform: rotate(-5deg); }
}
#yx-ai-fab {
  position: fixed;
  right: 22px;
  bottom: 24px;
  z-index: 9990;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(245, 195, 99, 0.65);
  background: linear-gradient(135deg, #f5c363 0%, #d98a2b 100%);
  color: #140e04;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  animation: yxPulseRing 2.6s ease-out infinite;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
#yx-ai-fab:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 16px 38px rgba(245, 195, 99, 0.36), 0 0 0 1px rgba(255, 255, 255, 0.25) inset;
}
#yx-ai-fab svg {
  flex-shrink: 0;
  animation: yxIconWiggle 4.2s ease-in-out infinite;
}
.yx-fab-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(20, 14, 4, 0.28);
  flex-shrink: 0;
}
#yx-ai-callout {
  position: fixed;
  right: 22px;
  bottom: 80px;
  z-index: 9989;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 9px 12px 9px 14px;
  border-radius: 12px;
  border: 1px solid rgba(245, 195, 99, 0.48);
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(12px);
  color: #fef3c7;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  animation: yxPopIn 0.35s ease-out, yxFloatTip 2.8s ease-in-out 0.4s infinite;
}
#yx-ai-callout.show { display: inline-flex; }
#yx-ai-callout::after {
  content: "";
  position: absolute;
  right: 26px;
  bottom: -6px;
  width: 10px;
  height: 10px;
  background: rgba(15, 23, 42, 0.96);
  border-right: 1px solid rgba(245, 195, 99, 0.48);
  border-bottom: 1px solid rgba(245, 195, 99, 0.48);
  transform: rotate(45deg);
}
#yx-ai-callout:hover {
  border-color: #f5c363;
  color: #fff;
}
.yx-callout-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}
.yx-callout-close:hover { color: #fff; }
@media (prefers-reduced-motion: reduce) {
  #yx-ai-fab, #yx-ai-fab svg, #yx-ai-callout { animation: none !important; }
}

#yx-ai-panel {
  position: fixed;
  right: 22px;
  bottom: 82px;
  z-index: 9991;
  width: 400px;
  max-width: calc(100vw - 24px);
  height: 580px;
  max-height: calc(100vh - 110px);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(11, 18, 34, 0.97);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.72);
  display: none;
  flex-direction: column;
  overflow: hidden;
  color: #f1f5f9;
}
#yx-ai-panel.open { display: flex; }

.yx-ai-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(245, 195, 99, 0.09), rgba(15, 23, 42, 0.2));
}
.yx-ai-hd-l { display: flex; align-items: center; gap: 10px; }
.yx-ai-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
}
.yx-ai-hd b { display: block; font-size: 14.5px; color: #fff; font-weight: 800; }
.yx-ai-hd small { display: block; font-size: 11.5px; color: #94a3b8; margin-top: 1px; }
.yx-ai-hd-r { display: flex; align-items: center; gap: 6px; }
.yx-ai-ibtn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 12px;
  cursor: pointer;
}
.yx-ai-ibtn:hover { border-color: rgba(245, 195, 99, 0.6); color: #f5c363; }

.yx-ai-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.yx-ai-row { display: flex; }
.yx-ai-row.user { justify-content: flex-end; }
.yx-ai-row.bot { justify-content: flex-start; }
.yx-ai-bub {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.65;
  word-break: break-word;
}
.yx-ai-row.user .yx-ai-bub {
  background: linear-gradient(135deg, #f5c363, #d98a2b);
  color: #161004;
  font-weight: 600;
  border-bottom-right-radius: 4px;
}
.yx-ai-row.bot .yx-ai-bub {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #e2e8f0;
  border-bottom-left-radius: 4px;
}
.yx-ai-bub code {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}
.yx-ai-bub b { color: #fff; }
.yx-ai-bub a { color: #f5c363; text-decoration: underline; }

.yx-ai-quicks {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 2px;
}
.yx-ai-q {
  background: rgba(245, 195, 99, 0.08);
  border: 1px solid rgba(245, 195, 99, 0.28);
  color: #f8dfa4;
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.yx-ai-q:hover {
  background: rgba(245, 195, 99, 0.18);
  border-color: rgba(245, 195, 99, 0.65);
  color: #fff;
}

.yx-ai-foot {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 11px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 13, 26, 0.9);
}
#yx-ai-input {
  flex: 1;
  resize: none;
  min-height: 38px;
  max-height: 96px;
  padding: 8px 11px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  font-size: 13.5px;
  line-height: 1.45;
  outline: none;
}
#yx-ai-input:focus { border-color: rgba(245, 195, 99, 0.65); }
#yx-ai-send {
  padding: 9px 15px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #f5c363, #d98a2b);
  color: #161004;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
}
#yx-ai-send:disabled { opacity: 0.55; cursor: not-allowed; }

.yx-ai-tip {
  padding: 6px 12px 10px;
  font-size: 11px;
  color: #64748b;
  text-align: center;
  background: rgba(8, 13, 26, 0.9);
}
.yx-ai-tip a { color: #f5c363; text-decoration: none; }
.yx-ai-tip a:hover { text-decoration: underline; }

@media (max-width: 560px) {
  #yx-ai-fab { right: 14px; bottom: 16px; padding: 10px 14px; font-size: 13px; }
  #yx-ai-callout { right: 14px; bottom: 68px; font-size: 12.5px; }
  #yx-ai-panel { right: 10px; left: 10px; width: auto; bottom: 68px; height: 74vh; }
}
