/* 全站背景音乐：本地音频，无第三方播放器 */
.site-bgm {
  position: fixed;
  z-index: 110;
  left: max(14px, env(safe-area-inset-left));
  bottom: max(14px, env(safe-area-inset-bottom));
  pointer-events: none;
}
.site-bgm--home { bottom: max(14px, env(safe-area-inset-bottom)); }
.site-bgm-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: min(300px, calc(100vw - 28px));
  height: 46px;
  padding: 0 13px 0 8px;
  border: 1px solid rgba(196, 176, 154, .86);
  border-radius: 999px;
  background: rgba(255, 250, 241, .92);
  color: var(--ink, #332a24);
  box-shadow: 0 10px 30px rgba(66, 48, 30, .16);
  backdrop-filter: blur(12px);
  cursor: pointer;
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.site-bgm-btn:hover {
  border-color: rgba(168, 68, 50, .42);
  box-shadow: 0 12px 32px rgba(66, 48, 30, .2);
}
.site-bgm-btn:active { transform: scale(.97); }
.site-bgm-note {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--cinnabar, #a84432);
  color: #fff8ee;
  font-family: var(--serif, Georgia, serif);
  font-size: 15px;
  line-height: 1;
}
.site-bgm-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.site-bgm-copy b {
  font-size: 10px;
  letter-spacing: .12em;
  line-height: 1.2;
  font-weight: 600;
}
.site-bgm-copy small {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted, #8a7c6d);
  font-size: 9px;
  line-height: 1.25;
}
.site-bgm-icon {
  flex: 0 0 auto;
  width: 18px;
  color: var(--cinnabar, #a84432);
  font-size: 12px;
  text-align: center;
}
.site-bgm.is-playing .site-bgm-note {
  animation: siteBgmPulse 1.9s ease-in-out infinite;
}
.site-bgm.is-playing .site-bgm-icon { font-size: 14px; letter-spacing: 1px; }
@keyframes siteBgmPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(168, 68, 50, .25); }
  50% { box-shadow: 0 0 0 7px rgba(168, 68, 50, 0); }
}
@media (max-width: 700px) {
  .site-bgm:not(.site-bgm--home) {
    bottom: max(86px, calc(env(safe-area-inset-bottom) + 76px));
  }
}
@media (max-width: 520px) {
  .site-bgm { left: max(10px, env(safe-area-inset-left)); }
  .site-bgm-btn { width: 46px; height: 46px; padding: 0; justify-content: center; gap: 0; }
  .site-bgm-copy { display: none; }
  .site-bgm-icon { display: none; }
}

body.auth-mode .site-bgm{display:none!important}
