/*
Theme Name: LiteBlog
Theme URI: https://example.com/
Author: 专业开发
Author URI: https://example.com/
Description: 轻量化摄影图文博客主题，纯CSS实现，响应式布局，明暗模式，AJAX评论
Version: 1.0
Tested up to: 6.9
Requires PHP: 8.3
License: GNU General Public License
Text Domain: liteblog
*/

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --card-bg: #f8f9fa;
    --border-color: #eee;
    --primary-color: #2d3748;
    --hover-color: #4a5568;
    --link-color: #2d3748;
    --link-hover: #4a5568;
}

/* 暗色模式 */
[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --card-bg: #1e1e1e;
    --border-color: #333;
    --primary-color: #ffffff;
    --hover-color: #cccccc;
    --link-color: #90caf9;
    --link-hover: #64b5f6;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    transition: all 0.3s ease;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 顶部头部 - 无固定、无悬浮 */
.site-header {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-color);
    position: static;
}

.site-branding {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.site-title {
    font-size: 24px;
    font-weight: 700;
}

.site-title a {
    color: var(--primary-color);
    text-decoration: none;
}

.site-description {
    font-size: 14px;
    opacity: 0.8;
}

/* 搜索框 - 强制显示 */
.search-form {
    display: flex !important;
    gap: 5px;
    align-items: center;
}

.search-form input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--card-bg);
    color: var(--text-color);
    min-width: 180px;
}

.search-form button {
    padding: 8px 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* 导航菜单 */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 25px;
    margin: 15px 0;
}

.nav-menu li a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
}

.nav-menu li a:hover {
    color: var(--hover-color);
}

/* 文章网格 */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.post-card {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
}

.post-thumbnail img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    loading: lazy;
}

.post-content {
    padding: 15px;
}

.post-title {
    font-size: 18px;
    margin-bottom: 10px;
}

.post-title a {
    color: var(--link-color);
    text-decoration: none;
}
.post-title a:hover {
    color: var(--link-hover);
}

.post-meta {
    font-size: 13px;
    opacity: 0.8;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 30px 0;
}

.pagination a {
    padding: 8px 15px;
    background: var(--card-bg);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 4px;
}

/* 工具按钮 */
.fixed-tools {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 98;
}

.theme-toggle, .back-to-top {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
}

/* 文章内容 */
.single-post {
    max-width: 800px;
    margin: 40px auto;
}

.single-post h2 {
    font-size: 32px;
    margin-bottom: 20px;
}

.single-post h3 {
    font-size: 24px;
    margin: 30px 0 15px;
    padding-left: 10px;
    border-left: 4px solid var(--primary-color);
}

.single-post p {
    margin-bottom: 15px;
    font-size: 16px;
}

/* 文章图片限制 */
.single-post img,
.single-post figure,
.single-post .wp-caption {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 6px;
}

/* TOC */
.toc-container {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 220px;
    background: var(--card-bg);
    padding: 15px;
    border-radius: 6px;
    max-height: 70vh;
    overflow-y: auto;
}

.toc-title {
    font-weight: 600;
    margin-bottom: 10px;
}

.toc-list {
    list-style: none;
}

.toc-list li {
    margin-bottom: 8px;
}

.toc-list a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
}

/* 文章内部分页 */
.page-links {
    margin: 30px 0;
    text-align: center;
}
.page-links a,
.page-links span {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 4px;
    background: var(--card-bg);
    border-radius: 4px;
    color: var(--link-color);
    text-decoration: none;
}

/* 文章TAG */
.post-tags {
    margin: 20px 0;
}
.post-tags strong {
    margin-right: 10px;
}
.post-tags a {
    display: inline-block;
    background: var(--card-bg);
    padding: 4px 10px;
    border-radius: 4px;
    margin-right: 6px;
    color: var(--link-color);
    text-decoration: none;
}

/* 版权 */
.post-copyright {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
}

/* 作者信息 - 缩小头像 + 正常显示名称+简介 */
.author-box {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 40px 0;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 8px;
}
.author-box img {
    width: 60px !important;
    height: 60px !important;
    border-radius: 50%;
    object-fit: cover;
}
.author-box h4 {
    margin: 0 0 5px;
    font-size: 18px;
}
.author-box p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

/* 相关文章 */
.related-posts {
    margin: 40px 0;
}

/* ==============================
   评论层级缩进 - 终极修复
=============================== */
.comments-area {
    max-width: 800px;
    margin: 50px auto;
}
.comment-list {
    list-style: none;
}
.comment {
    display: flex;
    gap: 12px;
    padding: 15px;
    background: var(--card-bg);
    border-radius: 6px;
    margin-bottom: 12px;
}
.comment-avatar img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
}
.comment-author {
    font-weight: 600;
    margin-bottom: 4px;
}

/* 层级缩进核心 */
.comment-list li {
    clear: both;
}
.comment-list .children {
    list-style: none;
    margin-left: 60px !important;
    padding-left: 0;
}
.comment-list .children .comment {
    background: color-mix(in srgb, var(--card-bg), #000 5%);
    border-left: 3px solid var(--primary-color);
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-color);
}

/* 评论分页 - 与首页/分类页分页样式完全统一 */
.comment-pagination {
    margin: 20px 0 !important;
    text-align: center !important;
}
.comment-pagination a,
.comment-pagination span {
    display: inline-block !important;
    padding: 8px 15px !important;
    margin: 0 4px !important;
    background: var(--card-bg) !important;
    color: var(--text-color) !important;
    text-decoration: none !important;
    border-radius: 4px !important;
}
.comment-pagination .current {
    background: var(--primary-color) !important;
    color: var(--bg-color) !important;
}

/* 纯CSS评论层级缩进 —— 父评论正常，子评论向右缩进 */
.comment.comment-child {
    margin-left: 60px !important;
}
.comment.comment-child .comment-avatar img {
    width: 40px;
    height: 40px;
}

/* 归档 */
.archive-year{margin:20px 0}
.year-toggle,.month-toggle{cursor:pointer;background:var(--card-bg);padding:10px;margin:5px 0;border-radius:4px}
.year-content,.month-posts{display:none;padding-left:20px}

@media (max-width: 768px) {
    .posts-grid {grid-template-columns: 1fr;}
    .toc-container {display: none;}
    .site-branding {flex-direction: column; gap:15px;}
    .search-form {width:100%; justify-content: center;}
}