/* ============================================================
   全站共用：底部固定音乐栏样式（配合 assets/kz-player.js）
   首页 index.html / 友链页 friends.html / 统计页 stats.html 共用
   ------------------------------------------------------------
   页面接入三件套：
     1. <link rel="stylesheet" href="assets/kz-player.css">
     2. 在 body 底部放置 .dock 播放器结构与 <audio id="bgm">
     3. <script src="assets/kz-player.js"></script>
   ============================================================ */

@keyframes rot { to { transform: rotate(360deg); } }
@keyframes eq { 0%, 100% { height: 5px; } 50% { height: 18px; } }

/* ================= 底部固定音乐栏（播放器样式） ================= */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 22px;
  background: linear-gradient(to top, rgba(8,20,28,.96) 0%, rgba(8,20,28,.86) 70%, rgba(8,20,28,.45) 100%);
  border-top: 1px solid rgba(212,175,55,.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 13px; letter-spacing: 1.5px; color: rgba(240,230,200,.72);
}
.dock-art {
  flex: 0 0 auto;
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(212,175,55,.08);
  border: 1px solid rgba(212,175,55,.4);
  color: #d4af37;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dock-art svg { width: 26px; height: 26px; }
body.playing .dock-art svg { animation: rot 4s linear infinite; }
.dock-info { flex: 0 1 200px; min-width: 90px; overflow: hidden; }
.dock-title { color: #d4af37; font-size: 13px; letter-spacing: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-artist { color: rgba(240,230,200,.55); font-size: 11px; letter-spacing: 1.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.dock-progress-wrap { flex: 1 1 auto; min-width: 140px; display: flex; align-items: center; gap: 10px; }
.dock-time { font-size: 11px; color: rgba(240,230,200,.5); font-variant-numeric: tabular-nums; min-width: 36px; letter-spacing: 1px; }
.dock-time-cur { text-align: right; }
.dock-progress { flex: 1 1 auto; height: 4px; position: relative; background: rgba(212,175,55,.18); border-radius: 2px; cursor: pointer; }
.dock-progress-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: linear-gradient(to right, #d4af37, #c9a24a); border-radius: 2px; transition: width .12s linear; }
.dock-progress-handle { position: absolute; top: 50%; left: 0%; width: 10px; height: 10px; border-radius: 50%; background: #d4af37; transform: translate(-50%, -50%); box-shadow: 0 0 6px rgba(212,175,55,.6); opacity: 0; transition: opacity .2s; pointer-events: none; }
.dock-progress:hover .dock-progress-handle,
.dock-progress.dragging .dock-progress-handle { opacity: 1; }
.dock-volume { flex: 0 0 auto; position: relative; display: inline-flex; align-items: center; justify-content: center; }
.dock-volume::before { content: ""; position: absolute; left: 0; right: 0; top: -16px; height: 16px; }
.dock-volume-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(212,175,55,.6); background: rgba(212,175,55,.18); color: #d4af37; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all .3s ease; padding: 0; }
.dock-volume-btn:hover { background: #d4af37; color: #1c1206; transform: scale(1.05); }
.dock-volume:hover .dock-volume-btn,
.dock-volume.open .dock-volume-btn { background: #d4af37; color: #1c1206; transform: scale(1.05); }
.dock-volume-panel { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(6px); width: 48px; height: 144px; background: rgba(15,22,30,.92); border: 1px solid rgba(212,175,55,.35); border-radius: 24px; padding: 26px 0 8px; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .22s ease, transform .22s ease; backdrop-filter: blur(8px); box-shadow: 0 10px 28px rgba(0,0,0,.45); }
.dock-volume:hover .dock-volume-panel,
.dock-volume.open .dock-volume-panel { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.dock-volume-panel::after { content: ""; position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%) rotate(45deg); width: 8px; height: 8px; background: rgba(15,22,30,.92); border-right: 1px solid rgba(212,175,55,.35); border-bottom: 1px solid rgba(212,175,55,.35); }
.dock-volume-num { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); font-size: 10px; color: rgba(240,230,200,.85); font-variant-numeric: tabular-nums; background: rgba(212,175,55,.12); padding: 2px 8px; border-radius: 9px; border: 1px solid rgba(212,175,55,.25); letter-spacing: .5px; }
.dock-volume-slider { width: 6px; height: 100px; position: relative; background: rgba(212,175,55,.22); border-radius: 3px; cursor: pointer; }
.dock-volume-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 10%; background: #d4af37; border-radius: 3px; }
.dock-volume-handle { position: absolute; left: 50%; bottom: 10%; width: 12px; height: 12px; border-radius: 50%; background: #d4af37; transform: translate(-50%, 50%); box-shadow: 0 0 6px rgba(212,175,55,.55); transition: transform .2s; }
.dock-volume-slider:hover .dock-volume-handle,
.dock-volume-slider.dragging .dock-volume-handle { transform: translate(-50%, 50%) scale(1.25); }
.dock-btn { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(212,175,55,.6); background: rgba(212,175,55,.18); color: #d4af37; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all .3s ease; }
.dock-btn:hover { background: #d4af37; color: #1c1206; transform: scale(1.05); }
.dock-btn svg { width: 16px; height: 16px; }
.dock-icon-pause { display: none; }
body.playing .dock-icon-play { display: none; }
body.playing .dock-icon-pause { display: inline; }

/* 页面内没有 #toast 时，脚本会动态创建 #kzToast，此处给出兜底样式 */
#kzToast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px);
  z-index: 300; max-width: 86vw;
  background: rgba(12,28,38,.95); border: 1px solid rgba(212,175,55,.5);
  color: #f0e6c8; font-size: 13.5px; letter-spacing: 1px; line-height: 1.9;
  padding: 14px 22px; border-radius: 10px; text-align: center;
  opacity: 0; pointer-events: none; transition: all .45s ease;
}
#kzToast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }

/* ================= 响应式 ================= */
@media (max-width: 720px) {
  .dock { padding: 8px 12px; gap: 8px; }
  .dock-art { display: none; }
  .dock-info { flex: 0 1 auto; min-width: 0; }
  .dock-title { font-size: 12px; letter-spacing: 1px; }
  .dock-artist { display: none; }
  .dock-progress-wrap { min-width: 0; gap: 6px; }
  .dock-time { min-width: 30px; font-size: 10px; }
  .dock-volume-btn { width: 38px; height: 38px; }
  .dock-btn { width: 38px; height: 38px; }
  .dock-volume-panel { height: 132px; }
  .dock-volume-slider { height: 88px; }
}
@media (max-width: 480px) {
  .dock { padding: 7px 10px; gap: 7px; }
  .dock-progress-wrap { gap: 4px; }
  .dock-time { display: none; }
  .dock-volume-btn, .dock-btn { width: 36px; height: 36px; }
}
