#codequest-ai-launcher,
#codequest-ai-tip {
  display: none !important;
}

#codequest-voice-mentor {
  position: absolute;
  left: 0;
  top: 0;
  width: 560px;
  height: 142px;
  z-index: 80;
  font-family: "Microsoft YaHei", Arial, sans-serif;
  color: #eef8ff;
  pointer-events: none;
}

#codequest-voice-mentor.cq-hidden {
  display: none;
}

#codequest-voice-mentor * {
  box-sizing: border-box;
}

.cq-agent-avatar {
  width: 128px;
  height: 128px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  top: 10px;
  filter: drop-shadow(0 18px 20px rgba(0, 0, 0, 0.34));
}

.cq-agent-avatar::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 112px;
  height: 120px;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(7, 16, 28, 0.88), rgba(7, 16, 28, 0.72));
  box-shadow: inset 0 0 0 1px rgba(122, 198, 255, 0.14);
}

.cq-agent-avatar:focus-visible {
  outline: 3px solid #70d9ff;
  outline-offset: 4px;
  border-radius: 28px;
}

.cq-agent-stage {
  position: absolute;
  inset: 0;
  perspective: 420px;
  z-index: 1;
}

.cq-agent-shadow {
  position: absolute;
  left: 30px;
  right: 20px;
  bottom: 5px;
  height: 16px;
  border-radius: 999px;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0));
}

.cq-agent-body {
  position: absolute;
  left: 37px;
  top: 54px;
  width: 57px;
  height: 60px;
  border-radius: 22px 22px 18px 18px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 28%),
    linear-gradient(180deg, #38bdf8, #2563eb 68%, #1d4ed8);
  box-shadow:
    inset -8px -10px 0 rgba(0, 0, 0, 0.16),
    inset 9px 8px 0 rgba(255, 255, 255, 0.16);
  transform: rotateX(8deg) rotateY(-10deg);
}

.cq-agent-body::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 11px;
  width: 30px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.cq-agent-head {
  position: absolute;
  left: 28px;
  top: 18px;
  width: 72px;
  height: 62px;
  border-radius: 30px 30px 25px 25px;
  background:
    radial-gradient(circle at 28% 28%, rgba(255, 255, 255, 0.56), transparent 17%),
    linear-gradient(140deg, #fff1c2, #ffd18a 60%, #f6a955);
  box-shadow:
    inset -8px -9px 0 rgba(129, 68, 19, 0.15),
    0 8px 0 rgba(64, 34, 18, 0.15);
  transform: rotateX(7deg) rotateY(-13deg);
}

.cq-agent-hair {
  position: absolute;
  left: 26px;
  top: 13px;
  width: 76px;
  height: 24px;
  border-radius: 27px 28px 12px 12px;
  background: linear-gradient(180deg, #28313f, #111827);
  transform: rotate(-3deg);
}

.cq-agent-ear {
  position: absolute;
  top: 44px;
  width: 14px;
  height: 22px;
  border-radius: 999px;
  background: #f4b66e;
}

.cq-agent-ear.left {
  left: 22px;
}

.cq-agent-ear.right {
  right: 24px;
  filter: brightness(0.9);
}

.cq-agent-eye {
  position: absolute;
  top: 45px;
  width: 9px;
  height: 12px;
  border-radius: 999px;
  background: #0b1220;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.55);
}

.cq-agent-eye.left {
  left: 49px;
}

.cq-agent-eye.right {
  left: 75px;
}

.cq-agent-mouth {
  position: absolute;
  left: 59px;
  top: 64px;
  width: 20px;
  height: 8px;
  border-radius: 0 0 999px 999px;
  background: #d6423b;
  transform-origin: center top;
}

.cq-agent-scarf {
  position: absolute;
  left: 76px;
  top: 72px;
  width: 28px;
  height: 12px;
  border-radius: 3px;
  background: linear-gradient(90deg, #ff4848, #ff9f45);
  transform: rotate(-5deg);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.12);
}

.cq-agent-headset {
  position: absolute;
  left: 19px;
  top: 34px;
  width: 20px;
  height: 31px;
  border-radius: 999px;
  background: linear-gradient(180deg, #63e6ff, #0ea5e9);
  border: 4px solid rgba(7, 16, 28, 0.82);
}

.cq-agent-headset::after {
  content: "";
  position: absolute;
  left: -15px;
  top: 14px;
  width: 18px;
  height: 5px;
  border-radius: 999px;
  background: #ffd34d;
}

.cq-agent-orb {
  position: absolute;
  left: 89px;
  top: 35px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 34%, rgba(255, 255, 255, 0.95), transparent 12%),
    radial-gradient(circle at 62% 60%, #67e8f9, #0891b2);
  box-shadow: 0 0 0 8px rgba(14, 165, 233, 0.18), 0 0 18px rgba(103, 232, 249, 0.75);
}

.cq-agent-badge {
  position: absolute;
  left: 7px;
  bottom: 0;
  min-width: 88px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd36a, #f59e0b);
  color: #1d1407;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 7px 0 rgba(113, 63, 18, 0.32), 0 13px 18px rgba(0, 0, 0, 0.24);
}

.cq-agent-status {
  display: none !important;
  position: absolute;
  left: 102px;
  bottom: 18px;
  min-width: 136px;
  max-width: 238px;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 13px 13px 13px 4px;
  background: rgba(8, 18, 31, 0.82);
  border: 1px solid rgba(142, 203, 255, 0.22);
  color: #f4fbff;
  font-size: 14px;
  line-height: 1.25;
  text-align: left;
  pointer-events: none;
  box-shadow: 0 11px 24px rgba(0, 0, 0, 0.22);
}

.cq-agent-panel {
  position: absolute;
  left: 118px;
  bottom: 118px;
  width: min(420px, calc(100vw - 156px));
  max-height: 420px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(8, 16, 29, 0.96);
  border: 1px solid rgba(120, 220, 255, 0.22);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  display: none;
}

.cq-agent-panel.open {
  display: block;
}

.cq-agent-panel header {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: linear-gradient(90deg, #142943, #0c1829);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cq-agent-panel-title {
  flex: 1;
  font-size: 17px;
  font-weight: 800;
  color: #ffdf7a;
}

.cq-agent-context {
  font-size: 12px;
  color: #b8d6ef;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cq-agent-close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #f4b844;
  color: #1d1407;
  font-weight: 900;
  cursor: pointer;
}

.cq-agent-log {
  height: 210px;
  overflow: auto;
  padding: 12px 14px;
  background: rgba(2, 8, 18, 0.62);
  font-size: 14px;
  line-height: 1.48;
  user-select: text;
}

.cq-agent-line {
  margin: 0 0 10px;
  padding: 9px 11px;
  border-radius: 10px;
}

.cq-agent-line.ai {
  background: rgba(69, 142, 199, 0.18);
  border: 1px solid rgba(111, 203, 255, 0.15);
}

.cq-agent-line.user {
  background: rgba(246, 184, 68, 0.18);
  border: 1px solid rgba(255, 211, 106, 0.16);
  color: #fff5d2;
}

.cq-agent-controls {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  padding: 12px;
}

.cq-agent-input {
  min-width: 0;
  height: 42px;
  border: 1px solid rgba(151, 201, 240, 0.28);
  border-radius: 8px;
  background: rgba(240, 248, 255, 0.96);
  color: #0c1727;
  padding: 0 12px;
  font-size: 15px;
  outline: none;
  pointer-events: auto;
}

.cq-agent-input:focus {
  border-color: #70d9ff;
  box-shadow: 0 0 0 3px rgba(112, 217, 255, 0.18);
}

.cq-agent-action {
  height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: #198de8;
  color: white;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
}

.cq-agent-action.secondary {
  background: rgba(89, 116, 145, 0.84);
}

.cq-agent-action.listening {
  background: #ef4444;
}

.cq-agent-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 12px 12px;
}

.cq-agent-quick button {
  height: 30px;
  border: 1px solid rgba(255, 211, 106, 0.22);
  border-radius: 999px;
  background: rgba(255, 211, 106, 0.12);
  color: #ffe4a3;
  padding: 0 12px;
  font-size: 12px;
  cursor: pointer;
  pointer-events: auto;
}

#codequest-voice-mentor.cq-listening .cq-agent-orb,
#codequest-voice-mentor.cq-speaking .cq-agent-orb {
  animation: cqPulse 0.72s ease-in-out infinite alternate;
}

#codequest-voice-mentor.cq-listening .cq-agent-head {
  animation: cqNod 0.9s ease-in-out infinite;
}

#codequest-voice-mentor.cq-thinking .cq-agent-stage {
  animation: cqThink 1.25s ease-in-out infinite;
}

#codequest-voice-mentor.cq-speaking .cq-agent-mouth {
  animation: cqTalk 0.19s ease-in-out infinite alternate;
}

#codequest-voice-mentor.cq-speaking .cq-agent-body {
  animation: cqBodyBeat 0.42s ease-in-out infinite alternate;
}

#codequest-voice-mentor.cq-happy .cq-agent-head {
  animation: cqHappy 0.45s ease-in-out 3;
}

#codequest-voice-mentor:not(.cq-listening):not(.cq-thinking):not(.cq-speaking) .cq-agent-stage {
  animation: cqIdle 2.4s ease-in-out infinite;
}

@keyframes cqIdle {
  0%, 100% { transform: translateY(0) rotateZ(-1deg); }
  50% { transform: translateY(-5px) rotateZ(1deg); }
}

@keyframes cqPulse {
  from { transform: scale(1); box-shadow: 0 0 0 8px rgba(14, 165, 233, 0.18), 0 0 18px rgba(103, 232, 249, 0.75); }
  to { transform: scale(1.18); box-shadow: 0 0 0 13px rgba(14, 165, 233, 0.12), 0 0 30px rgba(103, 232, 249, 0.96); }
}

@keyframes cqTalk {
  from { transform: scaleY(0.65); }
  to { transform: scaleY(1.55); }
}

@keyframes cqNod {
  0%, 100% { transform: rotateX(7deg) rotateY(-13deg) translateY(0); }
  50% { transform: rotateX(13deg) rotateY(-6deg) translateY(2px); }
}

@keyframes cqThink {
  0%, 100% { transform: rotateZ(-2deg); }
  50% { transform: rotateZ(2deg); }
}

@keyframes cqBodyBeat {
  from { transform: rotateX(8deg) rotateY(-10deg) scale(1); }
  to { transform: rotateX(8deg) rotateY(-3deg) scale(1.04); }
}

@keyframes cqHappy {
  0%, 100% { transform: rotateX(7deg) rotateY(-13deg) translateY(0); }
  50% { transform: rotateX(7deg) rotateY(-13deg) translateY(-5px); }
}

@media (max-width: 720px) {
  #codequest-voice-mentor {
    transform: scale(0.86);
    transform-origin: left top;
  }

  .cq-agent-panel {
    left: 6px;
    bottom: 142px;
    width: calc(100vw - 22px);
  }

  .cq-agent-status {
    display: none;
  }
}
