/* /assets/machines/automotive/how-a-four-stroke-engine-works-cutaway.css — 本页专属样式（en/zh 共用） */
/* ============ 特殊材质（Solid-fill internals） ============ */
.part .water{fill:#6fa8dc;fill-opacity:.6;stroke:#2563eb;stroke-width:1.2}
.part.is-active .water{fill:#2563eb;fill-opacity:.75}
.part .ceramic{fill:#f1f4f8;stroke:#9aa6b8;stroke-width:2}
.part.is-active .ceramic{fill:#ffffff;stroke:var(--accent-2)}
.part .coffee{fill:#6f4a2f;stroke:#4b3220;stroke-width:1}
.part.is-active .coffee{fill:#8a5a38;stroke:#b0703a}
.part .crema{fill:#d9a86c}
.part.is-active .crema{fill:#e8b877}
.stream{fill:none;stroke:#6f4a2f;stroke-width:6;stroke-linecap:round;stroke-dasharray:9 9;opacity:.85}
.is-running .stream{animation:flow 1.1s linear infinite}

/* ============ 零件本体/区分色（part bodies & per-part distinct fills） ============ */
.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}
/* active highlight stays blue */
.part.is-active .body{fill:#cfe3fb;stroke:var(--accent)}
.part.is-active .body2{fill:#e3eefc;stroke:#60a5fa}
.part.is-active .body3{fill:var(--accent)}
.part.is-active .accent{stroke:var(--accent-2)}
.part.is-active{filter:drop-shadow(0 0 10px rgba(37,99,235,.35))}

/* ============ 动画：叶轮 / 光环（motion） ============ */
.impeller{transform-box:view-box;animation:spin 1.4s linear infinite;animation-play-state:paused}
.is-running .impeller{animation-play-state:running}
@keyframes spin{to{transform:rotate(360deg)}}

.halo{opacity:0;transition:opacity .5s}
.is-running .halo{opacity:1;animation:halo 2.2s ease-in-out infinite}
@keyframes halo{0%,100%{opacity:.35}50%{opacity:.85}}

/* ============ 管道流动（flow） ============ */
.pipe-case{fill:none;stroke:#94a3b8;stroke-width:24;stroke-linecap:round;stroke-linejoin:round}
.pipe-flow{
  fill:none;stroke:var(--accent);stroke-width:6;stroke-linecap:round;stroke-linejoin:round;
  stroke-dasharray:10 16;opacity:0;transition:opacity .4s;
}
.pipe-flow.hot{stroke:#ea580c}
.pipe-flow.cold{stroke:#2563eb}
.is-running .pipe-flow{opacity:.95;animation:flow 1.15s linear infinite}
.is-running .pipe-flow.hot{animation-duration:.9s}
@keyframes flow{to{stroke-dashoffset:-26}}
/* ============ 四冲程发动机 · 各部件区分色（four-stroke per-part distinct fills） ============ */
/* 选择器均绑定 data-id；用 :not(.is-active) 保证全局 .part.is-active 高亮仍生效，不影响 espresso 页 */
.part[data-id="part-cylinder"]:not(.is-active) .body{fill:#ccd6e2}
.part[data-id="part-cylinder"]:not(.is-active) .body2{fill:#e7ecf3}
.part[data-id="part-piston"]:not(.is-active) .body{fill:#b7c9dd}
.part[data-id="part-piston"]:not(.is-active) .body2{fill:#d8e3ef}
.part[data-id="part-piston"]:not(.is-active) .accent{stroke:#7f90a5}
.part[data-id="part-connecting-rod"]:not(.is-active) .body{fill:#a9bccf}
.part[data-id="part-connecting-rod"]:not(.is-active) .body2{fill:#d3dce7}
.part[data-id="part-crankshaft"]:not(.is-active) .body{fill:#adbccb}
.part[data-id="part-crankshaft"]:not(.is-active) .body2{fill:#ccd7e3}
.part[data-id="part-flywheel"]:not(.is-active) .body{fill:#b3becb}
.part[data-id="part-flywheel"]:not(.is-active) .body2{fill:#d4dbe5}
.part[data-id="part-intake-port"]:not(.is-active) .body{fill:#bfe0f5;stroke:#7cb6dd}
.part[data-id="part-intake-port"]:not(.is-active) .body2{fill:#e0f1fc}
.part[data-id="part-exhaust-port"]:not(.is-active) .body{fill:#f5c9a6;stroke:#dd9a66}
.part[data-id="part-exhaust-port"]:not(.is-active) .body2{fill:#fbdec5}
.part[data-id="part-intake-valve"]:not(.is-active) .body{fill:#a9d9f2}
.part[data-id="part-intake-valve"]:not(.is-active) .body2{fill:#d5edfb}
.part[data-id="part-exhaust-valve"]:not(.is-active) .body{fill:#f4b98b}
.part[data-id="part-exhaust-valve"]:not(.is-active) .body2{fill:#fbdcc0}
.part[data-id="part-spark-plug"]:not(.is-active) .body{fill:#e2d4f3}
.part[data-id="part-spark-plug"]:not(.is-active) .body2{fill:#f0e8fa}
.part[data-id="part-spark-plug"]:not(.is-active) .accent{stroke:#8b5cf6}
.part[data-id="part-camshaft"]:not(.is-active) .body{fill:#c8c1e5}
.part[data-id="part-camshaft"]:not(.is-active) .body2{fill:#e2ddf3}
.part[data-id="part-combustion-chamber"]:not(.is-active) .body{fill:#f8d8bf}

/* ============ 四冲程发动机 · 飞轮旋转（复用现有 .impeller 动画，绕自身中心） ============ */
.part[data-id="part-flywheel"] .impeller{transform-origin:880px 720px}
