/* 外榜列表页：与全站 Bootstrap / 管理台风格统一 */

/* 固定列用 data-width，标题列不限制宽度并吃掉剩余空间 */
.outrank-list-scope table#outrank_list_table {
    table-layout: fixed;
    width: 100%;
}

/* 标题列：无批量列为第 2 列（ID 后）；管理员勾选列为首列时标题为第 3 列 */
.outrank-list-scope:not(.outrank-list-scope--batch) #outrank_list_table colgroup col:nth-child(2) {
    width: auto !important;
}

.outrank-list-scope:not(.outrank-list-scope--batch) #outrank_list_table thead th:nth-child(2),
.outrank-list-scope:not(.outrank-list-scope--batch) #outrank_list_table tbody td:nth-child(2) {
    width: auto !important;
    max-width: none !important;
    min-width: 8rem;
}

.outrank-list-scope--batch #outrank_list_table colgroup col:nth-child(3) {
    width: auto !important;
}

.outrank-list-scope--batch #outrank_list_table thead th:nth-child(3),
.outrank-list-scope--batch #outrank_list_table tbody td:nth-child(3) {
    width: auto !important;
    max-width: none !important;
    min-width: 8rem;
}

.outrank-list-scope #outrank_list_table .outrank-title-link {
    display: inline;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: none;
}

.outrank-list-scope .bootstrap-table .fixed-table-container {
    border: 1px solid rgba(13, 110, 253, 0.12);
    border-radius: 0.5rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.outrank-list-scope .bootstrap-table .table thead th {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    color: #334155;
    font-weight: 600;
    font-size: 0.8125rem;
    vertical-align: middle;
    border-bottom: 1px solid rgba(13, 110, 253, 0.12);
    white-space: nowrap;
}

.outrank-list-scope .bootstrap-table .table tbody td {
    vertical-align: middle !important;
    font-size: 0.875rem;
    border-color: rgba(0, 0, 0, 0.06);
}

.outrank-list-scope .bootstrap-table .table tbody tr:hover td {
    background-color: rgba(13, 110, 253, 0.04);
}

/* ID 列（与表头 data-width 一致）；管理员首列为勾选框 */
.outrank-list-scope:not(.outrank-list-scope--batch) #outrank_list_table thead th:first-child,
.outrank-list-scope:not(.outrank-list-scope--batch) #outrank_list_table tbody td:first-child {
    width: 156px;
    max-width: 156px;
    box-sizing: border-box;
}

.outrank-list-scope--batch #outrank_list_table thead th:first-child,
.outrank-list-scope--batch #outrank_list_table tbody td:first-child {
    width: 52px;
    max-width: 52px;
    box-sizing: border-box;
    vertical-align: middle;
}

.outrank-list-scope--batch #outrank_list_table thead th:nth-child(2),
.outrank-list-scope--batch #outrank_list_table tbody td:nth-child(2) {
    width: 156px;
    max-width: 156px;
    box-sizing: border-box;
}

.outrank-list-scope:not(.outrank-list-scope--batch) #outrank_list_table tbody td:first-child {
    padding: 0.5rem 0.5rem !important;
}

.outrank-list-scope--batch #outrank_list_table tbody td:nth-child(2) {
    padding: 0.5rem 0.5rem !important;
}

/* ID + 可选类型徽标 */
.outrank-id-cell {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    cursor: pointer;
    user-select: none;
    min-width: 0;
}

/* 「更新」列：大管理员且近 7 天内有更新时，黄星叠在时间上不占额外列宽 */
.outrank-updated-at-cell--recent {
    position: relative;
    display: inline-block;
    max-width: 100%;
    vertical-align: middle;
}

.outrank-updated-at__inner {
    display: block;
}

.outrank-updated-at__star {
    position: absolute;
    left: -0.1rem;
    top: -0.42rem;
    z-index: 2;
    font-size: 0.65rem;
    line-height: 1;
    color: #ca8a04;
    text-shadow: 0 0 3px rgba(250, 204, 21, 0.85);
    pointer-events: auto;
    cursor: default;
}

.outrank-id-cell__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.125rem;
    min-width: 0;
    text-align: left;
}

.outrank-id-cell__id {
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.2;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.outrank-id-cell__uuid {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.65rem;
    line-height: 1.15;
    color: #64748b;
    max-width: 5.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 比赛类型 logo：小圆角卡片，清晰展示（替代半透明大半圆） */
/* 无 ckind 徽标时占位，尺寸与 .outrank-type-logo 一致，保证 ID 列横向对齐 */
.outrank-type-logo.outrank-type-logo--placeholder {
    visibility: hidden;
    background-image: none;
    border-color: transparent;
    box-shadow: none;
    pointer-events: none;
}

.outrank-type-logo {
    flex-shrink: 0;
    width: 2.375rem;
    height: 2.375rem;
    border-radius: 0.5rem;
    box-sizing: border-box;
    background-color: #fff;
    background-image: var(--outrank-logo-bg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    border: 1px solid rgba(13, 110, 253, 0.16);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.outrank-list-scope .bootstrap-table .table tbody tr:hover .outrank-type-logo {
    border-color: rgba(13, 110, 253, 0.28);
    box-shadow:
        0 2px 6px rgba(13, 110, 253, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

/* 操作列：横向排列 */
.outrank-action-cell {
    min-width: 5.5rem;
}

.outrank-action-cell .btn {
    padding: 0.25rem 0.45rem;
}

/* 导入预览 Modal */
.outrank-import-preview-modal .outrank-import-preview-dialog {
    max-width: min(1080px, 98vw);
    margin: 0.75rem auto;
}

.outrank-import-preview-modal .modal-content {
    border-radius: 0.5rem;
    border: 1px solid rgba(13, 110, 253, 0.12);
}

.outrank-import-preview-scroll {
    max-height: min(62vh, 520px);
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.375rem;
    background: #fff;
    -webkit-overflow-scrolling: touch;
}

/* 导入预览：bootstrap-table 外层与列表页风格统一（无 data-height 时仅一层表头，勿再 sticky thead，避免与旧版固定表头叠成双行） */
.outrank-import-preview-modal .outrank-import-preview-scroll .bootstrap-table {
    margin-bottom: 0;
}

.outrank-import-preview-modal .outrank-import-preview-scroll .fixed-table-container {
    border: none;
    border-radius: 0.25rem;
}

.outrank-import-preview-table {
    font-size: 0.8125rem;
    --bs-table-striped-bg: rgba(13, 110, 253, 0.035);
}

.outrank-import-preview-modal .outrank-import-preview-table thead th {
    font-size: 0.75rem;
    white-space: nowrap;
    vertical-align: middle;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
    background-color: var(--bs-table-bg, #fff);
}

.outrank-import-preview-col-check,
.outrank-import-preview-table th:first-child,
.outrank-import-preview-table td:first-child {
    width: 2.5rem;
    max-width: 2.5rem;
    text-align: center;
    vertical-align: middle;
}

/* 文件名列：固定 80px，中间省略由脚本生成 */
.outrank-import-preview-col-file,
.outrank-import-preview-filename {
    width: 120px;
    max-width: 120px;
    min-width: 80px;
    box-sizing: border-box;
    padding-left: 0.35rem !important;
    padding-right: 0.35rem !important;
    vertical-align: middle;
}

.outrank-import-preview-filename-inner {
    display: block;
    overflow: hidden;
    line-height: 1.25;
    font-size: 0.7rem;
    word-break: break-all;
    cursor: default;
}

.outrank-import-preview-col-meta,
.outrank-import-preview-meta-cell {
    min-width: 12rem;
    max-width: 28rem;
}

.outrank-import-preview-meta-title {
    font-size: 0.9rem;
    line-height: 1.3;
}

.outrank-import-preview-col-num,
.outrank-import-preview-num {
    width: 2.75rem;
    max-width: 3rem;
    white-space: nowrap;
}

.outrank-import-preview-col-time,
.outrank-import-preview-time-cell {
    width: 6.5rem;
    max-width: 7.5rem;
}

.outrank-import-preview-table .badge .en-text {
    margin-left: 0.25rem;
}

.outrank-import-preview-table .badge {
    font-weight: 500;
    font-size: 0.7rem;
}

/* 禁用态「打包 ZIP」：tooltip 绑在外层 span 上；禁用时让事件落到 span，避免依赖 global.js 把 title 提升到整行 toolbar */
.outrank-batch-zip-btn-wrap button:disabled {
    pointer-events: none;
}
