.agent-interaction-card {
  display: grid;
  gap: 12px;
  padding: 14px 16px 16px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 16% 10%, rgba(108, 99, 255, .13), transparent 34%),
    linear-gradient(180deg, #fff 0%, #f7f4ff 100%);
}

.xiaobei-assistant-top {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.xiaobei-avatar-stage {
  position: relative;
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
}

.xiaobei-avatar-mark {
  position: relative;
  z-index: 2;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border: 4px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #6567ff, #37b9b0);
  box-shadow: 0 16px 30px rgba(41, 45, 68, .16);
  font-weight: 950;
}

.xiaobei-sound-ring {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: repeating-conic-gradient(from -8deg, rgba(147, 151, 164, .65) 0deg 2deg, transparent 2deg 5deg);
  mask: radial-gradient(circle, transparent 0 43px, #000 44px 52px, transparent 53px);
  animation: xiaobeiRingRotate 18s linear infinite;
}

.xiaobei-avatar-stage[data-state="listening"] .xiaobei-sound-ring,
.xiaobei-avatar-stage[data-state="speaking"] .xiaobei-sound-ring,
.xiaobei-avatar-stage[data-state="thinking"] .xiaobei-sound-ring {
  background: repeating-conic-gradient(from -8deg, rgba(86, 87, 255, .8) 0deg 3deg, transparent 3deg 7deg);
  animation-duration: 8s;
}

.xiaobei-hero-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.xiaobei-hero-copy > span {
  color: #6567ff;
  font-size: 12px;
  font-weight: 900;
}

.xiaobei-hero-copy h2 {
  margin: 0;
  color: #1f2d4d;
  font-size: 22px;
  font-weight: 950;
  line-height: 1.15;
}

.xiaobei-state-bubble {
  width: fit-content;
  min-width: 0;
  max-width: 260px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 16px;
  color: #6567ff;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 14px 34px rgba(91, 91, 255, .16);
  white-space: nowrap;
  animation: xiaobeiBubblePop .34s ease;
}

.xiaobei-state-bubble.pop {
  animation: xiaobeiBubblePop .34s ease;
}

.state-dots {
  display: flex;
  gap: 4px;
}

.state-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6567ff;
  animation: xiaobeiDotPulse 1.15s ease-in-out infinite;
}

.state-dots i:nth-child(2) {
  animation-delay: .16s;
}

.state-dots i:nth-child(3) {
  animation-delay: .32s;
}

.xiaobei-state-bubble strong {
  display: inline-block;
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
}

.voice-agent-widget {
  min-height: 0;
  font-family: "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
}

.voice-agent-panel {
  display: grid;
  gap: 12px;
}

.voice-agent-log {
  min-height: 180px;
  max-height: 260px;
  overflow-y: auto;
  padding: 14px;
  border: 1px solid rgba(232, 224, 255, .8);
  border-radius: 18px;
  background: rgba(255, 255, 255, .82);
}

.voice-agent-message {
  max-width: min(100%, 560px);
  margin-bottom: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  animation: voiceCardPop 260ms cubic-bezier(.2, .9, .25, 1.18) both;
}

.voice-agent-message.user {
  margin-left: auto;
  color: #fff;
  background: linear-gradient(135deg, rgba(91, 92, 255, .94), rgba(31, 185, 166, .88));
}

.voice-agent-message.bot {
  color: #0f172a;
  border: 1px solid rgba(255, 255, 255, .78);
  background: linear-gradient(135deg, rgba(255, 255, 255, .9), rgba(239, 246, 255, .74));
  box-shadow: 0 12px 26px rgba(31, 41, 55, .10);
}

.voice-agent-message.bot::before {
  content: "小贝";
  display: inline-flex;
  align-items: center;
  height: 20px;
  margin: 0 0 8px;
  padding: 0 9px;
  border-radius: 999px;
  color: #0f766e;
  background: rgba(209, 250, 244, .78);
  font-size: 11px;
  font-weight: 900;
}

.xiaobei-input-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 10px;
  align-items: center;
}

.xiaobei-input-wrap {
  position: relative;
  min-width: 0;
}

#voice-agent-input {
  width: 100%;
  min-height: 46px;
  height: 46px;
  margin: 0;
  padding: 0 16px 0 46px;
  resize: none;
  overflow: hidden;
  border: 3px solid #111827;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  line-height: 40px;
  background: #fff;
}

#voice-agent-input:focus {
  outline: none;
}

.input-mic-button {
  position: absolute;
  left: 17px;
  top: 50%;
  z-index: 2;
  width: 24px;
  height: 24px;
  border: 0;
  padding: 0;
  color: #111827;
  background: transparent;
  font-size: 0;
  transform: translateY(-50%);
  cursor: pointer;
}

.input-mic-button::before {
  content: "";
  width: 17px;
  height: 17px;
  display: block;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2'/%3E%3Cpath d='M12 19v3'/%3E%3Cpath d='M8 22h8'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2'/%3E%3Cpath d='M12 19v3'/%3E%3Cpath d='M8 22h8'/%3E%3C/svg%3E") center / contain no-repeat;
}

.input-mic-button.listening {
  color: #6557ff;
}

.input-mic-button.listening::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  background: rgba(101, 87, 255, .13);
  animation: micPulse 1.2s ease-in-out infinite;
}

.send-icon-button {
  width: 52px;
  height: 52px;
  min-height: 52px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  color: #fff;
  background: linear-gradient(135deg, #c084fc, #a855f7);
  box-shadow: 0 14px 28px rgba(168, 85, 247, .28);
  font-size: 22px;
  cursor: pointer;
}

#voice-agent-count {
  position: absolute;
  right: 64px;
  bottom: -15px;
  color: #8792a6;
  font-size: 12px;
}

.voice-agent-actions {
  display: flex;
  gap: 8px;
}

.voice-agent-actions button,
.agent-quick-prompts button,
.xiaobei-primary-functions button {
  cursor: pointer;
}

.voice-agent-actions button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(86, 87, 255, .28);
  border-radius: 12px;
  color: #5657ff;
  background: #fff;
  font-weight: 900;
}

.voice-agent-actions button.listening {
  color: #fff;
  background: #5657ff;
}

.xiaobei-scroll-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(232, 224, 255, .8);
  border-radius: 18px;
  background: linear-gradient(180deg, #f7f4ff 0%, #fbfaff 54%, #f2efff 100%);
}

.agent-quick-prompts {
  display: grid;
  gap: 8px;
}

.agent-quick-prompts h3 {
  margin: 0;
  color: #202a44;
  font-size: 15px;
  font-weight: 900;
}

.quick-demand-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.agent-quick-prompts button {
  min-height: 34px;
  padding: 7px;
  border: 0;
  border-radius: 14px;
  color: #34425d;
  background: #f0f3fb;
  font-weight: 900;
}

.xiaobei-primary-functions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.xiaobei-primary-functions button {
  min-height: 72px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 2px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(232, 234, 246, .92);
  border-radius: 16px;
  color: #1f2d4d;
  background: rgba(255, 255, 255, .82);
  text-align: left;
}

.xiaobei-primary-functions i {
  grid-row: 1 / 3;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(108, 99, 255, .14), rgba(93, 215, 200, .18));
  font-style: normal;
}

.xiaobei-primary-functions strong {
  font-size: 13px;
  font-weight: 950;
}

.xiaobei-primary-functions span {
  color: #7b849a;
  font-size: 11px;
  line-height: 1.3;
}

@keyframes xiaobeiRingRotate {
  to {
    transform: rotate(360deg);
  }
}

@keyframes xiaobeiDotPulse {
  0%, 100% {
    opacity: .35;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@keyframes xiaobeiBubblePop {
  0% {
    transform: scale(.95);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes voiceCardPop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes micPulse {
  0%, 100% {
    transform: scale(.82);
    opacity: .45;
  }
  50% {
    transform: scale(1.08);
    opacity: .9;
  }
}

@media (max-width: 820px) {
  .xiaobei-assistant-top {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .xiaobei-avatar-stage {
    width: 92px;
    height: 92px;
  }

  .xiaobei-avatar-mark {
    width: 64px;
    height: 64px;
  }

  .quick-demand-grid,
  .xiaobei-primary-functions {
    grid-template-columns: 1fr;
  }
}
