Time-resolved photoluminescence measurements were used to characterize the photophysical properties of 6-thienyllumazine (TLm) fluorophores in cellulose acetate nanofibers (NFs) in the presence and absence of mercuric acetate salts. In solution, excited-state proton transfer (ESPT) from TLm to water molecules was observed at pH from 2 to 12. The insertion of the thienyl group into lumazine (Lm) introduces cis and trans conformers while keeping the same tautomerization structures. Global and target analysis was employed to resolve the true emission spectra of all prototropic, tautomeric, and rotameric species for TLm in water. However, in the NFs solid film no ESPT from TLm to a nearby water molecule was observed. The addition of NFs increases the excited-state lifetime of TLm in the solid state because of combined polarity/confinement effects. The solid-state fluorescence of TLm (in NFs) was quenched by mercuric acetate through different mechanisms—dynamic and static—depending on the applied pressure—atmospheric and vacuum, respectively. The new solid-state sensor is simple, ecofriendly, and instantly fabricated. 20 μmol TLm-loaded NFs is able to detect down to 200nmol of mercuric ions in aqueous media. The formation of the non-fluorescent ground-state complex between TLm molecules and mercuric ions inside the pores of NFs was achieved under vacuum condition