> no, we can't say at all that capital gains are unearned.

Yes, we can say this. The IRS classifies capital gains as unearned income.

The way the IRS uses technical terms has nothing to do with the ordinary lay person's concept of what is earned and what is not. (The main function of the IRS definition of "unearned income" is to define what kinds of income don't have to have payroll tax withheld.)