/* =============================================================
   Table Widget  –  sparta-table
   设计基准：1280px；表头深色底+白字，斑马纹行，横向滚动响应式
   ============================================================= */

/* ---------- CSS 变量默认值（JS/PHP inline style 可覆盖） ---------- */
.sfw-table {
	--sfw-table-header-bg:   #054fbd;
	--sfw-table-header-text: #ffffff;
	--sfw-table-stripe:      #eef4ff;
	--sfw-table-border:      #d0e4ff;
	--sfw-table-text:        #1a1a2e;
	--sfw-table-radius:      8px;

	font-family: 'Montserrat', sans-serif;
	width: 100%;
	margin-top: 60px;
	margin-bottom: 60px;
}

/* ---------- 与其他 section 对齐的内容容器 ---------- */
.sfw-table__inner {
	max-width: 1600px;
	margin: 0 auto;
	padding: 0 30px;
	box-sizing: border-box;
}

/* 大屏 */
@media (min-width: 1800px) {
	.sfw-table__inner {
		max-width: 1600px;
	}
}

/* 平板 */
@media (min-width: 768px) and (max-width: 1279px) {
	.sfw-table__inner {
		padding: 0 24px;
	}
}

/* 手机 */
@media (max-width: 767px) {
	.sfw-table__inner {
		padding: 0 20px;
	}
}

/* ---------- 横向滚动容器 ---------- */
.sfw-table__scroll-wrapper {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border-radius: var(--sfw-table-radius);
	border: 1px solid var(--sfw-table-border);
	scrollbar-width: thin;
	scrollbar-color: #c0d4f5 transparent;
}

/* ---------- 表格主体 ---------- */
.sfw-table__table {
	width: 100%;
	min-width: 480px;       /* 防止内容过窄时错乱 */
	border-collapse: collapse;
	border-spacing: 0;
	table-layout: auto;
	/* 覆盖 Astra 主题全局 table 样式（margin:0 0 1.5em 会在容器底部撑出空白行） */
	margin: 0;
	border: none;
}

/* ---------- 表头 ---------- */
.sfw-table__table thead tr {
	background-color: var(--sfw-table-header-bg);
}

.sfw-table__table thead th {
	padding: 14px 20px;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--sfw-table-header-text);
	text-align: left;
	white-space: nowrap;
	border: none; /* 清除主题全局 th 边框 */
	border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.sfw-table__table thead th:last-child {
	border-right: none;
}

/* 第一列表头圆角 */
.sfw-table__table thead tr th:first-child {
	border-radius: var(--sfw-table-radius) 0 0 0;
}
.sfw-table__table thead tr th:last-child {
	border-radius: 0 var(--sfw-table-radius) 0 0;
}

/* ---------- 表体行 ---------- */
.sfw-table__table tbody tr {
	background-color: #ffffff;
	border-bottom: 1px solid var(--sfw-table-border);
	transition: background-color 0.15s ease;
}

.sfw-table__table tbody tr:hover {
	background-color: rgba(208, 228, 255, 0.25);
}

/* 斑马纹：偶数行 */
.sfw-table__table tbody tr.sfw-table__row--even {
	background-color: var(--sfw-table-stripe);
}
.sfw-table__table tbody tr.sfw-table__row--even:hover {
	background-color: rgba(208, 228, 255, 0.5);
}

/* 最后一行无底部边框 */
.sfw-table__table tbody tr:last-child {
	border-bottom: none;
}

/* 最后一行圆角 */
.sfw-table__table tbody tr:last-child td:first-child {
	border-radius: 0 0 0 var(--sfw-table-radius);
}
.sfw-table__table tbody tr:last-child td:last-child {
	border-radius: 0 0 var(--sfw-table-radius) 0;
}

/* ---------- 单元格 ---------- */
.sfw-table__table tbody td {
	padding: 12px 20px;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.6;
	color: var(--sfw-table-text);
	text-align: left;
	border: none; /* 清除主题全局 td 边框 */
	border-right: 1px solid var(--sfw-table-border);
	vertical-align: top;
}

.sfw-table__table tbody td:last-child {
	border-right: none;
}

/* 第一列加粗，作为行标题 */
.sfw-table__table tbody td:first-child {
	font-weight: 600;
	color: #012f73;
}

/* ---------- 响应式 ---------- */

/* 平板（768–1279px）：稍微收紧 padding */
@media (min-width: 768px) and (max-width: 1279px) {
	.sfw-table__table thead th,
	.sfw-table__table tbody td {
		padding: 11px 14px;
		font-size: 12px;
	}
}

/* 手机（≤ 767px）：更紧凑，依赖横向滚动 */
@media (max-width: 767px) {
	.sfw-table__table {
		min-width: 560px;
	}

	.sfw-table__table thead th,
	.sfw-table__table tbody td {
		padding: 10px 12px;
		font-size: 12px;
		white-space: normal;
	}
}

/* 大屏（≥ 1600px） */
@media (min-width: 1600px) {
	.sfw-table__table thead th,
	.sfw-table__table tbody td {
		padding: 16px 24px;
		font-size: 14px;
	}
}
