/*
 * 手机竖屏榜单顶部工具条压缩（≤767.98px），桌面不受影响。
 * 行 1：模式名（只留中文）+ 全部图标按钮（含「…」）同排；行 2：当前/总时长同一行 + 进度条 + 跳到末尾。
 * 只改排布与尺寸，颜色、图标、交互保持原样。外榜的「放得下 / 放不下」排布和按钮尺寸由 outrank_mobile.css 决定，这里只收副标题、时间行和内边距。
 */
@media (max-width: 767.98px) {
    .rank-header .controls-time-container {
        gap: 4px 6px;
        padding: 4px 8px;
    }

    /* 模式名：中英改成只留中文，单行 */
    .rank-header .rank-mode-indicator {
        padding: 0;
        line-height: 1.2;
    }

    .rank-header .rank-mode-indicator en-text {
        display: none;
    }

    /* 比赛榜图标按钮统一 30px（外榜按钮尺寸由 outrank_mobile.css 管，不动） */
    body:not(.csg-layout-outrank) .rank-header .controls-time-container .custom-select-btn.icon-only,
    body:not(.csg-layout-outrank) .rank-header .controls-time-container .control-btn,
    body:not(.csg-layout-outrank) .rank-header .controls-toggle-btn {
        width: 30px;
        min-width: 30px;
        height: 30px;
        min-height: 30px;
        padding: 0;
        justify-content: center;
    }

    body:not(.csg-layout-outrank) .rank-header .controls-toggle-btn i {
        font-size: 18px;
        line-height: 1;
    }

    /* 比赛榜：「…」跟在图标后面，不再单独占一行 */
    body:not(.csg-layout-outrank) .rank-header .controls-time-container > .toolbar-item,
    body:not(.csg-layout-outrank) .rank-header .controls-time-container > .toolbar-group-filter,
    body:not(.csg-layout-outrank) .rank-header .controls-toggle-btn {
        order: 1;
    }

    body:not(.csg-layout-outrank) .rank-header .controls-toggle-btn {
        margin-left: 0;
    }

    body:not(.csg-layout-outrank) .rank-header .time-progress-wrapper {
        order: 2;
    }

    /* 时间行：当前 / 总时长同一行 */
    .rank-header .time-progress-wrapper {
        gap: 4px;
        margin-top: 0;
    }

    .rank-header .time-display-group {
        flex-direction: row;
        align-items: baseline;
        gap: 0;
        width: auto;
        min-width: 0;
        padding: 0;
    }

    .rank-header .time-current {
        font-size: 12px;
        line-height: 1.2;
    }

    .rank-header .time-total {
        font-size: 10px;
        line-height: 1.2;
    }

    .rank-header .time-total::before {
        content: "/";
        margin: 0 2px;
    }

    .rank-header .time-progress-bar-container {
        padding: 0 4px;
    }
}
