/* Theme Name: PureText
Description: A minimalist theme for Typecho.
Author: Gemini
Version: 1.0
*/

/* 基础设置 */
body {
    font-family: "微軟正黑體", "Punct Song Body", minion-pro, "Times New Roman", 思源宋体, "Noto Serif SC", "Songti SC", NSimSun, SimSun, serif;
    /* font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; */
    line-height: 1.8;
    color: #333;
    background: #fff;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: #000;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover { color: #666; }

/* --- Header 优化样式 --- */

.site-header {
    padding: 60px 0 40px; /* 适当减小顶部留白，增加呼吸感 */
    background: #fff;
}

.header-inner {
    display: flex;
    flex-direction: column; /* 纵向排列，适合极简阅读风格 */
    align-items: flex-start; /* 左对齐 */
    border-bottom: 1px solid #f0f0f0; /* 极细的分割线 */
    padding-bottom: 30px;
}

/* 网站标题 */
.site-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.site-title a {
    color: #1a1a1a;
    text-decoration: none;
}

/* 网站描述 */
.site-description {
    margin: 8px 0 0;
    font-size: 13px;
    color: #888;
    font-weight: 400;
}

/* 导航栏 */
.site-nav {
    margin-top: 30px;
    width: 100%;
}

.nav-links {
    display: flex;
    gap: 25px; /* 链接之间的间距 */
}

.nav-links a {
    font-size: 17px;
    color: #666;
    text-decoration: none;
    position: relative;
    padding-bottom: 4px;
    transition: all 0.2s ease;
}

/* 导航悬停与当前状态 */
.nav-links a:hover {
    color: #000;
}

.nav-links a.current {
    color: #000;
    font-weight: 500;
}

/* 装饰性下划线：只在当前页面显示，增加精致感 */
.nav-links a.current::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 15px; /* 短下划线更显精致 */
    height: 2px;
    background: #000;
}

/* 移动端适配 */
@media (max-width: 600px) {
    .site-header {
        padding: 40px 0 20px;
    }
    .nav-links {
        gap: 15px;
        flex-wrap: wrap; /* 手机端导航自动换行 */
    }
}

/* 列表 */
.post-list { margin-top: 40px; }
.post-item { margin-bottom: 15px; display: flex; align-items: baseline; }
.post-date { font-size: 13px; color: #999; min-width: 100px; font-family: Georgia, serif; }
.post-title { font-size: 17px; margin: 0; font-weight: 400; }

/* --- 文章内页深度优化 --- */
/* --- 1. 标题字号优化 --- */
.post-header .post-title {
    font-size: 32px;          /* 从32px提升，增强对比度 */
    font-weight: 700;
    line-height: 1.25;        /* 紧凑的标题行高更具张力 */
    letter-spacing: -1px;     /* 大字号下稍微缩紧字距更精致 */
    color: #1a1a1a;
    margin: 0 0 15px 0;       /* 增加标题与下方Meta的间距 */
}

/* 移动端标题适配 */
@media (max-width: 600px) {
    .post-header .post-title {
        font-size: 28px;      /* 手机端适当缩小，防止单词断行 */
    }
}

/* --- 2. 导航与页脚间距优化 --- */


/* 兼容没有导航时的间距（例如第一篇或最后一篇文章） */
.post-content {
    margin-bottom: 60px;
    text-align: justify ;
}

/* 1. 引用区块 (Blockquote) */
.entry-content blockquote {
    margin: 2em 0;
    padding: 0 0 0 20px;
    border-left: 2px solid #000;
    color: #666;
    font-style: italic;
}

/* 2. 代码区块 (Code) */
/* 行内代码 */
.entry-content :not(pre) > code {
    background: #f5f5f5;
    color: #c7254e;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: "SFMono-Regular", Consolas, Courier, monospace;
}
/* 代码块 */
.entry-content pre {
    background: #f9f9f9;
    padding: 20px;
    overflow: auto;
    border: 1px solid #eee;
    border-radius: 4px;
    line-height: 1.5;
    margin: 2em 0;
}
.entry-content pre code {
    background: none;
    padding: 0;
    color: #333;
    font-size: 14px;
}

/* 3. 图片样式 (Images) */
.entry-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2.5em auto;
    border-radius: 2px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05); /* 轻微阴影增加精致感 */
}
/* 图片说明文字 (如果使用了 <figure>) */
.entry-content figcaption {
    text-align: center;
    font-size: 13px;
    color: #999;
    margin-top: -1.5em;
    margin-bottom: 2em;
}

/* 4. 链接样式 (Links) */
.entry-content a {
    color: #000;
    border-bottom: 1px dotted #ccc;
    transition: all 0.2s ease;
}
.entry-content a:hover {
    border-bottom: 1px solid #000;
    background: rgba(0,0,0,0.02);
}

/* 5. 标签云 (Tags) */
.post-tags {
    margin: 50px 0 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.post-tags a {
    font-size: 12px;
    color: #888;
    background: #f2f2f2;
    padding: 4px 12px;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s;
}
.post-tags a:hover {
    background: #000;
    color: #fff;
}
.post-tags a::before {
    content: "# ";
    opacity: 0.5;
}

/* 6. 上下篇导航 (Post Near) */
.post-near {
    display: flex;
    justify-content: space-between;
    margin-top: 80px;         /* 增加与正文结尾的距离 */
    margin-bottom: 100px;     /* 核心修改：增加与底部Footer的间距，创造呼吸感 */
    padding-top: 40px;
    border-top: 1px solid #f0f0f0;
}
.near-item {
    width: 48%;
    display: flex;
    flex-direction: column;
}
.near-item.next {
    text-align: right;
}
.near-label {
    font-size: 10px;
    letter-spacing: 2px;
    color: #bbb;
    margin-bottom: 8px;
}
.near-item a {
    font-size: 15px;
    color: #444;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
}
.near-item a:hover {
    color: #000;
}

/* 7. 列表样式 */
.entry-content ul, .entry-content ol {
    margin: 1.5em 0;
    padding-left: 1.5em;
}
.entry-content li {
    margin-bottom: 0.5em;
}

/* --- 归档页面深度优化 --- */

.archive-page {
    margin-bottom: 100px;
}

.archive-year-section {
    margin-bottom: 60px;
}

/* 年份标题与上标计数 */
.archive-year {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 30px 0;
    display: flex;
    align-items: flex-start;
    font-family: "Georgia", serif;
}

.year-count {
    font-size: 12px;
    font-weight: 400;
    color: #bbb;
    margin-left: 6px;
    vertical-align: super;
    font-family: -apple-system, sans-serif;
}

/* 月份层级 */
.archive-month-group {
    margin-left: 10px;
    margin-bottom: 30px;
}

.archive-month {
    font-size: 16px;
    font-weight: 600;
    color: #444;
    margin: 0 0 15px 0;
    padding-left: 10px;
    border-left: 2px solid #eee; /* 月份左侧的小线条，增加引导感 */
}

/* 文章列表 */
.archive-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0 12px;
}

.archive-item {
    display: flex;
    align-items: baseline;
    padding: 8px 0;
    border-bottom: 0px solid #f9f9f9;
}

.archive-item:last-child {
    border-bottom: none;
}

.archive-date {
    font-size: 13px;
    color: #999;
    min-width: 45px;
    font-family: "Georgia", serif;
}

.archive-link {
    font-size: 15px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
}

.archive-link:hover {
    color: #000;
    padding-left: 5px; /* 悬停时轻微右移 */
}

/* 移动端优化 */
@media (max-width: 600px) {
    .archive-year { font-size: 24px; }
    .archive-month { font-size: 15px; }
    .archive-link { font-size: 14px; }
}


/* 页码与底部 */
/* --- Pagination 极简方括号样式 --- */

.pagination {
    margin: 80px 0 60px;
    text-align: center;
    font-family: "Georgia", serif; /* 使用衬线体增加精致感 */
}

.pagination-list {
    display: inline-flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 10px; /* 页码之间的间距 */
    align-items: center;
}

.pagination-list li {
    display: inline-block;
    font-size: 14px;
}

/* 默认页码样式 */
.pagination-list li a, 
.pagination-list li span {
    color: #888;
    text-decoration: none;
    padding: 0 4px;
    transition: all 0.2s ease;
}

/* 核心：利用伪元素生成方括号 */
.pagination-list li a::before, 
.pagination-list li span::before {
    content: "[";
    margin-right: 2px;
    color: #eee; /* 括号颜色浅一点，突出数字 */
}

.pagination-list li a::after, 
.pagination-list li span::after {
    content: "]";
    margin-left: 2px;
    color: #eee;
}

/* 悬停效果 */
.pagination-list li a:hover {
    color: #000;
}
.pagination-list li a:hover::before,
.pagination-list li a:hover::after {
    color: #000;
}

/* 当前页（高亮） */
.pagination-list li.current span {
    color: #000;
    font-weight: bold;
}
.pagination-list li.current span::before,
.pagination-list li.current span::after {
    color: #000; /* 当前页的括号变黑 */
}

/* 省略号样式 */
.pagination-list li span.page-num:not(.current) {
    border: none;
    color: #ccc;
}
.pagination-list li span.page-num:not(.current)::before,
.pagination-list li span.page-num:not(.current)::after {
    content: ""; /* 省略号不需要括号 */
}

/* 响应式调整 */
@media (max-width: 600px) {
    .pagination-list {
        gap: 5px;
    }
    .pagination-list li {
        font-size: 13px;
    }
}

/* --- Footer 深度优化 --- */

.site-footer {
    padding: 80px 0 60px;
    border-top: 1px solid #f0f0f0;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #bbb;
    letter-spacing: 0.5px;
    text-transform: uppercase; /* 适当的大写增加设计感 */
}

.footer-inner a {
    color: #999;
    border-bottom: 1px transparent;
    transition: all 0.2s ease;
}

.footer-inner a:hover {
    color: #000;
    border-bottom: 1px solid #000;
}

.footer-info span {
    margin-left: 15px;
}

/* 回到顶部按钮样式 */
#back-to-top {
    position: fixed;
    right: 40px;
    bottom: 40px;
    width: 44px;
    height: 44px;
    background: #fff;
    color: #000;
    border: 1px solid #eee;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    z-index: 99;
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(-10px); /* 浮现时向上微动 */
}

#back-to-top:hover {
    background: #000;
    color: #fff;
    border-color: #000;
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

/* 移动端适配：缩小底部间距并隐藏回顶按钮（或缩小按钮） */
@media (max-width: 600px) {
    .footer-inner {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    .footer-info span {
        display: block;
        margin-left: 0;
        margin-top: 5px;
    }
    #back-to-top {
        right: 20px;
        bottom: 20px;
        width: 36px;
        height: 36px;
    }
}

/* --- 自动暗色模式 (Dark Mode) 适配 --- */

@media (prefers-color-scheme: dark) {
    /* 基础背景与文字 */
    body {
        background-color: #1a1a1a;
        color: #ccc;
    }

    /* 链接颜色 */
    a, .site-title a, .near-item a, .archive-link {
        color: #eee;
    }
    
    a:hover {
        color: #fff;
    }

    /* Header 与 分割线 */
    .site-header {
        background-color: #1a1a1a;
    }
    
    .header-inner, .site-footer, .post-near, .archive-month {
        border-color: #2c2c2c;
    }

    /* 文本描述与元数据 */
    .site-description, .post-date, .post-meta, .near-label, .archive-date, .year-count, .footer-inner {
        color: #777;
    }

    .nav-links a {
        color: #888;
    }

    .nav-links a:hover, .nav-links a.current {
        color: #fff;
    }

    .nav-links a.current::after {
        background: #fff;
    }

    /* 文章内容细节 */
    .post-header .post-title, .archive-year, .archive-month {
        color: #fff;
    }

    .entry-content blockquote {
        border-left-color: #444;
        color: #999;
    }

    .entry-content :not(pre) > code {
        background: #2a2a2a;
        color: #e06c75; /* 稍微调整代码颜色以适应深色 */
    }

    .entry-content pre {
        background: #222;
        border-color: #333;
    }

    .entry-content pre code {
        color: #bbb;
    }

    .entry-content a {
        border-bottom-color: #444;
    }
    
    .entry-content a:hover {
        background: rgba(255, 255, 255, 0.05);
        border-bottom-color: #fff;
    }

    /* 标签云 */
    .post-tags a {
        background: #2a2a2a;
        color: #888;
    }

    .post-tags a:hover {
        background: #fff;
        color: #000;
    }

    /* 分页逻辑 */
    .pagination-list li a, .pagination-list li span {
        color: #666;
    }
    
    .pagination-list li a::before, .pagination-list li a::after,
    .pagination-list li span::before, .pagination-list li span::after {
        color: #333;
    }

    .pagination-list li.current span, .pagination-list li a:hover {
        color: #fff;
    }
    
    .pagination-list li.current span::before, .pagination-list li.current span::after,
    .pagination-list li a:hover::before, .pagination-list li a:hover::after {
        color: #fff;
    }

    /* 回到顶部按钮 */
    #back-to-top {
        background: #2a2a2a;
        color: #fff;
        border-color: #333;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }

    #back-to-top:hover {
        background: #fff;
        color: #000;
    }

    /* 图片亮度降低，防止暗光下刺眼 */
    img {
        opacity: 0.85;
        transition: opacity 0.3s ease;
    }
    
    img:hover {
        opacity: 1;
    }
}
