/* ===== 94Acc 语音组件样式 v1 ===== */

/* UBB 编辑器工具栏 🎤 按钮（显眼胶囊：海湾蓝主题） */
#ubbEditorModal .ubb-toolbar #ubbVoiceBtn {
  font-size: 16px;
  line-height: 1.2;
  padding: 6px 14px 6px 10px;
  margin: 0 2px;
  border: 2px solid #1e90ff;
  border-radius: 16px;
  background: #e3f2fd;
  color: #0d47a1;
  font-weight: 600;
  cursor: pointer;
  vertical-align: middle;
  box-shadow: 0 1px 4px rgba(30, 144, 255, 0.35);
  transition: background .2s, box-shadow .2s, transform .1s;
}
#ubbEditorModal .ubb-toolbar #ubbVoiceBtn:hover { background: #bbdefb; box-shadow: 0 2px 8px rgba(30, 144, 255, 0.5); }
#ubbEditorModal .ubb-toolbar #ubbVoiceBtn:active { transform: scale(0.96); }
#ubbEditorModal .ubb-toolbar #ubbVoiceBtn.vrec-active {
  background: #e74c3c;
  color: #fff;
  border-color: #e74c3c;
  animation: vrec-pulse 1s ease-in-out infinite;
}
@keyframes vrec-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(231, 76, 60, 0); }
}

/* 识别状态提示条 */
#ubbVoiceStatus {
  display: none;
  margin: 6px 2px 0;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  color: #1a5276;
  background: #eaf2f8;
  border: 1px solid #aed6f1;
}

/* 留言语音条（播放器 + 时长 横排） */
.cw-voice {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0;
}
.cw-voice audio {
  width: 280px;
  max-width: 100%;
  height: 40px;
}
.cw-voice-dur {
  font-size: 12px;
  color: #888;
  white-space: nowrap;
}

/* 留言条目 🔊 朗读按钮 */
.cw-readbtn {
  display: inline-block;
  border: none;
  background: transparent;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 4px;
  margin-left: 2px;
  border-radius: 4px;
  opacity: .75;
  vertical-align: middle;
}
.cw-readbtn:hover { background: #eaf2f8; opacity: 1; }
.cw-readbtn.cw-reading { background: #ffe9c7; opacity: 1; color: #c0793f; }

/* 手机触控放大 */
@media (max-width: 768px) {
  #ubbEditorModal .ubb-toolbar #ubbVoiceBtn {
    font-size: 20px;
    padding: 6px 12px;
    min-width: 44px;
    min-height: 36px;
    touch-action: manipulation;
  }
  .cw-readbtn {
    font-size: 17px;
    padding: 4px 8px;
    min-width: 40px;
    min-height: 36px;
    touch-action: manipulation;
  }
  /* 手机：语音条 audio 自适应宽度（原生控件固定 300px 会溢出窄屏） */
  .cw-voice audio {
    width: 100%;
    height: 40px;
  }
  .cw-voice-dur {
    font-size: 13px;
  }
  /* 手机：编辑器录音完成状态条 flex 横排 */
  #ubbVoiceBar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
  }
  #ubbVoiceBar audio {
    width: 100%;
    height: 40px;
  }
}

/* ============================================================
 * 语音留言 v2 — 按住说话面板（留言板手机端）
 * 手势三区域：直接松手=发送 / 上滑左=取消 / 上滑右=转文字
 * ============================================================ */

/* 🎤 语音留言按钮：桌面默认隐藏，手机端由 JS 控制成员/能力显示 */
.cw-btn-voice {
  display: none;
  font-size: 13px;
  padding: 7px 14px;
  border: 2px solid #1e90ff;
  border-radius: 16px;
  background: #e3f2fd;
  color: #0d47a1;
  font-weight: 600;
  cursor: pointer;
  vertical-align: middle;
  box-shadow: 0 1px 4px rgba(30, 144, 255, 0.35);
  transition: background .2s, box-shadow .2s, transform .1s;
  touch-action: manipulation;
}
.cw-btn-voice:hover { background: #bbdefb; box-shadow: 0 2px 8px rgba(30, 144, 255, 0.5); }
.cw-btn-voice:active { transform: scale(0.96); }
@media (max-width: 768px) {
  .cw-btn-voice { display: inline-block !important; min-height: 40px; }
}

/* ---- 语音面板 ---- */
.cw-vpanel {
  border: 1px solid #e5dfd3;
  border-radius: 10px;
  padding: 12px 12px 10px;
  margin-bottom: 10px;
  background: #fdfdf9;
}
.cvp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.cvp-title { font-size: 13px; font-weight: 700; color: #1a5276; }
.cvp-close {
  font-size: 12px;
  color: #888;
  background: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  min-height: 32px;
}
.cvp-close:hover { background: #f0ece4; color: #333; }

/* ---- 手势区（固定于大圆左右，零位移；2026-08-13 改版） ---- */
.cvp-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 4px 0 2px;
}
.cvp-zone {
  flex: 1 1 0;
  max-width: 108px;
  height: 64px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  font-weight: 600;
  opacity: .55;
  transition: background .15s, box-shadow .15s, transform .1s, opacity .15s;
}
.cvp-row.cvp-recording .cvp-zone { opacity: 1; }
.cvp-zone small { font-size: 11px; font-weight: 400; opacity: .85; }
.cvp-zone-cancel { background: #fdecea; border: 1.5px solid #f5b7b1; color: #922b21; }
.cvp-zone-text { background: #eaf2f8; border: 1.5px solid #aed6f1; color: #1a5276; }
.cvp-zone.active { transform: scale(1.03); box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.cvp-zone-cancel.active { background: #f5c6c0; border-color: #e74c3c; }
.cvp-zone-text.active { background: #bcd9ee; border-color: #1e90ff; }

/* ---- 倒计时 ---- */
.cvp-count {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: #1a5276;
  font-variant-numeric: tabular-nums;
  margin: 2px 0 0;
}

/* ---- 按住键 ---- */
.cvp-holdbtn {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  margin: 0;
  flex: 0 0 auto;
  background: #1e90ff;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(30, 144, 255, 0.4);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  transition: background .2s, box-shadow .2s, transform .1s;
}
.cvp-holdbtn:active { transform: scale(0.95); }
.cvp-holdbtn.cvp-hold-active {
  background: #e74c3c;
  animation: vrec-pulse 1s ease-in-out infinite;
}

/* ---- 提示与状态 ---- */
.cvp-hint {
  text-align: center;
  font-size: 12px;
  color: #888;
  margin: 2px 0 4px;
  min-height: 17px;
}
.cvp-status {
  text-align: center;
  font-size: 12px;
  color: #1a5276;
  min-height: 18px;
  margin-top: 2px;
}
.cvp-status-rec { color: #e74c3c; }
.cvp-status-err { color: #dc3545; }

/* ---- 确认浮层 ---- */
.cvp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cvp-confirm {
  background: #fff;
  border-radius: 12px;
  padding: 18px 16px 16px;
  width: 86%;
  max-width: 340px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}
.cvp-confirm h4 {
  margin: 0 0 10px;
  font-size: 15px;
  color: #1a5276;
  text-align: center;
}
.cvp-confirm audio { width: 100%; height: 40px; }
.cvp-confirm-dur {
  text-align: center;
  font-size: 12px;
  color: #888;
  margin: 6px 0 0;
}
.cvp-confirm-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.cvp-btn-rec,
.cvp-btn-send {
  flex: 1;
  padding: 10px 0;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  min-height: 44px;
  cursor: pointer;
}
.cvp-btn-rec { background: #eee; color: #333; }
.cvp-btn-send { background: #1e90ff; color: #fff; font-weight: 600; }
.cvp-btn-rec:active { background: #ddd; }
.cvp-btn-send:active { background: #1873cc; }

/* ===== 播放条转文字（2026-08-14 VoiceStt） ===== */
/* 文按钮：语音条右侧小胶囊 */
.cw-stt-btn {
  border: 1.5px solid #1e90ff;
  background: #e3f2fd;
  color: #1a5276;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 5px 9px;
  cursor: pointer;
  flex-shrink: 0;
  touch-action: manipulation;
}
.cw-stt-btn:hover { background: #d0e7fb; }
.cw-stt-btn:active { transform: scale(0.94); }
.cw-stt-hint { animation: cwSttPulse 1.6s ease 2; }
@keyframes cwSttPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(30, 144, 255, 0); }
  50% { box-shadow: 0 0 0 5px rgba(30, 144, 255, 0.28); }
}
/* 转写文字区：播放条正下方 */
.cw-stt {
  background: #f7f5ee;
  border: 1px solid #e3dcc9;
  border-left: 3px solid #c0793f;
  border-radius: 6px;
  padding: 8px 10px;
  margin: 2px 0 6px;
}
.cw-stt-body {
  font-size: 13px;
  line-height: 1.65;
  color: #2c3e50;
  word-break: break-all;
  max-height: 130px;
  overflow-y: auto;
  white-space: pre-wrap;
}
.cw-stt-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 11px;
  color: #999;
}
.cw-stt-copy {
  border: 1px solid #d5c9ae;
  background: #fff;
  color: #8a6d3b;
  border-radius: 10px;
  font-size: 11px;
  padding: 2px 10px;
  cursor: pointer;
}
.cw-stt-copy:hover { border-color: #c0793f; color: #c0793f; }
.cw-stt-cached { color: #b3a68a; }
/* 手机触控放大 */
@media (max-width: 768px) {
  .cw-stt-btn {
    font-size: 14px;
    padding: 8px 13px;
    min-width: 40px;
    min-height: 36px;
  }
  .cw-stt-body { font-size: 14px; }
  .cw-stt-copy {
    font-size: 13px;
    padding: 4px 12px;
    min-height: 32px;
  }
  .cw-voice { -webkit-touch-callout: none; }
}
