/*
Theme Name: Zhihuilu Child
Theme URI: https://www.zhihuilu.com/
Description: 智慧路 · 中国供应链本地执行 —— GeneratePress 子主题。中文镜像站设计，承载「找工厂 / 供应链 / 翻译机构 / 国内展会」四类服务。视觉体系对齐 come-to-china.com（中国红 + 墨色 + 纸灰）。
Author: Zhihuilu
Author URI: https://www.zhihuilu.com/
Template: generatepress
Version: 1.4.1
Requires at least: 6.2
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: zhihuilu-child
Tags: business, services, chinese, responsive, accessibility-ready
*/

/* ==========================================================================
   0. 设计令牌层
   --------------------------------------------------------------------------
   控制权归属：色板 / 字体 / 内容宽度一律来自 GeneratePress 全局设置
   （外观 → 自定义 → 全局颜色 / 排版 / 布局），本文件只做「语义映射」。

   左边是本主题语义名，右边第一顺位是 GP 变量，fallback 仅在 GP 未输出
   对应变量时兜底（例如前台被裁剪的极简场景）。要改品牌色，改主题设置，
   不要改这里。
   ========================================================================== */

:root {
	/* —— 品牌与文字 —— */
	--zhl-brand: var(--accent, #c7000b);
	--zhl-brand-deep: var(--accent-hover, #a30008);
	--zhl-ink: var(--contrast, #202020);
	--zhl-ink-soft: var(--contrast-2, #525354);
	--zhl-ink-faint: var(--contrast-3, #6a6f74);
	--zhl-on-brand: var(--accent-text-color, #ffffff);

	/* —— 面 —— */
	--zhl-page: var(--base-3, #ffffff);
	--zhl-paper: var(--base-2, #f6f8fa);
	/* come 的卡片底色：#f5f5f5，用 mix 表达，跟随主题墨色走 */
	--zhl-card: color-mix(in srgb, var(--zhl-ink) 4.5%, var(--zhl-page));
	--zhl-paper-deep: color-mix(in srgb, var(--zhl-ink) 5%, var(--zhl-page));
	--zhl-line: color-mix(in srgb, var(--zhl-ink) 11%, transparent);
	--zhl-line-strong: color-mix(in srgb, var(--zhl-ink) 20%, transparent);

	/* —— 点缀（来自 come 色板 15 / 11 / 12 的克制用法） —— */
	--zhl-amber: #f5a524;
	--zhl-green: #13612e;
	--zhl-blue: #1159af;

	/* —— 尺度 —— */
	--zhl-container: min(100% - (2 * var(--zhl-gutter)), var(--content-width, 1440px));
	--zhl-read: 46rem; /* 正文可读宽度，与容器宽度解耦 */
	--zhl-gutter: 24px;
	--zhl-section-y: clamp(56px, 5.5vw, 84px);
	--zhl-header-h: 98px;

	/* —— 形状 —— */
	--zhl-radius: 8px;
	--zhl-radius-btn: 6px;
	--zhl-radius-lg: 14px;
	--zhl-shadow-sm: 0 3px 14px rgb(18 42 46 / 0.05);
	--zhl-shadow: 0 18px 42px rgb(18 42 46 / 0.12);
	--zhl-shadow-lg: 0 30px 64px rgb(6 22 22 / 0.2);
	--zhl-ring: 0 0 0 3px color-mix(in srgb, var(--zhl-brand) 28%, transparent);

	/* —— 字体：中文优先栈，正文与标题同族，靠字重与字距分层 —— */
	--zhl-font: var(--global-body-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif);
	--zhl-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* ==========================================================================
   1. 基础重置与排版
   ========================================================================== */

/* 统一的盒模型。GP 本身也会下发这条，但子主题不能依赖父主题的 reset：
   一旦父主题样式被裁剪或优化插件延迟加载，所有 100% + padding 的组件都会溢出。 */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--zhl-header-h) + 16px);
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	padding: 0;
	font-family: var(--zhl-font);
	color: var(--zhl-ink-soft);
	background: var(--zhl-page);
	/* 对齐 come：基准 17px / 行高 1.6 */
	font-size: 17px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

body.zhl-dark-band {
	background: var(--zhl-page);
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--zhl-font);
	color: var(--zhl-ink);
	line-height: 1.28;
	letter-spacing: -0.015em;
	margin: 0 0 0.6em;
	font-weight: 700;
	text-wrap: balance;
}

h1 { font-size: clamp(2rem, 1.45rem + 1.75vw, 3.02rem); line-height: 1.04; letter-spacing: -0.025em; font-weight: 800; }
h2 { font-size: clamp(1.75rem, 1.25rem + 1.72vw, 2.75rem); font-weight: 600; letter-spacing: -0.022em; line-height: 1.12; }
h3 { font-size: clamp(1.15rem, 1.05rem + 0.4vw, 1.35rem); }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a {
	color: var(--zhl-brand);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	transition: color 0.18s ease;
}

a:hover { color: var(--zhl-brand-deep); }

:where(a, button, input, textarea, select, summary):focus-visible {
	outline: 2px solid var(--zhl-brand);
	outline-offset: 2px;
	border-radius: 3px;
}

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

hr {
	border: 0;
	border-top: 1px solid var(--zhl-line);
	margin: 2.2em 0;
}

::selection {
	background: color-mix(in srgb, var(--zhl-brand) 18%, transparent);
	color: var(--zhl-ink);
}

/* 屏幕阅读器专用 */
.zhl-sr {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* 跳转链接 */
.zhl-skip {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 9999;
	padding: 12px 18px;
	background: var(--zhl-ink);
	color: #fff;
	border-radius: 0 0 var(--zhl-radius) 0;
	font-weight: 600;
}

.zhl-skip:focus {
	left: 0;
	color: #fff;
}

/* ==========================================================================
   2. 布局基元
   ========================================================================== */

.zhl-wrap {
	width: var(--zhl-container);
	margin-inline: auto;
}

.zhl-section {
	padding-block: var(--zhl-section-y);
	position: relative;
}

.zhl-section--paper { background: var(--zhl-paper); }

.zhl-section--ink {
	background: var(--zhl-ink);
	color: color-mix(in srgb, #fff 82%, transparent);
}

.zhl-section--ink h2,
.zhl-section--ink h3,
.zhl-section--ink h4 { color: #fff; }

.zhl-section--tight { padding-block: clamp(36px, 4.5vw, 64px); }

/* 区块标题：左侧 eyebrow + H2，右侧导语（对齐 come 的双栏 section head） */
/* 对齐 come：区块头是居中堆叠（eyebrow → H2 → 导语），不是左右两栏 */
.zhl-head {
	display: block;
	text-align: center;
	margin-bottom: clamp(28px, 3.2vw, 44px);
}

.zhl-head h2 { margin-bottom: 0; }

.zhl-head__lead {
	max-width: 40rem;
	margin: 14px auto 0;
	text-align: center;
	color: var(--zhl-ink-soft);
	font-size: 1.0625rem;
	line-height: 1.65;
}

/* come 的 eyebrow 是纯文字居中，没有前置短线 */
.zhl-eyebrow {
	display: block;
	margin: 0 0 10px;
	color: var(--zhl-brand);
	font-size: 0.84rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1.6;
}

.zhl-section--ink .zhl-eyebrow {
	color: color-mix(in srgb, var(--zhl-amber) 88%, #fff);
}

.zhl-head h2 { margin-bottom: 0; }

/* ==========================================================================
   3. 按钮
   ========================================================================== */

.zhl-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	min-height: 46px;
	padding: 12px 22px;
	border: 1px solid transparent;
	border-radius: var(--zhl-radius-btn);
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.zhl-btn--primary {
	background: var(--zhl-brand);
	color: var(--zhl-on-brand);
}

.zhl-btn--primary:hover {
	background: var(--zhl-brand-deep);
	color: var(--zhl-on-brand);
	transform: translateY(-1px);
	box-shadow: 0 12px 26px color-mix(in srgb, var(--zhl-brand) 30%, transparent);
}

.zhl-btn--ghost {
	background: transparent;
	border-color: var(--zhl-line-strong);
	color: var(--zhl-ink);
}

.zhl-btn--ghost:hover {
	background: var(--zhl-paper);
	border-color: var(--zhl-ink-soft);
	color: var(--zhl-ink);
}

/* 深底上的次级按钮 */
.zhl-btn--ghost-light {
	background: rgb(255 255 255 / 0.08);
	border-color: rgb(255 255 255 / 0.42);
	color: #fff;
}

.zhl-btn--ghost-light:hover {
	background: rgb(255 255 255 / 0.16);
	border-color: rgb(255 255 255 / 0.7);
	color: #fff;
}

.zhl-btn--small {
	min-height: 40px;
	padding: 9px 16px;
	font-size: 0.88rem;
}

.zhl-btn--block { width: 100%; }

/* 文字箭头链接 */
.zhl-go {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 600;
	font-size: 0.93rem;
	color: var(--zhl-brand);
	text-decoration: none;
}

.zhl-go svg { transition: transform 0.2s ease; }
.zhl-go:hover svg { transform: translateX(3px); }

/* 标签 */
.zhl-chip {
	display: inline-flex;
	align-items: center;
	padding: 6px 12px;
	border-radius: 999px;
	border: 1px solid var(--zhl-line);
	background: var(--zhl-page);
	color: var(--zhl-ink-soft);
	font-size: 0.8rem;
	line-height: 1.2;
	white-space: nowrap;
}

.zhl-section--ink .zhl-chip {
	background: rgb(255 255 255 / 0.06);
	border-color: rgb(255 255 255 / 0.18);
	color: rgb(255 255 255 / 0.82);
}
