﻿.ttbp-fullpage-book-template {
	--ttbp-bg: #f3f3f3;
	--ttbp-bg-soft: #e7e7e7;
	--ttbp-surface: #ffffff;
	--ttbp-panel: #1c1e27;
	--ttbp-panel-soft: #2a2d39;
	--ttbp-text: #333333;
	--ttbp-muted: #4b5563;
	--ttbp-border: #ececec;
	--ttbp-accent: #ff9b0a;
	--ttbp-accent-strong: #ff991f;
	--ttbp-danger: #ea3943;
	--ttbp-shadow-soft: 0 0 20px #ccc;
	--ttbp-shadow-deep: 0 18px 40px rgba(28, 30, 39, 0.18);
	margin: 0;
	background: radial-gradient(circle at 15% -20%, #ffe7be 0%, var(--ttbp-bg) 45%, #efefef 100%);
	color: var(--ttbp-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.ttbp-fullpage-book-template * {
	box-sizing: border-box;
}

.ttbp-fullpage-book-template .ttbp-book-ui {
	min-height: 100vh;
}

.ttbp-fullpage-book-template .ttbp-book-ui-topbar {
	position: sticky;
	top: 0;
	z-index: 50;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
	background: linear-gradient(180deg, rgba(28, 30, 39, 0.98) 0%, rgba(42, 45, 57, 0.96) 100%);
	backdrop-filter: blur(6px);
}

.ttbp-fullpage-book-template .ttbp-book-ui-topbar-inner {
	width: min(1140px, 92%);
	min-height: 72px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
}

.ttbp-fullpage-book-template .ttbp-book-ui-title {
	margin: 0;
	font-size: clamp(1.15rem, 2.1vw, 1.85rem);
	font-weight: 700;
	color: #fff;
	line-height: 1.2;
	min-width: 0;
	flex: 1 1 auto;
}

.ttbp-fullpage-book-template .ttbp-book-ui-actions {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.ttbp-fullpage-book-template .ttbp-action-btn,
.ttbp-fullpage-book-template .ttbp-nav-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid transparent;
	text-decoration: none;
	padding: 10px 22px;
	min-height: 42px;
	border-radius: 10px;
	font-size: 0.92rem;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	letter-spacing: 0.2px;
	transition: 0.2s ease;
}

.ttbp-fullpage-book-template .ttbp-action-btn {
	background: var(--ttbp-accent);
	border-color: #e08a07;
	color: #111;
}

.ttbp-fullpage-book-template .ttbp-action-btn:hover {
	background: var(--ttbp-accent-strong);
}

.ttbp-fullpage-book-template .ttbp-action-btn.ghost {
	background: rgba(255, 255, 255, 0.09);
	border-color: rgba(255, 255, 255, 0.22);
	color: #fff;
}

.ttbp-fullpage-book-template .ttbp-catalog {
	width: min(1140px, 92%);
	margin: 32px auto 42px;
}

.ttbp-fullpage-book-template .ttbp-catalog-header {
	margin-bottom: 22px;
}

.ttbp-fullpage-book-template .ttbp-catalog-subtitle {
	margin: 0 0 8px;
	font-size: clamp(1rem, 1.8vw, 1.18rem);
	color: #111;
	font-weight: 600;
}

.ttbp-fullpage-book-template .ttbp-catalog-description {
	margin: 0;
	color: var(--ttbp-muted);
	line-height: 1.6;
}

.ttbp-fullpage-book-template .ttbp-promo-box {
	width: 200px;
	height: 200px;
	border-radius: 14px;
	border: 1px solid var(--ttbp-border);
	background: #fff;
	box-shadow: var(--ttbp-shadow-soft);
	overflow: hidden;
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 42;
}

.ttbp-fullpage-book-template .ttbp-promo-box-catalog {
	margin: 0;
}

.ttbp-fullpage-book-template .ttbp-promo-box-detail {
	margin: 0;
}

.ttbp-fullpage-book-template .ttbp-promo-link,
.ttbp-fullpage-book-template .ttbp-promo-image {
	display: block;
	width: 100%;
	height: 100%;
}

.ttbp-fullpage-book-template .ttbp-promo-image {
	object-fit: cover;
}

.ttbp-fullpage-book-template .ttbp-promo-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 18px;
	text-align: center;
	color: var(--ttbp-muted);
	background: linear-gradient(145deg, #ffffff 0%, #f6f6f6 100%);
}

.ttbp-fullpage-book-template .ttbp-promo-placeholder strong {
	font-size: 1.06rem;
	color: #111;
}

.ttbp-fullpage-book-template .ttbp-promo-placeholder span {
	font-size: 0.86rem;
	line-height: 1.5;
}

.ttbp-fullpage-book-template .ttbp-chapter-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(240px, 1fr));
	gap: 22px;
}

.ttbp-fullpage-book-template .ttbp-chapter-card {
	text-decoration: none;
	background: linear-gradient(180deg, #ffffff 0%, #f8f8f8 100%);
	border: 6px solid #2b2b2b;
	border-radius: 10px;
	padding: 26px 22px;
	min-height: 215px;
	color: var(--ttbp-text);
	box-shadow: var(--ttbp-shadow-soft);
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 10px;
	transform: translateY(14px);
	opacity: 0;
	animation: ttbp-slide-up 0.45s ease-out forwards;
}

.ttbp-fullpage-book-template .ttbp-chapter-card:nth-child(2) {
	animation-delay: 0.06s;
}

.ttbp-fullpage-book-template .ttbp-chapter-card:nth-child(3) {
	animation-delay: 0.12s;
}

.ttbp-fullpage-book-template .ttbp-chapter-card:nth-child(4) {
	animation-delay: 0.18s;
}

.ttbp-fullpage-book-template .ttbp-chapter-card:nth-child(5) {
	animation-delay: 0.24s;
}

.ttbp-fullpage-book-template .ttbp-chapter-card-icon {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.95rem;
	font-weight: 700;
	background: rgba(255, 155, 10, 0.2);
	color: #000;
}

.ttbp-fullpage-book-template .ttbp-chapter-card-label {
	color: #9a6d00;
	font-weight: 700;
}

.ttbp-fullpage-book-template .ttbp-chapter-card-title {
	margin: 0;
	text-align: center;
	font-size: clamp(1.45rem, 2.7vw, 2rem);
	line-height: 1.1;
	font-weight: 700;
}

.ttbp-fullpage-book-template .ttbp-reader-layout {
	display: grid;
	grid-template-columns: 300px minmax(0, 1fr);
	min-height: calc(100vh - 72px);
}

.ttbp-fullpage-book-template .ttbp-reader-sidebar {
	position: sticky;
	top: 72px;
	align-self: start;
	height: calc(100vh - 72px);
	background: linear-gradient(180deg, var(--ttbp-panel) 0%, var(--ttbp-panel-soft) 100%);
	padding: 22px 16px;
	border-right: 1px solid rgba(255, 255, 255, 0.09);
	overflow: auto;
}

.ttbp-fullpage-book-template .ttbp-sidebar-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 14px;
}

.ttbp-fullpage-book-template .ttbp-sidebar-header h2 {
	margin: 0;
	font-size: 1.4rem;
	color: var(--ttbp-accent);
}

.ttbp-fullpage-book-template .ttbp-sidebar-toggle {
	display: none;
	border: 0;
	background: transparent;
	color: var(--ttbp-accent);
	font-size: 1.2rem;
	cursor: pointer;
}

.ttbp-fullpage-book-template .ttbp-sidebar-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ttbp-fullpage-book-template .ttbp-sidebar-list a {
	display: block;
	text-decoration: none;
	color: #e5e7eb;
	padding: 11px 10px;
	border-radius: 9px;
	border: 1px solid transparent;
	font-size: 0.93rem;
	line-height: 1.35;
	transition: 0.2s ease;
}

.ttbp-fullpage-book-template .ttbp-sidebar-list a:hover {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.16);
}

.ttbp-fullpage-book-template .ttbp-sidebar-list a.is-active {
	background: rgba(255, 155, 10, 0.18);
	border-color: rgba(255, 155, 10, 0.42);
	color: #fff;
}

.ttbp-fullpage-book-template .ttbp-reader-main {
	padding: clamp(20px, 3vw, 38px);
}

.ttbp-fullpage-book-template .ttbp-reader-header {
	padding-bottom: 14px;
	border-bottom: 1px solid var(--ttbp-border);
}

.ttbp-fullpage-book-template .ttbp-reader-chapter-title {
	margin: 0;
	font-size: clamp(1.7rem, 3.4vw, 2.7rem);
	color: #111;
	line-height: 1.14;
}

.ttbp-fullpage-book-template .ttbp-reader-progress-text {
	margin: 10px 0 8px;
	color: var(--ttbp-muted);
	font-size: 0.94rem;
}

.ttbp-fullpage-book-template .ttbp-reader-progress-track {
	width: min(360px, 100%);
	height: 7px;
	background: #e9d8b8;
	border-radius: 999px;
	overflow: hidden;
}

.ttbp-fullpage-book-template .ttbp-reader-progress-track span {
	display: block;
	height: 100%;
	background: linear-gradient(90deg, var(--ttbp-accent), var(--ttbp-accent-strong));
}

.ttbp-fullpage-book-template .ttbp-reader-content {
	margin-top: 20px;
	padding: clamp(18px, 3vw, 30px);
	border: 1px solid var(--ttbp-border);
	border-radius: 16px;
	background: var(--ttbp-surface);
	box-shadow: var(--ttbp-shadow-deep);
}

.ttbp-fullpage-book-template .ttbp-reader-content p {
	line-height: 1.8;
	color: #222;
	margin: 0 0 16px;
}

.ttbp-fullpage-book-template .ttbp-reader-content h1,
.ttbp-fullpage-book-template .ttbp-reader-content h2,
.ttbp-fullpage-book-template .ttbp-reader-content h3 {
	color: #121212;
	margin-top: 1.2em;
}

.ttbp-fullpage-book-template .ttbp-reader-footer {
	margin-top: 18px;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: space-between;
}

.ttbp-fullpage-book-template .ttbp-nav-btn {
	background: #111;
	color: #fff;
	border-color: #111;
}

.ttbp-fullpage-book-template .ttbp-nav-btn:hover {
	background: var(--ttbp-accent);
	border-color: #e08a07;
	color: #111;
}

.ttbp-fullpage-book-template .ttbp-nav-btn.ghost {
	background: #fff;
	color: #111;
	border-color: #d6d6d6;
}

.ttbp-fullpage-book-template .ttbp-nav-btn.ghost:hover {
	background: #f7f7f7;
}

.ttbp-fullpage-book-template .ttbp-nav-btn.is-disabled {
	background: #e2e2e2;
	color: #8a8a8a;
	border-color: #d4d4d4;
	pointer-events: none;
}

.ttbp-fullpage-book-template .ttbp-empty-state {
	width: min(820px, 92%);
	margin: 42px auto;
	padding: 32px;
	text-align: center;
	background: #fff;
	border: 1px solid var(--ttbp-border);
	border-radius: 14px;
	box-shadow: var(--ttbp-shadow-soft);
}

.ttbp-fullpage-book-template .ttbp-empty-state h2 {
	margin: 0 0 8px;
}

.ttbp-fullpage-book-template .ttbp-empty-state p {
	margin: 0;
	color: var(--ttbp-muted);
}

@keyframes ttbp-slide-up {
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

@media (max-width: 980px) {
	.ttbp-fullpage-book-template .ttbp-reader-layout {
		grid-template-columns: 1fr;
	}

	.ttbp-fullpage-book-template .ttbp-reader-sidebar {
		position: relative;
		top: 0;
		height: auto;
		max-height: 64px;
		overflow: hidden;
		transition: max-height 0.24s ease;
		padding: 12px 14px;
	}

	.ttbp-fullpage-book-template .ttbp-sidebar-toggle {
		display: inline-flex;
	}

	.ttbp-fullpage-book-template .ttbp-sidebar-header {
		margin-bottom: 0;
	}

	.ttbp-fullpage-book-template .ttbp-sidebar-header h2 {
		font-size: 1.22rem;
	}

	.ttbp-fullpage-book-template .ttbp-reader-sidebar .ttbp-sidebar-list {
		display: none;
	}

	.ttbp-fullpage-book-template .ttbp-reader-sidebar:not(.is-collapsed) {
		max-height: 230px;
	}

	.ttbp-fullpage-book-template .ttbp-reader-sidebar:not(.is-collapsed) .ttbp-sidebar-list {
		display: flex;
		max-height: 154px;
		overflow: auto;
		padding-right: 4px;
	}
}

@media (max-width: 760px) {
	.ttbp-fullpage-book-template .ttbp-chapter-grid {
		grid-template-columns: 1fr;
	}

	.ttbp-fullpage-book-template .ttbp-chapter-card {
		min-height: 188px;
	}

	.ttbp-fullpage-book-template .ttbp-book-ui-topbar-inner {
		min-height: 64px;
	}

	.ttbp-fullpage-book-template .ttbp-reader-footer {
		justify-content: flex-start;
	}

	.ttbp-fullpage-book-template .ttbp-book-ui-topbar-inner {
		gap: 10px;
	}

	.ttbp-fullpage-book-template .ttbp-action-btn {
		padding: 9px 18px;
		min-height: 40px;
	}

	.ttbp-fullpage-book-template .ttbp-promo-box {
		right: 10px;
		bottom: 10px;
		width: 100px;
		height: 100px;
	}
}

