/**
 * 富文本内容统一样式
 * 前台展示 + 后台 Jodit 编辑器共享
 * 使用 .rich-content 包裹类名
 */

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

/* 标题 */
.rich-content h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin: 2rem 0 1rem;
    line-height: 1.3;
}

.rich-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 1.75rem 0 0.75rem;
    line-height: 1.35;
}

.rich-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 1.5rem 0 0.5rem;
    line-height: 1.4;
}

.rich-content h4,
.rich-content h5,
.rich-content h6 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin: 1.25rem 0 0.5rem;
    line-height: 1.4;
}

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

/* 段落 */
.rich-content p {
    margin: 0 0 1rem;
    color: #4b5563;
}

/* 链接 */
.rich-content a {
    color: #0284c7;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s;
}

.rich-content a:hover {
    color: #0369a1;
}

/* 粗体 / 斜体 */
.rich-content strong {
    font-weight: 700;
    color: #111827;
}

/* 列表 */
.rich-content ul,
.rich-content ol {
    margin: 1rem 0;
    padding-left: 1.75rem;
}

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

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

.rich-content li {
    margin-bottom: 0.375rem;
}

.rich-content li > ul,
.rich-content li > ol {
    margin: 0.375rem 0;
}

/* 引用 */
.rich-content blockquote {
    border-left: 4px solid #e5e7eb;
    padding: 0.75rem 1.25rem;
    margin: 1.5rem 0;
    color: #6b7280;
    background: #f9fafb;
    border-radius: 0 0.5rem 0.5rem 0;
}

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

/* 代码 */
.rich-content code {
    background: #f3f4f6;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
    color: #dc2626;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.rich-content pre {
    background: #1f2937;
    color: #e5e7eb;
    padding: 1.25rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.875rem;
    line-height: 1.6;
}

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

/* 图片 */
.rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

/* 表格 */
.rich-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9375rem;
}

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

.rich-content th {
    background: #f8fafc;
    font-weight: 600;
    color: #1e293b;
}

.rich-content tbody tr:hover {
    background: #f9fafb;
}

/* 分割线 */
.rich-content hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 2rem 0;
}

/* 视频 / iframe */
.rich-content video,
.rich-content iframe {
    max-width: 100%;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

/* figure / figcaption */
.rich-content figure {
    margin: 1.5rem 0;
}

.rich-content figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
}
