/**
 * 赢政指数 - 排行榜样式
 */

/* =====================================================
   表格容器
   ===================================================== */
.yz-table-wrap {
    overflow-x: auto;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
}

.yz-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.yz-table thead {
    background: rgba(0,0,0,0.02);
    border-bottom: 1px solid var(--border);
}

.yz-table th {
    padding: 1rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.yz-table td {
    padding: 0.9rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.yz-table__row:last-child td {
    border-bottom: none;
}

.yz-table__row {
    transition: background 0.15s;
}

.yz-table__row:hover {
    background: rgba(0,0,0,0.02);
}

/* =====================================================
   排名列
   ===================================================== */
.yz-table__rank {
    width: 50px;
    text-align: center !important;
    font-size: 1.1rem;
}

.yz-table__row--top1 .yz-table__rank { font-size: 1.3rem; }
.yz-table__row--top2 .yz-table__rank { font-size: 1.2rem; }

.yz-table__row--top1 {
    background: rgba(212,162,76,0.06);
}

.yz-table__row--top1:hover {
    background: rgba(212,162,76,0.1);
}

/* =====================================================
   模型列
   ===================================================== */
.yz-table__model {
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* Fix: th doesn't support flex, only td */
th.yz-table__model {
    display: table-cell;
}

.yz-table__provider-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.yz-table__model-name {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.yz-table__provider-label {
    font-size: 0.72rem;
    color: var(--muted);
    white-space: nowrap;
}

/* =====================================================
   分数列
   ===================================================== */
.yz-table__score {
    text-align: center !important;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    min-width: 60px;
}

.yz-table__score--main {
    min-width: 140px;
}

/* =====================================================
   分数条
   ===================================================== */
.yz-score-bar {
    position: relative;
    height: 28px;
    background: rgba(0,0,0,0.03);
    border-radius: 6px;
    overflow: hidden;
    min-width: 100px;
}

.yz-score-bar__fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--accent), var(--gold));
    transition: width 0.6s ease;
    opacity: 0.7;
}

.yz-table__row--top1 .yz-score-bar__fill {
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    opacity: 0.9;
}

.yz-score-bar__num {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
}

/* =====================================================
   移动端
   ===================================================== */
@media (max-width: 768px) {
    .yz-table {
        font-size: 0.82rem;
    }

    .yz-table th,
    .yz-table td {
        padding: 0.7rem 0.5rem;
    }

    .yz-table__model {
        min-width: 150px;
    }

    .yz-table__provider-label {
        display: none;
    }

    .yz-table__score--main {
        min-width: 100px;
    }

    .yz-score-bar {
        min-width: 70px;
    }
}

@media (max-width: 480px) {
    .yz-table__provider-icon {
        display: none;
    }

    .yz-table th,
    .yz-table td {
        padding: 0.6rem 0.35rem;
    }

    .yz-table { font-size: 0.75rem; }
    .yz-table__model { min-width: 110px; }
    .yz-table__score { min-width: 45px; font-size: 0.72rem; }
    .yz-table__score--main { min-width: 80px; }
    .yz-score-bar { min-width: 55px; height: 24px; }
    .yz-score-bar__num { font-size: 0.75rem; }
    .yz-table__rank { width: 36px; font-size: 0.95rem; }
    .yz-table th { white-space: normal; font-size: 0.7rem; }
}

@media (max-width: 375px) {
    .yz-table { font-size: 0.7rem; }
    .yz-table__model { min-width: 90px; }
    .yz-table__score { min-width: 38px; font-size: 0.68rem; }
    .yz-table__score--main { min-width: 65px; }
    .yz-score-bar { min-width: 45px; height: 22px; }
    .yz-score-bar__num { font-size: 0.7rem; }
    .yz-table__rank { width: 30px; font-size: 0.85rem; }
    .yz-table th, .yz-table td { padding: 0.5rem 0.25rem; }
    .yz-table__model-name { font-size: 0.72rem; }
}

/* =====================================================
   版本 badge
   ===================================================== */
.yz-version-badge {
    display: inline-flex;
    align-items: center;
    gap: .35em;
    padding: .2em .65em;
    font-size: .76rem;
    font-weight: 500;
    line-height: 1.5;
    color: rgba(0,0,0,.55);
    background: rgba(0,0,0,.03);
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 6px;
    white-space: nowrap;
}
.yz-version-badge i { font-size: .7em; opacity: .6; }

/* 跨版本迁移 badge */
.yz-migration-badge {
    display: inline-flex;
    align-items: center;
    gap: .3em;
    padding: .15em .55em;
    font-size: .72rem;
    font-weight: 600;
    color: #fbbf24;
    background: rgba(234,179,8,.12);
    border: 1px solid rgba(234,179,8,.3);
    border-radius: 5px;
    white-space: nowrap;
}
.yz-migration-badge i { font-size: .7em; }

/* 判分类型 badge */
.yz-judge-badge {
    display: inline-flex;
    align-items: center;
    gap: .25em;
    padding: .1em .45em;
    font-size: .68rem;
    font-weight: 500;
    border-radius: 4px;
    white-space: nowrap;
}
.yz-judge-badge--strict {
    color: #f87171;
    background: rgba(248,113,113,.12);
    border: 1px solid rgba(248,113,113,.25);
}
.yz-judge-badge--normal {
    color: rgba(0,0,0,.45);
    background: rgba(0,0,0,.03);
    border: 1px solid rgba(0,0,0,.04);
}
