/* blog.css — 博客列表 + 文章内容页共用样式，基于 root.css 变量 */

/* 头部 */
.blog-main-title {
    font-size: 2.2rem;
    font-weight: 500;
    letter-spacing: 2px;
    color: var(--gj-jade);
}
.lead-subtitle {
    font-size: 1rem;
    opacity: 0.8;
    font-style: italic;
}
.divider-grace {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gj-gold), transparent);
}

/* 文章卡片列表 */
.blog-card {
    background-color: var(--gj-paper);
    border: 1px solid var(--gj-card-border);
    border-radius: 28px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 6px 14px var(--gj-shadow);
}
.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 28px var(--gj-shadow);
}
.blog-card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    /* padding-bottom: 0.5rem; */
}
.blog-card-title a {
    color: var(--gj-ink);
    text-decoration: none;
    transition: color 0.2s;
}
.blog-card-title a:hover {
    color: var(--gj-gold);
}
.blog-card-meta {
    font-size: 0.8rem;
    color: var(--gj-gold-light);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.blog-card-summary {
    color: var(--gj-ink);
    line-height: 1.5;
    opacity: 0.85;
}
.blog-card-footer {
    margin-top: 1rem;
    text-align: right;
}
.btn-read {
    background: transparent;
    border: 1px solid var(--gj-gold);
    border-radius: 40px;
    padding: 0.25rem 1.2rem;
    font-size: 0.8rem;
    color: var(--gj-gold);
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}
.btn-read:hover {
    background: var(--gj-gold);
    color: #1f1b16;
    text-decoration: none;
}

/* 列表页卡片副标题 — 与日期颜色区分 */
.blog-card-subtitle {
    font-size: 0.95rem;
    color: var(--gj-ink);  
    opacity: 0.75;        
    margin: 0.1rem 0 0.3rem 0;
    font-weight: 400;
    letter-spacing: 0.3px;
    padding-left: 0.2rem;
    padding-bottom: 0.5rem;
    font-style: italic;        
}
/* 副标题两侧装饰线（可选） */
.blog-card-subtitle::before,
.blog-card-subtitle::after {
    content: " —— ";
    color: var(--gj-ink);
    opacity: 0.5;
}
/* .blog-card-subtitle {
    font-size: 0.95rem;
    color: var(--gj-jade);  
    margin: 0.1rem 0 0.3rem 0;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding-left: 0.2rem;
} */



/* 文章内容页样式 */
.article-header {
    text-align: center;
    margin-bottom: 2rem;
}
.article-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--gj-jade);
    margin-bottom: 0.0rem;
    padding-bottom: 0.1rem;
}
.article-date {
    color: var(--gj-gold-light);
    font-size: 0.85rem;
}
.article-body {
    background: var(--gj-paper);
    border-radius: 32px;
    padding: 2rem;
    border: 1px solid var(--gj-card-border);
    line-height: 1.7;
    font-size: 1rem;
    color: var(--gj-ink);
}
.article-body h2,
.article-body h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 500;
}
.article-body p {
    margin-bottom: 1.2em;
}
.article-body img {
    max-width: 100%;
    border-radius: 20px;
    margin: 1rem 0;
}
.article-body blockquote {
    border-left: 4px solid var(--gj-gold);
    background: var(--gj-stone);
    padding: 0.8rem 1.5rem;
    border-radius: 20px;
    font-size:larger;
    font-style: italic;
    font-family: 'Segoe UI', 'Roboto', 'Noto Serif SC', '思源宋体', 'Georgia', 'Times New Roman', serif; 
    margin: 1rem 0;
}


pre code {
    display: block;
    background: var(--gj-stone);
    padding: 1rem;
    border-radius: 16px;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre;
    tab-size: 4;
}


.multi-column-2 {
    column-count: 2;          /* 分为2栏 */
    column-gap: 2rem;        /* 栏间距 */
    column-rule: 1px solid var(--gj-card-border); /* 分隔线 */
    text-align: justify;    
    /* white-space: pre-wrap;  */
    white-space: pre; 
    font-family: inherit;
}

@media (max-width: 768px) {
    .multi-column-2 {
        column-count: 1;
        column-rule: none;
    }
}

/* 提要摘要样式 */
.article-excerpt {
    background: var(--gj-stone);
    border-left: 4px solid var(--gj-gold);
    border-radius: 20px;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    color: var(--gj-ink);
    font-family: 'Segoe UI', 'Roboto', 'Noto Serif SC', '思源宋体', 'Georgia', 'Times New Roman', serif; 
    font-size:larger;
    /* font-style: italic; */

}
.excerpt-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gj-gold);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.article-excerpt p {
    margin: 0;
    line-height: 1.5;
}

/* 表格样式优化 */
.article-body .table {
    margin-bottom: 0;
}
.article-body .table td,
.article-body .table th {
    padding: 1rem 1.2rem;
    border-top: none;
    border-bottom: 1px solid var(--gj-card-border);
    vertical-align: middle;
    color: var(--gj-ink);
    background-color: transparent;
}


/* 文章子标题 — 古籍风格 */
.article-body h2 {
    font-size: 1.6rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid var(--gj-gold-light);
    color: var(--gj-jade);
    letter-spacing: 1px;
    font-family: 'Noto Serif SC', 'Georgia', serif;
}

.article-body h3 {
    font-size: 1.25rem;
    font-weight: 500;
    margin: 1.5rem 0 0.75rem 0;
    color: var(--gj-ink);
    padding-left: 0.8rem;
    border-left: 4px solid var(--gj-gold);
    font-family: 'Noto Serif SC', 'Georgia', serif;
}

/* 可选的 h4（小标题） */
.article-body h4 {
    font-size: 1.05rem;
    font-weight: 500;
    margin: 1rem 0 0.5rem 0;
    color: var(--gj-ink);
    font-weight: bold;
    /* font-style: italic; */
}

/* 文章内醒目跳转链接 —— 仿古籍“朱笔圈点” */
.article-body .featured-link {
    display: inline-block;
    background-color: var(--gj-paper);
    padding: 0.4rem 1.4rem 0.4rem 1rem;
    border-radius: 40px;
    border: 1.5px solid var(--gj-gold);
    color: var(--gj-gold);
    font-weight: 500;
    font-size: 1.05rem;
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px var(--gj-shadow);
    backdrop-filter: blur(2px);
    margin: 0.2rem 0;
}

/* 图标与文字间距 */
.article-body .featured-link i {
    margin-right: 0.6rem;
    font-size: 0.9rem;
}

/* 如果想让它在段落中更突出，可以加一个左侧“引用竖线”背景装饰（可选） */
/* .article-body .featured-link::before {
    content: "|";
    color: var(--gj-gold-light);
    font-weight: 300;
    margin-right: 0.6rem;
} */


/* 文章内图片容器 */
.article-figure {
    margin: 2rem 0;
    text-align: center;
    background: var(--gj-paper);
    border-radius: 28px;
    padding: 1rem 1rem 0.5rem 1rem;
    border: 1px solid var(--gj-card-border);
    box-shadow: 0 6px 14px var(--gj-shadow);
    transition: transform 0.2s;
}
.article-figure:hover {
    transform: scale(1.01);
}
.article-figure img {
    max-width: 100%;
    height: auto;
    border-radius: 20px;
    background: var(--gj-paper);
}
.article-figure figcaption {
    margin-top: 0.6rem;
    font-size: 0.85rem;
    color: var(--gj-gold-light);
    font-style: italic;
    letter-spacing: 0.5px;
}

.article-figure img {
    background-color: var(--gj-stone); /* 让透明图片有底色 */
}


/* 文章内图片尺寸变体 —— 基于百分比，且自动居中/浮动 */
.article-figure.size-sm {
    max-width: 40%;
}
.article-figure.size-md {
    max-width: 65%;
}
.article-figure.size-lg {
    max-width: 85%;
}
.article-figure.size-sm,
.article-figure.size-md,
.article-figure.size-lg {
    margin-left: auto;
    margin-right: auto;
}

/* 如果需要图文混排（左/右浮动） */
.article-figure.float-left {
    float: left;
    margin-right: 1.5rem;
    margin-bottom: 0.5rem;
}
.article-figure.float-right {
    float: right;
    margin-left: 1.5rem;
    margin-bottom: 0.5rem;
}


/* 简约链接卡片样式 */
.link-card {
    display: block;
    text-decoration: none;
    margin: 1rem 0;
    padding: 0.8rem 1.2rem;
    background-color: var(--gj-paper);
    border: 1px solid var(--gj-card-border);
    border-radius: 16px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px var(--gj-shadow);
}

/* 悬停效果：轻微上浮并加深阴影 */
.link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--gj-shadow);
    border-color: var(--gj-gold);
}

.link-card-content {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.link-card-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    width: 2rem;
    text-align: center;
}

.link-card-text {
    flex: 1;
    min-width: 0; /* 防止文字溢出 */
}

.link-card-title {
    display: block;
    font-weight: 500;
    color: var(--gj-ink);
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 0.1rem;
}

.link-card-url {
    display: block;
    font-size: 0.75rem;
    color: var(--gj-gold-light);
    word-break: break-all;
}

.link-card-arrow {
    font-size: 1.2rem;
    color: var(--gj-gold-light);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

/* 悬停时箭头右移，增加互动感 */
.link-card:hover .link-card-arrow {
    transform: translateX(3px);
    color: var(--gj-gold);
}




/* ========== 左侧导航栏样式 ========== */
.sidebar-col {
    background-color: var(--gj-paper);
    border-right: 1px solid var(--gj-card-border);
    position: sticky;
    top: 0;
    height: calc(100vh - 70px);
    overflow-y: auto;
    padding: 1.2rem 0.8rem;
}
.blog-sidebar {
    height: 100%;
}

.sidebar-header h5 {
    color: var(--gj-jade);
}

.archive-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.nav-year-group {
    margin-bottom: 0.8rem;
}
.year-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: transparent;
    border: none;
    padding: 0.5rem 0.7rem;
    font-weight: 600;
    color: var(--gj-ink);
    border-radius: 28px;
    transition: background 0.2s;
}
.year-header:hover {
    background-color: var(--gj-glow);
}
.year-header .chevron {
    transition: transform 0.2s;
}
.year-header.collapsed .chevron {
    transform: rotate(-90deg);
}
.month-list {
    padding-left: 1.2rem;
    margin-top: 0.25rem;
}
.month-group {
    margin: 0.5rem 0;
}
.month-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gj-gold);
    padding: 0.2rem 0;
    letter-spacing: 1px;
}
.article-list {
    list-style: none;
    padding-left: 1rem;
    margin: 0;
}
.article-list li {
    margin: 0.2rem 0;
}
.article-link {
    display: block;
    padding: 0.3rem 0.8rem;
    font-size: 0.85rem;
    color: var(--gj-ink);
    text-decoration: none;
    border-radius: 20px;
    transition: all 0.2s;
}
.article-link:hover {
    background-color: var(--gj-stone);
    color: var(--gj-jade);
    transform: translateX(3px);
}

/* ========== 右侧内容区 ========== */
.content-col {
    padding: 1.5rem 2rem;
}
.blog-content {
    /* max-width: 960px; */
    width: 90%;
    margin: 0 auto;
}

/* 响应式：移动端自动折叠侧边栏（需配合 toggle 按钮，可参照 update 页面实现） */
@media (max-width: 767px) {
    .sidebar-col {
        position: fixed;
        left: -85%;
        top: 0;
        width: 80%;
        max-width: 280px;
        height: 100%;
        z-index: 1050;
        transition: left 0.3s ease;
        background-color: var(--gj-paper);
        box-shadow: 2px 0 12px var(--gj-shadow);
    }
    .sidebar-col.mobile-open {
        left: 0;
    }
    .content-col {
        width: 100%;
        padding: 1rem;
    }
    /* 移动端开关按钮（需在模板中添加） */
    .mobile-nav-toggle {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin-bottom: 1rem;
        background: var(--gj-paper);
        border: 1px solid var(--gj-card-border);
        border-radius: 40px;
        padding: 0.4rem 1rem;
    }
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        backdrop-filter: blur(2px);
        z-index: 1040;
        display: none;
    }
    .sidebar-overlay.show {
        display: block;
    }
}
@media (min-width: 768px) {
    .mobile-nav-toggle,
    .sidebar-overlay {
        display: none !important;
    }
}



/* 文章段落内的行内链接 */
.article-body .inline-link {
    color: var(--gj-gold);           /* 金色，像朱批 */
    text-decoration: none;           /* 去掉默认下划线 */
    border-bottom: 1px dotted var(--gj-gold-light); /* 优雅的虚线底边 */
    padding-bottom: 0.05rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

/* 悬停时变为实线，颜色加深，增加互动感 */
.article-body .inline-link:hover {
    color: var(--gj-jade);
    border-bottom-color: var(--gj-jade);
    border-bottom-style: solid;
}


/* 文章作者样式 */
.article-author {
    font-size: 0.95rem;
    color: var(--gj-gold);
    margin: 0.2rem 0 0.8rem 0;
    letter-spacing: 0.5px;
    font-weight: bold;
}
.article-author i {
    margin-right: 0.3rem;
}



/* ===== 视频容器 ===== */
.video-figure {
    margin: 2rem auto;
    background: var(--gj-paper);
    border-radius: 28px;
    padding: 0.5rem 0.5rem 0.3rem 0.5rem;
    border: 1px solid var(--gj-card-border);
    box-shadow: 0 6px 14px var(--gj-shadow);
    transition: transform 0.2s;
    max-width: 100%;
}
.video-figure:hover {
    transform: scale(1.005);
}

/* 视频父容器：保持 16:9 比例，并居中 */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 20px;
    background: #000; /* 深色背景，适应明暗模式 */
}
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
}

/* 视频标题（说明文字） */
.video-figure figcaption {
    text-align: center;
    font-size: 0.9rem;
    color: var(--gj-gold-light);
    padding: 0.6rem 0.2rem 0.2rem 0.2rem;
    font-style: italic;
    letter-spacing: 0.5px;
}

/* 明暗模式下视频背景一致 */
[data-bs-theme="dark"] .video-container {
    background: #1a1a1a;
}
[data-bs-theme="dark"] .video-figure {
    background: var(--gj-paper);
}


/* 文章副标题 */
.article-subtitle {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--gj-jade);
    margin: -0.2rem 0 0.6rem 0;
    letter-spacing: 1px;
    font-style: italic;
    /* font-weight: bold; */
    /* 可添加修饰线 */
    position: relative;
    display: inline-block;
    padding: 0rem 1rem 1rem;
}
/* 副标题两侧装饰线（可选） */
.article-subtitle::before,
.article-subtitle::after {
    content: " — ";
    color: var(--gj-gold-light);
    opacity: 0.5;
}