/**
 * TingPro 布局：顶栏、双栏栅格、容器。
 */

/* 顶部导航：页面顶部时贴顶整条，滚动后丝滑变为悬浮圆角胶囊 */
.topbar {
	position: sticky;
	top: 0;
	z-index: 100;
	max-width: none;
	margin: 0 auto;
	padding: 0;
	transition: top 0.35s ease, margin-top 0.35s ease, padding 0.35s ease,
		max-width 0.35s ease;
}

body.admin-bar .topbar {
	top: var(--wp-admin--admin-bar--height, 32px);
}

@media screen and (max-width: 782px) {
	body.admin-bar .topbar {
		top: var(--wp-admin--admin-bar--height, 46px);
	}
}

.topbar__inner {
	display: flex;
	align-items: center;
	gap: 8px;
	height: 64px;
	padding: 0 32px;
	background: var(--topbar-bg);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border: 1px solid var(--border);
	border-width: 0 0 1px 0;
	border-radius: 0;
	box-shadow: none;
	transition: height 0.35s ease, padding 0.35s ease, border-radius 0.35s ease,
		border-width 0.35s ease, box-shadow 0.35s ease;
}

.topbar.is-floating {
	top: 12px;
	margin-top: 12px;
	padding: 0 24px;
	max-width: 1320px;
}

body.admin-bar .topbar.is-floating {
	top: calc(var(--wp-admin--admin-bar--height, 32px) + 12px);
}

.topbar.is-floating .topbar__inner {
	height: var(--topbar-h);
	padding: 0 10px 0 28px;
	border-width: 1px;
	border-radius: 999px;
	box-shadow: var(--shadow-sm);
}

.topbar__logo {
	display: flex;
	align-items: center;
	font-weight: 800;
	font-size: 1.15rem;
	letter-spacing: 0.04em;
	color: var(--accent);
	white-space: nowrap;
	margin-right: 12px;
}

.topbar__logo img {
	max-height: 36px;
	width: auto;
}

.topbar__nav {
	flex: 1;
	min-width: 0;
	overflow-x: auto;
	scrollbar-width: none;
}

.topbar__nav::-webkit-scrollbar {
	display: none;
}

.topbar__actions {
	display: flex;
	align-items: center;
	gap: 4px;
	padding-right: 6px;
}

.topbar__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--text-sub);
	transition: background-color 0.2s ease, color 0.2s ease;
}

.topbar__btn:hover {
	background: var(--accent-soft);
	color: var(--accent);
}

.topbar__btn .icon {
	width: 20px;
	height: 20px;
}

.topbar__btn--burger {
	display: none;
}

/* ---------------- 主栅格 ---------------- */

.site-layout {
	display: grid;
	grid-template-columns: 290px minmax(0, 1fr);
	gap: 36px;
	align-items: start;
	max-width: 1320px;
	margin: 28px auto 0;
	padding: 0 24px;
}

.site-sidebar {
	position: sticky;
	top: calc(var(--topbar-h) + 40px);
}

body.admin-bar .site-sidebar {
	top: calc(var(--topbar-h) + 40px + var(--wp-admin--admin-bar--height, 32px));
}

.site-main {
	min-width: 0;
	outline: none;
	min-height: 60vh;
	transition: opacity 0.22s ease, transform 0.22s ease;
}

/* PJAX 切页过渡：离场淡出下移，入场由 .is-entering 反向触发 */
.site-main.is-leaving {
	opacity: 0;
	transform: translateY(14px);
}

.site-main.is-entering {
	opacity: 0;
	transform: translateY(-10px);
	transition: none;
}

/* 内容列宽：首页卡片流较宽，文章页在 single.css 中收窄 */
.container {
	max-width: 980px;
}

/* ---------------- 页脚 ---------------- */

.site-footer {
	max-width: 1320px;
	margin: 56px auto 0;
	padding: 24px 24px 32px;
	border-top: 1px solid var(--border);
	text-align: center;
	color: var(--text-faint);
	font-size: 0.85rem;
	line-height: 2;
}

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

/* ---------------- 回到顶部 ---------------- */

.backtop {
	position: fixed;
	right: 28px;
	bottom: 28px;
	z-index: 90;
	width: 44px;
	height: 44px;
	border: 1px solid var(--border);
	border-radius: 50%;
	background: var(--card-bg);
	color: var(--text-sub);
	box-shadow: var(--shadow-sm);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s ease, transform 0.2s ease;
}

.backtop:hover {
	color: var(--accent);
	transform: translateY(-2px);
}

.backtop .icon {
	width: 20px;
	height: 20px;
}
