﻿/* xia-admin mobile enhancement - verified mobile patch 2026-05-18 */
@media (max-width: 768px) {
  html,
  body,
  #root {
    width: 100%;
    min-width: 0 !important;
    overflow-x: hidden;
  }

  body {
    background: #f5f7fb;
  }

  .app-shell,
  .ant-layout {
    min-width: 0 !important;
    width: 100% !important;
  }

  .app-sider.ant-layout-sider,
  aside.ant-layout-sider,
  .ant-layout-sider,
  .ant-layout-sider-children {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    flex: 0 0 0 !important;
    overflow: hidden !important;
  }

  .app-header {
    position: sticky;
    top: 0;
    z-index: 18;
    min-height: 52px !important;
    padding: 8px 10px !important;
    gap: 8px !important;
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  }

  .app-header .ant-space {
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .app-header .ant-btn {
    height: 34px;
    padding-inline: 10px;
  }

  .app-content,
  main.ant-layout-content {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 10px !important;
    overflow-x: hidden;
  }

  .module-stack {
    width: 100%;
    max-width: 100%;
    gap: 10px !important;
  }

  .hero-panel {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 16px !important;
    border-radius: 14px !important;
    margin-bottom: 12px !important;
    overflow: hidden;
  }

  .hero-panel > * {
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .hero-panel h1,
  .hero-panel h2,
  .hero-title,
  .hero-title.ant-typography {
    font-size: 22px !important;
    line-height: 1.25 !important;
    margin-bottom: 6px !important;
    word-break: normal;
  }

  .hero-description,
  .hero-description.ant-typography,
  .hero-panel .ant-typography-secondary {
    font-size: 13px !important;
    line-height: 1.55 !important;
  }

  .hero-stats {
    width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-top: 12px !important;
  }

  .hero-stats > *,
  .hero-stats div {
    min-width: 0 !important;
    padding: 10px 12px !important;
    border-radius: 10px !important;
  }

  .hero-stats strong {
    font-size: 20px !important;
    line-height: 1.1 !important;
  }

  .module-toolbar,
  .finance-section-head,
  .platform-shop-head,
  .section-head,
  .toolbar-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .module-toolbar > *,
  .finance-section-head > *,
  .platform-shop-head > * {
    max-width: 100%;
    min-width: 0;
  }

  .module-toolbar .ant-space,
  .finance-section-head .ant-space,
  .platform-shop-head .ant-space {
    width: 100%;
    flex-wrap: wrap;
  }

  .ant-card,
  .timeline-card,
  .module-card {
    width: 100%;
    max-width: 100%;
    border-radius: 10px !important;
  }

  .ant-card-body {
    padding: 12px !important;
  }

  .ant-card-head {
    padding: 0 12px !important;
    min-height: 44px !important;
  }

  .ant-card-head-title {
    font-size: 15px !important;
    line-height: 1.4 !important;
  }

  .ant-row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    row-gap: 8px !important;
  }

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

  .ant-form-item {
    margin-bottom: 12px !important;
  }

  .ant-form-item-label {
    padding-bottom: 4px !important;
  }

  .ant-input,
  .ant-input-number,
  .ant-picker,
  .ant-select,
  .ant-select-selector,
  .ant-input-affix-wrapper,
  .ant-input-number-affix-wrapper,
  .ant-space-compact {
    width: 100% !important;
    min-width: 0 !important;
  }

  .ant-space,
  .ant-space-item {
    max-width: 100%;
  }

  .ant-space-wrap {
    row-gap: 8px !important;
  }

  .ant-table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .ant-table-wrapper .ant-table {
    min-width: 760px;
  }

  .ant-table-cell {
    padding: 8px !important;
    white-space: nowrap;
  }

  .ant-pagination {
    justify-content: flex-start !important;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .ant-modal {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    margin: 10px auto !important;
    top: 10px !important;
    padding-bottom: 10px !important;
  }

  .ant-modal-content {
    padding: 12px !important;
    border-radius: 12px !important;
  }

  .ant-modal-body {
    max-height: calc(100vh - 150px);
    overflow-y: auto;
  }

  .ant-modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px !important;
  }

  .ant-drawer-content-wrapper {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  .platform-shop-metrics,
  .finance-summary-grid,
  .admin-test-entry-grid,
  .selection-summary,
  .dashboard-grid {
    grid-template-columns: 1fr !important;
    min-width: 0 !important;
  }

  .amap-container,
  .location-map,
  .map-panel,
  .route-map {
    min-height: 360px !important;
  }
}

@media (max-width: 480px) {
  .app-content,
  main.ant-layout-content {
    padding: 8px !important;
  }

  .hero-panel {
    padding: 14px !important;
  }

  .hero-stats {
    grid-template-columns: 1fr !important;
  }

  .ant-table-wrapper .ant-table {
    min-width: 680px;
  }
}
