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

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

  // 筛选区域
  &__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;
  }

  &__accountTag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    background: #f0f5ff;
    color: #2f54eb;

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

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

  &__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;
  }

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

  &__txHash {
    font-family: monospace;
    font-size: 11px;
    color: $text-secondary;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  // 操作按钮
  &__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;
    }

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

  &__formHint {
    font-size: 12px;
    color: $text-secondary;
    margin-top: 4px;
  }

  &__formError {
    font-size: 12px;
    color: $error-color;
    margin-top: 4px;
  }

  &__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;
  }

  // 账户卡片列表
  &__accountCards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
  }

  &__accountCard {
    padding: 16px;
    background: #fafafa;
    border: 1px solid $border-color;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;

    &:hover {
      border-color: $primary-color;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    &--selected {
      border-color: $primary-color;
      background: #e6f4ff;
    }
  }

  &__accountCardName {
    font-size: 15px;
    font-weight: 600;
    color: $text-primary;
    margin-bottom: 8px;
  }

  &__accountCardSequence {
    font-size: 13px;
    color: $text-secondary;
    font-family: monospace;
  }

  &__accountCardBalance {
    font-size: 14px;
    color: $primary-color;
    font-weight: 500;
    margin-top: 8px;
  }

  // 警告信息
  &__warning {
    padding: 12px 16px;
    background: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 8px;
    color: #ad6800;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 16px;
  }
}
