/* ==========================================================================
   电器·智库 — 公共基础样式
   设计变量 / 重置 / 容器 / 面包屑 / 侧边栏 / 数据卡 / 通用动画
   全站常驻加载（dependencies: 无）
   ========================================================================== */

:root {
	--ink: #16283c;
	--navy: #0d1b2a;
	--navy-2: #132a40;
	--brand: #c8102e;
	--brand-dark: #5c0a16;
	--copper: #b8863b;
	--copper-light: #d4a25c;
	--paper: #f6f3ec;
	--paper-2: #efe9dd;
	--text: #2a2f36;
	--muted: #6b7280;
	--line: #e2dccd;
	--white: #ffffff;
	--radius: 12px;
	--radius-lg: 14px;
	--serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
	--sans: "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", -apple-system, "Segoe UI", sans-serif;
}

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

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: var(--sans);
	color: var(--text);
	background: var(--paper);
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
}

a {
	color: inherit;
	text-decoration: none;
}

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

ul,
ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

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

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote {
	margin: 0;
}

.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 24px;
}

/* 内容区双栏布局（列表页 / 文章页共用，页面样式可覆盖 padding） */
.layout {
	display: grid;
	grid-template-columns: 1fr 300px;
	gap: 40px;
}

/* 无障碍：仅供读屏 */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- 面包屑 ---------- */
.crumb {
	font-size: 13px;
	color: var(--muted);
	padding: 20px 0 0;
	letter-spacing: 1px;
	line-height: 1.8;
}

.crumb a {
	color: var(--muted);
	transition: color .2s;
}

.crumb a:hover {
	color: var(--copper);
}

.crumb .sep {
	margin: 0 8px;
	color: var(--line);
}

.crumb .cur {
	color: var(--copper);
}

/* ---------- 侧边栏（列表页 / 文章页共用） ---------- */
.aside {
	position: sticky;
	top: 80px;
	align-self: start;
}

.aside-box {
	background: var(--white);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 20px;
	margin-bottom: 20px;
}

.aside-box h3 {
	font-family: var(--serif);
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 1px;
	color: var(--navy);
	margin-bottom: 14px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--line);
}

/* 侧边栏热门阅读 */
.aside-hot li {
	padding: 9px 0;
	border-bottom: 1px solid var(--line);
}

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

.aside-hot a {
	display: flex;
	gap: 8px;
	font-size: 13px;
	line-height: 1.5;
	color: var(--text);
	transition: color .2s;
}

.aside-hot a:hover {
	color: var(--copper);
}

.aside-hot .idx {
	flex: none;
	font-family: var(--serif);
	font-size: 15px;
	font-weight: 700;
	color: var(--copper);
}

/* 标签云 */
.aside-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--line);
}

.aside-head h3 {
	margin: 0;
	padding: 0;
	border: 0;
}

.dq-tags-more {
	flex: none;
	padding: 3px 10px;
	font-size: 12px;
	line-height: 1.6;
	letter-spacing: .5px;
	color: var(--copper);
	background: var(--paper-2);
	border: 0;
	border-radius: 11px;
	cursor: pointer;
	transition: background .2s, color .2s;
}

.dq-tags-more:hover {
	background: var(--copper);
	color: var(--white);
}

.aside-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.aside-tags a {
	font-size: 12px;
	color: var(--muted);
	background: var(--paper-2);
	padding: 4px 12px;
	border-radius: 14px;
	transition: all .2s;
}

.aside-tags a:hover {
	background: var(--copper);
	color: var(--white);
}

/* 侧边栏二维码切换 */
.dq-qr-input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.dq-qr-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--line);
}

.dq-qr-head h3 {
	margin: 0;
	padding: 0;
	border: 0;
}

.dq-qr-tabs {
	display: flex;
	flex: none;
	gap: 4px;
}

.dq-qr-tabs label {
	padding: 3px 10px;
	font-size: 12px;
	line-height: 1.6;
	letter-spacing: .5px;
	color: var(--muted);
	background: var(--paper-2);
	border-radius: 11px;
	cursor: pointer;
	transition: background .2s, color .2s;
}

#dq-qr-wechat:checked~.dq-qr-head .dq-qr-tabs label[for="dq-qr-wechat"],
#dq-qr-weibo:checked~.dq-qr-head .dq-qr-tabs label[for="dq-qr-weibo"] {
	background: var(--copper);
	color: var(--white);
}

.dq-qr-panel {
	display: none;
	margin: 14px 0 0;
	text-align: center;
}

#dq-qr-wechat:checked~.dq-qr-panels .dq-qr-panel--wechat,
#dq-qr-weibo:checked~.dq-qr-panels .dq-qr-panel--weibo {
	display: block;
}

.dq-qr-panel img {
	display: block;
	width: 124px;
	height: 124px;
	margin: 0 auto;
	padding: 6px;
	background: var(--white);
	border: 1px solid var(--line);
	border-radius: 6px;
	image-rendering: pixelated;
}

.dq-qr-panel figcaption {
	margin-top: 8px;
	font-size: 12px;
	letter-spacing: 1px;
	color: var(--muted);
}

/* ---------- 通用动画 ---------- */
@keyframes rise {
	from {
		opacity: 0;
		transform: translateY(12px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	* {
		animation-duration: .001ms !important;
		transition-duration: .001ms !important;
	}
}

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

	.aside {
		position: static;
	}
}

@media (max-width: 640px) {
	.container {
		padding: 0 18px;
	}
}

/* ---------- 返回顶部 ---------- */
.dq-top {
	position: fixed;
	right: 26px;
	bottom: 30px;
	z-index: 90;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 1px solid rgba(212, 162, 92, .5);
	border-radius: 50%;
	background: linear-gradient(150deg, #7a1020 0%, var(--brand-dark) 100%);
	color: var(--copper-light);
	box-shadow: 0 8px 22px rgba(13, 27, 42, .24);
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	transition: opacity .25s, transform .25s, visibility .25s, box-shadow .2s, border-color .2s;
}

.dq-top svg {
	width: 18px;
	height: 18px;
}

.dq-top.is-visible:hover {
	border-color: var(--copper-light);
	box-shadow: 0 12px 26px rgba(13, 27, 42, .32);
	transform: translateY(-3px);
}

.dq-top:focus-visible {
	outline: 2px solid var(--copper-light);
	outline-offset: 3px;
}

.dq-top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: none;
}

@media (max-width: 640px) {
	.dq-top {
		right: 16px;
		bottom: 18px;
		width: 42px;
		height: 42px;
	}
}
