/* Layout only: keep the existing authorized menus, forms and event handlers. */
html body .yunnei-layout { min-width: 0; height: 100dvh; overflow-x: hidden; }
html body .yunnei-body, html body .yunnei-content { min-width: 0; }
html body .yunnei-content > *, html body .ant-card-body, html body .ant-col { min-width: 0; }

@media (max-width: 1100px) {
  html body .yunnei-header {
    height: auto; min-height: 56px; overflow: visible;
    flex-wrap: wrap; gap: 8px 12px; padding: 10px 14px;
  }
  html body .yunnei-module-nav { flex: 1 1 120px; }
  html body .yunnei-module-trigger { min-width: 0; max-width: 100%; min-height: 36px; }
  html body .yunnei-header-right {
    flex: 1 1 100%; width: 100%; min-width: 0;
    flex-wrap: wrap; gap: 6px; overflow: visible;
  }
  html body .yunnei-header-right > * { flex-shrink: 0; max-width: 100%; }
  html body .yunnei-header-right button { white-space: nowrap; min-height: 36px; }
  html body .yunnei-user { margin-inline-start: auto; min-height: 36px; }
  html body .yunnei-org-select { max-width: 160px; }
  html body .yunnei-content { padding: 14px 14px 88px; scroll-padding-bottom: 72px; }
  html body:has(.ant-modal-wrap:not([style*="display: none"])) #yunheng-ai-widget,
  html body:has(.ant-drawer-open) #yunheng-ai-widget { visibility: hidden; }
  html body .yunnei-content .ant-table-wrapper { width: 100%; min-width: 0; }
  html body .yunnei-content .ant-table-container { min-width: 0; }
  html body .yunnei-content .ant-table-content, html body .ant-modal .ant-table-content, html body .ant-drawer .ant-table-content { max-width: 100%; overflow-x: auto !important; overscroll-behavior-x: contain; }
  html body .yunnei-content .ant-table-content > table, html body .ant-modal .ant-table-content > table, html body .ant-drawer .ant-table-content > table { min-width: 680px; }
  html body .yunnei-content .ant-table-body { max-width: 100%; overscroll-behavior-x: contain; }
  html body .yunnei-content .ant-pagination { flex-wrap: wrap; row-gap: 8px; }
  html body .yunnei-content .ant-card-head { padding: 12px 16px; }
  html body .yunnei-content .ant-card-head-wrapper { flex-wrap: wrap; gap: 8px; }
  html body .yunnei-content .ant-card-extra { margin-inline-start: 0; min-width: 0; max-width: 100%; }
  html body .yunnei-content .ant-card-head-title { white-space: normal; }
  html body .yunnei-content .ant-space-horizontal { flex-wrap: wrap; }
  html body .yunnei-content .ant-pro-table-list-toolbar-container,
  html body .yunnei-content .ant-pro-table-list-toolbar-right { flex-wrap: wrap; gap: 8px; }
  html body .yunnei-content .ant-pro-table-list-toolbar-left,
  html body .yunnei-content .ant-pro-table-list-toolbar-right { min-width: 0; max-width: 100%; }
  html body .yunnei-content .ant-form-inline { gap: 8px; }
  html body .yunnei-content .ant-form-inline > .ant-form-item { flex: 1 1 180px; min-width: 0; margin-inline-end: 0; }
  html body .yunnei-content .ant-form-item-control-input-content > .ant-select,
  html body .yunnei-content .ant-form-item-control-input-content > .ant-picker { max-width: 100%; }
  html body .yunnei-content .ant-descriptions-view { overflow-x: auto; }
}

@media (max-width: 800px) {
  html body .yunnei-body { flex-direction: column; }
  html body .yunnei-user-main { width: 100%; min-width: 0; }
  html body .yunnei-content .ant-input-affix-wrapper, html body .yunnei-content .ant-input-search, html body .yunnei-content .ant-select { max-width: 100%; }
  html body .yunnei-side-primary, html body .yunnei-side-primary.wide {
    width: 100%; max-width: 100%; flex-direction: row;
    padding: 6px; gap: 4px; overflow-x: auto; overflow-y: hidden;
    border-right: 0; border-bottom: 1px solid var(--yn-border);
    overscroll-behavior-x: contain;
  }
  html body .yunnei-side-primary .yunnei-side-item,
  html body .yunnei-side-primary.wide .yunnei-side-item {
    flex: 0 0 auto; min-height: 44px; flex-direction: row;
    padding: 8px 12px; white-space: nowrap; font-size: 13px;
  }
  html body .yunnei-side-secondary {
    width: 100%; max-width: 100%; display: flex; align-items: center;
    gap: 4px; padding: 6px; overflow-x: auto; overflow-y: hidden;
    border-right: 0; border-bottom: 1px solid var(--yn-border);
    overscroll-behavior-x: contain;
  }
  html body .yunnei-side-group-title { flex: none; padding: 0 8px; margin: 0; white-space: nowrap; }
  html body .yunnei-side-leaf { flex: none; width: auto; min-height: 44px; padding: 8px 12px; margin: 0; white-space: nowrap; }
  html body .yunnei-content { flex: 1 1 0; min-height: 0; padding: 12px 12px 88px; }
  html body .yunnei-page-location { flex-wrap: wrap; overflow-wrap: anywhere; }
  html body .yunnei-content .ant-card-body { padding: 16px; }
  html body .yunnei-content .ant-pro-table-search { padding: 12px 12px 0; }
  html body .ant-modal { max-width: calc(100vw - 16px); margin-inline: auto; top: 12px; padding-bottom: 12px; }
  html body .ant-modal .ant-modal-content { padding: 16px; }
  html body .ant-modal .ant-modal-body { max-height: calc(100dvh - 180px); overflow-y: auto; overscroll-behavior: contain; }
  html body .ant-modal .ant-modal-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
  html body .ant-modal .ant-modal-footer > button { margin-inline-start: 0 !important; min-height: 40px; }
  html body .ant-drawer-content-wrapper { max-width: 100vw; }
}

@media (max-width: 600px) {
  html body .yunnei-header { padding: 8px 10px; }
  html body .yunnei-header-right { gap: 4px; }
  html body .yunnei-header-right .yunnei-user > span:last-child { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html body .yunnei-content .ant-row:not(.ant-form-item) > .ant-col:not(.ant-col-24) { flex: 0 0 100%; max-width: 100%; }
  html body .yunnei-content .ant-form-inline > .ant-form-item { flex-basis: 100%; }
  html body .ant-modal .ant-form-item .ant-col { flex: 0 0 100%; max-width: 100%; }
  html body .ant-modal .ant-row:not(.ant-form-item) > .ant-col { flex: 0 0 100%; max-width: 100%; }
  html body .ant-modal .ant-form-item-label { text-align: start; padding-bottom: 4px; }
  html body .yunnei-content .ant-tabs-nav { max-width: 100%; }
}
