/* YouTube 背景音樂播放器 by chuan0418 */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono&family=DM+Sans:wght@300;400;500&display=swap');

.yt-music-wrap {
  font-family: 'DM Sans', sans-serif;
  background: #f0f6ff; border: 1px solid #c8dcf5; border-radius: 7px;
  padding: 20px 24px; max-width: 480px; margin: 0 auto;
  color: #1a2e4a; box-shadow: 0 8px 32px rgba(59,120,220,0.1);
}
#yt-iframe-container { position: fixed; top: 0; left: -320px; width: 320px; height: 180px; pointer-events: none; }
.yt-header { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.yt-icon { width: 32px; height: 32px; background: #2d7ff9; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 4px 12px rgba(45,127,249,0.3); }
.yt-icon svg { width: 16px; height: 16px; fill: #fff; }
.yt-label { font-size: 22px; font-weight: 700; color: #2d7ff9; }
.yt-visualizer { display: flex; align-items: flex-end; gap: 3px; height: 24px; margin-left: auto; }
.yt-visualizer span { display: block; width: 3px; background: #2d7ff9; border-radius: 2px; opacity: 0.5; transform-origin: bottom; }
.yt-visualizer.playing span { animation: bar-dance 0.8s ease-in-out infinite alternate; }
.yt-visualizer span:nth-child(1) { height: 8px; }
.yt-visualizer span:nth-child(2) { height: 16px; animation-delay: .15s; }
.yt-visualizer span:nth-child(3) { height: 12px; animation-delay: .3s; }
.yt-visualizer span:nth-child(4) { height: 20px; animation-delay: .1s; }
.yt-visualizer span:nth-child(5) { height: 10px; animation-delay: .25s; }
@keyframes bar-dance { from { transform: scaleY(0.3); opacity: 0.3; } to { transform: scaleY(1.4); opacity: 1; } }
.yt-track-info { margin-bottom: 16px; min-height: 44px; }
.yt-marquee-wrap { overflow: hidden; white-space: nowrap; margin-bottom: 4px; }
.yt-marquee-wrap.has-fade { mask-image: linear-gradient(to right, black calc(100% - 28px), transparent 100%); -webkit-mask-image: linear-gradient(to right, black calc(100% - 28px), transparent 100%); }
.yt-track-title { font-size: 15px; font-weight: 500; color: #000; display: inline-block; white-space: nowrap; }
.yt-track-meta { font-family: 'DM Mono', monospace; font-size: 11px; color: #7aa3cc; letter-spacing: .05em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.yt-progress-wrap { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.yt-time { font-family: 'DM Mono', monospace; font-size: 10px; color: #a0bedd; flex-shrink: 0; min-width: 32px; }
.yt-time.right { text-align: right; }
.yt-progress-bar { flex: 1; height: 4px; background: #c8dcf5; border-radius: 4px; position: relative; cursor: pointer; overflow: hidden; }
.yt-progress-fill { height: 100%; background: #2d7ff9; border-radius: 4px; width: 0%; transition: width .5s linear; pointer-events: none; }
.yt-progress-bar::after { content: ''; position: absolute; top: 50%; right: calc(100% - var(--pct,0%) - 6px); transform: translateY(-50%); width: 12px; height: 12px; border-radius: 50%; background: #2d7ff9; box-shadow: 0 2px 6px rgba(45,127,249,.4); opacity: 0; transition: opacity .15s; pointer-events: none; }
.yt-progress-bar:hover::after { opacity: 1; }
.yt-progress-bar:hover .yt-progress-fill { transition: none; }
.yt-controls { display: flex; align-items: center; gap: 12px; }
.yt-btn { background: none; border: none; cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; color: #a0bedd; transition: color .2s, transform .15s; }
.yt-btn:hover { color: #2d7ff9; transform: scale(1.1); }
.yt-btn:active { transform: scale(0.95); }
.yt-btn-play { width: 44px; height: 44px; background: #2d7ff9; border-radius: 50%; color: #fff; flex-shrink: 0; box-shadow: 0 4px 16px rgba(45,127,249,.4); transition: background .2s, transform .15s, box-shadow .2s; }
.yt-btn-play:hover { background: #1a6fe8; box-shadow: 0 6px 22px rgba(45,127,249,.55); transform: scale(1.05); }
.yt-track-index { font-family: 'DM Mono', monospace; font-size: 10px; color: #a0bedd; margin-left: 4px; }
.yt-open-btn { display: flex; align-items: center; justify-content: center; margin-left: auto; width: 32px; height: 32px; border-radius: 8px; border: 1px solid #c8dcf5; background: #fff; color: #2d7ff9; text-decoration: none; flex-shrink: 0; transition: background .15s, border-color .15s, box-shadow .15s; }
.yt-open-btn:hover { background: #eaf2ff; border-color: #2d7ff9; box-shadow: 0 2px 8px rgba(45,127,249,.15); }
.yt-status-dot { width: 6px; height: 6px; border-radius: 50%; background: #c8dcf5; flex-shrink: 0; }
.yt-status-dot.active { background: #34c97e; box-shadow: 0 0 6px rgba(52,201,126,.5); }
.yt-playlist-toggle { display: flex; align-items: center; gap: 6px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #daeaf8; cursor: pointer; user-select: none; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: #7aa3cc; transition: color .2s; }
.yt-playlist-toggle:hover { color: #2d7ff9; }
.yt-caret { transition: transform .25s; flex-shrink: 0; margin-left: auto; }
.yt-playlist-toggle.open .yt-caret { transform: rotate(180deg); }
.yt-playlist-list { margin-top: 8px; max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.yt-playlist-list.open { max-height: 260px; overflow-y: auto; }
.yt-playlist-list::-webkit-scrollbar { width: 4px; }
.yt-playlist-list::-webkit-scrollbar-thumb { background: #c8dcf5; border-radius: 4px; }
.yt-playlist-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; cursor: pointer; transition: background .15s; }
.yt-playlist-item:hover { background: #daeaf8; }
.yt-playlist-item.active { background: #dbeeff; }
.yt-playlist-num { font-family: 'DM Mono', monospace; font-size: 10px; color: #a0bedd; }
.yt-playlist-name { font-size: 13px; color: #3a5a7a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.yt-playlist-dur { font-family: 'DM Mono', monospace; font-size: 10px; color: #a0bedd; flex-shrink: 0; margin-left: 6px; }
.yt-playlist-item.active .yt-playlist-name { color: #2d7ff9; font-weight: 500; }
.yt-playlist-item.active .yt-playlist-num { color: #7ab6fa; }
.yt-playlist-loading { font-size: 12px; color: #a0bedd; padding: 12px; text-align: center; }
