.has-site-music { padding-bottom: calc(122px + env(safe-area-inset-bottom, 0px)); }
.site-music { position: fixed; right: 24px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 90; width: min(320px, calc(100vw - 32px)); padding: 12px; border: 1px solid #526477; border-radius: 18px; background: #132a42; color: #fffefa; box-shadow: 0 10px 32px #08192838; font: 14px/1.5 "Microsoft YaHei", sans-serif; }
.site-music[hidden], .site-music [hidden] { display: none !important; }
.music-summary { display: flex; align-items: center; gap: 12px; }
.site-music button, .gallery-music-toggle { min-height: 44px; cursor: pointer; font: inherit; }
.music-toggle { flex: 0 0 48px; height: 48px; border: 0; border-radius: 50%; background: #c73127; color: white; font-weight: 700 !important; }
.music-copy { flex: 1; min-width: 0; }
.music-copy strong { display: block; font-size: 16px; letter-spacing: .04em; }
.music-copy small { color: #b9d4e4; }
.music-expand { flex: 0 0 44px; background: transparent; border: 1px solid #6b8197; color: #f0b93c; border-radius: 10px; }
.music-expand[aria-expanded="true"] { transform: rotate(180deg); }
.music-status { margin: 8px 0 0; font-size: 12px; color: #e2eaf0; overflow-wrap: anywhere; }
.music-panel { padding-top: 12px; max-height: 50vh; overflow-y: auto; }
.music-panel label { display: block; margin-bottom: 12px; }
.music-panel output { float: right; color: #f0b93c; }
.music-panel input { display: block; width: 100%; height: 32px; accent-color: #f0b93c; cursor: pointer; }
.music-mute, .gallery-music-toggle { background: #203c56; color: #fffefa; border: 1px solid #7f98ae; border-radius: 8px; padding: 6px 14px; }
.gallery-music-toggle { margin-top: 8px; font-size: 13px; }
.site-music button:focus-visible, .site-music input:focus-visible, .gallery-music-toggle:focus-visible { outline: 3px solid #f0b93c; outline-offset: 3px; }
.music-bars { display: inline-flex; gap: 3px; align-items: center; height: 14px; margin-left: 6px; }
.music-bars i { display: block; width: 3px; height: 5px; background: #f0b93c; border-radius: 2px; }
.is-playing .music-bars i { animation: music-pulse .9s ease-in-out infinite alternate; }
.is-playing .music-bars i:nth-child(2) { animation-delay: -.3s; }
.is-playing .music-bars i:nth-child(3) { animation-delay: -.6s; }
@keyframes music-pulse { to { height: 14px; } }
@media (max-width: 720px) { .site-music { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: min(274px, calc(100vw - 24px)); padding: 10px; } .music-copy strong { font-size: 14px; } .music-summary { gap: 8px; } }
@media (prefers-reduced-motion: reduce) { .is-playing .music-bars i { animation: none; height: 10px; } }

/* Song keepsake: photograph, live lyric and a small smiling lantern. */
.has-site-music { padding-bottom: calc(162px + env(safe-area-inset-bottom, 0px)); }
.site-music { isolation: isolate; padding: 12px 14px; border-color: #819696; max-height: calc(100dvh - 100px); overflow: auto; background: linear-gradient(100deg, #092337ea, #102a43d9), url('works/gallery/71ec41bfb4a175b7.webp') center 62% / cover; }
.site-music.is-expanded { background: #102a43; }
.music-summary { gap: 10px; }
.music-toggle { flex-basis: 56px; height: auto; min-height: 90px; padding: 0; display: flex; flex-direction: column; align-items: center; background: transparent; border-radius: 12px; }
.music-lantern { display: block; width: 56px; height: 70px; overflow: visible; }
.music-button-label { color: #fff3d4; font-size: 12px; line-height: 20px; white-space: nowrap; }
.lantern-pause { display: none; }
.is-active .lantern-pause { display: initial; }
.is-active .lantern-play { display: none; }
.lantern-tassel { transform-origin: 32px 64px; }
.is-active .lantern-tassel { animation: lantern-sway 1.8s ease-in-out infinite alternate; }
.music-copy strong { font-size: 16px; }
.music-copy .music-lyric { display: block; color: #fff3d4; font-size: 13px; line-height: 1.6; min-height: 3.2em; margin-top: 5px; overflow-wrap: anywhere; }
.music-expand { flex-basis: 36px; min-width: 44px; }
.music-status { font-size: 12px; margin-top: 5px; color: #cfdee6; }
.music-photo { margin: 0 0 12px; }
.music-photo img { display: block; width: 100%; height: auto; border-radius: 10px; object-fit: contain; }
.music-photo figcaption { color: #c9d9df; font-size: 11px; margin-top: 5px; letter-spacing: .05em; }
.music-panel { max-height: none; overflow: visible; border-top: 1px solid #ffffff25; margin-top: 12px; }
.gallery-music-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px 3px 6px; }
.gallery-music-toggle .music-lantern { width: 32px; height: 40px; }
@keyframes lantern-sway { from { transform: rotate(-8deg); } to { transform: rotate(8deg); } }
@media (max-width: 720px) {
  .site-music { width: min(300px, calc(100vw - 24px)); padding: 10px 12px; }
  .music-copy strong { font-size: 14px; }
  .music-toggle { flex-basis: 48px; min-height: 82px; }
  .music-lantern { width: 48px; height: 60px; }
  .music-summary { gap: 8px; }
  .music-copy .music-lyric { font-size: 12px; }

  .site-music:not(.is-expanded) {
    width: 76px;
    max-height: none;
    padding: 5px;
    overflow: visible;
    border-color: rgba(240, 185, 60, 0.72);
    border-radius: 22px;
    background: rgba(9, 35, 55, 0.94);
    box-shadow: 0 10px 28px rgba(8, 25, 40, 0.28);
  }

  .site-music:not(.is-expanded) .music-summary {
    position: relative;
    display: block;
  }

  .site-music:not(.is-expanded) .music-copy,
  .site-music:not(.is-expanded) .music-status {
    display: none;
  }

  .site-music:not(.is-expanded) .music-toggle {
    width: 64px;
    min-height: 72px;
    margin: 0;
  }

  .site-music:not(.is-expanded) .music-lantern {
    width: 46px;
    height: 56px;
  }

  .site-music:not(.is-expanded) .music-button-label {
    font-size: 10px;
    line-height: 14px;
  }

  .site-music:not(.is-expanded) .music-expand {
    position: absolute;
    top: -9px;
    right: -9px;
    width: 28px;
    min-width: 28px;
    height: 28px;
    min-height: 28px;
    padding: 0;
    background: #132a42;
    border-color: rgba(240, 185, 60, 0.78);
    border-radius: 50%;
    font-size: 0.72rem;
    line-height: 1;
  }
}
@media (prefers-reduced-motion: reduce) { .is-active .lantern-tassel { animation: none; } }
