/* =========================================
   全站共用樣式 (style.css) - V23.0 (捲動後變透明版)
   ========================================= */
:root {
    --primary-dark: #0f172a;
    --primary-blue: #1e3a8a;
    --accent-gold: #fbbf24;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.6);
    --text-dark: #1e293b;
    --nav-height: 80px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Noto Sans TC', sans-serif;
    color: var(--text-dark);
    background-color: #f0f4f8;
    padding-top: var(--nav-height);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 背景特效 */
.animated-bg {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -1;
    background: linear-gradient(-45deg, #e0e7ff, #f0f9ff, #fffbeb, #eef2ff);
    background-size: 400% 400%; animation: gradientBG 15s ease infinite;
}
@keyframes gradientBG {
    0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; }
}

/* ================= 導覽列 ================= */
nav {
    position: fixed; top: 0; left: 0; width: 100%; height: var(--nav-height);
    
    /* 【置頂狀態】：實色 (不透明)，清楚呈現 */
    background-color: var(--primary-dark); 
    
    color: #fff;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 4%; z-index: 1000; transition: all 0.4s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
nav.scrolled {
    /* 【捲動狀態】：變成半透明 (增加透明度) + 毛玻璃 */
    background-color: rgba(15, 23, 42, 0.75) !important;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    
    height: 75px; 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.nav-brand-link { text-decoration: none; color: inherit; display: flex; align-items: center; transition: opacity 0.3s; }
.nav-brand-link:hover { opacity: 0.9; }
.nav-brand-container { display: flex; flex-direction: column; justify-content: center; line-height: 1.1; }
.nav-brand-main { font-size: 1.6rem; font-weight: 800; letter-spacing: 2px; color: #fff; margin-bottom: 4px; }
.nav-brand-main span.highlight { color: var(--accent-gold); }
.nav-brand-sub { font-size: 0.65rem; color: #cbd5e1; font-weight: 400; letter-spacing: 0.5px; max-width: 200px; line-height: 1.3; }
.nav-brand-sub span { color: var(--accent-gold); font-weight: 600; }

.nav-links { list-style: none; display: flex; gap: 20px; align-items: center; }
.nav-links a { text-decoration: none; color: rgba(255,255,255,0.7); font-weight: 500; font-size: 0.95rem; position: relative; transition: 0.3s; padding: 10px 0; white-space: nowrap; }
.nav-links a:hover, .nav-links a.active { color: #fff; }

.nav-links > li > a:not(.dropbtn)::after {
    content: ''; position: absolute; bottom: 0; left: 50%; width: 0; height: 2px;
    background: var(--accent-gold); transition: width 0.3s ease, left 0.3s ease;
}
.nav-links > li > a:not(.dropbtn):hover::after,
.nav-links > li > a:not(.dropbtn).active::after { width: 100%; left: 0; }

/* ================= 下拉選單 ================= */
.dropdown { position: relative; display: inline-block; }

.dropbtn { 
    padding-right: 20px !important; 
    cursor: pointer; 
    position: relative; 
}
.dropbtn::after { 
    content: '▾'; 
    position: absolute; 
    right: 0; top: 50%; transform: translateY(-50%); 
    font-size: 0.8rem; color: var(--accent-gold);
    height: auto !important; width: auto !important;
    background: transparent !important; bottom: auto !important; left: auto !important;
}

.dropdown-content { display: none; position: absolute; top: 100%; left: 0; background-color: rgba(15, 23, 42, 0.95); min-width: 180px; box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2); z-index: 1001; border-top: 3px solid var(--accent-gold); border-radius: 0 0 8px 8px; padding: 10px 0; }
.dropdown-content a { color: #fff; padding: 12px 20px; text-decoration: none; display: block; text-align: left; }
.dropdown-content a:hover { background-color: rgba(251, 191, 36, 0.1); color: var(--accent-gold); }
.dropdown:hover .dropdown-content { display: block; }

/* ================= 內容與排版 ================= */
.site-header { text-align: center; padding: 50px 20px 30px; animation: fadeIn 1s ease-out; }
.main-title { font-size: 2.8rem; font-weight: 800; color: var(--primary-dark); margin-bottom: 10px; letter-spacing: 1px; position: relative; display: inline-block; }
.main-title::after { content: ''; display: block; width: 60%; height: 4px; background-color: var(--accent-gold); margin: 10px auto 0; border-radius: 2px; }

footer { margin-top: auto; background: var(--primary-dark); color: #94a3b8; text-align: center; padding: 30px 20px; font-size: 0.9rem; }
footer strong { color: inherit; font-weight: 400; }

/* TOP 按鈕 */
#backToTopBtn { 
    position: fixed; bottom: 90px; right: 30px; 
    width: 50px; height: 50px; 
    background-color: var(--primary-dark); color: var(--accent-gold); 
    border: 2px solid var(--accent-gold); border-radius: 50%; 
    font-weight: bold; 
    cursor: pointer; z-index: 9999; 
    opacity: 0; visibility: hidden; transition: all 0.3s ease; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.2); 
    display: flex; flex-direction: column; 
    align-items: center; justify-content: center; 
    padding: 0;
}
#backToTopBtn:hover { background-color: var(--accent-gold); color: var(--primary-dark); transform: translateY(-5px); }
#backToTopBtn.show { opacity: 1; visibility: visible; }

.top-text {
    font-size: 0.75rem;
    line-height: 1;
}
.top-arrow {
    font-size: 0.65rem; 
    line-height: 1;
    margin-top: 3px; 
}

/* 容器樣式 */
.content-section { display: flex; justify-content: center; padding: 20px 8% 80px; flex: 1; }

.content-container { 
    display: flex; 
    flex-direction: row; 
    max-width: 1300px; 
    gap: 50px; 
    align-items: center; 
    width: 100%; 
}

.profile-image-wrapper { flex: 0 0 35%; position: relative; animation: floatImage 6s ease-in-out infinite; }
.aspect-ratio-box { 
    position: relative; 
    width: 100%; 
    height: 480px; 
    border-radius: 20px; 
    overflow: hidden; 
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.2); 
    border: 4px solid rgba(255, 255, 255, 0.8); 
}
.aspect-ratio-box img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; transition: transform 0.5s ease; }
.aspect-ratio-box:hover img { transform: scale(1.05); }

/* 卡片樣式 */
.glass-card { 
    flex: 1; 
    background: var(--glass-bg); 
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); 
    border: 1px solid var(--glass-border); border-radius: 24px; 
    padding: 50px 15px; 
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.08); 
    animation: fadeUp 0.8s ease-out forwards; 
    display: block; 
}

.section-title { font-size: 1.8rem; color: var(--primary-blue); margin-bottom: 25px; font-weight: 700; border-left: 5px solid var(--accent-gold); padding-left: 15px; }

/* 內文樣式 */
.bio-text { font-size: 1.15rem; color: #334155; line-height: 2; text-align: justify; }
.bio-text p { text-indent: 2em; margin-bottom: 25px; }
.bio-text strong { color: var(--primary-blue); background-color: rgba(251, 191, 36, 0.35); padding: 2px 6px; border-radius: 4px; font-weight: 700; box-decoration-break: clone; }

/* ================= 教案頁面專用樣式 ================= */

.content-container.single-column { justify-content: center; max-width: 1350px; }

.btn-cta {
    display: inline-block;
    background-color: var(--primary-blue);
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 15px 40px;
    border-radius: 50px; 
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(30, 58, 138, 0.3);
    border: 2px solid transparent;
}
.btn-cta:hover {
    background-color: var(--accent-gold);
    color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.4);
}
.cta-container {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.drive-embed-container { width: 100%; margin-top: 20px; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.1); border: 1px solid rgba(0,0,0,0.1); background: #fff; }
.drive-embed-iframe { width: 100%; height: 400px; border: none; }

.lesson-text p { text-indent: 2em; margin-bottom: 1em; line-height: 2; color: #334155; text-align: justify; }
.lesson-section { margin-bottom: 1.5em; }
.lesson-section-title { font-size: 1.2rem; color: var(--primary-dark); font-weight: 700; margin-bottom: 0.8em; display: block; border-left: 4px solid var(--accent-gold); padding-left: 10px; }
.lesson-content h3 { color: var(--primary-blue); font-size: 1.4rem; margin-top: 30px; margin-bottom: 25px; border-bottom: 2px solid rgba(251, 191, 36, 0.5); padding-bottom: 5px; display: inline-block; }

.lesson-content ul { list-style: disc; margin-left: 1em; margin-bottom: 25px; color: #334155; line-height: 1.8; }
.lesson-content ul li { margin-bottom: 1em; letter-spacing: -0.04em; }
.lesson-content ul li:last-child { margin-bottom: 0; }

/* ================= 影音與相簿樣式 ================= */

.video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; 
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    margin-bottom: 40px; 
}
.video-wrapper iframe {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    border: 0;
}

.photos-grid {
    display: flex;
    gap: 30px; 
    justify-content: center;
    width: 100%;
}
.photo-item {
    flex: 1; 
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    background: #fff;
}
.photo-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}
.photo-item:hover img {
    transform: scale(1.03); 
}

/* 動畫與 RWD */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes floatImage { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

@media (max-width: 968px) {
    .content-container { flex-direction: column; gap: 40px; align-items: center; }
    .profile-image-wrapper { flex: none; width: 80%; max-width: 450px; }
    .aspect-ratio-box { height: 450px; }
    .glass-card { width: 100%; padding: 30px; }
    
    .main-title { font-size: 2.0rem; }
    
    nav { height: auto; padding: 15px 4%; flex-direction: column; gap: 15px; }
    nav.scrolled { height: auto; padding: 10px 4%; }
    .nav-brand-container { align-items: center; text-align: center; }
    .nav-brand-sub { max-width: none; }
    .nav-links { flex-wrap: wrap; justify-content: center; width: 100%; gap: 15px; }
    .nav-links a { font-size: 0.9rem; }
    
    .dropbtn::after { display: block !important; right: 0 !important; }
    
    .dropdown-content { position: static; min-width: 100%; box-shadow: none; background: rgba(255, 255, 255, 0.05); border-top: none; padding-left: 20px; border-radius: 4px; }
    
    /* 手機版 padding-top 增加到 180px */
    body { padding-top: 180px; }
    
    .btn-cta { width: 100%; text-align: center; }
    
    .photos-grid { flex-direction: column; }
}