290 lines
7.6 KiB
HTML
290 lines
7.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>{% block title %}人,是一根会思考的芦苇{% endblock %}</title>
|
|
|
|
<!-- highlight.js 样式(护眼低对比主题) -->
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/styles/github.min.css">
|
|
|
|
<style>
|
|
/* ===== Reset ===== */
|
|
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
|
|
/* ===== 基础变量(✅ 背景改为米黄色) ===== */
|
|
:root {
|
|
--bg: #fdfaf3; /* ✅ 米黄色背景 */
|
|
--text: #1a1a1a;
|
|
--text-light: #6b6b6b;
|
|
--text-muted: #9b9b9b;
|
|
--accent: #333333;
|
|
--border: #e8e8e8;
|
|
--code-bg: #f6f6f6;
|
|
--radius: 4px;
|
|
}
|
|
|
|
/* ===== 全局 ===== */
|
|
body {
|
|
font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC",
|
|
"STSong", "Times New Roman", serif;
|
|
font-size: 17px;
|
|
line-height: 1.85;
|
|
color: var(--text);
|
|
background: var(--bg);
|
|
-webkit-font-smoothing: antialiased;
|
|
}
|
|
|
|
/* ===== 布局 ===== */
|
|
.container {
|
|
max-width: 680px;
|
|
margin: 0 auto;
|
|
padding: 0 1.5rem;
|
|
}
|
|
|
|
/* ===== 头部 ===== */
|
|
header {
|
|
padding: 3rem 0 2rem;
|
|
text-align: center;
|
|
border-bottom: 1px solid var(--border);
|
|
margin-bottom: 3rem;
|
|
}
|
|
|
|
header h1 {
|
|
font-size: 1.4rem;
|
|
font-weight: 700;
|
|
letter-spacing: 0.02em;
|
|
}
|
|
|
|
header h1 a {
|
|
color: var(--text);
|
|
text-decoration: none;
|
|
}
|
|
|
|
nav {
|
|
margin-top: 1rem;
|
|
}
|
|
|
|
nav a {
|
|
color: var(--text-light);
|
|
text-decoration: none;
|
|
margin: 0 0.8rem;
|
|
font-size: 0.9rem;
|
|
font-family: -apple-system, "Noto Sans SC", sans-serif;
|
|
}
|
|
|
|
nav a:hover {
|
|
color: var(--text);
|
|
}
|
|
|
|
/* ===== 文章列表 ===== */
|
|
.post-item {
|
|
margin-bottom: 2.5rem;
|
|
}
|
|
|
|
.post-item h2 {
|
|
font-size: 1.2rem;
|
|
font-weight: 600;
|
|
margin-bottom: 0.3rem;
|
|
}
|
|
|
|
.post-item h2 a {
|
|
color: var(--text);
|
|
text-decoration: none;
|
|
}
|
|
|
|
.post-item h2 a:hover {
|
|
text-decoration: underline;
|
|
text-decoration-thickness: 1px;
|
|
text-underline-offset: 3px;
|
|
}
|
|
|
|
.post-date {
|
|
font-size: 0.85rem;
|
|
color: var(--text-muted);
|
|
font-family: -apple-system, "Noto Sans SC", sans-serif;
|
|
}
|
|
|
|
.post-summary {
|
|
margin-top: 0.5rem;
|
|
color: var(--text-light);
|
|
font-size: 0.95rem;
|
|
}
|
|
|
|
/* ===== 文章详情 ===== */
|
|
article h1 {
|
|
font-size: 1.6rem;
|
|
font-weight: 700;
|
|
line-height: 1.4;
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.article-meta {
|
|
font-size: 0.85rem;
|
|
color: var(--text-muted);
|
|
margin-bottom: 2.5rem;
|
|
font-family: -apple-system, "Noto Sans SC", sans-serif;
|
|
}
|
|
|
|
.article-meta span {
|
|
margin-right: 1rem;
|
|
}
|
|
|
|
/* 正文排版 */
|
|
.post-body {
|
|
font-size: 17px;
|
|
line-height: 1.9;
|
|
}
|
|
|
|
.post-body h2 {
|
|
font-size: 1.25rem;
|
|
font-weight: 600;
|
|
margin: 2.2em 0 0.8em;
|
|
}
|
|
|
|
.post-body h3 {
|
|
font-size: 1.1rem;
|
|
font-weight: 600;
|
|
margin: 1.8em 0 0.6em;
|
|
}
|
|
|
|
.post-body p {
|
|
margin-bottom: 1.3em;
|
|
}
|
|
|
|
.post-body a {
|
|
color: var(--text);
|
|
text-decoration: underline;
|
|
text-decoration-color: var(--text-muted);
|
|
text-underline-offset: 3px;
|
|
}
|
|
|
|
.post-body a:hover {
|
|
text-decoration-color: var(--text);
|
|
}
|
|
|
|
.post-body img {
|
|
max-width: 100%;
|
|
height: auto;
|
|
margin: 1.5em 0;
|
|
border-radius: var(--radius);
|
|
}
|
|
|
|
.post-body blockquote {
|
|
border-left: 3px solid var(--text-muted);
|
|
padding: 0.5em 0 0.5em 1.2em;
|
|
margin: 1.5em 0;
|
|
color: var(--text-light);
|
|
font-style: italic;
|
|
}
|
|
|
|
.post-body ul, .post-body ol {
|
|
margin-bottom: 1.3em;
|
|
padding-left: 1.5em;
|
|
}
|
|
|
|
.post-body li {
|
|
margin-bottom: 0.4em;
|
|
}
|
|
|
|
/* ===== 代码块(✅ 优化 + highlight.js 兼容) ===== */
|
|
.post-body pre {
|
|
background: #f4f4f4;
|
|
padding: 1.2em;
|
|
border-radius: var(--radius);
|
|
overflow-x: auto;
|
|
margin: 1.5em 0;
|
|
font-size: 14px;
|
|
line-height: 1.6;
|
|
}
|
|
|
|
.post-body code {
|
|
font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
|
|
font-size: 0.9em;
|
|
}
|
|
|
|
.post-body p code,
|
|
.post-body li code {
|
|
background: var(--code-bg);
|
|
padding: 0.15em 0.4em;
|
|
border-radius: 3px;
|
|
}
|
|
|
|
/* highlight.js 代码块微调 */
|
|
.post-body pre code.hljs {
|
|
background: transparent;
|
|
padding: 0;
|
|
}
|
|
|
|
/* ===== 分类/标签 ===== */
|
|
.tags, .categories {
|
|
margin-top: 3rem;
|
|
padding-top: 1.5rem;
|
|
border-top: 1px solid var(--border);
|
|
font-size: 0.85rem;
|
|
color: var(--text-light);
|
|
font-family: -apple-system, "Noto Sans SC", sans-serif;
|
|
}
|
|
|
|
.tags a, .categories a {
|
|
color: var(--text-light);
|
|
text-decoration: none;
|
|
margin-right: 0.8rem;
|
|
}
|
|
|
|
.tags a:hover, .categories a:hover {
|
|
color: var(--text);
|
|
text-decoration: underline;
|
|
}
|
|
|
|
/* ===== 页脚 ===== */
|
|
footer {
|
|
margin-top: 5rem;
|
|
padding: 2rem 0;
|
|
text-align: center;
|
|
font-size: 0.8rem;
|
|
color: var(--text-muted);
|
|
border-top: 1px solid var(--border);
|
|
font-family: -apple-system, "Noto Sans SC", sans-serif;
|
|
}
|
|
|
|
/* ===== 响应式 ===== */
|
|
@media (max-width: 768px) {
|
|
body { font-size: 16px; }
|
|
header { padding: 2rem 0 1.5rem; margin-bottom: 2rem; }
|
|
.post-body { font-size: 16px; }
|
|
article h1 { font-size: 1.35rem; }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<header>
|
|
<h1><a href="/">人,是一根会思考的芦苇</a></h1>
|
|
<nav>
|
|
<a href="/">首页</a>
|
|
<a href="/archive/">归档</a>
|
|
<a href="/about/">关于</a>
|
|
</nav>
|
|
</header>
|
|
|
|
<main>
|
|
{% block content %}{% endblock %}
|
|
</main>
|
|
|
|
<footer>
|
|
<p>© 2024 郭安的小站 · 用 Django 构建</p>
|
|
</footer>
|
|
</div>
|
|
|
|
<!-- highlight.js 核心脚本 -->
|
|
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/highlight.min.js"></script>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
document.querySelectorAll('pre code').forEach(function (block) {
|
|
hljs.highlightElement(block);
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |