/* ========== 全局布局 ========== */
.blog-page-wrapper { position: relative; max-width: 1400px; margin: 30px auto; padding: 0 20px; }
.blog-glass-card {
    position: relative; background: rgba(255,255,255,0.72);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-radius: 28px; overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15), 0 0 0 1px rgba(255,255,255,0.6);
}
#particleCanvas { position: absolute; top:0; left:0; width:100%; height:100%; pointer-events:none; z-index:1; }
.blog-container { display: flex; gap: 30px; padding: 25px; position: relative; z-index: 2; }
.blog-sidebar { width: 250px; flex-shrink: 0; display: flex; flex-direction: column; gap: 20px; }
.sidebar-card { background:#fff; border-radius:16px; padding:20px; box-shadow:0 8px 24px rgba(0,0,0,0.06); }
.sidebar-card h4 { margin:0 0 15px; color:#1e466e; font-weight:600; }
.tag-list-vertical { list-style:none; padding:0; margin:0; }
.tag-list-vertical li { margin-bottom:8px; }
.tag-list-vertical li a {
    display:flex; align-items:center; justify-content:space-between;
    padding:6px 10px; border-radius:6px; color:#333; text-decoration:none;
    font-size:0.85rem; transition:all 0.2s; background:#f8f9fa;
}
.tag-list-vertical li a:hover { background:#e9ecef; color:#0d6efd; }
.tag-list-vertical li a.active { background:#1e466e; color:#fff; font-weight:600; }
.tag-count { background:#dee2e6; color:#495057; font-size:0.72rem; padding:1px 6px; border-radius:10px; }
.tag-list-vertical li a.active .tag-count { background:#fff; color:#1e466e; }
.all-tag-link {
    display:flex; align-items:center; justify-content:space-between;
    margin-bottom:12px; padding:6px 10px; border-radius:8px; color:#333;
    text-decoration:none; font-weight:500; transition:all 0.2s;
}
.all-tag-link:hover { background:#f0f4ff; }
.all-tag-link.active { background:#1e466e; color:#fff; font-weight:600; }
.all-tag-link .tag-count { background:#dee2e6; color:#495057; }
.all-tag-link.active .tag-count { background:#fff; color:#1e466e; }
.ad-card {
    background:linear-gradient(135deg,#0f2027,#203a43,#2c5364); color:#fff;
    border-radius:16px; padding:20px; box-shadow:0 10px 25px rgba(0,0,0,0.2);
    position:relative; overflow:hidden;
}
.ad-card::before { content:""; position:absolute; top:-20px; right:-20px; width:80px; height:80px; background:rgba(255,255,255,0.1); border-radius:50%; }
.ad-card h5 { font-size:1rem; margin:0 0 12px; font-weight:700; }
.ad-card p { font-size:0.8rem; line-height:1.6; margin:0 0 10px; opacity:0.9; }
.ad-card .contact-links { display:flex; flex-direction:column; gap:4px; font-size:0.82rem; font-weight:500; }
.ad-card .contact-links i { width:20px; text-align:center; margin-right:6px; }
.blog-main { flex:1; min-width:0; }
.category-header-card {
    background:#fff; border-radius:16px; padding:20px 28px; margin-bottom:25px;
    box-shadow:0 4px 16px rgba(0,0,0,0.06);
}
.category-header-card h1 { margin:0; color:#1e293b; font-weight:800; font-size:1.8rem; }
.post-card {
    background:#fff; border-radius:20px; padding:30px 28px; margin-bottom:25px;
    box-shadow:0 2px 4px rgba(0,0,0,0.02), 0 12px 28px rgba(0,0,0,0.08), 0 20px 40px -12px rgba(0,0,0,0.12);
    transition:transform 0.25s ease, box-shadow 0.25s ease;
    border:1px solid rgba(255,255,255,0.8);
}
.post-card:hover { transform:translateY(-6px); box-shadow:0 4px 8px rgba(0,0,0,0.04), 0 16px 36px rgba(0,0,0,0.1), 0 24px 48px -12px rgba(0,0,0,0.18); }
.post-card h2 { margin:0 0 12px; }
.post-card h2 a { background:linear-gradient(to right,#1e466e,#0d6efd); -webkit-background-clip:text; -webkit-text-fill-color:transparent; text-decoration:none; font-weight:700; }
.post-meta { color:#94a3b8; font-size:0.88rem; margin-bottom:14px; }
.post-summary { color:#475569; line-height:1.8; margin-bottom:20px; font-size:0.98rem; }
.read-more-btn { display:inline-flex; align-items:center; background:#f1f5f9; color:#1e466e; padding:8px 20px; border-radius:30px; text-decoration:none; font-weight:600; font-size:0.9rem; transition:all 0.2s; }
.read-more-btn:hover { background:#e0e7ff; color:#0b3d6b; }

/* 文章标题缩小 */
.post-card h1 { font-size: 1.8rem; }

/* 正文统一排版 */
.post-content {
    font-size: 1rem;
    line-height: 1.9;
    color: #334155;
}
.post-content p {
    margin-bottom: 1.2rem;
}

/* 代码块 */
.post-content pre, .post-content code {
    background-color: #f4f6f9;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    font-family: 'Courier New', monospace;
    font-size: 0.92rem;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-x: auto;
}
.post-content pre { margin: 25px 0; }

/* Google Prettify 色彩 */
.post-content pre .pln { color: #2d3748; }
.post-content pre .pun { color: #e53e3e; }
.post-content pre .kwd { color: #5a67d8; }
.post-content pre .lit { color: #dd6b20; }
.post-content pre .typ { color: #e69f00; }
.post-content pre .com { color: #718096; font-style: italic; }
.post-content pre .str { color: #38a169; }
.post-content pre .clo, .post-content pre .opn, .post-content pre .atn { color: #718096; }

/* 上一篇/下一篇 */
.post-nav-row { display: flex; gap: 15px; margin-bottom: 25px; }
.post-nav-card {
    flex: 1; background: #fff; border-radius: 14px; padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.03); text-decoration: none;
    transition: all 0.2s; display: flex; align-items: center; gap: 12px;
    color: #334155;
}
.post-nav-card:hover { box-shadow: 0 6px 16px rgba(0,0,0,0.08); transform: translateY(-1px); }
.post-nav-card.prev { justify-content: flex-start; }
.post-nav-card.next { justify-content: flex-end; text-align: right; }
.post-nav-card .nav-icon { font-size: 1.6rem; flex-shrink: 0; }
.post-nav-card .nav-text { line-height: 1.4; }
.post-nav-card .nav-label { font-size: 0.72rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; }
.post-nav-card .nav-title { font-weight: 600; font-size: 0.9rem; }
.post-nav-card.empty { opacity: 0.5; pointer-events: none; }

/* 彩色箭头 */
.nav-arrow-left { color: #f59e0b; }
.nav-arrow-right { color: #10b981; }

/* 相关文章 */
.related-posts-card {
    background: #fff; border-radius: 20px; padding: 25px 28px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.related-posts-card h4 { margin: 0 0 18px; color: #1e293b; font-weight: 700; }
.related-list { list-style: none; padding: 0; margin: 0; }
.related-list li { margin-bottom: 12px; }
.related-list li:last-child { margin-bottom: 0; }
.related-list a {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px; border-radius: 10px; background: #f8fafc;
    color: #334155; text-decoration: none; transition: all 0.2s;
}
.related-list a:hover { background: #eef2ff; color: #0d6efd; }
.related-list .related-date { font-size: 0.8rem; color: #94a3b8; white-space: nowrap; margin-left: 15px; }

/* 跳动火焰图标 */
.icon-fire {
    color: #ef4444;
    animation: bounce 1s infinite;
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* 分页 */
.pagination-custom { display:flex; justify-content:center; align-items:center; gap:8px; margin-top:40px; flex-wrap:wrap; }
.pagination-custom a, .pagination-custom strong {
    display:inline-flex; align-items:center; justify-content:center;
    min-width:40px; height:40px; padding:0 12px; border-radius:12px;
    background:#fff; color:#334155; text-decoration:none;
    font-weight:600; box-shadow:0 2px 8px rgba(0,0,0,0.04); transition:all 0.2s;
}
.pagination-custom strong { background:#1e466e; color:#fff; box-shadow:0 6px 14px rgba(30,70,110,0.3); }
.pagination-custom a:hover { background:#f1f5f9; box-shadow:0 4px 12px rgba(0,0,0,0.08); transform:translateY(-1px); }
.pagination-custom .disabled { opacity:0.4; pointer-events:none; box-shadow:none; }
.post-detail-full { max-width:100%; }

/* 图片自适应 */
.post-content * { max-width: 100% !important; box-sizing: border-box; }
.post-content img {
    display: block; height: auto !important;
    margin-left: auto; margin-right: auto;
    cursor: pointer; border-radius: 8px;
    transition: opacity 0.2s;
}
.post-content img:hover { opacity: 0.9; }

/* 图片说明文字 */
.img-caption {
    text-align: center;
    font-size: 0.82rem;
    color: #6b7280;
    margin-top: 6px;
    line-height: 1.4;
    max-width: 100%;
}

/* 灯箱 */
.lightbox-overlay {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 99999;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.lightbox-overlay img {
    max-width: 90%; max-height: 90%;
    border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    cursor: default;
}
.lightbox-close {
    position: absolute; top: 25px; right: 35px;
    font-size: 48px; color: #fff;
    cursor: pointer; opacity: 0.9;
    line-height: 1; user-select: none;
    transition: opacity 0.2s;
}
.lightbox-close:hover { opacity: 1; }

@media (max-width:768px) {
    .blog-container { flex-direction:column; }
    .blog-sidebar { width:100%; }
    .post-card { padding:20px 16px; }
    .post-nav-row { flex-direction: column; }
    .blog-page-wrapper { padding:0 10px; }
}

/* 广告卡片 HOT 闪烁 */
.hot-badge {
    display: inline-block;
    background: #ff4d4f;
    color: #fff;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 4px;
    margin-right: 5px;
    animation: blink 1s infinite;
    vertical-align: middle;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* 网站统计列表 */
.stats-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.stats-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px dashed #e9ecef;
    font-size: 0.85rem;
    color: #495057;
}
.stats-list li:last-child {
    border-bottom: none;
}
.stats-value {
    font-weight: 600;
    color: #1e466e;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
}

/* 友情链接列表 */
.links-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.links-list li {
    margin-bottom: 8px;
}
.links-list li:last-child {
    margin-bottom: 0;
}
.links-list a {
    display: flex;
    align-items: center;
    color: #334155;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 5px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}
.links-list a:hover {
    background: #f1f5f9;
    color: #0d6efd;
}

/* ========== 终极图片居中 ========== */
.post-content .wp-caption,
.post-content .wp-block-image,
.post-content .alignleft,
.post-content .alignright,
.post-content .aligncenter,
.post-content .alignnone {
    float: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
    text-align: center !important;
}
.post-content img.alignleft,
.post-content img.alignright,
.post-content img.aligncenter,
.post-content img.alignnone {
    float: none !important;
    margin: 0 auto !important;
    display: block !important;
}
/* 如果图片被链接包裹，确保链接不会干扰居中 */
.post-content a:has(> img) {
    display: block;
    text-align: center;
}
/* 对于不支持 :has() 的浏览器，使用通用规则 */
.post-content a {
    display: inline-block;
}
.post-content a > img {
    display: block;
    margin: 0 auto;
}