/* =========================================
   DESIGN TOKENS & VARIABLES
   定义全站统一的设计变量，便于维护
   ========================================= */
:root {
    /* Colors */
    --color-text-primary: #111111;
    --color-text-secondary: #333;
    --color-text-tertiary: #555555;
    --color-text-meta: #666666;
    --color-text-muted: #888888;
    --color-border-light: #eee;
    --color-border-divider: #ddd;
    --color-bg-hover: #f9f9f9;
    
    /* Typography */
    --font-mono: 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;
    --font-sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "WenQuanYi Micro Hei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    
    /* Spacing & Layout */
    --spacing-unit-sm: 0.2rem;
    --spacing-unit-md: 0.5rem;
    --spacing-unit-lg: 1rem;
    --spacing-item-padding: 0.5rem;
    --width-col-fixed: 100px;
}

/* =========================================
   GLOBAL ARCHIVE STRUCTURE
   适用于：Activities Feed, Projects Archive, Research Bibliography
   ========================================= */

/* 1. 容器通用设置 */
.activities-feed,
.archive-list,
.biblio-list {
    display: flex;
    flex-direction: column;
    margin-top: var(--spacing-unit-lg);
    /* 注意：根据您之前的决定，这里没有顶部封边线，如需加回请取消下面注释 */
    /* border-top: 1px solid var(--color-text-primary); */
}

/* 2. 条目/行 通用布局 */
.feed-entry,
.archive-row,
.biblio-item {
    display: flex; /* Biblio-item 内部虽为 block，但整体列表流保持一致 */
    align-items: baseline;
    justify-content: space-between;
    gap: 1.5rem;
    padding: var(--spacing-item-padding) 0;
    border-bottom: 1px solid var(--color-border-light);
    transition: background-color 0.15s ease;
}

/* 特殊处理：Biblio-item 内部结构不同，需覆盖 display */
.biblio-item {
    display: block; 
}

.feed-entry:last-child,
.archive-row:last-child,
.biblio-item:last-child {
    border-bottom: none;
}

.feed-entry:hover,
.archive-row:hover,
.biblio-item:hover {
    background-color: var(--color-bg-hover);
}

/* =========================================
   GLOBAL HEADER STYLE (Compact & Cold)
   适用于：所有列表页 (Projects, Activities, Research)
   ========================================= */

.main__header {
    margin-bottom: 0; /* 移除底部大间距，让列表紧贴标题 */
    padding-bottom: 0.8rem; /* 仅保留少量内边距 */
    border-bottom: 1px dashed #aaa; /* 关键：底部加黑线，作为“表头”封底 */
}

.main__title {
    font-size: 1.4rem; /* 适度减小字号，避免过于张扬 */
    font-weight: 700;
    margin: 0 0 0.3rem 0; /* 极小下边距 */
    line-height: 1.2;
    font-family: var(--font-sans);
    color: var(--color-text-primary);
    letter-spacing: -0.5px; /* 紧凑字间距 */
    text-transform: none; /* 保持原标题大小写，或可改为 uppercase 更冷峻 */
}

.main__subtitle {
    font-family: var(--font-mono); /* 强制等宽字体 */
    font-size: 0.75rem;
    color: var(--color-text-meta); /* 中灰色 */
    margin: 0;
    line-height: 1.5;
    letter-spacing: 0.5px;
    text-transform: uppercase; /* 全大写增强工程感 */
    font-weight: 400;
    
    /* 可选：如果希望副标题像代码注释一样淡，可取消下面注释 */
    /* opacity: 0.8; */
}

/* 移动端微调 */
@media (max-width: 768px) {
    .main__title {
        font-size: 1.25rem;
    }
    
    .main__subtitle {
        font-size: 0.7rem;
        white-space: normal; /* 允许换行 */
    }
}

/* =========================================
   MODULE: ACTIVITIES FEED (专业参与)
   ========================================= */

.entry-date {
    flex: 0 0 var(--width-col-fixed);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    text-align: left;
    line-height: 1.5;
    letter-spacing: -0.5px;
}

.entry-body {
    flex: 1;
    min-width: 0;
}

.entry-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    line-height: 1.4;
    font-family: var(--font-sans);
    color: var(--color-text-primary);
    display: inline;
}

.entry-title a {
    color: var(--color-text-primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.entry-title a:hover {
    border-bottom-color: var(--color-text-primary);
    opacity: 1;
}

.record-link-wrapper {
    display: inline-block;
    margin-left: var(--spacing-unit-md);
    vertical-align: middle;
}

.record-link-wrapper a {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--color-text-muted);
    text-decoration: none;
    border: 1px solid #eee;
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.record-link-wrapper a:hover {
    color: var(--color-text-primary);
    border-color: #999;
    background-color: #fff;
}

.entry-meta {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--color-text-meta);
    line-height: 1.6;
    letter-spacing: 0.2px;
    display: block;
    margin-top: var(--spacing-unit-sm);
    margin-bottom: var(--spacing-unit-sm);
}

/* =========================================
   MODULE: PROJECTS ARCHIVE (项目档案)
   ========================================= */

.col-index {
    flex: 0 0 var(--width-col-fixed);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    letter-spacing: -0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-content {
    flex: 1;
    min-width: 0;
}

.row-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    line-height: 1.4;
    font-family: var(--font-sans);
    color: var(--color-text-primary);
    display: inline;
}

.row-title a {
    color: var(--color-text-primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.row-title a:hover {
    border-bottom-color: var(--color-text-primary);
    opacity: 1;
}

.row-meta {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--color-text-meta);
    line-height: 1.6;
    letter-spacing: 0.2px;
    display: block;
    margin-top: var(--spacing-unit-sm);
    margin-bottom: var(--spacing-unit-sm);
}

.meta-cat {
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
}

.meta-tag {
    color: var(--color-text-tertiary);
}

.meta-author {
    font-style: italic;
    color: var(--color-text-muted);
}

.meta-sep {
    color: var(--color-border-divider);
    margin: 0 4px;
    user-select: none;
}

.col-action {
    flex: 0 0 60px;
    text-align: right;
}

.btn-link {
    font-family: var(--font-mono);
    color: #111;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
    padding: 2px 6px;
    transition: all 0.2s;
}

.btn-link:hover {
    color: var(--color-text-primary);
    border-color: var(--color-border-divider);
}

/* =========================================
   MODULE: RESEARCH BIBLIOGRAPHY (Grid Aligned)
   修复“乱”的问题：建立严格的三列网格对齐
   ========================================= */

.biblio-list {
    display: flex;
    flex-direction: column;
    margin-top: var(--spacing-unit-lg);
}

.biblio-item {
    display: flex;
    align-items: baseline; /* 关键：所有列基于第一行文字基线对齐 */
    justify-content: space-between;
    gap: 1.5rem;
    padding: var(--spacing-item-padding) 0;
    border-bottom: 1px solid var(--color-border-light);
    transition: background-color 0.15s ease;
    position: relative;
}

.biblio-item:hover {
    background-color: var(--color-bg-hover);
}

/* --- 列 1: 年份 (固定宽度，右对齐) --- */
.col-year {
    flex: 0 0 50px; /* 固定宽度，足够放下 4 位数字 */
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-text-secondary);
    text-align: right; /* 右对齐，形成整齐的右边缘 */
    line-height: 1.5;
    padding-right: 1rem; /* 与中间内容的间距 */
    user-select: none;
}

/* --- 列 2: 内容区 (适配新顺序：标题 -> 作者 -> 元数据) --- */
.biblio-content {
    flex: 1;
    min-width: 0;
}

/* Line 1: Title (现在是视觉焦点) */
.biblio-title {
    font-size: 0.9rem;
    font-weight: 700;         /* 加粗，强调重要性 */
    margin: 0 0 0.15rem 0;    /* 下边距减小，紧贴作者行 */
    line-height: 1.35;
    font-family: var(--font-sans);
    color: var(--color-text-primary);
    display: block;
}

.biblio-title a {
    color: var(--color-text-primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.biblio-title a:hover {
    border-bottom-color: var(--color-text-primary);
}

/* Line 2: Authors (现在是次要信息) */
.biblio-header-line {
    font-family: var(--font-mono);
    font-size: 0.72rem;       /* 较小字号 */
    color: var(--color-text-tertiary); /* 颜色稍淡 */
    margin-bottom: 0.2rem;    /* 与下方元数据的间距 */
    line-height: 1.4;
}

.biblio-authors {
    font-style: normal;
    /* 可选：在作者前加一个小点或保持纯净 */
    /* &::before { content: "· "; color: #ccc; } */
}

/* Line 3: Venue & Type (辅助信息) */
.biblio-meta-line {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--color-text-meta);
    line-height: 1.5;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.meta-venue {
    font-style: italic;
    color: var(--color-text-secondary);
}


.meta-type {
    text-transform: uppercase;
    font-size: 0.65rem;
    color: #777;
    letter-spacing: 0.5px;
}

.biblio-meta-line .meta-divider {
    display: inline-block;
    width: 1px;
    height: 0.7em;
    background-color: var(--color-border-divider);
    margin: 0 2px;
    vertical-align: middle;
}

/* --- 列 3: 操作区 (固定宽度，右对齐) --- */
.col-action {
    flex: 0 0 140px; /* 固定宽度，预留足够空间放 3 个按钮 */
    text-align: right; /* 整体右对齐 */
    display: flex;
    flex-direction: row;
    justify-content: flex-end; /* 按钮靠右排 */
    align-items: center;
    gap: 6px; /* 按钮之间的固定间距，不再依赖 &nbsp; */
    min-height: 1.5em; /* 保证即使没有按钮也有高度，防止塌陷 */
}

.col-action .btn-link {
    font-size: 0.7rem;
    padding: 2px 5px;
    opacity: 0.7;
    white-space: nowrap;
    border: 1px solid transparent; /* 预留边框位置防止抖动 */
}

.col-action .btn-link:hover {
    opacity: 1;
    border-color: var(--color-border-divider);
}

.col-action .btn-link.disabled {
    color: #eee;
    cursor: default;
    visibility: hidden; /* 隐藏占位符，保持整洁 */
}

/* =========================================
   RESPONSIVE: Mobile Adaptation
   ========================================= */
@media (max-width: 768px) {
    .biblio-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.8rem 0;
    }

    /* 移动端年份变为顶部标签 */
    .col-year {
        width: 100%;
        text-align: left;
        padding-right: 0;
        margin-bottom: 0.2rem;
        font-size: 0.7rem;
        color: var(--color-text-muted);
        font-weight: 600;
    }

    .biblio-content {
        width: 100%;
    }

    .biblio-title {
        font-size: 1.0rem;
    }

    /* 移动端操作区沉底 */
    .col-action {
        width: 100%;
        justify-content: flex-start; /* 左对齐 */
        margin-top: 0.4rem;
        padding-top: 0.4rem;
        border-top: 1px dashed #f0f0f0;
        gap: 8px;
        flex: 0 0 auto; /* 取消固定宽度 */
    }
    
    .col-action .btn-link {
        padding: 3px 6px;
        border: 1px solid #eee; /* 移动端给个边框更好点 */
        border-radius: 2px;
    }
}
/* =========================================
   RESPONSIVE: Research Mobile Adaptation
   ========================================= */
@media (max-width: 768px) {
    .biblio-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
        padding: 0.6rem 0;
    }

    .biblio-content {
        width: 100%;
    }

    .biblio-header-line {
        margin-bottom: 0.2rem;
        font-size: 0.7rem;
    }

    .biblio-title {
        font-size: 1.0rem;
        margin-bottom: 0.3rem;
    }

    .biblio-meta-line {
        font-size: 0.68rem;
        gap: 0.2rem;
    }
    
    .biblio-meta-line .meta-divider {
        margin: 0 4px;
        height: 0.6em;
    }

    /* 移动端操作区：独占一行，带虚线 */
    .col-action {
        width: 100%;
        flex-direction: row; /* 移动端也可以横向排开，或者改 column 堆叠 */
        justify-content: flex-start;
        margin-top: 0.3rem;
        padding-top: 0.3rem;
        border-top: 1px dashed #f0f0f0;
        gap: 0.5rem;
    }
    
    .col-action .btn-link {
        font-size: 0.65rem;
        padding: 2px 6px;
    }
}

/* =========================================
   SINGLE PAGE CONTENT SPACING FIX
   解决普通页面 (Page) 内容与 Header 之间无间距的问题
   ========================================= */

/* 1. 确保普通页面的内容容器有顶部间距 */
.main__content,
.content {
    margin-top: 0.5rem; /* 关键：增加顶部外边距，拉开与 Header 的距离 */
    padding-top: 0.5rem; /* 可选：增加一点内边距，让文字不贴边 */
}


/* 移动端适配 */
@media (max-width: 768px) {
    .main__content,
    .content {
        margin-top: 0.5rem;
    }
    
    .main__content h4,
    .content h4 {
        font-size: 1.0rem;
        margin-top: 0.5rem;
        border-left-width: 2px;
    }
}

/* =========================================
   RESPONSIVE DESIGN FIX (Mobile Spacing Optimization)
   专门解决 Activities 和 Projects 在移动端间距过大的问题
   ========================================= */
@media (max-width: 768px) {
    
    /* 1. 压缩容器与标题的间距 (从 1rem 降至 0.5rem) */
    .activities-feed,
    .archive-list {
        margin-top: 0.5rem; 
        gap: 0; /* 确保条目间无额外间隙，靠 border 分割 */
    }

    /* 2. 压缩条目垂直内边距 (从 1rem 降至 0.6rem) */
    .feed-entry,
    .archive-row {
        padding: 0.6rem 0; 
        gap: 0.4rem; /* 压缩列间距 */
    }

    /* 3. 压缩日期/索引号下方的间距 */
    .entry-date,
    .col-index {
        margin-bottom: 0.15rem; /* 从 0.2rem 进一步压缩 */
        font-size: 0.7rem; /* 字号略微调小以适应窄屏 */
    }

    /* 4. 压缩描述文本/元数据的上边距 (紧贴标题) */
    .entry-meta,
    .row-meta {
        margin-top: 0.15rem; /* 从 0.4rem 大幅压缩至 0.15rem */
        margin-bottom: 0;    /* 移除底部间距 */
        font-size: 0.7rem;   /* 字号略微调小 */
        line-height: 1.5;    /* 行高略微调紧 */
    }

    /* 5. 优化移动端操作区/链接区的间距 */
    .col-action,
    .record-link-wrapper {
        width: 100%;
        text-align: left;
        margin-top: 0.4rem; /* 已优化过的间距 */
        padding-top: 0.4rem;
        border-top: 1px dashed #f0f0f0;
    }

    /* 6. 确保 Research 页面保持一致的紧凑度 (作为参考基准) */
    .biblio-list {
        margin-top: 0.5rem;
    }
    
    .biblio-item {
        padding: 0.6rem 0;
    }

    .biblio-header-line {
        margin-bottom: 0.2rem;
        font-size: 0.7rem;
    }

    .biblio-title {
        font-size: 1.0rem;
        margin-bottom: 0.3rem;
    }

    .biblio-meta-line {
        font-size: 0.68rem;
        gap: 0.2rem;
    }
    
    .meta-divider {
        margin: 0 4px;
        height: 0.6em;
    }
}

/* --- 详情页 (Single) 字体与布局微调 --- */
/* 1. 标题冷峻化：减小字号，增加字重，减少下边距 */
.single .post__title {
    font-size: 1.25rem; /* 原主题可能更大，这里稍微收一点 */
    font-weight: 700;
    font-family: var(--font-sans);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em; /* 让字母更紧凑 */
    color: var(--color-text-primary);
}

/* 2. 正文密度调整：略微减小行高，提升阅读效率 */
.single .post__content {
    font-size: 0.9rem; /* 确保基础字号适中 */
    line-height: 1.65; /* 比默认的 1.8 稍紧，更像文档 */
    color: var(--color-text-secondary);
}

/* 3. 缩略图约束：防止图片过大破坏版面平衡 */
.single .post__thumbnail img {
    max-height: 450px; /* 限制最大高度 */
    width: 100%;
    object-fit: cover;
    border-radius: 2px; /* 轻微圆角或直角，看您喜好，直角更冷峻 */
    margin-bottom: 2rem;
    /* 可选：添加轻微滤镜降低色彩饱和度 */
    /* filter: grayscale(10%); */ 
}


/* =========================================
   FIX: Default List & Summary Integration
   将原有的 archive-row 风格应用到默认的 single.html 生成的列表项中
   ========================================= */

/* 1. 确保 list__item 表现为 archive-row (Flex 布局) */
/* 注意：如果缩略图存在，可能需要调整 flex-direction 或 display */
.list__item.post {
    /* 继承 archive-row 的样式，但如果有缩略图，可能需要 block 或 flex-column */
    /* 这里我们假设缩略图在 header 之前，整体保持 block 流或 flex */
    display: block; 
    margin-bottom: 0; /* 由 border-bottom 控制间隔 */
}

/* 如果有缩略图，让缩略图和文字内容在同一行或上下排列？
   根据您的 "冷峻档案" 风格，通常列表页缩略图在左侧或顶部。
   MainRoad 默认是顶部。为了保持紧凑，我们强制让它像 archive-row 一样有分割线。
*/
.list__item.post {
    padding: var(--spacing-item-padding) 0;
    border-bottom: 1px solid var(--color-border-light);
    transition: background-color 0.15s ease;
}

.list__item.post:last-child {
    border-bottom: none;
}

.list__item.post:hover {
    background-color: var(--color-bg-hover);
}

/* 2. 统一副标题样式 (list__lead) */
.list__lead {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-text-meta);
    margin: 0.2rem 0 0.4rem 0;
    line-height: 1.5;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: block; /* 强制换行 */
}

/* 3. 统一元数据样式 (row-meta / list__meta) */
.row-meta, 
.list__meta {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--color-text-meta);
    margin-top: 0.2rem;
    margin-bottom: 0.4rem;
    letter-spacing: 0.5px;
}

/* 4. 优化缩略图在列表页的表现 */
/* 防止图片太大破坏紧凑感 */
.list .post__thumbnail {
    margin-bottom: 1rem;
}

.list .post__thumbnail img {
    max-height: 200px; /* 限制高度，比详情页更矮 */
    width: 100%;
    object-fit: cover;
    border-radius: 2px;
    opacity: 0.95;
}

/* 5. 优化 "Read More" 按钮 */
.list__footer-readmore {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-primary);
    text-decoration: none;
    border: 1px solid transparent;
    padding: 2px 6px;
    transition: all 0.2s;
    display: inline-block;
    margin-top: 0.5rem;
}

.list__footer-readmore:hover {
    border-color: var(--color-border-divider);
    opacity: 0.8;
}

/* 6. 无记录提示 */
.no-records {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-style: italic;
    padding: 2rem 0;
    text-align: center;
    border-bottom: 1px solid var(--color-border-light);
}

/* =========================================
   COMPONENT: ACADEMIC IDS (Compact Asymmetric)
   ========================================= */

.widget-academic-ids {
    padding-top: 0.5rem;
    width: 100%;
}

.widget-academic-ids .widget__title {
    font-family: var(--font-mono), monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-text-primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1rem;
}

/* 容器：垂直单列 */
.academic-ids-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem; /* 卡片间距紧凑 */
    width: 100%;
}

/* 卡片主体：横向布局，但内部比例非对称 */
.academic-id-card {
    display: flex;
    flex-direction: row; /* 恢复左右布局 */
    align-items: center;  /* 垂直居中 */
    justify-content: flex-start;
    
    /* 尺寸控制：高度由内容决定，不再强制 min-height */
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem 0.8rem; /* 紧凑的内边距 */
    
    /* 视觉风格 */
    background-color: #ffffff;
    border: 1px solid var(--color-border-light);
    border-radius: 0;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    
    transition: all 0.2s ease;
}

/* 左侧：Logo 区域 - 关键修改 */
.card-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* 【核心】固定宽度，而非高度 */
    /* 根据侧边栏总宽调整，这里设为 50px-60px 通常能容纳 1:4 Logo 的短边 */
    width: 100px; 
    flex-shrink: 0; /* 禁止被压缩 */
    
    height: auto;   /* 高度自适应，由 Logo 比例决定，但受限于容器 padding */
    max-height: 40px; /* 限制最大高度，防止细长 Logo 把卡片撑得太高 */
    
    margin-right: 1rem; /* 与文字的间距 */
    padding: 0.2rem;    /* 微小内边距 */
    box-sizing: border-box;
}

.card-logo-wrapper img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain; /* 保持 1:4 比例，在固定宽度的框内自动缩放 */
    display: block;
    filter: none;
}

/* 右侧：文字区域 - 占据剩余所有空间 */
.card-text-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    
    flex-grow: 1;       /* 【核心】占满剩余宽度 */
    min-width: 0;       /* 允许 flex 子项缩小以防止溢出 */
    
    gap: 0.25rem;       /* 两行文字间距极小 */
    overflow: hidden;
}

/* 第一行：平台全称 */
.card-title {
    font-family: var(--font-sans), sans-serif;
    font-size: 0.9rem;   /* 适中字号 */
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.2;
    text-transform: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* 超长自动省略号 */
}

/* 第二行：具体 ID */
.card-id {
    font-family: var(--font-mono), monospace;
    font-size: 0.7rem;   /* 较小字号，节省空间 */
    font-weight: 500;
    color: var(--color-text-meta);
    line-height: 1.2;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- 交互状态 --- */

.academic-id-card:hover {
    border-color: var(--color-text-primary);
    background-color: #fafafa;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transform: translateY(-1px); /* 仅轻微上浮 */
    z-index: 2;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .card-logo-wrapper {
        max-height: 35px;
        margin-right: 0.8rem;
    }
    
    .academic-id-card {
        padding: 0.5rem 0.6rem;
    }
    
    .card-title {
        font-size: 0.85rem;
    }
    
    .card-id {
        font-size: 0.65rem;
    }
}



/* =========================================
   FIX: UNIFY WIDGET TITLES
   强制统一侧边栏两个核心组件的标题样式
   ========================================= */
.widget-academic-ids .widget__title,
.widget-social .widget__title {
    font-family: var(--font-mono), monospace !important;
    font-size: 0.85rem !important; 
    font-weight: 700 !important;
    color: var(--color-text-primary) !important;
    /* 补充：确保间距也一致，视觉上更整齐 */
    margin-bottom: 1rem !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    
}

/* =========================================
   COMPONENT: SOCIAL CONTACTS (Compact)
   紧凑型社交联系卡片 - 小尺寸、低高度
   ========================================= */

/* 容器：保持垂直排列，间距稍小 */
.widget-social .academic-ids-container {
    gap: 0.6rem; /* 卡片间距比学术组件更小 */
}

/* 社交专用卡片类：紧凑模式 */
.social-contact-card {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    
    /* 【关键】尺寸大幅缩小 */
    width: 100%;
    box-sizing: border-box;
    padding: 0.4rem 0.6rem; /* 内边距很小，约 6px-10px */
    min-height: 42px;       /* 最小高度限制，比学术卡片 (80px+) 小得多 */
    
    /* 视觉风格：保持直角，边框稍细 */
    background-color: #ffffff;
    border: 1px solid var(--color-border-light);
    border-radius: 0;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    
    transition: all 0.2s ease;
}

/* 左侧：小 Logo 区域 */
.social-contact-card .card-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* 【关键】Logo 尺寸缩小 */
    width: 32px;            /* 固定宽度，比学术组件的 54px 小 */
    height: 32px;           /* 固定高度 */
    flex-shrink: 0;
    margin-right: 0.8rem;   /* 与文字间距缩小 */
}

.social-contact-card .card-logo-wrapper img,
.social-contact-card .card-logo-wrapper svg {
    max-width: 80%;         /* 图标在框内留一点白 */
    max-height: 80%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* 右侧：文字区域 */
.social-contact-card .card-text-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    
    flex-grow: 1;
    min-width: 0;
    gap: 0.1rem;            /* 两行文字间距极小 */
    overflow: hidden;
}

/* 第一行：平台名 (如 Email) */
.social-contact-card .card-title {
    font-family: var(--font-sans), sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 第二行：具体信息 (如邮箱地址) */
.social-contact-card .card-id {
    font-family: var(--font-mono), monospace;
    font-size: 0.65rem;     /* 字号更小，像备注一样 */
    font-weight: 400;
    color: var(--color-text-meta);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- 交互状态 --- */
.social-contact-card:hover {
    border-color: var(--color-text-primary);
    background-color: #fafafa;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05); /* 阴影更淡 */
    transform: translateY(-1px);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .social-contact-card {
        padding: 0.3rem 0.5rem;
        min-height: 38px;
    }
    .social-contact-card .card-logo-wrapper {
        width: 28px;
        height: 28px;
        margin-right: 0.6rem;
    }
    .social-contact-card .card-title {
        font-size: 0.75rem;
    }
    .social-contact-card .card-id {
        font-size: 0.6rem;
    }
}

/* =========================================
   COMPONENT: HOME PAGE DYNAMIC SECTIONS
   首页动态区域 — 单行布局 + 标签徽章
   ========================================= */

.home-section {
    margin-top: 0.3rem;
}

.home-section__title {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-text-meta);
    margin: 0 0 0.65rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border-divider);
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.home-section__footer {
    margin-top: 0.5rem;
    text-align: right;
}

.home-section__more {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--color-text-muted);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 2px 8px;
    transition: all 0.15s;
}

.home-section__more:hover {
    color: var(--color-text-primary);
}

/* =========================================
   HOME ROW: 单行
   ========================================= */

.home-row-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.home-row {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    padding: 0.38rem 0;
    border-bottom: 1px solid #f2f2f2;
    line-height: 1.5;
}

.home-row:last-child {
    border-bottom: none;
}

/* --- 日期列：等宽 mono，安静 --- */
.home-row__date {
    flex: 0 0 46px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--color-text-muted);
    text-align: right;
    white-space: nowrap;
    user-select: none;
}

/* --- 主体 --- */
.home-row__body {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    column-gap: 0.4rem;
    row-gap: 0.15rem;
}

/* 标题链接 */
.home-row__title {
    font-size: 0.88rem;
    font-weight: 650;
    color: var(--color-text-primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s;
}

.home-row__title:hover {
    border-bottom-color: var(--color-text-primary);
}

/* --- 标签徽章 --- */
.home-row__badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.56rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    padding: 1px 6px;
    white-space: nowrap;
    vertical-align: middle;
    line-height: 1.4;
    background: #fafafa;
}

/* --- 元信息：刊物 · 作者 --- */
.home-row__meta {
    font-family: var(--font-mono);
    font-size: 0.69rem;
    color: var(--color-text-meta);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-row__meta-sep {
    color: var(--color-border-divider);
    margin: 0 0.2rem;
    user-select: none;
}

/* --- 右侧链接按钮 --- */
.home-row__links {
    flex-shrink: 0;
    display: flex;
    gap: 0.25rem;
}

.home-row__btn {
    font-family: var(--font-mono);
    font-size: 0.56rem;
    color: var(--color-text-muted);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 1px 5px;
    border: 1px solid transparent;
    border-radius: 2px;
    transition: all 0.15s;
    white-space: nowrap;
}

.home-row__btn:hover {
    color: var(--color-text-primary);
    border-color: var(--color-border-divider);
    background: #fafafa;
}

/* =========================================
   HOME SECTIONS — MOBILE
   ========================================= */
@media (max-width: 768px) {
    .home-section {
        margin-top: 1.5rem;
    }

    .home-section__title {
        font-size: 0.68rem;
        margin-bottom: 0.5rem;
    }

    .home-section__more {
        font-size: 0.65rem;
    }

    .home-row {
        flex-wrap: wrap;
        gap: 0.25rem 0.5rem;
        padding: 0.45rem 0;
    }

    .home-row__date {
        flex: 0 0 42px;
        font-size: 0.65rem;
    }

    .home-row__title {
        font-size: 0.84rem;
    }

    .home-row__badge {
        font-size: 0.52rem;
        padding: 0 5px;
    }

    .home-row__meta {
        font-size: 0.66rem;
    }

    .home-row__links {
        width: 100%;
        padding-left: 48px;
    }

    .home-row__btn {
        font-size: 0.54rem;
    }
}

/* =========================================
   COMPONENT: LANGUAGES (Grid Mini-Cards)
   ========================================= */

/* 1. 标题统一 */
.widget-languages .widget__title {
    font-family: var(--font-mono), monospace !important;
    font-size: 0.85rem !important; 
    font-weight: 700 !important;
    color: var(--color-text-primary) !important;
    margin-bottom: 0.8rem !important;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 2. 网格容器：核心修复逻辑 */
.widget-languages .language-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(45px, 1fr));

    gap: 0.4rem; /* 减小间距，节省空间 */
    padding: 0;
    margin: 0;
}

/* 3. 微型卡片样式：进一步压缩 */
.language-mini-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    position: relative;
    background-color: #ffffff;
    border: 1px solid var(--color-border-light);
    border-radius: 0;
    
    /* 【关键修改】极致压缩内边距 */
    padding: 0.25rem 0.1rem; /* 上下 4px，左右 2px */
    min-height: 42px;        /* 高度再降低一点 */
    
    text-decoration: none;
    transition: all 0.2s ease;
    overflow: hidden;
    
    /* 确保文字不换行，强制压缩在卡片内 */
    white-space: nowrap; 
}

/* 文字组 */
.language-mini-card .lang-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1; /* 行高收紧 */
    width: 100%;
}

/* 第一行：语言全称 - 允许省略号 */
.language-mini-card .lang-name {
    font-family: var(--font-sans), sans-serif;
    font-size: 0.8rem;      /* 字号再小一点 */
    font-weight: 700;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* 太长显示 ... */
    max-width: 100%;
    margin-bottom: 5px;
}

/* 第二行：语言代码 */
.language-mini-card .lang-code {
    font-family: var(--font-mono), monospace;
    font-size: 0.65rem;     /* 代码极小 */
    font-weight: 700;
    color: var(--color-text-meta);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

/* --- 交互状态 --- */
.language-mini-card:hover {
    border-color: var(--color-text-primary);
    background-color: #fafafa;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    transform: translateY(-1px);
    z-index: 1;
}

/* 4. 强制响应式策略 */
/* 移动端超窄屏幕：降级为 2 列 */
@media (max-width: 280px) {
    .widget-languages .language-grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}