/* ============================================
   DeepSeek 官网风格 Markdown 排版样式
   对标 DeepSeek Chat 文字排版效果
   适用版本：DeepSeek V4 Pro / V4 Flash
   ============================================ */

/* ---------- 基础排版 ---------- */
.deepseek-msg {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
        'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica,
        Arial, sans-serif;
    font-size: 16px;
    line-height: 1.75;
    color: #1a1a2e;
    letter-spacing: 0.01em;
    word-break: break-word;
    font-weight: 400;
}

/* ---------- 段落 ---------- */
.deepseek-msg p {
    margin: 0.75em 0;
    padding: 0;
}

.deepseek-msg p:first-child {
    margin-top: 0;
}

.deepseek-msg p:last-child {
    margin-bottom: 0;
}

/* ---------- 标题层级 ---------- */
.deepseek-msg h3,
.deepseek-msg h4 {
    margin: 1.5em 0 0.6em 0;
    font-weight: 600;
    line-height: 1.5;
    color: #0f0f1a;
    letter-spacing: 0.015em;
}

.deepseek-msg h3 {
    font-size: 18px;
}

.deepseek-msg h4 {
    font-size: 17px;
}

.deepseek-msg h3:first-child,
.deepseek-msg h4:first-child {
    margin-top: 0;
}

/* ---------- 加粗 / 强调 ---------- */
.deepseek-msg strong,
.deepseek-msg b {
    font-weight: 600;
    color: #0f0f1a;
}

.deepseek-msg em,
.deepseek-msg i {
    font-style: italic;
}

/* ---------- 行内代码 ---------- */
.deepseek-msg code {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Droid Sans Mono',
        'Source Code Pro', Consolas, 'Courier New', monospace;
    font-size: 0.875em;
    padding: 2px 6px;
    background-color: #f3f4f6;
    border-radius: 4px;
    color: #d63384;
    word-break: break-all;
}

/* ---------- 代码块 ---------- */
.deepseek-msg pre {
    margin: 1em 0;
    padding: 16px 20px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow-x: auto;
    line-height: 1.6;
    font-size: 0.875em;
}

.deepseek-msg pre code {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Droid Sans Mono',
        'Source Code Pro', Consolas, 'Courier New', monospace;
    font-size: 0.925em;
    padding: 0;
    background: none;
    border-radius: 0;
    color: #1a1a2e;
    word-break: normal;
}

/* ---------- 引用块 ---------- */
.deepseek-msg blockquote {
    margin: 1em 0;
    padding: 8px 16px;
    border-left: 3px solid #d0d5dd;
    background-color: #f9fafb;
    border-radius: 0 4px 4px 0;
    color: #4a4a5a;
}

.deepseek-msg blockquote p {
    margin: 0.4em 0;
}

.deepseek-msg blockquote p:first-child {
    margin-top: 0;
}

.deepseek-msg blockquote p:last-child {
    margin-bottom: 0;
}

/* ---------- 无序列表 ---------- */
.deepseek-msg ul {
    margin: 0.6em 0;
    padding-left: 1.5em;
    list-style-type: disc;
}

.deepseek-msg ul li {
    margin: 0.3em 0;
    line-height: 1.7;
}

.deepseek-msg ul ul {
    list-style-type: circle;
    margin: 0.2em 0;
}

.deepseek-msg ul ul ul {
    list-style-type: square;
}

/* ---------- 有序列表 ---------- */
.deepseek-msg ol {
    margin: 0.6em 0;
    padding-left: 1.5em;
    list-style-type: decimal;
}

.deepseek-msg ol li {
    margin: 0.3em 0;
    line-height: 1.7;
}

/* ---------- 分割线 ---------- */
.deepseek-msg hr {
    margin: 1.5em 0;
    border: none;
    border-top: 1px solid #e5e7eb;
}

/* ---------- 链接 ---------- */
.deepseek-msg a {
    color: #2563eb;
    text-decoration: none;
}

.deepseek-msg a:hover {
    text-decoration: underline;
}

/* ---------- 表格 ---------- */
.deepseek-msg table {
    width: 100%;
    margin: 1em 0;
    border-collapse: collapse;
    font-size: 0.95em;
    line-height: 1.6;
}

.deepseek-msg th,
.deepseek-msg td {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    text-align: left;
}

.deepseek-msg th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #0f0f1a;
}

.deepseek-msg td {
    background-color: #ffffff;
}

.deepseek-msg tr:nth-child(even) td {
    background-color: #fafbfc;
}

/* ---------- 响应式适配 ---------- */
@media (max-width: 767px) {
    .deepseek-msg {
        font-size: 15px;
        line-height: 1.7;
    }

    .deepseek-msg h3 {
        font-size: 17px;
    }

    .deepseek-msg h4 {
        font-size: 16px;
    }

    .deepseek-msg pre {
        padding: 12px 14px;
        font-size: 0.85em;
    }

    .deepseek-msg blockquote {
        padding: 6px 12px;
    }

    .deepseek-msg table {
        font-size: 0.88em;
    }

    .deepseek-msg th,
    .deepseek-msg td {
        padding: 6px 8px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .deepseek-msg {
        font-size: 15.5px;
    }
}