/* @🍮 聊天室专属样式开始 */
        .chat-room-overlay { position: fixed; top: 0; left: 100%; width: 100%; height: 100%; background: #ededed; transition: left 0.3s ease-in-out; z-index: 130; display: flex; flex-direction: column; font-family: sans-serif; }
        .chat-room-overlay.active { left: 0; }
        .chat-header { background: #ededed; height: 50px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; font-weight: bold; color: #000; flex-shrink: 0; border-bottom: 1px solid #d9d9d9; }
        .chat-header-left, .chat-header-right { display: flex; align-items: center; cursor: pointer; width: 30px; }
        .chat-header-left svg, .chat-header-right svg { width: 24px; height: 24px; fill: #000; }
        .chat-header-title { font-size: 17px; flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .chat-messages { flex: 1; overflow-y: auto; background: #ededed; padding: 15px; }
        .chat-bottom-bar { background: #f7f7f7; border-top: 1px solid #d9d9d9; display: flex; align-items: center; padding: 8px 10px; gap: 10px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); flex-shrink: 0; }
        .chat-input-container { flex: 1; background: #fff; border-radius: 4px; display: flex; align-items: center; padding: 5px 10px; height: 40px; box-sizing: border-box; min-width: 0; }
        .chat-input { flex: 1; border: none; outline: none; background: transparent; font-size: 15px; color: #333; min-width: 0; width: 100%; }
        .chat-voice-icon { width: 24px; height: 24px; fill: #000; cursor: pointer; flex-shrink: 0; }
        .chat-icon { width: 28px; height: 28px; fill: #000; cursor: pointer; flex-shrink: 0; }
        
        .contact-item { display: flex; align-items: center; padding: 12px 15px; background: #fff; border-bottom: 1px solid #f0f0f0; cursor: pointer; gap: 15px; }
        .contact-avatar { width: 44px; height: 44px; background: #34c759; border-radius: 6px; flex-shrink: 0; display:flex; justify-content:center; align-items:center; color:#fff; font-size:20px; font-weight:bold;}
        .contact-name { font-size: 16px; color: #333; flex: 1; }
        
        /* 列表左滑专属样式 */
        .chat-list-wrapper { position: relative; overflow: hidden; width: 100%; border-bottom: 1px solid #f0f0f0; }
        .chat-list-wrapper .contact-item { border-bottom: none; position: relative; z-index: 2; transition: transform 0.2s ease; background: #fff; }
        .chat-list-wrapper.pinned .contact-item { background: #f9f9f9; }
        .swipe-actions { position: absolute; top: 0; right: 0; height: 100%; display: flex; z-index: 1; }
        .swipe-btn { width: 65px; height: 100%; display: flex; justify-content: center; align-items: center; color: #fff; font-size: 14px; cursor: pointer; }
        .swipe-btn.pin { background: #c7c7cc; }
        .swipe-btn.del { background: #ff3b30; }

        /* @🍮 聊天室气泡与表情面板专属样式开始 */
        .message-row { display: flex; margin-bottom: 15px; width: 100%; }
        .message-row.mine { justify-content: flex-end; }
        .message-avatar { width: 40px; height: 40px; border-radius: 6px; background-color: #ddd; flex-shrink: 0; background-size: cover; background-position: center; }
        .message-content { max-width: 70%; padding: 10px 12px; border-radius: 8px; font-size: 15px; line-height: 1.4; word-break: break-all; }
        .message-row.theirs .message-content { background: #fff; color: #333; margin-left: 10px; border-top-left-radius: 0; }
        .message-row.mine .message-content { background: #95ec69; color: #000; margin-right: 10px; border-top-right-radius: 0; }
        .message-row.mine .message-avatar { background-image: url('https://img.baibai.cv/f/3YRqie/mmexport1785515299260.jpg'); }
        .message-image { max-width: 150px; border-radius: 8px; display: block; }
        
        .emoji-panel { background: #f7f7f7; border-top: 1px solid #d9d9d9; display: none; flex-direction: column; height: 250px; flex-shrink: 0; }
        .emoji-panel.active { display: flex; }
        .emoji-header { display: flex; align-items: center; justify-content: space-between; padding: 5px 10px; background: #ededed; border-bottom: 1px solid #e0e0e0; }
        .emoji-nav { display: flex; overflow-x: auto; gap: 10px; flex: 1; padding: 5px 0; scrollbar-width: none; }
        .emoji-nav::-webkit-scrollbar { display: none; }
        .emoji-cat { padding: 5px 10px; font-size: 13px; color: #666; background: #fff; border-radius: 12px; white-space: nowrap; cursor: pointer; user-select: none; }
        .emoji-cat.active { background: #000; color: #fff; }
        .emoji-actions { display: flex; gap: 10px; align-items: center; padding-left: 10px; flex-shrink: 0; }
        .emoji-grid { flex: 1; overflow-y: auto; padding: 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 10px; align-content: start; }
        .emoji-item { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
        .emoji-img { width: 100%; aspect-ratio: 1; border-radius: 8px; background-color: #eee; background-size: cover; background-position: center; }
        .emoji-name { font-size: 10px; color: #666; text-align: center; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .emoji-item.selected { box-shadow: 0 0 0 3px #07c160; opacity: 0.8; }
        
        /* @🍮 左侧菜单面板专属样式 */
        .chat-left-menu { position: absolute; bottom: 65px; left: 10px; background: #4c4c4c; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.2); display: none; flex-direction: column; z-index: 150; padding: 5px 0; min-width: 120px;}
        .chat-left-menu.active { display: flex; }
        .chat-left-menu::after { content: ''; position: absolute; bottom: -10px; left: 15px; border-width: 5px; border-style: solid; border-color: #4c4c4c transparent transparent transparent; }
        .chat-menu-item { padding: 12px 15px; font-size: 14px; color: #fff; cursor: pointer; display: flex; align-items: center; gap: 10px; }
        .chat-menu-item:active { background: #5a5a5a; }

        /* @🍮 语音气泡专属样式 (独立框与新波纹) */
        .message-body { display: flex; flex-direction: column; max-width: 70%; gap: 5px; }
        .message-row.theirs .message-body { margin-left: 10px; align-items: flex-start; }
        .message-row.mine .message-body { margin-right: 10px; align-items: flex-end; }
        .message-body .message-content { margin: 0 !important; max-width: 100% !important; cursor: pointer; }
        
        .voice-bubble { display: flex; align-items: center; gap: 5px; user-select: none; }
        .voice-icon-svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
        .message-row.mine .voice-bubble { flex-direction: row-reverse; }
        .message-row.mine .voice-icon-svg { transform: scaleX(-1); }
        
        .voice-text-box { display: none; padding: 10px 12px; border-radius: 8px; font-size: 15px; line-height: 1.4; word-break: break-all; max-width: 100%; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
        .message-row.theirs .voice-text-box { background: #fff; color: #333; border-top-left-radius: 0; }
        .message-row.mine .voice-text-box { background: #95ec69; color: #000; border-top-right-radius: 0; }
        .voice-text-box.active { display: block; }
        
        /* @🍮 文字图翻转魔法专属样式开始 */
        .text-image-container {
            perspective: 1000px;
            width: 140px;
            height: 180px;
            cursor: pointer;
            margin: 0 5px;
        }
        .text-image-card {
            width: 100%;
            height: 100%;
            position: relative;
            transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
            transform-style: preserve-3d;
        }
        .text-image-card.flipped {
            transform: rotateY(180deg);
        }
        .text-image-front, .text-image-back {
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0;
            left: 0;
            backface-visibility: hidden;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 2px 6px rgba(0,0,0,0.1);
        }
        .text-image-front {
            background-image: url('https://img.baibai.cv/f/VqNMs4/Image_1771584544984_681.jpg');
            background-size: cover;
            background-position: center;
        }
        .text-image-back {
            background: #fff;
            color: #333;
            transform: rotateY(180deg);
            padding: 12px;
            box-sizing: border-box;
            overflow-y: auto;
            font-size: 14px;
            line-height: 1.5;
            word-break: break-all;
            scrollbar-width: none; 
        }
        .text-image-back::-webkit-scrollbar { display: none; }
        .message-row.mine .text-image-back {
            background: #95ec69;
            color: #000;
        }
        
        /* @🍮 文字图翻转魔法专属样式结束 */

        /* @🍮 微信转账魔法专属样式开始 */
        .message-content.image-wrap { background: transparent !important; padding: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
        .message-content.transfer-wrap { background: transparent !important; padding: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
        .transfer-bubble { width: 220px; border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; cursor: pointer; border: 1px solid rgba(0,0,0,0.05); user-select: none; }
        .transfer-top { background-color: #f39b38; padding: 12px 15px; display: flex; align-items: center; gap: 12px; color: #fff; transition: background-color 0.2s; }
        .transfer-top.accepted { background-color: #f7c388; }
        .transfer-icon { width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.8); display: flex; justify-content: center; align-items: center; flex-shrink: 0; }
        .transfer-icon svg { width: 22px; height: 22px; fill: #fff; }
        .transfer-info { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: hidden; }
        .transfer-amount { font-size: 16px; font-weight: 500; }
        .transfer-note { font-size: 13px; opacity: 0.9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .transfer-bottom { background-color: #fff; padding: 5px 15px; font-size: 10px; color: #999; text-align: left; }
        /* @🍮 微信转账魔法专属样式结束 */


        /* @🍮 聊天室气泡与表情面板专属样式结束 */
        
        
        /* @🍮 聊天设置专属样式开始 */
        .chat-settings-overlay { position: fixed; top: 100%; left: 0; width: 100%; height: 100%; background: #ededed; transition: top 0.35s ease-in-out; z-index: 140; display: flex; flex-direction: column; font-family: sans-serif; overflow-y: auto; }
        .chat-settings-overlay.active { top: 0; }
        .chat-settings-header { background: #ededed; height: 50px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; font-weight: bold; color: #000; flex-shrink: 0; border-bottom: 1px solid #d9d9d9; }
        .cs-header-left { display: flex; align-items: center; cursor: pointer; }
        /* @🍮 聊天设置专属样式结束 */

        
        /* @🍮 引用与撤回专属样式 */
        .quote-preview-box {
            background: #f7f7f7; border-top: 1px solid #d9d9d9; padding: 8px 15px; display: none; align-items: center; gap: 10px; width: 100%; box-sizing: border-box; flex-shrink: 0;
        }
        .quote-preview-box.active { display: flex; }
        .bubble-quote-box { font-size: 13px; color: #444; background: #e0e0e0; border-radius: 6px; padding: 8px 10px; margin-top: 1px; max-width: 100%; white-space: normal; word-break: break-all; box-sizing: border-box; text-align: left; }

        /* @🍮 气泡长按菜单面板专属样式 */
        .bubble-context-menu {
            position: fixed;
            background: #4c4c4c;
            border-radius: 8px;
            display: none;
            flex-direction: row;
            z-index: 1000;
            box-shadow: 0 4px 12px rgba(0,0,0,0.2);
            overflow: hidden;
        }
        .bubble-context-menu.active { display: flex; }
        .bubble-menu-item {
            padding: 10px 15px; color: #fff; font-size: 13px; cursor: pointer; white-space: nowrap; position: relative;
        }
        .bubble-menu-item:not(:last-child)::after {
            content: ''; position: absolute; right: 0; top: 20%; height: 60%; width: 1px; background: #5a5a5a;
        }
        .bubble-menu-item:active { background: #5a5a5a; }


        /* @🍮 世界书专属样式 */
        .wb-cat-header { display:flex; align-items:center; padding:12px 15px; background:#fff; border-radius:8px; font-weight:bold; color:#333; font-size:15px; cursor:pointer; user-select:none; box-shadow: 0 1px 3px rgba(0,0,0,0.02); }
        .wb-cat-header svg { width:16px; height:16px; fill:#999; margin-right:8px; transition: transform 0.2s; }
        .wb-cat-header.expanded svg { transform: rotate(90deg); }
        .wb-entry-list { display:none; flex-direction:column; gap:8px; padding:8px 0 8px 24px; }
        .wb-entry-list.expanded { display:flex; }
        .wb-entry-item { display:flex; align-items:center; background:#f9f9f9; padding:10px 15px; border-radius:8px; font-size:14px; color:#555; cursor:pointer; }
        .wb-radio { display:flex; align-items:center; gap:5px; font-size:14px; color:#333; cursor:pointer; }
        .wb-radio input[type="radio"] { accent-color: #333; width:16px; height:16px; }
        .wb-checkbox { accent-color: #07c160; width:18px; height:18px; margin-right:10px; flex-shrink:0; cursor:pointer; }


        /* @🍮 群聊消息说话人名字专属样式（头像顶端与气泡对齐，名字探在气泡左上方） */
        .message-row.theirs:has(.group-sender-name) { align-items: flex-start; }
        /* @🍮 头像往下挪，跳过名字那一行的高度，正好和气泡顶端对齐 */
        .message-row.theirs:has(.group-sender-name) .message-avatar { margin-top: 19px; }
        .group-sender-name { font-size: 12px; line-height: 16px; color: #999; margin: 0 0 3px 0; padding-left: 2px; }
        .message-row.mine .group-sender-name { display: none; }

        /* @🍮 聊天室专属样式结束 */
/* @🍮 */
.image-preview-overlay.active { display: flex !important; }

        /* @🍮 聊天多选删除模式专属样式 */
        .message-checkbox {
            display: none; accent-color: #07c160; width: 22px; height: 22px; margin-top: 9px; margin-right: 10px; flex-shrink: 0; pointer-events: none;
        }
        .chat-messages.manage-mode .message-checkbox { display: block; }
        .chat-messages.manage-mode .message-row { cursor: pointer; align-items: flex-start; }
        .chat-messages.manage-mode .message-row.mine .message-checkbox { margin-right: auto; margin-left: 0; }
