@use './variables.scss' as *;

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: $bg-page;
  color: $text-primary;
}

#app {
  height: 100%;
}

// 滚动条样式 - 更精致
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
  
  &:hover {
    background: #9ca3af;
  }
}

// 工具类
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

// 页面过渡动画
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.2s ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

// 卡片样式 - 更精致
.page-card {
  background: #fff;
  border-radius: $radius-lg;
  padding: 24px;
  box-shadow: $shadow-sm;
  border: 1px solid $border-light;
}

// 统计数据样式
.stat-item {
  text-align: center;
  
  .stat-value {
    font-size: 28px;
    font-weight: 600;
    color: $text-primary;
  }
  
  .stat-label {
    font-size: 13px;
    color: $text-secondary;
    margin-top: 4px;
  }
}

// Element Plus 样式覆盖
.el-button {
  border-radius: $radius-base !important;
  font-weight: 500;
}

.el-input {
  --el-input-border-radius: #{$radius-base};
}

.el-select {
  --el-select-border-radius: #{$radius-base};
}

.el-card {
  border-radius: $radius-lg !important;
  border: 1px solid $border-light !important;
  box-shadow: $shadow-sm !important;
}

.el-dialog {
  border-radius: $radius-xl !important;
  overflow: hidden;
}

.el-message-box {
  border-radius: $radius-lg !important;
}

.el-tag {
  border-radius: $radius-sm !important;
}

.el-table {
  --el-table-border-color: #{$border-light};
  --el-table-header-bg-color: #{$bg-base};
  
  th.el-table__cell {
    font-weight: 600;
    color: $text-primary;
  }
}

// 表格行悬停
.el-table__row:hover > td.el-table__cell {
  background: $primary-color-light !important;
}

// 侧边栏折叠后的弹出菜单样式
.el-menu--vertical.el-menu--popup-container {
  .el-menu--popup {
    background: #fff !important;
    border-radius: $radius-lg;
    box-shadow: $shadow-lg;
    padding: 6px;
    min-width: 140px;
    
    .el-menu-item {
      height: 36px;
      line-height: 36px;
      border-radius: $radius-base;
      margin-bottom: 2px;
      padding: 0 16px !important;
      color: $text-regular;
      
      &:hover {
        background: $primary-color-light !important;
        color: $primary-color;
      }
      
      &.is-active {
        background: $primary-color-light !important;
        color: $primary-color !important;
      }
      
      .sub-menu-title {
        font-size: 13px;
      }
    }
  }
}
