/* 檔案: main.css */
/* 說明: 此檔案包含網站所有的樣式規則，與 HTML 結構和 JavaScript 邏輯分離。*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* v1.0 的主色調 + v1.1 的結構 */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --primary-color-darker: #5a6fd8; /* 新增 */
    --secondary-color: #f093fb;
    --accent-color: #4facfe;
    --accent-color-darker: #3a9ae9; /* 新增 */
    --morning-light: #fff5e6;
    --heaven-gold: #ffd700;
    --pure-white: #ffffff;
    --soft-gray: #f8f9fa;
    --text-primary: #2c3e50;
    --text-secondary: #5d6d7e;
    --text-light: #7f8c8d;

    /* 有機形狀的陰影 */
    --soft-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --hover-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);

    /* 間距系統 */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 3rem;
    --space-xl: 5rem;

    --divider-color: #ddd; /* 定義分隔線顏色 */
}

/* 全域字體設定 - 更好的可讀性 */
body {
    /* --- 排版與字體 (Typography & Font) --- */
    /* * 業界標準的字體堆疊 (Font Stack)，為繁體中文顯示優化：
     * 1. 優先使用各作業系統的預設英文字體 (-apple-system, Segoe UI, Roboto) 來渲染西文及數字，以獲得最佳效果。
     * 2. 為 Apple 裝置指定蘋方-繁體 (`PingFang TC`) 作為中文首選。
     * 3. 為 Windows 裝置指定微軟正黑體 (`Microsoft JhengHei`) 作為中文首選。
     * 4. 最後回退到通用的無襯線字體。
     */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "PingFang TC", "Microsoft JhengHei", sans-serif;
    line-height: 1.6; /* 使用無單位的行高以獲得最佳的縮放兼容性 */

    /* --- 渲染優化 (Rendering Optimization) --- */
    -webkit-font-smoothing: antialiased; /* 在 WebKit 核心瀏覽器（如 Chrome, Safari）中啟用字體平滑 */
    -moz-osx-font-smoothing: grayscale; /* 在 Firefox 中啟用更清晰的字體渲染模式 */
    text-rendering: optimizeLegibility; /* 提示瀏覽器優先考慮易讀性而非速度，會啟用更高級的字距調整 */

    /* --- 色彩與背景 (Color & Background) --- */
    color: var(--text-primary);
    background: var(--pure-white);

    /* --- 佈局與滾動 (Layout & Scrolling) --- */
    overflow-x: hidden; /* 防止因動畫或寬元素造成的意外水平滾動條 */
}

/* 行動版選單開啟時，鎖定頁面滾動 */
body.mobile-menu-open {
    overflow: hidden;
}

/* 平滑滾動 */
html {
    scroll-behavior: smooth;
    overflow-x: hidden; /* [核心修正] 確保根元素不會因 off-canvas 元素產生水平滾動，增強跨瀏覽器相容性 */
}

/* [核心修正] 針對所有可作為錨點目標的 <section> 元素，新增向上捲動邊界 */
/* 目的：補償固定導覽列 (fixed navbar) 所佔據的高度，確保當使用者點擊導覽連結時，
         目標區塊的標題能準確地對齊在可視範圍的頂部，而不是被導覽列遮蔽。*/
section[id] {
    scroll-margin-top: 5rem; /* 5rem 約等於 80px，與 hero 區的 padding-top 匹配 */
}

/* 導航列 - 簡潔溫暖 */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    /* REPLACE: 增加左右邊距，讓行動版圖示不會太靠邊 */
    padding: 0rem 0rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none; /* 移除連結底線 */
    z-index: 1001; /* 確保 Logo 在行動選單之上 */
    gap: 0rem;
}

.logo-image {
    height: 3rem; /* 設定 Logo 高度，例如 40px */
    width: auto; /* 寬度自動縮放以保持比例 */
    margin-bottom: 15px; /* 您可以根據需要調整這個數值 */
    margin-top: 8px; /* 您可以根據需要調整這個數值 */
}

.site_logo_title {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 0rem;
    z-index: 1001; /* 確保 Logo 在行動選單之上 */
}

.nav-menu {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    align-items: center;
}

.nav-menu a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-menu a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--primary-gradient);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 2px;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-menu a:hover::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.theme-toggle {
    background: var(--soft-gray);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--morning-light);
    transform: scale(1.05);
}

.theme-toggle:focus {
    outline: none;
}
.theme-toggle:focus-visible {
    box-shadow: 0 0 10px 2px var(--primary-color);
}

/* 語言選擇器樣式 */
.language-selector-container {
    position: relative;
}

.language-selector {
    display: flex; /* 新增 */
    align-items: center; /* 新增 */
    gap: 0.5rem; /* 新增，控制圖示和箭頭的間距 */
    padding: 0.6rem 1rem; /* 微調 padding */
    background: var(--morning-light);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-size: 0.95rem;
    white-space: nowrap; /* 確保文字和圖示保持在同一行 */
}

.lang-icon {
    width: 1.35rem; /* 20px */
    height: 1.35rem; /* 20px */
}

.language-selector:hover {
    background: var(--primary-color);
    color: var(--pure-white);
    transform: translateY(-2px);
}

.language-dropdown {
    display: none; /* 預設隱藏 */
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--pure-white);
    border-radius: 8px;
    box-shadow: var(--soft-shadow);
    overflow: hidden;
    z-index: 1100;
    margin-top: 0.5rem;
    min-width: 150px;
}

.language-dropdown a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.language-dropdown a:hover {
    background-color: var(--soft-gray);
}

/* 漢堡選單按鈕 */
.hamburger-menu {
    display: none; /* 預設在桌面版隱藏 */
    width: 44px;
    height: 44px;
    background: transparent;
    z-index: 1001; /* 確保按鈕在選單之上 */
    position: relative;
    right: 1rem; /* 向左移動，增加與邊緣的距離 */
    outline: none; /* [核心修改] 移除瀏覽器預設的焦點輪廓線 */
    border: none; /* 確保沒有額外的邊框干擾 */
    background-color: transparent; /* 確保背景透明 */
    cursor: pointer;
}

.hamburger-menu:focus {
    /* [新增] 自訂焦點樣式：使用一個與主色調相近的淡色邊框 */
    border: 2px solid var(--primary-light); /* 使用您的主色調淡化版本 */
    border-radius: 5px; /* 可選：增加一點圓角 */
    outline: none; /* 再次確保沒有瀏覽器預設的外框 */
}

.hamburger-menu span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--text-primary);
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    border-radius: 2px;
}

/* 主視覺區 - 有機形狀背景 */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 80px;
    overflow: hidden;
}

/* 輪播幻燈片樣式 */
.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    z-index: 0;
}

/* 只有在 hero 元素有 transitions-active class 時，才啟用轉場動畫 */
.hero.transitions-active .hero-slide {
    transition: opacity 1.5s ease-in-out;
}

.hero-slide.active-slide {
    opacity: 1;
    z-index: 1;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    z-index: 2;
    position: relative;
    text-align: center;
}

.hero-subtitle {
    color: var(--pure-white);
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 1rem;
    opacity: 0.9;
    animation: fadeInDown 1s ease-out;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    color: var(--pure-white);
    margin-bottom: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
    animation: fadeInUp 1s ease-out 0.2s both;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.hero-description {
    font-size: 1.3rem;
    color: var(--pure-white);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.95;
    animation: fadeInUp 1s ease-out 0.4s both;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease-out 0.6s both;
}

.btn {
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none; /* 確保按鈕沒有預設邊框 */
}

.btn-primary {
    background: var(--pure-white);
    color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
    background: var(--morning-light);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: var(--pure-white);
    border: 2px solid var(--pure-white);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
}

/* 使命宣言區 */
.mission {
    padding: var(--space-xl) 0;
    background: var(--soft-gray);
    text-align: center;
}

.mission-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

.mission h2 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.mission-text {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* 關於我們區塊 */
.about-us {
    background: var(--soft-gray);
    padding: var(--space-xl) 0;
}

.about-us-content {
    background: var(--pure-white);
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 4rem;
    border-radius: 20px;
    box-shadow: var(--soft-shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.about-us-content p {
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.training-title {
    color: var(--text-primary);
    font-size: 1.3rem;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--divider-color);
}

/* =============================================================================
   摺疊式內文
   ============================================================================= */
.about-text-wrapper {
    position: relative;
}

.about-text-collapsible {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.about-text-wrapper.expanded .about-text-collapsible {
    max-height: 1000px;
}

.about-expand-btn {
    display: block;
    width: 100%;
    padding: 12px 20px;
    margin: 1rem 0 2rem;
    background: linear-gradient(135deg, var(--primary-color), #764ba2);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.about-expand-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.about-text-wrapper.expanded + .about-expand-btn {
    display: none;
}

/* =============================================================================
   訓練項目卡片（Mobile First）
   ============================================================================= */
.trainings-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.training-card {
    background: linear-gradient(
        135deg,
        rgba(102, 126, 234, 0.08),
        rgba(118, 75, 162, 0.08)
    );
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.training-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.training-card-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.training-card-content {
    flex: 1;
}

.training-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.training-card-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}

/* 平板以上：兩欄並排 */
@media (min-width: 768px) {
    .trainings-list {
        flex-direction: row;
        gap: 1.5rem;
    }

    .training-card {
        flex: 1;
        padding: 2rem;
    }

    .about-expand-btn {
        width: auto;
        padding: 12px 30px;
        margin: 1.5rem auto 2.5rem;
    }
}

/* =============================================================================
   深色模式支援
   ============================================================================= */
body.dark-theme .training-card {
    background: linear-gradient(
        135deg,
        rgba(102, 126, 234, 0.15),
        rgba(118, 75, 162, 0.15)
    );
    border-color: rgba(102, 126, 234, 0.25);
}

body.dark-theme .training-card:hover {
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.25);
}

body.dark-theme .about-expand-btn {
    background: linear-gradient(135deg, #8b9cef, #a78bfa);
}

.about-us-cta {
    font-size: 1.05rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--divider-color);
    margin-top: 1.5rem;
    margin-bottom: 0 !important; /* 確保沒有多餘的底部間距 */
}

/* 核心價值卡片 */
.values {
    padding: var(--space-xl) 0;
    background: var(--pure-white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-sm);
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.section-title {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.value-card {
    background: var(--pure-white);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--soft-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    position: relative;
    overflow: hidden;
}

.value-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    transform-origin: left;
}

.value-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.value-card:hover::before {
    transform: scaleX(1);
}

.value-icon {
    width: 70px;
    height: 70px;
    margin-bottom: 1.5rem;
    background: var(--primary-gradient);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.value-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.value-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* 活動區塊 */
.events {
    padding: var(--space-xl) 0;
    background: var(--soft-gray);
}

.event-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.event-card {
    background: var(--pure-white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--soft-shadow);
    transition: all 0.3s ease;
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.event-image {
    height: 200px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pure-white);
    font-size: 3rem;
}

.event-content {
    padding: 2rem;
}

.event-date {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.event-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.event-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.event-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s ease;
}

.event-link:hover {
    gap: 1rem;
}

/* 健康祝禱站 - 新增 */
.healing-centers {
    padding: var(--space-xl) 0;
    background: var(--pure-white);
}

.centers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.center-card {
    background: var(--soft-gray);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--soft-shadow);
    transition: all 0.3s ease;
}

.center-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.center-map {
    height: 200px;
    background: linear-gradient(
        135deg,
        var(--primary-color),
        var(--accent-color)
    );
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pure-white);
    font-size: 3rem;
    position: relative;
}

.center-info {
    padding: 2rem;
}

.center-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.center-leader {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.leader-avatar {
    width: 50px;
    height: 50px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pure-white);
}

.leader-info h4 {
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.leader-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.center-contact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.center-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

.center-actions a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.center-actions a:hover {
    color: var(--secondary-color);
}

/* 協力教會 - 新增 */
.partner-churches {
    padding: var(--space-xl) 0;
    background: var(--soft-gray);
}

.partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.partner-card {
    background: var(--pure-white);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--soft-shadow);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.partner-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
    border-color: var(--primary-color);
}

.partner-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: var(--soft-gray);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.partner-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.partner-location {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.partner-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.partner-link:hover {
    text-decoration: underline;
}

/* 見證分享 - 修改為影片展示 */
.testimonials {
    padding: var(--space-xl) 0;
    background: var(--pure-white);
}

.testimonial-videos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.video-testimonial {
    background: var(--soft-gray);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--soft-shadow);
    transition: all 0.3s ease;
}

.video-testimonial:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    background: var(--text-primary);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-info {
    padding: 1.5rem;
}

.video-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.video-author {
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 特色見證 - 大型影片展示 */
.featured-testimonial {
    max-width: 800px;
    margin: 0 auto 3rem;
    background: var(--soft-gray);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.featured-testimonial .video-wrapper {
    padding-bottom: 56.25%;
}

.featured-testimonial .video-info {
    padding: 2rem;
    text-align: center;
}

.featured-testimonial .video-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.video-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-top: 1rem;
}

/* 行動呼籲 */
.cta-section {
    padding: var(--space-xl) 0;
    background: var(--primary-gradient);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-content {
    position: relative;
    z-index: 1;
}

.cta-section h2 {
    color: var(--pure-white);
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-section p {
    color: var(--pure-white);
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

/* 頁尾 */
footer {
    background: var(--text-primary);
    color: var(--pure-white);
    padding: var(--space-lg) 0 var(--space-md);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: var(--morning-light);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--pure-white);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-section a:hover {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.7;
}

/* 響應式設計 (Mobile-First) */
/* 平板與手機 (992px 以下) */
@media (max-width: 992px) {
    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%; /* 預設隱藏在左邊 */
        width: 100%;
        height: 100vh;
        background-color: var(--pure-white);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transition: left 0.3s ease-in-out;
        z-index: 999;
    }

    .nav-menu a {
        font-size: 1.5rem; /* 放大行動版選單字體 */
    }

    body.mobile-menu-open .nav-menu {
        left: 0; /* 選單滑入 */
    }

    .hamburger-menu {
        display: block; /* 在行動版顯示漢堡按鈕 */
    }

    /* [新增] 當 .nav-actions 被 JS 移入行動選單後的樣式 */
    .nav-menu .nav-actions {
        order: -1; /* [核心修改] 使用 flexbox order 將其排序至所有項目的最頂部 */
        margin-top: 2rem; /* 與下方的導覽連結拉開垂直距離 */
        margin-bottom: -1rem; /* 與下方的導覽連結拉開垂直距離 */

        /* [視覺樣式保留] */
        padding: 0.5rem;
        background: var(--soft-gray);
        border-radius: 50px;
    }

    body.mobile-menu-open .hamburger-menu span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    body.mobile-menu-open .hamburger-menu span:nth-child(2) {
        opacity: 0;
    }
    body.mobile-menu-open .hamburger-menu span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}

/* 手機 (768px 以下) */
@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }

    .mission h2 {
        font-size: 2rem;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero-description {
        font-size: 1.1rem;
    }

    .cta-buttons {
        flex-direction: column;
        width: 100%;
        padding: 0 1rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
        padding: 0.9rem 2rem;
    }

    .values-grid,
    .event-cards,
    .centers-grid,
    .testimonial-videos {
        grid-template-columns: 1fr;
    }

    .partners-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .footer-content {
        text-align: center;
    }

    /* 關於我們區塊 - 手機版留白優化 */
    .about-us-content {
        padding: 1.5rem 1.25rem;
        border-radius: 12px;
    }

    .training-card {
        padding: 1.25rem;
        border-radius: 12px;
    }

    .training-card-icon {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .training-card-title {
        font-size: 1rem;
    }

    .training-card-desc {
        font-size: 0.9rem;
    }

    .training-title {
        font-size: 1.1rem;
        margin-top: 1.5rem;
        margin-bottom: 1rem;
    }

    .about-expand-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
        margin: 0.75rem 0 1.5rem;
    }
}

/* 見證卡片手機版優化 */
@media (max-width: 768px) {
    .text-testimonials-container {
        /* 在手機上強制使用單欄佈局，讓卡片填滿可用空間 */
        grid-template-columns: 1fr;
    }
}

.text-testimonials-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: var(--space-lg); /* 新增上間距以取代舊標題的間距 */
}

.text-testimony-card {
    background: var(--soft-gray);
    padding: 2rem;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.text-testimony-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
    border-color: var(--primary-color);
}

.text-testimony-card h4 {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.text-testimony-card p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.section-divider {
    border: none;
    height: 2px;
    background-color: var(--divider-color); /* 使用一個柔和的顏色 */
    width: 60px; /* 設定長度，不要太長 */
    margin: var(--space-lg) auto; /* 上下間距和水平居中 */
    opacity: 0.7; /* 增加一點透明度 */
}

/* 回到頂部按鈕樣式 */
.back-to-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--pure-white);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--soft-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s ease-out;
    z-index: 990;
}

.back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top-btn:hover {
    background-color: var(--secondary-color);
    box-shadow: var(--hover-shadow);
}

/* 燈箱(Lightbox)樣式 */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(44, 62, 80, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-container {
    background-color: var(--pure-white);
    width: 90%;
    max-width: 800px;
    height: 85vh;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    padding: 2.5rem;
    position: relative;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s ease-out;
}

.lightbox-overlay.active .lightbox-container {
    transform: scale(1);
}

.lightbox-close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    font-size: 2.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.lightbox-header {
    margin-bottom: 1rem;
    padding-right: 2rem; /* 避免標題與關閉按鈕重疊 */
}

.lightbox-title {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.lightbox-author {
    font-size: 1rem;
    color: var(--text-secondary);
}

.lightbox-controls {
    margin-bottom: 1.5rem;
}

.lightbox-lang-switcher button {
    background: var(--soft-gray);
    border: 1px solid #ddd;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    margin-right: 0.5rem;
    transition: all 0.2s;
}

.lightbox-lang-switcher button.active {
    background: var(--primary-color);
    color: var(--pure-white);
    border-color: var(--primary-color);
}

.lightbox-story-content {
    flex-grow: 1;
    overflow-y: auto; /* 核心：讓見證內容可以滾動 */
    padding-right: 1rem; /* 美化滾動條 */
}

.lightbox-story {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    white-space: pre-wrap; /* 保留換行符 */
}

/* --- Mobile Optimization: Lightbox Max View --- */
@media (max-width: 768px) {
    .lightbox-container {
        width: 95% !important; /* 卡片寬度撐開至 95% */
        height: 90vh !important; /* 卡片高度撐開至 90% */
        max-height: 90vh !important; /* 強制最大高度限制 */
        padding: 1.25rem !important; /* 大幅縮減內邊距 (原 2.5rem -> 1.25rem) */
        border-radius: 16px !important;
    }

    .lightbox-header {
        margin-bottom: 0.5rem !important; /* 縮減標題區塊下方留白 */
        padding-right: 2.5rem !important; /* 右側留出空間給關閉按鈕，避免重疊 */
    }

    .lightbox-title {
        font-size: 1.6rem !important; /* 稍微縮小標題字級 */
        margin-bottom: 0.25rem !important;
        line-height: 1.2 !important;
    }

    .lightbox-author {
        font-size: 0.95rem !important;
        margin-bottom: 0.5rem !important;
    }

    .lightbox-controls {
        margin-bottom: 0.75rem !important; /* 縮減控制列下方留白 */
    }

    /* 關鍵：強制內容區域佔滿剩餘高度 */
    .lightbox-story-content {
        flex-grow: 1 !important;
        height: auto !important;
        padding-right: 5px !important; /* 微調滾動條間距 */
    }

    .lightbox-story {
        font-size: 1.05rem !important; /* 行動版最適閱讀字級 */
        line-height: 1.6 !important;
    }

    /* 調整關閉按鈕位置 */
    .lightbox-close-btn {
        top: 0.75rem !important;
        right: 0.75rem !important;
        font-size: 2rem !important;
        padding: 5px !important;
    }
}

/* 無障礙設計 */
:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* 列印樣式 */
@media print {
    nav,
    .cta-section,
    footer {
        display: none;
    }
}

/* =====================================================
   Playlist 外連卡片樣式
   ===================================================== */
.playlist-card {
    background: var(--soft-gray);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--soft-shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: block;
    color: inherit;
}

.playlist-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

/* 堆疊縮圖容器 */
.playlist-thumbnail-stack {
    --stack-padding: 1.5rem;
    --stack-offset: 1.6rem;

    position: relative;
    width: 100%;
    padding: var(--stack-padding);
    padding-bottom: calc(56.25% + var(--stack-padding)); /* 16:9 + 上下留白 */
    background: var(--text-primary);
    overflow: hidden;
    box-sizing: border-box;
}

/* 堆疊縮圖 - 共用樣式 */
.playlist-thumbnail-stack img {
    position: absolute;
    width: calc(100% - var(--stack-padding) * 4);
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease;
    left: 50%;
    top: 50%;
}

/* 堆疊縮圖 - 第 3 張（最底層） */
.playlist-thumbnail-stack img:nth-child(1) {
    transform: translate(-50%, -50%)
        translate(
            calc(var(--stack-offset) * -2),
            calc(var(--stack-offset) * -2)
        );
    z-index: 1;
}

/* 堆疊縮圖 - 第 2 張（中層） */
.playlist-thumbnail-stack img:nth-child(2) {
    transform: translate(-50%, -50%)
        translate(
            calc(var(--stack-offset) * -1),
            calc(var(--stack-offset) * -1)
        );
    z-index: 2;
}

/* 堆疊縮圖 - 第 1 張（最上層） */
.playlist-thumbnail-stack img:nth-child(3) {
    transform: translate(-50%, -50%);
    z-index: 3;
}

/* Hover 時展開堆疊 */
.playlist-card:hover .playlist-thumbnail-stack img:nth-child(1) {
    transform: translate(-50%, -50%)
        translate(
            calc(var(--stack-offset) * -3),
            calc(var(--stack-offset) * -3)
        );
}
.playlist-card:hover .playlist-thumbnail-stack img:nth-child(2) {
    transform: translate(-50%, -50%)
        translate(
            calc(var(--stack-offset) * -1.5),
            calc(var(--stack-offset) * -1.5)
        );
}
.playlist-card:hover .playlist-thumbnail-stack img:nth-child(3) {
    transform: translate(-50%, -50%);
}

/* Playlist Badge */
.playlist-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
}

.playlist-badge svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* 卡片資訊區 */
.playlist-info {
    padding: 1.5rem;
}

.playlist-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.playlist-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.playlist-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.playlist-cta svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.playlist-card:hover .playlist-cta svg {
    transform: translateX(4px);
}

/* 響應式 */
@media (max-width: 768px) {
    .playlist-thumbnail-stack img {
        width: 80%;
    }

    .playlist-info {
        padding: 1.25rem;
    }

    .playlist-title {
        font-size: 1.1rem;
    }
}

/* =====================================================
   Playlist 卡片 - Dark Mode
   ===================================================== */
body.dark-theme .playlist-card {
    background: var(--dark-surface-light);
}

body.dark-theme .playlist-thumbnail-stack {
    background: var(--dark-bg);
}

body.dark-theme .playlist-thumbnail-stack img {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

body.dark-theme .playlist-badge {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}
