/* R&D Technology page specific styles */

.rd-hero {
    position: relative;
    margin-top: 132px;
    height: 400px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.rd-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}

.rd-hero-overlay {
    position: absolute;
    inset: 0;
    background-image: url(../images/rd-bg.jpg);
    background-size: 100% 100%;
}

.rd-hero-content {
    position: relative;
    z-index: 2;
    color: var(--dark);
}

.rd-hero-content h1 {
    font-size: 54px;
    font-weight: 700;
    color:var(--dark);
}

.rd-hero-content p {
    margin-top: 24px;
    font-size: 18px;
    color: #333;
    line-height: 1.8;
    width: 590px;
}

/* Breadcrumb */
.rd-breadcrumb {
    background: var(--white);
    border-bottom: 1px solid #eee;
    font-size: 15px;
    color: #666;
    line-height: 60px;
    box-sizing: border-box;
}

.rd-breadcrumb i { margin-right: 8px; font-size: 15px;}
.rd-breadcrumb a { color: #333;font-size: 15px; }
.rd-breadcrumb a:hover { color: var(--primary); }
.rd-breadcrumb span { margin: 0 8px;font-size: 15px; }
.rd-breadcrumb .current { color: var(--primary); }

/* Section common */
.rd-section { padding: 70px 0; background: var(--white); }
.rd-section-title {
    font-size: 36px;
    font-weight: 700;
    text-align: center;
    color: #333;
    margin-bottom: 16px;
}
.rd-section-subtitle {
    text-align: center;
    font-size: 18px;
    color: #666;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* R&D System */
.rd-system-text {
    margin-bottom: 30px;
    width: 100%;
    color: #333;
    font-size: 18px;
    line-height: 2;
    /* 两端对齐：英文按单词断行时右边缘参差不齐（窄栏尤其明显），
       中文也是这个规则最自然。inter-ideograph 让中英混排的标点也参与对齐。 */
    text-align: justify;
    text-justify: inter-ideograph;
    word-break: normal;
}
.rd-system-text p { margin-bottom: 16px; }
.rd-system-text p:last-child { margin-bottom: 0; }

.rd-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap:26px 16px;
}
.rd-gallery img {
    width: 100%;
    /* height: 220px; */
    object-fit: cover;
    border-radius: 4px;
    /* transition: var(--transition); */
}
.rd-gallery img:hover { transform: scale(1.02); }

/* Partners */
.rd-partners-section { background: #faf8f5; }
.rd-partners {
    display: flex;
    justify-content: center;
    gap: 80px;
}
.rd-partner-img {
    /* display: block;
    width: 590px;
    height: 130px;
    border-radius: 4px; */
    object-fit: cover;
    /* background: #f0efec; */
    transition: var(--transition);
}
/* .rd-partner-img:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.1); } */

/* Directions */
.rd-directions-section { background: var(--white); }
.rd-directions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.rd-direction-card {
    background: var(--white);
    padding: 34px 24px;
    text-align: center;
    transition: var(--transition);
    border: 1px solid #dedede;
    border-radius: 4px;
}
.rd-direction-card:hover { transform: translateY(-6px); box-shadow: 0 10px 28px rgba(0,0,0,0.1); }
.rd-direction-icon {
    margin: 0 auto 20px;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.rd-direction-card h4 { font-size: 20px; font-weight: 500; margin-bottom: 14px; color: var(--dark); }
.rd-direction-card p { font-size: 18px; color: #333; line-height: 1.7; text-align: left;}

/* Responsive */
@media (max-width: 992px) {
    .rd-hero-overlay{
        background-size: cover;
        background-position: 60% center;
    }
    /* 移动端面包屑统一尺寸：基础规则里的 line-height:60px 是给桌面单行条用的固定行高，
       窄屏必须覆盖成 1.5，否则条高固定 60px、比其它页高 14px。
       14px 字号 + 1.5 行高 = 21px 行盒，上下 12px padding，加 1px 下边框 = 46px 条高。
       子元素（a / span / i）在基础规则里各自写死了 15px，这里一并压回 14px，
       否则行盒会被 15px 的子元素撑到 22.5px。 */
    .rd-breadcrumb { padding: 12px 0; font-size: 14px; line-height: 1.5; }
    .rd-breadcrumb a,
    .rd-breadcrumb span,
    .rd-breadcrumb i { font-size: 14px; }

    .rd-hero { margin-top: 64px; height: auto;  padding: 60px 0; }
    /* 移动端 hero 文案一律左对齐（客户要求，中英文一致）。
       .rd-hero 是 flex 容器，内容块作为 flex item 时 width:auto 会收缩成 fit-content、
       再被 .container 的 margin:0 auto 居中（中文短标题时左侧就空一大片）；
       这里显式铺满一行并清掉左右 auto 外边距，桌面不受影响（规则只在 ≤992 生效）。 */
    .rd-hero .rd-hero-content {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        text-align: left;
    }
    .rd-hero-content h1 { font-size: 28px; }
    .rd-hero-content p { width: auto; font-size: 16px; }
    /* 移动端统一：副标题 16px、段落/内容 16px（补齐无覆盖、会继承 PC 18px 的规则） */
    .rd-section-subtitle { font-size: 16px; }
    .rd-system-text { font-size: 16px; }
    .rd-direction-card p { font-size: 16px; }
    /* 577-992 区间防继承 PC 大字号 */
    .rd-section-title { font-size: 20px; }
    .rd-gallery { grid-template-columns: repeat(2, 1fr); }
    /* 移动端两列：原来是一列一张（flex 竖排），5 张 logo 要滚很久。
       改用 grid 两列，第 5 张落单时跨两列居中，宽度与上面任意一张一致，
       避免右下角空一块看起来像漏了一张。 */
    .rd-partners {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 24px 16px;
        align-items: center;
        justify-items: center;
        max-width: 560px;   /* 两列总共 560px，避免 992/768 档两列被 1fr 拉得太开 */
        margin: 0 auto;     /* 配合 max-width 让整块水平居中 */
    }
    .rd-partner-img {
        width: 100%;
        max-width: 220px;   /* logo 原始 150px，放大过多会糊；大屏时限制在 220px */
        height: auto;
    }
    .rd-partners .rd-partner-img:last-child {
        grid-column: 1 / -1;
        justify-self: center;
        /* 50% 是整行的一半，减去半个 gap 正好等于一列宽度，
           这样第 5 张与上面任意一张等宽；列宽超过 220px 时两者同时被 max-width 收住。 */
        width: calc(50% - 8px);
        max-width: 220px;
    }
    .rd-directions { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 576px) {
    .rd-hero-overlay{
        background-size: cover;
        background-position: 60% center;
    }
    .rd-hero-content h1 { font-size: 28px; }
    .rd-hero-content p { font-size: 16px; }
    .rd-section { padding: 60px 0; }
    .rd-section-title { font-size: 20px; }
    .rd-gallery { grid-template-columns: 1fr; }
    .rd-gallery img { height: 180px; }
    .rd-directions { grid-template-columns: 1fr; }
}

/* 英文窄屏一行只有 3~4 个单词，两端对齐会把词间距拉到 4~6 倍（390px 实测 23px，
   自然值 4.92px），比右边缘参差更难读。中文按字断行不存在这个问题，仍保持
   上面 .rd-system-text 的两端对齐。js-lang-zh 是中文态时加在 <html> 上的类。 */
@media (max-width: 575px) {
    html:not(.js-lang-zh) .rd-system-text { text-align: left; }
}
