/* ==========================================================================
   onpaperclub — base.css
   基础重置 + 通用工具类 + 设计令牌（Design Tokens）
   设计基调：暖纸色 + 墨绿 + 手写感细节，追求"有人味"的阅读体验
   ========================================================================== */

/* ---------------- 重置 ---------------- */
html,
body,
div,
ul,
ol,
li,
dl,
dt,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
p,
img,
span,
i,
a,
em,
strong,
b,
input,
textarea,
select {
	margin: 0;
	padding: 0;
}

i,
em {
	font-weight: normal;
	font-style: normal;
}

html,
body {
	height: 100%;
}

html {
	font-size: 16px;
	scroll-behavior: smooth;
}

body {
	width: 100%;
	position: relative;
	font-family: Georgia, "Times New Roman", "Songti SC", SimSun, serif;
	font-size: 16px;
	line-height: 1.7;
	color: var(--ink-700);
	background-color: var(--paper-50);
	/* 纸张纹理：极淡的斜向纤维感 */
	background-image:
		repeating-linear-gradient(45deg, rgba(140, 120, 90, 0.012) 0 2px, transparent 2px 6px),
		repeating-linear-gradient(-45deg, rgba(140, 120, 90, 0.01) 0 2px, transparent 2px 6px);
	display: flex;
	flex-direction: column;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

#pc {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

#pc > main {
	flex: 1;
}

li {
	list-style: none;
}

a,
img,
input {
	border: 0 none;
}

a {
	text-decoration: none;
	outline: none;
	display: block;
	color: inherit;
}

a:hover {
	text-decoration: none;
}

a:focus,
input:focus {
	outline: 0 none;
}

textarea {
	resize: none;
	font-size: 14px;
}

img {
	border: 0;
	vertical-align: middle;
	max-width: 100%;
}

button {
	cursor: pointer;
	border: none;
	background: none;
	font-family: inherit;
}

* {
	box-sizing: border-box;
}

/* ---------------- 设计令牌 ---------------- */
:root {
	/* 纸张色阶 */
	--paper-50: #faf7f0;
	--paper-100: #f5f0e5;
	--paper-200: #ece4d4;
	--paper-300: #ddd1bb;
	--paper-400: #c8b89c;

	/* 墨色阶 */
	--ink-900: #1c1a16;
	--ink-800: #2b2823;
	--ink-700: #3d382f;
	--ink-600: #565043;
	--ink-500: #756d5d;
	--ink-400: #9a9182;
	--ink-300: #bdb4a4;

	/* 主色：温润墨绿 */
	--accent-700: #2f5d50;
	--accent-600: #3a7161;
	--accent-500: #4a8a76;
	--accent-100: #e3ede8;

	/* 强调色：赭石 */
	--clay-600: #b4622c;
	--clay-500: #c9743a;
	--clay-100: #f7e9dc;

	/* 语义色 */
	--line: #e2d9c7;
	--line-soft: #efe8d9;

	/* 排版
	 *
	 * 字体栈顺序原则：把「带全套西文标点字形」的字体排在前面，
	 * 避免回退到最后兜底字体后，’ “ ” — 等标点被渲染成方块（tofu）。
	 *
	 * 经逐字形实测（scripts/check-glyphs2.js）：
	 *   无字形（渲染成方块）：Inter / Helvetica Neue / Microsoft YaHei /
	 *                        PingFang SC / Caveat / Kaiti SC / STKaiti
	 *   字形完整：Georgia / Times New Roman / Arial / Segoe UI / Verdana /
	 *            Tahoma / Palatino Linotype / Segoe Script
	 *
	 * 所以：serif 用 Georgia 打底，sans 用 Segoe UI 打底，
	 * 手写体优先用 Segoe Script（Windows 自带），再考虑自托管 webfont。
	 */
	--font-serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", "Songti SC", SimSun, serif;
	--font-sans: "Segoe UI", Inter, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
	--font-hand: "Segoe Script", "Bradley Hand", "Kaiti SC", "STKaiti", "Comic Sans MS", cursive;

	/* 阴影：柔和、有纸感 */
	--shadow-sm: 0 1px 2px rgba(60, 48, 30, 0.05);
	--shadow-md: 0 4px 14px rgba(60, 48, 30, 0.08);
	--shadow-lg: 0 12px 34px rgba(60, 48, 30, 0.11);

	/* 圆角 */
	--r-sm: 6px;
	--r-md: 10px;
	--r-lg: 16px;
	--r-xl: 24px;

	/* 容器宽度 */
	--w-max: 1280px;
	--w-content: 1180px;
	--w-read: 720px;
}

/* ---------------- 布局工具 ---------------- */
.w1280 {
	width: 1280px;
	margin: 0 auto;
}

.w1180 {
	width: 1180px;
	margin: 0 auto;
}

.w720 {
	width: 720px;
	margin: 0 auto;
}

@media screen and (max-width: 1320px) {
	.w1280,
	.w1180 {
		width: calc(100% - 48px);
	}
}

@media screen and (max-width: 768px) {
	.w1280,
	.w1180 {
		width: calc(100% - 32px);
	}
}

/* ---------------- 文字工具 ---------------- */
.f13 { font-size: 13px; }
.f14 { font-size: 14px; }
.f15 { font-size: 15px; }
.f16 { font-size: 16px; }
.f18 { font-size: 18px; }
.f20 { font-size: 20px; }

.f-bold { font-weight: 700; }
.f-medium { font-weight: 600; }
.f-light { font-weight: 300; }

.f-sans { font-family: var(--font-sans); }
.f-hand { font-family: var(--font-hand); }

.c-accent { color: var(--accent-600); }
.c-clay { color: var(--clay-600); }
.c-mute { color: var(--ink-500); }
.c-faint { color: var(--ink-400); }

/* ---------------- 通用块 ---------------- */
.hide { display: none; }
.fl { float: left; }
.fr { float: right; }

.clearfix:after {
	content: " ";
	display: block;
	clear: both;
	height: 0;
}

.clearfix { zoom: 1; }

[v-cloak] { display: none !important; }

/* 屏幕阅读器专用 */
.sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* 分隔线（手绘感：两段粗细不同） */
.rule-hand {
	height: 2px;
	border: none;
	background: linear-gradient(to right, var(--accent-500) 0 38%, var(--line) 38% 100%);
	border-radius: 2px;
}

/* 小标签 */
.tag-line {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--font-sans);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--accent-600);
}

.tag-line::before {
	content: "";
	width: 18px;
	height: 1px;
	background: var(--accent-500);
}

/* 阅读进度条 */
#read-progress {
	position: fixed;
	top: 0;
	left: 0;
	height: 3px;
	width: 0;
	background: linear-gradient(90deg, var(--accent-500), var(--clay-500));
	z-index: 999;
	transition: width 0.1s linear;
}

/* 回到顶部 */
#back-top {
	position: fixed;
	right: 28px;
	bottom: 28px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--ink-800);
	color: var(--paper-100);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: all 0.25s ease;
	z-index: 900;
	box-shadow: var(--shadow-md);
}

#back-top.show {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

#back-top:hover {
	background: var(--accent-600);
	transform: translateY(-3px);
}
