/* ==========================================================================
   HT-社区主题 社交深化样式（私信、@提及、话题标签）
   ========================================================================== */

/* ---------- 私信容器 ---------- */
.ht-messages-container {
    display: flex;
    gap: 0;
    background: var(--ht-bg-card);
    border-radius: var(--ht-radius);
    box-shadow: var(--ht-shadow);
    overflow: hidden;
    height: 600px;
}

/* ---------- 会话列表 ---------- */
.ht-conv-list {
    width: 260px;
    flex-shrink: 0;
    border-right: 1px solid var(--ht-border);
    overflow-y: auto;
}
.ht-conv-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--ht-border);
    transition: background .15s;
    position: relative;
}
.ht-conv-item:hover { background: var(--ht-bg-hover, #f5f7fa); }
.ht-conv-item.active { background: #eef2ff; }
.ht-conv-item img { border-radius: 50%; flex-shrink: 0; }
.ht-conv-info { flex: 1; min-width: 0; }
.ht-conv-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.ht-conv-last {
    font-size: 12px;
    color: var(--ht-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ht-conv-unread {
    position: absolute;
    top: 10px;
    right: 10px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #e04040;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
}

/* ---------- 消息线程 ---------- */
.ht-conv-thread {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.ht-conv-thread-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--ht-border);
    font-size: 15px;
    font-weight: 600;
}
.ht-conv-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.ht-conv-thread-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ht-text-muted);
    font-size: 14px;
}

/* ---------- 消息气泡 ---------- */
.ht-message {
    display: flex;
    gap: 8px;
    max-width: 75%;
}
.ht-message.mine {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.ht-message-avatar { flex-shrink: 0; }
.ht-message-avatar img { border-radius: 50%; }
.ht-message-body {
    background: #f0f2f8;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
}
.ht-message.mine .ht-message-body {
    background: var(--ht-primary);
    color: #fff;
}
.ht-message-time {
    font-size: 11px;
    color: var(--ht-text-muted);
    margin-top: 4px;
}
.ht-message.mine .ht-message-time { text-align: right; }

/* ---------- 消息输入区 ---------- */
.ht-conv-input {
    display: flex;
    gap: 10px;
    padding: 12px 18px;
    border-top: 1px solid var(--ht-border);
    align-items: flex-end;
}
.ht-conv-input textarea {
    flex: 1;
    border: 1px solid var(--ht-border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    resize: none;
    font-family: inherit;
    max-height: 120px;
}
.ht-conv-input textarea:focus {
    outline: none;
    border-color: var(--ht-primary);
}
.ht-conv-input button {
    flex-shrink: 0;
    padding: 8px 20px;
}

/* ---------- @提及 / #话题 ---------- */
.ht-mention {
    color: var(--ht-primary);
    font-weight: 500;
    text-decoration: none;
}
.ht-mention:hover { text-decoration: underline; }
.ht-hashtag {
    color: #7c3aed;
    font-weight: 500;
    text-decoration: none;
}
.ht-hashtag:hover { text-decoration: underline; }

/* ---------- 发私信按钮 ---------- */
.ht-send-message-btn {
    text-decoration: none;
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .ht-messages-container {
        flex-direction: column;
        height: auto;
    }
    .ht-conv-list {
        width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--ht-border);
    }
    .ht-conv-thread { min-height: 400px; }
    .ht-message { max-width: 85%; }
}
