@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;600;700&display=swap');

/* --- Global Settings & Variables --- */
:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-serif: "Georgia", "Times New Roman", serif;
    --font-mono: 'Fira Code', 'JetBrains Mono', SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;

    --color-text: #333;
    --color-background: #fdfdfd;
    --color-primary: #3f75eb;
    --color-border: #eee;
    --color-meta: #777;
    --color-code-bg: #f5f5f5;
    --grid-line-color: rgba(0,0,0,0.04);
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    line-height: 1.7;
    color: var(--color-text);
    background-color: #f2f5f8;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-size: 16px;
}

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

.post-container {
    display: flex;
    max-width: 1100px;
    align-items: flex-start;
    gap: 2rem;
}

.post-full {
    flex: 1; 
    min-width: 0;
}

.main-content {
    flex: 1;
}

/* --- Header & Footer --- */
.site-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.nav-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    color: var(--color-text);
}

.site-nav a {
    font-family: var(--font-sans);
    text-decoration: none;
    color: var(--color-text);
    margin-left: 1.5rem;
    transition: color 0.2s ease;
}

.site-nav a:hover {
    color: var(--color-primary);
}

.brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--color-text);
}

.brand-logo {
    height: 24px;
    width: 24px;
    margin-right: 0.5rem;
    border-radius: 4px;
}

.brand-title {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 600;
}

.nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-icons {
    display: flex;
    align-items: center;
}

.icon-link {
    background: none;
    border: none;
    padding: 0;
    margin-left: 1rem;
    cursor: pointer;
    color: var(--color-text);
    display: flex;
    align-items: center;
}

.icon-link:hover {
    color: var(--color-primary);
}

@media (max-width: 768px) {
    .nav-center {
        margin-top: 0.5rem;
    }
}

.site-footer {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
    border-top: 1px solid var(--color-border);
    color: var(--color-meta);
    font-family: var(--font-sans);
    font-size: 0.9rem;
}

/* --- Typography & Content --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-mono);
    color: var(--color-text);
    line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

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

a:hover {
    text-decoration: underline;
}

p {
    margin-bottom: 1.5rem;
}

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

blockquote {
    border-left: 3px solid var(--color-primary);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--color-meta);
}

pre {
    background-color: var(--color-code-bg);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.4;
}
code {
    font-family: var(--font-mono);
    background-color: var(--color-code-bg);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 90%;
}
pre code {
    padding: 0;
    background: none;
    border-radius: 0;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* --- Post List --- */
.post-item {
    background-color: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
}
.post-item:last-child {
    margin-bottom: 0;
}
.post-item-title {
    margin: 0 0 0.3rem 0; 
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}
.post-item-title a {
    color: var(--color-text);
    text-decoration: none;
    display: block;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}
.post-item-title a:hover {
    color: var(--color-primary);
}
.post-meta {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--color-meta);
    margin-bottom: 0.4rem; 
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.3rem;
    overflow: hidden;
}

.post-meta a {
    color: var(--color-meta);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}

.more-categories {
    color: var(--color-meta);
    font-size: 0.8rem;
    white-space: nowrap;
}
.post-meta a {
    color: var(--color-meta);
}
.post-meta a:hover {
    color: var(--color-primary);
}

/* --- Full Post / Page --- */
.post-full-header, .page-full-header {
    text-align: center;
    margin-bottom: 2.1rem;
}
.post-full-title, .page-full-title {
    margin: 0;
}
.post-content {
    margin-top: 2rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.post-content img {
    cursor: zoom-in;
}

/* --- Tags & Categories --- */
.tag, .category-link {
    display: inline-block;
    background-color: #f0f0f0;
    padding: 0.1rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: var(--font-sans);
    margin-right: 0.5rem;
    color: var(--color-meta);
    text-decoration: none;
    transition: all 0.2s ease;
}
.tag:hover, .category-link:hover {
    color: #fff;
    text-decoration: none;
}

/* --- Archive & List Pages --- */
.archive-list, .tag-list, .category-list {
    list-style: none;
    padding: 0;
}
.archive-list li, .tag-list li, .category-list li {
    margin-bottom: 1rem;
    font-family: var(--font-sans);
    font-size: 1.1rem;
}
.archive-list time {
    color: var(--color-meta);
    margin-right: 1rem;
    display: inline-block;
    width: 100px;
}
.archive-year {
    margin: 2.5rem 0 1.5rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.5rem;
}

/* --- Archive List Styles --- */
.archive-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Archive redesigned card */
.archive-item {
    padding: 0;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.archive-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background-color: #fff;
    text-decoration: none;
    transition: background 0.2s ease, border 0.2s ease;
}
.archive-link:hover {
    background-color: #ffffff;
    border-color: #dfe1e4;
}

.archive-date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-meta);
    min-width: 50px;
}
.archive-title {
    flex: 1;
    color: var(--color-text);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.archive-comments {
    font-size: 0.75rem;
    color: var(--color-meta);
}
.archive-arrow {
    color: var(--color-border);
}

.archive-meta {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    color: var(--color-meta);
    gap: 0.25rem;
    margin-left: auto;
}
.archive-meta i {font-size: 0.75rem;}

/* --- Error Page --- */
.error-container {
    text-align: center;
    padding: 4rem 1rem;
}
.error-container h1 {
    font-size: 6rem;
    margin: 0;
    color: #ccc;
}
.error-container p {
    font-size: 1.5rem;
    font-family: var(--font-sans);
}
.error-container a {
    font-size: 1rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    body { font-size: 15px; }
    h1 { font-size: 2rem; }
    h2 { font-size: 1.7rem; }

    .nav-container {
        flex-direction: column;
    }
    .site-title {
        margin-bottom: 1rem;
    }
    .site-nav a {
        margin: 0 0.75rem;
    }
}

/* --- Hitokoto (One-liner) --- */
.hitokoto-wrapper {
    text-align: center;
    margin: 1rem 0 2rem;
    padding: 1rem 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.hitokoto-text {
    font-size: 1rem;
    font-style: italic;
    color: var(--color-text);
    margin: 0;
}

.hitokoto-source {
    font-size: 0.9rem;
    color: var(--color-meta);
    font-family: var(--font-sans);
    margin: 0.5rem 0 0 0;
}

/* --- Social Links --- */
.social-links {
    text-align: center;
    margin-bottom: 2rem;
}

.social-links a {
    display: inline-block;
    margin: 0 0.5rem 0.5rem;
    color: var(--color-meta);
    font-size: 1.3rem;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.social-links a:hover {
    color: var(--color-primary); /* 鼠标悬停时变为主题色 */
}

/* --- Pagination (Simple Style) --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center; /* 垂直居中对齐箭头和文字 */
    margin-top: 4rem;
    font-family: var(--font-sans);
}

.page-indicator {
    margin: 0 1.5rem; /* 与箭头之间的间距 */
    font-size: 1.1rem;
    color: var(--color-text);
    font-weight: bold;
    letter-spacing: 0.1em;
}

.page-nav-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;  /* 定义宽度 */
    height: 40px; /* 定义高度 */
    border: 1px solid var(--color-border);
    border-radius: 50%; /* 圆形按钮 */
    color: var(--color-meta);
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

a.page-nav-arrow:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
    background-color: #fdfdfd;
}

/* 禁用状态下的箭头样式 */
.page-nav-arrow.disabled {
    color: var(--color-border);
    background-color: #f8f9fa;
    cursor: default;
}

a.page-nav-arrow.disabled:hover {
    color: var(--color-border);
    border-color: var(--color-border);
}

/* --- Pagination --- */
.pagination-list {
    display: flex;
    align-items: center; /* 垂直居中对齐 */
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0.5rem;
}

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

.pagination-item .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.55rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background-color: #fff;
    transition: background 0.2s ease, border 0.2s ease;
    color: var(--color-meta);
}

/* 上一页/下一页链接内的图标样式 */
.pagination-item .page-link i {
    font-size: 0.8em; /* 让图标比文字稍小一点 */
}
.pagination-item .page-link .page-link-text {
    margin: 0 0.4rem; /* 图标和文字之间的间距 */
}


.pagination-item a.page-link:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.pagination-item.current .page-link {
    background-color: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    cursor: default;
}

.pagination-item.disabled .page-link {
    color: #ccc;
    cursor: default;
}

.pagination-item.disabled .page-link:hover {
    color: #ccc;
    border-color: var(--color-border);
}

/* ====================================================== */
/* 移动端适配样式         */
/* ====================================================== */
@media (max-width: 768px) {
    /* 在移动端隐藏 "上一页" 和 "下一页" 的文字 */
    .pagination .page-link-text {
        display: none;
    }

    /* 在移动端隐藏带 .hide-on-mobile class 的元素 */
    .pagination-item.hide-on-mobile {
        display: none;
    }

    /* 为只有图标的按钮调整内边距，使其更像一个方形 */
    .pagination-item .page-link {
        padding: 0.5rem 0.8rem;
    }
}

/* --- Empty State --- */
.empty-state-container {
    text-align: center;
    padding: 5rem 2rem;
    margin-top: 2rem;
    border: 2px dashed var(--color-border);
    border-radius: 8px;
    color: var(--color-meta);
}

.empty-state-icon {
    font-size: 3.5rem;
    color: var(--color-border);
    margin-bottom: 1.5rem;
}

.empty-state-container h2 {
    font-family: var(--font-sans);
    color: var(--color-text);
    margin: 0 0 1rem 0;
}

.empty-state-container p {
    font-size: 1.1rem;
    max-width: 400px;
    margin: 0 auto 2rem auto;
}

.btn-write-post {
    display: inline-block;
    background-color: var(--color-primary);
    color: #fff;
    padding: 0.8rem 1.8rem;
    border-radius: 5px;
    text-decoration: none;
    font-family: var(--font-sans);
    font-weight: bold;
    transition: all 0.2s ease-in-out;
}

.btn-write-post:hover {
    background-color: var(--color-text);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* --- Table of Contents (TOC) --- */
.toc-container {
    flex: 0 0 240px; /* 固定宽度，不伸缩 */
    order: 2;
}

.toc-sticky {
    position: sticky;
    top: 2rem; /* 距离视口顶部的距离 */
}

.toc-container h4 {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: bold;
    margin: 0 0 1rem 0;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.5rem;
}

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

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

.toc-nav a {
    color: var(--color-meta);
    text-decoration: none;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    display: block;
    transition: all 0.2s ease;
}

.toc-nav a:hover {
    color: var(--color-primary);
    transform: translateX(4px);
}

/* 滚动监听高亮样式 */
.toc-nav a.active {
    color: var(--color-primary);
    font-weight: bold;
    transform: translateX(4px);
}

/* 目录层级缩进 */
.toc-level-h3 {
    padding-left: 1rem;
}

/* --- Responsive for Post with TOC --- */
@media (max-width: 1024px) {
    /* 在平板和手机上隐藏目录 */
    .toc-container {
        display: none;
    }

    /* 让文章内容区域恢复正常宽度 */
    .post-container {
        max-width: 800px;
        padding: 2rem 1rem;
    }
}

/* --- Comments Section --- */
.post-comments {
    margin-top: 5rem; 
    padding-top: 3rem;
    border-top: 1px solid var(--color-border); 
}

.comments-title {
    text-align: center;
    font-family: var(--font-sans);
    margin-bottom: 3rem;
    color: var(--color-text);
}

.comment-thread-container {
}

.comment-loading-notice {
    text-align: center;
    color: var(--color-meta);
    font-style: italic;
    padding: 2rem 0;
}

/* --- Moment List --- */
.moment-item {
    position: relative;
    margin-bottom: 2rem;
    padding: 1.5rem 1.5rem 1rem;
    background-color: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease;
}
.moment-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
    .moment-item {
        background-color: #1e1e1e;
        border-color: #333;
    }
}

.moment-meta {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--color-meta);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.moment-time {
    font-size: 0.8rem;
}
.moment-author {
    font-weight: bold;
    margin-right: 0.25rem;
}

/* 内容与媒体 */
.moment-content {
    line-height: 1.7;
    margin-bottom: 0.75rem;
}
.moment-media img,
.moment-media video {
    margin-top: 0.75rem;
    border-radius: 6px;
    max-width: 100%;
}
.moment-media video,
.moment-media audio {
    width: 100%;
    outline: none;
}

.moment-overlay-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    text-decoration: none;
    color: inherit;
}

.moment-item > *:not(.moment-overlay-link) {
    position: relative;
    z-index: 2;
}

/* --- Moment Detail Page --- */
.moment-detail {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    padding: 2rem;
    margin-bottom: 2rem;
}

.moment-detail .moment-meta {
    margin-bottom: 1.5rem;
}

.moment-detail .moment-content {
    margin-bottom: 1.5rem;
}

.moment-detail .moment-media {
    margin-top: 1.5rem;
}

.moment-navigation {
    margin-top: 2rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

/* --- Modern Minimalist Home Layout --- */
.home-wrapper {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 2rem;
    max-width: none; 
    width: 100%;
    margin: 0 auto;
    padding: 2rem 4rem; 
    gap: 0.5rem; 
}

/* 移动端优化 home-wrapper 间距 */
@media (max-width: 768px) {
    .home-wrapper {
        padding: 1rem 0.9rem;
    }
}

.home-wrapper {
    grid-template-columns: clamp(240px, 17vw, 306px) minmax(0, 1000px) clamp(240px, 17vw, 306px);
    justify-content: center; 
}

.sidebar {
    position: sticky;
    top: 2rem;
    align-self: flex-start;
}

.sidebar-left {
    margin-right: 1.5rem;
}

.sidebar-right {
    margin-left: 1.5rem;
}

.author-card,
.widget {
    background-color: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.author-card {
    text-align: center;
}

.author-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    margin-bottom: 1rem;
}

.author-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0.5rem 0;
}

.author-bio {
    font-size: 0.9rem;
    color: var(--color-meta);
    margin-bottom: 1rem;
}

.author-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 1.5rem;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--color-border);
    padding-top: 1rem;
}

.author-stats li {
    text-align: center;
}

.stat-num {
    font-size: 1.25rem;
    font-weight: 600;
    display: block;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--color-meta);
}

.widget-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.stats-list,
.category-list,
.tag-cloud {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stats-list li,
.category-list li,
.tag-cloud li {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.card.tag-cloud-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    padding: 1.5rem 1.7rem 1.2rem 1.7rem;
    margin-bottom: 2rem;
}
.card.tag-cloud-card .card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #6b7685;
    margin-bottom: 1.1rem;
}
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem 1rem;
    margin: 0.5rem 0 1.5rem 0;
}
.tag-cloud .tag {
    display: inline-block;
    background: none;
    color: #38404a;
    border-radius: 0;
    padding: 0;
    font-size: 1rem;
    font-weight: 400;
    text-decoration: none;
    box-shadow: none;
    margin: 0 0.3em 0.3em 0;
    transition: color 0.18s, font-size 0.18s, font-weight 0.18s;
    line-height: 1.7;
    position: relative;
}
.tag-cloud .tag:hover {
    color: var(--color-primary, #3b82f6);
    text-decoration: underline;
    z-index: 1;
}
.tag-cloud .tag .tag-name {
    margin-right: 0.7em;
    font-size: 1.02rem;
    font-weight: 500;
}
.tag-cloud .tag .tag-count {
    background: rgba(255,255,255,0.7);
    color: #8a94a6;
    border-radius: 10px;
    padding: 0.08em 0.7em;
    font-size: 0.92rem;
    font-weight: 500;
    min-width: 1.8em;
    text-align: center;
    display: inline-block;
}

.tag-cloud a {
    display: inline-block;
    margin: 0.25rem 0.5rem;
    color: var(--color-text);
}

.tag-cloud a:hover {
    color: var(--color-primary);
}

@media (max-width: 1024px) {
    .home-wrapper {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none;
    }
}

/* --- Main Content Center Alignment --- */
.content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.content > * {
    width: 100%;
}

/* 移动端内容区域优化 */
@media (max-width: 768px) {
    .content {
        padding: 0 0.2rem;
        overflow-x: hidden; /* 禁止水平滚动 */
    }
    
    /* 文章标题换行优化 */
    .post-item-title {
        word-wrap: break-word;
        word-break: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .post-item-title a {
        display: block;
        word-wrap: break-word;
        word-break: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
}

.widget.widget-stats {
    padding-top: 0.8rem;
}

.stats-list {
    display: flex;
    justify-content: space-between;
    margin: 0;
    padding: 0;
    list-style: none;
}

.stat-item {
    flex: 1;
    text-align: center;
    position: relative;
    padding: 0 0.5rem;
}

.stat-item:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 1px;
    height: 60%;
    background-color: var(--color-border);
}

.stat-num {
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.2;
    display: block;
    margin-bottom: 0.2rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--color-meta);
}

.top-category-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.widget.widget-top-categories {
    padding-top: 0.8rem;
}

.top-category-item {
    padding: 0.3rem 0.6rem;
}

.top-category-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.top-category-link:hover {
    text-decoration: none;
}

.top-category-name {
    font-size: 0.85rem;
    color: var(--color-meta);
    font-weight: 600;
    margin-right: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.top-category-count {
    background-color: #f0f2f4;
    border-radius: 10px;
    width: 32px; 
    text-align: center;
    font-size: 0.7rem;
    color: var(--color-text);
    flex-shrink: 0;
    margin-left: 0.5rem;
}

/* Sidebar widgets spacing */
.sidebar .widget + .widget {
    margin-top: 1.0rem;
}

.top-category-item:hover {
    background-color: #f0f2f4;
}

.top-tag-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.top-tag-link {
    font-size: 0.8rem;
    color: var(--color-meta);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
}

.top-tag-link:hover {
    color: var(--color-text);
    text-decoration: underline;
}

.widget.widget-top-tags {
    padding-top: 0.8rem;
}

/* add styles near post-item section */
.post-item {
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.post-cover {
    width: 160px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
}
.post-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.post-excerpt {
    margin: 0.3rem 0 0.6rem;
    color: var(--color-meta);
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.6;
}
.read-more {
    align-self: flex-start;
    font-size: 0.8rem;
    color: var(--color-primary);
    text-decoration: none !important;
}
.read-more:hover {text-decoration: none !important;}

/* Post card hover effect */
.post-item:hover {
    border-radius: 6px;
    transition: background-color .2s ease;
}

/* ensure no underline on hover */
.pagination .page-link:hover,
.pagination .page-link:focus {
    text-decoration: none;
}

/* footer styles */
.site-footer {
    padding: 2rem 1rem;
    background: #fff;
    border-top: 1px solid var(--color-border);
    font-size: 0.85rem;
    color: var(--color-meta);
}
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
}
.footer-links {
    display: flex;
    gap: 1rem;
}
.footer-links a {
    color: var(--color-meta);
    text-decoration: none;
    font-weight: 500;
}
.footer-links a:hover {
    color: var(--color-text);
}
.back-to-top {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    font-size: 1rem;
    color: var(--color-meta);
    text-decoration: none;
}
.back-to-top:hover {
    color: var(--color-text);
    background-color: #f0f2f4;
}

.site-footer-copy {
    margin: 0;
}

.back-to-top {
    margin-left: auto;
}

/* ensure pagination link colors */
.pagination-item .page-link {
    color: var(--color-meta);
}
.pagination-item .page-link:hover {
    color: var(--color-text);
}

.archive-link,
.archive-link:hover {
    text-decoration: none;
}

.content .archive-year:first-of-type {
    margin-top: 0;
}

.sidebar.sidebar-left > * {
    width: 100%;
    margin-right: 0;
}
.sidebar.sidebar-left > * + * {
    margin-top: 1.5rem;
}
.sidebar.sidebar-left .sidebar-left {
    margin-right: 0;
}

.author-card.no-hitokoto .social-links {
    margin-bottom: 1rem;
}

/* 最近文章列表 */
.widget.widget-recent-posts {
    padding-top: 0.8rem;
}
.recent-post-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.recent-post-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.2rem;
    border-bottom: 1px solid var(--color-border);
}
.recent-post-item:last-child {
    border-bottom: none;
}
.recent-post-link {
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.85rem;
    flex: 0 1 auto;
    max-width: calc(100% - 80px); /* 为日期预留空间 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}
.recent-post-link:hover {
    color: var(--color-primary);
    text-decoration: underline;
}
.recent-post-date {
    font-size: 0.75rem;
    color: var(--color-meta);
    margin-left: 0.5rem;
}
/* Hover 效果 */
.recent-post-item:hover {
    background-color: #f7f8f9;
    border-radius: 4px;
}

/* 友链列表 */
.widget.widget-links {
    padding-top: 0.8rem;
}
.links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.link-item .link {
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.85rem;
}
.link-item .link:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

/* 乞讨卡片 */
.widget.widget-donate {
    padding-top: 0.8rem;
}
.donate-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.donate-item {
    display: grid;
    grid-template-columns: 1.2rem 3.2rem 1fr; /* 固定宽度列保证对齐 */
    column-gap: 0.3rem;
    font-size: 0.8rem;
    list-style: none;
    padding-left: 0;
}
.donate-label {
    white-space: nowrap;
    align-self: start;
}
.donate-value, .donate-link {
    word-break: break-all;
}
.donate-icon {
     width: 1.2rem;
     height: 1rem;
     display: flex;
     align-items: center;
     justify-content: center;
     text-align: center;
     color: var(--color-meta);
     font-size: 0.8rem;
     line-height: 1;
 }
.donate-value, .donate-link {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-text);
    word-break: break-all;
}
.donate-link:hover { color: var(--color-primary); }

/* 分类列表现代化卡片 */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.category-item-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background-color: #fff;
    text-decoration: none;
    color: var(--color-text);
    transition: background 0.2s ease, border 0.2s ease;
}
.category-item-link:hover {
    background-color: #f5f6f7;
    border-color: #dfe1e4;
}
.category-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.category-count {
    background-color: #f0f2f4;
    border-radius: 12px;
    padding: 0 0.5rem;
    font-size: 0.75rem;
    color: var(--color-meta);
    margin-right: 0.4rem; /* space before arrow icon */
    flex-shrink: 0;
}

/* 分类卡片折叠 */
.category-card {
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background-color: #fff;
    transition: box-shadow 0.2s ease, border 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.category-card + .category-card { margin-top: 0.75rem; }
.category-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 600;
    column-gap: 0.25rem;
}
.category-card-header:hover { background-color: #f5f6f7; }
.category-card:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.06); border-color: transparent; }
.category-card-header .toggle-icon { 
    transition: transform 0.2s ease; 
}
.category-card-header.open .toggle-icon { 
    transform: rotate(180deg); 
}

.category-post-list {
    list-style: none;
    margin: 0;
    padding: 0.25rem 1rem 0.75rem 1.5rem; /* indent for bullet */
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    pointer-events: none;
}
.category-post-list.expanded {
    max-height: 500px;
    opacity: 1;
    padding-top: 0.25rem;
    padding-bottom: 0.75rem;
    pointer-events: auto;
}
.category-post-item {
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    position: relative;
}

.category-post-item::before {
    content: '\2022'; /* bullet */
    position: absolute;
    left: -1rem;
    top: 0.45rem;
    color: var(--color-border);
    font-size: 0.55rem;
}
.category-post-item a {
    color: var(--color-text);
    text-decoration: none;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.category-post-item a:hover { color: var(--color-primary); }
.category-post-date {
    font-size: 0.75rem;
    color: var(--color-meta);
    margin-left: 0.5rem;
    flex-shrink: 0;
}
.category-post-item:not(:last-child) {
    border-bottom: 1px dashed var(--color-border-light, #e5e6e8);
    padding-bottom: 0.5rem;
}
.category-more-item { text-align: right; }
.category-more-item a {
    font-size: 0.8rem;
    color: var(--color-primary);
    text-decoration: none;
}

/* 分类卡片容器间距 */
.category-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.post-icon {
    color: var(--color-meta);
    font-size: 0.7rem;
    margin-right: 0.35rem;
    flex-shrink: 0;
    line-height: 1;
}
.category-post-link { flex: 1; }

.widget.widget-archives {
    padding-top: 0.8rem;
}

.archives-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    border-radius: 14px;
    flex-direction: column;
    gap: 0.25rem;
}

.archives-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1rem;
    color: #4a5568;
    font-weight: 500;
    padding: 0.1rem 0;
    border-radius: 14px;
    transition: all 0.2s ease;
}

.archives-item:hover {
    background: #f8fafc;
    color: #2d3748;
}

.archives-year {
    flex: 1;
    font-weight: 500;
}

.archives-count {
    background: #f1f3f5;
    color: #6b7280;
    border-radius: 20px;
    padding: 0.25rem 0.45rem;
    font-size: 0.775rem;
    font-weight: 500;
    margin-left: 1rem;
    min-width: 2.2em;
    text-align: center;
    transition: all 0.2s ease;
}

.archives-item:hover .archives-count {
    background: #e5e7eb;
    color: #374151;
}

.widget.widget-toc {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    padding: 1.2rem 1.4rem 1.1rem 1.4rem;
    margin-bottom: 1.5rem;
}
.widget-toc .widget-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #6b7685;
    margin-bottom: 1.1rem;
}
.toc-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}
.toc-nav li {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}
.toc-nav a {
    color: var(--color-text);
    text-decoration: none;
    display: block;
    padding: 0.3rem 0;
    border-radius: 6px;
    transition: background 0.2s ease;
}
.toc-nav a:hover {
    background: #f5f6f7;
    color: var(--color-primary);
}

.card.post-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    padding: 2rem 2.5rem;
    margin-bottom: 2rem;
}
.post-card .post-full-header {
    margin-bottom: 2rem;
}
.post-card .post-full-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 1rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.post-card .post-meta {
    color: var(--color-meta);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}
.post-card .post-meta time {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.post-card .post-meta .meta-separator {
    display: flex;
    align-items: center;
    color: var(--color-meta);
    gap: 0.4rem;
    margin: 0 0.8rem;
}
.post-card .post-meta .meta-separator i {
    font-size: 0.8rem;
}
.post-card .post-meta a {
    color: var(--color-meta);
    text-decoration: none;
    transition: color 0.2s ease;
}
.post-card .post-meta a:hover {
    color: var(--color-primary);
}
.post-card .post-content {
    line-height: 1.8;
    color: var(--color-text);
}
.post-card .post-comments {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}
