/* ============================================================
 * 头像 / 好友 / 私信 模块样式（前缀 so-，与 bootstrap 隔离）
 * ============================================================ */
.so-wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 18px 18px 60px;
}

/* ---------- 页头 / 页签 ---------- */
.so-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 14px;
    flex-wrap: wrap;
}
.so-head h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2f3440;
    letter-spacing: .2px;
}
.so-head .so-sub {
    margin: 4px 0 0;
    font-size: 12px;
    color: #8a94a6;
}
.so-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e9edf5;
    flex-wrap: wrap;
}
.so-tab {
    position: relative;
    padding: 9px 14px;
    font-size: 14px;
    color: #5b667a;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
}
.so-tab:hover { color: #2f6fe0; text-decoration: none; }
.so-tab.on { color: #2f6fe0; border-bottom-color: #2f6fe0; font-weight: 600; }
.so-tab .dot {
    display: inline-block;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    margin-left: 5px;
    border-radius: 9px;
    background: #f5493d;
    color: #fff;
    font-size: 11px;
    line-height: 17px;
    text-align: center;
    vertical-align: 1px;
}

/* ---------- 卡片 ---------- */
.so-card {
    background: #fff;
    border: 1px solid #e6eaf2;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(24, 42, 80, .05);
}
.so-card + .so-card { margin-top: 16px; }
.so-card-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid #eef1f7;
}
.so-card-hd h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #2f3440;
}
.so-card-bd { padding: 18px; }

.so-grid2 {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
@media (max-width: 860px) {
    .so-grid2 { grid-template-columns: 1fr; }
}

/* ---------- 头像 ---------- */
img.ua, span.ua {
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
    flex: 0 0 auto;
    vertical-align: middle;
    background: #eef1f7;
}
span.ua-initial {
    color: #fff;
    text-align: center;
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.so-avatar-big {
    width: 128px;
    height: 128px;
    margin: 0 auto 14px;
    display: block;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 2px 10px rgba(24, 42, 80, .12);
}
.so-avatar-big.ua-initial {
    font-size: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.so-avatar-wrap { text-align: center; }
.so-avatar-wrap h3 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    color: #2f3440;
}
.so-avatar-wrap p { margin: 0; font-size: 12px; color: #8a94a6; }

/* ---------- 按钮 ---------- */
.so-btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 7px;
    border: 1px solid #d7deea;
    background: #fff;
    color: #3c4658;
    font-size: 13px;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.so-btn:hover { border-color: #b9c6da; background: #f7f9fc; color: #2f3440; text-decoration: none; }
.so-btn-primary {
    background: #4c97ff;
    border-color: #3d86ef;
    color: #fff;
}
.so-btn-primary:hover { background: #3d86ef; border-color: #2f6fe0; color: #fff; }
.so-btn-danger { color: #d9453a; border-color: #f3c9c6; }
.so-btn-danger:hover { background: #fff4f3; border-color: #e8a7a2; color: #c53a2f; }
.so-btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 6px; }
.so-btn-lg { padding: 11px 22px; font-size: 14px; }
.so-btn[disabled], .so-btn.is-disabled {
    opacity: .55;
    cursor: not-allowed;
    pointer-events: none;
}
.so-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 表单 ---------- */
.so-field { margin-bottom: 14px; }
.so-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #4a5568;
    font-weight: 500;
}
.so-input, .so-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d7deea;
    border-radius: 8px;
    font-size: 14px;
    color: #2f3440;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}
.so-textarea { resize: vertical; min-height: 76px; line-height: 1.6; }
.so-input:focus, .so-textarea:focus {
    outline: none;
    border-color: #4c97ff;
    box-shadow: 0 0 0 3px rgba(76, 151, 255, .14);
}
.so-hint { margin: 6px 0 0; font-size: 12px; color: #8a94a6; }
.so-error { margin: 6px 0 0; font-size: 12px; color: #d9453a; }

/* ---------- 冷却倒计时 ---------- */
.so-cd {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 9px;
    background: #fff8ec;
    border: 1px solid #ffe2b0;
    font-size: 13px;
    color: #8a5a00;
    margin-bottom: 14px;
}
.so-cd.is-ready { background: #eefbf3; border-color: #bfe9d0; color: #1c7a45; }
.so-cd .t {
    font: 600 18px/1.2 "SF Mono", Menlo, Consolas, monospace;
    letter-spacing: .5px;
    color: #c46a00;
}
.so-cd.is-ready .t { color: #1c7a45; }
.so-cd .ico { font-size: 18px; }

/* ---------- 上传 / 裁剪 ---------- */
.so-drop {
    border: 2px dashed #d7deea;
    border-radius: 10px;
    padding: 26px 16px;
    text-align: center;
    color: #8a94a6;
    background: #fafbfd;
    cursor: pointer;
    transition: all .15s;
}
.so-drop:hover, .so-drop.dragging {
    border-color: #4c97ff;
    background: #f4f8ff;
    color: #3d86ef;
}
.so-drop strong { display: block; font-size: 14px; color: #3c4658; margin-bottom: 4px; }
.so-drop span { font-size: 12px; }

.so-cropper { display: none; }
.so-cropper.on { display: block; }
.so-crop-stage {
    position: relative;
    width: 100%;
    max-width: 360px;
    aspect-ratio: 1 / 1;
    margin: 0 auto 12px;
    background: #1f2530;
    border-radius: 10px;
    overflow: hidden;
    cursor: grab;
    touch-action: none;
    user-select: none;
}
.so-crop-stage:active { cursor: grabbing; }
.so-crop-stage canvas { display: block; width: 100%; height: 100%; }
.so-crop-mask {
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 0 9999px rgba(16, 20, 28, .45);
    border-radius: 10px;
}
.so-crop-mask::after {
    content: "";
    position: absolute;
    inset: 8%;
    border: 2px solid rgba(255, 255, 255, .85);
    border-radius: 6px;
}
.so-zoom { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.so-zoom input[type=range] { flex: 1; accent-color: #4c97ff; }

/* ---------- 好友列表 ---------- */
.so-search { display: flex; gap: 8px; }
.so-search .so-input { width: 220px; }
.so-friends {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
    gap: 12px;
}
.so-friend {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid #e9edf5;
    border-radius: 10px;
    background: #fff;
    transition: box-shadow .15s, border-color .15s;
}
.so-friend:hover { border-color: #d3e0f7; box-shadow: 0 3px 12px rgba(24, 42, 80, .07); }
.so-friend-main { flex: 1 1 auto; min-width: 0; }
.so-friend-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #2f3440;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.so-friend-name:hover { color: #2f6fe0; text-decoration: none; }
.so-friend-sub {
    margin: 2px 0 0;
    font-size: 12px;
    color: #98a2b3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.so-friend-ops { display: flex; gap: 6px; margin-top: 8px; }
.so-online {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c9d2e0;
    margin-right: 5px;
    vertical-align: 1px;
}
.so-online.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .16); }

/* ---------- 好友申请 ---------- */
.so-req {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f3f9;
}
.so-req:last-child { border-bottom: 0; }
.so-req-main { flex: 1 1 auto; min-width: 0; }
.so-req-top {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.so-req-name { font-size: 14px; font-weight: 600; color: #2f3440; }
.so-req-time { font-size: 12px; color: #98a2b3; margin-left: auto; }
.so-req-msg {
    margin: 6px 0 0;
    font-size: 13px;
    color: #5b667a;
    line-height: 1.6;
    background: #f7f9fc;
    border-radius: 8px;
    padding: 8px 11px;
    word-break: break-word;
}
.so-req-ops { display: flex; gap: 8px; margin-top: 10px; }
.so-empty {
    padding: 48px 20px;
    text-align: center;
    color: #98a2b3;
    font-size: 13px;
}
.so-empty .big { font-size: 34px; display: block; margin-bottom: 10px; opacity: .5; }

/* ---------- 标签 ---------- */
.so-tag {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 11px;
    line-height: 18px;
    background: #eef3ff;
    color: #3d6fd4;
    border: 1px solid #dbe6ff;
}
.so-tag.gray { background: #f4f6fa; color: #7c8698; border-color: #e5eaf3; }
.so-tag.red { background: #fdeeed; color: #c53a2f; border-color: #f8d5d2; }
.so-tag.green { background: #eafaf1; color: #1c7a45; border-color: #c9eeda; }

/* ---------- 头像上传进度与失败重试 ---------- */
.so-upload-progress { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; }
.so-upload-track { flex: 1 1 auto; height: 8px; border-radius: 999px; background: #edf1f8; overflow: hidden; }
.so-upload-track > span {
    display: block; width: 0; height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, #4c9bff, #1677ff);
    transition: width .15s linear;
}
.so-upload-pct { flex: 0 0 42px; font-size: 12px; color: #6b7892; text-align: right; }
#btnRetry { margin-top: 10px; }

/* ---------- 聊天 ---------- */
.so-chat {
    display: grid;
    grid-template-columns: 296px minmax(0, 1fr);
    height: calc(100vh - 168px);
    min-height: 520px;
    background: #fff;
    border: 1px solid #e6eaf2;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(24, 42, 80, .05);
}
.so-chat-side {
    border-right: 1px solid #eef1f7;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #fcfdff;
}
.so-chat-side-hd {
    padding: 13px 16px;
    border-bottom: 1px solid #eef1f7;
    font-size: 14px;
    font-weight: 600;
    color: #2f3440;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.so-chat-list { flex: 1 1 auto; overflow-y: auto; }
.so-conv {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 11px 14px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f5f7fb;
    transition: background .12s;
}
.so-conv:hover { background: #f5f9ff; text-decoration: none; color: inherit; }
.so-conv.on { background: #edf4ff; }
.so-conv-main { flex: 1 1 auto; min-width: 0; }
.so-conv-top { display: flex; align-items: baseline; gap: 6px; }
.so-conv-name {
    font-size: 14px;
    font-weight: 600;
    color: #2f3440;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1 1 auto;
}
.so-conv-time { font-size: 11px; color: #a3adbd; flex: 0 0 auto; }
.so-conv-last {
    margin: 3px 0 0;
    font-size: 12px;
    color: #98a2b3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.so-conv-badge {
    flex: 0 0 auto;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #f5493d;
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
}
.so-chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.so-chat-hd {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    border-bottom: 1px solid #eef1f7;
    background: #fff;
}
.so-chat-hd .name { font-size: 15px; font-weight: 600; color: #2f3440; }
.so-chat-hd .st { font-size: 12px; color: #98a2b3; }
.so-chat-hd .back { display: none; }
.so-chat-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 18px 18px 8px;
    background: #f7f9fc;
    min-height: 0;
    scroll-behavior: smooth;
}
.so-day {
    text-align: center;
    margin: 10px 0 16px;
    font-size: 11px;
    color: #a3adbd;
}
.so-day span {
    background: #e9eef8;
    padding: 2px 10px;
    border-radius: 10px;
}
.so-msg { display: flex; gap: 8px; margin-bottom: 14px; align-items: flex-end; }
.so-msg.mine { flex-direction: row-reverse; }
.so-msg .ua { width: 32px; height: 32px; font-size: 13px; }
/* 宽度约束放在外层：气泡若用百分比 max-width，包含块宽度又由内容决定，会互相依赖导致窄到逐字换行 */
.so-msg-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    max-width: min(72%, 560px);
}
.so-msg.mine .so-msg-body { align-items: flex-end; }
.so-bubble {
    max-width: 100%;
    padding: 9px 13px;
    border-radius: 14px;
    border-top-left-radius: 4px;
    background: #fff;
    border: 1px solid #e6eaf2;
    font-size: 14px;
    line-height: 1.62;
    color: #2f3440;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
}
.so-msg.mine .so-bubble {
    background: #4c97ff;
    border-color: #4c97ff;
    color: #fff;
    border-top-left-radius: 14px;
    border-top-right-radius: 4px;
}
.so-msg-meta {
    font-size: 11px;
    color: #a3adbd;
    margin-top: 3px;
    display: flex;
    gap: 5px;
    align-items: center;
}
.so-msg.mine .so-msg-meta { justify-content: flex-end; }
.so-msg .pending { color: #c9a227; }
.so-msg .failed { color: #d9453a; cursor: pointer; }
.so-loadmore {
    display: block;
    margin: 0 auto 14px;
    font-size: 12px;
    color: #6b7a90;
    background: #fff;
    border: 1px solid #e0e7f2;
    border-radius: 14px;
    padding: 4px 14px;
    cursor: pointer;
}
.so-chat-input {
    position: relative;
    border-top: 1px solid #eef1f7;
    padding: 10px 12px 12px;
    background: #fff;
}
.so-chat-input textarea {
    width: 100%;
    border: 1px solid #dfe5f0;
    border-radius: 9px;
    padding: 9px 12px;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    max-height: 140px;
    min-height: 44px;
    box-sizing: border-box;
    color: #2f3440;
    transition: border-color .15s, box-shadow .15s;
}
.so-chat-input textarea:focus {
    outline: none;
    border-color: #4c97ff;
    box-shadow: 0 0 0 3px rgba(76, 151, 255, .13);
}
.so-chat-tools {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 8px;
}
.so-chat-tools .tip { flex: 1 1 auto; font-size: 11px; color: #a3adbd; }
.so-lock {
    padding: 10px 12px;
    background: #fff8ec;
    border: 1px solid #ffe2b0;
    border-radius: 9px;
    font-size: 13px;
    color: #8a5a00;
    text-align: center;
}

/* ---------- 个人主页 ---------- */
.so-profile {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 22px;
    flex-wrap: wrap;
}
.so-profile .ua { width: 88px; height: 88px; font-size: 32px; }
.so-profile-main { flex: 1 1 240px; min-width: 0; }
.so-profile-main h2 { margin: 0 0 4px; font-size: 19px; font-weight: 600; color: #2f3440; }
.so-profile-main p { margin: 0; font-size: 13px; color: #8a94a6; }
.so-profile-meta { display: flex; gap: 18px; margin-top: 10px; font-size: 12px; color: #7c8698; }
.so-profile-meta b { display: block; font-size: 15px; color: #2f3440; font-weight: 600; }

/* ---------- 提示条 ---------- */
.so-toast {
    position: fixed;
    left: 50%;
    bottom: 36px;
    transform: translateX(-50%) translateY(12px);
    background: rgba(38, 46, 60, .94);
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    z-index: 9999;
    max-width: 80vw;
}
.so-toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.so-toast.err { background: rgba(196, 52, 40, .95); }

/* ---------- 导航角标 ---------- */
.nav-badge {
    display: inline-block;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    margin-left: 4px;
    border-radius: 8px;
    background: #f5493d;
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    vertical-align: 1px;
    font-weight: 600;
}

/* ---------- 移动端 ---------- */
@media (max-width: 820px) {
    .so-wrap { padding: 12px 12px 40px; }
    .so-chat {
        grid-template-columns: 1fr;
        height: calc(100vh - 132px);
    }
    /* 未打开会话时高度由会话条数决定，不再留一大片空白 */
    .so-chat:not(.has-active) { height: auto; min-height: 0; }
    .so-chat:not(.has-active) .so-chat-main { display: none; }
    .so-chat .so-chat-main { display: none; }
    .so-chat.has-active .so-chat-side { display: none; }
    .so-chat.has-active .so-chat-main { display: flex; }
    .so-chat-hd .back { display: inline-block; }
    .so-msg-body { max-width: 80%; }
    .so-profile { padding: 16px; gap: 14px; }
    .so-search .so-input { width: 100%; }
    .so-search { flex: 1 1 100%; }
    .so-friends { grid-template-columns: 1fr; }
}

.so-chat-empty {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #98a2b3;
    font-size: 14px;
    background: #fbfcfe;
    padding: 30px;
}

/* hidden 属性会被 .nav-badge 等类的 display 覆盖，这里强制兜底 */
[hidden] { display: none !important; }

/* ============================================================
   添加好友（弹窗 + 昵称搜索结果）
   ============================================================ */
.so-head-ops {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

body.so-modal-open { overflow: hidden; }

.so-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.so-modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(24, 32, 46, .46);
    backdrop-filter: blur(2px);
}
.so-modal-box {
    position: relative;
    width: 100%;
    max-width: 460px;
    max-height: 84vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 18px 60px rgba(16, 28, 52, .24);
    animation: soModalIn .16s ease-out;
}
@keyframes soModalIn {
    from { opacity: 0; transform: translateY(10px) scale(.985); }
    to   { opacity: 1; transform: none; }
}
.so-modal-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid #eef2f8;
}
.so-modal-hd h3 { margin: 0; font-size: 15px; font-weight: 600; color: #2f3440; }
.so-modal-x {
    border: 0;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    color: #98a2b3;
    cursor: pointer;
    padding: 0 2px;
    border-radius: 6px;
}
.so-modal-x:hover { color: #2f3440; background: #f2f5fa; }
.so-modal-bd {
    padding: 16px 18px 18px;
    overflow-y: auto;
}
.so-modal-bd .so-field { margin-bottom: 8px; }
.so-modal-bd .so-search { flex: 1 1 auto; }
.so-modal-bd .so-search .so-input { width: 100%; }

.so-result { margin-top: 12px; }
.so-result-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border: 1px solid #eef2f8;
    border-radius: 10px;
    background: #fff;
}
.so-result-item + .so-result-item { margin-top: 8px; }
.so-result-item:hover { border-color: #d7e3f8; background: #fafcff; }
.so-result-main { flex: 1 1 auto; min-width: 0; }
.so-result-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #2f3440;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.so-result-name .so-online { width: 7px; height: 7px; }
.so-result-sub {
    margin-top: 2px;
    font-size: 12px;
    color: #98a2b3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.so-result-empty,
.so-result-loading {
    padding: 22px 12px;
    text-align: center;
    font-size: 13px;
    color: #98a2b3;
    line-height: 1.7;
}

@media (max-width: 820px) {
    .so-head-ops { width: 100%; }
    .so-head-ops .so-search { flex: 1 1 auto; }
    .so-modal { padding: 12px; align-items: flex-end; }
    .so-modal-box { max-height: 88vh; }
}

/* ============================================================
   表情面板（类微信 / QQ）
   ============================================================ */
.so-emoji-btn {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    filter: grayscale(.15);
    transition: background .15s, border-color .15s, filter .15s;
}
.so-emoji-btn:hover { background: #f3f6fb; border-color: #e2e9f5; filter: none; }
.so-emoji-btn.on { background: #eef4ff; border-color: #cfe0ff; filter: none; }

.so-emoji-panel {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: calc(100% - 2px);
    z-index: 30;
    display: flex;
    flex-direction: column;
    max-height: 252px;
    background: #fff;
    border: 1px solid #e4eaf4;
    border-radius: 12px;
    box-shadow: 0 12px 34px rgba(20, 35, 65, .16);
    overflow: hidden;
    animation: soEmojiIn .14s ease-out;
}
@keyframes soEmojiIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

.so-emoji-tabs {
    display: flex;
    gap: 2px;
    padding: 6px 8px;
    border-bottom: 1px solid #eef2f8;
    background: #fbfcfe;
    flex: 0 0 auto;
    overflow-x: auto;
}
.so-emoji-tab {
    flex: 0 0 auto;
    width: 30px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    opacity: .5;
    transition: background .12s, opacity .12s;
}
.so-emoji-tab:hover { opacity: .85; background: #f1f5fb; }
.so-emoji-tab.on { opacity: 1; background: #e8f0ff; }

.so-emoji-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    padding: 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.so-emoji-item {
    border: 0;
    padding: 5px 0;
    border-radius: 7px;
    background: transparent;
    font-size: 20px;
    line-height: 1.15;
    cursor: pointer;
    transition: background .1s, transform .1s;
}
.so-emoji-item:hover { background: #f1f5fb; transform: scale(1.08); }
.so-emoji-item:active { transform: scale(.94); }
.so-emoji-tip {
    grid-column: 1 / -1;
    padding: 26px 10px;
    text-align: center;
    font-size: 12.5px;
    color: #a3adbd;
}

@media (max-width: 820px) {
    .so-emoji-panel { max-height: 216px; }
    .so-emoji-grid { grid-template-columns: repeat(8, 1fr); }
    .so-emoji-item { font-size: 19px; }
}

/* ============================================================
 * 专属数字 ID（前缀 uid-）
 * ============================================================ */
.uid-hero {
    position: relative;
    padding: 22px 24px 20px;
    margin-bottom: 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2f6fe0 0%, #4c8dff 58%, #6ea6ff 100%);
    color: #fff;
    box-shadow: 0 6px 20px rgba(47, 111, 224, .22);
}
.uid-hero-label {
    font-size: 13px;
    letter-spacing: .5px;
    opacity: .88;
}
.uid-hero-num {
    margin: 8px 0 10px;
    font-family: 'SF Mono', Menlo, Consolas, 'Courier New', monospace;
    font-size: 36px;
    font-weight: 700;
    letter-spacing: 3px;
    line-height: 1.2;
    word-break: break-all;
}
.uid-hero-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.uid-hero-tip {
    margin: 12px 0 0;
    font-size: 12px;
    opacity: .85;
}
.uid-hero .uid-chip {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}
.uid-hero .uid-chip.is-gray {
    background: rgba(255, 255, 255, .14);
}
.uid-copy {
    margin-left: 4px;
    padding: 4px 13px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .75);
    background: transparent;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: .15s;
}
.uid-copy:hover {
    background: #fff;
    color: #2f6fe0;
}

.uid-chip {
    display: inline-block;
    padding: 1px 9px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 19px;
    background: #eef4ff;
    color: #2f6fe0;
    white-space: nowrap;
}
.uid-chip.is-gray {
    background: #f2f4f8;
    color: #8a94a6;
}

.uid-alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 12px;
}
.uid-alert.is-warn {
    background: #fff8e6;
    border: 1px solid #ffe1a8;
    color: #8a5a00;
}
.uid-alert .so-hint {
    display: block;
    margin: 2px 0 0;
}

.uid-step {
    margin: 0 0 4px;
    font-size: 13px;
    color: #5b667a;
}

.uid-cands {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 10px 0 12px;
}
.uid-cand {
    flex: 1 1 170px;
    min-width: 150px;
    padding: 12px 14px;
    border: 1px solid #dce3f0;
    border-radius: 10px;
    background: #fbfcff;
    cursor: pointer;
    text-align: left;
    transition: .15s;
}
.uid-cand b {
    display: block;
    font-family: 'SF Mono', Menlo, Consolas, 'Courier New', monospace;
    font-size: 21px;
    letter-spacing: 1px;
    color: #2f3440;
}
.uid-cand span {
    font-size: 12px;
    color: #8a94a6;
}
.uid-cand:hover {
    border-color: #9dbcff;
    background: #f3f7ff;
}
.uid-cand.is-on {
    border-color: #2f6fe0;
    background: #eef4ff;
    box-shadow: 0 0 0 3px rgba(47, 111, 224, .12);
}
.uid-cand.is-on b {
    color: #2f6fe0;
}
.uid-refresh-row {
    margin: -4px 0 14px;
}

.uid-pending-main {
    margin: 0 0 6px;
    font-size: 15px;
    color: #2f3440;
}
.uid-pending-main b {
    font-family: 'SF Mono', Menlo, Consolas, 'Courier New', monospace;
    font-size: 20px;
    color: #2f6fe0;
    letter-spacing: 1px;
}

/* ---------- 申请历史 ---------- */
.uid-hist-row {
    padding: 10px 0;
    border-bottom: 1px dashed #eef1f7;
}
.uid-hist-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}
.uid-hist-main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.uid-hist-main b {
    font-family: 'SF Mono', Menlo, Consolas, 'Courier New', monospace;
    font-size: 15px;
    letter-spacing: 1px;
    color: #2f3440;
}
.uid-hist-uid {
    font-family: 'SF Mono', Menlo, Consolas, 'Courier New', monospace;
    font-size: 13px;
    color: #5b667a;
}
.uid-hist-sub {
    margin-top: 4px;
    font-size: 12px;
    color: #8a94a6;
    line-height: 1.6;
}

.uid-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 9px;
    font-size: 12px;
    line-height: 18px;
    white-space: nowrap;
}
.uid-badge.is-pending {
    background: #fff5e6;
    color: #c47f00;
}
.uid-badge.is-approved {
    background: #e8f7ee;
    color: #1f8a4c;
}
.uid-badge.is-rejected {
    background: #fdeaea;
    color: #c33;
}
.uid-badge.is-cancelled {
    background: #eef1f7;
    color: #8a94a6;
}

/* ---------- 审批页 ---------- */
.uid-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.uid-stat {
    flex: 1 1 140px;
    background: #fff;
    border: 1px solid #e9edf5;
    border-radius: 10px;
    padding: 13px 16px;
}
.uid-stat b {
    display: block;
    font-size: 24px;
    line-height: 1.2;
    color: #2f3440;
}
.uid-stat span {
    font-size: 12px;
    color: #8a94a6;
}

.uid-req {
    border: 1px solid #e9edf5;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: #fff;
}
.uid-req:last-child {
    margin-bottom: 0;
}
.uid-req-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.uid-req-user b {
    font-size: 15px;
    color: #2f3440;
}
.uid-req-sub {
    margin-left: 8px;
    font-size: 12px;
    color: #8a94a6;
}
.uid-req-time {
    font-size: 12px;
    color: #a3abbd;
}
.uid-req-body {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 6px;
    flex-wrap: wrap;
}
.uid-arrow {
    color: #b7c1d4;
    font-size: 16px;
}
.uid-req-num {
    font-family: 'SF Mono', Menlo, Consolas, 'Courier New', monospace;
    font-size: 25px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #2f6fe0;
}
.uid-req-tags {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.uid-req-reason {
    margin: 4px 0 8px;
    font-size: 13px;
    color: #5b667a;
}
.uid-req-ops {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.uid-note {
    flex: 1 1 240px;
    min-width: 180px;
}

.uid-denied {
    text-align: center;
    padding: 46px 20px;
}
.uid-denied-ico {
    font-size: 34px;
    margin-bottom: 8px;
}
.uid-denied h2 {
    margin: 0 0 8px;
    font-size: 19px;
    color: #2f3440;
}
.uid-denied .so-actions {
    justify-content: center;
    margin-top: 14px;
}

@media (max-width: 640px) {
    .uid-hero {
        padding: 18px 16px;
    }
    .uid-hero-num {
        font-size: 26px;
        letter-spacing: 2px;
    }
    .uid-cands {
        flex-direction: column;
    }
    .uid-req-num {
        font-size: 21px;
    }
}

/* 行内展示的专属 ID 数字 */
.uid-inline {
    font-family: 'SF Mono', Menlo, Consolas, 'Courier New', monospace;
    font-size: 1.02em;
    letter-spacing: .5px;
    color: #2f6fe0;
}
.so-profile-uid {
    margin: 2px 0 0;
    font-size: 13px;
    color: #5b667a;
}
.so-profile-uid .so-hint {
    margin-left: 6px;
    font-size: 12px;
}

/* ============================================================
 * GIF 动图面板（表情按钮右侧，前缀 so-gif-）
 * ============================================================ */
.so-gif-btn {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    color: #2f6fe0;
    background: #eef4ff;
    border-radius: 50%;
}
.so-gif-btn:hover {
    background: #2f6fe0;
    color: #fff;
}

.so-gif-panel {
    width: 340px;
    max-height: 320px;
    overflow-y: auto;
}
.so-gif-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}
.so-gif-item {
    padding: 0;
    border: 0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #f2f4f8;
    transition: .15s;
}
.so-gif-item img {
    display: block;
    width: 100%;
    height: 110px;
    object-fit: cover;
}
.so-gif-item:hover {
    transform: scale(1.03);
    box-shadow: 0 3px 10px rgba(0, 0, 0, .16);
}
.so-gif-loading {
    padding: 26px 0;
    text-align: center;
    font-size: 13px;
    color: #8a94a6;
}
.so-gif-foot {
    grid-column: 1 / -1;
    padding: 6px 2px 0;
    font-size: 11px;
    color: #a3abbd;
    text-align: center;
}

/* 消息气泡里的动图 */
.so-bubble.is-gif {
    padding: 3px;
    background: transparent;
    border: 0;
    box-shadow: none;
}
.so-msg-gif {
    display: block;
    max-width: 220px;
    max-height: 220px;
    border-radius: 8px;
    cursor: pointer;
    transition: .15s;
}
.so-msg-gif:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}
.so-msg.mine .so-bubble.is-gif {
    background: transparent;
}
@media (max-width: 640px) {
    .so-gif-panel { width: 280px; }
    .so-msg-gif { max-width: 170px; max-height: 170px; }
}


/* ============================================================
 * 自定义动图：上传入口 / 我的动图（前缀 so-gif-）
 * ============================================================ */
.so-gif-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 0 8px;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
}
.so-gif-upload {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border: 1px dashed #a9c6ff;
    background: #f4f8ff;
    color: #2f6fe0;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.so-gif-upload:hover { background: #e8f1ff; border-color: #2f6fe0; }
.so-gif-upload .ico { font-size: 14px; line-height: 1; }
.so-gif-tip { font-size: 11px; color: #a3abbd; }
.so-gif-sect {
    margin: 6px 2px 6px;
    font-size: 12px;
    font-weight: 600;
    color: #5b667a;
}
.so-gif-mine {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.so-gif-empty {
    padding: 12px 2px 14px;
    font-size: 12px;
    color: #a3abbd;
    text-align: center;
}
.so-gif-pic {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #f2f4f8;
    cursor: pointer;
    transition: .15s;
}
.so-gif-pic img {
    display: block;
    width: 100%;
    height: 72px;
    object-fit: cover;
}
.so-gif-pic:hover {
    transform: scale(1.03);
    box-shadow: 0 3px 10px rgba(0, 0, 0, .16);
}
.so-gif-del {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    padding: 0;
    line-height: 16px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .45);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    opacity: 0;
    transition: .15s;
}
.so-gif-pic:hover .so-gif-del { opacity: 1; }
.so-gif-del:hover { background: #e5484d; }
@media (hover: none) {
    .so-gif-del { opacity: 1; background: rgba(0, 0, 0, .35); }
}
.so-gif-uploading {
    margin: 0 0 8px;
    font-size: 11px;
    color: #5b667a;
}
.so-gif-uploading .bar {
    height: 4px;
    margin-bottom: 4px;
    background: #e8eef8;
    border-radius: 2px;
    overflow: hidden;
}
.so-gif-uploading .bar i {
    display: block;
    height: 100%;
    width: 0;
    background: #2f6fe0;
    border-radius: 2px;
    transition: width .15s;
}
.so-gif-uploading.done .bar i { background: #12a150; }
.so-gif-panel.is-drop {
    outline: 2px dashed #2f6fe0;
    outline-offset: -4px;
    background: #f0f6ff;
}


/* 超管开关：普通用户可用 */
.so-gif-switch {
    flex-basis: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    padding-top: 7px;
    border-top: 1px dashed #e6ecf6;
    font-size: 11px;
    color: #5b667a;
    cursor: pointer;
    user-select: none;
}
.so-gif-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.so-gif-switch .track {
    position: relative;
    width: 30px;
    height: 16px;
    flex: 0 0 auto;
    border-radius: 8px;
    background: #d6dce8;
    transition: .18s;
}
.so-gif-switch .track i {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    transition: .18s;
}
.so-gif-switch input:checked + .track { background: #12a150; }
.so-gif-switch input:checked + .track i { left: 16px; }
.so-gif-switch em { font-style: normal; }


/* 聊天记录保留策略提示 */
.so-retention {
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: #86909C;
}
