/* out399 后台移动端适配(2026-11-03 方案B:竖屏卡片化)
   适用 ≤768px 竖屏;桌面端零影响。高频页表格加 o3cards 类即卡片化,
   列标签用 nth-child 在此集中维护(改动列顺序时同步这里)。 */

@media (max-width: 768px) {

    /* ── 全局底座 ─────────────────────────────── */
    .layuimini-main { padding: 10px !important; }
    .layui-elem-quote { padding: 10px 12px !important; font-size: 13px !important; line-height: 1.7 !important; margin-bottom: 10px !important; }

    /* 弹窗:内联宽度夹到 94vw;内容横向可滑(弹窗内小表格不卡片化,滑着看) */
    .layui-layer { max-width: 94vw !important; }
    .layui-layer-content { overflow-x: auto; }
    .layui-layer-content table { min-width: 360px; }

    /* 筛选区:固定宽输入框放开为弹性换行 */
    .layui-form-pane .layui-inline { margin: 0 8px 8px 0; }
    .layui-form-pane .layui-inline > .layui-input,
    .layui-form-pane .layui-inline > select { width: auto !important; min-width: 120px; max-width: 60vw; }

    /* 分页行 */
    .layui-table + div .layui-btn { margin-top: 6px; }

    /* ── 卡片化:表格变竖排卡片 ───────────────── */
    table.o3cards, table.o3cards > tbody { display: block; width: 100%; }
    table.o3cards > thead { display: none !important; }
    table.o3cards > tbody > tr {
        display: block; background: #fff; border: 1px solid #e8e8ec; border-radius: 10px;
        padding: 4px 14px 10px; margin-bottom: 10px; box-shadow: 0 1px 5px rgba(30,30,60,.07);
    }
    table.o3cards > tbody > tr > td {
        display: flex; justify-content: space-between; align-items: center; gap: 14px;
        border: none !important; padding: 5px 0 !important;
        text-align: right !important; white-space: normal !important; word-break: break-all; font-size: 14px;
    }
    table.o3cards > tbody > tr > td::before { content: attr(data-l); flex: none; color: #8a7f81; font-size: 13px; }
    /* 无 data-l 的列(操作列等):标签用 nth-child 规则补 */
    table.o3cards > tbody > tr > td:last-child {
        border-top: 1px dashed #ececf1 !important; margin-top: 5px; padding-top: 9px !important;
        justify-content: flex-start; flex-wrap: wrap; gap: 8px;
    }
    table.o3cards > tbody > tr > td:last-child::before { content: '操作'; }
    /* 例外:无操作列的表(积分流水末列=时间),覆盖标签并还原普通行样式 */
    .o3points > tbody > tr > td:last-child::before { content: '时间'; }
    .o3points > tbody > tr > td:last-child {
        border-top: none !important; margin-top: 0; padding-top: 5px !important;
        justify-content: space-between; flex-wrap: nowrap;
    }
}

/* 列标签(nth-child):媒体查询外写会污染桌面?不会——::before 内容只在上面的移动端规则里生效,
   这里仅按页配 content;桌面端 these ::before 无样式入口,安全。为稳妥仍放同一断点内。 */
@media (max-width: 768px) {
    /* 用户管理 11 列 */
    .o3member td:nth-child(1)::before { content: 'ID'; }
    .o3member td:nth-child(2)::before { content: '手机号'; }
    .o3member td:nth-child(3)::before { content: '用户名'; }
    .o3member td:nth-child(4)::before { content: '上级'; }
    .o3member td:nth-child(5)::before { content: '是否购买'; }
    .o3member td:nth-child(6)::before { content: '是否返款'; }
    .o3member td:nth-child(7)::before { content: '邀请/完成'; }
    .o3member td:nth-child(8)::before { content: '下级出局'; }
    .o3member td:nth-child(9)::before { content: '总返现'; }
    .o3member td:nth-child(10)::before { content: '总积分'; }
    /* 返现管理 10 列 */
    .o3rewards td:nth-child(1)::before { content: 'ID'; }
    .o3rewards td:nth-child(2)::before { content: '手机号'; }
    .o3rewards td:nth-child(3)::before { content: '用户名'; }
    .o3rewards td:nth-child(4)::before { content: '邀请的人手机号'; }
    .o3rewards td:nth-child(5)::before { content: '邀请的人用户名'; }
    .o3rewards td:nth-child(6)::before { content: '购买时间'; }
    .o3rewards td:nth-child(7)::before { content: '返现金额'; }
    .o3rewards td:nth-child(8)::before { content: '状态'; }
    .o3rewards td:nth-child(9)::before { content: '打款时间'; }
    /* 出局退款 10 列(2026-11-13 加出局方式列) */
    .o3exit td:nth-child(1)::before { content: 'ID'; }
    .o3exit td:nth-child(2)::before { content: '手机号'; }
    .o3exit td:nth-child(3)::before { content: '用户名'; }
    .o3exit td:nth-child(4)::before { content: '返现金额'; }
    .o3exit td:nth-child(5)::before { content: '出局方式'; }
    .o3exit td:nth-child(6)::before { content: '是否返还'; }
    .o3exit td:nth-child(7)::before { content: '邀请人数'; }
    .o3exit td:nth-child(8)::before { content: '出局时间'; }
    .o3exit td:nth-child(9)::before { content: '返还时间'; }
    /* 排队队列 9 列(点数制 2026-11-13) */
    .o3queue td:nth-child(1)::before { content: '序号'; }
    .o3queue td:nth-child(2)::before { content: '手机号'; }
    .o3queue td:nth-child(3)::before { content: '用户名'; }
    .o3queue td:nth-child(4)::before { content: '加入时间'; }
    .o3queue td:nth-child(5)::before { content: '前面还有'; }
    .o3queue td:nth-child(6)::before { content: '已邀(人)'; }
    .o3queue td:nth-child(7)::before { content: '新进加持(人)'; }
    .o3queue td:nth-child(8)::before { content: '还差几人'; }
    .o3queue td:nth-child(9)::before { content: '备注'; }
    /* 商城订单 9 列 */
    .o3exchange td:nth-child(1)::before { content: '单号'; }
    .o3exchange td:nth-child(2)::before { content: '会员'; }
    .o3exchange td:nth-child(3)::before { content: '商品明细'; }
    .o3exchange td:nth-child(4)::before { content: '应付'; }
    .o3exchange td:nth-child(5)::before { content: '领取方式'; }
    .o3exchange td:nth-child(6)::before { content: '收货地址'; }
    .o3exchange td:nth-child(7)::before { content: '状态'; }
    .o3exchange td:nth-child(8)::before { content: '下单时间'; }
    /* 订单管理(活动商品) 10 列 */
    .o3wine td:nth-child(1)::before { content: 'ID'; }
    .o3wine td:nth-child(2)::before { content: '订单号'; }
    .o3wine td:nth-child(3)::before { content: '会员'; }
    .o3wine td:nth-child(4)::before { content: '金额'; }
    .o3wine td:nth-child(5)::before { content: '状态'; }
    .o3wine td:nth-child(6)::before { content: '玩法状态'; }
    .o3wine td:nth-child(7)::before { content: '创建时间'; }
    .o3wine td:nth-child(8)::before { content: '付款确认'; }
    .o3wine td:nth-child(9)::before { content: '退款时间'; }
    /* 积分流水 6 列 */
    .o3points td:nth-child(1)::before { content: 'ID'; }
    .o3points td:nth-child(2)::before { content: '手机号'; }
    .o3points td:nth-child(3)::before { content: '用户名'; }
    .o3points td:nth-child(4)::before { content: '积分明细'; }
    .o3points td:nth-child(5)::before { content: '事项'; }
    /* 打款登记 6 列 */
    .o3cash td:nth-child(1)::before { content: '用户名/手机号'; }
    .o3cash td:nth-child(2)::before { content: '玩法状态'; }
    .o3cash td:nth-child(3)::before { content: '奖励现金累计'; }
    .o3cash td:nth-child(4)::before { content: '已登记打款'; }
    .o3cash td:nth-child(5)::before { content: '待打款'; }
    /* 每日营收明细 6 列(操作列走 last-child 默认规则) */
    .o3income td:nth-child(1)::before { content: '日期'; }
    .o3income td:nth-child(2)::before { content: '商品收款'; }
    .o3income td:nth-child(3)::before { content: '活动收款'; }
    .o3income td:nth-child(4)::before { content: '活动支出'; }
    .o3income td:nth-child(5)::before { content: '合计'; }
    /* 商城商品 8 列 */
    .o3goods td:nth-child(1)::before { content: '商品图'; }
    .o3goods td:nth-child(2)::before { content: '名称'; }
    .o3goods td:nth-child(3)::before { content: '售价'; }
    .o3goods td:nth-child(4)::before { content: '库存'; }
    .o3goods td:nth-child(5)::before { content: '排序'; }
    .o3goods td:nth-child(6)::before { content: '状态'; }
    .o3goods td:nth-child(7)::before { content: '创建时间'; }
    /* 库存流水 7 列(末列=原因,无操作列) */
    .o3stock td:nth-child(1)::before { content: '时间'; }
    .o3stock td:nth-child(2)::before { content: '类型'; }
    .o3stock td:nth-child(3)::before { content: '变动'; }
    .o3stock td:nth-child(4)::before { content: '库存变化'; }
    .o3stock td:nth-child(5)::before { content: '关联单号'; }
    .o3stock td:nth-child(6)::before { content: '操作人'; }
    .o3stock > tbody > tr > td:last-child::before { content: '原因/备注'; }
    .o3stock > tbody > tr > td:last-child {
        border-top: none !important; margin-top: 0; padding-top: 5px !important;
        justify-content: space-between; flex-wrap: nowrap;
    }
}
