/* Browser surfaces corresponding to RoyTools' native header and settings. */
:root { --music-action-height:40px;--music-action-radius:999px; }
.playlist-navigation { position:fixed;right:max(16px,calc((100vw - 1200px)/2 + 16px));bottom:calc(var(--player-height,120px) + 28px + env(safe-area-inset-bottom));z-index:5;display:flex;flex-direction:column;gap:10px; }
.playlist-jump { display:flex;align-items:center;justify-content:center;width:46px;height:46px;min-width:46px;min-height:46px;padding:12px;border:1px solid var(--line);border-radius:50%;background:var(--panel);color:var(--blue);box-shadow:0 3px 14px #00000018; }
.playlist-jump svg { width:22px;height:22px;flex:none; }
.playlist-jump:active { background:var(--soft,var(--bg)); }
html.native-embedded .playlist-navigation { bottom:calc(88px + env(safe-area-inset-bottom)); }
html:has(dialog[open],#queue-panel:not([hidden]),#full-queue:not([hidden])) .playlist-navigation { visibility:hidden;pointer-events:none; }
#remove-queued-track>svg { color:inherit; }
/* Filled actions and outlined selectors share the same visible capsule. */
button.primary,button.secondary,button.back,button.quality,#feedback-stack button,#web-download-tray,.download-delete.is-confirming,.image-placeholder button {
 display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;
 min-height:var(--music-action-height)!important;padding:8px 16px!important;
 border-radius:var(--music-action-radius)!important;line-height:20px;
}
.download-delete.is-confirming { height:var(--music-action-height)!important; }
/* Navigation, menu actions and choice rows use the same compact capsule. */
.desktop-shell .nav-item,.desktop-shell .settings-button,.desktop-shell #fixed-playlists .music-entry {
 min-height:var(--music-action-height)!important;padding:8px 13px!important;
 border-radius:var(--music-action-radius)!important;line-height:20px;
}
.track-more-menu button,.full-more-menu button,.web-option {
 min-height:var(--music-action-height)!important;padding:8px 12px!important;
 border-radius:var(--music-action-radius)!important;line-height:20px;
}
.search,.roytools-select-trigger,#sleep-minutes {
 box-sizing:border-box;min-height:var(--music-action-height)!important;height:var(--music-action-height);
 border-radius:var(--music-action-radius)!important;
}
.filters .roytools-select-trigger { padding-block:8px; }
.search input:focus { outline:none!important;box-shadow:none!important; }
.search:focus-within { border-color:var(--blue)!important; }
#settings-dialog .roytools-select-trigger { padding:8px 16px;line-height:20px;font-size:14px; }
.desktop-shell #settings-dialog .roytools-select-trigger { font-size:12px; }
html { scrollbar-gutter:stable; }
.web-header { position:sticky;top:0;z-index:5;display:flex;align-items:center;gap:8px;max-width:1200px;margin:0 auto;padding:12px 16px;background:var(--bg);min-height:72px; }
.web-header #web-home { padding:0;background:transparent;color:var(--text);text-align:left; }
.web-header h1 { margin:0;font-size:26px;font-weight:700; }
#web-back { width:44px;height:48px;color:var(--blue);padding:8px; }
#web-back svg { width:28px;height:28px; }
.mobile-shell .section-heading>div:first-child,.mobile-shell #back-albums,.mobile-shell .settings-head { display:none!important; }
.web-actions { display:flex;flex-wrap:wrap;gap:10px;margin-top:12px; }
.web-actions button { min-height:40px; }
.destructive { color:#d70015!important; }
html[data-theme="dark"] .destructive { color:#ff453a!important; }
#settings-dialog input[role="switch"] { appearance:none;position:relative;width:52px;height:32px;flex:none;border:2px solid var(--muted);border-radius:999px;background:var(--line);cursor:pointer; }
#settings-dialog input[role="switch"]:before { content:'';position:absolute;top:6px;left:6px;width:16px;height:16px;border-radius:50%;background:var(--muted);transition:transform .15s,width .15s,height .15s; }
#settings-dialog input[role="switch"]:checked { background:var(--blue);border-color:var(--blue); }
#settings-dialog input[role="switch"]:checked:before { top:2px;left:2px;width:24px;height:24px;background:#fff;transform:translateX(20px); }
#web-options,#web-download { color:var(--text);background:var(--panel);border:1px solid var(--line);border-radius:24px;width:min(480px,calc(100vw - 32px));max-height:80dvh;padding:24px;overflow:auto; }
#web-options h2,#web-download h2 { font-size:20px;margin:0 0 16px; }
#web-option-list { display:flex;flex-direction:column;gap:4px; }
.web-option { display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:52px;padding:12px;border-radius:12px;color:var(--text);background:transparent;text-align:left; }
.web-option:hover { background:var(--control-hover); }
.web-option[aria-checked="true"] { color:var(--blue);background:var(--soft); }
.web-radio { flex:none;width:20px;height:20px;border:2px solid var(--muted);border-radius:50%; }
[aria-checked="true"]>.web-radio { border-color:var(--blue);background:radial-gradient(circle,var(--blue) 0 45%,transparent 50%); }
#web-download-progress { width:100%;height:8px;accent-color:var(--blue); }
#web-download-current,#web-download-detail { overflow-wrap:anywhere; }
#web-download-tray { position:fixed;right:16px;bottom:94px;z-index:7;background:var(--blue);color:white;border-radius:999px;padding:10px 16px;box-shadow:0 4px 20px #0002; }
#desktop-settings-modal>#web-download-tray { position:absolute;right:16px;bottom:16px;z-index:9; }
.desktop-shell .track-row:not(.current):not(.queue-current):has(.icon:hover) { background:transparent!important; }
.desktop-shell .player-extra { gap:12px; }
.desktop-shell button.quality { white-space:nowrap;flex-shrink:0; }
#web-toast { position:fixed;bottom:100px;left:50%;transform:translateX(-50%);max-width:calc(100% - 32px);border-radius:999px;background:var(--text);color:var(--panel);padding:12px 20px;z-index:9999;font-size:14px; }
body.web-player-open>.player { visibility:hidden;pointer-events:none; }
.mobile-shell .player { z-index:5;bottom:calc(12px + env(safe-area-inset-bottom))!important;box-sizing:border-box; }
#full-player .full-header { display:flex;align-items:center;justify-content:flex-start;gap:10px;font-size:0!important;font-family:inherit!important; }
#full-player .full-header>span { display:none; }
#full-player .full-header:after { content:'正在播放';font-size:22px;font-weight:700; }
#sleep-current,#sleep-countdown,.queue-tag,#full-more.on,#full-more[aria-expanded="true"] { color:var(--blue)!important; }
.queue-tag { background:var(--soft)!important;border-radius:var(--music-action-radius)!important; }
#full-player .full-header .icon { order:-1;position:static;flex:none;margin:0;color:var(--blue); }
#full-player .full-shell { height:100%;min-height:0; }
/* A phone rotated to landscape keeps access to the player action menu. */
@media(min-width:701px) {
 .mobile-shell #full-player .full-view-bar { display:block;position:absolute;top:8px;right:16px;z-index:8; }
 .mobile-shell #full-player .full-tabs { display:none; }
 .mobile-shell #full-player .full-more-menu { position:absolute;top:calc(100% + 8px);right:0;max-height:calc(100dvh - 80px);overflow-y:auto; }
}
input:focus-visible,button:focus-visible,select:focus-visible { outline:2px solid var(--blue);outline-offset:3px; }
html:not([data-keyboard-nav]) :is(button,a):focus { outline:none!important; }
html[data-theme] .icon:not(.play):not(.is-confirming),#settings-downloads-back,#web-back {
 border:0!important;background:transparent!important;box-shadow:none!important;
}
[hidden] { display:none!important; }
@media(max-width:700px) {
 .web-header { padding-top:calc(10px + env(safe-area-inset-top)); }
 main { padding-bottom:calc(100px + env(safe-area-inset-bottom))!important; }
 #full-player .full-shell { padding-top:calc(8px + env(safe-area-inset-top));padding-bottom:calc(12px + env(safe-area-inset-bottom)); }
 .mobile-shell:not(.native-embedded) #full-player .full-shell { grid-template-rows:44px calc(var(--music-action-height) + 8px) minmax(0,1fr) 104px; }
 #full-player .full-view-bar { min-height:calc(var(--music-action-height) + 8px); }
 #full-player .full-tabs { height:calc(var(--music-action-height) + 8px)!important;padding:4px; }
 #full-player .full-tabs .full-tab { height:var(--music-action-height)!important;min-height:var(--music-action-height)!important;border-radius:var(--music-action-radius)!important; }
}
html,body,button,input,select,textarea { font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",Roboto,sans-serif!important; }
.web-header #web-home { color:var(--text)!important; }
#web-confirm { color:var(--text);background:var(--panel);border:1px solid var(--line);border-radius:24px;width:min(440px,calc(100vw - 32px));padding:24px; }
#web-confirm h2 { font-size:20px; }
#web-confirm p { color:var(--muted); }
#settings-dialog .web-actions .destructive { color:white!important;background:#c62828!important; }
#full-player .full-header:after { color:var(--text); }
@media(max-width:700px) {
 #settings-dialog .web-actions { flex-direction:column;align-items:flex-start;gap:6px; }
 #settings-dialog .settings-row .roytools-select-trigger { flex:none;width:auto;min-width:88px;max-width:50%;padding:8px 16px;border:1px solid var(--line);background:var(--panel);color:var(--blue);font-size:14px; }
 #playback-diagnostics-text { box-sizing:border-box;max-width:100%;padding:12px;overflow-wrap:anywhere; }
}
#web-options .queue-head { display:flex;justify-content:space-between;align-items:center;gap:12px; }
#web-options .queue-head h2 { margin:0; }
#web-options .queue-head { margin-bottom:12px; }
#web-options .queue-head>.icon { order:0; }
#web-toast { width:max-content;max-width:calc(100vw - 32px);box-sizing:border-box;line-height:1.4;text-align:center;overflow-wrap:anywhere; }
#settings-dialog .settings-row .roytools-select-trigger { display:flex;align-items:center;justify-content:center;text-align:center;gap:0; }
#settings-dialog .settings-row .roytools-select-trigger::after { content:none;display:none; }
:is(#downloads-songs,#songs) .download-delete { display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;font-size:13px;line-height:20px;white-space:nowrap; }
.collection-play-actions { display:flex;flex-wrap:wrap;align-items:center;gap:10px;min-width:0; }
.collection-play-actions>button.primary,.collection-play-actions>button.secondary { display:inline-flex;align-items:center;justify-content:center;gap:7px;margin:0;font-size:13px;line-height:20px;white-space:nowrap; }
.collection-play-actions svg { flex:none;width:17px;height:17px; }
@media(max-width:380px) {
 .collection-play-actions { gap:6px; }
 .collection-play-actions>button.primary,.collection-play-actions>button.secondary { gap:4px;padding-inline:7px;font-size:11px; }
 .collection-play-actions svg { width:14px;height:14px; }
}
@media(max-width:700px) {
 :is(#songs,#downloads-songs) .track-row.download-row { grid-template-columns:minmax(0,1fr) 44px;gap:8px;min-height:72px; }
 :is(#songs,#downloads-songs) .track-row.download-row.confirming-delete { grid-template-columns:minmax(0,1fr) 88px; }
 :is(#songs,#downloads-songs) .download-row>.track-no { display:none; }
 :is(#songs,#downloads-songs) .download-row>.track-start { grid-column:1;grid-row:1;display:flex;width:100%;min-width:0;gap:10px;padding:0; }
 :is(#songs,#downloads-songs) .download-row>.download-delete { grid-column:2;grid-row:1;justify-self:end; }
 :is(#songs,#downloads-songs) .download-row .track-art-play { width:40px;min-width:40px;flex:none; }
 :is(#songs,#downloads-songs) .download-row .track-cover { width:40px;height:40px; }
 :is(#songs,#downloads-songs) .download-row .track-copy { flex:1;min-width:0;height:auto;overflow:hidden; }
 :is(#songs,#downloads-songs) .download-row .track-title-play { display:block;width:100%;min-width:0;text-align:left; }
 :is(#songs,#downloads-songs) .download-row .track-copy strong,:is(#songs,#downloads-songs) .download-row .track-copy small { display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
}

/* Keep scrolling inside the rounded surfaces, with stationary dialog headers. */
#sleep-dialog { box-sizing:border-box;overflow:hidden; }
#sleep-dialog[open] { display:flex;flex-direction:column; }
#sleep-dialog>.queue-head { flex:none; }
#sleep-dialog>.sleep-body { min-height:0;overflow-y:auto;overscroll-behavior:contain;padding-right:4px;scrollbar-width:thin;scrollbar-color:var(--muted) transparent; }
#web-options { overflow:hidden; }
#web-options[open] { display:flex;flex-direction:column; }
#web-options .queue-head { flex:none; }
html:has(dialog[open],#queue-panel:not([hidden]),#full-queue:not([hidden])) { overflow:hidden; }
#web-option-list { min-height:0;max-height:calc(80dvh - 112px);overflow-y:auto;overscroll-behavior:contain;padding-right:8px;margin-right:-8px; }
:is(#desktop-settings-modal .settings-body,#web-option-list,#queue-list,#full-queue-list,.track-more-menu,#web-download,#web-confirm,#sleep-dialog) { scrollbar-width:thin;scrollbar-color:var(--muted) transparent; }
:is(#desktop-settings-modal .settings-body,#web-option-list,#queue-list,#full-queue-list,.track-more-menu,#web-download,#web-confirm,#sleep-dialog)::-webkit-scrollbar { width:6px;height:6px; }
:is(#desktop-settings-modal .settings-body,#web-option-list,#queue-list,#full-queue-list,.track-more-menu,#web-download,#web-confirm,#sleep-dialog)::-webkit-scrollbar-thumb { background:var(--muted);border-radius:999px; }
:is(#desktop-settings-modal .settings-body,#web-option-list,#queue-list,#full-queue-list,.track-more-menu,#web-download,#web-confirm,#sleep-dialog)::-webkit-scrollbar-track { background:transparent; }
:is(#desktop-settings-modal .settings-body,#web-option-list,#queue-list,#full-queue-list,.track-more-menu,#web-download,#web-confirm,#sleep-dialog)::-webkit-scrollbar-button { display:none; }

/* Page transitions never create a horizontal scrollbar. */
html,body { overflow-x:clip; }
main { overflow-x:clip; }
#full-lyrics,#desktop-downloads-body,#queue-list,#full-queue-list { overflow-x:hidden; }
*::-webkit-scrollbar:horizontal { height:0!important;display:none!important; }
/* Keep the gutter stable; show the thumb only while the content is moving. */
:is(html.music-scrollbar-auto,#full-lyrics,#queue-list,#full-queue-list,#desktop-downloads-body) {
 scrollbar-width:thin;scrollbar-color:transparent transparent;
}
:is(html.music-scrollbar-auto,#full-lyrics,#queue-list,#full-queue-list,#desktop-downloads-body).is-scrolling {
 scrollbar-color:var(--muted) transparent;
}
:is(html.music-scrollbar-auto,#full-lyrics,#queue-list,#full-queue-list,#desktop-downloads-body)::-webkit-scrollbar { width:6px; }
:is(html.music-scrollbar-auto,#full-lyrics,#queue-list,#full-queue-list,#desktop-downloads-body)::-webkit-scrollbar-thumb { background:transparent;border-radius:999px; }
:is(html.music-scrollbar-auto,#full-lyrics,#queue-list,#full-queue-list,#desktop-downloads-body).is-scrolling::-webkit-scrollbar-thumb { background:var(--muted); }
:is(html.music-scrollbar-auto,#full-lyrics,#queue-list,#full-queue-list,#desktop-downloads-body)::-webkit-scrollbar-track { background:transparent; }
:is(html.music-scrollbar-auto,#full-lyrics,#queue-list,#full-queue-list,#desktop-downloads-body)::-webkit-scrollbar-button { display:none; }
@supports selector(::-webkit-scrollbar) {
 :is(html.music-scrollbar-auto,#full-lyrics,#queue-list,#full-queue-list,#desktop-downloads-body),
 :is(html.music-scrollbar-auto,#full-lyrics,#queue-list,#full-queue-list,#desktop-downloads-body).is-scrolling {
  scrollbar-width:auto;scrollbar-color:auto;
 }
}
/* Automatic lyric following stays quiet, including the previous scroll state. */
#full-player #full-lyrics.lyric-auto-follow { scrollbar-color:transparent transparent; }
#full-player #full-lyrics.lyric-auto-follow::-webkit-scrollbar-thumb { background:transparent!important; }
@supports selector(::-webkit-scrollbar) {
 #full-player #full-lyrics { scrollbar-width:auto;scrollbar-color:auto; }
 #full-player #full-lyrics.lyric-auto-follow { scrollbar-color:auto; }
}
