The system of quinone molecules encapsulated in the single-wall carbon nanotube (SWCNT) has been proposed as a next-generation cathode electrode material for rechargeable battery. We investigate the complex interaction among the SWCNT, phenanthrene-quinone (PhQ), and Li atoms in the encapsulated system by using our original DFT code. We thereby find that the shape of the SWCNT changes significantly in the relaxed state depending on the extent of Li atoms inserted. The SWCNT shows a circular cylinder shape when no Li exists. With sufficient Li atoms inserted, the SWCNT is flattened. Substantial electron transfer from the PhQs to SWCNT is found. As for the dynamics of Li atoms in insertion or extraction process, we find that the Li atoms can take either of the two paths: one is along the inner wall of the SWCNT and the other is hopping on the PhQs.