/* ============================================================
   sse-markdown.css
   Markdown 内容样式 + 数学公式显示 + 打字机光标 + 加载动画
   ============================================================ */

/* ---- Markdown 内容 ---- */
.sse-md-content {
    font-size: 15px;
    line-height: 1.8;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.sse-md-content h1, .sse-md-content h2, .sse-md-content h3, .sse-md-content h4 {
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    font-weight: 600;
    line-height: 1.4;
}
.sse-md-content h1 { font-size: 1.8em; border-bottom: 2px solid #e5e7eb; padding-bottom: 0.3em; }
.sse-md-content h2 { font-size: 1.5em; border-bottom: 1px solid #e5e7eb; padding-bottom: 0.3em; }
.sse-md-content h3 { font-size: 1.3em; }
.sse-md-content h4 { font-size: 1.1em; }
.sse-md-content p { margin-bottom: 1em; }
.sse-md-content ul, .sse-md-content ol { margin-left: 1.5em; margin-bottom: 1em; }
.sse-md-content li { margin-bottom: 0.3em; }
.sse-md-content li > ul, .sse-md-content li > ol { margin-bottom: 0; }
.sse-md-content blockquote {
    border-left: 4px solid #8b5cf6;
    padding-left: 1em;
    margin: 1em 0;
    color: #6b7280;
    background: #f5f3ff;
    padding: 0.8em 1em;
    border-radius: 0 4px 4px 0;
}
.sse-md-content code {
    background: #f3f4f6;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
}
.sse-md-content pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 1em;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1em 0;
}
.sse-md-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: 0.85em;
}
.sse-md-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}
.sse-md-content th, .sse-md-content td {
    border: 1px solid #e5e7eb;
    padding: 0.5em 1em;
}
.sse-md-content th {
    background: #f9fafb;
    font-weight: 600;
}
.sse-md-content strong { font-weight: 600; }
.sse-md-content em { font-style: italic; }
.sse-md-content a { color: #7c3aed; text-decoration: underline; }
.sse-md-content hr {
    border: none;
    border-top: 2px solid #e5e7eb;
    margin: 2em 0;
}
.sse-md-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 1em 0;
}

/* ---- 数学公式显示 ---- */
.sse-md-content .sse-math-display {
    margin: 1em 0;
    overflow-x: auto;
    text-align: center;
    padding: 0.5em 0;
}
.sse-md-content .sse-math-fallback {
    display: inline-block;
    background: #f3f4f6;
    padding: 0.2em 0.6em;
    border-radius: 3px;
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
    color: #dc2626;
}

/* ---- 打字机光标 ---- */
.sse-typing-cursor::after {
    content: '|';
    animation: sse-cursor-blink 1s infinite;
    font-weight: 300;
    color: #6b7280;
}
@keyframes sse-cursor-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ---- 加载动画 ---- */
.sse-loading-dots span {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: sse-loading-dot 1.4s infinite ease-in-out both;
}
.sse-loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.sse-loading-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes sse-loading-dot {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}
