/* ==========================================================================
   portal-r29b.css —— 资讯详情页（/news/{id}）专项修复
   · 只作追加，不覆盖 portal.css / portal-extra.css 的任何规则
   · 引入顺序：放在 portal.css（必要时也放在 portal-extra.css）之后
   · 全部规则带 .nd-* 前缀（news-detail），全站引入也不影响其它页面
   对应问题：
     3. 分类徽标上方留白（原先紧跟 .pagehead 的 58px 下内边距，视觉上贴在一起）
     5. 正文底部灰色免责声明（13px / --ink-400 / 行高 1.8 / 上方 28px + 分隔线）
     6. 去掉左侧目录与卡片后，正文单列居中，阅读宽度 840px
     7. 正文上方分享条（微信 hover 二维码 / 新浪微博 / 复制链接）
   ========================================================================== */

/* ---------- 3 + 6. 头部容器与正文列同宽，徽标下移留白 ---------- */
/* 现状：.pagehead（portal.css:355）下内边距 58px，紧接着的 .section--tight
   被模板内联 padding-top:0 抵消，.badge（portal.css:417）直接贴着页头下沿。
   做法：分类徽标单独给上间距；头部容器与正文同宽（840px），保证徽标、元信息、
   正文左边缘对齐。 */
/* 页头（面包屑 + 标题）也收到同一列宽，避免「标题贴左边、徽标/正文居中」的错位 */
.container.nd-pagehead__in {
  max-width: 840px;
  margin: 0 auto;
}

.nd-head__in {
  max-width: 840px;
  margin: 0 auto;
}

.nd-head__in > .badge {
  margin-top: 14px;
}

/* 元信息行：左「日期 · 来源 · 阅读」，右「分享」，窄屏换行不挤压 */
.nd-metabar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 18px;
  flex-wrap: wrap;
  margin-top: 10px;
  min-height: 34px;
}

.nd-metabar__meta {
  margin: 0;
}

/* ---------- 6. 正文单列居中（原先 .aside-layout 是 250px + 1fr，见 portal.css:429） ---------- */
.nd-article {
  max-width: 840px;
  margin: 0 auto;
}

/* 正文图片不撑破阅读列（富文本里可能有宽图） */
.nd-article .prose img {
  max-width: 100%;
  height: auto;
}

.nd-article .prose table {
  max-width: 100%;
}

/* ---------- 5. 正文底部免责声明 ---------- */
/* 现状：正文结束直接接 .post-nav，没有任何「声明」区。
   做法：固定文案 + 灰色小字，上边距 28px、上方一条 1px 分隔线。 */
.nd-disclaimer {
  margin: 28px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line, #ECECEC);
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink-400, #999999);
  text-align: justify;
}

/* ---------- 7. 分享条（正文上方，元信息右侧；窄屏换到下一行） ---------- */
.nd-share {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.nd-share__label {
  font-size: 12.5px;
  color: var(--ink-400, #999999);
  white-space: nowrap;
}

.nd-share__acts {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nd-share__item {
  position: relative;
  display: inline-flex;
}

/* 圆形图标按钮：34px，微信绿 / 微博红 / 复制深灰，hover 轻微上浮 */
.nd-share__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ink-700, #333333);
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .18s var(--ease, ease), box-shadow .18s var(--ease, ease), background-color .18s var(--ease, ease);
}

.nd-share__btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.nd-share__btn--wx { background: #07C160; }
.nd-share__btn--wb { background: #E6162D; }
.nd-share__btn--cp { background: #4E5969; }

.nd-share__btn:hover,
.nd-share__btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .16);
}

.nd-share__btn:focus-visible {
  outline: 2px solid var(--gold-500, #FAC100);
  outline-offset: 2px;
}

/* tooltip：hover / 键盘聚焦时出现在图标上方 */
.nd-share__tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translate(-50%, 4px);
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(17, 24, 39, .92);
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .16s var(--ease, ease), transform .16s var(--ease, ease), visibility .16s;
  z-index: 31;
}

.nd-share__item:hover .nd-share__tip,
.nd-share__item:focus-within .nd-share__tip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* 微信二维码浮层：图标下方弹出，白底 + 细边 + 阴影（参考新华网样式） */
.nd-share__qr {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translate(-50%, 4px);
  width: 172px;
  padding: 10px 10px 8px;
  border: 1px solid var(--line, #ECECEC);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(17, 24, 39, .16);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s var(--ease, ease), transform .18s var(--ease, ease), visibility .18s;
  z-index: 30;
}

.nd-share__item.is-open .nd-share__qr,
.nd-share__item:hover .nd-share__qr,
.nd-share__item:focus-within .nd-share__qr {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

/* 二维码浮层的小尖角 */
.nd-share__qr::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  background: #fff;
  border-left: 1px solid var(--line, #ECECEC);
  border-top: 1px solid var(--line, #ECECEC);
  transform: rotate(45deg);
}

.nd-share__qr-canvas {
  display: block;
  width: 150px;
  height: 150px;
  margin: 0 auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.nd-share__qr-txt {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-500, #666666);
}

.nd-share__qr-link {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-400, #999999);
  word-break: break-all;
}

/* 复制成功轻提示（放在分享条右侧，不占布局） */
.nd-share__toast {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(17, 24, 39, .92);
  color: #fff;
  font-size: 12.5px;
  line-height: 1.5;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .18s var(--ease, ease), transform .18s var(--ease, ease), visibility .18s;
  pointer-events: none;
  z-index: 32;
}

.nd-share__toast.is-on {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 触屏：去掉 hover 造成的浮层残留（JS 用 .is-open 控制） */
@media (hover: none) {
  .nd-share__item:hover .nd-share__qr { opacity: 0; visibility: hidden; pointer-events: none; }
  .nd-share__item.is-open .nd-share__qr { opacity: 1; visibility: visible; pointer-events: auto; }
  .nd-share__item:hover .nd-share__tip { opacity: 0; visibility: hidden; }
  .nd-share__item:focus-within .nd-share__tip { opacity: 1; visibility: visible; }
}

/* 窄屏：分享条与元信息分两行，二维码浮层靠右避免出屏 */
@media (max-width: 640px) {
  .nd-metabar {
    align-items: flex-start;
  }

  .nd-share {
    width: 100%;
    justify-content: flex-start;
  }

  .nd-share__qr {
    left: 0;
    transform: translate(0, 4px);
  }

  .nd-share__item.is-open .nd-share__qr,
  .nd-share__item:hover .nd-share__qr,
  .nd-share__item:focus-within .nd-share__qr {
    transform: translate(0, 0);
  }
}
