/* 产品文档中心页：隐藏站点主导航，使用独立顶栏 */
body.product-doc-center-page .custom-header,
body.product-doc-center-page .mobile-header,
body.product-doc-center-page .search-panel,
body.product-doc-center-page .site-footer,
body.product-doc-center-page footer,
body:has(.product-doc-center) .custom-header,
body:has(.product-doc-center) .mobile-header,
body:has(.product-doc-center) .search-panel,
body:has(.product-doc-center) .site-footer,
body:has(.product-doc-center) footer {
	display: none !important;
}

body.product-doc-center-page {
	--doc-topbar-height: 88px;
	--doc-topbar-sticky-offset: 88px;
	--doc-toc-fixed-top: 108px;
	--doc-page-pad-x: 80px;
	--doc-sidebar-width: 280px;
	--doc-body-grid: var(--doc-sidebar-width) minmax(0, 1fr);
	--doc-topbar-grid: var(--doc-sidebar-width) minmax(0, 1fr) var(--doc-page-pad-x);
	--doc-toc-width: 240px;
	--doc-body-pad-y: 40px;
	--doc-list-gap: 16px;
	--doc-toc-top-gap: 20px;
	--doc-accent: #0075c9;
	--doc-accent-hover: #005fa3;
	--doc-header-bg: #EEF3FB;
	--doc-page-bg: #f5f7fa;
	--doc-border: #e4e9ef;
	--doc-text: #333333;
	--doc-text-muted: #666666;
	--doc-text-light: #999999;
	background: var(--doc-page-bg);
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

.product-doc-center {
	min-height: 100vh;
	background: var(--doc-page-bg);
	color: var(--doc-text);
}

/* ── 顶栏（与下方两栏布局对齐） ── */
.product-doc-center__topbar {
	position: sticky;
	top: 0;
	z-index: 200;
	background: var(--doc-header-bg);
}

body.admin-bar .product-doc-center__topbar {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar .product-doc-center__topbar {
		top: 46px;
	}
}

.product-doc-center__topbar-wrap {
	box-sizing: border-box;
}

.product-doc-center__topbar-inner {
	display: grid;
	grid-template-columns: var(--doc-topbar-grid);
	align-items: stretch;
	width: 100%;
	min-height: 88px;
	box-sizing: border-box;
}

.product-doc-center__topbar-brand {
	grid-column: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 8px;
	min-width: 0;
	/* padding: 20px 24px 20px var(--doc-page-pad-x); */
	border-right: 1px solid var(--doc-border);
	box-sizing: border-box;
}

/* Logo 留空：自行在模板内添加 img，或通过 CSS 设置 background-image */
.product-doc-center__logo {
	width: auto;
	min-height: 28px;
	flex-shrink: 0;
}

.product-doc-center__logo img {
	display: block;
	max-width: 160px;
	max-height: 36px;
	width: auto;
	height: auto;
	object-fit: contain;
}

.product-doc-center__title {
	font-size: 13px;
	font-weight: 400;
	color: var(--doc-text-muted);
	line-height: 1.3;
	white-space: nowrap;
	letter-spacing: 0.02em;
}

.product-doc-center__topbar-main {
	grid-column: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 32px;
	min-width: 0;
	padding: 20px 0 20px 40px;
	box-sizing: border-box;
}

.product-doc-center__search {
	position: relative;
	flex: 1;
	min-width: 0;
	max-width: 560px;
}

.product-doc-center__search-icon {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--doc-text-light);
	display: inline-flex;
	pointer-events: none;
}

.product-doc-center__search-input {
	width: 100%;
	height: 40px;
	padding: 0 18px 0 42px;
	border: none;
	border-radius: 20px;
	background: #fff;
	font-size: 14px;
	color: var(--doc-text);
	outline: none;
	box-shadow: none;
	transition: box-shadow 0.2s ease;
}

.product-doc-center__search-input:focus {
	box-shadow: 0 0 0 2px rgba(0, 117, 201, 0.18);
}

.product-doc-center__search-input::placeholder {
	color: #b8c0cc;
}

.product-doc-center__home {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
	color: var(--doc-accent);
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	white-space: nowrap;
	transition: color 0.2s ease;
}

.product-doc-center__home:hover {
	color: var(--doc-accent-hover);
}

.product-doc-center__home svg {
	stroke: currentColor;
	flex-shrink: 0;
}

/* ── 两栏主体（侧栏贴左，与顶栏分界线对齐） ── */
.product-doc-center__body {
	display: grid;
	grid-template-columns: var(--doc-body-grid);
	width: 100%;
	min-height: calc(100vh - var(--doc-topbar-height));
	align-items: stretch;
	box-sizing: border-box;
}

/* ── 左侧产品列表 ── */
.product-doc-center__sidebar {
	position: sticky;
	top: var(--doc-topbar-sticky-offset, var(--doc-topbar-height));
	align-self: start;
	max-height: calc(100vh - var(--doc-topbar-sticky-offset, var(--doc-topbar-height)));
	overflow-y: auto;
	background: #fff;
	border-right: 1px solid var(--doc-border);
	box-sizing: border-box;
}

.doc-product-list {
	display: flex;
	flex-direction: column;
	gap: var(--doc-list-gap);
	padding: var(--doc-body-pad-y) 0;
	box-sizing: border-box;
}

.doc-product-list__item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0 var(--doc-body-pad-y);
	color: var(--doc-text);
	text-decoration: none;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.45;
	transition: color 0.15s ease;
}

.doc-product-list__item:hover {
	color: var(--doc-accent);
}

.doc-product-list__item.is-active {
	color: var(--doc-accent);
	font-weight: 500;
}

.doc-product-list__item.is-hidden {
	display: none;
}

.doc-product-list__icon-wrap {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	color: #aab2bd;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	transition: color 0.15s ease;
}

.doc-product-list__icon-wrap .doc-product-list__icon {
	display: block;
	width: 40px;
	height: 40px;
	flex-shrink: 0;
}

.doc-product-list__icon-wrap img.doc-product-list__icon,
.doc-product-list__icon-wrap .doc-product-list__icon--img {
	object-fit: contain;
	object-position: center;
}

.doc-product-list__item:hover .doc-product-list__icon-wrap,
.doc-product-list__item.is-active .doc-product-list__icon-wrap {
	color: var(--doc-accent);
}

.doc-product-list__name {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.doc-product-list__chevron-wrap {
	flex-shrink: 0;
	color: #c5ccd6;
	display: inline-flex;
	align-items: center;
	transition: color 0.15s ease;
}

.doc-product-list__chevron {
	display: block;
	flex-shrink: 0;
}

.doc-product-list__item:hover .doc-product-list__chevron-wrap,
.doc-product-list__item.is-active .doc-product-list__chevron-wrap {
	color: var(--doc-accent);
}

.doc-product-list__empty {
	margin: 0;
	padding: 24px 16px;
	font-size: 13px;
	color: var(--doc-text-light);
	text-align: center;
}

/* ── 右侧内容区（全宽，为固定目录预留右侧空间） ── */
.product-doc-center__content {
	position: relative;
	background: #fff;
	min-height: calc(100vh - var(--doc-topbar-height));
	padding: var(--doc-body-pad-y) 48px 80px 40px;
	padding-right: calc(var(--doc-toc-width) + 64px);
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
}

.doc-content {
	max-width: none;
}

.doc-content__header {
	margin-bottom: 28px;
}

.doc-content__page-title {
	margin: 0 0 20px;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.35;
	color: #1c1c1c;
	letter-spacing: 0.01em;
}

.doc-content__title-divider {
	height: 1px;
	background: var(--doc-border);
}

.doc-content__body {
	font-size: 14px;
	line-height: 1.85;
	color: var(--doc-text-muted);
}

.doc-content__body > :first-child {
	margin-top: 0;
}

.doc-content__body h1,
.doc-content__body h2,
.doc-content__body h3 {
	color: #1c1c1c;
	font-weight: 700;
	line-height: 1.5;
	scroll-margin-top: calc(var(--doc-topbar-height) + 16px);
}

.doc-content__body h1 {
	font-size: 18px;
	margin: 32px 0 14px;
}

.doc-content__body h2 {
	font-size: 16px;
	margin: 28px 0 12px;
}

.doc-content__body h3 {
	font-size: 15px;
	margin: 22px 0 10px;
}

.doc-content__body p {
	margin: 0 0 14px;
}

.doc-content__body a {
	color: var(--doc-accent);
	text-decoration: none;
	transition: color 0.15s ease;
}

.doc-content__body a:hover {
	color: var(--doc-accent-hover);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.doc-content__body ul,
.doc-content__body ol {
	margin: 0 0 16px;
	padding-left: 1.6em;
}

.doc-content__body li {
	margin-bottom: 6px;
}

.doc-content__body img {
	max-width: 100%;
	height: auto;
}

.doc-content__empty {
	color: var(--doc-text-light);
}

/* ── 文档目录：fixed 固定视口右侧（top 由 JS 按顶栏实际 bottom + 20px 计算） ── */
.product-doc-center__toc {
	position: fixed;
	top: var(--doc-toc-fixed-top, calc(var(--doc-topbar-height) + var(--doc-toc-top-gap)));
	right: var(--doc-page-pad-x);
	width: var(--doc-toc-width);
	z-index: 150;
	pointer-events: none;
	overflow: hidden;
}

.doc-toc-card {
	pointer-events: auto;
	background: #fff;
	border-radius: 8px;
	border: 1px solid #eef2f6;
	box-shadow: 0 4px 16px rgba(15, 35, 55, 0.08);
	padding: 20px 18px 18px;
	max-height: calc(100vh - var(--doc-toc-fixed-top, calc(var(--doc-topbar-height) + var(--doc-toc-top-gap))) - 24px);
	overflow-x: hidden;
	overflow-y: auto;
}

.doc-toc-card__title {
	margin: 0 0 16px;
	font-size: 14px;
	font-weight: 700;
	color: #1c1c1c;
	line-height: 1.4;
}

.doc-toc-list {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	overflow: hidden;
}

.doc-toc-list__item {
	display: block;
	padding: 6px 8px;
	font-size: 13px;
	line-height: 1.55;
	color: var(--doc-text-muted);
	text-decoration: none;
	border-radius: 4px;
	transition: color 0.15s ease, background-color 0.15s ease;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.doc-toc-list__item--h1 {
	font-weight: 500;
	color: #444;
}

.doc-toc-list__item--h2 {
	padding-left: 16px;
	font-size: 13px;
}

.doc-toc-list__item--h3 {
	padding-left: 28px;
	font-size: 12px;
	color: var(--doc-text-light);
}

.doc-toc-list__item:hover,
.doc-toc-list__item.is-active {
	color: var(--doc-accent);
	background: #f5f9fc;
}

.doc-toc-card__empty {
	margin: 0;
	font-size: 13px;
	color: var(--doc-text-light);
}

/* ── 响应式 ── */
@media (max-width: 1199px) {
	.product-doc-center__content {
		padding-right: 48px;
	}

	.product-doc-center__toc {
		display: none;
	}
}

@media (max-width: 991px) {
	body.product-doc-center-page {
		--doc-sidebar-width: 240px;
		--doc-page-pad-x: 24px;
	}

	.product-doc-center__topbar-inner {
		grid-template-columns: 1fr;
		min-height: 0;
	}

	.product-doc-center__topbar-wrap {
		padding: 0 var(--doc-page-pad-x);
	}

	.product-doc-center__topbar-brand {
		grid-column: 1;
		flex-direction: row;
		align-items: center;
		gap: 12px;
		padding: 16px 0;
		border-right: none;
		border-bottom: 1px solid var(--doc-border);
	}

	.product-doc-center__topbar-main {
		grid-column: 1;
		position: relative;
		padding: 48px 0 16px;
		gap: 16px;
	}

	.product-doc-center__search {
		max-width: none;
	}

	.product-doc-center__home {
		position: absolute;
		top: 16px;
		right: 0;
	}

	.product-doc-center__content {
		padding: 28px 24px 64px;
	}

	.doc-content__page-title {
		font-size: 22px;
	}
}

@media (max-width: 767px) {
	body.product-doc-center-page {
		--doc-sidebar-width: 100%;
	}

	.product-doc-center__body {
		grid-template-columns: 1fr;
		max-width: none;
	}

	.product-doc-center__sidebar {
		position: static;
		max-height: none;
		border-right: none;
		border-bottom: 1px solid var(--doc-border);
	}

	.product-doc-center__content {
		padding: 28px 24px 64px;
	}

	.doc-product-list {
		padding: 24px 0;
		max-height: 220px;
		overflow-y: auto;
	}
}
