Investments - Summary of Amortized Cost, Gross Unrealized Gains and Losses, Fair Value and Level in Fair Value Hierarchy for Investments (Details) - USD ($) $ in Thousands | Sep. 30, 2019 | Dec. 31, 2018 |
Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | $ 88,337 | $ 47,199 |
Level 1 | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 88,337 | 47,199 |
Level 2 | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 0 | 0 |
Short-term investments | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Amortized Cost | 185,243 | 175,736 |
Gross Unrealized Gains | 387 | 0 |
Gross Unrealized (Losses) | (8) | (696) |
Short-term investments | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 185,622 | 175,040 |
Short-term investments | Level 1 | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 94,764 | 69,605 |
Short-term investments | Level 2 | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 90,858 | 105,435 |
Short-term investments | U.S. government and agency bonds | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Amortized Cost | 106,135 | 112,995 |
Gross Unrealized Gains | 204 | 0 |
Gross Unrealized (Losses) | (7) | (486) |
Short-term investments | U.S. government and agency bonds | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 106,332 | 112,509 |
Short-term investments | U.S. government and agency bonds | Level 1 | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 94,764 | 69,605 |
Short-term investments | U.S. government and agency bonds | Level 2 | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 11,568 | 42,904 |
Short-term investments | Corporate bonds | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Amortized Cost | 71,329 | 56,235 |
Gross Unrealized Gains | 156 | 0 |
Gross Unrealized (Losses) | (1) | (210) |
Short-term investments | Corporate bonds | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 71,484 | 56,025 |
Short-term investments | Corporate bonds | Level 1 | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 0 | 0 |
Short-term investments | Corporate bonds | Level 2 | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 71,484 | 56,025 |
Short-term investments | Certificates of deposit | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Amortized Cost | 7,779 | 6,506 |
Gross Unrealized Gains | 27 | 0 |
Gross Unrealized (Losses) | 0 | 0 |
Short-term investments | Certificates of deposit | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 7,806 | 6,506 |
Short-term investments | Certificates of deposit | Level 1 | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 0 | 0 |
Short-term investments | Certificates of deposit | Level 2 | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 7,806 | 6,506 |
Long-term investments | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Amortized Cost | 30,877 | 140,865 |
Gross Unrealized Gains | 187 | 142 |
Gross Unrealized (Losses) | (58) | (223) |
Long-term investments | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 31,006 | 140,784 |
Long-term investments | Level 1 | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 9,979 | 64,086 |
Long-term investments | Level 2 | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 21,027 | 76,698 |
Long-term investments | U.S. government and agency bonds | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Amortized Cost | 27,873 | 90,458 |
Gross Unrealized Gains | 125 | 99 |
Gross Unrealized (Losses) | (20) | (155) |
Long-term investments | U.S. government and agency bonds | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 27,978 | 90,402 |
Long-term investments | U.S. government and agency bonds | Level 1 | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 9,979 | 64,086 |
Long-term investments | U.S. government and agency bonds | Level 2 | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 17,999 | 26,316 |
Long-term investments | Corporate bonds | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Amortized Cost | 814 | 46,743 |
Gross Unrealized Gains | 44 | 43 |
Gross Unrealized (Losses) | (38) | (68) |
Long-term investments | Corporate bonds | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 820 | 46,718 |
Long-term investments | Corporate bonds | Level 1 | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 0 | 0 |
Long-term investments | Corporate bonds | Level 2 | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 820 | 46,718 |
Long-term investments | Certificates of deposit | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Amortized Cost | 2,190 | 3,664 |
Gross Unrealized Gains | 18 | 0 |
Gross Unrealized (Losses) | 0 | 0 |
Long-term investments | Certificates of deposit | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 2,208 | 3,664 |
Long-term investments | Certificates of deposit | Level 1 | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 0 | 0 |
Long-term investments | Certificates of deposit | Level 2 | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 2,208 | 3,664 |
Money market mutual funds | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 83,342 | 47,199 |
Money market mutual funds | Level 1 | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 83,342 | 47,199 |
Money market mutual funds | Level 2 | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 0 | $ 0 |
U.S. government and agency bonds | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 4,995 | |
U.S. government and agency bonds | Level 1 | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 4,995 | |
U.S. government and agency bonds | Level 2 | Recurring fair value measurements | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | $ 0 | |