This nitrogen-containing heterocyclic compound or pharmaceutically acceptable salt thereof is, for example, useful as a prophylactic and/or therapeutic agent and the like for dermatosis and the like. The present invention provides a heterocyclic compound represented by general formula (I) or a pharmaceutically acceptable salt and the like thereof that is, for example, useful as a prophylactic and/or therapeutic agent for dermatosis and the like.[In the formula, for example, X