/* ===== 基础样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.8;
    color: #333;
    background: #f5f5f5;
}

/* ===== 容器：让内容居中且不占满屏幕 ===== */
.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== 顶部导航栏 ===== */
header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 60px 0 40px;
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2em;
    margin-bottom: 8px;
}

.subtitle {
    opacity: 0.85;
    font-size: 1.1em;
}

/* ===== 文章卡片 ===== */
.post-card {
    background: white;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.post-card h2 {
    margin-bottom: 8px;
}

.post-card h2 a {
    color: #333;
    text-decoration: none;
}

.post-card h2 a:hover {
    color: #667eea;
}

.post-meta {
    color: #999;
    font-size: 0.9em;
    margin-bottom: 12px;
}

.post-excerpt {
    color: #666;
    margin-bottom: 12px;
}

.read-more {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.read-more:hover {
    text-decoration: underline;
}

/* ===== 文章详情页 ===== */
.post-detail {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.post-detail h1 {
    font-size: 1.8em;
    margin-bottom: 10px;
}

.post-detail h2 {
    margin: 30px 0 10px;
    color: #444;
}

.post-detail p {
    margin-bottom: 16px;
}

.post-detail pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 16px;
    font-size: 0.9em;
}

.post-detail code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.post-detail pre code {
    background: none;
    padding: 0;
}

.post-detail ul {
    margin-bottom: 16px;
    padding-left: 24px;
}

.post-detail li {
    margin-bottom: 6px;
}

.back-link {
    display: inline-block;
    margin-top: 30px;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

/* ===== 页脚 ===== */
footer {
    text-align: center;
    padding: 30px 0;
    color: #999;
    font-size: 0.9em;
    margin-top: 40px;
}

/* ===== 手机端适配 ===== */
@media (max-width: 600px) {
    header {
        padding: 40px 0 30px;
    }

    header h1 {
        font-size: 1.5em;
    }

    .post-card, .post-detail {
        padding: 20px;
    }
}
