﻿body {
    font-family: 'Noto Sans TC', 'Microsoft JhengHei';
    line-height: 1.8;
    margin: 0;
    padding: 0;
    background-color: #f6ede8;
}

.container {
    width: clamp(100%, 70vw, 70%);
    margin: 20px auto; /* 調整容器的頂部間距和水平居中 */
}

.header-container, .date-container {
    width: 100%;
    margin-bottom: -18px;
    text-align: left;
    background-color: #fffcfa;
    color: #835E54;
}

@media (max-width: 768px) {
    .header-container .text-left {
        text-align: center !important;
    }

    .header-container img {
        display: none;
        margin: 0 auto;
    }
}


.content-container {
    margin-top: 40px;
    padding: 20px;
    border-radius: 8px;
    display: flex; /* 使內容部分為彈性佈局 */
    flex-direction: column; /* 初始為縱向佈局 */
    align-items: center; /* 使內部內容居中 */
    max-width: 100%; /* 确保父容器的宽度不超过页面 */
    font-size: 1.2em;
}

    .content-container.hide {
        max-height: 0;
        opacity: 0;
    }

.image-section {
    max-height: 600px;
    object-fit: cover;
    display: block;
    justify-content: space-between; /* 確保圖片之間的間距 */
    width: 50%; /* 確保圖片區塊佔滿父容器寬度 */
    gap: 10px; /* 設置圖片之間的間隔 */
    margin-bottom: 15px;
}

    .image-section img {
        max-height: 580px;
        width: auto;
        max-width: 100%;
        height: auto;
        object-fit: contain; /* ✅ 讓圖片完整縮放，不裁切 */
        display: block;
        margin-bottom: 15px;
    }

.text-section {
    display: flex;
    flex-direction: column;
    justify-content: start;
    text-align: left; /* 文字部分左對齊 */
    width: 50%; /* 確保文字區塊佔滿父容器寬度 */
    margin-top: clamp(0px,10%, 1%);
    max-height: clamp(450px,550px,600px);
    overflow-y: auto;
}

    .text-section p {
        font-size: 1rem; /* 統一字體大小 */
        line-height: 1.6; /* 統一行距 */
        color: #835E54;
        margin-bottom: 12px;
        white-space: pre-line;
    }

/* 引言：稍小、斜體、灰色，和內文區隔 */
.quote {
    font-style: italic;
    color: #555;
    opacity: 0.85;
    margin-bottom: 8px;
}

/* 內文：保持基準樣式即可，必要時可加強字色 */
.main-text {
    font-weight: 400;
}

/* ── 系統標題列（預設風格）── */
#system-title {
    display: block;
    margin-bottom: 20px;
    font-weight: bold;
    font-size: 1.25em;
    line-height: 1.6;
    padding: 10px 16px;
    border-left: 5px solid #c09080;
    border-radius: 0 6px 6px 0;
    background: rgba(214, 184, 174, 0.2);
    color: #5c3020;
}

/* 簽名：縮小、靠右、加淡色 */
.signature {
    font-size: 0.9rem;
    color: #777;
    text-align: right;
    margin-top: 16px;
    opacity: 0.8;
}
.tab-container {
    margin-bottom: 20px;
    text-align: center;
    background-color: #f6ede8;
}

.tab {
    cursor: pointer;
    padding: 12px 18px;
    margin: 3px 8px;
    background-color: #007ACC;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    transition: all 0.3s ease-in-out;
}

    .tab:hover {
        background-color: #005F8F;
    }

    .tab.active {
        background-color: #005F8F;
        box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.3);
    }


.tab-content {
    display: none; /* 默认隐藏内容 */
    background-color: #A38172;
    max-width: 100%; /* 确保父容器的宽度不超过页面 */
    color: #835E54;
    font-size: clamp(1rem, 2vw + 0.5rem, 1.2rem);
}

    .tab-content.active {
        display: block; /* 激活状态显示内容 */
    }


#systems-container {
    display: none; /* 初始不顯示也不佔位 */
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s ease, transform 1s ease;
}

    #systems-container.active {
        opacity: 1;
        transform: translateY(0);
    }

a.system-link {
    text-decoration: none; /* 移除默認的超連結下劃線 */
    color: inherit; /* 使用默認文字顏色 */
    display: block; /* 讓整個區塊可點擊 */
}

a.event-link:hover {
    background-color: #B0E0E6; /* 悬停时的背景颜色 */
}

a.event-link.active {
    background-color: #5F9EA0; /* 激活状态的背景颜色 */
    color: #fff; /* 激活状态的文本颜色 */
    font-weight: bold; /* 激活状态的文本加粗 */
}

#backToTopBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    display: none; /* Initially hidden */
}

.system-image {
    max-width: 50%; /* 圖片最大寬度為父容器的一半 */
    width: 100%; /* 確保圖片寬度充滿容器 */
    flex: 1; /* 讓圖片各自占一半寬度 */
    border-radius: 10px;
}

/* 讓 3D 文字雲的容器 `#word-cloud` 根據父物件大小變化 */
#word-cloud {
    background: rgba(17, 17, 17, 0.85); /* 柔化深色背景 */
    padding: 20px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    min-height: 300px;
    transition: all 0.5s ease;
}

    #word-cloud img {
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
        transition: transform 0.3s ease;
        max-width: 100%;
        height: auto;
    }

        #word-cloud img:hover {
            transform: scale(1.1); /* 滑鼠懸停稍微放大 */
        }

    /* 讓 `svg` 內容也自適應 */
    #word-cloud svg {
        width: 100%;
        height: 100%;
        display: block;
    }

#word-cloud-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

.Word-Cloud {
    background-color: #3A4F4F;
    color: #DDE8E8;
    padding: 40px 20px;
    transition: background 0.5s ease;
}

    .Word-Cloud span {
        color: #FFFFFF;
    }

.explore-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 20px auto;
    flex-wrap: wrap;
}

.explore-btn {
    background-color: #4F8C8D; /* 主色 */
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-weight: bold;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

    .explore-btn:hover {
        background-color: #6DA8AB; /* hover 淺藍綠 */
        transform: scale(1.05);
    }

    .explore-btn.active {
        background-color: #A3C2B2; /* 被選中後的顏色 */
        color: #2B2F2C;
    }

.event-link {
    color: #443728;
    text-decoration: none;
    display: block;
    margin: 12px auto;
    max-width: 720px;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    border-radius: 10px;
}

    .event-link:hover .event-item {
        background-color: #f0f7f8;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }

    .event-link.active .event-item {
        background-color: #e6f0f1;
        border-left: 4px solid #6DA8AB;
    }

#toggle-buttons {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

    #toggle-buttons button {
        background-color: #4F8C8D;
        color: #fff;
        border: none;
        padding: 10px 15px;
        margin: 5px;
        border-radius: 6px;
        cursor: pointer;
        transition: background-color 0.3s ease;
    }

        #toggle-buttons button:hover {
            background-color: #6DA8AB;
        }

/* ✅ 通用 active 樣式 */
#systems-container td.active {
    background: #5F9EA0 !important; /* 深色背景 */
    color: #fff !important; /* 白色文字 */
    font-weight: bold; /* 加粗 */
    border: 2px solid #4682B4; /* 外框更明顯 */
}

a:hover, a:visited, a:link, a:active {
    color: inherit;
    text-decoration: none;
}

.header-title {
    font-size: clamp(1.5rem, 1vw + 2rem, 3rem);
    font-weight: bold;
    text-decoration: none;
    color: #835E54;
    display: inline-block;
    padding: 10px 20px;
}

.img-fluid {
    max-width: 100%;
    max-width: clamp(30%, 70vw,100%);
    max-height: clamp(100px, 250px, 450px);
    height: auto;
    max-height: 450px;
}


.outer-container {
    padding: 40px 20px;
}

.system-introduction {
    border-radius: 10px;
    background-color: white;
    padding: 5%;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    /* ✅ 用 clamp 自動調整，螢幕小寬度就變大 */
    max-width: clamp(99%, 70vw, 70%);
    max-height: clamp(95%, 85vh, 85%);
    margin: 0 auto;
}

#system-overview {
    background-color: #fef9f6;
    padding: 5%;
}

/* 隱藏/顯示容器，初始為隱藏 */
.accordion-content {
    display: none;
    overflow: hidden;
    padding: 15px;
    margin-top: 10px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: max-height 0.5s ease-out; /* 動畫過渡效果 */
    max-height: 0;
}

    /* 展開後的狀態 */
    .accordion-content.open {
        display: block;
        max-height: 500px; /* 可設定最大高度 */
        padding-top: 20px;
        padding-bottom: 20px;
    }

.system-section {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    padding: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.fade-text {
    transition: opacity 0.4s ease-in-out;
    opacity: 1;

}

.fade-out {
    opacity: 0;
}

#SystemStyle {
    transition: opacity 0.4s ease-in-out;
    opacity: 1;
    font-size: clamp(0.9rem, 1vw + 0.8rem, 2rem);
    font-weight: bold;
    display: block;
}

#SystemStyle-Description #Description {
    transition: opacity 0.4s ease-in-out;
    opacity: 1;    
    display: block;
}


.swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 600px; /* 或根據需要調整幻燈片高度 */
}

    .swiper-slide img {
        max-height: 100%;
        max-width: 100%;
        object-fit: contain;
    }

.event-section {
    background-color: #fef9f6; /* 與 system-overview 相同底色 */
    color: #443728;
    padding: 40px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.section-title {
    font-size: clamp(1rem, 1vw + 1rem, 2rem);
    font-weight: bold;
    color: #4F8C8D;
    display: block;
    margin-bottom: 1%;
}

.section-description {
    font-size: clamp(0.5rem,  1rem, 1rem);
    color: #5f5a56;
}

.event-date-selector {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 260px;
    padding: 10px 14px;
    font-size: 1rem;
    border-radius: 8px;
    border: 1px solid #A3C2B2;
    background-color: #FDF9F5;
    color: #443728;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: border 0.3s ease, box-shadow 0.3s ease;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%236DA8AB' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

    event-date-selector:hover,
    .event-date-selector:focus {
        border-color: #6DA8AB;
        background-color: #f9f9f9;
        outline: none;
        box-shadow: 0 0 0 2px rgba(109, 168, 171, 0.2);
    }

    .event-date-selector option[disabled] {
        color: #999;
        font-style: italic;
    }

.event-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 720px;
    margin: 0 auto;
}

.event-card {
    display: block;
    border-radius: 10px;
    background-color: #fdf9f5;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    padding: 16px 24px;
    color: #443728;
    text-decoration: none;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

    .event-card:hover {
        background-color: #f0f7f8;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }

    .event-card.active {
        background-color: #e6f0f1;
        border-left: 4px solid #4F8C8D;
    }

    .event-card p {
        margin: 4px 0;
        font-size: 1rem;
        line-height: 1.5;
        color: #443728;
    }
.system-table {
    width: 100%;
    border-collapse: collapse;
}

.system-cell {
    padding: 12px;
    text-align: center;
    cursor: pointer;
    color: #2C3E3E;
    transition: background 0.3s ease-in-out, color 0.3s ease-in-out;
}

.system-row-even {
    background-color: #F0F7F8;
}

.system-row-odd {
    background-color: #D9E7E8;
}

.system-cell.active {
    background-color: #9CC9CB;
    color: #2C3E3E;
}

.system-title-cell {
    padding: 15px;
    text-align: center;
    cursor: pointer;
    background: #4F8C8D;
    color: #FFFFFF;
    font-weight: bold;
    font-size: 18px;
    transition: background 0.3s ease-in-out;
}

.system-fade {
    opacity: 0;
    display: inline-block;
    transition: opacity 0.5s ease;
}
.system-cell:hover:not(.active) {
    background-color: #6DA8AB !important;
    color: #fff;
}
.category-button {
    background-color: #A38172;
    color: #fff;
    font-weight: bold;
    margin: -2px;
    padding: 10px 20px;
    border-radius: 4px;
    border: 1px solid transparent; 
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

    .category-button:hover:not(.active) {
        background-color: #fff;
        color: #A38172;
        border: 1px solid #A38172;
    }

.title-text {
    font-size: clamp(1rem, 1vw + 1rem, 2rem);
    font-weight: bold;
    display: block;
    
}

/* 手機螢幕以下，改成垂直排版 */
@media (max-width: 768px) {
    #system-content-container .row {
        flex-direction: column; /* 變成垂直排列 */
        align-items: center; /* 水平置中每個欄位 */
    }

    #system-content-container .image-section,
    #system-content-container .text-section {
        width: 100%; /* 滿版寬度 */
        max-width: 90%; /* 留點邊距，看起來比較美觀 */
        margin-bottom: 20px; /* 上下間距 */
    }

    #system-content-container .text-section {
        max-height: none; /* 避免小螢幕文字被限制高度 */
        text-align: center; /* 讓文字置中，閱讀更舒服 */
    }

    #system-title {
        font-size: 1.3rem;
        display: block;
        margin-bottom: 12px;
    }

    #word-cloud-container, .Word-Cloud {
        display: none !important;
    }
}
