/* 与 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: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.rmjk-reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #c8161d 0%, #e03c42 100%);
  pointer-events: none;
  transition: width .08s linear;
}

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

.article-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  width: 100%;
  margin: 22px 0 0;
  padding-top: 14px;
  border-top: 1px solid #f0f1f4;
}

.article-footer-credits {
  flex: 1 1 auto;
  min-width: 0;
}

.article-operate-slot {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  width: auto;
  height: 36px;
  margin: 0 0 0 auto;
}

.article-operate-bar {
  position: fixed;
  left: auto;
  right: 16px;
  bottom: max(18px, calc(12px + env(safe-area-inset-bottom, 0px)));
  transform: translateY(0);
  z-index: 20;
  width: max-content;
  min-width: 0;
  padding: 0 18px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  column-gap: 20px;
  height: 44px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, .92);
  background: rgba(255, 255, 255, .95);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 0 0 .5px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .085), 0 2px 6px rgba(15, 23, 42, .035), inset 0 1px 0 rgba(255, 255, 255, .95);
  transition: opacity .22s ease, transform .22s ease;
}

.article-operate-bar.article-operate-bar-docked {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  transform: none;
  margin: 0;
  height: 36px;
  padding: 0 2px 0 0;
  column-gap: 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
}

.article-operate-bar.article-operate-bar-docked .article-operate-item,
.article-operate-bar.article-operate-bar-docked .article-font-toggle {
  color: #3f424a;
}

.article-operate-bar.article-operate-bar-docked .article-operate-item-active,
[data-rmjk-font="large"] .article-operate-bar.article-operate-bar-docked .article-font-toggle {
  color: #c8161d;
}

.article-operate-bar.article-operate-bar-docked .article-like-count {
  background: #ffffff;
}

.article-operate-bar.article-operate-bar-docked .article-font-toggle {
  padding-left: 18px;
}

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

.article-operate-bar.article-operate-bar-docked.article-operate-bar-hidden {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.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: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: fill .18s ease, transform .15s ease;
}

.article-operate-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-width: 22px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1f2329;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .18s ease, transform .15s ease;
}

.article-operate-item:active {
  transform: scale(.9);
}

.article-operate-item[data-active="1"] {
  color: #c8161d;
}

.article-operate-item[data-active="1"] .article-operate-icon {
  fill: currentColor;
}

.article-like-count {
  position: absolute;
  top: 2px;
  left: 15px;
  padding: 0 2px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .92);
  color: #c8161d;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.article-like-count:empty {
  display: none;
}

.article-font-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  margin: 0;
  padding: 0 2px 0 20px;
  box-sizing: border-box;
  border: 0;
  background: transparent;
  color: #1f2329;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.03em;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: color .18s ease, transform .15s ease;
}

.article-font-toggle:active {
  transform: scale(.92);
}

.article-font-toggle::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 14px;
  background: rgba(15, 23, 42, .11);
}

[data-rmjk-font="large"] .article-font-toggle {
  color: #c8161d;
  font-weight: 600;
}

[data-rmjk-font="large"] .article-font-toggle::after {
  content: "+";
  position: absolute;
  top: 5px;
  right: -5px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: #c8161d;
}

/* 轻报头：随页面滚走、无吸顶与底线，左为主标“[logo] 健康”，右为浅灰微署名 */
.topbar {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px 20px 0;
}

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

.topbar-brand {
  margin-left: 6px;
  color: #c8161d;
  font-size: min(3.7vw, 15px);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.topbar-title {
  margin-left: auto;
  padding-left: 12px;
  color: #8e95a2;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: .04em;
  white-space: nowrap;
}

.ad-act {
  box-sizing: border-box;
  width: 100%;
  padding: 26px 20px 52px;
  padding-bottom: max(52px, calc(36px + env(safe-area-inset-bottom, 0px)));
}

.tit {
  margin: 0 0 14px;
  color: #262629;
  font-family: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", "PingFang SC", Georgia, serif;
  font-size: clamp(23px, 6.13vw, 25.5px);
  font-weight: 600;
  line-height: 1.44;
  letter-spacing: 0;
  text-align: left;
  overflow-wrap: break-word;
}

.actTime {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px 12px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid #ebecee;
  color: #8e95a2;
  font-size: 12.5px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.actTime::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 32px;
  height: 2px;
  border-radius: 1px;
  background: #c8161d;
}

.afor {
  margin-right: 12px;
  color: #3f424a;
  font-weight: 600;
}

.atts {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #8e95a2;
  white-space: nowrap;
}

.article-reads-icon {
  display: block;
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  opacity: .85;
}

.rich.article-body {
  --rmjk-body-size: clamp(18px, 4.8vw, 20px);
  --rmjk-body-lh: 1.82;
  --rmjk-h2-size: clamp(20.5px, 5.4vw, 22.5px);
  --rmjk-h3-size: clamp(19px, 5vw, 21px);
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  color: #303030;
  font-size: var(--rmjk-body-size, 18.5px);
  font-weight: 400;
  line-height: var(--rmjk-body-lh, 1.82);
  letter-spacing: .006em;
  text-align: justify;
  line-break: strict;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  -webkit-text-size-adjust: none;
}

[data-rmjk-font="large"] .rich.article-body {
  --rmjk-body-size: clamp(21px, 5.6vw, 23.5px);
  --rmjk-body-lh: 1.85;
  --rmjk-h2-size: clamp(23.5px, 6.2vw, 26px);
  --rmjk-h3-size: clamp(22px, 5.8vw, 24px);
}

.rich.article-body p:not([data-article-credit]):not([data-editor-note-label]),
.rich.article-body .rmjk-body-block,
.rich.article-body div:not(#keywords):not([data-editor-note-content]):not(:has(> p, > div, > h1, > h2, > h3, > h4, > ul, > ol, > section, > table, > figure, > blockquote)) {
  margin: 0 0 21px;
  color: #303030;
  overflow-wrap: anywhere;
  font-size: var(--rmjk-body-size, 18.5px);
  font-weight: 400;
  line-height: var(--rmjk-body-lh, 1.82);
  letter-spacing: .006em;
  text-align: justify;
  text-indent: 0 !important;
  line-break: strict;
  -webkit-text-size-adjust: none;
}

.rich.article-body .rmjk-empty-block {
  display: none !important;
}

.rich.article-body h2 {
  margin: 34px 0 12px;
  padding-left: 11px;
  border-left: 3px solid #c8161d;
  color: #262629;
  font-family: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", "PingFang SC", Georgia, serif;
  font-size: var(--rmjk-h2-size, 21px);
  font-weight: 600;
  line-height: 1.42;
  text-align: left;
}

.rich.article-body h3 {
  margin: 26px 0 10px;
  color: #262629;
  font-family: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", "PingFang SC", Georgia, serif;
  font-size: var(--rmjk-h3-size, 19.5px);
  font-weight: 600;
  line-height: 1.46;
  text-align: left;
}

.rich.article-body ul,
.rich.article-body ol {
  margin: 0 0 21px;
  padding-left: 1.45em;
  color: #303030;
  font-size: var(--rmjk-body-size, 18.5px);
  line-height: var(--rmjk-body-lh, 1.82);
}

.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: 22px auto;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(24, 24, 27, .05);
}

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

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

.rich.article-body p[data-editor-note-label] {
  margin: 0 0 8px;
  color: #c8161d;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .04em;
  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-footer {
    margin-top: 26px;
    padding-top: 16px;
  }

  .article-operate-slot {
    height: 36px;
    margin-top: 0;
  }

  .article-operate-bar:not(.article-operate-bar-docked) {
    right: max(24px, calc((100vw - 750px) / 2 + 24px));
    left: auto;
    bottom: 28px;
    padding: 0 20px;
    column-gap: 22px;
    height: 46px;
    border-radius: 23px;
  }

  .article-operate-bar.article-operate-bar-docked {
    column-gap: 20px;
  }

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

  .article-like-count {
    font-size: 11px;
    top: 1px;
    left: 16px;
  }

  .article-font-toggle {
    padding: 0 2px 0 22px;
    font-size: 16px;
  }
  /* 桌面端两侧灰底 + 内容列白底卡片（与主 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 {
    padding: 28px 36px 0;
  }

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

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

  .topbar-title {
    font-size: 12.5px;
  }

  .ad-act {
    /* 标题与报头间距适度留白；文末由 .article-footer 承接落位操作栏 */
    padding: 26px 36px 56px;
  }

  .tit {
    font-size: 26px;
    line-height: 1.44;
  }

  .actTime {
    font-size: 14px;
  }

  .rich.article-body {
    --rmjk-body-size: 18px;
    --rmjk-body-lh: 1.85;
    --rmjk-h2-size: 22px;
    --rmjk-h3-size: 20px;
  }

  [data-rmjk-font="large"] .rich.article-body {
    --rmjk-body-size: 21px;
    --rmjk-body-lh: 1.88;
    --rmjk-h2-size: 25px;
    --rmjk-h3-size: 22px;
  }
}

/* 多图详情保持图片原比例，并沿用现有页面的最大版心宽度。 */
.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; }
.article-gallery .article-footer { box-sizing: border-box; margin-top: 8px; padding: 14px 16px 48px; padding-bottom: max(48px, calc(32px + env(safe-area-inset-bottom, 0px))); border-top-color: rgba(255, 255, 255, .14); }
.article-gallery .article-operate-bar.article-operate-bar-docked .article-operate-item { color: #f3f4f6; }
.article-gallery .article-operate-bar.article-operate-bar-docked .article-operate-item-active { color: #c8161d; }
.article-gallery .article-operate-bar.article-operate-bar-docked .article-like-count { background: #111; }

.rich.article-body [data-article-credits],
.article-footer-credits [data-article-credits] {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  margin: 1.4rem 0 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid #f0f1f4;
  text-align: left;
}
.article-footer-credits [data-article-credits] {
  gap: 4px 16px;
  margin: 0;
  padding-top: 0;
  border-top: 0;
}
.rich.article-body [data-article-credits] [data-article-credit],
.article-footer-credits [data-article-credits] [data-article-credit] {
  margin: 0;
  padding: 0;
  color: #8e95a2;
  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,
.article-footer-credits [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],
  .article-footer-credits [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.35rem;
  margin: 0.85rem 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.14rem 0.52rem;
  height: auto;
  background: #f4f5f7;
  color: #555962;
  border: 1px solid #ebecee;
  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.08rem 0.35rem;
    border-radius: 0.375rem;
  }
}
