/* @budding: 聊天室与消息气泡 */
#chat-room-screen { background-size: cover; background-position: center; }
#chat-room-screen .content { display: flex; flex-direction: column; padding: 10px; padding-bottom: 10px; transition: padding-bottom 0.3s ease; }
#chat-room-screen.multi-select-active .content { padding-bottom: 70px; }
.message-area { flex-grow: 1; overflow-y: auto; padding: 0 10px; scroll-behavior: smooth; }
.message-wrapper { display: flex; margin-bottom: 12px; align-items: flex-start; transition: background-color 0.2s; flex-direction: column; }
.message-wrapper.group-message { margin-bottom: 18px; }
.message-wrapper.sent { align-items: flex-end; }
.message-wrapper.received { align-items: flex-start; }
.message-wrapper.system-notification { align-items: center; }
.message-bubble-row { display: flex; width: 100%; align-items: flex-start; }
.message-wrapper.sent .message-bubble-row { flex-direction: row-reverse; }
.message-wrapper.multi-select-selected { background-color: rgba(144, 202, 249, 0.2); border-radius: var(--border-radius); }

.message-info { display: flex; flex-direction: column; align-items: center; position: relative; }
.group-nickname { position: absolute; top: -15px; font-size: 11px; color: #888; white-space: nowrap; width: 70px; text-align: center; overflow: hidden; text-overflow: ellipsis; }
.message-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.message-time { font-size: 9px; color: #aaa; margin-top: 3px; }

/* 各种气泡 */
.message-bubble { max-width: 260px; padding: 8px 12px; border-radius: var(--border-radius); word-wrap: break-word; line-height: 1.4; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); margin: 0 8px; cursor: pointer; font-size: 15px; }
.message-bubble.sent { background-color: var(--accent-color); color: var(--white-color); border-bottom-right-radius: 5px; }
.message-bubble.received { background-color: var(--bg-color); color: var(--text-color); border-bottom-left-radius: 5px; }
.system-notification-bubble { background-color: rgba(200, 200, 200, 0.5); color: #666; font-size: 12px; padding: 4px 10px; border-radius: 10px; text-align: center; }

.image-bubble { max-width: 120px; border-radius: var(--border-radius); margin: 0 8px; padding: 4px; background-color: rgba(255, 255, 255, 0.5); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); cursor: pointer; }
.image-bubble img { width: 100%; height: auto; display: block; border-radius: calc(var(--border-radius) - 4px); }
.message-wrapper.sent .image-bubble { border-bottom-right-radius: 5px; }
.message-wrapper.received .image-bubble { border-bottom-left-radius: 5px; }

.voice-bubble { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-radius: var(--border-radius); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); margin: 0 8px; cursor: pointer; transition: all 0.2s ease; min-width: 90px; max-width: 200px; }
.message-wrapper.sent .voice-bubble { border-bottom-right-radius: 5px; flex-direction: row-reverse; }
.message-wrapper.received .voice-bubble { border-bottom-left-radius: 5px; }
.voice-bubble .play-icon { width: 18px; height: 18px; flex-shrink: 0; }
.voice-bubble .duration { font-size: 13px; margin: 0 8px; white-space: nowrap; }
.message-wrapper.sent .play-icon { transform: scaleX(-1); }
.voice-transcript { font-size: 14px; color: #555; background-color: rgba(255, 255, 255, 0.7); padding: 8px 12px; margin-bottom: 5px; margin-left: 54px; margin-right: 54px; border-radius: 10px; line-height: 1.6; max-width: calc(100% - 108px); display: none; animation: fadeIn 0.3s ease; }
.voice-transcript.active { display: block; }
.message-wrapper.sent .voice-transcript { align-self: flex-end; margin-right: 54px; margin-left: auto; }
.message-wrapper.received .voice-transcript { align-self: flex-start; margin-left: 54px; margin-right: auto; }

.pv-card { width: 230px; aspect-ratio: 1 / 1; background-color: #f0f0f0; border-radius: var(--border-radius); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); overflow: hidden; position: relative; cursor: pointer; margin: 0 8px; }
.message-wrapper.sent .pv-card { border-bottom-right-radius: 5px; }
.message-wrapper.received .pv-card { border-bottom-left-radius: 5px; }
.pv-card-image-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; transition: opacity 0.5s ease-in-out; z-index: 2; }
.pv-card-image-overlay.hidden { opacity: 0; pointer-events: none; }
.pv-card-content { padding: 15px; height: 100%; overflow-y: auto; color: var(--text-color); line-height: 1.6; font-size: 15px; background-color: white; position: relative; z-index: 1; }
.pv-card-footer { background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent); color: white; padding: 20px 10px 8px; font-size: 12px; display: flex; align-items: center; gap: 5px; position: absolute; bottom: 0; left: 0; width: 100%; z-index: 3; pointer-events: none; transition: opacity 0.5s ease-in-out; }
.pv-card-footer.hidden { opacity: 0; }
.pv-card-footer svg { width: 14px; height: 14px; fill: white; flex-shrink: 0; }

.transfer-card { width: 240px; height: auto; border-radius: var(--border-radius); margin: 0 8px; overflow: hidden; position: relative; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); color: white; }
.message-wrapper.sent .transfer-card { border-bottom-right-radius: 5px; }
.message-wrapper.received .transfer-card { border-bottom-left-radius: 5px; cursor: pointer; }
.transfer-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-size: cover; background-position: center; filter: blur(4px); transform: scale(1.1); z-index: 1; }
.transfer-card.sent-transfer::before { background-image: url('https://i.postimg.cc/sxN893WF/IMG-20250712.png'); }
.transfer-card.received-transfer::before { background-image: url('https://i.postimg.cc/FzR8LY7g/IMG-20250712-170703.png'); }
.transfer-card .overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.3); z-index: 2; transition: background-color 0.5s ease; }
.transfer-card.received .overlay { background-color: rgba(180, 180, 180, 0.4); }
.transfer-card.returned .overlay { background-color: rgba(100, 100, 100, 0.5); }
.transfer-content { position: relative; z-index: 3; padding: 20px; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); }
.transfer-title { font-size: 14px; margin: 0 0 5px 0; opacity: 0.9; }
.transfer-amount { font-size: 28px; font-weight: bold; margin: 0; }
.transfer-remark { font-size: 14px; margin-top: 10px; opacity: 0.9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.transfer-status { font-size: 12px; margin-top: 15px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.3); opacity: 0.8; }

.gift-card { width: 230px; background-color: #fff; border: 2px solid #333; border-radius: var(--border-radius); box-shadow: 4px 4px 0px #ddd; padding: 10px; display: flex; align-items: center; cursor: pointer; margin: 0 8px; position: relative; overflow: hidden; }
.message-wrapper.sent .gift-card { border-bottom-right-radius: 5px; }
.message-wrapper.received .gift-card { border-bottom-left-radius: 5px; }
.gift-card-icon { width: 50px; height: 50px; margin-right: 15px; flex-shrink: 0; }
.gift-card-text { font-size: 16px; font-weight: bold; color: #333; font-family: 'Comic Sans MS', 'Chalkduster', 'Handwriting', cursive; }
.gift-card-description { font-size: 14px; color: #555; background-color: rgba(240, 240, 240, 0.9); padding: 8px 12px; margin-bottom: 5px; margin-left: 54px; margin-right: 54px; border-radius: 10px; line-height: 1.6; max-width: calc(100% - 108px); display: none; animation: fadeIn 0.3s ease; }
.gift-card-description.active { display: block; }
.message-wrapper.sent .gift-card-description { align-self: flex-end; margin-right: 54px; margin-left: auto; }
.message-wrapper.received .gift-card-description { align-self: flex-start; margin-left: 54px; margin-right: auto; }
.gift-card-received-stamp { position: absolute; top: 5px; right: 5px; font-size: 14px; font-weight: bold; color: var(--secondary-color); border: 2px solid var(--secondary-color); border-radius: 8px; padding: 2px 6px; transform: rotate(15deg); opacity: 0; transition: opacity 0.3s ease; font-family: 'Comic Sans MS', 'Chalkduster', 'Handwriting', cursive; }
.gift-card.received .gift-card-received-stamp { opacity: 1; }

.typing-indicator { text-align: center; color: #aaa; font-style: italic; font-size: 14px; padding: 10px 0; display: none; }

/* 输入区与功能栏 */
.chat-input-wrapper { flex-shrink: 0; }
#sticker-bar { flex-shrink: 0; padding: 0 10px 5px; display: flex; align-items: center; background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(10px); }
.sticker-bar-btn { background: none; border: none; padding: 5px; cursor: pointer; }
.sticker-bar-btn svg { width: 28px; height: 28px; fill: #888; }
#regenerate-btn svg, #summary-btn svg { fill: #888; }
.message-input-area { display: flex; align-items: center; padding: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid #eee; background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(10px); flex-shrink: 0; gap: 10px; border-bottom-left-radius: var(--phone-corner-radius); border-bottom-right-radius: var(--phone-corner-radius); overflow: hidden; }
.message-input-area input, .message-input-area textarea { flex-grow: 1; border: none; padding: 12px; border-radius: 18px; background-color: #f0f0f0; font-family: inherit; font-size: 14px; }
.message-input-area textarea { resize: none; height: 44px; box-sizing: border-box; overflow-y: auto; line-height: 20px; }
.message-input-area input:focus, .message-input-area textarea:focus { outline: none; }
.message-input-area .icon-btn { background: var(--primary-color); color: white; border: none; border-radius: 50%; width: 40px; height: 40px; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: background-color 0.2s; }
.message-input-area .icon-btn:hover { background: var(--secondary-color); }
.message-input-area .icon-btn:disabled { background-color: #cccccc; cursor: not-allowed; }
.message-input-area .icon-btn svg { width: 20px; height: 20px; fill: currentColor; }
.message-input-area .icon-btn.send-btn { font-size: 18px; }

#multi-select-bar { position: absolute; bottom: 0; left: 0; width: 100%; background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(10px); display: none; justify-content: space-between; align-items: center; padding: 10px 20px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid #eee; z-index: 20; border-bottom-left-radius: var(--phone-corner-radius); border-bottom-right-radius: var(--phone-corner-radius); animation: slideUp 0.3s ease-out; }
#multi-select-bar.visible { display: flex; }

/* 极简翻译 */
.message-translation { display: none; margin-top: 6px; padding-top: 6px; border-top: 1px dashed rgba(128, 128, 128, 0.2); word-break: break-word; font-size: 0.95em; opacity: 0.9; }
.show-translation .message-translation { display: block; animation: fadeIn 0.2s ease; }


/* =========================================
   七、表情包/图片彻底透明化（拔掉半透明外壳和毛玻璃背景）
   ========================================= */
.image-bubble {
  background: transparent !important;
  background-color: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  border: none !important;
}

.image-bubble img {
  border-radius: 8px !important;
  display: block !important;
}
/* @budding */


/* =========================================
   八、去掉发送和等待回复按钮的背景圆圈
   ========================================= */
#send-message-btn, 
#get-reply-btn, 
#offline-send-btn, 
#offline-get-reply-btn {
    background: transparent !important;
    color: #666 !important; /* 把变成透明底后的图标换成深灰色，防止隐形 */
    box-shadow: none !important;
}

/* 稍微放大一点点图标，因为去掉了外面的大圆圈，怕图标显得太小 */
#send-message-btn svg, 
#get-reply-btn svg, 
#offline-send-btn svg, 
#offline-get-reply-btn svg {
    width: 26px !important;
    height: 26px !important;
}

/* 按下去或者鼠标放上去的时候给一点点变化，假装它是有灵魂的 */
#send-message-btn:hover, 
#get-reply-btn:hover, 
#offline-send-btn:hover, 
#offline-get-reply-btn:hover {
    background: transparent !important;
    color: var(--accent-color) !important;
    transform: scale(1.1);
}
/* @budding */







/* =========================================
   十、主菜单按钮样式 (使用背景图，方便自定义CSS覆盖)
   ========================================= */
#new-menu-toggle-btn, #offline-menu-toggle-btn {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    width: 28px !important;    /* 稍微放大至 28px 克服视错觉，与发送键平齐 */
    height: 28px !important;
    flex-shrink: 0;
    margin-right: 4px;
    
    /* 核心图标写入这里！把黑色的 #000 换成了适配的 %23666 深灰色 */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><rect width="24" height="24" fill="none"/><path fill="%23666" d="M3 2h2v20H3zm7 4h7v2h-7zm0 4h7v2h-7z"/><path fill="%23666" d="M19 2H6v20h13c1.103 0 2-.897 2-2V4c0-1.103-.897-2-2-2m0 18H8V4h11z"/></svg>') !important;
    background-size: 28px 28px !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

#new-menu-toggle-btn:hover, #offline-menu-toggle-btn:hover {
    transform: scale(1.1);
    transition: all 0.2s;
}

/* 强制保证功能栏绝对不换行，保持一排 */
#sticker-bar {
    flex-wrap: nowrap !important;
    overflow-x: auto !important; /* 太多的话允许手指横向滑动 */
    scrollbar-width: none;       /* 隐藏滚动条 */
}
#sticker-bar::-webkit-scrollbar {
    display: none;
}
/* @budding */
