/* 全局样式 */
:root {
    --primary-red: #d32f2f;
    --primary-white: #ffffff;
    --secondary-red: #b71c1c;
    --light-red: #ffebee;
    --dark-gray: #333333;
    --medium-gray: #666666;
    --light-gray: #f5f5f5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "SimHei", Arial, sans-serif;
    color: var(--dark-gray);
    line-height: 1.6;
    background-color: var(--light-gray);
}

/* 页面横幅 */
.page-banner {
    position: relative;
    width: 100%;
    height: 50vh;
    min-height: 300px;
    max-height: 500px;
    overflow: hidden;
}

.banner-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-content {
    text-align: center;
    color: var(--primary-white);
    padding: 2rem;
}

.banner-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.banner-content .slogan {
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 2px;
}

/* 关于我们容器 */
.about-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    background-color: var(--primary-white);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    margin-top: -50px;
    position: relative;
    z-index: 1;
    border-radius: 10px;
}

/* 选项卡导航 */
.tab-navigation {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
    border-bottom: 2px solid var(--light-gray);
}

.tab-btn {
    padding: 1rem 2.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 1.1rem;
    color: var(--medium-gray);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tab-btn:hover {
    color: var(--primary-red);
}

.tab-btn.active {
    color: var(--primary-red);
    border-bottom-color: var(--primary-red);
    font-weight: bold;
}

/* 选项卡内容 */
.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 公司简介样式 */
.section-title {
    text-align: center;
    color: var(--primary-red);
    margin-bottom: 2.5rem;
    font-size: 2.2rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: var(--primary-red);
}

/* 关键指标 */
.key-metrics {
    display: flex;
    justify-content: space-around;
    margin: 3rem 0;
    flex-wrap: wrap;
    gap: 2rem;
}

.metric-item {
    text-align: center;
    flex: 1;
    min-width: 200px;
    padding: 2rem;
    background: linear-gradient(135deg, var(--light-red), #fff5f5);
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.metric-item:hover {
    transform: translateY(-5px);
}

.metric-icon {
    font-size: 3rem;
    color: var(--primary-red);
    margin-bottom: 1rem;
}

.metric-value {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-red);
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 1.1rem;
    color: var(--medium-gray);
}

/* 公司简介内容 */
.intro-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--dark-gray);
}

.intro-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.intro-content strong {
    color: var(--primary-red);
    font-weight: bold;
}

/* 发展历程 */
.development-timeline {
    margin-top: 4rem;
    padding: 2rem;
    background: var(--light-gray);
    border-radius: 10px;
}

.development-timeline h3 {
    color: var(--primary-red);
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.8rem;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--primary-red);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
    width: 45%;
    padding: 1.5rem;
    background: var(--primary-white);
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.timeline-item:nth-child(odd) {
    margin-left: 0;
    margin-right: auto;
}

.timeline-item:nth-child(even) {
    margin-left: auto;
    margin-right: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--primary-red);
    border-radius: 50%;
    top: 20px;
}

.timeline-item:nth-child(odd)::before {
    right: -60px;
}

.timeline-item:nth-child(even)::before {
    left: -60px;
}

.year {
    display: inline-block;
    background: var(--primary-red);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-weight: bold;
    margin-bottom: 1rem;
}

/* 企业文化 */
.corporate-values {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 4rem;
}

.value-card {
    flex: 1;
    min-width: 300px;
    text-align: center;
    padding: 2.5rem;
    background: linear-gradient(135deg, #fff, var(--light-red));
    border-radius: 15px;
    transition: all 0.3s ease;
    border: 1px solid #ffcdd2;
}

.value-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(211, 47, 47, 0.2);
}

.value-icon {
    font-size: 3.5rem;
    color: var(--primary-red);
    margin-bottom: 1.5rem;
}

.value-card h3 {
    color: var(--primary-red);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.value-card p {
    color: var(--medium-gray);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* 图片展示 - 修复后的样式 */
.culture-gallery {
    margin-top: 4rem;
}

.culture-gallery h3 {
    color: var(--primary-red);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    min-height: 200px; /* 添加最小高度 */
}

/* 移除 aspect-ratio 相关样式，使用更兼容的方式 */
.gallery-item.landscape {
    height: 240px; /* 横图高度 */
}

.gallery-item.portrait {
    height: 380px; /* 竖图高度 */
    grid-row: span 2; /* 竖图占据两行 */
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保持比例填充 */
    display: block;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .image-overlay {
    transform: translateY(0);
}

/* 资质荣誉 */
.honor-content {
    padding: 2rem;
}

.honor-title {
    text-align: center;
    color: var(--primary-red);
    margin-bottom: 3rem;
    font-size: 1.8rem;
}

.honor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem;
}

.honor-item {
    background: var(--primary-white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 350px; /* 添加最小高度 */
}

.honor-item:hover {
    transform: translateY(-5px);
}

.honor-item img {
    width: 100%;
    height: 250px;
    object-fit: contain; /* 改为 contain 以完整显示证书 */
    background: #f9f9f9;
    padding: 15px;
    display: block;
}

.honor-item p {
    padding: 1.5rem;
    text-align: center;
    color: var(--dark-gray);
    font-weight: 500;
    margin: 0;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .page-banner {
        height: 40vh;
        min-height: 250px;
    }

    .banner-content h1 {
        font-size: 2.5rem;
    }

    .banner-content .slogan {
        font-size: 1.2rem;
    }

    .about-container {
        margin: -30px 1rem 0;
        padding: 2rem 1rem;
    }

    .tab-navigation {
        flex-direction: column;
    }

    .tab-btn {
        width: 100%;
        text-align: center;
    }

    .key-metrics {
        flex-direction: column;
        align-items: center;
    }

    .metric-item {
        width: 100%;
        max-width: 300px;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-item {
        width: calc(100% - 40px);
        margin-left: 40px !important;
        margin-right: 0 !important;
    }

    .timeline-item::before {
        left: -40px !important;
        right: auto !important;
    }

    .corporate-values {
        flex-direction: column;
    }

    .value-card {
        width: 100%;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-item.landscape,
    .gallery-item.portrait {
        height: 250px; /* 移动端统一高度 */
        grid-row: span 1; /* 移除竖图的两行跨度 */
    }

    .honor-grid {
        grid-template-columns: 1fr;
    }

    .honor-item {
        min-height: 300px;
    }

    .honor-item img {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .banner-content h1 {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .metric-value {
        font-size: 2rem;
    }

    .gallery-item.landscape,
    .gallery-item.portrait {
        height: 200px;
    }
}

/* 确保图片始终可见 */
.gallery-item img,
.honor-item img {
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
}

/* 图片加载失败时的样式 */
img {
    max-width: 100%;
    height: auto;
}
