/* 聊天富媒体：图片 / 预览 / 语音 / 通话 / 转账 / 表情面板
   —— 由 styles.css 第 1957–2392 行原样切分，规则与顺序未改动。 */
/* === 新增：朋友圈图片 === */
.moments-image-wrap{
  position:relative;margin-bottom:10px;border-radius:10px;overflow:hidden;
  background:#f0f0f0;display:inline-block;max-width:100%;
}
.moments-image-wrap img{
  display:block;max-width:100%;max-height:320px;border-radius:10px;
}
.moments-image-download{
  position:absolute;right:8px;bottom:8px;
  width:30px;height:30px;border-radius:50%;
  background:rgba(0,0,0,0.55);backdrop-filter:blur(10px);
  border:none;display:flex;align-items:center;justify-content:center;
  cursor:pointer;color:#fff;
}
.moments-image-download svg{width:16px;height:16px;fill:#fff;}
.moments-image-download:active{transform:scale(0.9);}
.moments-image-loading{
  width:200px;height:200px;border-radius:10px;
  background:rgba(0,0,0,0.03);
  display:flex;align-items:center;justify-content:center;
  color:#bbb;font-size:12px;
}
.moments-post-btn{
  width:100%;padding:12px;border:none;
  border-radius:12px;background:#FFD4E8;
  color:white;font-size:14px;font-weight:600;
  cursor:pointer;margin-bottom:12px;
}

/* 聊天图片消息 */
.chat-image-wrap{
  max-width:200px;border-radius:14px 14px 14px 4px;overflow:hidden;
  cursor:pointer;background:#f0f0f0;
}
.message-row.user .chat-image-wrap {
  border-radius:14px 14px 4px 14px;
}
.chat-image-wrap img{
  display:block;width:100%;height:auto;max-height:260px;
  object-fit:cover;border-radius:14px;
}
.chat-image-pending{
  display:flex;align-items:center;gap:8px;
  padding:8px 4px;font-size:13px;color:#8E8E93;
}

/* 图片预览大图面板 */
.image-preview-mask{
  position:absolute;inset:0;z-index:10020;
  background:rgba(0,0,0,0.85);
  display:flex;flex-direction:column;
  align-items:center;justify-content:center;
  padding:24px;
  overflow:hidden;
}
.image-preview-img{
  max-width:100%;max-height:70vh;border-radius:12px;
  object-fit:contain;
}
.image-preview-actions{
  display:flex;gap:10px;margin-top:20px;flex-wrap:wrap;
  justify-content:center;
}
.image-preview-btn{
  padding:10px 18px;border:none;border-radius:20px;
  font-size:14px;font-weight:600;cursor:pointer;
  background:rgba(255,255,255,0.9);color:#333;
  font-family:inherit;
}
.image-preview-btn:active{transform:scale(0.95);}
.image-preview-regen{
  width:100%;max-width:360px;
  background:#fff;border-radius:16px;padding:16px;
  margin-top:20px;
}
.image-preview-regen textarea{
  width:100%;min-height:70px;padding:10px;
  border:1px solid #e0e0e0;border-radius:10px;
  font-size:14px;outline:none;resize:vertical;
  font-family:inherit;color:#333;
}
.image-preview-regen-actions{
  display:flex;gap:8px;margin-top:10px;
}
.image-preview-regen-actions button{
  flex:1;padding:10px;border:none;border-radius:10px;
  font-size:13px;font-weight:600;cursor:pointer;font-family:inherit;
}
.image-preview-regen-actions .primary{background:#FFD4E8;color:#fff;}
.image-preview-regen-actions .secondary{background:#f0f0f0;color:#333;}

.sound-chip{
  padding:6px 12px;border-radius:20px;
  background:#f5f5f5;font-size:12px;color:#666;
  cursor:pointer;transition:all 0.2s;border:1px solid transparent;
}
.sound-chip.active{
  background:#FFF0F5;color:#FF9CB9;border-color:#FFD4E8;font-weight:600;
}

/* 当气泡内是语音或图片时，褪去气泡原本的底色、内边距和阴影 */
.message-bubble.bubble-transparent {
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
  /* 把原本气泡的尖角也去掉，交给内部元素 */
  border-radius: 0 !important; 
  max-width: 100% !important;
}

/* 语音气泡（它现在直接充当最外层气泡本体） */
.chat-voice-bubble {
  display: flex; align-items: center; gap: 12px;
  background: #fff; padding: 10px 14px; border-radius: 16px 16px 16px 4px;
  cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  font-size: 14px; color: #333;
  flex-direction: row;
}
.chat-voice-bubble.user-voice {
  background: #d4e8ff;
  flex-direction: row-reverse;
  border-radius: 16px 16px 4px 16px; /* 用户发的语音圆角反过来 */
}
.voice-waves { display: flex; align-items: center; gap: 3px; height: 16px; }
.voice-waves span {
  display: block; width: 3px; height: 100%; background: #333;
  border-radius: 2px; animation: wave 1s infinite ease-in-out;
}
.chat-voice-bubble.user-voice .voice-waves span { background: #1C1C1E; }
.voice-waves span:nth-child(1) { height: 60%; animation-delay: 0s; }
.voice-waves span:nth-child(2) { height: 100%; animation-delay: 0.2s; }
.voice-waves span:nth-child(3) { height: 40%; animation-delay: 0.4s; }
@keyframes wave {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1); }
}
.voice-duration { font-size: 13px; font-weight: 500; }

/* 模拟通话 UI */
.call-overlay {
  position: absolute; inset: 0; z-index: 9999;
  background: #1a1a1a; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: #fff;
  overflow: hidden;
}
.call-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(40,40,40,0.8), rgba(10,10,10,0.95));
}
.call-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  width: 100%; max-width: 300px;
}
.call-avatar {
  width: 100px; height: 100px; border-radius: 24px;
  background: rgba(255,255,255,0.1); font-size: 48px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.call-name { font-size: 24px; font-weight: 600; }
.call-status { font-size: 14px; color: #aaa; margin-bottom: 40px; }
.call-hangup-btn {
  width: 60px; height: 60px; border-radius: 50%;
  background: #ff3b30; color: #fff; border: none;
  font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 16px rgba(255,59,48,0.4);
}
.call-hangup-btn:active { transform: scale(0.9); }

/* 录音呼吸灯动画 */
@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255,59,48,0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(255,59,48,0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255,59,48,0); }
}

/* 转账气泡 */
.chat-transfer-bubble {
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  cursor: pointer;
}
.chat-transfer-bubble.transfer {
  background: #FFB900;
  color: #333;
  box-shadow: 0 2px 8px rgba(255, 185, 0, 0.2);
}
.chat-transfer-bubble.redpacket {
  background: #E54D42;
  color: #fff;
  box-shadow: 0 2px 8px rgba(229, 77, 66, 0.3);
}
.chat-transfer-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: bold;
}
.chat-transfer-info { flex: 1; }
.chat-transfer-amount { font-size: 16px; font-weight: 600; }
.chat-transfer-note { font-size: 12px; opacity: 0.8; margin-top: 2px; }
.chat-transfer-status { font-size: 12px; opacity: 0.6; }

/* 红包/转账独立块：去掉气泡外壳后，修正对齐 */
.message-row > .chat-transfer-bubble {
  align-self: flex-start;
}
.message-row.user > .chat-transfer-bubble {
  align-self: flex-end;
}

/* 扩展面板 */
.extend-panel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 20px 24px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-top: 0.5px solid rgba(0,0,0,0.06);
  flex-shrink: 0;
  animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.extend-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer;
  font-size: 11px; color: #888; font-weight: 500;
}
.extend-icon {
  width: 56px; height: 56px; border-radius: 20px;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 2px 8px rgba(255,182,217,0.15), inset 0 0 0 1px rgba(255,255,255,0.5);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.extend-item:active .extend-icon { 
  transform: scale(0.92); 
  background: #FFF0F5; 
}
.extend-item:active { color: #FF9CB9; }

/* 表情面板 */
.sticker-panel{
  flex-shrink:0;
  background:rgba(255,255,255,0.92);
  backdrop-filter:blur(30px);-webkit-backdrop-filter:blur(30px);
  border-top:0.5px solid rgba(0,0,0,0.06);
  padding:12px 16px 16px;
  max-height:280px;
  display:flex;flex-direction:column;
  animation:slideUp 0.25s cubic-bezier(0.4,0,0.2,1);
}
.sticker-panel-head{
  display:flex;justify-content:space-between;align-items:center;
  margin-bottom:10px;flex-shrink:0;
}
.sticker-add-btn{
  padding:4px 12px;border:none;border-radius:14px;
  background:#FFD4E8;color:#fff;font-size:12px;font-weight:600;
  cursor:pointer;font-family:inherit;
}
.sticker-add-btn:active{transform:scale(0.94);}
.sticker-empty{
  text-align:center;font-size:12px;color:#999;
  padding:24px 8px;
}

/* 表情分组 tab 行 */
.sticker-tab-row{
  display:flex;align-items:center;gap:6px;
  overflow-x:auto;padding:0 0 10px;margin-bottom:2px;
  flex-shrink:0;
}
.sticker-tab-row::-webkit-scrollbar{display:none;}
.sticker-tab{
  flex-shrink:0;
  padding:5px 12px;border-radius:14px;
  background:#f5f5f5;color:#888;
  font-size:12px;font-weight:500;
  cursor:pointer;white-space:nowrap;
  transition:all 0.2s;
  display:flex;align-items:center;gap:4px;
}
.sticker-tab.active{
  background:#FFD4E8;color:#fff;font-weight:600;
}
.sticker-tab-count{
  font-size:10px;opacity:0.7;
  background:rgba(0,0,0,0.06);
  border-radius:8px;padding:0 5px;line-height:1.5;
}
.sticker-tab.active .sticker-tab-count{
  background:rgba(255,255,255,0.35);opacity:1;
}
.sticker-clear-btn{
  flex-shrink:0;margin-left:auto;
  padding:5px 10px;border:none;border-radius:14px;
  background:rgba(255,59,48,0.08);color:#ff3b30;
  font-size:11px;font-weight:600;
  cursor:pointer;font-family:inherit;
  white-space:nowrap;
}
.sticker-clear-btn:active{transform:scale(0.94);}
.sticker-manage-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}
.sticker-manage-list::-webkit-scrollbar { display: none; }

.sticker-grid{
  display:grid;grid-template-columns:repeat(5,1fr);
  gap:8px;overflow-y:auto;padding-right:2px;
}
.sticker-cell{
  position:relative;aspect-ratio:1/1;
  border-radius:10px;background:#f5f5f5;overflow:hidden;
}
.sticker-cell img{
  width:100%;height:100%;object-fit:cover;display:block;cursor:pointer;
}
.sticker-cell:active img{transform:scale(0.94);transition:transform 0.1s;}
.sticker-del{
  position:absolute;top:2px;right:2px;
  width:18px;height:18px;border-radius:50%;
  background:rgba(0,0,0,0.55);color:#fff;border:none;
  font-size:12px;line-height:1;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
}

/* 拍一拍消息 */
.message-pat{
  text-align:center;font-size:12px;color:#999;
  padding:6px 0;display:flex;justify-content:center;
}
.message-pat-text{
  background:rgba(0,0,0,0.04);padding:4px 12px;border-radius:12px;
}

/* 朋友圈评论 */
.moments-comment-item{
  padding:2px 0;line-height:1.6;cursor:pointer;
  border-radius:4px;
}
.moments-comment-item:active{background:rgba(0,0,0,0.04);}
.moments-comment-author{
  color:#576b95;font-weight:600;
}
.moments-comment-replyto{
  color:#576b95;font-weight:400;
}
.moments-comment-sep{color:#666;}
.moments-comment-text{color:#333;}
.moments-comment-input-wrap{margin-top:6px;}
.moments-reply-hint{
  font-size:11px;color:#999;margin-bottom:4px;
  display:flex;justify-content:space-between;align-items:center;
}
.moments-reply-cancel{
  color:#ff3b30;cursor:pointer;padding:2px 6px;
}

/* 朋友圈发动态面板 */
.moment-post-mask{
  position:absolute;inset:0;z-index:10015;
  background:rgba(0,0,0,0.5);
  display:flex;align-items:flex-end;justify-content:center;
  overflow:hidden;
}
.moment-post-box{
  width:100%;max-width:430px;
  background:#fff;border-radius:24px 24px 0 0;
  padding:24px;max-height:80vh;overflow-y:auto;
  animation:slideUp 0.3s ease;
}
.moment-post-title{
  font-size:18px;font-weight:600;text-align:center;
  margin-bottom:16px;color:#333;
}
.moment-post-textarea{
  width:100%;min-height:100px;padding:12px;
  border:1px solid #e0e0e0;border-radius:12px;
  font-size:14px;outline:none;resize:vertical;
  font-family:inherit;color:#333;margin-bottom:12px;
}
.moment-post-image-preview{
  position:relative;width:120px;height:120px;
  border-radius:12px;overflow:hidden;margin-bottom:12px;
}
.moment-post-image-preview img{
  width:100%;height:100%;object-fit:cover;
}
.moment-post-image-remove{
  position:absolute;top:4px;right:4px;
  width:24px;height:24px;border-radius:50%;
  background:rgba(0,0,0,0.6);color:#fff;border:none;
  font-size:16px;cursor:pointer;display:flex;
  align-items:center;justify-content:center;
}
.moment-post-actions{
  display:flex;gap:10px;margin-top:8px;
}

/* 输入中的动画 */
.typing-dots{
  display:inline-flex;gap:2px;align-items:center;
}
.typing-dots span{
  width:4px;height:4px;border-radius:50%;
  background:#666;animation:typingBounce 1.2s infinite;
}
.typing-dots span:nth-child(2){animation-delay:0.15s;}
.typing-dots span:nth-child(3){animation-delay:0.3s;}
@keyframes typingBounce{
  0%,60%,100%{transform:translateY(0);opacity:0.4;}
  30%{transform:translateY(-4px);opacity:1;}
}

/* API 测试结果 */
.api-test-result{
  font-size:12px;padding:8px;border-radius:8px;
  margin-top:8px;word-break:break-all;
}
.api-test-result.ok{background:rgba(80,200,120,0.1);color:#2a9d4a;}

