/* 首页专属样式 - GitHub 风格 */

/* 整体背景 - 深色渐变与光晕效果 */
body {
    background: linear-gradient(180deg, #0d1117 0%, #010409 50%, #0d1117 100%);
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Full-page Vanta layer (transparent, sits above gradients, behind content) */
#vanta-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0; /* below all content (which is z-index:1 via body > *) */
    pointer-events: none; /* allow clicks to pass through */
}

/* 背景光晕效果 */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(circle at center, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: pulseGlow 8s ease-in-out infinite;
}

/* 第二层光晕 */
body::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.5;
        transform: translateX(-50%) scale(1);
    }
    50% {
        opacity: 0.8;
        transform: translateX(-50%) scale(1.1);
    }
}

body > * {
    position: relative;
    z-index: 1;
}

/* 产品展示墙样式 - GitHub 风格 */
.main-panel {
    position: relative;
    margin: 1rem auto 3rem auto; /* 整体上移，减少顶部空余 */
    max-width: 1400px;
    padding: 1rem 0 3rem 0; /* 减少内边距顶部 */
}

/* 统一大框体：Github 式玻璃面板 */
.main-panel::before { content: none; }

.main-panel::after {
    /* 黄色底板：左右贯穿，比内层内容更高更大 */
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: -0.75rem;  /* 高度略大于内容区域 */
    bottom: -0.75rem;
    /* 将红框宽度缩小到与内层篮框一致（以内边距为基准） */
    width: min(1400px, calc(100% - 3rem));
    border-radius: 28px;
    background: transparent; /* 移除蓝框底板，仅保留描边轮廓 */
    border: 1px solid rgba(139,92,246,0.22);
    box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.02) inset;
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    pointer-events: none;
    z-index: 0;
}

/* 移动端：让内容与面板宽度一致，避免图片超出 */
@media (max-width: 768px) {
    .main-panel::after {
        width: calc(100% - 2rem); /* 与容器左右各 1rem 的内边距对齐 */
        left: 50%;
        transform: translateX(-50%);
    }
    .gallery-container,
    .gallery-grid,
    .gallery-item {
        max-width: 100%;
    }
}

/* 保证内容在面板之上 */
.main-panel > * {
    position: relative;
    z-index: 1;
}
.product-gallery {
    background: transparent; /* 移除篮框内的底板 */
    padding: 2rem 0 3rem 0; /* 减小顶部留白 */
    overflow: hidden;
    position: relative;
}

.product-gallery::before {
    /* 旧的贯穿顶线去重以避免与新底板重叠 */
    content: none;
}

/* 半透明面板（照片墙区域）：压住底部动态网格，增强可读性 */
/* 移除分区域面板，统一用 main-panel 框体承载 */
/* .product-gallery::after { disabled } */

.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 3rem;
}

/* 确保照片墙内容位于面板之上 */
.product-gallery > * {
    position: relative;
    z-index: 1;
}

.gallery-header {
    margin-bottom: 3rem;
    /* 将标题组右移下移，进入面板内的“红框”区域 */
    margin-left: clamp(1rem, 4vw, 2.5rem);
    margin-top: clamp(0.5rem, 2.5vw, 1.25rem);
}

.gallery-title {
    font-size: 2.8rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    text-align: left;
}

.gallery-subtitle {
    font-size: 1.8rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

.gallery-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(200px, 1fr);
    column-gap: 4rem;
    row-gap: 3rem;
    flex: 1;
}

.gallery-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(22, 27, 34, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    aspect-ratio: 16 / 9;
    min-height: 200px;
    isolation: isolate;
    backdrop-filter: blur(10px);
}

.gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 48px rgba(139, 92, 246, 0.3), 
                0 0 24px rgba(59, 130, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.5);
    z-index: 10;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

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

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay-text {
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* VIEW MORE 样式 - GitHub 风格 */
.gallery-view-more {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    border: 2px dashed rgba(139, 92, 246, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-more-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.4s ease;
}

.view-more-link:hover {
    color: rgba(139, 92, 246, 1);
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.6));
}

.view-more-link svg {
    transition: transform 0.3s ease;
}

.view-more-link:hover svg {
    transform: translateX(5px);
}

/* 导航按钮 - GitHub 风格 */
.gallery-nav {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid rgba(139, 92, 246, 0.3);
    background: rgba(22, 27, 34, 0.8);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

.gallery-nav:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.6);
    color: rgba(255, 255, 255, 1);
    transform: scale(1.15);
    box-shadow: 0 12px 32px rgba(139, 92, 246, 0.4),
                0 0 16px rgba(139, 92, 246, 0.3);
}

.gallery-nav:active {
    transform: scale(0.95);
}

.gallery-nav-prev {
    order: -1;
}

.gallery-nav-next {
    order: 1;
}

/* 响应式设计 - 横图适配 */
@media (max-width: 1400px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        column-gap: 3rem;
        row-gap: 2.5rem;
    }
    
    .gallery-container {
        padding: 0 2.5rem;
    }
    
    .gallery-item {
        min-height: 180px;
    }
}

@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        column-gap: 2.5rem;
        row-gap: 2rem;
        grid-auto-rows: minmax(160px, 1fr);
    }
    
    .gallery-container {
        padding: 0 2rem;
    }
    
    .gallery-item {
        min-height: 160px;
    }
}

@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 2rem;
        row-gap: 1.5rem;
        grid-auto-rows: minmax(140px, 1fr);
    }
    
    .gallery-item {
        min-height: 140px;
    }
}

@media (max-width: 768px) {
    .gallery-header {
        margin-left: 1rem;
        margin-top: 0.5rem;
    }
    /* 防止图片超出圆角容器 */
    .gallery-container { padding: 0 1rem; }
    .gallery-grid { width: 100%; }
    .gallery-item { width: 100%; border-radius: 14px; overflow: hidden; }
    .gallery-title {
        font-size: 2.2rem;
    }
    
    .gallery-subtitle {
        font-size: 1.4rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 1.5rem;
        row-gap: 1.2rem;
        grid-auto-rows: minmax(120px, 1fr);
    }
    
    .gallery-item {
        min-height: 120px;
    }
    
    .gallery-nav {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .product-gallery {
        padding: 2rem 0;
    }
    .gallery-header {
        margin-left: 0.75rem;
        margin-top: 0.5rem;
    }
    /* 保持与上层一致，防止更小尺寸再次溢出 */
    .gallery-container { padding: 0 1rem; }
    .gallery-grid { width: 100%; }
    .gallery-item { width: 100%; border-radius: 14px; overflow: hidden; }
    
    .gallery-title {
        font-size: 1.8rem;
    }
    
    .gallery-subtitle {
        font-size: 1.2rem;
    }
    
    .gallery-wrapper {
        gap: 0.5rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        column-gap: 0;
        row-gap: 1.2rem;
        grid-auto-rows: minmax(140px, 1fr);
    }
    
    .gallery-item {
        min-height: 140px;
    }
    
    .gallery-nav {
        display: none;
    }
}

.features {
    background: var(--bg-light);
    padding: 4rem 0;
}

/* “我们的产品”主面板：半透明玻璃效果容器 */
#products { position: relative; padding-top: 3rem; padding-bottom: 3rem; }

/* 服务介绍样式 */
.services {
    background: var(--white);
    padding: 5rem 0;
}

.section-subtitle {
    text-align: center;
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 2px;
    margin-top: -2rem;
    margin-bottom: 3rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2.5rem;
    margin-top: 3rem;
}

.service-item {
    text-align: center;
    padding: 1.5rem 1.5rem;
    background: var(--white);
    border-radius: 15px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.service-item:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 15px 40px rgba(37, 99, 235, 0.1);
}

.service-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    margin-bottom: 1rem;
}

.service-icon svg {
    width: 25px;
    height: 25px;
    stroke: white;
}

.service-item:nth-child(2) .service-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.service-item:nth-child(3) .service-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.service-item:nth-child(4) .service-icon {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.service-title {
    font-size: 1.2rem;
    margin-bottom: 0.4rem;
    color: var(--text-dark);
    font-weight: 600;
}

.service-subtitle-en {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.8rem;
    font-style: italic;
}

.service-description {
    color: var(--text-dark);
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
    line-height: 1.6;
    font-weight: 500;
}

.service-details {
    color: var(--text-light);
    line-height: 1.7;
    font-size: 0.85rem;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 992px) {
    .services-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .service-item {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .services {
        padding: 3rem 0;
    }
    
    .service-icon {
        width: 45px;
        height: 45px;
    }
    
    .service-icon svg {
        width: 22px;
        height: 22px;
    }
    
    .service-title {
        font-size: 1.1rem;
    }

    .service-item {
        padding: 1.2rem 1rem;
    }
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-item {
    text-align: center;
    padding: 2rem;
    background: var(--white);
    border-radius: 15px;
    transition: all 0.3s ease;
}

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

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-item h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.feature-item p {
    color: var(--text-light);
    line-height: 1.8;
}

@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* 图片查看模态框样式 */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.image-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-content {
    margin: auto;
    display: block;
    /* 限制图片最大尺寸，保持在合适范围内 */
    max-width: 80vw;
    max-height: 70vh;
    width: auto;
    height: auto;
    /* 保持图片清晰度，不模糊 */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 48px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10000;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    line-height: 1;
}

.modal-close:hover,
.modal-close:focus {
    color: #667eea;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #fff;
    padding: 15px 0;
    font-size: 16px;
}

/* 中等屏幕优化 */
@media (max-width: 1200px) {
    .modal-content {
        max-width: 85vw;
        max-height: 75vh;
    }
}

/* 移动端优化 */
@media (max-width: 768px) {
    .modal-close {
        top: 10px;
        right: 20px;
        font-size: 36px;
        width: 40px;
        height: 40px;
    }
    
    .image-modal {
        padding: 10px;
    }
    
    .modal-content {
        max-width: 90vw;
        max-height: 60vh;
    }
    
    .modal-caption {
        font-size: 14px;
        width: 90%;
    }
}


