/* 全局樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft JhengHei', Arial, sans-serif;
}

body {
    color: #333;
    line-height: 1.6;
}

/* 導航欄樣式 */
nav {
    background-color: rgba(21, 34, 50, 1); /* #152232 帶有透明度 */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    height: 120px; /* 原始大约60-70px */
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

nav.scrolled {
    background-color: rgba(21, 34, 50, 1); /* 滾動後更實的顏色 */
    height: 80px; /* 原始大约60-70px */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    padding: 10px 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 25px 20px;
    transition: all 0.3s ease;
}

nav.scrolled .nav-container {
    padding: 5px 20px;
}

.logo {
    height: 90px;
    transition: all 0.3s ease;
}

nav.scrolled .logo {
    height: 60px;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 22px;
    transition: color 0.3s;
    position: relative;
}

.nav-links a.active {
    color: #0066cc;
    font-weight: bold;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #0066cc;
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover {
    color: #0066cc;
}

/* 主頁內容樣式 */
.main-content {
    margin-top: 120px;
}

/* 橫幅區域 */
.hero-banner {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    overflow: hidden;
}

.slider-container {
    position: relative;
    height: 100%;
  }

.hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 0 20px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease forwards 0.5s;
}

.hero-content h1 {
    font-size: 42px;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 18px;
    margin-bottom: 30px;
}

/* 按鈕樣式 */
.btn {
    display: inline-block;
    background-color: #0066cc;
    color: white;
    padding: 12px 30px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    background-color: #0055aa;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

/* 內容區塊 */
.section {
    padding: 100px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 32px;
    margin-bottom: 40px;
    color: #222;
    position: relative;
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.section-title.animated {
    opacity: 0;
    transform: translateY(0);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: #0066cc;
}

.project-card {
    position: relative;
    height: 400px; /* 調整高度 */
    border-radius: 8px;
    overflow: visible; /* 修正為 visible */
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease; /* 新增過渡效果 */
  }

.project-card.animated {
    opacity: 1;
    transform: translateY(0);
}

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s ease;
    z-index: 1; /* 圖片在下層 */
}

.project-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 25px;
    background: linear-gradient(to top, rgba(21, 34, 50, 0.9), transparent);
    color: white;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.5s ease;
    z-index: 2; /* 文字在上層 */
    left/right: 15px; /* 兩側留空 */
}

.project-card:hover .project-info {
    transform: translateY(0);
    opacity: 1;
}

.project-card:hover img {
    transform: scale(1.05);
}


/* 公司簡介區塊 */
.about-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 50px;
    flex-wrap: wrap;
}

.about-text {
    flex: 1;
    min-width: 300px;
    padding: 0 20px;
    text-align: left;
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s ease;
}

.about-text.animated {
    opacity: 1;
    transform: translateX(0);
}

.about-image {
    flex: 1;
    min-width: 300px;
    padding: 20px;
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s ease;
}

.about-image.animated {
    opacity: 1;
    transform: translateX(0);
}

.about-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.about-image img:hover {
    transform: scale(1.03);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

/* 頁腳樣式 */
footer {
    background-color: #152232;
    color: #fff;
    padding: 50px 20px;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    list-style: none;
    margin-bottom: 30px;
}

.footer-links li {
    margin: 0 15px;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #fff;
}

.copyright {
    color: #999;
    font-size: 14px;
}

/* 動畫關鍵幀 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 平滑滾動 */
html {
    scroll-behavior: smooth;
}
/* ==================== 主要業務區塊 ==================== */
.services-section {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.service-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    height: 300px;
    transition: all 0.5s ease;
}

.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s ease;
}

.service-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(21, 34, 50, 0.9); /* 使用您的品牌色 */
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    transition: all 0.5s ease;
    transform: translateY(20px);
}

.service-overlay h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #1e88e5; /* 高亮色 */
}

.service-overlay p {
    font-size: 16px;
    line-height: 1.6;
    text-align: center;
}

.service-item:hover .service-overlay {
    opacity: 1;
    transform: translateY(0);
}

.service-item:hover .service-image img {
    transform: scale(1.1);
}

/* ==================== HGC圖片區塊 ==================== */
.hgc-banner {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
    text-align: center;
    opacity: 1;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.hgc-banner.animated {
    opacity: 1;
    transform: translateY(0);
}

.hgc-banner img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* ==================== 重點項目區塊 ==================== */
.projects-section {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    position: relative; /* 新增 */
    z-index: 1; /* 新增 */
}

.projects-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    gap: 30px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}


.project-info h3 {
    font-size: 22px;
    margin-bottom: 10px;
    color: #fff;
}

.project-info p {
    font-size: 16px;
    line-height: 1.5;
}

.more-projects {
    margin-top: 50px;
    text-align: center;
}

/* 響應式調整 */
@media (max-width: 768px) {
    .slide-content {
        padding: 20px;
    }
    
    .slide h1 {
        font-size: 36px;
    }
    
    .slide p {
        font-size: 18px;
    }
}

/* ==================== 公司資訊區塊 ==================== */
.company-info {
    background-color: #fdfdfc;
    padding: 80px 20px;
}

.info-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
}

.company-logo {
    flex: 1;
    min-width: 300px;
    text-align: center;
}

.company-logo img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
}

.contact-info {
    flex: 1;
    min-width: 300px;
}

.contact-info h3 {
    font-size: 28px;
    color: #152232;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.contact-info h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 600px;
    height: 3px;
    background-color: #1e88e5;
}

.contact-details {
    list-style: none;
}

.contact-details li {
    margin-bottom: 15px;
    font-size: 16px;
    color: #555;
    display: flex;
    align-items: center;
}

.contact-details i {
    margin-right: 12px;
    color: #1e88e5;
    width: 20px;
    text-align: center;
}

.contact-details a {
    color: #1e88e5;
    text-decoration: none;
    transition: color 0.3s;
}

.contact-details a:hover {
    color: #1565c0;
    text-decoration: underline;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .company-info {
        padding: 50px 20px;
    }
    
    .info-container {
        flex-direction: column;
        gap: 30px;
    }
    
    .company-logo,
    .contact-info {
        min-width: 100%;
    }
    
    .contact-info h3 {
        text-align: center;
    }
    
    .contact-info h3::after {
        left: 50%;
        transform: translateX(-50%);
    }
}

/* ==================== 文字輪播修正 ==================== */
.text-slider {
    width: 100%;
    position: relative;
    min-height: auto; /* 移除固定高度限制 */
}

/* 幻燈片通用樣式 */
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(50px);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.slide.active {
    opacity: 1;
    transform: translateX(0);
}

/* 文字內容容器 */
.slide-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 1200px;
    width: 90%;
    padding: 40px;
    background: rgba(21, 34, 50, 0.8);
    border-radius: 8px;
    text-align: center;
}

/* 文字樣式 */
.slide h1 {
    font-size: 48px;
    color: #fff;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: textSlideIn 0.8s ease forwards;
}

.slide p {
    font-size: 24px;
    color: #e0e0e0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    animation: textSlideIn 0.8s ease forwards 0.3s;
}

@keyframes textSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* 新增動畫關鍵幀 */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}





/* 文字動畫關鍵幀 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* 關於我們頁面專用樣式 */
.about-main {
    margin-top: 120px; /* 與導航欄高度匹配 */
}

.page-banner {
    height: 400px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
}

.page-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.banner-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 0 20px;
}

.company-overview {
    padding: 80px 20px;
    background: #f8f9fa;
}

.overview-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 40px;
    align-items: center;
}

.overview-text {
    flex: 1;
}

.overview-image {
    flex: 1;
}

.overview-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.highlights-list {
    list-style: none;
    margin-top: 20px;
}

.highlights-list li {
    margin-bottom: 12px;
    padding: 10px;
    background: rgba(21,34,50,0.05);
    border-radius: 4px;
}

/* 時間軸樣式 */
.timeline {
    max-width: 800px;
    margin: 40px auto;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    width: 0px;
    height: 100%;
    background: #1e88e5;
}

.timeline-item {
    width: 50%;
    padding: 20px;
    position: relative;
}

.timeline-item:nth-child(odd) {
    margin-left: 50%;
}

.timeline-year {
    background: #1e88e5;
    color: white;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    position: absolute;
    left: -80px;
    top: 20px;
}

/* 核心價值卡片 */
.core-values {
    padding: 80px 20px;
    background: white;
}

.values-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding: 40px 0;
}

.value-card {
    text-align: center;
    padding: 30px;
    border-radius: 8px;
    background: #f8f9fa;
    transition: transform 0.3s ease;
}

.value-card:hover {
    transform: translateY(-5px);
}

.value-card i {
    font-size: 40px;
    color: #1e88e5;
    margin-bottom: 20px;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .overview-container {
        flex-direction: column;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-item {
        width: 100%;
        margin-left: 0 !important;
        padding-left: 60px;
    }

    .timeline-year {
        left: 0;
    }
}

/* 新增服務頁面專用樣式 */
.services-main {
    margin-top: 80px;
}

.service-banner {
    height: 500px;
    background-size: cover;
    position: relative;
}

.banner-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.core-services {
    padding: 60px 20px;
    background: #f8f9fa;
}

.service-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.service-card.highlighted {
    border-top: 4px solid #1e88e5;
}

.service-card:hover {
    transform: translateY(-5px);
}

.service-icon {
    font-size: 40px;
    color: #1e88e5;
    margin-bottom: 20px;
}

.workflow {
    background: #152232;
    color: white;
    padding: 80px 20px;
}

.phase-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 30px;
}

.phase {
    text-align: center;
    flex: 1;
}

.phase-number {
    display: inline-block;
    width: 50px;
    height: 50px;
    line-height: 50px;
    border-radius: 50%;
    background: #1e88e5;
    margin-bottom: 15px;
}

.cert-grid {
    max-width: 800px;
    margin: 0 auto;
    opacity: 0;
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 40px 0;
}

.cert-card {
    text-align: center;
}

@media (max-width: 768px) {
    .phase-container {
        flex-direction: column;
    }
}


/* 新增项目页面专用样式 */
.projects-main {
    margin-top: 120px;
}

.project-filters {
    padding: 40px 0;
    background: #f8f9fa;
}

.filter-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 12px 25px;
    border: 2px solid #1e88e5;
    background: transparent;
    color: #1e88e5;
    border-radius: 30px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.filter-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: #1e88e5;
    transition: width 0.3s ease;
}

.filter-btn.active {
    background: #1e88e5;
    color: white;
}

.filter-btn.active::after {
    width: 100%;
}

.project-grid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    display: -ms-grid; /* Edge 旧版需要 */
    -ms-grid-columns: repeat(auto-fit, minmax(300px, 1fr)); /* 非标准语法 */
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

@supports (display: grid) {
    /* 现代浏览器样式 */
}
@supports not (display: grid) {
    /* 备用布局方案 */
}


.project-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    transform: scale(1);
}

.project-item.hidden {
    opacity: 0;
    transform: scale(0.9);
    height: 0;
    margin: 0;
    padding: 0;
    pointer-events: none;
}

.project-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

.project-media {
    position: relative;
    height: 280px;
    overflow: hidden;
}

.project-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-media:hover img {
    transform: scale(1.05);
}

.project-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(21,34,50,0.9);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
}

.project-info {
    padding: 25px;
}

.project-link {
    color: #1e88e5;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
}

.project-link i {
    transition: transform 0.3s ease;
}

.project-link:hover i {
    transform: translateX(5px);
}

/* 时间轴动画 */
.project-timeline {
    height: 200px;
    position: relative;
    margin: 60px 0;
}

.timeline-bar {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 100%;
    background: #1e88e5;
}

.milestone {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    animation: timelineEntry 1s ease forwards;
}

@keyframes timelineEntry {
    from {
        opacity: 0;
        transform: translateY(-50%) scale(0);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

@media (max-width: 768px) {
    .project-grid {
        grid-template-columns: 1fr;
    }
    
    .timeline-bar {
        left: 20px;
    }
}

/* 聯絡頁面專用樣式 */
.contact-main {
    margin-top: 120px;
}

.contact-banner {
    height: 500px;
    background: linear-gradient(rgba(21,34,50,0.8), rgba(21,34,50,0.8)),
                url('../images/contact-bg.jpg') center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.banner-overlay h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.contact-container {
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.contact-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #152232;
    font-weight: 500;
}

.form-group label span {
    color: #e53e3e;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #1e88e5;
    outline: none;
}

.submit-btn {
    background: #1e88e5;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.submit-btn:hover {
    background: #1565c0;
}

.contact-info {
    display: grid;
    gap: 30px;
}

.info-block {
    padding: 25px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.info-block i {
    font-size: 24px;
    color: #1e88e5;
    margin-bottom: 15px;
}

.info-block h3 {
    color: #152232;
    margin-bottom: 10px;
}

.contact-map {
    margin-top: 60px;
    height: 450px;
}

@media (max-width: 768px) {
    .contact-container {
        grid-template-columns: 1fr;
    }
    
    .contact-form {
        order: 2;
    }
    
    .banner-overlay h1 {
        font-size: 2rem;
    }
}