.shen-table-wrap {
	--shen-table-min: 640px;
	border: 1px solid #e6e9f0;
	border-radius: 4px;
	overflow: hidden;
}

/* 横向滑动模式的滚动能力只在窄屏开启（见文件下方媒体查询）。
   桌面端保持 overflow: hidden，不创建滚动上下文，
   否则浏览器会预留滚动条槽位，在表格底部留下一条空白。 */

/* margin: 0 是必要的重置：小部件可能位于文章正文等容器内，
   那些容器常给 table 设置底部外边距，会在表格下方留出空白。 */
.shen-table,
.shen-article-content .shen-table {
	width: 100%;
	margin: 0;
	/* 关键：把边框计入宽度，避免列分隔线把表格撑出容器而触发滚动条 */
	box-sizing: border-box;
	border-collapse: collapse;
	border-spacing: 0;
	background: #fff;
}
/* 同样重置单元格边框：避免被正文容器的 th/td 边框规则叠加 */
.shen-table :is(td, th),
.shen-article-content .shen-table :is(td, th) {
	box-sizing: border-box;
	border: 0;
}

.shen-table__caption {
	caption-side: bottom;
	padding: 12px 18px;
	color: #6b7280;
	font-size:13px;
	line-height: 1.7;
	text-align: left;
}

.shen-table thead th {
	padding: 14px 18px;
	border-bottom: 1px solid #e6e9f0;
	background-color: #fff;
	color: #1a2440;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.6;
	text-align: left;
	white-space: nowrap;
}

.shen-table tbody tr {
	border-top: 1px solid #eef0f4;
}
.shen-table tbody tr:first-child {
	border-top: 0;
}

.shen-table tbody :is(td, th) {
	padding: 16px 18px;
	background-color: #fff;
	color: #3f4859;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.7;
	text-align: left;
	vertical-align: top;
	transition: background-color .15s ease;
}

.shen-table tbody tr > :first-child {
	color: #1a2440;
}

/* 滚动与最小宽度只在窄屏生效：桌面端表格自适应容器不会溢出，
   既不产生滚动条，底部也就不会多出一条空白。 */
@media (max-width: 1024px) {
	.shen-table-wrap.is-mobile-scroll {
		overflow-x: auto;
		overflow-y: hidden;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior-x: contain;
		scrollbar-width: thin;
	}
	.shen-table-wrap.is-mobile-scroll .shen-table {
		min-width: var(--shen-table-min);
	}
}

/* 斑马纹 / 悬停 / 高亮 / 小节行 */
.shen-table.is-striped tbody tr:nth-child(even) :is(td, th) {
	background-color: #fafbfd;
}
.shen-table.is-hoverable tbody tr:hover :is(td, th) {
	background-color: #f5f8fd;
}
.shen-table tbody tr.is-highlight :is(td, th) {
	background-color: #eef4ff;
}
.shen-table tbody tr.is-section :is(td, th) {
	background-color: #f4f6fa;
	color: #1a2440;
	font-weight: 600;
}

/* 滑动时固定首列 */
.shen-table.has-sticky-col :is(thead, tbody) tr > :first-child {
	position: sticky;
	left: 0;
	z-index: 2;
}
.shen-table.has-sticky-col tbody tr > :first-child::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 1px;
	background: #e6e9f0;
}

/* 单元格内的常见元素 */
.shen-table :is(td, th) a {
	color: #1d4ed8;
	text-decoration: underline;
	text-underline-offset: 2px;
}
.shen-table :is(td, th) code {
	padding: 2px 6px;
	border-radius: 3px;
	background: rgba(0, 0, 0, .05);
	font-size: .92em;
}
.shen-table :is(td, th) small {
	color: #8b93a3;
	font-size: .85em;
}

@media (prefers-reduced-motion: reduce) {
	.shen-table tbody :is(td, th) { transition: none; }
}

/* ===== 窄屏：堆叠为卡片 =====
   每行变成一张卡片，单元格纵向排列。首列作为卡片标题。 */
@media (max-width: 767px) {
	.shen-table-wrap.is-mobile-stack {
		border: 0;
		border-radius: 0;
		overflow: visible;
	}
	/* 堆叠模式不需要最小宽度，覆盖滑动模式的变量值 */
	.shen-table-wrap.is-mobile-stack .shen-table {
		min-width: 0 !important;
		display: block;
		background: none;
	}
	.shen-table-wrap.is-mobile-stack .shen-table thead {
		display: none;
	}
	.shen-table-wrap.is-mobile-stack .shen-table tbody {
		display: block;
	}
	.shen-table-wrap.is-mobile-stack .shen-table tbody tr {
		display: block;
		margin-bottom: 12px;
		border: 1px solid #e6e9f0;
		border-radius: 4px;
		overflow: hidden;
	}
	.shen-table-wrap.is-mobile-stack .shen-table tbody tr:last-child {
		margin-bottom: 0;
	}
	.shen-table-wrap.is-mobile-stack .shen-table tbody :is(td, th) {
		display: block;
		width: auto !important;
		text-align: left !important;
		border-right: 0 !important;
	}
	/* 首列作为卡片头部 */
	.shen-table-wrap.is-mobile-stack .shen-table tbody tr > :first-child {
		border-bottom: 1px solid #eef0f4;
		background-color: #f7f8fb;
		font-weight: 600;
	}
	.shen-table-wrap.is-mobile-stack .shen-table.has-sticky-col tbody tr > :first-child {
		position: static;
	}
	.shen-table-wrap.is-mobile-stack .shen-table.has-sticky-col tbody tr > :first-child::after {
		content: none;
	}
}
