/* Batch16：统一解决宽度溢出、筛选栏冲突、移动端密度与层级问题。 */
:root{
  --b16-line:#dbe5ef;
  --b16-soft:#f6f9fc;
  --b16-text:#1d2b3a;
  --b16-muted:#65758a;
  --b16-blue:#2563eb;
  --b16-radius:15px;
  --b16-shadow:0 8px 26px rgba(18,42,72,.055);
}
html{overflow-x:hidden;background:#eef3f8}
body.erp-mode{overflow-x:hidden;color:var(--b16-text);background:linear-gradient(145deg,#f3f7fb 0%,#eef4f9 48%,#f5f8fb 100%)}
body.erp-mode *,body.erp-mode *::before,body.erp-mode *::after{box-sizing:border-box}
body.erp-mode .erp-shell,body.erp-mode .erp-app,body.erp-mode .erp-content,body.erp-mode .erp-page,body.erp-mode .erp-page>*{min-width:0}
body.erp-mode .erp-content{width:100%;max-width:none!important}
body.erp-mode .erp-page.erp-page-active{animation:b16-page-in .18s ease-out}
@keyframes b16-page-in{from{opacity:.45;transform:translateY(3px)}to{opacity:1;transform:none}}

body.erp-mode .card,body.erp-mode .erp-panel,body.erp-mode .erp-module-card,
body.erp-mode .yd-bridge-panel,body.erp-mode .mp-panel{
  border-color:var(--b16-line)!important;
  box-shadow:var(--b16-shadow)!important;
}
body.erp-mode .card,body.erp-mode .erp-panel,body.erp-mode .yd-bridge-panel{border-radius:var(--b16-radius)!important}
body.erp-mode .erp-module-card{transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease}
@media(hover:hover){body.erp-mode .erp-module-card:hover{transform:translateY(-2px);border-color:#c8d8e8!important;box-shadow:0 12px 30px rgba(18,42,72,.085)!important}}

body.erp-mode button,body.erp-mode input,body.erp-mode select,body.erp-mode textarea{font-family:inherit}
body.erp-mode button{transition:filter .15s ease,transform .12s ease,box-shadow .15s ease}
@media(hover:hover){body.erp-mode button:not(:disabled):hover{filter:saturate(1.05)}}
body.erp-mode button:not(:disabled):active{transform:translateY(1px)}
body.erp-mode input:focus-visible,body.erp-mode select:focus-visible,body.erp-mode textarea:focus-visible,body.erp-mode button:focus-visible{
  outline:3px solid rgba(37,99,235,.17)!important;
  outline-offset:1px;
  border-color:#76a3ee!important;
}

body.erp-mode .erp-page-heading{min-width:0;gap:14px!important}
body.erp-mode .erp-page-heading>div:first-child{min-width:0}
body.erp-mode .erp-page-heading p{max-width:1000px}
body.erp-mode .erp-page-heading>.actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px}
body.erp-mode .erp-topbar{gap:12px}
body.erp-mode .erp-topbar-left,body.erp-mode .erp-topbar-right,body.erp-mode .erp-breadcrumb{min-width:0}
body.erp-mode .erp-breadcrumb strong,body.erp-mode .erp-breadcrumb small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.erp-mode .erp-page-updated{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

body.erp-mode .layout-bar{display:grid!important;grid-template-columns:minmax(260px,1fr) repeat(3,minmax(145px,max-content)) max-content;align-items:end!important;gap:10px!important}
body.erp-mode .layout-title{min-width:0;margin:0!important}
body.erp-mode .layout-bar label{min-width:0}
body.erp-mode .layout-bar select,body.erp-mode .range-control{width:100%;min-width:0!important}

body.erp-mode .control-filter-grid,body.erp-mode .control-filter-group,body.erp-mode .control-filter-advanced{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(145px,1fr));
  align-items:end!important;
  gap:10px!important;
}
body.erp-mode .control-filter-grid label,body.erp-mode .control-filter-group label,body.erp-mode .control-filter-advanced label{min-width:0!important;width:auto!important}
body.erp-mode .control-filter-grid input,body.erp-mode .control-filter-grid select,
body.erp-mode .control-filter-group input,body.erp-mode .control-filter-group select,
body.erp-mode .control-filter-advanced input,body.erp-mode .control-filter-advanced select{width:100%;min-width:0!important}

body.erp-mode .yd-settings,body.erp-mode .yd-filters,body.erp-mode .promo-settings{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(145px,1fr));
  align-items:end!important;
  gap:10px!important;
}
body.erp-mode .yd-settings label,body.erp-mode .yd-filters label,body.erp-mode .promo-settings label{min-width:0!important;width:auto!important}
body.erp-mode .yd-settings input,body.erp-mode .yd-settings select,
body.erp-mode .yd-filters input,body.erp-mode .yd-filters select,
body.erp-mode .promo-settings input,body.erp-mode .promo-settings select{width:100%;min-width:0!important}
body.erp-mode .yd-settings .yd-folder,body.erp-mode .yd-filters label.grow{grid-column:span 2;min-width:0!important}
body.erp-mode .yd-quick-time{grid-column:1/-1;display:flex;align-items:center;flex-wrap:wrap;gap:7px;min-width:0}
body.erp-mode .yd-bridge-head{align-items:flex-start;gap:14px}
body.erp-mode .yd-bridge-head>div:first-child{min-width:0}
body.erp-mode .yd-head-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px}
body.erp-mode .yd-status-footer,body.erp-mode .promo-freshness{min-width:0;overflow-wrap:anywhere}

body.erp-mode .table-wrap,body.erp-mode .table-editor,body.erp-mode .control-display-wrap,
body.erp-mode .yd-table-wrap,body.erp-mode .mp-table-wrap,body.erp-mode .intel-table-wrap{
  width:100%;max-width:100%;min-width:0;overflow:auto;overscroll-behavior:contain;
  scrollbar-gutter:stable both-edges;
}
body.erp-mode table{font-variant-numeric:tabular-nums}
body.erp-mode th{position:relative}
body.erp-mode td,body.erp-mode th{vertical-align:middle}
body.erp-mode .control-display-wrap td,body.erp-mode .control-display-wrap th{background-clip:padding-box}
body.erp-mode .control-result-pager{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;margin-top:10px;padding:10px 12px;border:1px solid var(--b16-line);border-radius:12px;background:#f8fbfe;color:var(--b16-muted);font-size:12px}
body.erp-mode .control-result-pager>span{margin-right:auto}
body.erp-mode .control-result-pager label{display:flex;align-items:center;gap:6px}
body.erp-mode .control-result-pager select{min-height:34px}
body.erp-mode .control-result-pager button{min-height:34px;padding:6px 11px}

body.erp-mode .mp-page,body.erp-mode .mp-task-grid,body.erp-mode .mp-panel,body.erp-mode .mp-view{min-width:0}
body.erp-mode .mp-task-grid{grid-template-columns:minmax(0,1.65fr) minmax(290px,.8fr)}
body.erp-mode .mp-toolbar{gap:8px}
body.erp-mode .mp-toolbar label.grow{min-width:min(280px,100%)}
body.erp-mode .mp-hero-actions,body.erp-mode .mp-detail-actions,body.erp-mode .mp-task-actions{flex-wrap:wrap}

body.erp-mode .modal,body.erp-mode .intel-modal,body.erp-mode .v83-exception-modal{z-index:1600!important}
body.erp-mode .modal-panel,body.erp-mode .intel-modal-panel,body.erp-mode .v83-exception-dialog{max-width:min(96vw,1500px);max-height:min(94vh,1000px);overflow:auto}
body.erp-mode .erp-user-menu{z-index:1500}
body.erp-mode .ui-route-progress{z-index:1700}

@media(max-width:1280px){
  body.erp-mode .layout-bar{grid-template-columns:minmax(240px,1fr) repeat(2,minmax(145px,1fr))}
  body.erp-mode .layout-bar>button{justify-self:start}
  body.erp-mode .mp-task-grid{grid-template-columns:minmax(0,1.45fr) minmax(280px,.8fr)}
}
@media(max-width:900px){
  body.erp-mode .layout-bar{grid-template-columns:repeat(2,minmax(0,1fr))}
  body.erp-mode .layout-title{grid-column:1/-1}
  body.erp-mode .erp-page-heading>.actions{width:100%;justify-content:flex-start!important;overflow-x:auto;flex-wrap:nowrap!important;padding-bottom:4px}
  body.erp-mode .erp-page-heading>.actions button{flex:0 0 auto}
  body.erp-mode .mp-task-grid{grid-template-columns:minmax(0,1fr)}
  body.erp-mode .yd-bridge-head{flex-direction:column}
  body.erp-mode .yd-head-actions{width:100%;justify-content:flex-start}
  body.erp-mode .yd-head-actions button{flex:1 1 160px}
}
@media(max-width:820px){
  body.erp-mode .erp-topbar{min-height:58px;padding:0 10px!important}
  body.erp-mode .erp-topbar-right{margin-left:auto}
  body.erp-mode .erp-user-chip{max-width:48px;overflow:hidden}
  body.erp-mode .erp-content{padding:13px 9px calc(86px + env(safe-area-inset-bottom))!important}
  body.erp-mode .erp-page-heading{padding-left:11px!important}
  body.erp-mode .control-filter-grid,body.erp-mode .control-filter-group,body.erp-mode .control-filter-advanced,
  body.erp-mode .yd-settings,body.erp-mode .yd-filters,body.erp-mode .promo-settings{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.erp-mode .yd-settings .yd-folder,body.erp-mode .yd-filters label.grow{grid-column:1/-1}
  body.erp-mode .mp-hero{padding:18px!important}
  body.erp-mode .mp-hero-actions{width:100%;min-width:0!important}
  body.erp-mode .mp-hero-actions button{flex:1 1 145px}
}
@media(max-width:560px){
  body.erp-mode .layout-bar{grid-template-columns:minmax(0,1fr)}
  body.erp-mode .layout-title{grid-column:auto}
  body.erp-mode .layout-bar>button{width:100%}
  body.erp-mode .control-filter-grid,body.erp-mode .control-filter-group,body.erp-mode .control-filter-advanced,
  body.erp-mode .yd-settings,body.erp-mode .yd-filters,body.erp-mode .promo-settings{grid-template-columns:minmax(0,1fr)!important}
  body.erp-mode .yd-settings .yd-folder,body.erp-mode .yd-filters label.grow{grid-column:auto}
  body.erp-mode .yd-quick-time{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
  body.erp-mode .yd-quick-time b{grid-column:1/-1}
  body.erp-mode .yd-quick-time button{min-width:0;padding-inline:7px}
  body.erp-mode .yd-head-actions{display:grid;grid-template-columns:minmax(0,1fr);width:100%}
  body.erp-mode .yd-head-actions button{width:100%}
  body.erp-mode .control-result-pager{display:grid;grid-template-columns:1fr 1fr;text-align:center}
  body.erp-mode .control-result-pager>span{grid-column:1/-1;margin:0}
  body.erp-mode .control-result-pager label{grid-column:1/-1;justify-content:center}
  body.erp-mode .mp-source-metrics{grid-template-columns:minmax(0,1fr)!important}
  body.erp-mode .mp-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.erp-mode .mp-task-actions{display:grid;grid-template-columns:minmax(0,1fr)}
  body.erp-mode .mp-task-actions button{width:100%;min-width:0!important}
}
@media(prefers-reduced-motion:reduce){body.erp-mode .erp-page.erp-page-active{animation:none}body.erp-mode *,body.erp-mode *::before,body.erp-mode *::after{scroll-behavior:auto!important;transition-duration:.01ms!important}}
