/* About页面移动端专项修复 */

/* 解决Mission和Vision文字显示问题 */
@media screen and (max-width: 768px) {
    /* 修复Mission和Vision文字完整显示 */
    .about-text-centered {
        padding: 40px 20px !important;
        overflow: visible !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .about-text-centered h2 {
        font-size: 1.6rem !important;
        line-height: 1.4 !important;
        margin: 30px 0 20px 0 !important;
        text-align: center !important;
        color: var(--primary-color) !important;
        font-weight: 600 !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        max-width: 100% !important;
    }
    
    .about-text-centered h2:first-child {
        margin-top: 0 !important;
    }
    
    .about-text-centered p {
        font-size: 1.1rem !important;
        line-height: 1.6 !important;
        margin: 0 auto 30px auto !important;
        color: #333 !important;
        font-weight: 400 !important;
        text-align: center !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        width: 100% !important;
        max-width: 100% !important;
        transform: none !important;
        position: static !important;
        display: block !important;
        padding: 0 15px !important;
    }
    
    /* 移除所有transform偏移 */
    .about-text-centered h2:last-of-type + p {
        transform: none !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* Our Story图片显示修复 */
@media screen and (max-width: 768px) {
    .story-section {
        padding: 40px 0 !important;
    }
    
    .story-content {
        flex-direction: column !important;
        gap: 30px !important;
    }
    
    .story-text {
        order: 1 !important;
        margin-bottom: 0 !important;
    }
    
    .story-image {
        order: 2 !important;
        margin-top: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
    }
    
    .story-section .image-container {
        width: 100% !important;
        max-width: 400px !important;
        height: 280px !important;
        margin: 0 auto !important;
        border-radius: 12px !important;
        overflow: hidden !important;
        position: relative !important;
    }
    
    .story-section .image-container img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center !important;
        display: block !important;
    }
    
    /* 确保图片加载指示器正常工作 */
    .story-section .image-container::before,
    .story-section .image-container::after {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
    }
}

/* Engineering Gallery图片修复 */
@media screen and (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr !important;
        gap: 25px !important;
        padding: 0 15px !important;
    }
    
    .gallery-item {
        background: white !important;
        border-radius: 12px !important;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12) !important;
        overflow: hidden !important;
        transition: all 0.3s ease !important;
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        min-height: 320px !important;
        margin: 0 auto !important;
        max-width: 400px !important;
        width: 100% !important;
    }
    
    .gallery-description {
        padding: 20px 15px !important;
        text-align: center !important;
        background-color: white !important;
        height: auto !important;
        min-height: 80px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-bottom: 2px solid #f0f0f0 !important;
        order: 1 !important;
    }
    
    .gallery-description h3 {
        font-size: 1.1rem !important;
        margin: 0 !important;
        color: var(--primary-color) !important;
        font-weight: 600 !important;
        line-height: 1.3 !important;
        text-align: center !important;
    }
    
    .gallery-image {
        flex: 1 !important;
        overflow: hidden !important;
        height: 240px !important;
        min-height: 240px !important;
        order: 2 !important;
        position: relative !important;
        background-color: #f8f9fa !important;
    }
    
    .gallery-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center !important;
        display: block !important;
        transition: transform 0.3s ease !important;
    }
    
    /* 悬停效果 */
    .gallery-item:hover {
        transform: translateY(-5px) !important;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2) !important;
    }
    
    .gallery-item:hover .gallery-image img {
        transform: scale(1.05) !important;
    }
}

/* 中等屏幕优化 */
@media screen and (max-width: 480px) {
    .about-text-centered {
        padding: 30px 15px !important;
    }
    
    .about-text-centered h2 {
        font-size: 1.4rem !important;
        line-height: 1.3 !important;
        margin: 25px 0 15px 0 !important;
    }
    
    .about-text-centered p {
        font-size: 1rem !important;
        line-height: 1.5 !important;
        padding: 0 10px !important;
        margin-bottom: 25px !important;
    }
    
    .story-section .image-container {
        max-width: 350px !important;
        height: 250px !important;
    }
    
    .gallery-grid {
        gap: 20px !important;
        padding: 0 10px !important;
    }
    
    .gallery-item {
        max-width: 350px !important;
        min-height: 300px !important;
    }
    
    .gallery-image {
        height: 220px !important;
        min-height: 220px !important;
    }
    
    .gallery-description {
        min-height: 70px !important;
        padding: 15px 10px !important;
    }
    
    .gallery-description h3 {
        font-size: 1rem !important;
        line-height: 1.2 !important;
    }
}

/* 小屏幕优化 */
@media screen and (max-width: 360px) {
    .about-text-centered {
        padding: 25px 10px !important;
    }
    
    .about-text-centered h2 {
        font-size: 1.3rem !important;
        line-height: 1.2 !important;
        margin: 20px 0 12px 0 !important;
    }
    
    .about-text-centered p {
        font-size: 0.95rem !important;
        line-height: 1.4 !important;
        padding: 0 8px !important;
        margin-bottom: 20px !important;
    }
    
    .story-section .image-container {
        max-width: 320px !important;
        height: 220px !important;
    }
    
    .gallery-grid {
        gap: 15px !important;
        padding: 0 8px !important;
    }
    
    .gallery-item {
        max-width: 320px !important;
        min-height: 280px !important;
    }
    
    .gallery-image {
        height: 200px !important;
        min-height: 200px !important;
    }
    
    .gallery-description {
        min-height: 60px !important;
        padding: 12px 8px !important;
    }
    
    .gallery-description h3 {
        font-size: 0.95rem !important;
        line-height: 1.1 !important;
    }
}

/* 横屏手机优化 */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .story-section .image-container {
        max-width: 350px !important;
        height: 200px !important;
    }
    
    .gallery-item {
        max-width: 380px !important;
        min-height: 260px !important;
    }
    
    .gallery-image {
        height: 180px !important;
        min-height: 180px !important;
    }
    
    .gallery-description {
        min-height: 60px !important;
        padding: 12px 15px !important;
    }
}

/* 修复图片白边问题 */
@media screen and (max-width: 768px) {
    /* 确保所有图片都没有多余的白边 */
    .gallery-image {
        background: #ffffff !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .gallery-image img {
        border: none !important;
        outline: none !important;
        box-shadow: none !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* 修复Our Story图片的白边问题 */
    .story-section .image-container {
        background: #ffffff !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 auto !important;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12) !important;
    }
    
    .story-section .image-container img {
        border: none !important;
        outline: none !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
    }
}

/* 确保所有图片尺寸一致 */
@media screen and (max-width: 768px) {
    /* Engineering Gallery图片统一尺寸 */
    .gallery-item:nth-child(n) {
        height: auto !important;
        min-height: 320px !important;
    }
    
    .gallery-item:nth-child(n) .gallery-image {
        height: 240px !important;
        min-height: 240px !important;
        max-height: 240px !important;
    }
    
    .gallery-item:nth-child(n) .gallery-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center !important;
    }
    
    .gallery-item:nth-child(n) .gallery-description {
        height: auto !important;
        min-height: 80px !important;
        max-height: none !important;
    }
}

/* 特殊优化：确保文字不被截断 */
@media screen and (max-width: 768px) {
    .about-text-centered {
        overflow-x: visible !important;
        overflow-y: visible !important;
    }
    
    .about-text-centered * {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        word-wrap: break-word !important;
        word-break: normal !important;
    }
}

/* 性能优化 */
@media screen and (max-width: 768px) {
    /* GPU加速 */
    .gallery-item,
    .story-section .image-container,
    .gallery-image img,
    .story-section .image-container img {
        transform: translateZ(0) !important;
        backface-visibility: hidden !important;
    }
    
    /* 优化过渡效果 */
    .gallery-item {
        will-change: transform, box-shadow !important;
    }
    
    .gallery-image img {
        will-change: transform !important;
    }
}

/* 高分辨率屏幕优化 */
@media screen and (max-width: 768px) and (-webkit-min-device-pixel-ratio: 2) {
    .gallery-image img,
    .story-section .image-container img {
        image-rendering: -webkit-optimize-contrast !important;
        image-rendering: crisp-edges !important;
    }
} 