:root {
    --bg-color: #F8F9FA;
    --text-main: #1A202C;
    --text-muted: #64748B;
    --primary-color: #2563EB;
    --border-color: #E5E7EB;
    --code-bg: #F3F4F6;
    --content-width: 720px; /* 限制宽度以实现居中和易读性 */
}

/* 基础重置 */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Source Serif Pro', serif;
    line-height: 1.8;
}

/* 居中核心：container */
.container {
    max-width: var(--content-width);
    margin: 0 auto; /* 水平居中 */
    padding: 0 1.5rem;
}

/* 导航和页脚居中 */
.navbar, footer {
    width: 100%;
    padding: 2rem 0;
}

.post {
    margin-top: 4rem;
}

.post-content p {
    margin-bottom: 1.5rem;
}

/* 2. 修复代码高亮样式 */
pre {
    background: var(--code-bg);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto; /* 防止长代码撑开页面 */
    margin: 2rem 0;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Highlight.js 颜色补丁 (北欧风配色) */
.hljs-keyword { color: #2563EB; font-weight: bold; }
.hljs-string { color: #059669; }
.hljs-comment { color: #94A3B8; font-style: italic; }
.hljs-number { color: #D97706; }
.hljs-title, .hljs-function { color: #7C3AED; }
.hljs-attr { color: #9333EA; }

/* 紧凑型文章列表样式 */
.post-list .post-item {
    margin-bottom: 1.5rem; /* 每一项之间的垂直间距 */
    border-bottom: 1px solid var(--border-color); /* 可选：添加一条极淡的分隔线 */
    padding-bottom: 1rem;
}

.post-item:last-child {
    border-bottom: none;
}

.post-item h2 {
    font-size: 1.4rem; /* 稍微缩小首页标题字号 */
    margin: 0.2rem 0;
    line-height: 1.3;
}

.post-item time {
    font-size: 0.85rem;
    opacity: 0.8;
}

.post-item p {
    font-size: 0.95rem;
    margin-top: 0.2rem;
}

/* 修复文章内的列表排版 */
.post-content ul, 
.post-content ol {
    padding-left: 1.5rem; /* 关键：提供层级缩进空间 */
    margin-bottom: 1.5rem;
}

.post-content li {
    margin-bottom: 0.5rem;
    list-style-position: outside; /* 确保圆点在文字外面 */
}

/* 确保嵌套列表也有间距 */
.post-content ul ul, 
.post-content ol ol,
.post-content ul ol,
.post-content ol ul {
    margin-top: 0.5rem;
    margin-bottom: 0; 
}

/* 设置圆点样式，增加极简感 */
.post-content ul {
    list-style-type: disc; /* 第一级圆点 */
}

.post-content ul ul {
    list-style-type: circle; /* 第二级圆圈 */
}

.post-content ul ul ul {
    list-style-type: square; /* 第三级方块 */
}

/* 修复文章内的图片过宽问题 */
.post-content img {
    max-width: 100%;    /* 核心：图片宽度永远不会超过父容器宽度 */
    height: auto;       /* 核心：高度自动缩放，防止变形 */
    display: block;     /* 消除图片底部的微小空隙 */
    margin: 2rem auto;  /* 图片上下留白，并水平居中 */
    border-radius: 6px; /* 可选：稍微加一点圆角，符合北欧极简美学 */
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); /* 可选：给图片加一个非常淡的阴影，增加质感 */
}

/* 如果图片带有 title 属性，可以为其模拟一个简单的图注样式 */
.post-content img[title] {
    margin-bottom: 0.5rem;
}

/* 响应式调整：在小屏幕上微调图片边距 */
@media (max-width: 640px) {
    .post-content img {
        margin: 1.5rem auto;
        border-radius: 0; /* 手机端取消圆角通常看起来更有科技感 */
    }
}

@media (prefers-color-scheme: dark) {
    .post-content img {
        opacity: 0.85; /* 降低一点亮度 */
        transition: opacity 0.3s;
    }
    .post-content img:hover {
        opacity: 1; /* 鼠标悬停时恢复亮度 */
    }
}


/* 表格基础样式 */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
}

.post-content th, 
.post-content td {
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    text-align: left;
}

/* 表头背景 */
.post-content th {
    background-color: var(--code-bg);
    font-weight: 600;
}

/* 隔行变色（增加易读性） */
.post-content tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* 任务列表 (Todo List) 专项样式修复 */
.contains-task-list {
    list-style-type: none !important; /* 去掉任务列表前的圆点 */
    padding-left: 0.5rem !important;
}

.task-list-item {
    display: flex;
    align-items: center;
}

.task-list-item input[type="checkbox"] {
    margin-right: 0.8rem;
    width: 1.1rem;
    height: 1.1rem;
    cursor: default;
}