/* /assets/css/machines/automotive/four-stroke-engine-cylinder-head-cutaway.css — 本页专属样式（en/zh 共用） */

/* 共享零件本体/高亮模型（§4.9） */
.part .body{fill:var(--metal);stroke:#8ea0b5;stroke-width:1.6}
.part .body2{fill:var(--metal-2);stroke:#a9b7c9;stroke-width:1.2}
.part .body3{fill:#c6d0dd;stroke:none}
.part .accent{fill:none;stroke:#6b7b8c;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.part.is-active .body{fill:#9dc3f5;stroke:#1d4ed8;stroke-width:2.2}
.part.is-active .body2{fill:#c4daf8;stroke:#3b82f6;stroke-width:1.4}
.part.is-active .body3{fill:#1d4ed8}
.part.is-active .accent{stroke:#1d4ed8}
.part.is-active{filter:drop-shadow(0 0 12px rgba(29,78,216,.5))}

/* ---- 本页专属（ch- 前缀）· 主题蓝体系与文字对比度修正 ---- */
body[data-topic="cylinder-head"] .part .body{stroke:#2563eb;stroke-width:1.6}
body[data-topic="cylinder-head"] .part .body2{stroke:#60a5fa}
body[data-topic="cylinder-head"] .tag-sm{fill:#5b6472}

/* ---- 各部件区分色（作用域限定 · 未高亮中灰蓝，禁止近白） ---- */
body[data-topic="cylinder-head"] .part[data-id="part-camshaft"]:not(.is-active) .body{fill:#c9d5e6}
body[data-topic="cylinder-head"] .part[data-id="part-camshaft"]:not(.is-active) .body2{fill:#e0eaf5}
body[data-topic="cylinder-head"] .part[data-id="part-intake-valve"]:not(.is-active) .body{fill:#c8d4e5}
body[data-topic="cylinder-head"] .part[data-id="part-intake-valve"]:not(.is-active) .body2{fill:#dde7f4}
body[data-topic="cylinder-head"] .part[data-id="part-exhaust-valve"]:not(.is-active) .body{fill:#bccbe0}
body[data-topic="cylinder-head"] .part[data-id="part-exhaust-valve"]:not(.is-active) .body2{fill:#d9e4f2}
body[data-topic="cylinder-head"] .part[data-id="part-valve-spring"]:not(.is-active) .body2{fill:#d5e1f1}
body[data-topic="cylinder-head"] .part[data-id="part-combustion-chamber"]:not(.is-active) .body{fill:#cad6e6}
body[data-topic="cylinder-head"] .part[data-id="part-combustion-chamber"]:not(.is-active) .body2{fill:#e3ecf6}
body[data-topic="cylinder-head"] .part[data-id="part-spark-plug"]:not(.is-active) .body{fill:#c6d3e5}
body[data-topic="cylinder-head"] .part[data-id="part-spark-plug"]:not(.is-active) .body2{fill:#dde7f4}
body[data-topic="cylinder-head"] .part[data-id="part-head-gasket"]:not(.is-active) .body{fill:#b9c9de}
body[data-topic="cylinder-head"] .part[data-id="part-head-gasket"]:not(.is-active) .body2{fill:#dde7f4}
body[data-topic="cylinder-head"] .part[data-id="part-shell-housing"]:not(.is-active) .body{fill:#dfe6ef;stroke:#9aa6b8}
body[data-topic="cylinder-head"] .part[data-id="part-port-intake"]:not(.is-active) .ch-duct{stroke:#c3d0e1}
body[data-topic="cylinder-head"] .part[data-id="part-port-exhaust"]:not(.is-active) .ch-duct{stroke:#bfcee2}
body[data-topic="cylinder-head"] .part[data-id="part-cooling-jacket"]:not(.is-active) .ch-jacket{stroke:#c2d1e4}

/* ---- 气道 / duct ---- */
.ch-duct{fill:none;stroke:#c2d1e4;stroke-width:46;stroke-linecap:round;stroke-linejoin:round}
.ch-duct-core{fill:none;stroke:#dde7f4;stroke-width:30;stroke-linecap:round;stroke-linejoin:round}
.part.is-active .ch-duct{stroke:#9dc3f5}
.part.is-active .ch-duct-core{stroke:#c4daf8}
.ch-flow-in,.ch-flow-out{fill:none;stroke:#2563eb;stroke-width:3;stroke-linecap:round;stroke-dasharray:9 13;opacity:0}
.is-running .ch-flow-in,.is-running .ch-flow-out{opacity:.95;animation:ch-flow 1.4s linear infinite}
@keyframes ch-flow{to{stroke-dashoffset:-44}}

/* ---- 冷却水套 / cooling jacket ---- */
.ch-jacket{fill:none;stroke:#c2d1e4;stroke-width:34;stroke-linecap:round;stroke-linejoin:round}
.ch-coolant{fill:none;stroke:#4fa8cf;stroke-width:8;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:10 16;opacity:.85}
.is-running .ch-coolant{animation:ch-flow 2.2s linear infinite}
.part.is-active .ch-jacket{stroke:#9dc3f5}

/* ---- 凸轮轴旋转（两只凸轮错相 180°） ---- */
.ch-cam{transform-box:view-box;animation:ch-spin 2.4s linear infinite;animation-play-state:paused}
.ch-cam-l{transform-origin:439px 240px}
.ch-cam-r{transform-origin:761px 240px;animation-delay:-1.2s}
.is-running .ch-cam{animation-play-state:running}
@keyframes ch-spin{to{transform:rotate(360deg)}}

/* ---- 气门升程（进/排气错相） ---- */
.ch-lift-in{transform-box:view-box;animation:ch-lift-in 2.4s ease-in-out infinite;animation-play-state:paused}
.ch-lift-out{transform-box:view-box;animation:ch-lift-out 2.4s ease-in-out infinite;animation-play-state:paused}
.is-running .ch-lift-in,.is-running .ch-lift-out{animation-play-state:running}
@keyframes ch-lift-in{0%,100%{transform:translate(0,0)}50%{transform:translate(6.5px,12.4px)}}
@keyframes ch-lift-out{0%,100%{transform:translate(-6.5px,12.4px)}50%{transform:translate(0,0)}}

/* ---- 气门弹簧压缩（顶部下压，座面固定） ---- */
.ch-coil-in{transform-box:view-box;transform-origin:497px 400px;animation:ch-coil-in 2.4s ease-in-out infinite;animation-play-state:paused}
.ch-coil-out{transform-box:view-box;transform-origin:703px 400px;animation:ch-coil-out 2.4s ease-in-out infinite;animation-play-state:paused}
.is-running .ch-coil-in,.is-running .ch-coil-out{animation-play-state:running}
@keyframes ch-coil-in{0%,100%{transform:scaleY(1)}50%{transform:scaleY(.8)}}
@keyframes ch-coil-out{0%,100%{transform:scaleY(.8)}50%{transform:scaleY(1)}}

/* ---- 火花塞点火 + 燃烧火焰 ---- */
.ch-spark{opacity:0;animation:ch-spark 2.4s ease-out infinite;animation-play-state:paused;transform-box:view-box;transform-origin:600px 452px}
.is-running .ch-spark{animation-play-state:running}
@keyframes ch-spark{0%,85%{opacity:0}90%{opacity:.95}95%{opacity:.25}100%{opacity:0}}
.ch-flame{opacity:0;transform-box:view-box;transform-origin:600px 470px;animation:ch-flame 2.4s ease-out infinite;animation-play-state:paused}
.is-running .ch-flame{animation-play-state:running}
@keyframes ch-flame{0%,85%{opacity:0;transform:scale(.55)}91%{opacity:.92;transform:scale(1)}100%{opacity:0;transform:scale(1.06)}}