人民日报数据爬虫第三版
/* ===================================================
- Retypeset 官方原生高度还原版 - Bear Blog 适配
- 深度修复:段落排版、长链接/英文自然换行与文字对齐
- =================================================== */
/* 1. 全局变量与配色 / :root { --bg-color: #fbf9f5; / Retypeset 官方暖纸底色 / --text-color: #1c1917; / 墨黑正文字色 / --muted-color: #78716c; / 暖灰色 (次要文本/时间/边框) / --border-color: #e7e5e4; / 经典淡暖灰分割线 / --link-color: #2563eb; / 复古钢笔墨蓝色链接 / --highlight-color: #fef08a; / 选中的“荧光黄”高亮底色 */ --highlight-text: #1c1917;
/* 官方字体栈 */
--font-serif: "Georgia", "Source Serif Pro", "Noto Serif SC", "Songti SC", "SimSun", serif;
--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
--max-width: 680px;
}
/* 夜间模式 */
@media (prefers-color-scheme: dark) {
:root {
--bg-color: #1c1917;
--text-color: #e7e5e4;
--muted-color: #a8a29e;
--border-color: #292524;
--link-color: #60a5fa;
--highlight-color: #854d0e;
--highlight-text: #fef08a;
}
}
/* 2. 基础布局与印刷纸张质感 */ body { background-color: var(--bg-color); color: var(--text-color); font-family: var(--font-serif); font-size: 1.05rem; line-height: 1.8; max-width: var(--max-width); margin: 0 auto; padding: 2.5rem 1.2rem; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
/* 3. 头部导航栏 */ header { border-bottom: 1px solid var(--border-color); padding-bottom: 1.2rem; margin-bottom: 2.8rem; display: flex; justify-content: space-between; align-items: baseline; }
header a { font-family: var(--font-sans); color: var(--text-color); text-decoration: none; font-weight: 500; font-size: 0.95rem; padding: 0.15rem 0.35rem; border-radius: 2px; transition: all 0.2s ease; }
header a.title { font-family: var(--font-serif); font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; padding: 0; background: none !important; }
header nav a { margin-left: 0.8rem; color: var(--muted-color); }
header nav a:hover { color: var(--text-color); background-color: rgba(254, 240, 138, 0.4); }
header nav a[aria-current="page"], header nav a.active, header nav a[aria-current="true"] { color: var(--highlight-text) !important; background-color: var(--highlight-color) !important; font-weight: 600; }
/* 4. 标题与文章元信息 */ h1, h2, h3, h4 { font-family: var(--font-serif); color: var(--text-color); line-height: 1.35; margin-top: 2.2rem; margin-bottom: 0.8rem; font-weight: 600; }
h1 { font-size: 1.85rem; letter-spacing: -0.02em; }
/* 5. 首页文章列表格式化 */ main ul { list-style: none !important; padding: 0 !important; margin: 0 !important; }
main ul li { margin-bottom: 1.2rem !important; padding-bottom: 0 !important; border-bottom: none !important; display: flex !important; flex-direction: row !important; justify-content: space-between !important; align-items: baseline !important; gap: 1rem !important; }
main ul li a { order: 1 !important; font-size: 1.05rem; font-weight: 400 !important; text-decoration: none; color: var(--text-color); line-height: 1.4 !important; transition: opacity 0.2s; flex-grow: 1; }
main ul li a:hover { opacity: 0.6; }
main ul li time, main ul li .date, main ul li small, main ul li span { order: 2 !important; font-family: var(--font-sans); font-size: 0.85rem; color: var(--muted-color); line-height: 1.4 !important; white-space: nowrap !important; text-align: right !important; }
/* 6. 文章内页排版美化 & 换行/对齐彻底优化 */ p, article p, main p, .post p { margin-top: 0; margin-bottom: 1.25rem;
/* 🌟 核心修复:强制取消两端对齐,并允许长链接/单词自然断行 / text-align: left !important; text-justify: auto !important; overflow-wrap: anywhere !important; / 确保长文本/URL自然换行,不推挤周围文字 */ word-break: normal; }
p:empty { display: none; }
mark { background-color: var(--highlight-color); color: var(--highlight-text); padding: 0.1em 0.3em; border-radius: 2px; }
img { max-width: 100% !important; height: auto !important; display: block; margin: 2rem auto; border-radius: 4px; border: 1px solid var(--border-color); }
figcaption { text-align: center; font-size: 0.85rem; color: var(--muted-color); margin-top: -1.2rem; margin-bottom: 2rem; font-style: italic; }
hr { border: none; border-top: 1px solid var(--border-color); margin: 2.2rem auto; width: 30%; }
/* 正文链接排版 / a { color: var(--link-color); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; transition: opacity 0.2s ease; overflow-wrap: anywhere; / 防止超长 URL 撑破排版 */ }
a:hover { opacity: 0.7; }
blockquote { margin: 1.8rem 0; padding-left: 1.2rem; border-left: 2px solid var(--text-color); color: var(--muted-color); font-style: italic; }
pre, code { font-family: "ui-monospace", "Cascadia Code", "Source Code Pro", monospace; font-size: 0.88em; background-color: rgba(0, 0, 0, 0.035); border-radius: 4px; }
code { padding: 0.2em 0.4em; overflow-wrap: anywhere; }
pre { padding: 1rem; overflow-x: auto; border: 1px solid var(--border-color); }
pre code { padding: 0; background: none; }
/* 7. 页脚样式 */ footer { margin-top: 3.8rem; padding-top: 1.8rem; border-top: 1px solid var(--border-color); font-family: var(--font-sans); font-size: 0.85rem; color: var(--muted-color); text-align: center; }