/* 全局样式 */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --text-color: #2c3e50;
    --light-gray: #ecf0f1;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.8;
    color: var(--text-color);
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
    margin: 0;
    padding: 0;
}

/* 导航栏美化 */
#navList {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    box-shadow: var(--shadow);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

#navList.scrolled {
    padding: 10px 0;
    background: rgba(255, 255, 255, 0.98);
}

#navList li {
    display: inline-block;
    margin: 0 20px;
    position: relative;
}

#navList a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

#navList a:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: width 0.3s ease;
}

#navList a:hover:after {
    width: 100%;
}

/* 文章卡片样式 */
.postTitle {
    font-size: 1.5em;
    margin-bottom: 15px;
    position: relative;
    padding-left: 15px;
}

.postTitle:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: var(--secondary-color);
    border-radius: 2px;
}

.postTitle a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.postTitle a:hover {
    color: var(--secondary-color);
}

.postDesc {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.postDesc .date, .postDesc .views, .postDesc .comments {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 文章内容美化 */
.postCon {
    margin-bottom: 30px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.postCon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

/* 代码块美化 */
.cnblogs_code {
    background: #282c34;
    color: #abb2bf;
    padding: 20px;
    border-radius: 8px;
    margin: 1.5em 0;
    position: relative;
    overflow-x: auto;
}

.cnblogs_code pre {
    margin: 0;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
}

/* 侧边栏美化 */
#sideBar {
    position: fixed;
    right: 20px;
    top: 80px;
    width: 280px;
}

.newsItem, .catListEssay {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.newsItem:hover, .catListEssay:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.catListTitle {
    font-size: 1.2em;
    color: var(--text-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--light-gray);
}

/* 按钮美化 */
.btn {
    display: inline-block;
    padding: 8px 20px;
    background: var(--secondary-color);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* 标签云美化 */
#tagcloud {
    padding: 15px;
}

#tagcloud a {
    display: inline-block;
    margin: 5px;
    padding: 5px 10px;
    background: var(--light-gray);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 15px;
    transition: var(--transition);
}

#tagcloud a:hover {
    background: var(--secondary-color);
    color: #fff;
    transform: scale(1.05);
}

/* 评论区美化 */
#comment_form {
    margin-top: 30px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.commentbox {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
    transition: var(--transition);
}

.commentbox:hover {
    background: var(--light-gray);
    padding-left: 10px;
}

/* 添加动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.postCon, .newsItem, .catListEssay {
    animation: fadeIn 0.5s ease-out;
}

/* 返回顶部按钮美化 */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--secondary-color);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    transition: var(--transition);
    box-shadow: var(--shadow);
    text-align: center;
    line-height: 40px;
}

#back-to-top:hover {
    background: #2980b9;
    transform: scale(1.1);
}

/* 响应式设计优化 */
@media screen and (max-width: 1200px) {
    #sideBar {
        display: none;
    }
    
    #main {
        max-width: 800px;
    }
}

@media screen and (max-width: 768px) {
    #navList {
        padding: 10px 0;
    }
    
    #navList li {
        margin: 0 10px;
        font-size: 0.9em;
    }
    
    #main {
        margin-top: 60px;
        padding: 0 15px;
    }
    
    .postTitle {
        font-size: 1.2em;
    }
    
    .postCon {
        padding: 15px;
    }
}

/* 添加暗色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #34495e;
        --secondary-color: #3498db;
        --text-color: #ecf0f1;
        --light-gray: #2c3e50;
        --border-color: #34495e;
    }
    
    body {
        background: linear-gradient(to bottom, #2c3e50, #34495e);
    }
    
    .postCon, .newsItem, .catListEssay, #comment_form {
        background: var(--primary-color);
    }
}


/* 全局样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    margin: 0;
    padding: 0;
}

/* 导航栏 */
#navList {
    background: #fff;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

#navList li {
    display: inline-block;
    margin: 0 15px;
}

#navList a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

#navList a:hover {
    color: #007bff;
}

/* 主体内容 */
#main {
    max-width: 900px;
    margin: 80px auto 20px;
    padding: 0 20px;
}

/* 文章列表 */
.postTitle {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.postTitle a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.postTitle a:hover {
    color: #007bff;
}

.postDesc {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 20px;
}

.postCon {
    margin-bottom: 20px;
    line-height: 1.8;
}

/* 文章详情 */
#topics .postTitle {
    font-size: 2em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

#topics .postBody {
    font-size: 1.1em;
    line-height: 1.8;
}

#topics .postBody p {
    margin-bottom: 1.5em;
}

/* 代码块 */
.cnblogs_code {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin: 1em 0;
}

.cnblogs_code pre {
    margin: 0;
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
}

/* 侧边栏 */
#sideBar {
    position: fixed;
    right: 20px;
    top: 80px;
    width: 250px;
}

.newsItem, .catListEssay {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

/* 评论区 */
#comment_form {
    margin-top: 30px;
}

.commentbox {
    border-bottom: 1px solid #eee;
    padding: 15px 0;
}

/* 响应式设计 */
@media screen and (max-width: 1200px) {
    #sideBar {
        display: none;
    }
    
    #main {
        max-width: 800px;
    }
}

@media screen and (max-width: 768px) {
    #navList {
        padding: 10px 0;
    }
    
    #navList li {
        margin: 0 10px;
        font-size: 0.9em;
    }
    
    #main {
        margin-top: 60px;
    }
    
    .postTitle {
        font-size: 1.2em;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 返回顶部按钮 */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #007bff;
    color: #fff;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    display: none;
    transition: background 0.3s;
}

#back-to-top:hover {
    background: #0056b3;
}
