/* 分享落地页。别人认识 SongBuds 的第一眼，所以不做成"能用就行"的样子。
   视觉基准是 App 内的全屏播放页（.fplayer）：大封面卡、渐变叠层标题、
   固定高度的歌词窗——这一页在那个配方上改，不是另起一套。 */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: #0b0908;
  color: var(--text, #ece5dc);
  font-family: var(--font-body, "PingFang SC", "Microsoft YaHei", sans-serif);
  -webkit-font-smoothing: antialiased;
}

/* 去掉移动浏览器点击时显示的矩形热区；键盘用户仍保留单独的焦点提示。 */
.sp :where(button, a, [role="slider"], .sp__lyrics span) {
  -webkit-tap-highlight-color: transparent;
}
body.is-pointer-input .sp :where(button, a, [role="slider"], .sp__lyrics span):focus {
  outline: none !important;
}
.sp :where(button, a, [role="slider"], .sp__lyrics span):focus-visible {
  outline: 2px solid rgba(255, 170, 84, 0.82);
  outline-offset: 2px;
}

.sp__loading {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0;
  margin: 0;
  padding: 24px;
  text-align: center;
  color: rgba(236, 229, 220, 0.4);
  font-size: 14px;
}
/* 链接失效不是"报个错"，而是一次挽留：给形、给话、给出路 */
.sp__loading.is-error { gap: 14px; }
.sp__loading-art {
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: radial-gradient(circle at 50% 38%, rgba(255, 122, 26, 0.14), transparent 68%);
  color: rgba(255, 180, 84, 0.45);
  font-size: 38px;
}
.sp__loading strong { color: var(--text, #ece5dc); font-size: 18px; font-weight: 500; }
.sp__loading p { margin: 0 0 8px; font-size: 13px; }

/* 一屏装完，不滚动。和 .fplayer 一样：封面、播放条、歌词、去处
   四段都是定高的，不靠某一段弹性伸缩去凑——数字是量出来的（见下面各段）。
   100vh 兜住不支持 dvh 的老内核，100dvh 随后覆盖：WeChat 地址栏收起/展开
   高度会变，dvh 才是那一刻真实可见的高度。 */
.sp {
  position: relative;
  height: 100vh;
  height: var(--app-viewport-height, 100dvh);
  display: flex;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) 20px calc(14px + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
}

/* 封面的颜色渗到整页背景 —— 每首歌打开都是不同的气氛 */
/* --song-tint 由脚本按封面主色写入；没写入时退回品牌橙 */
:root { --song-tint: 255, 122, 26; }
.sp__glow {
  position: fixed;
  inset: -20%;
  z-index: 0;
  background:
    radial-gradient(58% 42% at 50% 28%, rgba(var(--song-tint), 0.4), transparent 68%),
    radial-gradient(70% 50% at 82% 96%, rgba(255, 122, 26, 0.14), transparent 70%);
  filter: blur(46px);
  transition: background 0.8s ease;
  pointer-events: none;
}
/* 取到色之后，页面顶部再压一层同色，让"这首歌的颜色"落到整页而不只是一团光 */
body.has-tint {
  background:
    linear-gradient(180deg, rgba(var(--song-tint), 0.22), transparent 42%),
    #0b0908;
}

.sp__col {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: sp-rise 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes sp-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* ---- 由谁做的：这次不是压在封面渐变里的一行小字 ----
   "介绍是谁写的"和"去处"合成一个胶囊，摆在最前面——比塞进封面叠层
   当装饰更明显，点一下也能直接去创作页，一个元素两件事。 */
.sp__badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 180, 84, 0.28);
  background: rgba(255, 122, 26, 0.14);
  color: rgba(255, 202, 145, 0.95);
  font-family: var(--font-display, "Space Grotesk", sans-serif);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background-color 160ms ease, transform 160ms ease;
}
.sp__badge:active { transform: scale(0.97); background: rgba(255, 122, 26, 0.22); }
.sp__badge svg { width: 13px; height: 13px; flex: 0 0 13px; opacity: 0.85; }

/* ---- 封面即"海报"：和 .fplayer__card 同一个配方 ----
   大图 + 底部渐变 + 叠在渐变上的品牌小标/曲名/副标题。
   宽高比不是正方形（1/0.95）——和 App 播放页的 1/.91 一个量级，
   刻意留一点横向的"海报感"，比正方形更像一张唱片封面。 */
.sp__cover {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 1 / 0.95;
  display: grid;
  place-items: center;
  border-radius: var(--r-sheet, 24px);
  overflow: hidden;
  background:
    radial-gradient(circle at 74% 20%, rgba(255, 180, 84, 0.28), transparent 52%),
    linear-gradient(150deg, #2a1c12, #100c09);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.5);
}
.sp__cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.sp__cover-fallback { position: relative; z-index: 0; font-size: 56px; color: rgba(255, 180, 84, 0.4); }
/* 播放时封面轻微起伏，像在呼吸 */
.sp.is-playing .sp__cover { animation: sp-breathe 4s ease-in-out infinite; }
@keyframes sp-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.012); }
}
/* 底部渐变：不是叠一层色块，是让文字在任何封面上都读得清——
   和 .fplayer__card::before 同一个写法。 */
.sp__cover::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 5, 7, 0.1) 30%, rgba(5, 5, 7, 0.2) 52%, rgba(5, 5, 7, 0.94) 100%);
}
.sp__info {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 154px;
  bottom: 0;
  padding: 64px 22px 20px;
}
.sp__info h1 {
  margin: 0;
  color: #fff;
  font-family: var(--font-display, "Space Grotesk", sans-serif);
  font-size: clamp(21px, 6vw, 25px);
  font-weight: 650;
  line-height: 1.28;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.72);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sp__info p {
  margin: 6px 0 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12.5px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ---- 收藏 + 分享：和播放页 .fpacts/.fpact 同一个配方 ----
   心形不挑粉/红——这一页也只用品牌橙一种强调色，多一种颜色就多一个焦点，
   跟 comments.css 里 .fpact 那条老规矩一样。分享是纯数字展示，
   不是新的动作入口：这一页本身已经是分享的结果。 */
/* 收藏/留言/分享这一排、留言弹层的全部内容，都是 comments.css 里的
   .fpacts/.fpact/.cmt*，微信转发引导是 sheet.css 里的 .wxguide
   ——都和 App 内同一份样式，这里不重复定义。 */
.fpacts--share {
  position: absolute;
  z-index: 3;
  right: 16px;
  bottom: 16px;
  width: auto;
  min-height: 44px;
  margin: 0;
  justify-content: flex-end;
  gap: 2px;
  padding: 2px 5px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  background: rgba(9, 8, 7, 0.64);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.fpacts--share .fpact {
  min-width: 44px;
  min-height: 44px;
  padding-inline: 6px;
  justify-content: center;
}
.fpacts--share .fpact svg { width: 19px; height: 19px; }
.fpacts--share .fpact em { font-size: 11.5px; }

/* 轻量提示，仅这一页用——App 内 toast() 挂在 .phone__screen 下面，
   这一页没有那个容器，样式各写各的（见 sharepage.js 的 toast()）。 */
.sp__toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 70;
  max-width: calc(100% - 40px);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(20, 16, 12, 0.92);
  color: var(--text, #ece5dc);
  font-size: 13px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 200ms ease, transform 200ms ease;
}
.sp__toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---- 播放条：结构与分享编辑页、音乐墙共用，页面只管位置 ---- */
.sp__transport {
  flex: 0 0 auto;
  width: 100%;
  --shareplayer-accent: var(--accent);
}

.sp__description {
  flex: 0 0 auto;
  display: -webkit-box;
  overflow: hidden;
  margin: 1px 12px 0;
  color: rgba(236, 229, 220, .62);
  font-size: 11.5px;
  line-height: 1.5;
  text-align: center;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.sp__description:empty { display: none; }

/* ---- 歌词：够看见来路和去处，不是把整首词摊开 ----
   和 .fplayer__lyrics 同一个分寸——那边的原话："最早是 flex:1 吃掉全部
   剩余高度，一屏铺了九句，那不是在帮人跟着唱，是把整首词摊在那里"。
   这里定高不用 flex:1，理由一样：这一页的主角是"我也要写一首"，
   歌词是引子，多铺三行不会让人更想听，只会把 CTA 挤到眼睛之外。 */
.sp__lyrics {
  flex: 0 0 auto;
  height: 166px;
  min-height: 0;
  /* 播放器与主 CTA 之间的剩余高度由歌词窗上下平分。
     之前全部被 footer 的 margin-top:auto 吃在歌词下方，视觉上就像
     歌词粘着播放器；保持歌词定高，只调整它在两者之间的位置。 */
  margin-block: auto;
  padding: 9px 12px;
  overflow: hidden;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
  color: rgba(236, 229, 220, 0.32);
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  /* 上下渐隐：告诉眼睛"这里还有"，比滚动条礼貌 */
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 12%, #000 88%, transparent);
}
.sp__lyrics.has-timed-lyrics {
  overflow-y: auto;
  justify-content: flex-start;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
}
.sp__lyrics.has-timed-lyrics::before,
.sp__lyrics.has-timed-lyrics::after {
  content: "";
  flex: 0 0 calc(50% - .8em);
  pointer-events: none;
}
.sp__lyrics span {
  flex: 0 0 auto;
  display: block;
  width: min(100%, 320px);
  margin-inline: auto;
  padding: 0;
  text-align: center;
  overflow-wrap: anywhere;
  color: rgba(236, 229, 220, 0.32);
  cursor: pointer;
  border-radius: 6px;
  outline: none;
  transition: color 240ms ease, font-size 240ms ease, opacity 240ms ease;
}
.sp__lyrics span.is-sung { color: rgba(236, 229, 220, 0.62); }
.sp__lyrics span.is-active {
  color: #f4efe9;
  font-size: 16px;
  font-weight: 500;
  text-shadow: none;
}
.sp__lyrics pre {
  margin: 0;
  width: min(100%, 340px);
  margin-inline: auto;
  text-align: center;
  font: inherit;
  scrollbar-width: none;
}
.sp__lyrics::-webkit-scrollbar { display: none; }

/* ---- 去处：这一页真正的目的地，不是页脚 ----
   没有歌词时 .sp__lyrics 整个 hidden，margin-top:auto 把这一块
   顶到屏幕最底下——歌词在的时候它已经被前面几段定高的内容自然
   推到了合适的位置，这条规则不生效也没关系。 */
.sp__foot {
  flex: 0 0 auto;
  margin-top: auto;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
/* 有歌词时，歌词自己的上下 auto margin 负责居中；没有歌词时继续由
   footer 的 auto margin 把主 CTA 推到底部。 */
.sp__lyrics:not([hidden]) ~ .sp__foot { margin-top: 0; }
/* 和首页「开始创作」同一个按钮配方：渐变、68px、标题+副标题+箭头。
   这一页除了"听" —— 唯一的动作就是"我也要自己写一首"，
   给它 App 里最重的那个按钮样式，而不是和"逛逛广场"平分秋色的小胶囊。 */
.sp__cta {
  width: 100%;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 20px 14px 24px;
  border-radius: var(--r-card-lg, var(--r-xl, 21px));
  background: var(--grad-brand, linear-gradient(135deg, #ff9a3c, var(--accent)));
  box-shadow: var(--sh-brand, 0 12px 30px rgba(255, 122, 26, 0.32));
  color: var(--on-brand, #1a0f05);
  text-decoration: none;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}
.sp__cta:active { transform: scale(0.97); }
.sp__cta-copy { display: flex; flex-direction: column; gap: 3px; text-align: left; }
.sp__cta-copy strong { font-size: 16.5px; font-weight: 700; line-height: 1.3; }
.sp__cta-copy small { font-size: 12px; line-height: 1.35; opacity: 0.76; }
.sp__cta svg { width: 20px; height: 20px; flex: 0 0 20px; }

.sp__ghost {
  color: rgba(236, 229, 220, 0.5);
  font-size: 12.5px;
  text-decoration: none;
  text-underline-offset: 3px;
}
.sp__ghost:active { color: rgba(236, 229, 220, 0.72); }

/* 手机浏览器顶部地址栏、底部工具栏会吃掉 60–120px 可用高度。
   以前仍按 393×852 的定高配方排版，结果封面很好看，但 CTA 被裁在屏幕外，
   而整页又禁止滚动。这里不改变信息顺序，只在真实可用高度不足时收紧各段：
   封面和歌词按 dvh 缩放，触控按钮仍不小于 44px。 */
@media (max-width: 767px) and (max-height: 899px) {
  .sp {
    padding: max(10px, env(safe-area-inset-top, 0px)) 16px
      calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .sp__col { gap: 8px; }
  .sp__badge {
    padding: 6px 9px 6px 11px;
    font-size: 11px;
  }
  .sp__cover {
    height: clamp(260px, 39dvh, 330px);
    aspect-ratio: auto;
  }
  .sp__info { padding: 52px 18px 16px; }
  .sp__info { right: 142px; }
  .fpacts--share { right: 12px; bottom: 12px; }
  .sp__lyrics {
    height: clamp(140px, 19dvh, 166px);
    padding-block: 8px;
    gap: 8px;
    line-height: 1.55;
  }
  .sp__description { margin-top: 0; font-size: 10.5px; line-height: 1.4; }
  .sp__foot { gap: 6px; }
  .sp__cta {
    min-height: 60px;
    padding: 10px 16px 10px 20px;
  }
  .sp__cta-copy strong { font-size: 15.5px; }
  .sp__cta-copy small { font-size: 11.5px; }
}

/* 公开链接在手机/微信里仍然是全屏页面；桌面打开时加一个 393×852 的预览壳，
   否则内容会随着浏览器无限放大，用户看不到真实手机效果。 */
@media (min-width: 768px) and (min-height: 900px) {
  html, body { overflow: hidden; }
  body {
    min-height: 100%;
    display: grid;
    place-items: center;
    background:
      radial-gradient(560px 520px at 50% 46%, rgba(var(--song-tint), 0.18), transparent 72%),
      #0b0908;
  }
  body.has-tint {
    background:
      radial-gradient(560px 520px at 50% 46%, rgba(var(--song-tint), 0.22), transparent 72%),
      #0b0908;
  }
  body::before {
    content: "";
    position: fixed;
    z-index: 0;
    left: 50%;
    top: 50%;
    width: 421px;
    height: 880px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 58px;
    background: linear-gradient(145deg, #353236, #171518 38%, #080708 78%);
    box-shadow:
      0 34px 90px rgba(0, 0, 0, 0.7),
      0 0 46px rgba(var(--song-tint), 0.12),
      inset 0 1px 1px rgba(255, 255, 255, 0.28),
      inset 0 -1px 0 rgba(255, 122, 26, 0.14);
    transform: translate(-50%, -50%);
    pointer-events: none;
  }
  .sp {
    z-index: 1;
    flex: none;
    width: 393px;
    height: 852px;
    border-radius: 44px;
    background: #0b0908;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  }
  /* 桌面壳里不能继续用 -20% 的 fixed 光晕：它会制造一个不可见的滚动区，
     按播放键获得焦点时浏览器会偷偷把整页向下滚，顶部作者胶囊随之消失。 */
  .sp__glow { position: absolute; inset: 0; filter: blur(38px); }
  .sp__loading {
    inset: 50% auto auto 50%;
    z-index: 1;
    width: 393px;
    height: 852px;
    border-radius: 44px;
    background: #0b0908;
    transform: translate(-50%, -50%);
  }
}

/* 极矮的视口（分屏、横屏、极老机型）：这一页已经是按定高数字排的，
   再矮就真的装不下了——退回可以整页滚动，好过内容被切掉看不见。
   700px 大致是"iPhone SE 竖屏 - 系统安全区"那个量级
   （比之前 660 略高：封面不再靠 flex 收缩，需要多一点余量才撑得住）。 */
@media (max-height: 700px) {
  .sp { height: auto; min-height: 100vh; min-height: var(--app-viewport-height, 100dvh); overflow-y: auto; }
}

/* SHARE-003：播放键与进度条同排。playback-system.css 在本文件后加载，
   因此这里用分享页结构作用域覆盖它的旧绝对坐标，不改动其它播放器。 */
.sp > .sp__col > .sp__transport {
  position: absolute;
  z-index: 4;
  top: 625px;
  left: 22px;
  width: calc(100% - 44px);
  height: 45px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.sp .sp__transport-play {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #1a0f05;
  background: var(--playback-orange);
}
.sp .sp__transport-play:active:not(:disabled) { transform: scale(.92); }
.sp .sp__transport-play:disabled { cursor: wait; }
.sp .sp__transport-play svg { width: 20px; height: 20px; stroke-width: 2; }
.sp .sp__transport-play[data-icon="play"] svg { fill: currentColor; stroke: none; }
.sp .sp__transport-play[data-icon="loader"] svg { animation: sp-play-loader 900ms linear infinite; }
.sp > .sp__col > .sp__transport > .sp__timeline {
  position: relative;
  width: 100%;
  height: 45px;
}
.sp > .sp__col > .sp__transport .sp__progress {
  top: 21px;
  left: 0;
  width: 100%;
}
.sp > .sp__col > .sp__transport .sp__times {
  top: 33px;
  left: 0;
  width: 100%;
}

@keyframes sp-play-loader { to { transform: rotate(360deg); } }

/* 绝对定位内容的底边在 786px；共享样式的 700px 内层滚动会在极短屏形成
   双滚动容器。短屏只让文档滚动，并移除会压到 CTA 底边的装饰横条。 */
@media (max-height: 760px) {
  html, body { height: auto; min-height: 100%; }
  html { scrollbar-width: none; }
  html::-webkit-scrollbar { display: none; }
  html body .sp.kaki-standalone-page {
    height: 786px;
    min-height: 786px;
    overflow: visible;
  }
  body .sp.kaki-standalone-page::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sp .sp__transport-play[data-icon="loader"] svg { animation: none; }
}
