/* ==========================================================================
   音樂站樣式：跟隨站群主題變量（--c-primary / --c-accent / --c-surface ...）
   11 個域名的主色不同，這裡不寫死顏色，音樂站 UI 自動隨站點變。
   ========================================================================== */

:root {
  --m-player-h: 76px;
  --m-dark: #14161a;
}

body { padding-bottom: calc(var(--m-player-h) + 8px); }

/* ---------- 音樂站頂欄 ---------- */
.music-bar {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  position: sticky; top: 0; z-index: 30;
}
.music-bar-inner {
  display: flex; align-items: center; gap: 14px;
  min-height: 54px; flex-wrap: wrap;
}
.music-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--c-text); text-decoration: none; }
.music-brand-mark {
  width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center;
  background: var(--c-primary); color: var(--c-on-primary, #fff); font-size: 15px;
}
.music-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.music-tabs a {
  padding: 6px 12px; border-radius: 999px; text-decoration: none;
  color: var(--c-text); font-size: 14px; opacity: .78;
}
.music-tabs a:hover { opacity: 1; background: var(--c-primary-soft); }
.music-tabs a.is-active { background: var(--c-primary); color: var(--c-on-primary, #fff); opacity: 1; }
.music-search { display: flex; gap: 6px; margin-left: auto; }
.music-search input {
  width: 180px; padding: 7px 10px; border: 1px solid var(--c-border); border-radius: var(--c-radius-sm);
  background: var(--c-bg); color: var(--c-text);
}
.music-search button {
  padding: 7px 12px; border: 0; border-radius: var(--c-radius-sm); cursor: pointer;
  background: var(--c-primary); color: var(--c-on-primary, #fff);
}
.music-back { font-size: 13px; color: var(--c-text); opacity: .7; text-decoration: none; white-space: nowrap; }
.music-back:hover { opacity: 1; }

/* ---------- 佈局 ---------- */
.music-wrap { padding-top: 20px; padding-bottom: 28px; }
.music-section { margin-bottom: 30px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-head h2 { font-size: 19px; margin: 0; }
.section-head h3 { font-size: 16px; margin: 0; }
.section-head a { font-size: 13px; }
.muted { color: var(--c-text); opacity: .62; font-size: 13px; }
.music-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
@media (max-width: 860px) { .music-columns { grid-template-columns: 1fr; } }

/* ---------- Hero ---------- */
.music-hero {
  display: grid; grid-template-columns: 220px 1fr; gap: 22px; align-items: center;
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--c-radius);
  padding: 18px; margin-bottom: 28px; box-shadow: var(--c-shadow);
}
.hero-cover img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: var(--c-radius-sm); display: block; }
.hero-kicker { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--c-primary); margin: 0 0 6px; }
.hero-title { margin: 0 0 6px; font-size: 26px; }
.hero-title a { color: var(--c-text); text-decoration: none; }
.hero-sub { margin: 0 0 14px; color: var(--c-text); opacity: .7; font-size: 14px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .music-hero { grid-template-columns: 1fr; }
  .hero-cover img { max-width: 180px; }
}

/* ---------- 按鈕 ---------- */
.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px; cursor: pointer;
  font-size: 14px; text-decoration: none; border: 1px solid transparent;
}
.btn-primary { background: var(--c-primary); color: var(--c-on-primary, #fff); border-color: var(--c-primary); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; color: var(--c-text); border-color: var(--c-border); }
.btn-ghost:hover { background: var(--c-primary-soft); }
.btn-ghost.is-on { border-color: var(--c-primary); color: var(--c-primary); background: var(--c-primary-soft); }

/* ---------- 專輯卡 ---------- */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px; }
.album-card { min-width: 0; }
.album-cover {
  position: relative; display: block; border-radius: var(--c-radius-sm); overflow: hidden;
  background: var(--c-primary-soft); box-shadow: var(--c-shadow);
}
.album-cover img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
.album-play {
  position: absolute; right: 8px; bottom: 8px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(0,0,0,.62); color: #fff; font-size: 13px;
  opacity: 0; transition: opacity .18s ease;
}
.album-card:hover .album-play, .album-cover:focus-within .album-play { opacity: 1; }
.album-name { display: block; margin-top: 8px; font-weight: 600; color: var(--c-text); text-decoration: none; font-size: 15px; }
.album-name:hover { color: var(--c-primary); }
.album-meta, .album-count { margin: 3px 0 0; font-size: 12px; color: var(--c-text); opacity: .62; }
.pl-cover { display: grid; place-items: center; aspect-ratio: 3/4; background: var(--c-primary-soft); }
.pl-cover-mark { font-size: 40px; color: var(--c-primary); opacity: .7; }

/* ---------- 榜單 ---------- */
.rank-list, .song-rank { list-style: none; margin: 0; padding: 0; }
.rank-list li {
  display: flex; align-items: center; gap: 10px; padding: 8px 6px;
  border-bottom: 1px dashed var(--c-border);
}
.rank-no { width: 22px; text-align: center; font-weight: 700; color: var(--c-text); opacity: .55; text-decoration: none; }
.rank-cover img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; display: block; }
.rank-body { min-width: 0; flex: 1; }
.rank-title { display: block; color: var(--c-text); text-decoration: none; font-weight: 600; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-meta { margin: 2px 0 0; font-size: 12px; opacity: .62; }
.rank-play, .song-play, .track-play {
  border: 1px solid var(--c-border); background: transparent; color: var(--c-text);
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 11px;
}
.rank-play:hover, .song-play:hover, .track-play:hover { background: var(--c-primary-soft); border-color: var(--c-primary); }
.song-rank li { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-bottom: 1px dashed var(--c-border); }
.song-no { width: 22px; text-align: center; font-weight: 700; opacity: .5; font-size: 13px; }
.song-body { flex: 1; min-width: 0; }
.song-title { color: var(--c-text); text-decoration: none; font-size: 14px;
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-title:hover { color: var(--c-primary); }
.song-meta { margin: 2px 0 0; font-size: 12px; opacity: .6; }

/* ---------- 專輯詳情 ---------- */
.breadcrumb { font-size: 13px; opacity: .72; margin-bottom: 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.album-head { display: grid; grid-template-columns: 240px 1fr; gap: 26px; align-items: start; margin-bottom: 30px; }
.album-head-cover img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: var(--c-radius); box-shadow: var(--c-shadow); }
.pl-head-cover { aspect-ratio: 3/4; display: grid; place-items: center; background: var(--c-primary-soft); border-radius: var(--c-radius); }
.album-kicker { margin: 0 0 6px; font-size: 12px; letter-spacing: .08em; color: var(--c-primary); text-transform: uppercase; }
.album-head-body h1 { margin: 0 0 8px; font-size: 28px; }
.album-subname { margin: 0 0 8px; opacity: .72; }
.album-links { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; margin: 0 0 10px; }
.album-intro { font-size: 14px; opacity: .78; max-width: 62ch; margin: 0 0 14px; }
.album-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 640px) { .album-head { grid-template-columns: 1fr; } .album-head-cover img { max-width: 190px; } }

/* ---------- 歌曲列表 ---------- */
.track-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--c-border); }
.track { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--c-border); }
.track-no { width: 24px; text-align: center; font-size: 13px; opacity: .55; }
.track-body { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.track-title { font-size: 15px; color: var(--c-text); text-decoration: none; }
.track-title:hover { color: var(--c-primary); }
.tag-theme { font-style: normal; font-size: 11px; padding: 1px 6px; border-radius: 999px;
  background: var(--c-primary); color: var(--c-on-primary, #fff); margin-left: 6px; vertical-align: 1px; }
.track-has-lyric { font-size: 11px; opacity: .5; border: 1px solid var(--c-border); border-radius: 999px; padding: 1px 6px; }
.track-dur { font-size: 13px; opacity: .6; min-width: 42px; text-align: right; }
.track-like, .track-add {
  border: 0; background: transparent; cursor: pointer; font-size: 15px; color: var(--c-text); opacity: .55;
  width: 26px; height: 26px; border-radius: 50%;
}
.track-like:hover, .track-add:hover { opacity: 1; background: var(--c-primary-soft); }
.track-like.is-on { color: var(--c-primary); opacity: 1; }

/* ---------- 語言 chips ---------- */
.lang-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.lang-chip {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--c-border);
  text-decoration: none; color: var(--c-text); font-size: 13px;
}
.lang-chip em { font-style: normal; opacity: .55; margin-left: 4px; font-size: 12px; }
.lang-chip:hover, .lang-chip.is-active { background: var(--c-primary); color: var(--c-on-primary, #fff); border-color: var(--c-primary); }
.lang-chip.is-active em, .lang-chip:hover em { opacity: .8; }

/* ---------- 分頁 ---------- */
.music-pager { margin-top: 22px; }

/* ---------- 底部播放器 ---------- */
.music-player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--m-dark); color: #eef0f3;
  box-shadow: 0 -6px 24px rgba(0,0,0,.28);
}
.mp-inner { display: flex; align-items: center; gap: 12px; min-height: var(--m-player-h); }
.mp-cover img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; display: block; background: #23262b; }
.mp-meta { min-width: 0; width: 220px; }
.mp-title { display: block; color: #fff; text-decoration: none; font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-album { display: block; color: #c8ccd2; text-decoration: none; font-size: 12px; opacity: .78;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-controls { display: flex; align-items: center; gap: 4px; }
.mp-btn {
  background: transparent; border: 0; color: #dfe3e8; cursor: pointer;
  width: 34px; height: 34px; border-radius: 50%; font-size: 13px;
}
.mp-btn:hover { background: rgba(255,255,255,.12); }
.mp-play { width: 40px; height: 40px; background: var(--c-primary); color: var(--c-on-primary, #fff); font-size: 15px; }
.mp-play:hover { filter: brightness(1.1); }
.mp-progress { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 120px; }
.mp-time { font-size: 11px; opacity: .72; font-variant-numeric: tabular-nums; }
.mp-bar { flex: 1; height: 5px; background: rgba(255,255,255,.18); border-radius: 999px; cursor: pointer; position: relative; }
.mp-bar-fill { height: 100%; width: 0; background: var(--c-primary); border-radius: 999px; }
.mp-extra { display: flex; align-items: center; gap: 2px; }
.mp-volume { display: flex; align-items: center; gap: 4px; }
.mp-volume input { width: 72px; }
.mp-queue, .mp-lyric {
  position: fixed; right: 16px; bottom: calc(var(--m-player-h) + 12px);
  width: 320px; max-width: calc(100vw - 24px); max-height: 50vh; overflow: auto;
  background: #1c1f24; color: #e8eaee; border-radius: 10px; box-shadow: 0 16px 40px rgba(0,0,0,.4);
  padding: 10px 12px; z-index: 61;
}
.mp-lyric { width: 380px; }
.mp-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.mp-queue-list { margin: 0; padding-left: 20px; font-size: 13px; }
.mp-queue-list li { padding: 4px 0; cursor: pointer; opacity: .85; }
.mp-queue-list li.is-current { color: var(--c-primary); font-weight: 700; opacity: 1; }
.mp-lyric-body { font-size: 14px; line-height: 1.9; white-space: pre-wrap; max-height: 40vh; overflow: auto; }
.mp-lyric-empty { opacity: .6; }
.mp-toast {
  position: fixed; left: 50%; bottom: calc(var(--m-player-h) + 16px); transform: translateX(-50%);
  background: #1c1f24; color: #fff; padding: 8px 16px; border-radius: 999px; font-size: 13px; z-index: 70;
}

/* ---------- 彈窗（加入歌單） ---------- */
.music-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 80;
  display: grid; place-items: center; padding: 16px;
}
.music-modal-box { background: var(--c-surface); color: var(--c-text); border-radius: var(--c-radius);
  width: 360px; max-width: 100%; padding: 14px 16px; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.pl-modal-body { font-size: 14px; }
.pl-pick { list-style: none; margin: 0 0 10px; padding: 0; max-height: 200px; overflow: auto; }
.pl-pick-item { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 1px solid var(--c-border);
  border-radius: var(--c-radius-sm); background: transparent; color: var(--c-text); cursor: pointer; margin-bottom: 6px; }
.pl-pick-item:hover { background: var(--c-primary-soft); }
.pl-create { display: flex; gap: 8px; margin-top: 8px; }
.pl-create input { flex: 1; padding: 8px 10px; border: 1px solid var(--c-border); border-radius: var(--c-radius-sm);
  background: var(--c-bg); color: var(--c-text); }
.pl-create-inline { margin-bottom: 14px; }

/* ---------- 小說頁的主題曲卡 ---------- */
.book-theme {
  margin: 18px 0; padding: 14px 16px; border: 1px solid var(--c-border);
  border-radius: var(--c-radius); background: var(--c-surface); box-shadow: var(--c-shadow);
}
.book-theme-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.book-theme-head h3 { margin: 0; font-size: 16px; }
.book-theme-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.book-theme-row audio { flex: 1; min-width: 220px; height: 36px; }
.book-theme-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.theme-album-chip {
  font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--c-border);
  text-decoration: none; color: var(--c-text);
}
.theme-album-chip:hover { border-color: var(--c-primary); color: var(--c-primary); background: var(--c-primary-soft); }

@media (max-width: 720px) {
  .mp-meta { width: 120px; }
  .mp-volume, #mpLike { display: none; }
  .music-search input { width: 120px; }
}

/* ==========================================================================
   WAP（手機版）音樂站
   ========================================================================== */
.wap-body.has-music-player .wap-main {
  padding-bottom: calc(var(--w-tabbar-h, 56px) + 78px);
}
.wap-body .music-player,
.wap-body #jqPlayer {
  bottom: var(--w-tabbar-h, 56px);
}
.wap-body #jqPlayer .mp-inner {
  min-height: 62px;
  gap: 8px;
  padding-left: 8px;
  padding-right: 8px;
}
.wap-body #jqPlayer .mp-cover img { width: 44px; height: 44px; }
.wap-body #jqPlayer .mp-meta { width: 96px; }
.wap-body #jqPlayer .mp-title { font-size: 13px; }
.wap-body #jqPlayer .mp-album { font-size: 11px; }
.wap-body #jqPlayer .mp-play { width: 36px; height: 36px; }
.wap-body #jqPlayer .mp-extra #mpLike,
.wap-body #jqPlayer .mp-extra #mpMode,
.wap-body #jqPlayer .mp-volume { display: none; }
.wap-body #jqPlayer .mp-time { font-size: 10px; }
.wap-body #jqPlayer .mp-queue,
.wap-body #jqPlayer .mp-lyric {
  bottom: calc(var(--w-tabbar-h, 56px) + 70px);
  width: calc(100vw - 24px);
  max-height: 45vh;
}

/* WAP 音樂站內容 */
.wap-music-tabs {
  display: flex; gap: 6px; overflow-x: auto; padding: 10px 12px;
  background: var(--w-surface, #fff); border-bottom: 1px solid var(--w-border, #eee);
  -webkit-overflow-scrolling: touch;
}
.wap-music-tabs a {
  flex: 0 0 auto; padding: 6px 12px; border-radius: 999px;
  font-size: 13px; text-decoration: none;
  color: var(--w-text, #333); background: var(--w-bg, #f5f5f5);
}
.wap-music-tabs a.is-active { background: var(--w-primary, #a04a2e); color: #fff; }
.wap-album-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px;
  padding: 10px 12px;
}
.wap-album-card { min-width: 0; }
.wap-album-card img {
  width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 8px; display: block;
  background: var(--w-border, #eee);
}
.wap-album-card .n {
  display: block; margin-top: 5px; font-size: 13px; font-weight: 600;
  color: var(--w-text, #333); text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wap-album-card .m { margin: 2px 0 0; font-size: 11px; opacity: .62; }
.wap-track-list { margin: 0; padding: 0; list-style: none; }
.wap-track {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border-bottom: 1px solid var(--w-border, #f0f0f0); background: var(--w-surface, #fff);
}
.wap-track .i { width: 20px; text-align: center; font-size: 12px; opacity: .5; }
.wap-track .b { flex: 1; min-width: 0; }
.wap-track .t { display: block; font-size: 14px; color: var(--w-text, #333);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wap-track .d { font-size: 11px; opacity: .55; }
.wap-track .p {
  border: 1px solid var(--w-border, #ddd); background: transparent; color: var(--w-text, #333);
  width: 32px; height: 32px; border-radius: 50%; font-size: 12px;
}
.wap-music-head { padding: 12px 14px; background: var(--w-surface, #fff); }
.wap-music-head h1 { margin: 0 0 6px; font-size: 18px; }
.wap-music-head .meta { font-size: 12px; opacity: .65; margin: 0 0 10px; }
.wap-music-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.wap-music-actions .btn-primary,
.wap-music-actions .btn-ghost { padding: 8px 14px; font-size: 13px; }
