Rachel Bilson has made a career out of playing “the girl-next-door types” in shows including “The O.C.” and “Hart of Dixie.”

Now, she’s turning over a new leaf in ABCs comic procedural “Take Two.”

“It’s my first procedural,” says Bilson, 36. “I love that kind of stuff; I get into any show that’s a mystery. So I was like ‘Oh my gosh, I get to solve cases each week’ and it’s also funny at the same time. [Taking the role] was a no-brainer.”

In “Take Two,” premiering Thursday at 10 p.m., Bilson plays Sam Swift, a disgraced actress (dubbed a “Tabloid Trainwreck”) who’s shadowing a lone-wolf private detective while researching a new role to turn her career around. Eddie Cibrian (“CSI: Miami”) co-stars as Eddie, the PI. In a typical procedural (“The X-Files,” “Bones,” “Castle”) the man is often the wacky partner while the woman is more serious. “Take Two” takes this dynamic and turns it on its head.

“I like that it’s the straight man and the funny girl. That was my favorite part of the whole thing,” says Bilson. “She was just an awesome character to play — strong, independent, smart. I love to do comedy. ‘I Love Lucy’ is my favorite show of all time. So I’m all for anything that I could do in the comedic genre.”

While Sam often hatches elaborate schemes, Eddie operates more by-the-book in order to solve cases.

‘She was just an awesome character to play — strong, independent, smart. I love to do comedy.’

If “Take Two” sounds like a gender-swapped version of “Castle,” that’s because it’s helmed by that series’ former creators Andrew W. Marlowe and Terri Edda Miller. Bilson is essentially playing Richard Castle (Nathan Fillion) while Cibrian is this show’s Kate Beckett (Stana Katic).

“We worked well together,” Bilson says about Cibrian. “He’s super professional and nice and easy going.”

Like many shows in the genre, their characters have an undercurrent of a “will they or won’t they” dynamic but, Bilson says, “they’re really just working on the characters as partners and solving the cases.”

Bilson’s only challenge in shooting the show (which is set in LA but filmed in Vancouver) was balancing her schedule with her home life (she has a daughter, 3 and a half, with ex-fiance Hayden Christensen).

“Working as much as I do on a two-hander like this, figuring out the logistics was the most difficult part just because [my daughter] is only 3 and a half,” she says. “And for me, being mom is number one.”

Aside from “Take Two,” 2018 also marks 15 years since “The O.C.” first premiered, catapulting Bilson to prominence as Summer Roberts.

“People have asked me trivia about ‘The O.C.’ over the years and I can’t answer any of the questions,” she says, laughing. “I do still get approached with the Summer reference. It just goes to show that people really liked the show, and I think that’s awesome.”

“Take Two” Series premiere 10 p.m. Thursday on ABC