/* =============================================================================
   Typecho 默认主题美化版 - 专为 yubin.wang 定制
   作者：Qwen | 日期：2025年12月
   特点：宽松导航、专业排版、代码高亮、响应式
============================================================================= */

/* ---------------- 全局重置与基础 ---------------- */
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: #333;
    background-color: #fafafa;
}
a {
    color: #1e88e5;
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: #0d47a1;
    text-decoration: underline;
}

/* ---------------- 容器 ---------------- */
#container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------------- 头部 ---------------- */
#header {
    padding: 40px 0 20px;
    text-align: center;
    border-bottom: 1px solid #eee;
}
#title {
    margin: 0;
}
#title a {
    font-size: 2.2em;
    font-weight: 700;
    color: #2c3e50;
    letter-spacing: -0.5px;
}
#description {
    color: #7f8c8d;
    margin-top: 8px;
    font-size: 1.05em;
}

/* ---------------- 导航栏（重点优化） ---------------- */
#nav-menu {
    margin: 20px 0;
    padding: 0;
    list-style: none;
    text-align: center;
}
#nav-menu li {
    display: inline-block;
    margin: 0 18px; /* 关键：增大间距 */
}
#nav-menu a {
    font-size: 1.05em;
    font-weight: 500;
    padding: 8px 10px;
    color: #555;
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s;
}
#nav-menu a:hover,
#nav-menu a.current {
    color: #1e88e5;
    border-bottom: 2px solid #1e88e5;
}

/* ---------------- 文章列表 ---------------- */
.post {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s, box-shadow 0.2s;
}
.post:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}
.post-title {
    font-size: 1.6em;
    margin: 0 0 16px;
}
.post-title a {
    color: #2c3e50;
}
.post-title a:hover {
    color: #1e88e5;
}
.post-content {
    color: #555;
    font-size: 1.02em;
}
.post-meta {
    color: #999;
    font-size: 0.95em;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed #eee;
}
.post-meta a {
    color: #999;
}
.post-meta a:hover {
    color: #1e88e5;
}

/* ---------------- 单篇文章页 ---------------- */
#post-content h1,
#post-content h2,
#post-content h3,
#post-content h4 {
    margin: 1.8em 0 1em;
    color: #2c3e50;
}
#post-content h2 {
    padding-bottom: 0.4em;
    border-bottom: 1px solid #eee;
}
#post-content p {
    margin: 1.2em 0;
}
#post-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 24px auto;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
#post-content pre {
    margin: 24px 0;
    padding: 16px;
    background: #2d333b;
    border-radius: 8px;
    overflow-x: auto;
    color: #abb2bf;
    font-size: 0.95em;
    line-height: 1.5;
}
#post-content code:not([class]) {
    background: #f1f3f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.95em;
    color: #e06c75;
}

/* ---------------- 分页 ---------------- */
#pagenavi {
    text-align: center;
    margin: 30px 0;
}
#pagenavi a,
#pagenavi span {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 4px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #555;
}
#pagenavi a:hover {
    background: #1e88e5;
    color: white;
    border-color: #1e88e5;
}
#pagenavi .current {
    background: #1e88e5;
    color: white;
    border-color: #1e88e5;
}

/* ---------------- 侧边栏 ---------------- */
#secondary {
    margin-top: 40px;
    font-size: 0.95em;
}
.widget {
    margin-bottom: 30px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}
.widget-title {
    font-size: 1.2em;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #1e88e5;
    color: #2c3e50;
}
.widget ul {
    padding-left: 0;
}
.widget li {
    list-style: none;
    padding: 6px 0;
    border-bottom: 1px dashed #f0f0f0;
}
.widget li:last-child {
    border-bottom: none;
}
.widget li a {
    color: #555;
}
.widget li a:hover {
    color: #1e88e5;
}

/* ---------------- 评论区 ---------------- */
#comments {
    margin-top: 40px;
}
.comment-list {
    list-style: none;
    padding: 0;
}
.comment {
    padding: 20px 0;
    border-bottom: 1px dashed #eee;
}
.comment-author {
    font-weight: bold;
    color: #1e88e5;
}
.comment-time {
    color: #999;
    font-size: 0.9em;
    margin-left: 8px;
}
.comment-content {
    margin: 8px 0;
}

/* ---------------- 页脚 ---------------- */
#footer {
    text-align: center;
    padding: 40px 0 20px;
    color: #999;
    font-size: 0.95em;
    border-top: 1px solid #eee;
    margin-top: 40px;
}

/* ---------------- 响应式（手机适配） ---------------- */
@media (max-width: 768px) {
    #header {
        padding: 30px 0 15px;
    }
    #title a {
        font-size: 1.8em;
    }
    .post {
        padding: 20px 15px;
        margin: 20px 0;
    }
    #nav-menu li {
        display: block;
        margin: 8px 0;
        text-align: left;
    }
    #nav-menu li:first-child {
        margin-top: 15px;
    }
    #container {
        padding: 0 15px;
    }
}

/* 修复图片溢出容器的问题 */
.post-content img,
#post-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 16px auto;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
