/* 新闻正文公共样式：官网详情页和商户后台编辑器共同加载，确保编辑与发布效果一致。 */
.news-rich-text {
  max-width: 700px;
  margin: 0;
  color: #46565c;
  font-family: 'Microsoft YaHei', 'Microsoft YaHei UI', 'PingFang SC', sans-serif;
  font-size: 16px;
  line-height: 1.88;
}

.news-rich-text > p:first-child {
  margin-bottom: 42px;
  padding: 2px 0 2px 20px;
  border-left: 2px solid #78978e;
  color: #29413b;
  font-family: Georgia, 'Songti SC', SimSun, serif;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.8;
}

.news-rich-text > p:first-child > strong:first-child {
  margin-right: 8px;
  color: #416f63;
  font-family: 'Microsoft YaHei', 'Microsoft YaHei UI', 'PingFang SC', sans-serif;
  font-size: 12px;
  font-weight: 800;
}

.news-rich-text :is(h2, h3) {
  color: #071f2a;
  font-family: 'Microsoft YaHei', 'Microsoft YaHei UI', 'PingFang SC', sans-serif;
  letter-spacing: 0;
  scroll-margin-top: 104px;
}

.news-rich-text h2 {
  margin: 48px 0 17px;
  padding: 0 0 0 13px;
  border-left: 3px solid #20c997;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.45;
}

.news-rich-text h3 {
  margin: 38px 0 14px;
  color: #17323c;
  font-size: 17px;
  font-weight: 750;
  line-height: 1.55;
}

.news-rich-text p {
  margin: 0 0 30px;
}

.news-rich-text ul,
.news-rich-text ol {
  margin: 4px 0 36px;
  padding: 0;
  display: grid;
  gap: 10px;
  list-style: none;
}

.news-rich-text ol {
  counter-reset: article-list-item;
}

.news-rich-text li {
  min-height: 0;
  padding: 7px 0 7px 22px;
  position: relative;
  color: #34464c;
}

/* Tiptap 会在列表项内生成 p，需取消正文段落的 30px 下边距，避免列表被重复撑高。 */
.news-rich-text li > p {
  margin: 0;
}

.news-rich-text li::before {
  width: 5px;
  height: 5px;
  position: absolute;
  left: 2px;
  top: 19px;
  border-radius: 50%;
  background: #657974;
  content: '';
}

.news-rich-text ol > li {
  padding-left: 32px;
  counter-increment: article-list-item;
}

.news-rich-text ol > li::before {
  width: 22px;
  height: auto;
  left: 0;
  top: 9px;
  color: #758782;
  background: transparent;
  content: counter(article-list-item, decimal-leading-zero);
  font-family: 'Roboto Mono', 'SFMono-Regular', Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
}

.news-rich-text strong {
  color: #b64d45;
  font-weight: 700;
}

.news-rich-text blockquote {
  margin: 46px 0;
  padding: 4px 0 4px 22px;
  border-left: 2px solid #78978e;
  color: #3e514c;
  font-family: Georgia, 'Songti SC', SimSun, serif;
  font-size: 17px;
  line-height: 1.85;
}

.news-rich-text blockquote > :last-child {
  margin-bottom: 0;
}

.news-rich-text hr {
  margin: 48px 0;
  border: 0;
  border-top: 1px solid #cfdcd8;
}

.news-rich-text a {
  color: #087552;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.news-rich-text img {
  width: auto;
  max-width: min(100%, 660px);
  max-height: 480px;
  height: auto;
  margin: 60px auto;
  display: block;
  border: 1px solid #e1e9e7;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 15px 35px rgba(8, 39, 53, 0.05);
}

.news-rich-text figure {
  width: min(100%, 660px);
  max-width: 100%;
  margin: 60px 0;
}

.news-rich-text figure img,
.news-rich-text figure video {
  width: 100%;
  max-width: 100%;
  margin: 0;
  display: block;
  border-radius: 12px;
  box-shadow: 0 15px 35px rgba(8, 39, 53, 0.05);
}

.news-rich-text figure img {
  max-height: 440px;
  object-fit: cover;
}

.news-rich-text figcaption {
  min-height: 22px;
  margin-top: 14px;
  color: #667085;
  font-size: 13px;
  font-style: italic;
  line-height: 1.7;
}

.news-rich-text video,
.news-rich-text iframe {
  width: min(100%, 660px);
  max-width: 100%;
  max-height: 440px;
  margin: 60px 0;
  display: block;
  aspect-ratio: 16 / 9;
  border: 1px solid #dfe8e5;
  border-radius: 12px;
  background: #e7eeec;
  box-shadow: 0 15px 35px rgba(8, 39, 53, 0.05);
  object-fit: cover;
}

.news-rich-text table {
  width: 100%;
  max-width: 100%;
  margin: 38px 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.news-rich-text th,
.news-rich-text td {
  min-width: 90px;
  padding: 11px 13px;
  position: relative;
  border: 1px solid #d9e3e0;
  color: #3f5156;
  line-height: 1.6;
  vertical-align: top;
}

.news-rich-text th {
  color: #29413b;
  background: #eef6f3;
  font-weight: 700;
}

.news-rich-text [data-news-attachment] {
  width: min(100%, 520px);
  min-height: 58px;
  margin: 30px 0;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #d8e5e1;
  border-radius: 6px;
  color: #29413b;
  background: #f7faf9;
  text-decoration: none;
}

.news-rich-text .news-attachment-mark {
  padding: 4px 6px;
  border-radius: 4px;
  color: #fff;
  background: #397b69;
  font-family: 'Roboto Mono', 'SFMono-Regular', Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
}

.news-rich-text .news-attachment-name {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-rich-text a:hover {
  color: #075d46;
  text-decoration-thickness: 2px;
}

@media (max-width: 560px) {
  .news-rich-text {
    max-width: 100%;
    font-size: 16px;
    line-height: 1.85;
  }

  .news-rich-text > p:first-child {
    margin-bottom: 30px;
    padding-left: 16px;
    font-size: 17px;
  }

  .news-rich-text h2 {
    margin-top: 36px;
    font-size: 20px;
  }

  .news-rich-text h3 {
    margin-top: 28px;
    font-size: 17px;
  }

  .news-rich-text p {
    margin-bottom: 26px;
  }

  .news-rich-text :is(img, video),
  .news-rich-text figure {
    margin-top: 42px;
    margin-bottom: 42px;
  }
}
