/* 与 H5 的 750 设计稿 / 20px 基准根字号一致。 */
html { font-size: clamp(10px, 5.333333vw, 40px); }
@media (min-width: 751px) {
  html { font-size: 32px; }
}

body {
  font-size: 16px;
  margin: 0;
  background: #fff;
  color: #303030;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.article-detail-body {
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 750px;
  margin: 0 auto;
}

.article-operate-bar {
  position: fixed;
  right: 18px;
  bottom: 44px;
  z-index: 20;
  width: max-content;
  min-width: 0;
  padding: 0 17px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  column-gap: 34px;
  height: 50px;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 2px 14px rgba(0, 0, 0, .16);
  transition: opacity .2s ease, transform .2s ease;
}

.article-operate-bar-hidden {
  opacity: 0;
  transform: translateY(130%);
  pointer-events: none;
}

.share-bottom-container {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 12px 12px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, .5);
}

.share-bottom-bg {
  width: 100%;
  padding: 18px 14px 20px;
  box-sizing: border-box;
  border-radius: 20px;
  background: #f6f6f6;
}

.share-bottom-close {
  align-self: flex-end;
  width: 32px;
  height: 32px;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 30px;
  line-height: 28px;
}

.share-bottom-title {
  margin-bottom: 12px;
  color: #333;
  font-size: 16px;
  font-weight: 700;
}

.share-bottom-content {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}

.share-bottom-item {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.share-bottom-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  object-fit: contain;
}

.share-bottom-text {
  margin-top: 7px;
  color: #666;
  font-size: 12px;
  white-space: nowrap;
}

.article-operate-icon {
  display: block;
  width: 29px;
  height: 29px;
  object-fit: contain;
}

.article-operate-item {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}

.article-like-count {
  position: absolute;
  top: -4px;
  right: -12px;
  min-width: 14px;
  padding: 0 4px;
  box-sizing: border-box;
  color: #df542f;
  background: #fff;
  border-radius: 8px;
  font-size: 10px;
  line-height: 14px;
  text-align: center;
}

/* 标题字体：阿里妈妈方圆体 VF 子雅（wght=400 / BEVL=100 圆体，仅“人民网健康服务平台”9 字），
   由 tools/build-topbar-assets.py 生成；占位符在服务端启动时替换为哈希文件名，与 CSS 同目录 */
@font-face {
  font-family: "rmjk-topbar";
  src: url("topbar-font.18dd0884ffba.woff2") format("woff2");
  font-display: swap;
}

/* 顶条沿用原横幅 800x124 比例，内部元素按宽度等比缩放；
   min() 上限对应 750px 容器下的取值，避免桌面端继续放大 */
.topbar {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  width: 100%;
  aspect-ratio: 800 / 106;
  padding-left: 18px; /* 与 .ad-act 正文左缘同轴 */
  background: #ffffff;
  /* 底部分隔：还原图片版顶条的柔和投影（原版为烘焙进图片的灰带，此处更轻） */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* 人民网 logo 保持图片形式 */
.topbar::before {
  content: "";
  display: block;
  width: min(16.2vw, 121px);
  aspect-ratio: 314 / 120;
  background: url("topbar-logo.c4f748bdad88.png") no-repeat left center / contain;
}

/* 频道名沿用系统默认字体 */
.topbar-brand {
  margin-left: min(2.125vw, 16px);
  color: #cc282e;
  font-size: min(4.02vw, 30px);
  font-weight: 500;
  line-height: 1;
}

.topbar-title {
  margin-left: min(5.5vw, 41px);
  color: #6d6d6d;
  font-family: "rmjk-topbar", sans-serif;
  font-size: min(4vw, 30px);
  line-height: 1;
}

.ad-act {
  box-sizing: border-box;
  width: 100%;
  padding: 20px 18px 40px;
}

.tit {
  margin-bottom: 10px;
  color: #333641;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.45;
  text-align: justify;
}

.actTime {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  color: #999999;
  font-size: 13px;
  line-height: 1.5;
}

.afor {
  margin-right: 16px;
}

.atts {
  margin-left: 8px;
  white-space: nowrap;
}

.rich.article-body {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  -webkit-text-size-adjust: none;
}

.rich.article-body p {
  margin: 0 0 20px;
  color: #303030;
  overflow-wrap: anywhere;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.8;
  text-align: justify;
  -webkit-text-size-adjust: none;
}

.rich.article-body h2 {
  margin: 30px 0 14px;
  color: #303030;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.5;
}

.rich.article-body h3 {
  margin: 26px 0 12px;
  color: #303030;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.5;
}

.rich.article-body ul,
.rich.article-body ol {
  margin: 0 0 20px;
  padding-left: 1.5em;
  font-size: 18px;
  line-height: 1.8;
}

.rich.article-body img,
.rich.article-body video,
.rich.article-body table {
  max-width: 100%;
}

.rich.article-body img,
.rich.article-body video {
  display: block;
  width: 100% !important;
  height: auto;
  margin: 20px auto;
}

.rich.article-body a {
  color: inherit;
}

/* CMS 受控“编者按”块，与 H5 客户端保持一致。 */
.rich.article-body section[data-editor-note] {
  box-sizing: border-box;
  margin: 20px 0;
  padding: 18px 18px 18px 20px;
  color: #3f3a38;
  border-left: 3px solid #b51f2e;
  background: #f7f4f2;
}

.rich.article-body p[data-editor-note-label] {
  margin: 0 0 10px;
  color: #9f2431;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-weight: 600;
  text-align: left;
}

.rich.article-body [data-editor-note-content] {
  font-family: KaiTi, STKaiti, FangSong, serif;
}

.rich.article-body [data-editor-note-content] > :last-child {
  margin-bottom: 0;
}

@media (min-width: 750px) {
  .article-operate-bar {
    right: max(30px, calc((100vw - 750px) / 2 + 30px));
    bottom: 88px;
    padding: 0 34px;
    column-gap: 68px;
    height: 100px;
    border-radius: 52px;
  }

  .article-operate-icon {
    width: 58px;
    height: 58px;
  }

  .article-like-count {
    top: -8px;
    right: -24px;
    min-width: 28px;
    padding: 0 7px;
    border-radius: 16px;
    font-size: 20px;
    line-height: 28px;
  }
  /* 桌面端两侧灰底 + 内容列白底卡片（与主 H5 的 PC 适配一致，见 src/app.less）：
     顶条底部分隔线此前是页面唯一通栏边界，视觉上比内缩的正文宽一圈；
     卡片化后顶条与正文同属一个版心 */
  body {
    background: #f4f6fb;
  }

  .article-detail-body {
    min-height: 100vh;
    background: #ffffff;
    box-shadow: 0 0 16px rgba(0, 0, 0, 0.12);
  }

  .topbar {
    aspect-ratio: auto;
    height: 64px;
    padding-left: 30px;
    /* 桌面端去掉底部分隔线，顶条与正文仅靠留白分隔（移动端保留分隔线） */
    box-shadow: none;
  }

  .topbar::before {
    width: 84px;
  }

  .topbar-brand {
    margin-left: 8px;
    font-size: 19px;
  }

  .topbar-title {
    margin-left: 22px;
    font-size: 20px;
  }

  .ad-act {
    /* 标题与顶条间距由 30px 放宽到 44px，缓解标题顶着顶条的压迫感 */
    padding: 44px 30px 56px;
  }

  .tit {
    font-size: 24px;
    line-height: 36px;
  }

  .actTime {
    font-size: 14px;
  }

  .rich.article-body p {
    font-size: 18px;
    line-height: 32px;
  }

  .rich.article-body h2 {
    margin: 28px 0 12px;
    font-size: 22px;
    line-height: 32px;
  }

  .rich.article-body h3 {
    margin: 24px 0 10px;
    font-size: 20px;
    line-height: 30px;
  }
}

/* 多图详情保持图片原比例，并沿用现有页面的最大版心宽度。 */
.article-detail-body.article-gallery { background: #111; color: #fff; min-height: 100vh; }
.article-gallery .topbar { display: none; }
.article-gallery .ad-act { padding: 0; }
.article-gallery .tit { margin: 18px 16px; font-size: 20px; line-height: 30px; color: #fff; }
.article-gallery .gallery-figure { margin: 0 0 22px; }
.article-gallery .gallery-image { display: block; width: 100%; height: auto; }
.article-gallery .gallery-caption { margin: 8px 16px 0; font-size: 14px; line-height: 22px; color: #ddd; white-space: pre-wrap; overflow-wrap: break-word; }

.rich.article-body [data-article-credits] {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  margin: 1rem 0 0.6rem;
  text-align: left;
}
.rich.article-body [data-article-credits] [data-article-credit] {
  margin: 0;
  padding: 0;
  color: #aaa;
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1rem;
  text-align: left;
  text-indent: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.rich.article-body [data-article-credits] [data-article-credit] a {
  color: inherit;
  font-size: inherit;
  text-decoration: none;
}

@media (min-width: 751px) {
  .rich.article-body [data-article-credits] [data-article-credit] {
    font-size: 0.4375rem;
    line-height: 0.625rem;
  }
}

/* 关键词标签与正文隔开；尺寸随 rem 缩放，长标签可换行。 */
.rich #keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.3rem;
  margin: 0.8rem 0 0.6rem;
  text-align: left;
  text-indent: 0;
}
.rich #keywords span {
  display: inline-block;
  box-sizing: border-box;
  max-width: 100%;
  margin: 0;
  padding: 0.1rem 0.5rem;
  height: auto;
  background: #7da4f0;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 400;
  line-height: 1rem;
  border-radius: 0.6rem;
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (min-width: 751px) {
  .rich #keywords span {
    font-size: 0.375rem;
    line-height: 0.625rem;
    padding: 0.0625rem 0.3125rem;
    border-radius: 0.375rem;
  }
}
