/* ==========================================================
   案例详情页专属样式（前缀 csd-）
   依赖：main.css（全局基础、.container、.page-banner）
   ========================================================== */

/* ── Banner：1920×850 ───────────────────────────────────── */
.page-banner--case-detail {
    height: 850px;
}

.csd-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.csd-banner-img--placeholder {
    background-color: #2c2c2c;
}

/* ── 区块1：项目信息卡 ──────────────────────────────────── */
.csd-info-card {
    position: relative;
    z-index: 1;
    margin-top: -110px;
    display: flex;
    justify-content: center;
}

.csd-info-inner {
    width: 1420px;
    max-width: calc(100% - 40px);
    min-height: 548px;
    background-color: rgba(0, 0, 0, 0.451);
    padding: 160px 75px 90px 75px;
    box-sizing: border-box;
}

/* ── 上方行：信息 ─────────────────────────────────────────── */
.csd-info-top {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    min-height: 160px;
}

/* 左列：标题区 640px */
.csd-info-left {
    flex: 0 0 640px;
    width: 640px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* 英文标题：bold 40px 白色，固定 2 行高度 */
.csd-title-en {
    font-size: 40px;
    font-family: 'HarmonyOS_Sans_SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.3;
    height: calc(40px * 1.3 * 2); /* 固定 2 行高度 ≈ 104px */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 中文标题：light 40px 白色 */
.csd-title-cn {
    font-size: 40px;
    font-family: 'HarmonyOS_Sans_SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-weight: 300;
    color: #fff;
    margin: 0;
    line-height: 1.3;
    word-wrap: break-word;
}

/* 右列：参数表 530px */
.csd-info-right {
    flex: 0 0 530px;
    width: 530px;
}

/*
 * 参数网格：4 行 × 2 列，垂直两端对齐
 *
 * 结构示例：
 *   项目地址：xxx          Project address：xxx
 *   服务内容：xxx          Service content：xxx
 *   项目面积：xxx          Project area：xxx
 *   完工时间：xxx          Completion time：xxx
 */
.csd-meta-grid {
    display: grid;
    grid-template-columns: auto 1fr; /* 左列按内容收缩，右列占满剩余 */
    column-gap: 40px;
    height: 160px;
    align-content: space-between;
}

.csd-meta-cell {
    font-size: 18px;
    font-family: 'HarmonyOS_Sans_SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-weight: 300;
    color: #fff;
    line-height: 1.5;
}

.csd-meta-key {
    opacity: 0.7;
}

.csd-meta-val {
    /* 保持 100% 不透明 */
}

/* ── 下方行：简介（距上方 60px）───────────────────────────── */
.csd-info-desc {
    margin-top: 60px;
}

.csd-info-desc p {
    font-size: 18px;
    font-family: 'HarmonyOS_Sans_SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-weight: 300;
    color: #fff;
    margin: 0;
    line-height: 1.8;
}

/* ── 区块2：图集轮播（距区块1 130px）──────────────────── */
.csd-gallery {
    margin-top: 130px;
}

.csd-gallery-viewport {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.csd-gallery-track {
    display: flex;
    transition: transform 0.5s ease;
    will-change: transform;
}

.csd-gallery-slide {
    flex: 0 0 100%;
    width: 100%;
}

.csd-gallery-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* ── 左右箭头 ─────────────────────────────────────────────── */
.csd-gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.2);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background-color 0.2s;
    padding: 0;
}

.csd-gallery-arrow:hover {
    background-color: rgba(0, 0, 0, 0.4);
}

.csd-gallery-arrow--prev {
    left: 180px;
}

.csd-gallery-arrow--next {
    right: 180px;
}

/* ── 右下角计数器 ─────────────────────────────────────────── */
.csd-gallery-counter {
    position: absolute;
    bottom: 60px;
    right: 250px;
    z-index: 2;
    display: flex;
    align-items: baseline;
    gap: 4px;
    line-height: 1;
}

.csd-gallery-current {
    font-size: 76px;
    font-family: 'HarmonyOS_Sans_SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-weight: 300;
    color: #fff;
}

.csd-gallery-sep,
.csd-gallery-total {
    font-size: 41px;
    font-family: 'HarmonyOS_Sans_SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-weight: 300;
    color: #fff;
}

/* ==========================================================
   响应式
   ========================================================== */
@media screen and (max-width: 1200px) {
    .page-banner--case-detail {
        height: 600px;
    }

    .csd-info-inner {
        padding: 100px 50px 60px 50px;
        min-height: auto;
    }

    .csd-info-top {
        flex-direction: column;
        gap: 40px;
        min-height: auto;
    }

    .csd-info-left {
        flex: none;
        width: 100%;
    }

    .csd-info-right {
        flex: none;
        width: 100%;
    }

    .csd-meta-grid {
        height: auto;
        gap: 20px 0;
    }

    .csd-title-en {
        font-size: 30px;
        height: auto;
    }

    .csd-title-cn {
        font-size: 30px;
        margin-top: 12px;
    }
}

@media screen and (max-width: 960px) {
    .page-banner--case-detail {
        height: 400px;
    }

    .csd-info-card {
        margin-top: -60px;
    }

    .csd-info-inner {
        padding: 60px 30px 40px 30px;
    }

    .csd-title-en,
    .csd-title-cn {
        font-size: 24px;
    }

    .csd-meta-cell {
        font-size: 15px;
    }

    .csd-info-desc p {
        font-size: 15px;
    }

    .csd-gallery {
        margin-top: 80px;
    }

    .csd-gallery-arrow {
        width: 60px;
        height: 60px;
    }

    .csd-gallery-arrow svg {
        width: 14px;
        height: 24px;
    }

    .csd-gallery-arrow--prev { left: 16px; }
    .csd-gallery-arrow--next { right: 16px; }

    .csd-gallery-current {
        font-size: 48px;
    }

    .csd-gallery-sep,
    .csd-gallery-total {
        font-size: 28px;
    }
}

@media screen and (max-width: 600px) {
    .page-banner--case-detail {
        height: 260px;
    }

    .csd-info-card {
        margin-top: -40px;
    }

    .csd-info-inner {
        padding: 40px 20px 30px 20px;
    }

    .csd-info-top {
        gap: 24px;
    }

    .csd-title-en,
    .csd-title-cn {
        font-size: 20px;
    }

    .csd-meta-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .csd-info-desc {
        margin-top: 30px;
    }

    .csd-gallery {
        margin-top: 40px;
    }

    .csd-gallery-arrow {
        width: 44px;
        height: 44px;
    }

    .csd-gallery-arrow svg {
        width: 10px;
        height: 18px;
    }

    .csd-gallery-arrow--prev { left: 10px; }
    .csd-gallery-arrow--next { right: 10px; }

    .csd-gallery-counter {
        bottom: 16px;
        right: 16px;
    }

    .csd-gallery-current {
        font-size: 36px;
    }

    .csd-gallery-sep,
    .csd-gallery-total {
        font-size: 22px;
    }
}
