@charset "utf-8";
/*
 * Theme Name: Leay Minimal (Typecho World Color Edition)
 * Theme URI: https://leay.net/
 * Author: AI Designer
 * Author URI: https://leay.net/
 * Description: 结合 Typecho World 2.0 橄榄绿/燕麦米白大地色调的极简自适应主题。
 * Version: 1.1.0
 */

/* ==========================================================================
   全局配色变量定义 (Typecho World 配色系统)
   ========================================================================== */
:root {
    --bg-main: #f4f4ee;           /* 主页面背景：燕麦米白，温润护眼 */
    --bg-card: #ffffff;           /* 容器/卡片背景：纯白 */
    --bg-subtle: #eaeae0;         /* 次级浅色背景：输入框、短代码浅衬底 */
    --bg-quote: #e8e8dc;          /* 引用块背景：稍深自然暖沙色 */
    --bg-dark: #2c332d;           /* 深色代码块背景：深炭绿灰 */
    
    --primary-color: #425244;     /* 主品牌色：沉稳橄榄绿 */
    --primary-hover: #536655;     /* 主色悬浮态：轻微提亮橄榄绿 */
    
    --text-main: #222222;          /* 主文字色：深炭灰 */
    --text-body: #333333;          /* 正文文字色 */
    --text-muted: #8a8e85;         /* 次要/元信息文字色：灰褐色 */
    --text-code: #d97736;          /* 行内代码高亮：复古暖橙 */
    
    --border-color: #d8d8ce;      /* 标准边框/分割线颜色 */
    --border-light: #e5e5dc;      /* 淡色分割线 */
}

/* 基础重置 */
*, *::before, *::after {
    box-sizing: border-box;
}
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: "微軟正黑體", "Punct Song Body", minion-pro, "Times New Roman", 思源宋体, "Noto Serif SC", "Songti SC", NSimSun, SimSun, serif;
    background-color: var(--bg-main);
    color: var(--text-body);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}
a {
    color: var(--text-body);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover {
    color: var(--primary-color);
}

/* 主容器布局 - 默认PC端：左右布局 */
.main-container {
    display: table;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    table-layout: fixed;
    padding: 60px 20px;
}
.sidebar-col {
    display: table-cell;
    width: 260px;
    vertical-align: top;
    padding-right: 50px;
}
.content-col {
    display: table-cell;
    vertical-align: top;
}

/* 侧边栏样式 */
.sidebar {
    position: sticky;
    top: 60px;
    text-align: center;
}
.avatar-wrap {
    margin-bottom: 25px;
}
.avatar-wrap img {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
    padding: 5px;
    background-color: var(--bg-card);
    transition: transform 0.5s ease;
}
.avatar-wrap img:hover {
    transform: rotate(360deg);
}
.site-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 8px 0;
    letter-spacing: 1px;
}
.site-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 30px 0;
}
.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
}
.nav-menu li {
    margin: 10px 0;
}
.nav-menu a {
    font-size: 0.95rem;
    display: block;
    padding: 6px 0;
}
.site-status {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* 右侧内容区 & 归档文章列表 */
.archive-container {
    padding-left: 20px;
}
.year-group {
    margin-bottom: 40px;
}
.year-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}
.archive-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.archive-item {
    padding: 12px 0;
    border-bottom: 0px dashed var(--border-color);
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.archive-date {
    display: inline-block;
    color: var(--text-muted);
    font-family: "微軟正黑體", "Punct Song Body", minion-pro, "Times New Roman", 思源宋体, "Noto Serif SC", "Songti SC", NSimSun, SimSun, serif;
    width: 80px;
}
.archive-title {
    font-weight: 400;
}

/* 移动端专属导航条 (PC默认隐藏) */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 55px;
    background-color: var(--bg-main);
    border-bottom: 1px solid var(--border-light);
    z-index: 999;
    padding: 0 15px;
}
.mobile-header-inner {
    display: table;
    width: 100%;
    height: 100%;
}
.mobile-nav-toggle, .mobile-title, .mobile-search-toggle {
    display: table-cell;
    vertical-align: middle;
}
.mobile-nav-toggle {
    width: 40px;
    font-size: 1.3rem;
    cursor: pointer;
}
.mobile-title {
    text-align: center;
    font-size: 1.14rem;
    font-weight: bold;
    color: var(--text-main);
}
.mobile-search-toggle {
    width: 40px;
    text-align: right;
    font-size: 1.2rem;
    cursor: pointer;
}

/* 抽屉式侧边栏（移动端展示） */
.mobile-drawer {
    position: fixed;
    top: 55px;
    left: -280px;
    bottom: 0;
    width: 260px;
    background-color: var(--bg-main);
    border-right: 1px solid var(--border-color);
    z-index: 998;
    transition: left 0.3s ease;
    padding: 30px 20px;
    overflow-y: auto;
}
.mobile-drawer.active {
    left: 0;
}
.drawer-mask {
    display: none;
    position: fixed;
    top: 55px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.15);
    z-index: 997;
}

/* 弹出搜索框 */
.search-modal {
    display: none;
    position: fixed;
    top: 55px;
    left: 0;
    right: 0;
    background-color: var(--bg-main);
    border-bottom: 1px solid var(--border-color);
    padding: 15px;
    z-index: 1000;
}
.search-modal.active {
    display: block;
}
.search-form-inner {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}
.search-input {
    width: 100%;
    padding: 10px 15px;
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    outline: none;
    font-size: 1rem;
    color: var(--text-main);
}


/* ==========================================================================
   文章详情页 (post) 排版与色彩适配
   ========================================================================== */

/* 1. 详情页骨架布局 */
.post-container {
    max-width: 700px;
    margin: 0 auto;
    padding-top: 20px;
}

/* 2. 文章头部区域 */
.post-header {
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.post-title {
    font-size: 1.9rem; 
    font-weight: 700; 
    color: var(--text-main); 
    margin: 0 0 12px 0; 
    line-height: 1.4; 
    letter-spacing: -0.5px;
}

.post-meta {
    font-size: 0.85rem; 
    color: var(--text-muted);
    margin-top: 8px;
}

.post-meta span {
    margin-right: 18px;
}

/* 3. 正文字体与段落 */
.post-content {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text-body);
    letter-spacing: 0.3px;
}

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

.post-content h2, 
.post-content h3 {
    margin: 45px 0 20px 0;
    color: var(--text-main);
}

/* 4. 引用块 (blockquote) - 橄榄绿左边框 + 沙白色衬底 */
.post-content blockquote {
    margin: 35px 0;
    padding: 15px 24px;
    background-color: var(--bg-quote);
    border-left: 3px solid var(--primary-color);
    border-radius: 0 4px 4px 0;
    color: #555c54; 
    font-style: italic;
}

.post-content blockquote p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.75;
}

/* 5. 行内短代码 (code) */
.post-content :not(pre) > code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9em;
    background-color: var(--bg-subtle);
    color: var(--text-code);
    padding: 3px 6px;
    border-radius: 3px;
    word-break: break-word;
}

/* 6. 代码块 (pre) - 复古深炭绿质感 */
.post-content pre {
    margin: 35px 0;
    padding: 20px;
    background-color: var(--bg-dark);
    border-radius: 6px;
    overflow-x: auto;
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.25);
}

.post-content pre code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9rem;
    color: #e2e8e0;
    line-height: 1.6;
    display: block;
    background: none;
    padding: 0;
    border-radius: 0;
    word-break: normal;
    white-space: pre;
}

/* 7. 图像容器 (img & figure) */
.post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 40px auto 12px auto;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(66, 82, 68, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-content img:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(66, 82, 68, 0.15);
}

.post-content .img-caption, 
.post-content figure figcaption {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    font-style: italic;
}

/* 8. 分割线 (hr) */
.post-content hr {
    margin: 50px 0;
    border: none;
    border-top: 1px dashed var(--border-color);
    text-align: center;
}

.post-content hr::after {
    content: "···";
    display: inline-block;
    position: relative;
    top: -11px;
    padding: 0 10px;
    background-color: var(--bg-main);
    color: var(--text-muted);
    font-size: 1.2rem;
    letter-spacing: 4px;
}

/* 9. 列表 (ul / ol) */
.post-content ul, 
.post-content ol {
    margin: 0 0 30px 0;
    padding-left: 24px;
}

.post-content li {
    margin-bottom: 10px;
    color: var(--text-body);
}

/* 10. 文章底部元信息 */
.post-footer-meta {
    margin-top: 60px; 
    font-size: 0.85rem; 
    color: var(--text-muted); 
    border-top: 1px dashed var(--border-color); 
    padding-top: 20px;
}

.post-footer-meta p { 
    margin-bottom: 8px; 
}

.post-footer-meta .quote-text {
    font-style: italic; 
    color: var(--primary-color);
}

/* 分页组件 */
.pagination-wrap {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}
.page-navigator {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
}
.page-navigator li {
    display: inline-block;
    margin: 0 5px;
}
.page-navigator a, .page-navigator span {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    color: var(--text-body);
}
.page-navigator .current a {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

/* 上一篇/下一篇 导航 */
.post-near-navigation {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    display: table;
    width: 100%;
}

.near-item {
    display: table-cell;
    width: 50%;
    vertical-align: top;
}

.near-prev {
    padding-right: 20px;
    text-align: left;
}

.near-next {
    padding-left: 20px;
    text-align: right;
}

.near-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.near-title,
.near-title a {
    font-size: 0.9rem;
    color: var(--text-body);
    line-height: 1.5;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.near-title a:hover {
    color: var(--primary-color);
}

@media screen and (max-width: 600px) {
    .post-near-navigation {
        display: block;
    }
    .near-item {
        display: block;
        width: 100%;
        text-align: left;
    }
    .near-prev {
        padding-right: 0;
        margin-bottom: 25px;
    }
    .near-next {
        padding-left: 0;
        text-align: left;
    }
}


/* ==========================================================================
   404 页面样式
   ========================================================================== */
.error-page {
    padding: 80px 20px;
    text-align: center;
    width: 100%;
}

.error-title {
    font-size: 6rem;
    font-weight: 800;
    color: var(--border-color);
    margin: 0;
    line-height: 1;
    letter-spacing: -2px;
}

.error-msg {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin: 25px 0 35px 0;
    font-style: italic;
    line-height: 1.6;
}

.back-home-btn {
    display: inline-block;
    padding: 10px 30px;
    border: 1px solid var(--primary-color);
    color: var(--primary-color) !important;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 500;
    background: transparent;
    transition: all 0.3s ease;
    text-decoration: none;
}

.back-home-btn:hover {
    background-color: var(--primary-color);
    color: #ffffff !important;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(66, 82, 68, 0.2);
}

/* SVG 图标适配 */
.icon-svg {
    display: inline-block;
    vertical-align: middle;
    color: var(--text-body);
    transition: color 0.2s ease, transform 0.2s ease;
}

.mobile-nav-toggle:hover .icon-svg,
.mobile-search-toggle:hover .icon-svg {
    color: var(--primary-color);
}

.mobile-nav-toggle:active .icon-svg,
.mobile-search-toggle:active .icon-svg {
    transform: scale(0.9);
}

/* 响应式断点控制 */
@media screen and (max-width: 768px) {
    body {
        padding-top: 55px;
    }
    .main-container {
        display: block;
        padding: 20px 15px;
    }
    .sidebar-col {
        display: none;
    }
    .content-col {
        display: block;
        width: 100%;
    }
    .archive-container {
        padding-left: 0;
    }
    .mobile-header {
        display: block;
    }
    .archive-item {
        font-size: 0.95rem;
    }
    .error-page {
        padding: 50px 10px;
    }
    .error-title {
        font-size: 4.5rem;
    }
    .error-msg {
        font-size: 1rem;
    }
}
