:root {
    --bg: #ffffff;
    --text: #1a1a1a;
    --sub: #888;
    --line-color: #e5e5e5;
    --header-height: 120px;

    --ease-move: cubic-bezier(0.65, 0, 0.35, 1);
    --ease-line: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-out-quint: cubic-bezier(0.23, 1, 0.32, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    opacity: 0;
    animation: fadeInBody 0.5s ease forwards;
}

@keyframes fadeInBody {
    to { opacity: 1; }
}

/* --- 1. Logo 容器 --- */
#brand-container {
    position: fixed;
    z-index: 1000;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.6);
    text-align: center;
    transition: all 1.2s var(--ease-move);
    width: 100%;
}

.site-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: #000;
    pointer-events: auto;
}

.site-title a {
    color: #000;
    text-decoration: none;
    pointer-events: auto;
}

/* 首页动画：Logo上移 */
body.is-home.moved #brand-container {
    top: 0;
    left: 50%;
    transform: translate(-50%, 0) scale(1);
    height: var(--header-height);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
}

/* 内页：直接显示最终状态，无动画 */
body.is-page #brand-container {
    top: 0;
    left: 50%;
    transform: translate(-50%, 0) scale(1);
    height: var(--header-height);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    transition: none;
}

/* --- 2. 搜索入口按钮 --- */
#search-trigger {
    position: fixed;
    top: 0;
    right: 40px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.icon-search {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: #1a1a1a;
    stroke-width: 1.5;
    transition: stroke 0.3s;
}

#search-trigger:hover .icon-search {
    stroke: #888;
}

/* 首页动画：搜索图标显现 */
body.is-home.draw-line #search-trigger {
    opacity: 1;
    pointer-events: auto;
}

/* 内页：直接显示 */
body.is-page #search-trigger {
    opacity: 1;
    pointer-events: auto;
    transition: none;
}

/* --- 3. 搜索全屏遮罩 --- */
#search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#search-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.close-btn {
    position: absolute;
    top: 40px;
    right: 40px;
    font-size: 2rem;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    color: #ccc;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #000;
}

.search-input-wrap {
    width: 80%;
    max-width: 600px;
    position: relative;
}

.search-input {
    width: 100%;
    border: none;
    border-bottom: 1px solid #ddd;
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    padding: 10px 0;
    background: transparent;
    outline: none;
    color: #000;
    text-align: center;
}

.search-input::placeholder {
    color: #eee;
}

#search-results {
    width: 80%;
    max-width: 600px;
    margin-top: 40px;
    max-height: 50vh;
    overflow-y: auto;
}

.search-result-item {
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    display: block;
    color: inherit;
    transition: opacity 0.3s;
}

.search-result-item:hover {
    opacity: 0.7;
}

.search-result-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: #111;
}

.search-result-excerpt {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
}

/* --- 4. 独立的分割线 --- */
#header-line {
    position: fixed;
    top: var(--header-height);
    left: 0;
    height: 1px;
    background-color: var(--line-color);
    z-index: 999;
    width: 0%;
    transition: width 1.2s var(--ease-line);
}

/* 首页动画：线条划出 */
body.is-home.draw-line #header-line {
    width: 100%;
}

/* 内页：直接显示完整线条 */
body.is-page #header-line {
    width: 100%;
    transition: none;
}

/* --- 5. 内容区域 --- */
.container {
    max-width: 720px;
    margin: 0 auto;
    /* padding: calc(var(--header-height) + 60px) 20px 100px; */
    opacity: 1;
    transform: translateY(0);
    transition: opacity 1s ease, transform 1s ease;
}

/* 首页专用：内容初始隐藏，动画后显示 */
body:not(.show-content) .container .post-item,
body:not(.show-content) .container .pagination {
    opacity: 0;
    transform: translateY(40px);
}

body.show-content .container .post-item,
body.show-content .container .pagination {
    opacity: 1;
    transform: translateY(0);
}

/* --- 6. 列表样式 --- */
.post-item {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 40px 0;
    border-bottom: 1px solid transparent;
    position: relative;
}

.post-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: #f0f0f0;
    transform: scaleX(1);
    transform-origin: left;
    transition: background 0.3s;
}

.post-item:hover::after {
    background: #000;
}

.post-meta {
    font-size: 0.75rem;
    color: var(--sub);
    letter-spacing: 1px;
    margin-bottom: 12px;
    font-family: 'Inter', monospace;
}

.post-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 400;
    line-height: 1.25;
    margin-bottom: 10px;
    color: #111;
    transition: color 0.3s;
}

.post-excerpt {
    font-size: 1rem;
    color: #666;
    line-height: 1.6;
    font-weight: 300;
}

.post-item {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

body.show-content .post-item {
    opacity: 1;
    transform: translateY(0);
}

body.show-content .post-item:nth-child(1) { transition-delay: 0.05s; }
body.show-content .post-item:nth-child(2) { transition-delay: 0.1s; }
body.show-content .post-item:nth-child(3) { transition-delay: 0.15s; }
body.show-content .post-item:nth-child(4) { transition-delay: 0.2s; }
body.show-content .post-item:nth-child(5) { transition-delay: 0.25s; }
body.show-content .post-item:nth-child(6) { transition-delay: 0.3s; }
body.show-content .post-item:nth-child(7) { transition-delay: 0.35s; }
body.show-content .post-item:nth-child(8) { transition-delay: 0.4s; }

/* --- 7. 分页 --- */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px 0;
    font-size: 0.875rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease 0.45s;
}

body.show-content .pagination {
    opacity: 1;
    transform: translateY(0);
}

.page-link {
    color: var(--text);
    text-decoration: none;
    transition: opacity 0.3s;
}

.page-link:hover {
    opacity: 0.6;
}

.page-number {
    color: var(--sub);
    font-family: 'Inter', monospace;
}

/* --- 8. 非首页的固定 Header --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid var(--line-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.header .site-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

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

/* --- 9. Footer --- */
.footer {
    margin-top: 80px;
    padding: 30px 20px 60px;
    text-align: center;
    color: var(--sub);
    font-size: 0.75rem;
    border-top: 1px solid var(--line-color);
}

.footer-content p {
    margin: 8px 0;
}

/* --- 10. 单篇文章页面样式 --- */
.post-single {
    max-width: 960px;
    margin: 0 auto;
    padding: 0px 40px 100px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* 文章页动画 */
body.is-page.page-loaded .post-single {
    opacity: 1;
    transform: translateY(0);
}

/* --- 侧边栏 --- */
.sidebar-left,
.sidebar-right {
    position: fixed;
    top: calc(var(--header-height) + 40px);
    width: 240px;
    max-height: calc(100vh - var(--header-height) - 80px);
    overflow-y: auto;
    padding: 20px;
    display: none;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
}

.sidebar-left {
    left: 20px;
}

.sidebar-right {
    right: 20px;
}

/* 只在大屏幕显示侧栏 */
@media (min-width: 1400px) {
    .sidebar-left,
    .sidebar-right {
        display: block;
    }
}

.sidebar-section {
    margin-bottom: 40px;
}

.sidebar-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #111;
    letter-spacing: -0.3px;
}

/* 左侧栏：归档时间线 */
.archive-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 20px;
}

/* 时间线竖线 */
.archive-timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--line-color);
}

.timeline-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-decoration: none;
    color: inherit;
    padding: 12px 0 12px 16px;
    position: relative;
    transition: opacity 0.3s;
}

/* 时间线圆点 */
.timeline-item::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 16px;
    width: 8px;
    height: 8px;
    background: #fff;
    border: 2px solid var(--line-color);
    border-radius: 50%;
    transition: all 0.3s;
}

.timeline-item:hover {
    opacity: 1;
}

.timeline-item:hover::before {
    background: var(--text);
    border-color: var(--text);
    transform: scale(1.3);
}

.timeline-date {
    font-family: 'Inter', monospace;
    font-size: 0.65rem;
    color: var(--sub);
    letter-spacing: 0.5px;
}

.timeline-title {
    font-size: 0.85rem;
    color: var(--text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 左侧栏：标签云 */
.sidebar-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sidebar-tag {
    font-family: 'Inter', monospace;
    font-size: 0.7rem;
    color: var(--sub);
    text-decoration: none;
    padding: 4px 8px;
    border: 1px solid var(--line-color);
    border-radius: 2px;
    transition: all 0.3s;
}

.sidebar-tag:hover {
    color: var(--text);
    border-color: var(--text);
}

/* 右侧栏：目录 */
.toc {
    font-size: 0.85rem;
    line-height: 1.8;
}

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

.toc li {
    margin: 0;
    padding: 0;
}

.toc a {
    color: var(--sub);
    text-decoration: none;
    display: block;
    padding: 6px 0;
    transition: color 0.3s;
    border-left: 2px solid transparent;
    padding-left: 12px;
    margin-left: -12px;
}

.toc a:hover {
    color: var(--text);
}

.toc a.active {
    color: var(--text);
    border-left-color: var(--text);
}

.toc ul ul {
    padding-left: 16px;
}

.toc ul ul a {
    font-size: 0.8rem;
}

/* 侧栏滚动条样式 */
.sidebar-left::-webkit-scrollbar,
.sidebar-right::-webkit-scrollbar {
    width: 4px;
}

.sidebar-left::-webkit-scrollbar-track,
.sidebar-right::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-left::-webkit-scrollbar-thumb,
.sidebar-right::-webkit-scrollbar-thumb {
    background: var(--line-color);
    border-radius: 2px;
}

.sidebar-left::-webkit-scrollbar-thumb:hover,
.sidebar-right::-webkit-scrollbar-thumb:hover {
    background: var(--sub);
}

.post-header {
    margin-bottom: 30px;
}

.post-title-single {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 600;
    letter-spacing: -1.5px;
    margin: 0 0 30px 0;
    line-height: 1.1;
    color: #111;
}

.post-meta-single {
    font-family: 'Inter', monospace;
    font-size: 0.7rem;
    color: var(--sub);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 30px;
}

.separator {
    margin: 0 10px;
    color: var(--line-color);
}

.post-content {
    font-size: 1.125rem;
    line-height: 1.9;
    color: var(--text);
}

.post-content h1,
.post-content h2,
.post-content h3 {
    font-family: 'Playfair Display', serif;
    margin-top: 80px;
    margin-bottom: 30px;
    font-weight: 600;
    letter-spacing: -0.8px;
    color: #111;
    line-height: 1.2;
}

.post-content h1 { font-size: 2.75rem; }
.post-content h2 { font-size: 2.25rem; }
.post-content h3 { font-size: 1.75rem; }

.post-content p {
    margin-bottom: 24px;
}

.post-content a {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: var(--line-color);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.3s;
}

.post-content a:hover {
    text-decoration-color: var(--text);
}

.post-content img {
    max-width: 100%;
    height: auto;
    margin: 40px 0;
    border-radius: 4px;
}

.post-content pre {
    background: #f8f8f8;
    padding: 24px;
    overflow-x: auto;
    border-radius: 4px;
    margin: 32px 0;
    border: 1px solid var(--line-color);
}

.post-content code {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.9em;
}

/* 代码高亮容器 */
.post-content .highlight {
    position: relative;
    background: #fafafa;
    border-radius: 6px;
    margin: 32px 0;
    border: 1px solid var(--line-color);
    overflow-x: auto;
}

.post-content .highlight pre {
    margin: 0;
    padding: 20px;
    background: transparent;
    border: none;
    border-radius: 6px;
    overflow-x: auto;
}

.post-content .highlight code {
    white-space: pre;
    word-wrap: normal;
    overflow-wrap: normal;
}

/* 行号样式 */
.post-content .highlight .lntd {
    padding: 0;
    margin: 0;
    border: none;
}

.post-content .highlight .lnt,
.post-content .highlight .ln {
    color: #aaa;
    user-select: none;
    padding-right: 1em;
}

/* 单行代码块隐藏行号列 */
.post-content .highlight.single-line .lntd:first-child {
    display: none;
}

.post-content .highlight.single-line .lnt,
.post-content .highlight.single-line .ln {
    display: none;
}

/* 代码复制按钮 */
.code-copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line-color);
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text);
}

.highlight:hover .code-copy-btn {
    opacity: 1;
}

.code-copy-btn:hover {
    background: #fff;
    border-color: var(--text);
}

.code-copy-btn.copied {
    background: #4caf50;
    color: #fff;
    border-color: #4caf50;
}

.code-copy-btn svg {
    width: 16px;
    height: 16px;
}

.post-content blockquote {
    border-left: 3px solid var(--text);
    margin: 32px 0;
    padding-left: 24px;
    color: var(--sub);
    font-style: italic;
}

.post-content ul,
.post-content ol {
    padding-left: 28px;
    margin-bottom: 24px;
}

.post-content li {
    margin-bottom: 8px;
}

/* --- 文章标签 --- */
.post-tags-single {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--line-color);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.tag-link {
    font-family: 'Inter', monospace;
    font-size: 0.75rem;
    color: var(--sub);
    text-decoration: none;
    letter-spacing: 0.5px;
    padding: 6px 12px;
    border: 1px solid var(--line-color);
    border-radius: 2px;
    transition: all 0.3s;
}

.tag-link:hover {
    color: var(--text);
    border-color: var(--text);
}

/* --- 文章导航 --- */
.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid var(--line-color);
}

.post-nav-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    padding: 24px;
    border: 1px solid var(--line-color);
    transition: all 0.3s;
    position: relative;
}

.post-nav-item:hover {
    border-color: var(--text);
    transform: translateY(-2px);
}

.post-nav-prev {
    text-align: left;
}

.post-nav-next {
    text-align: right;
}

.post-nav-label {
    font-family: 'Inter', monospace;
    font-size: 0.7rem;
    color: var(--sub);
    letter-spacing: 1.5px;
    font-weight: 500;
}

.post-nav-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.3;
    color: var(--text);
}

/* --- 标签和归档页面 --- */
.tag-page,
.tags-list,
.archives {
    max-width: 720px;
    margin: 0 auto;
    padding: calc(var(--header-height) + 60px) 20px 100px;
}
.tag-page{
    padding: calc(var(--header-height)) 20px 100px;
}
.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 600;
    letter-spacing: -1px;
    margin-bottom: 20px;
    color: #111;
}

.tag-desc {
    font-family: 'Inter', monospace;
    font-size: 0.75rem;
    color: var(--sub);
    letter-spacing: 1px;
    margin-bottom: 40px;
    text-transform: uppercase;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 40px;
}

.tag-item {
    font-family: 'Inter', monospace;
    color: var(--text);
    text-decoration: none;
    transition: opacity 0.3s;
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
}

.tag-item:hover {
    opacity: 0.6;
}

.tag-count {
    color: var(--sub);
    font-size: 0.85em;
}

/* --- 11. 响应式设计 --- */
@media (max-width: 600px) {
    :root {
        --header-height: 80px;
    }

    .site-title {
        font-size: 1.8rem;
    }

    #search-trigger {
        right: 20px;
    }

    .search-input {
        font-size: 1.5rem;
    }

    .container {
        padding: 0px 16px 60px;
    }

    .post-item {
        padding: 30px 0;
    }

    .post-title {
        font-size: 1.5rem;
    }

    .post-single {
        padding: 0px 16px 60px;
    }

    .post-title-single {
        font-size: 2rem;
    }

    .post-content {
        font-size: 1rem;
    }

    .post-content h1 { font-size: 1.75rem; }
    .post-content h2 { font-size: 1.5rem; }
    .post-content h3 { font-size: 1.25rem; }

    /* 移动端代码块优化 */
    .post-content .highlight {
        margin: 20px -16px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .post-content .highlight pre {
        padding: 16px;
        font-size: 0.85rem;
    }

    .post-content code {
        font-size: 0.85em;
    }

    .code-copy-btn {
        top: 8px;
        right: 8px;
        padding: 4px 8px;
        font-size: 0.7rem;
    }

    /* 移动端文章导航优化 */
    .post-nav {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 40px;
        padding-top: 30px;
    }

    .post-nav-item {
        padding: 16px;
    }

    .post-nav-prev,
    .post-nav-next {
        text-align: left;
    }

    .post-nav-title {
        font-size: 1.1rem;
    }

    .close-btn {
        top: 20px;
        right: 20px;
    }
}
.index-pd {
    padding: calc(var(--header-height) + 60px) 20px 100px;
}