/* ===== 1. 基础与重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background: #f8fafc;
    min-height: 100vh;
    position: relative; /* 为绝对定位的子元素提供参考 */
}

/* ===== 2. 最底层：3D背景容器 ===== */
/* 这个容器将放置Canvas，作为最底层背景 */
#3d-banner-container {
    position: fixed; /* 固定定位，覆盖整个视口 */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1; /* 最底层 */
    pointer-events: none; /* 允许交互穿透 */
}
#3d-banner-canvas { width: 100%; height: 100%; display: block; }
.loading-msg {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.8);
    z-index: 2;
}

/* ===== 3. 中间层：服务卡片Grid容器 ===== */
/* 这个新容器专门包裹6个卡片，并实现Grid布局 */
.cards-grid-container {
    position: relative; /* 建立定位上下文 */
    z-index: 3; /* 在3D背景(1)之上，在头部(4)之下 */
    display: grid;
    /* 关键：定义自适应的网格列。这里设定为最小300px，自动填充。 */
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.8rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    /* 通过负margin让Grid区域向上延伸，与头部区域自然衔接 */
    margin-top: -5vh;
}

/* ===== 4. 最顶层：头部区域 (横幅+标题+导航) ===== */
.div-header {
    position: relative;
    z-index: 4; /* 最高层，确保在最前面 */
    text-align: center;
    padding: 2rem 1rem 1rem;
    color: white;
    /* 可选：为深色文字在复杂背景上增加可读性 */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

/* 横幅图片 - 保持您的响应式方案 */
.banner-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 40vh;
    object-fit: cover;
    margin: 1rem auto;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
@media (max-width: 768px) {
    .banner-img {
        height: 35vh !important;
        width: auto;
        max-width: 95%;
        max-height: none;
    }
}

/* 导航样式 */
.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    padding: 1.5rem 0 0;
}
.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: all 0.3s ease;
    font-weight: 500;
}
.nav-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* ===== 5. 卡片通用样式 (位于.cards-grid-container内) ===== */
/* 选中所有以 `div-` 开头的卡片 */
[class^="div-"]:not(.div-header) {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-radius: 18px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(31, 38, 135, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.9);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
[class^="div-"]:not(.div-header):hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(31, 38, 135, 0.25);
}

/* 卡片内部元素样式 */
.service-title {
    color: #2d3748;
    margin-bottom: 0.8rem;
    font-size: 1.6rem;
}
[class^="div-"]:not(.div-header) h3 {
    color: #4a5568;
    margin-bottom: 1.2rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
}
[class^="div-"]:not(.div-header) p {
    color: #718096;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    line-height: 1.5;
}
.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    margin-top: 0.8rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}
.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(102, 126, 234, 0.5);
}

/* ===== 6. 页脚 ===== */
footer {
    position: relative;
    z-index: 3; /* 与卡片同层 */
    text-align: center;
    padding: 2.5rem 1rem;
    margin-top: 2rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}
footer p { margin-bottom: 0.5rem; color: #4a5568; }
footer .small { font-size: 0.85rem; opacity: 0.8; max-width: 800px; margin: 0.5rem auto; }

/* ===== 7. 响应式微调 ===== */
@media (max-width: 768px) {
    .cards-grid-container {
        grid-template-columns: 1fr; /* 小屏单列 */
        padding: 1.5rem;
        margin-top: 0; /* 移动端取消负margin */
        gap: 1.5rem;
    }
    .div-header h1 { font-size: 2rem; }
    .site-lead { font-size: 1.1rem; }
    .main-nav ul { flex-direction: column; align-items: center; }
    .nav-link { width: 90%; text-align: center; margin-bottom: 0.5rem; }
}