@use './variables' as *;

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  font-family: $font-family;
  font-size: $font-size-base;
  color: $text-primary;
  background-color: $bg-color-page;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  width: 100%;
  height: 100%;
}

a {
  color: $primary-color;
  text-decoration: none;

  &:hover {
    text-decoration: underline;
  }
}

// 滚动条样式
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: $border-color;
  border-radius: 4px;

  &:hover {
    background: $text-secondary;
  }
}

// 文本省略
.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

// Flex 布局
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.flex-1 {
  flex: 1;
}

// 间距工具类
.mt-sm { margin-top: $spacing-sm; }
.mt-md { margin-top: $spacing-md; }
.mt-lg { margin-top: $spacing-lg; }
.mb-sm { margin-bottom: $spacing-sm; }
.mb-md { margin-bottom: $spacing-md; }
.mb-lg { margin-bottom: $spacing-lg; }
.ml-sm { margin-left: $spacing-sm; }
.ml-md { margin-left: $spacing-md; }
.mr-sm { margin-right: $spacing-sm; }
.mr-md { margin-right: $spacing-md; }

// Element Plus 样式覆盖
.el-button--primary {
  --el-button-bg-color: #{$primary-color};
  --el-button-border-color: #{$primary-color};
}

// 页面容器
.page-container {
  padding: $spacing-lg;
  min-height: 100%;
}

// 卡片样式
.card {
  background: #fff;
  border-radius: $border-radius-large;
  box-shadow: $box-shadow-light;
  padding: $spacing-md;
}

