/* Layout styles */

/* 国产安卓浏览器（vivo/UC/QQ 系）常无视 viewport meta 做字体自动放大，
   截图实测按钮/页脚被放大到溢出屏幕；全局钉死 text-size-adjust */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* 深海蓝渐变背景（视口固定层：html 白底兜底，::before 铺渐变不随滚动拉伸；
   Safari 对 background-attachment:fixed 有兼容坑，fixed 伪元素方案全平台一致）。
   尾部掺鲸青调（2026-09-22）：#4d6bfe 纯蓝系略「模板」，向 DeepSeek 深海主题靠半档 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, #f7f9ff 0%, #eef2fb 55%, #e9f2f4 100%);
  pointer-events: none;
}

body.dark::before {
  background: linear-gradient(180deg, #121212 0%, #14161f 60%, #152130 100%);
}

body {
  font-family: "Roboto", Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  padding: 0;
  background-color: transparent;
  transition: background-color 0.3s, color 0.3s;
  /* 100vh 在移动端地址栏收起/展开时跳动；dvh 跟随动态视口，老浏览器吃上一行兜底 */
  min-height: 100vh; /* Ensures footer is at the bottom */
  min-height: 100dvh;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0); /* iOS Safari */
  -webkit-touch-callout: none; /* Disable callout, image save panel (iOS Safari) */
  /* 不再全局禁用 user-select：story 正文、alt 文案、页脚链接需要能被选中复制。
     图片长按保存菜单仍由 -webkit-touch-callout 抑制，图片本身的选中在 gallery.css 单独处理 */
  -ms-touch-action: manipulation; /* IE 10 */
  touch-action: manipulation; /* Non-prefixed version, currently supported by Chrome, Edge, and Firefox */
  color: var(--text-color);
}

header {
  width: 100%;
  /* 柔和顶栏（2026-09-22 UI 优化）：整条高饱和品牌蓝填充刺眼，改白底毛玻璃
     + 细底边框，品牌蓝只留给投稿主按钮/进度条等点缀 */
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px) saturate(1.5);
  -webkit-backdrop-filter: blur(12px) saturate(1.5);
  color: var(--text-color);
  padding: 10px 24px;
  /* 刘海屏安全区：顶部吃刘海、左右吃圆角（padding 前缀属性叠加，老浏览器忽略） */
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  padding-left: calc(24px + env(safe-area-inset-left, 0px));
  padding-right: calc(24px + env(safe-area-inset-right, 0px));
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  border-bottom: 1px solid rgba(77, 107, 254, 0.14);
  box-shadow: 0 1px 12px rgba(23, 35, 80, 0.06);
  z-index: 1000;
  transition: transform 0.3s ease-in-out, height 0.3s ease-in-out,
    padding 0.3s ease-in-out;
  /* content-box + padding 会让 header 实际渲染宽 = width + padding，
     在 1280 视口下实测到 1340，导致右端按钮被切 60px。强制 border-box
     让 width:100% 包含 padding */
  box-sizing: border-box;
}

header h1 {
  margin: 0;
  font-size: 1.25em; /* 20px：内容区优先，标题让出首屏空间（原 2em/32px） */
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: font-size 0.3s ease-in-out;
  min-width: 0; /* flex 子项需显式允许收缩，否则长标题不触发 ellipsis */
  overflow: hidden;
}

/* 标题链接继承 h1 的响应式字号：否则会被下面 header a 的固定 24px 覆盖，
   导致移动端无法靠缩字号把长标题压进一行 */
header h1 a {
  display: block;
  font-size: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 默认显示完整站名；<=600px 切短站名，腾出横向空间给投稿按钮 */
.brand-short {
  display: none;
}

.header-buttons {
  display: flex;
  align-items: center;
  transition: font-size 0.3s ease-in-out;
}

header a {
  color: var(--text-color);
  font-size: 1.5em;
  margin-right: 20px;
  text-decoration: none;
  transition: font-size 0.3s ease-in-out;
}

header button {
  background: none;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  transition: font-size 0.3s ease-in-out;
  display: flex;
}

/* 白底顶栏下，主题切换的白色 SVG 图标反色成深色；深色顶栏还原 */
header button img {
  width: 24px;
  height: 24px;
  margin-right: 0.1em;
  filter: invert(1);
  opacity: 0.75;
  transition: opacity 0.2s ease;
}

body.dark header button img {
  filter: none;
  opacity: 0.9;
}

header button:hover img {
  opacity: 1;
}

header a img {
  width: 26px;
  height: 26px;
  transition: font-size 0.3s ease-in-out;
  margin-right: 0.1em;
}

/* 页头投稿按钮：白底顶栏下唯一的品牌蓝实心主按钮（原白色半透明太弱）。
   独立成按钮而不是塞进语言菜单：地球图标是「语言」语义，
   用户不会想到点它找投稿——藏在那儿等于没有入口 */
.contribute-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  padding: 5px 14px;
  border-radius: 999px;
  /* 固定品牌蓝渐变而非 var(--primary-color)：深色模式该变量被覆盖提亮，
     主按钮统一走深海→鲸青微渐变 */
  background: var(--primary-grad);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(61, 108, 222, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transition: transform 0.22s var(--bounce-ease), box-shadow 0.2s ease, filter 0.2s ease;
}

.contribute-btn:hover,
.contribute-btn:focus {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(61, 108, 222, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  filter: saturate(1.12);
}

.contribute-btn:active {
  transform: scale(0.92);
  transition-duration: 0.08s;
}

body.dark .contribute-btn {
  box-shadow: none;
}

body.dark .contribute-btn:hover,
body.dark .contribute-btn:focus {
  filter: none;
}

/* 语言切换器（locale.js 动态插入 .header-buttons 首位） */
.lang-switch {
  position: relative;
  margin-right: 14px;
}

.lang-switch > button {
  padding: 4px;
  border-radius: 6px;
}

.lang-switch > button svg {
  width: 24px;
  height: 24px;
  display: block;
}

.lang-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  min-width: 128px;
  z-index: 1200;
}

.lang-switch.open .lang-menu {
  display: block;
}

/* 语言项用 button，反馈入口用 a（可中键/右键新开），两者共用一套行样式 */
.lang-menu button,
.lang-menu .lang-menu-action {
  display: block;
  width: 100%;
  padding: 10px 18px;
  color: #333;
  font-size: 0.9rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  text-decoration: none;
  box-sizing: border-box;
}

.lang-menu button:hover,
.lang-menu .lang-menu-action:hover {
  background: #eef1ff;
}

.lang-menu button.active {
  color: #4d6bfe;
  font-weight: 600;
}

/* 语言项与反馈入口之间的分隔线 */
.lang-sep {
  height: 1px;
  margin: 4px 0;
  background: rgba(0, 0, 0, 0.08);
}

/* 深色模式：语言菜单默认是白底黑字，需整体反色，否则在深色页面上是一块突兀的白 */
body.dark .lang-menu {
  background: #1e1e1e;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

body.dark .lang-menu button,
body.dark .lang-menu .lang-menu-action {
  color: #e0e0e0;
}

body.dark .lang-menu button:hover,
body.dark .lang-menu .lang-menu-action:hover {
  background: #2a2a2a;
}

body.dark .lang-menu button.active {
  color: #8fa6ff; /* 品牌蓝在深底上偏暗，提亮一档保证对比度 */
}

body.dark .lang-sep {
  background: rgba(255, 255, 255, 0.12);
}

/* SEO 审计（E3）主体语义容器。宽度钉死 100%：body 是 flex column + align-items:center，
   main 若 shrink-to-fit 会被 chips/瀑布流的百分比宽度循环依赖撑出 1~3px 舍入溢出
   （2026-09-22 移动端 375px 视口实测 378px），clip 兜底消灭横向滚动条 */
main {
  width: 100%;
  max-width: 100vw;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  align-items: center;
}

footer {
  width: 100%;
  box-sizing: border-box;
  /* 柔和页脚：与白底顶栏呼应，细上边框代替整条品牌蓝填充 */
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(77, 107, 254, 0.12);
  color: var(--text-color);
  text-align: center;
  padding: 14px 16px;
  margin-top: auto; /* Pushes footer to the bottom */
  opacity: 0; /* Start hidden */
  transition: opacity 1s; /* Fade-in effect */
  font-size: 13px; /* 页脚是导航内链区不是横幅：压字号防止长链行溢出（截图实测糊出右屏） */
  line-height: 1.7;
  /* 底部悬浮球（左下导航坞/右下滚动球）常驻，页脚给它们让位 */
  padding-bottom: calc(14px + 76px);
}

footer a {
  color: var(--primary-color);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.load-more {
  padding: 10px 20px;
  margin: 20px 0;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s, opacity 1s; /* Fade-in effect for the button */
  opacity: 0; /* Start hidden */
  display: flex;
  align-items: center;
  justify-content: center;
}

.load-more.loading {
  background-color: #a0a0a0; /* 灰色 */
  cursor: not-allowed;
}

.load-more.loading::after {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  content: "";
  border: 2px solid #fff;
  border-top: 2px solid transparent;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  margin-left: 10px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Dark theme styles */
body.dark {
  background-color: transparent; /* 底色交给 body::before 深色渐变层 */
  color: #e0e0e0;
  /* 2026-09-22：深色主色恢复品牌蓝（提亮一档保暗底对比度）。原 #3d3d3d 中性灰
     是顶栏还用整条填充时代的降饱和决策——顶栏已白底毛玻璃化，灰主色只会让
     全站各页的选中态/主按钮在深色下集体失色 */
  --primary-color: #5d79ff;
  --primary-color-dark: #4d6bfe; /* 深色下 hover 反向取原色 */
  --text-color: #e0e0e0;
  --bg-color: #1c1e26; /* 深色渐变底上的组件底色（chips 等） */
  --shadow-color: rgba(0, 0, 0, 0.6);
}

body.dark header {
  background: rgba(28, 30, 38, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: none;
}

body.dark footer {
  background: rgba(24, 26, 33, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

body.dark footer a {
  color: #8fa6ff; /* 品牌蓝在深底上提亮一档保证对比度 */
}

body.dark .tag {
  background-color: #4d4d4d;
  color: #e0e0e0;
}

body.dark .modal {
  background-color: rgba(61, 61, 61, 0.9);
}

body.dark .modal-content {
  background-color: #4d4d4d;
}

/* 加载原图按钮：已收进弹层操作条 #meme-actions（meme-actions.js），不再 fixed 悬浮——
   原右下角 bottom:20 与自动滚动球重叠是历史遗留（见 MEMORY 多 fixed 重叠条目）。
   条内布局由 .meme-action-btn 提供，这里保留配色、状态与加载动画 */
.load-original-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.load-original-btn:hover {
  background-color: var(--primary-color-dark);
}

.load-original-btn:active {
  opacity: 0.85;
}

/* 按钮加载状态 */
.load-original-btn.loading {
  cursor: not-allowed;
  pointer-events: none;
}

.load-original-btn .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  flex-shrink: 0;
  display: block;
}

.load-original-btn span {
  display: block;
  line-height: 1;
  white-space: nowrap;
}

/* 深色主题下的按钮样式 */
body.dark .load-original-btn {
  background-color: var(--primary-color);
  color: white;
}

body.dark .load-original-btn:hover {
  background-color: var(--primary-color-dark);
}

/* ========== 弹层操作条（meme-actions.js）========== */
/* 跟在弹层大图/story 之后普通流内布局，不悬浮——替代旧的两个右下 fixed 球。
   移动端单列全宽，按钮等分；桌面与 story 卡片同宽居中 */
.meme-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 88%;
  max-width: 700px;
  margin: 10px auto 0;
  justify-content: center;
}

.meme-actions[hidden] {
  display: none;
}

.meme-action-btn {
  flex: 1 1 auto;
  /* 紧凑胶囊（2026-09-21 用户反馈按钮太大）；触控目标靠 padding 撑到 ~34px，
     略低于 44px 无障碍建议但操作条按钮间距密、误触代价低 */
  min-height: 34px;
  padding: 6px 14px;
  border: none;
  border-radius: 17px;
  background: var(--primary-color);
  color: #fff;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.22s var(--bounce-ease), background 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
  /* 移动端按钮允许折行：宁可两行字也不溢出屏幕（截图实测 nowrap 胶囊糊出屏幕边缘） */
  white-space: normal;
  text-align: center;
}

.meme-action-btn:hover {
  background: var(--primary-grad);
  filter: saturate(1.08);
}

.meme-action-btn:active {
  transform: scale(0.93);
  transition-duration: 0.08s;
}

.meme-action-btn:active {
  opacity: 0.85;
}

.meme-action-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* 「生成分享图」在操作条里做次级视觉：主色实心留给下载/复制这两个保存路径 */
#share-card-btn.meme-action-btn {
  background: rgba(128, 128, 128, 0.25);
  color: #fff;
}

#share-card-btn.meme-action-btn:hover {
  background: rgba(128, 128, 128, 0.4);
}

body.dark #share-card-btn.meme-action-btn {
  background: rgba(255, 255, 255, 0.14);
  color: #f0f0f0;
}

body.dark #share-card-btn.meme-action-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

/* 移动端操作条改 2x2 网格：等分宽度，永远不可能溢出屏幕（flex+胶囊在
   字体放大的浏览器里会糊出边缘，截图实测） */
@media (max-width: 600px) {
  .meme-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 92%;
  }
}

/* 回到顶部（搜索条与排序切换已下线，2026-09-21） */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 86px; /* 右下还有 50px 自动滚动球(bottom:20)，回顶球叠它上方 */
  z-index: 900;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--primary-color);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.back-to-top[hidden] {
  display: none;
}

.back-to-top svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.back-to-top:active {
  transform: scale(0.94);
}

/* Loading animation */
#loading {
  /* 原 fixed 全屏居中：索引拉取期间整个屏幕一个孤伶伶的转圈（用户截图反馈巨幕孤圈丑）。
     改为贴 header 下方的小胶囊，像「顶部加载提示」而非「全屏遮罩」 */
  position: fixed;
  top: calc(58px + env(safe-area-inset-top, 0px)); /* 收敛后的顶栏（~49px）下方；刘海屏叠加安全区 */
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
}

body.dark #loading {
  background: rgba(30, 30, 30, 0.94);
}

#loading::after {
  content: "";
  border: 4px solid var(--primary-color);
  border-top: 4px solid transparent;
  border-radius: 50%;
  width: 26px; /* 原 40px 太大，缩小配合小胶囊 */
  height: 26px;
  animation: spin 1s linear infinite;
  will-change: transform; /* 优化动画性能 */
}

#loading.hidden {
  display: none;
}

/* 断点：字号收敛后顶栏统一更矮（高度由 padding 决定，不再钉死 height——
   旧断点里的固定 height 本就被 padding+内容顶破，实测无效，删掉还原真实高度） */
@media (max-width: 600px) {
  header {
    padding: 8px 14px;
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
  }
  header h1 {
    font-size: 1.05em; /* 移动端单行短站名「梗鲸」 */
  }
  header button {
    margin-right: 4px; /* 移动端省出横向空间给标题 */
  }
  /* 只留「梗鲸」两个字，把空间让给投稿按钮（完整站名仍在 DOM，不影响 SEO） */
  .brand-full {
    display: none;
  }
  .brand-short {
    display: inline;
  }
}

@media (min-width: 600px) and (max-width: 1200px) {
  header button {
    margin-right: 24px;
  }
}

@media (min-width: 1200px) {
  header button {
    margin-right: 32px;
  }
}

/* 1280 视口（13 寸笔记本常见宽度）下完整站名+投稿按钮会被切右侧，
   切短站名「梗鲸」让出空间。完整站名仍在 DOM，SEO 不受影响 */
@media (max-width: 1280px) {
  .brand-full {
    display: none;
  }
  .brand-short {
    display: inline;
  }
}

/* 浅色模式（--bg-color / --shadow-color 必须在 :root 定义：
   这两个变量被本文件开头的 body、header 直接使用，原先只在 .dark 里定义，
   导致浅色模式下 body 背景透明、header 阴影失效） */
:root {
  --primary-color: #4d6bfe; /* DeepSeek 品牌蓝主题色 */
  --primary-color-dark: #3a65c2; /* hover 加深 */
  /* 深海蓝→鲸青轻量微渐变（2026-09-22 减模板感）：只用于主按钮/选中态等
     品牌强调面，基准色不变；末端取深青蓝保白字对比（≥3.8:1） */
  --primary-grad: linear-gradient(135deg, #4d6bfe 0%, #4480e8 55%, #3e8ade 100%);
  --primary-grad-dark: linear-gradient(135deg, #3a65c2 0%, #3573c9 55%, #2f7cc4 100%);
  /* Q 弹曲线：overshoot 回弹，按压松手时轻微 bouncy（二次元轻快调性） */
  --bounce-ease: cubic-bezier(0.34, 1.56, 0.64, 1);
  --bg-color: #ffffff;
  --text-color: #1e232c;
  --shadow-color: rgba(0, 0, 0, 0.12);
}

/* 深色变量：合并到下面的 body.dark 块里（原 .dark 选择器特异性低，
   被 body.dark 覆盖，纯属冗余，删了省得误导后人） */

/* 使用变量替换原有颜色值（header/footer 已改白底毛玻璃，此处只剩加载更多按钮） */
.load-more {
    background: var(--primary-grad);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: background 0.2s, opacity 1s, transform 0.22s var(--bounce-ease);
}
.load-more:active { transform: scale(0.97); }

/* 加载指示器样式 */
#temp-loading-msg {
    text-align: center;
    margin: 20px 0;
    padding: 10px;
    color: rgba(0, 0, 0, 0.65);
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 5px;
    animation: fadeInOut 1.5s infinite alternate;
}

@keyframes fadeInOut {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

/* 适配深色模式 */
body.dark #temp-loading-msg {
    color: #aaa;
    background-color: rgba(255, 255, 255, 0.05);
}

/* 通知系统样式 */
.notification-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  max-width: 300px;
}

.notification {
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.3s, transform 0.3s, top 0.3s;
  position: relative;
  word-wrap: break-word;
  max-width: 100%;
  font-size: 14px;
  display: flex;
  align-items: center;
}

.notification.show {
  opacity: 1;
  transform: translateX(0);
}

.notification.fade-out {
  opacity: 0;
  transform: translateY(-10px);
}

/* 带加载图标的通知 */
.notification.with-spinner {
  padding-left: 16px; /* 减小左侧内边距，与普通通知一致 */
}

.notification .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s linear infinite;
  margin-right: 10px;
}

/* 深色模式下的通知样式 */
body.dark .notification {
  background-color: #1e1e1e; /* 改为不透明背景 */
  color: #f0f0f0;
  border: 1px solid rgba(80, 80, 80, 0.5); /* 添加边框 */
}

/* ========== 广告位 ========== */
#ad-banner-bottom {
  margin: 24px auto 12px;
  text-align: center;
  min-height: 50px;
}


/* Native Banner 穿插容器 */
.ad-native-wrap {
  margin: 12px 0;
  padding: 8px;
  border-radius: 8px;
  background: rgba(128,128,128,.06);
  overflow: hidden;
}
.ad-native-wrap > div[id^="container-"] { min-height: 120px; }

/* ========== 分享卡片 ========== */
/* 入口按钮 #share-card-btn 已收进弹层操作条（见上方 .meme-actions），旧 fixed 样式删除 */
.share-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 20000;
  overflow: auto;
  padding: 20px;
}
.share-overlay.show { display: flex; align-items: center; justify-content: center; }
.share-box {
  position: relative;
  max-width: 92vw;
  text-align: center;
}
.share-box canvas {
  max-width: 100%;
  max-height: 76vh;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
}
/* 展示用的导出图：移动端长按它弹出「存储图像」 */
.share-box .share-img {
  max-width: 100%;
  max-height: 76vh;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
  -webkit-touch-callout: default; /* 覆盖 body 的全局禁用，允许 iOS 长按保存 */
  -webkit-user-select: auto;
  user-select: auto;
}
.share-tip {
  color: rgba(255,255,255,.85);
  font-size: 13px;
  margin: 14px 0 10px;
}
.share-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
.share-btn {
  display: inline-block;
  background: var(--primary-grad);
  color: #fff;
  border: none;
  padding: 9px 26px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.22s var(--bounce-ease), filter 0.2s ease;
}
.share-btn:hover { filter: saturate(1.1) brightness(1.05); }
.share-btn:active { transform: scale(0.93); transition-duration: 0.08s; }
.share-close {
  background: rgba(255,255,255,.18);
  color: #fff;
  border: none;
  padding: 8px 26px;
  border-radius: 18px;
  font-size: 13px;
  cursor: pointer;
}
