That said, there are pleasures to be had in watching “Non-Stop” director Jaume Collet-Serra and his star Blake Lively try to wring every scare out of this simple scenario, battling not just mediocre special effects but also a script that both artificially amplifies the stakes and adds an unconvincing emotional undercurrent. “The Shallows” is diverting escapism one wishes could have cut a little deeper.

Lively practically puts on a one-woman show as Nancy, a medical student mourning the recent death of her mother by going on a surfing expedition to a gorgeous, remote Mexican beach that her beloved mum once visited. Though an experienced surfer, Nancy is attacked by a shark about 200 yards from shore and forced to scurry to an exposed rock formation in the middle of the ocean to protect herself from becoming the beast’s next meal.

Written by Anthony Jaswinski, “The Shallows” uses that setup to establish a taut showdown between Nancy and the shark wherein our hero must figure out how she can get to safety without going into the water with her now-bloody leg. In films like “Non-Stop” and “Run All Night,” Collet-Serra has demonstrated a passion for pulpy genre fare, his movies playing like down-and-dirty, relatively low-budget studio thrillers. With “The Shallows,” this penchant for B-movie baseness is apparent in his slow, leering pans over Lively’s shapely bikini body, but it’s more effective in the film’s uncluttered suspense, which requires little more than a lone woman in peril, a terrifying shark, and a large body of water that separates the woman from help.

On screen in every scene, Lively brings a calm focus to her portrayal of Nancy, who because of her medical training can tend to her wounds expertly while thinking rationally about how to extricate herself from this life-or-death predicament.

Lively is a sympathetic presence, but there’s not much heft to the performance. Plus, Nancy’s seemingly tragic backstory — paired with the reveal that she decided to abandon medical school after becoming powerless in her mother’s fight against cancer — is imposed on the character in a forced way in the hopes that her present dilemma acquires a metaphoric, emotional dimension. (Her battle with the shark is really an inner struggle to go on living after her mother’s death.)

Ever since “Jaws” terrorized summer audiences almost exactly 41 years ago, filmmakers have exploited our fear of sharks hovering menacingly beneath the surface of the water. But in all that time, they’ve also had to contend with the fact that it can be difficult to produce realistic great whites, and in “The Shallows” that problem is compounded by shoddy effects shots that either involve Nancy surfing or, later, fighting to stay alive. The more that Collet-Serra raises the tension, the more ludicrous the story becomes, requiring Nancy’s nemesis to behave in ways that suggest it’s either super-intelligent or, more likely, obeying the whims of filmmakers who aren’t too fussed about logic.

As a result, the proceedings become increasingly hokey, even when Collet-Serra pulls out all the stops for a rousing finale that’s so gloriously ridiculous that one can’t help but almost admire his chutzpah. Even then, though, “The Shallows” feels hemmed in by its own limited imagination, tightening the screws on the typical shark-attack/lost-at-sea drama but still slavishly following those genres’ most familiar tenets.