/* ===== Home 页面专属样式 ===== */

/* 局部还原常规无衬线字体（覆盖页面全局 Noto Serif SC） */
.gallery-label,
.services-label,
.service-flow-section,
.service-flow-nodes {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

/* 横幅区域 */
.banner-section {
    padding: 40px 60px 0;
    text-align: center;
    position: relative;
    z-index: 10;
    background: #fff;
}
.banner-text h1 {
    font-size: 42px;
    font-weight: normal;
    margin-bottom: 10px;
}
.banner-text .subtitle {
    font-size: 24px;
    color: #999;
    margin-bottom: 50px;
}
.banner-image {
    width: 95%;
    max-width: 4500px;
    aspect-ratio: 936 / 420;
    margin: 0 auto;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

/* 固定文字区域 - galleryLabel固定在顶部, title/subtitle在屏幕中央 */
.fixed-text-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}
.gallery-label {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 6px;
    color: #333;
    margin: 0;
    padding-top: 80px;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.gallery-label.visible {
    opacity: 1;
}
.monument-title {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 42px;
    font-weight: normal;
    margin: 0 0 15px;
    white-space: nowrap;
    color: #333;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.monument-subtitle {
    position: absolute;
    top: calc(45% + 40px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    color: #333;
    margin: 0;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* 产品展示区域 - 滚动切换 */
.products-section {
    position: relative;
    z-index: 10;
    background: transparent;
    margin-top: 900px;
    padding: 0 60px;
    height: 500vh; /* 4个产品 + 额外1屏停留 */
}
.products-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-showcase {
    display: grid;
    grid-template-columns: 320px 1fr 320px;
    gap: 20px;
    align-items: start;
    width: 100%;
    padding: 0 100px;
}
.product-info {
    position: relative;
}
.product-name-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}
.product-name {
    flex: 0 0 auto;
    font-size: 20px;
    font-weight: normal;
    color: #333;
    letter-spacing: 0.5px;
    margin: 0;
    line-height: 1.4;
    white-space: pre;
}
.explore-all-btn {
    display: inline-block;
    padding: 3px 20px;
    background: #222;
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    transition: background 0.3s;
    margin-left: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}
.explore-all-btn:hover {
    background: #444;
}
.product-size {
    margin-top: 15px;
}
.product-size p {
    font-size: 15px;
    color: #999;
    line-height: 1.8;
}
.product-main-image {
    width: 100%;
    height: 75vh;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 4px;
}

/* 产品指示器（完整文本） */
.product-indicators {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: flex-start;
    text-align: left;
    pointer-events: none;
    background: #fff;
    border-radius: 4px;
    /* 右侧区域整体向左移动 20px（相对定位，不影响 grid 布局）*/
    position: relative;
    left: -20px;
}
.indicator {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 20px;
    font-weight: normal;
    color: #ccc;
    transition: color 0.4s ease;
    line-height: 0.9;
}
.indicator-num {
    flex-shrink: 0;
    width: 16px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.indicator-text {
    white-space: pre;
}
.indicator.active {
    color: #333;
}

/* 项目展示区域 */
.projects-section {
    position: relative;
    z-index: 5;
    background: #fff;
    margin-top: 100px;
    padding-left: 16px;
    padding-right: 16px;
}

/* SERVICES 文字区域 - 普通文档流 */
.services-text-section {
    text-align: center;
    padding: 570px 20px 400px; /* 顶部 570px 补偿被移出文档流的 services-label 原有间距，保持标题位置不变 */
}
.services-label {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    padding-top: 80px;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 6px;
    color: #333;
    margin: 0;
    z-index: 900;
    pointer-events: none;
    opacity: 0; /* 默认隐藏，滚动进入服务流程区域时由 JS 淡入 */
    transition: opacity 0.5s ease;
}
.services-title {
    font-size: 42px;
    font-weight: normal;
    margin: 0 0 15px;
    color: #333;
}
.services-subtitle {
    font-size: 24px;
    color: #333;
    margin: 0;
}
.project-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.project-item {
    text-align: left;
    cursor: pointer;
    transition: opacity 0.3s;
}
.project-image {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 4px;
    margin-bottom: 15px;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}
.project-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.15);
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.project-item:hover .project-image::after {
    opacity: 0;
}
.blue-placeholder {
    background: #4a7fb5;
}
.project-item h3 {
    font-size: 20px;
    font-weight: normal;
    margin-bottom: 8px;
    color: #333;
}
.project-item p {
    font-size: 16px;
    color: #999;
}

/* ===== Services 流动线段动画区域 ===== */
.service-flow-section {
    position: relative;
    z-index: 5;
    background: transparent;
    height: 1000vh;
}
.service-flow-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}
.service-flow-label {
    position: absolute;
    top: 4%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 30px;
    letter-spacing: 6px;
    color: #ddd;
    font-weight: bold;
    z-index: 10;
    margin: 0;
}
.service-flow-svg {
    position: absolute;
    top: 15%;
    left: 0;
    width: 100%;
    height: 80%;
    z-index: 1;
    pointer-events: none;
    overflow: visible;
}
.service-flow-nodes {
    position: absolute;
    top: 15%;
    left: 0;
    width: 100%;
    height: 80%;
    z-index: 2;
}
.service-flow-node {
    position: absolute;
    transform: translateX(-50%);
    text-align: center;
    pointer-events: none;
    padding-top: 18px; /* 内容统一显示在黑点下方 */
}
.node-label {
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 1px;
    color: #aaa;
    white-space: nowrap;
    height: 16px;
    line-height: 16px;
    margin-bottom: 4px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
}
.service-flow-node.active .node-label {
    color: #333;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 1.5px;
    height: 22px;
    line-height: 22px;
}
.node-content {
    margin-top: 10px;
    opacity: 0;
    transform: translateY(-12px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}
.service-flow-node.active .node-content {
    opacity: 1;
    transform: translateY(0);
}
.node-icon {
    font-size: 52px;
    line-height: 1;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.node-icon svg {
    width: 56px;
    height: 56px;
}
.node-desc {
    font-size: 16px;
    max-width: 280px;
    color: #888;
    margin: 0 auto;
    /* 标记点位激活时仅展示主标题与 icon，隐藏下方描述文字 */
    display: none;
}
.service-flow-bottom {
    position: absolute;
    bottom: 4%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.8s ease;
}
.service-flow-bottom.visible {
    opacity: 1;
}
.service-flow-gear-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    display: block;
}
.service-flow-gear-icon svg {
    display: block;
    width: 60px;
    height: 60px;
}
.service-flow-bottom-text {
    font-size: 12px;
    color: #888;
    line-height: 1.8;
    margin: 0;
}

/* ===== 响应式 - 平板/手机 ≤768px ===== */
@media (max-width: 768px) {
    /* 横幅区域 */
    .banner-section {
        padding: 20px 16px 0;
    }
    .banner-text h1 {
        font-size: 18px;
    }
    .banner-text .subtitle {
        font-size: 13px;
        margin-bottom: 20px;
    }
    .banner-image {
        width: 100%;
        aspect-ratio: 16 / 9;
    }

    /* 固定文字区域 */
    .gallery-label {
        font-size: 16px;
        letter-spacing: 4px;
        padding-top: 80px;
    }
    .monument-title {
        font-size: 20px;
        white-space: normal;
        width: 100%;
        padding: 0 16px;
        box-sizing: border-box;
        text-align: center;
    }
    .monument-subtitle {
        font-size: 13px;
        top: calc(50% + 30px);
        white-space: normal;
        width: 100%;
        padding: 0 24px;
        box-sizing: border-box;
        text-align: center;
    }

    /* SERVICES 文字区域 - 手机端 */
    .services-text-section {
        padding: 220px 16px 100px; /* 顶部补偿 fixed 定位的 services-label 原有间距 */
    }
    .services-label {
        font-size: 16px;
        letter-spacing: 4px;
    }
    .services-title {
        font-size: 22px;
    }
    .services-subtitle {
        font-size: 14px;
    }

    /* 产品展示区域 */
    .products-section {
        margin-top: 750px;
        padding: 0 16px;
        height: 500vh;
    }
    .products-sticky {
        height: auto;
        min-height: 100vh;
        padding: 80px 0 30px;
    }
    .product-showcase {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0;
    }
    .product-info {
        display: block;
    }
    .product-name-row {
        display: flex;
        align-items: center;
        gap: 12px;
    }
    .product-name {
        flex: 1;
        min-width: 0;
        margin-bottom: 0;
        font-size: 13px;
        white-space: normal;
    }
    .explore-all-btn {
        flex-shrink: 0;
        margin-bottom: 0;
        font-size: 12px;
        padding: 3px 14px;
    }
    .product-size p {
        font-size: 11px;
    }
    .product-main-image {
        height: 36vh;
    }
    .product-indicators {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
        text-align: left;
    }
    .indicator {
        font-size: 11px;
        white-space: nowrap;
    }

    /* 项目展示区域 */
    .projects-section {
        padding: 40px 16px;
    }
    .project-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .project-item h3 {
        font-size: 15px;
    }
    .project-item p {
        font-size: 13px;
        line-height: 1.7;
    }

    /* Services 流动线段区域 - 手机端字体适配 */
    .service-flow-label {
        font-size: 11px;
        letter-spacing: 4px;
    }
    /* 手机端给节点固定宽度（而非 max-width），避免右侧边缘节点因可用空间不足被挤成多行；
       宽度按 6px 字号下最长标签两行排布设定，超出屏幕的边缘节点由 clampFlowNodeLabels 向内平移 */
    .service-flow-node {
        width: 160px;
    }
    .node-label {
        font-size: 6px;
        /* 允许长标题换行，取消固定高度避免多行被裁剪 */
        white-space: normal;
        height: auto;
        line-height: 1.3;
        /* 手机端仅对 transform/color 做过渡（不动 font-size，因而不会重排/换行），
           让放大平滑过度而非突兵出现 */
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s ease;
    }
    /* 激活：字号/字重/字间距全部与放大前保持一致（不触发重排），
       仅用 transform: scale 视觉放大 + text-stroke 视觉加粗，做到“原本几行放大后还是几行” */
    .service-flow-node.active .node-label {
        font-size: 6px;
        font-weight: 600;
        letter-spacing: 1px;
        height: auto;
        line-height: 1.3;
        transform: scale(1.67);
        transform-origin: top center;
        -webkit-text-stroke: 0.3px currentColor;
    }
    /* 第一个节点(Custom Monument)的标签与左下方 Expert 标签重叠，
       手机端把它单独移到黑点上方；left/right 撑满节点宽度并靠 text-align 居中，
       不用 transform 定位，以免与激活态的 scale 冲突 */
    .service-flow-node[data-index="0"] .node-label {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 100%;          /* 置于节点顶边(黑点中心)之上 */
        margin: 0 0 16px 0;    /* 与黑点保持间距，避开圆点半径 */
    }
    /* 放大时以底部中心为原点向上生长，避免盖住黑点 */
    .service-flow-node.active[data-index="0"] .node-label {
        transform-origin: bottom center;
    }
    .node-icon {
        font-size: 26px;
    }
    .node-icon svg {
        width: 30px;
        height: 30px;
    }
    .node-desc {
        font-size: 13px;
        white-space: normal;
    }
    .service-flow-gear-icon {
        width: 40px;
        height: 40px;
    }
    .service-flow-bottom-text {
        font-size: 10px;
    }
}
