﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.5; /* 行高 */
    font-weight: bold; /* 設定字體粗細 */
    color: #3E3E40;
}

/* Styling the scrollbars */
::-webkit-scrollbar {
    width: 16px; /* Width of the vertical scrollbar */
    height: 16px; /* Height of the horizontal scrollbar */
}

::-webkit-scrollbar-track {
    background-color: #F2F2EB; /* Color of the track (background) */
}

::-webkit-scrollbar-thumb {
    background-color: #3E3E40; /* Color of the thumb (scrollable part) */
    border-radius: 8px; /* Rounded corners for the thumb */
}

    ::-webkit-scrollbar-thumb:hover {
        background-color: #BF9999; /* Color when hovering over the thumb */
    }

a {
    text-decoration: none; /* 去除默認的下劃線 */
    color: #3E3E40; /* 默認顏色 */
    position: relative;
}

    a:hover {
        transition: color 0.5s ease;
        color: #BF9999;
        animation: text-shadow-drop-center 0.6 forwards; /* 動畫名稱、時長、動作結束後保持最終狀態 */
    }

@keyframes text-shadow-drop-center {
    0% {
        text-shadow: 0 0 0 rgba(0, 0, 0, 0);
    }

    100% {
        text-shadow: 0 0 18px rgba(0, 0, 0, 0.35);
    }
}

/* 主內容區域 */
main {
    margin-top: 70px; /* 留出空間給固定的導航欄 */
}

/* 內容區域 */
.content-section {
    padding: 20px;
}

.hero {
    background: url('images/news/news01.jpg') no-repeat center center/cover;
    padding: 80px 20px;
    color: #F2F2EB;
    text-align: center;
}

.hero-content h1 {
    font-size: 3em;
    text-shadow: 0 0 0.2em #3E3E40, 0 0 0.2em #3E3E40;
    margin-bottom: 20px;
    animation: fadeIn 4s forwards; /* 動畫名稱、時長、動作結束後保持最終狀態 */
}

/* 定義 fadeIn 動畫 */
@keyframes fadeIn {
    0% {
        opacity: 0; /* 初始狀態，完全透明 */
    }

    100% {
        opacity: 1; /* 最終狀態，完全不透明 */
    }
}

.hero-content p {
    font-size: 1.2em;
    margin-bottom: 30px;
}

/* 影片播放 */
.news-movie {
    display: inline-block;
    width: 47%; /* 設置影片最大寬度 */
    padding: 0 0 30px 0;
    margin: 15px;
    transition: background-color 0.5s;
}
    .news-movie p {
        font-size: 18px;
        margin-bottom: 18px;
    }

/* 影片元素 */
.video-player {
    display: block; /* 取消影片的默認內間距 */
    width: 100%; /* 設置影片寬度自適應容器 */
    height: auto; /* 確保影片比例不會失真 */
    border-radius: 3px; /* 圓角邊框 */
}

/* 新聞區塊 */
.news {
    grid-area: products;
    width: 80%;
    margin: auto;
    text-align: center;
    padding: 20px;
}

/* 服務區塊 */
.services {
    text-align: center;
    padding: 10px;
}

    .services h2 {
        font-size: 30px;
        margin-bottom: 30px;
        color: #00060D;
    }

.services-text {
    max-width: 1000px;
    margin: 30px auto;
    text-align: center;
    padding: 30px;
    background-color: #F1F1F1;
    filter: opacity(90%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    font-weight: normal;
}

    .services-text p {
        font-size: 16px;
        margin: 8px;
    }

    .services .service-card {
        display: inline-block;
        width: 25%;
        padding: 30px;
        margin: 15px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
        transition: background-color 0.5s;
        border-radius: 10px;
    }

        .services .service-card h3 {
            font-size: 24px;
            margin-bottom: 15px;
            color: #1B2B40;
        }

        .services .service-card p {
            font-size: 16px;
            margin-bottom: 16px;
        }

.service-card img {
    width: 100%;
    height: auto;
    margin-bottom: 15px;
    border-radius: 2px;
}

.service-card:hover {
    background-color: #F2F2F2;
}

/* 數字轉動 */
.counter-section {
      display: flex;
      flex-wrap: wrap;
      gap: 1rem;
      justify-content: center;
      text-align: center;
      width: 80%;
      margin: auto;
    }

    .counter-box {
      flex: 1 1 calc(25% - 1rem);
      background: white;
      border-radius: 8px;
      padding: 1rem;
      min-width: 200px;
    }

    .counter-number {
      font-size: 4rem;
      font-weight: bold;
      color: #0378A6;
    }

    .counter-label {
      font-size: 1.5rem;
      color: #333;
    }

/* 整體樣式 */
.carousel {
    position: relative;
    width: 100%;
    height: auto;
    margin: 0 auto;
    overflow: hidden;
    display: flex;
    align-items: center;
}

/* 圖片容器 */
.image-wrapper {
    display: flex;
    width: 100%;
    max-width: 500px;
    transition: transform 0.7s ease-in-out;
}

    /* 單張圖片 */
    .image-wrapper img {
        width: 100%;
        height: auto;
    }

/* 左右切換按鈕 */
.prev-btn, .next-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 1000;
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

    .prev-btn:hover, .next-btn:hover {
        background-color: rgba(0, 0, 0, 0.7);
    }

/* 回到最上層 */
.scroll-to-top {
    position: fixed;
    opacity: 0.6;
    bottom: 20px;
    right: 20px;
    display: none; /* 初始隱藏 */
    z-index: 1000; /* 確保按鈕在其他元素上方 */
    transition: opacity 0.3s ease-in-out; /* 讓按鈕出現和消失更平滑 */
}

    .scroll-to-top:hover {
        opacity: 0.7; /* 鼠標懸停時調整圖片透明度 */
    }


/* 小螢幕背景調整 */
    @media screen and (max-width: 1250px) {
        .services .service-card {
        width: 45%;
    }

        .news-movie {
        width: 90%; /* 設置影片最大寬度 */
    }
}

/* 小螢幕樣式 */
@media (max-width: 768px) {
     .hero h1 {
        font-size: 2rem;
    }

    .news {
        width: 100%;
    }

    .services .service-card {
        width: 90%;
        margin-bottom: 20px;
    }

    .counter-section {
      width: 100%;
    }
    
    .counter-box {
        flex: 1 1 calc(50% - 1rem);
    }
}

/* 小螢幕調整 */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 28px;
    }

    .hero p {
        font-size: 20px;
    }

    .content-section h2 {
        font-size: 1.8em;
    }

    .counter-box {
        flex: 1 1 100%;
    }
}
