/*
 * Theme Name: Journals
 * Theme URI: https://xcnv.com
 * Description: 一款古朴书香风格的旅行博客Typecho主题
 * Version: 1.0
 * Author: 羡鱼
 */

/* ========== 自定义字体声明（根据实际路径调整 url） ========== */
@font-face {
  font-family: "youyuan";
  src: url("ziti/youyuan.woff") format("woff"),
       url("ziti/youyuan.eot") format("embedded-opentype"),
       url("ziti/youyuan.svg") format("svg");
  font-display: swap;
}

/* ========== 全局变量 & 字体分配说明 ========== */
:root {
    --bg-page: #f6f1e6;
    --bg-paper: #faf7f0;
    --bg-cream: #fdf8f2;
    --text-primary: #2c1810;
    --text-secondary: #5c3d2e;
    --text-muted: #8b6f5e;
    --border-light: #d4c5b2;
    --border-medium: #b8a088;
    --border-dark: #6b4c3b;
    --accent-brown: #7a5238;
    --accent-warm: #c4956a;
    --seal-red: #b5343a;
    --seal-red-light: #c94043;
    --seal-red-dark: #8b1a1f;
    --shadow-soft: rgba(107, 76, 59, 0.08);
    --shadow-medium: rgba(80, 50, 30, 0.13);
    --shadow-deep: rgba(60, 30, 15, 0.2);
    --gold-accent: #b8946e;
    --ink-blue: #3a4f6b;
    --sage-green: #6b7d6b;
    --parchment-dark: #e8dcc8;
    --parchment-light: #fdfaf3;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.8rem;
    --spacing-lg: 3rem;
    --spacing-xl: 5rem;
    --max-width: 900px;
    --border-radius: 4px;
    --transition: 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);

    /*
     * ---------- 字体使用说明 ----------
     * --font-display : 用于博客主标题、装饰性大字（如「行远游记」）
     * --font-heading : 用于文章内标题、导航、卡片标题、评论区标题等
     * --font-body    : 用于正文、描述、元信息等
     *
     * 你可以自由交换 zql / youyuan 来改变不同区域的字体效果。
     * 后备字体按顺序提供，确保在任何设备上都有合适的显示。
     */
    --font-display: 'youyuan', 'Ma Shan Zheng', 'ZCOOL XiaoWei', 'Noto Serif SC', 'STKaiti', 'KaiTi', serif;
    --font-heading: 'youyuan', 'Noto Serif SC', 'STSong', 'SimSun', 'Songti SC', serif;
    --font-body:    'youyuan', 'Noto Serif SC', 'STSong', 'SimSun', 'Songti SC', serif;
}

/* ========== 全局重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background-color: var(--parchment-dark);
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(180, 150, 120, 0.03) 2px, rgba(180, 150, 120, 0.03) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 3px, rgba(160, 130, 100, 0.02) 3px, rgba(160, 130, 100, 0.02) 6px),
        radial-gradient(ellipse at 30% 20%, rgba(200, 170, 130, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 60%, rgba(180, 140, 100, 0.1) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 85%, rgba(190, 155, 115, 0.08) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.8;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.texture-filter {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
    mix-blend-mode: multiply;
}

/* ========== 主容器（书本效果） ========== */
.book-wrapper {
    position: relative;
    z-index: 1;
    max-width: var(--max-width);
    margin: 2rem auto 4rem;
    background: var(--bg-paper);
    box-shadow:
        0 2px 8px var(--shadow-soft),
        0 8px 32px var(--shadow-medium),
        0 20px 60px var(--shadow-deep),
        2px 0 0 rgba(139, 100, 70, 0.06),
        -2px 0 0 rgba(139, 100, 70, 0.06);
    border-radius: 2px;
    border-left: 1px solid rgba(160, 120, 80, 0.15);
    border-right: 1px solid rgba(160, 120, 80, 0.15);
}

.book-wrapper::after {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(160, 130, 100, 0.2);
    pointer-events: none;
    z-index: 0;
    border-radius: 1px;
}

.book-cover-strip {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(to bottom, #6b4c3b, #7a5538, #8b6040, #7a5538, #6b4c3b);
    z-index: 2;
    border-radius: 2px 2px 0 0;
    box-shadow: 0 1px 3px rgba(60, 30, 15, 0.3);
}
.book-cover-strip-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(to top, #6b4c3b, #7a5538, #8b6040, #7a5538, #6b4c3b);
    z-index: 2;
    border-radius: 0 0 2px 2px;
    box-shadow: 0 -1px 3px rgba(60, 30, 15, 0.3);
}

/* ========== 导航栏 ========== */
.nav-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 247, 240, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    padding: 0.7rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    flex-wrap: wrap;
    box-shadow: 0 1px 8px rgba(100, 70, 40, 0.06);
    transition: box-shadow var(--transition);
}
.nav-bar.scrolled {
    box-shadow: 0 2px 16px rgba(100, 70, 40, 0.12);
}
.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    padding: 0.25rem 0;
    transition: color var(--transition);
    cursor: pointer;
    white-space: nowrap;
}
.nav-link.active {
    color: var(--accent-brown);
}
.nav-dot {
    display: none;
}

.nav-slider {
    position: absolute;
    bottom: 6px;
    left: 0;
    height: 3px;
    background-color: var(--accent-brown);
    transition: all 0.3s ease;
    border-radius: 2px;
    pointer-events: none;
    width: 0;
    z-index: 101;
}

/* ========== 内容区域 ========== */
.content-inner {
    position: relative;
    z-index: 1;
    padding: 2rem 3rem 2.5rem;
}

/* ========== 首页 Hero 区域 ========== */
.hero-section {
    text-align: center;
    padding: 2rem 1rem 1.5rem;
    position: relative;
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.hero-title {
    font-family: var(--font-display);
    font-size: 4.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.12em;
    line-height: 1.2;
    margin-bottom: 0.3rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.06);
    position: relative;
    display: inline-block;
}
.hero-title a {
    text-decoration: none;
    color: inherit;
}
.hero-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 15%;
    right: 15%;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--border-medium), var(--accent-brown), var(--border-medium), transparent);
}
.hero-subtitle {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    margin-top: 1.2rem;
    font-weight: 400;
}

/* ========== 通用板块标题 ========== */
.section-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    letter-spacing: 0.08em;
    margin-bottom: 0.4rem;
    position: relative;
}
.section-title-en {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    color: var(--text-muted);
    font-weight: 300;
    text-transform: uppercase;
    margin-bottom: 0.2rem;
    font-family: 'Georgia', 'Times New Roman', serif;
}
.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 0.5rem 0 1.8rem;
}
.section-divider .line {
    width: 60px;
    height: 1px;
    background: var(--border-medium);
    flex-shrink: 0;
}
.section-divider .ornament {
    font-size: 1rem;
    color: var(--border-medium);
    flex-shrink: 0;
}

/* ========== 文章列表（首页卡片） ========== */
.projects-section {
    padding: 0.5rem 0 1.5rem;
}
.project-card {
    border: 1px solid var(--border-light);
    padding: 1.6rem 2rem;
    margin-bottom: 1.2rem;
    background: rgba(253, 248, 242, 0.5);
    border-radius: var(--border-radius);
    transition: all var(--transition);
    position: relative;
    cursor: pointer;
    border-left: 4px solid transparent;
    display: block;
    text-decoration: none;
    color: inherit;
}
.project-card:hover {
    border-left-color: var(--accent-brown);
    box-shadow: 0 4px 18px var(--shadow-medium);
    background: rgba(255, 252, 245, 0.85);
    transform: translateX(3px);
}
.project-card::after {
    content: '阅读更多 →';
    position: absolute;
    right: 1.5rem;
    bottom: 1.2rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
}
.project-card:hover::after {
    opacity: 0.7;
}
.project-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.05em;
    margin-bottom: 0.3rem;
}
.project-title a {
    text-decoration: none;
    color: inherit;
}
.project-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    margin-bottom: 0.6rem;
}
.project-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}
.project-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.8rem;
}
.project-tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.7rem;
    border: 1px solid var(--border-light);
    border-radius: 2px;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    background: rgba(250, 245, 235, 0.4);
    transition: all var(--transition);
    text-decoration: none;
}
.project-tag a {
    color: inherit;
    text-decoration: none;
}
.project-card:hover .project-tag {
    border-color: var(--border-medium);
    color: var(--text-secondary);
}
.project-tag:hover {
    background: rgba(180, 140, 110, 0.15);
    color: var(--accent-brown);
}

/* ========== 文章内容区域样式 ========== */
.post-content {
    padding: 1rem 0;
    line-height: 2;
    font-size: 1rem;
    color: var(--text-secondary);
}
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    margin: 1.8rem 0 0.8rem;
    letter-spacing: 0.05em;
}
.post-content h2 {
    font-size: 1.5rem;
    border-left: 3px solid var(--accent-brown);
    padding-left: 0.8rem;
}
.post-content h3 {
    font-size: 1.25rem;
}
.post-content p {
    margin-bottom: 1rem;
    text-indent: 2em;
}
.post-content p:first-of-type {
    text-indent: 0;
}
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 3px;
    margin: 1.5rem auto;
    display: block;
    box-shadow: 0 3px 12px var(--shadow-medium);
    border: 3px solid #fff;
    outline: 1px solid var(--border-light);
}
.post-content blockquote {
    border-left: 4px solid var(--accent-warm);
    margin: 1.5rem 0;
    padding: 0.8rem 1.5rem;
    background: rgba(200, 170, 130, 0.08);
    font-style: italic;
    color: var(--text-secondary);
    border-radius: 0 3px 3px 0;
}
.post-content blockquote p {
    text-indent: 0;
    margin-bottom: 0.3rem;
}
.post-content a {
    color: var(--accent-brown);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-warm);
    transition: all var(--transition);
}
.post-content a:hover {
    color: var(--seal-red);
    border-bottom-color: var(--seal-red);
}
.post-content ul,
.post-content ol {
    margin: 1rem 0 1rem 1.5rem;
}
.post-content li {
    margin-bottom: 0.4rem;
}
.post-content code {
    background: rgba(180, 150, 120, 0.12);
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
    font-size: 0.9em;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    color: var(--text-secondary);
}
.post-content pre {
    background: rgba(44, 24, 16, 0.03);
    border: 1px solid var(--border-light);
    border-radius: 3px;
    padding: 1rem 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    line-height: 1.6;
}
.post-content pre code {
    background: none;
    padding: 0;
}
.post-content hr {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 2rem 0;
}
.post-header-meta {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}
.post-header-meta a {
    color: var(--accent-brown);
    text-decoration: none;
}
.post-header-meta a:hover {
    text-decoration: underline;
}
.post-tags-row {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}
.post-tags-row .project-tag {
    display: inline-block;
    margin: 0.2rem;
}

/* ========== 评论区域 ========== */
.comments-area {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-medium);
}
.comments-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--text-primary);
    letter-spacing: 0.06em;
    margin-bottom: 1.2rem;
    text-align: center;
}
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.comment-list > li {
    margin-bottom: 1.5rem;
    padding: 1rem 1.5rem;
    background: rgba(253, 248, 242, 0.5);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    border-left: 3px solid var(--border-medium);
    box-sizing: border-box;
}

.comment-children {
    list-style: none !important;
    padding: 0 !important;
    margin-top: 0.5rem !important;
    box-sizing: border-box !important;
}
.comment-list > li > .comment-children {
    margin-left: 0 !important;
}
.comment-children .comment-children {
    margin-left: 0 !important;
}

.comment-list li,
.comment-children li {
    width: 100% !important;
    max-width: unset !important;
    box-sizing: border-box !important;
}

.comment-children li {
    padding: 0.6rem 0 !important;
    margin-bottom: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    border-bottom: 1px dashed var(--border-light) !important;
}
.comment-children li:last-child {
    border-bottom: none !important;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.3rem;
}
.comment-author img.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-light);
    flex-shrink: 0;
    margin-right: 0.5rem;
}
.comment-author .fn {
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 0.95rem;
}
.comment-author .fn a {
    color: inherit;
    text-decoration: none;
}

.comment-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    flex-shrink: 0;
}
.comment-meta a {
    color: var(--text-muted) !important;
    text-decoration: none !important;
    border-bottom: none !important;
}
.comment-meta a:hover {
    color: var(--accent-brown) !important;
}

.comment-content {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-top: 0.2rem;
}
.comment-content p {
    margin-bottom: 0.5rem;
}

.comment-children .comment-content p {
    display: inline;
    margin: 0;
}
.comment-children .comment-content p + p {
    display: block;
    margin-top: 0.5em;
}

/* @回复人 统一改为红色 */
.comment-content a[href^="#comment-"] {
    pointer-events: none;
    color: var(--seal-red) !important;
    text-decoration: none;
    border-bottom: none !important;
    font-weight: 600;
    cursor: default;
}
.comment-content a[href^="#comment-"]:hover {
    color: var(--seal-red) !important;
}
.comment-content a:not([href^="#comment-"]) {
    color: var(--accent-brown);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-warm);
}
.comment-content a:not([href^="#comment-"]):hover {
    color: var(--seal-red);
    border-bottom-color: var(--seal-red);
}

.comment-reply {
    text-align: right;
    margin-top: 0.3rem;
}
.comment-reply a {
    font-size: 0.8rem;
    color: var(--accent-brown);
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: color var(--transition);
}
.comment-reply a:hover {
    color: var(--seal-red);
}

/* 评论表单 */
.comment-respond {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(253, 248, 242, 0.6);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
}
.comment-respond h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-primary);
    letter-spacing: 0.06em;
    margin-bottom: 1rem;
    text-align: center;
}
.comment-form label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
    letter-spacing: 0.04em;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-light);
    border-radius: 3px;
    background: var(--bg-cream);
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: border-color var(--transition);
    margin-bottom: 0.8rem;
    resize: vertical;
}
.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent-brown);
    box-shadow: 0 0 0 3px rgba(122, 82, 56, 0.08);
}
.comment-form textarea {
    min-height: 120px;
}
.comment-form .submit {
    display: inline-block;
    padding: 0.5rem 1.8rem;
    background: var(--accent-brown);
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    transition: all var(--transition);
}
.comment-form .submit:hover {
    background: #6b4c3b;
    box-shadow: 0 3px 10px var(--shadow-medium);
}

/* ========== 分页（首页/文章/评论通用） ========== */
.pagination,
.page-navigator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
}
.pagination li,
.page-navigator li {
    list-style: none;
}
.pagination a,
.pagination span,
.page-navigator a,
.page-navigator span {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--border-light);
    border-radius: 2px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    transition: all var(--transition);
    background: rgba(253, 248, 242, 0.5);
    font-family: var(--font-heading);
}
.pagination a:hover,
.page-navigator a:hover {
    background: rgba(180, 140, 110, 0.2);
    border-color: var(--accent-brown);
    color: var(--accent-brown);
}
.pagination .current,
.page-navigator .current {
    background: var(--accent-brown);
    color: #fff;
    border-color: var(--accent-brown);
    font-weight: 600;
}
.pagination .prev,
.pagination .next,
.page-navigator .prev,
.page-navigator .next {
    font-weight: 500;
}

/* ========== 归档 ========== */
.archive-list {
    list-style: none;
    padding: 0;
    margin: 2rem 0 0 0 !important;
}
.archive-item {
    padding: 0.5rem 1rem;
    border-bottom: 1px dotted var(--border-light);
    transition: all var(--transition);
}
.archive-item:hover {
    background: rgba(253, 248, 242, 0.6);
}
.archive-item a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    transition: color var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.archive-item a:hover {
    color: var(--accent-brown);
}
.archive-item .archive-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.no-posts {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 0;
    letter-spacing: 0.08em;
}

/* ========== 404 ========== */
.not-found-section {
    text-align: center;
    padding: 3rem 1rem;
}
.not-found-section .error-code {
    font-family: var(--font-display);
    font-size: 6rem;
    color: var(--accent-brown);
    opacity: 0.6;
    letter-spacing: 0.1em;
}
.not-found-section .error-message {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    margin: 1rem 0 2rem;
}
.not-found-section .back-home {
    display: inline-block;
    padding: 0.6rem 2rem;
    border: 2px solid var(--accent-brown);
    color: var(--accent-brown);
    text-decoration: none;
    border-radius: 3px;
    font-family: var(--font-heading);
    letter-spacing: 0.08em;
    transition: all var(--transition);
}
.not-found-section .back-home:hover {
    background: var(--accent-brown);
    color: #fff;
}

/* ========== 页脚 ========== */
.footer-area {
    text-align: center;
    padding: 1.5rem 1rem 1rem;
    border-top: 1px solid var(--border-light);
    position: relative;
    z-index: 1;
}
.footer-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
}
.footer-text a {
    color: var(--accent-brown);
    text-decoration: none;
}
.footer-text a:hover {
    text-decoration: underline;
}
.footer-verse {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    margin-top: 0.2rem;
    opacity: 0.6;
}

/* ========== 返回顶部 & 主题切换 & 语言切换（统一间距） ========== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(180, 140, 110, 0.7);
    color: #fff;
    border: none;
    cursor: pointer;
    z-index: 200;
    box-shadow: 0 2px 10px rgba(100, 60, 30, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, background var(--transition);
}
.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.back-to-top:hover {
    background: rgba(140, 100, 70, 0.9);
}

.theme-toggle {
    position: fixed;
    bottom: 5.5rem;                     /* 与返回顶部间距约3.5rem */
    right: 2rem;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(180, 140, 110, 0.7);
    color: #fff;
    border: none;
    cursor: pointer;
    z-index: 200;
    box-shadow: 0 2px 10px rgba(100, 60, 30, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 1;
    pointer-events: auto;
    transition: background var(--transition);
}
.theme-toggle:hover {
    background: rgba(140, 100, 70, 0.9);
}
.theme-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.theme-icon svg {
    color: #fff;
    stroke: #fff;
}

/* 语言切换按钮 */
.lang-toggle {
    position: fixed;
    bottom: 9rem;                       /* 与主题切换间距约3.5rem */
    right: 2rem;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(180, 140, 110, 0.7);
    color: #fff;
    border: none;
    cursor: pointer;
    z-index: 200;
    box-shadow: 0 2px 10px rgba(100, 60, 30, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background var(--transition);
}
.lang-toggle:hover {
    background: rgba(140, 100, 70, 0.9);
}
.lang-text {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
}

/* 夜间模式语言按钮 */
body[data-theme="dark"] .lang-toggle {
    background: rgba(180, 140, 100, 0.8);
    color: #fff;
}
body[data-theme="dark"] .lang-toggle:hover {
    background: rgba(200, 160, 120, 0.9);
}

/* ========== 侧边栏 ========== */
.sidebar-widget {
    margin-bottom: 1.5rem;
    padding: 1rem 1.2rem;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    background: rgba(253, 248, 242, 0.4);
}
.sidebar-widget h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--text-primary);
    letter-spacing: 0.06em;
    margin-bottom: 0.8rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-light);
}
.sidebar-widget ul {
    list-style: none;
    padding: 0;
}
.sidebar-widget ul li {
    padding: 0.3rem 0;
    border-bottom: 1px dotted var(--border-light);
}
.sidebar-widget ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color var(--transition);
}
.sidebar-widget ul li a:hover {
    color: var(--accent-brown);
}

/* ========== 友链列表 ========== */
.links-list {
    list-style: none;
    padding: 0;
    margin: 20px 0 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
@media (max-width: 768px) {
    .links-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}
.links-item {
    background: var(--bg-cream);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(107, 76, 59, 0.06);
    transition: all 0.25s ease;
    overflow: hidden;
    box-sizing: border-box;
}
.links-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(107, 76, 59, 0.12);
    border-color: var(--accent-brown);
}
.links-item a {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    gap: 14px;
    box-sizing: border-box;
}
.links-item-img {
    flex-shrink: 0;
    line-height: 0;
}
.links-item-img img {
    display: block;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background: #f5f5f5;
    border: 1px solid var(--border-light);
}
.links-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}
.links-name {
    display: block;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.links-desc {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.no-links {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 0;
    margin: 0;
}

/* ========== 夜间模式 ========== */
body[data-theme="dark"] {
    --bg-page: #1a1815;
    --bg-paper: #28231e;
    --bg-cream: #302a24;
    --text-primary: #e8ddd0;
    --text-secondary: #c9bcab;
    --text-muted: #a69783;
    --border-light: #4b4034;
    --border-medium: #635548;
    --border-dark: #3b3228;
    --accent-brown: #c7a77b;
    --accent-warm: #9b7a5c;
    --seal-red: #d45c5f;
    --seal-red-light: #e07375;
    --seal-red-dark: #8b1a1f;
    --shadow-soft: rgba(0, 0, 0, 0.25);
    --shadow-medium: rgba(0, 0, 0, 0.35);
    --shadow-deep: rgba(0, 0, 0, 0.5);
    --parchment-dark: #1a1815;
    --parchment-light: #28231e;
}
body[data-theme="dark"] .texture-filter {
    opacity: 0.12;
    mix-blend-mode: overlay;
}
body[data-theme="dark"] .nav-bar {
    background: rgba(40, 35, 30, 0.95);
    border-bottom-color: var(--border-light);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}
body[data-theme="dark"] .nav-link {
    color: var(--text-muted);
}
body[data-theme="dark"] .nav-link.active {
    color: var(--accent-brown);
}
body[data-theme="dark"] .nav-slider {
    background-color: var(--accent-brown);
}
body[data-theme="dark"] .book-wrapper {
    background: var(--bg-paper);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
body[data-theme="dark"] .project-card {
    background: rgba(50, 45, 38, 0.5);
    border-color: var(--border-light);
}
body[data-theme="dark"] .project-card:hover {
    background: rgba(65, 58, 48, 0.85);
    border-left-color: var(--accent-brown);
}
body[data-theme="dark"] .project-tag {
    background: rgba(80, 70, 60, 0.4);
    border-color: var(--border-light);
    color: var(--text-muted);
}
body[data-theme="dark"] .project-tag:hover {
    background: rgba(180, 140, 100, 0.2);
    color: var(--accent-brown);
    border-color: var(--accent-brown);
}
body[data-theme="dark"] .comment-list > li {
    background: rgba(50, 45, 38, 0.6);
    border-color: var(--border-light);
    border-left-color: var(--border-medium);
}
body[data-theme="dark"] .comment-children li {
    border-bottom-color: var(--border-light) !important;
}
body[data-theme="dark"] .comment-respond {
    background: rgba(50, 45, 38, 0.7);
    border-color: var(--border-light);
}
body[data-theme="dark"] .comment-form input,
body[data-theme="dark"] .comment-form textarea {
    background: rgba(30, 25, 20, 0.7);
    border-color: var(--border-light);
    color: var(--text-primary);
}
body[data-theme="dark"] .comment-form input:focus,
body[data-theme="dark"] .comment-form textarea:focus {
    border-color: var(--accent-brown);
    box-shadow: 0 0 0 3px rgba(180, 140, 100, 0.2);
}
body[data-theme="dark"] .comment-form .submit {
    background: var(--accent-brown);
    color: #1a1815;
}
body[data-theme="dark"] .comment-form .submit:hover {
    background: #b38a5c;
}
body[data-theme="dark"] .sidebar-widget {
    background: rgba(50, 45, 38, 0.5);
    border-color: var(--border-light);
}
body[data-theme="dark"] .pagination a,
body[data-theme="dark"] .pagination span,
body[data-theme="dark"] .page-navigator a,
body[data-theme="dark"] .page-navigator span {
    background: rgba(50, 45, 38, 0.5);
    border-color: var(--border-light);
    color: var(--text-muted);
}
body[data-theme="dark"] .pagination a:hover,
body[data-theme="dark"] .page-navigator a:hover {
    background: rgba(180, 140, 100, 0.2);
    color: var(--accent-brown);
}
body[data-theme="dark"] .pagination .current,
body[data-theme="dark"] .page-navigator .current {
    background: var(--accent-brown);
    color: #1a1815;
}
body[data-theme="dark"] .archive-item {
    border-bottom-color: var(--border-light);
}
body[data-theme="dark"] .archive-item:hover {
    background: rgba(50, 45, 38, 0.6);
}
body[data-theme="dark"] .links-item {
    background: #2d2924;
    border-color: #4b4034;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
body[data-theme="dark"] .links-item:hover {
    border-color: var(--accent-brown);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}
body[data-theme="dark"] .links-name {
    color: #e8ddd0;
}
body[data-theme="dark"] .links-desc {
    color: #a69783;
}
body[data-theme="dark"] .post-content a {
    color: var(--accent-brown);
    border-bottom-color: var(--accent-warm);
}
body[data-theme="dark"] .post-content a:hover {
    color: var(--seal-red);
}
body[data-theme="dark"] .post-content blockquote {
    background: rgba(180, 140, 100, 0.1);
    border-left-color: var(--accent-warm);
}
body[data-theme="dark"] .post-content code {
    background: rgba(180, 140, 100, 0.15);
}
body[data-theme="dark"] .post-content pre {
    background: rgba(0, 0, 0, 0.2);
    border-color: var(--border-light);
}
body[data-theme="dark"] .back-to-top {
    background: rgba(180, 140, 110, 0.7);
}
body[data-theme="dark"] .back-to-top:hover {
    background: rgba(200, 160, 120, 0.9);
}
body[data-theme="dark"] .theme-toggle {
    background: rgba(180, 140, 100, 0.8);
    color: #1a1815;
}
body[data-theme="dark"] .theme-toggle:hover {
    background: rgba(200, 160, 120, 0.9);
}

/* ==================== 时光机页面样式 ==================== */
#shiguangji .comment-body.comment-parent {
    background: rgba(253, 248, 242, 0.5);
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--border-medium);
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    list-style: none;
    box-sizing: border-box;
}
#shiguangji .comment-body.comment-parent > div:first-child {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0;
    margin-bottom: 0;
}
#shiguangji .comment-body.comment-child > div:first-child {
    padding: 0.6rem 0;
    margin-bottom: 0;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}
#shiguangji .comment-body {
    margin: 0 0 16px 0;
    padding: 0;
}
#shiguangji .comment-parent > .comment-children {
    margin-left: 20px;
    margin-top: 12px;
    padding-left: 0;
    list-style: none;
}
#shiguangji .comment-child > .comment-children {
    margin-left: 0;
    margin-top: 12px;
    padding-left: 0;
    list-style: none;
}
#shiguangji .comment-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.3rem;
}
#shiguangji .comment-author img.avatar {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    border: 2px solid var(--border-light);
}
#shiguangji .comment-author .fn {
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 0.95rem;
}
#shiguangji .comment-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    flex-shrink: 0;
}
#shiguangji .comment-meta a {
    color: var(--text-muted);
    text-decoration: none;
}
#shiguangji .comment-meta a:hover {
    color: var(--accent-brown);
}
#shiguangji .comment-content {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-top: 0.2rem;
}
#shiguangji .comment-content .comment-at {
    color: var(--seal-red) !important;
    text-decoration: none;
    font-weight: 600;
    pointer-events: none;
}
#shiguangji .comment-content a:not(.comment-at) {
    color: var(--accent-brown);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-warm);
}
#shiguangji .comment-content a:not(.comment-at):hover {
    color: var(--seal-red);
    border-bottom-color: var(--seal-red);
}
#shiguangji .comment-reply {
    text-align: right;
    margin-top: 0.3rem;
}
#shiguangji .comment-reply .reply-trigger {
    font-size: 0.8rem;
    color: var(--accent-brown);
    text-decoration: none;
    letter-spacing: 0.05em;
    cursor: pointer;
}
#shiguangji .comment-reply .reply-trigger:hover {
    color: var(--seal-red);
}
#shiguangji .no-comments {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 0;
    letter-spacing: 0.08em;
}
#shiguangji .page-navigator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
}
#shiguangji .page-navigator a,
#shiguangji .page-navigator span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--border-light);
    border-radius: 2px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    background: rgba(253, 248, 242, 0.5);
    font-family: var(--font-heading);
    transition: all var(--transition);
    min-width: 2.2rem;
}
#shiguangji .page-navigator a:hover {
    background: rgba(180, 140, 110, 0.2);
    border-color: var(--accent-brown);
    color: var(--accent-brown);
}
#shiguangji .page-navigator .current {
    background: var(--accent-brown);
    color: #fff;
    border-color: var(--accent-brown);
    font-weight: 600;
}
#shiguangji .page-navigator .prev i,
#shiguangji .page-navigator .next i {
    font-size: 0.85rem;
    line-height: 1;
    color: inherit;
}
#shiguangji .page-navigator .prev a,
#shiguangji .page-navigator .next a {
    font-weight: 500;
}
#shiguangji .reply-form-container {
    margin: 10px 0;
}
#shiguangji #original-form-wrapper {
    margin-bottom: 20px;
    background: transparent;
    border: none;
    padding: 0;
}
#shiguangji .comment-input-wrapper {
    position: relative;
    width: 100%;
}
#shiguangji textarea.comment-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px 44px 12px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    font-size: 0.9rem;
    line-height: 1.6;
    resize: vertical;
    background: var(--bg-cream);
    color: var(--text-primary);
    box-sizing: border-box;
    font-family: var(--font-body);
}
#shiguangji .send-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: var(--accent-brown);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
#shiguangji .send-btn:hover {
    background: #6b4c3b;
}
#shiguangji .send-btn svg {
    width: 16px;
    height: 16px;
}
#shiguangji .guest-fields {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
#shiguangji .guest-fields input {
    flex: 1 1 150px;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    background: var(--bg-cream);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-body);
}
#shiguangji .cancel-reply-link {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    cursor: pointer;
    text-decoration: none;
}
#shiguangji .cancel-reply-link:hover {
    color: var(--accent-brown);
}
#shiguangji .reply-hint {
    text-align: center;
    padding: 1rem 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border: 1px dashed var(--border-light);
    border-radius: 8px;
    margin-top: 1rem;
}

/* 时光机夜间模式适配 */
body[data-theme="dark"] #shiguangji .comment-body.comment-parent {
    background: rgba(50, 45, 38, 0.6);
    border-color: var(--border-light);
    border-left-color: var(--border-medium);
}
body[data-theme="dark"] #shiguangji textarea.comment-textarea {
    background: rgba(30, 25, 20, 0.7);
    border-color: var(--border-light);
}
body[data-theme="dark"] #shiguangji .guest-fields input {
    background: rgba(30, 25, 20, 0.7);
    border-color: var(--border-light);
}
body[data-theme="dark"] #shiguangji .reply-hint {
    border-color: var(--border-light);
}
body[data-theme="dark"] #shiguangji .page-navigator a,
body[data-theme="dark"] #shiguangji .page-navigator span {
    background: rgba(50, 45, 38, 0.5);
    border-color: var(--border-light);
    color: var(--text-muted);
}
body[data-theme="dark"] #shiguangji .page-navigator a:hover {
    background: rgba(180, 140, 100, 0.2);
    color: var(--accent-brown);
}
body[data-theme="dark"] #shiguangji .page-navigator .current {
    background: var(--accent-brown);
    color: #1a1815;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .book-wrapper {
        margin: 0.5rem;
        border-radius: 1px;
    }
    .content-inner {
        padding: 1.2rem 1.2rem 1.5rem;
    }
    .hero-section {
        padding: 1.2rem 0.5rem 1rem;
        min-height: auto;
    }
    .hero-title {
        font-size: 2.8rem;
        letter-spacing: 0.08em;
    }
    .hero-subtitle {
        font-size: 0.9rem;
        letter-spacing: 0.1em;
        margin-top: 0.8rem;
    }
    .section-title {
        font-size: 1.4rem;
        margin-bottom: 0.2rem;
    }
    .section-title-en {
        margin-bottom: 0.1rem;
    }
    .section-divider {
        margin: 0.3rem 0 1.2rem;
    }
    .projects-section {
        padding: 0.2rem 0 1rem;
    }
    .nav-bar {
        gap: 1.5rem;
        padding: 0.5rem 1rem;
    }
    .nav-link {
        font-size: 0.85rem;
        letter-spacing: 0.04em;
    }
    .project-card {
        padding: 1.2rem 1rem;
    }
    .project-card::after {
        display: none;
    }

    /* 移动端三个浮动按钮间距统一为 3rem */
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
    }
    .theme-toggle {
        bottom: 4rem;                /* 1rem + 36px + 间距 ≈ 4rem */
        right: 1rem;
        width: 36px;
        height: 36px;
    }
    .lang-toggle {
        bottom: 7rem;                /* 4rem + 36px + 间距 ≈ 7rem */
        right: 1rem;
        width: 36px;
        height: 36px;
    }
    .lang-text {
        font-size: 0.8rem;
    }
    .theme-icon svg {
        width: 18px;
        height: 18px;
    }

    .post-content {
        font-size: 0.9rem;
    }
    .post-content p {
        text-indent: 1.5em;
    }
    .comment-list li {
        padding: 0.8rem 1rem;
    }
    .comment-children li {
        padding: 0.5rem 0 !important;
    }
    .comment-author {
        gap: 0.3rem;
    }
    .pagination a,
    .pagination span,
    .page-navigator a,
    .page-navigator span {
        padding: 0.3rem 0.6rem;
        font-size: 0.78rem;
    }
}

@media (max-width: 400px) {
    .hero-title {
        font-size: 2.2rem;
    }
    .nav-bar {
        gap: 0.8rem;
    }
    .nav-link {
        font-size: 0.75rem;
    }
    .archive-item a {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }
}

@media print {
    body {
        background: #fff;
    }
    .book-wrapper {
        box-shadow: none;
        border: 1px solid #ccc;
        margin: 0;
        max-width: 100%;
    }
    .nav-bar,
    .back-to-top,
    .book-cover-strip,
    .book-cover-strip-bottom,
    .texture-filter,
    .comments-area,
    .comment-respond,
    .theme-toggle {
        display: none;
    }
}

/* ========== ICP 备案号 ========== */
.footer-icp {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    margin-top: 0.2rem;
}
.footer-icp a {
    color: var(--accent-brown);
    text-decoration: none;
    transition: color var(--transition);
}
.footer-icp a:hover {
    color: var(--seal-red);
    text-decoration: underline;
}

/* 夜间模式适配 */
body[data-theme="dark"] .footer-icp a {
    color: var(--accent-brown);
}
body[data-theme="dark"] .footer-icp a:hover {
    color: var(--seal-red);
}

/* ========== 评论头像保底样式 ========== */
.avatar-wrapper {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.avatar-wrapper .avatar {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-fallback {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #ccc;
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    align-items: center;
    justify-content: center;
}

/* 当图片加载失败被隐藏时，显示备用首字母 */
.avatar-wrapper .avatar[style*="display:none"] + .avatar-fallback {
    display: flex;
}


/* 文章图片懒加载（模糊） */
.post-content img.lazy-blur {
    filter: blur(20px);
    transition: filter 0.6s ease;
}
.post-content img.lazy-blur.loaded {
    filter: blur(0);
}

/* 首页文章内容文字显示3行 */
.project-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}