/* 全局重置 + 性能优化基础 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* 开启硬件加速，减少重绘卡顿 */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

body {
    font-family: "Microsoft Yahei", "PingFang SC", sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased; /* 字体抗锯齿，提升渲染流畅度 */
}

/* 通用容器 - 限制最大宽度，避免极端屏幕布局错乱 */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 - 粘性定位 + 硬件加速，减少滚动卡顿 */
.top-header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 999;
    will-change: transform; /* 告诉浏览器提前优化渲染 */
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    padding: 0 20px;
    max-width: 1280px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.logo span {
    font-size: 16px;
    font-weight: 600;
    color: #12192c;
}

.top-nav {
    display: flex;
    gap: 30px;
}

.top-nav a {
    text-decoration: none;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
}

.top-nav a.active, .top-nav a:hover {
    color: #0078ff;
}

.top-nav a.active::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #0078ff;
}

/* 面包屑 */
.breadcrumb {
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #999;
}

.breadcrumb .current {
    color: #0078ff;
    font-weight: 500;
}

/* 核心：3列布局 + 响应式适配 */
.case-container {
    padding: 40px 0;
}

/* 网格布局实现一行3个，自动换行 */
.case-grid {
    display: grid;
    /* 3列，列间距20px，自适应宽度 */
    grid-template-columns: repeat(3, 1fr);
    gap: 25px; 

    grid-auto-rows: 1fr;
}

.case-card {
    color: #333;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    cursor: default;
}

.case-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

/* 图片容器 - 固定高度，避免加载时布局跳动 */
.card-img {
    width: 100%;
    height: 240px;
    overflow: hidden;
}

/* 图片样式 - 覆盖容器，平滑过渡 */
.case-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保持比例，裁剪多余部分 */
    transition: transform 0.5s ease; /* 平滑缩放，避免卡顿 */
}

.case-card:hover .case-img {
    transform: scale(1.05); /* hover轻微放大，提升交互感 */
}

/* 案例名称 */
.card-name {
    padding: 18px 15px;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* 超长名称省略 */
}

/* 页脚 */
.footer {
    background: #12192c;
    color: #fff;
    padding: 30px 0;
    text-align: center;
    font-size: 14px;
    margin-top: 20px;
}

/* 响应式适配 - 不同屏幕自动调整列数 */
/* 平板：一行2个 */
@media (max-width: 992px) {
    .case-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 手机：一行1个 */
@media (max-width: 576px) {
    .case-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .header-container {
        flex-direction: column;
        height: auto;
        padding: 15px 0;
    }
    
    .top-nav {
        margin-top: 15px;
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .card-img {
        height: 200px; /* 手机端图片高度适配 */
    }
}