/* Theme Name: Puock Child Template: wordpress-theme-puock Version: 1.0.0 Description: Puock 子主题 - 宋体正文 + 黑体标题 阅读优化,适配暗色模式 (代码块自动黑白切换) */ /* ============================================ 字体引入(霞鹜文楷,国内 BootCDN 镜像) font-display:swap 不阻塞页面渲染 ============================================ */ @import url('https://cdn.bootcdn.net/ajax/libs/lxgw-wenkai-webfont/1.7.0/style.css'); /* ========================================================= 一、全局基础字体 ========================================================= */ body { font-family: "LXGW WenKai", "SimSun", "宋体", "Noto Serif SC", Georgia, serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; } /* ========================================================= 二、正文排版(宋体风格 + 昼夜适配) ========================================================= */ #post .entry-content, #page .entry-content, .entry-content-box { font-family: "LXGW WenKai", "SimSun", "宋体", Georgia, serif !important; font-size: 17px !important; line-height: 1.9 !important; color: #222; } #post .entry-content p, #page .entry-content p { margin: 14px 0 !important; line-height: 1.9; letter-spacing: 0.02em; } /* ========================================================= 三、页眉 & 菜单(强制微软雅黑 - 全面覆盖所有层级) ========================================================= */ .site-header, .pk-header, #site-header, .main-navigation, #site-navigation, .nav-menu, .pk-nav-menu, .pk-mobile-menu, .navbar, .dropdown-menu, .sub-menu, .menu-item, .pk-header a, .main-navigation a, .nav-menu a, .site-header a, .navbar a, .dropdown-menu a, .sub-menu a, .pk-mobile-menu li a, .pk-nav-menu ul li a, .main-navigation ul li a, .pk-header .menu-item a, .nav-menu .current-menu-item a { font-family: "Microsoft YaHei", "SimHei", "PingFang SC", "Helvetica Neue", sans-serif !important; font-weight: 500 !important; } /* ========================================================= 四、文章标题(黑体/无衬线) ========================================================= */ h1, h2, h3, h4, h5, h6, #post-title, .page-title, .pk-posts-item .post-title, .pk-related-item .post-title, .widget-title, .sidebar .widget h2, .sidebar .widget h3 { font-family: "Microsoft YaHei", "SimHei", "PingFang SC", "Noto Sans CJK SC", sans-serif !important; font-weight: bold !important; color: #1a1a1a; line-height: 1.4; } /* 正文内标题间距优化 */ #post .entry-content h1, #post .entry-content h2, #post .entry-content h3, #post .entry-content h4, #post .entry-content h5, #post .entry-content h6, #page .entry-content h1, #page .entry-content h2, #page .entry-content h3, #page .entry-content h4, #page .entry-content h5, #page .entry-content h6 { margin: 28px 0 12px; letter-spacing: -0.01em; } /* ========================================================= 五、小字/备注/文章摘要 ========================================================= */ .post-meta, .entry-meta, .pk-post-meta, .excerpt, .post-excerpt, .description { font-family: "SimSun", "宋体", serif !important; font-size: 15px !important; color: #666; } /* ========================================================= 六、代码块 & 语法高亮(日间模式 · GitHub 浅色风格) ========================================================= */ /* 整块代码容器 */ #post .entry-content pre, #page .entry-content pre { background: #f6f8fa !important; border: 1px solid #e5e7eb !important; border-radius: 8px !important; padding: 18px 22px !important; overflow-x: auto !important; font-family: "JetBrains Mono", "Consolas", "Courier New", monospace !important; color: #24292f !important; font-size: 14px !important; line-height: 1.75 !important; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important; } #post .entry-content pre code, #page .entry-content pre code { font-family: inherit !important; color: #24292f !important; background: transparent !important; padding: 0 !important; border: none !important; font-size: inherit !important; } /* 行内代码 */ #post .entry-content code:not([class]), #page .entry-content code:not([class]) { font-family: "JetBrains Mono", "Consolas", "Courier New", monospace !important; background: #eff2f7 !important; border: 1px solid #e5e7eb !important; border-radius: 4px !important; padding: 0.2em 0.5em !important; color: #0969da !important; font-size: 13px !important; } /* 修复行高亮白条:统一柔和行背景 */ #post .entry-content pre .line, #page .entry-content pre .line, #post .entry-content pre .line-highlight, #page .entry-content pre .line-highlight { background: transparent !important; background-color: transparent !important; box-shadow: none !important; } #post .entry-content pre .line-highlight, #page .entry-content pre .line-highlight { background-color: rgba(0, 0, 0, 0.04) !important; } /* 行号区域:与代码块协调统一 */ #post .entry-content pre .line-numbers-rows, #page .entry-content pre .line-numbers-rows, #post .entry-content pre .line-numbers, #page .entry-content pre .line-numbers { background-color: #f6f8fa !important; border-right: 1px solid #e5e7eb !important; color: #9aa0a6 !important; } #post .entry-content pre .line-numbers-rows > span:before, #page .entry-content pre .line-numbers-rows > span:before { color: #9aa0a6 !important; } /* 语法高亮 · 日间 GitHub 标准配色 */ #post .entry-content pre .token.keyword, #page .entry-content pre .token.keyword { color: #cf222e !important; } #post .entry-content pre .token.string, #page .entry-content pre .token.string { color: #0a3069 !important; } #post .entry-content pre .token.function, #page .entry-content pre .token.function { color: #8250df !important; } #post .entry-content pre .token.number, #page .entry-content pre .token.number { color: #0550ae !important; } #post .entry-content pre .token.comment, #page .entry-content pre .token.comment { color: #6e7781 !important; font-style: italic !important; } #post .entry-content pre .token.property, #page .entry-content pre .token.property, #post .entry-content pre .token.tag, #page .entry-content pre .token.tag { color: #116329 !important; } #post .entry-content pre .token.operator, #page .entry-content pre .token.operator { color: #cf222e !important; } #post .entry-content pre .token.punctuation, #page .entry-content pre .token.punctuation { color: #24292f !important; } /* ========================================================= 七、CSDN 风格 - 引用块(左侧亮蓝边 + 淡蓝底) ========================================================= */ #post .entry-content blockquote, #page .entry-content blockquote { background: #f4f8ff !important; border-left: 4px solid #1e80ff !important; padding: 12px 24px !important; margin: 20px 0 !important; color: #333333 !important; border-radius: 0 4px 4px 0 !important; font-style: normal !important; font-size: 15px !important; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02) !important; } #post .entry-content blockquote p, #page .entry-content blockquote p { margin: 8px 0 !important; color: #333333 !important; } #post .entry-content blockquote cite, #page .entry-content blockquote cite { color: #666666 !important; font-size: 13px !important; } /* ========================================================= 八、文章列表缩略图(自适应修复) ========================================================= */ .pk-posts-item .post-thumbnail a img, .pk-related-item .post-thumbnail img { width: 100% !important; height: auto !important; object-fit: cover !important; border-radius: 6px !important; } /* ========================================================= 九、右侧边栏作者栏(微软雅黑) ========================================================= */ .theiaStickySidebar, .theiaStickySidebar .widget, .theiaStickySidebar .author-card, .theiaStickySidebar .author-info__name, .theiaStickySidebar .author-info__description, .theiaStickySidebar .site-data { font-family: "Microsoft YaHei", "SimHei", sans-serif !important; } .theiaStickySidebar .author-info__name { font-weight: bold !important; } /* ========================================================= 十、进阶排版优化(表格 / 图片 / 分隔线) ========================================================= */ /* 表格 */ #post .entry-content table, #page .entry-content table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 14px; border-radius: 6px; overflow: hidden; } #post .entry-content table th, #page .entry-content table th { background-color: var(--pk-c-primary) !important; color: #fff !important; padding: 10px 14px; font-weight: 600; text-align: left; font-family: "Microsoft YaHei", sans-serif; } #post .entry-content table td, #page .entry-content table td { padding: 9px 14px; border-bottom: 1px solid var(--pk-c-border); color: var(--pk-c-font); background-color: transparent; } #post .entry-content table tr:last-child td, #page .entry-content table tr:last-child td { border-bottom: none; } #post .entry-content table tr:nth-child(even) td, #page .entry-content table tr:nth-child(even) td { background-color: var(--pk-bg-box-content); } /* 分隔线 */ #post .entry-content hr, #page .entry-content hr { border: none; border-top: 1px solid var(--pk-c-border); margin: 30px 0; } /* 图片 */ #post .entry-content img:not(.wp-smiley), #page .entry-content img:not(.wp-smiley) { border-radius: 6px; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1); } /* ========================================================= 十一、暗色模式完整修复 ========================================================= */ /* 修复内联硬编码黑色文字 */ body.puock-dark [style*="color:#000"], body.puock-dark [style*="color: #000"], body.puock-dark [style*="color:black"], body.puock-dark [style*="color: black"], body.puock-dark [style*="color:#333"], body.puock-dark [style*="color: #333"], body.puock-dark [style*="color:#222"], body.puock-dark [style*="color: #222"], body.puock-dark [style*="color:#111"], body.puock-dark [style*="color:#1e1e1e"], body.puock-dark [style*="color:#2c2c2c"] { color: var(--pk-c-font) !important; } /* 修复内联硬编码白色背景 */ body.puock-dark [style*="background-color:#fff"], body.puock-dark [style*="background-color: #fff"], body.puock-dark [style*="background-color:white"], body.puock-dark [style*="background-color: white"], body.puock-dark [style*="background:#fff"], body.puock-dark [style*="background: #fff"] { background-color: var(--pk-bg-box) !important; } /* 正文文字 */ body.puock-dark #post .entry-content, body.puock-dark #page .entry-content, body.puock-dark .entry-content-box { color: #d8d6d6; } /* 标题 */ body.puock-dark #post .entry-content h1, body.puock-dark #post .entry-content h2, body.puock-dark #post .entry-content h3, body.puock-dark #post .entry-content h4, body.puock-dark #post .entry-content h5, body.puock-dark #post .entry-content h6, body.puock-dark #page .entry-content h1, body.puock-dark #page .entry-content h2, body.puock-dark #page .entry-content h3, body.puock-dark #page .entry-content h4, body.puock-dark #page .entry-content h5, body.puock-dark #page .entry-content h6, body.puock-dark #post-title { color: #f0eeee !important; } /* 表格暗色 */ body.puock-dark #post .entry-content table, body.puock-dark #page .entry-content table { background-color: var(--pk-bg-box) !important; } body.puock-dark #post .entry-content table td, body.puock-dark #page .entry-content table td { color: var(--pk-c-font) !important; border-color: var(--pk-c-border) !important; } body.puock-dark #post .entry-content table tr:nth-child(even) td, body.puock-dark #page .entry-content table tr:nth-child(even) td { background-color: rgba(255, 255, 255, 0.04) !important; } /* ---------- 代码块 & 语法高亮 · 暗色模式(One Dark 风格) ---------- */ body.puock-dark #post .entry-content pre, body.puock-dark #page .entry-content pre { background: #282c34 !important; border-color: #3e4451 !important; color: #abb2bf !important; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2) !important; } body.puock-dark #post .entry-content pre code, body.puock-dark #page .entry-content pre code { color: #abb2bf !important; } /* 行内代码 · 暗色 */ body.puock-dark #post .entry-content code:not([class]), body.puock-dark #page .entry-content code:not([class]) { background: #2c313a !important; border-color: #3e4451 !important; color: #61afef !important; } /* 行高亮 · 暗色 */ body.puock-dark #post .entry-content pre .line, body.puock-dark #page .entry-content pre .line, body.puock-dark #post .entry-content pre .line-highlight, body.puock-dark #page .entry-content pre .line-highlight { background: transparent !important; } body.puock-dark #post .entry-content pre .line-highlight, body.puock-dark #page .entry-content pre .line-highlight { background-color: rgba(255, 255, 255, 0.06) !important; } /* 行号 · 暗色 */ body.puock-dark #post .entry-content pre .line-numbers-rows, body.puock-dark #page .entry-content pre .line-numbers-rows, body.puock-dark #post .entry-content pre .line-numbers, body.puock-dark #page .entry-content pre .line-numbers { background-color: #282c34 !important; border-right: 1px solid #3e4451 !important; color: #5c6370 !important; } body.puock-dark #post .entry-content pre .line-numbers-rows > span:before, body.puock-dark #page .entry-content pre .line-numbers-rows > span:before { color: #5c6370 !important; } /* 语法高亮 · 暗色 One Dark 标准配色 */ body.puock-dark #post .entry-content pre .token.keyword, body.puock-dark #page .entry-content pre .token.keyword { color: #c678dd !important; } body.puock-dark #post .entry-content pre .token.string, body.puock-dark #page .entry-content pre .token.string { color: #98c379 !important; } body.puock-dark #post .entry-content pre .token.function, body.puock-dark #page .entry-content pre .token.function { color: #61afef !important; } body.puock-dark #post .entry-content pre .token.number, body.puock-dark #page .entry-content pre .token.number { color: #d19a66 !important; } body.puock-dark #post .entry-content pre .token.comment, body.puock-dark #page .entry-content pre .token.comment { color: #5c6370 !important; font-style: italic !important; } body.puock-dark #post .entry-content pre .token.property, body.puock-dark #page .entry-content pre .token.property, body.puock-dark #post .entry-content pre .token.tag, body.puock-dark #page .entry-content pre .token.tag { color: #e06c75 !important; } body.puock-dark #post .entry-content pre .token.operator, body.puock-dark #page .entry-content pre .token.operator { color: #56b6c2 !important; } body.puock-dark #post .entry-content pre .token.punctuation, body.puock-dark #page .entry-content pre .token.punctuation { color: #abb2bf !important; } /* CSDN 引用块 - 暗色适配 */ body.puock-dark #post .entry-content blockquote, body.puock-dark #page .entry-content blockquote { background: #0d1117 !important; border-left-color: #58a6ff !important; color: #e6e6e6 !important; } body.puock-dark #post .entry-content blockquote p, body.puock-dark #page .entry-content blockquote p { color: #e6e6e6 !important; } body.puock-dark #post .entry-content blockquote cite, body.puock-dark #page .entry-content blockquote cite { color: #8b949e !important; } /* 图片暗化 */ body.puock-dark #post .entry-content img:not(.wp-smiley), body.puock-dark #page .entry-content img:not(.wp-smiley) { opacity: 0.88; box-shadow: 0 2px 16px rgba(0, 0, 0, 0.45); } /* 评论区 & 输入框暗色 */ body.puock-dark .comment-content p { color: var(--pk-c-font) !important; } body.puock-dark input, body.puock-dark textarea, body.puock-dark select { color: var(--pk-c-font) !important; background-color: var(--pk-c-input-bg) !important; border-color: var(--pk-c-border) !important; } https://lifetruth.top/wp-sitemap-posts-post-1.xmlhttps://lifetruth.top/wp-sitemap-posts-page-1.xmlhttps://lifetruth.top/wp-sitemap-posts-moments-1.xmlhttps://lifetruth.top/wp-sitemap-taxonomies-category-1.xmlhttps://lifetruth.top/wp-sitemap-taxonomies-post_tag-1.xml