/* 批发商工作台 - 移动端适配（≤768px）：左侧导航收起为汉堡菜单，点击展开（图标左+文字右） */
#wsHamburger { display: none; }
.route-list-mobile { display: none; }
@media (max-width: 768px) {
    .app { flex-direction: row; }
    .sidebar { position: fixed !important; left: 0 !important; top: 0 !important; bottom: 0 !important; width: 200px !important; min-height: 100vh; flex-shrink: 0; transform: translateX(-100%); transition: transform .2s ease; z-index: 100; overflow-y: auto; }
    body.ws-nav-open .sidebar { transform: translateX(0); }
    .admin-layout { flex-direction: row; }
    .admin-sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 200px; min-height: 100vh; flex-shrink: 0; transform: translateX(-100%); transition: transform .2s ease; z-index: 100; overflow-y: auto; }
    body.ws-nav-open .admin-sidebar { transform: translateX(0); }
    #wsHamburger { display: block; position: fixed; top: 8px; left: 8px; z-index: 110; width: 38px; height: 38px; border: none; border-radius: 10px; background: #14532d; color: #fff; font-size: 18px; line-height: 1; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
    .sidebar .logo { padding: 10px 20px !important; text-align: left !important; font-size: 15px !important; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,.12); }
    .sidebar .logo i { font-size: 15px; }
    .sidebar nav { display: block; overflow-y: auto; }
    .sidebar nav a { flex-direction: row !important; justify-content: flex-start !important; gap: 8px !important; padding: 8px 16px !important; font-size: 14px !important; line-height: 1.3 !important; }
    .sidebar nav a i { font-size: 14px; margin: 0; }
    .sidebar nav a.active { border-left: 3px solid #86efac; }
    .main { padding: 10px 6px !important; padding-top: 56px !important; min-width: 0; }
    .admin-main { margin-left: 0 !important; width: 100% !important; padding: 10px 6px !important; padding-top: 56px !important; box-sizing: border-box; }
    .page-h { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 10px !important; margin-left: 0 !important; margin-right: 0 !important; }
    .page-h h2 { font-size: 15px; }
    /* 统计卡片：尽量单行排列（≤3 个一行，多的自动换行），与内容卡同宽贴边 */
    .stat-grid { display: grid !important; grid-template-columns: repeat(3, 1fr) !important; gap: 6px !important; margin-left: 0 !important; margin-right: 0 !important; }
    .stat-card { padding: 10px 6px !important; }
    .stat-card .num { font-size: 16px; margin-top: 3px; }
    .stat-card .lbl { font-size: 11px; }
    .card-header { flex-wrap: wrap; gap: 6px; padding: 10px 10px !important; }
    /* 所有内容白卡：与主区同宽（外框贴边），内边距一并压掉页面内联样式的宽留白 */
    .admin-card { margin-left: 0 !important; margin-right: 0 !important; }
    .card-body { padding: 6px 8px !important; }
    .filter-bar { padding: 10px 8px !important; }
    .card-body [style*="display:flex"] { flex-direction: column; }
    /* 内联 flex 表单：保持横向换行，避免被上面的单列规则误伤 */
    .card-body form[style*="display:flex"] { flex-direction: row !important; flex-wrap: wrap !important; }
    /* 项目库添加表单：手机端名称整行 + 其余字段两列 + 按钮换行 */
    .item-add-form { flex-direction: row !important; flex-wrap: wrap !important; align-items: flex-start !important; gap: 8px !important; }
    .item-add-form .form-group { flex: 1 1 calc(50% - 4px) !important; min-width: 0 !important; width: auto !important; margin-bottom: 0 !important; }
    .item-add-form .form-group:first-child { flex-basis: 100% !important; }
    .item-add-form .btn { margin-top: 4px !important; }
    .btn { font-size: 12px; padding: 8px 14px; }
    table { display: block; overflow-x: auto; white-space: nowrap; }
    th, td { padding: 6px 6px !important; font-size: 12px; }
    .empty { padding: 20px; }
    /* 订单编辑页：项目明细行手机端单列卡片 */
    .item-row { grid-template-columns: 1fr !important; gap: 6px; padding: 10px; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; margin-bottom: 10px; }
    .item-row.item-head { display: none; }
    .item-row input, .item-row select { font-size: 14px; padding: 10px; }
    .item-row .lib-add { text-align: left; }
    /* 快速添加项目工具条：单行 */
    #quickAddBar { flex-wrap: nowrap !important; flex-direction: row !important; gap: 6px !important; }
    #qiName { flex: 1 !important; min-width: 0 !important; width: auto !important; padding: 8px 8px !important; font-size: 13px !important; }
    #qiPrice { width: 64px !important; flex: none !important; padding: 8px 6px !important; font-size: 13px !important; }
    #qiType { width: 78px !important; flex: none !important; padding: 8px 4px !important; font-size: 12px !important; }
    #quickAddBar .btn { flex: none !important; padding: 8px 6px !important; font-size: 11px !important; white-space: nowrap; letter-spacing: 0; }
    /* 合计栏：单行 */
    .total-bar { flex-wrap: nowrap !important; flex-direction: row !important; gap: 6px !important; justify-content: flex-start !important; padding: 10px 10px !important; overflow-x: auto; }
    .total-bar > span { font-size: 12px !important; white-space: nowrap; }
    .total-bar .label { font-size: 12px !important; }
    .total-bar .val { font-size: 15px !important; }
    #adjustAmount { width: 68px !important; flex: none !important; padding: 6px 6px !important; font-size: 13px !important; }
    /* 我的线路：手机端切换为卡片列表（标题一行完整 + 其他信息一行 + 操作按钮换行） */
    #wsRoutesTable { display: none; }
    /* 我的线路列表：线路卡片贴 card-body 边缘（内部子卡片，无内边距） */
    .route-card .card-body { padding-left: 0 !important; padding-right: 0 !important; }
    .route-list-mobile { display: block; }
    .route-row { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 10px; margin-bottom: 10px; }
    .rr-top { display: flex; align-items: center; gap: 8px; }
    .rr-id { flex: none; font-size: 11px; color: #94a3b8; }
    .rr-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: #2563eb; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .rr-top .tag { flex: none; }
    .rr-meta { margin-top: 4px; font-size: 11px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .rr-ops { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
    .rr-ops .btn { font-size: 11px; padding: 4px 8px; margin: 0; line-height: 1.4; }
    .rr-ops form { display: inline; margin: 0; }
    /* 通用列表卡片（js 把各页表格转成卡片列表） */
    .tbl-cards { display: block; }
    .tbl-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 9px 10px; margin-bottom: 9px; }
    .tbl-card-title { font-size: 13px; font-weight: 600; color: #0f172a; word-break: break-all; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
    .tbl-card-title .tt-no { flex: 1 1 auto; min-width: 0; word-break: break-all; }
    .tbl-card-title a { color: #2563eb; text-decoration: none; }
    .tbl-card-title .tt-tag { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: #eef2ff; color: #4338ca; white-space: nowrap; flex-shrink: 0; }
    .tbl-card-title .tt-date { font-size: 11px; color: #64748b; white-space: nowrap; flex-shrink: 0; }
    /* 财务流水卡片：删除按钮贴在时间标题行右侧，不再独占一行 */
    .tbl-card-title.ff-title { gap: 8px; }
    .tbl-card-title.ff-title .ff-ops { margin-left: auto; flex: 0 0 auto; display: inline-flex; align-items: center; }
    .ff-title .ff-ops form { display: inline; margin: 0; }
    .ff-title .ff-ops .btn { font-size: 10.5px; padding: 3px 8px; margin: 0; line-height: 1.4; }
    .tbl-card-hl { margin-top: 6px; font-size: 12px; color: #0f172a; font-weight: 600; display: flex; flex-wrap: nowrap; align-items: center; line-height: 1.6; }
    .tbl-card-hl > span { white-space: nowrap; flex-shrink: 0; }
    .tbl-card-hl .hl-route { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .tbl-card-hl .tag { font-size: 11px; padding: 2px 7px; border-radius: 999px; }
    .tbl-card-hl .tbl-meta-sep { color: #cbd5e1; padding: 0 4px; }
    .tbl-card-meta { margin-top: 4px; font-size: 11px; color: #64748b; line-height: 1.7; word-break: break-all; }
    .tbl-card-meta b { color: #334155; font-weight: 600; }
    .tbl-card-items { margin-top: 2px; }
    .tbl-item-d { color: #94a3b8; }
    .tbl-item-row { margin-top: 1px; color: #475569; }
    .tbl-item-type { color: #0f766e; }
    .tbl-item-qty { color: #94a3b8; }
    .tbl-item-amt { font-weight: 600; color: #334155; }
    .tbl-item-sub { margin-top: 1px; color: #94a3b8; text-align: right; }
    .tbl-item-total { margin-top: 3px; border-top: 1px dashed #cbd5e1; padding-top: 3px; }
    .tbl-item-total b { color: #dc2626; font-size: 12px; }
    .tbl-card-money { margin-top: 2px; }
    .tbl-card-profit { margin-top: 2px; }
    .tbl-meta-sep { color: #cbd5e1; padding: 0 2px; }
    .tbl-card-ops { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
    .tbl-card-ops span { display: inline; }
    .tbl-card-ops .btn { font-size: 10.5px; padding: 3px 7px; margin: 0; line-height: 1.4; }
    .tbl-card-ops .tag { font-size: 10.5px; padding: 2px 7px; }
    .tbl-card-ops form { display: inline; margin: 0; }
    /* 订单列表卡片：出发日期 / 线路名称 / 人数 / 订单类型 / 订单状态 为视觉重点 */
    .odc-route { margin-top: 5px; font-size: 13.5px; font-weight: 800; color: #0f172a; line-height: 1.35; word-break: break-all; }
    .odc-hl { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
    .odc-date { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 800; color: #14532d; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 8px; padding: 3px 9px; white-space: nowrap; }
    .odc-k { font-size: 10px; font-weight: 700; color: #15803d; background: #d1fae5; border-radius: 999px; padding: 1px 6px; }
    .odc-type { font-size: 11px; font-weight: 700; padding: 2px 8px; color: #4338ca; background: #eef2ff; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
    .odc-st { display: inline-flex; align-items: center; }
    .odc-st select { font-size: 12px; font-weight: 700; border: none; background: transparent; padding: 2px 4px; }
    .odc-ppl { font-size: 12px; font-weight: 800; color: #b45309; }
    .odc-ppl a { margin-left: 7px; }
    .odc-pay { font-size: 11px; font-weight: 700; padding: 2px 8px; color: #0369a1; background: #e0f2fe; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
    .odc-no-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
    .odc-no-row input[type=checkbox] { width: 18px; height: 18px; flex: none; margin: 0; }
    .odc-no-row .odc-no { margin-top: 0; flex: 1 1 auto; min-width: 0; }
    .odc-inline-date { float: right; font-size: 11px; color: #94a3b8; font-weight: 600; white-space: nowrap; }
    .tbl-card .ord-stack { flex-direction: row !important; flex-wrap: wrap; gap: 5px; align-items: center; }
    .tbl-card .ord-stack .tag { margin: 0; }
    .ws-ord-filter { gap: 6px !important; padding: 8px 10px !important; }
    .ws-ord-filter > span { font-size: 12px !important; }
    .ws-f { display: flex; align-items: center; gap: 5px; flex: 0 1 auto; min-width: 0; }
    .ws-f > span { font-size: 12px; white-space: nowrap; color: #334155; }
    .ws-f select { flex: 1 1 auto; min-width: 0; max-width: 100%; }
    .ws-f-date { flex: 1 1 100%; }
    .ws-f-date input[type=date] { flex: 1 1 0; min-width: 0; }
    .ws-ord-filter select { flex: 1 1 auto; min-width: 0; max-width: 100%; }
    .ws-ord-filter input[type=date] { flex: 1 1 44%; min-width: 0; max-width: 100%; }
    .ws-ord-filter input[type=text] { flex: 1 1 100% !important; width: auto !important; min-width: 0; }
    .ws-ord-filter button, .ws-ord-filter > a { flex: none; }
    .odc-no { margin-top: 3px; font-size: 13.5px; font-weight: 800; line-height: 1.3; word-break: break-all; }
    .odc-no a { color: #2563eb; text-decoration: none; }
    .odc-amt2 { margin-top: 3px; }
    .tbl-item-qty, .tbl-item-amt { white-space: nowrap; }
    .tbl-item-row { display: flex; gap: 6px; align-items: baseline; }
    .tbl-item-l { flex: 1 1 auto; min-width: 0; }
    .tbl-item-amt { flex: none; text-align: right; }
    /* 工作台·我的线路订单：6 项快捷统计卡（手机 3 列 2 行） */
    .dash-quick { grid-template-columns: repeat(3, 1fr) !important; gap: 6px !important; margin-bottom: 9px !important; }
    .dqc { padding: 8px 9px; border-radius: 10px; }
    .dqc .q-lbl { font-size: 11px; }
    .dqc .q-amt { font-size: 12.5px; margin-top: 3px; }
    .dqc .q-sub { font-size: 10.5px; }
}
@media (max-width: 420px) {
    .page-h > div { width: 100%; }
}

/* 工作台·我的线路订单：7 项快捷统计卡（桌面自适应列；手机端在媒体块内覆盖为 3 列） */
.dash-quick { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
@media (max-width: 1200px) { .dash-quick { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.dqc { display: block; background: #fff; border: 1px solid #e2e8f0; border-radius: 11px; padding: 9px 10px; text-decoration: none; transition: .15s; }
.dqc:hover { border-color: #86efac; }
.dqc.on { background: #14532d; border-color: #14532d; }
.dqc .q-lbl { display: block; font-size: 12px; color: #64748b; white-space: nowrap; }
.dqc .q-amt { display: block; font-size: 14px; font-weight: 800; color: #0f172a; margin-top: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dqc .q-sub { display: block; font-size: 11px; color: #94a3b8; margin-top: 1px; white-space: nowrap; }
.dqc.on .q-lbl { color: #dcfce7; }
.dqc.on .q-amt { color: #fff; }
.dqc.on .q-sub { color: #bbf7d0; }

/* 排期 / 线路 页头：标题与右侧按钮强制同一行（≤768px） */
@media (max-width: 768px) {
    .page-h-edge { flex-direction: row !important; align-items: center !important; justify-content: space-between !important; flex-wrap: nowrap !important; gap: 6px !important; box-sizing: border-box !important; width: 100% !important; }
    .page-h-edge h2 { flex: 1 1 auto; min-width: 0; font-size: 12.5px !important; line-height: 1.35; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .page-h-edge > div { width: auto !important; flex: 0 0 auto !important; }
    .page-h-edge .btn { font-size: 11px !important; padding: 4px 8px !important; line-height: 1.5; white-space: nowrap; }
    /* 分页器：窄屏下统一字号与间距，避免高低错落 */
    .ws-pager { display: flex !important; flex-wrap: wrap !important; align-items: center !important; justify-content: center !important; gap: 6px !important; margin-top: 12px !important; }
    .ws-pager a { font-size: 12px !important; padding: 5px 9px !important; line-height: 1.4 !important; border-radius: 7px !important; }
    .ws-pager span { font-size: 11.5px !important; }
}
