BEIJING — President Trump says he is optimistic that a landmark trade deal with China is close. Chinese officials are not so sure.

The two sides in recent weeks agreed to the broad outlines of an agreement that would roll back tariffs in both countries, with China buying more American goods and opening up some markets to foreign goods. The trade deal looks like a good one for Beijing, since it would largely spare the government from making substantive changes to its economy.

But some of the biggest details — like the enforcement mechanism to ensure China complies and the timing for the removal of tariffs — still haven’t been hammered out. Beijing officials are wary that the final terms may be less favorable, especially given Mr. Trump’s propensity for last-minute changes, according to two people familiar with China’s position.

“The work team is still continuing to negotiate because we still have a lot to do,” Commerce Minister Zhong Shan said on the sidelines of the 11-day annual session of the National People’s Congress, which began on Tuesday. At the legislative meeting, senior Chinese officials have been taking turns warning that challenges remain.