
/* ============================================================================
   ⑤ 模組: 音樂庫 (music)
   ---------------------------------------------------------------------------
   播放器 (#mu-pbar) 掛在 body、fixed 底部, 所以離開音樂頁仍然繼續播;
   body.mu-haspbar 會給 #view 補底部留白, 免得最後一行被播放器蓋住。
   ========================================================================== */
body.mu-haspbar .view{padding-bottom:104px}
@media (max-width:640px){ body.mu-haspbar .view{padding-bottom:132px} }

#mu-head .mu-hrow{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
#mu-head .mu-stats{display:flex;gap:14px;align-items:baseline;flex-wrap:wrap;font-size:12.5px;color:var(--muted)}
#mu-head .mu-stats b{color:var(--txt);font-size:15px;font-weight:600;margin-right:3px}
#mu-head .mu-tabs{display:flex;gap:7px;align-items:center;margin-top:12px;flex-wrap:wrap}
#mu-head .mu-search{
  min-width:180px;max-width:280px;padding:7px 11px;border-radius:99px;
  border:1px solid var(--line);background:var(--well);color:var(--txt);font-size:12.5px;
}
#mu-head .mu-search:focus{outline:none;border-color:var(--accent)}
.mu-prog{height:5px;border-radius:99px;background:var(--well);overflow:hidden;margin:9px 0 4px}
.mu-prog > div{height:100%;background:linear-gradient(90deg,var(--accent),var(--accent2));transition:width .4s var(--ease)}

/* ---- 統計條 / 區塊標題 ---- */
.mu-secrow{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:14px 0 10px;font-size:12.5px}
.mu-secrow .grow{flex:1}
.mu-sel{width:auto;max-width:220px;padding:5px 9px;border-radius:99px;border:1px solid var(--line);
  background:var(--well);color:var(--txt);font-size:12px;cursor:pointer}
.mu-kv{display:grid;grid-template-columns:110px 1fr;gap:6px 12px;font-size:12.5px;margin-top:6px}
.mu-kv span{color:var(--muted)}
.mu-kv b{font-weight:500;word-break:break-all}

/* ---- 歌曲列 ---- */
.mu-tbl{margin-top:4px}
.mu-th,.mu-row{
  display:grid;grid-template-columns:38px minmax(0,2.4fr) minmax(0,1.4fr) 62px 56px 34px 34px;
  gap:8px;align-items:center;
}
.mu-th{padding:0 10px 6px;font-size:11px;letter-spacing:.04em;color:var(--muted);text-transform:uppercase}
.mu-row{
  padding:7px 10px;border-radius:var(--radius-sm);cursor:pointer;
  border:1px solid transparent;transition:background var(--dur),border-color var(--dur);
}
.mu-row:hover{background:var(--hover);border-color:var(--line)}
.mu-row.playing{background:rgba(var(--accent-rgb),.12);border-color:rgba(var(--accent-rgb),.36)}
.mu-row.playing .mu-t{color:var(--accent)}
.mu-idx{
  width:32px;height:32px;border-radius:8px;border:1px solid var(--line);
  background-color:var(--well);background-size:cover;background-position:center;
  color:var(--muted);font-size:11.5px;cursor:pointer;font-variant-numeric:tabular-nums;
  display:grid;place-items:center;position:relative;overflow:hidden;padding:0;
}
.mu-idx .mu-n{position:relative;z-index:1}
.mu-idx.ph{color:#fff;font-weight:600;text-shadow:0 1px 3px rgba(0,0,0,.55)}
.mu-idx .mu-pv{display:none;position:relative;z-index:1;font-size:11px;color:#fff}
.mu-row:hover .mu-idx .mu-n{display:none}
.mu-row:hover .mu-idx .mu-pv{display:block}
.mu-row:hover .mu-idx{background-image:none;background-color:rgba(var(--accent-rgb),.22);border-color:var(--accent)}
.mu-row:hover .mu-idx .mu-pv{color:var(--accent)}
.mu-row.playing .mu-idx{border-color:var(--accent)}
.mu-cov.ph{color:#fff}
.mu-init{font-size:30px;font-weight:600;color:#fff;text-shadow:0 2px 6px rgba(0,0,0,.45)}
.mu-cov.big.ph .mu-init{font-size:52px}
.mu-tt,.mu-al{min-width:0}
.mu-t,.mu-a,.mu-al,.mu-du,.mu-br{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mu-t{font-size:13px;font-weight:500;color:var(--txt)}
.mu-a{font-size:11.5px;color:var(--muted)}
.mu-al,.mu-du,.mu-br{font-size:12px;color:var(--muted)}
.mu-like{
  width:28px;height:28px;border-radius:50%;border:1px solid transparent;background:transparent;
  color:var(--muted);font-size:14px;cursor:pointer;line-height:1;
}
.mu-like:hover{color:var(--danger);border-color:var(--line)}
.mu-like.on{color:var(--danger)}
.mu-more{
  width:28px;height:28px;border-radius:6px;border:1px solid transparent;background:transparent;
  color:var(--muted);cursor:pointer;line-height:1;font-size:15px;
}
.mu-more:hover{color:var(--txt);border-color:var(--line);background:var(--well)}

/* ---- 歌手 / 專輯卡 ---- */
.mu-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(158px,1fr));gap:12px}
.mu-arcard,.mu-alcard{display:flex;flex-direction:column;gap:6px;cursor:pointer;position:relative;padding:12px}
.mu-avatar{
  width:100%;aspect-ratio:1;border-radius:var(--radius-sm);display:grid;place-items:center;
  background:linear-gradient(135deg,rgba(var(--accent-rgb),.28),rgba(56,189,248,.22));
  font-size:30px;color:var(--txt);font-weight:600;margin-bottom:2px;
}
.mu-cov{
  width:100%;aspect-ratio:1;border-radius:var(--radius-sm);overflow:hidden;display:grid;place-items:center;
  background:var(--well);color:var(--muted);font-size:26px;
}
.mu-cov img{width:100%;height:100%;object-fit:cover;display:block}
.mu-cov.big{width:170px;height:170px;flex:none}
.mu-alhead{display:flex;gap:16px;align-items:flex-start}
.mu-alhead > div:last-child{flex:1;min-width:0}
.mu-plcard{position:relative}

/* ---- 重複 / 整理 ---- */
/* 勾選框一定要自己定尺寸: Chrome 會把 flex row 內的 input[type=checkbox] 拉長
   (實測 695px), 令整理清單的勾選框佔半行、右邊文字只剩 230px 而且被切。 */
.mu-oline > input[type=checkbox],
.mu-rootrow > input[type=checkbox],
.mu-secrow input[type=checkbox]{
  width:16px;height:16px;min-width:16px;flex:0 0 16px;
  margin:1px 0 0;accent-color:var(--accent);cursor:pointer;
}
.mu-oline > div{flex:1 1 auto;min-width:0}
.mu-dupe{margin-bottom:10px}
.mu-ditem{display:flex;gap:10px;align-items:center;padding:6px 0;border-top:1px dashed var(--line);font-size:12px}
.mu-ditem .grow{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mu-org{display:flex;flex-direction:column;gap:2px;max-height:60vh;overflow:auto}
.mu-oline{display:flex;gap:10px;align-items:flex-start;padding:7px 4px;border-top:1px solid var(--line)}
.mu-oline:first-child{border-top:0}
.mu-from,.mu-to{font-size:11.5px;color:var(--muted);min-width:0;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mu-to{color:var(--accent)}
.mu-roots{display:flex;flex-direction:column;gap:8px;margin-top:6px}
.mu-rootrow{display:flex;gap:10px;align-items:center;padding:8px;border:1px solid var(--line);border-radius:var(--radius-sm)}
.mu-menu{display:flex;flex-wrap:wrap;gap:8px}
.mu-qlist{max-height:56vh;overflow:auto}
.mu-qrow{display:flex;gap:10px;align-items:center;padding:7px 8px;border-radius:var(--radius-xs);cursor:pointer;font-size:12.5px}
.mu-qrow:hover{background:var(--hover)}
.mu-qrow.on{background:rgba(var(--accent-rgb),.14);color:var(--accent)}
.mu-qrow .grow{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mu-qn{width:24px;color:var(--muted);font-variant-numeric:tabular-nums;font-size:11.5px}

/* ---- 底部播放器 ---- */
#mu-pbar{
  position:fixed;left:0;right:0;bottom:0;z-index:60;display:flex;align-items:center;gap:12px;
  padding:9px 14px;border-top:1px solid var(--line);
  background:var(--shelf);backdrop-filter:blur(var(--blur)) saturate(var(--sat));
  box-shadow:0 -14px 40px -22px rgba(0,0,0,.9);
}
#mu-pbar[hidden]{display:none}
.mu-p-cover{
  width:46px;height:46px;border-radius:9px;flex:none;background:var(--well) center/cover no-repeat;
  display:grid;place-items:center;color:var(--muted);font-size:18px;position:relative;overflow:hidden;
}
.mu-p-cover span{position:relative;z-index:0}
.mu-p-meta{width:170px;min-width:0;flex:none}
.mu-p-title{font-size:12.5px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mu-p-artist{font-size:11.5px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mu-p-mid{flex:1;min-width:0}
.mu-p-ctl{display:flex;gap:10px;align-items:center;justify-content:center;margin-bottom:2px}
.mu-pbtn{
  flex:none;width:30px;height:30px;border-radius:50%;border:1px solid transparent;background:transparent;
  color:var(--muted);cursor:pointer;font-size:13px;line-height:1;display:grid;place-items:center;
  padding:0;
}
.mu-pbtn svg{width:15px;height:15px;display:block}
.mu-pbtn:hover{color:var(--txt);background:var(--hover)}
.mu-pbtn.on{color:var(--accent);border-color:rgba(var(--accent-rgb),.4)}
.mu-pbtn.main{
  width:36px;height:36px;flex:none;
  background:linear-gradient(135deg,var(--accent),var(--accent2));
  color:var(--accent-ink);border:0;
}
.mu-pbtn.main svg{width:16px;height:16px}
.mu-p-seek{display:flex;gap:9px;align-items:center;width:100%;font-size:10.5px;color:var(--muted);font-variant-numeric:tabular-nums}
.mu-p-seek input[type=range]{flex:1 1 auto;min-width:0}
.mu-p-right{display:flex;gap:4px;align-items:center;flex:none}
#mu-pbar input[type=range]{
  -webkit-appearance:none;appearance:none;height:4px;padding:0;margin:0;border:0;
  border-radius:99px;background:var(--well);outline:none;cursor:pointer;
}
#mu-pbar input[type=range]::-webkit-slider-thumb{
  -webkit-appearance:none;width:11px;height:11px;border-radius:50%;background:var(--accent);
  border:0;cursor:pointer;
}
#mu-pbar input[type=range]::-moz-range-thumb{
  width:11px;height:11px;border:0;border-radius:50%;background:var(--accent);cursor:pointer;
}
@media (max-width:860px){
  .mu-p-meta{width:96px}
  .mu-p-right #mu-vol,.mu-p-right #mu-btn-vol{display:none}
}
@media (max-width:640px){
  #mu-pbar{flex-wrap:wrap;gap:8px;padding:8px 10px}
  .mu-p-mid{order:3;flex-basis:100%}
  .mu-p-cover{width:38px;height:38px}
  .mu-th{display:none}
  .mu-row{grid-template-columns:32px minmax(0,1fr) 46px 30px 30px}
  .mu-row .mu-al,.mu-row .mu-br{display:none}
  .mu-alhead{flex-direction:column}
  .mu-cov.big{width:100%;height:auto;aspect-ratio:1}
}
