body {
    font-family: "Cactus Classical Serif", "Noto Serif KR", "Noto Serif JP", "Noto Serif HK", 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;
}

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;
    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 {
    color: #444444;
    /* 統一字體顏色為深灰色，提升對比 */
}

span {
    font-weight: bold;
}
.span2 {
    color: rgba(241, 126, 166);
    font-weight: normal;
  }

.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: 0rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 3rem;
}

button {
    padding: 8px 12px;
    font-size: 1.2rem;
    font-family: "Cactus Classical Serif", "Noto Serif KR", "Noto Serif JP", "Noto Serif HK", 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:link, button a:visited {
    color: white;
    /* 保持文字顏色與未訪問時一致 */
    text-decoration: none;
}

#datetime,
#utctime,
#datetime-en,
#utctime-en,
#datetime-ja,
#utctime-ja {
    font-size: 1rem;
    font-weight: 600;
    color: #444444;
    /* 改變顏色為與<h1>一致 */
    text-shadow: none;
    /* 移除文字陰影以統一樣式 */
}

/* 漸變和動畫 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.02);
        /* 保持輕微變化 */
    }
}
/* 設定按鈕區域的樣式 */
.button-section {
    display: flex;
    background-color: rgba(241, 126, 166, 0.2);;
    justify-content: center; /* 水平居中排列 */
    flex-wrap: wrap; /* 允許按鈕換行 */
    gap: 15px; /* 按鈕之間的間距 */
    padding: 20px; /* 設置內邊距 */
}

/* 讓所有按鈕變大並居中 */
.button-section button {
    min-width: 200px; /* 設置按鈕的最小寬度 */
    text-align: center; /* 讓按鈕內文字居中 */
    border: none;
    background-color: rgba(241, 126, 166, 0.9); /* 背景色 */
    color: white;
    border-radius: 15px;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
}

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

/* 按鈕內的超連結保持一致的樣式 */
button a {
    color: inherit; /* 保持與按鈕一致的文字顏色 */
    text-decoration: none; /* 移除超連結的下劃線 */
}

/* 為中等寬度設備和小螢幕添加響應式設計 */
@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: 1.2rem;
    }

    .responsive-img {
        width: 30%;
    }
}

@media screen and (max-width: 600px) {
    nav a {
        display: block;
        margin: 10px 0;
    }

    .banner img {
        width: 150px;
    }

    section {
        margin: 10px;
        padding: 10px;
    }

    .responsive-img {
        width: 40%;
    }
}
