/* 11选5 走势图 - 悬浮按钮与悬浮面板（PC / H5 共用）
 * 表格视觉参考: shzrs.com 11选5 号码分布走势图
 */

/* 悬浮按钮：右侧竖排 */
.x5TrendFab {
    position: fixed;
    right: 0;
    top: 46%;
    transform: translateY(-50%);
    z-index: 1600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 38px;
    padding: 12px 0;
    border-radius: 8px 0 0 8px;
    background: linear-gradient(180deg, #d93b3b, #a81d24);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    line-height: 1;
    letter-spacing: 1px;
    border: 0;
    outline: none;
    text-decoration: none;
    box-shadow: -2px 2px 10px rgba(228, 57, 60, .35);
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    writing-mode: vertical-rl;
    text-orientation: upright;
}

.x5TrendFab:hover,
.x5TrendFab:focus {
    color: #fff;
    text-decoration: none;
    background: linear-gradient(180deg, #c73333, #992026);
}

.x5TrendFab .x5TrendFabIcon {
    width: 18px;
    height: 18px;
    writing-mode: horizontal-tb;
}

.x5TrendFab .x5TrendFabIcon svg {
    display: block;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* PC 开奖公告区内的文字入口 */
.x5TrendPageLink {
    color: #d93b3b;
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
}

.x5TrendPageLink:hover,
.x5TrendPageLink:focus {
    color: #0066b3;
    text-decoration: underline;
}

/* 页面内嵌按钮（H5 顶部开奖区） */
.x5TrendLink {
    display: inline-block;
    height: 24px;
    line-height: 22px;
    padding: 0 10px;
    margin-left: 8px;
    border: 1px solid rgba(255, 255, 255, .75);
    border-radius: 12px;
    background: rgba(255, 255, 255, .22);
    color: #fff;
    font-size: 12px;
    text-decoration: none;
    vertical-align: middle;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.x5TrendLink:hover,
.x5TrendLink:focus {
    background: rgba(255, 255, 255, .36);
    color: #fff;
    text-decoration: none;
}

/* 遮罩层 */
.x5TrendMask {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease;
}

.x5TrendMask.is-open {
    opacity: 1;
    visibility: visible;
}

/* 面板 */
.x5TrendPanel {
    width: 760px;
    max-width: 100%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 14px 44px rgba(0, 0, 0, .28);
    transform: translateY(12px) scale(.98);
    transition: transform .18s ease;
}

.x5TrendMask.is-open .x5TrendPanel {
    transform: translateY(0) scale(1);
}

/* 标题栏：参考站点红色标题条 */
.x5TrendHead {
    display: flex;
    align-items: center;
    height: 48px;
    flex: 0 0 48px;
    padding: 0 12px;
    background: #d91d37;
    border-bottom: 1px solid #c4162d;
    color: #fff;
}

.x5TrendTitle {
    flex: 1 1 auto;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.x5TrendTitle .x5TrendSub {
    margin-left: 6px;
    font-size: 12px;
    font-weight: 400;
    color: rgba(255, 255, 255, .85);
}

.x5TrendTools {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.x5TrendBtn {
    height: 28px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 3px;
    background: transparent;
    color: #fff;
    font-size: 13px;
    line-height: 26px;
    cursor: pointer;
    outline: none;
}

.x5TrendBtn:hover {
    background: rgba(255, 255, 255, .18);
}

.x5TrendClose {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 3px;
    background: transparent;
    color: #fff;
    font-size: 20px;
    line-height: 25px;
    cursor: pointer;
    outline: none;
}

.x5TrendClose:hover {
    background: rgba(255, 255, 255, .18);
}

/* 横滑提示（内容超宽时由 JS 显示，仅窄屏） */
.x5TrendTip {
    display: none;
    flex: 0 0 auto;
    padding: 6px 10px;
    background: #fff;
    color: #999;
    font-size: 12px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

/* 表格容器 */
.x5TrendBody {
    flex: 1 1 auto;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
}

.x5TrendLoading {
    padding: 70px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.x5TrendLoading.is-error {
    color: #d91d37;
}

.x5TrendLoading a {
    color: #d93b3b;
    text-decoration: underline;
    cursor: pointer;
}

/* 走势表格 */
table.x5TrendTable {
    width: 100%;
    min-width: 558px;
    border-collapse: collapse;
    table-layout: fixed;
    font-family: Arial, "Microsoft Yahei", sans-serif;
    font-size: 13px;
    color: #333;
    background: #fff;
}

table.x5TrendTable th,
table.x5TrendTable td {
    height: 34px;
    padding: 0;
    border: 1px solid #ddd;
    text-align: center;
    font-weight: 400;
    white-space: nowrap;
    box-sizing: border-box;
}

/* 表头：蓝底白字 */
table.x5TrendTable thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #d93b3b;
    color: #fff;
    font-weight: 400;
}

/* 期号列固定 */
table.x5TrendTable thead th.x5TrendColExpect,
table.x5TrendTable tbody td.x5TrendColExpect,
table.x5TrendTable tfoot th.x5TrendColStat {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 96px;
    min-width: 96px;
    max-width: 96px;
    background: #fafafa;
    color: #333;
    font-weight: 600;
    box-shadow: 1px 0 0 #ddd;
}

table.x5TrendTable thead th.x5TrendColExpect {
    z-index: 5;
    background: #d93b3b;
    color: #fff;
    font-weight: 400;
}

/* 斑马纹 */
table.x5TrendTable tbody tr:nth-child(odd) td {
    background: #f6f9fc;
}

table.x5TrendTable tbody tr:nth-child(odd) td.x5TrendColExpect {
    background: #eef3f8;
}

table.x5TrendTable tbody tr:hover td {
    background: #eaf6ff;
}

table.x5TrendTable tbody tr:hover td.x5TrendColExpect {
    background: #e0f0fd;
}

/* 开奖号码球 */
.x5TrendBall {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    border-radius: 50%;
    background: #d93b3b;
    color: #fff;
    font-size: 14px;
    font-weight: 400;
    vertical-align: middle;
}

/* 当期第一位开奖号码 */
.x5TrendBall.is-first {
    background: #e60012;
}

/* 号码分布遗漏值 */
.x5TrendMiss {
    color: #999;
    font-size: 13px;
}

/* 统计区（合并进表格底部） */
table.x5TrendTable tfoot {
    background: #fdf7f7;
}

table.x5TrendTable tfoot th,
table.x5TrendTable tfoot td {
    height: 30px;
    background: #fdf7f7;
    color: #333;
    font-size: 13px;
}

table.x5TrendTable tfoot th.x5TrendColStat {
    background: #fafafa;
    font-weight: 400;
    white-space: normal;
    line-height: 1.2;
}

/* 期数切换栏 */
.x5TrendNumBar {
    position: sticky;
    left: 0;
    z-index: 1;
    width: 100%;
    padding: 10px 12px 8px;
    display: flex;
    justify-content: center;
    gap: 8px;
    background: #fff;
    border-bottom: 1px solid #eef1f5;
    box-sizing: border-box;
}

.x5TrendNumBtn {
    margin: 0;
    padding: 4px 18px;
    border: 1px solid #e3e8ef;
    border-radius: 999px;
    background: #fff;
    color: #606a78;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    outline: none;
    transition: background .15s, color .15s, border-color .15s;
}

.x5TrendNumBtn.is-active {
    background: #d91d37;
    border-color: #d91d37;
    color: #fff;
    font-weight: 600;
}

/* 图例 */
.x5TrendLegend {
    position: sticky;
    left: 0;
    width: 100%;
    padding: 12px;
    color: #8a94a6;
    font-size: 12px;
    line-height: 1.9;
    text-align: center;
    background: #f8fafc;
    border-top: 1px solid #eef1f5;
    box-sizing: border-box;
}

.x5TrendLegend .x5TrendBall {
    width: 18px;
    height: 18px;
    line-height: 18px;
    font-size: 11px;
    margin-right: 4px;
    vertical-align: -3px;
}

/* H5 */
@media (max-width: 750px) {
    .x5TrendFab {
        width: 30px;
        padding: 10px 0;
        font-size: 12px;
        border-radius: 6px 0 0 6px;
    }

    .x5TrendFab .x5TrendFabIcon,
    .x5TrendFab .x5TrendFabIcon svg {
        width: 15px;
        height: 15px;
    }

    .x5TrendMask {
        padding: 0;
        align-items: stretch;
    }

    .x5TrendPanel {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        transform: none;
    }

    /* 标题栏：渐变红 + 半透明圆形按钮 */
    .x5TrendHead {
        height: 52px;
        flex-basis: 52px;
        padding: 0 10px;
        background: linear-gradient(135deg, #ff4d5a 0%, #d91d37 55%, #c4162d 100%);
        border-bottom: 0;
        box-shadow: 0 1px 6px rgba(196, 22, 45, .28);
    }

    .x5TrendTitle {
        text-align: left;
        font-size: 15px;
        font-weight: 600;
        padding-left: 2px;
    }

    .x5TrendTitle .x5TrendSub {
        display: inline-block;
        margin-left: 6px;
        padding: 1px 7px;
        border-radius: 9px;
        background: rgba(255, 255, 255, .18);
        font-size: 11px;
        font-weight: 400;
        color: #fff;
        vertical-align: 1px;
    }

    .x5TrendTools {
        gap: 8px;
    }

    .x5TrendBtn {
        height: 26px;
        padding: 0 10px;
        border: 0;
        border-radius: 13px;
        background: rgba(255, 255, 255, .18);
        color: #fff;
        font-size: 12px;
        line-height: 26px;
    }

    .x5TrendBtn:hover {
        background: rgba(255, 255, 255, .3);
    }

    .x5TrendClose {
        width: 26px;
        height: 26px;
        border: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, .18);
        font-size: 18px;
        line-height: 23px;
    }

    .x5TrendClose:hover {
        background: rgba(255, 255, 255, .3);
    }

    /* 表格：一屏放下彩期 + 11 个号码列 */
    table.x5TrendTable {
        min-width: 0;
        width: 100%;
        font-size: 11px;
    }

    table.x5TrendTable th,
    table.x5TrendTable td {
        height: 30px;
        border-color: #eef1f5;
    }

    table.x5TrendTable thead th {
        height: 32px;
        background: linear-gradient(180deg, #2ba3f2 0%, #d93b3b 100%);
        font-size: 10px;
        letter-spacing: 0;
    }

    table.x5TrendTable th.x5TrendColExpect,
    table.x5TrendTable td.x5TrendColExpect,
    table.x5TrendTable tfoot th.x5TrendColStat {
        width: 80px;
        min-width: 80px;
        max-width: 80px;
        padding: 0 2px;
        font-size: 10px;
        letter-spacing: -.2px;
    }

    table.x5TrendTable tbody td {
        overflow: hidden;
    }

    table.x5TrendTable tfoot th,
    table.x5TrendTable tfoot td {
        height: 26px;
        font-size: 10px;
    }

    table.x5TrendTable tfoot th.x5TrendColStat {
        font-size: 10px;
    }

    .x5TrendBall {
        width: 21px;
        height: 21px;
        line-height: 21px;
        font-size: 11px;
        box-shadow: 0 1px 2px rgba(0, 0, 0, .16);
    }

    .x5TrendBall.is-first {
        background: linear-gradient(180deg, #ff5a5f 0%, #e60012 100%);
    }

    .x5TrendMiss {
        font-size: 11px;
        color: #b0b7c3;
    }

    .x5TrendNumBar {
        padding: 8px 12px;
        background: #fff;
    }

    .x5TrendNumBtn {
        padding: 4px 16px;
        font-size: 12px;
    }

    .x5TrendLegend {
        padding: 10px 10px calc(14px + env(safe-area-inset-bottom));
        font-size: 11px;
        line-height: 1.8;
    }

    .x5TrendLegend .x5TrendBall {
        width: 16px;
        height: 16px;
        line-height: 16px;
        font-size: 9px;
        vertical-align: -3px;
    }
}

/* 超窄屏（≤360px）进一步压缩，避免号码球挤在一起 */
@media (max-width: 360px) {
    table.x5TrendTable th.x5TrendColExpect,
    table.x5TrendTable td.x5TrendColExpect,
    table.x5TrendTable tfoot th.x5TrendColStat {
        width: 72px;
        min-width: 72px;
        max-width: 72px;
        font-size: 9px;
        letter-spacing: -.4px;
    }

    .x5TrendBall {
        width: 19px;
        height: 19px;
        line-height: 19px;
        font-size: 10px;
    }

    table.x5TrendTable thead th {
        font-size: 9px;
    }
}
