/* ============================================================
   星海音乐 Web · share.css（v6.21 · 从 style.css 结构化拆分）
   内容：分享弹窗 / 落地卡片
   ⚠ 级联顺序即加载顺序（app.html 按本文件在链中的位置引入），
     调整 @media / 覆盖关系时请保持文件间相对顺序不变。
   ============================================================ */

/* ============================================================
   【v6.17】分享歌曲：弹窗 / 落地卡片
   ============================================================ */
.share-row { display: flex; align-items: center; gap: 10px; margin: 4px 0 2px; }
.share-url {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--sub);
  font-size: 12.5px;
  outline: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.share-copy { flex: none; height: 40px; }
.share-card {
  text-align: center;
  width: min(380px, 100%);
  /* 【v6.18】卡片永不超出弹窗容器：极端矮窗口下卡片内部滚动，
     按钮永远可达（旧版竖排卡片高 ~440px，横屏手机可用高 ~300px 时
     「立即播放」被裁剪到视口外 —— 点击落在窗口外 → “识别出来但
     播放不了”） */
  max-height: 100%;
  overflow-y: auto;
}
.share-tag { font-size: 12.5px; color: var(--accent-2); letter-spacing: 2px; margin-bottom: 14px; font-weight: 600; }
.sl-cover-box {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}
#slCover { width: 100%; height: 100%; object-fit: cover; display: none; }
.sl-cover-box.has #slCover { display: block; }
.sl-cover-box.has .sl-cover-fallback { display: none; }
.sl-cover-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: #3d4a68; }
.sl-cover-fallback .icon { width: 54px; height: 54px; }
.sl-name {
  font-size: 20px;
  font-weight: 700;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.sl-singer { margin-top: 6px; font-size: 13px; color: var(--sub); }
.sl-play {
  width: 100%;
  height: 46px;
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
}
.sl-skip { margin-top: 10px; }

/* 【v6.18】矮屏（横屏手机等）落地卡片紧凑布局：封面缩至 112px 与
   歌名/歌手并排（grid 两列），按钮全宽置底 —— 总高约 280px，
   300px 可用高度的横屏也能一屏完整放下，不再裁剪按钮 */
@media (max-height: 560px) {
  .share-card {
    display: grid;
    grid-template-columns: 112px 1fr;
    grid-template-areas:
      "tag tag"
      "cover name"
      "cover singer"
      "play play"
      "skip skip";
    column-gap: 16px;
    row-gap: 6px;
    align-items: center;
  }
  .share-tag { margin-bottom: 0; }
  .sl-cover-box { width: 112px; height: 112px; margin: 0; border-radius: 14px; }
  .sl-cover-fallback .icon { width: 40px; height: 40px; }
  .sl-name { text-align: left; font-size: 17px; }
  .sl-singer { text-align: left; margin-top: 0; }
  .sl-play { margin-top: 8px; }
  .sl-skip { margin-top: 0; }
}



/* ============================================================
   【v6.31 阶段二】系统分享按钮（Web Share API）
   ============================================================ */
.share-native {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  min-height: 42px;
}
.share-native.hidden { display: none; }


/* ============================================================
   【v6.31 阶段四】分享海报弹窗与预览
   ============================================================ */
.poster-card { width: min(360px, 100%); }
.poster-preview-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
}
.poster-preview-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
}
.poster-preview-wrap.generating::after {
  content: "海报绘制中…";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 14, 26, 0.82);
  color: var(--sub);
  font-size: 13px;
  letter-spacing: 1px;
}
.poster-actions { margin-top: 14px; }
.poster-actions .btn-primary { width: 100%; min-height: 42px; }
