/* General Styles */
body {
    font-family: 'Arial', sans-serif;
    background-color: #f9f9f9;
    color: #111111;
    margin: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: #fff;
    color: #111111;
    padding: 20px 0;
    border-bottom: 1px solid #444444;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    height: 50px;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: #111111;
    text-decoration: none;
    font-size: 16px;
    /* 新增：添加过渡效果，提升交互体验 */
    transition: color 0.3s ease;
}

/* 新增：导航链接hover效果，提供交互反馈 */
nav ul li a:hover {
    color: #555555;
    text-decoration: underline;
}

/* Hero Section - 修改Banner高度 */
.hero {
    height: 500px; /* 强制设置高度，排除高度为0的问题 */
    border: 1px solid red; /* 可视化区域，确认hero是否存在 */
    max-height: 500px;
    background-color: #000000;
    overflow: hidden;
    position: relative;
}

.banner {
    width: 100%;
    height: 100%;
    position: relative;
}

.banner-slide {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: absolute;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    min-height: 400px;
    z-index: 1; /* 确保幻灯片在文本下方 */
}

.banner-slide.active {
    opacity: 1;
    z-index: 2; /* 激活的幻灯片在上方 */
}

/* 添加默认背景图，确保即使JS不工作也有内容显示 */
.banner::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: url('../images/banner1.jpg'); /* 默认图片 */
    background-size: cover;
    background-position: center;
    z-index: 0;
}

/* Banner Text - 调整文字位置和样式 */
.banner-text {
    position: absolute;
    top: 50%;
    /* 修改：将固定left改为基于容器的相对位置，提升适配性 */
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10; /* 确保文本在最上层 */
    text-align: left;
    /* 修改：限制最大宽度，防止文字溢出 */
    max-width: 80%;
    width: auto;
    pointer-events: none; /* 防止文本阻止点击下面的指示器 */
}

.hero-sub-heading {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-family: 'SimHei', '黑体', sans-serif;
}

.hero-heading {
    font-size: 5rem; /* 大约100px */
    margin: 0;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    line-height: 1.2;
    font-family: 'SimHei', '黑体', sans-serif;
    font-weight: bold;
}

/* Banner Indicators */
.banner-indicators {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    z-index: 11; /* 确保指示器在最上层 */
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.indicator.active {
    background-color: #ffffff;
}

.indicator:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

/* Section Titles - 确保所有标题居中 */
.intro h2, 
.portfolio-preview h2, 
.team-preview h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 40px;
    color: #333;
}

/* Intro Section */
.intro {
    padding: 80px 0;
    text-align: center;
}

.intro-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-top: 40px;
}

.intro-item img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

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

/* Portfolio Preview Section */
.portfolio-preview {
    padding: 80px 0;
    background-color: #ffffff;
}

.portfolio-gallery-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.portfolio-gallery-wrapper::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.portfolio-gallery {
    display: flex;
    gap: 20px;
    padding-bottom: 20px;
    cursor: grab;
}

.portfolio-item {
    flex: 0 0 300px;
}

.portfolio-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.portfolio-item img:hover {
    transform: scale(1.03);
}

/* Team Preview Section */
.team-preview {
    padding: 80px 0;
}

.team-member {
    display: flex;
    align-items: center;
    gap: 40px;
    justify-content: center;
}

.team-member img {
    max-width: 200px;
    border-radius: 50%;
}

/* Slogan Section */
.slogan {
    padding: 60px 0;
    text-align: center;
    background-color: #dddddd;
}

.slogan p {
    font-size: 24px;
    font-style: italic;
}

/* Footer */
footer {
    background-color: #222222;
    color: #888888;
    padding: 20px 0;
    text-align: center;
}

footer a {
    color: #888888;
    text-decoration: none;
}

/* Buttons */
.view-more {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #333;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.view-more:hover {
    background-color: #555;
}

/* Works Page */
.works-page {
    padding: 80px 0;
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.work-item {
    /* 新增：为作品项添加过渡效果，增强交互一致性 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.work-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
}

/* 新增：作品项hover效果，与图片效果呼应 */
.work-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.pagination {
    text-align: center;
    margin-top: 40px;
}

.pagination a, .pagination span {
    /* 修改：将文字颜色改为深色，与浅色背景形成对比 */
    color: #333333;
    padding: 8px 16px;
    text-decoration: none;
    border: 1px solid #555555;
    margin: 0 4px;
    /* 新增：添加过渡效果，提升交互体验 */
    transition: all 0.3s ease;
}

.pagination .active {
    background-color: #555555;
    /* 新增：激活状态文字颜色改为白色，增强对比 */
    color: #ffffff;
}

/* 新增：分页hover效果，提升可点击感知 */
.pagination a:hover:not(.active) {
    background-color: #f0f0f0;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    /* 修改：移除固定padding-top，改为flex布局居中 */
    padding: 20px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
    /* 新增：使用flex实现内容居中 */
    display: flex;
    justify-content: center;
    align-items: center;
    /* 默认隐藏 */
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.3s ease;
}

/* 新增：lightbox激活状态 */
.lightbox.active {
    visibility: visible;
    opacity: 1;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 80%;
    max-height: 80%;
    /* 新增：确保图片自适应 */
    object-fit: contain;
}

.close-lightbox {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    /* 新增：增大点击区域 */
    padding: 10px;
    /* 新增：添加过渡效果 */
    transition: color 0.3s ease;
}

/* 新增：关闭按钮hover效果 */
.close-lightbox:hover {
    color: #ffffff;
    transform: scale(1.1);
}

/* Team Page */
.team-page {
    padding: 80px 0;
}

.team-content {
    display: flex;
    gap: 40px;
}

.team-photo img {
    max-width: 400px;
    border-radius: 8px;
}

/* Products Page */
.products-page {
    padding-top: 80px;
}

.product-nav-container {
    overflow-x: auto;
    background-color: #222222;
    padding: 20px 0;
}

.product-nav {
    display: flex;
    gap: 20px;
    padding: 0 20px;
}

.product-nav-item {
    cursor: pointer;
}

.product-nav-item img {
    width: 100px;
    height: 100px;
    border-radius: 8px;
}

.product-display {
    padding: 40px 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.product-display img {
    width: 100%;
    border-radius: 8px;
}

/* Contact Page */
.contact-page {
    padding: 80px 0;
    text-align: center;
}

.contact-info {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .hero-heading {
        font-size: 4rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    header .container {
        flex-direction: column;
    }
    
    nav ul {
        margin-top: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    nav ul li {
        margin: 0 10px 10px 0;
    }
    
    .hero-heading {
        font-size: 2.5rem;
    }
    
    .hero-sub-heading {
        font-size: 1.2rem;
    }
    
    .banner-text {
        left: 50%;
        text-align: center;
        width: 80%;
        transform: translate(-50%, -50%);
    }
    
    .intro-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .team-member {
        flex-direction: column;
        text-align: center;
    }
    
    .portfolio-gallery {
        flex-direction: column;
    }
    
    .portfolio-item {
        flex: 1 1 auto;
    }
    
    /* 响应式调整 - 团队页面 */
    .team-content {
        flex-direction: column;
    }
    
    /* 响应式调整 - 联系页面 */
    .contact-info {
        flex-direction: column;
        gap: 20px;
    }
    
    /* 响应式调整 - 产品页面 */
    .product-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* 响应式调整 - 作品页面 */
    .works-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 480px) {
    .logo {
        height: 40px;
    }
    
    .hero {
        max-height: 300px;
    }
    
    .banner-slide {
        min-height: 300px;
    }
    
    .hero-heading {
        font-size: 2rem;
    }
    
    .hero-sub-heading {
        font-size: 1rem;
    }
    
    .intro, .portfolio-preview, .team-preview, .slogan {
        padding: 40px 0;
    }
    
    .slogan p {
        font-size: 18px;
    }
    
    /* 响应式调整 - 其他页面 */
    .works-page, .team-page, .products-page, .contact-page {
        padding: 40px 0;
    }
}