Files
personal-blog-20260928164707/static/css/style.css
T

314 lines
4.7 KiB
CSS

/* ---------- 基础样式 ---------- */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
"Hiragino Sans GB", "Microsoft YaHei", sans-serif;
color: #333;
background: #fafafa;
line-height: 1.75;
font-size: 16px;
}
a {
color: #2b6cb0;
text-decoration: none;
transition: color 0.2s ease;
}
a:hover {
color: #1a4d80;
}
.container {
max-width: 720px;
margin: 0 auto;
padding: 0 24px;
}
/* ---------- 头部 ---------- */
.site-header {
background: #fff;
border-bottom: 1px solid #eee;
padding: 20px 0;
margin-bottom: 48px;
}
.header-inner {
display: flex;
justify-content: space-between;
align-items: center;
}
.site-title {
font-size: 20px;
font-weight: 600;
color: #222;
letter-spacing: 0.5px;
}
.site-title:hover {
color: #2b6cb0;
}
.site-nav a {
margin-left: 20px;
color: #666;
font-size: 15px;
}
.site-nav a:hover {
color: #2b6cb0;
}
/* ---------- 首页 Hero ---------- */
.hero {
text-align: center;
margin-bottom: 56px;
}
.hero h1 {
font-size: 32px;
font-weight: 600;
color: #222;
margin-bottom: 12px;
}
.hero .subtitle {
color: #888;
font-size: 16px;
}
/* ---------- 文章列表 ---------- */
.post-list {
display: flex;
flex-direction: column;
gap: 40px;
}
.post-item {
padding-bottom: 32px;
border-bottom: 1px solid #eee;
}
.post-item:last-child {
border-bottom: none;
}
.post-title {
font-size: 22px;
font-weight: 600;
margin-bottom: 8px;
}
.post-title a {
color: #222;
}
.post-title a:hover {
color: #2b6cb0;
}
.post-meta {
color: #999;
font-size: 14px;
margin-bottom: 12px;
}
.post-summary {
color: #555;
margin-bottom: 12px;
}
.read-more {
font-size: 14px;
color: #2b6cb0;
}
.empty-tip {
color: #999;
text-align: center;
padding: 40px 0;
}
/* ---------- 文章详情 ---------- */
.post-detail {
background: #fff;
padding: 40px 36px;
border-radius: 8px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.post-header {
margin-bottom: 32px;
padding-bottom: 20px;
border-bottom: 1px solid #eee;
}
.post-header h1 {
font-size: 28px;
font-weight: 600;
color: #222;
margin-bottom: 8px;
line-height: 1.4;
}
.post-content h2 {
font-size: 20px;
margin: 32px 0 16px;
color: #222;
}
.post-content h3 {
font-size: 17px;
margin: 24px 0 12px;
color: #222;
}
.post-content p {
margin-bottom: 16px;
}
.post-content ul,
.post-content ol {
margin: 0 0 16px 24px;
}
.post-content li {
margin-bottom: 6px;
}
.post-content blockquote {
border-left: 3px solid #ddd;
padding: 8px 16px;
color: #666;
background: #f9f9f9;
margin: 16px 0;
border-radius: 0 4px 4px 0;
}
.post-content code {
background: #f4f4f4;
padding: 2px 6px;
border-radius: 4px;
font-size: 14px;
font-family: "SFMono-Regular", Consolas, Menlo, monospace;
}
.post-content pre {
background: #2d2d2d;
color: #f8f8f2;
padding: 16px;
border-radius: 6px;
overflow-x: auto;
margin: 16px 0;
}
.post-content pre code {
background: transparent;
padding: 0;
color: inherit;
}
.post-footer {
margin-top: 40px;
padding-top: 20px;
border-top: 1px solid #eee;
}
.back-link {
color: #666;
font-size: 14px;
}
.back-link:hover {
color: #2b6cb0;
}
/* ---------- 关于页面 ---------- */
.about {
background: #fff;
padding: 40px 36px;
border-radius: 8px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.about h1 {
font-size: 26px;
margin-bottom: 20px;
color: #222;
}
.about h2 {
font-size: 18px;
margin: 28px 0 12px;
color: #222;
}
.about p {
margin-bottom: 14px;
color: #444;
}
.contact-list {
list-style: none;
padding: 0;
}
.contact-list li {
margin-bottom: 8px;
color: #555;
}
/* ---------- 404 ---------- */
.not-found {
text-align: center;
padding: 80px 0;
}
.not-found h1 {
font-size: 72px;
color: #ddd;
margin-bottom: 16px;
}
.not-found p {
color: #888;
margin-bottom: 24px;
}
/* ---------- 底部 ---------- */
.site-footer {
margin-top: 80px;
padding: 32px 0;
text-align: center;
color: #aaa;
font-size: 14px;
border-top: 1px solid #eee;
}
/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
.hero h1 {
font-size: 26px;
}
.post-detail,
.about {
padding: 28px 20px;
}
.post-header h1 {
font-size: 22px;
}
.header-inner {
flex-direction: column;
gap: 12px;
}
.site-nav a {
margin: 0 10px;
}
}