/* ==========================================================================
   花浆妤露 · 背景音乐控件（电脑版 / 手机竖版共用，左下角圆形「音」钮）
   --------------------------------------------------------------------------
   - 米纸底 + 细墨框 + 朱红「音」字，宋式印章意象
   - 播放中：外圈虚线环缓慢旋转（水纹）；未播放：一道朱红斜线（静音记号）
   - 位置避开右下角「手机版」书签入口（PC）与右缘圆点导航（竖版）
   - z-index 88：高于页面内容与入口书签，低于竖版菜单面板(90)/顶栏(95)
   ========================================================================== */
.hj-bgm {
  position: fixed;
  left: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 88;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(122, 96, 66, 0.55);
  border-radius: 50%;
  background: rgba(240, 233, 218, 0.88);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 16px rgba(60, 44, 26, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #8a3a2a;
  font-family: "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.hj-bgm:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(60, 44, 26, 0.26);
}

.hj-bgm:active { transform: scale(0.94); }

.hj-bgm:focus-visible { outline: 2px solid #963c2c; outline-offset: 3px; }

.hj-bgm-word {
  font-size: 17px;
  line-height: 1;
  transform: translateY(-1px);
  pointer-events: none;
}

/* 播放中：外圈虚线环缓慢旋转 */
.hj-bgm::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px dashed rgba(138, 58, 42, 0.6);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.hj-bgm.is-playing::before {
  opacity: 1;
  animation: hjBgmSpin 16s linear infinite;
}

@keyframes hjBgmSpin { to { transform: rotate(360deg); } }

/* 未播放：一道朱红斜线（静音记号） */
.hj-bgm::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 50%;
  height: 1px;
  margin-top: -0.5px;
  background: rgba(138, 58, 42, 0.8);
  transform: rotate(-45deg);
  opacity: 0.9;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.hj-bgm.is-playing::after { opacity: 0; }

/* 小屏（手机竖版）稍收紧 */
@media (max-width: 820px) {
  .hj-bgm {
    left: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: 42px;
    height: 42px;
  }
  .hj-bgm-word { font-size: 15px; }
}

/* 减动效偏好：环不转，仅保留状态变化 */
@media (prefers-reduced-motion: reduce) {
  .hj-bgm.is-playing::before { animation: none; }
  .hj-bgm { transition: none; }
}
