/* yanxin:im-voice-display-hotpatch v1 — 文本型语音消息转可播放气泡 */

.im-shell .yx-voice-hp.im-voice-bubble,
.im-shell .message-bubble__body .yx-voice-hp.im-voice-bubble {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
  max-width: 220px;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.04);
  cursor: pointer;
  user-select: none;
}

.im-shell .im-msg-row.self .yx-voice-hp.im-voice-bubble,
.im-shell .message-bubble--self .yx-voice-hp.im-voice-bubble {
  background: var(--wx-bubble-self, #95ec69);
}

.im-shell .yx-voice-hp.im-voice-bubble--loading {
  opacity: 0.65;
}

.im-shell .yx-voice-hp .im-voice-bubble__play {
  display: none;
}

.im-shell .yx-voice-hp .im-voice-bubble__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.im-shell .im-msg-row:not(.self) .yx-voice-hp .im-voice-bubble__body,
.im-shell .message-bubble:not(.message-bubble--self) .yx-voice-hp .im-voice-bubble__body {
  flex-direction: row-reverse;
}

.im-shell .yx-voice-hp .im-voice-bubble__wave {
  flex: 1;
  min-width: 0;
  max-width: 72px;
  height: 14px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
}

.im-shell .yx-voice-hp .im-voice-bubble__bar {
  flex: 0 0 2px;
  width: 2px;
  height: 6px;
  border-radius: 1px;
  background: rgba(0, 0, 0, 0.28);
}

.im-shell .yx-voice-hp .im-voice-bubble__bar:nth-child(odd) {
  height: 10px;
}

.im-shell .yx-voice-hp .im-voice-bubble__bar:nth-child(3n) {
  height: 12px;
}

.im-shell .yx-voice-hp.is-playing .im-voice-bubble__bar {
  animation: yx-voice-hp-wave 0.8s ease-in-out infinite alternate;
}

.im-shell .yx-voice-hp.is-playing .im-voice-bubble__bar:nth-child(2n) {
  animation-delay: 0.12s;
}

.im-shell .yx-voice-hp.is-playing .im-voice-bubble__bar:nth-child(3n) {
  animation-delay: 0.24s;
}

@keyframes yx-voice-hp-wave {
  from {
    transform: scaleY(0.55);
  }
  to {
    transform: scaleY(1.15);
  }
}

.im-shell .yx-voice-hp .im-voice-bubble__dur {
  font-size: 12px;
  color: var(--el-text-color-secondary, rgba(0, 0, 0, 0.45));
  white-space: nowrap;
}

.im-shell .yx-voice-hp audio {
  display: none;
}
