/* 全局按钮行：不换行，随容器等比缩小；触底后横向滚动。
   不含 .modal-footer：弹窗是决策区（1–3 个按钮），走 base-shell / 设计系统尺寸。
   工具条收缩合同压到 11–14px / 28px，确认、警告、表单弹窗的主操作都会过小。 */
.btn-group:not(.btn-group-vertical),
.check-option-group,
.quick-filter-group,
.filter-button-group,
.filter-bar-actions,
.page-head-actions,
.hero-actions,
.workorder-hero-actions,
.action-buttons-container,
.bee-action-bar,
.mc-hero-actions,
.sr-hero-actions,
.disassembly-status-buttons,
.table tbody td:last-child:has(.btn),
.table tbody td:last-child:has(.btn-group) {
    container-type: inline-size;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.quick-filter-group,
.filter-button-group,
.filter-bar-actions,
.page-head-actions,
.hero-actions,
.workorder-hero-actions,
.action-buttons-container,
.bee-action-bar,
.mc-hero-actions,
.sr-hero-actions,
.disassembly-status-buttons,
.check-option-group,
.table tbody td:last-child:has(.btn),
.table tbody td:last-child:has(.btn-group) {
    gap: 0.45em;
}

.btn-group:not(.btn-group-vertical):not(.check-option-group) {
    gap: 0;
}

.check-option-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    align-items: stretch;
}

.btn-group:not(.btn-group-vertical) > .btn,
.check-option-group > .btn,
.check-option-group > label,
.quick-filter-group > .btn,
.filter-button-group > .btn,
.filter-button-group > a,
.filter-bar-actions > .btn,
.page-head-actions > .btn,
.page-head-actions > a,
.workorder-hero-actions > .btn,
.action-buttons-container > .btn,
.bee-action-bar > .btn,
.disassembly-status-buttons > .btn,
.table tbody td:last-child .btn {
    flex: 0 1 auto;
    min-width: 0;
    width: auto;
    max-width: none;
    margin-bottom: 0;
    white-space: nowrap;
    font-size: clamp(0.6875rem, 0.35rem + 1.2cqi, 0.875rem);
    padding: 0.4em 0.85em;
    min-height: max(28px, 2.2em);
}

.check-option-group > .btn,
.check-option-group > label {
    flex: 1 1 0;
    width: 100%;
    justify-content: center;
}

.action-buttons-container > .btn-icon-split,
.bee-action-bar > .btn-icon-split {
    padding: 0;
    width: auto;
}

.action-buttons-container .btn-icon-split .icon,
.bee-action-bar .btn-icon-split .icon {
    padding: 0 0.7em;
    min-width: 2.4em;
}

.action-buttons-container .btn-icon-split .icon i,
.bee-action-bar .btn-icon-split .icon i {
    font-size: 1em;
}

.action-buttons-container .btn-icon-split .text,
.bee-action-bar .btn-icon-split .text {
    padding: 0 0.9em;
    font-size: inherit;
    white-space: nowrap;
}

.action-buttons-container .btn:not(.btn-icon-split) {
    padding: 0.4em 0.85em;
}

.btn-action-emphasis {
    min-width: 0;
}

/* 压过 mobile.css 竖排/换行/两列操作钮（该文件有既有 side-tab，不宜在本任务改视觉） */
.btn-group:not(.btn-group-vertical),
.action-buttons-container,
.bee-action-bar,
.page-head-actions,
.hero-actions,
.workorder-hero-actions,
.quick-filter-group,
.filter-button-group,
.filter-bar-actions,
.mc-hero-actions,
.sr-hero-actions,
.disassembly-status-buttons,
.table tbody td:last-child:has(.btn),
.table tbody td:last-child:has(.btn-group),
.dataTable td:last-child {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
}

.check-option-group {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.action-buttons-container > .btn,
.action-buttons-container > .btn-icon-split,
.bee-action-bar > .btn,
.bee-action-bar > .btn-icon-split,
.page-head-actions > .btn,
.quick-filter-group > .btn,
.filter-button-group > .btn,
.filter-button-group > a,
.btn-group:not(.btn-group-vertical) > .btn,
.check-option-group > .btn,
.check-option-group > label,
.table tbody td:last-child .btn,
.dataTable td:last-child .btn {
    flex: 0 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    font-size: clamp(0.6875rem, 0.35rem + 1.2cqi, 0.875rem) !important;
    white-space: nowrap !important;
}

/* 分割图标按钮不能压到 min-width:0：overflow:hidden 会裁掉左侧图标和文案 */
.action-buttons-container > .btn-icon-split,
.bee-action-bar > .btn-icon-split {
    flex: 0 0 auto !important;
    min-width: max-content !important;
    min-height: 42px !important;
}

.action-buttons-container .btn-icon-split .text,
.bee-action-bar .btn-icon-split .text {
    padding: 0.5em 0.9em;
}

/* 详情操作条：换行展示完整按钮，避免一排挤扁或横向裁切 */
.action-buttons-container.bee-action-bar {
    flex-wrap: wrap !important;
    overflow: visible;
    align-items: stretch;
}

/* 工单详情页自己收容按钮，不套全局 nowrap / max-content */
.mwo-page .btn-group:not(.btn-group-vertical),
.mwo-page .action-buttons-container,
.mwo-page .bee-action-bar,
.wo-detail-page .action-buttons-container,
.wo-detail-page .bee-action-bar {
    container-type: normal;
}

.wo-detail-page .action-buttons-container,
.wo-detail-page .bee-action-bar {
    flex-wrap: wrap !important;
    overflow: visible;
    align-items: stretch;
}

.wo-detail-page .action-buttons-container > .btn-icon-split,
.wo-detail-page .bee-action-bar > .btn-icon-split {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

/* 首页 / 物料 Hero / 统一页头：作者尺寸，允许换行，不走 cqi 缩小 */
.hero-actions,
.mc-hero-actions,
.sr-hero-actions,
.workorder-hero-actions,
.page-head-actions {
    container-type: normal;
    flex-wrap: wrap !important;
    overflow: visible;
    align-items: center;
}

header.page-head .page-head-actions > .btn,
header.page-head .page-head-actions > a.btn {
    flex: 0 0 auto !important;
    min-width: max-content !important;
    font-size: 0.8125rem !important;
}

.workorder-hero-actions > .btn {
    flex: 0 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: nowrap !important;
}
