Investments - Schedule of Assets Measured on a Recurring and Nonrecurring Basis (Details) - USD ($) $ in Thousands | Jun. 30, 2019 | Dec. 31, 2018 |
Recurring fair value measurements: | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | $ 50,427 | $ 47,199 |
Recurring fair value measurements: | Money market mutual funds | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 50,427 | 47,199 |
Level 1 | Recurring fair value measurements: | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 45,439 | 47,199 |
Level 1 | Recurring fair value measurements: | Money market mutual funds | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 45,439 | 47,199 |
Level 2 | Recurring fair value measurements: | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 4,988 | 0 |
Level 2 | Recurring fair value measurements: | Money market mutual funds | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Cash equivalents | 4,988 | 0 |
Short-term investments | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Amortized Cost | 189,720 | 175,736 |
Gross Unrealized Gains | 244 | 0 |
Gross Unrealized (Losses) | (83) | (696) |
Short-term investments | Recurring fair value measurements: | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 189,881 | 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 | 69,779 | 69,605 |
Short-term investments | Level 1 | Recurring fair value measurements: | U.S. government and agency bonds | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 69,779 | 69,605 |
Short-term investments | Level 1 | Recurring fair value measurements: | Corporate bonds | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 0 | 0 |
Short-term investments | Level 1 | Recurring fair value measurements: | Certificates of deposit | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 0 | 0 |
Short-term investments | Level 2 | Recurring fair value measurements: | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 120,102 | 105,435 |
Short-term investments | Level 2 | Recurring fair value measurements: | U.S. government and agency bonds | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 33,999 | 42,904 |
Short-term investments | Level 2 | Recurring fair value measurements: | Corporate bonds | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 76,405 | 56,025 |
Short-term investments | Level 2 | Recurring fair value measurements: | Certificates of deposit | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 9,698 | 6,506 |
Short-term investments | U.S. government and agency bonds | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Amortized Cost | 103,776 | 112,995 |
Gross Unrealized Gains | 69 | 0 |
Gross Unrealized (Losses) | (67) | (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 | 103,778 | 112,509 |
Short-term investments | Corporate bonds | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Amortized Cost | 76,256 | 56,235 |
Gross Unrealized Gains | 162 | 0 |
Gross Unrealized (Losses) | (13) | (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 | 76,405 | 56,025 |
Short-term investments | Certificates of deposit | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Amortized Cost | 9,688 | 6,506 |
Gross Unrealized Gains | 13 | 0 |
Gross Unrealized (Losses) | (3) | 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 | 9,698 | 6,506 |
Long-term investments | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Amortized Cost | 62,365 | 140,865 |
Gross Unrealized Gains | 355 | 142 |
Gross Unrealized (Losses) | (43) | (223) |
Long-term investments | Recurring fair value measurements: | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 62,677 | 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 | 29,915 | 64,086 |
Long-term investments | Level 1 | Recurring fair value measurements: | U.S. government and agency bonds | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 29,915 | 64,086 |
Long-term investments | Level 1 | Recurring fair value measurements: | Corporate bonds | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 0 | 0 |
Long-term investments | Level 1 | Recurring fair value measurements: | Certificates of deposit | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 0 | 0 |
Long-term investments | Level 2 | Recurring fair value measurements: | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 32,762 | 76,698 |
Long-term investments | Level 2 | Recurring fair value measurements: | U.S. government and agency bonds | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 28,023 | 26,316 |
Long-term investments | Level 2 | Recurring fair value measurements: | Corporate bonds | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 818 | 46,718 |
Long-term investments | Level 2 | Recurring fair value measurements: | Certificates of deposit | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Fair Value | 3,921 | 3,664 |
Long-term investments | U.S. government and agency bonds | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Amortized Cost | 57,647 | 90,458 |
Gross Unrealized Gains | 294 | 99 |
Gross Unrealized (Losses) | (3) | (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 | 57,938 | 90,402 |
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) | (40) | (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 | 818 | 46,718 |
Long-term investments | Certificates of deposit | | |
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items] | | |
Amortized Cost | 3,904 | 3,664 |
Gross Unrealized Gains | 17 | 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 | $ 3,921 | $ 3,664 |