@use '@/styles/variables' as *;

.withdrawals {
  display: flex;
  flex-direction: column;
  gap: 24px;

  &__header {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  &__title {
    font-size: 24px;
    font-weight: 600;
    color: $text-primary;
  }

  &__subtitle {
    font-size: 14px;
    color: $text-secondary;
  }

  &__card {
    background: $card-background;
    border-radius: 12px;
    padding: 24px;
    box-shadow: $shadow-base;
  }

  // 标签页
  &__tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid $border-color;
    padding-bottom: 0;
  }

  &__tab {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: $text-secondary;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: -1px;

    &:hover {
      color: $primary-color;
    }

    &--active {
      color: $primary-color;
      border-bottom-color: $primary-color;
    }
  }

  &__tabBadge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: 8px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    background: #ff4d4f;
    border-radius: 10px;
  }

  // 筛选区域
  &__filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
  }

  &__input {
    padding: 8px 12px;
    border: 1px solid $border-color;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    min-width: 140px;

    &:focus {
      outline: none;
      border-color: $primary-color;
    }
  }

  &__select {
    padding: 8px 12px;
    border: 1px solid $border-color;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    min-width: 140px;

    &:focus {
      outline: none;
      border-color: $primary-color;
    }
  }

  // 列表区域
  &__list {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  &__loading,
  &__empty,
  &__error {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 60px 20px;
    color: $text-secondary;
    font-size: 14px;
  }

  &__error {
    color: $error-color;
  }

  // 表格样式
  &__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;

    th,
    td {
      padding: 12px 16px;
      text-align: left;
      border-bottom: 1px solid $border-color;
    }

    th {
      font-weight: 600;
      color: $text-secondary;
      background: #fafafa;
    }

    td {
      color: $text-primary;
    }

    tbody tr {
      transition: background 0.15s;

      &:hover {
        background: #f5f7fa;
      }
    }
  }

  &__orderNo {
    font-family: monospace;
    font-size: 12px;
    color: $text-secondary;
  }

  &__amount {
    font-weight: 600;
    color: $primary-color;
    font-size: 15px;
  }

  &__fee {
    font-size: 12px;
    color: $text-secondary;
  }

  &__methodTag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;

    &--bank {
      background: #fff7e6;
      color: #fa8c16;
    }

    &--alipay {
      background: #e6f7ff;
      color: #1677ff;
    }

    &--wechat {
      background: #f6ffed;
      color: #52c41a;
    }
  }

  &__statusTag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
  }

  &__accountSequence {
    font-weight: 600;
    color: $primary-color;
    font-size: 13px;
  }

  &__userId {
    font-size: 12px;
    color: $text-secondary;
  }

  &__paymentInfo {
    font-size: 12px;
    line-height: 1.5;

    &Label {
      color: $text-secondary;
    }

    &Value {
      color: $text-primary;
      font-weight: 500;
    }
  }

  // 操作按钮
  &__actions {
    display: flex;
    gap: 8px;
  }

  &__actionBtn {
    padding: 4px 10px;
    font-size: 13px;
    color: $text-secondary;
    background: transparent;
    border: 1px solid $border-color;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;

    &:hover {
      color: $primary-color;
      border-color: $primary-color;
    }

    &--success {
      color: #52c41a;
      border-color: #52c41a;

      &:hover {
        background: #f6ffed;
      }
    }

    &--danger {
      &:hover {
        color: $error-color;
        border-color: $error-color;
      }
    }

    &--primary {
      color: $primary-color;
      border-color: $primary-color;

      &:hover {
        background: #e6f4ff;
      }
    }
  }

  // 分页
  &__pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid $border-color;
    font-size: 14px;
    color: $text-secondary;
  }

  &__pageButtons {
    display: flex;
    gap: 8px;
  }

  // 弹窗表单
  &__form {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  &__formGroup {
    display: flex;
    flex-direction: column;
    gap: 6px;

    label {
      font-size: 14px;
      font-weight: 500;
      color: $text-primary;
    }

    input,
    select,
    textarea {
      padding: 10px 12px;
      border: 1px solid $border-color;
      border-radius: 8px;
      font-size: 14px;
      transition: border-color 0.2s;

      &:focus {
        outline: none;
        border-color: $primary-color;
      }

      &::placeholder {
        color: $text-disabled;
      }
    }

    textarea {
      resize: vertical;
      min-height: 80px;
    }
  }

  &__modalFooter {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
  }

  // 详情样式
  &__detail {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  &__detailSection {
    padding: 16px;
    background: #fafafa;
    border-radius: 8px;
  }

  &__detailTitle {
    font-size: 14px;
    font-weight: 600;
    color: $text-primary;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid $border-color;
  }

  &__detailRow {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 8px;

    &:last-child {
      margin-bottom: 0;
    }
  }

  &__detailLabel {
    flex-shrink: 0;
    width: 80px;
    font-size: 13px;
    color: $text-secondary;
  }

  &__detailValue {
    flex: 1;
    font-size: 13px;
    color: $text-primary;
  }

  // 统计卡片
  &__stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
  }

  &__statCard {
    padding: 16px;
    background: #fafafa;
    border-radius: 8px;
    text-align: center;
  }

  &__statValue {
    font-size: 24px;
    font-weight: 600;
    color: $primary-color;
    margin-bottom: 4px;
  }

  &__statLabel {
    font-size: 13px;
    color: $text-secondary;
  }
}
