body {
    font-family: serif; /* 設置為瀏覽器默認的襯線字體 */
    background: linear-gradient(135deg, rgba(255,223,186,0.2), rgba(255,182,193,0.2)), 
        url('img/huaban.jpg'); /* 使用圖片背景 */
    background-size: cover; /* 確保圖片覆蓋背景 */
    background-blend-mode: overlay; /* 改變融合模式 */
    background-attachment: fixed; /* 固定背景圖 */
    background-position: center; /* 背景圖片置中 */
    margin: 0;
    padding: 0;
    padding-bottom: 60px; /* 增加底部空間以避免footer擋住內容 */
}

header, nav, footer {
    background-color: rgba(214, 51, 132, 0.2); /* 統一背景透明度 */
    color: white;
    text-align: center;
}

header img {
    width: 100px;
    animation: fadeIn 2s ease-in-out;
}

h1 {
    font-size: 2.5rem; /* 可根據需求調整 */
}

h2 {
    font-size: 1.8rem; /* 可根據需求調整 */
}

h3 {
    font-size: 1.2rem; /* 可根據需求調整 */
}

p {
	 font-size: 1.2rem;
}


nav {
    display: flex;
    flex-wrap: wrap; /* 允許按鈕在小螢幕換行 */
    justify-content: center; /* 保持按鈕居中 */
    padding: 20px;
    margin-top: 20px;
    max-width: 100%; /* 防止 nav 區域超出父容器 */
    box-sizing: border-box; /* 確保內外邊距計入元素總寬度 */
}

nav a {
    color: white;
    background-color: rgba(241, 126, 166, 0.9); /* 半透明背景 */
    padding: 10px 20px;
    border-radius: 8px;
    margin: 10px;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
    display: inline-block; /* 保證按鈕顯示為塊狀元素 */
    box-sizing: border-box; /* 確保按鈕大小符合父容器 */
}

nav a:hover {
    background-color: #fbe250; /* 當鼠標懸停時改變背景色 */
    color: #444444; /* 當鼠標懸停時改變文字顏色 */
}

section {
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.5); /* 提高透明度 */
    margin: 20px;
    border-radius: 15px;
    box-shadow: 0px 4px 12px rgba(0,0,0,0.1);
    animation: fadeInUp 1.5s ease-in-out;
}

h1, h2, p, #datetime, #utctime, #datetime-en, #utctime-en, #datetime-ja, #utctime-ja {
    color: #444444; /* 統一字體顏色為深灰色，提升對比 */
    text-shadow: none; /* 移除文字陰影以統一樣式 */
}

span {
    font-weight: bold;
}

.banner {
    text-align: center;
    padding: 50px 0;
    background-color: rgba(255,182,193, 0.7);
    border-radius: 10px;
    box-shadow: 0px 4px 8px rgba(0,0,0,0.3);
}

.banner img {
    width: 200px;
    animation: pulse 3s infinite;
}

footer {
    font-size: small;
    padding: 1rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 3rem;
}

/* 為中等寬度設備和小螢幕添加響應式設計 */
@media screen and (max-width: 1024px) {
    nav {
        flex-direction: column; /* 垂直排列按鈕 */
        align-items: center; /* 中心對齊按鈕 */
    }

    nav a {
        width: 100%; /* 每個按鈕占據一行 */
        text-align: center;
        margin: 10px 0; /* 按鈕之間保持適當的間距 */
        font-size: 16px;
    }
}

@media screen and (max-width: 600px) {
    .banner img {
        width: 150px;
    }

    section {
        margin: 10px;
        padding: 10px;
    }
	.p {
			font-size: 1.2rem ;
	}
}

button {
    padding: 8px 12px;
    font-size: 1.2rem;
    font-family: serif;
    font-weight: 600;
    min-width: 80px;
    width: auto;
    max-width: 100%;
    display: inline-block;
    margin: 5px 0;
    white-space: nowrap;
    text-align: center;
    border-radius: 15px;
    cursor: pointer;
    border: none;
    color: rgb(255, 255, 255) !important;
    background-color: rgba(241, 126, 166, 0.9);
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
}

button:hover {
    background-color: #fbe250; /* 當鼠標懸停時改變背景色 */
    color: #444444; /* 當鼠標懸停時改變文字顏色 */
}

button a:visited {
    color: white; /* 保持文字颜色与未访问时一致 */
    text-decoration: none;
}

button :visited {
    color: white; /* 保持文字颜色与未访问时一致 */
    text-decoration: none;
}
}
#backToTopBtn {
    position: fixed; /* 固定位置 */
    bottom: 20px;    /* 距離底部 20px */
    right: 20px;     /* 距離右邊 20px */
    z-index: 99;     /* 確保按鈕顯示在其他元素的上方 */
    font-size: 18px;
    background-color: #555;
    color: white;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 15px;
    border-radius: 50%;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s ease;
}
