﻿* {
    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/product/product01.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;
}

/* 分類區塊框 */
.table-container {
    display: flex;
    justify-content: center;
}

.table-nav {
    margin: 60px auto;
    width: 50px;
    text-align: right;
}

    .table-nav li {
        list-style: none;
        text-align: center;
        font-size: 16px;
        padding: 10px;
        background-color: #F2F2F2;
        box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
        border-radius: 3px;
        writing-mode: vertical-rl; /* 設定文字垂直顯示，從右到左 */
        /*transform: rotate(180deg);*/ /* 這是用來將文字方向旋轉180度，從左到右 */
    }

        .table-nav li:hover {
            animation: vibrate 0.5s forwards; /* 動畫名稱、時長、動作結束後保持最終狀態 */
        }

@keyframes vibrate {
    0% {
        -webkit-transform: translate(0);
        transform: translate(0);
    }

    100% {
        -webkit-transform: translate(2px, -2px);
        transform: translate(2px, -2px);
    }
}

/* 跳轉預留空間 */
#no1, #no2, #no3, #no4, #no5, #no6, #no7 {
    scroll-margin-top: 100px; /* 視窗往下偏移一點，避免被 header 擋住 */
}


/* 交通產品區塊 */
.traffic {
    grid-area: products;
    width: 80%;
    margin: auto;
    text-align: center;
    padding: 20px;
}

.traffic-container {
    display: grid;
    width: 100%;
    height: 100%;
    grid-template-areas: "traffic-title traffic-text traffic-img";
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr;
    margin: 40px 0 40px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.traffic-container {
    opacity: 0; /* 初始隱藏 */
    transform: translateY(50px); /* 讓元素向下偏移，隱藏在視窗下方 */
    transition: opacity 1s ease-out, transform 1s ease-out; /* 動畫效果 */
}

    .traffic-container.visible {
        opacity: 1; /* 當 traffic-container 變可見時，透明度為 1 */
        transform: translateY(0); /* 使元素回到原位置 */
    }

.traffic-title {
    grid-area: traffic-title;
    margin: auto;
    background-color: #FFFFFF;
    padding: 20px;
}

    .traffic-title h3 {
        font-size: 28px;
        color: #0D0D0D;
    }

    .traffic-title p {
        font-size: 20px;
        margin: 16px 0 16px 0;
    }

.traffic-text {
    grid-area: traffic-text;
    background-color: #F1F1F1;
    padding: 20px;
    text-align: left;
}
    .traffic-text ul {
        margin: 0 0 0 16px;
    }

    .traffic-text li {
        font-size: 16px;
    }

    .traffic-text p {
        font-size: 20px;
        margin: 16px 0 16px 0;
    }

    .traffic-text h4 {
        color: #0378A6;
        font-size: 14px;
        text-align: center;
        margin: 16px 0 0 0;
    }

.traffic-img {
    grid-area: traffic-img;
    background-color: #FFFFFF;
    margin: auto;
}

/* 整體樣式 */
.carousel {
    position: relative;
    width: 100%;
    text-align: center;
    max-width: 400px;
/*    overflow: hidden;*/
}

/* 大圖片 */
.main-image {
    width: 100%;
    height: auto;
}

/* 縮圖 */
.thumbnail-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* 允許縮圖換行 */
    gap: 10px;
    margin-top: 10px;
    max-width: 100%; /* 限制寬度不超過大圖 */
    overflow: hidden; /* 防止超出 */
}

.thumbnail {
    width: 15%; /* 讓縮圖根據大圖的寬度調整 */
    max-width: 100px; /* 避免縮圖過大 */
    height: auto;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.3s ease, opacity 0.3s ease, border 0.3s ease;
    opacity: 0.6; /* 初始透明度 */
}

    .thumbnail:hover {
        transform: scale(1.1); /* 滑鼠滑過時放大 */
        opacity: 1; /* 提高透明度 */
    }

    .thumbnail.active {
        border-radius: 5px;
        transform: scale(1.1); /* 讓當前選中縮圖也有放大效果 */
        opacity: 1;
    }

/* 左右切換按鈕 */
.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 15px;
    cursor: pointer;
    font-size: 20px;
    border-radius: 5px;
    user-select: none;
}

.prev-btn {
    left: 5px;
}

.next-btn {
    right: 5px;
}

    .prev-btn:hover, .next-btn:hover {
        background-color: rgba(0, 0, 0, 0.7);
    }

.goback {
    text-align: center;
}

/* 回到最上層 */
.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 (max-width: 1200px) {
    .image-wrapper {
        width: 300px;
        height: 300px;
    }
}

/* 小螢幕樣式 */
@media (max-width: 768px) {
     .hero h1 {
        font-size: 2rem;
    }

    .traffic {
        width: 100%;
    }

    .traffic-container {
        display: grid;
        width: 100%;
        height: 100%;
        grid-template-areas: "traffic-title"
            "traffic-img"
            "traffic-text";
        grid-template-columns: auto;
        margin: 40px 0 40px 0;
    }

    .solution-img {
        padding: 0;
    }
}

/* 小螢幕調整 */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 28px;
    }

    .hero p {
        font-size: 20px;
    }

    .content-section h2 {
        font-size: 1.8em;
    }

    .traffic-title h3 {
        font-size: 24px;
    }

    .traffic-title p {
        font-size: 18px;
    }

    .traffic-text li {
        font-size: 14px;
    }

    .traffic-text p {
        font-size: 16px;
        margin: 0 0 12px 0;
    }
}
