I read that the Fermi level is only correct when the subtrate is in thermal equilibrium (no external voltage applied on). I'm curious about what happened, for example, to the fermi level of a fully-depleted p-n junction
I'd rather say that Fermi level is spatially constant (not "correct") at thermal equilibrium. So, in case of a p-n junction with no applied bias, we have the same Fermi energy EF at every point of the structure (both in p and n regions).
When you apply bias, you have to consider that Fermi level of the side at a higher electric potential V will have a lower electron energy E than the side at a lower electric potential (remember that E=-qV for electrons). So, Fermi level is not spatially constant throughout a biased pn junction: two quasi-Fermi levels (with energies EFn and EFp) will establish in n and p sides respectively, each one being constant within its own region (both in the neutral and the depleted zones).
In case of forward bias, p-side potential is higher than n-side, so EFn>EFp.
In case of reverse bias, p-side potential is lower than n-side, so EFn
I'd rather say that Fermi level is spatially constant (not "correct") at thermal equilibrium. So, in case of a p-n junction with no applied bias, we have the same Fermi energy EF at every point of the structure (both in p and n regions).
When you apply bias, you have to consider that Fermi level of the side at a higher electric potential V will have a lower electron energy E than the side at a lower electric potential (remember that E=-qV for electrons). So, Fermi level is not spatially constant throughout a biased pn junction: two quasi-Fermi levels (with energies EFn and EFp) will establish in n and p sides respectively, each one being constant within its own region (both in the neutral and the depleted zones).
In case of forward bias, p-side potential is higher than n-side, so EFn>EFp.
In case of reverse bias, p-side potential is lower than n-side, so EFn
Fermi level, strictly speaking, is defined only when the entire system is in equilibrium. Such equilibrium can be disturbed by many interactions like shining light, applying a temperature difference, applying a electric potential difference. In all these cases, according to the rigorous definition, the concept of fermi level is inapplicable. However, the strength of non-equilibrium can come in two categories. In low non-equilibrium conditions, it is possible to extend the concept of fermi level and define quasi-fermi levels (like Marco mentioned) which helps us in device analysis. To do so, we cannot stick with the original rule of only one fermi level. In a reverse biased p-n junction, the electron and hole quasi-fermi levels are different. A single fermi level cannot describe the distribution of electrons/holes in such situations.
However, in extreme non-equilibrium, it is not possible to describe the energy distribution of electrons at all using simple analytical expressions like fermi distribution even if we try to split it into two fermi levels or as many levels as we want. Such cases can happen, for example, in the presence of large electric fields when hot-electrons start playing an important role.
At thermal equilibrium there is no shift in Fermi level. But if bias is applied then Fermi level will shift. For normal p-n junction diode, Fermi level will shift upward in n-side with respect to p-side if bias voltage is applied in forward direction, i.e. if positive terminal of the battery is connected to p-side that of negative to n-side.
You can find some further illustrations for the Fermi level under zero and forward bias here: http://dx.doi.org/10.13140/RG.2.1.4982.9203
As a further remark I would like to point out that in these transparancies (especially on pages 9a through 11c), the shape of the minorities' Fermi level is not exact but rather given schematically. In principle, one can determine the Quasi-Fermi level position numerically from the diffusion equation: Further away from the p-n junction, more minorities have recombined, and therefore the lower the relevant Quasi-Fermi level.
You can see in: https://en.wikipedia.org/wiki/Fermi_level
In particular in: Local conduction band referencing, internal chemical potential, and the parameter ζ,
Near the surface of a semiconductor or semimetal, ζ can be strongly controlled by externally applied electric fields, as is done in a field effect transistor.
And about problematic definition: Terminology problems.
So What do you think the Fp for a slab of biased n-type semiconductor should be illustrated, then? Is EF is splitting on the right side where it is connected to the positive voltage, or is it that the EFp is parallel with Fn in the bottom of the bandgap?
Well, since you consider a stationary situation for a biased n-type semiconductor (in the dark!), I guess that roughly nothing changes compared to the unbiased situation (in the dark!): The electrons are the majorities and carry the current, the holes do not play a role since they are the minorities. Also, there is just a single Fermi level, since there is no deviation from the law of mass action. (EF,p would only become a relevant quantity if there were additional injection processes, like e.g. illumination, that increase the density of the minorities above the level given by the law of mass action.)