/* ===== 新功能样式：上传进度提示 / 引用消息 / 我的收藏 / 自定义表情包 ===== */

/* 上传进度常驻提示（顶部居中，模仿聊天顶部 toast，直到完成才消失） */
#uploadProgressTip {
    position: fixed;
    top: 74px;
    left: 50%;
    transform: translateX(-50%) translateY(-16px);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 14px;
    padding: 8px 20px;
    border-radius: 8px;
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
}
#uploadProgressTip.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
/* 进度条：showUploadProgress 带百分比时出现，宽度随上传进度增长 */
#uploadProgressTip .upt-text {
    display: block;
    line-height: 18px;
    white-space: nowrap;
}
#uploadProgressTip .upt-bar {
    display: none;
    margin-top: 6px;
    width: 168px;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.25);
    overflow: hidden;
}
#uploadProgressTip.has-bar .upt-bar { display: block; }
#uploadProgressTip .upt-bar > i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 4px;
    background: #07C160;
    transition: width .18s linear;
}

/* 头像上传中的遮罩 + 百分比（个人信息页） */
.profile-avatar .pa-mask {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    z-index: 2;
    overflow: hidden;
}
.profile-avatar.uploading .pa-mask { display: flex; }
.profile-avatar .pa-mask b { font-weight: 600; letter-spacing: .3px; }
.profile-avatar .pa-mask .pa-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 3px;
    background: #07C160;
    transition: width .2s linear;
}

/* 朋友圈封面更换中的遮罩 */
.mv2-cover-loading {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    background: rgba(0, 0, 0, 0.42);
    color: #fff;
    font-size: 12px;
    z-index: 4;
}
.mv2-cover-loading.show { display: flex; }
.mv2-cover-loading .mcl-ring {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: paSpin .7s linear infinite;
}


/* 输入框上方的引用提示条 */
#quoteBar {
    display: none;
    align-items: center;
    gap: 8px;
    margin: 6px 12px 0;
    padding: 6px 10px;
    background: #f2f6f3;
    border-left: 3px solid var(--primary, #07C160);
    border-radius: 6px;
    font-size: 12px;
    color: #666;
}
#quoteBar .quote-bar-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#quoteBar i { cursor: pointer; color: #999; font-size: 16px; }

/* 消息气泡上方的引用块 */
.msg-quote {
    max-width: 260px;
    margin-bottom: 4px;
    padding: 5px 8px;
    background: rgba(0, 0, 0, 0.05);
    border-left: 3px solid var(--primary, #07C160);
    border-radius: 6px;
    font-size: 12px;
    color: #777;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
/* 自己的消息：引用块用白底深字，保证在绿色气泡/灰色背景上都清晰可见 */
.msg-item.self .msg-quote {
    background: rgba(255, 255, 255, 0.95);
    color: #666;
    border-left: 3px solid var(--primary, #07C160);
}
.msg-item.self .msg-quote .msg-quote-name { color: #333; }
.msg-quote .msg-quote-name { font-weight: 600; margin-right: 6px; }

/* 点击引用跳转后原消息闪烁高亮 */
.quote-jump-flash { animation: quoteFlash 1.6s ease; border-radius: 12px; }
@keyframes quoteFlash {
    0%, 60% { background: rgba(7, 193, 96, 0.15); }
    100% { background: transparent; }
}

/* ===== 我的收藏 ===== */
.favorites-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px 30px;
}
.fav-item {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.fav-meta {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.fav-text {
    font-size: 14px;
    color: #333;
    white-space: pre-wrap;
    word-break: break-word;
    background: #f7f7f7;
    border-radius: 8px;
    padding: 8px 10px;
}
.fav-image { text-align: center; }
.fav-image img { max-width: 100%; max-height: 320px; border-radius: 8px; cursor: pointer; }
.fav-del-btn {
    margin-top: 8px;
    border: none;
    background: none;
    color: #ff5c7a;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 0;
}
.fav-del-btn:hover { opacity: 0.75; }

/* ===== 自定义表情包面板（爱心图标，一行 5 个） ===== */
.custom-emoji-panel {
    display: none;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #eee;
    background: #fafafa;
    position: relative;
    max-height: 260px;
    overflow-y: auto;
}
.custom-emoji-cell {
    position: relative;
    aspect-ratio: 1;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.custom-emoji-cell img { width: 100%; height: 100%; object-fit: cover; }
.custom-emoji-cell.add {
    border: 1.5px dashed #ccc;
    color: #bbb;
    font-size: 24px;
}
.custom-emoji-cell.add:hover { border-color: var(--primary, #07C160); color: var(--primary, #07C160); }
.custom-emoji-del {
    position: absolute;
    top: 2px;
    right: 2px;
    color: #e74c3c;
    font-size: 15px;
    background: rgba(255,255,255,0.85);
    border-radius: 50%;
}
.custom-emoji-count {
    position: absolute;
    top: 6px;
    right: 12px;
    font-size: 11px;
    color: #aaa;
}

/* 设置页背景图上传中：预览区蒙层 + 百分比 */
.bg-preview { position: relative; }
.bg-preview.is-uploading::after {
    content: attr(data-pct);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .5);
    color: #fff;
    font-size: 13px;
    border-radius: inherit;
}
.profile-avatar.uploading i.ri-camera-line { display: none; }
