/* ===== 表情选择面板 ===== */
.emoji-picker {
    position: absolute;
    z-index: 9999;
    width: 320px;
    background: #fff;
    border: 1px solid #e4e7ed;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    user-select: none;
}

.emoji-cats {
    display: flex;
    border-bottom: 1px solid #ebeef5;
    padding: 4px 6px;
    gap: 2px;
    background: #fafafa;
    border-radius: 8px 8px 0 0;
}

.emoji-cat-btn {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 18px;
    padding: 6px 0;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
}
.emoji-cat-btn:hover { background: #e8f5ed; }
.emoji-cat-btn.active {
    background: #2d5a3d;
    color: #fff;
}

.emoji-panels {
    max-height: 160px;
    overflow-y: auto;
    padding: 6px;
}

.emoji-panel {
    display: none;
    flex-wrap: wrap;
    gap: 2px;
}
.emoji-panel.active { display: flex; }

.emoji-item {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, transform 0.12s;
}
.emoji-item:hover {
    background: #f0f9eb;
    transform: scale(1.2);
}
.emoji-item:active { transform: scale(1.05); }

/* 滚动条美化 */
.emoji-panels::-webkit-scrollbar { width: 6px; }
.emoji-panels::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 3px;
}
.emoji-panels::-webkit-scrollbar-thumb:hover { background: #b0b0b0; }

/* ===== 聊天图片消息 ===== */
.chat-msg-image {
    max-width: 240px;
    border-radius: 8px;
    display: block;
    cursor: pointer;
    transition: opacity 0.2s;
}
.chat-msg-image:hover { opacity: 0.9; }

/* 文件消息卡片 */
.chat-msg-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f5f7fa;
    border-radius: 8px;
    min-width: 180px;
    max-width: 280px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}
.chat-msg-file:hover { background: #ebeef5; }

.chat-msg-file-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.chat-msg-file-info {
    flex: 1;
    min-width: 0;
}

.chat-msg-file-name {
    font-size: 13px;
    font-weight: 500;
    color: #303133;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}

.chat-msg-file-size {
    font-size: 11px;
    color: #909399;
}

/* 上传中状态 */
.chat-msg-uploading {
    opacity: 0.6;
    position: relative;
}
.chat-msg-uploading::after {
    content: '上传中...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
}

/* ===== 移动端适配 ===== */
@media (max-width: 480px) {
    .emoji-picker {
        width: calc(100vw - 24px);
        max-width: 320px;
    }
    .emoji-item {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }
    .chat-msg-image {
        max-width: 60vw;
    }
}
