:root {
	--theme-page-bg: #fff;
	--theme-surface: #fff;
	--theme-surface-muted: #f7f7f8;
	--theme-surface-strong: #eef1f4;
	--theme-text: #444;
	--theme-text-strong: #1f2937;
	--theme-text-muted: #667085;
	--theme-border: #e5e7eb;
	--theme-link: #3354aa;
	--theme-accent: #ff6b35;
	--theme-accent-soft: rgba(255, 107, 53, .1);
	--theme-shadow: rgba(15, 23, 42, .12);
}

html.theme-dark {
	--theme-page-bg: #111315;
	--theme-surface: #191c1f;
	--theme-surface-muted: #202428;
	--theme-surface-strong: #292e33;
	--theme-text: #d8dde3;
	--theme-text-strong: #f4f5f6;
	--theme-text-muted: #9ba3ad;
	--theme-border: #343a40;
	--theme-link: #ff9a62;
	--theme-accent: #ff7a45;
	--theme-accent-soft: rgba(255, 122, 69, .14);
	--theme-shadow: rgba(0, 0, 0, .35);
	--page-bg: var(--theme-page-bg);
	--card-bg: var(--theme-surface);
	--text-color: var(--theme-text);
	--border-color: var(--theme-border);
}

.theme-switcher {
	position: relative;
	float: right;
	height: 34px;
	margin: 3px 5px 0 0;
	line-height: 1;
	vertical-align: middle;
}

.theme-switcher__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 34px;
	height: 34px;
	padding: 0;
	color: var(--theme-text);
	background: transparent;
	border: 1px solid transparent;
	border-radius: 4px;
	line-height: 1;
	vertical-align: middle;
	cursor: pointer;
	transition:
		color .2s ease,
		background-color .2s ease,
		border-color .2s ease;
}

.theme-switcher__toggle:hover,
.theme-switcher__toggle:focus-visible {
	color: var(--theme-accent);
	background: var(--theme-accent-soft);
	border-color: var(--theme-border);
}

.theme-switcher__toggle:focus-visible,
.theme-switcher__option:focus-visible {
	outline: 2px solid rgba(255, 107, 53, .35);
	outline-offset: 2px;
}

.theme-switcher__icon {
	display: none;
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

html[data-theme="light"] .theme-switcher__icon--light,
html[data-theme="dark"] .theme-switcher__icon--dark,
html[data-theme="auto"] .theme-switcher__icon--auto {
	display: block;
}

.theme-switcher__menu {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	z-index: 1100;
	box-sizing: border-box;
	width: 148px;
	padding: 4px;
	color: var(--theme-text);
	background: var(--theme-surface);
	border: 1px solid var(--theme-border);
	border-radius: 4px;
	box-shadow: 0 8px 20px var(--theme-shadow);
}

.theme-switcher__menu[hidden] {
	display: none;
}

.theme-switcher__option {
	display: grid;
	grid-template-columns: 18px minmax(0, 1fr);
	gap: 8px;
	align-items: center;
	box-sizing: border-box;
	width: 100%;
	min-height: 34px;
	padding: 6px 8px;
	color: var(--theme-text);
	background: transparent;
	border: 0;
	border-radius: 3px;
	font-size: 13px;
	line-height: 1.4;
	text-align: left;
	cursor: pointer;
}

.theme-switcher__option:hover,
.theme-switcher__option:focus-visible,
.theme-switcher__option.is-active {
	color: var(--theme-text-strong);
	background: var(--theme-accent-soft);
}

.theme-switcher__option.is-active {
	box-shadow: inset 2px 0 0 var(--theme-accent);
}

.theme-switcher__option svg {
	width: 17px;
	height: 17px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.theme-switcher__option span {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.theme-dark body {
	color: var(--theme-text);
	background-color: var(--theme-page-bg) !important;
}

.theme-dark #header {
	background-color: rgba(25, 28, 31, .96) !important;
	border-color: var(--theme-border);
}

.theme-dark #main,
.theme-dark #main > .post,
.theme-dark #secondary .widget {
	color: var(--theme-text);
	background-color: var(--theme-surface) !important;
	border-color: var(--theme-border);
}

.theme-dark #logo,
.theme-dark .site-title,
.theme-dark .post-title,
.theme-dark .post-title a,
.theme-dark .widget-title,
.theme-dark .post-content h1,
.theme-dark .post-content h2,
.theme-dark .post-content h3,
.theme-dark .post-content h4,
.theme-dark .post-content h5,
.theme-dark .post-content h6,
.theme-dark #comments h3,
.theme-dark #response {
	color: var(--theme-text-strong);
}

.theme-dark a,
.theme-dark .nav-menu a,
.theme-dark .nav-menu ul a,
.theme-dark .rec-post-list a {
	color: var(--theme-text);
}

.theme-dark a:hover,
.theme-dark .nav-menu a:hover,
.theme-dark .rec-post-list a:hover {
	color: var(--theme-text-strong);
}

.theme-dark .post-content a,
.theme-dark .comment-content a,
.theme-dark .rewards a,
.theme-dark .tags a,
.theme-dark .comment-author a,
.theme-dark .breadcrumbs a {
	color: var(--theme-link);
	border-color: var(--theme-border);
}

.theme-dark .post-meta,
.theme-dark .post-meta a,
.theme-dark .breadcrumbs,
.theme-dark .license,
.theme-dark .license-box,
.theme-dark .comment-meta time,
.theme-dark #footer,
.theme-dark #footer a,
.theme-dark .icpnum,
.theme-dark .post-near {
	color: var(--theme-text-muted);
}

.theme-dark #header,
.theme-dark #footer,
.theme-dark #comments,
.theme-dark .post-meta li,
.theme-dark .one-col .post,
.theme-dark .widget-title,
.theme-dark .post-content h2,
.theme-dark .rec-post-list li,
.theme-dark .whisper .whisper-body,
.theme-dark .respond {
	border-color: var(--theme-border);
}

.theme-dark #footer {
	background-color: var(--theme-surface) !important;
}

.theme-dark input,
.theme-dark textarea,
.theme-dark button,
.theme-dark input[type="submit"] {
	color: var(--theme-text);
	background-color: var(--theme-surface-muted);
	border-color: var(--theme-border);
}

.theme-dark input::placeholder,
.theme-dark textarea::placeholder {
	color: var(--theme-text-muted);
	opacity: 1;
}

.theme-dark #search input {
	color: var(--theme-text);
	background: transparent;
	border-color: var(--theme-text-muted);
}

.theme-dark #search button {
	color: var(--theme-text-muted);
	background: transparent;
}

.theme-dark .theme-switcher__toggle,
.theme-dark .theme-switcher__option {
	background: transparent;
}

.theme-dark .theme-switcher__toggle:hover,
.theme-dark .theme-switcher__toggle:focus-visible,
.theme-dark .theme-switcher__option:hover,
.theme-dark .theme-switcher__option:focus-visible,
.theme-dark .theme-switcher__option.is-active {
	background: var(--theme-accent-soft);
}

.theme-dark blockquote,
.theme-dark table th,
.theme-dark .post-content .links a,
.theme-dark .license-box,
.theme-dark .reply2view,
.theme-dark .expire-notice,
.theme-dark .rec-com-list li {
	color: var(--theme-text);
	background: var(--theme-surface-muted) !important;
	border-color: var(--theme-border) !important;
}

.theme-dark table,
.theme-dark table th,
.theme-dark table td {
	border-color: var(--theme-border);
}

.theme-dark pre,
.theme-dark code {
	color: #d8dee9;
	background: #202428;
}

.theme-dark .comment-list li,
.theme-dark .comment-level-even,
.theme-dark .comment-level-odd,
.theme-dark .comment-parent,
.theme-dark .comment-whisper,
.theme-dark .whisper .comment-parent,
.theme-dark .whisper .whisper-body {
	color: var(--theme-text);
	background: var(--theme-surface-muted);
	border-color: var(--theme-border);
}

.theme-dark .comment-by-author,
.theme-dark .whisper .comment-parent.comment-by-author,
.theme-dark .comment-by-author > .comment-whisper {
	background: rgba(255, 122, 69, .1);
}

.theme-dark .author-icon {
	color: var(--theme-text);
	background: var(--theme-surface-strong);
}

.theme-dark .whisper.post {
	border-color: var(--theme-border);
}

.theme-dark .whisper.post .post-title a {
	color: var(--theme-text-strong);
	background: var(--theme-surface-strong);
}

.theme-dark .page-navigator a,
.theme-dark .ajaxload a {
	color: var(--theme-text);
	border-color: var(--theme-border);
}

.theme-dark .page-navigator .current a {
	color: var(--theme-text-strong);
	border-color: var(--theme-text-muted);
}

.theme-dark .post-content > ul.links > li > a {
	color: var(--theme-text) !important;
	background: var(--theme-surface-muted) !important;
	border-color: var(--theme-border) !important;
}

.theme-dark .post-content > ul.links > li > a:hover,
.theme-dark .post-content > ul.links > li > a:focus-visible {
	color: var(--theme-accent) !important;
	background: var(--theme-surface-strong) !important;
	border-color: var(--theme-accent) !important;
}

.theme-dark .post-content > ul.links > li > a > img,
.theme-dark .post-content > ul.links > li > a > i {
	background: var(--theme-surface-strong) !important;
	border-color: var(--theme-border) !important;
}

.theme-dark .post-content > ul.links > li > a > span {
	color: inherit;
}

.theme-dark .post-content > ul.links > li > a::after {
	color: var(--theme-text-muted);
}

.theme-dark .menu-parent ul,
.theme-dark .nav-category-root > .nav-category-tree,
.theme-dark .nav-menu > .nav-category-item > .nav-category-tree {
	background: rgba(32, 36, 40, .98);
	border-color: var(--theme-border);
	box-shadow: 0 8px 20px var(--theme-shadow);
}

.theme-dark .nav-category-tree .nav-category-tree,
.theme-dark .menu-parent .menu-parent .menu-child {
	background: rgba(41, 46, 51, .98);
}

.theme-dark .menu-parent ul::before {
	border-bottom-color: rgba(32, 36, 40, .98);
}

.theme-dark .nav-category-tree a:hover,
.theme-dark .nav-category-tree a:focus-visible,
.theme-dark .menu-parent ul a:hover,
.theme-dark .menu-parent ul a:focus-visible {
	color: var(--theme-text-strong);
	background: rgba(255, 255, 255, .06);
}

.theme-dark .code-block {
	background: #16191c;
	border-color: var(--theme-border);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

.theme-dark .code-block__toolbar {
	color: var(--theme-text-muted);
	background: #202428;
	border-color: var(--theme-border);
}

.theme-dark .code-block__copy {
	color: var(--theme-text-muted);
	background: transparent;
}

.theme-dark .code-block__copy:hover,
.theme-dark .code-block__copy:focus-visible {
	color: var(--theme-accent);
	background: #292e33;
	border-color: #3a4148;
}

.theme-dark .code-block > pre > code {
	color: #d8dee9;
	background: transparent;
}

.theme-dark .code-block > pre {
	background: transparent;
	scrollbar-color: rgba(155, 163, 173, .4) transparent;
}

.theme-dark .code-block > pre::-webkit-scrollbar-thumb {
	background: rgba(155, 163, 173, .4);
}

.theme-dark .hljs-comment,
.theme-dark .hljs-quote {
	color: #8b949e;
}

.theme-dark .hljs-variable,
.theme-dark .hljs-template-variable,
.theme-dark .hljs-attribute,
.theme-dark .hljs-tag,
.theme-dark .hljs-name,
.theme-dark .hljs-regexp,
.theme-dark .hljs-link,
.theme-dark .hljs-selector-id,
.theme-dark .hljs-selector-class {
	color: #ff7b72;
}

.theme-dark .hljs-number,
.theme-dark .hljs-meta,
.theme-dark .hljs-built_in,
.theme-dark .hljs-builtin-name,
.theme-dark .hljs-literal,
.theme-dark .hljs-type,
.theme-dark .hljs-params {
	color: #d2a8ff;
}

.theme-dark .hljs-string,
.theme-dark .hljs-symbol,
.theme-dark .hljs-bullet {
	color: #a5d6ff;
}

.theme-dark .hljs-title,
.theme-dark .hljs-section {
	color: #7ee787;
}

.theme-dark .hljs-keyword,
.theme-dark .hljs-selector-tag {
	color: #ff9a62;
}

.theme-dark .announcement {
	color: var(--theme-text);
	background: var(--theme-surface-muted);
	border-color: var(--theme-border);
}

.theme-dark #cornertool li {
	color: var(--theme-text-strong);
	background: rgba(32, 36, 40, .86) !important;
	border-color: var(--theme-border) !important;
}

.theme-dark #cornertool #catalog {
	background: rgba(32, 36, 40, .86) !important;
	border-color: var(--theme-border) !important;
}

/* 普通列表项不是链接，悬停时保持正文颜色。 */
.post-content ul li:hover,
.post-content ol li:hover {
	color: inherit;
}

@media (min-width: 601px) {
	.theme-dark .menu-parent .menu-parent .menu-child::before {
		border-bottom-color: transparent;
		border-left-color: rgba(41, 46, 51, .98);
	}
}

@media (max-width: 600px) {
	.theme-dark .menu-parent ul,
	.theme-dark .nav-category-root > .nav-category-tree,
	.theme-dark .nav-menu > .nav-category-item > .nav-category-tree {
		background: rgba(32, 36, 40, .98);
	}

	.theme-dark .nav-category-tree .nav-category-tree {
		background: rgba(41, 46, 51, .9);
	}
}

@media (prefers-reduced-motion: reduce) {
	.theme-switcher__toggle {
		transition: none;
	}
}
