:root {
    --primary-color: #3B5998;
    --secondary-color: #a8c1f3;
    --text-color: #839ccf;
    --light-gray: #f5f5f5;
    --border-radius-base: 8px;      /* 基本圆角 */
    --border-radius-card: 12px;     /* 卡片圆角 */
    --border-radius-small: 8px;     /* 小组件圆角 */
    --transition-speed: 0.3s;
    --sidebar-bg: #3B5998;
    --sidebar-hover: #4c70ba;
}

/* Blog-specific styles */
.blog-container {
    max-width: 100%;
    min-height: 100vh;
    margin: 0 auto;
    padding: 0 1rem;
}

.blog-header {
    text-align: center;
    padding: 2rem 0;
    background: linear-gradient(135deg, #f8fafc, #ffffff);
    border-radius: var(--border-radius-card);
    margin-bottom: 2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.blog-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.blog-subtitle {
    font-size: 1.1rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.blog-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
}

.blog-stat {
    text-align: center;
}

.blog-stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.blog-stat-label {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.loading-container {
    text-align: center;
    padding: 3rem;
}

.loading-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #e1e4e8;
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.blog-posts {
    display: grid;
    gap: 2rem;
}

.blog-post {
    background: #ffffff;
    border-radius: var(--border-radius-card);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.blog-post:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.blog-post::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(59, 89, 152, 0.02);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.blog-post:hover::after {
    opacity: 1;
}

.blog-post-layout {
    display: flex;
    align-items: stretch;
    min-height: 140px;
}

.blog-post-thumbnail {
    flex: 0 0 160px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.blog-thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-post:hover .blog-thumbnail-img {
    transform: scale(1.05);
}

.blog-thumbnail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #94a3b8;
    font-size: 3rem;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}

.blog-post-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.blog-post-header {
    padding: 1rem 1rem 0.5rem;
    border-bottom: none;
}

.blog-post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.75rem;
    color: #64748b;
    flex-wrap: wrap;
}

.blog-post-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-post-labels {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.blog-post-label {
    background: #eff6ff;
    color: var(--primary-color);
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-small);
    font-size: 0.7rem;
    font-weight: 500;
}

.blog-post-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0;
    line-height: 1.3;
}

.blog-post-content {
    padding: 0.5rem 1rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-post-excerpt {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 0;
    flex: 1;
    font-size: 0.9rem;
}

.no-posts {
    text-align: center;
    padding: 3rem;
    color: #64748b;
}

.error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 1rem;
    border-radius: var(--border-radius-card);
    margin-bottom: 2rem;
    text-align: center;
}

/* Blog Detail Page Styles */
.blog-detail-container {
    max-width: 800px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: var(--border-radius-card);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.blog-detail-header {
    padding: 2rem;
    border-bottom: 1px solid #e1e4e8;
    background: linear-gradient(135deg, #f8fafc, #ffffff);
}

.back-to-blog-btn {
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-small);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.back-to-blog-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
}

.blog-detail-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: #64748b;
    flex-wrap: wrap;
}

.blog-detail-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-detail-labels {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.blog-detail-label {
    background: #eff6ff;
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius-small);
    font-size: 0.75rem;
    font-weight: 500;
}

.blog-detail-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
    margin: 0;
}

.blog-detail-content {
    padding: 1.5rem;
}

.blog-detail-body {
    color: #374151;
    line-height: 1.7;
    font-size: 1rem;
}

.blog-detail-body h1,
.blog-detail-body h2,
.blog-detail-body h3,
.blog-detail-body h4,
.blog-detail-body h5,
.blog-detail-body h6 {
    color: #1e293b;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.blog-detail-body h1 { font-size: 2rem; }
.blog-detail-body h2 { font-size: 1.75rem; }
.blog-detail-body h3 { font-size: 1.5rem; }
.blog-detail-body h4 { font-size: 1.25rem; }
.blog-detail-body h5 { font-size: 1.1rem; }
.blog-detail-body h6 { font-size: 1rem; }

.blog-detail-body p {
    margin-bottom: 1.5rem;
}

.blog-detail-body ul,
.blog-detail-body ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.blog-detail-body li {
    margin-bottom: 0.5rem;
}

.blog-detail-body blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: #64748b;
    font-style: italic;
    background: #f8fafc;
    padding: 1rem;
    border-radius: 0 var(--border-radius-small) var(--border-radius-small) 0;
}

.blog-detail-body code {
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-small);
    font-size: 0.875rem;
    color: #e11d48;
}

.blog-detail-body pre {
    background: #1e293b;
    color: #f1f5f9;
    padding: 1.5rem;
    border-radius: var(--border-radius-small);
    overflow-x: auto;
    margin: 1.5rem 0;
}

.blog-detail-body pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.blog-detail-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-small);
    margin: 1.5rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.blog-detail-body a {
    color: var(--primary-color);
    text-decoration: underline;
    transition: color 0.2s ease;
}

.blog-detail-body a:hover {
    color: var(--secondary-color);
}

.blog-detail-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.875rem;
}

.blog-detail-body th,
.blog-detail-body td {
    border: 1px solid #e1e4e8;
    padding: 0.75rem;
    text-align: left;
}

.blog-detail-body th {
    background: #f8fafc;
    font-weight: 600;
    color: #1e293b;
}

.blog-detail-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #e1e4e8;
    background: #f8fafc;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.blog-detail-stats {
    display: flex;
    gap: 1.5rem;
}

.blog-detail-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.875rem;
}

.view-on-github-btn {
    background: #24292e;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-small);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.view-on-github-btn:hover {
    background: #1a1e22;
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .blog-title {
        font-size: 2rem;
    }
    
    .blog-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .blog-post-layout {
        flex-direction: column;
        min-height: auto;
    }
    
    .blog-post-thumbnail {
        flex: 0 0 120px;
        order: -1;
    }
    
    .blog-post-main {
        order: 2;
    }
    
    .blog-post-header {
        padding: 0.75rem 1rem 0.25rem;
    }
    
    .blog-post-content {
        padding: 0.25rem 1rem 0.75rem;
    }
    
    .blog-post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .blog-post-title {
        font-size: 1.1rem;
    }
    
    /* Blog Detail Mobile Styles */
    .blog-detail-header {
        padding: 1.5rem;
    }
    
    .blog-detail-title {
        font-size: 1.75rem;
    }
    
    .blog-detail-content {
        padding: 1rem;
    }
    
    .blog-detail-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .blog-detail-footer {
        padding: 1rem 1.5rem;
        flex-direction: column;
        align-items: stretch;
    }
    
    .blog-detail-stats {
        justify-content: center;
        margin-bottom: 1rem;
    }
    
    .view-on-github-btn {
        text-align: center;
        justify-content: center;
    }
}
