/* Buyer wallet page — mobile/web only (< xl / 1200px). PC layout unchanged. */

@media (max-width: 1199.98px) {
    section.py-5:has(.fw-wallet) {
        padding-top: 0 !important;
        padding-bottom: 16px !important;
    }

    /* 内容较少时页脚紧跟内容，避免 margin-top:auto 撑出大片空白 */
    .aiz-main-wrapper:has(.fw-wallet) .fw-mobile-footer {
        margin-top: 0;
    }

    section.py-5:has(.fw-wallet) .container {
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
    }

    section.py-5:has(.fw-wallet) .aiz-user-panel {
        padding-left: 0;
        padding-right: 0;
    }

    .fw-wallet {
        padding: 12px 12px 16px;
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .fw-wallet__titlebar-pc {
        display: none !important;
    }

    /* Mobile page header */
    .fw-wallet__hero {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 4px 4px 0;
        margin: 0;
    }

    .fw-wallet__hero-icon {
        width: 44px;
        height: 44px;
        border-radius: 12px;
        background: linear-gradient(135deg, var(--primary, #e62d04), #ff6b35);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 22px;
        flex-shrink: 0;
        box-shadow: 0 4px 12px rgba(230, 45, 4, 0.25);
    }

    .fw-wallet__hero-title {
        margin: 0;
        font-size: 20px;
        font-weight: 700;
        color: #1a1a2e;
    }

    /* Balance + actions */
    .fw-wallet__top {
        display: flex;
        flex-wrap: wrap;
        margin: 0 !important;
        gap: 12px;
    }

    .fw-wallet__top > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 0 !important;
        margin: 0 !important;
    }

    .fw-wallet__balance-card {
        border-radius: 16px !important;
        box-shadow: 0 8px 24px rgba(230, 45, 4, 0.2);
    }

    .fw-wallet__balance-card .size-30px {
        width: 48px !important;
        height: 48px !important;
        margin-top: 20px !important;
    }

    .fw-wallet__balance-card .h4 {
        font-size: 28px !important;
        margin-bottom: 4px;
    }

    .fw-wallet__balance-card .opacity-50 {
        font-size: 13px;
        margin-bottom: 4px;
    }

    /* Action buttons side by side when 2 items */
    .fw-wallet__top:has(.fw-wallet__action:nth-child(3)) .fw-wallet__action {
        flex: 1 1 calc(50% - 6px);
        max-width: calc(50% - 6px);
    }

    .fw-wallet__top:not(:has(.fw-wallet__action:nth-child(3))) .fw-wallet__action {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .fw-wallet__action-card {
        border-radius: 14px !important;
        margin: 0 !important;
        padding: 16px 12px !important;
        min-height: 112px;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(0, 0, 0, 0.06);
    }

    .fw-wallet__action-card .size-60px {
        width: 48px !important;
        height: 48px !important;
        margin-bottom: 10px !important;
    }

    .fw-wallet__action-card .size-60px i {
        font-size: 1.5rem !important;
    }

    .fw-wallet__action-card .fs-18 {
        font-size: 13px !important;
        font-weight: 600;
        line-height: 1.35;
    }

    .fw-wallet__action-card--withdraw {
        box-shadow: 0 6px 20px rgba(230, 45, 4, 0.25);
    }

    .fw-wallet__action-card:active {
        transform: scale(0.98);
    }

    /* History cards */
    .fw-wallet__section {
        border: none;
        border-radius: 14px;
        box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
        margin: 0 !important;
        overflow: hidden;
    }

    .fw-wallet__section + .fw-wallet__section {
        margin-top: 0 !important;
    }

    .fw-wallet__section .card-header {
        background: #fafbfc;
        border-bottom: 1px solid #eef1f5;
        padding: 14px 16px;
    }

    .fw-wallet__section .card-header h5 {
        font-size: 15px;
        font-weight: 600;
        color: #1e293b;
    }

    .fw-wallet__section .card-body {
        padding: 12px;
    }

    .fw-wallet__empty {
        text-align: center;
        color: #94a3b8;
        padding: 16px 12px;
        font-size: 14px;
    }

    /* Table → card list */
    .fw-wallet__table-wrap {
        overflow: visible;
    }

    .fw-wallet__table thead {
        display: none;
    }

    .fw-wallet__table tbody tr {
        display: flex;
        flex-direction: column;
        background: #fff;
        border: 1px solid #eef1f5;
        border-radius: 12px;
        padding: 12px 14px;
        margin: 0 0 12px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    }

    .fw-wallet__table tbody tr:last-child {
        margin-bottom: 0;
    }

    .fw-wallet__table tbody td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        padding: 6px 0 !important;
        border: none !important;
        font-size: 13px;
        text-align: left !important;
    }

    .fw-wallet__table tbody td::before {
        content: attr(data-label);
        flex-shrink: 0;
        font-weight: 600;
        color: #64748b;
        font-size: 12px;
        min-width: 72px;
    }

    .fw-wallet__table tbody td[data-label="#"] {
        display: none;
    }

    .fw-wallet__table tbody td.fw-wallet__cell-amount {
        order: -1;
        font-weight: 700;
        color: var(--primary, #e62d04);
        font-size: 18px;
        padding-top: 0 !important;
        border-bottom: 1px solid #f0f2f5;
        margin-bottom: 4px;
        padding-bottom: 10px !important;
    }

    .fw-wallet__table tbody td.fw-wallet__cell-amount::before {
        font-size: 11px;
        font-weight: 500;
    }

    .fw-wallet__table .badge {
        margin-left: auto;
    }

    .fw-wallet .aiz-pagination {
        padding: 8px 0 0;
        margin: 0;
        justify-content: center;
    }

    .fw-wallet .aiz-pagination .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }

    /* Modals */
    .fw-wallet-modal .modal-dialog {
        margin: 0;
        max-width: 100%;
        min-height: 100%;
        display: flex;
        align-items: flex-end;
    }

    .fw-wallet-modal .modal-content {
        border: none;
        border-radius: 16px 16px 0 0;
        width: 100%;
        max-height: 92vh;
        overflow-y: auto;
    }

    .fw-wallet-modal .modal-header {
        position: sticky;
        top: 0;
        z-index: 2;
        background: #fff;
        border-bottom: 1px solid #eef1f5;
        padding: 16px 18px;
    }

    .fw-wallet-modal .modal-title {
        font-size: 16px;
        font-weight: 700;
    }

    .fw-wallet-modal .modal-body {
        padding: 16px 18px calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .fw-wallet__modal-balance {
        border-radius: 10px;
        margin-bottom: 16px;
    }

    .fw-wallet__form-row {
        flex-direction: column;
    }

    .fw-wallet__form-row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
    }

    .fw-wallet__form-row label {
        display: block;
        font-size: 13px;
        font-weight: 600;
        color: #475569;
        margin-bottom: 6px;
    }

    .fw-wallet__form-row .form-control {
        border-radius: 10px;
        min-height: 44px;
    }

    .fw-wallet__form-row textarea.form-control {
        min-height: 100px;
    }

    .fw-wallet__modal-footer {
        text-align: center !important;
        margin-top: 8px;
    }

    .fw-wallet__modal-footer .btn {
        width: 100%;
        min-height: 46px;
        border-radius: 10px;
        font-size: 15px;
        font-weight: 600;
    }
}
