/* player_h2h.css - 完整优化版 */

:root {
    --primary-bg: #0f172a;
    --card-bg: #ffffff;
    --accent-color: #6366f1;
    --win-color: #22c55e;
    --lose-color: #ef4444;
    --text-main: #1e293b;
    --text-muted: #64748b;
    /* 竞技对峙色 */
    --player-blue: #2563eb;
    --player-red: #dc2626;
}

body {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    background-color: #f8fafc;
    color: var(--text-main);
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

/* 导航按钮 */
.nav-header {
    margin-bottom: 20px;
}
.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    transition: color 0.2s;
}
.nav-btn:hover {
    color: var(--accent-color);
}
.nav-btn svg { width: 20px; height: 20px; }

h2 {
    text-align: center;
    font-weight: 800;
    font-size: 2.2rem;
    margin-bottom: 30px;
    color: #0f172a;
}

/* 筛选区域 */
.filter-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.selector-form {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

select {
    padding: 12px;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    background: #fff;
    font-size: 1rem;
    flex: 1;
    font-weight: 600;
}

.vs-divider {
    font-weight: 900;
    font-style: italic;
    color: #cbd5e1;
    font-size: 1.2rem;
}

button {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover {
    background: #4f46e5;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* --- 优化点 2 & 3: 夸张对比头部 --- */
.h2h-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch; /* 让左右高度一致 */
    background: #000;
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    position: relative;
}

.player-info {
    padding: 50px 20px;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 左侧蓝色阵营 */
.player-left {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e293b 100%);
    border-right: 1px solid rgba(255,255,255,0.1);
}

/* 右侧红色阵营 */
.player-right {
    background: linear-gradient(135deg, #1e293b 0%, #7f1d1d 100%);
    border-left: 1px solid rgba(255,255,255,0.1);
}

.avatar-wrapper img {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 5px solid rgba(255,255,255,0.2);
    object-fit: cover;
    margin-bottom: 15px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.player-info h3 {
    color: white;
    font-size: 1.5rem;
    margin: 10px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* 极其夸张的胜场数字 */
.win-count-display {
    margin-top: 10px;
}

.win-count-display .num {
    font-size: 6rem; /* 极其夸张 */
    font-weight: 900;
    line-height: 0.9;
    display: block;
    font-family: 'Impact', 'Arial Black', sans-serif;
}

.player-left .num {
    color: #60a5fa;
    text-shadow: 0 0 20px rgba(37, 99, 235, 0.6);
}

.player-right .num {
    color: #f87171;
    text-shadow: 0 0 20px rgba(220, 38, 38, 0.6);
}

.win-count-display .unit {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.6);
    font-weight: 800;
    letter-spacing: 4px;
}

/* 中间 VS 勋章 */
.vs-badge {
    align-self: center;
    background: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: black;
    margin: 0 -25px;
    z-index: 10;
    box-shadow: 0 0 0 8px rgba(0,0,0,0.4);
}

/* --- 优化点 1: 表格姓名高亮 --- */
.history-card {
    background: white;
    border-radius: 20px;
    padding: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

th {
    padding: 15px;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: left;
}

td {
    background: #fdfdfd;
    padding: 20px 15px;
}

td:first-child { border-radius: 12px 0 0 12px; }
td:last-child { border-radius: 0 12px 12px 0; }

/* 姓名高亮与上下排列 */
.team-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

/* 关键姓名高亮样式 */
.highlight-name {
    display: inline-block;
    background: #f1f5f9;
    color: #0f172a;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 800;
    margin: 0 2px;
}

.highlight-name.player-left {
    border-left: 4px solid var(--player-blue);
}

.highlight-name.player-right {
    border-left: 4px solid var(--player-red);
}

.score-pill {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 800;
}

.score-pill.player-left { background: #dcebfc; color: #156380; border: 1px solid #bbf2f7; }
.score-pill.player-right { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

.winner-name {
    font-weight: 800;
    background: rgba(99, 102, 241, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
}
.winner-name.player-left {
    color: var(--player-blue);
}
.winner-name.player-right {
    color: var(--player-red);
}

.win-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-left: 6px;
    border-radius: 50%;
    background: #22c55e; /* 绿色胜利色 */
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.8);
}

.mobile-only {
    display: none;
}

/* 响应式 */
/* --- 移动端卡片化改造 --- */
@media (max-width: 768px) {
    /* 1. 头部布局调整 */
    .h2h-header {
        grid-template-columns: 1fr auto 1fr;
        /*gap: 0;*/
        border-radius: 16px;
    }
    .player-info {
        padding: 25px 10px; /* 缩小内边距 */
    }

    /* 缩小头像 */
    .avatar-wrapper img {
        width: 60px;
        height: 60px;
        border-width: 2px;
        margin-bottom: 8px;
    }

    .player-info h3 {
        font-size: 0.9rem;
        margin-bottom: 5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* 放大数字 */
    .win-count-display .num {
        font-size: 10rem; /* 手机端依然占据视觉中心 */
    }

    .win-count-display .unit {
        font-size: 0.8rem;
        letter-spacing: 2px;
    }

    /* VS 勋章缩小 */
    .vs-badge {
        order: 2;
        width: 18px;
        height: 18px;
        font-size: 0.65rem;
        margin: 0 -10px;
        box-shadow: 0 0 0 5px rgba(0,0,0,0.3);
    }
    .player-left { order: 1; padding: 50px 20px 50px 20px; }
    .player-right { order: 3; padding: 50px 20px 50px 20px; }

    /* 2. 表格转卡片逻辑 */
    .history-card {
        background: transparent; /* 去掉容器背景，让子卡片独立 */
        box-shadow: none;
        padding: 0;
    }

    .history-card table,
    .history-card thead,
    .history-card tbody,
    .history-card th,
    .history-card td,
    .history-card tr {
        display: block;
    }

    /* 隐藏表头 */
    .history-card thead {
        display: none;
    }

    .history-card tr {
        background: white;
        margin-bottom: 20px;
        border-radius: 16px;
        padding: 15px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.05);
        border: 1px solid #e2e8f0;
    }

    .history-card td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 5px;
        border-bottom: 1px dashed #f1f5f9;
        background: transparent;
        text-align: left !important; /* 覆盖内联居中 */
    }

    .history-card td:last-child {
        border-bottom: none;
    }

    /* 为每一行增加伪元素标签（可选，增加可读性） */
    .history-card td::before {
        content: attr(data-label); /* 如果你在 HTML 中加了 data-label 属性 */
        font-weight: 700;
        font-size: 0.85rem;
        color: var(--text-muted);
    }

    /* 针对具体列的移动端微调 */
    .event-info {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .event-info strong {
        font-size: 1.1rem;
        color: var(--accent-color);
    }

    .mobile-only {
        display: inline-flex;
    }

    /* 让比分那一栏并排显示 */
    .history-card td:nth-child(2),
    .history-card td:nth-child(3) {
        display: none !important;
    }

    .team-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }

    .team-score {
        font-weight: 900;
        font-size: 1.1rem;
        padding: 4px 10px;
        border-radius: 8px;
        min-width: 42px;
        text-align: center;
    }

    .team-score.player-left {
        background: #dcebfc;
        color: #156380;
        border: 1px solid #bbf2f7;
    }

    .team-score.player-right {
        background: #fee2e2;
        color: #b91c1c;
        border: 1px solid #fecaca;
    }

    .winner-name {
        display: none;
    }

    .selector-form {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .selector-form select {
        width: 100%;
        font-size: 1rem;
    }

    .selector-form .vs-divider {
        font-size: 0.9rem;
        color: #94a3b8;
        letter-spacing: 2px;
    }

    .selector-form button {
        width: 100%;
        margin-top: 6px;
        padding: 14px;
        font-size: 1rem;
    }
}