:root {
    --bg-color: #f5ecd5; /* 信纸黄 */
    --text-color: #333333;
    --link-color: #8b5a2b; /* 复古棕 */
    --link-hover: #cd853f;
    --border-color: #d1bfae;
    --input-bg: rgba(255, 255, 255, 0.4);
    --input-bg-focus: #fff;
    --comment-author-bg: #e2e8c0;
}

body {
    background-color: var(--bg-color);
    /* 添加一点噪点效果 */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)' opacity='0.08'/%3E%3C/svg%3E");
    color: var(--text-color);
    font-family: "LXGW WenKai Lite", "LXGW WenKai", "Microsoft YaHei", sans-serif;
    line-height: 1.8;
    margin: 0;
    padding: 0;
    font-size: 17px;
    overflow-y: scroll; /* 始终显示滚动条，防止页面跳动 */
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--link-hover);
}

.site-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px 40px;
}

.site-header {
    padding-bottom: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.single-column {
    margin: 0 auto;
    max-width: 800px;
    flex: none;
    width: 100%;
}

.page-top-nav {
    margin-bottom: 30px;
    font-size: 1.1em;
    padding-bottom: 15px;
    text-align: center;
}

.page-top-nav a {
    margin-right: 20px;
    color: var(--text-color);
    font-weight: bold;
}

.page-top-nav a:hover {
    color: var(--link-hover);
}

.post-subtitle {
    font-size: 1.2em;
    color: #666;
    margin-top: -5px;
    margin-bottom: 15px;
    font-weight: normal;
    text-align: center;
}

.separator {
    margin: 0 8px;
    color: #999;
}

.site-title {
    font-size: 2.2em;
    margin: 0 0 10px 0;
}

.site-title a {
    color: var(--text-color);
}

.site-desc {
    color: #666;
    margin: 0;
    font-size: 1.1em;
}

.site-nav {
    margin-top: 20px;
}

.site-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.search-form {
    margin-top: 20px;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: transparent;
    font-family: inherit;
    border-radius: 4px;
}

.search-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: var(--border-color);
    color: var(--text-color);
    cursor: pointer;
    font-family: inherit;
    border-radius: 4px;
}

.search-btn:hover {
    background: var(--link-hover);
    color: white;
}

.content-wrapper {
    display: block;
    margin: 0 auto;
}

.main-content {
    width: 100%;
}

.post {
    margin-bottom: 50px;
}

.post-title {
    font-size: 1.8em;
    margin-top: 0;
    margin-bottom: 10px;
    text-align: center;
}

.post-title a {
    color: var(--text-color);
}

.post-meta {
    font-size: 0.9em;
    color: #777;
    margin-bottom: 40px;
    padding-bottom: 10px;
    text-align: center;
}

.post-content {
    font-size: 1.1em;
}

.post-content p {
    margin-bottom: 1.5em;
}

.post-content img {
    max-width: 100%;
    max-height: 480px;      /* 增加最大高度限制，防止竖屏图过长 */
    object-fit: cover;      /* 当设置大小不一的图片时统一裁剪居中显示（不会压缩失真） */
    object-position: center;
    display: block;
    margin: 30px auto;      /* 增加上下留白 */
    border-radius: 8px;     /* 更圆润的圆角，更贴合本主题的设计语言 */
    box-shadow: 0 6px 16px rgba(139, 90, 43, 0.15); /* 加一层符合主题的复古棕色阴影，使图片像统一卡片 */
    background-color: rgba(255, 255, 255, 0.4);     /* 防止透明图片太单薄 */
}

.post-tags {
    margin-top: 20px;
    font-size: 0.9em;
    color: #666;
}

.pagination {
    margin-top: 40px;
    text-align: center;
}

.pagination a {
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    margin: 0 5px;
    border-radius: 3px;
}

.sidebar {
    width: 250px;
}

.widget {
    margin-bottom: 30px;
}

.widget-title {
    font-size: 1.2em;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

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

.widget ul li {
    margin-bottom: 10px;
}

.widget ul li a {
    color: var(--text-color);
}

.widget ul li a:hover {
    color: var(--link-hover);
}

.site-footer {
    margin-top: 50px;
    padding-top: 20px;
    text-align: center;
    color: #777;
    font-size: 0.9em;
}

.footer-links a {
    color: #777;
}

/* 评论区样式 */
.comments-area {
    margin-top: 20px;
    padding-top: 30px;
}

.comment-list {
    list-style: none;
    padding: 0;
}

.comment-item {
    margin-bottom: 30px;
    padding-bottom: 10px;
}

.comments-toggle {
    text-align: center;
    cursor: pointer;
    color: var(--link-color);
    font-size: 1.1em;
    margin-bottom: 20px;
    padding: 10px;
    transition: color 0.3s ease;
    display: inline-block;
    width: 100%;
}

.comments-toggle:hover {
    color: var(--link-hover);
}

.toggle-icon {
    display: inline-flex;
    margin-right: 5px;
    vertical-align: middle;
    transition: transform 0.3s ease-out;
}

.comments-toggle.is-expanded .toggle-icon {
    transform: rotate(180deg);
}

.comments-content-collapse {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s ease-out;
}

.comments-content-collapse.is-expanded {
    grid-template-rows: 1fr;
}

.comments-content-wrapper {
    overflow: hidden;
    min-height: 0;
    transition: opacity 0.4s ease-out;
    opacity: 0;
}

.comments-content-collapse.is-expanded > .comments-content-wrapper {
    opacity: 1;
}

.comment-author-box {
    display: inline-flex;
    align-items: center;
    background-color: var(--comment-author-bg);
    padding: 6px 16px 6px 6px;
    border-radius: 40px;
    margin-bottom: 15px;
    transition: background-color 0.3s ease;
}

.comment-avatar {
    display: flex;
    margin-right: 12px;
}

.comment-avatar img {
    border-radius: 50%;
    width: 32px;
    height: 32px;
}

.comment-author-name {
    font-size: 1.05em;
    font-weight: bold;
    color: var(--text-color);
}

.comment-time {
    font-size: 0.5em;
    color: #8da382; /* 稍淡一点的绿色 */
    margin-left: 10px;
}

.comment-content {
    font-size: 1.1em;
    line-height: 1.8;
}

.comment-content p {
    margin: 5px 0;
}

.respond-title {
    margin-top: 30px;
    font-size: 1.3em;
}

.text, .textarea {
    width: 100%;
    max-width: 400px;
    padding: 8px;
    border: 1px solid var(--border-color);
    background: transparent;
    font-family: inherit;
    border-radius: 4px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.textarea {
    max-width: 100%;
    height: 80px; /* 初始状态小一点 */
    resize: vertical;
}

.textarea:focus {
    height: 180px; /* 点击后变大 */
    outline: none;
    border-color: var(--link-color);
}

.submit {
    padding: 10px 20px;
    background: var(--link-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
}

.submit:hover {
    background: var(--link-hover);
}

@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
}
/* Code Blocks and Inline Code */
code {
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    background-color: #f0f0f4;
    padding: 0.2em 0.4em;
    border-radius: 4px;
    color: #e83e8c;
    font-size: 0.9em;
}

.post-content pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
    border-radius: 0;
    font-size: 0.75em;
}

pre[class*="language-"] {
    border-radius: 8px;
    margin: 1.5em 0;
}


/* Blockquote Style */
blockquote {
    border-left: 4px solid var(--link-color);
    background-color: rgba(139, 90, 43, 0.08);
    padding: 15px 20px;
    margin: 20px 0;
    color: #555;
    font-size: 0.95em;
    border-radius: 0 4px 4px 0;
}

blockquote p:first-child {
    margin-top: 0;
}

blockquote p:last-child {
    margin-bottom: 0;
}


/* Table Styles */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.95em;
}

.post-content th,
.post-content td {
    padding: 10px 15px;
    border: 1px dashed var(--border-color);
}

.post-content th {
    background-color: rgba(139, 90, 43, 0.08);
    font-weight: 600;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
}

.post-content tr:nth-child(even) {
    background-color: rgba(139, 90, 43, 0.02);
}


/* Comment Form Styles */
.comment-input-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 10px 0 15px;
}

.comment-input-grid .input-item {
    margin: 0;
}

.comment-input-grid .text,
textarea.auto-expand {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    border: 1px dashed var(--border-color);
    background-color: var(--input-bg);
    border-radius: 6px;
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.95em;
    transition: all 0.3s ease;
}

.comment-input-grid .text:focus,
textarea.auto-expand:focus {
    border-color: var(--link-color);
    background-color: var(--input-bg-focus);
    outline: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); /* 统一调暗阴影 */
}

textarea.auto-expand {
    min-height: 120px;
    resize: vertical;
    margin-bottom: 10px;
}

button.submit {
    background-color: var(--link-color);
    color: #f5ecd5;
    border: none;
    padding: 10px 24px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.95em;
    font-family: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(139, 90, 43, 0.15);
}

button.submit:hover {
    background-color: var(--link-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(139, 90, 43, 0.25);
}

@media (max-width: 768px) {
    .comment-input-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}


/* New Global Header & Post List Styles */
.global-header {
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 30px;
    border-bottom: 1px dashed var(--border-color);
    position: relative;
}

.page-top-nav {
    font-size: 1.1em;
    margin-bottom: 0;
    padding-bottom: 0;
}

.page-top-nav a {
    margin-right: 20px;
    color: var(--text-color);
    font-weight: bold;
}

.page-top-nav a:hover {
    color: var(--link-hover);
}

.header-search {
    position: relative;
    display: flex;
    align-items: center;
}

.search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.search-toggle:hover {
    color: var(--link-hover);
}

.search-box {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 10px;
    background: var(--bg-color);
    padding: 10px;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(139, 90, 43, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 100;
}

.search-box.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-box .text {
    padding: 8px 12px;
    border: 1px dashed var(--border-color);
    background: var(--input-bg);
    font-family: inherit;
    border-radius: 4px;
    width: 200px;
    outline: none;
    color: var(--text-color);
}

.search-box .text:focus {
    border-color: var(--link-color);
    background: var(--input-bg-focus);
}

/* Post List Styles (Title Only) */
.post-list {
    margin-bottom: 40px;
}

.post-item-simple {
    display: flex;
    align-items: baseline;
    margin-bottom: 15px;
    position: relative;
    padding-left: 15px;
}

.post-item-simple::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: var(--link-color);
}

.post-item-simple .post-date {
    color: #999;
    font-size: 0.9em;
    min-width: 90px;
    flex-shrink: 0;
}

.post-item-simple .post-title-simple {
    margin: 0;
    font-size: 1.1em;
    font-weight: normal;
}

.post-item-simple .post-title-simple a {
    color: var(--text-color);
}

.post-item-simple .post-title-simple a:hover {
    color: var(--link-hover);
}

.site-header {
    display: none;
}


/* Site Intro (Homepage only) */
.site-intro {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    text-align: left;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px dashed var(--border-color);
}

.intro-avatar {
    flex-shrink: 0;
}

.intro-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(139, 90, 43, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.5);
    display: block;
}

.intro-text {
    display: flex;
    flex-direction: column;
}

.intro-title {
    font-size: 2em;
    margin: 0 0 5px 0;
    color: var(--text-color);
    font-weight: normal;
}

.intro-desc {
    font-size: 1.1em;
    color: #666;
    margin: 0;
}

@media (max-width: 768px) {
    .site-intro {
        flex-direction: column;
        text-align: center;
    }
}


/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--link-color);
    color: var(--bg-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 4px 10px rgba(139, 90, 43, 0.2);
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--link-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(139, 90, 43, 0.3);
}

.back-to-top svg {
    width: 20px;
    height: 20px;
}


/* Dark Mode Variables & System preference */
:root[data-theme="dark"] {
    --bg-color: #242424; /* 柔和暗色，非纯黑 */
    --text-color: #d4d4d4;
    --link-color: #c98a4b; /* 在暗色下增加一点亮度的复古棕 */
    --link-hover: #e0ac76;
    --border-color: #3f3f3f;
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-bg-focus: #1a1a1a;
    --comment-author-bg: #303030;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-color: #242424;
        --text-color: #d4d4d4;
        --link-color: #c98a4b;
        --link-hover: #e0ac76;
        --border-color: #3f3f3f;
        --input-bg: rgba(255, 255, 255, 0.05);
        --input-bg-focus: #1a1a1a;
        --comment-author-bg: #303030;
    }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.theme-switch {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.theme-switch:hover {
    color: var(--link-hover);
}


/* Dark Mode Switch Icons */
[data-theme="dark"] .moon-icon {
    display: none !important;
}
[data-theme="dark"] .sun-icon {
    display: block !important;
}
[data-theme="light"] .sun-icon {
    display: none !important;
}
[data-theme="light"] .moon-icon {
    display: block !important;
}

/* Background gradient for body transition */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Barba.js Transition Styles */
.barba-leave-active,
.barba-enter-active {
    transition: opacity 0.5s ease-in-out;
}

.barba-leave-to,
.barba-enter-from {
    opacity: 0;
}

/* Webmentions Styles */
.webmentions-area {
    margin-top: 40px;
    text-align: center; /* Center the header */
}

.webmentions-header {
    display: inline-flex; /* Allow centering */
    align-items: center;
    margin-bottom: 20px;
    padding: 8px 15px;
    background-color: rgba(139, 90, 43, 0.08);
    border-radius: 20px;
    transition: background-color 0.3s ease;
}

.webmentions-header.is-clickable {
    cursor: pointer;
}

.webmentions-header.is-clickable:hover {
    background-color: rgba(139, 90, 43, 0.15);
}

.webmentions-title {
    font-size: 0.9em; /* Smaller font size */
    color: var(--text-color);
    font-weight: bold;
}

.webmention-avatar-stack {
    display: flex;
    margin-right: 10px; /* Reduced margin */
}

.webmention-avatar-stack img {
    width: 28px; /* Smaller avatars */
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--bg-color);
    margin-left: -10px; /* Adjust overlap */
    transition: transform 0.2s ease;
}

.webmention-avatar-stack img:first-child {
    margin-left: 0;
}

.webmentions-header.is-clickable:hover .webmention-avatar-stack img {
    transform: scale(1.1);
}

.webmentions-list {
    margin-top: 20px;
    text-align: left; /* Reset text alignment for the list */
}

.webmentions-collapse {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s ease-out;
}

.webmentions-collapse.is-expanded {
    grid-template-rows: 1fr;
}

.webmentions-content-wrapper {
    overflow: hidden;
    min-height: 0;
    transition: opacity 0.4s ease-out;
    opacity: 0;
}

.webmentions-collapse.is-expanded > .webmentions-content-wrapper {
    opacity: 1;
}

.webmentions-list h4 {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: var(--link-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.webmention-faces {
    list-style: none;
    padding: 0;
    margin: 0 -5px;
    display: flex;
    flex-wrap: wrap;
}

.webmention-faces li {
    margin: 5px;
}

.webmention-faces img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--bg-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.webmention-faces img:hover {
    transform: scale(1.1);
}

.webmention-replies {
    list-style: none;
    padding: 0;
}

.webmention-reply {
    margin-bottom: 30px;
    padding-left: 60px;
    position: relative;
}

.webmention-author {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 50px;
}

.webmention-author a {
    color: var(--text-color);
    font-size: 0.8em;
}

.webmention-author img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-bottom: 5px;
}

.webmention-author span {
    word-wrap: break-word;
}

.webmention-content {
    background: rgba(139, 90, 43, 0.05);
    padding: 15px;
    border-radius: 8px;
    font-size: 1em;
}

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

.webmentions-header.is-expanded .webmentions-title::after {
    content: " (收起)"; /* Simpler text */
    font-size: 0.8em;
    color: #999;
    margin-left: 5px;
}

.post-meta .p-author .u-photo {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}
