/*
Theme Name: Astra Child
Theme URI: https://xn--4gq1d00pxuhq5cd7det7dp8dco0f6it.online/
Description: 班级空间首页、动态列表与论坛样式。
Author: ClassSite
Template: astra
Version: 1.3.1
Text Domain: astra-child
*/

:root {
	--primary: #1d4ed8;
	--primary-2: #2563eb;
	--accent: #f59e0b;
	--ink: #0f172a;
	--muted: #64748b;
	--line: #e2e8f0;
	--bg: #f5f7fb;
	--card: #ffffff;
	--hero-a: #0b1f4b;
	--hero-b: #1d4ed8;
	--hero-c: #2563eb;
	--radius: 18px;
}

html {
	scroll-behavior: smooth;
}

body {
	background: var(--bg);
	color: var(--ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
	-webkit-font-smoothing: antialiased;
}

a {
	color: var(--primary);
}

a:hover {
	color: var(--primary-2);
}

/* 站点头部 */
#masthead.site-header {
	position: sticky;
	top: 0;
	z-index: 60;
	background: rgba(255, 255, 255, 0.94);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	border-bottom: 1px solid rgba(15, 23, 42, 0.06);
	box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.admin-bar #masthead.site-header {
	top: 32px;
}

#masthead .ast-container {
	max-width: 1200px;
}

#masthead .site-title a {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: 20px;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--ink);
}

#masthead .site-title a::before {
	content: "11";
	display: inline-grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 11px;
	background: linear-gradient(135deg, var(--primary), var(--primary-2));
	color: #fff;
	font-size: 15px;
	font-weight: 900;
	letter-spacing: -0.04em;
	box-shadow: 0 8px 18px -8px rgba(29, 78, 216, 0.65);
}

#masthead .site-description {
	display: none;
}

#masthead .main-header-menu > li > a {
	display: inline-flex;
	align-items: center;
	padding: 10px 14px;
	border-radius: 10px;
	font-weight: 600;
	color: #334155;
	transition: background 0.18s ease, color 0.18s ease;
}

#masthead .main-header-menu > li > a:hover,
#masthead .main-header-menu > li.current-menu-item > a,
.home #menu-item-11 > a,
.blog #menu-item-59 > a,
.post-type-archive-forum #menu-item-17 > a,
.bbpress #menu-item-17 > a,
.cs-game #menu-item-105 > a {
	background: #eff6ff;
	color: var(--primary);
}

#masthead .main-header-menu > li.cs-menu-cta > a {
	align-self: center;
	height: 42px !important;
	max-height: 42px;
	margin-left: 6px;
	padding: 0 18px;
	border-radius: 12px;
	background: var(--primary);
	color: #fff;
	line-height: 42px;
	box-shadow: 0 10px 22px -12px rgba(29, 78, 216, 0.75);
}

#masthead .main-header-menu > li.cs-menu-cta > a:hover {
	background: var(--primary-2);
	color: #fff;
}

#masthead .menu-toggle {
	border: 1px solid var(--line);
	border-radius: 10px;
	color: var(--ink);
}

/* 移动端菜单 */
#ast-mobile-header .main-header-menu {
	padding: 10px 18px 18px;
}

#ast-mobile-header .main-header-menu > li > a {
	display: block;
	padding: 12px 10px;
	border-radius: 10px;
	font-weight: 600;
	color: #334155;
}

#ast-mobile-header .main-header-menu > li.cs-menu-cta > a {
	height: auto !important;
	max-height: none;
	margin-top: 8px;
	padding: 12px 10px;
	line-height: 1.4;
	text-align: center;
	background: var(--primary);
	color: #fff;
}

@media (max-width: 782px) {
	.admin-bar #masthead.site-header {
		top: 46px;
	}

	#masthead .site-title a {
		font-size: 17px;
	}

	#masthead .site-title a::before {
		width: 32px;
		height: 32px;
		border-radius: 10px;
		font-size: 13px;
	}
}

/* 小游戏切换标签 */
.cs-game-tabs {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 22px;
	padding: 5px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
}

.cs-game-tabs a {
	padding: 8px 18px;
	border-radius: 999px;
	color: #dbeafe;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
	transition: background 0.18s ease, color 0.18s ease;
}

.cs-game-tabs a:hover {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
}

.cs-game-tabs a.is-active {
	background: #fff;
	color: #0b1f4b;
}

@media (max-width: 720px) {
	.cs-game-tabs {
		width: 100%;
	}

	.cs-game-tabs a {
		flex: 1 1 auto;
		text-align: center;
	}
}

/* 内容区域铺满，页面内部用 .cs-container 控制宽度 */
.cs-front .site-content > .ast-container,
.cs-blog .site-content > .ast-container,
.cs-game .site-content > .ast-container,
.cs-circuit .site-content > .ast-container {
	max-width: none;
	width: 100%;
	padding: 0;
	display: block;
}

.cs-front #primary,
.cs-blog #primary,
.cs-game #primary,
.cs-circuit #primary {
	float: none;
	width: 100%;
	max-width: 100%;
	flex: 1 1 100%;
	margin: 0;
	padding: 0;
}

.cs-front #main,
.cs-blog #main,
.cs-game #main,
.cs-circuit #main {
	width: 100%;
}

/* 通用容器 */
.cs-container {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 24px;
	box-sizing: border-box;
}

/* 头像统一为匿名标记 */
.cs-avatar {
	display: inline-grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: #e2e8f0;
	color: #475569;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
}

/* 页脚 */
.cs-footer {
	background: #0b1220;
	color: #cbd5e1;
	padding: 56px 0 0;
	margin-top: 0;
}

.cs-footer a {
	color: #cbd5e1;
	text-decoration: none;
}

.cs-footer a:hover {
	color: #fff;
}

.cs-footer-grid {
	display: grid;
	grid-template-columns: 1.6fr 1fr 1fr;
	gap: 40px;
	padding-bottom: 40px;
}

.cs-footer-brand .cs-footer-logo {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 14px;
	color: #fff;
	font-size: 17px;
}

.cs-footer-brand .cs-footer-logo span {
	display: inline-grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 10px;
	background: var(--primary);
	color: #fff;
	font-size: 13px;
	font-weight: 900;
}

.cs-footer-brand p {
	margin: 0;
	max-width: 420px;
	color: #94a3b8;
	line-height: 1.8;
	font-size: 14px;
}

.cs-footer h4 {
	margin: 0 0 14px;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
}

.cs-footer-grid > div:not(.cs-footer-brand) a {
	display: block;
	margin: 0 0 10px;
	color: #94a3b8;
	font-size: 14px;
}

.cs-footer-bottom {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 20px 0;
	border-top: 1px solid rgba(148, 163, 184, 0.16);
	color: #64748b;
	font-size: 13px;
}

@media (max-width: 820px) {
	.cs-footer-grid {
		grid-template-columns: 1fr 1fr;
		gap: 30px;
	}

	.cs-footer-brand {
		grid-column: 1 / -1;
	}
}

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

	.cs-footer {
		padding-top: 40px;
	}

	.cs-footer-grid {
		grid-template-columns: 1fr;
		gap: 26px;
	}

	.cs-footer-bottom {
		flex-direction: column;
	}
}

/* 普通文章/页面排版微调 */
.site-content .entry-content {
	color: #1e293b;
	line-height: 1.9;
}

.site-content .entry-content a {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* 分页 */
.cs-pagination {
	margin-top: 36px;
}

.cs-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
}

.cs-pagination .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border-radius: 10px;
	border: 1px solid var(--line);
	background: #fff;
	color: #334155;
	text-decoration: none;
	font-weight: 600;
}

.cs-pagination .page-numbers.current,
.cs-pagination .page-numbers:hover {
	background: var(--primary);
	border-color: var(--primary);
	color: #fff;
}

/* 小屏时避免看板娘气泡顶出屏幕 */
@media (max-width: 600px) {
	.cs-mascot-bubble {
		left: auto;
		right: 0;
		max-width: calc(100vw - 28px) !important;
		transform: translateY(6px) scale(0.95);
	}

	.cs-mascot-bubble.show {
		transform: translateY(0) scale(1);
	}

	.cs-mascot.cs-bubble-below .cs-mascot-bubble {
		transform: translateY(-6px) scale(0.95);
	}

	.cs-mascot.cs-bubble-below .cs-mascot-bubble.show {
		transform: translateY(0) scale(1);
	}

	.cs-mascot-bubble::after {
		left: auto;
		right: 30px;
		transform: none;
	}

	.cs-mascot-bubble::before {
		left: auto;
		right: 31px;
		transform: none;
	}
}
