:root{--bg:#0b0b0b;--surface:#181818;--surface2:#242424;--muted:#aaa;--accent:#ff2d55;--header-h:64px;--player-h:72px;--nav-h:56px;--cover-a:#3b3b52;--cover-b:#1c1c28;--safe-top:env(safe-area-inset-top,0px);--safe-bottom:env(safe-area-inset-bottom,0px)}
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
[hidden]{display:none!important}
html{color-scheme:dark;overflow-x:hidden;max-width:100%}
body{background:var(--bg);color:#fff;font-family:-apple-system,"Segoe UI","Noto Sans TC","PingFang TC","Microsoft JhengHei",Roboto,sans-serif;overflow:hidden;max-width:100%;height:100vh;height:100dvh}
button{background:none;border:0;color:inherit;cursor:pointer;font:inherit;display:inline-flex;align-items:center;justify-content:center}
button:disabled{cursor:default;opacity:.4}
svg{width:24px;height:24px;fill:currentColor;flex-shrink:0}
ul{list-style:none}
audio{display:none}

header{position:fixed;top:0;left:0;right:0;height:calc(var(--header-h) + var(--safe-top));padding:var(--safe-top) 16px 0;display:flex;align-items:center;gap:12px;background:rgba(11,11,11,.92);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);z-index:30;border-bottom:1px solid #222}
.logo{display:flex;align-items:center;gap:8px;font-weight:700;font-size:20px;letter-spacing:-.5px;white-space:nowrap}
.logo i{width:28px;height:28px;border-radius:50%;background:conic-gradient(var(--accent),#ff8a00,var(--accent));display:grid;place-items:center}
.logo i::after{content:"";border-left:9px solid #fff;border-top:6px solid transparent;border-bottom:6px solid transparent;margin-left:2px}
.search{flex:1;max-width:560px;margin:0 auto;display:flex;align-items:center;gap:8px;background:var(--surface2);border-radius:10px;padding:0 14px;height:42px;color:var(--muted);min-width:0}
.search input{flex:1;background:none;border:0;outline:0;color:#fff;font:inherit;font-size:15px;min-width:0;-webkit-appearance:none;appearance:none}
.search input::-webkit-search-cancel-button{-webkit-appearance:none}
.avatar{width:36px;height:36px;border-radius:50%;background:linear-gradient(135deg,#7f5af0,#2cb67d);margin-left:auto;flex-shrink:0}
.avatar svg{width:20px;height:20px}

aside{position:fixed;top:calc(var(--header-h) + var(--safe-top));bottom:var(--player-h);left:0;width:220px;padding:12px;border-right:1px solid #222;overflow-y:auto;z-index:20;background:var(--bg)}
.navitem{display:flex;align-items:center;gap:20px;width:100%;padding:12px 16px;border-radius:10px;color:#ddd;font-size:15px;justify-content:flex-start}
.navitem:hover{background:var(--surface)}
.navitem.active{background:var(--surface2);color:#fff;font-weight:600}
.side-sep{height:1px;background:#222;margin:12px 0}
.side-note{padding:8px 16px;color:var(--muted);font-size:12px;line-height:1.6}

main{position:fixed;top:calc(var(--header-h) + var(--safe-top));left:220px;right:0;bottom:var(--player-h);overflow-y:auto;overflow-x:hidden;padding:20px 28px 40px}
.chips{display:flex;gap:8px;overflow-x:auto;padding-bottom:6px;scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.chip{padding:8px 16px;border-radius:8px;background:var(--surface2);font-size:14px;white-space:nowrap;flex-shrink:0}
.chip.active,.chip:hover{background:#fff;color:#000}
section{margin-top:28px;min-width:0}
.chips + section{margin-top:24px}
.sec-head{display:flex;align-items:flex-end;justify-content:space-between;margin-bottom:14px;gap:8px}
.sec-head small{color:var(--muted);font-size:12px;letter-spacing:1px;display:block;margin-bottom:2px}
.sec-head h2{font-size:28px;font-weight:700}
.sec-head .more{border:1px solid #444;border-radius:16px;padding:6px 14px;font-size:13px;white-space:nowrap;flex-shrink:0}
.sec-head .more:hover{background:var(--surface2)}
.hint,.empty{color:var(--muted);font-size:14px;padding:4px 0 14px}
.empty{padding:32px 0;text-align:center}

/* 封面：全部統一使用同一個音符背景 */
.cover{aspect-ratio:1;border-radius:8px;display:grid;place-items:center;font-size:32px;position:relative;overflow:hidden;background:linear-gradient(135deg,var(--cover-a),var(--cover-b))}
.cover::before{content:"🎵"}
.cover::after{content:"";position:absolute;inset:0;background:radial-gradient(circle at 30% 20%,rgba(255,255,255,.18),transparent 55%)}

.quick{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(360px,100%),1fr));gap:4px 24px}
.quick > *{min-width:0}
.row{display:flex;align-items:center;gap:12px;padding:6px 8px;border-radius:8px;cursor:pointer;position:relative;min-width:0}
.row:hover,.row.playing{background:var(--surface)}
.row .cover{width:48px;font-size:20px;flex-shrink:0;border-radius:4px}
.row .info{flex:1;min-width:0}
.t{font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.a{font-size:13px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}
.row.playing .t{color:var(--accent)}
.row .dur{color:var(--muted);font-size:13px;white-space:nowrap;flex-shrink:0}
.rbtn,.grip{width:36px;height:36px;border-radius:50%;color:#ccc;opacity:.55;flex-shrink:0}
.rbtn:hover,.grip:hover{opacity:1;background:#2a2a2a;color:#fff}
.grip{cursor:grab;touch-action:none;opacity:.7}
.row.dragging{background:rgba(255,255,255,.2)!important;box-shadow:0 6px 20px rgba(0,0,0,.55);z-index:2;opacity:.95}

.player{position:fixed;left:0;right:0;bottom:0;height:var(--player-h);background:#181818;z-index:40;display:grid;grid-template-columns:1fr 2fr 1fr;align-items:center;padding:0 16px;gap:16px}
.bar-progress{position:absolute;top:-8px;left:0;right:0;height:16px}
input[type=range]{-webkit-appearance:none;appearance:none;width:100%;height:4px;border-radius:2px;background:linear-gradient(to right,var(--accent) var(--p,0%),#4a4a4a var(--p,0%));outline:0;cursor:pointer}
input[type=range]:disabled{cursor:default;opacity:1}
input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:0;height:0;border-radius:50%;background:#fff;transition:.15s}
input[type=range]:not(:disabled):hover::-webkit-slider-thumb,.full input[type=range]:not(:disabled)::-webkit-slider-thumb{width:13px;height:13px}
input[type=range]::-moz-range-thumb{width:0;height:0;border:0}
input[type=range]:not(:disabled):hover::-moz-range-thumb,.full input[type=range]:not(:disabled)::-moz-range-thumb{width:13px;height:13px;border:0;background:#fff;border-radius:50%}
.bar-progress input{position:absolute;top:6px;height:3px;border-radius:0}
.ctrls{display:flex;align-items:center;gap:6px;justify-self:start}
.ctrls button{width:44px;height:44px;border-radius:50%}
.ctrls button:hover{background:#2a2a2a}
.ctrls .big{width:48px;height:48px}
.ctrls .big svg{width:36px;height:36px}
.time{font-size:12px;color:var(--muted);margin-left:10px;white-space:nowrap}
.now{display:flex;align-items:center;gap:12px;min-width:0;justify-self:center;width:100%;max-width:520px;cursor:pointer}
.now .cover{width:48px;font-size:20px;border-radius:4px;flex-shrink:0}
.now .info{min-width:0;flex:1}
.right{display:flex;align-items:center;gap:4px;justify-self:end}
.right button{width:40px;height:40px;border-radius:50%;color:#ccc}
.right button:hover{background:#2a2a2a;color:#fff}
.right button.on{color:var(--accent)}
.vol{display:flex;align-items:center;width:130px}

.toast{position:fixed;left:50%;bottom:calc(var(--player-h) + 16px);transform:translate(-50%,8px);max-width:min(560px,calc(100vw - 32px));background:#2a2a2a;color:#fff;font-size:13px;line-height:1.5;padding:10px 16px;border-radius:12px;box-shadow:0 8px 30px rgba(0,0,0,.5);z-index:55;opacity:0;pointer-events:none;transition:.2s;overflow-wrap:anywhere}
.toast.show{opacity:1;transform:translate(-50%,0)}
.mini,.bottom-nav{display:none}

.full{position:fixed;inset:0;z-index:60;overflow:hidden;background:linear-gradient(180deg,var(--cover-a),#0b0b0b 85%);transform:translateY(100%);visibility:hidden;transition:transform .35s cubic-bezier(.2,.8,.2,1),visibility 0s .35s;display:flex;flex-direction:column;padding:var(--safe-top) 0 var(--safe-bottom)}
.full.open{transform:none;visibility:visible;transition:transform .35s cubic-bezier(.2,.8,.2,1),visibility 0s}
.full-top{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;flex-shrink:0}
.full-top > button{width:44px;height:44px;border-radius:50%;flex-shrink:0}
.full-top > button:hover{background:rgba(255,255,255,.1)}
.tabs{display:flex;gap:4px;background:rgba(0,0,0,.3);border-radius:20px;padding:3px}
.tab{padding:6px 18px;border-radius:16px;font-size:14px;color:#ccc;white-space:nowrap}
.tab.active{background:rgba(255,255,255,.18);color:#fff}
.full-body{flex:1;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:minmax(0,1fr);gap:40px;padding:0 48px 16px;min-height:0;max-width:1200px;width:100%;margin:0 auto;overflow:hidden}
.left-pane{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:22px;min-height:0;min-width:0}
.left-pane > *{min-width:0;max-width:100%}
.big-cover{width:min(100%,46vh,440px);font-size:110px;border-radius:12px;box-shadow:0 20px 60px rgba(0,0,0,.5);transition:transform .3s}
.big-cover.paused{transform:scale(.92)}
.meta{width:min(100%,440px);min-width:0}
.meta .t{font-size:22px;font-weight:700;white-space:normal;overflow:hidden;overflow-wrap:anywhere;word-break:break-word;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;text-overflow:clip}
.meta .a{font-size:15px}
.seek{width:min(100%,440px)}
.seek .times{display:flex;justify-content:space-between;font-size:12px;color:#bbb;margin-top:8px}
.fctrls{display:flex;align-items:center;gap:10px;width:min(100%,440px);justify-content:space-between}
.fctrls button{width:48px;height:48px;border-radius:50%;flex-shrink:0}
.fctrls button.on{color:var(--accent)}
.fctrls .play-big{width:68px;height:68px;background:#fff;color:#000}
.fctrls .play-big svg{width:38px;height:38px}
.queue{overflow-y:auto;overflow-x:hidden;min-height:0;min-width:0;padding:4px 0}
.queue-head{display:flex;align-items:center;justify-content:space-between;margin:6px 8px 10px;gap:8px}
.queue-head h3{font-size:14px;color:#ccc;font-weight:500}
.queue-head button{border:1px solid rgba(255,255,255,.3);border-radius:14px;padding:4px 12px;font-size:12px}
.queue .row:hover,.queue .row.playing{background:rgba(255,255,255,.1)}
.queue .note{color:#ccc;font-size:13px;padding:8px;line-height:1.5}

.login{position:fixed;inset:0;background:rgba(0,0,0,.75);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);display:none;align-items:center;justify-content:center;padding:16px;z-index:80}
.login.show{display:flex}
.login .box{background:var(--surface);border:1px solid #2a2a2a;border-radius:16px;padding:28px 24px;width:100%;max-width:340px;display:flex;flex-direction:column;gap:14px}
.login .logo{justify-content:center;font-size:22px}
.login p{color:var(--muted);font-size:13px;text-align:center}
.login input{background:var(--surface2);border:1px solid transparent;border-radius:10px;padding:12px 14px;color:#fff;font:inherit;font-size:15px;outline:0;min-width:0}
.login input:focus{border-color:var(--accent)}
.login .err{color:#ff6b81;font-size:13px;min-height:1.2em;text-align:center}
.login .go{background:var(--accent);color:#fff;border-radius:22px;padding:12px;font-weight:600}

@media (max-width:1100px){.vol{display:none}.player{grid-template-columns:auto 1fr auto}}
@media (max-width:900px){aside{display:none}main{left:0}.time{display:none}}
@media (max-width:700px){
  :root{--header-h:56px}
  header{padding-left:16px;padding-right:12px}
  .logo span{display:none}
  .login .logo span{display:inline}
  .search{margin:0}
  main{padding:12px 16px 24px;bottom:calc(var(--nav-h) + var(--safe-bottom) + 70px)}
  .sec-head h2{font-size:22px}
  .quick{grid-template-columns:minmax(0,1fr)}
  .toast{bottom:calc(var(--nav-h) + var(--safe-bottom) + 76px)}
  .player{display:none}
  .mini{display:block;position:fixed;left:8px;right:8px;bottom:calc(var(--nav-h) + var(--safe-bottom) + 6px);height:56px;background:#2a2a2a;border-radius:10px;z-index:40;overflow:hidden}
  .mini-in{display:flex;align-items:center;gap:12px;height:100%;padding:0 6px 3px 8px;min-width:0}
  .mini .cover{width:40px;font-size:16px;border-radius:4px;flex-shrink:0}
  .mini .info{flex:1;min-width:0}
  .mini button{width:42px;height:42px;border-radius:50%;flex-shrink:0}
  .mini-prog{position:absolute;left:0;bottom:0;height:2px;background:var(--accent);width:0}
  .bottom-nav{display:flex;position:fixed;left:0;right:0;bottom:0;height:calc(var(--nav-h) + var(--safe-bottom));padding-bottom:var(--safe-bottom);background:#121212;z-index:35;border-top:1px solid #222}
  .bottom-nav button{flex:1;flex-direction:column;gap:2px;font-size:11px;color:var(--muted)}
  .bottom-nav button.active{color:#fff}
  .full-body{grid-template-columns:minmax(0,1fr);padding:0 24px 16px;gap:0}
  .full-body .queue{display:none}
  .full[data-tab="queue"] .left-pane{display:none}
  .full[data-tab="queue"] .queue{display:block;height:100%}
  .big-cover{width:min(100%,36vh);font-size:80px}
  .left-pane{gap:16px;overflow:hidden}
  .meta .t{font-size:20px}
}
@media (min-width:701px){.tabs{display:none}}

/* ── 播放清單 / 離線下載 ── */
.pl-actions{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px}
.pl-actions .more{border:1px solid #444;border-radius:16px;padding:8px 14px;font-size:13px;white-space:nowrap}
.pl-actions .more:hover{background:var(--surface2)}
.pl-actions .more.danger{color:#ff6b81;border-color:#5a2a33}
.quick.single{grid-template-columns:minmax(0,1fr)}
.row.offline .t::before{content:"✓ ";color:var(--accent)}
.row.missing{opacity:.5}
.rbtn.done{color:var(--accent);opacity:1}
#plLists + .empty{padding:24px 0}
.offline-box{margin-top:24px;display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.offline-box .hint{padding:0}
.offline-box .more{border:1px solid #444;border-radius:16px;padding:6px 14px;font-size:13px;white-space:nowrap}
.pick-list{max-height:40vh;overflow-y:auto;display:flex;flex-direction:column;gap:2px;list-style:none}
.pick-list .note{color:var(--muted);font-size:13px;text-align:center;padding:12px}
.login .go.ghost{background:var(--surface2)}
.login .go.alt{background:var(--surface2);border:1px solid var(--accent)}
.login .box > p.ttl{color:#fff;font-size:16px;font-weight:600}

/* ── 歌曲列「⋮」選單 ── */
.row .a:empty{display:none}
.rbtn[data-dlmenu]{opacity:.8}
.row-menu{position:fixed;z-index:70;min-width:210px;max-width:min(300px,calc(100vw - 16px));background:#2a2a2a;border:1px solid #3a3a3a;border-radius:12px;box-shadow:0 10px 36px rgba(0,0,0,.6);padding:6px;display:flex;flex-direction:column}
.menu-item{display:flex;align-items:center;gap:12px;width:100%;padding:11px 12px;border-radius:8px;font-size:14px;justify-content:flex-start;text-align:left}
.menu-item:hover{background:#383838}
.menu-item svg{width:20px;height:20px}
.menu-item.done{color:var(--accent)}
.menu-sep{height:1px;background:#3a3a3a;margin:6px 4px}
.menu-info{padding:6px 12px 8px;font-size:12px;color:var(--muted);line-height:1.8;overflow-wrap:anywhere}
.menu-info b{color:#ddd;font-weight:500;margin-right:4px}

/* ── 播放清單內頁(設計稿版) ── */
body.pl-detail header .search{visibility:hidden}
#plDetailPane{max-width:720px}
.pl-top{display:flex;align-items:center;gap:12px;height:48px}
.pl-icon{width:40px;height:40px;border-radius:50%;color:#ddd;flex-shrink:0}
.pl-icon:hover{background:#222}
.pl-search{flex:1;display:flex;align-items:center;gap:8px;background:#1c1c1c;border-radius:12px;padding:0 14px;height:40px;color:#888;min-width:0}
.pl-search svg{width:20px;height:20px}
.pl-search input{flex:1;background:none;border:0;outline:0;color:#fff;font:inherit;font-size:14px;min-width:0;-webkit-appearance:none;appearance:none}
.pl-search input::-webkit-search-cancel-button{-webkit-appearance:none}
.pl-header{display:flex;gap:16px;align-items:center;margin:20px 0 18px}
.pl-cover{width:96px;font-size:40px;border-radius:12px;box-shadow:0 8px 24px rgba(0,0,0,.5);flex-shrink:0;background:linear-gradient(135deg,#4b3f8f,#1d1a3a)}
.pl-meta{min-width:0}
.pl-meta h1{font-size:24px;margin-bottom:4px;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.pl-meta p{font-size:13px;color:#888}
.pl-actions{display:flex;align-items:center;gap:10px;margin-bottom:12px;position:relative;flex-wrap:nowrap}
.pl-play{flex:1;height:46px;border-radius:23px;background:#fff;color:#000;font-size:15px;font-weight:700;gap:6px}
.pl-play:hover{background:#e6e6e6}
.pl-play svg{width:22px;height:22px}
.pl-circle{width:46px;height:46px;border-radius:50%;border:1px solid #333;background:#141414;color:#fff;flex-shrink:0}
.pl-circle:hover{background:#222}
.pl-circle.done{color:var(--accent)}
.pl-menu{position:absolute;right:0;top:54px;background:#1c1c1c;border:1px solid #2e2e2e;border-radius:12px;padding:6px;min-width:180px;display:none;z-index:10;box-shadow:0 10px 30px rgba(0,0,0,.6)}
.pl-menu.show{display:block}
.pl-menu button{width:100%;justify-content:flex-start;text-align:left;gap:10px;color:#eee;padding:11px 12px;border-radius:8px;font-size:14px}
.pl-menu button:hover{background:#2a2a2a}
.pl-menu .danger{color:#ff6b6b}
.pl-menu hr{border:0;border-top:1px solid #2e2e2e;margin:4px 0}
#plItems{margin-top:8px}
#plItems .row{padding:8px;border-radius:12px;gap:12px}
#plItems .cover{width:48px;border-radius:8px;background:linear-gradient(135deg,#3a3560,#1a1a2e)}
#plItems .cover::before{content:"♪";font-size:20px;color:#8b7fd8}
#plItems .t{font-weight:600}
#plItems .a{font-size:12px;color:#777;margin-top:3px}
#plItems .grip{color:#555}
.menu-item.danger{color:#ff6b6b}

/* ── 播放清單:總覽卡片 + 電腦版內頁雙欄 ── */
#plNew{background:#fff;color:#000;border:0;font-weight:700;padding:9px 18px;font-size:14px}
#plNew:hover{background:#e6e6e6}
#plLists{grid-template-columns:minmax(0,1fr);gap:4px}
.pl-card{display:flex;align-items:center;gap:12px;padding:8px;border-radius:12px;cursor:pointer;position:relative;min-width:0}
.pl-card:hover{background:var(--surface)}
.pl-card-art{position:relative;flex-shrink:0;width:48px}
.pl-card .cover{width:100%;border-radius:8px;background:linear-gradient(135deg,#3a3560,#1a1a2e)}
.pl-card .cover::before{content:"♪";font-size:20px;color:#8b7fd8}
.pl-card-info{flex:1;min-width:0}
.pl-card .t{font-weight:600}
.pl-card .a{font-size:12px;color:#777;margin-top:3px}
.pl-card-play{display:none}
.pl-card-pm{width:40px;height:40px;border-radius:50%;color:#ccc;flex-shrink:0}
.pl-card-pm:hover{background:#2a2a2a;color:#fff}

@media (min-width:701px){
  #plLists{grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:20px 18px}
  .pl-card{flex-direction:column;align-items:stretch;gap:12px;padding:12px;background:var(--surface)}
  .pl-card:hover{background:var(--surface2)}
  .pl-card-art{width:100%}
  .pl-card .cover{border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.45)}
  .pl-card .cover::before{font-size:44px}
  .pl-card-pm{display:none}
  .pl-card-play{display:grid;place-items:center;position:absolute;right:10px;bottom:10px;width:44px;height:44px;border-radius:50%;background:var(--accent);color:#fff;box-shadow:0 6px 16px rgba(0,0,0,.5);opacity:0;transform:translateY(6px);transition:.15s}
  .pl-card:hover .pl-card-play,.pl-card-play:focus-visible{opacity:1;transform:none}
}
@media (min-width:701px) and (hover:none){
  .pl-card-play{opacity:1;transform:none}
}

.pl-search{max-width:460px}
@media (min-width:760px){
  #plDetailPane{max-width:1100px;display:grid;grid-template-columns:300px minmax(0,1fr);grid-template-areas:"top top" "side list";column-gap:40px;align-items:start}
  .pl-top{grid-area:top}
  .pl-side{grid-area:side;position:sticky;top:8px}
  .pl-header{flex-direction:column;align-items:flex-start;gap:18px;margin:12px 0 18px}
  .pl-cover{width:240px;font-size:84px;border-radius:14px}
  .pl-meta h1{font-size:30px}
  #plItems{grid-area:list;margin-top:0}
  #plItemsEmpty{grid-area:list}
}
