/* --- GeneMedi Pro Blog Theme (Red Edition v5.0 Final) --- */
:root {
    /* 核心品牌色 - GeneMedi Red */
    --gm-primary: #e24035;       /* 主色调 */
    --gm-primary-dark: #c53026;  /* 深色主调 (用于Hover) */
    --gm-primary-light: #fff5f5; /* 极浅色 (用于背景/标签) */
    --gm-primary-fade: rgba(226, 64, 53, 0.08); /* 半透明背景 */
    
    /* 中性色 */
    --gm-text-main: #2d3748;     /* 正文黑 (接近黑色的深灰) */
    --gm-text-light: #718096;    /* 辅助灰 */
    --gm-bg: #f8f9fa;            /* 全局背景色 */
    --gm-card-bg: #ffffff;
    --border-color: #e2e8f0;
    
    /* 装饰性 */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --radius: 8px;
}

body {
    background-color: var(--gm-bg);
    color: var(--gm-text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.7; /* 增加行高，提升阅读体验 */
    -webkit-font-smoothing: antialiased;
    margin: 0;
    padding: 0;
}

a { color: inherit; text-decoration: none; transition: 0.2s; }
a:hover { color: var(--gm-primary); }

/* --- 1. 布局系统 (Layout) --- */

.gm-container {
    max-width: 1400px; /* 最佳阅读宽度 */
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

.gm-grid {
    display: grid;
    grid-template-columns: 1fr 320px; /* 左侧自适应，右侧固定 */
    gap: 40px;
    /*margin-top: 30px;*/
    align-items: start;
}

/* [关键修复] 防止长内容(如代码/表格)撑爆网格布局 */
.gm-grid > * {
    min-width: 0; 
}

/* --- 2. 通用组件 (Components) --- */

/* 卡片 */
.gm-card {
    background: var(--gm-card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

/* 标签 (Pills) */
.gm-tag-pill {
    background-color: var(--gm-primary-light) !important;
    color: var(--gm-primary) !important;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    display: inline-block;
    transition: 0.2s;
    border: 1px solid transparent;
}
.gm-tag-pill:hover {
    background-color: var(--gm-primary) !important;
    color: #fff !important;
    border-color: var(--gm-primary);
}

/* CTA 渐变盒子 */
.gm-cta-gradient {
    background: linear-gradient(135deg, #e24035 0%, #c0392b 100%) !important;
    color: #fff;
    padding: 35px;
    border-radius: 8px;
    margin-top: 50px;
    text-align: center;
    box-shadow: var(--shadow-md);
}

/* --- 3. 列表页样式 (List View) --- */
.gm-list-item {
    display: flex;
    padding: 24px;
    position: relative;
}
.gm-list-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--gm-primary-fade);
}
.gm-list-thumb {
    width: 240px; height: 160px; flex-shrink: 0; margin-right: 24px;
    border-radius: var(--radius); overflow: hidden; background: #edf2f7;
    position: relative;
}
.gm-list-thumb img {
    width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease;
}
.gm-list-item:hover .gm-list-thumb img { transform: scale(1.08); }

.gm-list-content { flex: 1; display: flex; flex-direction: column; }
.gm-list-title {
    font-size: 1.5rem; font-weight: 700; margin: 0 0 10px 0; line-height: 1.3;
    color: var(--gm-text-main);
}
.gm-list-title a { text-decoration: none; color: inherit; }
.gm-list-title a:hover { color: var(--gm-primary); }

.gm-list-summary {
    color: var(--gm-text-light); font-size: 1rem; margin-bottom: auto;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.gm-list-meta {
    margin-top: 15px; font-size: 0.875rem; color: #a0aec0;
    display: flex; align-items: center; gap: 15px;
}

/* --- 4. 详情页样式 (Article Detail) --- */
.gm-article-header {
    padding-bottom: 25px; border-bottom: 1px solid #edf2f7; margin-bottom: 35px;
}
.gm-article-h1 {
    font-size: 2.5rem; font-weight: 800; color: #1a202c; line-height: 1.2;
    margin-bottom: 20px; letter-spacing: -0.02em;
}
.gm-article-meta-row {
    display: flex; align-items: center; flex-wrap: wrap; gap: 20px;
    color: var(--gm-text-light); font-size: 0.95rem;
}
.gm-article-meta-row i { color: var(--gm-primary); margin-right: 5px; }

/* 目录 TOC */
.gm-toc {
    background: #fcfcfc; border-left: 4px solid var(--gm-primary);
    padding: 25px; margin: 30px 0; border-radius: 0 var(--radius) var(--radius) 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}
.gm-toc-title { font-weight: 700; display: block; margin-bottom: 15px; color: #2d3748; font-size: 1.1rem; }
.gm-toc ul { list-style: none; padding: 0; margin: 0; }
.gm-toc li { margin-bottom: 8px; }
.gm-toc li a {
    display: block; padding: 4px 0; color: #4a5568; text-decoration: none;
    font-size: 0.95rem; border-bottom: 1px solid transparent; width: fit-content;
    transition: all 0.2s;
}
.gm-toc li a:hover { color: var(--gm-primary); padding-left: 5px; border-bottom-color: var(--gm-primary); }

/* --- 5. 正文排版 (Typography & Formatting) --- */
.gm-content { font-size: 1.125rem; line-height: 1.8; color: #2d3748; }

/* 标题 */
.gm-content h2 {
    font-size: 1.8rem; margin-top: 50px; margin-bottom: 25px;
    font-weight: 800; color: #1a202c; position: relative; padding-left: 15px;
}
.gm-content h2::before {
    content:''; position:absolute; left:0; top:8px; bottom:8px;
    width:5px; background:var(--gm-primary); border-radius:4px;
}
.gm-content h3 { font-size: 1.4rem; margin-top: 35px; margin-bottom: 18px; font-weight: 700; color: #2d3748; }
.gm-content h4 { font-size: 1.2rem; margin-top: 25px; margin-bottom: 15px; font-weight: 700; }

/* 段落与文本 */
.gm-content p { margin-bottom: 24px; text-align: justify; }
.gm-content strong, .gm-content b { color: #1a202c; font-weight: 700; }
.gm-content em, .gm-content i { color: #4a5568; }
.gm-content a {
    color: var(--gm-primary); text-decoration: none;
    border-bottom: 1px solid rgba(226, 64, 53, 0.3); transition: 0.2s;
}
.gm-content a:hover { color: var(--gm-primary-dark); border-bottom-color: var(--gm-primary); background: var(--gm-primary-light); }

/* 列表样式 */
.gm-content ul, .gm-content ol { margin-bottom: 24px; padding-left: 20px; }
.gm-content ul { list-style-type: disc; }
.gm-content ol { list-style-type: decimal; }
.gm-content li { margin-bottom: 10px; padding-left: 5px;list-style: auto; }

/* 表格样式 (Responsive Table) */
.gm-content table {
    width: 100%; border-collapse: collapse; margin: 30px 0;
    font-size: 0.95rem; border-radius: 8px; overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    /* 防止宽表格撑破布局 */
    display: block; overflow-x: auto; white-space: nowrap;
}
.gm-content th {
    background-color: #f8fafc; color: #2d3748; font-weight: 700;
    text-align: left; padding: 15px; border-bottom: 2px solid #e2e8f0;
}
.gm-content td { padding: 12px 15px; border-bottom: 1px solid #edf2f7; color: #4a5568; }
.gm-content tr:last-child td { border-bottom: none; }
.gm-content tr:nth-child(even) { background-color: #fcfcfc; }
.gm-content tr:hover { background-color: var(--gm-primary-light); }

/* 图片样式 */
.gm-content img {
    max-width: 100%; height: auto; border-radius: 8px; display: block;
    margin: 35px auto; box-shadow: var(--shadow-sm); border: 1px solid #edf2f7;
}
.gm-content figcaption {
    text-align: center; font-size: 0.9rem; color: #718096; margin-top: -20px; margin-bottom: 35px; font-style: italic;
}

/* 引用块 */
.gm-content blockquote {
    background: var(--gm-primary-light);
    border-left: 4px solid var(--gm-primary);
    margin: 30px 0; padding: 20px 25px;
    border-radius: 0 8px 8px 0;
    font-style: italic; color: #4a5568;
    position: relative;
}
.gm-content blockquote p:last-child { margin-bottom: 0; }

/* 代码块 */
.gm-content code {
    background-color: #edf2f7; color: #c53026;
    padding: 2px 6px; border-radius: 4px;
    font-family: Consolas, Monaco, "Courier New", monospace; font-size: 0.9em;
}
.gm-content pre {
    background: #2d3748; color: #fff; padding: 20px;
    border-radius: 8px; margin: 30px 0;
    /* 防止代码撑破布局 */
    overflow-x: auto; max-width: 100%;
}
.gm-content pre code { background: transparent; color: inherit; padding: 0; }

/* 分割线 */
.gm-content hr { border: 0; height: 1px; background: #e2e8f0; margin: 40px 0; }

/* --- 6. 特殊功能组件 --- */

/* 视频容器 */
.gm-video-wrapper {
    position: relative; padding-bottom: 56.25%; height: 0;
    overflow: hidden; border-radius: 8px; margin-bottom: 40px;
    background: #000; box-shadow: var(--shadow-md);
}
.gm-video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* 附件下载 */
.gm-downloads-box {
    background: #fffafa; border: 1px solid #fed7d7;
    border-radius: 8px; padding: 30px; margin-top: 60px;
}
.gm-download-title {
    font-size: 1.2rem; font-weight: 700; margin-bottom: 20px;
    display: flex; align-items: center; gap: 10px; color: var(--gm-primary-dark);
}
.gm-download-list {
    list-style: none; padding: 0; margin: 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 15px;
}
.gm-download-item {
    display: flex; align-items: center; background: #fff; padding: 15px;
    border-radius: 6px; border: 1px solid #feb2b2;
    transition: all 0.2s; text-decoration: none !important; color: #4a5568;
}
.gm-download-item:hover {
    border-color: var(--gm-primary); transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(226, 64, 53, 0.15); color: var(--gm-primary);
}
.gm-download-icon { font-size: 28px; margin-right: 15px; color: var(--gm-primary); }
.gm-download-name { font-weight: 600; font-size: 0.95rem; line-height: 1.2; margin-bottom: 2px; }
.gm-download-cta { font-size: 0.75rem; color: #718096; text-transform: uppercase; }

/* 作者盒子 */
.gm-author-box {
    background: #fff; padding: 25px; border-radius: var(--radius);
    display: flex; align-items: center; gap: 20px; margin-top: 60px;
    border: 1px solid #edf2f7; box-shadow: var(--shadow-sm);
}
.gm-author-avatar { 
    width: 70px; height: 70px; border-radius: 50%; object-fit: cover; 
    border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* --- 7. 侧边栏样式 (Sidebar) --- */
.gm-sidebar-sticky { position: sticky; top: 20px; }
.gm-widget-title {
    font-size: 1.1rem; font-weight: 700; margin-bottom: 18px;
    padding-bottom: 12px; border-bottom: 2px solid #edf2f7; position: relative;
}
.gm-widget-title::after {
    content: ''; position: absolute; bottom: -2px; left: 0; width: 40px; height: 2px; background: var(--gm-primary);
}
.gm-widget-list { list-style: none; padding: 0; }
.gm-widget-list li { margin-bottom: 12px; }
.gm-widget-list a { color: var(--gm-text-main); display: flex; justify-content: space-between; transition: 0.2s; text-decoration: none; }
.gm-widget-list a:hover { color: var(--gm-primary); }

/* Sidebar Profile */
.gm-sidebar-profile { text-align: center; }
.gm-profile-avatar { width: 90px; height: 90px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 6px 15px rgba(0,0,0,0.1); margin-bottom: 15px; object-fit: cover; }
.gm-profile-name { font-size: 1.2rem; font-weight: 700; color: #1a202c; margin-bottom: 5px; }
.gm-profile-bio { font-size: 0.9rem; color: #718096; line-height: 1.6; margin-bottom: 20px; }
.gm-social-links a { display: inline-flex; width:32px; height:32px; align-items:center; justify-content:center; margin: 0 5px; color: #718096; background:#f7fafc; border-radius:50%; transition: 0.2s; }
.gm-social-links a:hover { color: #fff; background: var(--gm-primary); transform: translateY(-3px); }

/* Sidebar Recent Posts */
.gm-recent-item { display: flex; gap: 15px; margin-bottom: 20px; align-items: center; }
.gm-recent-thumb { width: 70px; height: 70px; border-radius: 6px; background: #eee; flex-shrink: 0; overflow: hidden; }
.gm-recent-thumb img { width: 100%; height: 100%; object-fit: cover; transition: 0.3s; }
.gm-recent-item:hover .gm-recent-thumb img { transform: scale(1.1); }
.gm-recent-info { flex: 1; }
.gm-recent-title { font-size: 0.95rem; font-weight: 600; line-height: 1.4; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gm-recent-title a { color: #2d3748; text-decoration: none; }
.gm-recent-title a:hover { color: var(--gm-primary); }
.gm-recent-date { font-size: 0.75rem; color: #a0aec0; }

/* Sidebar Newsletter */
.gm-newsletter-box { background: linear-gradient(135deg, #fff5f5 0%, #ffe4e4 100%); border: 1px solid #fecaca; text-align: center; }
.gm-newsletter-input { width: 100%; padding: 12px; margin-bottom: 12px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 0.9rem; outline:none; box-sizing: border-box; }
.gm-newsletter-input:focus { border-color: var(--gm-primary); box-shadow: 0 0 0 3px rgba(226, 64, 53, 0.1); }
.gm-newsletter-btn { width: 100%; background: var(--gm-primary); color: #fff; border: none; padding: 12px; border-radius: 6px; font-weight: 600; cursor: pointer; transition: 0.2s; }
.gm-newsletter-btn:hover { background: var(--gm-primary-dark); box-shadow: 0 4px 12px rgba(226, 64, 53, 0.25); }

/* --- 8. 面包屑导航 (Modern Minimal Style) --- */
.gm-breadcrumb-nav {
    padding: 15px 0 25px 0; font-size: 0.95rem; color: var(--gm-text-light);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.gm-breadcrumb-list {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-wrap: wrap; align-items: center; line-height: 1.5;
}
.gm-breadcrumb-item { display: flex; align-items: center; }
.gm-breadcrumb-item a {
    color: #718096; text-decoration: none; transition: all 0.2s ease;
    display: flex; align-items: center; font-weight: 500;
}
.gm-breadcrumb-item a:hover { color: var(--gm-primary); transform: translateX(2px); }
.gm-breadcrumb-icon { margin-right: 6px; font-size: 1.1rem; position: relative; top: -1px; }
.gm-breadcrumb-separator { margin: 0 12px; color: #e2e8f0; font-size: 0.8rem; }
.gm-breadcrumb-current {
    color: var(--gm-text-main); font-weight: 700; pointer-events: none;
    background: rgba(226, 64, 53, 0.08); padding: 2px 10px; border-radius: 4px;
    max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* --- 知识图谱模块 (Knowledge Graph Widget) --- */
.gm-kg-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 25px;
    margin-top: 40px; /* 与正文的距离 */
    margin-bottom: 20px; /* 与下载区的距离 */
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    text-align: center;
}

.gm-kg-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3748;
    border-bottom: 1px dashed #e2e8f0;
    padding-bottom: 15px;
}

.gm-kg-img-wrapper {
    display: block;
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid #edf2f7;
    position: relative;
}

.gm-kg-img-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
    margin: 0 !important; /* 覆盖正文图片的默认margin */
}

/* 鼠标悬停放大效果，暗示可点击 */
.gm-kg-img-wrapper:hover img {
    transform: scale(1.02);
}

.gm-kg-hint {
    margin-top: 12px;
    font-size: 0.85rem;
    color: #718096;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
/* --- 9. 响应式适配 (Mobile) --- */
@media (max-width: 992px) {
    .gm-container { padding: 0 15px; }
    .gm-grid { grid-template-columns: 1fr; gap: 30px; }
    .gm-list-item { flex-direction: column; }
    .gm-list-thumb { width: 100%; height: 200px; margin-right: 0; margin-bottom: 20px; }
    .gm-article-h1 { font-size: 1.8rem; }
    .gm-content h2 { font-size: 1.5rem; }
    .gm-breadcrumb-current { max-width: 150px; }
    
    /* 移动端表格强制滚动提示 */
    .gm-content table::-webkit-scrollbar { height: 6px; }
    .gm-content table::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 3px; }
}