/* ============================================================
   Oattn melody · 共享底部播放器样式
   依赖 CSS 变量：--bg / --bg-soft / --ink / --ink-soft / --ink-mute
                  --sage / --sage-deep / --sand / --line / --serif
   每个页面已经在 :root 里定义了它们。
   ============================================================ */

body { padding-bottom: 110px; }

.player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(140%) blur(20px);
  -webkit-backdrop-filter: saturate(140%) blur(20px);
  border-top: 1px solid var(--line);
  padding: 14px 24px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  box-shadow: 0 -8px 28px rgba(44, 53, 49, 0.06);
}

/* 闲置态：按钮淡化、不可交互 */
.player.idle .player-btn,
.player.idle #playerDl {
  opacity: 0.45;
  pointer-events: none;
}
.player.idle .progress-bar { pointer-events: none; opacity: 0.6; }
.player.idle .player-cover { background: var(--bg-soft, #ece6d6); }

.player-inner {
  /* 与首页内容容器同宽（max-width 1200px），让封面左缘与上方曲目卡片左缘对齐 */
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  /* 左：紧凑 track 信息 · 中：控件 + 进度条 · 右：音量 + 下载 */
  grid-template-columns: minmax(140px, 200px) 1fr auto;
  align-items: center;
  gap: 18px;
}

.player-track {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.player-cover {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.player-cover svg { width: 50%; height: 50%; opacity: 0.9; }
.player-cover .cover-placeholder {
  width: 78%;
  height: 78%;
  object-fit: contain;
  opacity: 0.95;
}
.player-cover.has-image svg,
.player-cover.has-image .cover-placeholder { display: none; }

.player-text { min-width: 0; }
.player-title {
  font-family: var(--serif, "Cormorant Garamond", "Noto Serif SC", serif);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink, #2c3531);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-cat {
  font-size: 12px;
  color: var(--ink-mute, #8a9189);
  letter-spacing: 0.05em;
}

.player-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.player-buttons {
  display: flex;
  align-items: center;
  gap: 14px;
}
.player-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--ink-soft, #5a6760);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}
.player-btn:hover { color: var(--ink, #2c3531); }
.player-btn svg { width: 18px; height: 18px; }
.player-btn-main {
  background: var(--ink, #2c3531);
  color: #fff;
  width: 44px;
  height: 44px;
}
.player-btn-main:hover { background: var(--sage-deep, #4a6553); color: #fff; }

.player-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  /* 进度条收回到当前布满宽度的约 1/3，居中在中间列里 */
  max-width: clamp(280px, 32vw, 520px);
  font-size: 11px;
  color: var(--ink-mute, #8a9189);
  font-variant-numeric: tabular-nums;
}
.player-controls {
  width: 100%;
}
.progress-bar {
  flex: 1;
  height: 4px;
  background: var(--line, #e3dcc9);
  border-radius: 2px;
  cursor: pointer;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--sage, #6b8772);
  width: 0%;
  border-radius: 2px;
  transition: width 0.1s linear;
}

.player-extra {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}
.volume-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-mute, #8a9189);
}
.volume-wrap svg { width: 16px; height: 16px; }
.volume-slider {
  width: 80px;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  background: var(--line, #e3dcc9);
  border-radius: 2px;
  cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--ink, #2c3531);
  cursor: pointer;
}
.volume-slider::-moz-range-thumb {
  width: 12px; height: 12px;
  border: none;
  border-radius: 50%;
  background: var(--ink, #2c3531);
  cursor: pointer;
}

/* 下载按钮：胶囊形，图标 + "下载"文字 */
.player .btn-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--bg-soft, #ece6d6);
  color: var(--ink, #2c3531);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  white-space: nowrap;
}
.player .btn-download:hover {
  background: var(--sand-soft, #d9c4a3);
  color: var(--sage-deep, #4a6553);
  transform: translateY(-1px);
}
.player .btn-download span { display: inline; }
.player .btn-download svg { width: 14px; height: 14px; }

/* ============================================================
   付款弹窗（点击下载按钮触发）
   ============================================================ */
.sms-pay-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 25, 22, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.sms-pay-mask.show {
  display: flex;
  opacity: 1;
}
.sms-pay-modal {
  background: #fff;
  border-radius: 20px;
  padding: 32px 32px 28px;
  text-align: center;
  position: relative;
  max-width: 340px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0,0,0,0.30);
  font-family: var(--sans, "Inter", "PingFang SC", sans-serif);
  transform: translateY(12px) scale(0.96);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.sms-pay-mask.show .sms-pay-modal { transform: translateY(0) scale(1); }

.sms-pay-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #8a9189;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}
.sms-pay-close:hover { background: #f1eee5; color: #2c3531; }

.sms-pay-title {
  font-family: var(--serif, "Cormorant Garamond", "Noto Serif SC", serif);
  font-size: 22px;
  font-weight: 500;
  color: #2c3531;
  margin-bottom: 4px;
  letter-spacing: 0.06em;
}
.sms-pay-sub {
  font-size: 13px;
  color: #8a9189;
  margin-bottom: 22px;
  line-height: 1.5;
  word-break: break-all;
  padding: 0 8px;
}

.sms-pay-qr {
  width: 220px;
  height: 220px;
  margin: 0 auto 18px;
  padding: 12px;
  background: #fff;
  border: 1px solid #e3dcc9;
  border-radius: 12px;
  position: relative;
  box-shadow: 0 6px 20px rgba(74, 101, 83, 0.08);
}
.sms-pay-qr img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.sms-pay-qr::after {
  content: "";
  position: absolute;
  inset: -1px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: linear-gradient(135deg, #6b8772, #b8956a) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0.35;
  pointer-events: none;
}

.sms-pay-amount {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-bottom: 6px;
}
.sms-pay-currency {
  font-family: var(--serif, "Cormorant Garamond", serif);
  font-size: 20px;
  color: #5a6760;
  font-weight: 400;
}
.sms-pay-num {
  font-family: var(--serif, "Cormorant Garamond", serif);
  font-size: 38px;
  font-weight: 500;
  color: #2c3531;
  line-height: 1;
}

.sms-pay-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #8a9189;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  margin-top: 4px;
}
.sms-pay-hint svg {
  width: 14px; height: 14px;
  color: #07c160; /* 微信绿 */
}

.sms-pay-foot {
  margin-top: 18px;
  font-size: 11px;
  color: #b0a98e;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* 公益微提示:支付弹窗底部,谢意 + 透明 */
.sms-pay-charity {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(184, 149, 106, 0.35);
  border-radius: 10px;
  background: rgba(184, 149, 106, 0.08);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  font-size: 12px;
  color: #5a6760;
  line-height: 1.65;
  letter-spacing: 0.02em;
}
.sms-pay-charity svg {
  width: 14px;
  height: 14px;
  color: #b8956a;
  flex-shrink: 0;
  margin-top: 2px;
}
.sms-pay-charity strong {
  color: #2c3531;
  font-weight: 500;
}
.sms-pay-charity a {
  color: #4a6553;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.sms-pay-charity a:hover { color: #2c3531; }

@media (max-width: 880px) {
  .player { padding: 10px 14px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  body { padding-bottom: 130px; }
  .player-extra { display: none; }
  .player-inner {
    grid-template-columns: minmax(120px, 180px) 1fr auto;
    gap: 10px;
  }
  .player-progress { width: 100%; max-width: none; }
  .player-controls { align-items: stretch; gap: 6px; }
  .player-buttons { justify-content: flex-start; }
}
