/* 新闻联播文字稿存档 · 共享样式 v2
   编辑部档案美学: 暖纸色底 + 深红点缀 + 数字统计 + 克制动效
   双主题: 跟随系统 prefers-color-scheme */

:root {
	--bg: #f7f5f2;
	--surface: #ffffff;
	--surface-2: #f1ede8;
	--text: #1a1917;
	--text-soft: #44423e;
	--muted: #6f6b64;
	--line: #e6e1da;
	--accent: #a8281e;
	--accent-strong: #84211a;
	--accent-soft: #f7e9e6;
	--radius: 10px;
	--shadow-card: 0 1px 2px rgba(26, 25, 23, 0.04), 0 8px 24px rgba(26, 25, 23, 0.05);
	--font: -apple-system, BlinkMacSystemFont, "PingFang SC",
		"Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #141413;
		--surface: #1c1b1a;
		--surface-2: #232220;
		--text: #e9e7e3;
		--text-soft: #c9c5bd;
		--muted: #98948b;
		--line: #32302c;
		--accent: #e06055;
		--accent-strong: #ef7a70;
		--accent-soft: #36211f;
		--shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
	}
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
	margin: 0;
	padding: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 15px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }

/* ═══════════ 顶部栏 ═══════════ */

.topbar {
	border-bottom: 1px solid var(--line);
	background: var(--surface);
}

.topbar-inner {
	max-width: 960px;
	margin: 0 auto;
	padding: 0.9rem 1.4rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.brand { display: flex; align-items: center; gap: 0.7rem; }

.brand-logo {
	width: 34px;
	height: 34px;
	border-radius: 8px;
	background: var(--accent);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 17px;
	font-weight: 700;
	flex-shrink: 0;
}

.brand-name {
	font-size: 1rem;
	font-weight: 800;
	letter-spacing: 0.03em;
	color: var(--text);
}

.brand-sub {
	font-size: 0.72rem;
	color: var(--muted);
	margin-top: -2px;
}

.topbar-meta {
	font-size: 0.78rem;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
	text-align: right;
}

.topbar-meta strong { color: var(--text); font-weight: 700; }

/* ═══════════ 首屏 hero ═══════════ */

.hero {
	max-width: 960px;
	margin: 0 auto;
	padding: 3rem 1.4rem 2.6rem;
	display: grid;
	grid-template-columns: 1.15fr 0.85fr;
	gap: 2.5rem;
	align-items: center;
}

.hero-eyebrow {
	margin: 0 0 0.7rem;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--accent);
}

.hero h1 {
	margin: 0;
	font-size: 2.5rem;
	line-height: 1.2;
	letter-spacing: 0.01em;
	font-weight: 900;
}

.hero h1 .thin { font-weight: 400; color: var(--text-soft); }

.hero-sub {
	margin: 0.9rem 0 1.6rem;
	max-width: 32em;
	color: var(--muted);
	font-size: 0.95rem;
}

.hero-stats {
	display: flex;
	gap: 2.2rem;
}

.hero-stats .stat strong {
	display: block;
	font-size: 1.5rem;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	line-height: 1.15;
}

.hero-stats .stat span {
	font-size: 0.75rem;
	color: var(--muted);
}

/* 最新一期卡片 */

.hero-card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow-card);
	padding: 1.4rem 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 0.8rem;
}

.hero-card-head {
	display: flex;
	align-items: center;
	gap: 0.6rem;
}

.badge-latest {
	background: var(--accent);
	color: #fff;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	padding: 0.18rem 0.55rem;
	border-radius: 999px;
}

.hero-card time {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	font-size: 0.95rem;
}

.hero-card .card-abs {
	margin: 0;
	color: var(--text-soft);
	font-size: 0.86rem;
	line-height: 1.75;
	display: -webkit-box;
	-webkit-line-clamp: 5;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.btn {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	align-self: flex-start;
	background: var(--accent);
	color: #fff;
	font-size: 0.85rem;
	font-weight: 600;
	padding: 0.5rem 1.05rem;
	border-radius: 8px;
	transition: background 0.15s ease, transform 0.15s ease;
}

.btn:hover { background: var(--accent-strong); color: #fff; text-decoration: none; }
.btn:active { transform: scale(0.97); }

/* ═══════════ 搜索 ═══════════ */

.search-wrap {
	max-width: 960px;
	margin: 0 auto;
	padding: 0 1.4rem 1.2rem;
}

.search-box {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 0.55rem 0.9rem;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-box:focus-within {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-box svg { flex-shrink: 0; color: var(--muted); }

.search-box input {
	flex: 1;
	border: none;
	background: none;
	outline: none;
	color: var(--text);
	font-size: 0.92rem;
	font-family: inherit;
}

.search-box input::placeholder { color: var(--muted); }

.search-result { margin: 0.55rem 0 0; font-size: 0.78rem; color: var(--muted); }
.search-result.hidden { display: none; }

/* ═══════════ 目录列表 ═══════════ */

main { max-width: 960px; margin: 0 auto; padding: 0.6rem 1.4rem 3.5rem; }

.month { margin-bottom: 2.4rem; }

.month-head {
	display: flex;
	align-items: baseline;
	gap: 0.6rem;
	border-bottom: 1px solid var(--line);
	padding-bottom: 0.5rem;
	margin-bottom: 0.3rem;
}

.month-head h2 {
	margin: 0;
	font-size: 1rem;
	font-weight: 800;
	letter-spacing: 0.06em;
}

.month-head .count {
	color: var(--muted);
	font-size: 0.75rem;
	font-variant-numeric: tabular-nums;
}

.month.hidden { display: none; }

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

.news-list li { border-bottom: 1px solid var(--line); }
.news-list li:last-child { border-bottom: none; }
.news-list li.hidden { display: none; }

.news-list a {
	display: grid;
	grid-template-columns: 7.2em 4.4em 1fr 1.6em;
	align-items: baseline;
	gap: 0.9rem;
	padding: 0.72rem 0.6rem;
	color: var(--text);
	border-radius: 8px;
	transition: background 0.15s ease;
}

.news-list a:hover { background: var(--accent-soft); text-decoration: none; }
.news-list a:active { transform: scale(0.995); }

.news-date {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	font-size: 0.92rem;
}

.news-weekday {
	font-size: 0.78rem;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
}

.news-abs {
	color: var(--muted);
	font-size: 0.86rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	min-width: 0;
}

.news-arrow {
	color: var(--accent);
	font-size: 0.85rem;
	text-align: right;
	opacity: 0;
	transform: translateX(-3px);
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.news-list a:hover .news-arrow { opacity: 1; transform: translateX(0); }

.news-latest-flag {
	grid-column: 1 / -1;
	font-size: 0.68rem;
	color: var(--accent);
	font-weight: 700;
	margin-top: -0.4rem;
}

@media (max-width: 640px) {
	.news-list a { grid-template-columns: 6.2em 1fr; gap: 0.15rem 0.8rem; }
	.news-weekday { grid-column: 2; margin-top: -0.5rem; }
	.news-abs { grid-column: 1 / -1; }
	.news-arrow { display: none; }
	.news-latest-flag { grid-column: 1 / -1; }
}

/* ═══════════ 页脚 ═══════════ */

.site-footer {
	border-top: 1px solid var(--line);
	background: var(--surface);
	padding: 1.5rem 1.4rem 2rem;
}

.site-footer-inner {
	max-width: 960px;
	margin: 0 auto;
	color: var(--muted);
	font-size: 0.78rem;
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}

/* ═══════════ 阅读页 (view.html) ═══════════ */

/* 阅读进度条 */
.progress-bar {
	position: fixed;
	top: 0;
	left: 0;
	height: 3px;
	width: 100%;
	background: transparent;
	z-index: 100;
	pointer-events: none;
	animation: progress-grow linear both;
	animation-timeline: scroll(root);
	transform-origin: left;
	background: var(--accent);
}

@keyframes progress-grow {
	from { transform: scaleX(0); }
	to { transform: scaleX(1); }
}

.view-bar {
	position: sticky;
	top: 0;
	z-index: 50;
	border-bottom: 1px solid var(--line);
	background: var(--surface);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.view-bar-inner {
	max-width: 760px;
	margin: 0 auto;
	padding: 0.8rem 1.4rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.view-back {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.84rem;
	color: var(--muted);
	white-space: nowrap;
}

.view-back:hover { color: var(--accent); text-decoration: none; }

.view-title {
	font-size: 0.92rem;
	font-weight: 700;
	text-align: right;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* 文章主体 */

.article {
	max-width: 760px;
	margin: 0 auto;
	padding: 2.6rem 1.4rem 4rem;
}

.article-head {
	margin-bottom: 2.2rem;
	padding-bottom: 1.4rem;
	border-bottom: 3px solid var(--accent);
}

.article-head time {
	font-size: 0.82rem;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.04em;
}

.article-head h1 {
	margin: 0.35rem 0 0;
	font-size: 1.9rem;
	font-weight: 900;
	line-height: 1.3;
	letter-spacing: 0.01em;
}

/* 本期内容目录 */

.toc {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow-card);
	padding: 1.1rem 1.3rem;
	margin-bottom: 2.4rem;
}

.toc-head {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0 0 0.6rem;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	color: var(--text);
}

.toc-head::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 2px;
	background: var(--accent);
}

.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }

.toc li {
	counter-increment: toc;
	border-bottom: 1px dashed var(--line);
}

.toc li:last-child { border-bottom: none; }

.toc a {
	display: flex;
	gap: 0.7rem;
	align-items: baseline;
	padding: 0.42rem 0.2rem;
	color: var(--text-soft);
	font-size: 0.87rem;
	line-height: 1.5;
}

.toc a::before {
	content: counter(toc, decimal-leading-zero);
	font-size: 0.72rem;
	font-weight: 700;
	color: var(--accent);
	font-variant-numeric: tabular-nums;
	flex-shrink: 0;
}

.toc a:hover { color: var(--accent); text-decoration: none; }

/* markdown 正文排版 (showdown 输出) */

.article-body {
	background: var(--bg);
	color: var(--text);
	font-size: 1.02rem;
	line-height: 1.85;
	word-break: break-word;
}

.article-body h2 {
	font-size: 1.28rem;
	margin: 2.4rem 0 0.9rem;
	padding-top: 0.7rem;
	border-top: 1px solid var(--line);
	line-height: 1.4;
}

.article-body h3 {
	font-size: 1.08rem;
	margin: 1.9rem 0 0.7rem;
	scroll-margin-top: 70px;
	line-height: 1.45;
}

.article-body p { margin: 0.8rem 0; }

.article-body ul, .article-body ol {
	margin: 0.8rem 0;
	padding-left: 1.4em;
}

.article-body li { margin: 0.35rem 0; }

.article-body strong { font-weight: 700; }

.article-body a {
	color: var(--accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.article-body blockquote {
	margin: 1rem 0;
	padding: 0.3rem 1rem;
	border-left: 3px solid var(--line);
	color: var(--muted);
}

.article-body hr {
	border: none;
	border-top: 1px solid var(--line);
	margin: 2rem 0;
}

.article-body code {
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	font-size: 0.88em;
	background: var(--accent-soft);
	border-radius: 4px;
	padding: 0.1em 0.35em;
}

/* 上一篇 / 下一篇 */

.article-nav {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
	margin-top: 3rem;
	padding-top: 1.4rem;
	border-top: 1px solid var(--line);
}

.article-nav a {
	display: block;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 0.8rem 1rem;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.article-nav a:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }

.article-nav .nav-label {
	display: block;
	font-size: 0.7rem;
	color: var(--muted);
	margin-bottom: 0.2rem;
}

.article-nav .nav-date {
	font-weight: 700;
	font-size: 0.9rem;
	font-variant-numeric: tabular-nums;
}

.article-nav .nav-next { text-align: right; }

@media (max-width: 640px) {
	.article-nav { grid-template-columns: 1fr; }
}

/* 加载 / 错误状态 */

.state-msg {
	max-width: 760px;
	margin: 0 auto;
	padding: 4rem 1.4rem;
	text-align: center;
	color: var(--muted);
}

.state-msg h2 { color: var(--text); margin-top: 0; }

/* 返回顶部 */

.backtop {
	position: fixed;
	right: 1.2rem;
	bottom: 1.2rem;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid var(--line);
	background: var(--surface);
	color: var(--text);
	font-size: 1.05rem;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
	z-index: 90;
	box-shadow: var(--shadow-card);
}

.backtop.show { opacity: 1; pointer-events: auto; }

.backtop:hover { color: var(--accent); border-color: var(--accent); }

/* 首屏 hero 响应式 */

@media (max-width: 720px) {
	.hero { grid-template-columns: 1fr; gap: 1.8rem; padding-top: 2.2rem; }
	.hero h1 { font-size: 2rem; }
	.hero-stats { gap: 1.4rem; }
	.topbar-meta { display: none; }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	* { transition: none !important; animation: none !important; }
	.news-list a:active { transform: none; }
}
