/* ============================================ */
/* 全局大容器 */
/* ============================================ */
.fk-rank-root {
    background-color: #ffffff;
    color: #1f2937;
    padding: 24px;
    border-radius: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 20px auto;
    max-width: 1340px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s, color 0.3s;
}

/* ============================================ */
/* 头部 - 左右布局 */
/* ============================================ */
.fk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    margin-bottom: 16px;
    gap: 16px;
    flex-wrap: nowrap;
}

.fk-header-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    min-width: 0;
}

.fk-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
}

.fk-header-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
}

#fk-header-tabs-container {
    display: flex;
    align-items: center;
}

/* ============================================ */
/* 自定义下拉选择器 */
/* ============================================ */
.fk-custom-select {
    position: relative;
    width: 280px;
    font-family: inherit;
    z-index: 100;
}

.fk-select-selected {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-size: 14px;
    color: #000000;
    font-weight: 600;
    gap: 8px;
    position: relative;
    min-height: 22px;
}

.fk-select-selected:hover {
    border-color: #9ca3af;
}

.fk-select-selected:focus {
    border-color: #4b5563;
    box-shadow: 0 0 0 2px rgba(75, 85, 99, 0.1);
    outline: none;
}

.fk-select-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
}

.fk-select-arrow {
    margin-left: auto;
    font-size: 10px;
    color: #9ca3af;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.fk-select-selected:hover .fk-select-arrow {
    color: #6b7280;
}

/* 隐藏的搜索输入框 - 覆盖在选中区域 */
.fk-select-search-hidden {
    position: absolute;
    left: 12px;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    outline: none;
    font-size: 14px;
    font-weight: 600;
    color: #000000;
    background: transparent;
    padding: 0;
    margin: 0;
    z-index: 2;
    font-family: inherit;
}

.fk-select-search-hidden::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.fk-select-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fk-select-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 350px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    animation: fk-select-fadeIn 0.15s ease-out;
}

@keyframes fk-select-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fk-select-options-wrapper {
    max-height: 300px;
    overflow-y: auto;
}

.fk-select-option {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.15s;
    gap: 8px;
    font-size: 14px;
    color: #000000;
    font-weight: 600;
}

.fk-select-option:hover {
    background-color: #f9fafb;
}

.fk-select-option.active {
    background-color: #f3f4f6;
    font-weight: 500;
    color: #111827;
}

.fk-select-no-result {
    padding: 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
}

.fk-select-options::-webkit-scrollbar {
    width: 6px;
}

.fk-select-options::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 0 8px 8px 0;
}

.fk-select-options::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 3px;
}

.fk-select-options::-webkit-scrollbar-thumb:hover {
    background-color: #9ca3af;
}

.fk-selector {
    display: none;
}

/* ============================================ */
/* 标签页 All / Home / Away */
/* ============================================ */
.fk-tabs {
    display: inline-flex;
    background-color: #f3f4f6;
    padding: 3px;
    border-radius: 8px;
    white-space: nowrap;
}

.fk-tab {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
    user-select: none;
}

.fk-tab.active,
.fk-tab:hover {
    background-color: #ffffff;
    color: #000000;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ============================================ */
/* 表格 */
/* ============================================ */
.fk-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.fk-white-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    min-width: 800px;
}

.fk-white-table th {
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.fk-white-table th:nth-child(1),
.fk-white-table th:nth-child(2) {
    text-align: left;
}

.fk-white-table th:nth-child(3),
.fk-white-table th:nth-child(4),
.fk-white-table th:nth-child(5),
.fk-white-table th:nth-child(6),
.fk-white-table th:nth-child(7),
.fk-white-table th:nth-child(8),
.fk-white-table th:nth-child(9) {
    width: 55px;
    text-align: center;
}

.fk-white-table th:nth-child(10) {
    width: 160px;
    text-align: left;
    padding-left: 15px;
}

.fk-white-table td {
    padding: 12px 8px;
    font-size: 14px;
    font-weight: bold;
    color: #000000;
    line-height: 21px;
    vertical-align: middle;
    border-bottom: 1px solid #f3f4f6;
}

.fk-rank {
    font-weight: 600;
    color: #111827;
    width: 40px;
}

.fk-team-cell {
    min-width: 200px;
}

.fk-team-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fk-team-logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
}

.fk-team-name {
    font-weight: 500;
    color: #111827;
}

.fk-white-table td:nth-child(3),
.fk-white-table td:nth-child(4),
.fk-white-table td:nth-child(5),
.fk-white-table td:nth-child(6),
.fk-white-table td:nth-child(7),
.fk-white-table td:nth-child(8),
.fk-white-table td:nth-child(9) {
    text-align: center;
}

.fk-muted {
    color: #6b7280;
}

.fk-points {
    font-weight: 700;
    color: #111827;
}

/* ============================================ */
/* 近五场胜负球 */
/* ============================================ */
.fk-form-flex {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.fk-ball {
    width: 28px;
    height: 28px;
    font-size: 13px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: #ffffff;
}

.fk-win {
    background-color: #10b981;
}

.fk-loss {
    background-color: #ef4444;
}

.fk-draw {
    background-color: #9ca3af;
}

/* ============================================ */
/* 底部图例 */
/* ============================================ */
.fk-legends {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.fk-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
}

.fk-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.fk-loading,
.fk-error {
    text-align: center;
    padding: 60px;
    color: #9ca3af;
    font-size: 14px;
}

/* ============================================ */
/* 暗黑主题 */
/* ============================================ */
.fk-theme-dark.fk-rank-root {
    background-color: #1a1a2e;
    color: #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
}

.fk-theme-dark .fk-header h2 {
    color: #f3f4f6;
}

.fk-theme-dark .fk-select-selected {
    background: #2d2d44;
    border-color: #4b5563;
    color: #f3f4f6;
}

.fk-theme-dark .fk-select-selected:hover {
    border-color: #6b7280;
}

.fk-theme-dark .fk-select-arrow {
    color: #9ca3af;
}

.fk-theme-dark .fk-select-search-hidden {
    color: #f3f4f6;
}

.fk-theme-dark .fk-select-search-hidden::placeholder {
    color: #6b7280;
}

.fk-theme-dark .fk-select-options {
    background: #2d2d44;
    border-color: #4b5563;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.fk-theme-dark .fk-select-option {
    color: #e5e7eb;
    font-weight: 500;
}

.fk-theme-dark .fk-select-option:hover {
    background-color: #3d3d5c;
}

.fk-theme-dark .fk-select-option.active {
    background-color: #4a4a6a;
    color: #ffffff;
}

.fk-theme-dark .fk-select-no-result {
    color: #6b7280;
}

.fk-theme-dark .fk-select-options::-webkit-scrollbar-thumb {
    background-color: #4b5563;
}

.fk-theme-dark .fk-select-options::-webkit-scrollbar-thumb:hover {
    background-color: #6b7280;
}

.fk-theme-dark .fk-tabs {
    background-color: #2d2d44;
}

.fk-theme-dark .fk-tab {
    color: #9ca3af;
}

.fk-theme-dark .fk-tab.active,
.fk-theme-dark .fk-tab:hover {
    background-color: #4a4a6a;
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.fk-theme-dark .fk-white-table th {
    color: #9ca3af;
    border-bottom-color: #374151;
}

.fk-theme-dark .fk-white-table td {
    color: #e5e7eb;
    border-bottom-color: #2d2d44;
}

.fk-theme-dark .fk-rank {
    color: #f3f4f6;
}

.fk-theme-dark .fk-team-name {
    color: #f3f4f6;
}

.fk-theme-dark .fk-muted {
    color: #9ca3af;
}

.fk-theme-dark .fk-points {
    color: #ffffff;
}

.fk-theme-dark .fk-legends {
    border-top-color: #374151;
}

.fk-theme-dark .fk-legend-item {
    color: #9ca3af;
}

.fk-theme-dark .fk-loading,
.fk-theme-dark .fk-error {
    color: #6b7280;
}

/* ============================================ */
/* 响应式 - 手机端 */
/* ============================================ */
@media (max-width: 768px) {
    .fk-rank-root {
        padding: 16px;
    }

    .fk-header {
        flex-wrap: wrap;
    }

    .fk-header-left {
        width: 100%;
        justify-content: space-between;
    }

    .fk-header-right {
        width: auto;
        margin-left: 0;
    }

    .fk-custom-select {
        width: 180px;
    }

    .fk-white-table th,
    .fk-white-table td {
        padding: 8px 4px;
        font-size: 12px;
    }

    .fk-ball {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }

    .fk-team-name {
        font-size: 12px;
    }

    .fk-select-options {
        max-height: 280px;
    }
}

@media (max-width: 768px) {
    .fk-tabs-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .fk-mobile-more {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border: 0;
        border-radius: 10px;
        background: #232a2d;
        color: #ffffff;
        font-size: 18px;
        font-weight: 700;
        cursor: pointer;
        transition: all .2s ease;
    }

    .fk-mobile-more.active {
        background: #0f5f3a;
        color: #22ff88;
    }

    .fk-white-table {
        width: 100%;
        min-width: 0 !important;
    }

    .fk-table-wrapper {
        overflow-x: visible !important;
    }

    /* 默认隐藏 BT-BB / HS / Phong độ */
    .fk-table-wrapper[data-extra-open="0"] .fk-white-table th:nth-child(7),
    .fk-table-wrapper[data-extra-open="0"] .fk-white-table td:nth-child(7),
    .fk-table-wrapper[data-extra-open="0"] .fk-white-table th:nth-child(8),
    .fk-table-wrapper[data-extra-open="0"] .fk-white-table td:nth-child(8),
    .fk-table-wrapper[data-extra-open="0"] .fk-white-table th:nth-child(10),
    .fk-table-wrapper[data-extra-open="0"] .fk-white-table td:nth-child(10) {
        display: none !important;
    }

    /* 展开后隐藏 W / D / L，腾位置给 BT-BB / HS / Phong độ */
    .fk-table-wrapper[data-extra-open="1"] .fk-white-table th:nth-child(3),
    .fk-table-wrapper[data-extra-open="1"] .fk-white-table td:nth-child(3),
    .fk-table-wrapper[data-extra-open="1"] .fk-white-table th:nth-child(4),
    .fk-table-wrapper[data-extra-open="1"] .fk-white-table td:nth-child(4),
    .fk-table-wrapper[data-extra-open="1"] .fk-white-table th:nth-child(5),
    .fk-table-wrapper[data-extra-open="1"] .fk-white-table td:nth-child(5),
    .fk-table-wrapper[data-extra-open="1"] .fk-white-table th:nth-child(6),
    .fk-table-wrapper[data-extra-open="1"] .fk-white-table td:nth-child(6),
    .fk-table-wrapper[data-extra-open="1"] .fk-white-table th:nth-child(7),
    .fk-table-wrapper[data-extra-open="1"] .fk-white-table td:nth-child(7),
    .fk-table-wrapper[data-extra-open="1"] .fk-white-table th:nth-child(8),
    .fk-table-wrapper[data-extra-open="1"] .fk-white-table td:nth-child(8),
    .fk-table-wrapper[data-extra-open="1"] .fk-white-table th:nth-child(9),
    .fk-table-wrapper[data-extra-open="1"] .fk-white-table td:nth-child(9) {
        display: none !important;
    }

    .fk-white-table th:nth-child(1),
    .fk-white-table td:nth-child(1) {
        width: 32px !important;
    }

    .fk-white-table th:nth-child(2),
    .fk-white-table td:nth-child(2) {
        width: auto !important;
    }

    .fk-white-table th:nth-child(3),
    .fk-white-table td:nth-child(3),
    .fk-white-table th:nth-child(4),
    .fk-white-table td:nth-child(4),
    .fk-white-table th:nth-child(5),
    .fk-white-table td:nth-child(5),
    .fk-white-table th:nth-child(6),
    .fk-white-table td:nth-child(6),
    .fk-white-table th:nth-child(9),
    .fk-white-table td:nth-child(9) {
        width: 36px !important;
        text-align: center !important;
    }

    .fk-table-wrapper[data-extra-open="1"] .fk-white-table th:nth-child(7),
    .fk-table-wrapper[data-extra-open="1"] .fk-white-table td:nth-child(7) {
        width: 58px !important;
        text-align: center !important;
    }

    .fk-table-wrapper[data-extra-open="1"] .fk-white-table th:nth-child(8),
    .fk-table-wrapper[data-extra-open="1"] .fk-white-table td:nth-child(8),
    .fk-table-wrapper[data-extra-open="1"] .fk-white-table th:nth-child(9),
    .fk-table-wrapper[data-extra-open="1"] .fk-white-table td:nth-child(9) {
        width: 42px !important;
        text-align: center !important;
    }

    .fk-table-wrapper[data-extra-open="1"] .fk-white-table th:nth-child(10),
    .fk-table-wrapper[data-extra-open="1"] .fk-white-table td:nth-child(10) {
        width: 72px !important;
    }

    .fk-team-name {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

.fk-team-cell {
    min-width: 120px;
}

.fk-team-info {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.fk-team-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 90px;
}

.fk-form-flex {
    gap: 3px !important;
    flex-wrap: wrap;
}