/* Base */
:root {
    --primary-color: #333;
    --secondary-color: #666;
    --accent-color: #0066cc;
    --background-color: #fff;
    --light-gray: #f5f5f5;
    --border-color: #eee;
    --font-family: Lora, "Noto Serif SC", ui-serif, Georgia, Cambria, "times new roman", Times, serif;
    --code-font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    line-height: 1.8;
}

body {
    font-family: var(--font-family);
    color: var(--primary-color);
    background-color: var(--background-color);
    font-weight: 400;
}

a {
    color: var(--accent-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    margin: 1.5rem 0 1rem;
    line-height: 1.3;
    font-weight: 600;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

p, ul, ol {
    margin-bottom: 1.2rem;
}

ul, ol {
    padding-left: 1.5rem;
}

blockquote {
    margin: 1.8rem 0;
    padding: 0 1.5rem;
    border-left: 4px solid var(--border-color);
    color: var(--secondary-color);
    font-style: italic;
}

pre, code {
    font-family: var(--code-font-family);
    font-size: 0.9rem;
    background-color: var(--light-gray);
    border-radius: 3px;
}

code {
    padding: 0.2rem 0.4rem;
}

pre {
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

pre code {
    padding: 0;
    background-color: transparent;
}

img {
    max-width: 100%;
    height: auto;
}

/* Layout */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.site-header {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.site-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.site-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
}

.site-title a {
    text-decoration: none;
    color: #333;
}

.site-title a:hover {
    color: #666;
}

.title-separator {
    margin: 0 0.5rem;
    color: #666;
}

.site-title a:hover {
    text-decoration: none;
}

.site-nav .menu {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    margin-left: 1.5rem;
}

.menu-item a {
    color: var(--secondary-color);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.menu-item a:hover {
    color: var(--accent-color);
    text-decoration: none;
}

/* Footer */
.site-footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.site-footer-inner {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

/* Content */
.content-list {
    margin-bottom: 3rem;
}

.page-title {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.page-content {
    margin-bottom: 2.5rem;
}

/* Posts */
.post-item {
    margin-bottom: 1.8rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Remove hover effect for home page */
.home-content .post-item:hover {
    transform: none;
    box-shadow: none;
}

.post-title {
    margin-top: 0;
    letter-spacing: -0.01em;
    font-size: 1.4rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

/* Smaller title for home page */
.home-content .post-title {
    font-size: 1.5rem;
}

.post-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-title a:hover {
    color: #3498db;
}

.post-meta {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
    font-weight: 400;
}

.post-categories, .post-tags {
    margin-left: 0.5rem;
}

.post-categories a, .post-tags a {
    color: #3498db;
    text-decoration: none;
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 12px;
    margin-right: 0.3rem;
    transition: all 0.2s ease;
}

.post-categories a:hover, .post-tags a:hover {
    background: rgba(52, 152, 219, 0.2);
    color: #2980b9;
}

.post-summary {
    margin-bottom: 0.8rem;
    color: #555;
    line-height: 1.6;
}

.read-more a {
    font-weight: 500;
    color: #3498db;
    text-decoration: none;
    transition: color 0.2s ease;
}

.read-more a:hover {
    color: #2980b9;
}

/* Single Post */
.post {
    margin-bottom: 2rem;
}

.post-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.post-title {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.8rem;
    color: #1a1a1a;
}

.post-meta {
    font-size: 0.9rem;
    color: #666;
    font-weight: 400;
}

.post-content {
    line-height: 1.75;
    font-size: 1.05rem;
    color: #2c3e50;
}

.post-content h2 {
    font-size: 1.65rem;
    font-weight: 600;
    margin-top: 2.8rem;
    margin-bottom: 1rem;
    color: #2c3e50;
    position: relative;
    padding-bottom: 0.5rem;
}

.post-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, #3498db, #2980b9);
    border-radius: 1px;
}

.post-content h3 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-top: 2.2rem;
    margin-bottom: 0.8rem;
    color: #34495e;
}

.post-content h4 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-top: 1.8rem;
    margin-bottom: 0.7rem;
    color: #34495e;
}

.post-content h5, .post-content h6 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.6rem;
    color: #34495e;
}

.post-content p {
    margin-bottom: 1.4rem;
    text-align: justify;
}

.post-content p:last-child {
    margin-bottom: 0;
}

/* 首段特殊处理 */
.post-content > p:first-child {
    font-size: 1.1rem;
    margin-bottom: 1.8rem;
    color: #2c3e50;
}

/* 改善代码块样式 */
.post-content pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1.2rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.5;
}

.post-content code {
    background: #f1f3f4;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
    color: #d63384;
}

.post-content pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

/* 改善引用样式 */
.post-content blockquote {
    border-left: 4px solid #3498db;
    background: #f8f9ff;
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    color: #555;
    font-style: italic;
    border-radius: 0 4px 4px 0;
}

/* 改善列表样式 */
.post-content ul, .post-content ol {
    margin: 1.2rem 0;
    padding-left: 1.8rem;
}

.post-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* 改善链接样式 */
.post-content a {
    color: #3498db;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.post-content a:hover {
    color: #2980b9;
    border-bottom-color: #2980b9;
}

.post-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* 表格样式优化 */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    overflow: hidden;
}

.post-content table th,
.post-content table td {
    padding: 0.8rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.post-content table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.post-content table tr:hover {
    background: #f8f9fa;
}

.post-content table tr:last-child td {
    border-bottom: none;
}

/* 图片样式优化 */
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-content img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* 分隔线样式 */
.post-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, #e9ecef, transparent);
    margin: 2.5rem 0;
}

/* 强调和粗体文本 */
.post-content strong {
    color: #2c3e50;
    font-weight: 600;
}

.post-content em {
    color: #34495e;
    font-style: italic;
}

/* 数学公式优化 */
.post-content .MathJax {
    font-size: 1.1em !important;
}

/* 脚注样式 */
.post-content .footnote-ref {
    color: #3498db;
    text-decoration: none;
    font-size: 0.8em;
    vertical-align: super;
    padding: 0 0.2em;
}

.post-content .footnote-ref:hover {
    color: #2980b9;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}

.page-item {
    margin: 0 0.25rem;
}

.page-link {
    display: block;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    color: var(--secondary-color);
}

.page-link:hover {
    background-color: var(--light-gray);
    text-decoration: none;
}

.page-item.active .page-link {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.page-item.disabled .page-link {
    color: #ccc;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .site-header-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .site-nav {
        margin-top: 1rem;
    }
    
    .menu-item {
        margin-left: 0;
        margin-right: 1.5rem;
    }
    
    .site-footer-inner {
        flex-direction: column;
    }
    
    .powered-by {
        margin-top: 0.5rem;
    }
    
    /* 移动端文章样式优化 */
    .post-title {
        font-size: 1.8rem;
        line-height: 1.25;
    }
    
    .post-content {
        font-size: 1rem;
        line-height: 1.7;
    }
    
    .post-content h2 {
        font-size: 1.4rem;
        margin-top: 2.2rem;
    }
    
    .post-content h3 {
        font-size: 1.2rem;
        margin-top: 1.8rem;
    }
    
    .post-content h4 {
        font-size: 1.1rem;
        margin-top: 1.5rem;
    }
    
    .post-content > p:first-child {
        font-size: 1.05rem;
    }
    
    .post-content pre {
        padding: 1rem;
        margin: 1.2rem -1rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .post-content blockquote {
        margin: 1.2rem -1rem;
        border-radius: 0;
        padding: 1rem 1.5rem;
    }
}

.section-title {
    letter-spacing: -0.01em;
    margin-bottom: 1.5rem;
}

/* Table of Contents */
.post-wrapper {
    display: flex;
    flex-direction: row;
    gap: 2.5rem;
    margin-top: 0.5rem;
}

.post-content {
    flex: 1;
    min-width: 0; /* 防止内容溢出 */
}

.toc-container {
    position: sticky;
    top: 2rem;
    width: 260px;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    padding: 1.2rem;
    background: #fafbfc;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.5;
}

.toc-title {
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1rem;
    color: #2c3e50;
    border-bottom: 1px solid #e1e5e9;
    padding-bottom: 0.5rem;
}

.toc-content nav ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.toc-content nav ul ul {
    padding-left: 1rem;
    margin-top: 0.3rem;
}

.toc-content nav li {
    margin-bottom: 0.4rem;
}

.toc-content nav a {
    color: #7f8c8d;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
    padding: 0.2rem 0;
    border-radius: 3px;
    position: relative;
}

.toc-content nav a:hover {
    color: #3498db;
    padding-left: 0.5rem;
}

.toc-content nav a.active {
    color: #3498db;
    font-weight: 500;
    padding-left: 0.5rem;
}

.toc-content nav a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 100%;
    background: #3498db;
    border-radius: 2px;
}

@media (max-width: 768px) {
    .post-wrapper {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .toc-container {
        position: relative;
        width: 100%;
        top: 0;
        background: #f8f9fa;
        border: 1px solid #e9ecef;
        padding: 1rem;
        margin-top: 1.5rem;
        border-radius: 6px;
    }
    
    .toc-title {
        font-size: 0.95rem;
        margin-bottom: 0.8rem;
    }
}

/* MathJax Styles */
.MathJax {
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
}

.mjx-chtml {
    display: inline-block;
    line-height: 0;
    text-indent: 0;
    text-align: left;
    text-transform: none;
    font-style: normal;
    font-weight: normal;
    font-size: 100%;
    font-size-adjust: none;
    letter-spacing: normal;
    word-wrap: normal;
    word-spacing: normal;
    white-space: nowrap;
    float: none;
    direction: ltr;
    max-width: none;
    max-height: none;
    min-width: 0;
    min-height: 0;
    border: 0;
    margin: 0;
    padding: 1px 0;
}

.mjx-math {
    display: inline-block;
    border-collapse: separate;
    border-spacing: 0;
}

.mjx-container[jax="CHTML"][display="true"] {
    display: block;
    text-align: center;
    margin: 1em 0;
}

/* External Photography Link Styles */

.page-title-header {
    font-weight: 500;
    color: #666;
}


