/* CLC 共用：音樂播放器 v1 — clc-dx04/shared/widgets/music/music-player.v1.css
   顏色用變數，各站可在 :root 改 --mp-accent（LF 跟背景主題，DX 系用 #007E8A）。深色模式看 html.dark。 */
:root { --mp-accent: #007E8A; --mp-accent-fg: #fff; --mp-fg: #17262a; --mp-muted: #5d6f73; --mp-line: rgba(0,0,0,.1);
  --mp-glass: rgba(255,255,255,.8); --mp-hover: rgba(0,0,0,.05); --mp-r: 14px; }
html.dark { --mp-accent: #2bb3bf; --mp-accent-fg: #06272a; --mp-fg: #e6eef0; --mp-muted: #9db0b4; --mp-line: rgba(255,255,255,.12);
  --mp-glass: rgba(26,36,39,.82); --mp-hover: rgba(255,255,255,.06); }

.mp-tab, .mp-tab *, .mp-panel, .mp-panel *, .mp-dlg * { -webkit-tap-highlight-color: transparent; }
/* 長按把手時不要被選取（Android 會蓋一層半透明選取色） */
.mp-tab, .mp-tab * { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.mp-tab.mp-gone { display: none; }
.mp-tab, .mp-panel, .mp-dlg { font-family: "CLC Arial", Arial, "Microsoft JhengHei", "PingFang TC", sans-serif; color: var(--mp-fg); }
.mp-panel { -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); background: var(--mp-glass); border: 1px solid var(--mp-line);
  -webkit-user-select: none; user-select: none; box-sizing: border-box; }

/* 把手：和 LF 的 🏠 一模一樣（半圓貼邊、音符只露出一半），只是底色不同。
   滑鼠移上去／手指按住時吐出來成圓頭長方形；點一下才打開卡片。 */
.mp-tab { position: fixed; z-index: 2147483000; right: 0; width: 22px; height: 44px; box-sizing: border-box; display: grid; place-items: center;
  border-radius: 22px 0 0 22px; background: rgba(28,28,28,.45); /* 和 🏠 一模一樣（深淺色都同），只換圖示 */ color: #fff; opacity: .28; overflow: hidden;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 2px 8px rgba(0,0,0,.15);
  cursor: pointer; touch-action: none; transition: opacity .2s, width .2s ease, border-radius .2s ease; }
.mp-tab svg { width: 22px; height: 22px; display: block; flex: none; pointer-events: none; transform: translateX(11px); transition: transform .2s; }
.mp-tab.mp-left { right: auto; left: 0; border-radius: 0 22px 22px 0; }
.mp-tab.mp-left svg { transform: translateX(-11px); }
@media (hover: none), (pointer: coarse) { .mp-tab { width: 34px; } .mp-tab svg { transform: translateX(2px); } .mp-tab.mp-left svg { transform: translateX(-2px); } }
.mp-tab.mp-press, .mp-tab:focus-visible { opacity: .9; width: 50px; }
.mp-tab.mp-press svg, .mp-tab:focus-visible svg { transform: none; }
@media (hover: hover) { .mp-tab:hover { opacity: .9; width: 50px; } .mp-tab:hover svg { transform: none; } }
.mp-tab.mp-float, .mp-tab.mp-lift { width: 44px; border-radius: 22px; }
.mp-tab.mp-float svg, .mp-tab.mp-lift svg { transform: none; }
.mp-tab.mp-lift { transition: opacity .2s; opacity: .9; cursor: grabbing; }
.mp-tab.mp-hide { opacity: 0; pointer-events: none; }
.mp-eq { display: none; }

/* 面板：貼邊時從那一邊長出來（貼螢幕那側是平的）；浮動時從把手放大出來。
   關著時移到畫面外（不 display:none，播放才不會斷） */
.mp-panel { position: fixed; z-index: 2147483001; right: 0; top: 12px; width: min(380px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px); overflow: auto; padding: 12px calc(12px + env(safe-area-inset-right, 0px)) 12px 12px;
  border-right: 0; border-radius: calc(var(--mp-r) + 4px) 0 0 calc(var(--mp-r) + 4px); box-shadow: -4px 10px 30px rgba(0,0,0,.25);
  transform: translateX(100%); visibility: hidden; transition: transform .25s ease-out, visibility 0s .25s; }
.mp-panel.mp-left { right: auto; left: 0; padding: 12px 12px 12px calc(12px + env(safe-area-inset-left, 0px));
  border-right: 1px solid var(--mp-line); border-left: 0; border-radius: 0 calc(var(--mp-r) + 4px) calc(var(--mp-r) + 4px) 0; transform: translateX(-100%); }
.mp-panel.mp-float { right: auto; padding: 12px; border: 1px solid var(--mp-line); border-radius: calc(var(--mp-r) + 4px);
  transform: scale(.3); opacity: 0; transition: transform .2s ease-out, opacity .2s, visibility 0s .2s; }
.mp-panel.mp-open { transform: none; opacity: 1; visibility: visible; transition: transform .25s ease-out, opacity .2s; }
.mp-video { margin: 0 0 12px 0; position: relative; aspect-ratio: 16 / 9; min-height: 200px; border-radius: calc(var(--mp-r) - 4px); overflow: hidden; background: #000; }
.mp-novideo .mp-video { aspect-ratio: auto; min-height: 0; height: 0; }
.mp-video iframe, .mp-video > div { position: absolute; inset: 0; width: 100%; height: 100%; }
.mp-empty { display: none; place-items: center; color: #cfd8da; font-size: 13px; padding: 12px; text-align: center; }
.mp-none .mp-empty { display: grid; }
.mp-now { display: flex; align-items: stretch; gap: 10px; }
.mp-novideo .mp-video { margin: 0; }
.mp-ctl button[aria-pressed="true"] { color: var(--mp-accent); }
.mp-meta { flex: 1; min-width: 0; } .mp-meta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.mp-meta small { color: var(--mp-muted); font-size: 12px; }
.mp-panel button, .mp-dlg button { font: inherit; color: inherit; border: 0; background: transparent; cursor: pointer; border-radius: var(--mp-r); }
.mp-sr { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mp-art { position: relative; width: 84px; flex: none; align-self: stretch; margin: -12px 0 -12px -12px; background: var(--mp-hover); display: grid; place-items: center; color: var(--mp-muted); overflow: hidden; }
.mp-left .mp-art { margin-left: calc(-12px - env(safe-area-inset-left, 0px)); }
.mp-art svg { width: 28px; height: 28px; }
.mp-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mp-thumb[hidden] { display: none; }
.mp-meta b { cursor: pointer; font-size: 14px; padding-top: 4px; margin-bottom: 2px; }
.mp-lists .mp-sel { flex: 1; }
.mp-count { color: var(--mp-muted); font-size: 12px; padding: 0 4px; white-space: nowrap; }
.mp-ctl { display: flex; justify-content: space-between; margin-top: 2px; }
.mp-ctl button { width: 40px; height: 40px; font-size: 19px; border-radius: 50% !important; }
.mp-ctl .mp-main svg { width: 26px !important; height: 26px !important; }
@media (hover: hover) { .mp-panel button:hover { background: var(--mp-hover); } }
.mp-panel .mp-main { color: var(--mp-accent); }
.mp-dlg .mp-main { background: var(--mp-accent) !important; color: var(--mp-accent-fg); }
.mp-panel button svg, .mp-dlg button svg { width: 22px; height: 22px; display: block; margin: auto; pointer-events: none; }
.mp-ctl .mp-main svg { width: 30px; height: 30px; }
.mp-items li button svg, .mp-lists button svg { width: 18px; height: 18px; }
/* 手指按下去時不要出現外框、陰影或底色（只有鍵盤操作才顯示外框） */
.mp-tab { outline: none; }
.mp-panel button { outline: none; box-shadow: none; -webkit-appearance: none; appearance: none; }
.mp-panel button:active { background: transparent; opacity: .6; }

/* 清單 */
.mp-sheet { margin-top: 8px; border-top: 1px solid var(--mp-line); padding-top: 10px; display: grid; gap: 8px; }
.mp-sheet[hidden] { display: none; }
.mp-lists { display: flex; gap: 4px; align-items: center; }
.mp-lists button { width: 40px; height: 40px; flex: none; }
.mp-sel, .mp-in { font: inherit; color: inherit; min-height: 40px; padding: 0 10px; border: 1px solid var(--mp-line); border-radius: 10px;
  background: transparent; box-sizing: border-box; width: 100%; min-width: 0; -webkit-user-select: text; user-select: text; }
.mp-sel option { color: #17262a; }
/* 大卡片：電腦從貼邊那一側滑出整面（約 400px），手機全螢幕；霧面半透明，下面的桌面還隱約看得到 */
.mp-panel.mp-big { top: 0 !important; bottom: 0; height: 100dvh; max-height: none; width: min(400px, 100vw); border-radius: 0; overscroll-behavior: contain;
  display: flex; flex-direction: column; padding-top: calc(12px + env(safe-area-inset-top, 0px)); padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
.mp-panel.mp-big.mp-float { left: auto !important; right: 0; border-radius: 0; }
.mp-big .mp-sheet { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.mp-big .mp-sheet[hidden] { display: none; }
.mp-big .mp-items { flex: 1; }
.mp-items { align-content: start; }
.mp-yt-head { font-size: 12px; color: var(--mp-muted); font-weight: 700; padding: 8px 4px 2px !important; min-height: 0 !important; cursor: default !important; }
.mp-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--mp-hover); }
.mp-tabs button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; border-radius: 9px !important; font-size: 14px; font-weight: 700; color: var(--mp-muted) !important; }
.mp-tabs button svg { width: 18px; height: 18px; margin: 0; }
.mp-tabs button[aria-selected="true"] { background: var(--mp-glass); color: var(--mp-accent) !important; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.mp-tabs button:disabled { opacity: .4; cursor: default; }
.mp-showlyr > :not(.mp-tabs):not(.mp-lyrics) { display: none !important; }
.mp-lyrics { padding: 4px 4px 16px; max-height: 45vh; overflow: auto; -webkit-user-select: text; user-select: text; }
.mp-lyrics[hidden] { display: none; }
.mp-big .mp-lyrics { flex: 1; min-height: 0; max-height: none; }
.mp-lyr-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: -4px; background: var(--mp-glass); padding: 6px 0; }
.mp-lyr-h { flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 0 10px; margin-bottom: 6px; border-bottom: 1px solid var(--mp-line); }
/* 歌名當標題（大、粗、主色），上面一行小字「歌詞」；歌詞本文一般字重，兩者一眼分得開 */
.mp-lyr-h b { font-size: 20px; line-height: 1.35; color: var(--mp-accent); }
/* 歌詞：靠左、適合閱讀的字級（電腦 17px，手機 18px），段落間空行保留 */
.mp-lyr-t { white-space: pre-wrap; font-size: 17px; line-height: 1.85; text-align: left; padding: 4px 0 8px; letter-spacing: .02em; }
@media (max-width: 600px) { .mp-lyr-t { font-size: 18px; } }
.mp-big .mp-items { max-height: none; }
@media (max-width: 600px) { .mp-panel.mp-big { width: 100vw; left: 0 !important; right: 0; border: 0; } }
.mp-msg { font-size: 12px; color: var(--mp-muted); min-height: 1em; }
.mp-msg:empty { display: none; }
.mp-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 40vh; overflow: auto; }
.mp-items li { display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 10px; cursor: pointer; min-height: 44px; }
@media (hover: hover) { .mp-items li:hover { background: var(--mp-hover); } }
.mp-items li.mp-cur { color: var(--mp-accent); font-weight: 700; }
.mp-items img { width: 56px; height: 32px; object-fit: cover; border-radius: 6px; flex: none; }
.mp-items span { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mp-items li button { width: 36px; height: 36px; flex: none; color: var(--mp-muted); }
.mp-hidden { position: fixed; left: -9999px; top: 0; width: 200px; height: 200px; }

.mp-dlg { border: 1px solid var(--mp-line); border-radius: 18px; background: var(--mp-glass); padding: 16px; width: min(320px, calc(100vw - 32px)); box-sizing: border-box; }
.mp-dlg::backdrop { background: rgba(0,0,0,.3); }
.mp-dlg form { display: grid; gap: 12px; }
.mp-dlg-btns { display: flex; justify-content: flex-end; gap: 8px; }
.mp-dlg-btns button { min-height: 40px; padding: 0 16px; }

@media (hover: hover) and (pointer: fine) { .mp-panel button:focus-visible { outline: 2px solid var(--mp-accent); outline-offset: -2px; } }
@media (prefers-reduced-motion: reduce) { .mp-tab, .mp-panel, .mp-tab svg { transition: none; } }
.mp-panel:not(.mp-novideo) .mp-art { margin-top: 0; }

/* 拖曳排序、打字建議 */
.mp-items .mp-grip { cursor: grab; touch-action: none; }
.mp-items.mp-dragging li { transition: transform .15s; }
.mp-items li.mp-drag { transition: none; position: relative; z-index: 1; background: var(--mp-hover); box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.mp-items.mp-dragging .mp-grip { cursor: grabbing; }
.mp-items li.mp-sug { min-height: 40px; padding-left: 12px; }
.mp-items li.mp-sug svg { width: 18px; height: 18px; flex: none; color: var(--mp-muted); }

/* 搜尋框自己的 ✕（各瀏覽器一致）、加歌提示、播放方式鈕、清單下拉對比 */
.mp-inw { position: relative; }
.mp-inw .mp-in { padding-right: 40px; }
.mp-inw .mp-in::-webkit-search-cancel-button { display: none; }
.mp-inw button { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; color: var(--mp-muted); }
.mp-inw button svg { width: 18px; height: 18px; }
.mp-inw[hidden] { display: none; }
.mp-toast { position: absolute; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 3; display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 14px; border-radius: 10px; background: #263238; color: #fff; font-size: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.mp-toast[hidden] { display: none; }
.mp-toast span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-panel .mp-toast button { color: #7fdbe3; font-weight: 700; padding: 8px 12px; }
html.dark .mp-toast { background: #e6eef0; color: #17262a; } html.dark .mp-panel .mp-toast button { color: #007E8A; }
.mp-items li.mp-flash { background: var(--mp-hover); box-shadow: inset 3px 0 0 var(--mp-accent); }
.mp-ctl .mp-act { color: var(--mp-accent); }
.mp-sel { background: var(--mp-glass); }
.mp-sel option { background: #fff; color: #17262a; }
html.dark .mp-sel { color-scheme: dark; } html.dark .mp-sel option { background: #1a2427; color: #e6eef0; }

/* 共用清單提示、新增清單的「只有我／家人共用」選項、🔍 按下狀態 */
.mp-shared-note { font-size: 12px; color: var(--mp-muted); margin-top: -4px; }
.mp-shared-note[hidden] { display: none; }
.mp-lists [aria-pressed="true"] { color: var(--mp-accent); }
.mp-dlg-note { margin: 0; font-size: 13px; color: #b45309; }
.mp-dlg-share { display: flex; gap: 16px; font-size: 14px; }
.mp-dlg-share label { display: flex; align-items: center; gap: 6px; cursor: pointer; min-height: 36px; }
/* 大卡片：縮圖下緣剛好貼齊分隔線，不再超出 */
.mp-big .mp-sheet { margin-top: 12px; }

/* 清單選單（取代原生下拉）：參照 Apple／Material 選單——列高 44px、左右 12px、字 15px，分組標題 12px 淡色、無圖示，目前項目打勾 */
.mp-selw { position: relative; flex: 1; min-width: 0; }
.mp-panel .mp-sel { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; border: 1px solid var(--mp-line); border-radius: 10px; }
.mp-sel span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-panel .mp-sel svg { width: 18px; height: 18px; margin: 0; color: var(--mp-muted); }
.mp-menu { position: absolute; left: 0; top: calc(100% + 4px); z-index: 5; min-width: 100%; max-width: 280px; max-height: 50vh; overflow: auto; padding: 6px 0;
  border-radius: 12px; background: #fff; border: 1px solid var(--mp-line); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
html.dark .mp-menu { background: #1f2b2e; }
.mp-menu[hidden] { display: none; }
.mp-mh { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--mp-muted); padding: 10px 16px 4px; }
.mp-mh:first-child { padding-top: 4px; }
.mp-panel .mp-menu button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 12px 0 16px; border-radius: 0; font-size: 15px; text-align: left; }
.mp-menu button span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-panel .mp-menu button svg { width: 18px; height: 18px; margin: 0; color: var(--mp-accent); }
.mp-menu button[aria-selected="true"] { color: var(--mp-accent); font-weight: 700; }
.mp-menu button:focus-visible { background: var(--mp-hover); }

/* ⋯ 選單（靠右展開）與原位改名 */
.mp-morew { position: relative; flex: none; }
.mp-panel .mp-moremenu { left: auto; right: 0; min-width: 160px; }
.mp-panel .mp-moremenu .mp-danger { color: #d93025; }
html.dark .mp-panel .mp-moremenu .mp-danger { color: #f28b82; }
.mp-panel .mp-rename { position: absolute; inset: 0; z-index: 2; border-color: var(--mp-accent); background: var(--mp-glass); }

/* 歌詞頁排版（參照 Apple Music／Spotify）：不包框、不用色塊；左右留 16px 呼吸空間，歌名主色大字當標題、下面留白分開，
   上下邊緣淡出（捲動時文字自然消失，不會被切一刀）。沒有歌詞時顯示「暫無歌詞」 */
.mp-lyrics { padding: 12px 16px 32px; -webkit-mask-image: linear-gradient(transparent, #000 16px, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(transparent, #000 16px, #000 calc(100% - 32px), transparent); }
.mp-lyr-h { position: static; background: none; border: 0; padding: 4px 0 0; margin: 0 0 16px; }
.mp-lyr-h b { font-size: 22px; font-weight: 800; line-height: 1.3; }
.mp-lyrics.mp-nolyr .mp-lyr-t::before { content: '暫無歌詞'; color: var(--mp-muted); }
