.api-keys-page {
  min-height: 100vh;
  background: #f5f5f5;
  padding: 24rpx;
  padding-bottom: 120rpx;

  &__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24rpx;
  }

  &__title {
    font-size: 36rpx;
    font-weight: 600;
    color: #333;
  }

  &__create-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 32rpx;
    font-size: 26rpx;
    padding: 0 28rpx;
    height: 60rpx;
    line-height: 60rpx;

    &::after {
      border: none;
    }
  }

  &__tips {
    background: #fffbeb;
    border: 1px solid #ffe58f;
    border-radius: 12rpx;
    padding: 24rpx;
    margin-bottom: 24rpx;

    text {
      font-size: 26rpx;
      color: #d48806;
      line-height: 1.6;
    }
  }

  &__list {
    display: flex;
    flex-direction: column;
    gap: 24rpx;
  }

  &__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 120rpx 0;

    text {
      font-size: 30rpx;
      color: #999;
    }

    &-hint {
      margin-top: 16rpx;
      font-size: 26rpx !important;
      color: #ccc !important;
    }
  }

  &__loading,
  &__no-more {
    display: flex;
    justify-content: center;
    padding: 32rpx 0;

    text {
      font-size: 26rpx;
      color: #999;
    }
  }
}

// API Key 卡片
.api-key-card {
  background: #fff;
  border-radius: 16rpx;
  padding: 32rpx;
  box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.05);

  &__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24rpx;
  }

  &__info {
    display: flex;
    align-items: center;
    gap: 16rpx;
  }

  &__name {
    font-size: 32rpx;
    font-weight: 600;
    color: #333;
  }

  &__status {
    font-size: 24rpx;
    padding: 4rpx 12rpx;
    border-radius: 8rpx;
    background: #f5f5f5;
  }

  &__type {
    font-size: 24rpx;
    color: #666;
    background: #f0f0f0;
    padding: 4rpx 16rpx;
    border-radius: 8rpx;
  }

  &__body {
    padding: 24rpx;
    background: #fafafa;
    border-radius: 12rpx;
    margin-bottom: 24rpx;
  }

  &__row {
    display: flex;
    align-items: center;
    margin-bottom: 16rpx;

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

  &__label {
    font-size: 26rpx;
    color: #666;
    width: 140rpx;
    flex-shrink: 0;
  }

  &__value {
    font-size: 26rpx;
    color: #333;
    flex: 1;
    word-break: break-all;

    &--monospace {
      font-family: 'Monaco', 'Menlo', monospace;
      font-size: 24rpx;
    }
  }

  &__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  &__time {
    font-size: 24rpx;
    color: #999;
  }

  &__actions {
    display: flex;
    gap: 32rpx;
  }

  &__action {
    font-size: 26rpx;
    padding: 8rpx 16rpx;

    &--primary {
      color: #667eea;
    }

    &--danger {
      color: #ff4d4f;
    }
  }
}

// 创建弹窗
.api-keys-page__modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;

  &-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
  }

  &-content {
    position: relative;
    width: 100%;
    max-height: 80vh;
    background: #fff;
    border-radius: 32rpx 32rpx 0 0;
    padding: 48rpx 32rpx;
    padding-bottom: calc(48rpx + env(safe-area-inset-bottom));
    overflow-y: auto;
  }

  &-title {
    display: block;
    font-size: 36rpx;
    font-weight: 600;
    color: #333;
    text-align: center;
    margin-bottom: 48rpx;
  }
}

.api-keys-page__form {
  &-item {
    margin-bottom: 32rpx;
  }

  &-label {
    display: block;
    font-size: 28rpx;
    color: #333;
    margin-bottom: 16rpx;
  }

  &-input {
    width: 100%;
    height: 88rpx;
    background: #f5f5f5;
    border-radius: 12rpx;
    padding: 0 24rpx;
    font-size: 30rpx;
  }

  &-radio {
    display: flex;
    gap: 24rpx;

    &-item {
      flex: 1;
      height: 72rpx;
      line-height: 72rpx;
      text-align: center;
      background: #f5f5f5;
      border-radius: 12rpx;
      font-size: 28rpx;
      color: #666;

      &.active {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: #fff;
      }
    }
  }
}

.api-keys-page__modal-actions {
  display: flex;
  gap: 24rpx;
  margin-top: 48rpx;
}

.api-keys-page__modal-btn {
  flex: 1;
  height: 88rpx;
  line-height: 88rpx;
  border-radius: 44rpx;
  font-size: 32rpx;

  &--cancel {
    background: #f5f5f5;
    color: #666;
  }

  &--confirm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;

    &::after {
      border: none;
    }
  }
}
