// 全局样式

// 强制所有元素使用小米字体
* {
  font-family:
    'MiSans',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif !important;
}

.btn-icon {
  font-size: 10px;
}

.el-btn-red {
  color: #fa6962 !important;

  &:hover {
    opacity: 0.9;
  }

  &:active {
    opacity: 0.7;
  }
}

// 顶部进度条颜色
#nprogress .bar {
  background-color: color-mix(in srgb, var(--main-color) 65%, white);
}

// 处理移动端组件兼容性
@media screen and (max-width: $device-phone) {
  * {
    cursor: default !important;
  }

  .el-col2 {
    margin-top: 15px;
  }
}

// 背景滤镜
*,
::before,
::after {
  --tw-backdrop-blur: ;
  --tw-backdrop-brightness: ;
  --tw-backdrop-contrast: ;
  --tw-backdrop-grayscale: ;
  --tw-backdrop-hue-rotate: ;
  --tw-backdrop-invert: ;
  --tw-backdrop-opacity: ;
  --tw-backdrop-saturate: ;
  --tw-backdrop-sepia: ;
}

// 色弱模式
.color-weak {
  filter: invert(80%);
  -webkit-filter: invert(80%);
}

#noop {
  display: none;
}

// 语言切换选中样式
.langDropDownStyle {
  // 选中项背景颜色
  .is-selected {
    background-color: rgba(var(--art-gray-200-rgb), 0.8) !important;
  }

  // 语言切换按钮菜单样式优化
  .lang-btn-item {
    .el-dropdown-menu__item {
      padding-left: 13px !important;
      padding-right: 6px !important;
      margin-bottom: 3px !important;
    }

    &:last-child {
      .el-dropdown-menu__item {
        margin-bottom: 0 !important;
      }
    }

    .menu-txt {
      min-width: 60px;
      display: block;
    }

    i {
      font-size: 10px;
      margin-left: 10px;
    }
  }
}

// 盒子默认边框
.page-content,
.art-custom-card {
  border: 1px solid var(--art-card-border) !important;
}

// 盒子边框
[data-box-mode='border-mode'] {
  .page-content,
  .art-custom-card,
  .art-table-card {
    border: 1px solid var(--art-card-border) !important;
  }

  .layout-sidebar {
    border-right: 1px solid var(--art-card-border) !important;
  }
}

// 盒子阴影
[data-box-mode='shadow-mode'] {
  .page-content,
  .art-custom-card,
  .art-table-card {
    box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.04) !important;
    border: 1px solid rgba(var(--art-gray-300-rgb), 0.3) !important;
  }

  .layout-sidebar {
    border-right: 1px solid rgba(var(--art-gray-300-rgb), 0.4) !important;
  }
}

html,
body {
  touch-action: none; /* 禁用触摸事件 */
  overflow-x: hidden; /* 禁用横向滚动 */
}

// 元素全屏
.el-full-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 500;
  margin-top: 0;
  padding: 15px;
  box-sizing: border-box;
  background-color: var(--art-main-bg-color);

  .art-table-full-screen {
    height: 100% !important;
  }
}

// 表格卡片
.art-table-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: 15px;
  border-radius: calc(var(--custom-radius) / 2 + 2px) !important;

  .el-card__body {
    height: 100%;
    overflow: auto;
  }
}

.flex-row-sb {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.mt-20 {
  margin-top: 20px;
}

.flex-row-g20 {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 20px;
}

// 表单分段标题样式 - 用于对话框中的表单分段
.form-section-title {
  margin: 24px 0 16px 0;
  padding-left: 12px;
  border-left: 3px solid var(--el-color-primary);

  .title-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--el-text-color-primary);
  }
}
