.site-audio {
  display: none;
}

.audio-toggle {
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  position: fixed;
  top: 15px;
  right: 25px;
  z-index: 45;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  color: var(--audio-control-color, var(--ink, #1f1e1a));
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  transition: opacity 300ms ease, filter 300ms ease;
}

html.has-resource-card-focus .audio-toggle {
  pointer-events: none;
  opacity: 0.18;
  filter: blur(2px);
}

.audio-toggle svg {
  width: 38px;
  height: 18px;
  overflow: visible;
  opacity: 0.52;
  transition: opacity 200ms ease;
}

.audio-toggle .audio-wave {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.audio-toggle.is-playing svg {
  opacity: 0.9;
}

.audio-toggle:hover svg,
.audio-toggle:focus-visible svg,
.audio-toggle.is-pressed svg {
  opacity: 1;
}

.audio-toggle:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: -4px;
}

/* 首页的声音标识跟随文字系统显影，并比正文晚 0.9 秒起势。 */
.audio-toggle.reveal {
  opacity: 0;
  filter: blur(6px);
  transition: opacity 2800ms linear 900ms, filter 2800ms ease 900ms, color 300ms ease;
}

.audio-toggle.reveal.is-on {
  opacity: 1;
  filter: blur(0);
}

body:has(.landing.is-dark) .audio-toggle {
  --audio-control-color: #eceeed;
}

@media (prefers-reduced-motion: reduce) {
  .audio-toggle svg {
    transition: none;
  }

  .audio-toggle.reveal,
  .audio-toggle.reveal.is-on {
    filter: none;
    transition: none;
  }
}

@media (max-width: 720px) {
  .audio-toggle {
    top: max(10px, env(safe-area-inset-top));
    right: 10px;
    width: 40px;
    height: 40px;
  }

  .audio-toggle svg {
    width: 34px;
    height: 17px;
  }
}
