/* styles.css - 最终完整版 (含修复) */

:root {
    --primary-color: #0056b3;
    --primary-light: #e6f0fa;
    --secondary-color: #00d2ff;
    --text-dark: #1a1a1a;
    --text-grey: #666;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --shadow-sm: 0 5px 15px rgba(0,0,0,0.05);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 1.6; color: var(--text-dark); background: var(--bg-light); overflow-x: hidden; }
a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }

/* === 导航栏 === */
header { position: fixed; top: 0; width: 100%; z-index: 1000; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(12px); box-shadow: 0 1px 0 rgba(0,0,0,0.05); padding: 15px 0; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.header-content { display: flex; justify-content: space-between; align-items: center; }
.logo-container { display: flex; align-items: center; gap: 12px; }
.logo-container img { height: 38px; }
.company-name { font-weight: 700; font-size: 1.1rem; color: #333; letter-spacing: -0.5px; }
.nav-links { display: flex; gap: 32px; }
.nav-links a { font-weight: 500; font-size: 0.95rem; color: #444; position: relative; }
.nav-links a:hover, .nav-links a.active { color: var(--primary-color); }
.dropdown { position: relative; }
.dropdown-content { position: absolute; top: 100%; left: -20px; background: var(--white); min-width: 200px; box-shadow: var(--shadow-lg); border-radius: 8px; padding: 8px 0; opacity: 0; visibility: hidden; transform: translateY(10px); transition: var(--transition); border: 1px solid #eee; }
.dropdown:hover .dropdown-content { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-content li a { display: block; padding: 10px 20px; color: var(--text-dark); font-size: 0.9rem; }
.dropdown-content li a:hover { background-color: var(--bg-light); color: var(--primary-color); }
.language-switcher { display: flex; align-items: center; white-space: nowrap; }
.language-switcher a { font-size: 0.85rem; color: #888; margin: 0 4px; padding: 5px; font-weight: 600; cursor: pointer; }
.language-switcher a:hover { color: var(--primary-color); }

/* 导航栏修正 */
.main-nav { display: flex; align-items: center; gap: 30px; }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; }
.menu-toggle span { display: block; width: 25px; height: 3px; background-color: #333; margin: 5px 0; transition: 0.4s; }

/* === Hero & 通用 === */
.hero { position: relative; height: 100vh; min-height: 700px; display: flex; align-items: center; justify-content: center; overflow: hidden; margin-top: -74px; }
.video-background { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; }
.video-background video { width: 100%; height: 100%; object-fit: cover; }
.video-background::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.6) 100%); }
.video-overlay { text-align: center; color: var(--white); z-index: 2; padding: 20px; max-width: 800px; }
.video-overlay h1 { font-size: 4rem; line-height: 1.1; margin-bottom: 24px; font-weight: 800; letter-spacing: -1px; text-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.video-overlay p { font-size: 1.5rem; font-weight: 300; opacity: 0.95; margin-bottom: 40px; max-width: 600px; margin-left: auto; margin-right: auto; }
.hero-buttons { display: flex; gap: 15px; justify-content: center; }
.btn { display: inline-block; padding: 14px 36px; border-radius: 4px; font-weight: 600; cursor: pointer; transition: var(--transition); font-size: 1rem; }
.btn-primary { background: var(--primary-color); color: var(--white); border: 2px solid var(--primary-color); }
.btn-primary:hover { background: #004494; border-color: #004494; transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--white); border: 2px solid var(--white); }
.btn-outline:hover { background: var(--white); color: var(--text-dark); transform: translateY(-2px); }

/* 统计条 */
.stats-bar { background: var(--white); padding: 40px 0; margin-top: -60px; position: relative; z-index: 10; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.08); max-width: 1100px; margin-left: auto; margin-right: auto; display: flex; justify-content: space-around; text-align: center; }
.stat-item h3 { font-size: 2.5rem; color: var(--primary-color); font-weight: 700; margin-bottom: 5px; }
.stat-item p { color: var(--text-grey); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; }

/* 通用板块 */
section { padding: 100px 0; }
.section-header { text-align: center; margin-bottom: 60px; max-width: 700px; margin-left: auto; margin-right: auto; }
.section-header h2 { font-size: 2.5rem; color: var(--text-dark); margin-bottom: 15px; font-weight: 700; }
.section-header p { color: var(--text-grey); font-size: 1.1rem; }
.section-header .line { width: 60px; height: 4px; background: var(--primary-color); margin: 20px auto 0; }

/* 卡片网格 */
.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 40px; }
.product-card { background: var(--white); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-sm); transition: var(--transition); position: relative; }
.product-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-lg); }
.card-image { height: 280px; overflow: hidden; position: relative; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.product-card:hover .card-image img { transform: scale(1.1); }
.card-content { padding: 30px; }
.card-content h3 { font-size: 1.5rem; margin-bottom: 10px; color: var(--text-dark); }
.card-content p { color: var(--text-grey); margin-bottom: 20px; font-size: 0.95rem; line-height: 1.6; }
.text-link { color: var(--primary-color); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.text-link:hover { gap: 10px; }

/* 优势图标 */
.bg-grey { background-color: #f4f6f8; }
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }
.feature-box { background: var(--white); padding: 40px 25px; border-radius: 8px; text-align: center; transition: var(--transition); border: 1px solid transparent; }
.feature-box:hover { border-color: var(--primary-color); transform: translateY(-5px); }
.feature-box i { font-size: 2.5rem; color: var(--primary-color); margin-bottom: 20px; }
.feature-box h4 { font-size: 1.2rem; margin-bottom: 10px; color: var(--text-dark); }
.feature-box p { color: var(--text-grey); font-size: 0.9rem; }
.cta-section { background: linear-gradient(90deg, #004e92 0%, #000428 100%); color: var(--white); text-align: center; padding: 80px 0; }
.cta-section h2 { font-size: 2.5rem; margin-bottom: 20px; }
.cta-section p { font-size: 1.2rem; opacity: 0.8; margin-bottom: 30px; }

/* === 新增：博客搜索框样式 === */
.search-wrapper { max-width: 600px; margin: -40px auto 60px; position: relative; z-index: 10; padding: 0 20px; }
.search-box { display: flex; align-items: center; background: white; border-radius: 50px; padding: 15px 25px; box-shadow: 0 10px 30px rgba(0,0,0,0.08); border: 1px solid #eee; transition: all 0.3s; }
.search-box:focus-within { box-shadow: 0 15px 40px rgba(0, 102, 204, 0.15); border-color: var(--primary-color); transform: translateY(-2px); }
.search-icon { color: #999; margin-right: 15px; font-size: 1.1rem; }
#search-input { border: none; outline: none; width: 100%; font-size: 1rem; color: #333; background: transparent; }

/* === 紧凑版页脚 (已修复) === */
footer { background-color: #1a1a1a; color: #b0b0b0; padding: 40px 0 20px; margin-top: 60px; font-size: 0.9rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; }
.footer-item { text-align: center; padding: 0 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.footer-icon { width: 40px; height: 40px; background: rgba(255, 255, 255, 0.08); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; font-size: 1.1rem; color: var(--primary-color); transition: all 0.3s ease; }
.footer-item:hover .footer-icon { background: var(--primary-color); color: white; transform: translateY(-3px); }
.footer-item h4 { color: #f0f0f0; font-size: 1rem; margin-bottom: 5px; font-weight: 600; }
.footer-item p, .footer-item a { color: #999; line-height: 1.4; text-decoration: none; transition: color 0.3s; font-size: 0.85rem; }
.footer-item a:hover { color: white; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 20px; text-align: center; }
.copyright { font-size: 0.8rem; opacity: 0.5; margin: 0; }

/* =========================================
   Insights / Knowledge Hub 专属样式
   ========================================= */

/* 1. 顶部标题区域 (修复贴边，增加留白) */
.insights-header {
    background-color: var(--bg-light);
    padding: 120px 0 60px; /* 上留白避开导航栏 */
    text-align: center;
}

.insights-header h1 {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 15px;
    font-weight: 700;
}

.insights-header p {
    color: var(--text-grey);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 40px; /* 居中且底部留空给搜索框 */
    padding: 0 20px; /* 防止手机端贴边 */
}

/* 2. 美化搜索框 (圆角、阴影、悬浮效果) */
.search-container {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    padding: 0 20px; /* 容器防贴边 */
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    width: 100%;
    padding: 18px 60px 18px 25px; /* 右侧留空给图标 */
    font-size: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 50px; /* 胶囊形状 */
    background: var(--white);
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: var(--transition);
    outline: none;
}

.search-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(0,86,179, 0.15); /* 聚焦时蓝色光晕 */
    transform: translateY(-2px);
}

.search-box input::placeholder {
    color: #999;
}

.search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.search-btn:hover {
    background-color: #004494;
    transform: translateY(-50%) scale(1.1);
}

/* 3. 文章列表容器 (核心：解决贴边问题) */
.insights-content {
    max-width: 1200px; /* 限制最大宽度 */
    margin: 0 auto;    /* 居中 */
    padding: 80px 24px; /* 上下留白，左右内边距防止贴边 */
}

/* 分类标签 */
.tags-filter {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.tag-btn {
    padding: 8px 20px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid #eee;
    color: var(--text-grey);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.tag-btn.active, .tag-btn:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0,86,179, 0.2);
}

/* 文章卡片网格 */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); /* 响应式网格 */
    gap: 40px; /* 卡片间距 */
}

.article-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.article-thumb {
    height: 220px;
    background-color: #eee; /* 占位色 */
    overflow: hidden;
}

.article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.article-card:hover .article-thumb img {
    transform: scale(1.05);
}

.article-info {
    padding: 30px; /* 卡片内部文字留白 */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.article-cat {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.article-info h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    line-height: 1.4;
    color: var(--text-dark);
}

.article-info p {
    font-size: 0.95rem;
    color: var(--text-grey);
    margin-bottom: 20px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* 限制显示3行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more-link {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.read-more-link:hover {
    color: var(--primary-color);
    gap: 8px;
}

/* ============================================
   移动端适配终极修复 (请复制并覆盖原有 Media Queries)
   ============================================ */

/* 0. 核心防溢出 (防止任何元素撑破屏幕) */
html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* ============================================
   平板与手机端通用修复 (屏幕 < 992px)
   ============================================ */
@media (max-width: 992px) {
    
    /* --- 1. 头部导航栏重排序 --- */
    .header-content {
        justify-content: flex-start;
    }
    .logo-container {
        order: 1; flex: 1; max-width: 60%;
    }
    .main-nav {
        order: 2; margin-left: auto; position: static;
    }
    .menu-toggle {
        order: 3; display: block; margin-left: 15px; font-size: 1.4rem; color: #333;
    }
    .company-name {
        font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .logo-container img { height: 28px; }

    /* --- 2. 下拉菜单 (关键修复：改为 Fixed 定位) --- */
    .main-nav .nav-links {
        display: none;
        position: fixed; /* 关键：改为 fixed，脱离 padding 限制 */
        top: 70px;       /* 大约是 Header 的高度 */
        left: 0;
        width: 100%;     /* 刚好占满屏幕，不多不少 */
        background: white;
        flex-direction: column;
        padding: 0;      /* 重置 padding */
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        border-top: 1px solid #eee;
        z-index: 999;
        margin: 0;       /* 清除负 margin */
        max-height: calc(100vh - 70px); /* 防止菜单过长无法滚动 */
        overflow-y: auto;
    }

    .main-nav .nav-links.active { display: flex; }
    .main-nav .nav-links li { width: 100%; border-bottom: 1px solid #f9f9f9; }
    .main-nav .nav-links li a { padding: 15px 24px; display: block; } /* 增加内部 padding */

    /* --- 3. 侧边栏竖排 --- */
    .product-sidebar .sidebar-menu { display: flex; flex-direction: column; gap: 10px; }
    .product-sidebar .sidebar-menu li a { justify-content: space-between; background: #f8f9fa; padding: 15px; border-radius: 8px; }

    /* --- 4. 统计条修复 (扩大范围到 992px，防止大屏手机溢出) --- */
    .stats-bar {
        display: flex;
        flex-direction: column;
        gap: 20px;
        padding: 30px;
        height: auto;
        width: 90%;        /* 限制宽度 */
        margin-left: auto; 
        margin-right: auto;
        margin-top: -40px; 
        position: relative;
        z-index: 20;
    }

    /* --- 5. 主页 Hero 调整 --- */
    .hero-buttons { flex-direction: column; padding: 0 40px; }
    .hero h1 { font-size: 2rem; padding: 0 20px; }
}

/* ============================================
   小屏手机专属优化 (屏幕 < 768px)
   ============================================ */
@media (max-width: 768px) {
    
    /* 关于我们页面：强制竖排 */
    .factory-showcase { padding-bottom: 40px; }
    .factory-layout {
        display: flex;
        flex-direction: column;
        gap: 30px;
    }
    .factory-layout .showcase-img,
    .factory-layout .showcase-text {
        width: 100%;
        min-width: 0;
    }
    
    /* 通用修正 */
    .page-header { background-attachment: scroll; padding: 100px 0 50px; }
    .advantages .features-grid { gap: 15px; }
    .advantages .feature-box { flex: 1 1 100%; max-width: 100%; }
}

/* 桌面端恢复横排 */
@media (min-width: 769px) {
    .factory-layout {
        display: flex;
        align-items: center;
        gap: 50px;
    }
    .factory-layout .showcase-img, 
    .factory-layout .showcase-text {
        flex: 1;
    }
}