.rich-content {
    color: #374151;
    line-height: 1.8;
    word-break: break-word;
}

.dark .rich-content {
    color: #d1d5db;
}

.rich-content h1,
.rich-content h2,
.rich-content h3,
.rich-content h4 {
    color: #111827;
    font-weight: 700;
    line-height: 1.35;
}

.dark .rich-content h1,
.dark .rich-content h2,
.dark .rich-content h3,
.dark .rich-content h4 {
    color: #f9fafb;
}

.rich-content h1 {
    margin: 1.75em 0 0.75em;
    font-size: 2rem;
}

.rich-content h2 {
    margin: 1.6em 0 0.75em;
    font-size: 1.6rem;
}

.rich-content h3 {
    margin: 1.4em 0 0.65em;
    font-size: 1.3rem;
}

.rich-content h4 {
    margin: 1.2em 0 0.55em;
    font-size: 1.125rem;
}

.rich-content p,
.rich-content ul,
.rich-content ol,
.rich-content blockquote,
.rich-content pre,
.rich-content table,
.rich-content img {
    margin: 1.25em 0;
}

.rich-content ul,
.rich-content ol {
    padding-left: 1.6em;
}

.rich-content ul {
    list-style: disc;
}

.rich-content ol {
    list-style: decimal;
}

.rich-content li {
    margin: 0.45em 0;
}

.rich-content ul ul,
.rich-content ul ol,
.rich-content ol ul,
.rich-content ol ol {
    margin: 0.75em 0;
}

.rich-content a {
    color: #2563eb;
    text-decoration: underline;
}

.dark .rich-content a {
    color: #60a5fa;
}

.rich-content blockquote {
    padding-left: 1em;
    border-left: 4px solid #d1d5db;
    color: #4b5563;
    font-style: italic;
}

.dark .rich-content blockquote {
    border-left-color: #4b5563;
    color: #9ca3af;
}

.rich-content img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

.rich-content pre {
    padding: 1rem 1.25rem;
    overflow-x: auto;
    border-radius: 0.5rem;
    background: #111827;
    color: #f9fafb;
}

.rich-content code {
    padding: 0.15em 0.35em;
    border-radius: 0.25rem;
    background: #f3f4f6;
    color: #111827;
    font-size: 0.875em;
}

.dark .rich-content code {
    background: #1f2937;
    color: #f9fafb;
}

.rich-content pre code {
    padding: 0;
    background: transparent;
    color: inherit;
}

.rich-content table {
    width: 100%;
    border-collapse: collapse;
}

.rich-content th,
.rich-content td {
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.dark .rich-content th,
.dark .rich-content td {
    border-color: #374151;
}

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

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