/*
Theme Name: Nocturne Press
Theme URI: https://example.com/nocturne-press
Author: Codex
Author URI: https://openai.com/
Description: 一款专注阅读体验、响应式设计与搜索引擎友好结构的暗色 WordPress 内容主题。
Version: 1.0.1
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
Text Domain: nocturne-press
Tags: blog, news, dark, two-columns, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

:root {
	--bg: #0b0d10;
	--surface: #12161b;
	--surface-soft: #171c22;
	--border: #252c35;
	--text: #e8edf2;
	--muted: #99a4b0;
	--accent: #7dd3a8;
	--accent-strong: #a2e9c4;
	--danger: #ff9b9b;
	--radius: 14px;
	--shadow: 0 16px 48px rgba(0, 0, 0, .22);
	--content: 1160px;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
	font-size: 16px;
	line-height: 1.75;
	-webkit-font-smoothing: antialiased;
}

body::before {
	position: fixed;
	z-index: -1;
	inset: 0;
	background:
		radial-gradient(circle at 15% -10%, rgba(125, 211, 168, .09), transparent 32rem),
		linear-gradient(180deg, #0d1014 0, var(--bg) 30rem);
	content: "";
	pointer-events: none;
}

a {
	color: var(--accent);
	text-decoration-thickness: .08em;
	text-underline-offset: .2em;
}

a:hover,
a:focus {
	color: var(--accent-strong);
}

img {
	max-width: 100%;
	height: auto;
}

button,
input,
textarea,
select {
	font: inherit;
}

.screen-reader-text {
	position: absolute;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	width: 1px;
	height: 1px;
	white-space: nowrap;
}

.screen-reader-text:focus {
	z-index: 100000;
	top: 8px;
	left: 8px;
	clip: auto;
	width: auto;
	height: auto;
	padding: .65rem 1rem;
	border-radius: 8px;
	background: var(--text);
	color: var(--bg);
}

.site-shell {
	width: min(calc(100% - 2rem), var(--content));
	margin-inline: auto;
}

.site-header {
	position: sticky;
	z-index: 50;
	top: 0;
	border-bottom: 1px solid rgba(37, 44, 53, .82);
	background: rgba(11, 13, 16, .88);
	backdrop-filter: blur(18px);
}

.header-inner {
	display: flex;
	min-height: 72px;
	align-items: center;
	gap: 2rem;
}

.site-branding {
	display: flex;
	min-width: 0;
	align-items: center;
	gap: .8rem;
}

.custom-logo-link {
	flex: 0 0 auto;
	line-height: 0;
}

.custom-logo {
	width: auto;
	max-height: 38px;
}

.site-title {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 760;
	letter-spacing: -.02em;
	line-height: 1.2;
}

.site-title a {
	color: var(--text);
	text-decoration: none;
}

.site-description {
	margin: .2rem 0 0;
	color: var(--muted);
	font-size: .78rem;
	line-height: 1.3;
}

.main-navigation {
	margin-left: auto;
}

.main-navigation ul {
	display: flex;
	margin: 0;
	padding: 0;
	align-items: center;
	gap: .25rem;
	list-style: none;
}

.main-navigation a {
	display: block;
	padding: .55rem .75rem;
	border-radius: 8px;
	color: #cbd3dc;
	font-size: .92rem;
	text-decoration: none;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current-menu-ancestor > a {
	background: var(--surface-soft);
	color: var(--accent-strong);
}

.menu-toggle {
	display: none;
	margin-left: auto;
	padding: .5rem .7rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--surface);
	color: var(--text);
	cursor: pointer;
}

.site-main {
	min-height: 65vh;
	padding-block: 2.8rem 4.5rem;
}

.hero {
	display: grid;
	margin-bottom: 2.4rem;
	padding: clamp(1.4rem, 4vw, 3rem);
	border: 1px solid var(--border);
	border-radius: calc(var(--radius) + 4px);
	background:
		linear-gradient(115deg, rgba(125, 211, 168, .08), transparent 50%),
		var(--surface);
	box-shadow: var(--shadow);
	grid-template-columns: minmax(0, 1.25fr) minmax(230px, .75fr);
	align-items: end;
	gap: 2rem;
}

.eyebrow {
	margin: 0 0 .65rem;
	color: var(--accent);
	font-size: .76rem;
	font-weight: 750;
	letter-spacing: .12em;
	text-transform: uppercase;
}

.hero h1,
.archive-header h1 {
	max-width: 760px;
	margin: 0;
	font-size: clamp(2rem, 5vw, 3.65rem);
	letter-spacing: -.055em;
	line-height: 1.08;
}

.hero-copy {
	max-width: 650px;
	margin: 1rem 0 0;
	color: #aab4bf;
	font-size: 1.05rem;
}

.hero-stats {
	display: flex;
	padding: 1rem;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: rgba(11, 13, 16, .52);
	gap: 1rem;
}

.hero-stats span {
	flex: 1;
	color: var(--muted);
	font-size: .78rem;
}

.hero-stats strong {
	display: block;
	color: var(--text);
	font-size: 1.45rem;
	line-height: 1.25;
}

.content-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 2.2rem;
}

.section-heading,
.archive-header {
	margin-bottom: 1.4rem;
}

.section-heading {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 1rem;
}

.section-heading h2,
.archive-header h1 {
	margin: 0;
}

.section-heading h2 {
	font-size: 1.35rem;
	letter-spacing: -.025em;
}

.archive-header {
	padding-bottom: 1.3rem;
	border-bottom: 1px solid var(--border);
}

.archive-header h1 {
	font-size: clamp(1.8rem, 4vw, 2.65rem);
}

.archive-description {
	max-width: 720px;
	margin-top: .75rem;
	color: var(--muted);
}

.post-list {
	display: grid;
	gap: 1rem;
}

.post-card {
	display: grid;
	min-width: 0;
	padding: 1rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	grid-template-columns: 168px minmax(0, 1fr);
	gap: 1.15rem;
	transition: border-color .2s ease, transform .2s ease, background .2s ease;
}

.post-card:hover {
	border-color: #39454f;
	background: #14191f;
	transform: translateY(-2px);
}

.post-thumbnail {
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 10;
	border-radius: 10px;
	background: var(--surface-soft);
}

.post-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .35s ease;
}

.post-thumbnail-placeholder {
	display: grid;
	background:
		linear-gradient(135deg, rgba(125, 211, 168, .18), rgba(125, 211, 168, .02)),
		var(--surface-soft);
	color: var(--accent-strong);
	place-items: center;
	text-decoration: none;
}

.post-thumbnail-placeholder span {
	font-size: .82rem;
	font-weight: 750;
	letter-spacing: .16em;
}

.post-card:hover .post-thumbnail img {
	transform: scale(1.035);
}

.post-card-body {
	display: flex;
	min-width: 0;
	flex-direction: column;
	justify-content: center;
}

.entry-meta {
	display: flex;
	margin-bottom: .42rem;
	color: var(--muted);
	font-size: .78rem;
	flex-wrap: wrap;
	gap: .3rem .75rem;
}

.entry-meta a {
	color: var(--muted);
	text-decoration: none;
}

.entry-meta a:hover {
	color: var(--accent);
}

.entry-title {
	margin: 0;
	color: var(--text);
	font-size: 1.17rem;
	letter-spacing: -.02em;
	line-height: 1.38;
}

.entry-title a {
	color: inherit;
	text-decoration: none;
}

.entry-title a:hover {
	color: var(--accent-strong);
}

.entry-summary {
	display: -webkit-box;
	overflow: hidden;
	margin: .5rem 0 0;
	color: #9faab5;
	font-size: .9rem;
	line-height: 1.65;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.entry-summary p {
	margin: 0;
}

.sidebar {
	min-width: 0;
}

.widget {
	margin-bottom: 1rem;
	padding: 1.15rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
}

.widget-title {
	margin: 0 0 .8rem;
	font-size: .96rem;
	letter-spacing: -.015em;
}

.widget ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.widget li {
	padding-block: .5rem;
	border-bottom: 1px solid rgba(37, 44, 53, .72);
	color: var(--muted);
	font-size: .88rem;
}

.widget li:last-child {
	border-bottom: 0;
}

.widget a {
	color: #bdc6cf;
	text-decoration: none;
}

.widget a:hover {
	color: var(--accent);
}

.search-form {
	display: flex;
	gap: .5rem;
}

.search-field,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	border: 1px solid var(--border);
	border-radius: 9px;
	outline: 0;
	background: #0e1115;
	color: var(--text);
}

.search-field {
	min-width: 0;
	padding: .6rem .7rem;
}

.search-field:focus,
.comment-form input:focus,
.comment-form textarea:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(125, 211, 168, .08);
}

.search-submit,
.submit {
	padding: .58rem .9rem;
	border: 0;
	border-radius: 9px;
	background: var(--accent);
	color: #07110c;
	font-weight: 700;
	cursor: pointer;
}

.search-submit:hover,
.submit:hover {
	background: var(--accent-strong);
}

.pagination {
	margin-top: 2rem;
}

.nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: .45rem;
}

.page-numbers {
	display: inline-flex;
	min-width: 2.45rem;
	height: 2.45rem;
	padding: 0 .7rem;
	border: 1px solid var(--border);
	border-radius: 9px;
	background: var(--surface);
	color: #c5ced7;
	align-items: center;
	justify-content: center;
	text-decoration: none;
}

.page-numbers.current,
.page-numbers:hover {
	border-color: var(--accent);
	background: rgba(125, 211, 168, .1);
	color: var(--accent-strong);
}

.single-layout {
	display: grid;
	grid-template-columns: minmax(0, 780px) 300px;
	justify-content: space-between;
	gap: 3rem;
}

.single-article {
	min-width: 0;
}

.single-header {
	margin-bottom: 1.75rem;
}

.single-header .entry-title {
	margin-bottom: 1rem;
	font-size: clamp(2rem, 5vw, 3.35rem);
	line-height: 1.15;
}

.single-featured {
	overflow: hidden;
	margin: 0 0 2rem;
	border-radius: var(--radius);
}

.single-featured img {
	display: block;
	width: 100%;
}

.entry-content {
	color: #d3dae2;
	font-size: 1.04rem;
}

.entry-content > * {
	max-width: 100%;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
	margin: 2.2em 0 .7em;
	color: var(--text);
	letter-spacing: -.025em;
	line-height: 1.35;
}

.entry-content p,
.entry-content ul,
.entry-content ol {
	margin-block: 1.2em;
}

.entry-content blockquote {
	margin: 1.6rem 0;
	padding: .1rem 0 .1rem 1.2rem;
	border-left: 3px solid var(--accent);
	color: #b4bec8;
}

.entry-content pre {
	overflow-x: auto;
	padding: 1rem;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: #080a0d;
}

.entry-content code {
	border-radius: 4px;
	background: var(--surface-soft);
	color: #c6f2da;
}

.entry-content table {
	display: block;
	overflow-x: auto;
	width: 100%;
	border-collapse: collapse;
}

.entry-content th,
.entry-content td {
	padding: .7rem;
	border: 1px solid var(--border);
}

.entry-footer {
	margin-top: 2rem;
	padding-top: 1.2rem;
	border-top: 1px solid var(--border);
	color: var(--muted);
	font-size: .88rem;
}

.post-tags a {
	display: inline-block;
	margin: .2rem .2rem .2rem 0;
	padding: .25rem .6rem;
	border: 1px solid var(--border);
	border-radius: 999px;
	color: var(--muted);
	text-decoration: none;
}

.post-navigation {
	margin: 2.2rem 0;
}

.post-navigation .nav-links {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: .8rem;
}

.post-navigation a {
	display: block;
	height: 100%;
	padding: 1rem;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--surface);
	color: var(--text);
	text-decoration: none;
}

.post-navigation a:hover {
	border-color: #3d4a54;
}

.post-navigation .nav-next {
	text-align: right;
}

.nav-subtitle {
	display: block;
	margin-bottom: .25rem;
	color: var(--muted);
	font-size: .76rem;
}

.nav-title {
	display: -webkit-box;
	overflow: hidden;
	font-size: .9rem;
	font-weight: 650;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.related-posts {
	margin-top: 2.2rem;
}

.related-posts h2,
.comments-title {
	margin-bottom: 1rem;
	font-size: 1.25rem;
}

.related-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: .8rem;
}

.related-card {
	overflow: hidden;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--surface);
}

.related-card.no-thumbnail {
	display: block;
}

.related-card .post-thumbnail {
	border-radius: 0;
}

.related-card-body {
	padding: .8rem;
}

.related-card h3 {
	display: -webkit-box;
	overflow: hidden;
	margin: 0;
	font-size: .9rem;
	line-height: 1.5;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.related-card h3 a {
	color: var(--text);
	text-decoration: none;
}

.related-card time {
	display: block;
	margin-top: .35rem;
	color: var(--muted);
	font-size: .72rem;
}

.comments-area {
	margin-top: 2.5rem;
}

.comment-list {
	padding: 0;
	list-style: none;
}

.comment-list .children {
	list-style: none;
}

.comment-body {
	margin-bottom: .8rem;
	padding: 1rem;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--surface);
}

.comment-meta {
	font-size: .82rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	padding: .7rem;
}

.not-found {
	padding: 3rem 1.2rem;
	text-align: center;
}

.site-footer {
	padding-block: 2.2rem;
	border-top: 1px solid var(--border);
	background: #090b0e;
	color: var(--muted);
	font-size: .85rem;
}

.footer-inner {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
}

.footer-inner p {
	margin: 0;
}

.footer-current-time {
	margin-left: auto !important;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.footer-current-time time {
	color: #c8d1da;
}

.footer-menu {
	display: flex;
	margin: 0;
	padding: 0;
	gap: 1rem;
	list-style: none;
}

.footer-menu a {
	color: var(--muted);
	text-decoration: none;
}

@media (max-width: 900px) {
	.content-layout,
	.single-layout {
		grid-template-columns: 1fr;
	}

	.sidebar {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 1rem;
	}

	.widget {
		margin: 0;
	}
}

@media (max-width: 720px) {
	.header-inner {
		flex-wrap: wrap;
		gap: 0;
	}

	.menu-toggle {
		display: inline-flex;
	}

	.main-navigation {
		display: none;
		width: 100%;
		margin: 0;
		padding: .65rem 0 1rem;
	}

	.main-navigation.is-open {
		display: block;
	}

	.main-navigation ul {
		display: block;
	}

	.main-navigation a {
		padding: .7rem;
	}

	.hero {
		grid-template-columns: 1fr;
	}

	.post-card {
		grid-template-columns: 118px minmax(0, 1fr);
		padding: .8rem;
		gap: .85rem;
	}

	.entry-summary {
		display: none;
	}

	.related-grid {
		grid-template-columns: 1fr;
	}

	.related-card {
		display: grid;
		grid-template-columns: 110px 1fr;
	}

	.footer-inner {
		flex-direction: column;
	}

	.footer-current-time {
		margin-left: 0 !important;
	}
}

@media (max-width: 480px) {
	.site-shell {
		width: min(calc(100% - 1.2rem), var(--content));
	}

	.site-description {
		display: none;
	}

	.site-main {
		padding-top: 1.5rem;
	}

	.hero {
		margin-bottom: 1.5rem;
	}

	.hero-stats {
		display: none;
	}

	.post-card {
		grid-template-columns: 92px minmax(0, 1fr);
	}

	.entry-title {
		font-size: 1rem;
	}

	.entry-meta .byline,
	.entry-meta .comments-link {
		display: none;
	}

	.sidebar {
		grid-template-columns: 1fr;
	}

	.post-navigation .nav-links {
		grid-template-columns: 1fr;
	}

	.post-navigation .nav-next {
		text-align: left;
	}
}

@media (prefers-reduced-motion: reduce) {
	* {
		scroll-behavior: auto !important;
		transition: none !important;
	}
}
