/*!
 * PBF Cookie Consent v1.0.0
 * 自带同意横幅样式。不含任何外部资源（无字体、无图标、无图片），
 * 因此不会成为新的追踪面，也不会拖慢首屏。
 */

.pbf-cc {
	--pbf-cc-accent: #0b6bcb;
	--pbf-cc-bg: #ffffff;
	--pbf-cc-fg: #1b2430;
	--pbf-cc-muted: #5b6875;
	--pbf-cc-line: #e2e6eb;
	--pbf-cc-radius: 12px;
	--pbf-cc-shadow: 0 10px 40px rgba(15, 25, 40, 0.18);
	--pbf-cc-z: 2147483000;

	position: fixed;
	inset: auto 0 0 0;
	z-index: var(--pbf-cc-z);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
	font-size: 14px;
	line-height: 1.55;
	color: var(--pbf-cc-fg);
	-webkit-font-smoothing: antialiased;
}

/* 深色配色：--dark 强制深色；--auto 跟随系统 */
.pbf-cc--dark {
	--pbf-cc-bg: #1c222b;
	--pbf-cc-fg: #f2f5f8;
	--pbf-cc-muted: #a8b3bf;
	--pbf-cc-line: #333c47;
}

@media (prefers-color-scheme: dark) {
	.pbf-cc--auto {
		--pbf-cc-bg: #1c222b;
		--pbf-cc-fg: #f2f5f8;
		--pbf-cc-muted: #a8b3bf;
		--pbf-cc-line: #333c47;
	}
}

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

/*
 * 根容器是一层透明的定位外壳。它本身不吃点击，只有真正的子元素才接管事件 ——
 * 否则横幅被关掉之后，这层空壳还会在页面底部挡掉一条区域的点击。
 */
.pbf-cc {
	pointer-events: none;
}

.pbf-cc > * {
	pointer-events: auto;
}

/* 居中模式这层同时充当遮罩，需要自己接收点击。 */
.pbf-cc--center {
	pointer-events: auto;
}

/* ── 横幅本体 ───────────────────────────────────────────────────────────── */

.pbf-cc__banner {
	background: var(--pbf-cc-bg);
	border-top: 1px solid var(--pbf-cc-line);
	box-shadow: var(--pbf-cc-shadow);
	animation: pbf-cc-rise 0.28s ease-out both;
}

@keyframes pbf-cc-rise {
	from { transform: translateY(14px); opacity: 0; }
	to   { transform: translateY(0);    opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.pbf-cc__banner { animation: none; }
}

.pbf-cc__inner {
	max-width: 1180px;
	margin: 0 auto;
	padding: 18px 20px;
	display: flex;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
}

.pbf-cc__copy {
	flex: 1 1 420px;
	min-width: 260px;
}

.pbf-cc__title {
	margin: 0 0 4px;
	font-size: 15px;
	font-weight: 700;
	color: var(--pbf-cc-fg);
	line-height: 1.35;
}

.pbf-cc__msg {
	margin: 0;
	color: var(--pbf-cc-muted);
	font-size: 13px;
}

.pbf-cc__link {
	color: var(--pbf-cc-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.pbf-cc__link:hover {
	text-decoration: none;
}

.pbf-cc__actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
}

/* ── 按钮 ──────────────────────────────────────────────────────────────── */

.pbf-cc__btn {
	appearance: none;
	border: 1px solid transparent;
	border-radius: 8px;
	padding: 10px 16px;
	font-size: 13px;
	font-weight: 600;
	font-family: inherit;
	line-height: 1.2;
	cursor: pointer;
	white-space: nowrap;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* 主按钮与拒绝按钮视觉权重刻意接近，避免暗黑模式诱导 */
.pbf-cc__btn--solid {
	background: var(--pbf-cc-accent);
	border-color: var(--pbf-cc-accent);
	color: #fff;
}

.pbf-cc__btn--solid:hover {
	filter: brightness(0.92);
}

.pbf-cc__btn--outline {
	background: transparent;
	border-color: var(--pbf-cc-line);
	color: var(--pbf-cc-fg);
}

.pbf-cc__btn--outline:hover {
	border-color: var(--pbf-cc-accent);
	color: var(--pbf-cc-accent);
}

.pbf-cc__btn--ghost {
	background: var(--pbf-cc-accent);
	border-color: var(--pbf-cc-accent);
	color: #fff;
}

.pbf-cc__btn--ghost:hover {
	filter: brightness(0.92);
}

/* 「偏好设置」是次要出口，做成文字样式但不缩小点击面积 */
.pbf-cc__btn--plain {
	background: transparent;
	border-color: transparent;
	color: var(--pbf-cc-muted);
	text-decoration: underline;
	text-underline-offset: 3px;
	padding-left: 6px;
	padding-right: 6px;
}

.pbf-cc__btn--plain:hover {
	color: var(--pbf-cc-accent);
}

.pbf-cc__btn:focus-visible,
.pbf-cc__x:focus-visible,
.pbf-cc__pill:focus-visible,
.pbf-cc__reopen:focus-visible,
.pbf-cc__switch input:focus-visible + .pbf-cc__track {
	outline: 2px solid var(--pbf-cc-accent);
	outline-offset: 2px;
}

/* ── 位置变体 ──────────────────────────────────────────────────────────── */

.pbf-cc--bottom-left,
.pbf-cc--bottom-right {
	inset: auto auto 16px 16px;
	max-width: min(440px, calc(100vw - 32px));
}

.pbf-cc--bottom-right {
	inset: auto 16px 16px auto;
}

.pbf-cc--bottom-left .pbf-cc__banner,
.pbf-cc--bottom-right .pbf-cc__banner {
	border: 1px solid var(--pbf-cc-line);
	border-radius: var(--pbf-cc-radius);
	overflow: hidden;
}

.pbf-cc--bottom-left .pbf-cc__inner,
.pbf-cc--bottom-right .pbf-cc__inner {
	padding: 16px;
	display: block;
}

.pbf-cc--bottom-left .pbf-cc__actions,
.pbf-cc--bottom-right .pbf-cc__actions {
	margin-top: 14px;
}

.pbf-cc--bottom-left .pbf-cc__actions .pbf-cc__btn--solid,
.pbf-cc--bottom-left .pbf-cc__actions .pbf-cc__btn--outline,
.pbf-cc--bottom-right .pbf-cc__actions .pbf-cc__btn--solid,
.pbf-cc--bottom-right .pbf-cc__actions .pbf-cc__btn--outline {
	flex: 1 1 auto;
	text-align: center;
}

.pbf-cc--center {
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(12, 18, 26, 0.45);
	padding: 20px;
}

.pbf-cc--center .pbf-cc__banner {
	border-radius: var(--pbf-cc-radius);
	max-width: 520px;
	width: 100%;
}

.pbf-cc--center .pbf-cc__inner {
	display: block;
	padding: 22px;
}

.pbf-cc--center .pbf-cc__actions {
	margin-top: 18px;
}

/* ── 悬浮重开按钮 ──────────────────────────────────────────────────────── */

.pbf-cc__pill {
	position: fixed;
	left: 14px;
	bottom: 14px;
	z-index: var(--pbf-cc-z);
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: var(--pbf-cc-bg);
	color: var(--pbf-cc-fg);
	border: 1px solid var(--pbf-cc-line);
	border-radius: 999px;
	padding: 8px 14px;
	font-size: 12px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(15, 25, 40, 0.14);
}

.pbf-cc__pill:hover {
	border-color: var(--pbf-cc-accent);
	color: var(--pbf-cc-accent);
}

/* 短代码入口：样式贴近正文链接，不突兀 */
.pbf-cc__reopen {
	appearance: none;
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	font: inherit;
	color: inherit;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ── 偏好面板 ──────────────────────────────────────────────────────────── */

.pbf-cc__modal[hidden] {
	display: none;
}

.pbf-cc__modal {
	position: fixed;
	inset: 0;
	z-index: calc(var(--pbf-cc-z) + 1);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 18px;
}

.pbf-cc__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 15, 22, 0.5);
	animation: pbf-cc-fade 0.2s ease-out both;
}

@keyframes pbf-cc-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.pbf-cc__sheet {
	position: relative;
	width: 100%;
	max-width: 560px;
	max-height: min(86vh, 720px);
	display: flex;
	flex-direction: column;
	background: var(--pbf-cc-bg);
	color: var(--pbf-cc-fg);
	border: 1px solid var(--pbf-cc-line);
	border-radius: var(--pbf-cc-radius);
	box-shadow: var(--pbf-cc-shadow);
	overflow: hidden;
	animation: pbf-cc-pop 0.22s ease-out both;
}

@keyframes pbf-cc-pop {
	from { transform: translateY(10px) scale(0.99); opacity: 0; }
	to   { transform: none; opacity: 1; }
}

.pbf-cc__sheet-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 18px;
	border-bottom: 1px solid var(--pbf-cc-line);
}

.pbf-cc__sheet-title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--pbf-cc-fg);
}

.pbf-cc__x {
	appearance: none;
	background: transparent;
	border: 0;
	color: var(--pbf-cc-muted);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
	border-radius: 6px;
}

.pbf-cc__x:hover {
	color: var(--pbf-cc-fg);
}

.pbf-cc__sheet-body {
	padding: 8px 18px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

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

.pbf-cc__cat {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 0;
	border-bottom: 1px solid var(--pbf-cc-line);
}

.pbf-cc__cat:last-child {
	border-bottom: 0;
}

.pbf-cc__cat-copy {
	flex: 1 1 auto;
	min-width: 0;
}

.pbf-cc__cat-name {
	margin: 0 0 3px;
	font-size: 14px;
	font-weight: 600;
	color: var(--pbf-cc-fg);
}

.pbf-cc__cat-desc {
	margin: 0;
	font-size: 12.5px;
	color: var(--pbf-cc-muted);
}

.pbf-cc__badge {
	display: inline-block;
	margin-left: 6px;
	padding: 1px 7px;
	border-radius: 999px;
	background: rgba(11, 108, 203, 0.12); /* color-mix 不支持时的回退色 */
	background: color-mix(in srgb, var(--pbf-cc-accent) 12%, transparent);
	color: var(--pbf-cc-accent);
	font-size: 11px;
	font-weight: 600;
	vertical-align: 1px;
}

/* ── 开关 ──────────────────────────────────────────────────────────────── */

.pbf-cc__switch {
	position: relative;
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	cursor: pointer;
	margin-top: 2px;
}

.pbf-cc__switch input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	margin: 0;
}

.pbf-cc__track {
	display: block;
	width: 44px;
	height: 24px;
	border-radius: 999px;
	background: var(--pbf-cc-line);
	transition: background-color 0.18s ease;
}

.pbf-cc__knob {
	display: block;
	width: 18px;
	height: 18px;
	margin: 3px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
	transition: transform 0.18s ease;
}

.pbf-cc__switch input:checked + .pbf-cc__track {
	background: var(--pbf-cc-accent);
}

.pbf-cc__switch input:checked + .pbf-cc__track .pbf-cc__knob {
	transform: translateX(20px);
}

/* ── 面板底部操作 ──────────────────────────────────────────────────────── */

.pbf-cc__sheet-foot {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: flex-end;
	padding: 14px 18px;
	border-top: 1px solid var(--pbf-cc-line);
	background: var(--pbf-cc-bg);
}

/* ── 无障碍辅助 ────────────────────────────────────────────────────────── */

.pbf-cc__sr,
.pbf-cc .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ── 小屏 ──────────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
	.pbf-cc__inner {
		padding: 16px;
	}

	.pbf-cc__actions {
		width: 100%;
	}

	.pbf-cc__actions .pbf-cc__btn--solid,
	.pbf-cc__actions .pbf-cc__btn--outline {
		flex: 1 1 46%;
		text-align: center;
	}

	.pbf-cc__actions .pbf-cc__btn--plain {
		flex: 1 1 100%;
		text-align: center;
		order: 3;
	}

	.pbf-cc__sheet-foot {
		flex-direction: column-reverse;
	}

	.pbf-cc__sheet-foot .pbf-cc__btn {
		width: 100%;
		text-align: center;
	}
}
