.rich-content {
  color: #222f3e;
  font-size: 16px;
  font-family: initial;
  line-height: 1.75;
  word-break: normal;
  overflow-wrap: break-word;
  text-size-adjust: 100%;
}

.rich-content,
.rich-content * {
  box-sizing: border-box;
}

.rich-content--empty {
  color: #9ca3af;
  font-size: 15px;
  text-align: center;
  padding: 24px 0;
}

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

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

.rich-content h1,
.rich-content h2,
.rich-content h3,
.rich-content h4,
.rich-content h5,
.rich-content h6 {
  color: #111827;
  font-weight: 700;
  line-height: 1.3;
  margin: 1.2em 0 0.6em;
}

.rich-content h1 {
  font-size: 2em;
}

.rich-content h2 {
  font-size: 1.5em;
}

.rich-content h3 {
  font-size: 1.17em;
}

.rich-content h4 {
  font-size: 1em;
}

.rich-content p {
  margin: 0 0 1em;
}

.rich-content strong,
.rich-content b {
  font-weight: 700;
}

.rich-content em,
.rich-content i {
  font-style: italic;
}

.rich-content a {
  color: #0b57d0;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.rich-content a:hover {
  color: #0842a0;
}

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

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

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

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

.rich-content ul ul,
.rich-content ul ol,
.rich-content ol ul,
.rich-content ol ol {
  margin-top: 0.45em;
  margin-bottom: 0.45em;
}

.rich-content blockquote {
  margin: 1.5em 0;
  padding: 0.25em 0 0.25em 1em;
  color: #5f6b7a;
  background: transparent;
  border-left: 4px solid #d0d7de;
  border-radius: 0;
}

.rich-content hr {
  border: 0;
  border-top: 1px solid #d0d7de;
  margin: 1.5em 0;
}

.rich-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.5em auto;
  border: 0;
  border-radius: 0;
}

.rich-content figure {
  margin: 1.5em 0;
}

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

.rich-content code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9em;
  background: rgba(175, 184, 193, 0.2);
  color: #24292f;
  border-radius: 3px;
  padding: 0.15em 0.3em;
}

.rich-content pre {
  margin: 1.5em 0;
  padding: 1em;
  overflow-x: auto;
  color: #e5eef9;
  background: #0f172a;
  border-radius: 6px;
}

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

.rich-content .hljs {
  color: #e2e8f0;
  background: transparent;
}

.rich-content .hljs-comment,
.rich-content .hljs-quote {
  color: #94a3b8;
}

.rich-content .hljs-keyword,
.rich-content .hljs-selector-tag,
.rich-content .hljs-literal,
.rich-content .hljs-section,
.rich-content .hljs-link {
  color: #93c5fd;
}

.rich-content .hljs-string,
.rich-content .hljs-title,
.rich-content .hljs-name,
.rich-content .hljs-attribute,
.rich-content .hljs-symbol,
.rich-content .hljs-bullet,
.rich-content .hljs-addition {
  color: #86efac;
}

.rich-content .hljs-number,
.rich-content .hljs-meta,
.rich-content .hljs-meta .hljs-keyword,
.rich-content .hljs-type,
.rich-content .hljs-params {
  color: #f9a8d4;
}

.rich-content .hljs-variable,
.rich-content .hljs-template-variable,
.rich-content .hljs-deletion {
  color: #fca5a5;
}

.rich-content table {
  width: 100%;
  margin: 1.5em 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 15px;
}

.rich-content th,
.rich-content td {
  border: 1px solid #d0d7de;
  padding: 0.6em 0.75em;
  text-align: left;
  vertical-align: top;
}

.rich-content th {
  font-weight: 600;
  color: #24292f;
  background: #f6f8fa;
}

.rich-content iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 1.5em 0;
  border: 0;
  border-radius: 0;
}

@media (max-width: 768px) {
  .rich-content {
    font-size: 15px;
    line-height: 1.7;
  }

  .rich-content pre {
    padding: 0.875rem;
  }
}

/* 延伸阅读模块美化 - 采用列表式排版 */
.rich-content .related {
  margin: 3.5rem 0 1rem;
  color: #1e293b;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
}

/* 标题前的装饰小方块 */
.rich-content .related::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #0b57d0;
  margin-right: 0.6rem;
  transform: rotate(45deg);
  margin-left: 5px;
}

/* 紧随 .related 后的 UL 列表 */
.rich-content .related + ul {
  margin: 0 0 3rem;
  padding: 0;
  list-style: none;
  border-top: 2px solid #f1f5f9;
}

.rich-content .related + ul li {
  margin: 0;
  padding: 0.75rem 0;
  border-bottom: 1px dashed #e2e8f0;
}

.rich-content .related + ul li:last-child {
  border-bottom: none;
}

.rich-content .related + ul li a {
  color: #475569;
  text-decoration: none;
  font-size: 14px;
  display: block;
  transition:
    color 0.3s ease,
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1.5;
  backface-visibility: hidden;
}

.rich-content .related + ul li a:hover {
  color: #0b57d0;
}

/* 适配移动端 */
@media (max-width: 768px) {
  .rich-content .related {
    margin-top: 2.5rem;
  }
}

/* 强制富文本的 图片最大限制 宽度100% */
.rich-content img {
  max-width: 100% !important;
}
