/* 全局样式重置和基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏样式 */
header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: 15px 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.menu {
    list-style: none;
    display: flex;
}

.menu li {
    margin-left: 30px;
}

.menu a {
    color: #333;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s;
}

.menu a:hover {
    color: #007bff;
}

/* 主要内容区样式 */
main {
    padding: 40px 0;
    display: flex;
    justify-content: space-between;
}

/* 博客列表样式 */
.blog-list {
    width: 70%;
}

.blog-list h2 {
    margin-bottom: 30px;
    font-size: 28px;
    color: #333;
    position: relative;
}

.blog-list h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 60px;
    height: 3px;
    background-color: #007bff;
}

.blog-post {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    display: flex;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.blog-post:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.post-thumbnail {
    width: 30%;
    min-height: 180px;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content {
    width: 70%;
    padding: 20px;
}

.post-category {
    display: inline-block;
    background-color: #007bff;
    color: #fff;
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.post-title {
    margin-bottom: 15px;
}

.post-title a {
    color: #333;
    text-decoration: none;
    font-size: 20px;
    font-weight: bold;
    transition: color 0.3s;
}

.post-title a:hover {
    color: #007bff;
}

.post-excerpt {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.8;
}

.post-meta {
    display: flex;
    font-size: 14px;
    color: #999;
}

.post-meta span {
    margin-right: 20px;
}

/* 分页导航样式 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.pagination a {
    display: inline-block;
    padding: 10px 15px;
    margin: 0 5px;
    color: #333;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s;
}

.pagination a:hover {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

.pagination .current-page {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* 侧边栏样式 */
.sidebar {
    width: 28%;
}

.widget {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 30px;
}

.widget h3 {
    margin-bottom: 20px;
    font-size: 20px;
    color: #333;
    position: relative;
    padding-bottom: 10px;
}

.widget h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background-color: #007bff;
}

/* 搜索框样式 */
.search-form {
    display: flex;
}

.search-form input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
}

.search-form button {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-form button:hover {
    background-color: #0056b3;
}

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

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

.category-list a {
    color: #666;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dotted #eee;
    transition: color 0.3s;
}

.category-list a:hover {
    color: #007bff;
}

.category-list span {
    background-color: #f5f5f5;
    color: #999;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

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

.tag-cloud a {
    color: #666;
    text-decoration: none;
    padding: 6px 12px;
    background-color: #f5f5f5;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s;
}

.tag-cloud a:hover {
    background-color: #007bff;
    color: #fff;
}

/* 最新评论样式 */
.recent-comments {
    list-style: none;
}

.recent-comments li {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dotted #eee;
}

.recent-comments li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.recent-comments p {
    margin-bottom: 5px;
    line-height: 1.5;
}

.recent-comments a {
    color: #007bff;
    text-decoration: none;
}

.recent-comments span {
    font-size: 12px;
    color: #999;
}

/* 关于我部分样式 */
.about-section {
    background-color: #fff;
    padding: 60px 0;
}

.about-section h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 32px;
    color: #333;
}

.about-content {
    display: flex;
    align-items: center;
    gap: 40px;
}

.about-image {
    width: 30%;
}

.about-image img {
    width: 100%;
    border-radius: 50%;
    border: 5px solid #f5f5f5;
}

.about-text {
    width: 70%;
}

.about-text p {
    margin-bottom: 20px;
    line-height: 1.8;
    color: #666;
}

/* 联系我部分样式 */
.contact-section {
    background-color: #f8f9fa;
    padding: 60px 0;
}

.contact-section h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 32px;
    color: #333;
}

.contact-content {
    display: flex;
    gap: 40px;
}

.contact-info {
    width: 40%;
}

.contact-info p {
    margin-bottom: 15px;
    line-height: 1.8;
    color: #666;
}

.contact-form {
    width: 60%;
}

.contact-form form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.contact-form button {
    align-self: flex-start;
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 15px 30px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.contact-form button:hover {
    background-color: #0056b3;
}

/* 社交链接样式 */
.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icon {
    display: inline-block;
    color: #666;
    text-decoration: none;
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s;
}

.social-icon:hover {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* 页脚样式 */
footer {
    background-color: #333;
    color: #fff;
    padding: 40px 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.footer-about,
.footer-links,
.footer-social {
    width: 30%;
}

.footer-about h3,
.footer-links h3,
.footer-social h3 {
    margin-bottom: 20px;
    font-size: 20px;
    color: #fff;
}

.footer-about p {
    color: #999;
    line-height: 1.8;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #999;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #007bff;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #444;
    color: #999;
}

/* 备案号样式 */
.icp-record {
    margin-top: 10px;
    font-size: 12px;
    color: #bdc3c7;
}

/* 文章详情页样式 */
.single-post {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 40px;
    margin-bottom: 40px;
}

.single-post h1 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #333;
}

.single-post .post-meta {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.post-content-full {
    line-height: 1.8;
    color: #333;
}

.post-content-full p {
    margin-bottom: 20px;
}

.post-content-full h2,
.post-content-full h3 {
    margin: 30px 0 20px 0;
    color: #333;
}

.post-content-full img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 20px 0;
}

/* 评论区样式 */
.comments-section {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 40px;
}

.comments-section h3 {
    margin-bottom: 30px;
    font-size: 24px;
    color: #333;
}

.comment-form {
    margin-bottom: 40px;
}

.comment-form form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment-form button {
    align-self: flex-start;
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.comment-form button:hover {
    background-color: #0056b3;
}

.comment-list {
    list-style: none;
}

.comment-item {
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 15px;
    background-color: #f5f5f5;
}

.comment-author {
    font-weight: bold;
    margin-right: 15px;
}

.comment-date {
    color: #999;
    font-size: 14px;
}

.comment-content {
    color: #666;
    line-height: 1.8;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    main {
        flex-direction: column;
    }
    
    .blog-list,
    .sidebar {
        width: 100%;
    }
    
    .sidebar {
        margin-top: 40px;
    }
    
    .about-content,
    .contact-content {
        flex-direction: column;
    }
    
    .about-image,
    .about-text,
    .contact-info,
    .contact-form {
        width: 100%;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 40px;
    }
    
    .footer-about,
    .footer-links,
    .footer-social {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .menu {
        display: none;
    }
    
    .blog-post {
        flex-direction: column;
    }
    
    .post-thumbnail,
    .post-content {
        width: 100%;
    }
    
    .post-thumbnail {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .navbar .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .blog-list h2,
    .about-section h2,
    .contact-section h2 {
        font-size: 24px;
    }
    
    .single-post {
        padding: 20px;
    }
    
    .single-post h1 {
        font-size: 24px;
    }
}