/* 小邻 · DeepSeek 风格对话渲染（思考态 / 正文 / 链接 / 复制） */
.msg-ai-rich {
    position: relative;
    max-width: 92%;
    padding: 12px 14px 10px !important;
}
.msg-ai-rich .msg-body {
    font-size: 15px;
    line-height: 1.62;
    white-space: pre-wrap;
    word-break: break-word;
}
.msg-ai-rich .msg-reasoning {
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.15);
}
.msg-reasoning-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: #2563eb;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}
.msg-reasoning-body {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.55;
    color: #546e7a;
    white-space: pre-wrap;
    max-height: 160px;
    overflow-y: auto;
}
.msg-reasoning.collapsed .msg-reasoning-body { display: none; }
.msg-link-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 8px 0 0;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(232, 131, 90, 0.2);
}
.msg-link-row a {
    flex: 1;
    font-size: 13px;
    line-height: 1.45;
    color: #2563eb;
    word-break: break-all;
    text-decoration: underline;
    cursor: pointer;
}
.msg-inline-link {
    color: #2563eb;
    text-decoration: underline;
    word-break: break-all;
    cursor: pointer;
}
.msg-copy-inline {
    margin-left: 4px;
    vertical-align: middle;
    font-size: 11px;
    padding: 2px 8px;
}
.msg-link-row a:active { opacity: 0.75; }
.msg-copy-btn {
    flex-shrink: 0;
    border: none;
    background: rgba(232, 131, 90, 0.12);
    color: var(--primary, #e8835a);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
}
.msg-copy-btn.copied { background: #dcfce7; color: #15803d; }
.msg-actions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed rgba(232, 131, 90, 0.25);
}
.msg-ref-block { margin-top: 10px; }
.msg-ref-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text, #333);
}
.msg-streaming .msg-body::after {
    content: '▍';
    display: inline-block;
    margin-left: 2px;
    color: var(--primary, #e8835a);
    animation: xlCursorBlink 0.8s step-end infinite;
}

/* 思考 / 搜索指示（转圈 + 阶段文案） */
.msg-thinking {
    background: linear-gradient(135deg, #FEF0E6 0%, #FFF8F0 100%) !important;
    border: 1px solid rgba(232, 131, 90, 0.35) !important;
    box-shadow: 0 2px 10px rgba(232, 131, 90, 0.1);
    color: var(--text-muted, #888) !important;
    padding: 12px 14px !important;
    max-width: 92%;
}
.thinking-inner { display: flex; align-items: flex-start; gap: 10px; }
.thinking-spinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(232, 131, 90, 0.22);
    border-top-color: var(--primary, #e8835a);
    border-radius: 50%;
    animation: xlThinkRing 0.85s linear infinite;
    flex-shrink: 0;
    margin-top: 1px;
}
.thinking-main { flex: 1; min-width: 0; }
.thinking-text { font-size: 14px; color: var(--text, #444); font-weight: 600; }
.thinking-sub { font-size: 12px; color: var(--text-muted, #888); margin-top: 3px; line-height: 1.4; }
.thinking-dots { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }
.thinking-dots i {
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--primary, #e8835a); opacity: 0.35;
    animation: xlThinkDot 1.2s ease-in-out infinite;
}
.thinking-dots i:nth-child(2) { animation-delay: 0.15s; }
.thinking-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes xlThinkRing { to { transform: rotate(360deg); } }
@keyframes xlThinkDot {
    0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}
@keyframes xlCursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
.msg-interrupted { opacity: 0.72; }
.msg-interrupted-tag {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #888;
}
