/* ============================================================
   blog.css — 阅读进度条 / 博客列表页 / 文章详情页
   [INPUT]: 依赖 base.css 的 CSS 变量（--pv-* 系列）
   [OUTPUT]: 博客相关所有页面样式
   [POS]: 博客功能专属样式，仅 index.html 使用
   [PROTOCOL]: 变更时更新此头部，然后检查 CLAUDE.md
   ============================================================ */

/* ============================================================
   Reading Progress Bar
   ============================================================ */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #213547, #4A7FA5);
    width: 0%;
    z-index: 1000;
    transition: width 0.1s ease;
}

/* ============================================================
   Blog List View
   ============================================================ */
#blog-list-view {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--pv-bg);
    z-index: 200;
    overflow-y: auto;
    padding: 40px 24px;
}

.blog-list-container {
    max-width: 800px;
    margin: 0 auto;
}

.posts-page-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 40px;
    color: var(--pv-title);
    font-family: var(--font-serif);
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.post-list-card {
    cursor: pointer;
    min-height: 80px;
    padding: 24px 32px;
}

.post-list-card .card-content { padding: 0; }

/* ============================================================
   Single Post View
   ============================================================ */
#post-view {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--pv-bg);
    z-index: 300;
    overflow-y: auto;
    padding: 40px 0;
}

.post-wrapper {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px;
}

.post-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Back Buttons */
.btn-back {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    border: 1px solid var(--pv-btn-border);
    color: var(--pv-btn-text);
    border-radius: 50px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-back:hover { background: var(--pv-btn-hover-bg); }

.btn-back-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    border: 1px solid var(--pv-btn-border);
    color: var(--pv-btn-text);
    border-radius: 50px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-back-pill:hover { background: var(--pv-btn-hover-bg); }

/* Post Header */
.post-header {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--pv-border);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.post-title {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 12px;
    color: var(--pv-title);
    font-family: var(--font-serif);
    -webkit-user-select: none;
    user-select: none;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--pv-text-secondary);
    font-size: 0.875rem;
    -webkit-user-select: none;
    user-select: none;
}

/* Post Body */
.post-body {
    color: var(--pv-text);
    line-height: 1.8;
    font-size: 1.1rem;
    -webkit-user-select: none;
    user-select: none;
}

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4,
.post-body h5,
.post-body h6 {
    color: var(--pv-heading);
    margin-top: 2em;
    margin-bottom: 1em;
    font-family: var(--font-serif);
}

.post-body h1 { font-size: 2rem; }
.post-body h2 { font-size: 1.75rem; }
.post-body h3 { font-size: 1.5rem; }
.post-body p  { margin-bottom: 1.5em; }

.post-body a {
    color: var(--pv-heading);
    text-decoration: underline;
}

.post-body code {
    background: var(--pv-code-bg);
    color: var(--pv-code-text);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.post-body pre {
    background: var(--pv-code-bg);
    padding: 1.5em;
    border-radius: 12px;
    overflow-x: auto;
    margin-bottom: 1.5em;
}

.post-body pre code { background: transparent; padding: 0; }

.post-body blockquote {
    background: var(--pv-blockquote-bg);
    border-left: 4px solid var(--pv-heading);
    padding: 1em 1.5em;
    margin: 1.5em 0;
    font-style: italic;
    color: var(--pv-text-secondary);
}

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

.post-body li  { margin-bottom: 0.5em; }
.post-body ul  { list-style: disc; }
.post-body ol  { list-style: decimal; }

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2em 0;
}

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

/* Post Footer */
.post-footer {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--pv-border);
}

.thanks {
    text-align: center;
    color: var(--pv-text-muted);
    font-size: 1rem;
    font-style: italic;
}

/* ============================================================
   Mobile
   ============================================================ */
@media (max-width: 768px) {
    .posts-page-title { font-size: 2.5rem; }

    .post-list-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 20px;
    }
}
