/* styles/base.scss - 基础样式 */

/* 重置样式 */
* {
  box-sizing: border-box;
}

page {
  background-color: $background-color;
  font-size: $font-size-md;
  line-height: $line-height-normal;
  color: $text-primary;
}

/* 通用布局 */
.container {
  padding: $spacing-md;
}

.page {
  min-height: 100vh;
  background-color: $background-color;
}

.page-content {
  padding: $spacing-md;
}

/* 卡片样式 */
.card {
  background: $background-white;
  border-radius: $border-radius-large;
  padding: $spacing-md;
  margin-bottom: $spacing-md;
  box-shadow: $shadow-light;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: $spacing-sm;
  
  .card-title {
    font-size: $font-size-lg;
    font-weight: bold;
    color: $text-primary;
  }
}

.card-body {
  color: $text-secondary;
  line-height: $line-height-large;
}

/* 按钮样式 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 24rpx 32rpx;
  border-radius: $border-radius-normal;
  font-size: $font-size-md;
  text-align: center;
  transition: all $animation-duration-normal;
  border: none;
  cursor: pointer;
  
  &.btn-block {
    width: 100%;
  }
  
  &.btn-large {
    padding: 32rpx 48rpx;
    font-size: $font-size-lg;
  }
  
  &.btn-small {
    padding: 16rpx 24rpx;
    font-size: $font-size-sm;
  }
  
  &.btn-primary {
    background-color: $primary-color;
    color: white;
    
    &:active {
      background-color: darken($primary-color, 10%);
    }
    
    &:disabled {
      background-color: $border-color;
      color: $text-disabled;
    }
  }
  
  &.btn-secondary {
    background-color: $background-light;
    color: $text-primary;
    border: 1rpx solid $border-color;
    
    &:active {
      background-color: $border-light;
    }
  }
  
  &.btn-success {
    background-color: $success-color;
    color: white;
    
    &:active {
      background-color: darken($success-color, 10%);
    }
  }
  
  &.btn-warning {
    background-color: $warning-color;
    color: white;
    
    &:active {
      background-color: darken($warning-color, 10%);
    }
  }
  
  &.btn-error {
    background-color: $error-color;
    color: white;
    
    &:active {
      background-color: darken($error-color, 10%);
    }
  }
}

/* 表单样式 */
.form-group {
  margin-bottom: $spacing-md;
}

.form-label {
  display: block;
  margin-bottom: $spacing-xs;
  font-size: $font-size-md;
  color: $text-primary;
  
  &.required::after {
    content: ' *';
    color: $error-color;
  }
}

.form-input {
  width: 100%;
  padding: 24rpx;
  border: 1rpx solid $border-color;
  border-radius: $border-radius-normal;
  font-size: $font-size-md;
  background-color: $background-white;
  
  &:focus {
    border-color: $primary-color;
    outline: none;
  }
  
  &:disabled {
    background-color: $background-light;
    color: $text-disabled;
  }
}

.form-textarea {
  @extend .form-input;
  height: 120rpx;
  resize: none;
}

.form-select {
  @extend .form-input;
  position: relative;
  
  &::after {
    content: '';
    position: absolute;
    right: 20rpx;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 10rpx solid transparent;
    border-right: 10rpx solid transparent;
    border-top: 10rpx solid $text-secondary;
  }
}

/* 列表样式 */
.list {
  background: $background-white;
  border-radius: $border-radius-large;
  overflow: hidden;
}

.list-item {
  padding: $spacing-md;
  border-bottom: 1rpx solid $border-light;
  display: flex;
  align-items: center;
  
  &:last-child {
    border-bottom: none;
  }
  
  &:active {
    background-color: $background-light;
  }
}

.list-item-content {
  flex: 1;
}

.list-item-title {
  font-size: $font-size-md;
  color: $text-primary;
  margin-bottom: 8rpx;
}

.list-item-subtitle {
  font-size: $font-size-sm;
  color: $text-secondary;
}

.list-item-extra {
  margin-left: $spacing-sm;
  color: $text-secondary;
}

/* 状态标签 */
.status-badge {
  display: inline-block;
  padding: 8rpx 16rpx;
  border-radius: 24rpx;
  font-size: $font-size-xs;
  font-weight: bold;
  
  &.status-pending {
    background-color: lighten($warning-color, 35%);
    color: $warning-color;
  }
  
  &.status-approved {
    background-color: lighten($success-color, 35%);
    color: $success-color;
  }
  
  &.status-rejected {
    background-color: lighten($error-color, 35%);
    color: $error-color;
  }
  
  &.status-reviewing {
    background-color: lighten($primary-color, 35%);
    color: $primary-color;
  }
}

/* 工具类 */
.text-center {
  text-align: center;
}

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

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

.text-primary {
  color: $text-primary;
}

.text-secondary {
  color: $text-secondary;
}

.text-success {
  color: $success-color;
}

.text-warning {
  color: $warning-color;
}

.text-error {
  color: $error-color;
}

.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;
}

.flex-1 {
  flex: 1;
}

/* 间距工具类 */
.mt-10 { margin-top: 10rpx; }
.mt-20 { margin-top: 20rpx; }
.mt-30 { margin-top: 30rpx; }
.mb-10 { margin-bottom: 10rpx; }
.mb-20 { margin-bottom: 20rpx; }
.mb-30 { margin-bottom: 30rpx; }
.ml-10 { margin-left: 10rpx; }
.ml-20 { margin-left: 20rpx; }
.mr-10 { margin-right: 10rpx; }
.mr-20 { margin-right: 20rpx; }

.p-10 { padding: 10rpx; }
.p-20 { padding: 20rpx; }
.p-30 { padding: 30rpx; }
.pt-10 { padding-top: 10rpx; }
.pt-20 { padding-top: 20rpx; }
.pb-10 { padding-bottom: 10rpx; }
.pb-20 { padding-bottom: 20rpx; }
.pl-10 { padding-left: 10rpx; }
.pl-20 { padding-left: 20rpx; }
.pr-10 { padding-right: 10rpx; }
.pr-20 { padding-right: 20rpx; }