/* 首页：工艺流程示意图 + 长英文/日文标题适配（加载于 home-b.css 之后） */

.process-flow {
    position: relative;
    margin: clamp(28px, 4vw, 48px) 0 0;
    padding: clamp(18px, 2.6vw, 36px) clamp(16px, 3vw, 44px);
    width: 100%;
    border: 1px solid rgba(31, 95, 191, .16);
    border-radius: 16px;
    /* 与上方工艺卡片同宽；浅蓝底 + 细点阵，融入页面背景，不再用突兀的纯白 */
    background:
        radial-gradient(rgba(31, 95, 191, .09) 1px, transparent 1.4px) 0 0 / 22px 22px,
        linear-gradient(135deg, #f4f8fe 0%, #e7f0fb 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
    box-sizing: border-box;
}

.process-flow__stage {
    position: relative;
    container-type: inline-size;
}

.process-flow__svg {
    display: block;
    width: 100%;
    height: auto;
}

/* 说明文字统一放在各自图形正上方、左对齐、单行不换行；
   坐标基于 1200x460 的 viewBox 换算为百分比，字号用 cqw 随图等比缩放，保证任何宽度下都不折行、不重叠。 */
.process-flow__notes {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.process-flow__cap {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: .25em;
    white-space: nowrap;
    color: #4A5D78;
    font-size: 13px;
    font-size: 1.1cqw;
    line-height: 1.5;
}
.process-flow__cap strong {
    color: var(--c-brand-deep, #163A7A);
    font-size: 1.3em;
    font-weight: 700;
    line-height: 1.3;
}
.process-flow__cap--mother { left: 2.5%;   bottom: 50.9%; }
.process-flow__cap--slit   { left: 26.67%; bottom: 83%; }
.process-flow__cap--shear  { left: 26.5%;  bottom: 32.2%; }
.process-flow__cap--manual { left: 61.67%; bottom: 32.2%; }

/* 整体居中：图形 + 说明文字的实际外框（按 1200 单位实测：左 30；右端 zh 1057 / ja 1188 / en 1098）
   与舞台左右留白不等，按语言平移使其水平居中。translate 百分比相对舞台宽度，= 偏移单位 / 1200。 */
@media (min-width: 1101px) {
    .process-flow__stage { translate: 4.73% 0; }
    html[lang^="ja"] .process-flow__stage { translate: -0.78% 0; }
    html[lang="en"] .process-flow__stage { translate: 2.99% 0; }
}

/* 窄屏：叠放的文字放不下，改为图下方的说明列表 */
@media (max-width: 1100px) {
    .process-flow__notes {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px 20px;
        margin-top: 18px;
    }
    .process-flow__cap {
        position: static;
        white-space: normal;
        font-size: 13px;
        padding-left: 12px;
        border-left: 3px solid #1F5FBF;
    }
}
@media (max-width: 480px) {
    .process-flow__notes { grid-template-columns: 1fr; }
}

/* ---- 动效（process-flow.js：.pf-ready 隐藏初始状态，.pf-play 分段播放，.pf-done 后线条持续流动）----
   时间线（秒）：母卷 0–0.5 → 主线 0.5 → 分支 0.85 → 箭头 1.2 → 分条 / 切方 1.45–2.7
               → 手工剪板连线 2.9 → 小板 3.4–4.0 → 文案随各段淡入 → 4.6 起线条流动 */
.process-flow .pf-mother,
.process-flow .pf-shear-coil,
.process-flow .pf-head,
.process-flow .pf-piece { transform-box: fill-box; transform-origin: center; }
.process-flow .pf-flow { opacity: 0; stroke-dasharray: 3 22; }
.process-flow.pf-ready { cursor: pointer; }

.pf-ready:not(.pf-play) :is(.pf-mother, .pf-head, .pf-slit, .pf-shear-coil, .pf-sheet, .pf-piece, .process-flow__cap) { opacity: 0; }
.pf-ready .pf-line { stroke-dasharray: 1; stroke-dashoffset: 1; }

.pf-play .pf-mother        { animation: pf-pop .5s cubic-bezier(.2, .8, .3, 1.15) both; }
.pf-play .pf-line--trunk   { animation: pf-draw .35s ease-out .5s both; }
.pf-play .pf-line--up,
.pf-play .pf-line--down    { animation: pf-draw .45s ease-out .85s both; }
.pf-play .pf-head--up,
.pf-play .pf-head--down    { animation: pf-pop .25s ease-out 1.25s both; }
.pf-play .pf-slit--1,
.pf-play .pf-shear-coil    { animation: pf-fade .3s ease-out 1.45s both; }
/* 分条：后两卷先藏在第一卷下面一起出现，再向右滑出 */
.pf-play .pf-slit--2       { animation: pf-fade .3s ease-out 1.45s both, pf-slide-40 .55s cubic-bezier(.3, .7, .3, 1) 1.85s both; }
.pf-play .pf-slit--3       { animation: pf-fade .3s ease-out 1.45s both, pf-slide-80 .75s cubic-bezier(.3, .7, .3, 1) 1.85s both; }
.pf-play .pf-sheet--1      { animation: pf-sheet .35s ease-out 1.9s both; }
.pf-play .pf-sheet--2      { animation: pf-sheet .35s ease-out 2.15s both; }
.pf-play .pf-sheet--3      { animation: pf-sheet .35s ease-out 2.4s both; }
.pf-play .process-flow__cap--mother { animation: pf-fade .4s ease-out .4s both; }
.pf-play .process-flow__cap--slit  { animation: pf-fade .4s ease-out 2.5s both; }
.pf-play .process-flow__cap--shear { animation: pf-fade .4s ease-out 2.7s both; }
.pf-play .pf-line--manual  { animation: pf-draw .45s ease-out 2.9s both; }
.pf-play .pf-head--manual  { animation: pf-pop .25s ease-out 3.3s both; }
.pf-play .pf-piece--1      { animation: pf-pop .3s ease-out 3.4s both; }
.pf-play .pf-piece--2      { animation: pf-pop .3s ease-out 3.5s both; }
.pf-play .pf-piece--3      { animation: pf-pop .3s ease-out 3.6s both; }
.pf-play .pf-piece--4      { animation: pf-pop .3s ease-out 3.7s both; }
.pf-play .pf-piece--5      { animation: pf-pop .3s ease-out 3.8s both; }
.pf-play .pf-piece--6      { animation: pf-pop .3s ease-out 3.9s both; }
.pf-play .process-flow__cap--manual { animation: pf-fade .4s ease-out 4.1s both; }

.pf-done .pf-flow { opacity: 1; transition: opacity .6s ease; animation: pf-march 1.6s linear infinite; }

@keyframes pf-pop      { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: none; } }
@keyframes pf-fade     { from { opacity: 0; } to { opacity: 1; } }
@keyframes pf-draw     { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pf-slide-40  { from { transform: translateX(-40px); } to { transform: none; } }
@keyframes pf-slide-80  { from { transform: translateX(-80px); } to { transform: none; } }
@keyframes pf-sheet    { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes pf-march    { to { stroke-dashoffset: -25; } }

@media (prefers-reduced-motion: reduce) {
    .process-flow .pf-flow { display: none; }
}

/* 英文标题更长：允许换行并略缩字号，避免撑出屏幕 */
html[lang="en"] .hero-banner__title {
    flex-wrap: wrap;
    font-size: clamp(28px, 3.7vw, 54px);
    line-height: 1.12;
}
html[lang="en"] .hero-banner__title .text { white-space: normal; }
html[lang="en"] .hero-banner__anniversary-label { font-size: .34em; }

/* 英文单位（Year / Persons / tons）与数字之间留出间距 */
html[lang="en"] .stats__value { gap: 8px; }

/* 首页蒙版减淡后，英文副标题不再跨到右侧厂房上 */
@media (min-width: 641px) {
    html[lang="en"] .hero-banner__sub { max-width: 26em; }
}
