﻿/* ========================================= */
/* 1. 字體與基礎設定 */
/* ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Chiron+GoRound+TC:wght@200..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;700&display=swap');

body {
    /* 背景色：保留原色但加入漸層以增強玻璃感 */
    background: radial-gradient(circle at 10% 20%, rgb(92, 148, 252) 0%, rgb(120, 170, 255) 90%);
    background-color: #5C94FC;
    /* Fallback */
    color: #ffffff;
    margin: 0;
    padding: 20px;
    padding-top: 100px;
    /* 增加頂部間距避開更寬的 Navbar */
    padding-bottom: 80px;
    box-sizing: border-box;
    /* 全面改用圓體 */
    font-family: "Chiron GoRound TC", sans-serif;
    font-weight: 500;
    min-height: 100vh;
}

/* ========================================= */
/* 2. 導覽列 (Navbar) - Glassmorphism */
/* ========================================= */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* 玻璃擬態背景 */
    background: rgba(200, 76, 12, 0.75);
    /* 保留橘色系，但在透明度上做文章 */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    color: #fff;
    padding: 15px 30px;
    /* 加大內距 */
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    box-sizing: border-box;

    /* 移除舊版黑框，改為柔和邊框與陰影 */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0 0 20px 20px;
    /* 下方圓角 */

    animation: slideInFromTop 1s ease-out forwards;
    transform: translateY(-100%);
}

@keyframes slideInFromTop {
    0% {
        transform: translateY(-20%);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.navbar .logo {
    font-size: 1.8em;
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    /* 柔和陰影 */
    font-family: 'Noto Sans TC', sans-serif;
    letter-spacing: 1px;
}

.nav-links {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    gap: 20px;
    margin-left: auto;
    margin-right: 40px;
    color: #fff;
}

.nav-links li {
    display: inline;
}

.nav-links a {
    color: #ffffff;
    text-decoration: none;
    font-size: 1.05em;
    font-family: "Chiron GoRound TC", sans-serif;
    font-weight: 600;
    position: relative;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    text-shadow: none;
}

/* 導覽列連結 Hover - 玻璃光澤 */
.nav-links a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.nav-links a.active {
    background: rgba(251, 208, 0, 0.85);
    /* 黃色 */
    color: #fff;
    box-shadow: 0 0 15px rgba(251, 208, 0, 0.4);
}

.menu-toggle {
    font-size: 28px;
    cursor: pointer;
    color: #fff;
    background: none;
    border: none;
    display: none;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* ========================================= */
/* 3. 資源區排版 (Flexbox - Glass Cards) */
/* ========================================= */

.social-container {
    display: flex;
    flex-direction: column;
    margin-top: 40px;
    /* 增加間距 */
    align-items: center;
    width: 100%;
    max-width: 1600px;
    margin: 40px auto;
}

.single-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    width: 100%;
    margin-bottom: 30px;
}

.social-group {
    padding: 30px;

    /* 玻璃卡片樣式 */
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);

    text-align: left;
    flex: 0 0 calc((100% - 60px) / 3);
    min-width: 300px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.social-group:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
}

.social-group h3 {
    margin-bottom: 20px;
    color: #fff;
    /* 改為白色以適應透明背景 */
    font-size: 26px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    font-family: "Chiron GoRound TC", sans-serif;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: rgba(200, 76, 12, 0.8);
    /* 標題背景 */
    padding: 10px;
    border-radius: 12px;
}

/* --- RWD 響應式調整 --- */
@media (max-width: 950px) {
    .social-group {
        flex: 0 0 calc((100% - 30px) / 2);
    }
}

@media (max-width: 600px) {
    .social-group {
        flex: 0 0 100%;
    }
}

/* 資源連結按鈕 */
.btn-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn {
    /* 玻璃按鈕 */
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    color: #ffffff;
    padding: 14px 24px;
    font-size: 22px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);

    text-decoration: none;
    text-align: left;
    transition: all 0.3s ease;
    display: block;
    margin-bottom: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    letter-spacing: 1px;
    font-weight: 600;
    font-family: "Chiron GoRound TC", sans-serif;
}

.btn:hover {
    transform: translateY(-2px) scale(1.02);
    background: rgba(229, 37, 33, 0.85);
    /* 紅色 Hover */
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 6px 20px rgba(229, 37, 33, 0.3);
    color: #fff;
}

/* ========================================= */
/* 4. 分頁章節按鈕 (Glass Style) */
/* ========================================= */

.chapter-button,
.section-button {
    margin: 8px;
    padding: 16px 30px;
    font-size: 24px;
    font-family: "Chiron GoRound TC", sans-serif;
    font-weight: 600;

    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    color: #333;

    border: 1px solid rgba(255, 255, 255, 1);
    border-radius: 50px;
    /* 圓形按鈕 */

    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: inline-block;
}

.chapter-button:hover,
.section-button:hover {
    background: rgba(0, 170, 0, 0.85);
    /* 綠色 Hover */
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 170, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

.chapter-button.active,
.section-button.active {
    background: rgba(229, 37, 33, 0.9);
    /* 紅色 Active */
    color: #fff;
    font-weight: 700;
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(229, 37, 33, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.8);
    z-index: 10;
}

.button-row,
.button-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin: 30px 0 50px 0;
    text-align: center;
}

/* ========================================= */
/* 5. 頁尾 (Footer) - Glassmorphism */
/* ========================================= */

footer,
.sticky-footer {
    position: fixed;
    bottom: 20px;
    /* 懸浮感 */
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    /* 不滿版 */
    max-width: 1200px;
    height: auto;
    min-height: 60px;

    background: rgba(200, 76, 12, 0.75);
    /* 橘色玻璃 */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    /* 超圓 */

    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 30px;
    box-sizing: border-box;
    z-index: 9990;
    font-family: "Chiron GoRound TC", sans-serif;
    font-size: 15px;
    text-shadow: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.sticky-footer {
    justify-content: space-between;
}

footer p {
    margin: 0;
    display: inline-block;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
}

.footer-btn {
    background: rgba(232, 156, 36, 0.9);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.footer-btn:hover {
    background: #FBD000;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(251, 208, 0, 0.3);
    color: #333;
}

/* ========================================= */
/* 6. 其他通用元件 */
/* ========================================= */

.intro-text {
    font-family: "Chiron GoRound TC", sans-serif;
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700;
    text-align: center;
    margin: 40px auto 30px;
    white-space: nowrap;
    overflow: hidden;
    border-right: 4px solid #FBD000;
    /* 光標變細 */
    width: 0;
    animation: typing 3.5s steps(25, end) forwards, blink 0.75s step-end infinite;
    background: linear-gradient(to right, #ffffff, #e0e0e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    letter-spacing: 2px;
    max-width: 90vw;
    padding: 0 10px;
}

/* 下拉選單基礎樣式 */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #ffffff;
  min-width: 120px;
  box-shadow: 0px 8px 16px rgba(0,0,0,0.1);
  border-radius: 8px;
  z-index: 1000;
  top: 100%;
}

.dropdown-content a {
  color: #333 !important; /* 電腦版維持深色 */
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  font-size: 0.9rem;
  border-bottom: 1px solid #f0f0f0;
  opacity: 1; /* 確保透明度為 1 */
  visibility: visible; /* 確保可見 */
}

.dropdown-content a:hover {
  background-color: #5C94FC;
  color: white !important;
}

/* 懸浮顯示 */
.dropdown:hover .dropdown-content {
  display: block;
}



@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

.section-content {
    display: none;
}

.active-section {
    display: block;
    animation: fadeIn 0.8s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    font-family: "Chiron GoRound TC", sans-serif;
    font-weight: 800;
    font-size: clamp(2.2rem, 4vw, 3.5rem);
    text-align: center;
    color: #ffffff;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin: 50px auto 30px;
    max-width: 700px;
    letter-spacing: 3px;
    position: relative;
    padding-bottom: 15px;
    border: none;
}

/* 標題下方的裝飾線 */
.section-title::after {
    content: '';
    display: block;
    width: 100px;
    height: 4px;
    background: #C84C0C;
    margin: 15px auto 0;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(200, 76, 12, 0.5);
}

/* 首頁大型按鈕 */
.button-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    margin-top: 40px;
    padding: 20px;
}

.grade-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    width: 100%;
    max-width: 1100px;
}

.big-button {
    /* 玻璃按鈕 */
    background: rgba(0, 170, 0, 0.85);
    /* 綠色 */
    backdrop-filter: blur(8px);
    color: #fff;
    padding: 24px 30px;
    font-size: 26px;
    border-radius: 24px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* 彈跳效果 */
    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 20px rgba(0, 170, 0, 0.25);

    letter-spacing: 1px;
    font-weight: 700;
    max-width: none;
    width: 100%;
    box-sizing: border-box;
    animation: fadeIn 0.4s ease-in forwards, scaleIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.big-button:hover {
    background: rgba(0, 214, 0, 0.95);
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 15px 30px rgba(0, 170, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.7);
}

.big-button i {
    margin-right: 15px;
    font-size: 1.1em;
}

@keyframes scaleIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    70% {
        transform: scale(1.05);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}

/* ========================================= */
/* 7. 彈出視窗 (Modal) - Glass */
/* ========================================= */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    /* 背景暗化 */
    backdrop-filter: blur(5px);
    /* 背景模糊 */
    animation: fadeIn 0.3s;
}

.modal-content {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    margin: 5% auto;
    padding: 40px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    width: 80%;
    max-width: 900px;
    position: relative;
    color: #333;
}

.close-modal {
    color: #888;
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #000;
}

.modal-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    justify-content: center;
}

.modal-group {
    flex: 1 1 260px;
    min-width: 260px;

    background: rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.modal-group h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(200, 76, 12, 0.3);
    text-align: center;
    color: #C84C0C;
    font-size: 22px;
    font-family: "Chiron GoRound TC", sans-serif;
}

.modal-group .btn {
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    border: none;
    font-size: 18px;
    margin-top: 10px;
    border-radius: 12px;
}

.modal-group .btn:hover {
    background: #E52521;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(229, 37, 33, 0.3);
}