/* 全局样式重置与基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
    background-color: #f7f9fc;
    color: #333;
    line-height: 1.6;
}

/* 页面容器布局 */
#main {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 25px;
}

#mainContent {
    flex: 1;
    min-width: 0; /* 解决flex子元素溢出问题 */
}

#sideBar {
    width: 300px;
    flex-shrink: 0; /* 侧边栏不收缩 */
}

/* 头部导航美化 */
#header {
    background: linear-gradient(135deg, #4a6fa5 0%, #36598c 100%);
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#blogTitle h1 {
    font-size: 24px;
    margin-left: 20px;
}

#blogTitle a {
    color: #fff !important;
    text-decoration: none;
    transition: opacity 0.3s;
}

#blogTitle a:hover {
    opacity: 0.9;
}

#navigator {
    background: transparent;
}

#navList li {
    margin: 0 8px;
}

#navList a {
    color: rgba(255, 255, 255, 0.9) !important;
    padding: 5px 12px;
    border-radius: 4px;
    transition: all 0.3s;
}

#navList a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff !important;
}

/* 文章列表美化 */
.day {
    background: #fff;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.day:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
}

.postTitle {
    border-left: 4px solid #4a6fa5;
    padding-left: 15px;
    margin-bottom: 15px;
}

.postTitle a {
    font-size: 20px;
    color: #333 !important;
    text-decoration: none;
    transition: color 0.3s;
}

.postTitle a:hover {
    color: #4a6fa5 !important;
}

.postCon {
    color: #555;
    line-height: 1.8;
    margin-bottom: 15px;
}

.postDesc {
    color: #999;
    font-size: 13px;
    padding-top: 10px;
    border-top: 1px dashed #eee;
}

/* 侧边栏组件通用样式 */
.sidebar-block {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.sidebar-title {
    font-size: 16px;
    color: #4a6fa5;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.sidebar-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 40px;
    height: 2px;
    background: #4a6fa5;
}

/* 分类与标签样式 */
#sidebar_categories ul,
#sidebar_tags ul {
    list-style: none;
}

#sidebar_categories a,
#sidebar_tags a {
    display: inline-block;
    color: #666 !important;
    text-decoration: none;
    padding: 4px 0;
    transition: all 0.3s;
}

#sidebar_categories a:hover,
#sidebar_tags a:hover {
    color: #4a6fa5 !important;
    transform: translateX(5px);
}

#sidebar_tags a {
    margin-right: 8px;
    margin-bottom: 8px;
    padding: 2px 10px;
    background: #f5f7fa;
    border-radius: 12px;
    font-size: 13px;
}

#sidebar_tags a:hover {
    background: #eef2f7;
    transform: none;
}

/* 评论区美化 */
#comment_form_container,
#comments {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.comment_item {
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.comment_item:last-child {
    border-bottom: none;
}

/* 分页样式 */
#nav_next_page {
    margin: 30px 0;
    text-align: center;
}

#nav_next_page a {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 5px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    color: #666 !important;
    text-decoration: none;
    transition: all 0.3s;
}

#nav_next_page a:hover {
    background: #4a6fa5;
    color: #fff !important;
    border-color: #4a6fa5;
}

/* 代码块美化 */
.cnblogs_code {
    background: #f8f9fa !important;
    border-radius: 6px !important;
    border: none !important;
    padding: 15px !important;
    font-family: "Consolas", "Monaco", monospace !important;
    font-size: 14px !important;
    overflow-x: auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #main {
        flex-direction: column;
        padding: 10px;
    }
    
    #sideBar {
        width: 100%;
    }
    
    .day {
        padding: 15px;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}