/* ============================================================
 * 开枪杯 · 赛事数据中心 — 样式重构版
 * ============================================================
 *
 * 目录：
 *   1. 全局重置 & 隐藏滚动条
 *   2. CSS 变量
 *   3. 容器
 *   4. 页面标题头部
 *   5. 按钮通用样式
 *   6. 卡片容器
 *   7. 筛选栏
 *   8. 表格
 *   9. 标签（Tag）
 *  10. 头像
 *  11. 文字颜色工具类
 *  12. 选手数据速查卡片
 *  13. 排行榜三列网格
 *  14. 领奖台
 *  15. ELO 图表区域（左右并排）
 *  16. 对阵查询大表
 *  17. 记录分割线
 *  18. 弹窗
 *  19. 下拉选择器组件
 *  20. Toast 提示
 *  21. 曾用昵称
 *  22. 底部操作按钮
 *  23. 行内布局
 *  24. 选手搜索框
 *  25. 修复样式（统一列宽、固定行高等）
 *  26. 响应式布局
 *  27. 彻底固定行高 & 末页不缩
 *
 *  注：所有原始功能均已保留，仅整理注释、合并重复规则、修复明显笔误。
 * ============================================================ */

/* ============================================================
   1. 全局重置 & 隐藏滚动条
   ============================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 全局隐藏滚动条，保留滚动功能 */
html {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

body {
    font-family: 'Inter', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #0a101e, #0f172a);
    color: #e2e8f0;
    min-height: 100vh;
    font-size: 18px;
}

/* ============================================================
   2. CSS 变量
   ============================================================ */
:root {
    --bg: #0a101e;
    --bg2: #0f172a;
    --card: rgba(15, 23, 42, 0.88);
    --solid: #1e293b;
    --input-bg: rgba(15, 23, 42, 0.6);
    --hover: rgba(234, 179, 8, 0.04);
    --modal-bg: linear-gradient(145deg, #1a2332, #0f172a);
    --text: #e2e8f0;
    --text2: #94a3b8;
    --dim: #64748b;
    --gold: #fbbf24;
    --gold-dark: #eab308;
    --gold-shadow: rgba(234, 179, 8, 0.3);
    --red: #e94560;
    --red-shadow: rgba(233, 69, 96, 0.4);
    --green: #4ade80;
    --border: rgba(234, 179, 8, 0.18);
    --border-in: rgba(234, 179, 8, 0.25);
    --radius: 6px;
    --radius-md: 10px;
    --radius-lg: 15px;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
    --t: all 0.3s ease;
}

/* ============================================================
   3. 容器
   ============================================================ */
.container {
    width: 95%;
    max-width: 1600px;
    min-width: 300px;
    margin: 0 auto;
    padding: 20px;
}

/* ============================================================
   4. 页面标题头部
   ============================================================ */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #fbbf24;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(234, 179, 8, 0.18);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.15;
    background: repeating-linear-gradient(
        45deg,
        #eab308 0px,
        #eab308 2px,
        transparent 2px,
        transparent 6px
    );
    pointer-events: none;
}

.header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(234, 179, 8, 0.3);
    letter-spacing: 2px;
}

.header p,
.header .subtitle {
    color: #94a3b8;
    margin-top: 5px;
    font-size: 1.1rem;
}

.header .subtitle {
    font-size: 1rem;
}

.data-status {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 5px 10px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.68);
    color: #94a3b8;
    font-size: 0.95rem;
    font-weight: 600;
}

.data-status.online {
    border-color: rgba(74, 222, 128, 0.34);
    color: #4ade80;
}

.data-status.offline {
    border-color: rgba(251, 191, 36, 0.3);
    color: #fbbf24;
}

/* ============================================================
   5. 按钮通用样式
   ============================================================ */
.action-btn {
    padding: 10px 22px;
    background: linear-gradient(135deg, #e94560, #c62a47);
    color: #fff;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(233, 69, 96, 0.4);
}

.action-btn:active {
    transform: scale(0.96);
}

.action-btn.secondary {
    background: #1e293b;
    color: #fbbf24 !important;
    border: 1px solid rgba(234, 179, 8, 0.25);
}

.action-btn.danger {
    background: #7f1d1d;
}

.action-btn.small {
    padding: 6px 12px;
    font-size: 0.9rem;
}

.action-btn.active {
    background: #fbbf24;
    color: #1e293b !important;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.page-btn {
    padding: 6px 18px;
    border: 1px solid rgba(234, 179, 8, 0.18);
    border-radius: 6px;
    background: #1e293b;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.page-btn:hover:not(:disabled) {
    border-color: #fbbf24;
    color: #fbbf24;
    background: rgba(234, 179, 8, 0.08);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ============================================================
   6. 卡片容器
   ============================================================ */
.card-box {
    background: rgba(15, 23, 42, 0.88);
    border-radius: 15px;
    padding: 25px 25px 20px;
    margin-bottom: 30px;
    border: 1px solid rgba(234, 179, 8, 0.18);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
}

.card-title {
    color: #fbbf24;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    border-left: 4px solid #e94560;
    padding-left: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    cursor: pointer;
    user-select: none;
}

.card-title .title-text {
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.card-title .title-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    pointer-events: auto;
    cursor: default;
}

.fold-btn {
    font-size: 1.8rem;
    color: #fbbf24;
    padding: 0 8px;
    cursor: pointer;
}

.fold-btn:hover {
    color: #eab308;
}

/* ============================================================
   7. 筛选栏
   ============================================================ */
.filter-inline {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(234, 179, 8, 0.18);
}

.filter-group {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.filter-group label {
    margin-bottom: 5px;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fbbf24;
}

.filter-group select,
.filter-group input {
    padding: 9px 14px;
    border: 1px solid rgba(234, 179, 8, 0.25);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.6);
    font-size: 0.9rem;
    color: #e2e8f0;
    text-align: center;
    transition: all 0.3s ease;
    appearance: none;
    cursor: pointer;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%23eab308" stroke-width="2"><polyline points="6 9 12 15 18 9"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}

.filter-group select:hover,
.filter-group input:hover {
    border-color: #fbbf24;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: 0;
    border-color: #eab308;
    box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.3);
}

.filter-group select option {
    background: #0f172a;
    color: #e2e8f0;
}

/* ============================================================
   8. 表格
   ============================================================ */
table {
    width: 100%;
    border-collapse: collapse;
    color: #e2e8f0;
}

th, td {
    padding: 12px 10px;
    text-align: center;
    border-bottom: 1px solid rgba(234, 179, 8, 0.18);
    font-size: 1rem;
    vertical-align: middle;
}

th {
    color: #fbbf24;
    font-size: 0.9rem;
    letter-spacing: 0.8px;
    background: rgba(15, 23, 42, 0.95);
    text-transform: uppercase;
}

tr:hover {
    background: rgba(234, 179, 8, 0.04);
}

/* ============================================================
   9. 标签（Tag）
   ============================================================ */
.tag {
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-block;
    white-space: nowrap;
    border: 1px solid transparent;
}

.tag-stage {
    background: rgba(30, 58, 95, 0.6);
    color: #e2e8f0;
    border-color: rgba(100, 140, 200, 0.35);
}

.tag-status-active {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.4);
}

.tag-status-dormant {
    background: rgba(100, 116, 139, 0.15);
    color: #94a3b8;
    border-color: rgba(100, 116, 139, 0.3);
}

.tag-platform-bilibili {
    background: #fb7299;
    color: #fff;
    border-color: #fb7299;
}

.tag-platform-douyin {
    background: #1e1e1e;
    color: #fff;
    border-color: #333;
}

.tag-platform-huya {
    background: #f57c00;
    color: #fff;
    border-color: #f57c00;
}

.tag-platform-其他 {
    background: rgba(100, 116, 139, 0.3);
    color: #cbd5e1;
}

.tag-result-win {
    background: rgba(239, 68, 68, 0.18);
    color: #e94560;
    border-color: rgba(239, 68, 68, 0.5);
}

.tag-result-lose {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.4);
}

/* ============================================================
   10. 头像
   ============================================================ */
.table-avatar,
.podium-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e94560, #c62a47);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(233, 69, 96, 0.4);
    overflow: hidden;
    flex: 0 0 auto;
}

.table-avatar {
    font-size: 1.2rem;
    margin-right: 8px;
    vertical-align: middle;
}

.podium-avatar {
    width: 36px;
    height: 36px;
    font-size: 1.5rem;
    margin: 3px 0;
}

.player-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.avatar-preview {
    width: 96px;
    height: 96px;
    border-radius: 14px;
    font-size: 2.5rem;
}

.player-avatar-editor {
    grid-column: 1 / -1;
}

.avatar-edit-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.avatar-edit-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
}

.avatar-edit-actions input[type="file"] {
    width: 100%;
    max-width: 320px;
}

.avatar-hint {
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.45;
}

/* ============================================================
   11. 文字颜色工具类
   ============================================================ */
.text-gold {
    color: #fbbf24;
}

.text-green {
    color: #4ade80;
}

.text-red {
    color: #f87171;
}

.text-dim {
    color: #64748b;
}

.text-winrate {
    color: #f87171;
    font-weight: 700;
}
/* 注意：原文件此处有一个多余的花括号，已移除 */

/* ============================================================
   12. 选手数据速查卡片（一字排开，占满整行）
   ============================================================ */
.player-summary {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: stretch;
    gap: 6px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 10px;
    border: 1px solid rgba(234, 179, 8, 0.18);
}

.summary-item {
    flex: 1;
    text-align: center;
    padding: 4px 2px;
    min-width: 0;
}

.summary-item .label {
    font-size: 0.65rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.summary-item .value {
    font-size: 1.2rem;
    font-weight: 800;
    margin-top: 2px;
}

/* ============================================================
   13. 排行榜三列网格
   ============================================================ */
.rank-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.rank-col {
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 10px;
    padding: 18px;
    border: 1px solid rgba(234, 179, 8, 0.18);
}

.rank-col-title {
    color: #fbbf24;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
    text-align: center;
}

/* ============================================================
   14. 领奖台
   ============================================================ */
.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 12px;
    padding: 12px 4px 8px;
}

.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 12px;
    background: rgba(30, 41, 59, 0.7);
    border: 2px solid rgba(234, 179, 8, 0.3);
    flex: 0 1 100px;
    min-width: 70px;
}

.podium-gold {
    border-color: #fbbf24;
    background: linear-gradient(145deg, #2a2416, #1f1a0e);
    order: 2;
    transform: scale(1.02);
    height: 200px;
}

.podium-silver {
    border-color: #94a3b8;
    background: linear-gradient(145deg, #1e293b, #0f172a);
    order: 1;
    height: 175px;
}

.podium-bronze {
    border-color: #cd7f32;
    background: linear-gradient(145deg, #2a1f18, #1a1410);
    order: 3;
    height: 150px;
}

.podium-rank {
    font-size: 1.3rem;
    font-weight: 900;
}

.podium-gold .podium-rank {
    color: #fbbf24;
}

.podium-silver .podium-rank {
    color: #cbd5e1;
}

.podium-bronze .podium-rank {
    color: #cd7f32;
}

.podium-name {
    color: #e2e8f0;
    font-weight: 700;
    font-size: 0.8rem;
}

.podium-score {
    font-weight: 800;
    font-size: 0.95rem;
    margin-top: 2px;
}

.podium-gold .podium-score {
    color: #fbbf24;
}

.podium-silver .podium-score {
    color: #94a3b8;
}

.podium-bronze .podium-score {
    color: #cd7f32;
}

/* ============================================================
   15. ELO 图表区域（左右并排）
   ============================================================ */
.stats-elo-section {
    display: flex;
    flex-direction: row;
    gap: 24px;
    margin-top: 24px;
    padding: 20px 24px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(234, 179, 8, 0.18);
}

.stats-left {
    flex: 0 0 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    text-align: center;
}

.stat-row {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-row .stat-label {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-row .stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: #fbbf24;
    line-height: 1.2;
}

.stat-row:last-child .stat-value {
    color: #64748b;
}

.elo-chart-wrap {
    flex: 1;
    min-width: 0;
}

.elo-chart-wrap .chart-title {
    color: #fbbf24;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-align: center;
}

.elo-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 200px;
    border-bottom: 1px solid rgba(234, 179, 8, 0.25);
}

.elo-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
    justify-content: flex-end;
}

.elo-bar {
    width: 100%;
    max-width: 40px;
    background: linear-gradient(180deg, #f43f5e, #fbbf24);
    border-radius: 4px 4px 0 0;
    min-width: 14px;
    position: relative;
    display: flex;
    justify-content: center;
}

.elo-bar .bar-count {
    position: absolute;
    top: -20px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fbbf24;
    white-space: nowrap;
}

.elo-label {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 6px;
    text-align: center;
}

/* ============================================================
   16. 对阵查询大表
   ============================================================ */
.h2h-table-wrap {
    margin: 20px 0;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 10px;
    border: 1px solid rgba(234, 179, 8, 0.18);
    overflow-x: auto;
}

.h2h-table-wrap table {
    table-layout: fixed;
    min-width: 500px;
}

.h2h-avatar-cell {
    width: 33.33%;
    padding: 14px 8px;
    vertical-align: middle;
}

.h2h-avatar-cell .big-avatar {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: linear-gradient(135deg, #e94560, #c62a47);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.6rem;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(233, 69, 96, 0.4);
    user-select: none;
    overflow: hidden;
}

.h2h-avatar-cell .big-avatar:has(> img) {
    width: 256px;
    height: 256px;
    border-radius: 18px;
}

.h2h-label-cell {
    width: 11.11%;
    color: #fbbf24;
    font-weight: 600;
    font-size: 0.9rem;
    background: rgba(234, 179, 8, 0.04);
    white-space: nowrap;
}

.h2h-value-cell {
    width: 11.11%;
    font-weight: 700;
    font-size: 1.1rem;
    white-space: nowrap;
}

/* ============================================================
   17. 记录分割线
   ============================================================ */
.record-divider {
    border-left: 2px solid rgba(234, 179, 8, 0.18);
    border-right: 2px solid rgba(234, 179, 8, 0.18);
}

.record-divider-left {
    border-left: 2px solid rgba(234, 179, 8, 0.18);
}

.record-divider-right {
    border-right: 2px solid rgba(234, 179, 8, 0.18);
}

th.record-divider {
    border-left: 2px solid rgba(234, 179, 8, 0.3);
    border-right: 2px solid rgba(234, 179, 8, 0.3);
}

th.record-divider-left {
    border-left: 2px solid rgba(234, 179, 8, 0.3);
}

th.record-divider-right {
    border-right: 2px solid rgba(234, 179, 8, 0.3);
}

/* ============================================================
   18. 弹窗
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: linear-gradient(145deg, #1a2332, #0f172a);
    padding: 32px 35px;
    border-radius: 20px;
    border: 1px solid rgba(234, 179, 8, 0.3);
    width: 90%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7);
    text-align: center;
}

.modal-content h2 {
    color: #fbbf24;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 25px;
    border-bottom: 2px solid rgba(234, 179, 8, 0.18);
    padding-bottom: 12px;
}

.modal-content .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px 30px;
}

.modal-content .form-full {
    grid-column: span 2;
}

.modal-content .filter-group input,
.modal-content .filter-group select {
    padding: 10px 14px;
    border: 1px solid rgba(234, 179, 8, 0.25);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.7);
    color: #e2e8f0;
    text-align: center;
    transition: all 0.3s ease;
}

.modal-content .filter-group input:focus,
.modal-content .filter-group select:focus {
    border-color: #eab308;
    box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.3);
}

/* ============================================================
   19. 下拉选择器组件（隐藏滚动条）
   ============================================================ */
.selector-wrap {
    position: relative;
    min-width: 150px;
    max-width: 200px;
}

.selector-wrap input {
    width: 100%;
    padding: 9px 15px;
    border: 1px solid rgba(234, 179, 8, 0.25);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.6);
    color: #e2e8f0;
    text-align: center;
}

.selector-wrap input:focus {
    border-color: #fbbf24;
}

.selector-wrap input::placeholder {
    color: #64748b;
}

.selector-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background: rgba(20, 30, 50, 0.75);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(234, 179, 8, 0.25);
    border-radius: 8px;
    z-index: 500;
    padding: 4px 0;
}

.selector-dropdown::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.selector-dropdown .sd-option {
    padding: 6px 14px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #e2e8f0;
    text-align: center;
    border-bottom: 1px solid rgba(234, 179, 8, 0.06);
    transition: background 0.15s;
}

.selector-dropdown .sd-option:hover {
    background: rgba(234, 179, 8, 0.15);
    color: #fbbf24;
}

.selector-dropdown .sd-empty {
    padding: 12px 14px;
    color: #64748b;
    font-size: 0.95rem;
    text-align: center;
}

/* ============================================================
   20. Toast 提示
   ============================================================ */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #e94560;
    color: #fff;
    padding: 12px 25px;
    border-radius: 8px;
    z-index: 2000;
    font-weight: 700;
}

.toast.success {
    background: #16a34a;
}

.toast.error {
    background: #dc2626;
}

/* ============================================================
   21. 曾用昵称
   ============================================================ */
.alias-cell {
    font-size: 0.7rem;
    color: #94a3b8;
    max-width: 140px;
    word-break: break-word;
}

.alias-cell .alias-item {
    display: block;
}

/* ============================================================
   22. 底部操作按钮
   ============================================================ */
.footer-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 30px 0 20px;
}

.footer-actions .action-btn {
    padding: 7px 18px;
    font-size: 0.85rem;
    min-width: 100px;
    justify-content: center;
}

.mode-active {
    border-color: #4ade80 !important;
    color: #4ade80 !important;
    background: rgba(34, 197, 94, 0.08) !important;
}

.mode-all {
    border-color: #fbbf24 !important;
    color: #fbbf24 !important;
    background: rgba(234, 179, 8, 0.08) !important;
}

/* ============================================================
   23. 行内布局
   ============================================================ */
.h2h-inline,
.quick-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.h2h-inline .selector-wrap,
.quick-inline .selector-wrap {
    flex: 1;
    min-width: 140px;
}

.h2h-inline .action-btn,
.quick-inline .action-btn {
    flex-shrink: 0;
}

/* ============================================================
   24. 选手搜索框
   ============================================================ */
.player-search-input {
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    width: 200px;
    text-align: center;
}

.player-search-input::placeholder {
    color: #94a3b8;
    text-align: center;
}

/* ============================================================
   25. 修复样式：统一列宽、固定行高等
   ============================================================ */
/* 25.1 对阵大表 & 速查记录表 7 列宽分配（比例 1:1:1:1:1.5:0.5:1.5） */
.h2h-table-wrap table,
.h2h-table-wrap ~ table,
.player-summary ~ table {
    table-layout: fixed;
    min-width: 520px;
    width: 100%;
    border-collapse: collapse;
    color: #e2e8f0;
}

.h2h-table-wrap table th,
.h2h-table-wrap table td,
.h2h-table-wrap ~ table th,
.h2h-table-wrap ~ table td,
.player-summary ~ table th,
.player-summary ~ table td {
    padding: 9px 6px !important;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.h2h-table-wrap ~ table th,
.player-summary ~ table th {
    color: #fbbf24;
    font-size: 0.9rem;
    letter-spacing: 0.8px;
    background: rgba(15, 23, 42, 0.95);
    text-transform: uppercase;
}

.h2h-table-wrap ~ table tr:hover,
.player-summary ~ table tr:hover {
    background: rgba(234, 179, 8, 0.04);
}

/* 列宽分配：nth-child(1)~ (7) */
.h2h-table-wrap table th:nth-child(1),
.h2h-table-wrap table td:nth-child(1),
.h2h-table-wrap ~ table th:nth-child(1),
.h2h-table-wrap ~ table td:nth-child(1),
.player-summary ~ table th:nth-child(1),
.player-summary ~ table td:nth-child(1) {
    width: 13.33%;
}

.h2h-table-wrap table th:nth-child(2),
.h2h-table-wrap table td:nth-child(2),
.h2h-table-wrap ~ table th:nth-child(2),
.h2h-table-wrap ~ table td:nth-child(2),
.player-summary ~ table th:nth-child(2),
.player-summary ~ table td:nth-child(2) {
    width: 13.33%;
}

.h2h-table-wrap table th:nth-child(3),
.h2h-table-wrap table td:nth-child(3),
.h2h-table-wrap ~ table th:nth-child(3),
.h2h-table-wrap ~ table td:nth-child(3),
.player-summary ~ table th:nth-child(3),
.player-summary ~ table td:nth-child(3) {
    width: 13.33%;
}

.h2h-table-wrap table th:nth-child(4),
.h2h-table-wrap table td:nth-child(4),
.h2h-table-wrap ~ table th:nth-child(4),
.h2h-table-wrap ~ table td:nth-child(4),
.player-summary ~ table th:nth-child(4),
.player-summary ~ table td:nth-child(4) {
    width: 13.33%;
}

.h2h-table-wrap table th:nth-child(5),
.h2h-table-wrap table td:nth-child(5),
.h2h-table-wrap ~ table th:nth-child(5),
.h2h-table-wrap ~ table td:nth-child(5),
.player-summary ~ table th:nth-child(5),
.player-summary ~ table td:nth-child(5) {
    width: 20%;
}

.h2h-table-wrap table th:nth-child(6),
.h2h-table-wrap table td:nth-child(6),
.h2h-table-wrap ~ table th:nth-child(6),
.h2h-table-wrap ~ table td:nth-child(6),
.player-summary ~ table th:nth-child(6),
.player-summary ~ table td:nth-child(6) {
    width: 6.67%;
}

.h2h-table-wrap table th:nth-child(7),
.h2h-table-wrap table td:nth-child(7),
.h2h-table-wrap ~ table th:nth-child(7),
.h2h-table-wrap ~ table td:nth-child(7),
.player-summary ~ table th:nth-child(7),
.player-summary ~ table td:nth-child(7) {
    width: 20%;
}

/* 25.2 排行榜表格平均分配 + 状态列不撑高 */
.rank-col table {
    table-layout: fixed;
}

.rank-col table tr,
.rank-col table tbody tr,
.rank-col table tbody tr td {
    height: 34px !important;
    line-height: 34px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    vertical-align: middle !important;
}

.rank-col table thead tr,
.rank-col table thead tr th {
    height: 32px !important;
    line-height: 32px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.rank-col table th,
.rank-col table td {
    padding-left: 6px !important;
    padding-right: 6px !important;
    font-size: 0.82rem;
}

.rank-col table th:nth-child(1),
.rank-col table td:nth-child(1) {
    width: 25%;
    text-align: center;
}

.rank-col table th:nth-child(2),
.rank-col table td:nth-child(2) {
    width: 25%;
    text-align: center;
}

.rank-col table th:nth-child(3),
.rank-col table td:nth-child(3) {
    width: 25%;
    text-align: center;
}

.rank-col table th:nth-child(4),
.rank-col table td:nth-child(4) {
    width: 25%;
    text-align: center;
    white-space: nowrap;
}

/* 状态标签不换行、高度固定 */
.rank-col table td:nth-child(4) .tag,
.rank-col table td:nth-child(4) .status-badge {
    display: inline-block;
    white-space: nowrap;
    line-height: 1;
    padding: 2px 8px;
    font-size: 0.7rem;
    vertical-align: middle;
}

/* ============================================================
   26. 响应式布局
   ============================================================ */
@media (max-width: 1024px) {
    th, td {
        padding: 8px 6px;
    }
}

@media (max-width: 900px) {
    .rank-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 2.5rem;
    }

    .filter-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-inline .filter-group input,
    .filter-inline .selector-wrap,
    .filter-inline .filter-group select {
        width: 100%;
        min-width: unset;
        max-width: unset;
    }

    .filter-inline .action-btn {
        width: 100%;
        justify-content: center;
    }

    .card-title {
        font-size: 1.3rem;
    }

    .footer-actions {
        flex-direction: column;
        align-items: center;
    }

    .footer-actions .action-btn {
        width: 100%;
        max-width: 220px;
    }
}

@media (max-width: 600px) {
    .modal-content {
        padding: 25px 20px;
    }

    .modal-content .form-grid {
        grid-template-columns: 1fr;
    }

    .modal-content .form-full {
        grid-column: span 1;
    }
}

/* ============================================================
   27. 彻底固定行高 & 末页不缩
   ============================================================ */
/* 1. 表格自身最小高度（防止末页收缩） */
table {
    min-height: 350px;
}

/* 2. 所有数据行严格固定 60px，禁止被撑开 */
.card-box tbody tr {
    height: 60px !important;
    max-height: 60px !important;
    overflow: hidden !important;
}

/* 3. 单元格垂直居中，内容超出隐藏 */
.card-box tbody td {
    height: 60px !important;
    max-height: 60px !important;
    padding-top: 2px !important;
    padding-bottom: 2px !important;
    overflow: hidden !important;
    vertical-align: middle !important;
}

/* 4. ★ 曾用昵称改为行内显示（一行排完），超出省略，不换行不撑高 */
.alias-item {
    display: inline !important;
}
.alias-item:not(:last-child)::after {
    content: "·";
    white-space: pre;
}
.alias-cell {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 140px !important;
    line-height: 44px !important;
}

/* 5. 成员列单行省略，不撑高 */
.member-cell {
    display: block !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.2 !important;
    max-height: 1.2em !important;
}

/* ============================================================
   27B. 对阵大表行高紧凑（覆盖第27部分通用规则）
   ============================================================ */
.h2h-table-wrap tbody tr,
.h2h-table-wrap tbody td {
    height: 30px !important;
    max-height: 30px !important;
    line-height: 30px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.h2h-table-wrap tbody td {
    vertical-align: middle !important;
}

/* 头像单元格跨行时不受行高约束，使用头像自身高度 */
.h2h-avatar-cell[rowspan="7"] {
    height: auto !important;
    line-height: 1 !important;
}

/* ============================================================
   28. 赛事门户风格覆盖层（仅 index-modern.html 使用）
   与 gsbp.eastfs.cn 首页统一：深色画布、细线框架、金色主强调。
   ============================================================ */
:root {
    --bg: #0a101e;
    --bg2: #0d1422;
    --card: rgba(13, 20, 34, 0.82);
    --solid: #121b2b;
    --input-bg: #0d1524;
    --hover: rgba(234, 179, 8, 0.06);
    --modal-bg: #101827;
    --text: #e5e7eb;
    --text2: #94a3b8;
    --text-primary: #e5e7eb;
    --text-secondary: #94a3b8;
    --dim: #64748b;
    --gold: #eab308;
    --gold-dark: #ca8a04;
    --gold-shadow: rgba(234, 179, 8, 0.16);
    --red: #ef4444;
    --red-shadow: rgba(239, 68, 68, 0.2);
    --green: #4ade80;
    --border: #273247;
    --border-in: #344158;
    --radius: 2px;
    --radius-md: 3px;
    --radius-lg: 4px;
    --shadow: none;
}

html {
    scrollbar-width: thin;
    scrollbar-color: #334155 #0a101e;
}

html::-webkit-scrollbar {
    display: block;
    width: 9px;
    height: 9px;
}

html::-webkit-scrollbar-track { background: #0a101e; }
html::-webkit-scrollbar-thumb { background: #334155; border: 2px solid #0a101e; }

body {
    background: #0a101e;
    color: var(--text);
    font-size: 16px;
    line-height: 1.55;
}

.container {
    width: min(100%, 1440px);
    padding: 0 40px 48px;
}

.header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    min-height: 146px;
    margin: 0 -40px 34px;
    padding: 42px 40px 28px;
    border: 0;
    border-bottom: 1px solid #273247;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    text-align: left;
}

.header::before { display: none; }

.header h1 {
    color: #f8fafc;
    font-size: clamp(2rem, 4vw, 3.35rem);
    font-weight: 700;
    letter-spacing: -0.065em;
    line-height: 1.08;
    text-shadow: none;
}

.data-status {
    margin: 0;
    padding: 5px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text2);
    font-size: 0.78rem;
    letter-spacing: 0.05em;
}

.data-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 14%, transparent);
}

.data-status.online { color: #eab308; }
.data-status.offline { color: #94a3b8; }

.card-box {
    margin-bottom: 20px;
    padding: 26px 0 0;
    border: 0;
    border-top: 1px solid #273247;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.card-title {
    margin: 0 0 18px;
    padding: 0;
    border-left: 0;
    color: #f8fafc;
    font-size: 1.35rem;
    letter-spacing: -0.025em;
}

.card-title .title-text::before {
    content: '';
    width: 3px;
    height: 1.1em;
    flex: 0 0 auto;
    background: var(--gold);
}

.card-title .title-text > .fa-solid {
    color: #eab308;
    font-size: 0.94em;
}

.fold-btn {
    color: var(--text2);
    font-size: 1rem;
    padding: 4px 0 4px 10px;
}

.fold-btn:hover { color: var(--gold); }
.fold-btn .fa-solid { width: 0.7em; text-align: center; }

.action-btn,
.page-btn {
    min-height: 38px;
    border-radius: 0;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: none;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.action-btn {
    padding: 8px 16px;
    background: #eab308;
    color: #111827;
    text-shadow: none;
}

.action-btn:hover {
    transform: none;
    background: #facc15;
    box-shadow: none;
}

.action-btn:active { transform: none; background: #ca8a04; }

.action-btn.secondary,
.page-btn {
    border: 1px solid #3b485d;
    background: transparent;
    color: #cbd5e1 !important;
}

.action-btn.secondary:hover,
.page-btn:hover:not(:disabled) {
    border-color: var(--gold);
    background: rgba(234, 179, 8, 0.08);
    color: #fef3c7 !important;
}

.action-btn.danger { background: #7f1d1d; color: #fee2e2; }
.action-btn.danger:hover { background: #991b1b; }

.action-btn.active {
    background: transparent;
    border: 1px solid var(--gold);
    color: #fef3c7 !important;
    box-shadow: none;
}

.filter-inline,
.player-summary,
.rank-col,
.stats-elo-section,
.h2h-table-wrap {
    border: 1px solid #273247;
    border-radius: 0;
    background: rgba(15, 23, 42, 0.42);
    box-shadow: none;
}

.filter-inline {
    justify-content: flex-start;
    gap: 12px;
    padding: 14px;
}

.filter-group { text-align: left; }
.filter-group label,
.rank-col-title,
.elo-chart-wrap .chart-title {
    color: #cbd5e1;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
}

.filter-group select,
.filter-group input,
.selector-wrap input,
.player-search-input {
    min-height: 38px;
    border-color: #3b485d;
    border-radius: 0;
    background-color: #0a101e;
    color: #e5e7eb;
    text-align: left;
}

.filter-group select:focus,
.filter-group input:focus,
.selector-wrap input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.14);
}

.selector-dropdown {
    border-color: #3b485d;
    border-radius: 0;
    background: #101827;
    backdrop-filter: none;
}

.selector-dropdown .sd-option:hover {
    background: rgba(234, 179, 8, 0.1);
    color: #fef3c7;
}

table { min-height: 0; }

th,
td {
    border-bottom-color: #273247;
    font-size: 0.9rem;
}

th {
    padding: 11px 10px;
    background: rgba(15, 23, 42, 0.72);
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

tr:hover { background: rgba(234, 179, 8, 0.035); }

.card-box tbody tr,
.card-box tbody td {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

.card-box tbody td {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

.rank-col table tr,
.rank-col table tbody tr,
.rank-col table tbody tr td {
    height: 40px !important;
    line-height: 1.35 !important;
}

.tag {
    border-radius: 1px;
    font-size: 0.72rem;
    font-weight: 600;
}

.tag-result-win { background: rgba(74, 222, 128, 0.12); color: #86efac; border-color: rgba(74, 222, 128, 0.3); }
.tag-result-lose { background: rgba(248, 113, 113, 0.12); color: #fca5a5; border-color: rgba(248, 113, 113, 0.3); }

.text-gold { color: #facc15; }
.text-green { color: #86efac; }
.text-winrate { color: #fef3c7; }

.player-summary {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 0;
    padding: 0;
}

.summary-item {
    padding: 14px 8px;
    border-right: 1px solid #273247;
}

.summary-item:last-child { border-right: 0; }
.summary-item .label { color: #64748b; font-size: 0.68rem; letter-spacing: 0.06em; }
.summary-item .value { color: #e5e7eb; font-size: 1.12rem; }

.rank-grid { gap: 14px; }
.rank-col { padding: 16px; }
.rank-col-title { margin-bottom: 10px; text-align: left; }

.podium {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 8px;
    padding: 0 0 14px;
}
.podium-item {
    position: relative;
    min-width: 0;
    min-height: 132px;
    height: auto !important;
    padding: 12px 6px 10px;
    border: 1px solid #344158;
    border-top-width: 3px;
    border-radius: 2px;
    background: #101827;
    box-shadow: none;
}
.podium-gold { transform: none; background: #171607; border-top-color: #eab308; }
.podium-silver { background: #111827; border-top-color: #94a3b8; }
.podium-bronze { background: #18120d; border-top-color: #cd7f32; }
.podium .podium-avatar { width: 52px; height: 52px; margin: 6px 0 7px; border-radius: 2px; }
.podium-rank { font-size: 0.74rem; line-height: 1; letter-spacing: 0.06em; }
.podium-name { width: 100%; overflow: hidden; color: #e5e7eb; font-size: 0.8rem; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.podium-score { margin-top: 4px; font-size: 1rem; font-variant-numeric: tabular-nums; }

.stats-elo-section { gap: 18px; padding: 18px; }
.stat-row .stat-value { color: #facc15; font-size: 1.8rem; }
.elo-chart { border-bottom-color: #3b485d; }
.elo-bar { border-radius: 0; background: #eab308; }
.elo-bar .bar-count { color: #fef3c7; }

.h2h-table-wrap { margin: 16px 0; }
.h2h-label-cell { background: rgba(234, 179, 8, 0.045); color: #cbd5e1; }
.h2h-avatar-cell .big-avatar { border-radius: 2px; box-shadow: none; }
.h2h-avatar-cell .big-avatar:has(> img) {
    width: 512px;
    height: 512px;
    max-width: 100%;
    border-radius: 2px;
}

.table-avatar,
.podium-avatar,
.avatar-preview { border-radius: 2px; box-shadow: none; }

.modal-overlay { background: rgba(3, 7, 18, 0.88); }
.modal-content {
    border-color: #3b485d;
    border-radius: 2px;
    background: #101827;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.modal-content h2 { color: #f8fafc; border-bottom-color: #273247; }

.toast { border-radius: 0; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35); }

@media (max-width: 960px) {
    .container { padding-right: 24px; padding-left: 24px; }
    .header { margin-right: -24px; margin-left: -24px; padding-right: 24px; padding-left: 24px; }
    .player-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .summary-item { border-bottom: 1px solid #273247; }
    .summary-item:nth-child(3n) { border-right: 0; }
    .summary-item:nth-last-child(-n + 3) { border-bottom: 0; }
}

@media (max-width: 640px) {
    .container { padding-right: 16px; padding-left: 16px; }
    .header {
        align-items: flex-start;
        flex-direction: column;
        min-height: 0;
        margin-right: -16px;
        margin-left: -16px;
        padding: 28px 16px 20px;
    }
    .header h1 { font-size: 2.05rem; }
    .data-status { font-size: 0.72rem; }
    .player-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .summary-item:nth-child(3n) { border-right: 1px solid #273247; }
    .summary-item:nth-child(2n) { border-right: 0; }
    .summary-item:nth-last-child(-n + 3) { border-bottom: 1px solid #273247; }
    .summary-item:nth-last-child(-n + 2) { border-bottom: 0; }
    .h2h-avatar-cell .big-avatar:has(> img) { width: 72px; height: 72px; }
}

/* 对阵原图按 256 × 256 显示；小屏使用紧凑尺寸。 */
.h2h-table-wrap {
    overflow-x: auto;
}

.h2h-table-wrap table {
    width: 960px;
    min-width: 960px;
    margin-right: auto;
    margin-left: auto;
}

.h2h-table-wrap table col:nth-child(1),
.h2h-table-wrap table col:nth-child(5),
.h2h-avatar-cell {
    width: 304px !important;
    min-width: 304px !important;
}

.h2h-table-wrap table col:nth-child(2),
.h2h-table-wrap table col:nth-child(3),
.h2h-table-wrap table col:nth-child(4) {
    width: 117px !important;
}

.h2h-avatar-cell .big-avatar:has(> img) {
    width: 256px;
    height: 256px;
    max-width: none;
}

@media (max-width: 640px) {
    .h2h-table-wrap table {
        width: 100%;
        min-width: 500px;
    }

    .h2h-table-wrap table col:nth-child(1),
    .h2h-table-wrap table col:nth-child(5),
    .h2h-avatar-cell {
        width: 33.33% !important;
        min-width: 0 !important;
    }

    .h2h-table-wrap table col:nth-child(2),
    .h2h-table-wrap table col:nth-child(3),
    .h2h-table-wrap table col:nth-child(4) {
        width: 11.11% !important;
    }

    .h2h-avatar-cell .big-avatar:has(> img) {
        width: 72px;
        height: 72px;
    }

    .podium { gap: 6px; }
    .podium-item { min-height: 116px; padding-right: 4px; padding-left: 4px; }
    .podium .podium-avatar { width: 42px; height: 42px; }
    .podium-name { font-size: 0.72rem; }
}

/* score_BP iframe 深链：只压缩查询详情首屏，不改变普通页面。 */
html.datacenter-embed-score-bp .container {
    width: 100%;
    max-width: none;
    padding-top: 12px;
}

html.datacenter-embed-score-bp .header,
html.datacenter-embed-score-bp #h2h-section .h2h-inline {
    display: none;
}

html.datacenter-embed-score-bp #h2h-section {
    margin-top: 0;
}
