/* ============================================================
 * solink_v2 手机端适配补丁 v1.0.0 (2026-10-03)
 * 作用域：≤768px 竖屏模式，桌面端完全不受影响
 * 覆盖：
 *   1) Layer 弹层内 flex 表单行自动换行、控件不溢出
 *   2) 收款统计/财务收支/库存统计 卡片两列排布、数字不重叠
 *   3) 统计页自定义筛选工具栏允许换行，竖版切换按钮可见
 * ============================================================ */
@media (max-width: 768px) {

    /* ---- Layer 弹层内容 ---- */
    .layui-layer-content div[style*="display: flex"],
    .layui-layer-content div[style*="display:flex"] {
        flex-wrap: wrap !important;
        row-gap: 8px;
    }
    .layui-layer-content .form-control {
        max-width: 100% !important;
    }
    /* 弹层里定宽 select 在手机上占满整行，避免挤压 */
    .layui-layer-content select.form-control[style*="width"] {
        width: 100% !important;
        margin-left: 0 !important;
    }
    /* 70/80px 固定标签在手机上收紧 */
    .layui-layer-content span[style*="width:70px"],
    .layui-layer-content span[style*="width:80px"] {
        width: auto !important;
        margin-right: 6px;
    }

    /* ---- 收款统计（finance）统计卡 ---- */
    .finance-stats .stat-col {
        width: 50% !important;
        padding: 0 6px;
    }
    .finance-stats .sm-st-icon {
        width: 46px;
        height: 46px;
        line-height: 46px;
        font-size: 20px;
        margin-right: 8px;
    }
    .finance-stats .sm-st-info > span { font-size: 17px; }
    .finance-stats .sm-st-info > div { font-size: 12px; }

    /* ---- 库存统计（rom）统计卡图标 ---- */
    .rom-stats .sm-st-icon {
        width: 46px;
        height: 46px;
        line-height: 46px;
        font-size: 20px;
        margin-right: 8px;
    }
    .rom-stats .sm-st-info > span { font-size: 17px; }
    .rom-stats .sm-st-info > div { font-size: 12px; }

    /* ---- 财务收支（account）账户卡片 ----
       v1.0.3.100（杰哥需求）：撤回两列改 3 列小卡 + JS 金额转「万」单位紧凑显示；
       3×31%+2×8px 间距 < 100%，保证真两行以上不挤成一行一卡 */
    .account-stats { flex-wrap: wrap !important; gap: 8px !important; }
    .account-stats .acc-col {
        flex: 0 0 31% !important;
        max-width: 31% !important;
        min-width: 0 !important;
    }
    .account-stats .acc-card {
        padding: 8px 10px;
        margin-bottom: 8px;
    }
    .account-stats .acc-name { font-size: 12px; }
    .account-stats .acc-balance {
        font-size: 16px;
        white-space: nowrap;
    }
    .account-stats .acc-sub { font-size: 11px; line-height: 1.5; }

    /* ---- 统计页自定义筛选工具栏：允许换行 ---- */
    .finance-toolbar,
    .account-toolbar,
    .rom-toolbar {
        flex-wrap: wrap !important;
    }
    .finance-toolbar select.form-control,
    .account-toolbar select.form-control,
    .rom-toolbar select.form-control {
        width: auto;
        min-width: 96px;
    }
    .finance-toolbar #finance-kw,
    .account-toolbar #account-kw,
    .rom-toolbar #rom-kw {
        width: 100% !important;
    }

    /* ---- 控制台（dashboard）统计卡 ----
       v1.0.3.105（杰哥需求）：图标在上、数字在下，居中排布；
       两部手机版型统一，数字到几十万也不换行挤压 */
    .dash-stats .sm-st {
        padding: 14px 6px 12px;
        margin-bottom: 12px;
        text-align: center;
    }
    .dash-stats .sm-st-icon {
        float: none !important;
        display: inline-block;
        margin: 0 auto 8px;
        width: 52px;
        height: 52px;
        line-height: 52px;
        font-size: 24px;
    }
    .dash-stats .sm-st-info {
        padding-top: 0;
        width: 100%;
    }
    .dash-stats .sm-st-info span {
        font-size: 20px;
        font-weight: 600;
        line-height: 1.3;
        white-space: nowrap;
    }
    .dash-stats .sm-st-info,
    .dash-stats .sm-st-info span,
    .dash-stats .sm-st-info a {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* ---- 提成结算（commission） ----
       v1.0.3.106：统计卡两列、工具栏换行、体检条换行、底部勾选条可换行 */
    .commission-stats .stat-col {
        width: 50% !important;
        padding: 0 6px !important;
    }
    .commission-stats .sm-st-icon {
        width: 46px;
        height: 46px;
        line-height: 46px;
        font-size: 20px;
        margin-right: 8px;
    }
    .commission-stats .sm-st-info > span { font-size: 17px; }
    .commission-stats .sm-st-info > div { font-size: 12px; }
    .commission-toolbar { flex-wrap: wrap !important; }
    .commission-toolbar select.form-control { width: auto; min-width: 92px; }
    .commission-toolbar .btn { margin-bottom: 6px; }
    .commission-check { line-height: 1.9; margin-bottom: 8px; }
    .commission-summary { display: flex; flex-wrap: wrap; align-items: center; }
    .commission-summary .cs-item { margin: 0 12px 6px 0; }
    /* v1.0.3.138：明细/汇总双 Tab 手机端紧凑 */
    .commission-tabs { margin-top: 4px; }
    .commission-tabs .cm-tab { padding: 7px 12px; font-size: 13px; }
    /* 弹窗内表格手机上横向滚动即可 */
    .layui-layer-content .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .layui-layer-content .table-responsive > table { min-width: 520px; }

    /* ---- bootstrap-table 工具栏：允许换行，竖版切换按钮不被挤出屏幕 ---- */
    .bootstrap-table .fixed-table-toolbar {
        flex-wrap: wrap;
        height: auto;
    }
    .fixed-table-toolbar .bs-bars,
    .fixed-table-toolbar .columns,
    .fixed-table-toolbar .search {
        white-space: normal;
    }
}

/* ===== 渠道成本页（106-10） ===== */
#cost-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
#cost-toolbar .btn { flex: none; }
#cost-toolbar select.form-control, #cost-toolbar input.form-control { flex: 1 1 150px; width: auto; max-width: 100%; }
.cost-slot { flex-wrap: wrap; }
.cost-slot > div { flex: 1 1 150px; }
@media (max-width: 767px) {
  .cost-slot .cost-slot-name { flex: 1 1 100%; }
}

/* ===== 渠道结算页（107-1） ===== */
@media (max-width: 767px) {
  .cb-stats .stat-col { width: 50%; }
  .cb-stats .sm-st-icon { width: 46px; height: 46px; line-height: 46px; font-size: 20px; }
  .cb-stats .sm-st-info > span { font-size: 17px; }
  .cb-stats .sm-st-info > div { font-size: 12px; }
  .cb-toolbar { flex-wrap: wrap !important; }
  .cb-toolbar select.form-control { width: auto; min-width: 92px; }
  .cb-toolbar input.form-control { width: auto; min-width: 120px; }
  .cb-toolbar .btn { margin-bottom: 6px; }
  .cb-tabs .cb-tab { padding: 6px 12px; }
  #cb-selection { display: flex; flex-wrap: wrap; align-items: center; }
  #cb-selection > span { margin: 0 12px 6px 0; }
}
