Facing declining ridership and rising complaints about conditions in downtown San Francisco stations, BART plans to take aim at what officials see as a possible reason for both — homelessness.

BART officials said Thursday they’ll clean up the stations, help homeless people who linger in them find shelter elsewhere and post and enforce its code of conduct.

Ridership on BART has grown to record numbers over the past six years and its trains have become uncomfortably crowded during the morning and evening commutes. But the strain is beginning to show. Ridership has been dropping — on weekends, during nonpeak hours and now, for the first time, during commutes.

Rider dissatisfaction, meanwhile, is on the rise. Crowded trains and unreliable service have frustrated passengers, and Paul Oversier, BART’s assistant general manager for operations, said complaints about the atmosphere in San Francisco’s downtown stations — the system’s busiest — are rising.

Passengers say they feel uncomfortable with dirty stations, open drug use and debris, homeless people sleeping and lingering in stations and panhandling.

BART has a policy prohibiting lying down or sitting with legs stretched out inside stations. Over the past couple of years, it has stepped up cleaning, including adding a deep-clean team that focuses on the busiest and often grimiest stations. But those efforts haven’t slowed the problems — or the complaints — as evidenced in BART customer satisfaction surveys.

“This is something where we need to do more than we’re doing now,” Oversier said during a budget discussion at a BART Board of Directors meeting.

Oversier outlined what he said would be a collaborative effort. BART will work with the San Francisco Municipal Transportation Agency, San Francisco’s homeless outreach teams and social service agencies. The strategy, still in its early stages, is planned for inclusion in the budget for the fiscal year that starts July 1.

In addition, Oversier said, BART plans to increase the number of workers it has cleaning the downtown stations — Embarcadero, Montgomery Street, Powell Street and Civic Center. The agency also plans to increase efforts to get homeless people into services or shelters. And it plans to put up higher barriers around paid areas as part of an effort to prevent people from entering stations unless they pay.

Bevan Dufty, a BART director and former head of San Francisco’s homeless services, said he sees the effort as a positive step, and not an effort to just roust people from stations and push them onto the streets.

“There is a level of engagement that hasn’t existed before at BART,” he said.

BART officials participated in a recent homeless roundtable he organized, Dufty said, and the transit agency is working with San Francisco’s Public Health Department on a program funded by a $5.9 million grant to steer addicts and mentally ill people into treatment instead of jail.

BART also plans to publicize a little-known customer code of conduct ordinance it passed in 2013 — and post signs at stations. Customer conduct ordinances are not unheard of at transit agencies. They typically require patrons to obey a series of rules — pay fares, don’t smoke, don’t litter, avoid eating and drinking, no panhandling or soliciting — and subject those who don’t comply to arrest, fines, refusal of service or being barred from the system.

Additional community service officers, unarmed officers without the power of arrest, would be added to help patrol downtown stations, he said. BART is already working to hire more than two dozen officers to bolster its force.

Rebecca Saltzman, the BART board president, said the agency is trying to take a legal, and humanitarian, approach to dealing with homeless people while keeping its stations safe and nonthreatening for riders.

“We’ve been focusing on getting people the homeless services they need,” she said. “But we also need to mitigate the impacts of people spending a huge amount of time in our stations and on our trains.”

With BART’s customer satisfaction ratings at a record low and its ridership in decline, the transit system is struggling to do whatever it can to make its riders happier.

BART still carries big crowds — averaging about 423,000 per weekday this fiscal year. Weekday trains are still crowded during commute times, but peak-hour ridership is beginning to slide — by 1 percent compared with the same time last year. Overall ridership is down 3.2 percent.

The ridership decline, which began near the end of last summer, is steepest on the weekends, when 7 percent fewer passengers are boarding BART. On weekdays, outside of the commute, the decline is 5 percent.

BART officials had expected the ridership surge over the past six years to taper off, just not so soon. They don’t know the reasons behind the drop. Crowded trains and a decrease in BART’s reliability are likely causes, along with the rise of electronically hailed ride services like Uber and Lyft.

Despite the ridership dip, and a decline in the amount of money BART collects from fares, the transit agency expects to be able to balance its budget for the coming year without significant service cuts or fare increases. That’s because the state’s recently approved transportation plan included enough money, about $16 million, to help BART fill more than half of its projected budget hole.

Michael Cabanatuan is a San Francisco Chronicle staff writer. Email: mcabanatuan@sfchronicle.com Twitter: @ctuan