/* 页面容器 */
.page-container {
    max-width: 1200px;
    margin: 100px auto; /* 桌面端顶部边距 */
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
}

/* 主要内容区 */
.main-content {
    flex: 1;
    min-width: 0;
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* 页面内容样式继承文章样式 */
.page-content.article-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* 页面中的代码块样式 */
.page-content.article-content pre[class*="language-"] {
    margin: 2em 0;
    padding: 1.5em;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* 页面中的工具栏样式 */
.page-content.article-content div.code-toolbar > .toolbar {
    opacity: 1;
    top: 0.3em;
    right: 0.3em;
}

/* 页面中的图片样式 */
.page-content.article-content img {
    max-width: 100%;
    height: auto;
    margin: 2em auto;
    display: block;
}

/* 页面中的行内代码样式 */
.page-content.article-content :not(pre) > code {
    padding: 2px 5px;
    border-radius: 3px;
    background: #f5f5f5;
    color: #e83e8c;
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
}


/* 页面标题 */
.page-title {
    font-size: 2em;
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
    line-height: 1.4;
}

/* 页面分割线 */
.page-divider {
    height: 3px;
    background: linear-gradient(to right, #3498db, transparent);
    margin: 20px 0;
}

/* 页面元信息 */
.page-meta {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 0.9em;
    margin-bottom: 30px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.meta-item i {
    color: #3498db;
}

/* 特色图片 */
.page-featured-image {
    margin: -30px -30px 30px;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
}

.page-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* 页面内容 */
.page-content {
    line-height: 1.8;
    color: #333;
    font-size: 16px;
}

.page-content h2 {
    font-size: 1.5em;
    margin: 30px 0 15px;
    color: #2c3e50;
    font-weight: 600;
}

.page-content h3 {
    font-size: 1.3em;
    margin: 25px 0 15px;
    color: #34495e;
    font-weight: 600;
}

.page-content p {
    margin-bottom: 1.5em;
}

.page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 10px 0;
}

/* 分页链接 */
.page-links {
    margin: 30px 0;
    text-align: center;
}

.page-links span {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #f8f9fa;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .page-container {
        flex-direction: column;
        padding: 15px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .page-title {
        font-size: 1.5em;
    }
    
    .page-meta {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .page-featured-image {
        margin: -20px -20px 20px;
    }
    
    .page-content {
        font-size: 15px;
    }
}

/* 侧边栏基础样式 */
.sidebar {
    position: sticky;
    top: 30px;
    align-self: start;
}

/* 小部件通用样式 */
.widget {
    background: #fff;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.widget:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* 小部件标题样式 */
.widget-title {
    font-size: 1.2rem;
    color: #1a202c;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #edf2f7;
    position: relative;
    font-weight: 600;
}

/* 标题装饰线 */
.widget-title:after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: #3182ce;
    border-radius: 2px;
}

/* 作者卡片样式 */
.author-card {
    text-align: center;
}

.author-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 15px;
    overflow: hidden;
    border: 3px solid #fff;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
}

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

.author-card:hover .author-avatar img {
    transform: scale(1.05);
}

.author-name {
    font-size: 1.2rem;
    color: #2d3748;
    margin-bottom: 10px;
    font-weight: 600;
}

.author-bio {
    color: #718096;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.author-social {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 15px;
}

.social-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 热门文章列表样式 */
.popular-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.popular-item {
    display: flex;
    gap: 15px;
    text-decoration: none;
    padding-bottom: 15px;
    border-bottom: 1px solid #edf2f7;
    transition: transform 0.3s ease;
}

.popular-item:hover {
    transform: translateX(5px);
}

.popular-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.popular-image {
    flex: 0 0 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
}

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

.popular-item:hover .popular-image img {
    transform: scale(1.08);
}

.popular-info {
    flex: 1;
    min-width: 0; /* 防止文本溢出 */
}

.popular-info h4 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    line-height: 1.4;
    color: #2d3748;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.popular-item:hover .popular-info h4 {
    color: #3182ce;
}

.popular-info time {
    font-size: 0.85rem;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 分类列表样式 */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: 10px;
}

.category-list a {
    color: #2d3748;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    background: #f7fafc;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.category-list a:hover {
    color: #fff;
    background: #3182ce;
    transform: translateX(5px);
}

.category-count {
    background: #edf2f7;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    color: #4a5568;
    transition: all 0.3s ease;
}

.category-list a:hover .category-count {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* 标签云样式 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud a {
    padding: 6px 12px;
    background: #f7fafc;
    color: #4a5568;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem !important;
    transition: all 0.3s ease;
}

.tag-cloud a:hover {
    background: #3182ce;
    color: #fff;
    transform: translateY(-2px);
}



/* 打印样式 */
@media print {
    .page-container {
        display: block;
        padding: 0;
    }
    
    .main-content {
        box-shadow: none;
        padding: 0;
    }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .sidebar {
        width: 280px;
    }
    .page-container {
        max-width: 95%;
        margin: 100px auto;
    }
}

@media (max-width: 768px) {
    .page-container {
        grid-template-columns: 1fr;
        margin: 100px auto 20px; /* 调整移动端顶部边距 */
        padding: 0 15px;
    }
    
    .main-content {
        padding: 20px;
        width: 100%;
    }
    
    .page-title {
        font-size: 1.5em;
    }
    
    .page-meta {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .page-featured-image {
        margin: -20px -20px 20px;
    }
    
    .page-content {
        font-size: 15px;
    }

    /* 在移动端隐藏侧边栏 */
    .sidebar {
        display: none;
    }
    .widget {
        padding: 20px;
        margin-bottom: 20px;
    }

    /* 调整作者卡片在移动端的样式 */
    .author-avatar {
        width: 80px;
        height: 80px;
    }

    .author-name {
        font-size: 1.1rem;
    }

    /* 调整热门文章列表在移动端的样式 */
    .popular-image {
        flex: 0 0 70px;
        height: 70px;
    }

    /* 调整分类列表在移动端的样式 */
    .category-list a {
        padding: 8px 12px;
    }

    /* 调整标签云在移动端的样式 */
    .tag-cloud {
        gap: 6px;
    }

    .tag-cloud a {
        padding: 4px 10px;
        font-size: 0.85rem !important;
    }
}


/* 小屏手机的额外优化 */
@media (max-width: 480px) {
   .page-container {
        margin: 100px auto 15px; /* 小屏幕手机的顶部边距 */
        padding: 0 10px;
    }

    .main-content {
        padding: 15px;
    }
    
       .page-title {
        font-size: 1.3em;
    }

    .page-meta {
        font-size: 0.8em;
    }


    .widget {
        padding: 15px;
    }

   
    .popular-item {
        gap: 10px;
    }

    .popular-image {
        flex: 0 0 60px;
        height: 60px;
    }
}
