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

// 导入主题系统
@use './theme/index.scss';

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

html,
body,
#app {
  width: 100%;
  height: 100%;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  background-color: var(--bg-page);
  transition: background-color var(--transition-base) var(--transition-timing),
    color var(--transition-base) var(--transition-timing);
}

a {
  text-decoration: none;
  color: inherit;

  &:hover {
    color: var(--color-primary);
  }
}

ul,
ol {
  list-style: none;
}

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

::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border-radius: var(--radius-full);
  transition: background-color var(--transition-base);

  &:hover {
    background-color: var(--scrollbar-thumb-hover);
  }
}

::-webkit-scrollbar-track {
  background-color: var(--scrollbar-track);
}

// 通用类
.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-col {
  display: flex;
  flex-direction: column;
}

.flex-1 {
  flex: 1;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-end {
  justify-content: flex-end;
}

.gap-sm {
  gap: var(--spacing-sm);
}

.gap-md {
  gap: var(--spacing-md);
}

.gap-lg {
  gap: var(--spacing-lg);
}

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

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-primary {
  color: var(--text-primary);
}

.text-regular {
  color: var(--text-regular);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-success {
  color: var(--color-success);
}

.text-warning {
  color: var(--color-warning);
}

.text-danger {
  color: var(--color-danger);
}

.font-medium {
  font-weight: var(--font-weight-medium);
}

.font-semibold {
  font-weight: var(--font-weight-semibold);
}

.clearfix::after {
  content: '';
  display: table;
  clear: both;
}

// 页面容器
.page-container {
  padding: var(--content-padding);
  height: 100%;
  overflow-y: auto;
  background-color: var(--bg-container);
  border-radius: var(--radius-lg);
  // box-shadow: var(--shadow-sm);
}

// 搜索表单
.search-form {
  padding: var(--spacing-base);
  background-color: var(--bg-container);
  border-radius: var(--radius-base);
  margin-bottom: var(--spacing-base);
}

// 表格操作按钮
.table-actions {
  margin-bottom: var(--spacing-base);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

// 分页
.pagination {
  margin-top: var(--spacing-lg);
  display: flex;
  justify-content: flex-end;
}

// 卡片
.card {
  background-color: var(--bg-container);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-base);
  padding: var(--spacing-lg);
}

// 主题切换过渡
.theme-transition {
  transition: background-color var(--transition-base) var(--transition-timing),
    border-color var(--transition-base) var(--transition-timing), color var(--transition-base) var(--transition-timing),
    box-shadow var(--transition-base) var(--transition-timing);
}
