reported much lower earnings than expected Thursday, and shares declined more than 2% in late trading. The e-commerce giant reported net income of $197 million, or 40 cents a share, on sales of $38 billion, a profit decline of 77% from the same quarter a year ago. Analysts on average expected Amazon to report earnings of $1.41 a share on sales of $37.2 billion. The company’s spending cut into profit, as fulfillment costs — the amount Amazon spends to fulfill customers’ orders on its e-commerce platform — rose about 33% from a year ago and spending on technology and content increased by about 43%. Amazon stock traded at all-time highs this week, making Amazon the fourth U.S. company with a market capitalization of $500 billion and briefly giving Chief Executive Jeff Bezos the title of richest man in the world, but shares declined about 2% in immediate after-hours action.