What's the impact of former university's transcript on PhD application? I'm a junior majoring in chemistry and have a plan for applying Ph.D. after graduation. My current GPA is not distinct, just 3.65 out of 4 (Many people say 3.7 is competitive while 3.6 is like average if want to apply for top programs). My current school is awesome though and highly prestigious in Chemistry, ranks 10ish on USNEWS, I don't know if that helps when the GPA is not that top?

In addition, I'm a transfer student, which makes the things more complicated. Before coming to US, I spent 2 years at a Chinese university with an overall GPA 3.43/4.00 and rank maybe top 10%, which seems to be fine but not that satisfactory. The most serious problem is that I even got C for some important courses like Orgo 2 (well even I got an A in orgo 1...)and both 1,2 of p.chem. The average scores for these courses were around C and the failure rate was about 30% so luckily I at least didn't fail but just got an average score. That's terrible and I don't know if the past transcript will play extreme bad effects on my application. (Actually, I think I put more emphasis on some entrepreneur and voluntary activities, that was really time-consuming and meaningless...)

I want to do research in the biochemistry field. And it's a dilemma. The pChem seems to have no significant relation to my field of interest(ye, orgo 2 does...) but which are definitely important courses for a Chem major. And I'm wondering if sacrificing time to retake these courses is a better choice since I really want to take some grad level course during my senior year. If the good performance in upper-level courses can cover the bad grades in past?

And I know the research is extremely important for Ph.D. application. I did one in my former Univ. in my sophomore which is related to organic synthesis but was very basic. I didn't have some papers for this one I just started my second research last semester here at my current university. It's awesome the lab is closely related to my field of interest and the PI and Ph.D. mentor are really nice and helpful. But here comes the question, I think the lab is awesome and if I continue to involve there is possibility I can get some result maybe some publication? But the lab is very new and the PI just started her AP position here, definitely, she is willing to write a strong RL for me if I continue to work at her lab, but is the RL strong enough for a top program? (I know I'm greedy but... Everyone wants the best right)

I know it's a whole lot of questions and sorry for that...
Every field (chemistry vs. mathematics vs. history) is different and every PhD program at different universities you apply to is different. Also, who serves on the PhD admissions committee may change year-to-year.

Yes, many top-tier programs will look at your GPA. How much weight will they use to judge your application is variable. I can imagine a situation where the five professors on this years admission committee decide to stress class grades for incoming students.

Yes, many program will seriously consider any research you do, even if you never published anything. Simple being involved in an processor's research laboratory will most likely give you an advantage. I can imagine a situation where the five professors on next years admission committee decide to stress undergraduate research in incoming students.

My point is the following: You can't predict what will get you into a PhD program because it may change year-to-year. 

What I would do: It would be nice to find a way as an undergrad to research something, but I wouldn't stress about it being publicly published. It may be enough to have a strong undergraduate thesis, similar to a senior-project, that shows your research ability. That with a good recommendation letter from one (or more) professors you work with will be the building blocks of a strong application.