/* AMIS 主题(cxd.css)默认将 .amis-scope 的 body-size 映射到 14px，这里统一提升为 16px */
.amis-scope {
  --body-size: 16px;
  --fontSizeBase: 16px;
  font-size: 16px !important;
}

/* 站点端 body 下全屏弹层挂载点：与整页 amis 同源 .amis-scope 规则并存，须钉死透明底，否则会盖住 #app 呈「一片白」 */
#amis-site-modal-portal-scope.amis-scope {
  background: transparent !important;
  box-shadow: none !important;
}

/* Portal 根节点 pointer-events:none 以便空白区域点击穿透；Select/Modal 等挂在此处的浮层须恢复可点，否则会穿透到页面表单抢焦点 */
#amis-site-modal-portal-scope.amis-scope > * {
  pointer-events: auto;
}

/* 站点 AMIS 弹层 z-index:5000，须抬升 ElMessage 以免顶部错误提示被编辑弹窗挡住 */
body > .el-message {
  z-index: 5200 !important;
}

.cxd-Table-table th > .cxd-Form,
.cxd-Table-table th > .cxd-Form-item > .cxd-Form-control:not(.is-thin),
.cxd-Table-table td > .cxd-Form,
.cxd-Table-table td > .cxd-Form-item > .cxd-Form-control:not(.is-thin) {
  min-width: 80px !important;
}

/* 单元格 2px：border-box 让 padding 算进列宽，避免比 amis 列宽变量多出一块触发 overflow-x */
.cxd-Table-table {
  box-sizing: border-box;
}
.cxd-Table-table > thead > tr > th {
  box-sizing: border-box;
  padding: 6px 0 6px 6px !important;
  position: relative;
}
.cxd-Table-table > tbody > tr > td,
.cxd-Table-table > tbody > tr > th {
  box-sizing: border-box;
  padding: 2px !important;
  position: relative;
}
.cxd-TableSelection .cxd-Table-table > thead > tr > th,
.cxd-TableSelection .cxd-Table-table > tbody > tr > td {
  padding: 5px !important;
  position: relative;
}
.amis-scope .cxd-OperationField {
  margin: 0 !important;
}

/*
 * amis embed 在根节点内会包一层 .amis-routes-wrapper，官方为 width:100%; height:100%。
 * 宿主为 layout flex + el-scrollbar 时，父级常为 flex:1 而无「百分高度参照」，height:100% 易解析失败或与 Table autoFillHeight 测高形成反馈，高度持续收缩。
 * 改为 flex 列分配高度（父级须为 flex + column，见 amis-base.vue #根节点）。
 */
.amis-scope .amis-routes-wrapper {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: auto !important;
}

/* layout-main 内 AMIS 宿主与根节点：flex-basis 0 才能吃满父级，避免 height:100% 在 flex 列里仍按内容 865px 结算 */
.layout-main .layout-router-filler > .amis-box {
  flex: 1 1 0%;
  min-height: 100%;
  height: auto;
  align-items: stretch;
}
.layout-main .layout-router-filler > .amis-box > div.amis-scope {
  flex: 1 1 0% !important;
  min-height: 100% !important;
  height: auto !important;
  max-height: none !important;
  align-self: stretch;
  display: flex;
  flex-direction: column;
}

/* 让 Page（含带侧栏）吃满 routes-wrapper，避免内部 Table 测到异常高度 */
.amis-scope .amis-routes-wrapper > .cxd-Page {
  flex: 1;
  min-height: 0;
  min-width: 0;
}
/*
 * 无侧栏页：低代码若在 Page 根上写 style.display:block / position:static，会盖掉主题里 Page 的 flex，
 * 与 routes-wrapper（flex 列）衔接断裂，CRUD autoFillHeight 测高塌缩。用 !important 压过内联 display。
 */
.amis-scope .amis-routes-wrapper > .cxd-Page:not(.cxd-Page--withSidebar) {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
}
/* 兜底：侧栏页必须保持横向布局，避免 content 跑到 aside 下方 */
.amis-scope .cxd-Page.cxd-Page--withSidebar {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
}

/*
 * 带 aside时根为横向 flex，但 content→main→body→Crud 仍须在嵌套 flex 里带 min-height:0，
 * 否则与 el-scrollbar 同链时 CRUD 高度会塌成 0（仅对 :not(.Page--withSidebar) 写链时会出现）。
 */
.amis-scope .cxd-Page .cxd-Page-content {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
/*
 * 正文兜底 13px。themeCss / CustomStyle：排除带 baseControlClassName-* 的 cxd-Container、className-*；容器内子节点用 inherit。
 * baseControlClassName 仅在与 .cxd-Container 同时出现时视为 theme 容器（避免误伤仅有字符串匹配的节点）。
 * 用 :is(...) 合并标签 + .fr-view；继承段需带相同 :not，否则无类名 span 会输给首段。
 */
.amis-scope .amis-routes-wrapper :is(div, span, p, a, b, i, u, s, em, strong, .fr-view):not(.cxd-Container[class*='baseControlClassName']):not([class*='className-']) {
  font-size: 13px;
}
.amis-scope .amis-routes-wrapper .cxd-Container[class*='baseControlClassName'] :is(div, span, p, a, b, i, u, s, em, strong, .fr-view):not(.cxd-Container[class*='baseControlClassName']):not([class*='className-']):not(.cxd-Button) {
  font-size: inherit;
}
.amis-scope .amis-routes-wrapper [class*='className-'] :is(div, span, p, a, b, i, u, s, em, strong, .fr-view):not(.cxd-Container[class*='baseControlClassName']):not([class*='className-']):not(.cxd-Button) {
  font-size: inherit;
}

.amis-scope .cxd-ResultBox {
  font-size: 13px;
}

/*
 * 与 cxd 中「width:0 + flex-grow:1」同意图，但嵌套在 layout flex 里时易被同特异性规则打乱，出现 content 宽 0。
 * 提高特异性并 !important，且与官方一致仅在 >=768px（侧栏横向）生效。
 */
@media (min-width: 768px) {
  .amis-scope .amis-routes-wrapper > .cxd-Page.cxd-Page--withSidebar > .cxd-Page-content {
    flex: 1 1 auto !important;
    flex-grow: 1 !important;
    flex-shrink: 1 !important;
    flex-basis: auto !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
  }
  /* 部分嵌入场景 wrapper 与 Page 之间多一层节点，保留与官方一致的直接子选择器兜底 */
  .amis-scope .amis-routes-wrapper .cxd-Page.cxd-Page--withSidebar > .cxd-Page-content {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
  }
}
.amis-scope .cxd-Page .cxd-Page-main {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.amis-scope .cxd-Page .cxd-Page-body {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  /* overflow: auto; */
}
.amis-scope .amis-dialog-widget.cxd-Modal {
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.amis-scope .cxd-Modal-content {
  max-height: none;
  overflow: visible;
}
.amis-scope .cxd-Modal-body {
  max-height: none;
  overflow: visible;
}
.amis-scope .cxd-Page .cxd-Page-body .cxd-Crud {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.amis-scope .cxd-Pagination-inputGroup-left {
  font-size: 12px;
}
/*
 * autoFillHeight：JS 依赖父级给出稳定高度。Crud 已 flex:1 时，若内部 .cxd-Table 仍按内容高度排版，
 * footToolbar 下方会相对 Crud 底部留白；contentWrap 需 flex:1 才能把剩余高度交给 --Table-content-height 计算链。
 * 限定在 Page.body 下的 Crud，降低对弹窗内表格的影响。
 */
.amis-scope .cxd-Page-body .cxd-Crud .cxd-Table.cxd-Table--autoFillHeight {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.amis-scope .cxd-Page-body .cxd-Crud .cxd-Table.cxd-Table--autoFillHeight > .cxd-Table-header,
.amis-scope .cxd-Page-body .cxd-Crud .cxd-Table.cxd-Table--autoFillHeight > .cxd-Table-toolbar {
  flex: 0 0 auto;
}

.amis-scope .cxd-Page-body .cxd-Crud .cxd-Table.cxd-Table--autoFillHeight > .cxd-Table-contentWrap {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.amis-scope .cxd-Page-body .cxd-Crud .cxd-Table.cxd-Table--autoFillHeight > .cxd-Table-contentWrap > .cxd-Table-content {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: auto;
}

/*
 * Page.body 下直接嵌 Tabs（如 460：Tabs → Service → 子 Page 461）时，中间缺少与 routes-wrapper 相同的纵向 flex，
 * 子页 CRUD 的 autoFillHeight 测到的「剩余高度」接近 0，表现为表格区塌缩。
 * 为 Tabs 根、内容区、激活 pane、Service、内层 Page 补 flex:1 + min-height:0（仅限定 body 的直系 Tabs，避免误伤表单内 Tabs）。
 */
.amis-scope .cxd-Page-body > .cxd-Tabs {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-self: stretch;
}

.amis-scope .cxd-Page-body > .cxd-Tabs > .cxd-Tabs-linksWrapper,
.amis-scope .cxd-Page-body > .cxd-Tabs > .cxd-Tabs-linksContainer-wrapper {
  flex: 0 0 auto;
}

.amis-scope .cxd-Page-body > .cxd-Tabs > .cxd-Tabs-content {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* 主题默认 .cxd-Tabs-pane.is-active{display:block}，改为 flex 列才能让子级继续分配高度 */
.amis-scope .cxd-Page-body > .cxd-Tabs > .cxd-Tabs-content > .cxd-Tabs-pane.is-active {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex !important;
  flex-direction: column;
}

.amis-scope .cxd-Page-body > .cxd-Tabs .cxd-Tabs-pane.is-active > .cxd-Service,
.amis-scope .cxd-Page-body > .cxd-Tabs .cxd-Tabs-pane.is-active > .cxd-Page:not(.cxd-Page--withSidebar) {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Service 内动态加载的子 Page（如 461）：根节点需与 routes-wrapper 下顶层 Page 一样参与 flex，否则 body→Crud 链断裂 */
.amis-scope .cxd-Page-body > .cxd-Tabs .cxd-Tabs-pane.is-active .cxd-Service > .cxd-Page:not(.cxd-Page--withSidebar) {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
}

/*
 * 与上「.cxd-Page .cxd-Page-body { overflow: auto }」配合：任意嵌套子 Page 的 body 也会命中该条，在 Tab 内
 * 形成独立滚动层，把 input-text 表格下拉等仍挂在表格 DOM 内的浮层垂直裁切。仅对「外层 body 直系 Tabs →
 * 激活 pane」内的子 Page 放开 overflow，滚动仍可由外层 Page.body / Tabs-content（min-height:0）承担。
 */
.amis-scope .cxd-Page-body > .cxd-Tabs .cxd-Tabs-pane.is-active .cxd-Service > .cxd-Page:not(.cxd-Page--withSidebar) > .cxd-Page-content > .cxd-Page-main > .cxd-Page-body,
.amis-scope .cxd-Page-body > .cxd-Tabs .cxd-Tabs-pane.is-active > .cxd-Page:not(.cxd-Page--withSidebar) > .cxd-Page-content > .cxd-Page-main > .cxd-Page-body {
  overflow: visible;
}

.amis-scope .cxd-Page-body > .cxd-Tabs .cxd-Tabs-pane.is-active > .cxd-Page.cxd-Page--withSidebar {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
}

/*
 * 订单列表等：Page.body 为「Tabs（仅顶部分类，pane 空或 .cxd-Tabs-content 隐藏）+ 同级 CRUD」。
 * 若仍对 Tabs 使用 flex:1，会与下方 CRUD 均分剩余高度，CRUD autoFillHeight 反复 ResizeObserver 测高，表现为高度一点点爬升。
 * :has(+ .cxd-Crud) 表示后邻为 CRUD 的导航型 Tabs：不参与纵向伸展，高度由内部 45px 等样式决定。
 */
.amis-scope .cxd-Page-body > .cxd-Tabs:has(+ .cxd-Crud) {
  flex: 0 0 auto;
  min-height: 0;
  align-self: stretch;
}

.amis-scope .cxd-Page-body > .cxd-Tabs:has(+ .cxd-Crud) > .cxd-Tabs-content {
  flex: 0 0 auto;
  min-height: 0;
}

.amis-scope .cxd-Page-body > .cxd-Tabs + .cxd-Crud {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
}

/* 原先 margin 8px 会显著加宽内容区，易与 .cxd-Table-content{overflow-x:auto} 叠加出横向条；改为 2px 与单元格一致 */
.cxd-Table-table > thead > tr > th .cxd-PlainField,
.cxd-Table-table > tbody > tr > td .cxd-PlainField {
  margin: 8px 0 8px 8px !important;
  position: relative;
  display: inline-block;
}

/*** amis-page *************/
/*
 * 勿使用全局 .is-highlight：amis-editor 的 RegionHLBox（.ae-Editor-rhlbox）在选中区域也会加 is-highlight，
 * 若配表格悬停背景会铺满整块画布；日历/下拉等 is-highlight 项也会被误伤。仅限定在数据表行。
 */
.cxd-Table-table > tbody > tr.is-highlight {
  background: var(--Table-onHover-bg) !important;
  border-color: var(--Table-onHover-borderColor);
  color: var(--Table-onHover-color);
}
.cxd-Number.cxd-Number-readonly {
  border-color: var(--inputNumber-base-default-top-border-color) var(--inputNumber-base-default-right-border-color) var(--inputNumber-base-default-bottom-border-color) var(--inputNumber-base-default-left-border-color);
  background-color: var(--input-default-disabled-bg-color);
}

.cxd-Divider-text {
  color: white !important;
  margin: 0 !important;
  padding: 5px 10px;
  font-size: var(--Divider-text-fontSize);
  box-sizing: border-box;
  font-weight: var(--Divider-text-fontWeight);
  line-height: 1;
  background-color: #007bff !important;
}
.cxd-Divider--horizontal.cxd-Divider--solid {
  border-bottom: solid 1px #409eff !important;
}

.cxd-Divider--horizontal {
  clear: both;
  position: relative;
  margin-top: 20px;
  border-bottom: var(--Divider-width) var(--Divider-style) #409eff !important;
  transform-origin: 0 center;
}

.cxd-Collapse .cxd-Collapse-header {
  display: flex !important;
  padding: 10px 0 0;
  border-bottom: 1px solid #007bff !important;
}

.cxd-Collapse .cxd-Collapse-header .cxd-TplField {
  color: white;
  padding: 1px 5px;
  background-color: #007bff !important;
}

.cxd-Divider--with-text::before,
.cxd-Divider--with-text::after {
  border-bottom-width: 0 !important;
}
.cxd-Divider--with-text.cxd-Divider--with-text-left:before,
.cxd-Divider--with-text.cxd-Divider--with-text-right:after {
  flex-basis: 0 !important;
}

.amis-scope .cxd-Table-table {
  width: auto;
}
.amis-scope .cxd-Page-body {
  padding: initial;
}

.cxd-Table-table td > .cxd-Form-item {
  min-width: 50px !important;
}
.cxd-Table-table th.cxd-Table-checkCell,
.cxd-Table-table td.cxd-Table-checkCell {
  text-align: center !important;
}
.cxd-InputTable .cxd-Field--quickEditable svg:hover {
  color: #000000 !important;
}
.cxd-InputTable .cxd-Field--quickEditable svg {
  color: #2f2e2e !important;
}

/*
 * 表格快捷编辑（如预到货「入库货位」）：amis 默认 .cxd-TextControl-input 为 flex + flex-wrap:wrap，
 * 列宽较窄时清除按钮会换到下一行；限制不换行并固定清除键宽度。
 */
.cxd-Field--quickEditable .cxd-TextControl-input {
  flex-wrap: nowrap;
  align-items: center;
}
.cxd-Field--quickEditable .cxd-TextControl-clear {
  flex-shrink: 0;
}

/* input-table 快捷编辑 autocomplete：挂到 getModalContainer 后仍需抬层，避免被弹窗/表格叠层挡住 */
.amis-scope .cxd-TextControl-popover,
.amis-scope .cxd-PopOver.cxd-TextControl-popover {
  z-index: 5100 !important;
}

#amis-site-modal-portal-scope .cxd-TextControl-popover {
  z-index: 5100 !important;
  pointer-events: auto;
}

/* 站点弹层：滚动下沉到 content，避免 Modal 根节点 overflow 裁切表格内 autocomplete */
#amis-site-modal-portal-scope .amis-dialog-widget.cxd-Modal {
  overflow: visible !important;
  max-height: none !important;
}

#amis-site-modal-portal-scope .cxd-Modal-content {
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

/*
 * 弹窗内 input-table（如出库单 detailTable）：
 * - 滚动必须由 Table-content 承担（overflow-x/y: auto），不可对 contentWrap/content 设 visible，
 *   否则 autoFillHeight 失效，宽表会撑破弹窗。
 * - 单元格/快捷编辑仍 visible，避免 popOver 编辑层被 td 裁切；autocomplete 下拉见上方 z-index + portal。
 */
.amis-scope .cxd-Modal .cxd-InputTable .cxd-Table-contentWrap {
  min-width: 0;
  overflow: hidden !important;
}

.amis-scope .cxd-Modal .cxd-InputTable .cxd-Table-content {
  overflow-x: auto !important;
  overflow-y: auto !important;
}

.amis-scope .cxd-Modal .cxd-InputTable .cxd-Table-table > tbody > tr > td,
.amis-scope .cxd-Modal .cxd-InputTable .cxd-Field--quickEditable {
  overflow: visible !important;
}

.cxd-Table-footTable > tbody > tr > th {
  width: 0 !important;
  padding: 0 10px 0 0 !important;
}
.cxd-Table-footTable > tbody > tr > td {
  word-break: break-all;
  padding: 0;
}
.cxd-Table-table > thead > tr > th.cxd-Table-expandCell {
  border-right: 0;
  width: 0.0625rem;
  padding-right: 0;
  text-align: center;
  padding-left: 4px !important;
}
.cxd-Table-table > tbody > tr > td.cxd-Table-expandCell {
  border-right: 0;
  width: 0.0625rem;
  padding-right: 0;
  text-align: center;
  padding-left: 6px !important;
}
.cxd-Table-table > tbody > tr.is-expanded > td.cxd-Table-expandCell::before {
  left: -1px !important;
  background: #fff;
}
.cxd-Table-footTable > tbody > tr > td {
  padding: 0 !important;
}

.cxd-Table-foot {
  border-bottom: 0 solid var(--Table-borderColor) !important;
}
.cxd-Table-table .cxd-CheckboxControl {
  display: flex;
  justify-content: flex-end;
}
.cxd-Table-table .cxd-Field--quickEditable .cxd-CheckboxControl {
  display: flex;
  justify-content: center;
}
.cxd-Table-table .cxd-CheckboxControl .cxd-Checkbox {
  margin: var(--Form-label-paddingTop) 3px 0 0 !important;
}
.cxd-Table-table > tbody > tr.is-moved,
.cxd-Table-table > tbody > tr.is-modified {
  color: var(--Table-onHover-color) !important;
}
/*隐藏表格顶部工具栏*/
.cxd-Table-headToolbar.hide-header-tool {
  display: none;
}

/*表单tab内容样式*/
.cxd-Modal-body:not(.subEditor-dialog) .in.is-active.cxd-Tabs-pane {
  border: 1px solid rgb(232, 233, 235);
  padding: 10px 5px;
}

/*弹窗 - 底部粘性固定，对提示弹窗排除在外*/
.cxd-Modal-footer:not(:has(.cxd-Button--danger)) {
  position: sticky;
  bottom: 0px;
  background-color: white;
  justify-content: center !important;
  padding: 10px 20px 10px 10px;
}

/**PopOver**/
.cxd-PopOver .cxd-Panel-body {
  padding: 0;
}
.cxd-PopOver .cxd-Table {
  margin-bottom: 0;
}

/*数字输入框上下箭头图标*/
.cxd-Number-handler-up-inner {
  font-family: icon-yrt !important;
  font-size: 14px;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.cxd-Number-handler-up-inner:after {
  content: '\e7a6' !important;
}
.cxd-Number-handler-down-inner {
  font-family: icon-yrt !important;
  font-size: 14px;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.cxd-Number-handler-down-inner:after {
  content: '\e7a6' !important;
}

/*** amis-page *************/
.cxd-TableSelection .cxd-Table-table > tbody > tr.is-highlighted {
  background: var(--Table-onHover-bg);
  border-color: var(--Table-onHover-borderColor);
  color: var(--Table-onHover-color);
}
.cxd-TableSelection .cxd-Table-table > tbody > tr.is-highlighted > td {
  color: var(--Form-select-menu-onActive-color);
  background: none !important;
}
.cxd-GroupedSelection-item.is-highlighted {
  background: var(--Table-onHover-bg);
  border-color: var(--Table-onHover-borderColor);
  color: var(--Table-onHover-color);
}
.cxd-Button.is-focused {
  outline: 1px solid #0368ff9a !important;
  outline-offset: 1px !important;
  box-shadow: var(--Button-onFocus-boxShadow) !important;
}
.rdtDay:focus {
  outline: 1px solid #0368ff9a !important;
  outline-offset: 1px !important;
  background: #0368ff1e !important;
}
.cxd-Switch:focus {
  outline: 1px solid #0368ff9a !important;
  outline-offset: 1px !important;
}
.cxd-Checkbox:focus {
  outline: 1px solid #0368ff9a !important;
  outline-offset: 1px !important;
}

.cxd-TextControl-placeholder {
  color: var(--Form-input-placeholderColor);
  user-select: none;
  position: absolute;
  left: var(--Form-input-paddingX);
  top: var(--Form-input-paddingY);
  margin-top: calc(2 * var(--Form-input-borderWidth));
  line-height: var(--Form-input-lineHeight);
  pointer-events: none;
}
.rdtNext:focus,
.rdtPrev:focus {
  outline: 1px solid #0368ff9a !important;
  outline-offset: 1px !important;
}
.rdtDay:hover {
  background: #0368ff1e !important;
}
.rdtDay:active {
  background: #0368ff1e !important;
}
.rdtDay:focus {
  outline: 1px solid #0368ff9a !important;
  outline-offset: 1px !important;
  background: #0368ff1e !important;
}
.rdtMonth:focus,
.rdtYear:focus {
  outline: 1px solid #0368ff9a !important;
  outline-offset: 1px !important;
}
.rdtMonth:hover,
.rdtYear:hover {
  background: #0368ff1e !important;
}
.rdtMonth:hover,
.rdtYear:hover {
  background: #0368ff1e !important;
}
.rdtMonth:hover,
.rdtYear:hover {
  background: #0368ff1e !important;
}
.rdtSwitch:focus {
  outline: 1px solid #0368ff9a !important;
  outline-offset: 1px !important;
}
.rdtSwitch:hover {
  background: #0368ff1e !important;
}
.rdtSwitch:active {
  background: #0368ff1e !important;
}
.cxd-Code--dark {
  display: block;
  padding: 10px;
}

/**
* 快捷搜索弹窗内边距
**/
.amis-scope .cxd-TableCell-searchPopOver > .cxd-Panel {
  padding: 10px;
}

.amis-scope button,
.amis-scope input,
.amis-scope optgroup,
.amis-scope select,
.amis-scope textarea,
.amis-scope .cxd-TextControl-input {
  font-size: 14px;
}

/*
 * 禁用态 Button 渲染为 div（amis-ui Button.tsx），在 theme 容器内会命中上方 inherit → 16px。
 * 须压过 baseControlClassName / className-* 的 inherit 段，与可用 button 同为 14px。
 */
.amis-scope .cxd-Button.is-disabled,
.amis-scope .amis-routes-wrapper .cxd-Container[class*='baseControlClassName'] .cxd-Button.is-disabled,
.amis-scope .amis-routes-wrapper [class*='className-'] .cxd-Button.is-disabled,
.amis-scope .cxd-InputVtable-toolbar .cxd-Button.is-disabled,
.amis-scope .cxd-InputVtable-footbar .cxd-Button.is-disabled {
  font-size: 14px !important;
}
/*
 * input-vtable 吸顶（stickyToolbar + autoCanvasHeight）
 * 1) 组件：纯 CSS sticky；SDK 未重打时补 display:block / toolbar-inner（见 _input-vtable.scss）
 * 2) 宿主：祖先 overflow 非 visible 会截断 sticky（cxd .amis-scope、app.scss html/body/#app）
 */
.cxd-InputVtable--stickyToolbarAuto,
.cxd-InputVtable.cxd-Form-control.cxd-InputVtable--stickyToolbarAuto {
  display: block !important;
  overflow: visible !important;
  max-height: none !important;
}

.cxd-InputVtable--stickyToolbarAuto > .cxd-InputVtable-container {
  flex: 0 0 auto !important;
  min-height: 120px !important;
  min-width: 0 !important;
  max-height: none !important;
  overflow: visible !important;
}

.cxd-InputVtable-toolbar.cxd-InputVtable-toolbar--sticky {
  display: block;
  position: sticky !important;
  top: var(--InputVtable-sticky-top, 0) !important;
  z-index: 40 !important;
  width: 100%;
  box-sizing: border-box;
  background: var(--Form-bg, #fff) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.cxd-InputVtable-toolbar--sticky > .cxd-InputVtable-toolbar-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  box-sizing: border-box;
}

.amis-scope:has(.cxd-InputVtable-toolbar--sticky, .cxd-InputVtable--stickyToolbarAuto) {
  overflow: visible !important;
}

html.layout-mode-defaults:not(.layout-amis-viewport):has(.cxd-InputVtable-toolbar--sticky, .cxd-InputVtable--stickyToolbarAuto),
html.layout-mode-defaults:not(.layout-amis-viewport):has(.cxd-InputVtable-toolbar--sticky, .cxd-InputVtable--stickyToolbarAuto) body,
html.layout-mode-defaults:not(.layout-amis-viewport):has(.cxd-InputVtable-toolbar--sticky, .cxd-InputVtable--stickyToolbarAuto) #app,
html.layout-mode-defaults:not(.layout-amis-viewport):has(.cxd-InputVtable-toolbar--sticky, .cxd-InputVtable--stickyToolbarAuto) :is(.layout-container, .layout-container-view, .layout-main, .layout-main-scroll, .layout-parent, .layout-router-filler, .layout-route-stage, .amis-box, .amis-scope) {
  overflow: visible !important;
}

html.layout-mode-defaults:not(.layout-amis-viewport):has(.cxd-InputVtable-toolbar--sticky, .cxd-InputVtable--stickyToolbarAuto) .amis-scope :is(.cxd-Page, .cxd-Page-content, .cxd-Page-main, .cxd-Page-body, .cxd-Tabs, .cxd-Tabs-content, .cxd-Tabs-pane, .cxd-Service, .cxd-Container, .cxd-Form, .cxd-Form--flex, .cxd-Form-item, .cxd-Form-value, .cxd-Panel, .cxd-Panel-body, .cxd-Flex) {
  overflow: visible !important;
}

html.layout-mode-defaults.layout-amis-viewport:has(.cxd-InputVtable-toolbar--sticky, .cxd-InputVtable--stickyToolbarAuto) .layout-main-scroll {
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

html.layout-mode-defaults.layout-amis-viewport:has(.cxd-InputVtable-toolbar--sticky, .cxd-InputVtable--stickyToolbarAuto) :is(.layout-main, .layout-parent, .layout-router-filler, .layout-route-stage, .amis-box) {
  overflow: visible !important;
}

.layout-backtop.el-scrollbar .el-scrollbar__wrap:has(.cxd-InputVtable-toolbar--sticky, .cxd-InputVtable--stickyToolbarAuto) {
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

:is(#amis-site-modal-portal-scope, .amis-scope) .cxd-Modal-content .cxd-InputVtable--stickyToolbarAuto {
  overflow: visible !important;
  max-height: none !important;
}

:is(#amis-site-modal-portal-scope, .amis-scope) .cxd-Modal-content .cxd-InputVtable--stickyToolbarAuto > .cxd-InputVtable-container {
  flex: 0 0 auto !important;
  overflow: visible !important;
  max-height: none !important;
}

/*
 * vtable 表头筛选菜单：插件用 getBoundingClientRect 视口坐标定位，须 fixed。
 * 上游/旧 SDK 默认 absolute，浏览器窗口滚动后会偏离表头（如费用页应付明细）。
 */
.vtable-filter-menu {
  position: fixed !important;
}

/* vtable 按值筛选：选项行（label 上一级 flex 容器）内边距，覆盖插件 optionItem 默认 8px 5px */
.amis-scope .vtable-filter-menu div:has(> label) {
  padding: 3px 5px !important;
}
.amis-scope .cxd-PopOver:not(:has(.cxd-Transfer-search)):not(:has(.cxd-Select-menu)):not(:has(.cxd-GroupedSelection)) {
  padding: 10px;
}
.amis-scope .cxd-PopOver pre {
  line-height: 1.5;
  font-size: 13px;
}
.vtable-filter-menu label {
  font-size: 14px;
}

/* 预约入库 - 添加箱号：首行 2/3 + 1/3，标签不换行、输入框对齐 */
.amis-scope .box-number-dialog .box-name-prefix-row.cxd-Form-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  column-gap: 12px;
  margin-bottom: 0;
}
.amis-scope .box-number-dialog .box-name-prefix-row > .cxd-Form-groupColumn {
  flex: none;
  padding: 0;
  margin: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
}
.amis-scope .box-number-dialog .box-name-prefix-row > .cxd-Form-groupColumn:first-child {
  width: 66.666667%;
}
.amis-scope .box-number-dialog .box-name-prefix-row > .cxd-Form-groupColumn:last-child {
  width: 33.333333%;
}
.amis-scope .box-number-dialog .box-name-prefix-row .cxd-Form-item {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  width: 100%;
  margin-bottom: 0;
}
.amis-scope .box-number-dialog .box-name-prefix-row .cxd-Form-label {
  white-space: nowrap !important;
  word-break: keep-all;
  overflow: visible;
  flex: 0 0 auto;
  flex-shrink: 0;
  padding-right: 8px !important;
  margin-right: 0 !important;
  line-height: var(--Form-input-height, 32px);
}
.amis-scope .box-number-dialog .box-name-prefix-row .cxd-Form-star {
  margin-right: 2px;
}
.amis-scope .box-number-dialog .box-name-prefix-row .cxd-Form-value {
  flex: 1 1 0;
  min-width: 0;
  padding-left: 0 !important;
  display: flex;
  align-items: center;
}
.amis-scope .box-number-dialog .box-name-prefix-row .cxd-Form-control {
  width: 100%;
}
.amis-scope .wrapperCustomStyle-formEditor .cxd-Panel-footerWrap {
  z-index: 0;
}

/*
 * 侧栏树页 page_box_tree：用 flex 链吃满 amis-box（固定 100vh 会比宿主矮一截，底部留空）。
 * Page overflow:hidden 防止树撑高整页；侧栏用 height:0+flex:1 锁定滚动区，滚动放在 .cxd-Tree。
 */
.amis-scope .amis-routes-wrapper > .cxd-Page.wrapperCustomStyle-page_box_tree.cxd-Page--withSidebar {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: 100% !important;
  height: auto !important;
  overflow: hidden !important;
}
.amis-scope .cxd-Page.wrapperCustomStyle-page_box_tree > .cxd-Page-content {
  min-height: 0 !important;
  max-height: 100% !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}
@media (min-width: 768px) {
  .amis-scope .amis-routes-wrapper > .cxd-Page.wrapperCustomStyle-page_box_tree.cxd-Page--withSidebar > .cxd-Page-content {
    overflow: hidden !important;
  }
}
.amis-scope .cxd-Page.wrapperCustomStyle-page_box_tree > .cxd-Page-content > .cxd-Page-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.amis-scope .cxd-Page.wrapperCustomStyle-page_box_tree .cxd-Page-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.amis-scope .cxd-Page.wrapperCustomStyle-page_box_tree > .cxd-Page-aside {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  flex: 0 0 auto;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  padding-top: var(--sizes-size-3);
  padding-bottom: var(--sizes-size-3);
  box-sizing: border-box;
}
.amis-scope .cxd-Page.wrapperCustomStyle-page_box_tree > .cxd-Page-aside .city-aside-country-filter {
  flex: 0 0 auto;
}
.amis-scope .cxd-Page.wrapperCustomStyle-page_box_tree > .cxd-Page-aside .city-aside-country-filter .cxd-Form-item {
  flex: 0 0 auto;
  min-height: auto;
  height: auto;
  overflow: visible;
}
.amis-scope .cxd-Page.wrapperCustomStyle-page_box_tree > .cxd-Page-aside .city-aside-country-filter .cxd-Form-item > .cxd-Form-control {
  flex: 0 0 auto;
  min-height: auto;
  height: auto;
  overflow: visible;
}
/* page_box_tree 侧栏 Tabs（如 BI 设计器 模板目录/数据源）：补 flex 链，否则 TreeControl height:0 无父级高度会压没 */
.amis-scope .amis-routes-wrapper .cxd-Page.wrapperCustomStyle-page_box_tree > .cxd-Page-aside > .cxd-Tabs {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.amis-scope .amis-routes-wrapper .cxd-Page.wrapperCustomStyle-page_box_tree > .cxd-Page-aside > .cxd-Tabs > .cxd-Tabs-linksWrapper,
.amis-scope .amis-routes-wrapper .cxd-Page.wrapperCustomStyle-page_box_tree > .cxd-Page-aside > .cxd-Tabs > .cxd-Tabs-linksContainer-wrapper {
  flex: 0 0 auto;
}
.amis-scope .amis-routes-wrapper .cxd-Page.wrapperCustomStyle-page_box_tree > .cxd-Page-aside > .cxd-Tabs > .cxd-Tabs-content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.amis-scope .amis-routes-wrapper .cxd-Page.wrapperCustomStyle-page_box_tree > .cxd-Page-aside > .cxd-Tabs > .cxd-Tabs-content > .cxd-Tabs-pane.is-active {
  flex: 1 1 auto;
  min-height: 0;
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
  padding: 5px;
}
.amis-scope .amis-routes-wrapper .cxd-Page.wrapperCustomStyle-page_box_tree > .cxd-Page-aside > .cxd-Tabs .cxd-ButtonToolbar {
  flex: 0 0 auto;
}
/* height:0+flex 仅运行时（有 amis-routes-wrapper flex 链）；设计器画布无高度上下文会把 input-tree 压没 */
.amis-scope .amis-routes-wrapper .cxd-Page.wrapperCustomStyle-page_box_tree > .cxd-Page-aside .cxd-Form-item:has(.cxd-TreeControl) {
  flex: 1 1 auto;
  min-height: 0;
  height: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.amis-scope .amis-routes-wrapper .cxd-Page.wrapperCustomStyle-page_box_tree > .cxd-Page-aside .cxd-Form-item:has(.cxd-TreeControl) > .cxd-Form-control {
  flex: 1 1 auto;
  min-height: 0;
  height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.amis-scope .amis-routes-wrapper .cxd-Page.wrapperCustomStyle-page_box_tree > .cxd-Page-aside .cxd-TreeControl {
  flex: 1 1 auto;
  min-height: 0;
  height: 0;
  overflow: hidden;
  display: block;
}
.amis-scope .amis-routes-wrapper .cxd-Page.wrapperCustomStyle-page_box_tree > .cxd-Page-aside .cxd-TreeControl.h-auto > .cxd-Tree,
.amis-scope .amis-routes-wrapper .cxd-Page.wrapperCustomStyle-page_box_tree > .cxd-Page-aside .cxd-TreeControl > .cxd-Tree {
  max-height: none !important;
  height: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}
/* amis-editor 设计器：侧栏 input-tree 用自然高度 + 树内滚动，便于拖拽编辑（覆盖 Page wrapperCustomStyle 内 height:0） */
.ae-Editor .cxd-Page-aside .cxd-Form-item:has(.cxd-TreeControl) {
  height: auto !important;
  min-height: 280px;
  overflow: visible !important;
}
.ae-Editor .cxd-Page-aside .cxd-Form-item:has(.cxd-TreeControl) > .cxd-Form-control {
  height: auto !important;
  min-height: 260px;
  overflow: visible !important;
}
.ae-Editor .cxd-Page-aside .cxd-TreeControl {
  height: auto !important;
  min-height: 240px;
  overflow: visible !important;
}
.ae-Editor .cxd-Page-aside .cxd-TreeControl > .cxd-Tree {
  height: auto !important;
  max-height: min(400px, 50vh) !important;
  min-height: 200px;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

/*
 * page_box_tree + cards：Cards-body 内滚动。Page overflow:hidden 下 cards 无 autoFillHeight，需在卡片区单独开滚动。
 */
.amis-scope .cxd-Page.wrapperCustomStyle-page_box_tree .cxd-Page-body .cxd-Crud > .cxd-Crud-filter {
  flex: 0 0 auto;
}
.amis-scope .cxd-Page.wrapperCustomStyle-page_box_tree .cxd-Page-body .cxd-Crud > .cxd-Crud-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.amis-scope .cxd-Page.wrapperCustomStyle-page_box_tree .cxd-Page-body .cxd-Crud .cxd-Cards {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.amis-scope .cxd-Page.wrapperCustomStyle-page_box_tree .cxd-Page-body .cxd-Crud .cxd-Cards > .cxd-Cards-toolbar,
.amis-scope .cxd-Page.wrapperCustomStyle-page_box_tree .cxd-Page-body .cxd-Crud .cxd-Cards > .cxd-Cards-footer {
  flex: 0 0 auto;
}
.amis-scope .cxd-Page.wrapperCustomStyle-page_box_tree .cxd-Page-body .cxd-Crud .cxd-Cards-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

/* cards 网格：仅容器占满高度滚动，单行/单卡不随 Cards-body 拉伸 */
.amis-scope .cxd-Page.wrapperCustomStyle-page_box_tree .cxd-Page-body .cxd-Crud .cxd-Cards-body.cxd-Grid {
  flex: 1 1 auto !important;
  align-content: flex-start !important;
  align-items: flex-start !important;
}
.amis-scope .cxd-Page.wrapperCustomStyle-page_box_tree .cxd-Page-body .cxd-Crud .cxd-Cards-body > div {
  display: block !important;
  align-self: flex-start !important;
  height: auto !important;
  max-height: none !important;
}
.amis-scope .cxd-Page.wrapperCustomStyle-page_box_tree .cxd-Page-body .cxd-Crud .cxd-Cards-body .cxd-Card {
  height: auto !important;
  max-height: none !important;
  flex: none !important;
}
.amis-scope .cxd-Page.wrapperCustomStyle-page_box_tree .cxd-Page-body .cxd-Crud .cxd-Cards-body .cxd-Card-body {
  flex: 0 0 auto !important;
  height: auto !important;
}

/* Page 侧边栏拖拽把手：cxd.css 内 UTF-8 中点 · 在无 charset 时会被解析成 Â·，改用 ASCII 转义 */
.amis-scope .cxd-Page-asideResizor:after {
  content: '\00B7\00B7\00B7';
}

/*
 * CRUD 工具栏内 input-file：maxSize 提示默认在按钮下方占位，会撑高 toolbar-item，
 * 导致同行「刷新 / 批量删除」等按钮垂直错位（附件管理等多处共用）。
 * 提示改为绝对定位浮在按钮下方，不参与工具栏高度计算；工具栏略增底边距给提示留空。
 * 水平表单项会渲染空 label 占位（--sizes-base-48），工具栏内一并隐藏。
 */
.amis-scope .cxd-Crud-toolbar:has(.cxd-FileControl) {
  padding-bottom: 16px;
}
.amis-scope .cxd-Crud-toolbar-item:has(.cxd-FileControl) {
  overflow: visible;
  position: relative;
}
.amis-scope .cxd-Crud-toolbar-item .cxd-Form-item {
  margin-bottom: 0;
}
/* flex 表单（如应付账单编辑 mode:flex）下 Form-item--flex 自带 overflow:hidden，
 * 会裁掉绝对定位的 maxSize 提示；工具栏上传项须可见溢出。 */
.amis-scope .cxd-Crud-toolbar-item .cxd-Form-item--flex,
.amis-scope .cxd-Crud-toolbar-item .cxd-Form-item:has(.cxd-FileControl) {
  overflow: visible;
}
.amis-scope .cxd-Crud-toolbar-item .cxd-Form-item--horizontal > .cxd-Form-label,
.amis-scope .cxd-Crud-toolbar-item .cxd-Form-item > .cxd-Form-label {
  display: none !important;
}
.amis-scope .cxd-Crud-toolbar-item .cxd-Form-item--horizontal {
  display: inline-flex;
  margin-left: 0;
}
.amis-scope .cxd-Crud-toolbar-item .cxd-Form-item--horizontal > .cxd-Form-value {
  margin-left: 0 !important;
  width: auto !important;
  flex: 0 0 auto;
}
.amis-scope .cxd-Crud-toolbar-item .cxd-FileControl {
  position: relative;
}
.amis-scope .cxd-Crud-toolbar-item .cxd-FileControl-sizeTip,
.amis-scope .cxd-Crud-toolbar-item .cxd-FileControl-description {
  position: absolute;
  left: 0;
  top: calc(100% + 2px);
  margin-top: 0;
  white-space: nowrap;
  line-height: 1.2;
  z-index: 2;
  pointer-events: none;
}
