/* ==================== 更多专家页（/match/experts/） ==================== */

/* 内容容器：与专家主页 .eh-wrap 同宽并水平居中 */
.em-wrap {
    max-width: 920px;
    margin: 20px auto 40px;
    padding: 0 16px;
}

/* 顶部返回标签（黑色胶囊）：与右侧「竞足/竞篮/其他」灰框分组再拉开一点间距
   （.filter-scroll 自身 gap 12px，此处再 +8px） */
.em-back {
    margin-right: 0;       /* 与右侧分组间距再 -3px（原 3px，现仅保留容器 gap 12px） */
    padding: 8px 18px;
}

/* ===== 榜单选项卡：白色通栏容器 + 选中红色胶囊白字 ===== */
.em-tabs {
    display: flex;
    align-items: center;
    gap: 0;                   /* 标签白底相互连通，不再留缝 */
    width: 100%;
    max-width: 100%;
    margin: 0 0 14px;
    padding: 6px;
    border-radius: 999px;
    background: #ffffff;      /* 白色底（原浅灰 #f5f5f7） */
    overflow-x: auto;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .06);   /* 标签条加投影（专家卡片不再用阴影） */
}

.em-tab {
    flex: none;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 9px 17px;        /* 原 22 → 17：整体宽度 -10px（含「全部」） */
    border-radius: 999px;
    background: #ffffff;      /* 未选中：白色胶囊 */
    color: #4b5563;           /* 未选中：深灰文字 */
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;    /* 榜单切换为链接 <a>：去掉下划线 */
    transition: background .15s ease, color .15s ease;
}

.em-tab.active {
    background: #111111;      /* 选中：黑色胶囊 */
    color: #ffffff;
    font-weight: 600;
}

/* 「全部」右侧的标签（总胜榜 / 连中榜 / 胜率榜 / 回报榜）：在已 -10px 基础上再 -5px（左右内边距 17 → 14.5） */
.em-tab:not(:first-child) {
    padding-left: 14.5px;
    padding-right: 14.5px;
}

/* 电脑端：标签间距 5px，且每个标签宽度再 +10px
   「全部」17 → 22，其余 14.5 → 19.5（左右内边距各 +5px） */
@media (min-width: 769px) {
    .em-tabs {
        gap: 5px;
    }

    .em-tab {
        padding-left: 22px;
        padding-right: 22px;
    }

    .em-tab:not(:first-child) {
        padding-left: 19.5px;
        padding-right: 19.5px;
    }

    /* 信息区两列：左列昵称 / 战绩 / 擅长条，右列关注按钮
       按钮在擅长条上方一行，右边缘与擅长条对齐 */
    .em-main {
        display: grid;
        grid-template-columns: 1fr auto;
        column-gap: 14px;
        align-items: center;
    }

    .em-name-row {
        grid-column: 1;
        grid-row: 1;
    }

    .em-sub {
        grid-column: 1;
        grid-row: 2;
    }

    .em-leagues {
        grid-column: 1 / -1;    /* 擅长条占满信息区宽度，用于右侧对齐基准 */
        grid-row: 3;
        margin-bottom: 5px;     /* 电脑端：下边距 +5px */
    }

    .em-follow-btn {
        grid-column: 2;
        grid-row: 2;                     /* 擅长条上方一行 */
        justify-self: end;               /* 右边缘与擅长条右边缘对齐 */
        transform: translateY(-15px);    /* 整体上移 15px */
    }
}

/* ===== 专家列表卡片 ===== */
.em-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.em-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #f0f1f3;       /* 卡片无阴影，改用 1px 浅描边分隔 */
    transition: border-color .15s ease;
}

/* 进入视口后滑出：从下往上滑入 + 淡入
   初始态由 JS 挂 .em-hidden，观察到可见时加 .em-in 触发动画，结束后 JS 移除这两个类 */
@keyframes emCardSlideIn {
    from { opacity: 0; transform: translateY(26px); }
    to   { opacity: 1; transform: translateY(0); }
}

.em-card.em-hidden {
    opacity: 0;
}

.em-card.em-hidden.em-in {
    animation: emCardSlideIn .45s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

/* 系统开启「减少动态效果」时直接显示 */
@media (prefers-reduced-motion: reduce) {
    .em-card.em-hidden { opacity: 1; }
    .em-card.em-hidden.em-in { animation: none; }
}

.em-card:hover {
    border-color: #e3e5e9;            /* hover 只加深描边，不再加阴影 */
}

/* 头像 + 底部「认证」标签 */
.em-avatar {
    position: relative;
    flex: none;
    align-self: flex-start;   /* 顶部对齐：与右侧昵称行同一起点（不再垂直居中） */
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #f0f1f3;
}

.em-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* 头像底部「认证专家」标签：与专家主页 .eh-avatar-badge 完全一致
   （上浮 2px、高度 20px、9px 字、2px 白边、宽度比头像窄 12px） */
.em-avatar-badge {
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;              /* 由文字 + 左右内边距决定宽度 */
    height: 20px;
    box-sizing: border-box;
    padding: 0 7px;           /* 左右内边距 +5px（原 2px） */
    border-radius: 999px;
    background: #e5484d;
    border: 2px solid #ffffff;
    color: #ffffff;
    font-size: 9px;
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    z-index: 2;
}

/* 中间：昵称 / 称号 / 战绩 / 粉丝
   固定基础宽度（不撑满）→ 关注按钮紧跟其后并左对齐，位置在各卡片间保持一致 */
.em-main {
    flex: 0 1 44%;
    min-width: 0;
}

.em-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.em-name {
    max-width: 150px;
    font-size: 14px;          /* 专家名称 16 → 14（缩小 2 号） */
    font-weight: 600;
    color: #222222;
    text-decoration: none;    /* 昵称改为链接：去掉下划线、保留原色 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.em-name:hover {
    color: #e5484d;           /* 可点提示：hover 变主色 */
}

/* 名字旁边的称号标签：10 号字，上下 3px / 左右 5px */
.em-title {
    flex: none;
    max-width: 120px;
    padding: 3px 5px;
    border-radius: 999px;
    background: #f5f7fa;
    color: #6b7280;
    font-size: 10px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.em-sub {
    display: flex;
    align-items: center;
    gap: 5px;                 /* 战绩标签与粉丝标签间距 5px */
    margin-top: 9px;          /* 专家名称与下方一行间距 +3px（原 6px） */
    font-size: 12px;
    color: #9ca3af;
}

/* 名字下方的两个标签（战绩 / 粉丝）共用：整体再上移 3px；
   inline 元素的上下 padding 不会撑开布局、背景会溢出，故改 inline-flex */
.em-record,
.em-fans {
    display: inline-flex;
    align-items: center;
    position: relative;
    top: -3px;
    padding: 3px 5px;         /* 标签内：上下 3px / 左右 5px */
    font-size: 10px;
    line-height: 1;
}

/* 最优战绩「近N中N」：浅红色无边框标签框 */
.em-record {
    border: none;
    border-radius: 6px;
    background: rgba(229, 72, 77, .12);   /* 浅红底 */
    color: #e5484d;                       /* 主色红字 */
}

/* 粉丝数：灰色标签框（与战绩标签同尺寸同字号，仅配色不同） */
.em-fans {
    border-radius: 6px;
    background: #f3f4f6;                  /* 浅灰底 */
    color: #6b7280;
}

/* 擅长联赛：另起一行，浅灰圆角条通栏（与专家主页 .eh-league-row 同款视觉），整条可点 */
.em-leagues {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 10px;
    background: #f5f6f8;      /* 浅灰背景条 */
    font-size: 12px;
    color: #9ca3af;
    text-decoration: none;    /* 整条为链接：去掉下划线 */
}

.em-leagues:hover {
    background: #eef0f3;      /* hover 提示可点 */
}

.em-leagues-label {
    flex: none;
    color: #9099a5;           /* 「擅长联赛」文字：比上一版（#b0b6bf）深一点 */
    font-size: 12px;
    line-height: 1;
}

/* 右侧箭头：推到条最右端 */
.em-leagues .layui-icon-right {
    flex: none;
    margin-left: auto;
    font-size: 12px;
    color: #9ca3af;
}

/* 单个联赛：灰色边框 + 白底胶囊（文字 10px；上下内边距 4px → 高度在上一步基础上 +4px） */
.em-league-tag {
    flex: none;
    padding: 4px 8px;
    border: 0.8px solid #dcdfe6;
    border-radius: 999px;
    background: #ffffff;
    color: #6b7280;
    font-size: 10px;
    line-height: 1;
    white-space: nowrap;
}

/* 关注按钮：位于信息区内（擅长条上方）
   电脑端由 .em-main 的 grid 提到昵称区右侧并左对齐；手机端自然排在擅长条上方 */
.em-follow-btn {
    flex: none;
    border: none;
    outline: none;
    cursor: pointer;
    background: #111111;
    color: #ffffff;
    font-size: 12px;
    line-height: 1;
    padding: 7px 14px;
    border-radius: 999px;
    transition: opacity .15s ease, background .15s ease;
}

.em-follow-btn:hover {
    opacity: .88;
}

/* 已关注：站内主色红胶囊 */
.em-follow-btn.followed {
    background: #e5484d;
}

/* 右侧四项数据：总胜率 / 近N场胜率 / 最高连中 / 回报率 */
.em-metrics {
    flex: none;
    margin-left: auto;      /* 数据区始终靠卡片右侧 */
    display: grid;
    grid-template-columns: repeat(4, minmax(62px, auto));   /* 标签更长，列宽 52 → 62 */
    gap: 0 16px;
}

.em-metric {
    text-align: center;
}

.em-metric-label {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    white-space: nowrap;    /* 「近N场胜率 / 最高连中」不折行 */
}

.em-metric-value {
    display: block;
    margin-top: 4px;
    font-size: 19px;          /* 四项统计数值统一 19px（15 → 17 → 19，累计加大 4 号） */
    font-weight: 600;
    color: #222222;
}

/* 胜率 / 回报率用主色强调 */
.em-metric-value.hl {
    color: #e5484d;
}

/* 标签里的场次 N（「近N场胜率」）：红色加粗 */
.em-metric-label b {
    color: #e5484d;
    font-weight: 700;
    margin: 0 1px;
}

/* 百分号：8 号小字，紧贴数字（专家主页 .eh-rate-pct 同款处理） */
.em-pct {
    font-size: 8px;
    font-weight: 600;
    margin-left: 1px;
}

/* 无专家：与列表卡片同款白色圆角块 + 1px 浅描边 */
.em-empty {
    padding: 60px 0;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
    background: #ffffff;
    border: 1px dashed #f0f1f3;      /* 虚线描边：与 .em-card 实线卡片区分，占位感更强 */
    border-radius: 14px;
}

.em-empty .layui-icon {
    display: block;
    margin-bottom: 8px;
    font-size: 32px;
}

/* 【由 Agent 完成】2026-10-19 未登录空态按钮：白底浅描边胶囊、并排居中（设计稿同款） */
.em-empty-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 18px;
}

.em-empty-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 118px;
    height: 44px;
    padding: 0 26px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #ffffff;
    color: #111827;
    font-size: 15px;
    text-decoration: none;
}

.em-empty-actions a:active { background: #f7f8fa; }

/* 底部汇总 */
.em-no-more {
    margin-top: 24px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
}

/* ===== 手机端：卡片换行，四项数据独占一行 ===== */
@media (max-width: 768px) {
    .em-wrap {
        margin: 16px auto 24px;
        padding: 0 12px;
    }

    /* 手机端选项卡：限制总宽度（不横向滚动），5 个标签等分通栏 */
    .em-tabs {
        overflow: hidden;         /* 不再横向滚动，总宽锁在容器内 */
    }

    .em-tab,
    .em-tab:not(:first-child) {
        flex: 1 1 0;              /* 等分整行 */
        min-width: 0;             /* 允许收缩，保证不溢出 */
        padding-left: 0;
        padding-right: 0;
        text-align: center;
    }

    .em-card {
        position: relative;       /* 关注按钮绝对定位到卡片右上角的参照 */
        flex-wrap: wrap;
        padding: 14px;
    }

    /* 手机端：擅长条与下方（数据区）间距缩减 10px */
    .em-leagues {
        margin-bottom: -10px;
    }

    .em-metrics {
        width: 100%;
        grid-template-columns: repeat(4, 1fr);
        gap: 0;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px dashed #f0f1f3;
    }

    /* 手机端：四项标签较长，字号 11 → 10px 保证四列排满不溢出 */
    .em-metric-label {
        font-size: 10px;
    }

    /* 手机端：关注按钮钉在卡片右上角（脱离信息区流，不挤占擅长条） */
    .em-follow-btn {
        position: absolute;
        top: 24px;            /* 原 14px，下移 10px */
        right: 14px;
        margin: 0;
    }

    /* 手机端信息区恢复自适应宽度（单列堆叠：昵称 / 战绩 / 关注 / 擅长条） */
    .em-main {
        flex: 1 1 auto;
        display: block;
    }

    .em-name {
        max-width: 120px;
    }
}

/* ==================== 「我的关注」视图（?rank=follow，推荐首页黑色胶囊进入） ==================== */

/* 栏目标题：橙色圆角竖条 + 加粗黑字（与专家主页「历史方案」.eh-sec-title 同款） */
.em-sec-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 20px 0 12px;
    font-size: 17px;
    font-weight: 700;
    color: #222222;
}

.em-sec-title::before {
    content: '';
    flex: none;
    width: 5px;
    height: 18px;
    border-radius: 3px;
    background: #f4602a;   /* 橙色竖条 */
}

/* 顶部筛选栏「关注」标签：与足球 / 篮球同处一个灰胶囊组（分段控件）内的第一项，
   样式跟随组内标签（透明底 + 灰字），鼠标经过变黑 */
.em-type-follow {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 9px 26px;
    border: none;
    border-radius: 25px;
    background: transparent;
    color: #666;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.2s ease;
}

.em-type-follow:hover {
    color: #222;
}

/* 「我的关注」视图下关注标签的选中态：与组内 filter-btn.active 同款（灰框内黑色胶囊 + 白字） */
.em-type-follow.active {
    background: #222222;
    color: #ffffff;
    font-weight: 600;
}

/* 足球 / 篮球已改为链接（?<type> 真实分类）：保持与原 button 一致的居中与等高 */
.jc-type-group .filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

/* 【由 Agent 完成】2026-10-01 篮球右侧「推荐」入口：与「关注」同款（透明底 + 灰字，
   鼠标经过变黑），位于灰胶囊组内、排在篮球之后，点击进比赛推荐首页 */
.em-nav-recommend {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 9px 26px;
    border: none;
    border-radius: 25px;
    background: transparent;
    color: #666;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.2s ease;
}

.em-nav-recommend:hover {
    color: #222;
}

@media (max-width: 768px) {
    .em-type-follow {
        padding: 7px 18px;
        font-size: 13px;
    }

    .em-nav-recommend {
        padding: 7px 18px;
        font-size: 13px;
    }
}
