/* =========================================
   1. 英雄区域 (Hero Section) & 视频背景
   ========================================= */
.hero-section {
    position: relative;
    width: 100%;
    min-height: 100vh; /* 确保至少占满一屏 */
    display: flex;
    align-items: center;
    overflow: hidden;
    background-color: #000; /* 视频加载前的背景色 */
}

/* 背景视频/图片通用样式 */
.hero-bg-video,
.hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* 关键：裁剪填满不拉伸 */
    z-index: 0;
}

/* 视频层级微调 */
.hero-bg-video {
    z-index: 1;
}

/* 遮罩层：确保文字清晰 */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4); /* 调整透明度，0.1可能太浅看不清字 */
    z-index: 2;
}

/* 内容层级：最高 */
.hero-content {
    position: relative;
    z-index: 3;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

/* =========================================
   2. 按钮样式 (Buttons)
   ========================================= */
.btn-hero {
    padding: 12px 35px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary-custom {
    background: var(--accent-color);
    border: 2px solid var(--accent-color);
    color: white;
}

.btn-primary-custom:hover {
    background: transparent;
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 107, 53, 0.3);
}

.btn-outline-custom {
    background: transparent;
    border: 2px solid white;
    color: white;
}

.btn-outline-custom:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* =========================================
   3. 导航栏 (Navbar)
   ========================================= */
.navbar {
    transition: all 0.4s ease;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 透明状态 */
.navbar-transparent {
    background-color: transparent !important;
    box-shadow: none !important;
    padding-top: 20px !important;
    padding-bottom: 20px !important;
}

.navbar-transparent .navbar-brand,
.navbar-transparent .nav-link {
    color: #fff !important;
}

.navbar-transparent .nav-link:hover {
    color: #e0e0e0 !important;
}

.navbar-transparent .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5);
}

.navbar-transparent .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* 移动端下拉菜单修复 */
@media (max-width: 991px) {
    .navbar-collapse {
        background-color: #fff;
        padding: 1rem;
        margin-top: 1rem;
        border-radius: 0.5rem;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }

    .navbar-transparent .navbar-collapse .nav-link {
        color: #333 !important; /* 手机端展开后强制黑色文字 */
    }
}

/* =========================================
   4. 通用板块 (Features, Stats, About, Contact)
   ========================================= */
/* 特色服务 */
.feature-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

/* 产品展示 */
.product-section {
    padding: 80px 0;
    background: var(--secondary-color);
}

.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
}

.product-card:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.product-img {
    height: 250px;
    object-fit: cover;
    width: 100%;
}

/* 统计数据 */
.stats-section {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    padding: 80px 0;
    color: white;
}

.stat-item {
    text-align: center;
    padding: 2rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 关于我们 */
.about-section {
    padding: 100px 0;
    background: white;
}

.about-text {
    padding: 3rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.milestone {
    text-align: center;
    padding: 2rem;
    border-radius: 10px;
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
}

.milestone:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.milestone-year {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.certification-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    margin: 0.25rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.certification-badge:hover {
    background: var(--accent-color);
    transform: scale(1.05);
}

/* 联系表单 */
.contact-form {
    background: white;
    border-radius: 15px;
    padding: 3rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.form-control, .form-select {
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    padding: 12px 15px;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 86, 179, 0.1);
}

/* =========================================
   5. 产品分类板块 (Category Showcase) - 核心逻辑
   ========================================= */
.category-showcase {
    padding: 100px 0;
    background: white;
}

/* --- 5.1 基础样式 (所有语言通用) --- */
.category-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;

    /* 结构布局：强制等高并垂直排列 */
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* 悬停背景效果 */
.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.category-card:hover::before {
    opacity: 0.9;
}

.category-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* 悬停文字变白 */
.category-card:hover .category-icon,
.category-card:hover .category-title,
.category-card:hover .category-description,
.category-card:hover .category-features,
.category-card:hover .category-features li::before {
    color: white;
    transform: translateY(-5px);
}

/* 内部元素基础样式 */
.category-icon {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
}

.category-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
}

.category-description {
    color: #666;
    margin-bottom: 1.5rem;
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
}

.category-features {
    list-style: none;
    padding: 0;
    margin: 0;
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
    flex-grow: 1; /* 关键：占据剩余空间，把按钮推到底部 */
}

.category-features li {
    padding: 0.25rem 0;
    color: #666;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.category-features li::before {
    content: '✓';
    color: var(--accent-color);
    font-weight: bold;
    margin-right: 0.5rem;
}

.category-btn {
    margin-top: auto; /* 关键：按钮沉底 */
    padding: 0.5rem 1.5rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 200px;
    align-self: center;
}

.category-card:hover .category-btn {
    background: white;
    color: var(--primary-color);
}

/* --- 5.2 结构安全 (防止长词撑爆) --- */
.category-title,
.category-description,
.category-features {
    word-break: break-word; /* 允许单词内换行 */
    overflow-wrap: break-word;
    hyphens: auto; /* 允许连字符 */
}

/* --- 5.3 俄语/德语 专属瘦身版 (仅在电脑端生效) --- */
/* 仅当屏幕宽度 > 992px 且 语言为 ru 或 de 时应用 */
@media (min-width: 992px) {
    /* 缩小列间距 */
    :lang(ru) .category-showcase .row,
    :lang(de) .category-showcase .row {
        --bs-gutter-x: 14px;
    }

    /* 缩小卡片内边距 */
    :lang(ru) .category-showcase .category-card,
    :lang(de) .category-showcase .category-card {
        padding: 1.2rem 0.8rem;
    }

    /* 缩小图标 */
    :lang(ru) .category-showcase .category-icon,
    :lang(de) .category-showcase .category-icon {
        font-size: 2rem;
        margin-bottom: 0.8rem;
        width: 50px;
        height: 50px;
        line-height: 50px;
        margin-left: auto;
        margin-right: auto;
    }

    /* 缩小并限制标题 */
    :lang(ru) .category-showcase .category-title,
    :lang(de) .category-showcase .category-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
        min-height: 2.5em; /* 预留两行高度 */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 缩小并限制描述 (最多2行) */
    :lang(ru) .category-showcase .category-description,
    :lang(de) .category-showcase .category-description {
        font-size: 0.8rem;
        margin-bottom: 0.8rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* 列表文字缩小 */
    :lang(ru) .category-showcase .category-features,
    :lang(de) .category-showcase .category-features {
        font-size: 0.75rem;
        padding-left: 0.5rem;
        margin-bottom: 1rem;
    }

    :lang(ru) .category-showcase .category-features li,
    :lang(de) .category-showcase .category-features li {
        margin-bottom: 0.2rem;
    }

    /* 按钮调整 */
    :lang(ru) .category-showcase .category-btn,
    :lang(de) .category-showcase .category-btn {
        padding: 0.4rem 0;
        font-size: 0.85rem;
        width: 100%;
        max-width: none; /* 取消最大宽度限制，填满卡片 */
    }
}

/* =========================================
   6. 移动端适配 (Mobile Responsive)
   ========================================= */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .about-text {
        padding: 2rem;
    }

    .category-card {
        padding: 2rem 1.5rem;
    }

    .category-icon {
        font-size: 2.5rem;
    }
}