@import url("./key-bindings.css");
/* 手机横屏单独预算高度，桌面继续使用已确认的三列。 */
@media (orientation:landscape) and (max-height:500px) and (max-width:1000px){
  #site-dialog[data-panel=songbook],#site-dialog[data-panel=region]{width:calc(100vw - 20px);max-height:calc(100vh - 16px);padding:10px 16px}
  #site-dialog .songbook-heading{margin:0 40px 6px 0;gap:8px;align-items:center}
  #site-dialog .songbook-heading h2{font-size:19px!important;margin:0!important}
  .songbook-heading .eyebrow,.songbook-heading p:not(.eyebrow),.songbook-heading .region-panel-emblem{display:none}
  #site-dialog .dialog-close{top:8px;right:10px;width:30px;height:30px;min-height:30px;font-size:20px}
  .songbook-tools{display:flex;align-items:center;gap:10px;padding:0 0 5px}
  .songbook-tools .search-label{display:block;flex:1;min-width:130px}.songbook-tools .search-label>span{display:none}
  #site-dialog .songbook-tools input{width:100%;height:32px;min-height:32px;padding:5px 9px;font-size:12px}
  .songbook-tools .filter-tabs{width:auto;gap:3px;padding:0;flex-shrink:0}
  .songbook-tools .filter-tabs button{min-height:32px;font-size:11px;padding:4px 8px}
  .songbook-count{margin:4px 0;font-size:11px}
  .songbook-results .song-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .songbook-results .song-card{padding:8px;gap:5px}
  .songbook-results .song-cover{aspect-ratio:auto;height:90px;min-height:90px;max-height:90px}
  .songbook-results .song-cover img{width:100%;height:100%;object-fit:cover}
  .songbook-results .song-cover small{font-size:9px;padding:3px 5px}
  .songbook-results .song-cover>.song-cross-region{font-size:10px;padding:3px 6px;top:5px;left:5px}
  .songbook-results .song-details{gap:3px}
  .songbook-results .song-details h3{font-size:17px;line-height:1.2;margin:0}
  .songbook-results .song-details .song-artist{font-size:11px;line-height:1.3;margin:0 0 4px;min-height:29px}
  .songbook-results .card-actions{padding-top:5px;min-height:39px;grid-template-columns:minmax(0,1fr) 36px;gap:6px}
  .songbook-results .card-actions .primary{min-height:34px;font-size:12px;padding:4px 8px}
  .songbook-results .card-actions .favorite{width:36px;height:34px;min-height:34px}
}
.site-modal-scrim{position:fixed;z-index:999;top:0;right:0;bottom:0;left:0;background:rgba(16,35,52,0.72157);background:#102334b8}
.site-modal-scrim[hidden]{display:none}
#site-dialog.rt-inline-dialog:not([open]){display:none}
#site-dialog.rt-inline-dialog[open]{display:block;position:fixed;z-index:1000;left:50%;top:50%;right:auto;bottom:auto;margin:0;transform:translate(-50%,-50%);box-sizing:border-box}
#site-dialog.rt-inline-dialog[open][data-panel=song-detail]{display:grid}
#site-dialog.rt-inline-dialog[open][data-panel=leaderboard]{display:flex;flex-direction:column}
.rt-low-quality *{backdrop-filter:none!important}
.rt-low-quality body,.rt-low-quality button,.rt-low-quality input{font-family:Arial,"Microsoft YaHei",sans-serif!important}
.rt-low-quality .c4-stickers{display:none}
.rt-low-quality .game-host-panel{box-shadow:none}
.online-board{padding-top:14px;margin-top:14px;border-top:1px solid var(--rt-line);font-size:13px}
.online-board h3{margin:0 0 10px;font-size:18px}.online-board .board-tabs{display:flex;flex-wrap:wrap;margin-bottom:10px}
.online-board .board-tabs button{padding:7px 10px;margin:3px;font-size:12px}.online-board .record-row{padding:8px 0}
/* 没有 CSS Grid 的内核：保持入口、触控轨道、结算操作可用。 */
.rt-legacy-layout body{height:100vh;display:flex;flex-direction:column}
.rt-legacy-layout #site-dialog,.rt-legacy-layout .panel-card,.rt-legacy-layout .song-card{background:#203e4b!important;color:#f5eddc!important}
.rt-legacy-layout .site-header{background:#203647!important;color:#f5eddc!important}
.rt-legacy-layout .game-host-panel{background:#183840!important;color:#f5eddc!important}
.rt-legacy-layout .site-header{height:62px;padding:8px 12px;flex-shrink:0}
.rt-legacy-layout .site-main{flex:1;min-height:0}
.rt-legacy-layout .site-nav a,.rt-legacy-layout .site-nav button{margin-right:4px;font-size:12px;padding:8px;color:var(--rt-text)}
.rt-legacy-layout #site-dialog{position:fixed;top:12px;bottom:12px;left:12px;right:12px;width:auto;max-width:none;max-height:calc(100vh - 24px);padding:20px;overflow:auto}
.rt-legacy-layout .songbook-tools,.rt-legacy-layout .song-detail-layout,.rt-legacy-layout .result-layout{display:block}
.rt-legacy-layout .song-grid{display:flex;flex-wrap:wrap;align-items:stretch;gap:0}
.rt-legacy-layout .songbook-results .song-card{width:calc(33.333% - 12px);height:auto;margin:6px}
.rt-legacy-layout .song-cover{height:160px}.rt-legacy-layout .song-cover img{height:100%;width:100%;object-fit:cover}
.rt-legacy-layout .card-actions{display:flex}.rt-legacy-layout .card-actions .primary{flex:1}.rt-legacy-layout .card-actions .favorite{flex-shrink:0;margin-left:8px}
.rt-legacy-layout .difficulty-options,.rt-legacy-layout .play-mode-tabs{display:flex;flex-wrap:wrap}
.rt-legacy-layout .difficulty-option{flex:0 1 160px;width:160px;max-width:calc(50% - 10px);margin:5px}
.rt-legacy-layout .play-mode-tabs button{margin:5px}.rt-legacy-layout .song-detail-controls{margin-top:16px}
.rt-legacy-layout .game-stage,.rt-legacy-layout .game-stage>section{top:0;right:0;bottom:0;left:0}
.rt-legacy-layout .game-host-bar{display:flex;justify-content:space-between;padding:8px 12px}
.rt-legacy-layout .game-host-controls{width:90px;flex-shrink:0}.rt-legacy-layout .game-host-controls button{display:flex;align-items:center;justify-content:center;margin-right:5px}
.rt-legacy-layout .game-host-song{width:32%}.rt-legacy-layout .game-host-stats span{margin:0 4px}
.rt-legacy-layout .game-host-overlay,.rt-legacy-layout .game-host-settings,.rt-legacy-layout .game-host-help{display:flex;align-items:center;justify-content:center;top:0;left:0;right:0;bottom:0}
.rt-legacy-layout .game-host-overlay[hidden],.rt-legacy-layout .game-host-settings[hidden],.rt-legacy-layout .game-host-help[hidden]{display:none}
.rt-legacy-layout .game-host-panel{width:460px;max-width:100%;max-height:calc(100vh - 40px);padding:20px}
.rt-legacy-layout .game-host-actions{display:flex;flex-wrap:wrap}.rt-legacy-layout .game-host-actions button{width:calc(50% - 8px);margin:4px}
.rt-legacy-layout .fa-touch,.rt-legacy-layout .c4-pads{display:flex;left:0;right:0;width:100%;transform:none}
.rt-legacy-layout .fa-touch button,.rt-legacy-layout .c4-pads button{flex:1;width:25%}
.rt-legacy-layout .fa-stage{left:0;transform:none;width:100%}
.rt-legacy-layout .result-layout{width:100%;max-width:1240px;margin:auto;overflow:auto}
.rt-legacy-layout .result-stat-grid,.rt-legacy-layout .result-actions{display:flex;flex-wrap:wrap}.rt-legacy-layout .result-stat-grid>div{width:25%}
.rt-legacy-layout .result-actions>*{margin:5px}.rt-legacy-layout .result-summary,.rt-legacy-layout .result-side{width:100%;margin-bottom:16px}
@media(max-width:680px){.rt-legacy-layout .songbook-results .song-card{width:100%;margin:6px 0}.rt-legacy-layout .song-detail-layout{display:block}}
@media(min-width:681px) and (max-width:900px){.rt-legacy-layout .songbook-results .song-card{width:calc(50% - 12px)}}

@media (orientation:landscape) and (max-height:500px) and (max-width:1000px){
  .rt-legacy-layout #site-dialog{padding-top:10px;padding-bottom:10px}
  .rt-legacy-layout .songbook-tools{display:flex}
}

@media (orientation:landscape) and (max-height:500px) and (max-width:1000px){
  .rt-legacy-layout .songbook-results .song-card{width:calc(50% - 12px)}
}

/* 全站排名优先展示，本机记录按需展开。 */
.journey-board>.online-board,.result-board .board-scroll>.online-board{border-top:0;margin-top:0;padding-top:0}
.online-rank-list{max-height:42vh;overflow-y:auto;overscroll-behavior:contain}
.local-records{flex:0 0 auto;border-top:1px solid var(--rt-line);margin-top:14px;padding-top:10px}
.local-records>summary{cursor:pointer;padding:8px 0;color:var(--rt-muted);font-size:13px}
.local-records .board-scroll{max-height:36vh;overflow-y:auto}
.result-board .online-rank-list{max-height:none;overflow:visible}

.rt-legacy-layout .detail-preferences{margin-top:10px}
