/* 详情页继续使用新闻列表的设计变量，仅补充文章和分享栏样式。 */
.page-canvas {
  position: relative;
  height: auto;
}

/* 详情页高度由正文实际内容决定，避免沿用新闻列表页的固定画布高度。 */
.page-stage {
  height: auto;
  overflow: visible;
}

/* 详情主体使用自然文档流，正文增减时自动撑开页面高度。 */
.detail-article {
  position: relative;
  width: 1680px;
  margin-top: 0;
}

.detail-title {
  width: 1680px;
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 400;
  line-height: 28px;
  text-align: center;
  white-space: nowrap;
}

.detail-meta {
  width: 1680px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
  text-align: center;
  white-space: nowrap;
}

/* 顶部和正文末尾分隔线直接使用 Figma 的 1680px 线条资源。 */
.detail-divider,
.detail-ending-divider {
  width: 1680px;
  height: 1px;
}

.detail-divider {
  margin-top: 20px;
}

.detail-copy {
  width: 1680px;
  margin-top: 39px;
  color: var(--text);
  font-size: 20px;
  line-height: 30px;
}

.detail-copy p {
  margin: 0;
}

/* 空段落复现设计稿中的 30px 留白，不使用额外的内容占位文字。 */
.detail-copy .detail-paragraph-gap {
  height: 30px;
}

/* 两张图片均为 1020×760，水平居中于正文区域。 */
.detail-figure {
  width: 1020px;
  margin: 40px auto 0;
}

.detail-figure img {
  width: 1020px;
  height: 760px;
  object-fit: cover;
}

.detail-figure figcaption {
  width: 1020px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 30px;
  text-align: center;
  white-space: nowrap;
}

.detail-figure-one {
  margin-top: 40px;
}

.detail-figure-two {
  margin-top: 40px;
}

/* 图片后的说明跟随前序内容排列，避免正文变化时相互覆盖。 */
.detail-ending {
  width: 1680px;
  margin: 40px 0 0;
  color: var(--text);
  font-size: 20px;
  line-height: 30px;
}

.detail-ending-divider {
  margin-top: 40px;
}

/* 文章导航预设上一篇和下一篇槽位，缺少任一链接时另一项位置保持不变。 */
.article-navigation {
  display: grid;
  width: 1680px;
  height: 152px;
  margin-top: 60px;
  grid-template-columns: 716px 716px;
  grid-template-areas: "previous next";
  column-gap: 144px;
}

.article-neighbor {
  position: relative;
  display: block;
  width: 716px;
  height: 152px;
  color: var(--text);
  transition: background-color .18s ease;
}

/* 通过固定网格区域保留相邻文章的空白槽位。 */
.article-neighbor--previous {
  grid-area: previous;
}

.article-neighbor--next {
  grid-area: next;
}

.article-neighbor:hover,
.article-neighbor:focus-visible {
  background: #f7f9fb;
}

.article-neighbor-label {
  position: absolute;
  top: 0;
  left: 0;
  font-size: 20px;
  line-height: 30px;
}

.article-neighbor-rule {
  position: absolute;
  top: 40px;
  left: 0;
  width: 100px;
  height: 4px;
  background: var(--primary);
}

.article-neighbor-date {
  position: absolute;
  top: 90px;
  left: 0;
  display: block;
  width: 54px;
  text-align: right;
}

.article-neighbor-date strong {
  display: block;
  color: #000000;
  font-size: 24px;
  font-weight: 400;
  line-height: 30px;
}

.article-neighbor-date small {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 30px;
}

.article-neighbor-title {
  position: absolute;
  top: 56px;
  width: 602px;
  overflow: hidden;
  font-size: 18px;
  line-height: 30px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* PC 端分享栏复现 Figma 的 60×270 右侧蓝色面板。 */
.share-tools {
  position: absolute;
  z-index: 30;
  top: 593px;
  right: 0;
  display: flex;
  width: 60px;
  height: 270px;
  flex-direction: column;
  align-items: center;
  background: url("../img/figma/share-panel-open.svg") center / 60px 270px no-repeat;
}

/* 分享标题、分隔线及图标位置均使用设计节点内的相对坐标。 */
.share-heading {
  display: flex;
  margin-top: 30px;
  flex-direction: column;
  align-items: center;
  color: #ffffff;
  font-size: 16px;
  line-height: 22px;
}

.share-heading::after {
  position: absolute;
  top: 120px;
  left: 10px;
  width: 40px;
  height: 1px;
  background: url("../img/figma/share-line.svg") center / 40px 1px no-repeat;
  content: "";
}

.share-heading img {
  width: 26px;
  height: 26px;
}

.share-heading span {
  margin-top: 11px;
}

/* “分享至”只用于手机端底部入口，PC 端由蓝色面板标题代替。 */
.share-label {
  display: none;
}

/* PC 端两个分享按钮覆盖完整行高，图标保持 Figma 原始尺寸。 */
.share-action {
  position: absolute;
  left: 0;
  display: flex;
  width: 60px;
  height: 55px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  color: #ffffff;
  background: transparent;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.share-wechat {
  top: 139px;
}

.share-weibo {
  top: 194px;
}

.share-action:hover {
  background: rgba(255, 255, 255, .1);
}

.share-action:active {
  background: rgba(255, 255, 255, .18);
}

.share-action:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.share-action img {
  width: 30px;
  height: 26px;
  object-fit: contain;
}

.share-action span {
  display: none;
}

/* 状态提示覆盖在页面底部，短暂反馈微信引导或链接复制结果。 */
.share-message {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: calc(24px + env(safe-area-inset-bottom));
  left: 20px;
  margin: 0;
  padding: 12px 16px;
  border-radius: 8px;
  color: #ffffff;
  background: rgba(28, 28, 30, .92);
  font-size: 14px;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
  backdrop-filter: blur(12px);
}

/* 微信二维码弹窗按参考图保持 449px 宽度与清晰的白色内容区。 */
.wechat-share-dialog {
  box-sizing: border-box;
  width: 449px;
  max-width: calc(100vw - 32px);
  margin: auto;
  padding: 16px 16px 58px;
  border: 0;
  border-radius: 8px;
  color: #333333;
  background: #ffffff;
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .2);
}

.wechat-share-dialog::backdrop {
  background: rgba(0, 0, 0, .36);
  backdrop-filter: blur(2px);
}

/* 弹窗容器接收初始焦点，但不显示额外轮廓，避免改变参考图视觉。 */
.wechat-share-dialog:focus {
  outline: none;
}

.wechat-share-header {
  display: flex;
  min-height: 28px;
  align-items: flex-start;
  justify-content: space-between;
}

.wechat-share-header h2 {
  margin: 0;
  color: #000000;
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
}

/* 关闭按钮使用熟悉的乘号，并保留足够的键盘和鼠标操作区域。 */
.wechat-share-close {
  display: grid;
  width: 32px;
  height: 32px;
  margin: -4px -4px 0 0;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: #9aa4ad;
  background: transparent;
  cursor: pointer;
}

.wechat-share-close span {
  font-size: 28px;
  font-weight: 300;
  line-height: 28px;
}

.wechat-share-close:hover,
.wechat-share-close:focus-visible {
  color: #333333;
  background: #f2f2f7;
  outline: none;
}

/* 二维码使用 308px 正方形，尺寸与用户提供的弹窗参考图一致。 */
.wechat-qr-code {
  width: 308px;
  height: 308px;
  margin: 18px auto 24px;
  background: #ffffff;
}

.wechat-qr-code img,
.wechat-qr-code canvas {
  display: block;
  width: 308px;
  height: 308px;
}

.wechat-share-dialog p {
  margin: 0;
  color: #666666;
  font-size: 18px;
  line-height: 34px;
}

/* 弹窗打开时锁定页面滚动，避免遮罩下的正文发生位移。 */
.share-dialog-open {
  overflow: hidden;
}

/* 手机端继续沿用原有横向分享入口，不显示 PC 端面板标题。 */
.is-mobile .share-tools {
  position: relative;
  z-index: auto;
  top: auto;
  right: auto;
  display: flex;
  width: calc(100% - 32px);
  height: auto;
  min-height: 76px;
  margin: 32px auto calc(24px + env(safe-area-inset-bottom));
  padding: 10px 16px;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid #e5e5ea;
  background: none;
}

.is-mobile .share-heading {
  display: none;
}

.is-mobile .share-label {
  display: block;
  margin-right: auto;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

/* 手机端分享按钮恢复 iOS 风格的圆形品牌图标与文字标签。 */
.is-mobile .share-action {
  position: static;
  width: 52px;
  height: auto;
  min-height: 56px;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
  border-radius: 8px;
  color: var(--text);
}

.is-mobile .share-action:hover,
.is-mobile .share-action:active {
  background: #f2f2f7;
}

.is-mobile .share-action img {
  width: 32px;
  height: 32px;
  padding: 6px;
  border-radius: 50%;
}

.is-mobile .share-wechat img {
  background: #07c160;
}

.is-mobile .share-weibo img {
  background: #e6162d;
}

.is-mobile .share-action span {
  display: block;
  font-size: 12px;
  line-height: 14px;
}

/* 手机端正文改为单列流式排版，内容随屏幕宽度自然排列。 */
.is-mobile .detail-article {
  width: 100%;
  height: auto;
  margin-top: 0;
}

.is-mobile .detail-title,
.is-mobile .detail-meta,
.is-mobile .detail-divider,
.is-mobile .detail-copy,
.is-mobile .detail-figure,
.is-mobile .detail-ending,
.is-mobile .detail-ending-divider {
  position: static;
  width: 100%;
  height: auto;
}

.is-mobile .detail-title {
  font-size: 20px;
  line-height: 1.5;
  white-space: normal;
}

.is-mobile .detail-meta {
  margin-top: 12px;
  font-size: 13px;
  line-height: 22px;
  white-space: normal;
}

.is-mobile .detail-divider {
  display: block;
  margin-top: 18px;
}

.is-mobile .detail-copy {
  margin-top: 22px;
  font-size: 15px;
  line-height: 1.9;
}

.is-mobile .detail-copy .detail-paragraph-gap {
  height: 18px;
}

.is-mobile .detail-figure {
  margin-top: 24px;
}

.is-mobile .detail-figure img {
  width: 100%;
  height: auto;
}

.is-mobile .detail-figure figcaption {
  width: 100%;
  margin-top: 8px;
  font-size: 12px;
  line-height: 20px;
  white-space: normal;
}

.is-mobile .detail-ending {
  margin-top: 24px;
  font-size: 15px;
  line-height: 1.9;
}

.is-mobile .detail-ending-divider {
  display: block;
  margin-top: 24px;
}

.is-mobile .article-navigation {
  display: grid;
  width: 100%;
  height: 276px;
  margin-top: 32px;
  grid-template-columns: 1fr;
  grid-template-rows: 126px 126px;
  grid-template-areas:
    "previous"
    "next";
  row-gap: 24px;
}

.is-mobile .article-neighbor {
  width: 100%;
  height: 126px;
  border-radius: 8px;
}

.is-mobile .article-neighbor-label {
  top: 12px;
  left: 14px;
  font-size: 17px;
}

.is-mobile .article-neighbor-rule {
  top: 48px;
  left: 14px;
  width: 64px;
  height: 3px;
}

.is-mobile .article-neighbor-date {
  top: 68px;
  left: 14px;
  width: 50px;
  text-align: left;
}

.is-mobile .article-neighbor-date strong {
  font-size: 20px;
  line-height: 24px;
}

.is-mobile .article-neighbor-date small {
  font-size: 12px;
  line-height: 20px;
}

.is-mobile .article-neighbor-title {
  top: 70px;
  left: 82px;
  width: calc(100% - 96px);
  font-size: 14px;
  line-height: 24px;
  white-space: normal;
}
