/*!
 * Theme Name: JianZi
 * Theme URI: https://github.com/yourname/jianzi
 * Description: 现代极简 Typecho 主题，无框架，卡片网格，深色模式，纯 CSS 实现。
 * Version: 1.1.0
 * Author: ESTO
 * Author URI: https://es4t.oevon.com
 */

/* ---------- 全局变量 ---------- */
:root {
    --bg-body: #F5F5F7;
    --text-color: #1D1D1F;
    --text-secondary: #6E6E73;
    --card-bg: #FFFFFF;
    --card-shadow: 0 8px 20px rgba(0, 0, 0, 0.02), 0 2px 6px rgba(0, 0, 0, 0.05);
    --border-radius: 20px;
    --accent: #3375E5;
    --header-bg: rgba(245, 245, 247, 0.7);
    --border-light: rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-body: #121212;
        --text-color: #ECECEC;
        --text-secondary: #98989D;
        --card-bg: #1E1E1E;
        --card-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
        --header-bg: rgba(18, 18, 18, 0.8);
        --border-light: rgba(255, 255, 255, 0.1);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-color);
    line-height: 1.5;
    font-weight: 450;
    transition: background-color 0.2s, color 0.2s;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    opacity: 0.7;
}

/* ---------- 容器 ---------- */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ---------- 自定义栅格系统 ---------- */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem;
}

[class*="col-"] {
    padding: 0 0.75rem;
}

.col-12 { width: 100%; }
.col-6 { width: 50%; }
.col-4 { width: 33.333%; }
.col-3 { width: 25%; }

@media (max-width: 992px) {
    .col-md-6 { width: 50%; }
    .col-md-12 { width: 100%; }
}
@media (max-width: 768px) {
    .col-sm-12 { width: 100%; }
    .col-sm-6 { width: 50%; }
}

/* ---------- 卡片网格 (纯 Grid) ---------- */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

/* ---------- 头部 ---------- */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
    padding: 0.8rem 0;
    transition: all 0.2s;
}

.header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo img {
    height: 40px;
    width: auto;
    vertical-align: middle;
}

.nav-menu {
    display: flex;
    gap: 1.8rem;
    align-items: center;
}

.nav-menu a {
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 500;
}

.search-button {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.search-icon {
    width: 18px;
    height: 18px;
    fill: var(--text-color);
}

.site-search {
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

header.expanded .site-search {
    max-height: 100px;
    margin-top: 1rem;
}

.search-wrapper {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    padding: 0.5rem 0;
}

.search-icon2 {
    width: 18px;
    height: 18px;
    fill: var(--text-color);
    margin-right: 0.8rem;
}

.search-input {
    background: transparent;
    border: none;
    outline: none;
    font-size: 1.1rem;
    width: 100%;
    color: var(--text-color);
    font-weight: 500;
}

/* 主体偏移 */
.main {
    margin-top: 90px;
    min-height: 70vh;
}

/* ---------- Hero ---------- */
.hero {
    text-align: center;
    padding: 3rem 1rem 2rem;
}

.hero h1 {
    font-size: 3.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.hero .lead {
    font-size: 1.2rem;
    opacity: 0.7;
}

/* 通知栏 */
.notice-bar {
    background-color: var(--card-bg);
    border-left: 4px solid var(--accent);
    padding: 1rem 1.8rem;
    border-radius: var(--border-radius);
    margin: 2rem 0;
    box-shadow: var(--card-shadow);
    font-weight: 500;
}

/* 特性卡片网格 */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.feature-card {
    background: var(--card-bg);
    padding: 2rem 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s;
    cursor: pointer;   
}

.feature-card:hover {
    transform: translateY(-4px);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

/* 下载区域 */
.download-area {
    text-align: center;
    margin: 3rem 0;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
}

.btn {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 0.7rem 1.8rem;
    border-radius: 40px;
    font-weight: 600;
    margin: 0.5rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

/* 文章卡片 */
.post-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--card-shadow);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 30px -12px rgba(0, 0, 0, 0.2);
}

.post-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-card .card-body {
    padding: 1.5rem;
    flex: 1;
}

.post-card h5 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* 分页 */
.page-navigator {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin: 3rem 0;
}

.page-navigator li {
    background: var(--card-bg);
    padding: 0.4rem 1rem;
    border-radius: 30px;
    font-weight: 500;
}

.page-navigator a {
    color: var(--text-color);
}

.page-navigator .current {
    background: var(--accent);
    color: white;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 2.5rem 0;
    font-size: 0.8rem;
    border-top: 1px solid var(--border-light);
    margin-top: 4rem;
}

/* 评论悬浮按钮 */
.comments-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--card-bg);
    padding: 10px 20px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    z-index: 99;
    font-weight: bold;
    backdrop-filter: blur(8px);
}

/* 评论侧滑面板 */
.info-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 480px;
    height: 100%;
    background: var(--bg-body);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    padding: 2rem;
}

.info-panel.active {
    transform: translateX(0);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 999;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 评论表单样式 */
.comment-create-card input,
.comment-create-card textarea {
    width: 100%;
    padding: 0.8rem;
    margin: 0.5rem 0;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text-color);
}

.comment-create-card button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    cursor: pointer;
}

.comment-card {
    margin: 1rem 0;
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
}

/* 单篇文章样式 */
.post-content {
    max-width: 780px;
    margin: 0 auto;
}
.post-content p, .post-content img {
    margin: 1.5rem 0;
}
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

/* 响应式 */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.2rem; }
    .nav-menu { gap: 1rem; }
    .info-panel { width: 100%; }
    .container { padding: 0 1rem; }
}
/* ---------- 评论侧滑面板美化 ---------- */
.info-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 480px;
    height: 100%;
    background: var(--bg-body);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    padding: 2rem;
}

.info-panel.active {
    transform: translateX(0);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 999;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 评论按钮 */
.comments-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--card-bg);
    padding: 10px 20px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    z-index: 99;
    font-weight: bold;
    backdrop-filter: blur(8px);
}

/* 评论列表样式（覆盖默认主题样式，使之符合卡片风格） */
.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment-list .comment {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    box-shadow: var(--card-shadow);
}

.comment-list .comment-body {
    margin-bottom: 0.5rem;
}

.comment-list .comment-author {
    font-weight: bold;
    margin-bottom: 0.2rem;
}

.comment-list .comment-meta {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-bottom: 0.8rem;
}

.comment-list .comment-content p {
    margin: 0.5rem 0;
}

.comment-list .reply {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.comment-list .children {
    list-style: none;
    padding-left: 1.5rem;
    margin-top: 1rem;
}

/* 表单美化 */
.respond {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.respond input, 
.respond textarea {
    width: 100%;
    padding: 0.7rem;
    margin: 0.5rem 0;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text-color);
}

.respond button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
}

.cancel-comment-reply {
    text-align: right;
    margin-bottom: 1rem;
}

.panel-title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

/* 分页样式 */
.page-navigator {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.page-navigator li {
    background: var(--card-bg);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
}

/* 响应式 */
@media (max-width: 768px) {
    .info-panel {
        width: 100%;
        padding: 1rem;
    }
}
/* ---------- 文章上下篇导航 ---------- */
.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
    gap: 1.5rem;
}

.post-navigation .nav-prev,
.post-navigation .nav-next {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-navigation .nav-prev:hover,
.post-navigation .nav-next:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.post-navigation .nav-prev {
    text-align: left;
}

.post-navigation .nav-next {
    text-align: right;
}

.post-navigation .nav-label {
    display: block;
    font-size: 0.8rem;
    opacity: 0.6;
    margin-bottom: 0.3rem;
    color: var(--text-color);
}

.post-navigation .nav-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap; /* 标题过长自动省略号 */
}

.post-navigation a {
    text-decoration: none;
    color: inherit; /* 继承当前主题颜色 */
}

.post-navigation .nav-empty {
    opacity: 0.4;
    font-style: italic;
    color: var(--text-secondary);
}

/* 移动端适配：屏幕较窄时变上下排列 */
@media (max-width: 768px) {
    .post-navigation {
        flex-wrap: wrap;
        gap: 1rem;
    }
    .post-navigation .nav-prev,
    .post-navigation .nav-next {
        width: 100%;
        margin: 0; /* 消除默认边距 */
    }
    .post-navigation .nav-next {
        text-align: left;
    }
}