/*
 * 基于 stagit 自带的 style.css，博客和 git 页面共用这一份。
 * 上半部分基本保持 stagit 原样，下半部分是博客额外需要的样式。
 */

body {
	color: #000;
	background-color: #fff;
	font-family: monospace;
	font-size: 14px;
	max-width: 880px;
	margin: 0 auto;
	padding: 16px;
}

h1, h2, h3, h4, h5, h6 {
	font-size: 1em;
	margin: 0;
}

img, h1, h2 {
	vertical-align: middle;
}

img {
	border: 0;
}

a:target {
	background-color: #ccc;
}

a.d,
a.h,
a.i,
a.line {
	text-decoration: none;
}

#blob a {
	color: #555;
}

#blob a:hover {
	color: blue;
	text-decoration: none;
}

table thead td {
	font-weight: bold;
}

table td {
	padding: 0 0.4em;
}

#content {
	overflow-x: auto;
}

#content table td {
	vertical-align: top;
	white-space: nowrap;
}

#branches tr:hover td,
#tags tr:hover td,
#index tr:hover td,
#log tr:hover td,
#files tr:hover td,
#posts tr:hover td {
	background-color: #eee;
}

#index tr td:nth-child(2),
#tags tr td:nth-child(3),
#branches tr td:nth-child(3),
#log tr td:nth-child(2),
#posts tr td:nth-child(2) {
	white-space: normal;
}

td.num {
	text-align: right;
}

.desc {
	color: #555;
}

hr {
	border: 0;
	border-top: 1px solid #555;
	height: 1px;
}

pre {
	font-family: monospace;
	tab-size: 4;
}

pre a.h {
	color: #00a;
}

.A,
span.i,
pre a.i {
	color: #070;
}

.D,
span.d,
pre a.d {
	color: #e00;
}

pre a.h:hover,
pre a.i:hover,
pre a.d:hover {
	text-decoration: none;
}

/* ---- 以下是博客部分 ---- */

img.avatar {
	display: block;
	filter: grayscale(1);
}

#head td {
	vertical-align: middle;
}

#head td:first-child {
	padding-left: 0;
	padding-right: 1ch;
}

#head h1 {
	font-size: 1.3em;
	letter-spacing: 0.05em;
}

#cols {
	display: flex;
	gap: 4ch;
	align-items: flex-start;
}

#main {
	flex: 1;
	min-width: 0;
}

#side {
	flex: none;
	width: 34ch;
	line-height: 1.5;
}

#side section + section {
	margin-top: 1.4em;
}

#main h2,
#side h2 {
	border-bottom: 1px dotted #555;
	margin-bottom: 0.4em;
}

#side p {
	margin: 0;
}

#posts td:first-child {
	padding-left: 0;
}

#side table {
	border-collapse: collapse;
}

#side table td:first-child {
	padding-left: 0;
}

#side #recent td:last-child,
#side table td:last-child {
	white-space: normal;
}

.meta {
	margin: 0;
}

.post {
	max-width: 80ch;
	line-height: 1.6;
}

.post h2,
.post h3 {
	margin: 1.6em 0 0.4em;
}

.post h2::before {
	content: "## ";
	color: #555;
}

.post h3::before {
	content: "### ";
	color: #555;
}

.post pre {
	margin: 1em 0 1em 2ch;
	line-height: 1.4;
	overflow-x: auto;
}

.post p code,
.post li code {
	background-color: #eee;
	padding: 0 0.2em;
}

.post blockquote {
	margin: 1em 0;
	padding-left: 2ch;
	border-left: 1px solid #555;
	color: #555;
}

.post ul,
.post ol {
	padding-left: 3ch;
}

#footer {
	color: #555;
}

@media (max-width: 720px) {
	#cols {
		flex-direction: column;
	}
	#side {
		width: auto;
	}
}

@media (max-width: 600px) {
	#posts td:nth-child(3) {
		display: none;
	}
}

@media (prefers-color-scheme: dark) {
	body {
		background-color: #000;
		color: #bdbdbd;
	}
	hr {
		border-color: #222;
	}
	a {
		color: #56c8ff;
	}
	a:target {
		background-color: #222;
	}
	.desc,
	#footer,
	.post blockquote,
	.post h2::before,
	.post h3::before {
		color: #888;
	}
	#blob a {
		color: #555;
	}
	#blob a:target {
		color: #eee;
	}
	#blob a:hover {
		color: #56c8ff;
	}
	pre a.h {
		color: #00cdcd;
	}
	.A,
	span.i,
	pre a.i {
		color: #00cd00;
	}
	.D,
	span.d,
	pre a.d {
		color: #cd0000;
	}
	#branches tr:hover td,
	#tags tr:hover td,
	#index tr:hover td,
	#log tr:hover td,
	#files tr:hover td,
	#posts tr:hover td,
	.post p code,
	.post li code {
		background-color: #111;
	}
	.post blockquote {
		border-color: #444;
	}
}
