提问背景 Question:
为什么,你发过来的不是代码,会渲染html的内容呢?
原生CSS重构百科页面方案
为了解决之前代码显示异常且依赖外部CDN的问题,我已将样式全部提取到内嵌的<style>标签中。以下是为您重构后的完整模板,它去除了冗长的类名,使用了标准的语义化HTML结构:
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<style>
body { font-family: sans-serif; background: #f8fafc; color: #334155; margin: 0; padding-bottom: 50px; }
.nav { height: 64px; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: space-between; max-width: 1000px; margin: auto; padding: 0 20px; }
.container { max-width: 1000px; margin: 24px auto; padding: 0 20px; }
.search-box { background: #0f172a; padding: 40px; border-radius: 20px; color: white; }
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.card { background: white; padding: 20px; border: 1px solid #e2e8f0; border-radius: 16px; }
.meta-line { font-size: 12px; color: #64748b; margin-top: 15px; display: flex; justify-content: space-between; }
.footer { text-align: center; font-size: 12px; color: #94a3b8; margin-top: 40px; }
</style>
</head>
<body>
<header class="nav"><div>🧠 AI 智库百科</div></header>
<main class="container">
<div class="search-box"><h1>检索高价值AI对话</h1></div>
<section class="card-grid">
<article class="card">
<h3>什么是 AI Agent?</h3>
<p>深度解析智能体核心架构...</p>
<div class="meta-line">
<span>标签: AI Agent, 概念</span>
<span>1,280次阅读 · 1小时前</span>
</div>
</article>
</section>
<footer class="footer">© 2024 AI 智库百科 版权所有</footer>
</main>
</body>
</html>