/**
 * LiCheng Products — 产品页面样式
 *
 * 设计约束（对应需求「页面设计要求」）：
 *   - 简洁、专业、可信的工业风格
 *   - 深蓝、白色及少量强调色
 *   - 不做多余动画，避免影响加载速度
 *   - 适配电脑 / 平板 / 手机
 *   - 所有重要位置都有明显询价入口
 *
 * 使用 CSS 变量，便于统一调色。
 */

:root {
	--lc-navy: #0d2b4b;
	--lc-navy-soft: #17456f;
	--lc-accent: #c8102e;
	--lc-whatsapp: #25d366;
	--lc-line: #06c755;
	--lc-border: #dfe4ea;
	--lc-bg-soft: #f7f9fb;
	--lc-text: #1f2a37;
	--lc-text-soft: #5b6672;
	--lc-radius: 12px;
}

/* =============================================================================
   0. 页面宽度容器
   -----------------------------------------------------------------------------
   产品详情页的内容容器。宽度取与页头**同一个变量**，保证左右边界完全对齐。

   ⚠️ 为什么自己定义容器，而不用区块的 alignwide / layout:constrained：

      踩过的坑（用无头浏览器量真实渲染宽度才定位到）：
        给内容组加 alignwide + layout:constrained 后，实测
            header      width=1240
            外层容器     width=1905   ← alignwide 未生效
            内层组       width=900    ← 被自动套上 contentSize
            参数表/图片  width=900
        结果表格比页头宽 600 多像素，两侧边界全不齐。

      原因有两个叠加：
        1. WordPress 布局引擎给「约束布局的直接子元素」自动加
           max-width: var(--wp--style--global--content-size)，
           规则按元素生成在内联的 core-block-supports-inline-css 里，
           无法用固定选择器稳定覆盖。
        2. .alignwide 的 max-width 在流式布局下不起作用。

      自己定义容器后行为完全确定：宽度只由这一个变量决定，
      与页头（同为 wideSize）天然对齐，不受布局引擎层叠规则影响。
   ========================================================================== */

/* -----------------------------------------------------------------------------
   外层：与页头一样，先在视口级别让出根内边距
   -----------------------------------------------------------------------------
   页头的结构是：
       <div class="hostinger-ai-menu ... has-global-padding">   ← 视口 − 左右内边距
           <div class="alignwide ...">                          ← min(wideSize, 100%)
   内容区必须复制这层，否则在「视口 − 内边距 < wideSize」的屏宽下会宽出
   正好一个内边距的量。实测：
       1024px 视口 → 页头 968px，内容 1009px（差 41px）
       1280px 视口 → 页头 1214px，内容 1240px（差 26px）
       1920px 视口 → 两者都是 1240px（此屏宽下不会暴露问题）
   -------------------------------------------------------------------------- */

.lc-page-outer {
	width: 100%;
	padding-left: var(--wp--style--root--padding-left, 24px);
	padding-right: var(--wp--style--root--padding-right, 24px);
	box-sizing: border-box;
}

.lc-page-content {
	width: 100%;

	/*
	 * 宽度与页头内容块完全一致：max-width = wideSize，居中，无内边距。
	 *
	 * 实测（无头浏览器量真实渲染，Chrome DevTools Protocol）：
	 *   页头内容块  padL=0  maxW=1240  → l=333 r=1573
	 *   本容器      padL=0  maxW=1240  → l=333 r=1573   ✅ 一致
	 *
	 * ⚠️ 这里**不能加内边距**。页头的 alignwide 容器自身 padding 是 0，
	 *    留白由外层 has-global-padding 提供。本容器再加内边距的话，
	 *    内容会比页头再向内缩一个内边距（实测 20-32px），边界对不齐 ——
	 *    这正是反复出现的「两侧留白」观感的来源。留白交给 .lc-page-outer。
	 */
	max-width: var(--wp--style--global--wide-size, 1240px);

	margin-left: auto;
	margin-right: auto;
	box-sizing: border-box;
}

@media (max-width: 640px) {
	.lc-page-content {
		padding-left: 16px;
		padding-right: 16px;
	}
}

/* =============================================================================
   1. 产品标题与摘要
   ========================================================================== */

.lc-product-title {
	color: var(--lc-navy);
	line-height: 1.25;
	margin-bottom: 0.5em;
}

.lc-summary {
	border-left: 4px solid var(--lc-navy);
	background: var(--lc-bg-soft);
	padding: 16px 20px;
	border-radius: 0 var(--lc-radius) var(--lc-radius) 0;
	margin-bottom: 24px;
}

.lc-summary__model {
	margin: 0 0 6px;
	font-size: 1.05rem;
	color: var(--lc-navy);
}

.lc-summary__label {
	color: var(--lc-text-soft);
	font-weight: 400;
	margin-right: 4px;
}

.lc-summary__cats {
	margin: 0 0 8px;
	font-size: 0.875rem;
	color: var(--lc-text-soft);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.lc-summary__desc {
	margin: 0;
	color: var(--lc-text);
	line-height: 1.65;
}

/* =============================================================================
   2. 通用区块
   ========================================================================== */

.lc-block {
	margin: 0 0 36px;
}

.lc-block__title {
	font-size: 1.35rem;
	color: var(--lc-navy);
	margin: 0 0 16px;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--lc-border);
	position: relative;
}

.lc-block__title::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -2px;
	width: 56px;
	height: 2px;
	background: var(--lc-accent);
}

.lc-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.lc-list li {
	position: relative;
	padding: 0 0 10px 26px;
	line-height: 1.6;
	color: var(--lc-text);
}

.lc-list li::before {
	content: "";
	position: absolute;
	left: 4px;
	top: 0.6em;
	width: 7px;
	height: 7px;
	background: var(--lc-accent);
	border-radius: 2px;
}

.lc-text {
	color: var(--lc-text);
	line-height: 1.7;
}

.lc-text p {
	margin: 0 0 10px;
}

.lc-note {
	margin: 10px 0 0;
	font-size: 0.875rem;
	color: var(--lc-text-soft);
}

/* =============================================================================
   3. 技术参数表
   ========================================================================== */

.lc-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.lc-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
	background: #fff;
}

.lc-table th,
.lc-table td {
	border: 1px solid var(--lc-border);
	padding: 12px 14px;
	text-align: left;
	vertical-align: top;
	line-height: 1.55;
}

.lc-table th[scope="row"] {
	width: 34%;
	min-width: 140px;
	background: var(--lc-bg-soft);
	color: var(--lc-navy);
	font-weight: 600;
}

.lc-table__section th {
	background: var(--lc-navy);
	color: #fff;
	font-weight: 600;
	letter-spacing: 0.02em;
}

/* -----------------------------------------------------------------------------
   多型号对比表格
   矿山设备选型需要横向比较多个型号，列数常有 7-8 列。
   窄屏下若强行压缩会导致无法阅读，因此给一个最小宽度并允许横滑，
   同时在首列（型号）做视觉锚定，横滑时便于对照。
   -------------------------------------------------------------------------- */

.lc-spec__subtitle {
	font-size: 1.05rem;
	font-weight: 600;
	color: var(--lc-navy);
	margin: 28px 0 10px;
	padding-left: 10px;
	border-left: 3px solid var(--lc-accent, #c8102e);
}

.lc-spec__subtitle:first-of-type {
	margin-top: 12px;
}

.lc-table--compare {
	font-size: 0.9rem;
}

.lc-table--compare thead th {
	background: var(--lc-navy);
	color: #fff;
	font-weight: 600;
	white-space: nowrap;
	text-align: center;
	vertical-align: middle;
}

.lc-table--compare thead th:first-child {
	text-align: left;
	position: sticky;
	left: 0;
	z-index: 2;
	background: var(--lc-navy);
}

.lc-table--compare tbody th[scope="row"] {
	width: auto;
	min-width: 108px;
	white-space: nowrap;
	font-weight: 600;
	background: var(--lc-bg-soft);
	color: var(--lc-navy);
	position: sticky;
	left: 0;
	z-index: 1;
}

.lc-table--compare tbody td {
	text-align: center;
	white-space: nowrap;
}

.lc-table--compare tbody tr:nth-child(even) td,
.lc-table--compare tbody tr:nth-child(even) th[scope="row"] {
	background: #fafbfc;
}

/* 列数多时的横滑容器：给表格一个合理的最小宽度 */
.lc-table-wrap--scroll .lc-table--compare {
	min-width: 720px;
}

.lc-table-wrap--scroll {
	border: 1px solid var(--lc-border);
	border-radius: 6px;
}

.lc-table-wrap--scroll .lc-table th,
.lc-table-wrap--scroll .lc-table td {
	border-width: 0 1px 1px 0;
}

.lc-table-wrap--scroll .lc-table thead th {
	border-bottom-width: 1px;
}

/* 移动端：字号略降，横滑提示 */
@media (max-width: 640px) {
	.lc-table--compare {
		font-size: 0.84rem;
	}
	.lc-table--compare tbody th[scope="row"] {
		min-width: 92px;
	}
	.lc-table-wrap--scroll .lc-table--compare {
		min-width: 620px;
	}
	.lc-spec__subtitle {
		font-size: 1rem;
	}
}

/* =============================================================================
   4. 图片集
   -----------------------------------------------------------------------------
   产品页的图库放在标题之上作为主图。

   ⚠️ 两个踩过的坑：

   坑 1（裁切）：早期版本用 aspect-ratio:1/1 + object-fit:cover 把图裁成正方形缩略图，
      结果 4:3 的设备图被切掉两侧 —— 设备边角直接丢失。产品图绝不能裁切。
      现在用 height:auto + object-fit:contain，图完整呈现。

   坑 2（留白）：给 .lc-gallery 设了 max-width:800px + margin:0 auto，
      本意是「尺寸尽量 800×600」，但容器本身是 .alignwide（主题宽版 1100px），
      于是图片两侧各留下约 150px 空白，看起来像页面有白边。
      现在图库宽度撑满容器（不再单独限宽），由容器决定宽度。
   ========================================================================== */

.lc-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
	gap: 16px;
	justify-items: center;
	width: 100%;
	/* 不设 max-width：容器多宽图就多宽，避免两侧留白 */
}

/* 单张图：撑满容器宽度，居中，不裁切 */
.lc-gallery__item {
	display: block;
	width: 100%;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	line-height: 0;      /* 消除 img 下方的行内基线空隙 */
}

.lc-gallery__item img {
	display: block;
	width: 100%;
	height: auto;        /* 保持原始宽高比，不裁切 */
	object-fit: contain;
	transition: transform 0.2s ease;
}

/* 有边框的样式只在多图时用，单图主图不要边框更像产品图 */
.lc-gallery__item:not(:only-child) {
	border: 1px solid var(--lc-border);
}

.lc-gallery__item:hover img {
	transform: scale(1.02);
}

/* 多图时排成缩略图网格 */
.lc-gallery:has(.lc-gallery__item:nth-child(2)) {
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

@media (max-width: 640px) {
	.lc-gallery {
		gap: 10px;
	}
	.lc-gallery:has(.lc-gallery__item:nth-child(2)) {
		grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	}
}

/* =============================================================================
   5. 视频
   ========================================================================== */

.lc-video {
	position: relative;
	width: 100%;
	max-width: 860px;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: var(--lc-radius);
	overflow: hidden;
}

.lc-video iframe,
.lc-video video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* =============================================================================
   6. FAQ（原生 details，无需 JS）
   ========================================================================== */

.lc-faq__item {
	border: 1px solid var(--lc-border);
	border-radius: 8px;
	margin-bottom: 10px;
	background: #fff;
}

.lc-faq__q {
	cursor: pointer;
	padding: 14px 18px;
	font-weight: 600;
	color: var(--lc-navy);
	list-style: none;
	position: relative;
	padding-right: 44px;
}

.lc-faq__q::-webkit-details-marker {
	display: none;
}

.lc-faq__q::after {
	content: "+";
	position: absolute;
	right: 18px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 1.3rem;
	font-weight: 400;
	color: var(--lc-accent);
	line-height: 1;
}

.lc-faq__item[open] .lc-faq__q::after {
	content: "−";
}

.lc-faq__a {
	padding: 0 18px 16px;
	color: var(--lc-text);
	line-height: 1.7;
}

/* =============================================================================
   7. 询价行动区（每个产品页必须有）
   ========================================================================== */

.lc-cta {
	background: var(--lc-bg-soft);
	border: 1px solid var(--lc-border);
	border-radius: var(--lc-radius);
	padding: 22px;
	text-align: center;
}

.lc-quote-card .lc-cta {
	background: transparent;
	border: 0;
	padding: 0;
	text-align: left;
}

.lc-cta__title {
	margin: 0 0 6px;
	font-size: 1.25rem;
	color: var(--lc-navy);
}

.lc-cta__desc {
	margin: 0 0 16px;
	color: var(--lc-text-soft);
	font-size: 0.95rem;
}

.lc-cta__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
}

.lc-quote-card .lc-cta__actions {
	justify-content: flex-start;
	flex-direction: column;
}

.lc-btn {
	display: inline-block;
	padding: 12px 22px;
	border-radius: 6px;
	font-weight: 600;
	text-decoration: none;
	line-height: 1.2;
	text-align: center;
	transition: background-color 0.15s ease;
}

.lc-btn--primary {
	background: var(--lc-navy);
	color: #fff !important;
}

.lc-btn--primary:hover {
	background: var(--lc-navy-soft);
}

.lc-btn--whatsapp {
	background: var(--lc-whatsapp);
	color: #fff !important;
}

.lc-btn--whatsapp:hover {
	background: #1eb455;
}

/* 侧栏询价卡：滚动时保持可见 */
.lc-sidebar-col {
	position: relative;
}

@media (min-width: 782px) {
	.lc-quote-card {
		position: sticky;
		top: 24px;
	}
}

.lc-quote-card__hint {
	margin: 0 0 14px;
	font-weight: 600;
	color: var(--lc-navy);
	font-size: 1.05rem;
}

/* =============================================================================
   8. 相关产品
   ========================================================================== */

.lc-related {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 16px;
}

.lc-related__item {
	display: block;
	border: 1px solid var(--lc-border);
	border-radius: 8px;
	padding: 12px;
	text-decoration: none;
	background: #fff;
	text-align: center;
}

.lc-related__item:hover {
	border-color: var(--lc-navy);
}

.lc-related__img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 6px;
	margin-bottom: 10px;
}

.lc-related__name {
	display: block;
	font-weight: 600;
	color: var(--lc-navy);
	line-height: 1.4;
	font-size: 0.95rem;
}

.lc-related__model {
	display: block;
	margin-top: 4px;
	font-size: 0.8rem;
	color: var(--lc-text-soft);
}

/* =============================================================================
   9. 产品归档卡片
   ========================================================================== */

.lc-archive-grid {
	gap: 24px;
}

.lc-card {
	background: #fff;
	height: 100%;
}

.lc-card__title {
	margin: 0;
	line-height: 1.35;
}

.lc-card__title a {
	color: var(--lc-navy);
	text-decoration: none;
}

.lc-card__title a:hover {
	color: var(--lc-accent);
}

.lc-card__excerpt {
	margin: 0;
	color: var(--lc-text-soft);
	font-size: 0.925rem;
	line-height: 1.6;
}

/* 归档卡片内图片统一比例 */
.lc-card .wp-block-post-featured-image img {
	aspect-ratio: 4 / 3;
	object-fit: cover;
	width: 100%;
	height: auto;
}

/* =============================================================================
   10. 响应式
   ========================================================================== */

@media (max-width: 781px) {
	.lc-product-title {
		font-size: 1.6rem;
	}

	.lc-block__title {
		font-size: 1.2rem;
	}

	.lc-table th[scope="row"] {
		width: 40%;
		min-width: 110px;
	}

	.lc-table th,
	.lc-table td {
		padding: 10px 11px;
		font-size: 0.9rem;
	}

	.lc-gallery {
		grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
		gap: 8px;
	}

	.lc-cta {
		padding: 18px;
	}

	.lc-btn {
		width: 100%;
	}
}

/* 打印时隐藏询价按钮，避免纸张浪费 */
@media print {
	.lc-cta,
	.lc-quote-card,
	#licheng-wa-float {
		display: none !important;
	}
}
