/* ==========================================================================
   0. 本地字体声明 (Local Webfonts)
   ========================================================================== */
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/plus-jakarta-sans-v12-latin-regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/plus-jakarta-sans-v12-latin-600.woff2') format('woff2');
}

@font-face {
    font-family: 'Lora';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/lora-v37-latin-regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Lora';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/lora-v37-latin-600.woff2') format('woff2');
}

/* ==========================================================================
   1. 全局基础样式 (Global Base)
   ========================================================================== */
body,
button,
input,
select,
textarea {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: #fcf9f2;
    color: #3b3a36;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

main {
    flex: 1;
}

/* 衬线体统一应用于标题与 .serif 类，排除 .heading 以保证小号眉标清晰 */
.serif,
.title,
.subtitle {
    font-family: 'Lora', serif !important;
    color: #2c3e3a;
}

.heading,
.section-eyebrow {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8d7365;
}

/* 顶部导航栏透明化，去除阴影 */
.navbar.is-fixed-top {
    background-color: #fcf9f2 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: none !important;
}
/* 顶部导航栏与当前位置高亮 */
.tang-navbar {
    background-color: #fcf9f2 !important;
    border-bottom: 1px solid rgba(141, 115, 101, 0.14);
    box-shadow: none !important;
}

.navbar-logo-img {
    max-height: 40px;
    filter: contrast(1.1) sepia(10%);
    margin-right: 12px;
}

.navbar-tagline {
    color: #a38d59;
    letter-spacing: 1px;
    margin-top: 2px;
}

.tang-navbar .navbar-menu .navbar-item {
    color: #3b3a36;
    background-color: transparent !important;
    transition: color 0.25s ease;
}

.tang-navbar .navbar-menu .navbar-item:hover {
    color: #8d7365;
    background-color: transparent !important;
}

.tang-navbar .navbar-menu .navbar-item.is-active {
    color: #8d7365 !important;
    font-weight: 600;
    background-color: transparent !important;
}

/* 激活项文本前置暗金菱形提示符 */
.tang-navbar .navbar-menu .navbar-item.is-active::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    background-color: #a38d59;
    transform: rotate(45deg);
    margin-right: 9px;
    vertical-align: middle;
    flex-shrink: 0;
}

/* 移动端展开菜单适配 */
@media screen and (max-width: 1023px) {
    .tang-navbar .navbar-menu {
        background-color: #fcf9f2;
        box-shadow: 0 8px 16px rgba(109, 76, 65, 0.06);
    }
}
/* ==========================================================================
   2. 全局链接与面包屑样式 (Global Links & Breadcrumbs)
   ========================================================================== */
a {
    color: #8d7365;
    transition: color 0.3s ease, border-color 0.3s ease;
}

a:hover {
    color: #6d4c41;
}

/* 覆盖 Bulma 默认的蓝色面包屑链接，融入古典主题 */
.tang-breadcrumb a {
    color: #8d7365 !important;
    transition: color 0.3s ease;
}

.tang-breadcrumb a:hover {
    color: #6d4c41 !important;
}

.tang-breadcrumb li.is-active a {
    color: #555555 !important;
    font-weight: 600;
    pointer-events: none;
}

/* 柔化分隔符 (>) 的颜色 */
.tang-breadcrumb ul li + li::before {
    color: #c5b8a5 !important;
}

/* 针对 Markdown 正文区 (.content) 的超链接优化 */
.content a {
    color: #8d7365;
    text-decoration: none;
    border-bottom: 1px solid rgba(141, 115, 101, 0.3);
}

.content a:hover {
    color: #6d4c41;
    border-bottom-color: #6d4c41;
}

/* ==========================================================================
   3. 杂志排版专用类 (Magazine Typography & Layout)
   ========================================================================== */
.text-gold-muted { color: #857521; }
.border-gold-muted { border-color: #e0d5c1 !important; }

/* 首字母下沉优化（同时兼容手动 .drop-cap 类与长文容器首段） */
.drop-cap::first-letter,
.editorial-prose > p:first-of-type::first-letter {
    font-family: 'Lora', serif;
    font-size: 4.2rem;
    font-weight: 400;
    float: left;
    margin-right: 0.85rem;
    margin-top: 0.1rem;
    line-height: 0.82;
    color: #a38d59;
}

.editorial-prose p {
    line-height: 1.85;
    color: #3b3a36;
    margin-bottom: 1.35rem;
}

/* 画报图片悬浮微动效 */
.editorial-img {
    transition: filter 0.3s ease, transform 0.3s ease;
}

.editorial-img:hover {
    filter: brightness(1.05);
    transform: translateY(-2px);
}

/* ==========================================================================
   4. Imperial Brain 专属卡片样式
   ========================================================================== */
.brain-card {
    position: relative;
    background-color: rgba(255, 255, 255, 0.42);
    border: 1px solid rgba(141, 115, 101, 0.2);
    border-top: 3px solid #8d7365;
    border-radius: 10px;
    padding: 2.25rem 2rem;
    height: 100%;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.brain-card:hover {
    background-color: rgba(255, 255, 255, 0.72);
    border-color: rgba(141, 115, 101, 0.38);
    box-shadow: 0 8px 24px rgba(109, 76, 65, 0.05);
    transform: translateY(-2px);
}

.brain-card-num {
    position: absolute;
    top: -4px;
    right: 18px;
    font-family: 'Lora', serif;
    font-size: 4.8rem;
    font-weight: 600;
    color: rgba(141, 115, 101, 0.12);
    z-index: 0;
    line-height: 1;
    pointer-events: none;
}

.brain-card-content {
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   5. 时间轴与分类标签样式 (Timeline & Tags)
   ========================================================================== */
.tang-timeline {
    position: relative;
    max-width: 860px;
    margin: 0 auto;
    padding-left: 2rem;
}

.tang-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 8px;
    width: 2px;
    background-color: rgba(141, 115, 101, 0.25);
}

.timeline-item {
    position: relative;
    margin-bottom: 3.5rem;
    padding-left: 2.5rem;
}

.timeline-marker {
    position: absolute;
    top: 8px;
    left: -20px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: #fcf9f2;
    border: 3px solid #8d7365;
    transition: all 0.3s ease;
    z-index: 1;
}

.timeline-item:hover .timeline-marker {
    background-color: #8d7365;
    transform: scale(1.2);
    box-shadow: 0 0 12px rgba(141, 115, 101, 0.3);
}

.timeline-box {
    background-color: transparent;
    border: 1px solid rgba(141, 115, 101, 0.15);
    border-radius: 12px;
    box-shadow: none;
    transition: all 0.3s ease;
}

.timeline-box:hover {
    background-color: rgba(255, 255, 255, 0.4);
    border-color: rgba(141, 115, 101, 0.35);
    transform: translateY(-2px);
}

/* 专属古典色调标签 */
.tag-political { background-color: rgba(163, 141, 89, 0.15); color: #85703f !important; border: 1px solid rgba(163, 141, 89, 0.2); }
.tag-military  { background-color: rgba(158, 87, 77, 0.1);  color: #8a4841 !important; border: 1px solid rgba(158, 87, 77, 0.15); }
.tag-culture   { background-color: rgba(105, 133, 146, 0.1); color: #4e6a78 !important; border: 1px solid rgba(105, 133, 146, 0.15); }
.tag-economy   { background-color: rgba(109, 137, 109, 0.1); color: #4a634a !important; border: 1px solid rgba(109, 137, 109, 0.15); }

/* ==========================================================================
   6. Wiki 图文环绕、通用透明卡片与分页器 (Wiki & Shared Cards)
   ========================================================================== */
@media screen and (min-width: 769px) {
    .wiki-float-img {
        float: right;
        width: 45%;
        margin-left: 2.5rem;
        margin-bottom: 1.5rem;
    }
}

@media screen and (max-width: 768px) {
    .wiki-float-img {
        width: 100%;
        margin-bottom: 1.5rem;
    }
}

/* 统一全站透明列表卡片 (.tang-card 与 .wiki-list-card 共享样式) */
.tang-card,
.wiki-list-card {
    background-color: transparent;
    border: 1px solid rgba(141, 115, 101, 0.2);
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tang-card:hover,
.wiki-list-card:hover {
    background-color: rgba(255, 255, 255, 0.5);
    border-color: rgba(141, 115, 101, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    transform: translateY(-2px);
}

.card-title-link {
    border-bottom: none !important;
}

.card-excerpt {
    line-height: 1.65;
}

.card-meta-tag {
    letter-spacing: 0.08em;
    font-weight: 600;
    color: #8d7365;
}

.card-read-more {
    color: #a38d59;
    border-bottom: none !important;
}

.tang-card:hover .card-read-more {
    color: #6d4c41;
}

/* 翻页器当前页的专属古典色 */
.pagination-link.is-current {
    background-color: #8d7365 !important;
    border-color: #8d7365 !important;
}

/* ==========================================================================
   7. 丝绸之路专题栏目样式 (Silk Road Topic Hub)
   ========================================================================== */
.silk-hero {
    border-bottom: 1px dashed rgba(141, 115, 101, 0.25);
}

.silk-hero-lead {
    max-width: 760px;
    line-height: 1.65;
    color: #555555 !important;
}

.section-heading-rule {
    border-bottom: 1px solid rgba(141, 115, 101, 0.18);
}

/* 右侧关键枢纽边栏 */
.hub-sidebar-box {
    position: sticky;
    top: 5.5rem;
    background-color: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(141, 115, 101, 0.2);
    border-top: 3px solid #8d7365;
    border-radius: 10px;
}

.hub-node-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hub-node-item {
    border-bottom: 1px dashed rgba(141, 115, 101, 0.18);
}

.hub-node-item:last-child {
    border-bottom: none;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.hub-node-title {
    color: #2c3e3a;
    font-size: 0.95rem;
}

.hub-node-cn {
    color: #8d7365;
}

/* ==========================================================================
   8. 通用单页目录与元信息样式 (Default Single Page & TOC)
   ========================================================================== */
.article-meta {
    color: #8d7365;
    letter-spacing: 0.03em;
}

.single-cover-img {
    border-radius: 8px;
    width: 100%;
    height: auto;
    display: block;
}

.section-top-rule {
    border-top: 1px dashed rgba(141, 115, 101, 0.25);
}

/* 格式化 Hugo 自动生成的文章目录 (#TableOfContents) */
.editorial-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.editorial-toc li {
    margin-bottom: 0.55rem;
    line-height: 1.45;
    font-size: 0.9rem;
}

.editorial-toc li ul {
    margin-top: 0.45rem;
    padding-left: 1rem;
    border-left: 1px solid rgba(141, 115, 101, 0.2);
}

.editorial-toc a {
    color: #3b3a36;
    border-bottom: none;
}

.editorial-toc a:hover {
    color: #8d7365;
}

.silk-banner-img {
    width: 100%;
    aspect-ratio: 2 / 1;
    object-fit: cover;
    object-position: center 75%;
    border-radius: 12px;
    border: 1px solid rgba(141, 115, 101, 0.28);
    box-shadow: 0 8px 28px rgba(109, 76, 65, 0.08);
    display: block;
}

/* ==========================================================================
   8. 404 页面与古典按钮样式
   ========================================================================== */
.not-found-hero {
    position: relative;
    overflow: hidden;
    padding-top: 4.5rem;
    padding-bottom: 4.5rem;
}

.not-found-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -52%);
    font-family: 'Lora', serif;
    font-size: clamp(8rem, 22vw, 15rem);
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.06em;
    color: rgba(141, 115, 101, 0.09);
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

.not-found-content {
    position: relative;
    z-index: 1;
}

.not-found-lead {
    max-width: 620px;
    color: #555;
    line-height: 1.75;
    font-weight: 400;
}

/* 古典暖棕主次按钮 */
.btn-tang-primary {
    background-color: #6d4c41;
    border-color: #6d4c41;
    color: #fcf9f2;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.25s ease;
}

.btn-tang-primary:hover {
    background-color: #573b32;
    border-color: #573b32;
    color: #fcf9f2;
}

.btn-tang-outline {
    background-color: rgba(255, 255, 255, 0.45);
    border-color: rgba(141, 115, 101, 0.45);
    color: #6d4c41;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.25s ease;
}

.btn-tang-outline:hover {
    background-color: rgba(255, 255, 255, 0.85);
    border-color: #8d7365;
    color: #573b32;
}

/* 正文自动内链（古典典籍注释风细下划线） */
.wiki-content .wiki-autolink {
    color: #6d4c41;
    text-decoration: none;
    border-bottom: 1px dashed rgba(141, 115, 101, 0.55);
    padding-bottom: 1px;
    transition: all 0.2s ease;
}

.wiki-content .wiki-autolink:hover {
    color: #3b3a36;
    background-color: rgba(163, 141, 89, 0.14);
    border-bottom: 1px solid #8d7365;
}