/* ============================================================
 * SC Flywheel Style — 言回搜尋飛輪 Agent（SFA）客戶共用前端樣式
 * 來源：sc-icg-snt v1.0.14 的 sc-source-note 樣式區段
 * ============================================================ */

/* === .sc-source-note：外部來源標註（緊跟前段、後段保留間距） === */
.sc-source-note {
	font-size: 0.75em !important;
	color: #9ca3af !important;
	background: rgba(0, 0, 0, 0.025) !important;
	border: 0 !important;
	border-radius: 4px !important;
	padding: 0.35em 0.6em !important;
	margin: 0 0 1.5em 0 !important;
	line-height: 1.5 !important;
}

/* 視覺上把 sc-source-note 黏到前一段：取消前段的 bottom margin（保留 4px 微距） */
*:has(+ .sc-source-note):not(.sc-source-note) {
	margin-bottom: 0.25em !important;
}

.sc-source-note a {
	color: #6b7280 !important;
	text-decoration: underline !important;
	text-decoration-color: rgba(107, 114, 128, 0.4) !important;
	text-underline-offset: 0.18em !important;
}

.sc-source-note a:hover {
	color: var(--theme-palette-color-2, #0A6EB1) !important;
	text-decoration-color: currentColor !important;
}

/* === 手機版 === */
@media (max-width: 640px) {
	.sc-source-note {
		font-size: 0.72em !important;
		padding: 0.3em 0.5em !important;
	}
}


/* ============================================================
 * 文章內表格美化（v1.1.0 起加入）
 * 來源：site-now blocksy-child/style.css PART A（基礎美化、所有文章內表格自動套用）
 * 不包含 PART B（sc-compare 第 2 欄藍色強調——飛輪客戶不做品牌對比、無需該功能）
 * Scope：body.single-post —— 只在部落格 single post 頁套用，不影響首頁/page/分類頁
 * ============================================================ */

/* 表格外框 */
body.single-post .entry-content table,
body.single-post .wp-block-table table,
body.single-post figure.wp-block-table table {
	width: 100% !important;
	border-collapse: separate !important;
	border-spacing: 0 !important;
	border: 1px solid rgba(40,51,59,.12) !important;
	border-radius: 10px !important;
	overflow: hidden !important;
	box-shadow: 0 2px 8px rgba(40,51,59,.05) !important;
	margin: 24px 0 32px !important;
	font-size: 14px !important;
	line-height: 1.65 !important;
	color: #333333 !important;
	background: #FFFFFF !important;
}

/* 表頭：統一深灰藍底、白字、置中、白色分隔線 */
body.single-post .entry-content table th,
body.single-post .entry-content table thead th,
body.single-post .wp-block-table table th,
body.single-post .wp-block-table table thead th,
body.single-post figure.wp-block-table table th,
body.single-post figure.wp-block-table table thead th,
body.single-post .entry-content table tr:first-child th,
body.single-post .wp-block-table table tr:first-child th {
	background: var(--theme-palette-color-3, #28333B) !important;
	background-color: var(--theme-palette-color-3, #28333B) !important;
	color: #FFFFFF !important;
	font-weight: 700 !important;
	font-size: 13px !important;
	letter-spacing: .3px;
	padding: 14px 16px !important;
	border: none !important;
	border-right: 1px solid rgba(255,255,255,.15) !important;
	text-align: center !important;
}

/* 表頭最後一欄不畫右框 */
body.single-post .entry-content table th:last-child,
body.single-post .wp-block-table table th:last-child,
body.single-post figure.wp-block-table table th:last-child {
	border-right: none !important;
}

/* 表身 cell：置中、格線、透明底 */
body.single-post .entry-content table tbody td,
body.single-post .wp-block-table table tbody td,
body.single-post figure.wp-block-table table tbody td {
	padding: 12px 16px !important;
	border: none !important;
	border-right: 1px solid rgba(40,51,59,.12) !important;
	border-bottom: 1px solid rgba(40,51,59,.12) !important;
	vertical-align: middle !important;
	text-align: center !important;
	background: transparent !important;
	background-color: transparent !important;
	transition: background .12s;
}

/* 最後一欄不畫右框；最後一列不畫下框 */
body.single-post .entry-content table tbody td:last-child,
body.single-post .wp-block-table table tbody td:last-child,
body.single-post figure.wp-block-table table tbody td:last-child {
	border-right: none !important;
}
body.single-post .entry-content table tbody tr:last-child td,
body.single-post .wp-block-table table tbody tr:last-child td,
body.single-post figure.wp-block-table table tbody tr:last-child td {
	border-bottom: none !important;
}

/* 斑馬紋 */
body.single-post .entry-content table tbody tr:nth-child(even) td,
body.single-post .wp-block-table table tbody tr:nth-child(even) td {
	background: rgba(40,51,59,.02) !important;
	background-color: rgba(40,51,59,.02) !important;
}

/* 整行 hover */
body.single-post .entry-content table tbody tr:hover td,
body.single-post .wp-block-table table tbody tr:hover td {
	background: rgba(10,110,177,.04) !important;
	background-color: rgba(10,110,177,.04) !important;
}

/* 第一欄描述欄：加粗 */
body.single-post .entry-content table tbody td:first-child,
body.single-post .wp-block-table table tbody td:first-child {
	font-weight: 600 !important;
	color: var(--theme-palette-color-3, #28333B) !important;
}

/* 強調 strong */
body.single-post .entry-content table tbody tr td strong,
body.single-post .wp-block-table table tbody tr td strong {
	color: var(--theme-palette-color-3, #28333B) !important;
	font-weight: 800 !important;
}

/* 表格內連結 */
body.single-post .entry-content table a,
body.single-post .wp-block-table table a {
	color: var(--theme-palette-color-2, #0A6EB1) !important;
	text-decoration: underline !important;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
	transition: opacity .15s;
}
body.single-post .entry-content table a:hover,
body.single-post .wp-block-table table a:hover {
	opacity: .7;
}

/* 手機版表格橫向滾動 */
@media (max-width: 767px) {
	body.single-post .entry-content .wp-block-table,
	body.single-post .entry-content figure.wp-block-table,
	body.single-post .wp-block-table {
		overflow-x: auto !important;
		-webkit-overflow-scrolling: touch;
		margin-left: -16px !important;
		margin-right: -16px !important;
		padding-left: 16px !important;
		padding-right: 16px !important;
	}
	body.single-post .entry-content table,
	body.single-post .wp-block-table table {
		min-width: 640px !important;
		font-size: 13px !important;
		margin: 16px 0 24px !important;
	}
	body.single-post .entry-content table th,
	body.single-post .entry-content table thead th,
	body.single-post .wp-block-table table th,
	body.single-post .wp-block-table table thead th {
		padding: 12px 12px !important;
		font-size: 12px !important;
		white-space: nowrap !important;
	}
	body.single-post .entry-content table tbody td,
	body.single-post .wp-block-table table tbody td {
		padding: 10px 12px !important;
	}
}
