/**
 * 全站通用页头 — 扁平实色、无渐变；禁止左侧色条与标题栏容器圆角（项目约定）
 * 语义：.csg-page-header*；兼容：.admin-page-header*
 */

:root {
	--csg-ph-bg: #ffffff;
	--csg-ph-border: #e2e8f0;
	--csg-ph-border-strong: #cbd5e1;
	--csg-ph-shadow: none;
	--csg-ph-accent: #2563eb;
	--csg-ph-accent-hover: #1d4ed8;
	--csg-ph-accent-fg: #ffffff;
	--csg-ph-icon-bg: #f1f5f9;
	--csg-ph-text: #0f172a;
	--csg-ph-muted: #64748b;
}

/* ========== 新版 .csg-page-header ========== */

.csg-page-header {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	margin-bottom: 1.5rem;
}

.csg-page-header__sheet {
	width: 100%;
	box-sizing: border-box;
	border-radius: 0;
	border: 1px solid var(--csg-ph-border);
	background: var(--csg-ph-bg);
	box-shadow: var(--csg-ph-shadow);
}

.csg-page-header__grid {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem 1.5rem;
	padding: 1.25rem 1.5rem;
	flex-wrap: wrap;
}

.csg-page-header__identity {
	display: flex;
	align-items: center;
	gap: 1rem;
	min-width: 0;
	flex: 1;
}

.csg-page-header__icon {
	flex-shrink: 0;
	width: 2.75rem;
	height: 2.75rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 0;
	background: var(--csg-ph-icon-bg);
	border: 1px solid var(--csg-ph-border);
	color: var(--csg-ph-accent);
	font-size: 1.25rem;
}

.csg-page-header__wording {
	min-width: 0;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
}

.csg-page-header__heading {
	margin: 0;
	font-size: clamp(1.25rem, 2.2vw, 1.5rem);
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.25;
	color: var(--csg-ph-text);
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.5rem 1rem;
}

.csg-page-header__title {
	color: var(--csg-ph-text);
}

/* 与题目编辑页一致：中英标题同一行（覆盖 bilingual.css 里 h1 .en-text { display:block }） */
.csg-page-header__heading > .csg-page-header__en,
.csg-page-header__heading > .en-text.csg-page-header__en {
	display: inline !important;
	margin-top: 0 !important;
	margin-left: 0;
	white-space: nowrap;
	vertical-align: baseline;
}

.csg-page-header__en,
.csg-page-header__heading .en-text {
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--csg-ph-muted) !important;
	font-style: normal !important;
	opacity: 1 !important;
}

.csg-page-header__meta-stack {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.375rem;
	min-width: 0;
}

.csg-page-header__meta-stack .en-text {
	text-transform: uppercase;
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	color: var(--csg-ph-muted) !important;
	font-style: normal !important;
	opacity: 1 !important;
}

.csg-page-header__chips {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
}

.csg-page-header__badge,
a.csg-page-header__badge {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.25rem 0.625rem;
	border-radius: 0;
	font-size: 0.75rem;
	font-weight: 600;
	text-decoration: none;
	color: var(--csg-ph-accent-fg) !important;
	background: var(--csg-ph-accent);
	border: 1px solid var(--csg-ph-accent);
	transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.csg-page-header__badge:hover {
	color: var(--csg-ph-accent-fg) !important;
	background: var(--csg-ph-accent-hover);
	border-color: var(--csg-ph-accent-hover);
}

.csg-page-header__actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
	flex-shrink: 0;
}

.csg-page-header__actions .btn {
	border-radius: 0;
	font-weight: 500;
	background-image: none !important;
	box-shadow: none !important;
}

.admin-page-header-actions .btn {
	background-image: none !important;
	box-shadow: none !important;
}

@media (max-width: 768px) {
	.csg-page-header__grid {
		flex-direction: column;
		align-items: stretch;
		padding: 1.1rem 1.25rem;
	}
	.csg-page-header__actions {
		justify-content: flex-end;
	}
}

@media (max-width: 576px) {
	.csg-page-header__icon {
		width: 2.5rem;
		height: 2.5rem;
		font-size: 1.1rem;
	}
	.csg-page-header__heading {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.25rem;
	}
}

/* ========== 旧版 .admin-page-header（同套扁平语言，无渐变） ========== */

.admin-page-header {
	position: relative;
	overflow: visible;
	border-radius: 0;
	border: 1px solid var(--csg-ph-border);
	background: var(--csg-ph-bg);
	box-shadow: var(--csg-ph-shadow);
	margin-bottom: 1.5rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.25rem 1.5rem;
	flex-wrap: wrap;
}

.admin-page-header-left {
	display: flex;
	align-items: center;
	flex-direction: row;
	gap: 1rem;
	flex: 1;
	min-width: 0;
}

.admin-page-header-right {
	display: flex;
	align-items: center;
	flex-direction: row;
	gap: 0.75rem;
	flex-shrink: 0;
	flex-wrap: wrap;
}

.admin-page-header-icon {
	background: var(--csg-ph-icon-bg);
	border: 1px solid var(--csg-ph-border);
	border-radius: 0;
	padding: 0;
	width: 2.75rem;
	height: 2.75rem;
	display: flex;
	align-items: center;
	justify-content: center;
}

.admin-page-header-icon i {
	color: var(--csg-ph-accent);
	font-size: 1.25rem;
}

.admin-page-header-title {
	font-size: clamp(1.25rem, 2.2vw, 1.5rem);
	font-weight: 600;
	letter-spacing: -0.02em;
	color: var(--csg-ph-text);
	margin: 0;
	display: flex;
	align-items: center;
	gap: 1rem;
	flex: 1;
	min-width: 0;
	flex-wrap: wrap;
}

.admin-page-header-title-main {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	color: var(--csg-ph-text);
}

.admin-page-header-title-right {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.25rem;
}

.admin-page-header-title-meta-right {
	margin-left: auto;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.25rem;
}

.admin-page-header-title .en-text,
.admin-page-header-title-right .en-text {
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--csg-ph-muted) !important;
	white-space: nowrap;
	font-style: normal !important;
	opacity: 1 !important;
}

.admin-page-header-id {
	background: var(--csg-ph-accent);
	color: var(--csg-ph-accent-fg) !important;
	font-size: 0.75rem;
	font-weight: 600;
	padding: 0.25rem 0.625rem;
	border-radius: 0;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	transition: background-color 0.12s ease, border-color 0.12s ease;
	border: 1px solid var(--csg-ph-accent);
	white-space: nowrap;
}

.admin-page-header-id:hover {
	color: var(--csg-ph-accent-fg) !important;
	text-decoration: none;
	background: var(--csg-ph-accent-hover);
	border-color: var(--csg-ph-accent-hover);
}

.admin-page-header-actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.admin-page-header-actions .btn {
	font-size: 0.875rem;
	padding: 0.375rem 0.75rem;
	border-radius: 0;
	font-weight: 500;
}

@media (max-width: 768px) {
	.admin-page-header {
		flex-direction: column;
		align-items: flex-start;
		padding: 1.1rem 1.25rem;
	}
	.admin-page-header-left {
		width: 100%;
		flex-wrap: wrap;
	}
	.admin-page-header-title {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.5rem;
	}
	.admin-page-header-title-right {
		align-items: flex-start;
	}
	.admin-page-header-actions {
		width: 100%;
		justify-content: flex-end;
	}
}

@media (max-width: 576px) {
	.admin-page-header-title {
		font-size: 1.125rem;
	}
	.admin-page-header-actions .btn {
		font-size: 0.8rem;
		padding: 0.25rem 0.5rem;
	}
	.admin-page-header-icon {
		width: 2.5rem;
		height: 2.5rem;
	}
	.admin-page-header-icon i {
		font-size: 1.1rem;
	}
}
