@import "../header-school.css";
@import "../footer.css";
@import "../dialog.css";
@import "../components/school-search.css";
@import "../components/school-category.css";
@import "../components/common-faqs.css";

.page-doc {
	padding-top: var(--app-header-school-height);
	display: flex;
	overflow: hidden;
}

::-webkit-scrollbar {
	width: 4px;
}

::-webkit-scrollbar-track {
	background: #f4f7fc;
}

::-webkit-scrollbar-thumb {
	background: #dcdcdc;
}

.app-header {
	border-bottom: 1px solid #e7e7e7;
}

.doc-category {
	flex-shrink: 0;
	width: 340px;

	position: relative;
}

.doc-category__wrapper {
	overflow: hidden auto;
	background: #ffffff;
	height: 100%;
}

.doc-category.sticky .doc-category__wrapper {
	position: fixed;
	width: 340px;
	top: var(--app-header-school-height);
	left: 0;
	height: calc(100vh - var(--app-header-school-height) - var(--app-header-school-lrpb));
}

.doc-category__search {
	display: flex;
	align-items: center;
	height: 44px;
	border: 1px solid #e7eefe;
	margin: 26px 2em 32px;
	border-radius: 100px;
	padding: 0 1em;
}

.doc-category__search__icon {
	font-size: 1.2em;
	color: var(--app-text-color-4);
	flex-shrink: 0;
	margin-right: 1em;
}

.doc-category__search__input {
	flex: 1;
	padding: 0 1em;
	border: none;
	outline: none;
	background: transparent;
}

.doc-category__item {
	padding-left: 1em;
}

.doc-category__item__content {
	display: flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.6em;
	cursor: pointer;
}

.doc-category__item__content:hover {
	color: var(--app-theme-secondary);
	font-weight: 600;
}

/* 当前路径上的栏目 / 当前文章：仅字色高亮（active 由 SchoolMenusModel::applyActiveByPath 写入） */
.doc-category__item__content.active {
	color: var(--app-theme-secondary);
	font-weight: 600;
}

.doc-category__item__name {
	color: inherit;
	text-decoration: none;
}

.doc-category__item__name.active {
	color: var(--app-theme-secondary);
	font-weight: 600;
}

.doc-category__item__arrow {
	font-size: 0.6em;
	flex-shrink: 0;
}

/* 有子级的栏目默认折叠，.open 时展开（与 initDocCategoryAccordion 的 classList.toggle 一致） */
.doc-category__item--branch > .doc-category__item__children {
	display: none;
}

.doc-category__item--branch.open > .doc-category__item__children {
	display: block;
}

.doc-category__item--branch > .doc-category__item__content .doc-category__item__arrow {
	transition: transform 0.2s ease;
}

.doc-category__item--branch.open > .doc-category__item__content .doc-category__item__arrow {
	transform: rotate(90deg);
}

.doc-category__item__arrow.hide {
	opacity: 0;
	user-select: none;
}

.doc-content {
	flex: 1;
	border-left: 1px solid #e7e7e7;
	width: 100%;
	overflow: hidden;
}

.doc-content__wrapper {
	max-width: 750px;
	margin: 0 auto;
	padding: 20px 20px 90px;
}

.doc-content img,
.doc-content video {
	max-width: 100% !important;
	margin: 1.5em auto !important;
}

.doc-directory {
	flex-shrink: 0;
	width: 340px;
	position: relative;
}

.doc-directory__wrapper {
	border-left: 1px solid #e7e7e7;
	padding-left: 2em;
	background: #fff;
	overflow: hidden auto;
}

.doc-directory.sticky .doc-directory__wrapper {
	position: fixed;
	width: 340px;
	top: var(--app-header-school-height);
	right: 0;
	height: calc(100vh - var(--app-header-school-height) - var(--app-header-school-lrpb));
}

.doc-directory__title {
	font-size: 1.28em;
	color: var(--app-text-color-2);
	font-weight: 500;
	margin: 74px 0 12px;
}

.doc-directory__item {
}

.doc-directory__item.lv2 .doc-directory__item__content {
	padding-left: 1em;
}

.doc-directory__item.lv3 .doc-directory__item__content {
	padding-left: 2em;
}

.doc-directory__item__content {
	padding: 0.6em 0;
	cursor: pointer;
	position: relative;
}

.doc-directory__item__content::before {
	content: "";
	display: block;
	width: 2px;
	height: 100%;
	background: var(--app-theme-secondary);
	position: absolute;
	left: -2em;
	top: 0;
	opacity: 0;
	user-select: none;
	transform: translateX(-50%);
}

.doc-directory__item__content.active {
	color: var(--app-theme-secondary);
	font-weight: 600;
}

.doc-directory__item__content.active::before {
	opacity: 1;
}

.doc-directory__item__content:hover {
	opacity: 0.8;
}

.page-doc-menus {
	height: 50px;
	width: 100%;
	align-items: center;
	justify-content: space-between;
	padding: 0 20px;
	display: none;
	position: fixed;
	top: var(--app-header-school-height);
	left: 0;
	z-index: 80;
	background: #fff;
	border-bottom: 1px solid #e7e7e7;
}

.page-doc-menu {
	display: flex;
	align-items: center;
	gap: 3px;
	cursor: pointer;
}

.app-footer {
	display: none;
	height: 0;
	overflow: hidden;
}

.doc-infos {
	margin: 2em 0 4em;
}

.doc-infos-title {
	font-size: var(--common-title-font-size);
	color: var(--app-text-color-2);
	font-weight: 500;
}

.doc-infos-items {
	display: flex;
	align-items: center;
	gap: 1.5em;
	color: var(--app-text-color-6);
	margin-top: 5px;
}

#detailContent *,
#detailContent *::before,
#detailContent *::after {
	margin: revert;
	padding: revert;
	box-sizing: revert;
}

@media screen and (max-width: 1366px) {
	.doc-category {
		width: 280px;
	}

	.doc-directory {
		display: none;
	}
}

@media screen and (max-width: 1024px) {
	.page-doc {
		padding-top: calc(var(--app-header-school-height) + 50px);
	}

	.page-doc-menus {
		display: flex;
	}

	.doc-category {
		position: fixed;
		width: 100%;
		height: 100%;
		z-index: 1000;
		background: rgba(0, 0, 0, 0.5);
		top: 0;
		left: -120%;
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		opacity: 0;
	}

	.doc-category.open {
		left: 0;
		opacity: 1;
		transition: opacity 200ms;
	}

	.doc-category__wrapper {
		width: 70%;
		height: 100%;
		overflow: hidden;
		display: flex;
		flex-direction: column;
	}

	.doc-category.sticky .doc-category__wrapper {
		position: static;
		width: 70%;
	}

	.doc-category__search {
		flex-shrink: 0;
	}

	.doc-category__list {
		flex: 1;
		overflow: hidden auto;
	}

	.doc-directory {
		position: fixed;
		width: 100%;
		height: 100%;
		z-index: 1000;
		background: rgba(0, 0, 0, 0.5);
		top: 0;
		left: -120%;
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		opacity: 0;
	}

	.doc-directory.open {
		left: 0;
		opacity: 1;
		transition: opacity 200ms;
		display: block;
	}

	.doc-directory__wrapper {
		width: 70%;
		height: 100%;
		overflow: hidden;
		display: flex;
		flex-direction: column;
		background: #ffffff;
	}

	.doc-directory.sticky .doc-directory__wrapper {
		position: static;
		width: 70%;
	}

	.doc-directory__title {
		flex-shrink: 0;
	}

	.doc-directory__list {
		flex: 1;
		overflow: hidden auto;
	}
}
