/* Consumer and substation mobile commerce v2. */
.commerce-sheet-backdrop,
.commerce-filter-sheet,
.commerce-detail-sheet { display: none; }

.commerce-state-pill { display: inline-flex; min-height: 24px; padding: 3px 9px; align-items: center; justify-content: center; border-radius: 999px; font-size: 11px; font-weight: 750; line-height: 1.2; white-space: nowrap; }
.commerce-state-pill.is-paid,
.commerce-state-pill.is-delivered { background: rgba(28,180,116,.12); color: #179965; }
.commerce-state-pill.is-unpaid,
.commerce-state-pill.is-pending { background: rgba(228,161,38,.13); color: #b57b12; }
.commerce-state-pill.is-auto { background: rgba(36,159,210,.12); color: #1886b5; }
.commerce-state-pill.is-manual { background: rgba(124,111,242,.12); color: #6e60d6; }
.tt-ai-record-actions { display: inline-flex; align-items: center; }
.tt-ai-record-actions a { display: inline-flex; min-height: 28px; padding: 4px 10px; align-items: center; justify-content: center; gap: 5px; border: 1px solid rgba(124,111,242,.23); border-radius: 8px; background: rgba(124,111,242,.09); color: #6e60d6; font-size: 12px; font-weight: 750; line-height: 1.2; text-decoration: none; white-space: nowrap; }

@media (max-width: 767px) {
    body.commerce-sheet-open { overflow: hidden; }
    .mf-page-shell-order .mf-main,
    .mf-page-shell-record .mf-main { padding-right: 12px !important; padding-left: 12px !important; padding-bottom: calc(82px + env(safe-area-inset-bottom)) !important; }
    .mf-page-shell-order .mf-panel,
    .mf-page-shell-record .mf-panel { padding: 10px !important; border-radius: 16px !important; box-shadow: none !important; }
    .mf-page-shell-order .mf-panel-heading,
    .mf-page-shell-record .mf-panel-heading { min-height: 34px; margin-bottom: 6px; font-size: 13px; }
    .mf-page-shell-order .fixed-table-toolbar,
    .mf-page-shell-record .fixed-table-toolbar { margin: 0 !important; }
    .mf-page-shell-order .table-search.commerce-search-ready,
    .mf-page-shell-record .table-search.commerce-search-ready { display: grid !important; width: 100%; margin: 0 0 8px !important; gap: 8px; grid-template-columns: minmax(0,1fr) 62px; }
    .table-search.commerce-search-ready > * { display: none !important; }
    .table-search.commerce-search-ready .commerce-primary-search,
    .table-search.commerce-search-ready .commerce-filter-trigger { display: block !important; width: 100% !important; margin: 0 !important; }
    .mf-page-shell-order .table-search.commerce-search-ready .commerce-query-submit { display: block !important; width: 100% !important; margin: 0 !important; grid-column: 1 / -1; }
    .commerce-primary-search { position: relative; }
    .commerce-primary-search::before { position: absolute; z-index: 2; top: 50%; left: 13px; color: var(--mf-text-muted,#8c8ba2); font-family: "Font Awesome 6 Pro"; content: "\f002"; transform: translateY(-50%); }
    .commerce-primary-search input { width: 100%; height: 42px; padding: 0 12px 0 36px; border: 1px solid var(--mf-line-soft,rgba(255,255,255,.1)); border-radius: 11px; background: var(--mf-bg-elevated,#1d1d25); color: var(--mf-text,#fff); font-size: 13px; outline: 0; }
    .commerce-filter-trigger button { width: 100%; height: 42px; border: 1px solid rgba(124,111,242,.3); border-radius: 11px; background: rgba(124,111,242,.12); color: #9b90ff; font-size: 12px; font-weight: 700; }
    .mf-page-shell-order .commerce-query-submit button { width: 100%; height: 44px; border: 0; border-radius: 11px; background: linear-gradient(135deg,#7869eb,#5e7cf6); color: #fff; font-size: 13px; font-weight: 750; box-shadow: none; }
    .mf-page-shell-order .commerce-query-submit button i { margin-right: 5px; }
    .mf-page-shell-order .table-switch-state,
    .mf-page-shell-record .table-switch-state { display: flex !important; position: sticky; z-index: 6; top: 0; width: 100%; margin: 0 0 9px !important; padding: 3px; gap: 3px; border: 1px solid var(--mf-line-soft,rgba(255,255,255,.1)); border-radius: 11px; background: color-mix(in srgb,var(--mf-bg-elevated,#1d1d25) 93%,transparent); backdrop-filter: blur(10px); }
    .mf-page-shell-order .table-switch-state button,
    .mf-page-shell-record .table-switch-state button { flex: 1; min-height: 32px; margin: 0 !important; padding: 4px 6px !important; border-radius: 8px !important; font-size: 11px !important; white-space: nowrap; }

    .commerce-sheet-backdrop { display: block; position: fixed; z-index: 2147482998; inset: 0; border: 0; background: rgba(3,4,12,.68); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
    .commerce-sheet-backdrop.is-open { opacity: 1; pointer-events: auto; }
    .commerce-filter-sheet,
    .commerce-detail-sheet { display: flex; position: fixed; z-index: 2147482999; right: 0; bottom: 0; left: 0; max-height: min(82vh,680px); padding: 0 14px calc(14px + env(safe-area-inset-bottom)); border: 1px solid var(--mf-line-soft,rgba(255,255,255,.1)); border-bottom: 0; border-radius: 18px 18px 0 0; background: var(--mf-bg-elevated,#17171e); box-shadow: 0 -14px 40px rgba(0,0,0,.34); flex-direction: column; transform: translateY(105%); transition: transform .24s ease; }
    .commerce-filter-sheet.is-open,
    .commerce-detail-sheet.is-open { transform: translateY(0); }
    .commerce-sheet-head { display: flex; min-height: 52px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--mf-line-soft,rgba(255,255,255,.1)); }
    .commerce-sheet-head strong { color: var(--mf-text,#fff); font-size: 15px; }
    .commerce-sheet-close { width: 34px; height: 34px; border: 0; border-radius: 9px; background: rgba(255,255,255,.07); color: var(--mf-text-secondary,#bbb); font-size: 20px; }
    .commerce-sheet-body { display: grid; min-height: 0; padding: 12px 0; gap: 10px; overflow-y: auto; }
    .commerce-sheet-body > .layui-input-inline { display: block !important; width: 100% !important; margin: 0 !important; }
    .commerce-sheet-body .layui-input,
    .commerce-sheet-body .layui-form-select,
    .commerce-sheet-body .layui-form-select input { width: 100% !important; min-height: 42px !important; border-radius: 10px !important; }
    .commerce-sheet-actions { display: grid; padding-top: 10px; gap: 8px; border-top: 1px solid var(--mf-line-soft,rgba(255,255,255,.1)); grid-template-columns: 1fr 1.6fr; }
    .commerce-sheet-actions button { min-height: 42px; border: 0; border-radius: 10px; font-size: 13px; font-weight: 700; }
    .commerce-filter-reset { background: rgba(255,255,255,.07); color: var(--mf-text-secondary,#bbb); }
    .commerce-filter-apply { background: linear-gradient(135deg,#7869eb,#5e7cf6); color: #fff; }

    .mf-page-shell-order .fixed-table-header,
    .mf-page-shell-record .fixed-table-header { display: none !important; }
    .mf-page-shell-order .fixed-table-body,
    .mf-page-shell-record .fixed-table-body { overflow: visible !important; }
    .mf-page-shell-order tbody > tr,
    .mf-page-shell-record tbody > tr,
    .mf-page-shell-order tbody > tr > td,
    .mf-page-shell-record tbody > tr > td { display: block !important; width: 100% !important; padding: 0 !important; border: 0 !important; }
    .mf-page-shell-order .card-views,
    .mf-page-shell-record .card-views { display: block !important; width: 100% !important; margin: 0 0 8px !important; padding: 11px 12px !important; border: 1px solid var(--mf-line-soft,rgba(255,255,255,.1)) !important; border-radius: 13px !important; background: var(--mf-bg-elevated,#1d1d25) !important; box-shadow: none !important; }
    .commerce-order-summary { min-width: 0; cursor: pointer; }
    .commerce-order-head { display: grid; min-width: 0; align-items: center; gap: 9px; grid-template-columns: 34px minmax(0,1fr) auto; }
    .commerce-order-icon { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; background: rgba(255,255,255,.06); }
    .commerce-order-title { display: -webkit-box; min-width: 0; overflow: hidden; color: var(--mf-text,#fff); font-size: 13px; font-weight: 750; line-height: 1.28; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
    .commerce-order-no { margin-top: 2px; overflow: hidden; color: var(--mf-text-muted,#8c8ba2); font-family: var(--mf-font-mono,ui-monospace); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
    .commerce-status { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 999px; background: rgba(255,184,0,.12); color: #e2a313; font-size: 10px; font-weight: 700; white-space: nowrap; }
    .commerce-status::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
    .commerce-status.is-paid { background: rgba(20,190,135,.12); color: #20c997; }
    .commerce-order-states { display: flex; max-width: 104px; align-items: flex-end; justify-content: center; gap: 3px; flex-direction: column; }
    .commerce-order-states .commerce-state-pill { min-height: 19px; padding: 2px 6px; font-size: 9px; }
    .commerce-order-core { display: grid; margin-top: 9px; align-items: center; gap: 7px; grid-template-columns: 1fr auto; }
    .commerce-order-amount { color: var(--mf-text,#fff); font-size: 16px; font-weight: 800; }
    .commerce-order-meta { color: var(--mf-text-muted,#8c8ba2); font-size: 10px; line-height: 1.5; text-align: right; }
    .commerce-order-foot { display: flex; margin-top: 8px; padding-top: 7px; align-items: center; justify-content: space-between; border-top: 1px solid var(--mf-line-soft,rgba(255,255,255,.1)); color: var(--mf-text-secondary,#bbb); font-size: 10px; }
    .commerce-order-link { color: #9b90ff; font-size: 11px; font-weight: 700; }
    .commerce-record-foot { display: grid; min-width: 0; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); }
    .commerce-record-foot > * { min-width: 0; align-self: center; }
    .commerce-delivery-state { justify-self: start; white-space: nowrap; }
    .commerce-order-ai { display: inline-flex; min-height: 25px; padding: 2px 7px; align-items: center; justify-content: center; justify-self: center; gap: 4px; border-radius: 7px; background: rgba(124,111,242,.1); color: #8b7cf0; font-size: 10px; font-weight: 750; line-height: 1; text-decoration: none; white-space: nowrap; }
    .commerce-record-foot .commerce-order-link { justify-self: end; text-align: right; white-space: nowrap; }

    @media (max-width: 360px) {
        .commerce-record-foot { gap: 3px; }
        .commerce-order-ai { padding-right: 5px; padding-left: 5px; font-size: 9px; }
        .commerce-record-foot .commerce-order-link { font-size: 10px; }
    }
    .mf-page-shell-order .commerce-order-head { align-items: center; column-gap: 9px; row-gap: 0; grid-template-rows: auto auto; }
    .mf-page-shell-order .commerce-order-icon { grid-column: 1; grid-row: 1 / 3; }
    .mf-page-shell-order .commerce-order-title { grid-column: 2 / 4; grid-row: 1; }
    .mf-page-shell-order .commerce-order-no { margin-top: 0; font-size: 11.5px; line-height: 1.2; grid-column: 2 / 4; grid-row: 2; }
    .mf-page-shell-order .commerce-order-core,
    .mf-page-shell-order .commerce-order-foot { display: grid; column-gap: 7px; grid-template-columns: repeat(3,minmax(0,1fr)); }
    .mf-page-shell-order .commerce-order-amount { justify-self: start; }
    .mf-page-shell-order .commerce-status { align-self: center; justify-self: end; justify-content: flex-end; text-align: right; }
    .mf-page-shell-order .commerce-order-meta { width: 88px; justify-self: center; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10.44px; text-align: center; white-space: nowrap; }
    .mf-page-shell-order .commerce-payment-row { display: flex; width: 88px; min-width: 0; align-items: center; justify-content: center; justify-self: center; gap: 6px; font-size: 9px; text-align: center; white-space: nowrap; }
    .mf-page-shell-order .commerce-order-link { display: flex; align-items: center; justify-content: flex-end; justify-self: end; gap: 6px; font-size: 12.5px; text-align: right; white-space: nowrap; }
    .commerce-order-details[hidden] { display: none !important; }
    .commerce-order-details { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--mf-line-soft,rgba(255,255,255,.1)); }
    .commerce-order-details .card-view { display: grid !important; min-width: 0; padding: 6px 0 !important; gap: 8px; border: 0 !important; grid-template-columns: 74px minmax(0,1fr); }
    .commerce-order-details .card-view-title { color: var(--mf-text-muted,#8c8ba2) !important; font-size: 10px !important; }
    .commerce-order-details .card-view-value { min-width: 0; color: var(--mf-text-secondary,#bbb) !important; font-size: 11px !important; overflow-wrap: anywhere; }
    .commerce-order-details .commerce-summary-source { display: none !important; }

    .commerce-detail-sheet .commerce-sheet-body { display: block; }
    .commerce-detail-product { display: grid; padding: 2px 0 14px; align-items: center; gap: 10px; grid-template-columns: 44px minmax(0,1fr); }
    .commerce-detail-product img { width: 44px; height: 44px; border-radius: 11px; object-fit: cover; }
    .commerce-detail-product strong { display: -webkit-box; overflow: hidden; color: var(--mf-text,#fff); font-size: 14px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
    .commerce-detail-product span { color: var(--mf-text-muted,#8c8ba2); font-family: var(--mf-font-mono,ui-monospace); font-size: 10px; overflow-wrap: anywhere; }
    .commerce-detail-grid { display: grid; padding: 10px 0; gap: 9px; border-top: 1px solid var(--mf-line-soft,rgba(255,255,255,.1)); grid-template-columns: 1fr 1fr; }
    .commerce-detail-grid div { min-width: 0; }
    .commerce-detail-grid small { display: block; color: var(--mf-text-muted,#8c8ba2); font-size: 10px; }
    .commerce-detail-grid span { display: block; margin-top: 2px; color: var(--mf-text-secondary,#bbb); font-size: 12px; overflow-wrap: anywhere; }
    .commerce-delivery-title { display: flex; margin-top: 5px; padding: 12px 0 8px; align-items: center; justify-content: space-between; border-top: 1px solid var(--mf-line-soft,rgba(255,255,255,.1)); color: var(--mf-text,#fff); font-size: 13px; font-weight: 800; }
    .commerce-secret-group { margin-bottom: 8px; padding: 10px; border: 1px solid var(--mf-line-soft,rgba(255,255,255,.1)); border-radius: 11px; background: rgba(255,255,255,.035); }
    .commerce-secret-group pre { max-height: 160px; margin: 0; padding: 0 !important; border: 0 !important; background: transparent !important; color: var(--mf-text-secondary,#bbb) !important; font: 11px/1.55 var(--mf-font-mono,ui-monospace); white-space: pre-wrap; overflow-wrap: anywhere; overflow-y: auto; }
    .commerce-copy { min-height: 30px; margin-top: 8px; padding: 0 10px; border: 1px solid rgba(124,111,242,.25); border-radius: 8px; background: rgba(124,111,242,.1); color: #9b90ff; font-size: 11px; font-weight: 700; }

    .public-order-query { padding: 12px !important; padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important; }
    .public-order-query > .panel:first-child .panel-header { padding-bottom: 4px; }
    .public-order-query > .panel:first-child .panel-body { padding-top: 8px; }
    .public-order-query .order-query-form .d-flex { display: grid !important; gap: 8px !important; grid-template-columns: minmax(0,1fr) 82px; }
    .public-order-query .order-query-form .d-flex > div { width: auto !important; }
    .public-order-query .order-query-form input { height: 42px; border-radius: 11px; font-size: 13px; }
    .public-order-query .order-query-form button { width: 100%; height: 42px; padding: 0 8px; border-radius: 11px; font-size: 12px; }
    .public-order-query .order-query-form button i { margin-right: 3px !important; }
    .public-order-query .order-results .panel-body { padding: 10px !important; }
    .public-order-query .order-item { margin-bottom: 8px !important; padding: 12px !important; border-radius: 13px !important; box-shadow: none !important; }
    .public-order-query .order-header { align-items: center !important; }
    .public-order-query .order-basic .payment-time,
    .public-order-query .order-basic .payment-dst { display: none; }
    .public-order-query .order-time { font-size: 10px !important; }
    .public-order-query .order-no { max-width: 190px; overflow: hidden; font-size: 10px !important; text-overflow: ellipsis; white-space: nowrap; }
    .public-order-query .amount-label { display: none; }
    .public-order-query .amount-value { font-size: 16px !important; }
    .public-order-query .goods-section { margin-top: 9px !important; padding-top: 9px !important; }
    .public-order-query .goods-image { width: 38px !important; height: 38px !important; border-radius: 9px !important; }
    .public-order-query .goods-name { display: -webkit-box; overflow: hidden; font-size: 13px !important; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
    .public-order-query .goods-meta { max-height: 25px; overflow: hidden; }
    .public-order-query .tt-ai-order-entry { min-height: 34px; margin-top: 8px; padding: 5px 10px; font-size: 11px; }
    .public-order-query .card-section { margin-top: 8px !important; padding: 9px !important; border-radius: 10px !important; }
    .public-order-query .card-display { max-height: 120px; overflow-y: auto; font-size: 11px !important; overflow-wrap: anywhere; }
}

@media (min-width: 768px) {
    .mf-page-shell-record .bootstrap-table .card-view:nth-child(10) { order: 10 !important; grid-column: 1 !important; padding-top: 0 !important; border-top: 0 !important; }
    .mf-page-shell-record .bootstrap-table .card-view:nth-child(11) { order: 11 !important; grid-column: 1 / -1 !important; padding-top: 20px !important; border-top: 1px dashed var(--mf-line-soft) !important; }
    .mf-page-shell-record .bootstrap-table .card-view:nth-child(12) { order: 12 !important; grid-column: 1 / -1 !important; padding-top: 20px !important; border-top: 1px dashed var(--mf-line-soft) !important; }
    .mf-page-shell-record .bootstrap-table .card-view:nth-child(11) .card-view-value { display: block !important; color: var(--mf-text-secondary) !important; font-size: 14px !important; line-height: 1.65 !important; }
    .mf-page-shell-record .bootstrap-table .card-view:nth-child(12) .card-view-value { display: grid !important; grid-template-columns: minmax(0,1fr) auto !important; align-items: end !important; gap: 12px !important; }
    .mf-page-shell-record .bootstrap-table .card-view:nth-child(12) .card-view-value > div { display: flex !important; justify-content: flex-end !important; margin-top: 0 !important; }
    .mf-page-shell-record .bootstrap-table .card-view:nth-child(12) .secret { width: 100% !important; min-height: 112px !important; height: 112px !important; padding: 14px 16px !important; border: 1px solid var(--mf-line-soft) !important; border-radius: 18px !important; background: rgba(255,255,255,.02) !important; color: var(--mf-text-secondary) !important; resize: none !important; }
}
