/* 前台富文本排版（参照实验室官网：首行缩进） */
.rich-content {
    color: #475569;
    line-height: 1.85;
    font-size: 1.06rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.rich-content > *:first-child { margin-top: 0; }
.rich-content > *:last-child { margin-bottom: 0; }

.rich-content p {
    margin: 0 0 0.85em;
    text-indent: 2em; /* 约两字；勿与正文全角空格叠用 */
}
.rich-content p.no-first-indent,
.rich-content p[style*="text-indent: 0"],
.rich-content p[style*="text-indent:0"],
.rich-content p:has(img) {
    text-indent: 0;
}
.rich-content p:has(img) {
    margin: 0.55em 0;
}
.rich-content blockquote p,
.rich-content li p {
    text-indent: 0;
}

.rich-content h1,
.rich-content h2,
.rich-content h3,
.rich-content h4,
.rich-content h5,
.rich-content h6 {
    color: #0b1220;
    font-family: var(--font-sans, "Source Sans 3", "PingFang SC", sans-serif);
    font-weight: 700;
    line-height: 1.4;
    margin: 1.6em 0 0.75em;
    text-indent: 0;
}
.rich-content h1 { font-size: 1.65rem; }
.rich-content h2 { font-size: 1.45rem; }
.rich-content h3 { font-size: 1.25rem; }
.rich-content h4 { font-size: 1.12rem; }

.rich-content a {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.rich-content a:hover { color: #0284c7; }

.rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 0.45em auto;
    display: block;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}
.rich-content p:has(img) img {
    margin: 0 auto;
}

.rich-content ul,
.rich-content ol {
    margin: 0 0 1em;
    padding-left: 1.5em;
}
.rich-content li { margin: 0.35em 0; }

.rich-content blockquote {
    margin: 1.25em 0;
    padding: 14px 18px;
    border-left: 4px solid #0284c7;
    background: rgba(124, 58, 237, 0.06);
    border-radius: 0 12px 12px 0;
    color: #334155;
}

.rich-content pre,
.rich-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9em;
}
.rich-content pre {
    background: #0b1220;
    color: #e2e8f0;
    padding: 16px 18px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 1.25em 0;
}
.rich-content code {
    background: #f1eef8;
    color: #0c4a6e;
    padding: 2px 6px;
    border-radius: 6px;
}
.rich-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.rich-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25em 0;
    font-size: 0.95rem;
    display: block;
    overflow-x: auto;
}
.rich-content th,
.rich-content td {
    border: 1px solid rgba(49, 46, 129, 0.12);
    padding: 10px 14px;
    text-align: left;
}
.rich-content th {
    background: #f7f5fb;
    color: #0b1220;
    font-weight: 700;
}

.rich-content hr {
    border: none;
    border-top: 1px solid #94a3b8;
    margin: 1.75em 0;
}

@media (max-width: 768px) {
    .rich-content { font-size: 0.98rem; }
    .rich-content p { margin: 0 0 0.75em; }
    .rich-content p:has(img) { margin: 0.4em 0; }
    .rich-content h1 { font-size: 1.45rem; }
    .rich-content h2 { font-size: 1.3rem; }
    .rich-content h3 { font-size: 1.15rem; }
}
