body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
}

.header {
    background-color: #4CAF50;
    color: white;
    padding: 10px 0;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header small {
    color: #7c7676;
    /* 顏色比 h1 淡 */
    font-size: 0.7em;
    /* 字形小一點 */
}

.fill {
    width: 100%;
    height: 100vh;
    /* Adjust this value as needed */
    background-position: center;
    background-size: cover;
}

a {
    text-decoration: none;
    color: inherit;
}

.header h1 {
    margin: 0;
    padding-left: 20px;
}

.header nav {
    margin-right: 20px;
}

/* 設置導航為 Flexbox 佈局 */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
}


.nav-links,
.dropdown-content {
    display: flex;
    gap: 15px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 5px;
}

.nav-links a:hover {
    background-color: #45a049;
}

.dropdown {
    position: relative;
    display: inline-block;
    margin: 10px;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 3;
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background-color: #ddd;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.container {
    width: 80%;
    margin: 0 auto;
    overflow: hidden;

    padding: 20px;
}





/* 新增 Flexbox 佈局 */
.about-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    /* 使項目在空間不足時換行 */
    gap: 20px;
    /* 項目之間的間距 */
}

.page-header {
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.panel {
    flex: 1;
    /* 使每個面板具有相同的彈性 */
    max-width: 30%;
    /* 設置最大寬度 */
    box-sizing: border-box;
    /* 確保內邊距和邊框不會影響寬度 */
}

.panel img {
    width: 100%;
    /* 使圖片寬度自適應面板 */
    height: auto;
    /* 高度自動調整 */
}

#Certificate h3 {
    background-color: #007BFF;
    color: white;
    text-align: center;
    padding: 10px;
    border-radius: 5px;
}

#AC h4 {
    background-color: #007BFF;
    color: white;
    text-align: center;
    padding: 10px;
    border-radius: 5px;
}


/* 平板以下：兩組一行 */
@media (max-width: 768px) {
    .elnec-certificate .certificate-item {
        max-width: 45%;
    }
}

/* 手機：一組一行 */
@media (max-width: 480px) {
    .elnec-certificate .certificate-item {
        max-width: 100%;
    }
}


.section {
    background: white;
    margin: 20px 0;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.section h2 {
    color: #333;
}

/* Custom styles for the services grid */
.services-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 20px;
    /* Adjust the gap between items */
    align-items: stretch;
    /* 保持同高度 */
}

.services-grid .panel {
    /*營業項目小標題(IC燒錄/隔離箱)*/
    flex: 1 1 calc(33.333% - 20px);
    /* Adjust this value to control the width of the panels */
    margin: 0;
    /* Remove any additional margin */
    box-sizing: border-box;
}

.services-grid .panel img {
    width: 100%;
    height: auto;
}

.certificate-item {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    flex: 0 1 250px;
    /* 固定每個證書寬度 */
    display: flex;
    flex-direction: column;
    /* 讓內容上下排列 */
    justify-content: space-between;
    /* 保證圖片和文字分佈均勻 */

    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.certificate-item img {
    max-width: 280px;
    height: 180px;
    /* 固定高度，確保圖片對齊 */
    object-fit: contain;
    /* 縮放但不裁切 */
    margin: 0 auto 10px;
}

.certificate-item h4 {
    font-size: 1rem;
    margin: 0;
}

/* Modal 背景 */
.modal {
    display: none;
    position: fixed;
    z-index: 999;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
}

/* Modal 內的圖片 */
.modal-content {
    margin: auto;
    display: block;
    max-width: 80%;
    max-height: 80%;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

/* Caption */
#caption {
    margin: 10px auto;
    text-align: center;
    color: #fff;
    font-size: 18px;
}

/* 關閉按鈕 */
.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close:hover {
    color: #ff4444;
}



.contact {
    background-color: #333;
    color: white;
    padding: 10px;
    text-align: center;
}

.contact p {
    margin: 0;
}

.contact a {
    color: #4CAF50;
    text-decoration: none;
}

.locations ul {
    list-style: none;
    padding: 0;
}

.locations li {
    margin-bottom: 10px;
}

.footer {
    text-align: center;
    padding: 10px 0;
    background-color: #4CAF50;
    color: white;
    margin-top: 20px;
}

.footer-contact {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    background-color: #f4f4f4;
    border-top: 1px solid #ddd;
}

.footer-contact .contact-info,
.footer-contact .map {
    width: 48%;
}

.footer-contact h2 {
    margin-bottom: 10px;
}

.footer-contact ul {
    list-style: none;
    padding: 0;
}

.footer-contact li {
    margin-bottom: 5px;
}

.map iframe {
    border: 0;
    width: 100%;
    height: 100%;
}

/* Carousel Container */
.carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.carousel-inner {
    display: flex;
    transition: transform 0.5s ease;
    width: 100%;
}

.item {
    min-width: 100%;
    box-sizing: border-box;
    position: relative;
}

.fill {
    width: 100%;
    height: 100vh;
    /* Adjust this value as needed */
    background-position: center;
    background-size: cover;
}

.carousel-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.carousel-indicators {
    list-style: none;
    display: none;
    justify-content: center;
    padding: 0;
}

.carousel-indicators li {
    background-color: #999;
    border-radius: 50%;
    width: 10px;
    height: 10px;
    margin: 5px;
    cursor: pointer;
}

.carousel-indicators .active {
    background-color: #333;
}

/* Control buttons */
.carousel-control-prev,
.carousel-control-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 36px;
    /* Size of the arrow */
    color: #000;
    background: linear-gradient(to right, rgba(255, 255, 0, 0.8), rgba(255, 255, 255, 0.8));
    /* Gradient from gray to white */
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    /* Initially hidden */
    transition: opacity 0.3s ease, background 0.3s ease;
    /* Smooth transitions */
    text-align: center;
    line-height: 1;
    width: 50px;
    height: 50px;
    z-index: 2;
    /* Ensure buttons are on top */
}

.carousel-control-prev {
    left: 10px;
}

.carousel-control-next {
    right: 10px;
}

.carousel:hover .carousel-control-prev,
.carousel:hover .carousel-control-next {
    opacity: 1;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    background: linear-gradient(to right, rgba(255, 255, 0, 0.8), rgba(255, 255, 255, 0.8));
    /* Gradient effect on hover */
}


/* Arrows */
.carousel-control-prev::before {
    content: '<';
    /* Unicode for left arrow */
    font-size: 24px;
}

.carousel-control-next::before {
    content: '>';
    /* Unicode for right arrow */
    font-size: 24px;
}

/* Ensure links below controls */
.item a {
    position: relative;
    z-index: 1;
    /* Ensure links are below controls */
}

video {
    width: 100%;
    height: 100vh;
    /* Adjust this value as needed */
    object-fit: cover;
}