* {
    padding:0;
    margin:0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #ffffff;
}
.menu {
    display:none;
}
header {
     z-index: 1000;     /* 讓這個區塊在所有元素上層 */
    background-color:rgb(255, 255, 255);/* 第四個數字碼代表透明程度 */
    height:80px;
    width:100%;
    position:fixed;
    border-bottom: 3px solid #0058a6;/* 調整區塊下緣的邊框顏色 */
}
h1 {
    color:rgb(255, 255, 255);
    position:absolute;
    left:120px;
    top:0;
    line-height: 80px;
    background-image:url(images/TPLlogo.png) ;
    background-repeat: no-repeat;
    background-position: center;
    width:510px; /* 寬度與圖片寬度一致 */
    text-indent: -9999px; 
}
header ul {
    position:absolute;
    right:5vw;
    top:0;
    line-height:80px;
}
header li {
    display:inline;
    margin-right:4vw;    
}
header a {
    color:rgb(0, 0, 0);
    text-decoration: none;
}
header a:hover {
    color:red
}







/* 新聞/首頁主要區塊樣式設定 - 純CSS輪播背景圖片 */
.news {
    background-color: rgb(255, 255, 255);   /* 預設背景顏色（當圖片載入失敗時顯示） */
    height: 100vh;                           /* 🎯 輪播畫布高度：視窗高度的110% */
    width: auto;                            /* 🎯 輪播畫布寬度：視窗寬度的100% */
    margin-top: 0px;    /* 只調整上邊距，為header+額外空間留位 */
    margin-left: 160px;       /* 移除左右邊距 */
    margin-right: 160px;
    justify-content: center;                /* 子元素垂直置中對齊 */
    background-repeat: no-repeat;           /* 背景圖片不重複顯示 */
    background-size: cover;                 /* 🎯 圖片填滿方式：覆蓋整個畫布 */
    background-position: center;            /* 🎯 圖片位置：置中對齊 */
    display: flex;                          /* 使用彈性盒子佈局 */
    flex-direction: column;                 /* 子元素垂直排列（上下排列） */
    align-items: center;                    /* 子元素水平置中對齊 */
    
    transform: translateY(60px);            /* 正值往下移動 */
    /* 純CSS輪播動畫設定 */
    animation: backgroundCarousel 15s infinite; /* 15秒循環播放，無限重複 */
}



/* 定義背景圖片輪播動畫 - 可以為每張圖片設定不同的顯示方式 */
@keyframes backgroundCarousel {
    0%, 33% {
        background-image: url("images/first-page1-1.jpg"); /* 第一張圖片：0-33%時間 */
        /*background-size: cover;                            /* cover = 填滿容器，可能會裁切圖片 */
        background-position: center center;               /* 圖片置中顯示 */
        background-repeat: no-repeat;                      /* 不重複 */
        background-size: contain;
    }
    34%, 66% {
        background-image: url("images/test-page2.jpg");   /* 第二張圖片：34-66%時間 */
        background-size: contain;                          /* contain = 完整顯示圖片，可能有空白邊 */
        background-position: center center;               /* 圖片置中顯示 */
        background-repeat: no-repeat;                      /* 不重複 */
    }
    67%, 100% {
        background-image: url("images/test-page3-1.jpg"); /* 第三張圖片：67-100%時間 */
        /*background-size: 100% 100%;                       /* 強制填滿，可能會變形 */
        background-position: center center;               /* 圖片置中顯示 */
        background-repeat: no-repeat;                      /* 不重複 */
        background-size: contain;
    }
} 
.news h2 {
    font-size:60px;
    margin-top:60px;
} 
.news p {
    color:#FEF7E6;
    font-size:18px;
    margin:25px 0;
}
.news a {
    color:white;
    text-decoration: none;
    border: 1px solid #ACACAC;
    padding:10px 20px;
    border-radius: 5px;
}
.slogan {
    background-color:#485652;
    color:white;
    height:250px;
    display:flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    line-height: 1.8em;  
}
.shop {
    scroll-margin-top: 80px;                /* 為固定header留出空間 */
    display:flex;
}
.shop img {
    width:50%;
}
.info {
    width:50%;
    background-color: rgb(255, 255, 255);
    display:flex;
    flex-direction:column;
    align-items: flex-start;                 /* 改為 flex-start，讓內容可以靠左 */
    justify-content: center;
    padding: 20px 20px;                        /* 添加左右內距，避免文字貼邊 */
}
.info h2 {
    padding-top: 60px;
    position: relative;
    margin-top: 10px;
    color: #ff0000;
    text-align: center;                      /* 水平置中 */
    font-size: clamp(25px, 4vw, 40px);      /* 響應式字體大小：最小24px，最大40px */
    width: 100%;                             /* 確保佔滿寬度 */
    font-family: 'Arial', sans-serif;
    line-height: 1.2;                        /* 控制行高，避免文字重疊 */
    word-wrap: break-word;                   /* 長文字自動換行 */
    overflow-wrap: break-word;               /* 確保換行功能 */

}

.info h6{
    font-size: 20px; 
    text-align: left;    /* 靠左 */
    font-family: 'Arial', sans-serif;
}





.info p {
    text-align: left;    /* 靠左 */
    line-height: 2em;
    font-family: 'Arial', sans-serif;
    font-weight:Bold
}
.product {
    scroll-margin-top: 80px;                /* 為固定header留出空間 */
    display:flex;
    background-color: #555555;
    flex-wrap: wrap;                         /* 允許換行，讓產品可以排成多排 */
    /*justify-content: space-between;*/          /* 產品項目平均分配空間 */
    justify-content: space-around;           /* 產品項目平均分配空間 */
    align-items: flex-start;                 /* 改為靠上對齊，讓產品元素往上移動 */
    align-items: center;
    padding: 150px 80px 120px;              /* 100px 180px 80px */
    gap: 20px;                              /* 產品項目間的間距 */
    transform: translateY(60px);            /* 正值往下移動 */
    /*position: relative;   */                  /* 🎯 相對定位，讓絕對定位的h2能相對於此容器定位 */
    padding-top: 120px;                     /* 增加頂部內距，為h2留出空間 */
    min-height: 600px;                      /* 設定最小高度確保區塊夠長 */
}
.product div {
    width: 22%;                              /* 改為百分比，確保一排最多4個 */
    text-align:center;
    /*margin-bottom: 40px;   */                  /* 調整產品項目下方間距 */
}
.product img {
    width:100%;
    border-radius: 10px;;
}

.product h2 {
    color: #ff0000;
    text-align: center;                      /* 水平置中 */
    font-size: 50px; 
    margin: 0px 0px;
    font-family: 'Arial', sans-serif;
    
    /* 🎯 讓h2位於容器頂部且置中的關鍵設定 */
    position: absolute;                      /* 絕對定位 */
    top: 20px;                               /* 距離容器頂部20px */
    left: 50%;                               /* 水平位置50% */
    transform: translateX(-50%);             /* 向左移動自身寬度的50%，實現完全置中 */
    width: 100%;                             /* 佔滿容器寬度 */
    z-index: 10;                             /* 確保在其他元素上方 */
}




.product a {
    text-decoration: none;/* 去除底線 */
}



.product h3 {
    color: #ffffff;
    font-size: 20px;    
    margin: 20px 0;
    font-family: 'Arial', sans-serif;
    
}
.product p {
    font-size:14px;
    line-height: 1.6em;
}

/*當游標懸停在圖片或h3內容時，文字都會變成紅色*/
.product div:hover h3,
.product a:hover ~ h3,
.product h3:hover {
    color: red;
}



















.newsletter {
    scroll-margin-top: 80px;                /* 為固定header留出空間 */
    background-color:#4c4c4c;     /* 區塊顏色 */
    color:rgb(255, 255, 255);     /* 區塊內容的顏色 */
    padding:60px 0;                 /* 區塊大小設定 */    /*60px 0*/
    display:flex;
    flex-direction: column;
    align-items: center;
    background-image:url(images/TPLbuttonlogo.jpg) ;
    background-repeat: no-repeat;
    background-size: 200px auto;             /* 圖片大小設定 */
    width:100%;                       /* 寬度與圖片寬度一致 */
    background-position:100px;
    text-indent: -9px; /*-9999px;*/  /* 文字區塊移動 */
}

.newsletter p {
    margin-bottom: 20px;
    font-family: Arial, Helvetica, sans-serif;
}
.newsletter a {
    color: #ffffff;                          /* 設定連結顏色為藍色 */
    text-decoration: none;                   /* 移除底線 */
}
.newsletter a:hover {
    color: #38bdff;                          /* 滑鼠移入時的顏色 */
    text-decoration: underline;              /* 滑鼠移入時顯示底線 */
}



.newsletter .address {
     text-align: center; 
     margin: 10px auto; 
     max-width: 600px;
     font-family: Arial, Helvetica, sans-serif;     /* 底部地址的字體 */
}

#pageviews {
    align-self: flex-end;
    margin-right: 20px;
    margin-top: 0px;
}

footer {                                /* 網頁版權宣告 */
    background-color:#000000;
    color:#B7B7B7;
    height:60px;
    display:flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    font-family: 'Arial', sans-serif;
}

.menu {
    display:none;
}
/* 響應式設計語法 */
@media screen and (max-width: 768px) {


header ul {
    display: none;
    position: absolute;
    top: 80px;                               /* 緊接在header下方 */
    left: 0%;                  /* 0 */
    width: 100%;
    background-color: rgba(255, 252, 252, 0.95);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 999;                            /* 確保在其他元素上方 */
    flex-direction: column;
    padding: 0;
    margin: 0;
    opacity: 0;
    
    transform: translateY(-10px);            /* -10px */
    transition: all 0.3s ease;              /* 添加平滑動畫 */
}


header h1 {
    width: 300px;        /* 調整 logo 寬度 */
    background-size: contain;  /* 或其他背景尺寸設定 */
    left: 50%;
    transform: translateX(-40%);
}



/* 當選單被激活時顯示 */
header ul.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

header li {
    display: block;
    margin: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

header li:last-child {
    border-bottom: none;
}

header a {
    display: block;
    padding: 15px 20px;
    color: rgb(0, 0, 0);
    text-decoration: none;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

header a:hover {
    background-color: rgba(255, 0, 0, 0.1);
    color: red;
}

.menu {
    display:block;
    background-color: transparent;
    color: #333;
    font-size: 30px;
    position: absolute;
    top: 15px;
    left: 20px;
    border: 2px solid #333;
    border-radius: 5px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1001;                           /* 確保在選單上方 */
}

.menu:hover {
    background-color: rgba(255, 0, 0, 0.1);
    color: red;
    border-color: red;
}


/* 新聞區塊調整 */
.news {
    margin-left: 20px;                       /* 手機版減少左右邊距 */
    margin-right: 20px;
    height: 80vh;                            /* 調整手機版高度 */
}

.news h2 {
    font-size: 40px;
}

.shop {
    flex-direction: column;
}
.shop img {
    width:100%;
}
.info {
    width:100%;
    padding:20px 0px;                       /* 增加左右內距，避免文字在小螢幕上貼邊 */
}
.product {
    flex-direction: column;
    padding: 100px 0;
}
.product div {
    margin-bottom: 30px;
}
.newsletter {
    background-image: none;                   /* 在手機版時移除背景圖片 */
    text-indent: 0;                           /* 重設文字縮排 */
}








}