/* 数制云 H5 样式整合复核 v6 — CSS only. No route, permission or form logic changes.
   Requires the static form classes included in this patch. Keep after the sidebar link.
   The high specificity is intentional: lazy component CSS may load after this file. */
html#htmlRoot { --szy-final-style-version: 6; }

/* Navigation drawers are not business dialogs. Keep the native mask/click/slide behavior. */
html#htmlRoot:not([data-theme="dark"]) .ant-drawer.jeecg-layout-sider-wrapper > .ant-drawer-content-wrapper {
  width: min(232px, calc(100vw - 56px)) !important;
  max-width: calc(100vw - 56px) !important;
  height: 100% !important;
}
html#htmlRoot:not([data-theme="dark"]) .ant-drawer.jeecg-layout-sider-wrapper :is(.ant-drawer-content,.ant-drawer-wrapper-body) {
  height: 100%; border-radius: 0 !important; overflow: hidden;
}
html#htmlRoot:not([data-theme="dark"]) .ant-drawer.jeecg-layout-sider-wrapper .ant-drawer-header-no-title { display: none !important; }
html#htmlRoot:not([data-theme="dark"]) .ant-drawer.jeecg-layout-sider-wrapper .ant-drawer-body {
  padding: 0 !important; height: 100% !important; min-height: 0; overflow: hidden;
}
html#htmlRoot:not([data-theme="dark"]) .ant-drawer.jeecg-layout-sider-wrapper .ant-layout-sider {
  width: 100% !important; min-width: 0 !important; max-width: none !important; flex-basis: auto !important;
  position: relative !important; height: 100%; top: 0 !important;
}
html#htmlRoot:not([data-theme="dark"]) .ant-layout-sider-collapsed .jeecg-menu {
  overflow-x: hidden;
}
html#htmlRoot:not([data-theme="dark"]) .jeecg-menu-menu-popover .ant-popover-inner-content {
  max-height: calc(100dvh - 32px); overflow-y: auto; overflow-x: hidden;
}

/* Only opt-in data entry forms become the H5 two-column grid. Query/search forms remain unchanged.
   display:contents is intentionally NOT !important: v-show="false" must still hide a row. */
html#htmlRoot:not([data-theme="dark"]) form:is(.szy-v6-form-grid,.szy-v6-form-stack) {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 19px;
  width: 100%; min-width: 0; margin: 0 !important; padding: 0 !important; align-content: start;
}
html#htmlRoot:not([data-theme="dark"]) form.szy-v6-form-stack { grid-template-columns: minmax(0,1fr); }
html#htmlRoot:not([data-theme="dark"]) form:is(.szy-v6-form-grid,.szy-v6-form-stack) > .ant-row:not(.ant-form-item) { display: contents; }
html#htmlRoot:not([data-theme="dark"]) form:is(.szy-v6-form-grid,.szy-v6-form-stack) > .ant-row:not(.ant-form-item) > .ant-col {
  width: auto !important; min-width: 0; max-width: none !important; flex: none !important; padding: 0 !important;
}
html#htmlRoot:not([data-theme="dark"]) form:is(.szy-v6-form-grid,.szy-v6-form-stack) > .ant-row > .ant-col:has(textarea,.ant-upload,.ant-table,.ant-tag,.ant-divider,.ant-tree,.szy-v6-full),
html#htmlRoot:not([data-theme="dark"]) form:is(.szy-v6-form-grid,.szy-v6-form-stack) > .ant-form-item:has(textarea,.ant-upload,.ant-table,.ant-tag,.ant-divider,.ant-tree,.szy-v6-full) {
  grid-column: 1 / -1;
}
html#htmlRoot:not([data-theme="dark"]) form:is(.szy-v6-form-grid,.szy-v6-form-stack) .ant-form-item {
  width: 100%; min-width: 0; margin: 0 !important; padding: 0; flex-direction: column; align-items: stretch;
}
html#htmlRoot:not([data-theme="dark"]) form:is(.szy-v6-form-grid,.szy-v6-form-stack) .ant-form-item-label {
  flex: none !important; width: 100% !important; max-width: 100% !important;
  padding: 0 0 9px !important; text-align: left; line-height: 18px; white-space: normal; overflow: visible;
}
html#htmlRoot:not([data-theme="dark"]) form:is(.szy-v6-form-grid,.szy-v6-form-stack) .ant-form-item-label > label {
  height: auto !important; min-height: 0 !important; color: #65728a; font-size: 12px; line-height: 18px; align-items: flex-start;
}
html#htmlRoot:not([data-theme="dark"]) form:is(.szy-v6-form-grid,.szy-v6-form-stack) .ant-form-item-label > label::after { content: ""; margin: 0; }
html#htmlRoot:not([data-theme="dark"]) form:is(.szy-v6-form-grid,.szy-v6-form-stack) .ant-form-item-control {
  flex: 1 1 auto !important; width: 100% !important; min-width: 0 !important; max-width: 100% !important;
}

html#htmlRoot:not([data-theme="dark"]) form:is(.szy-v6-form-grid,.szy-v6-form-stack) :is(.ant-input:not(textarea),.ant-input-affix-wrapper:not(.ant-input-textarea-affix-wrapper):not(.ant-input-affix-wrapper-textarea-with-clear-btn),.ant-picker,.ant-input-number) {
    box-sizing: border-box;  font-size: 12px;
}

html#htmlRoot:not([data-theme="dark"]) form:is(.szy-v6-form-grid,.szy-v6-form-stack) .ant-select:not(.ant-select-customize-input) .ant-select-selector {
    box-sizing: border-box;  font-size: 12px;
}

html#htmlRoot:not([data-theme="dark"]) form:is(.szy-v6-form-grid,.szy-v6-form-stack) :is(.ant-picker-input > input,.ant-input-number-input) { font-size: 12px; }

html#htmlRoot:not([data-theme="dark"]) form:is(.szy-v6-form-grid,.szy-v6-form-stack) textarea.ant-input {   font-size: 12px;   }
html#htmlRoot:not([data-theme="dark"]) form:is(.szy-v6-form-grid,.szy-v6-form-stack) .ant-form-item-control-input-content > div[style*="flex"] {
  min-width: 0; align-items: flex-start;
}
html#htmlRoot:not([data-theme="dark"]) form:is(.szy-v6-form-grid,.szy-v6-form-stack) .ant-form-item-control-input-content > div[style*="flex"] > :is(.ant-select,.ant-input) { min-width: 0; flex: 1 1 0; }
html#htmlRoot:not([data-theme="dark"]) form:is(.szy-v6-form-grid,.szy-v6-form-stack) .ant-form-item-control-input-content > div[style*="flex"] > .ant-btn { flex: 0 0 auto; min-height: 39px; }
html#htmlRoot:not([data-theme="dark"]) form:is(.szy-v6-form-grid,.szy-v6-form-stack) .ant-form-item-explain { position: static; white-space: normal; line-height: 20px; font-size: 12px; }
html#htmlRoot:not([data-theme="dark"]) form:is(.szy-v6-form-grid,.szy-v6-form-stack) .ant-table-wrapper { max-width: 100%; min-width: 0; overflow-x: auto; }

/* Preserve the three original inspection-plan steps, grid only the basic fields. */
html#htmlRoot:not([data-theme="dark"]) .szy-v6-plan-form #step1 .page-check-add-right-plan > [clas="content-paln"] {
  display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 19px; padding: 20px;
}
html#htmlRoot:not([data-theme="dark"]) .szy-v6-plan-form #step1 [clas="content-paln"] > .ant-row { padding: 0 !important; min-width: 0; }
html#htmlRoot:not([data-theme="dark"]) .szy-v6-plan-form #step1 [clas="content-paln"] > .ant-row > .ant-col { width: 100%; max-width: 100%; flex: 1; }
html#htmlRoot:not([data-theme="dark"]) .szy-v6-plan-form #step1 .ant-form-item { flex-direction: column; margin-bottom: 0 !important; }
html#htmlRoot:not([data-theme="dark"]) .szy-v6-plan-form #step1 :is(.ant-form-item-label,.ant-form-item-control) { flex: none; width: 100%; max-width: 100%; text-align: left; }
html#htmlRoot:not([data-theme="dark"]) .szy-v6-plan-form #step1 .ant-form-item-label { padding-bottom: 9px; }
html#htmlRoot:not([data-theme="dark"]) .szy-v6-plan-form #step1 .ant-form-item-label > label { min-height: 0; }

/* Modal shell: one body scroller, intact footer, safe full-screen state and long titles. */
html#htmlRoot:not([data-theme="dark"]) body:has(.szy-business-v5,.szy-workbench) .ant-modal-title { padding-right: 70px; overflow-wrap: anywhere; }
html#htmlRoot:not([data-theme="dark"]) body:has(.szy-business-v5,.szy-workbench) .ant-modal-body .jeecg-modal-content > .scrollbar { padding: 0 !important; }
html#htmlRoot:not([data-theme="dark"]) body:has(.szy-business-v5,.szy-workbench) .ant-modal-footer,
html#htmlRoot:not([data-theme="dark"]) body:has(.szy-business-v5,.szy-workbench) .ant-modal-footer > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
html#htmlRoot:not([data-theme="dark"]) body:has(.szy-business-v5,.szy-workbench) .ant-modal-footer .ant-btn + .ant-btn { margin-left: 0; }
html#htmlRoot:not([data-theme="dark"]) body:has(.szy-business-v5,.szy-workbench) .ant-modal.fullscreen-modal .ant-modal-body,
html#htmlRoot:not([data-theme="dark"]) body:has(.szy-business-v5,.szy-workbench) .fullscreen-modal .ant-modal-body { max-height: calc(100dvh - 152px); }
html#htmlRoot:not([data-theme="dark"]) body:has(.szy-business-v5,.szy-workbench) .jeecg-basic-drawer:not(.jeecg-layout-sider-wrapper) .jeecg-basic-drawer-footer {
  padding: 12px 24px; min-height: 60px; height: auto !important; line-height: normal !important;
  display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px;
  left: 0; right: 0; width: auto; border-top: 1px solid #e9edf4; background: #fff; z-index: 4;
}

@media (max-width: 760px) {
  /* Native nested selectors also use percentage widths (70%); fit the phone, not that desktop ratio. */
  html#htmlRoot:not([data-theme="dark"]) body:has(.szy-business-v5,.szy-workbench) .ant-modal-wrap:not(.fullscreen-modal) .ant-modal:not(.fullscreen-modal) { width: calc(100vw - 24px) !important; max-width: calc(100vw - 24px) !important; }
  html#htmlRoot:not([data-theme="dark"]) form:is(.szy-v6-form-grid,.szy-v6-form-stack) { grid-template-columns: minmax(0,1fr); gap: 16px; }
  html#htmlRoot:not([data-theme="dark"]) .szy-v6-plan-form #step1 .page-check-add-right-plan > [clas="content-paln"] { grid-template-columns: minmax(0,1fr); gap: 16px; padding: 16px; }
  html#htmlRoot:not([data-theme="dark"]) body:has(.szy-business-v5,.szy-workbench) .ant-modal-title { padding-right: 64px; }
  html#htmlRoot:not([data-theme="dark"]) body:has(.szy-business-v5,.szy-workbench) .ant-modal-footer { padding: 14px 16px; }
  html#htmlRoot:not([data-theme="dark"]) body:has(.szy-business-v5,.szy-workbench) .jeecg-basic-drawer:not(.jeecg-layout-sider-wrapper) .jeecg-basic-drawer-footer { padding: 12px 16px; }
}

/* Composite controls: inner inputs must not increase the outer control height. */



/* Fullscreen must outrank the ordinary 800px -> 740px modal mapping. */
html#htmlRoot:not([data-theme="dark"]) body:has(.szy-business-v5,.szy-workbench) .ant-modal.fullscreen-modal,
html#htmlRoot:not([data-theme="dark"]) body:has(.szy-business-v5,.szy-workbench) .fullscreen-modal .ant-modal {
  width: 100vw !important; min-width: 0 !important; max-width: 100vw !important;
  margin: 0 !important; left: 0 !important; top: 0 !important; padding-bottom: 0 !important;
}

/* The compact title has its own native blue ::before, separate from expanded leaf ::after. */
html#htmlRoot:not([data-theme="dark"]) .jeecg-layout-sideBar.ant-layout-sider-collapsed .jeecg-menu-submenu-title.jeecg-menu-submenu-active-border::before {
  content: "" !important; display: block !important; position: absolute;
  background: #302cbd !important; width: 3px !important; height: 16px !important;
  left: 0 !important; top: 50% !important; bottom: auto !important;
  border: 0 !important; border-radius: 4px; transform: translateY(-50%) !important;
}
