
/* ========== 投档线排行榜模块样式 ========== */
.ranking-container { display: flex; flex-direction: column; height: 100%; width: 100%; overflow: hidden; }
.ranking-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; flex-shrink: 0; padding: 0 5px; }
.ranking-header h2 { font-size: 18px; margin: 0; color: #1e3a8a; }
.ranking-stats { font-size: 13px; color: #64748b; }
.ranking-toolbar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; padding: 10px 12px; background: #f8fafc; border-radius: 8px; border: 1px solid #e2e8f0; align-items: flex-end; flex-shrink: 0; }
.ranking-filter-group { display: flex; flex-direction: column; gap: 4px; }
.ranking-filter-group label { font-size: 14px; font-weight: 600; color: #475569; }
.ranking-filter-group input[type="text"], .ranking-filter-group select { padding: 6px 10px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 14px; min-width: 140px; }
.ranking-filter-group input[type="checkbox"] { margin-right: 4px; vertical-align: middle; }
.ranking-sort-group { display: flex; gap: 6px; }
.ranking-btn-sort { background: white; border: 1px solid #cbd5e1; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 14px; transition: all 0.2s; }
.ranking-btn-sort:hover { border-color: #007bff; color: #007bff; }
.ranking-btn-sort.active { background: #007bff; color: white; border-color: #007bff; }
.ranking-table-wrapper { overflow: auto; flex-grow: 1; min-height: 0; border: 1px solid #e2e8f0; border-radius: 8px; }
.ranking-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
.ranking-table thead th { position: sticky; top: 0; background: #f8fafc; padding: 10px 12px; font-weight: 600; border-bottom: 2px solid #e2e8f0; z-index: 5; white-space: nowrap; }
.ranking-table tbody td { padding: 8px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.ranking-table tbody tr:hover { background-color: #f1f7ff; }
.ranking-rank-label { font-family: Consolas, "Courier New", monospace; font-weight: bold; padding: 2px 6px; border-radius: 4px; font-size: 13px; white-space: nowrap; }
.ranking-rank-sci { background: #dcfce7; color: #166534; }
.ranking-rank-art { background: #fef3c7; color: #92400e; }
.ranking-rank-total { background: #dbeafe; color: #1e40af; }
.ranking-sub-info { font-size: 12px; color: #64748b; display: block; margin-top: 2px; }
.ranking-score { font-weight: 600; font-size: 15px; }
.ranking-delta { display: inline-block; font-size: 11px; padding: 1px 5px; border-radius: 3px; margin-top: 3px; font-weight: 500; }
.ranking-delta-up { background: #dcfce7; color: #15803d; }
.ranking-delta-down { background: #fee2e2; color: #dc2626; }
.ranking-delta-same { background: #f1f5f9; color: #64748b; }
#ranking-tab { flex-direction: column; }
#ranking-tab.active { display: flex; }
@media (max-width: 768px) {
    .ranking-header { flex-direction: column; align-items: flex-start; gap: 5px; }
    .ranking-header h2 { font-size: 15px; }
    
    .ranking-toolbar { flex-direction: row; flex-wrap: wrap; gap: 8px; align-items: flex-end; padding: 8px; }
    
    /* 1&2: 年份与省份并排，各占约一半 */
    .ranking-filter-group:nth-child(1), .ranking-filter-group:nth-child(2) { flex: 1 1 45%; }
    
    /* 3: 搜索框占满全宽 */
    .ranking-filter-group:nth-child(3) { flex: 1 1 100%; }
    
    /* 4: 对比选框靠右对齐 */
    .ranking-filter-group:nth-child(4) { flex: 1 1 100%; align-items: flex-end; margin-top: -5px; }
    
    /* 5 是空白垫片，隐藏掉 */
    .ranking-toolbar > div:nth-child(5) { display: none; }
    
    /* 6: 排序按钮容器占满全宽 */
    .ranking-filter-group:nth-child(6) { flex: 1 1 100%; align-items: stretch; }
    
    .ranking-filter-group input[type="text"], .ranking-filter-group select { min-width: 0; width: 100%; box-sizing: border-box; padding: 6px; }
    
    .ranking-sort-group { flex-wrap: nowrap; justify-content: space-between; display: flex; width: 100%; }
    .ranking-btn-sort { flex: 1; padding: 6px 2px; text-align: center; font-size: 12px; margin: 0 2px; white-space: nowrap; }
    .ranking-btn-sort:first-child { margin-left: 0; }
    .ranking-btn-sort:last-child { margin-right: 0; }
    
    /* 表格极度压缩与列宽定制 */
    .ranking-table th, .ranking-table td { padding: 6px 4px; font-size: 11px; }
    
    /* 1. 省份列 */
    .ranking-table th:nth-child(1), .ranking-table td:nth-child(1) { width: 30px; white-space: nowrap; }
    
    /* 2. 院校列 - 加宽但适度，促使其换两行 */
    .ranking-table th:nth-child(2), .ranking-table td:nth-child(2) { 
        min-width: 90px; 
        max-width: 100px;
        white-space: normal; /* 允许校名换行 */
        word-break: break-all;
    }
    
    /* 3-8. 其他所有排位、分数等数字列 - 极度压缩、禁止换行 */
    .ranking-table th:nth-child(n+3), .ranking-table td:nth-child(n+3) { 
        white-space: nowrap; 
        text-align: center; 
    }
    
    /* 动态隐藏排位列逻辑（仅在手机端生效） */
    .ranking-table .col-sci, .ranking-table .col-art, .ranking-table .col-total { display: none; }
    #ranking-tab[data-active-sort="理科排位"] .ranking-table .col-sci { display: table-cell; }
    #ranking-tab[data-active-sort="文科排位"] .ranking-table .col-art { display: table-cell; }
    #ranking-tab[data-active-sort="总排位"] .ranking-table .col-total { display: table-cell; }
    
    .ranking-rank-label { padding: 1px 4px; font-size: 11px; }
    .ranking-score { font-size: 13px; }
    .ranking-sub-info { font-size: 10px; }
}
