/* 分享面板（所有页面）：电脑上是屏幕中间的小窗，手机上从底部升起 */
.share-overlay { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 60; background: rgba(20, 16, 12, .38); }
.share-panel {
  position: fixed; z-index: 61;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: calc(100vw - 32px); max-width: 420px; max-height: calc(100vh - 48px); overflow-y: auto;
  padding: 20px 22px 18px;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .18);
  font-family: var(--sans); font-size: 14px; line-height: 1.6;
}
.share-overlay[hidden], .share-panel[hidden], .share-panel [hidden] { display: none; }
.share-head { display: flex; align-items: center; justify-content: space-between; }
.share-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.share-close { width: 36px; height: 36px; margin-right: -8px; padding: 0; background: none; color: var(--muted); border: 0; font-size: 24px; line-height: 1; cursor: pointer; }
.share-close:hover { color: var(--ink); }
.share-name { margin: 6px 0 16px; font-family: var(--serif); font-size: 16px; font-weight: 700; }
.share-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; }
.share-actions button, .share-actions a {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 4px 10px;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 13px; text-decoration: none; cursor: pointer;
}
.share-actions button:hover, .share-actions a:hover { border-color: var(--ink); }
.share-actions svg { width: 22px; height: 22px; }
.share-wechat { display: flex; align-items: center; gap: 16px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.share-qr { flex: none; width: 112px; height: 112px; background: #FFFFFF; border-radius: 6px; }
.share-qr svg { display: block; width: 100%; height: 100%; }
.share-tip { margin: 0; color: var(--muted); font-size: 13px; }
.share-tip a { color: var(--ink); }
.share-poster { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); text-align: center; }
.share-poster img { display: block; width: 100%; max-width: 300px; margin: 0 auto 10px; border: 1px solid var(--line); border-radius: 6px; }
.share-status { min-height: 1.6em; margin: 10px 0 0; color: var(--muted); font-size: 13px; text-align: center; }

/* 面板关着时的小提示（例如文末“复制链接”） */
.share-toast {
  position: fixed; z-index: 62; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: 9px 16px;
  background: rgba(30, 26, 22, .92); color: #FFFFFF; border-radius: 999px;
  font: 13px/1.5 var(--sans); text-align: center;
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; pointer-events: none;
}
.share-toast.is-shown { opacity: 1; visibility: visible; }

/* 文末的分享区 */
.share-end { margin-top: 40px; padding: 22px 20px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; text-align: center; }
.share-end p { margin: 0 0 14px; font-family: var(--serif); font-size: 16px; }
.share-end .actions { justify-content: center; }
.share-end button { font: inherit; font-size: 14px; cursor: pointer; }
/* 分享按钮要靠脚本才能用；没有脚本时不显示 */
html:not(.js) [data-share-js] { display: none; }

@media (max-width: 759px) {
  .share-panel {
    top: auto; bottom: 0; left: 0; transform: none;
    width: 100%; max-height: 88vh;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
    border-width: 1px 0 0; border-radius: 16px 16px 0 0;
    animation: share-up .2s ease-out;
  }
  @keyframes share-up { from { transform: translateY(24px); opacity: 0; } }
}
@media (prefers-reduced-motion: reduce) {
  .share-panel, .share-toast { animation: none; transition: none; }
}
