.yc-card {
  position: relative;
  background: var(--color-bg-2);
  transition:
    box-shadow 0.2s cubic-bezier(0, 0, 1, 1),
    -webkit-box-shadow 0.2s cubic-bezier(0, 0, 1, 1);
  font-size: 14px;
  display: flex;
  flex-direction: column;

  .yc-card-header {
    overflow: hidden;
    border-bottom: 1px solid var(--color-neutral-3);
    display: flex;
    justify-content: space-between;
    align-items: center;

    .yc-card-header-title {
      flex: 1;
      font-size: 16px;
      color: var(--color-text-1);
      font-weight: 500;
      line-height: 1.5715;
    }

    .yc-card-header-extra {
      color: rgb(var(--primary-6));
    }
  }

  .yc-card-body {
    color: var(--color-text-2);

    .yc-card-cover {
      overflow: hidden;
    }

    .yc-card-actions {
      margin-top: 20px;
      display: flex;
      align-items: center;
      justify-content: flex-end;

      .yc-card-actions-right {
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--color-text-2);
        transition: color 0.2s cubic-bezier(0, 0, 1, 1);
      }
    }
  }
}
// bordered
.yc-card-bordered {
  border: 1px solid var(--color-neutral-3);
  border-radius: var(--border-radius-small);
  .yc-card-body {
    .yc-card-cover {
      border-radius: var(--border-radius-small) var(--border-radius-small) 0 0;
    }
  }
}
// hoverable
.yc-card-hoverable {
  &:hover {
    box-shadow: 0 4px 10px rgb(var(--gray-2));
  }
}
// loading
.yc-card-loading {
  .yc-card-body {
    .yc-spin {
      width: 100%;
    }
  }
}
// has-grid
.yc-card.yc-card-contain-grid {
  & > .yc-card-body {
    margin: 0 -1px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
  }
}
// size
@size: {
  @mini: {
    header-height: 40px;
    header-padding: 10px;
    body-padding: 16px;
  };
  @small: {
    header-height: 40px;
    header-padding: 8px;
    body-padding: 12px;
  };
  @medium: {
    header-height: 46px;
    header-padding: 10px;
    body-padding: 16px;
  };
  @large: {
    header-height: 40px;
    header-padding: 10px;
    body-padding: 16px;
  };
};

each(@size, .(@value, @name) {
  @key: replace(~"@{name}", "@", "");
  .yc-card-size-@{key} {
    .yc-card-header {
      height: @value[header-height];
      padding: @value[header-padding] 16px;
    }
    .yc-card-body {
      padding: @value[body-padding] 16px;
    }
  }
});
