/* ============================================================================
 * MechenDiy · 基础设计系统 (base.css)
 * ----------------------------------------------------------------------------
 * ★ 换色 / 换字体 的唯一入口：本文件顶部的 :root 变量。
 *   也可在后台 外观 → 自定义 → MechenDiy 品牌设置 → 基础色板 直接改（会覆盖此处）。
 *
 * 基础色板（来自品牌文档；沉稳暗调 + 中性 + 工程黄点缀）
 *   Graphite Black      #17191B  主文字 / 深色区块 / 页脚
 *   Warm White          #F5F4EF  页面底色 / 浅色区块
 *   Industrial Gray     #777B80  次要文字 / 说明 / 分隔
 *   Engineering Yellow  #F2C230  CTA / 强调 / 交互状态
 *   派生：Ink-2 #202427 / Ink-3 #2B3034 / Line rgba(23,25,27,.12) / Wood #B8874F
 *
 * 字体（Google Fonts，无衬线简约品牌字体）
 *   Manrope        标题 / 品牌字（几何感、工程气质）
 *   Inter          正文（高可读性）
 *   IBM Plex Mono  眉标 / 编号 / 规格标签（工程图纸感）
 *   换字体请同时改 inc/enqueue.php 里的 Google Fonts URL。
 * ========================================================================== */

:root {
	--mchd-ink:          #17191B;
	--mchd-paper:        #F5F4EF;
	--mchd-gray:         #777B80;
	--mchd-accent:       #F2C230;

	--mchd-ink-2:        #202427;
	--mchd-ink-3:        #2B3034;
	--mchd-ink-4:        #3A3F43;
	--mchd-white:        #FFFFFF;
	--mchd-paper-2:      #EBE9E1;
	--mchd-line:         rgba(23, 25, 27, .13);
	--mchd-line-strong:  rgba(23, 25, 27, .24);
	--mchd-line-dark:    rgba(245, 244, 239, .16);
	--mchd-wood:         #B8874F;
	--mchd-accent-dark:  #D9A91B;
	--mchd-success:      #2E6B4F;
	--mchd-error:        #A8442F;

	--mchd-font-display: 'Manrope', 'Helvetica Neue', Arial, sans-serif;
	--mchd-font-body:    'Inter', 'Helvetica Neue', Arial, sans-serif;
	--mchd-font-mono:    'IBM Plex Mono', ui-monospace, SFMono-Regular, Consolas, monospace;

	--mchd-container:    1280px;
	--mchd-gutter:       clamp(20px, 5vw, 64px);
	--mchd-section-y:    clamp(72px, 9vw, 132px);
	--mchd-radius:       2px;      /* 克制的方角，不做彩色圆角卡片 */
	--mchd-ease:         cubic-bezier(.22, .61, .36, 1);
	--mchd-shadow:       0 18px 48px rgba(23, 25, 27, .09);
}

/* ---------------------------------------------------------------- 重置 / 基础 */
*, *::before, *::after { box-sizing: border-box; }

html {
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
}

/* 关闭动效时连平滑滚动也一起停用，避免「关了动画还在动」 */
.mchd-no-motion html { scroll-behavior: auto; }
html:has(.mchd-no-motion) { scroll-behavior: auto; }

body {
	margin: 0;
	background: var(--mchd-paper);
	color: var(--mchd-ink);
	font-family: var(--mchd-font-body);
	font-size: 16px;
	line-height: 1.65;
	font-weight: 400;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--mchd-font-display);
	font-weight: 700;
	line-height: 1.12;
	letter-spacing: -.025em;
	margin: 0 0 .6em;
	color: inherit;
}
h1 { font-size: clamp(2.6rem, 5.4vw, 4.6rem); }
h2 { font-size: clamp(2rem, 3.6vw, 3.15rem); }
h3 { font-size: clamp(1.15rem, 1.6vw, 1.45rem); }
p  { margin: 0 0 1.15em; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.2em; }

strong { font-weight: 600; }

/* 键盘焦点：无障碍要求，禁止移除 */
:focus-visible {
	outline: 2px solid var(--mchd-accent);
	outline-offset: 3px;
}

::selection { background: var(--mchd-accent); color: var(--mchd-ink); }

.screen-reader-text {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.mchd-skip {
	position: fixed; top: -100px; left: 16px; z-index: 9999;
	background: var(--mchd-accent); color: var(--mchd-ink);
	padding: 12px 20px; font-weight: 600;
}
.mchd-skip:focus { top: 16px; }

/* ---------------------------------------------------------------- 布局工具 */
.mchd-container {
	width: 100%;
	max-width: var(--mchd-container);
	margin-inline: auto;
	padding-inline: var(--mchd-gutter);
}

.mchd-main { min-height: 40vh; }

.mchd-section { padding-block: var(--mchd-section-y); }
.mchd-section--values,
.mchd-section--new,
.mchd-section--faq { background: var(--mchd-paper-2); }
.mchd-section--steps,
.mchd-section--audience { background: var(--mchd-paper); }
.mchd-section--ways,
.mchd-section--reviews { background: var(--mchd-ink); color: var(--mchd-paper); }

.mchd-grid { display: grid; gap: clamp(18px, 2.2vw, 30px); }
.mchd-grid--products { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mchd-grid--cats     { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.mchd-section-head { max-width: 760px; margin-bottom: clamp(36px, 4vw, 60px); }
.mchd-section-head--center { margin-inline: auto; text-align: center; }
.mchd-section-sub { color: var(--mchd-gray); font-size: 1.02rem; max-width: 620px; }
.mchd-section-head--center .mchd-section-sub { margin-inline: auto; }

.mchd-section-head-row {
	display: flex; align-items: flex-end; justify-content: space-between;
	gap: 24px; flex-wrap: wrap;
}
.mchd-section-head-row .mchd-section-head { margin-bottom: clamp(32px, 3.5vw, 52px); }
.mchd-section-head-row__action { padding-bottom: clamp(32px, 3.5vw, 52px); }

.mchd-eyebrow {
	font-family: var(--mchd-font-mono);
	font-size: .72rem;
	font-weight: 500;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--mchd-gray);
	margin: 0 0 18px;
}
.mchd-eyebrow::before {
	content: ''; display: inline-block; width: 20px; height: 1px;
	background: var(--mchd-accent); vertical-align: middle;
	margin-right: 12px; margin-bottom: 3px;
}
.mchd-eyebrow--light { color: rgba(245, 244, 239, .7); }

.mchd-note {
	font-size: .84rem; color: var(--mchd-gray);
	font-family: var(--mchd-font-mono); line-height: 1.6;
}
.mchd-note--center { text-align: center; max-width: 720px; margin: 28px auto 0; }

/* ---------------------------------------------------------------- 按钮 */
.mchd-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 14px;
	min-height: 52px; padding: 14px 26px;
	font-family: var(--mchd-font-display);
	font-weight: 700; font-size: .9rem; letter-spacing: .01em;
	border: 1px solid transparent; border-radius: var(--mchd-radius);
	background: var(--mchd-ink); color: var(--mchd-paper);
	transition: background-color .25s var(--mchd-ease), color .25s var(--mchd-ease),
	            border-color .25s var(--mchd-ease), transform .25s var(--mchd-ease);
	white-space: nowrap;
}
.mchd-btn__arrow { transition: transform .25s var(--mchd-ease); font-size: 1.05em; }
.mchd-btn:hover .mchd-btn__arrow { transform: translateX(4px); }

.mchd-btn--primary { background: var(--mchd-accent); color: var(--mchd-ink); border-color: var(--mchd-accent); }
.mchd-btn--primary:hover { background: var(--mchd-accent-dark); border-color: var(--mchd-accent-dark); }

.mchd-btn--secondary { background: var(--mchd-ink); color: var(--mchd-paper); }
.mchd-btn--secondary:hover { background: var(--mchd-ink-3); }

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

.mchd-btn--light { background: var(--mchd-paper); color: var(--mchd-ink); border-color: var(--mchd-paper); }
.mchd-btn--light:hover { background: var(--mchd-accent); border-color: var(--mchd-accent); }

.mchd-text-link {
	display: inline-flex; align-items: center; gap: 8px;
	font-family: var(--mchd-font-display); font-weight: 700; font-size: .88rem;
	padding-bottom: 4px; border-bottom: 1px solid currentColor;
}
.mchd-text-link span { transition: transform .25s var(--mchd-ease); }
.mchd-text-link:hover span { transform: translateX(4px); }
.mchd-text-link--light { color: var(--mchd-paper); }

/* ---------------------------------------------------------------- 表单 */
.mchd-form input[type="text"],
.mchd-form input[type="email"],
.mchd-form input[type="search"],
.mchd-form textarea,
.mchd-newsletter__form input[type="email"] {
	width: 100%; padding: 14px 16px;
	background: var(--mchd-white);
	border: 1px solid var(--mchd-line-strong);
	border-radius: var(--mchd-radius);
	font-size: .95rem;
	transition: border-color .2s var(--mchd-ease);
}
.mchd-form textarea { resize: vertical; min-height: 160px; }
.mchd-form input:focus,
.mchd-form textarea:focus,
.mchd-newsletter__form input:focus { border-color: var(--mchd-ink); outline: none; }

.mchd-form label,
.mchd-newsletter__form label {
	display: block; font-size: .82rem; font-weight: 600;
	margin-bottom: 8px; font-family: var(--mchd-font-display);
}
.mchd-form p { margin-bottom: 20px; }
.mchd-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.mchd-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.mchd-form-status { padding: 14px 18px; margin-bottom: 24px; border-left: 3px solid; font-size: .92rem; }
.mchd-form-status--ok  { background: rgba(46,107,79,.09); border-color: var(--mchd-success); }
.mchd-form-status--err { background: rgba(168,68,47,.09); border-color: var(--mchd-error); }

/* ---------------------------------------------------------------- 通用内容排版 */
.mchd-prose { max-width: 780px; }
.mchd-prose--center { margin-inline: auto; text-align: center; }
.mchd-prose p { font-size: 1.04rem; line-height: 1.85; color: var(--mchd-ink-2); }
.mchd-prose h2 { margin-top: 1.6em; }
.mchd-lead {
	font-family: var(--mchd-font-display); font-size: clamp(1.3rem, 2.2vw, 1.8rem);
	font-weight: 600; line-height: 1.45; color: var(--mchd-ink) !important;
	border-left: 3px solid var(--mchd-accent); padding-left: 24px; margin-bottom: 2em;
}
.mchd-prose-section { padding-block: var(--mchd-section-y); }

.mchd-breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0 0 28px; font-size: .8rem; }
.mchd-breadcrumb li { color: var(--mchd-gray); }
.mchd-breadcrumb li + li::before { content: '/'; margin-right: 10px; color: var(--mchd-line-strong); }
.mchd-breadcrumb a:hover { color: var(--mchd-ink); text-decoration: underline; }

.mchd-empty { text-align: center; padding: 64px 24px; border: 1px dashed var(--mchd-line-strong); }
.mchd-empty h3 { margin-top: 0; }
.mchd-empty p { color: var(--mchd-gray); max-width: 560px; margin-inline: auto; }

/* ---------------------------------------------------------------- 动效关闭（★ 一键开关） */
/* body.mchd-no-motion 由以下三种方式之一加上：
   1) wp-config.php: define('MCHD_DISABLE_MOTION', true)
   2) 后台 外观 → 自定义 → 动效开关 → 取消勾选
   3) 手动在 body 上加 class="mchd-no-motion"
   关闭后：所有 transform / transition / animation 归零，内容保持完全可读可用。 */
.mchd-no-motion *,
.mchd-no-motion *::before,
.mchd-no-motion *::after {
	animation: none !important;
	transition: none !important;
	scroll-behavior: auto !important;
}
.mchd-no-motion .mchd-parallax__layer,
.mchd-parallax--off .mchd-parallax__layer {
	transform: none !important;
	will-change: auto !important;
}

/* 系统级「减少动态效果」偏好：同样完全关闭 */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		animation-duration: .001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .001ms !important;
	}
	.mchd-parallax__layer { transform: none !important; will-change: auto !important; }
}
