Optimizing Content Structure for LLMs and Search Engines: A Comprehensive Guide