/* --- 1. 全局变量定义 --- */
:root {
    --primary-blue: #003366;  /* 鸿泰主色：科技深蓝 */
    --accent-gold: #c5a059;   /* 强调色：工业金 */
    --bg-light: #f4f7f9;      /* 背景色：浅灰蓝 */
    --text-dark: #333333;     /* 文字色：深灰 */
    --white: #ffffff;
}

/* --- 2. 基础重置 --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    font-family: 'Segoe UI', "Microsoft YaHei", sans-serif; 
    color: var(--text-dark); 
    line-height: 1.6; 
    background-color: var(--white);
    overflow-x: hidden; 
}
.container { width: 90%; max-width: 1200px; margin: auto; }

/* --- 3. 导航栏样式 --- */
.navbar { 
    background: var(--white); 
    padding: 20px 0; 
    border-bottom: 2px solid var(--bg-light); 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
    transition: all 0.3s ease;
}
.navbar .container { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 24px; font-weight: bold; color: var(--primary-blue); text-decoration: none; text-transform: uppercase; }
.logo span { color: var(--accent-gold); }

.nav-links { display: flex; list-style: none; align-items: center; }
.nav-links li a { 
    margin-left: 25px; 
    text-decoration: none; 
    color: var(--text-dark); 
    font-weight: 500; 
    font-size: 15px;
    transition: color 0.3s;
}
.nav-links li a:hover, .nav-links li a.active { color: var(--accent-gold); }

/* --- 4. 英雄海报区 (Hero Section) --- */
.hero-section {
    /* 1. 基础尺寸 */
    height: 85vh;
    min-height: 500px;
    
    /* 2. 背景设置 (保持你原有的逻辑) */
    background: #002244; /* 设置底色防止图片未加载时发白 */
    background-image: linear-gradient(rgba(0, 34, 68, 0.75), rgba(0, 34, 68, 0.75)), 
                      url('images/hero-bg.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    /* 3. 核心对齐修复：使用 !important 确保不受全局 Flex 置底补丁的影响 */
    display: flex !important;
    flex-direction: column !important; /* 纵向排列标题、段落和按钮 */
    justify-content: center !important; /* 垂直方向居中 */
    align-items: center !important;    /* 水平方向居中 */
    
    text-align: center;
    color: #fff;
    position: relative;
    z-index: 1; /* 确保在遮罩层之上 */
}

.hero-content {
    width: 90%;
    max-width: 1200px;
    /* 这里的 margin: auto 配合 flex 会自动寻找中心 */
    margin: 0 auto; 
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 25px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 2px;
}

.hero-content p {
    font-size: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
    opacity: 0.9;
}

/* 移动端适配微调 */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    .hero-content p {
        font-size: 1.1rem;
    }
}


/* --- 5. 数字背书条 (Stats Bar) --- */
.stats-bar {
    background: var(--primary-blue);
    padding: 40px 0;
    color: #fff;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    text-align: center;
}
.stat-number {
    display: block;
    font-size: 2.2rem;
    font-weight: bold;
    color: var(--accent-gold);
    margin-bottom: 5px;
}
.stat-item p { font-size: 0.9rem; opacity: 0.8; }

/* --- 6. 核心优势区域 --- */
.section-title {
    text-align: center;
    margin-bottom: 50px;
    color: var(--primary-blue);
    font-size: 2.2rem;
}
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}
.feature-item {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    text-align: center;
    border-top: 3px solid var(--accent-gold);
}
.icon { font-size: 3rem; margin-bottom: 20px; display: block; }

/* --- 7. 通用样式与动效 --- */
/* --- 统一后的 Banner 基础样式 --- */
.page-banner {
    /* 统一使用深蓝色渐变，符合鸿泰半导体的科技感 */
    background: linear-gradient(135deg, var(--primary-blue), #004a99) !important;
    color: var(--white) !important;
    padding: 80px 0 !important;
    text-align: center;
    border-bottom: 4px solid var(--accent-gold); /* 统一加上金边装饰 */
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
}

.page-banner h1 { 
    font-size: 2.8rem; 
    margin-bottom: 15px; 
    font-weight: 700;
}

.page-banner p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
}

.reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s ease-out; }
.reveal.active { opacity: 1; transform: translateY(0); }

.btn-primary { 
    background: var(--primary-blue); 
    color: var(--white); 
    padding: 12px 30px; 
    border-radius: 4px; 
    text-decoration: none; 
    display: inline-block; 
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}
.btn-primary:hover { background: var(--accent-gold); transform: translateY(-2px); }

/* --- 8. 页脚样式 --- */
.footer { background: #1a1a1a; color: #ccc; padding: 60px 0; margin-top: 50px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; }
.footer h4 { color: var(--white); margin-bottom: 20px; }
.footer p { font-size: 14px; margin-bottom: 10px; }
.copyright { text-align: center; border-top: 1px solid #333; margin-top: 40px; padding-top: 20px; font-size: 13px; }

/* --- 9. 移动端适配 --- */
@media (max-width: 768px) {
    .nav-links { display: none; } 
    .hero-content h1 { font-size: 2.5rem; }
    .hero-content p { font-size: 1.1rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 30px; }
    .page-banner h1 { font-size: 1.8rem; }
    /* 修正 industry-card 在移动端的表现 */
    .industry-card { flex-direction: column !important; }
    .industry-card div { padding-right: 0 !important; margin-bottom: 30px; }
}



/* 页脚链接标题下的小装饰 */
.footer-links h4 {
    color: var(--white);
    font-size: 1.15rem;
    margin-bottom: 25px;
    position: relative;
    font-weight: 600;
}

.footer-links h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 35px;
    height: 2px;
    background: var(--accent-gold); /* 标志性的工业金横杠 */
}

.footer-links ul { list-style: none; }
.footer-links ul li { margin-bottom: 12px; }

.footer-links ul li a {
    color: #999;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

/* 悬停时的灵动感：微移并变色 */
.footer-links ul li a:hover {
    color: var(--accent-gold);
    padding-left: 8px;
}


/* ============================================================
   终极布局修正：解决点击位移 + 解决 Banner 变形 + 强制置底
   ============================================================ */

/* 1. 核心：强制所有页面显示滚动条轨道，防止跳转位移 */
html {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-y: scroll !important; /* 强制显示滚动条槽 */
}

body {
    min-height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* 2. 核心：防止 Banner 被 Flex 错误拉伸变形 */
#header-plugin, 
.page-banner { 
    flex-shrink: 0 !important; 
    flex-grow: 0 !important; 
}

/* 3. 核心：让内容区（如产品列表）自动占据剩余空间，推开页脚 */
main, 
.product-list, 
.industry-section, 
.container.industry-section,
#header-plugin + section { 
    flex: 1 0 auto; 
    display: block; /* 确保它是块级元素 */
}

/* 4. 页脚置底 */
#footer-plugin { 
    margin-top: auto; 
    flex-shrink: 0; 
    background: #1a1a1a; 
    position: relative;
    z-index: 10;
}

/* 如果你的产品页 Banner 还是觉得太厚，可以微调这里 */
.page-banner {
    padding: 60px 0 !important;
}


/* --- 修正 industry-card 的潜在问题 --- */
.industry-card { 
    display: flex; 
    background: #fff; 
    border: 1px solid #eee; 
    margin-bottom: 40px; 
    overflow: hidden; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    /* 删掉任何固定的 height: XXXpx; 确保它是高度自适应的 */
    min-height: min-content; 
}

/* --- 鸿泰顶级动效 CSS 驱动 --- */

/* 1. 基础状态：所有动效板块初始不可见且下移 */
.ht-effect-section {
    opacity: 0;
    transform: translateY(60px); /* 下移 60px，创造升起感 */
    transition: 
        opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1), /* 优雅的缓动曲线 */
        transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform; /* 性能优化 */
}

/* 2. 激活状态：板块升起并渐现 */
.ht-section-active {
    opacity: 1;
    transform: translateY(0);
}

/* 3. 交错延迟元素 (用于卡片、数字等) */
.ht-stagger {
    opacity: 0;
    transform: translateY(30px);
    /* JS 会自动计算并注入 transition-delay */
    transition: 
        opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 4. 视差背景基础样式 */
.ht-parallax-bg {
    background-attachment: scroll; /* 必须是 scroll，JS 才能控制位置 */
    background-size: cover;
    background-position: center 0;
}

/* 针对 Feature Item 的微调 */
.feature-item {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* 平滑过渡 */
    cursor: default;
}

/* 悬停时：卡片轻微上浮，影子变重，装饰条加宽 */
.feature-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 51, 102, 0.1); /* 带有主色调阴影 */
    border-top: 3px solid var(--primary-blue); /* 悬停时金边变蓝，体现科技感切换 */
}

/* 悬停时图标微动 */
.feature-item:hover .icon {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}


.page-banner p {
    color: rgba(255, 255, 255, 0.85); /* 85%的透明白色，专业且柔和 */
    font-size: 1.1rem;
    max-width: 800px;
    margin: 15px auto 0; /* 自动居中并保持与标题的距离 */
    line-height: 1.6;
    font-weight: 300; /* 使用细体字会显得更高端 */
}

@media (max-width: 768px) {
    .tech-banner {
        height: 40vh; /* 手机端稍微矮一点，更符合握持习惯 */
    }
}


.tech-banner {
    height: 65vh; 
    min-height: 450px;
    background: linear-gradient(rgba(0, 34, 68, 0.75), rgba(0, 34, 68, 0.75)), 
                url('images/tech-hero-bg.jpg') center center/cover no-repeat;
    
    /* 核心修复：强制内容垂直水平居中 */
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important; /* 确保文字从顶部回到正中间 */
    align-items: center !important;    /* 确保文字水平居中 */
    
    color: white;
    text-align: center;
    border-bottom: 5px solid var(--accent-gold);
    padding: 0 !important; /* 必须清除之前的 padding，否则会把文字顶偏 */
    margin: 0;
}

/* 确保内部文字不会因为父容器变大而跑偏 */
.tech-banner .banner-text-wrapper {
    width: 90%;
    max-width: 900px;
    margin: 0 auto;
}

.en-hero {
    /* 使用与中文版一致的混合模式遮罩 */
    background: linear-gradient(rgba(0,51,102,0.85), rgba(0,51,102,0.85)), 
                url('images/lab-bg.jpg') center/cover no-repeat !important;
    padding: 100px 0;
    border-bottom: 4px solid var(--accent-gold);
}


/* 产品详情卡片布局 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, min-minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.product-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,51,102,0.1);
}

.product-image {
    width: 100%;
    height: 250px;
    background: #f8f9fa; /* 图片加载前的背景色 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

.product-info {
    padding: 25px;
}

.product-info h3 {
    color: var(--primary-blue);
    margin-bottom: 10px;
}

.product-tags {
    margin: 10px 0 20px;
}

.tag {
    display: inline-block;
    background: var(--bg-light);
    color: var(--primary-blue);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-right: 8px;
}

/* 核心价值板块 */
.product-features-bar {
    background: var(--primary-blue);
    color: white;
    padding: 60px 0;
    margin: 60px 0;
}

.features-inner {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    text-align: center;
    gap: 20px;
}

.feature-box h4 {
    color: var(--accent-gold);
    font-size: 1.3rem;
    margin-bottom: 10px;
}
