/* ================================================================
   莱斯特城 · 球队管理
   设计系统：浅灰画布 + 白卡片 + 图标导航 + 顶部工具条
   品牌色：蓝 #002FA7 / 金 #FDBE11
   ================================================================ */

/* ---------- 自定义字体 ---------- */
@font-face {
    font-family: 'LCFC Sans';
    src: url('fonts/lcfc-sans-bold.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ---------- 设计变量 ---------- */
:root {
    --blue: #002FA7;
    --blue-600: #1A4BD8;
    --blue-soft: #E8EEFC;
    --blue-ink: #001E6B;
    --gold: #FDBE11;
    --gold-soft: #FFF6DC;

    --bg: #F4F6FB;
    --card: #FFFFFF;
    --ink: #111827;
    --ink-2: #374151;
    --muted: #6B7280;
    --faint: #98A2B3;
    --line: #E7EBF3;

    /* 字号：正文只保留四档，主次靠字重 / 颜色 / 间距区分 */
    --fs-caption: 12px;   /* 标签、表头、元信息 */
    --fs-body: 14px;      /* 正文、表格、按钮、说明 */
    --fs-title: 17px;     /* 卡片标题、球员名、弹窗标题 */
    --fs-page: 27px;      /* 页面主标题 */
    --fs-num: 24px;       /* 数字展示：KPI、统计值 */

    --r-sm: 9px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 20px;

    /* 阴影只用于弹窗 / 下拉 / 抽屉等浮层 */
    --sh-3: 0 24px 60px rgba(17, 24, 39, .16);

    --rail-w: 84px;
    --ease: cubic-bezier(.2, .7, .3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: var(--fs-body);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button, input, select, textarea { font-family: inherit; }
a { color: inherit; }
img { max-width: 100%; }

::selection { background: rgba(0, 47, 167, .14); }

/* 细滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #D3DAE6; border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #B9C3D4; background-clip: content-box; }

/* ================================================================
   左侧图标导航
   ================================================================ */
.rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--rail-w);
    background: #fff;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 0 14px;
    z-index: 60;
}

.rail-brand {
    display: block;
    width: 42px;
    height: 42px;
    margin-bottom: 20px;
    flex-shrink: 0;
}
.rail-brand img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0, 47, 167, .16));
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    align-items: center;
}
.nav-menu a {
    width: 62px;
    padding: 9px 0 7px;
    border-radius: var(--r-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--muted);
    font-size: var(--fs-caption);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
    -webkit-tap-highlight-color: transparent;
}
.nav-menu a i { font-size: 16px; }
.nav-menu a:hover { background: #F4F6FB; color: var(--ink); }
.nav-menu a:active { transform: scale(.96); }
.nav-menu a.active {
    background: var(--blue-soft);
    color: var(--blue);
}

.rail-bottom {
    margin-top: auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.rail-admin {
    width: 62px;
    padding: 9px 0 7px;
    border: 0;
    border-radius: var(--r-md);
    background: transparent;
    color: var(--muted);
    font-size: var(--fs-caption);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: background .18s var(--ease), color .18s var(--ease);
}
.rail-admin i { font-size: 16px; }
.rail-admin:hover { background: #F4F6FB; color: var(--ink); }
.rail-admin.is-on { background: var(--gold-soft); color: #8A6100; }
.rail-ver { font-size: var(--fs-caption); color: #C3CAD8; letter-spacing: .04em; }

/* 管理员浮层 */
.admin-pop {
    position: fixed;
    left: calc(var(--rail-w) + 12px);
    bottom: 22px;
    width: 258px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: 0 18px 44px rgba(17, 24, 39, .16);
    padding: 16px;
    z-index: 70;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(.98);
    transform-origin: bottom left;
    transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s;
}
.admin-pop.active { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.admin-pop-head {
    font-size: var(--fs-body);
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.admin-pop input {
    width: 100%;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 0 11px;
    font-size: var(--fs-body);
    color: var(--ink);
    background: #FBFCFE;
    outline: none;
    transition: border-color .16s, box-shadow .16s, background .16s;
}
.admin-pop input:focus {
    border-color: var(--blue);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 47, 167, .09);
}
.admin-pop button {
    width: 100%;
    height: 38px;
    margin-top: 9px;
    border: 0;
    border-radius: var(--r-sm);
    background: var(--blue);
    color: #fff;
    font-size: var(--fs-body);
    font-weight: 700;
    cursor: pointer;
    transition: background .16s, transform .12s;
}
.admin-pop button:hover { background: #00268A; }
.admin-pop button:active { transform: scale(.98); }
.admin-pop button:disabled { opacity: .6; cursor: default; }
#adminStatus {
    display: block;
    margin-top: 8px;
    font-size: var(--fs-caption);
    color: var(--muted);
    min-height: 0;
}
#adminStatus:empty { display: none; }

/* 已登录状态 */
.admin-logged-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 11px;
    border-radius: var(--r-sm);
    background: #F1F8F3;
    color: #1C6B39;
    font-size: var(--fs-body);
    font-weight: 600;
}
.admin-logged-row i { font-size: 14px; }
.admin-pop button.admin-logout {
    background: #fff;
    color: #B42318;
    border: 1px solid #F3C9C9;
}
.admin-pop button.admin-logout:hover { background: #FDF3F3; border-color: #E9AEAE; }

/* ================================================================
   主区 + 工具条
   ================================================================ */
.main {
    margin-left: var(--rail-w);
    min-height: 100vh;
}

.toolbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(244, 246, 251, .88);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
    padding: 12px 28px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search {
    flex: 1 1 auto;
    max-width: 340px;
    min-width: 0;
    height: 40px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 12px;
    color: var(--faint);
    transition: border-color .16s, box-shadow .16s;
}
.search:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0, 47, 167, .09);
}
.search i { font-size: 14px; }
.search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-size: var(--fs-body);
    color: var(--ink);
}
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search input::placeholder { color: var(--faint); }

.seg {
    display: flex;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 3px;
    flex-shrink: 0;
}
.btn-toggle {
    height: 32px;
    padding: 0 14px;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    font-size: var(--fs-body);
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: background .16s, color .16s;
    white-space: nowrap;
}
.btn-toggle:hover { color: var(--ink); }
.btn-toggle.active { background: var(--ink); color: #fff; }

.toolbar-spacer { flex: 1; }

.club-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    font-size: var(--fs-caption);
    font-weight: 600;
    color: var(--ink-2);
    white-space: nowrap;
}
.badge-sep {
    width: 1px;
    height: 12px;
    background: var(--line);
    display: inline-block;
}

.btn-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: var(--r-md);
    background: var(--blue);
    color: #fff;
    font-size: var(--fs-body);
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background .16s, transform .12s;
}
.btn-add span { display: none; }
.btn-add i { font-size: 16px; margin: 0; }
.btn-add:hover { background: #00268A; }
.btn-add:active { transform: translateY(1px); }
.btn-add:disabled { opacity: .6; cursor: default; transform: none; }
.btn-add.is-busy i { animation: btn-spin .9s linear infinite; }
@keyframes btn-spin { to { transform: rotate(360deg); } }

.page {
    padding: 26px 28px 70px;
    max-width: 1360px;
    margin: 0 auto;
}

/* ================================================================
   页面标题 / 视图
   ================================================================ */
.view-container { display: none; }
.view-container.active { display: block; animation: viewIn .26s var(--ease); }
@keyframes viewIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.page-head h1 {
    font-family: 'LCFC Sans', 'PingFang SC', sans-serif;
    font-size: var(--fs-page);
    line-height: 1.2;
    letter-spacing: .01em;
    font-weight: normal;
}
.page-head .sub {
    margin-top: 6px;
    color: var(--muted);
    font-size: var(--fs-body);
}
/* 标题后紧跟的赛季标签（与 h1 同一行） */
.page-head h1 .page-season {
    margin-left: 10px;
    font-size: var(--fs-body);
    font-weight: 500;
    color: var(--muted);
    letter-spacing: .02em;
}
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ================================================================
   KPI 概览
   ================================================================ */
.kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.kpi {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 15px 18px 16px;
}
.kpi span {
    font-size: var(--fs-caption);
    color: var(--muted);
    letter-spacing: .03em;
}
.kpi b {
    display: block;
    margin-top: 6px;
    font-size: clamp(17px, 4.4vw, var(--fs-num));
    line-height: 1.15;
    font-weight: 600;
    letter-spacing: .01em;
    color: var(--ink);
}
.kpi b i {
    font-style: normal;
    font-family: inherit;
    font-size: var(--fs-caption);
    color: var(--muted);
    margin-left: 4px;
    letter-spacing: .02em;
}
.kpi.hl {
    background: linear-gradient(135deg, var(--blue) 0%, #1A4BD8 100%);
    border-color: transparent;
}
.kpi.hl span { color: rgba(255, 255, 255, .74); }
.kpi.hl b { color: #fff; }
.kpi.hl b i { color: rgba(255, 255, 255, .62); }

/* ================================================================
   卡片容器
   ================================================================ */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
}
.card + .card { margin-top: 18px; }
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--line);
}
.card-head h2 {
    font-size: var(--fs-title);
    font-weight: 700;
    letter-spacing: .01em;
}
.card-count {
    font-size: var(--fs-caption);
    color: var(--muted);
    white-space: nowrap;
}
.card-count b { color: var(--blue); }

.empty-state {
    padding: 34px 20px;
    text-align: center;
    color: var(--faint);
    font-size: var(--fs-body);
}

/* ================================================================
   球员网格
   ================================================================ */
.squad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(198px, 1fr));
    gap: 12px;
    padding: 16px;
}

.position-group + .position-group { margin-top: 4px; }
.position-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px 4px;
    font-size: var(--fs-caption);
    font-weight: 600;
    letter-spacing: .16em;
    color: var(--muted);
    text-transform: uppercase;
}
.position-group-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

.player-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.player-card.clickable { cursor: pointer; }
.player-card.clickable:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 47, 167, .3);
    box-shadow: 0 12px 26px rgba(0, 47, 167, .10);
}
.player-card:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

/* 相框尺寸不变，照片按 --avatar-zoom 放大并从顶部对齐，底部自然被裁掉 */
.player-card .avatar-frame {
    position: relative;
    aspect-ratio: 1 / .98;
    background: linear-gradient(168deg, #EDF2FC 0%, #DFE8F8 62%, #D5E1F7 100%);
    overflow: hidden;
    --avatar-zoom: 1.22;
}
.player-card .player-avatar {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 100%;
    height: calc(100% * var(--avatar-zoom));
    object-fit: contain;
    object-position: top center;
    padding: 2px 0 0;
    transition: transform .28s var(--ease);
}
.player-card.clickable:hover .player-avatar { transform: translateX(-50%) scale(1.03); }
.player-card .default-avatar {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 40px;
    opacity: .5;
}
.player-card .shirt-number {
    position: absolute;
    left: 10px;
    top: 4px;
    z-index: 2;
    font-family: 'LCFC Sans', sans-serif;
    font-size: 27px;
    font-weight: normal;
    line-height: 1;
    color: rgba(0, 47, 167, .2);
    letter-spacing: .01em;
}
.player-card .flag-corner {
    position: absolute;
    right: 11px;
    top: 8px;
    z-index: 2;
    display: flex;
    gap: 4px;
    align-items: center;
}
.player-card .flag-corner .flag-icon {
    font-size: 1.05rem;
    line-height: 1;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(11, 26, 51, .18), 0 0 0 1px rgba(11, 26, 51, .08);
}

.player-card .card-body {
    padding: 9px 11px 11px;
    border-top: 1px solid var(--line);
}
.player-card .name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.player-card .player-display-name {
    font-size: var(--fs-body);
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.player-card .meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 2px;
}
.pd-fact-val .flag-icon {
    font-size: 1.05rem;
    border-radius: 3px;
    vertical-align: -3px;
    box-shadow: 0 0 0 1px rgba(11, 26, 51, .3), 0 1px 2px rgba(11, 26, 51, .14);
}
.player-card .player-full-name {
    margin-top: 2px;
    font-size: var(--fs-caption);
    color: var(--muted);
    letter-spacing: .01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.player-card .card-stats {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}
.player-card .card-stats span {
    font-size: var(--fs-caption);
    color: var(--muted);
    background: #F5F7FC;
    border-radius: 6px;
    padding: 2px 6px;
}
.player-card .card-stats b {
    color: var(--ink-2);
    font-size: var(--fs-caption);
    font-weight: 600;
    margin-right: 1px;
}

/* 位置标签 */
.position-tag {
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 6px;
    border-radius: 6px;
    font-size: var(--fs-caption);
    font-weight: 700;
    letter-spacing: .02em;
    background: #EEF2FB;
    color: var(--blue);
    flex-shrink: 0;
}
.position-tag.门将 { background: #FDF4DC; color: #8A6100; }
.position-tag.后卫 { background: #E9F1FD; color: #1257A8; }
.position-tag.中场 { background: #EAF6EE; color: #1C6B39; }
.position-tag.前锋 { background: #FDECEC; color: #A32626; }

/* 卡片上的编辑按钮 */
.btn-edit-card {
    position: absolute;
    right: 8px;
    top: 34px;
    z-index: 5;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: var(--r-sm);
    background: rgba(17, 24, 39, .72);
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .18s, background .18s;
}
.player-card:hover .btn-edit-card { opacity: 1; }
.btn-edit-card:hover { background: var(--blue); }
@media (hover: none) {
    .btn-edit-card { opacity: 1; }
}

/* ---------- 梯队：无照片文字卡片 ---------- */
.player-card.is-bare {
    background: #fff;
}
.player-card.is-bare .bare-body {
    position: relative;
    min-height: 138px;
    padding: 14px 13px 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.player-card.is-bare .bare-watermark {
    position: absolute;
    right: 0;
    bottom: -10px;
    font-family: 'LCFC Sans', sans-serif;
    font-weight: normal;
    font-size: 64px;
    line-height: 1;
    color: rgba(0, 47, 167, .05);
    pointer-events: none;
    user-select: none;
}
.player-card.is-bare .bare-head {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
}
.player-card.is-bare .bare-num {
    font-family: 'LCFC Sans', sans-serif;
    font-weight: normal;
    font-size: var(--fs-title);
    color: var(--blue);
    line-height: 1;
}
.player-card.is-bare .bare-team {
    font-size: var(--fs-caption);
    font-weight: 700;
    letter-spacing: .06em;
    color: #8A6100;
    background: var(--gold-soft);
    border-radius: 6px;
    padding: 2px 6px;
}
.player-card.is-bare .bare-flags { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.player-card.is-bare .bare-flags .flag-icon {
    font-size: .95rem;
    line-height: 1;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(11, 26, 51, .12);
}
.player-card.is-bare .bare-name {
    font-size: var(--fs-title);
    font-weight: 700;
    letter-spacing: .01em;
    line-height: 1.3;
}
.player-card.is-bare .bare-foot {
    margin-top: auto;
    padding-top: 10px;
}

/* ================================================================
   租借球员
   ================================================================ */
.loan-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 10px;
    padding: 16px;
}
.loan-card {
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 11px 13px;
    background: #FBFCFE;
    cursor: pointer;
    transition: border-color .16s, background .16s, transform .16s;
}
.loan-card:hover {
    background: #fff;
    border-color: rgba(0, 47, 167, .3);
    transform: translateY(-1px);
}
.loan-card-top {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.loan-number {
    font-family: 'LCFC Sans', sans-serif;
    font-weight: normal;
    font-size: var(--fs-title);
    color: var(--blue);
}
.loan-name-group { min-width: 0; }
.loan-display-name {
    display: block;
    font-size: var(--fs-body);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.loan-full-name {
    display: block;
    font-size: var(--fs-caption);
    color: var(--faint);
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.loan-card-bottom {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    font-size: var(--fs-caption);
    color: var(--muted);
}
.loan-club i { color: var(--gold); margin-right: 3px; }
.loan-empty { padding: 22px 16px; color: var(--faint); font-size: var(--fs-body); }

/* ================================================================
   通用弹窗
   ================================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(12, 18, 32, .55);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s var(--ease), visibility .2s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: var(--r-xl);
    box-shadow: var(--sh-3);
    overflow: hidden;
    transform: translateY(10px) scale(.99);
    transition: transform .22s var(--ease);
}
.modal-overlay.active .modal { transform: none; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}
.modal-header h2 {
    font-size: var(--fs-title);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-header h2 i { color: var(--gold); }
.close-modal {
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: #fff;
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background .16s, color .16s;
}
.close-modal:hover { background: #F4F6FB; color: var(--ink); }
.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--line);
    background: #FBFCFE;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ================================================================
   球员编辑弹窗
   ================================================================ */
.pm-modal { max-width: 880px; }
.pm-modal form { display: flex; flex-direction: column; min-height: 0; }
.pm-body {
    padding: 18px 20px 6px;
    overflow-y: auto;
    min-height: 0;
}
.pm-section + .pm-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.pm-section-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-body);
    font-weight: 700;
    color: var(--ink-2);
    letter-spacing: .02em;
    margin-bottom: 10px;
}
.pm-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 12px;
}
.pm-field { min-width: 0; }
.pm-field label {
    display: block;
    font-size: var(--fs-caption);
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 5px;
    letter-spacing: .02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pm-field .hint {
    color: var(--faint);
    font-weight: 400;
}
.pm-field input,
.pm-field select {
    width: 100%;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: #FBFCFE;
    padding: 0 10px;
    font-size: var(--fs-body);
    color: var(--ink);
    outline: none;
    transition: border-color .16s, box-shadow .16s, background .16s;
}
.pm-field select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}
.pm-field input:focus,
.pm-field select:focus {
    border-color: var(--blue);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 47, 167, .09);
}
.pm-subrow {
    grid-column: span 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
}
.pm-note {
    margin-top: 10px;
    font-size: var(--fs-caption);
    color: var(--faint);
}

.pm-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 13px 20px;
    border-top: 1px solid var(--line);
    background: #FBFCFE;
    flex-shrink: 0;
}
.btn-submit {
    height: 38px;
    padding: 0 22px;
    border: 0;
    border-radius: var(--r-sm);
    background: var(--blue);
    color: #fff;
    font-size: var(--fs-body);
    font-weight: 700;
    cursor: pointer;
    transition: background .16s, transform .12s;
}
.btn-submit:hover { background: #00268A; }
.btn-submit:active { transform: scale(.99); }
.btn-delete {
    margin-right: auto;
    height: 38px;
    padding: 0 16px;
    border: 1px solid #F3C9C9;
    border-radius: var(--r-sm);
    background: #FDF3F3;
    color: #B42318;
    font-size: var(--fs-body);
    font-weight: 600;
    cursor: pointer;
    transition: background .16s;
}
.btn-delete:hover { background: #FBE7E7; }

/* 头像上传 */
.drop-zone {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px dashed #C9D4E8;
    border-radius: var(--r-md);
    background: #FBFCFE;
    cursor: pointer;
    transition: border-color .16s, background .16s;
}
.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--blue);
    background: #F5F8FF;
}
.drop-icon {
    font-size: 20px;
    width: 42px;
    height: 42px;
    border-radius: var(--r-md);
    background: #EEF2FB;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.pm-drop-copy { min-width: 0; }
.drop-text { font-size: var(--fs-body); font-weight: 600; color: var(--ink-2); }
.drop-hint { font-size: var(--fs-caption); color: var(--faint); margin-top: 2px; }
.file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
#avatarPreview {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    z-index: 2;
}
.preview-thumb {
    width: 44px;
    height: 44px;
    border-radius: var(--r-md);
    object-fit: cover;
    border: 1px solid var(--line);
    background: #fff;
}
.clear-avatar {
    height: 28px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: #fff;
    font-size: var(--fs-caption);
    color: var(--muted);
    cursor: pointer;
    position: relative;
    z-index: 3;
}
.clear-avatar:hover { color: #B42318; border-color: #F3C9C9; }

/* ================================================================
   球员详情弹窗
   ================================================================ */
.player-modal {
    position: relative;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    background: #fff;
    border-radius: var(--r-xl);
    box-shadow: var(--sh-3);
    overflow: hidden auto;
    transform: translateY(10px) scale(.99);
    transition: transform .22s var(--ease);
}
.modal-overlay.active .player-modal { transform: none; }
.player-modal.is-solo { max-width: 620px; }

.pd-close {
    position: absolute;
    right: 14px;
    top: 14px;
    z-index: 6;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 9px;
    background: rgba(17, 24, 39, .45);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: background .16s;
}
.pd-close:hover { background: rgba(17, 24, 39, .62); }

.pd-grid {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
}
.pd-grid-solo { display: block; }

.pd-hero {
    position: relative;
    background: linear-gradient(168deg, #002FA7 0%, #001B60 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    min-height: 420px;
}
.pd-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 22%, rgba(255, 255, 255, .2), transparent 62%);
    pointer-events: none;
}
.pd-watermark {
    position: absolute;
    right: 14px;
    top: -6px;
    font-family: 'LCFC Sans', sans-serif;
    font-size: 96px;
    font-weight: normal;
    line-height: 1;
    color: rgba(255, 255, 255, .14);
    letter-spacing: .01em;
}
.pd-pos-en {
    position: absolute;
    left: 20px;
    top: 16px;
    font-size: var(--fs-caption);
    letter-spacing: .2em;
    color: rgba(255, 255, 255, .55);
    z-index: 2;
}
.pd-photo {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 14px 12px 0;
    min-height: 220px;
    overflow: hidden;
}
.pd-photo-img {
    width: 100%;
    max-height: 340px;
    object-fit: contain;
    object-position: bottom;
    filter: drop-shadow(0 14px 26px rgba(0, 0, 0, .32));
}
.pd-photo-default {
    font-size: 64px;
    opacity: .55;
    margin: auto;
}
.pd-hero-info {
    position: relative;
    z-index: 2;
    padding: 16px 20px 20px;
    background: linear-gradient(180deg, rgba(0, 20, 70, 0), rgba(0, 18, 60, .55));
}
.pd-name {
    font-size: var(--fs-page);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .01em;
}
.pd-en {
    margin-top: 3px;
    font-size: var(--fs-caption);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .62);
}
.pd-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.pd-chip {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: var(--fs-caption);
    font-weight: 600;
    background: rgba(255, 255, 255, .14);
    color: #fff;
}
.pd-chip-num { background: rgba(253, 190, 17, .18); color: #FFD95E; }
.pd-tags .position-tag { height: 20px; background: #fff; }

.pd-body { padding: 22px 24px 20px; }
.pd-body-head { margin-bottom: 14px; }
.pd-body-head .pd-name { color: var(--ink); font-size: var(--fs-page); }
.pd-body-head .pd-en { color: var(--faint); }
.pd-body-head .pd-tags { margin-top: 9px; }
.pd-body-head .pd-chip { background: #F2F5FB; color: var(--ink-2); }
.pd-body-head .pd-chip-num { background: var(--gold-soft); color: #8A6100; }

.pd-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.pd-stat {
    background: #F5F7FC;
    border-radius: var(--r-md);
    padding: 10px 8px;
    text-align: center;
}
.pd-stat-value {
    display: block;
    font-size: var(--fs-num);
    line-height: 1.15;
    font-weight: 600;
    color: var(--blue);
}
.pd-stat-label {
    display: block;
    margin-top: 2px;
    font-size: var(--fs-caption);
    color: var(--muted);
}
.pd-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
    margin-top: 16px;
    font-size: var(--fs-body);
}
.pd-fact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--line);
    min-width: 0;
}
.pd-fact-key {
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
}
.pd-fact-val {
    color: var(--ink);
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pd-edit-link {
    margin-top: 14px;
    height: 34px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: #fff;
    color: var(--blue);
    font-size: var(--fs-body);
    font-weight: 600;
    cursor: pointer;
    transition: background .16s, border-color .16s;
}
.pd-edit-link:hover { background: #F5F8FF; border-color: rgba(0, 47, 167, .3); }

.pd-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}
.pd-nav-btn {
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: #fff;
    color: var(--ink-2);
    font-size: var(--fs-body);
    font-weight: 600;
    cursor: pointer;
    transition: background .16s, color .16s;
}
.pd-nav-btn:hover:not(:disabled) { background: #F5F8FF; color: var(--blue); }
.pd-nav-btn:disabled { opacity: .4; cursor: default; }
.pd-counter {
    font-size: var(--fs-caption);
    color: var(--faint);
    letter-spacing: .04em;
}

/* 梯队详情（无照片）：横幅 + 单列 */
.pd-hero-solo {
    min-height: 0;
    padding: 26px 24px 22px;
    border-radius: 0;
}
.pd-hero-solo .pd-watermark { font-size: 86px; top: 6px; right: 56px; left: auto; }
.pd-hero-solo .pd-pos-en { top: 22px; }
.pd-hero-solo .pd-hero-info { background: none; padding: 26px 0 0; }
.pd-hero-solo .pd-name { font-size: var(--fs-page); }
.pd-grid-solo .pd-body { padding-top: 18px; }
.pd-grid-solo .pd-stats { grid-template-columns: repeat(3, 1fr); }

.pd-grid-solo .pd-fact-key { padding-right: 10px; }

/* ================================================================
   积分榜
   ================================================================ */
.standings-wrapper { overflow: hidden; }

.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-body);
}
.standings-table thead th {
    background: #FAFBFE;
    color: var(--muted);
    font-size: var(--fs-caption);
    font-weight: 700;
    letter-spacing: .08em;
    text-align: center;
    padding: 11px 8px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.standings-table tbody td {
    padding: 11px 8px;
    text-align: center;
    border-bottom: 1px solid #F1F4FA;
    color: var(--ink-2);
}
.standings-table tbody tr:last-child td { border-bottom: 0; }
.standings-table tbody tr:hover td { background: #F8FAFF; }

.standings-table .st-team { text-align: left; font-weight: 600; }
.standings-table tbody .st-points {
    font-size: var(--fs-body);
    font-weight: 700;
    color: var(--blue);
}
.standings-table .st-logo { width: 38px; }
.standings-table .st-logo img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}
.standings-table .st-gd { font-weight: 600; }
.standings-table tbody .st-gd,
.standings-table tbody .st-played,
.standings-table tbody .st-won,
.standings-table tbody .st-drawn,
.standings-table tbody .st-lost,
.standings-table tbody .st-gf,
.standings-table tbody .st-ga {
    font-size: var(--fs-body);
}
.standings-table tbody .st-rank {
    font-size: var(--fs-caption);
    color: var(--faint);
    width: 46px;
}

/* 升降级分区着色 */
.standings-table tbody tr.zone-promote td { background: #F5FAEE; }
.standings-table tbody tr.zone-playoff td { background: #F2F7FE; }
.standings-table tbody tr.zone-relegate td { background: #FDF4F4; }
.standings-table tbody tr.zone-promote td:first-child { box-shadow: inset 3px 0 0 #639922; }
.standings-table tbody tr.zone-playoff td:first-child { box-shadow: inset 3px 0 0 #378ADD; }
.standings-table tbody tr.zone-relegate td:first-child { box-shadow: inset 3px 0 0 #E24B4A; }
.standings-table tbody tr.zone-promote:hover td { background: #EFF7E6; }
.standings-table tbody tr.zone-playoff:hover td { background: #EAF2FD; }
.standings-table tbody tr.zone-relegate:hover td { background: #FBECEC; }

/* 莱斯特城高亮 */
.standings-table tbody tr.row-leicester td { background: #FFFCF1; }
.standings-table tbody tr.row-leicester td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.standings-table tbody tr.row-leicester .st-team { color: var(--blue); }
.standings-table tbody tr.row-leicester:hover td { background: #FFF8E4; }

.standings-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 20px;
    border-top: 1px solid var(--line);
    font-size: var(--fs-caption);
    color: var(--muted);
}
.standings-legend span { display: inline-flex; align-items: center; gap: 5px; }
.standings-legend i {
    width: 7px;
    height: 7px;
    border-radius: 2px;
    display: inline-block;
}
.standings-legend .lg-promote { background: #639922; }
.standings-legend .lg-playoff { background: #378ADD; }
.standings-legend .lg-relegate { background: #E24B4A; }
.standings-legend .lg-fox { background: var(--gold); }

.standings-edit-hint {
    margin: 16px 20px 0;
    padding: 11px 13px;
    background: #F5F8FF;
    border-radius: var(--r-md);
    font-size: var(--fs-body);
    color: var(--muted);
    line-height: 1.6;
}
.standings-textarea {
    margin: 12px 20px 16px;
    min-height: 300px;
    max-height: 46vh;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: #FBFCFE;
    padding: 12px;
    font-family: 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.6;
    color: var(--ink-2);
    resize: vertical;
    outline: none;
}
.standings-textarea:focus {
    border-color: var(--blue);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 47, 167, .09);
}

/* 积分榜视图：工具条里没有可用的搜索与排序 */
body[data-view="standings"] .search,
body[data-view="standings"] .seg { display: none; }
/* 桌面端积分榜没有可放的控件，整条工具条收起（移动端保留，用来放菜单与队徽） */
@media (min-width: 761px) {
    body[data-view="standings"] .toolbar { display: none; }
}
/* 积分榜视图不显示「添加球员」，避免误操作 */
body[data-view="standings"] #btnAddPlayer { display: none !important; }

/* ================================================================
   数据视图（出场 / 进球 / 助攻）
   ================================================================ */
.data-wrapper { overflow: visible; }
.data-scroll { overflow: visible; }

/* 统计范围筛选（右上角按钮 + 下拉） */
.scope-picker { position: relative; }
.scope-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: var(--fs-body);
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .14s, color .14s, box-shadow .14s;
}
.scope-btn:hover { border-color: #B9C6E6; color: var(--blue); }
.scope-btn[aria-expanded="true"] {
    border-color: var(--blue);
    color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0, 47, 167, .08);
}
.scope-btn .fa-filter { font-size: 12px; opacity: .7; }
.scope-btn .scope-caret { font-size: 10px; opacity: .55; transition: transform .16s; }
.scope-btn[aria-expanded="true"] .scope-caret { transform: rotate(180deg); }

.scope-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 40;
    min-width: 134px;
    padding: 5px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: 0 14px 34px -12px rgba(15, 23, 42, .28);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px) scale(.98);
    transition: opacity .14s, transform .14s, visibility .14s;
}
.scope-menu.active { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.scope-option {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: none;
    font: inherit;
    font-size: var(--fs-body);
    color: var(--ink-2);
    text-align: left;
    cursor: pointer;
    transition: background .12s, color .12s;
}
.scope-option:hover { background: #F3F7FF; color: var(--blue); }
.scope-option.is-active { background: #EEF4FF; color: var(--blue); font-weight: 700; }
.scope-option.is-active::after { content: '✓'; font-size: 12px; }

/* 非「全部比赛」口径下，零封没有分赛事来源，隐藏该列 */
.data-table.hide-cs .dt-cs { display: none; }
/* 零封隐藏后助攻成为最后一列，补回右侧留白 */
.data-table.hide-cs .dt-assists { padding-right: 16px; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-body);
    table-layout: fixed;
}
.data-table thead th {
    position: sticky;
    top: 64px;
    z-index: 3;
    background: #FAFBFE;
    color: var(--muted);
    font-size: var(--fs-caption);
    font-weight: 700;
    letter-spacing: .08em;
    text-align: center;
    padding: 10px 8px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
    box-shadow: 0 6px 12px -8px rgba(17, 24, 39, .22);
}
.data-table tbody td {
    padding: 9px 8px;
    text-align: center;
    border-bottom: 1px solid #F1F4FA;
    color: var(--ink-2);
    white-space: nowrap;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr.dt-row { cursor: pointer; transition: background .14s; }
.data-table tbody tr.dt-row:hover td { background: #F8FAFF; }

/* 可排序表头 */
.data-table th.is-sortable { cursor: pointer; user-select: none; transition: color .14s, background .14s; }
.data-table th.is-sortable:hover { color: var(--blue); background: #F2F6FF; }
.data-table th.is-sortable > span { vertical-align: middle; }
.data-table .dt-arrow {
    display: inline-block;
    width: 9px;
    margin-left: 3px;
    font-style: normal;
    opacity: .32;
}
.data-table .dt-arrow::before { content: '⇅'; font-size: 9px; }
.data-table th.is-asc { color: var(--blue); }
.data-table th.is-desc { color: var(--blue); }
.data-table th.is-asc .dt-arrow { opacity: 1; }
.data-table th.is-desc .dt-arrow { opacity: 1; }
.data-table th.is-asc .dt-arrow::before { content: '▲'; font-size: 8px; }
.data-table th.is-desc .dt-arrow::before { content: '▼'; font-size: 8px; }

/* 列宽 */
.data-table .dt-num { width: 62px; font-family: inherit; font-size: var(--fs-body); color: var(--muted); font-weight: 600; }
.data-table .dt-player { width: auto; text-align: left; }
.data-table .dt-pos { width: 74px; }
.data-table .dt-team { width: 86px; }
.data-table .dt-stat { width: 72px; font-weight: 600; color: var(--ink); }
.data-table .dt-cs { width: 66px; }
.data-table tbody .dt-num { font-size: var(--fs-body); }

/* 球员单元格 */
.data-table .dt-player { padding-left: 4px; }
.data-table .dt-name-wrap {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    vertical-align: middle;
    min-width: 0;
}
.data-table .dt-name-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.data-table .dt-name { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.data-table .dt-en {
    font-size: var(--fs-caption);
    color: var(--faint);
    letter-spacing: .02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.data-table .dt-team-inline { display: none; }

/* 队伍胶囊 */
.dt-team-chip,
.dt-team-inline {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 6px;
    font-size: var(--fs-caption);
    font-weight: 600;
    line-height: 1.6;
}
.dt-team-inline { display: none; }
.dt-team-chip.is-first, .dt-team-inline.is-first { background: #EDF2FC; color: #002FA7; }
.dt-team-chip.is-u21, .dt-team-inline.is-u21 { background: #F1F8F3; color: #1C6B39; }
.dt-team-chip.is-u18, .dt-team-inline.is-u18 { background: #F3F0FB; color: #5B3FBF; }
.dt-team-chip.is-loan, .dt-team-inline.is-loan { background: #FDF3F3; color: #B42318; }

.kpis.kpis-data { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpis-data .kpi b { font-size: var(--fs-num); }

/* ================================================================
   赛程视图
   ================================================================ */
/* 顶部：整宽「下一场」卡片 */
.fx-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

/* 列表头右侧：场次统计 + 友谊赛开关 */
.fx-head-right {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.fx-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 9px 4px 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.fx-toggle:hover { border-color: #C9D4E8; color: var(--ink-2); }
.fx-toggle-track {
    position: relative;
    display: block;
    flex: none;
    width: 26px;
    height: 15px;
    border-radius: 999px;
    background: #D6DDEA;
    transition: background .18s var(--ease);
}
.fx-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(9, 30, 66, .28);
    transition: transform .18s var(--ease);
}
.fx-toggle[aria-pressed="true"] {
    border-color: rgba(0, 82, 217, .28);
    background: var(--blue-soft);
    color: var(--blue);
}
.fx-toggle[aria-pressed="true"] .fx-toggle-track { background: var(--blue); }
.fx-toggle[aria-pressed="true"] .fx-toggle-knob { transform: translateX(11px); }

.fx-next-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0 20px;
    padding: 13px 20px;
    border-radius: var(--r-lg);
    background: linear-gradient(135deg, var(--blue) 0%, #1A4BD8 100%);
    color: #fff;
    min-width: 0;
}
.fx-next-card[hidden] { display: none; }

.nxt-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}
.nxt-tag {
    align-self: flex-start;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .2);
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.75;
    letter-spacing: .04em;
    white-space: nowrap;
}
.nxt-comp {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, .86);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nxt-when {
    font-size: 11.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, .7);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.nxt-teams {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}
.nxt-team {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}
.nxt-team.is-away {
    flex-direction: row-reverse;
    justify-content: flex-end;
}
.nxt-team b {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nxt-logo {
    flex: none;
    width: 38px;
    height: 38px;
    padding: 3px;
    border-radius: 50%;
    background: #fff;
    object-fit: contain;
    box-shadow: 0 2px 8px rgba(5, 20, 60, .26);
}
.nxt-logo.is-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--blue);
}
.nxt-vs {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    color: rgba(255, 255, 255, .6);
}

.nxt-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    text-align: right;
}
.nxt-side span {
    font-size: 10.5px;
    letter-spacing: .06em;
    color: rgba(255, 255, 255, .68);
}
.nxt-side b {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .01em;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.fx-card { padding-bottom: 6px; }
/* 赛程页沿用紧凑字号：卡片标题比全站标题小一档，避免挤压列表 */
.fx-card .card-head h2 { font-size: 15px; }

/* 中窄屏：下一场卡片改为两行（信息 + 倒计时 / 球队），避免球队被挤扁 */
@media (max-width: 1120px) {
    .fx-next-card {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px 14px;
        padding: 12px 16px;
    }
    .nxt-info {
        grid-column: 1;
        grid-row: 1;
        flex-flow: row wrap;
        align-items: center;
        gap: 4px 8px;
    }
    .nxt-side {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }
    .nxt-teams {
        grid-column: 1 / -1;
        grid-row: 2;
        max-width: none;
    }
}
.fx-list { padding: 0 4px 6px; }

/* 月份分隔 */
.fx-month {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px 7px;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-2);
}
.fx-month span { display: inline-flex; align-items: center; gap: 8px; }
.fx-month i {
    font-style: normal;
    font-weight: 600;
    font-size: 11.5px;
    color: var(--faint);
}

/* 单场比赛（桌面）：日期 + 时间 ｜ 赛事 + 轮次（各自一行）｜ 队伍 + 比分（靠右） */
.fx-row {
    display: grid;
    grid-template-columns: 88px 124px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    padding: 9px 14px;
    border-radius: var(--r-md);
    transition: background .15s var(--ease);
}
.fx-row + .fx-row { box-shadow: inset 0 1px 0 var(--line); }
.fx-row.is-next { background: var(--blue-soft); box-shadow: none; }
.fx-row.is-next + .fx-row { box-shadow: none; }

/* 左栏容器：桌面端摊平（日期/时间、赛事/轮次 各占一列），移动端堆成两行 */
.fx-when { display: contents; }

/* 日期与开球时间同一行 */
.fx-date {
    display: flex;
    align-items: baseline;
    gap: 7px;
    line-height: 1.2;
    white-space: nowrap;
}
.fx-date b {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.fx-date span {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* 赛事 + 轮次：同一行 */
.fx-meta {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 7px;
    min-width: 0;
}
.fx-comp {
    padding: 0 6px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.6;
    white-space: nowrap;
    background: var(--blue-soft);
    color: var(--blue);
}
.fx-comp.comp-eflcup { background: #E6F6F7; color: #0E7490; }
.fx-comp.comp-facup { background: #F1EDFC; color: #5B3FBF; }
.fx-comp.comp-efltrophy { background: #FFF4E0; color: #9A6100; }
.fx-comp.comp-friendly { background: #F3F4F6; color: #6B7280; }

.fx-round {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--ink-2);
    white-space: nowrap;
}

.fx-teams {
    display: grid;
    /* 两侧等宽 + 中间自适应 → 比分永远落在正中，两侧队名对称 */
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
    width: 100%;
    /* 桌面空间富余，整块靠右收拢 */
    max-width: 720px;
    justify-self: end;
}
.fx-team {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.fx-team.is-us { color: var(--blue); font-weight: 800; }

/* 队名 + 队徽 一组：主队「队名 队徽」，客队「队徽 队名」，队徽始终贴着比分 */
.fx-side {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.fx-side.is-home { justify-content: flex-end; }
.fx-side.is-away { justify-content: flex-start; }
.fx-side.is-home .fx-team { text-align: right; }

.fx-logo {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    object-fit: contain;
    /* 队徽多为白底方图，加一点柔和的描边让它不糊在列表背景上 */
    filter: drop-shadow(0 1px 1px rgba(11, 26, 51, .16));
}
.fx-logo.is-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #EDF1F7;
    color: var(--faint);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    filter: none;
}

/* 比分胶囊：胜/平/负 的配色直接体现在比分上，不再单独显示赛果 */
.fx-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-width: 54px;
    height: 24px;
    padding: 0 7px;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    background: #F1F3F7;
    color: var(--ink);
}
.fx-score i { font-style: normal; font-weight: 600; opacity: .45; }
.fx-score em {
    font-style: normal;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .06em;
}
.fx-row.res-W .fx-score { background: #E7F6ED; color: #10743D; }
.fx-row.res-D .fx-score { background: #F1F3F7; color: #4B5563; }
.fx-row.res-L .fx-score { background: #FBEBEB; color: #B42318; }
.fx-row.is-upcoming .fx-score { background: #F4F6FA; color: var(--muted); }
.fx-row.is-next .fx-score { background: #fff; color: var(--blue); }
.fx-row.is-upcoming .fx-team { color: var(--ink-2); font-weight: 600; }
.fx-row.is-upcoming .fx-team.is-us { color: var(--blue); font-weight: 800; }


/* ---------- 移动端专用控件（桌面隐藏） ---------- */
.nav-toggle,
.mobile-brand,
.rail-close,
.nav-backdrop { display: none; }
.page-head-main { min-width: 0; }
.page-head .seg { flex-shrink: 0; }
.page-head .page-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
/* 「同步球员数据」只在数据页出现 */
body:not([data-view="data"]) #btnRefreshStats { display: none !important; }

/* 按视图隐藏对应的「添加」按钮 */
body[data-view="squad"] #btnAddAcademyPlayer,
body[data-view="academy"] #btnAddPlayer,
body[data-view="standings"] #btnAddPlayer,
body[data-view="standings"] #btnAddAcademyPlayer,
body[data-view="data"] #btnAddPlayer,
body[data-view="data"] #btnAddAcademyPlayer,
body[data-view="fixtures"] #btnAddPlayer,
body[data-view="fixtures"] #btnAddAcademyPlayer { display: none !important; }

/* ================================================================
   Toast
   ================================================================ */
.toast {
    position: fixed;
    left: 50%;
    bottom: 34px;
    transform: translate(-50%, 16px);
    z-index: 200;
    max-width: min(90vw, 460px);
    padding: 11px 18px;
    border-radius: 999px;
    background: rgba(17, 24, 39, .92);
    color: #fff;
    font-size: var(--fs-body);
    font-weight: 600;
    box-shadow: 0 12px 30px rgba(17, 24, 39, .28);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
}
.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

/* ================================================================
   响应式
   ================================================================ */
@media (max-width: 1180px) {
    .pd-grid { grid-template-columns: 240px minmax(0, 1fr); }
}

@media (max-width: 900px) {
    /* 中屏沿用原来的标题节奏，避免页面主标题在平板宽度显得过大 */
    .page-head h1 { font-size: 23px; }
    .page { padding: 20px 18px 90px; }
    .toolbar { padding: 10px 16px; gap: 10px; }
    .club-badge { display: none; }
    .squad-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 12px; }
    .pd-grid { grid-template-columns: 1fr; }
    .pd-hero { min-height: 0; }
    .pd-photo { min-height: 190px; max-height: 300px; }
    .pd-photo-img { max-height: 260px; }
    .pm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pm-subrow { grid-column: span 2; }
}

/* ---------- 移动端：左侧抽屉导航 ---------- */
@media (max-width: 760px) {
    /* 标题与数字随屏幕等比缩放，不单独增加字号档位 */
    :root { --fs-page: 22px; --fs-num: 20px; }
    /* 页面主标题沿用原来的移动端尺寸 */
    .page-head h1 { font-size: 21px; }

    /* 侧栏变成可收回的左侧抽屉 */
    .rail {
        inset: 0 auto 0 0;
        width: 236px;
        height: 100%;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        padding: 18px 12px calc(16px + env(safe-area-inset-bottom, 0));
        border-right: 1px solid var(--line);
        border-top: 0;
        border-radius: 0 20px 20px 0;
        box-shadow: 8px 0 40px rgba(17, 24, 39, .16);
        transform: translateX(-104%);
        transition: transform .28s cubic-bezier(.32, .72, 0, 1);
        z-index: 90;
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    body.nav-open .rail { transform: translateX(0); }

    .rail-brand {
        display: block;
        width: 38px;
        height: 38px;
        margin: 0 0 18px 8px;
        flex-shrink: 0;
    }
    .rail-close {
        display: flex;
        position: absolute;
        top: 16px;
        right: 12px;
        width: 30px;
        height: 30px;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--line);
        border-radius: 9px;
        background: #fff;
        color: var(--muted);
        font-size: 14px;
        cursor: pointer;
    }
    .rail-close:active { background: #F4F6FB; }

    .nav-menu {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        width: 100%;
        gap: 4px;
    }
    .nav-menu a {
        width: 100%;
        flex: none;
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        padding: 11px 14px;
        border-radius: var(--r-md);
        font-size: var(--fs-body);
        font-weight: 600;
    }
    .nav-menu a i { font-size: 16px; width: 18px; text-align: center; }

    .rail-bottom {
        margin-top: auto;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding-top: 14px;
    }
    .rail-admin {
        width: 100%;
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        padding: 11px 14px;
        border-radius: var(--r-md);
        font-size: var(--fs-body);
    }
    .rail-admin i { font-size: 16px; width: 18px; text-align: center; }
    .rail-ver { display: block; padding-left: 14px; }

    /* 抽屉打开时的遮罩 */
    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 85;
        background: rgba(11, 26, 51, .42);
        opacity: 0;
        visibility: hidden;
        transition: opacity .24s var(--ease), visibility .24s;
        -webkit-tap-highlight-color: transparent;
    }
    body.nav-open .nav-backdrop { opacity: 1; visibility: visible; }
    body.nav-open { overflow: hidden; }

    .admin-pop {
        left: 12px;
        right: 12px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0));
        width: auto;
        z-index: 95;
        transform-origin: bottom center;
    }

    .main { margin-left: 0; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0)); }

    /* 工具条：左侧菜单 + 队徽，右侧搜索 */
    .toolbar { padding: 9px 12px; gap: 9px; }
    .nav-toggle {
        display: flex;
        width: 36px;
        height: 36px;
        flex-shrink: 0;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--line);
        border-radius: var(--r-md);
        background: #fff;
        color: var(--ink-2);
        font-size: 16px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .nav-toggle:active { background: #F1F4FA; }
    .mobile-brand {
        display: block;
        width: 30px;
        height: 30px;
        flex-shrink: 0;
    }
    .mobile-brand img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        filter: drop-shadow(0 2px 5px rgba(0, 47, 167, .18));
    }
    .search { margin-left: auto; max-width: 62%; flex: 1 1 auto; height: 36px; }
    .search input { font-size: var(--fs-body); }
    .page-head .seg { padding: 2px; }
    .page-head .seg .btn-toggle { height: 28px; padding: 0 10px; font-size: var(--fs-caption); }
    .btn-add { width: 36px; height: 36px; }
    .btn-add i { font-size: 16px; }
    .scope-btn { height: 36px; padding: 0 9px; gap: 5px; font-size: var(--fs-body); }
    .scope-btn .fa-filter { font-size: 12px; }
    .scope-btn .scope-caret { font-size: 10px; }
    .scope-menu { min-width: 120px; padding: 4px; }
    .scope-option { padding: 7px 9px; font-size: var(--fs-body); }
    .page { padding: 16px 14px 24px; }
    /* 标题行：左标题 + 右「按号码/按位置」，说明文字独占下一行 */
    .page-head {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 3px 10px;
        margin-bottom: 14px;
    }
    .page-head-main { display: contents; }
    .page-head h1 { grid-column: 1; grid-row: 1; }
    .page-head .seg { grid-column: 2; grid-row: 1; }
    .page-head .page-actions { grid-column: 2; grid-row: 1; justify-self: end; }
    .page-head-main .sub { grid-column: 1 / -1; grid-row: 2; }
    .page-head h1 .page-season { margin-left: 7px; font-size: var(--fs-caption); }
    .page-head .sub { font-size: var(--fs-caption); }
    .kpis { gap: 8px; }
    .kpi { padding: 11px 10px 12px; }
    .kpi span { font-size: var(--fs-caption); letter-spacing: 0; }
    .card-head { padding: 13px 14px; }
    .squad-grid { padding: 10px; gap: 9px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .player-card .player-display-name { font-size: var(--fs-body); }
    .player-card .card-body { padding: 8px 9px 10px; }
    .player-card .flag-corner { right: 8px; top: 7px; gap: 3px; }
    .player-card .flag-corner .flag-icon { font-size: .92rem; }
    .player-card .meta-row { gap: 4px; }
    .modal { max-height: 92vh; }
    .modal-overlay { padding: 12px; align-items: flex-end; }
    .pm-modal { max-height: 92vh; border-radius: var(--r-xl) var(--r-xl) 0 0; }
    .pm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 10px; }
    .pm-body { padding: 14px 14px 4px; }
    .pm-actions { padding: 11px 14px; }
    /* ---------- 球员详情：压缩到移动端一屏内 ---------- */
    .player-modal { max-height: 94vh; max-height: 94dvh; border-radius: var(--r-xl) var(--r-xl) 0 0; }
    .pd-close { right: 10px; top: 10px; width: 28px; height: 28px; font-size: 16px; border-radius: var(--r-sm); }
    .pd-hero { min-height: 0; }
    /* 号码水印移到左上，避开右上角的关闭/编辑按钮；位置已由红色标签表达，英文位置在移动端省略 */
    .pd-watermark { left: 14px; right: auto; top: -8px; font-size: 72px; color: rgba(255, 255, 255, .18); }
    .pd-grid:not(.pd-grid-solo) .pd-pos-en { display: none; }
    .pd-pos-en { left: 14px; top: 11px; font-size: var(--fs-caption); letter-spacing: .16em; }
    .pd-photo { min-height: 0; max-height: none; padding: 8px 10px 0; }
    .pd-photo-img { max-height: 158px; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .26)); }
    .pd-photo-default { font-size: 40px; }
    .pd-hero-info { padding: 8px 14px 12px; background: none; }
    .pd-name { font-size: var(--fs-page); }
    .pd-en { font-size: var(--fs-caption); margin-top: 1px; letter-spacing: .1em; }
    .pd-tags { margin-top: 6px; gap: 5px; }
    .pd-chip, .pd-tags .position-tag { height: 18px; padding: 0 7px; font-size: var(--fs-caption); }
    .pd-body { padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0)); }
    .pd-stats { gap: 6px; }
    .pd-stat { padding: 7px 4px; }
    .pd-stat-value { font-size: var(--fs-num); }
    .pd-stat-label { font-size: var(--fs-caption); margin-top: 1px; }
    .pd-facts { margin-top: 10px; font-size: var(--fs-body); gap: 0 12px; }
    .pd-fact { padding: 5px 0; }
    .pd-actions { margin-top: 10px; padding-top: 9px; gap: 8px; }
    .pd-nav-btn { height: 30px; padding: 0 9px; font-size: var(--fs-body); }
    .pd-counter { font-size: var(--fs-caption); }
    /* 管理员：编辑收成右上角图标，与关闭按钮并排 */
    .pd-edit-link {
        position: absolute;
        top: 10px;
        right: 44px;
        z-index: 6;
        width: 28px;
        height: 28px;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: var(--r-sm);
        background: rgba(17, 24, 39, .45);
        color: #fff;
        font-size: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        backdrop-filter: blur(6px);
    }
    .pd-edit-link i { font-size: 12px; }
    /* 无照片（梯队 / 租借）：同上压缩 */
    .pd-hero-solo { padding: 14px 14px 12px; }
    .pd-hero-solo .pd-watermark { font-size: 52px; top: 4px; right: 80px; left: auto; }
    .pd-hero-solo .pd-pos-en { top: 12px; }
    .pd-hero-solo .pd-hero-info { padding: 14px 0 0; }
    .pd-hero-solo .pd-name { font-size: var(--fs-page); }
    .pd-grid-solo .pd-body { padding-top: 10px; }
    .pd-grid-solo .pd-facts { margin-top: 8px; }

    .toast { bottom: 78px; }

    /* 积分榜：隐藏场次/进/失，压缩数据列，队名保留 */
    .standings-table { font-size: var(--fs-body); table-layout: fixed; }
    .standings-table thead th { padding: 9px 3px; }
    .standings-table tbody td { padding: 9px 3px; }
    .standings-table .st-played,
    .standings-table .st-gf,
    .standings-table .st-ga { display: none; }
    .standings-table .st-rank { width: 31px; }
    .standings-table .st-logo { width: 26px; }
    .standings-table .st-won,
    .standings-table .st-drawn,
    .standings-table .st-lost { width: 23px; }
    .standings-table .st-gd { width: 32px; }
    .standings-table .st-points { width: 38px; }
    .standings-table .st-team { padding-left: 6px; padding-right: 4px; white-space: nowrap; }
    .standings-table tbody .st-points { font-size: var(--fs-body); }
    .standings-legend { padding: 10px 14px; gap: 10px; font-size: var(--fs-caption); }

    /* 数据表：手机端只保留 号码 / 球员 / 出场 / 进球 / 助攻 */
    .data-table { font-size: var(--fs-body); }
    .data-table thead th { padding: 9px 3px; letter-spacing: .04em; top: 54px; }
    .data-table tbody td { padding: 8px 3px; }
    .data-table .dt-pos,
    .data-table .dt-team,
    .data-table .dt-cs { display: none; }
    .data-table .dt-num { width: 36px; }
    .data-table .dt-stat { width: 44px; }
    .data-table thead .dt-num,
    .data-table thead .dt-stat { font-size: var(--fs-caption); }
    .data-table thead th:last-child { padding-right: 10px; }
    .data-table tbody td:last-child { padding-right: 10px; }
    .data-table .dt-player { padding-left: 8px; padding-right: 2px; }
    .data-table .dt-en { display: none; }
    .data-table.hide-cs .dt-assists { padding-right: 10px; }
    .data-table .dt-name { max-width: 152px; }
    /* 一线队是常态，只用标签标出梯队 / 租借，给名字让出宽度 */
    .data-table .dt-team-inline.is-first { display: none; }    .data-table .dt-team-inline {
        display: inline-block;
        font-size: var(--fs-caption);
        padding: 0 4px;
        border-radius: 6px;
        line-height: 1.5;
    }
    /* 数据页 KPI 一行两格 */
    .kpis-data { gap: 8px; }
    .kpis-data .kpi { padding: 10px 8px 11px; }
    .kpis-data .kpi b i { font-size: var(--fs-caption); }
    .kpis-data .kpi span { font-size: var(--fs-caption); }
}

/* 屏幕较高的手机：详情照片可以给大一点，仍然一屏放得下 */
@media (max-width: 760px) and (min-height: 620px) {
    .pd-photo { padding-top: 10px; }
    .pd-photo-img { max-height: 190px; }
}

/* ---------- 赛程：移动端 ---------- */
@media (max-width: 760px) {
    .fx-top { gap: 10px; }

    .fx-next-card {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px 12px;
        padding: 12px 14px;
    }
    .nxt-info {
        grid-column: 1;
        grid-row: 1;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 6px 8px;
    }
    .nxt-tag { font-size: 10px; }
    .nxt-comp { font-size: 11.5px; }
    .nxt-when { font-size: 11px; }
    .nxt-side {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }
    .nxt-side b { font-size: 14px; }
    .nxt-teams {
        grid-column: 1 / -1;
        grid-row: 2;
        gap: 8px;
        max-width: none;
        padding-top: 2px;
    }
    .nxt-team { gap: 6px; }
    .nxt-team b { font-size: 13px; }
    .nxt-logo { width: 28px; height: 28px; }

    /* 移动端：左侧堆成两行（第一行 日期 + 时间，第二行 赛事 + 轮次），球队整块占右侧 */
    .fx-row { grid-template-columns: 74px minmax(0, 1fr); gap: 7px; padding: 8px 5px; }
    .fx-when { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
    .fx-date { flex-direction: row; align-items: baseline; gap: 3px; }
    .fx-date b { font-size: 11.5px; }
    .fx-date span { font-size: 9.5px; }
    .fx-meta { flex-direction: row; align-items: center; gap: 3px; }
    .fx-teams { max-width: none; justify-self: stretch; gap: 3px; }
    .fx-month { padding: 12px 10px 6px; font-size: 11.5px; }
    .fx-comp { font-size: 9px; padding: 0 3px; }
    .fx-round { font-size: 9px; }
    .fx-team { font-size: 12px; }
    .fx-side { gap: 3px; }
    .fx-logo,
    .fx-logo.is-empty { width: 16px; height: 16px; font-size: 9px; }
    .fx-score { font-size: 12.5px; min-width: 28px; height: 22px; padding: 0 3px; }
    .fx-card .card-head { padding: 12px; gap: 8px; }
    .fx-card .card-head h2 { font-size: 13px; }
    .fx-card .card-count { font-size: 10.5px; }
    .fx-head-right { gap: 8px; }
    .fx-toggle { padding: 3px 8px 3px 5px; font-size: 10.5px; gap: 6px; }
    .fx-toggle-track { width: 24px; height: 14px; }
    .fx-toggle-knob { width: 10px; height: 10px; }
    .fx-toggle[aria-pressed="true"] .fx-toggle-knob { transform: translateX(10px); }
}

@media (max-width: 400px) {
    /* 极窄屏：KPI 三列内边距再收一点，避免 6 字标签折行 */
    .kpis { gap: 6px; }
    .kpi { padding: 11px 8px 12px; }
    .standings-table .st-rank { width: 27px; }
    .standings-table .st-logo { width: 23px; }
    .standings-table .st-won,
    .standings-table .st-drawn,
    .standings-table .st-lost { width: 22px; }
    .standings-table .st-gd { width: 29px; }
    .standings-table .st-points { width: 34px; }
    .standings-table .st-logo img { width: 17px; height: 17px; }
    /* 320-400 窄屏：数据卡标题与计数压在一行 */
    .data-wrapper .card-head { padding: 12px; gap: 8px; }
    .data-wrapper .card-head h2 { font-size: var(--fs-title); white-space: nowrap; }
    .data-wrapper .card-count { font-size: var(--fs-caption); white-space: nowrap; }
    /* 窄屏赛程：收紧内边距 */
    .fx-row { padding: 9px 6px; }
}

/* ================================================================
   阵型图
   ================================================================ */
.fm-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: #fff;
    font-size: var(--fs-body);
    font-weight: 600;
    color: var(--ink-2);
    cursor: pointer;
    transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.fm-btn i { font-size: 12px; }
.fm-btn:hover { border-color: rgba(0, 47, 167, .35); color: var(--blue); background: var(--blue-soft); }
.fm-btn:active { transform: translateY(1px); }
.fm-btn:disabled { opacity: .6; cursor: default; transform: none; }
/* 导出按钮做成主色，和另外两个工具按钮区分开 */
#btnFmExport { border-color: var(--blue); background: var(--blue); color: #fff; }
#btnFmExport:hover { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }

/* 阵型胶囊 */
.fm-formations {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 14px;
}
.fm-chip {
    flex: 0 0 auto;
    padding: 5px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    font-size: var(--fs-body);
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.fm-chip:hover { border-color: #C9D4E8; color: var(--ink-2); }
.fm-chip.is-active {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}
.fm-form {
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
    min-width: 62px;
}

/* 左：球场 右：名单 */
.fm-layout {
    display: grid;
    grid-template-columns: minmax(0, 520px) minmax(280px, 340px);
    gap: 16px;
    align-items: start;
    justify-content: center;
}
.fm-card { overflow: hidden; }
/* 两栏并排时别继承 .card + .card 的上边距 */
.fm-layout .card + .card { margin-top: 0; }

.fm-pitch {
    position: relative;
    margin: 12px;
    aspect-ratio: 4 / 5;
    border-radius: 12px;
    overflow: hidden;
    background:
        radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0) 60%),
        repeating-linear-gradient(180deg, #1E7A46 0 10%, #1A6E3E 10% 20%);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .48), inset 0 10px 40px rgba(0, 0, 0, .16);
}
.pl-half {
    position: absolute;
    left: 0; right: 0; top: 50%;
    height: 2px;
    background: rgba(255, 255, 255, .42);
}
.pl-circle {
    position: absolute;
    left: 50%; top: 50%;
    width: 27%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255, 255, 255, .42);
    border-radius: 50%;
}
.pl-box {
    position: absolute;
    left: 50%;
    width: 58%;
    height: 15%;
    transform: translateX(-50%);
    border: 2px solid rgba(255, 255, 255, .42);
}
.pl-box.is-top { top: 0; border-top: 0; }
.pl-box.is-bottom { bottom: 0; border-bottom: 0; }
.pl-six {
    position: absolute;
    left: 50%;
    width: 30%;
    height: 6.4%;
    transform: translateX(-50%);
    border: 2px solid rgba(255, 255, 255, .42);
}
.pl-six.is-top { top: 0; border-top: 0; }
.pl-six.is-bottom { bottom: 0; border-bottom: 0; }

.fm-slots { position: absolute; inset: 0; }
.fm-slot {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transform: translate(-50%, -50%);
    cursor: pointer;
    --fm-tok: 52px;
}
.fm-token-wrap { position: relative; transition: transform .16s var(--ease); }
.fm-token {
    position: relative;
    width: var(--fm-tok);
    height: var(--fm-tok);
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .92);
    background: #fff;
    overflow: hidden;
    box-shadow: 0 5px 14px rgba(3, 22, 12, .38);
}
/* 半身照裁到「头 + 肩」：从顶部对齐放大，头顶永远不会被切；
   纵向照片（半身照）放大得多一些，方形头像照片少一些，由 JS 写入 --av-zoom */
.fm-token img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 0;
    transform: scale(var(--av-zoom, 1.6));
    transform-origin: 50% 0;
}
.fm-token.is-nopic { background: linear-gradient(160deg, var(--blue) 0%, #1A4BD8 100%); }
/* 号码徽标：圆形，压在头像右下角，底边与圆形头像底边齐平（尺寸随头像等比缩放） */
.fm-token-num {
    position: absolute;
    right: calc(var(--fm-tok, 46px) * -0.065);
    bottom: 0;
    width: calc(var(--fm-tok, 46px) * 0.42);
    height: calc(var(--fm-tok, 46px) * 0.42);
    padding: 0;
    box-sizing: border-box;
    display: grid;
    place-items: center;
    border: 1.5px solid rgba(255, 255, 255, .95);
    border-radius: 999px;
    background: var(--blue);
    color: #fff;
    font-family: 'LCFC Sans', 'PingFang SC', sans-serif;
    font-size: calc(var(--fm-tok, 46px) * 0.207);
    font-weight: normal;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(3, 22, 12, .4);
    pointer-events: none;
}
/* 两位数缩小一点，给圆环留出呼吸 */
.fm-token-num.is-2d { font-size: calc(var(--fm-tok, 46px) * 0.19); }
/* 头像加载失败：徽标变成圆圈正中的大字 */
.fm-token-num.is-flat {
    inset: 0;
    margin: auto;
    width: fit-content;
    height: fit-content;
    min-width: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    font-size: calc(var(--fm-tok, 46px) * 0.37);
    line-height: 1;
}
/* 没有头像时：号码回到圆圈正中，用大字号 */
.fm-token.is-nopic .fm-token-num {
    position: static;
    min-width: 0;
    width: auto;
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    font-size: calc(var(--fm-tok, 46px) * 0.37);
    line-height: 1;
}
.fm-slot:hover .fm-token-wrap { transform: translateY(-1px) scale(1.04); }

.fm-empty {
    width: var(--fm-tok);
    height: var(--fm-tok);
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, .62);
    background: rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .88);
    font-size: var(--fs-caption);
    transition: background .15s var(--ease), border-color .15s var(--ease);
}
.fm-slot:hover .fm-empty { background: rgba(255, 255, 255, .24); border-color: #fff; }

.fm-name {
    /* 宽度跟着头像走，保证五个人并排时姓名也不会互相压住 */
    max-width: calc(var(--fm-tok, 52px) * 1.55);
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(3, 20, 11, .58);
    color: #fff;
    font-size: var(--fs-caption);
    font-weight: 700;
    line-height: 1.55;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fm-name.is-label {
    background: rgba(3, 20, 11, .34);
    color: rgba(255, 255, 255, .82);
    font-weight: 600;
}

.fm-slot.is-selected .fm-token,
.fm-slot.is-selected .fm-empty {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(253, 190, 17, .45), 0 6px 16px rgba(3, 22, 12, .4);
}
.fm-slot.is-selected .fm-name { background: var(--gold); color: #3A2A00; }

.fm-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #E23D3D;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
.fm-remove:hover { background: #C92B2B; }

/* 右侧球员名单 */
.fm-panel { display: flex; flex-direction: column; min-height: 0; }
.fm-panel .card-head h2.is-target { color: var(--blue); }
.fm-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px 0;
}
.fm-hint {
    margin: 8px 12px 0;
    padding: 7px 10px;
    border-radius: 9px;
    background: var(--blue-soft);
    color: var(--blue-ink);
    font-size: var(--fs-body);
    line-height: 1.5;
}
.fm-players {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px 12px;
    max-height: 540px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.fm-pcard {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s var(--ease), background .15s var(--ease), transform .15s var(--ease);
}
.fm-pcard:hover { border-color: rgba(0, 47, 167, .35); background: var(--blue-soft); transform: translateX(1px); }
.fm-pcard.is-on { background: #F7F9FD; border-style: dashed; }
.fm-pcard.is-on:hover { background: var(--blue-soft); }
.fm-pcard-av {
    position: relative;
    flex: none;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(168deg, #EDF2FC 0%, #D5E1F7 100%);
    overflow: hidden;
}
.fm-pcard-av img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 0;
    transform: scale(var(--av-zoom, 1.6));
    transform-origin: 50% 0;
}
.fm-pcard-av.is-nopic { background: linear-gradient(160deg, var(--blue) 0%, #1A4BD8 100%); }
/* 号码：夹在头像与球员名之间，用 LCFC Sans */
.fm-pcard-num {
    flex: none;
    min-width: 22px;
    text-align: center;
    font-family: 'LCFC Sans', 'PingFang SC', sans-serif;
    font-size: var(--fs-title);
    font-weight: normal;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: var(--blue);
}
.fm-pcard-name {
    flex: 1;
    min-width: 0;
    font-size: var(--fs-body);
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fm-pcard-tag {
    flex: none;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(0, 47, 167, .1);
    color: var(--blue);
    font-size: var(--fs-caption);
    font-weight: 700;
}

/* ---------- 阵型图：中等屏 ---------- */
@media (max-width: 1120px) {
    .fm-layout { grid-template-columns: minmax(0, 1fr) minmax(250px, 300px); }
    .fm-slot { --fm-tok: 46px; }
    .fm-players { max-height: 480px; }
}

/* ---------- 阵型图：移动端 ---------- */
@media (max-width: 760px) {
    .fm-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .fm-formations {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        margin-bottom: 10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .fm-formations::-webkit-scrollbar { display: none; }
    .fm-chip { padding: 4px 10px; font-size: var(--fs-body); }
    .fm-form { min-width: 56px; }

    .fm-btn { height: 32px; padding: 0 10px; font-size: var(--fs-caption); gap: 5px; }
    .fm-btn span { display: none; }
    .fm-btn i { font-size: 14px; }

    .fm-pitch { margin: 10px; aspect-ratio: 5 / 6; }
    .fm-slot { --fm-tok: 42px; gap: 3px; }
    .fm-name { font-size: var(--fs-caption); padding: 1px 5px; }
    .fm-remove { width: 18px; height: 18px; font-size: 12px; }

    .fm-filters { padding: 8px 10px 0; gap: 5px; }
    .fm-hint { margin: 8px 10px 0; font-size: var(--fs-body); }
    .fm-players {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        padding: 10px;
        max-height: 320px;
    }
    .fm-pcard { padding: 5px 7px; gap: 6px; }
    .fm-pcard-av { width: 28px; height: 28px; }
    .fm-pcard-num { min-width: 16px; font-size: var(--fs-body); }
    .fm-pcard-name { font-size: var(--fs-body); }
    /* 两列排布太窄，「场上」文字标签让位给球员名，用整卡浅蓝底 + 虚线边区分 */
    .fm-pcard-tag { display: none; }
    .fm-pcard.is-on { background: var(--blue-soft); border-color: rgba(0, 47, 167, .35); }
}

@media (max-width: 360px) {
    .fm-slot { --fm-tok: 36px; }
    .fm-players { grid-template-columns: minmax(0, 1fr); }
}

/* ================================================================
   交手记录弹窗（点积分榜球队）
   ================================================================ */
/* 积分榜：除本队外的行可点击 */
.standings-table tbody tr[data-team] { cursor: pointer; }
.standings-table tbody tr[data-team]:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: -2px;
}

.h2h-modal { max-width: 680px; }

.h2h-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 56px 16px 22px;
    border-bottom: 1px solid var(--line);
}
.h2h-logo-wrap {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: var(--r-md);
    background: #F4F7FC;
}
.h2h-logo-wrap img { width: 40px; height: 40px; object-fit: contain; }
.h2h-logo-wrap.is-empty { background: #EDF1F7; color: var(--faint); font-size: 20px; }
.h2h-head-txt { min-width: 0; }
.h2h-head-txt h3 {
    margin: 0 0 3px;
    font-size: var(--fs-title);
    font-weight: 800;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.h2h-head-txt p { margin: 0; font-size: var(--fs-caption); color: var(--muted); }

.h2h-sum {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 22px;
    background: #FAFBFD;
    border-bottom: 1px solid var(--line);
}
.h2h-stat {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 5px 11px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    font-size: var(--fs-caption);
    color: var(--muted);
    white-space: nowrap;
}
.h2h-stat b {
    font-size: var(--fs-title);
    font-weight: 800;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.h2h-stat em { font-style: normal; }
.h2h-stat.is-w b { color: #10743D; }
.h2h-stat.is-d b { color: #4B5563; }
.h2h-stat.is-l b { color: #B42318; }
.h2h-stat.is-muted { color: var(--muted); }
.h2h-stat.is-muted em { color: var(--faint); }

.h2h-sec { padding: 4px 18px 12px; }
.h2h-sec-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 4px 6px;
    font-size: var(--fs-body);
    font-weight: 700;
    color: var(--ink-2);
}
.h2h-sec-head em {
    font-style: normal;
    font-size: var(--fs-caption);
    font-weight: 700;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue);
}
.h2h-none { margin: 2px 4px 8px; font-size: var(--fs-body); color: var(--faint); }

/* 弹窗比页面窄，行内回到「日期/赛事 | 球队」两列 */
.h2h-modal .fx-row { grid-template-columns: 84px minmax(0, 1fr); gap: 10px; padding: 9px 4px; }
.h2h-modal .fx-when { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.h2h-modal .fx-date { gap: 4px; }
.h2h-modal .fx-date b { font-size: var(--fs-body); }
.h2h-modal .fx-date span { font-size: var(--fs-caption); }
.h2h-modal .fx-meta { gap: 5px; }
.h2h-modal .fx-comp { font-size: var(--fs-caption); padding: 0 5px; }
.h2h-modal .fx-round { font-size: var(--fs-caption); }
.h2h-modal .fx-teams { width: 100%; max-width: 440px; justify-self: end; }

.h2h-loading,
.h2h-empty {
    padding: 44px 24px;
    text-align: center;
    font-size: var(--fs-body);
    color: var(--muted);
}
.h2h-empty i { margin-right: 6px; color: var(--faint); }

@media (max-width: 760px) {
    .h2h-head { padding: 16px 52px 12px 16px; gap: 11px; }
    .h2h-logo-wrap { width: 44px; height: 44px; }
    .h2h-logo-wrap img { width: 34px; height: 34px; }
    .h2h-head-txt p { font-size: var(--fs-caption); }
    /* 7 个数据块在窄屏用等宽网格，避免最后只剩一个孤零零换行 */
    .h2h-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 12px 16px; }
    .h2h-stat { justify-content: center; padding: 5px 4px; font-size: var(--fs-caption); gap: 3px; }
    .h2h-stat b { font-size: var(--fs-title); }
    .h2h-sec { padding: 4px 10px 10px; }
    .h2h-modal .fx-row { grid-template-columns: 78px minmax(0, 1fr); gap: 8px; padding: 8px 2px; }
    /* 列表页为了队名宽度隐藏队徽，弹窗里放得下，恢复显示 */
    .h2h-modal .fx-logo { display: inline-block; width: 15px; height: 15px; }
    .h2h-modal .fx-logo.is-empty { display: inline-flex; font-size: var(--fs-caption); }
    .h2h-modal .fx-side { gap: 5px; }
    .h2h-loading, .h2h-empty { padding: 34px 18px; font-size: var(--fs-body); }
}
