/* ---------- AI 客服小助理（卡通女生·贴内容区左边缘垂直居中漂浮） ---------- */
/* 位置对齐 .container 的 1180px 居中容器：大屏时贴内容左边缘外侧，垂直居中；窄屏回落到视口左边缘 */
.assistant-fab {
  position: fixed;
  left: max(20px, calc((100vw - 1180px) / 2 - 82px));
  top: 50%;
  z-index: 95;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  border: 2px solid var(--gold, #B89968);
  background: #fff center/cover no-repeat;
  box-shadow: 0 10px 28px rgba(15, 44, 92, .28);
  cursor: pointer;
  padding: 0;
  animation: assistantFloat 3.2s ease-in-out infinite;
  transition: box-shadow .25s, filter .25s;
}
.assistant-fab:hover { box-shadow: 0 14px 34px rgba(15, 44, 92, .42); filter: brightness(1.04); }
.assistant-fab::after {
  content: "";
  position: absolute;
  right: -3px; top: -3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #E8553F;
  border: 2px solid #fff;
}
@keyframes assistantFloat {
  0%, 100% { transform: translateY(-50%); }
  50% { transform: translateY(calc(-50% - 10px)); }
}

.assistant-panel {
  position: fixed;
  left: max(20px, calc((100vw - 1180px) / 2 - 82px));
  top: 50%;
  z-index: 96;
  width: 360px;
  max-width: calc(100vw - 36px);
  height: 70vh;
  max-height: 560px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(15, 44, 92, .26);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(-50%);
  transform-origin: left center;
  animation: assistantPop .22s ease;
  font-family: inherit;
}
@keyframes assistantPop {
  from { opacity: 0; transform: translateY(calc(-50% + 12px)) scale(.96); }
  to { opacity: 1; transform: translateY(-50%) scale(1); }
}
.assistant-panel.hidden { display: none; }

.ap-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--blue, #0F2C5C), var(--blue-deep, #0B1D3F));
  color: #fff;
}
.ap-head img { width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(184,153,104,.7); background:#fff; }
.ap-head .ap-title { font-size: 15px; font-weight: 800; line-height: 1.2; }
.ap-head .ap-sub { font-size: 11.5px; color: rgba(255,255,255,.72); margin-top: 2px; }
.ap-close {
  margin-left: auto;
  background: none; border: none; color: rgba(255,255,255,.85);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.ap-close:hover { color: #fff; }

.ap-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #F6F8FB;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ap-msg { max-width: 84%; font-size: 14px; line-height: 1.7; padding: 10px 13px; border-radius: 14px; word-break: break-word; }
.ap-msg.bot { align-self: flex-start; background: #fff; color: #2C3342; border: 1px solid #E6ECF3; border-bottom-left-radius: 4px; }
.ap-msg.user { align-self: flex-end; background: var(--blue, #0F2C5C); color: #fff; border-bottom-right-radius: 4px; }
.ap-msg .ap-time { display: block; font-size: 10.5px; opacity: .5; margin-top: 4px; }
.ap-typing { align-self: flex-start; background: #fff; border: 1px solid #E6ECF3; border-radius: 14px; border-bottom-left-radius: 4px; padding: 12px 14px; }
.ap-typing span { display: inline-block; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%; background: #B9C4D2; animation: apBlink 1.2s infinite; }
.ap-typing span:nth-child(2) { animation-delay: .2s; }
.ap-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes apBlink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

.ap-foot {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #EDF1F6;
  background: #fff;
}
.ap-foot input {
  flex: 1;
  border: 1px solid #D8E0EA;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.ap-foot input:focus { border-color: var(--gold, #B89968); }
.ap-foot button {
  flex-shrink: 0;
  border: none;
  background: var(--blue, #0F2C5C);
  color: #fff;
  border-radius: 999px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.ap-foot button:disabled { opacity: .5; cursor: default; }
.ap-foot button:hover:not(:disabled) { background: var(--blue-deep, #0B1D3F); }

@media (max-width: 480px) {
  .assistant-panel { left: 12px; width: calc(100vw - 24px); max-width: none; height: 64vh; }
  .assistant-fab { width: 60px; height: 60px; }
}
