/* 全站右下角问答智能体 —— 固定悬浮于视口 */
.qa-agent{
  position:fixed !important;
  right:28px;
  bottom:48px;
  z-index:1200 !important;
  font-family:"Noto Sans SC","PingFang SC","Microsoft YaHei",sans-serif;
  pointer-events:none;
}
.qa-agent > *{pointer-events:auto}
.qa-agent-fab{
  width:132px;
  height:132px;
  border:none;
  padding:0;
  background:transparent;
  cursor:pointer;
  filter:drop-shadow(0 16px 32px rgba(0,0,0,.5));
  position:relative;
  will-change:transform;
}
.qa-agent-fab-inner{
  width:100%;
  height:100%;
  border-radius:32px;
  position:relative;
}
.qa-agent-fab img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
  border-radius:28px;
  background:radial-gradient(circle at 40% 30%,rgba(56,189,248,.18),transparent 55%);
}
.qa-agent-fab-glow{
  position:absolute;
  inset:-8px;
  border-radius:34px;
  background:linear-gradient(135deg,rgba(56,189,248,.35),rgba(167,139,250,.25));
  filter:blur(14px);
  opacity:.55;
  z-index:-1;
}
.qa-agent-badge{
  position:absolute;
  top:-2px;
  right:-2px;
  min-width:26px;
  height:26px;
  padding:0 7px;
  border-radius:999px;
  background:linear-gradient(135deg,#22d3ee,#818cf8);
  color:#041018;
  font-size:12px;
  font-weight:800;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 4px 12px rgba(56,189,248,.45);
}

.qa-agent-panel{
  position:absolute;
  right:0;
  bottom:148px;
  width:min(380px,calc(100vw - 28px));
  height:min(520px,70vh);
  display:none;
  flex-direction:column;
  border-radius:22px;
  overflow:hidden;
  background:linear-gradient(165deg,rgba(18,22,42,.96),rgba(28,18,48,.94));
  border:1px solid rgba(167,139,250,.28);
  box-shadow:0 24px 60px rgba(0,0,0,.5),inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter:blur(18px);
  transform-origin:bottom right;
}
.qa-agent.open .qa-agent-panel{
  display:flex;
  animation:qaPanelIn .35s cubic-bezier(.22,1,.36,1);
}
@keyframes qaPanelIn{
  from{opacity:0;transform:translateY(16px) scale(.94)}
  to{opacity:1;transform:none}
}
.qa-agent-head{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 16px;
  border-bottom:1px solid rgba(255,255,255,.08);
  background:linear-gradient(90deg,rgba(56,189,248,.12),rgba(139,92,246,.1));
}
.qa-agent-head img{
  width:48px;
  height:48px;
  object-fit:contain;
  border-radius:14px;
  filter:drop-shadow(0 6px 14px rgba(56,189,248,.35));
}
.qa-agent-head h4{
  margin:0;
  font-size:1rem;
  font-weight:800;
  color:#f8fafc;
}
.qa-agent-head p{
  margin:2px 0 0;
  font-size:.78rem;
  color:#94a3b8;
}
.qa-agent-close{
  margin-left:auto;
  width:34px;
  height:34px;
  border:none;
  border-radius:10px;
  background:rgba(255,255,255,.06);
  color:#e2e8f0;
  cursor:pointer;
}
.qa-agent-close:hover{background:rgba(248,113,113,.18);color:#fda4af}
.qa-agent-msgs{
  flex:1;
  overflow-y:auto;
  padding:14px 14px 8px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.qa-msg{
  max-width:88%;
  padding:10px 12px;
  border-radius:14px;
  font-size:.9rem;
  line-height:1.55;
  color:#e2e8f0;
}
.qa-msg.bot{
  align-self:flex-start;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.06);
}
.qa-msg.user{
  align-self:flex-end;
  background:linear-gradient(135deg,rgba(56,189,248,.28),rgba(139,92,246,.28));
  border:1px solid rgba(56,189,248,.25);
}
.qa-agent-form{
  display:flex;
  gap:8px;
  padding:12px;
  border-top:1px solid rgba(255,255,255,.08);
  background:rgba(0,0,0,.18);
}
.qa-agent-form input{
  flex:1;
  min-width:0;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.05);
  color:#f8fafc;
  border-radius:12px;
  padding:10px 12px;
  font-size:.9rem;
  outline:none;
}
.qa-agent-form input:focus{
  border-color:rgba(56,189,248,.45);
  box-shadow:0 0 0 3px rgba(56,189,248,.12);
}
.qa-agent-form button{
  border:none;
  border-radius:12px;
  padding:0 14px;
  font-weight:700;
  color:#041018;
  background:linear-gradient(135deg,#22d3ee,#818cf8);
  cursor:pointer;
}
.qa-agent-form button:hover{filter:brightness(1.08)}
.qa-agent-hint{
  padding:0 14px 10px;
  font-size:.72rem;
  color:#64748b;
}
@media(max-width:576px){
  .qa-agent{right:14px;bottom:36px}
  .qa-agent-fab{width:108px;height:108px}
  .qa-agent-panel{bottom:124px;height:min(480px,68vh)}
}
