@charset "UTF-8";
/* CSS Document */

/* === 浮动目录面板样式 - 完全独立，不影响现有内容 === */
.float-toc-panel {
	position: fixed;
	left: 10px;
	top: 50%;
	transform: translateY(-50%);
	width: 240px;
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(8px);
	border: 1px solid rgba(0,0,0,0.1);
	border-radius: 24px;
	box-shadow: 0 20px 40px rgba(0,0,0,0.15);
	padding: 1.2rem 0.8rem 1rem 0.8rem;
	/* z-index 保持低层级，不遮挡主菜单 */
	z-index: 1020;
	font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	transition: all 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
	opacity: 1;
	visibility: visible;
}

/* ===== 小于1860px时的样式：默认缩小为图标 ===== */
@media (max-width: 1859.98px) {
	.float-toc-panel {
		width: 60px;
		height: 60px;
		padding: 0;
		border-radius: 50%;
		background: rgba(255,255,255,0.98);
		box-shadow: 0 10px 30px rgba(0,0,0,0.25), 0 0 0 1px rgba(13,110,253,0.2);
		left: 16px;
		transform: translateY(-50%);
		border: none;
		backdrop-filter: blur(10px);
		display: flex;
		align-items: center;
		justify-content: center;
		cursor: pointer;
		transition: all 0.3s ease;
		z-index: 1020;
	}

	/* 图标显示 - 使用 Bootstrap Icons */
	.float-toc-panel::before {
		content: "\F227";                /* bi-card-list 的 unicode */
		font-family: "bootstrap-icons" !important;
		font-size: 1.75rem;
		color: #0d6efd;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 100%;
		height: 100%;
		opacity: 1;
		transition: opacity 0.2s;
		line-height: 1;
	}

	/* 展开状态：恢复完整面板 */
	.float-toc-panel.expanded {
		width: 240px;
		height: auto;
		max-height: 70vh;
		overflow-y: auto;
		border-radius: 28px;
		padding: 1.2rem 0.8rem 1rem 0.8rem;
		background: rgba(255, 255, 255, 0.98);
		box-shadow: 0 25px 50px rgba(0,0,0,0.3);
		left: 16px;
		transform: translateY(-50%);
		cursor: default;
		display: block;
		z-index: 1020;
	}

	/* 展开时隐藏伪元素图标 */
	.float-toc-panel.expanded::before {
		display: none;
	}

	/* 隐藏按钮 (×) - 只在展开状态显示 */
	.float-toc-panel .hide-btn {
		display: none !important;
	}

	.float-toc-panel.expanded .hide-btn {
		display: flex !important;
		position: absolute;
		top: 16px;
		right: 10px;
		width: 28px;
		height: 28px;
		border-radius: 30px;
		background: rgba(0,0,0,0.04);
		border: none;
		color: #4b5563;
		align-items: center;
		justify-content: center;
		font-size: 1.2rem;
		cursor: pointer;
		transition: all 0.15s;
		z-index: 1060;
		padding: 0;
		line-height: 1;
	}

	.float-toc-panel.expanded .hide-btn:hover {
		background: rgba(13,110,253,0.1);
		color: #0d6efd;
		transform: scale(1.1);
	}

	/* 内容区域控制 */
	.float-toc-panel .toc-content {
		display: none;
	}

	.float-toc-panel.expanded .toc-content {
		display: block;
	}
}

/* ===== 大于等于1860px时的样式：始终展开 ===== */
@media (min-width: 1860px) {
	.float-toc-panel {
		width: 240px;
		padding: 1.2rem 0.8rem 1rem 0.8rem;
		background: rgba(255, 255, 255, 0.92);
		z-index: 1020;
	}

	.float-toc-panel::before {
		display: none;
	}

	.float-toc-panel .toc-content {
		display: block;
	}

	/* 隐藏按钮在大屏时也显示，但功能不同：点击后最小化 */
	.float-toc-panel .hide-btn {
		display: flex;
		position: absolute;
		top: 16px;
		right: 10px;
		width: 28px;
		height: 28px;
		border-radius: 30px;
		background: rgba(0,0,0,0.04);
		border: none;
		color: #4b5563;
		align-items: center;
		justify-content: center;
		font-size: 1.2rem;
		cursor: pointer;
		transition: all 0.15s;
		z-index: 1060;
		padding: 0;
		line-height: 1;
	}

	.hide-btn:hover {
		background: rgba(13,110,253,0.1);
		color: #0d6efd;
		transform: scale(1.1);
	}

	/* 大屏的最小化状态 */
	.float-toc-panel.minimized {
		width: 56px;
		height: 56px;
		padding: 0;
		border-radius: 50%;
		background: rgba(255,255,255,0.95);
		box-shadow: 0 8px 22px rgba(0,0,0,0.2);
		cursor: pointer;
		display: flex;
		align-items: center;
		justify-content: center;
		z-index: 1020;
	}

	.float-toc-panel.minimized .toc-content,
	.float-toc-panel.minimized .hide-btn {
		display: none !important;
	}

	.float-toc-panel.minimized::before {
		display: flex;
		content: "\F227";
		font-family: "bootstrap-icons" !important;
		font-size: 1.75rem;
		color: #0d6efd;
	}
}

/* 通用内容样式 */
.float-toc-panel .toc-title {
	font-weight: 600;
	font-size: 1.1rem;
	margin-bottom: 1rem;
	padding-bottom: 0.6rem;
	border-bottom: 1px dashed rgba(0,0,0,0.15);
	display: flex;
	align-items: center;
	gap: 8px;
	color: #1e293b;
	padding-right: 30px;
}

.float-toc-panel .toc-title i {
	color: #0d6efd;
	font-size: 1.2rem;
}

.float-toc-panel .toc-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.float-toc-panel .toc-item {
	margin-bottom: 0.5rem;
}

.float-toc-panel .toc-link {
	display: block;
	padding: 0.5rem 1rem;
	border-radius: 30px;
	color: #334155;
	text-decoration: none;
	font-size: 0.95rem;
	font-weight: 450;
	transition: all 0.15s;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	background-color: transparent;
	border: none;
	width: 100%;
	text-align: left;
}

.float-toc-panel .toc-link:hover {
	background-color: rgba(13, 110, 253, 0.08);
	color: #0d6efd;
	padding-left: 1.5rem;
}

.float-toc-panel .toc-item.level-2 .toc-link {
	padding-left: 2rem;
	font-size: 0.88rem;
	color: #475569;
}

.float-toc-panel .toc-item.level-3 .toc-link {
	padding-left: 2.8rem;
	font-size: 0.84rem;
	color: #64748b;
}

.float-toc-panel .toc-footer {
	margin-top: 1rem;
	text-align: center;
	font-size: 0.7rem;
	color: #94a3b8;
}
