/*
 * 驭鬼者论坛 · 页脚运行时样式（R108 重建）
 * 运营公告弹窗、悬浮音乐球与音乐卡片。
 * 位置（right / bottom / z-index）由 script.js 的悬浮控件锁定逻辑写入，这里只负责外观与动效。
 */

/* ================= 运营公告 ================= */
.ygz-duanwu-notice {
  position: fixed;
  inset: 0;
  z-index: 15000; /* 高于论坛悬浮发帖按钮(14000)与音乐卡片(14020) */
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}
.ygz-duanwu-notice.is-visible { pointer-events: auto; }
.ygz-duanwu-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 0%, rgba(80, 10, 22, .35), transparent 60%), rgba(2, 2, 5, .66);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .32s ease;
}
.ygz-duanwu-notice.is-visible .ygz-duanwu-backdrop { opacity: 1; }
.ygz-duanwu-dialog {
  position: relative;
  width: min(440px, 100%);
  max-height: min(84vh, 720px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 20px 20px 16px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, .13);
  background:
    radial-gradient(110% 60% at 50% -10%, rgba(143, 20, 32, .22), transparent 62%),
    linear-gradient(160deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .015) 48%),
    rgba(14, 15, 21, .97);
  box-shadow: 0 36px 90px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .12);
  color: #f2f2f5;
  opacity: 0;
  transform: translate3d(0, 18px, 0) scale(.97);
  transition: opacity .3s ease, transform .5s cubic-bezier(.16, 1, .3, 1);
}
.ygz-duanwu-dialog:focus { outline: none; }
.ygz-duanwu-notice.is-visible .ygz-duanwu-dialog { opacity: 1; transform: none; }
.ygz-duanwu-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ygz-duanwu-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px; letter-spacing: .16em;
  color: #e9cf96;
  background: rgba(217, 180, 106, .1);
  border: 1px solid rgba(217, 180, 106, .26);
}
.ygz-duanwu-kicker::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #d6344a; box-shadow: 0 0 8px rgba(214, 52, 74, .9); }
.ygz-duanwu-x {
  height: 32px; padding: 0 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .05);
  color: rgba(255, 255, 255, .72);
  font-size: 13px;
  transition: background .2s ease, color .2s ease;
}
.ygz-duanwu-x:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.ygz-duanwu-title { margin: 6px 0 6px; font-size: 21px; line-height: 1.3; letter-spacing: .04em; }
.ygz-duanwu-desc { margin: 0 0 14px; color: rgba(255, 255, 255, .66); font-size: 14px; line-height: 1.7; }
.ygz-duanwu-list { display: grid; gap: 8px; }
.ygz-duanwu-item {
  padding: 11px 13px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .07);
}
.ygz-duanwu-section-title { margin: 0 0 4px; font-size: 12px; letter-spacing: .12em; color: rgba(255, 255, 255, .46); }
.ygz-duanwu-note { margin: 0; font-size: 14px; line-height: 1.65; color: rgba(255, 255, 255, .88); word-break: break-word; }
.ygz-duanwu-linkbox { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ygz-duanwu-linkbox span {
  font-family: var(--ygz-font-mono, ui-monospace, monospace);
  font-size: 15px; font-weight: 700; letter-spacing: .08em;
  color: #f3dfb0;
  word-break: break-all;
}
.ygz-duanwu-mini-btn {
  flex: 0 0 auto;
  height: 30px; padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(217, 180, 106, .35);
  background: rgba(217, 180, 106, .1);
  color: #f0d9a4;
  font-size: 12.5px; font-weight: 600;
  transition: background .2s ease, transform .18s cubic-bezier(.16, 1, .3, 1);
}
.ygz-duanwu-mini-btn:hover { background: rgba(217, 180, 106, .18); }
.ygz-duanwu-mini-btn:active { transform: scale(.96); }
.ygz-duanwu-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 16px; }
.ygz-duanwu-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 46px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .05);
  color: rgba(255, 255, 255, .86);
  font-size: 15px; font-weight: 650; letter-spacing: .04em;
  text-decoration: none;
  transition: background .2s ease, transform .18s cubic-bezier(.16, 1, .3, 1), border-color .2s ease;
}
.ygz-duanwu-btn:hover { background: rgba(255, 255, 255, .09); }
.ygz-duanwu-btn:active { transform: scale(.98); }
.ygz-duanwu-btn.primary { border-color: rgba(255, 255, 255, .2); background: linear-gradient(180deg, #f4f4f6, #d9d9df); color: #0c0c10; }
.ygz-duanwu-tip { margin: 12px 0 0; font-size: 11.5px; text-align: center; color: rgba(255, 255, 255, .36); }
.ygz-duanwu-toast {
  position: absolute;
  left: 50%; bottom: 16px;
  transform: translate3d(-50%, 8px, 0);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #111;
  font-size: 13px; font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .3s cubic-bezier(.16, 1, .3, 1);
}
.ygz-duanwu-toast.is-show { opacity: 1; transform: translate3d(-50%, 0, 0); }

/* ================= 悬浮音乐球 ================= */
.music-trigger {
  position: fixed;
  right: calc(24px + env(safe-area-inset-right, 0px));
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 14010;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .14);
  background: #111218;
  transition: opacity .28s ease, transform .4s cubic-bezier(.16, 1, .3, 1), box-shadow .3s ease;
}
.music-trigger.hidden { display: none !important; }
.music-trigger:hover { box-shadow: 0 16px 38px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .24); }
.music-trigger:active { transform: scale(.94); }
.music-trigger:focus-visible { outline: 2px solid rgba(217, 180, 106, .8); outline-offset: 3px; }
.music-orb-cover {
  position: absolute;
  inset: 5px;
  width: calc(100% - 10px);
  height: calc(100% - 10px);
  border-radius: 50%;
  object-fit: cover;
  z-index: 1;
  animation: ygz-orb-spin 14s linear infinite;
  animation-play-state: paused;
}
.music-trigger.is-playing .music-orb-cover { animation-play-state: running; }
#musicOrbCanvas {
  position: absolute;
  inset: -6px;
  width: calc(100% + 12px);
  height: calc(100% + 12px);
  z-index: 2;
  pointer-events: none;
}
.music-mini-meter {
  position: absolute;
  left: 50%; bottom: 7px;
  z-index: 3;
  display: flex; align-items: flex-end; gap: 2px;
  height: 10px;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.music-mini-meter i {
  width: 2px; height: 100%;
  border-radius: 2px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 0 4px rgba(0, 0, 0, .6);
  transform-origin: bottom;
  transform: scaleY(.3);
  animation: ygz-meter .9s ease-in-out infinite;
  animation-delay: calc(var(--i, 1) * -.17s);
  animation-play-state: paused;
}
.music-trigger.is-playing .music-mini-meter { opacity: 1; }
.music-trigger.is-playing .music-mini-meter i { animation-play-state: running; }
html.ygz-music-open .music-trigger { opacity: 0; transform: scale(.6); pointer-events: none; }

@keyframes ygz-orb-spin { to { transform: rotate(360deg); } }
@keyframes ygz-meter { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }

/* ================= 音乐卡片 ================= */
.music-card {
  position: fixed;
  right: calc(24px + env(safe-area-inset-right, 0px));
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 14020;
  width: min(340px, calc(100vw - 32px));
  border-radius: 26px;
  overflow: hidden;
  color: #f4f4f7;
  background:
    radial-gradient(130% 80% at 0% 0%, rgba(143, 20, 32, .22), transparent 55%),
    linear-gradient(160deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .015) 50%),
    rgba(13, 14, 20, .94);
  border: 1px solid rgba(255, 255, 255, .13);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .62), inset 0 1px 0 rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  transform-origin: calc(100% - 26px) calc(100% - 26px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(.4);
  transition: opacity .26s ease, transform .5s cubic-bezier(.16, 1, .3, 1), visibility 0s linear .5s;
}
.music-card.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: opacity .22s ease, transform .5s cubic-bezier(.16, 1, .3, 1), visibility 0s;
}
.music-liquid-glass-canvas,
#visualizer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.music-liquid-glass-canvas { z-index: 0; opacity: .55; }
#visualizer { z-index: 1; opacity: .5; }
.music-ambient {
  position: absolute;
  inset: -30%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(closest-side, var(--music-ambient, rgba(143, 20, 32, .28)), transparent);
  filter: blur(30px);
  opacity: .7;
  transition: background .8s ease;
}
.music-card-content { position: relative; z-index: 2; padding: 16px 16px 18px; }
.music-cover-section { display: flex; align-items: center; gap: 14px; }
.cover-wrapper {
  position: relative;
  flex: 0 0 76px;
  width: 76px;
  height: 76px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 26px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .1);
  transform: scale(.94);
  transition: transform .6s cubic-bezier(.16, 1, .3, 1);
}
.music-card.is-playing .cover-wrapper { transform: none; }
.cover-wrapper img { width: 100%; height: 100%; object-fit: cover; display: block; }
.song-info { min-width: 0; flex: 1; }
.song-title { font-size: 16px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-artist { margin-top: 2px; font-size: 12.5px; color: rgba(255, 255, 255, .58); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sound-badge-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.sound-badge {
  height: 22px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .04);
  color: rgba(255, 255, 255, .55);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 20px;
  transition: color .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.sound-badge:hover { color: rgba(255, 255, 255, .85); }
.sound-badge[aria-pressed="true"] {
  color: #f6e2b2;
  border-color: rgba(217, 180, 106, .55);
  background: rgba(217, 180, 106, .14);
  box-shadow: 0 0 12px rgba(217, 180, 106, .18);
}
.dolby-badge[aria-pressed="true"] { color: #d9e6ff; border-color: rgba(150, 180, 255, .55); background: rgba(120, 150, 255, .14); box-shadow: 0 0 12px rgba(120, 150, 255, .2); }
.player-controls { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: 16px; }
.ctrl-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, .82);
  transition: background .2s ease, color .2s ease, transform .18s cubic-bezier(.16, 1, .3, 1);
}
.ctrl-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ctrl-btn:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.ctrl-btn:active { transform: scale(.92); }
.ctrl-btn.play-pause { width: 56px; height: 56px; background: #f3f3f6; color: #0d0d12; box-shadow: 0 10px 26px rgba(0, 0, 0, .4); }
.ctrl-btn.play-pause:hover { background: #fff; color: #000; }
.ctrl-btn.play-pause svg { width: 24px; height: 24px; fill: currentColor; stroke: none; }
.music-timebar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; height: 3px; background: rgba(255, 255, 255, .07); }
.music-timebar-fill {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(var(--music-progress, 0));
  background: linear-gradient(90deg, #8f1420, #d9b46a);
  box-shadow: 0 0 10px rgba(217, 180, 106, .45);
}

@media (max-width: 420px) {
  .music-trigger { width: 48px; height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .music-orb-cover, .music-mini-meter i { animation: none !important; }
}
