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

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

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

  &__codeTag {
    display: inline-block;
    padding: 2px 8px;
    background: #e6f4ff;
    color: #1677ff;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
  }

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

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

    &--warning {
      &:hover {
        color: #faad14;
        border-color: #faad14;
      }
    }

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

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

  &__formRow {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    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;
      }

      &:disabled {
        background: #f5f5f5;
        cursor: not-allowed;
      }
    }

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

  &__formHint {
    font-size: 12px;
    color: $text-disabled;
  }

  &__userIdsInput {
    font-family: monospace;
    font-size: 13px;
    line-height: 1.6;
    min-height: 100px;
  }

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

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

  &__detailRow {
    display: flex;
    gap: 12px;
    align-items: flex-start;
  }

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

  &__json {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    overflow-x: auto;
    margin: 0;
    flex: 1;
  }

  &__disabledInput {
    background: #f5f5f5 !important;
    cursor: not-allowed;
  }

  // 多选复选框网格
  &__checkboxGrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  &__checkboxItem {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid $border-color;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;

    &:hover {
      border-color: $primary-color;
      background: #f0f5ff;
    }

    input[type='checkbox'] {
      width: 16px;
      height: 16px;
      cursor: pointer;
    }

    span {
      font-size: 14px;
      color: $text-primary;
    }

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

      span {
        color: $primary-color;
        font-weight: 500;
      }
    }
  }

  // 可排序列表
  &__sortableList {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fafafa;
    padding: 12px;
    border-radius: 8px;
    min-height: 50px;
  }

  &__sortableItem {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: white;
    border: 1px solid $border-color;
    border-radius: 8px;
    transition: box-shadow 0.2s;

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

  &__dragHandle {
    cursor: grab;
    color: $text-disabled;
    font-size: 16px;
    padding: 4px;

    &:active {
      cursor: grabbing;
    }
  }

  &__sortableIndex {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: $primary-color;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
  }

  &__sortableLabel {
    flex: 1;
    font-size: 14px;
    color: $text-primary;
  }

  &__sortableRemove {
    background: transparent;
    border: none;
    color: $text-disabled;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s;

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

  // 特殊扣减样式
  &__specialDeduction {
    margin-top: 16px;
    padding: 16px;
    background: #fff7e6;
    border: 1px solid #ffd591;
    border-radius: 8px;
  }

  &__specialDeductionTitle {
    font-size: 14px;
    font-weight: 600;
    color: #d46b08;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;

    &::before {
      content: '⚠️';
    }
  }

  // 单选按钮组
  &__radioGroup {
    display: flex;
    gap: 16px;
  }

  &__radioItem {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid $border-color;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;

    input[type='radio'] {
      width: 16px;
      height: 16px;
      cursor: pointer;
      accent-color: $primary-color;
    }

    span {
      font-size: 14px;
      color: $text-primary;
    }

    &:hover {
      border-color: $primary-color;
      background: #f0f5ff;
    }

    &:has(input:checked) {
      border-color: $primary-color;
      background: #e6f4ff;

      span {
        color: $primary-color;
        font-weight: 500;
      }
    }
  }

  // 全额线下结算模式提示
  &__modeHint {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    background: #e6f4ff;
    border: 1px solid #91caff;
    border-radius: 8px;
    margin-bottom: 12px;
  }

  &__modeHintIcon {
    flex-shrink: 0;
    font-size: 18px;
    color: #1677ff;
    line-height: 1.4;
  }

  &__modeHintText {
    flex: 1;

    strong {
      display: block;
      font-size: 14px;
      font-weight: 600;
      color: #1677ff;
      margin-bottom: 6px;
    }

    p {
      margin: 0 0 4px 0;
      font-size: 13px;
      color: $text-secondary;
      line-height: 1.5;

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