/* 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("../images/news-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("../images/news-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(--blue);
  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;
}

