/* 传讯私聊 = 可拖动的悬浮子窗（与主聊天并存）：标题栏拖动 | 左会话列表 | 右立绘名片+聊天区 */
.dm-btn { position: relative; }
.dm-dot { display: inline-block; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: #d05050; color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; margin-left: 4px; vertical-align: 1px; }

.dm-win {
    position: fixed; z-index: 90;
    width: min(740px, 92vw); height: min(540px, 80vh);
    min-width: 520px; min-height: 380px;
    display: flex; flex-direction: column; overflow: hidden;
    background: #14110d; border: 1px solid rgba(212,160,74,.3); border-radius: 12px;
    box-shadow: 0 14px 44px rgba(0,0,0,.6);
    resize: both;
}
.dm-win-bar {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px;
    cursor: move; user-select: none;
    background: linear-gradient(180deg, rgba(52,43,32,.95), rgba(34,28,20,.98));
    border-bottom: 1px solid rgba(212,160,74,.25);
}
.dm-title { font-size: 13.5px; font-weight: 800; color: var(--accent, #d4a04a); letter-spacing: 3px; }
.dm-win-sub { flex: 1; font-size: 11px; color: var(--accent, #d4a04a); text-align: right; min-height: 13px; }
.dm-close { background: none; border: none; color: var(--sub, #9a8f7a); font-size: 18px; cursor: pointer; padding: 0 2px; line-height: 1; }
.dm-close:hover { color: var(--text, #f0e6d2); }

.dm-panels { flex: 1; display: flex; min-height: 0; }

/* 左栏：会话列表 */
.dm-left { width: 218px; flex: none; display: flex; flex-direction: column; border-right: 1px solid rgba(255,255,255,.08); background: rgba(0,0,0,.18); }
.dm-threads { flex: 1; overflow-y: auto; padding: 4px 0; }
.dm-thread { display: flex; align-items: center; gap: 9px; padding: 9px 10px; cursor: pointer; border-left: 3px solid transparent; }
.dm-thread:hover { background: rgba(255,255,255,.04); }
.dm-thread.active { background: rgba(212,160,74,.14); border-left-color: var(--accent, #d4a04a); }
.dm-avatar { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; object-position: top; flex: none; background: #2a2620; }
.dm-avatar-s { width: 32px; height: 32px; border-radius: 8px; }
.dm-thread-main { flex: 1; min-width: 0; }
.dm-row1 { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 2px; }
.dm-row2 { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.dm-npc { font-size: 12.5px; font-weight: 700; color: var(--text, #f0e6d2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-npc-s { font-size: 10.5px; color: var(--accent, #d4a04a); margin: 0 0 3px 4px; }
.dm-when { font-size: 9.5px; color: var(--sub, #9a8f7a); flex: none; }
.dm-last { font-size: 11px; color: var(--sub, #9a8f7a); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.dm-unread { min-width: 15px; height: 15px; padding: 0 4px; border-radius: 999px; background: #d05050; color: #fff; font-size: 9.5px; font-weight: 700; line-height: 15px; text-align: center; flex: none; }
.dm-empty { padding: 30px 16px; text-align: center; color: var(--sub, #9a8f7a); font-size: 12.5px; line-height: 1.8; }
.dm-hint { font-size: 11px; opacity: .7; }

/* 右栏：立绘名片 + 聊天区 */
.dm-right { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dm-right-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--sub, #9a8f7a); font-size: 12.5px; letter-spacing: 1px; }
.dm-chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.dm-chat-top { display: flex; align-items: center; gap: 10px; padding: 8px 12px 2px; }
.dm-chat-name { font-size: 13.5px; font-weight: 800; color: var(--text, #f0e6d2); }

/* 角色立绘名片 */
.dm-profile { display: flex; align-items: center; gap: 11px; margin: 3px 12px 6px; padding: 8px 12px; border-radius: 10px; background: linear-gradient(160deg, rgba(52,43,32,.95), rgba(38,32,24,.98)); border: 1px solid rgba(212,160,74,.3); }
.dm-profile-art { width: 40px; height: 54px; border-radius: 7px; object-fit: cover; object-position: top; flex: none; background: #2a2620; }
.dm-profile-info { flex: 1; min-width: 0; }
.dm-profile-name { font-size: 14.5px; font-weight: 800; color: var(--accent, #d4a04a); margin-bottom: 3px; }
.dm-profile-sub { font-size: 10.5px; color: var(--sub, #9a8f7a); line-height: 1.4; }

/* 气泡流 */
.dm-msgs { flex: 1; overflow-y: auto; padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.dm-msg { display: flex; align-items: flex-start; gap: 7px; max-width: 86%; }
.dm-msg.me { align-self: flex-end; }
.dm-msg.them { align-self: flex-start; }
.dm-msg .dm-thread-main { min-width: 0; }
.dm-bubble { padding: 8px 12px; border-radius: 11px; font-size: 13px; line-height: 1.55; word-break: break-word; }
.dm-msg.me .dm-bubble { background: linear-gradient(180deg, #efc27a, var(--accent, #d4a04a)); color: #241a08; border-bottom-right-radius: 4px; }
.dm-msg.them .dm-bubble { background: var(--card, #1e1a16); color: var(--text, #f0e6d2); border: 1px solid var(--line, rgba(255,255,255,.08)); border-bottom-left-radius: 4px; }
.dm-bubble.dm-typing { opacity: .5; font-style: italic; }
.dm-bubble.dm-err { color: #d05050; font-size: 12px; }
.dm-time { font-size: 9.5px; color: var(--sub, #9a8f7a); margin-top: 3px; flex: none; align-self: flex-end; }
/* 联系不上：居中灰行（不进气泡） */
.dm-sysline { align-self: center; text-align: center; color: var(--sub, #9a8f7a); font-size: 11.5px; padding: 4px 12px; max-width: 80%; }

.dm-input { display: flex; align-items: flex-end; gap: 7px; padding: 8px 12px 10px; border-top: 1px solid rgba(255,255,255,.08); }
.dm-input textarea { flex: 1; min-height: 34px; max-height: 90px; padding: 8px 11px; border-radius: 9px; border: 1px solid rgba(255,255,255,.08); background: var(--card, #1e1a16); color: var(--text, #f0e6d2); font-size: 12.5px; font-family: inherit; resize: none; box-sizing: border-box; }
.dm-input textarea:focus { outline: none; border-color: rgba(212,160,74,.5); }
.dm-input .send-btn { width: 34px; height: 34px; border-radius: 9px; border: none; background: linear-gradient(180deg, #efc27a, var(--accent, #d4a04a)); color: #241a08; font-size: 15px; font-weight: 700; cursor: pointer; flex: none; }
