/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    color: #333;
    background-color: #f9f9f9; /* 添加背景色 */
}

header {
    border-bottom: 1px solid #eee;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    text-align: center; /* 居中对齐标题 */
}

header h1 {
    font-size: 2rem;
    color: #333;
}

/* 导航栏样式 */
nav {
    margin-top: 0.5rem;
    display: flex;
    justify-content: center; /* 居中对齐导航 */
    gap: 1rem; /* 增加导航链接之间的间距 */
    background-color: #eaeaea; /* 调整为稍深的灰色背景条 */
    padding: 10px 0; /* 增加上下内边距 */
    border-radius: 8px; /* 添加圆角 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 添加轻微阴影 */
}

nav a {
    padding: 8px 16px; /* 添加内边距 */
    color: #2f51af; /* 默认颜色调整为柔和的蓝色 */
    text-decoration: none; /* 移除下划线 */
    font-weight: bold; /* 加粗文字 */
    border: 2px solid transparent; /* 默认透明边框 */
    border-radius: 4px; /* 添加圆角 */
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease; /* 添加过渡效果 */
}

nav a:hover {
    background-color: #d6e4f0; /* 悬停时背景变为浅蓝色 */
    color: #003d80; /* 悬停时文字颜色调整为深蓝色 */
    border-color: #d6e4f0; /* 悬停时边框颜色与背景一致 */
}

nav a.active {
    background-color: #b3cde8; /* 当前页面的背景色调整为柔和的蓝色 */
    color: #003d80; /* 当前页面的文字颜色调整为深蓝色 */
    border-color: #b3cde8; /* 当前页面的边框颜色与背景一致 */
}


/* 文章列表样式 */
.post-list {
    margin-top: 2rem;
}

.post-preview {
    margin-bottom: 2rem;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff; /* 添加背景色 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 添加阴影 */
    transition: transform 0.2s ease, box-shadow 0.2s ease; /* 添加动画 */
}

.post-preview:hover {
    transform: translateY(-5px); /* 悬停时上移 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* 增强阴影 */
}

.post-preview h2 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    color: #333;
}

.post-preview h2 a {
    text-decoration: none;
    color: #007BFF;
}

.post-preview h2 a:hover {
    text-decoration: underline;
}

time {
    display: block;
    color: #666;
    font-size: 0.9em;
    margin-bottom: 0.5rem;
}

.post-preview p {
    margin: 0;
    color: #555;
}

/* 代码块样式 */
pre {
    background: #f8f8f8;
    padding: 1rem;
    overflow-x: auto;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-size: 0.9rem;
}

/* 资源页面样式 */
.resource-section {
    margin-bottom: 2rem;
}

.resource-section h2 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 1rem;
    border-bottom: 2px solid #007BFF;
    padding-bottom: 0.5rem;
}

.resource-section ul {
    list-style-type: none;
    padding: 0;
}

.resource-section li {
    margin-bottom: 0.5rem;
}

.resource-section a.url {
    color: #007BFF;
    text-decoration: none;
    font-weight: bold;
}

.resource-section a.url:hover {
    text-decoration: underline;
}

/* 页脚样式 */
footer {
    margin-top: 3rem;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

footer a {
    color: #007BFF;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .post-preview {
        padding: 0.8rem;
    }

    .post-preview h2 {
        font-size: 1.2rem;
    }
}

/* 让整个 article 可点击 */
.post-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.post-link:hover .post-preview {
    transform: translateY(-5px); /* 添加悬停效果 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* 增强阴影 */
}

/* 超链接样式 */
a.url {
    color: #1a73e8; /* 默认颜色改为更柔和的蓝色 */
    text-decoration: none; /* 移除下划线 */
    font-weight: bold; /* 加粗文字 */
    transition: color 0.3s ease, text-shadow 0.3s ease, transform 0.2s ease; /* 添加过渡效果 */
}

a.url:hover {
    color: #0c47a1; /* 悬停时颜色改为深蓝色 */
    text-shadow: 0 0 8px rgba(12, 71, 161, 0.6); /* 添加更明显的发光效果 */
    transform: scale(1.05); /* 悬停时轻微放大 */
    text-decoration: none !important; /* 确保悬停时没有下划线 */
}
/* 其他样式可以根据需要添加 */