/* 章节配乐只向访客提供播放/暂停和音量，不展示或切换内部曲目。 */
.music-control .music-picker,
.music-control [data-audio-source],
.music-control .track-picker,
.music-control .track-switch,
.music-control .track-title,
.music-control .music-description {
  display: none !important;
}

.music-control {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.earth-sound-start {
  position: fixed;
  z-index: 18;
  left: 50%;
  bottom: clamp(5.8rem, 10vh, 8rem);
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.72rem 1.05rem;
  border: 1px solid rgb(247 223 170 / 0.35);
  border-radius: 999px;
  background: rgb(13 20 36 / 0.62);
  box-shadow: 0 0.8rem 2.5rem rgb(4 8 18 / 0.28);
  color: #f7e8ca;
  font: inherit;
  letter-spacing: 0.08em;
  cursor: pointer;
  transform: translateX(-50%);
  backdrop-filter: blur(16px);
  animation: earth-sound-breathe 2.8s ease-in-out infinite;
}

.earth-sound-start[hidden],
body:not([data-portal="earth"]) .earth-sound-start {
  display: none;
}

.earth-sound-start:focus-visible {
  outline: 2px solid #f4c777;
  outline-offset: 0.3rem;
}

@keyframes earth-sound-breathe {
  0%, 100% { box-shadow: 0 0.8rem 2.5rem rgb(4 8 18 / 0.28); }
  50% { box-shadow: 0 0.8rem 2.8rem rgb(239 189 100 / 0.22); }
}

.volume-control {
  --volume-level: 58%;
  display: inline-flex;
  min-width: 7.4rem;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid rgb(239 230 211 / 0.2);
  border-radius: 999px;
  background: rgb(14 20 35 / 0.42);
  color: rgb(239 230 211 / 0.78);
  backdrop-filter: blur(14px);
}

.volume-control__icon {
  display: inline-grid;
  width: 1rem;
  flex: 0 0 1rem;
  place-items: center;
  font-size: 0.9rem;
  line-height: 1;
}

.volume-control__device-note {
  display: none;
  white-space: nowrap;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.volume-control.is-device-volume .volume-control__icon,
.volume-control.is-device-volume input {
  display: none;
}

.volume-control.is-device-volume .volume-control__device-note {
  display: inline;
}

#volume-control {
  width: 5rem;
  height: 1.25rem;
  margin: 0;
  padding: 0;
  accent-color: #efbd64;
  cursor: pointer;
}

#volume-control::-webkit-slider-runnable-track {
  height: 0.24rem;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #efbd64 0 var(--volume-level),
    rgb(239 230 211 / 0.2) var(--volume-level) 100%
  );
}

#volume-control::-webkit-slider-thumb {
  width: 0.9rem;
  height: 0.9rem;
  margin-top: -0.33rem;
  border: 2px solid #161d30;
  border-radius: 50%;
  background: #f7dfaa;
  box-shadow: 0 0 0 0.18rem rgb(239 189 100 / 0.12);
  appearance: none;
}

#volume-control::-moz-range-track {
  height: 0.24rem;
  border: 0;
  border-radius: 999px;
  background: rgb(239 230 211 / 0.2);
}

#volume-control::-moz-range-progress {
  height: 0.24rem;
  border-radius: 999px;
  background: #efbd64;
}

#volume-control::-moz-range-thumb {
  width: 0.9rem;
  height: 0.9rem;
  border: 2px solid #161d30;
  border-radius: 50%;
  background: #f7dfaa;
  box-shadow: 0 0 0 0.18rem rgb(239 189 100 / 0.12);
}

#volume-control:focus-visible {
  outline: 2px solid #f4c777;
  outline-offset: 0.35rem;
}

@media (max-width: 720px) {
  .music-control {
    gap: 0.35rem;
  }

  .volume-control {
    min-width: 5.4rem;
    padding-inline: 0.55rem;
  }

  #volume-control {
    width: 3.4rem;
  }

  .earth-sound-start {
    bottom: 5.4rem;
    max-width: calc(100vw - 2rem);
    font-size: 0.88rem;
    white-space: nowrap;
  }
}

@media (max-width: 420px) {
  .volume-control__icon {
    display: none;
  }

  .volume-control {
    min-width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .earth-sound-start,
  #volume-control,
  #volume-control::-webkit-slider-thumb {
    transition: none;
  }
}
