:focus-visible {
  outline: none;
}

.mf-page {
  margin: 0;
  padding: 10px 15px 30px 15px;
  overflow: auto;
}

.el-form .form-item-helper {
  color: #909399;
  display: block;
  width: 100%;
}

.el-form .form-item-helper code {
  padding: 2px 4px;
  font-size: 90%;
  color: #c7254e;
  background-color: #f9f2f4;
  border-radius: 4px;
}

.el-form .el-upload-list__item {
  transition: none;
}

.el-tabs__header {
  margin-bottom: 20px;
}

/* 图片上传组件里图片缩略图的尺寸 */
.el-upload-list--picture-card {
  --el-upload-list-picture-card-size: 120px;
}

/* 图片上传组件里上传图片按钮的尺寸 */
.el-upload--picture-card {
  --el-upload-picture-card-size: 120px;
}

.picture-uploader .el-upload {
  border: 1px dashed var(--el-border-color);
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--el-transition-duration-fast);
}

.picture-uploader .el-upload:hover {
  border-color: var(--el-color-primary);
}

.el-icon.picture-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: var(--el-upload-list-picture-card-size);
  height: var(--el-upload-list-picture-card-size);
  text-align: center;
}

.picture-uploader .picture-uploader-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.keyValue {
  margin: 0;
  padding: 0;
  width: 100%;
}

.keyValue .el-col {}

.keyValue .el-row {
  margin-bottom: 5px;
}

.data-manage {
  margin-top: 5px;
}

.data-manage .el-button {
  font-weight: normal;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 3px;
}

.data-manage .el-tabs--card>.el-tabs__header .el-tabs__item.is-active {
  background-color: var(--el-bg-color);
}

.data-manage .el-tabs__header {
  margin-bottom: 0px;
}

.data-manage .table-box {
  padding: 15px;
  background-color: var(--el-bg-color);
  border: 1px solid var(--el-border-color-light);
}

.data-manage .table-body .table-search .el-date-editor.el-input,
.el-date-editor.el-input__wrapper {
  width: 220px;
}

.data-manage .table-toolbar {
  margin-bottom: 15px;
  display: flex;
  justify-content: space-between;
}

.data-manage .table-toolbar>div {
  display: flex;
  align-items: center;
  flex-direction: row;
}

.data-manage .table-body {
  margin-bottom: 0px;
}

.data-manage .el-table .cell {
  line-height: 24px;
}

.data-manage .table-toolbar .left {}

.data-manage .table-toolbar .right {
  justify-content: flex-end;
}

.data-manage .data-manage .table-box {
  border: 0;
  padding: 5px;
}

.table-toolbar .el-button~.el-button,
.table-toolbar .el-button+.el-button,
.table-toolbar .el-dropdown {
  margin-left: 5px;
}

.table-body .el-table__row .el-button {
  padding: 0 8px;
}

.table-body .el-table__row .el-button~.el-button,
.table-body .el-table__row .el-button+.el-button,
.table-body .el-table__row .el-dropdown {
  margin-left: 8px;
}

.table-pagination {
  margin-top: 15px;
}

/** 图片选择器 */

.mf-image-selector {
  width: 100%;
}

.mf-image-selector-header {
  display: flex;
  width: 100%;
}

.mf-image-selector-header .el-input {
  margin-right: 5px;
  width: 100%;
}

.mf-image-selector-preview {
  margin-right: 5px;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  align-items: center;
  justify-content: flex-start;
}

.mf-image-selector-item {
  margin-top: 8px;
  margin-right: 8px;
  text-align: center;
  line-height: 35px;
}

.mf-image-selector-preview-item {
  width: 120px;
  height: 100px;
  border-radius: 5px;
  border: 1px solid var(--el-border-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mf-image-selector-preview-item.__img {}

.mf-image-selector-preview-item.__media {}

.mf-image-selector-preview-item.__file {}

.mf-image-selector-item .el-image {
  width: 110px;
  height: 90px;
  cursor: pointer;
  overflow: hidden;
}

.mf-image-selector-item__close {
  width: 100%;
  max-height: 100px;
}

/** 附件选择对话框 **/

.mf-storage-dialog-items {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: flex-start;
  align-items: center;
}

.mf-storage-dialog-item {
  width: 130px;
  height: 150px;
  text-align: center;
  margin: 0 7px 10px;
}

.mf-storage-dialog-item-img {
  width: 130px;
  height: 120px;
  border: 2px solid #FFF;
  background: #F5F6FA;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mf-storage-dialog-item-img:hover {
  background: #D0DDFE;
}

.mf-storage-dialog-item-img.select {
  background: #D0DDFE;
  border: 2px solid #83a4f7;
}

.mf-storage-dialog-item-img img {
  max-width: 110px;
  max-height: 100px;
}

.mf-storage-dialog-footer {
  display: flex;
  justify-content: space-between;
}

/** mf-ueditor **/
.edui-default {
  line-height: 100%;
}

/* ====== 车间可视化布局 ====== */
.mf-page-equipment-position,
.mf-page-tooling-turret {
  --cell-size: 64px;
  --cell-gap: 8px;
  --cell-radius: 8px;
}

/* 刀塔换刀页：缩小车间布局图，让上方布局图 + 下方换刀界面在 1920×1080 一屏内放下 */
.mf-page-tooling-turret {
  --cell-size: 44px;
  --cell-gap: 5px;
  --cell-radius: 6px;
}
.mf-page-tooling-turret .slot-cell {
  font-size: 12px;
}
.mf-page-tooling-turret .area-header {
  padding: 4px 10px;
}
.mf-page-tooling-turret .area-title {
  font-size: 12px;
}
.mf-page-tooling-turret .area-sub {
  font-size: 11px;
}
.mf-page-tooling-turret .area-body {
  padding: 6px;
}
.mf-page-tooling-turret .col-flow {
  padding: 6px;
  gap: 5px;
}
.mf-page-tooling-turret .center-grid {
  padding: 6px;
  gap: 6px;
}
.mf-page-tooling-turret .center-row {
  gap: 6px;
}
.mf-page-tooling-turret .sub-group {
  padding: 4px;
  gap: 4px;
}
.mf-page-tooling-turret .sub-body {
  gap: 4px;
}
.mf-page-tooling-turret .legend {
  margin-top: 8px;
  gap: 12px;
}
.mf-page-tooling-turret .turret-col {
  padding: 10px;
}
.mf-page-tooling-turret .turret-col-title {
  margin: 0 0 8px;
  padding-bottom: 6px;
  font-size: 14px;
}
/* 压缩 el-card 内边距，进一步节省垂直空间 */
.mf-page-tooling-turret .el-card__body {
  padding: 10px;
}
.mf-page-tooling-turret .tab-toolbar {
  margin-bottom: 6px;
}

/* 刀塔换刀页：上方布局图机台方块选中高亮 */
.mf-page-tooling-turret .slot-cell.cell-selected {
  box-shadow: 0 0 0 3px #409eff;
  transform: scale(1.06);
}
.mf-page-tooling-turret .slot-cell.cell-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
/* 刀塔换刀页：下半区多栏布局（左刀塔 / 刀具 / 刀柄 / 右工装） */
.mf-page-tooling-turret .turret-bottom {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.mf-page-tooling-turret .turret-col {
  border: 1px solid #ebeef5;
  border-radius: 10px;
  padding: 14px;
  background: #fafbfc;
  box-sizing: border-box;
}
.mf-page-tooling-turret .turret-col-left {
  width: 320px;
  flex-shrink: 0;
}
.mf-page-tooling-turret .turret-col-center,
.mf-page-tooling-turret .turret-col-holder,
.mf-page-tooling-turret .turret-col-right {
  flex: 1;
  min-width: 0;
}
/* 合并框：刀具 + 刀柄占更宽 */
.mf-page-tooling-turret .turret-col-combined {
  flex: 2.2;
}
/* 工装框：更窄 */
.mf-page-tooling-turret .turret-col-right {
  flex: 0.9;
}
.mf-page-tooling-turret .turret-col-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #ebeef5;
}
.mf-page-tooling-turret .turret-list-scroll {
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 10px;
}
.mf-page-tooling-turret .tool-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.mf-page-tooling-turret .tool-row:hover {
  background: transparent;
}
.mf-page-tooling-turret .tool-row.active {
  background: #ecf5ff;
  outline: 1px solid #409eff;
}
/* 合并框：刀具 + 刀柄每刀位一行 */
.mf-page-tooling-turret .turret-title-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid #ebeef5;
  padding-bottom: 8px;
}
.mf-page-tooling-turret .turret-title-bar .turret-col-title {
  margin: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.mf-page-tooling-turret .tool-row-combined {
  gap: 10px;
  border-bottom: 1px solid #f0f0f0;
  padding: 8px 6px;
}
/* 列表表头 */
.mf-page-tooling-turret .tool-row-header {
  background: #f5f7fa;
  font-weight: 600;
  color: #606266;
  position: sticky;
  top: 0;
  z-index: 1;
  cursor: default;
}
.mf-page-tooling-turret .combined-head-cell {
  flex: 1;
  min-width: 0;
  padding: 0 8px;
  font-size: 13px;
  text-align: center;
}
.mf-page-tooling-turret .combined-head-pos {
  flex: 0 0 52px;
  width: 52px;
  padding: 0;
}
.mf-page-tooling-turret .tool-row-combined:last-child {
  border-bottom: none;
}
.mf-page-tooling-turret .combined-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #ebeef5;
  box-sizing: border-box;
}
.mf-page-tooling-turret .combined-cell:hover {
  background: #f0f7ff;
  border-color: #c6e2ff;
}
/* 单元格独立选中高亮（刀柄/刀具各自高亮） */
.mf-page-tooling-turret .combined-cell.cell-active {
  background: #ecf5ff;
  border-color: #409eff;
  box-shadow: 0 0 0 1px #409eff inset;
}
.mf-page-tooling-turret .combined-label {
  flex-shrink: 0;
  font-size: 11px;
  color: #909399;
  background: #f4f4f5;
  border-radius: 4px;
  padding: 1px 6px;
}
.mf-page-tooling-turret .combined-info {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.mf-page-tooling-turret .combined-name {
  font-size: 12px;
  color: #303133;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.mf-page-tooling-turret .combined-sub {
  font-size: 11px;
  color: #909399;
  flex-shrink: 0;
}
.mf-page-tooling-turret .combined-ops {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.mf-page-tooling-turret .op-link {
  color: #409eff;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
/* 更换/领用按钮：带边框，选中时高亮 */
.mf-page-tooling-turret .op-change {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid #c6e2ff;
  border-radius: 4px;
  background: #f0f7ff;
  line-height: 1.4;
}
.mf-page-tooling-turret .op-change.op-active {
  background: #409eff;
  border-color: #409eff;
  color: #fff;
}
/* 操作表单分区：刀柄在左、刀具在右 */
.mf-page-tooling-turret .op-split {
  display: flex;
  gap: 12px;
  border-top: 1px dashed #ebeef5;
  padding-top: 12px;
  margin-top: 8px;
}
.mf-page-tooling-turret .op-panel {
  flex: 1;
  min-width: 0;
  border: 1px solid #ebeef5;
  border-radius: 8px;
  padding: 10px;
  background: #fafbfc;
}
.mf-page-tooling-turret .op-panel-on {
  border-color: #409eff;
  background: #f5faff;
}
.mf-page-tooling-turret .op-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: #303133;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #ebeef5;
}
.mf-page-tooling-turret .op-panel-empty {
  font-size: 12px;
  color: #909399;
  text-align: center;
  padding: 20px 0;
}
.mf-page-tooling-turret .op-link:hover {
  text-decoration: underline;
}
.mf-page-tooling-turret .op-danger {
  color: #f56c6c;
}

/* 双标签页：车间布局图 / 位置管理 */
.mf-page-equipment-position .position-tabs > .el-tabs__header {
  margin-bottom: 16px;
}
.mf-page-equipment-position .position-tabs > .el-tabs__header .el-tabs__item {
  font-size: 15px;
  font-weight: 600;
}
.tab-toolbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: nowrap;
  gap: 10px;
}
.tab-tip {
  font-size: 12px;
  color: #909399;
  margin-right: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-total {
  font-weight: 600;
  color: #303133;
  white-space: nowrap;
}

.workshop-layout {
  display: flex;
  align-items: stretch;
  gap: 16px;
  min-width: 0;
}
.layout-left {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  min-width: 0;
}
.layout-left .area-center {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.layout-right {
  display: flex;
  flex-shrink: 0;
  width: 110px;
  min-width: 0;
}

.area-panel {
  border: 1px solid #ebeef5;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.area-panel.area-center {
  /* 与人工区外框一致（使用 .area-panel 默认样式） */
}
.area-panel.area-right {
  border: 2px solid #d9b46a;
  background: #fff8eb;
  width: 100%;
}
/* 右侧竖栏：人工CNC区+辅助设备区(同行) 在上，人工车床区、自动化车床区在下 */
.layout-right-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 600px;
  flex-shrink: 0;
  min-width: 0;
}
.layout-right-col > .area-panel {
  width: 100%;
}
/* 人工CNC区 + 辅助设备区 同行 */
.right-top-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}
/* 左列：人工CNC区(上) + 人工车床区(下) 紧贴 */
.manual-col {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* 单排不换行（必须定义在 .row-flow 之后，且提高特异性以覆盖 wrap） */
.row-nowrap.row-nowrap {
  flex-wrap: nowrap;
}
/* 右侧辅助设备：锯床区/磨床区/线切割区 纵向排列 */
.right-col {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 150px;
  flex-shrink: 0;
}
.right-col .area-header {
  white-space: nowrap;
}
/* 辅助设备区（与人工区外观一致） */
.area-right-compact {
  width: 100%;
}
.area-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 8px 14px;
  background: #f5f7fa;
  border-bottom: 1px solid #ebeef5;
}
.area-title {
  font-weight: 600;
  font-size: 14px;
}
.area-sub {
  font-size: 12px;
  color: #909399;
}
.area-body {
  padding: 10px;
}
.row-flow {
  display: flex;
  flex-wrap: wrap;
  gap: var(--cell-gap);
}
.col-flow {
  display: flex;
  flex-direction: column;
  gap: var(--cell-gap);
  padding: 10px;
}

.center-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}
.center-row {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  justify-content: start;
  gap: 10px;
  min-width: 0;
}
.sub-group {
  border: 1px dashed #ebeef5;
  border-radius: 8px;
  padding: 8px;
  background: #fafbfc;
  min-width: 0;
  width: max-content;
  max-width: 100%;
}
.sub-body {
  display: grid;
  gap: var(--cell-gap);
  min-width: 0;
}
.sub-body.sub-quad {
  grid-template-columns: repeat(2, min-content);
  justify-content: start;
  align-content: center;
}
.sub-body.sub-trio {
  grid-template-columns: repeat(3, min-content);
  justify-content: start;
  align-content: center;
}
/* 单行子区（如 C 区）容器高度收缩到内容，消除下方空白 */
.sub-group.sub-align-start {
  align-self: flex-start;
}
/* 单行子区（如 D 区）容器高度收缩到内容，整体贴行底部与同行下沿对齐 */
.sub-group.sub-align-end {
  align-self: end;
}

.slot-cell {
  width: var(--cell-size);
  height: var(--cell-size);
  border-radius: var(--cell-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s ease;
}
.slot-cell:hover {
  transform: scale(1.05);
}
.slot-cell.cell-normal {
  background: #67c23a;
  color: #fff;
  border: 2px solid #67c23a;
}
.slot-cell.cell-maintain {
  background: #e6a23c;
  color: #fff;
  border: 2px solid #e6a23c;
}
.slot-cell.cell-repair {
  background: #409eff;
  color: #fff;
  border: 2px solid #409eff;
}
.slot-cell.cell-stop {
  background: #f56c6c;
  color: #fff;
  border: 2px solid #f56c6c;
}
.slot-cell.cell-idle {
  background: #ecf5ff;
  color: #409eff;
  border: 2px solid #b3d8ff;
}
.slot-cell.cell-nonslot {
  background: #fdf6ec;
  color: #e6a23c;
  border: 2px solid #f5dab1;
}
.slot-cell.cell-free {
  background: #fff;
  color: #c0c4cc;
  border: 2px dashed #c0c4cc;
}
.slot-cell.cell-empty {
  visibility: hidden;
}

.empty-tip {
  font-size: 12px;
  color: #c0c4cc;
  padding: 16px;
  text-align: center;
  width: 100%;
}

.legend {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: #606266;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend-dot {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: inline-block;
}
.legend-dot.cell-normal  { background: #67c23a; }
.legend-dot.cell-maintain{ background: #e6a23c; }
.legend-dot.cell-repair  { background: #409eff; }
.legend-dot.cell-stop    { background: #f56c6c; }
.legend-dot.cell-free    { background: #fff;    border: 2px dashed #c0c4cc; }

/* 量具工具页 */
.mf-page-tooling-gauge .gauge-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.mf-page-tooling-gauge .gauge-pagination {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

/* 打印缓存侧边栏 */
.print-cache-badge { margin-left: 4px; }
.print-cache-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border: 1px solid #ebeef5;
  border-radius: 6px;
  margin-bottom: 8px;
}
.print-cache-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.print-cache-no {
  font-size: 13px;
  color: #303133;
  font-weight: 600;
}
.print-cache-time {
  font-size: 12px;
  color: #909399;
}
.print-cache-ops {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* 响应式 */
@media (max-width: 1280px) {
  .workshop-layout {
    flex-direction: column;
  }
  .layout-left {
    width: 100%;
    align-items: stretch;
  }
  .layout-right {
    width: 100%;
  }
  .center-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .center-row {
    grid-template-columns: 1fr;
  }
}