// 主要樣式文件
@import './variables.scss';
@import './mixins.scss';
@import './components.scss';
@import './layouts.scss';

// 全局重置樣式
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
  font-size: 14px;
}

body {
  height: 100%;
  font-family: $font-family;
  background-color: var(--el-bg-color-page);
  color: var(--el-text-color-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  height: 100%;
}

// 滾動條樣式
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--el-fill-color-lighter);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--el-border-color);
  border-radius: 4px;
  
  &:hover {
    background: var(--el-border-color-darker);
  }
}

// Firefox 滾動條
* {
  scrollbar-width: thin;
  scrollbar-color: var(--el-border-color) var(--el-fill-color-lighter);
}

// 文字選擇顏色
::selection {
  background: var(--el-color-primary-light-8);
  color: var(--el-color-primary);
}

::-moz-selection {
  background: var(--el-color-primary-light-8);
  color: var(--el-color-primary);
}

// 通用輔助類別
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.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-column { 
  display: flex; 
  flex-direction: column; 
}

// 間距輔助類別
@for $i from 1 through 10 {
  .m-#{$i} { margin: #{$i * 4}px; }
  .mt-#{$i} { margin-top: #{$i * 4}px; }
  .mr-#{$i} { margin-right: #{$i * 4}px; }
  .mb-#{$i} { margin-bottom: #{$i * 4}px; }
  .ml-#{$i} { margin-left: #{$i * 4}px; }
  .mx-#{$i} { 
    margin-left: #{$i * 4}px; 
    margin-right: #{$i * 4}px; 
  }
  .my-#{$i} { 
    margin-top: #{$i * 4}px; 
    margin-bottom: #{$i * 4}px; 
  }
  
  .p-#{$i} { padding: #{$i * 4}px; }
  .pt-#{$i} { padding-top: #{$i * 4}px; }
  .pr-#{$i} { padding-right: #{$i * 4}px; }
  .pb-#{$i} { padding-bottom: #{$i * 4}px; }
  .pl-#{$i} { padding-left: #{$i * 4}px; }
  .px-#{$i} { 
    padding-left: #{$i * 4}px; 
    padding-right: #{$i * 4}px; 
  }
  .py-#{$i} { 
    padding-top: #{$i * 4}px; 
    padding-bottom: #{$i * 4}px; 
  }
}

// 響應式斷點
.hidden-xs {
  @include respond-to(xs) { display: none !important; }
}
.hidden-sm {
  @include respond-to(sm) { display: none !important; }
}
.hidden-md {
  @include respond-to(md) { display: none !important; }
}
.hidden-lg {
  @include respond-to(lg) { display: none !important; }
}

// 動畫類別
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s ease;
}

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

.slide-enter-active,
.slide-leave-active {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);
}

.slide-enter-from {
  transform: translateX(-20px);
  opacity: 0;
}

.slide-leave-to {
  transform: translateX(20px);
  opacity: 0;
}

// 卡片陰影
.card-shadow {
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

.card-hover-shadow {
  transition: box-shadow 0.3s ease;
  
  &:hover {
    box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.15);
  }
}

// 載入狀態
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}