/* ============================================================
   DSH 前端修复：输入框被 addonBefore 标签挤压、框内内容不可见
   ------------------------------------------------------------
   现象（修复前实测，1404px 视口）：
     addon「应用名称」占 79px，整组只有 95px → 输入框只剩 16px，
     值「坤控」「65 MB」「2026」等全部看不到；页面放大后更严重。
   原因：antd 的 .ant-input-group 用 display:table，标签是 width:1px 的
         表单元格且 nowrap，容器一窄就把输入框压没。
   修法：改成 flex 布局 —— 标签保持自然宽度；输入框最小 6em；
         一行放不下就自动换行（标签一行、输入框一行占满），内容始终可见。
   注：antd v5 的样式是运行时 CSS-in-JS 注入的，注入顺序在本文件之后，
       所以这里必须用 !important 才能稳定生效。
   ============================================================ */

.ant-input-group-wrapper {
  width: 100% !important;
  max-width: 100% !important;
}

.ant-input-group {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: stretch !important;
  border-collapse: separate !important;
}

/* 标签：按内容自然宽度，不换行、不被压缩、不被裁字 */
.ant-input-group > .ant-input-group-addon {
  flex: 0 0 auto !important;
  width: max-content !important;
  min-width: max-content !important;
  max-width: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  text-align: center !important;
}

/* 输入框：至少 6em 可用宽度，放不下时自己换到下一行并占满整行 */
.ant-input-group > .ant-input,
.ant-input-group > .ant-input-affix-wrapper,
.ant-input-group > .ant-select,
.ant-input-group > .ant-input-number,
.ant-input-group > .ant-picker {
  flex: 1 1 6em !important;
  min-width: 6em !important;
  width: auto !important;
  max-width: 100% !important;
}

/* 标签与输入框同行时，避免两条边框叠成双线 */
.ant-input-group > .ant-input-group-addon + .ant-input,
.ant-input-group > .ant-input-group-addon + .ant-input-affix-wrapper {
  margin-left: -1px !important;
}

/* 浏览器放大（等效视口变窄）时，成对出现的 12 栅格字段改为整行显示 */
@media (max-width: 1100px) {
  .ant-row > .ant-col-12 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
}
