/* 仅在首页加载的 CSS */
.yy-home-about, .yy-home-products, .yy-home-cases, .yy-home-factory, .yy-home-cert, .yy-home-news { padding: 60px 0; }

.yy-home-slider { width: 100%; overflow: hidden; position: relative; background: var(--yy-gray); }
.yy-slider-container { position: relative; width: 100%; max-width: 1920px; margin: 0 auto; }
.yy-slider-track { display: flex; transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1); will-change: transform; }
.yy-slider-slide { flex: 0 0 100%; width: 100%; }
.yy-slider-img { width: 100%; height: auto; max-height: 800px; object-fit: cover; display: block; border-radius: 0; }

.yy-slider-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3); color: #fff; border: none;
    width: 50px; height: 50px; font-size: 24px; cursor: pointer;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    transition: var(--yy-transition); opacity: 0; z-index: 10;
}
.yy-slider-container:hover .yy-slider-btn { opacity: 1; }
.yy-slider-btn:hover { background: var(--yy-primary); }
.yy-slider-prev { left: 30px; }
.yy-slider-next { right: 30px; }

.yy-slider-dots {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 10px; z-index: 10;
}
.yy-slider-dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.5); cursor: pointer; transition: var(--yy-transition);
}
.yy-slider-dot.active { background: var(--yy-primary); width: 24px; border-radius: 6px; }

/* ================= 首页关于我们 V2 布局 ================= */
.yy-about-v2-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 强制两栏等宽 */
    gap: 60px;
    align-items: center;
}
.yy-about-v2-title {
    font-size: 2.4rem;
    color: #222;
    margin-top: 0;
    margin-bottom: 25px;
}
.yy-about-v2-desc {
    color: var(--yy-text-muted);
    line-height: 1.8;
    margin-bottom: 30px;
    font-size: 1.05rem;
}
.yy-about-v2-features {
    list-style: none;
    padding: 0;
    margin: 0;
}
.yy-about-v2-features li {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--yy-text);
}

/* ================= 首页解决方案 (手风琴交互) ================= */
.yy-solutions-accordion {
    display: flex;
    width: 100%;
    height: 450px; /* 控制整体高度 */
    gap: 15px;
}

.yy-solution-item {
    position: relative;
    flex: 1; /* 闭合时占 1 份 (1/5) */
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    transition: flex 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    display: flex;
    align-items: flex-end;
}

/* 核心魔法：容器未被 hover 时，默认第一个展开；被 hover 时，悬停的展开 */
.yy-solutions-accordion:not(:hover) .yy-solution-item:first-child,
.yy-solution-item:hover {
    flex: 2; /* 展开时占 2 份 (2/5) */
}

/* 背景图缩放特效 */
.yy-solution-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; /* 核心：让 img 表现得像 background-size: cover */
    transition: transform 0.6s ease; z-index: 1;
}
.yy-solution-item:hover .yy-solution-bg {
    transform: scale(1.05);
}

/* 底部黑色渐变遮罩，确保文字清晰 */
.yy-solution-item::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 70%;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
    z-index: 2; transition: opacity 0.3s;
}

/* 文字内容区域 */
.yy-solution-content {
    position: relative; z-index: 3; padding: 30px; color: #fff;
    width: 100%; min-width: 260px; /* 防止闭合时文字被暴力挤压换行 */
}
.yy-solution-title {
    font-size: 1.5rem; margin: 0 0 10px 0; color: #fff;
    white-space: nowrap; text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

/* 摘要描述：默认隐藏，展开时平滑出现 */
.yy-solution-desc {
    opacity: 0; transform: translateY(20px); transition: all 0.4s ease;
    max-height: 0; overflow: hidden;
}
.yy-solutions-accordion:not(:hover) .yy-solution-item:first-child .yy-solution-desc,
.yy-solution-item:hover .yy-solution-desc {
    opacity: 1; transform: translateY(0); max-height: 150px; margin-top: 15px;
}
.yy-solution-desc p { font-size: 0.95rem; line-height: 1.6; margin: 0 0 15px 0; color: #eee; white-space: normal; }
.yy-solution-more { font-size: 0.9rem; font-weight: bold; color: #fff; }


/* ================= 首页工厂展示 ================= */
.yy-factory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* PC端强制 4 列 */
    gap: 20px;
}

.yy-factory-card {
    background: #ffffff;
    border: 1px solid #eaeaea; /* 浅色边框 */
    padding: 30px 20px;
    text-align: center;
    transition: var(--yy-transition);
}

/* 鼠标悬停加入微小的高级浮动感 */
.yy-factory-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.05);
    transform: translateY(-3px);
}

.yy-factory-img {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.yy-factory-img img {
    max-width: 100%;
    height: auto;
    /* 去除圆角以贴合截图硬朗的工业风 */
    border-radius: 0;
}

.yy-factory-title {
    font-size: 1.2rem;
    color: #333;
    margin: 0;
    font-weight: bold;
}

/* ================= 首页证书展示 (纯图片极简版) ================= */
.yy-cert-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* PC端 5 列 */
    gap: 15px;
}

.yy-cert-card {
    background: #ffffff;
    border: 1px solid #eaeaea; /* 浅色外边框 */
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: var(--yy-transition);
    height: 100%;
    box-sizing: border-box;
}

/* 悬停时轻微上浮加深阴影 */
.yy-cert-card:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transform: translateY(-3px);
}

.yy-cert-img {
    cursor: zoom-in;
    position: relative;
    border: 1px dashed #ddd; /* 内部虚线框，增加高级感 */
    padding: 10px;
    border-radius: 6px;
    overflow: hidden;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    box-sizing: border-box;
}

.yy-cert-img img {
    width: 100%;
    height: auto;
    transition: transform 0.4s ease;
}

/* 悬停图片放大与提示图标 */
.yy-cert-zoom-icon {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 24px; opacity: 0; transition: 0.3s; text-shadow: 0 2px 4px rgba(255,255,255,0.8);
}
.yy-cert-img:hover img { transform: scale(1.05); opacity: 0.8; }
.yy-cert-img:hover .yy-cert-zoom-icon { opacity: 1; color: var(--yy-primary); }

/* 原生 Lightbox 弹窗样式 */
.yy-lightbox-overlay {
    display: none; position: fixed; z-index: 9999; top: 0; left: 0;
    width: 100%; height: 100%; background: rgba(0, 0, 0, 0.85);
    align-items: center; justify-content: center; backdrop-filter: blur(5px);
    opacity: 0; transition: opacity 0.3s ease;
}
.yy-lightbox-overlay.active { display: flex; opacity: 1; }
.yy-lightbox-overlay img {
    max-width: 90%; max-height: 90vh; border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5); transform: scale(0.95); transition: transform 0.3s ease;
}
.yy-lightbox-overlay.active img { transform: scale(1); }
.yy-lightbox-close {
    position: absolute; top: 20px; right: 40px; color: #fff;
    font-size: 40px; cursor: pointer; font-weight: 300; transition: color 0.3s;
}
.yy-lightbox-close:hover { color: var(--yy-primary); }


/* ================= 首页合作伙伴 (左右布局版) ================= */
.yy-partner-layout {
    display: grid;
    grid-template-columns: 1fr 2.5fr; /* 左侧文字占 1 份，右侧 Logo 占 2.5 份 */
    gap: 60px;
    align-items: center;
}

/* 左侧文字区域 */
.yy-partner-title {
    font-size: 1.8rem;
    color: var(--yy-primary); /* 使用全局配置的蓝色 */
    margin-top: 0;
    margin-bottom: 25px;
    font-weight: bold;
}
.yy-partner-desc p {
    color: var(--yy-text-muted);
    font-size: 0.95rem;
    line-height: 1.8;
    margin: 0;
}
.yy-partner-desc strong {
    color: var(--yy-text);
}

/* 右侧 Logo 网格区域 */
.yy-partner-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 强制 3 列，6 个元素自动折成 2 行 */
    gap: 20px;
}
.yy-partner-item {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--yy-transition);
}

/* 鼠标悬停微交互 */
.yy-partner-item:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transform: translateY(-2px);
    border-color: #e0e0e0;
}

/* 控制 Logo 图片自适应不拉伸 */
.yy-partner-img {
    max-width: 100%;
    height: auto;
    max-height: 70px;
    object-fit: contain;
}

/* 移动端适配：改为上下排列 */
@media (max-width: 992px) {
    .yy-about-v2-grid {
        grid-template-columns: 1fr; /* 移动端折叠为单列 */
        gap: 40px;
    }

    .yy-slider-btn { display: none; }

    .yy-solutions-accordion { flex-direction: column; height: 800px; }

    .yy-factory-grid {
        grid-template-columns: repeat(2, 1fr); /* 手机端 2 列 */
        gap: 15px;
    }
    .yy-factory-card {
        padding: 15px 10px; /* 手机端缩小内边距 */
    }
    .yy-factory-title {
        font-size: 1rem; /* 手机端稍微缩小标题字体 */
    }

    .yy-cert-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .yy-cert-card { padding: 8px; }
    .yy-cert-img { padding: 8px; }

    .yy-partner-layout {
        grid-template-columns: 1fr; /* 手机端改为上下两排 */
        gap: 40px;
    }
    .yy-partner-grid {
        grid-template-columns: repeat(2, 1fr); /* 手机端 Logo 改为 2 列 */
        gap: 15px;
    }
    .yy-partner-item {
        padding: 15px;
    }

}
