/* =========================================
   全局变量与基础设置 (Global & Reset)
   ========================================= */
:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #eff6ff;
    --text-main: #1f2937;
    --text-secondary: #4b5563;
    --text-light: #9ca3af;
    --bg-body: #f3f4f6;
    --bg-card: #ffffff;
    --border: #e5e7eb;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; transition: all 0.2s ease; }
a:hover { color: var(--primary); }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* 容器 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5px;
}
    .article-content a.internal-link {
        color: red !important;
        text-decoration: underline !important;
        font-weight: 500 !important;
    }
/* =========================================
   导航栏 (Header & Nav)
   ========================================= */
header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.5px;
}

.logo span { color: var(--primary); }

.menu { display: flex; gap: 30px; }
.menu a {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 1rem;
    padding: 8px 0;
    position: relative;
}

.menu a:hover, .menu a.active { color: var(--primary); }
.menu a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-family: -apple-system, sans-serif;
}
.back-btn:hover { color: var(--primary); }

/* =========================================
   通用布局网格 (Main Grid Layout)
   ========================================= */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 380px; /* 左宽右窄 */
    gap: 10px;
    margin-top: 40px;
    margin-bottom: 20px;
}

/* =========================================
   通用侧边栏组件 (Sidebar Widgets)
   ========================================= */
.sidebar { display: flex; flex-direction: column; gap: 30px; }

.widget {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 25px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-title svg { width: 20px; height: 20px; color: var(--primary); }

/* 侧边栏列表 */
.side-list li {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f3f4f6;
}
.side-list li:last-child { border: none; margin: 0; padding: 0; }

.side-link {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.4;
}
.side-link:hover { color: var(--primary); transform: translateX(5px); }

.side-meta {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 5px;
    display: block;
}

/* 热点文章序号 */
.hot-list { counter-reset: hot-counter; }
.hot-list li {
    position: relative;
    padding-left: 30px;
    border: none !important;
    margin-bottom: 12px;
}
.hot-list li::before {
    counter-increment: hot-counter;
    content: counter(hot-counter);
    position: absolute;
    left: 0;
    top: 2px;
    width: 20px;
    height: 20px;
    background: #f3f4f6;
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    line-height: 20px;
    border-radius: 4px;
    transition: 0.2s;
}
.hot-list li:nth-child(1)::before { background: #ef4444; color: white; }
.hot-list li:nth-child(2)::before { background: #f97316; color: white; }
.hot-list li:nth-child(3)::before { background: #eab308; color: white; }
.hot-list li:hover::before { background: var(--primary); color: white; }

/* 标签云 */
.tags-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-item {
    background: #f9fafb;
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: 0.2s;
}
.tag-item:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* 作者卡片 (内容页专用) */
.author-card { text-align: center; }
.author-card img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 15px;
    border: 3px solid var(--primary-light);
}
.author-card h4 { font-size: 1.1rem; margin-bottom: 5px; color: var(--text-main); }
.author-card p { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 15px; line-height: 1.5; }
.social-links { display: flex; justify-content: center; gap: 10px; }
.social-icon {
    width: 32px;
    height: 32px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}
.social-icon:hover { background: var(--primary); color: white; }

/* 目录导航 (内容页专用) */
.toc-list li { margin-bottom: 10px; }
.toc-link {
    font-size: 0.95rem;
    color: var(--text-secondary);
    display: block;
    padding: 5px 0;
    border-left: 2px solid transparent;
    padding-left: 10px;
}
.toc-link:hover { color: var(--primary); border-left-color: var(--primary); }
.toc-link.level-2 { font-weight: 600; color: var(--text-main); }
.toc-link.level-3 { font-size: 0.9rem; padding-left: 20px; color: var(--text-light); }

/* =========================================
   首页特有样式 (Home Page)
   ========================================= */
.hero {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    border-radius: var(--radius);
    padding: 60px 40px;
    color: white;
    text-align: center;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
}
.hero h1 { font-size: 2.5rem; margin-bottom: 15px; font-weight: 800; }
.hero p { font-size: 1.1rem; opacity: 0.9; max-width: 600px; margin: 0 auto; }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}
.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title::before {
    content: '';
    display: block;
    width: 6px;
    height: 24px;
    background: var(--primary);
    border-radius: 4px;
}

.post-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 25px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text-light);
}
.post-tag {
    background: var(--primary-light);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
}
.post-date { display: flex; align-items: center; gap: 5px; }

.post-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
    line-height: 1.3;
}
.post-title a:hover { color: var(--primary); }

.post-excerpt {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 15px;
}
.author-info { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; font-weight: 500; }
.author-avatar { width: 32px; height: 32px; background: #ddd; border-radius: 50%; background-size: cover; }
.read-more-btn {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* =========================================
   列表页特有样式 (List Page)
   ========================================= */
.page-header { margin-bottom: 30px; }
.page-title { font-size: 2rem; font-weight: 800; color: var(--text-main); margin-bottom: 10px; }
.page-desc { color: var(--text-secondary); }

.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    overflow-x: auto;
    padding-bottom: 5px;
}
.filter-btn {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
}
.filter-btn.active, .filter-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.list-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.list-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

.list-meta { display: flex; align-items: center; gap: 12px; font-size: 0.85rem; color: var(--text-light); }
.list-tag { background: var(--primary-light); color: var(--primary); padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.list-title { font-size: 1.4rem; font-weight: 700; color: var(--text-main); line-height: 1.3; }
.list-excerpt { color: var(--text-secondary); font-size: 0.95rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 15px; border-top: 1px solid #f3f4f6; }
.read-link { color: var(--primary); font-weight: 600; font-size: 0.9rem; }

.pagination { display: flex; justify-content: center; gap: 10px; margin-top: 40px; }
.page-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-weight: 600;
}
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-btn:hover:not(.active) { background: var(--primary-light); color: var(--primary); }

/* =========================================
   内容页特有样式 (Article Page)
   ========================================= */
.article-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border);
}

.article-header { padding: 50px 50px 30px; border-bottom: 1px solid var(--border); }
.article-tags { display: flex; gap: 10px; margin-bottom: 20px; }
.tag-pill {
    background: var(--primary-light);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: -apple-system, sans-serif;
}
.article-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.3;
    margin-bottom: 20px;
    font-family: -apple-system, sans-serif;
}
.article-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    color: var(--text-light);
    font-size: 0.95rem;
    font-family: -apple-system, sans-serif;
}
.author-block { display: flex; align-items: center; gap: 10px; color: var(--text-secondary); font-weight: 500; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #ddd; }

.article-content { padding: 50px; font-size: 1.125rem; color: #374151; line-height: 1.8; }
.article-content p { margin-bottom: 24px; text-align: justify; }
.article-content h2 {
    font-size: 1.6rem;
    color: var(--text-main);
    margin-top: 50px;
    margin-bottom: 20px;
    font-family: -apple-system, sans-serif;
    font-weight: 700;
    border-left: 5px solid var(--primary);
    padding-left: 15px;
    scroll-margin-top: 100px;
}
.article-content h3 {
    font-size: 1.3rem;
    color: var(--text-main);
    margin-top: 35px;
    margin-bottom: 15px;
    font-family: -apple-system, sans-serif;
    font-weight: 600;
}
.article-content ul, .article-content ol { margin-bottom: 24px; padding-left: 25px; }
.article-content li { margin-bottom: 10px; }

.abstract-box {
    background: var(--primary-light);
    border-left: 4px solid var(--primary);
    padding: 20px 25px;
    margin-bottom: 30px;
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
    font-style: italic;
    font-family: -apple-system, sans-serif;
}

figure { margin: 35px 0; text-align: center; }
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: block;
    margin: 0 auto;
}
figcaption {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--text-light);
    font-family: -apple-system, sans-serif;
}

blockquote {
    margin: 30px 0;
    padding: 20px 30px;
    background: #f9fafb;
    border-left: 4px solid var(--text-light);
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
    font-style: italic;
}

code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: "Consolas", monospace;
    font-size: 0.9em;
    color: #ef4444;
}

.article-footer {
    padding: 30px 50px;
    background: #f9fafb;
    border-top: 1px solid var(--border);
}
.footer-tags { margin-bottom: 30px; display: flex; gap: 10px; flex-wrap: wrap; }
.footer-tag {
    color: var(--text-secondary);
    font-size: 0.9rem;
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 6px;
}
.footer-tag:hover { border-color: var(--primary); color: var(--primary); }

.post-nav { display: flex; justify-content: space-between; gap: 20px; }
.nav-item { flex: 1; }
.nav-item.next { text-align: right; }
.nav-label { font-size: 0.85rem; color: var(--text-light); margin-bottom: 5px; display: block; }
.nav-title { font-weight: 600; color: var(--text-main); font-family: -apple-system, sans-serif; }
.nav-title:hover { color: var(--primary); }

/* =========================================
   页脚 (Footer)
   ========================================= */
footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 40px 0;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: auto;
}

/* =========================================
   响应式适配 (Responsive)
   ========================================= */
@media (max-width: 1024px) {
    .main-grid { grid-template-columns: 1fr; }
    .sidebar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    .article-content, .article-header, .article-footer { padding: 30px; }
}

@media (max-width: 600px) {
    .nav-inner {
        flex-direction: column;
        height: auto;
        padding: 15px 0;
        gap: 15px;
    }
    .menu { display: none; /* 移动端可改为汉堡菜单，此处暂隐藏 */ }
    .sidebar { grid-template-columns: 1fr; }
    
    .hero { padding: 40px 20px; }
    .hero h1 { font-size: 1.8rem; }
    
    .post-card, .list-item { padding: 20px; }
    .post-title, .list-title { font-size: 1.3rem; }
    
    .article-title { font-size: 1.6rem; }
    .post-nav { flex-direction: column; gap: 20px; }
    .nav-item.next { text-align: left; }
    
    .filter-bar { overflow-x: auto; }
}
.post-card-meta {margin:10Px 0}
.breadcrumb {padding:25Px}
























