:root {
	color-scheme: light;
	font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* {
	box-sizing: border-box;
}

html,
body {
	width: 100%;
	height: 100%;
	margin: 0;
	overflow: hidden;
}

.yhj-brochure-viewer {
	display: grid;
	grid-template-rows: 58px minmax(0, 1fr) 64px;
	color: #24364d;
	background:
		radial-gradient(circle at 50% 38%, rgba(255, 255, 255, .96) 0 24%, rgba(233, 244, 255, .92) 62%, rgba(198, 224, 248, .96) 100%),
		linear-gradient(135deg, #eaf5ff, #cfe8ff);
}

.brochure-topbar {
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding: 0 clamp(14px, 3vw, 40px);
	border-bottom: 1px solid rgba(42, 112, 178, .18);
	background: rgba(255, 255, 255, .9);
	box-shadow: 0 3px 16px rgba(34, 83, 128, .08);
	backdrop-filter: blur(10px);
}

.brochure-topbar h1 {
	min-width: 0;
	margin: 0;
	overflow: hidden;
	font-size: clamp(16px, 2vw, 22px);
	font-weight: 700;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.brochure-topbar__actions {
	display: flex;
	flex: 0 0 auto;
	gap: 8px;
}

.brochure-button,
.brochure-control {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 38px;
	border: 1px solid rgba(33, 112, 188, .28);
	border-radius: 8px;
	color: #125b9d;
	background: #fff;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: color .18s ease, background .18s ease, transform .18s ease;
}

.brochure-button {
	padding: 0 14px;
}

.brochure-button:hover,
.brochure-control:hover:not(:disabled) {
	color: #fff;
	background: #177cc3;
	transform: translateY(-1px);
}

.brochure-button:focus-visible,
.brochure-control:focus-visible {
	outline: 3px solid rgba(23, 124, 195, .3);
	outline-offset: 2px;
}

.brochure-stage {
	position: relative;
	display: flex;
	min-width: 0;
	min-height: 0;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	padding: 12px 20px;
}

.brochure-book {
	display: flex;
	align-items: center;
	justify-content: center;
	filter: drop-shadow(0 15px 22px rgba(26, 61, 91, .2));
	transition: transform .25s ease;
}

.brochure-book canvas {
	max-width: 100%;
}

.brochure-loading {
	position: absolute;
	z-index: 5;
	top: 50%;
	left: 50%;
	padding: 12px 18px;
	transform: translate(-50%, -50%);
	border-radius: 999px;
	color: #fff;
	background: rgba(14, 86, 146, .88);
	box-shadow: 0 8px 24px rgba(11, 62, 106, .2);
}

.brochure-loading[hidden] {
	display: none;
}

.brochure-loading.is-error {
	max-width: min(90vw, 520px);
	border-radius: 10px;
	background: #b42318;
	text-align: center;
}

.brochure-toolbar {
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 10px max(14px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
	border-top: 1px solid rgba(42, 112, 178, .16);
	background: rgba(255, 255, 255, .92);
	backdrop-filter: blur(10px);
}

.brochure-control {
	width: 42px;
	padding: 0;
	font-size: 28px;
	line-height: 1;
}

.brochure-control--wide {
	width: auto;
	padding: 0 16px;
	font-size: 14px;
}

.brochure-control:disabled {
	opacity: .36;
	cursor: not-allowed;
}

.brochure-status {
	min-width: 74px;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	text-align: center;
}

.brochure-noscript {
	position: fixed;
	z-index: 20;
	top: 70px;
	left: 50%;
	padding: 12px;
	transform: translateX(-50%);
	background: #fff;
}

@media (max-width: 640px) {
	.yhj-brochure-viewer {
		grid-template-rows: 52px minmax(0, 1fr) 62px;
	}

	.brochure-topbar {
		gap: 8px;
	}

	.brochure-topbar h1 {
		font-size: 15px;
	}

	.brochure-button {
		min-height: 34px;
		padding: 0 9px;
		font-size: 12px;
	}

	.brochure-stage {
		padding: 8px;
	}
}

@media (min-width: 801px) {
	.brochure-book.is-front-cover {
		clip-path: inset(0 0 0 50%);
		transform: translateX(-25%);
	}

	.brochure-book.is-back-cover {
		clip-path: inset(0 50% 0 0);
		transform: translateX(25%);
	}
}

@media (max-width: 390px) {
	.brochure-topbar__actions .brochure-button:first-child {
		display: none;
	}
}
