/* ============================================================
   post.css · 文章排版专用
   继承全局样式，针对长文阅读进行优化
   ============================================================ */

/* ===== 文章容器 ===== */
.post-wrapper {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 24px 60px;
}

/* ===== 文章头部 ===== */
.post-header {
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 24px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.post-meta .tag {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 12px;
    border-radius: var(--radius-full);
    background: var(--primary-bg);
    color: var(--primary);
}

.post-title {
    font-size: 36px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.5px;
    color: var(--text);
    margin-bottom: 8px;
}

.post-title a {
    color: inherit;
    text-decoration: none;
}

.post-title a:hover {
    color: var(--primary);
}

.post-excerpt {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 8px;
}

/* ===== 文章正文 ===== */
.post-body {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text);
}

.post-body p {
    margin-bottom: 1.2em;
}

.post-body h2 {
    font-size: 26px;
    font-weight: 700;
    margin-top: 2em;
    margin-bottom: 0.6em;
    letter-spacing: -0.3px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}

.post-body h3 {
    font-size: 20px;
    font-weight: 700;
    margin-top: 1.6em;
    margin-bottom: 0.4em;
}

.post-body h4 {
    font-size: 17px;
    font-weight: 700;
    margin-top: 1.2em;
    margin-bottom: 0.3em;
}

.post-body ul,
.post-body ol {
    padding-left: 1.6em;
    margin-bottom: 1.2em;
}

.post-body li {
    margin-bottom: 0.3em;
}

.post-body blockquote {
    border-left: 4px solid var(--primary);
    padding: 12px 20px;
    margin: 1.4em 0;
    background: var(--bg-alt);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
    font-style: italic;
}

.post-body blockquote p:last-child {
    margin-bottom: 0;
}

.post-body code {
    font-family: "SF Mono", "Menlo", "Monaco", monospace;
    font-size: 0.9em;
    padding: 2px 6px;
    background: var(--bg-alt);
    border-radius: 4px;
    color: #d63384;
}

.post-body pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 1.4em 0;
    font-size: 14px;
    line-height: 1.7;
}

.post-body pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: 14px;
}

.post-body img,
.post-body video {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin: 1.4em 0;
    display: block;
}

.post-body figure {
    margin: 1.6em 0;
}

.post-body figcaption {
    text-align: center;
    font-size: 14px;
    color: var(--text-light);
    margin-top: 6px;
}

.post-body .video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-sm);
    margin: 1.4em 0;
}

.post-body .video-wrapper iframe,
.post-body .video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--radius-sm);
}

.post-body hr {
    border: none;
    border-top: 2px solid var(--border);
    margin: 2.4em 0;
}

/* ===== 文章底部 ===== */
.post-footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.post-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.post-tags a {
    font-size: 13px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    background: var(--bg-alt);
    color: var(--text-secondary);
    transition: all var(--transition);
}

.post-tags a:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

.post-share {
    display: flex;
    gap: 10px;
}

.post-share a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-alt);
    color: var(--text-secondary);
    transition: all var(--transition);
    font-size: 16px;
}

.post-share a:hover {
    background: var(--primary);
    color: #fff;
}

/* ===== 文章导航（上一篇/下一篇） ===== */
.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.post-nav a {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition);
    max-width: 45%;
}

.post-nav a:hover {
    color: var(--primary);
}

.post-nav .next {
    text-align: right;
}

/* ===== 相关文章 ===== */
.related-posts {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.related-posts h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.related-item {
    padding: 14px 16px;
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.related-item:hover {
    background: var(--primary-bg);
}

.related-item a {
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    display: block;
}

.related-item .date {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .post-wrapper {
        padding: 24px 16px 40px;
    }

    .post-title {
        font-size: 28px;
    }

    .post-excerpt {
        font-size: 16px;
    }

    .post-body {
        font-size: 16px;
    }

    .post-body h2 {
        font-size: 22px;
    }

    .post-body h3 {
        font-size: 18px;
    }

    .post-nav {
        flex-direction: column;
        gap: 8px;
    }

    .post-nav a {
        max-width: 100%;
    }

    .post-nav .next {
        text-align: left;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .post-title {
        font-size: 24px;
    }

    .post-body pre {
        font-size: 13px;
        padding: 12px 14px;
    }
}
