/* --- 1. 全局变量和基础设置 --- */
:root {
    --primary-color: #3498db;      /* 主题色 - 蓝色 */
    --secondary-color: #2c3e50;    /* 文本和标题颜色 - 深灰蓝 */
    --background-color: #f4f7f6;   /* 页面背景色 - 浅灰 */
    --surface-color: #ffffff;      /* 卡片背景色 - 白色 */
    --light-gray-color: #95a5a6; /* 辅助性文字颜色 - 灰色 */
    --border-color: #ecf0f1;      /* 边框颜色 */
    
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Lato', sans-serif;
}

body {
    font-family: var(--font-body);
    line-height: 1.7;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--secondary-color);
}

/* --- 2. 头部和尾部样式 --- */
header {
    background-color: var(--surface-color);
    text-align: center;
    padding: 2rem 1rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

header h1 a {
    font-family: var(--font-heading);
    color: var(--primary-color);
    text-decoration: none;
    font-size: 2.5rem;
    transition: color 0.3s ease;
}

header h1 a:hover {
    color: var(--secondary-color);
}

footer {
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    background-color: var(--secondary-color);
    color: var(--surface-color);
}

/* --- 3. 主要内容和容器 --- */
main {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* --- 4. 文章列表卡片样式 (首页) --- */
.post-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 2rem; /* 卡片之间的间距 */
}

.post-card {
    background-color: var(--surface-color);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px); /* 鼠标悬停时轻微上浮 */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.post-card-title a {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--secondary-color);
    text-decoration: none;
}

.post-card-date {
    color: var(--light-gray-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.post-card-summary {
    color: #555;
}

.post-card-readmore a {
    display: inline-block;
    margin-top: 1.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.post-card-readmore a:hover {
    color: var(--secondary-color);
}

/* --- 5. 单篇文章页面样式 --- */
.post-full-content {
    background-color: var(--surface-color);
    border-radius: 8px;
    padding: 2rem 3rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
}

.post-full-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.post-full-date {
    color: var(--light-gray-color);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.post-full-body {
    white-space: pre-wrap; /* 保持博客文章中的换行和空格 */
    font-size: 1.1rem;
    line-height: 1.8;
}

.back-to-home {
    display: inline-block;
    margin-bottom: 2rem;
    font-size: 1rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}

.back-to-home:hover {
    text-decoration: underline;
}


/* --- 6. 响应式设计 --- */
@media (max-width: 768px) {
    header h1 a {
        font-size: 2rem;
    }
    .post-full-content {
        padding: 1.5rem;
    }
    .post-full-title {
        font-size: 2rem;
    }
}
