Other Balance Sheet Components - Accounts Receivable (Details) - USD ($)
12 Months Ended
Dec. 31, 2021
Dec. 31, 2020
Dec. 31, 2019
Accounts receivable, net:      
Accounts receivable due from third parties, gross $ 620,632,000 $ 343,220,000  
Total gross amount 765,739,000 527,166,000  
Allowance for credit losses:      
Balance at the beginning of the year (35,156,000) (36,594,000) $ (12,429,000)
Additional provision charged to expenses, net (19,702,000) (53,124,000) (38,561,000)
Write-off 12,208,000 54,562,000 14,396,000
Balance at the end of the year (42,650,000) (35,156,000) $ (36,594,000)
Accounts receivable, net 723,089,000 492,010,000  
Alibaba      
Accounts receivable, net:      
Accounts receivable due from related parties, gross 89,344,000 135,321,000  
Allowance for credit losses:      
Balance at the beginning of the year 0    
Balance at the end of the year 0 0  
Other related parties      
Accounts receivable, net:      
Accounts receivable due from related parties, gross 55,763,000 48,625,000  
Allowance for credit losses:      
Balance at the beginning of the year (6,095,000)    
Balance at the end of the year $ 0 $ (6,095,000)