@font-face {
	font-family: lxgw;
	src: local(霞鹜文楷), url(/tdyww/fonts/LXGWWenKai-Regular.ttf);
}

@font-face {
	font-family: lxgw-marker;
	src: local(霞鹜漫黑), url(/tdyww/fonts/LXGWMarkerGothic-Regular.ttf);
}

@font-face {
	font-family: josefin;
	src: local(Josefin Sans), url(/tdyww/fonts/JosefinSans-VariableFont_wght.ttf);
}

:root {
	--font-size: clamp(1rem, 0.8929rem + 0.5357vw, 1.375rem);
	--font-size-h1: calc(var(--font-size) * 1.8);
	--font-size-h2: calc(var(--font-size) * 1.6);
	--font-size-h3: calc(var(--font-size) * 1.3);
	--font-size-h4: calc(var(--font-size) * 1.2);
	--font-size-small: calc(var(--font-size) * 0.8);
	--text: #222;
	--bg: #fff;
	--c: #555;
}

* {
	box-sizing: border-box;
}

body {
	background-color: var(--bg);
	color: var(--text);
	font-size: var(--font-size);
	font-family: josefin, lxgw;
	line-height: 2;
}

h1,
h2,
h3,
h4 {
	color: var(--text);
	line-height: 2;
	font-family: josefin, lxgw-marker;
	margin-bottom: .5em;
	margin-top: 1em;
}

h1 {
	font-size: var(--font-size-h1);
}

h2 {
	font-size: var(--font-size-h2);
	border-bottom: .2em solid;
}

h3 {
	font-size: var(--font-size-h3);
}

h4 {
	font-size: var(--font-size-h4);
}

a,
a:visited {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: var(--c);
	text-decoration-thickness: .2em;
	text-underline-offset: .3em;
	text-decoration-skip-ink: none;
	transition: all .2s;

	&:hover {
		color: var(--c);
		text-underline-offset: .2em;
	}
}

header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	flex-wrap: wrap;
	padding: 0 2em;

	h1 {
		border-bottom: 0;
	}

	nav {
		display: flex;
		gap: 1em;
		flex-wrap: wrap;
	}
}

main {
	max-width: 860px;
	margin: auto;
	padding: 0 2em;

	img {
		max-width: 100%;
	}
}

footer {
	text-align: center;
	padding: 1em 0;
}

#toc {
	position: fixed;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column-reverse;
	align-items: flex-end;
	gap: 1em;
	max-width: 100%;
	max-height: 100%;
	padding: 2em 1em;
	z-index: 999;

	#toc-toggle {
		display: none;
	}

	label[for="toc-toggle"] {
		border: 0;
		background-color: var(--c);
		color: var(--bg);
		padding: 1em;
		border-radius: 999px;
		cursor: pointer;
		transition: box-shadow .2s;
		user-select: none;
	}

	#toc-content {
		background-color: var(--bg);
		border: .3em solid var(--c);
		border-radius: 1em;
		padding: .5em;
		overflow-y: auto;
		display: none;
		width: 24em;
		max-width: 100%;
	}

	#toc-toggle:checked~label {
		box-shadow: 0 0 1em var(--c);
	}

	#toc-toggle:checked~#toc-content {
		display: block;
	}
}

h2 .en {
	font-size: var(--font-size-h3);
	opacity: .7;
}

blockquote {
	border-left: 4px solid var(--c);
	padding-left: 1em;
}