/* ============================================================
   Hongtai Chemical - Global Master Stylesheet (v3.0)
   文件名：style.css
   定位：高效工业水处理与膜系统特种药剂服务商
   ============================================================ */

/* --- 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; 
}

html {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-y: scroll !important; /* 强制显示滚动条轨道，防止页面跳转抖动 */
}

body { 
    min-height: 100%;
    font-family: 'Segoe UI', "Microsoft YaHei", sans-serif; 
    color: var(--text-dark); 
    line-height: 1.6; 
    background-color: var(--white);
    overflow-x: hidden; 
    word-break: break-word; /* 增强移动端长单词与化学式容错 */
    overflow-wrap: break-word;
    display: flex;
    flex-direction: column;
}

.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 {
    height: 85vh;
    min-height: 500px;
    background: var(--primary-blue); /* 防止图片加载时发白 */
    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;
    
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    
    text-align: center;
    color: var(--white);
    position: relative;
    z-index: 1;
}

.hero-content {
    width: 90%;
    max-width: 1200px;
    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;
}

/* --- 5. 技术 Banner 区域 --- */
.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: var(--white);
    text-align: center;
    border-bottom: 5px solid var(--accent-gold);
    padding: 0 !important;
    margin: 0;
}

.tech-banner .banner-text-wrapper {
    width: 90%;
    max-width: 900px;
    margin: 0 auto;
}

.page-banner {
    background: linear-gradient(135deg, var(--primary-blue), #004a99) !important;
    color: var(--white) !important;
    padding: 60px 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.85);
    font-size: 1.1rem;
    max-width: 800px;
    margin: 15px auto 0;
    line-height: 1.6;
    font-weight: 300;
}

.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);
}

/* --- 6. 数字背书条 (Stats Bar) --- */
.stats-bar {
    background: var(--primary-blue);
    padding: 40px 0;
    color: var(--white);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent-gold);
    margin-bottom: 5px;
}

.stat-item p { 
    font-size: 0.9rem; 
    opacity: 0.8; 
}

/* --- 7. 核心优势与特色区域 --- */
.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: var(--white);
    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);
    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);
}

.icon { 
    font-size: 3rem; 
    margin-bottom: 20px; 
    display: block; 
}

.feature-item:hover .icon {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

/* --- 8. 产品与行业网格 (修正 Grid 语法) --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); /* 修正拼写错误 */
    gap: 30px;
    margin-top: 40px;
}

.product-item {
    background: var(--white);
    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: var(--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;
}

.industry-card { 
    display: flex; 
    background: var(--white); 
    border: 1px solid #eee; 
    margin-bottom: 40px; 
    overflow: hidden; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    min-height: min-content; 
}

/* --- 9. 按钮与交互通用类 --- */
.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); 
}

.reveal { 
    opacity: 0; 
    transform: translateY(30px); 
    transition: all 0.8s ease-out; 
}

.reveal.active { 
    opacity: 1; 
    transform: translateY(0); 
}

/* 动效引擎补充类 */
.ht-effect-section {
    opacity: 0;
    transform: translateY(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;
}

.ht-section-active {
    opacity: 1;
    transform: translateY(0);
}

.ht-stagger {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.ht-parallax-bg {
    background-attachment: scroll;
    background-size: cover;
    background-position: center 0;
}

.esg-icon-box { 
    padding: 40px; 
    background: var(--white); 
    border-radius: 12px; 
    transition: all 0.4s ease; 
    border: 1px solid #eee; 
}

.esg-icon-box:hover { 
    box-shadow: 0 20px 40px rgba(0, 51, 102, 0.08); 
    transform: translateY(-10px); 
}

.ht-interactive-img { 
    border-radius: 16px; 
    overflow: hidden; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.1); 
}

/* --- 10. 全局 Flex 布局与页脚置底 --- */
#header-plugin, 
.page-banner { 
    flex-shrink: 0 !important; 
    flex-grow: 0 !important; 
}

main, 
.product-list, 
.industry-section, 
.container.industry-section,
#header-plugin + section { 
    flex: 1 0 auto; 
    display: block; 
}

.footer { 
    background: #1a1a1a; 
    color: #ccc; 
    padding: 60px 0; 
    margin-top: 50px; 
}

#footer-plugin { 
    margin-top: auto; 
    flex-shrink: 0; 
    background: #1a1a1a; 
    position: relative;
    z-index: 10;
}

.footer-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 40px; 
}

.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;
}

.copyright { 
    text-align: center; 
    border-top: 1px solid #333; 
    margin-top: 40px; 
    padding-top: 20px; 
    font-size: 13px; 
}

/* --- 11. 响应式适配 --- */
@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; }
    .tech-banner { height: 40vh; }
    .industry-card { flex-direction: column !important; }
    .industry-card div { padding-right: 0 !important; margin-bottom: 30px; }
    .features-inner { grid-template-columns: 1fr; }
}



/* ==========================================
   导航栏与下拉菜单核心样式修复
   ========================================== */

/* 1. 基础布局与对齐 */
.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-links li {
    position: relative; /* 关键：让下拉菜单相对于父级定位 */
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    padding: 10px 15px;
    display: block;
    color: #333;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-blue, #003366);
}

/* 2. 下拉菜单默认隐藏与绝对定位 */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    min-width: 200px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    padding: 8px 0;
    margin: 0;
    list-style: none;
    
    /* 隐藏与过渡动画 */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

/* 3. 下拉菜单子项与链接 */
.dropdown-menu li {
    width: 100%;
}

.dropdown-menu a {
    padding: 10px 20px;
    white-space: nowrap;
    color: #555;
    font-size: 0.9rem;
}

.dropdown-menu a:hover {
    background-color: #f4f7fa;
    color: var(--primary-blue, #003366);
}

/* 4. 鼠标悬停（Hover）触发显示 */
.nav-item-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 5. 箭头小图标微调 */
.nav-item-dropdown .arrow {
    font-size: 0.8em;
    margin-left: 4px;
    display: inline-block;
    transition: transform 0.3s;
}

.nav-item-dropdown:hover .arrow {
    transform: rotate(180deg);
}



/* ==========================================
   手机端响应式导航抽屉菜单适配（建议追加到 style.css 末尾）
   ========================================== */
@media (max-width: 768px) {
    /* 重写手机端的 nav-links 隐藏与下拉展开逻辑 */
    .navbar .container {
        position: relative; /* 让绝对定位的菜单相对于 navbar 容器展开 */
    }

    .nav-links {
        display: none !important; /* 默认隐藏 */
        flex-direction: column !important;
        width: 100% !important;
        background: #ffffff !important;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
        padding: 20px 0 !important;
        border-bottom: 2px solid var(--bg-light);
        z-index: 1100;
    }

    /* 当 JS 触发 .active 时，手机端显示为垂直列表 */
    .nav-links.active {
        display: flex !important;
    }

    .nav-links li {
        width: 100% !important;
        text-align: center !important;
        margin: 8px 0 !important;
    }

    .nav-links li a {
        font-size: 1.05rem !important;
        padding: 10px 0 !important;
        display: block !important;
        margin-left: 0 !important;
    }

    /* 确保手机端汉堡菜单按钮正常显示并可点击 */
    .menu-toggle {
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        width: 28px !important;
        height: 21px !important;
        cursor: pointer !important;
    }

    .menu-toggle .bar {
        height: 3px !important;
        width: 100% !important;
        background-color: var(--primary-blue, #003366) !important;
        border-radius: 2px;
        transition: 0.3s;
    }
}

/* 电脑端默认隐藏汉堡菜单按钮 */
@media (min-width: 769px) {
    .menu-toggle {
        display: none !important;
    }
}