/* =========================================
           視覺變數
           ========================================= */
        :root {
            --ng-green: #068f3f;
            --ng-orange: #ff9434;
            --bg-body: #ffffff;
            --bg-gray: #f7f9fa;
            --text-main: #333333;
            --text-muted: #666666;
            --border-color: #e5e7eb;
        }

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

        /* 視覺隱藏但保留於無障礙樹/搜尋引擎可讀取的內容 (例如各分頁的 h2 標題)。 */
        .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
        body { font-family: 'PingFang HK', 'Microsoft JhengHei', sans-serif !important; background-color: var(--bg-body); color: var(--text-main); line-height: 1.6; -webkit-font-smoothing: antialiased; }
        a { text-decoration: none; color: inherit; transition: 0.2s; }

        /* =========================================
           頂部導航列
           ========================================= */
        .mk-header { background-color: #ffffff; border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 100; padding: 12px 0; box-shadow: 0 2px 10px rgba(0,0,0,0.03); }
        .header-inner { max-width: 1140px; margin: 0 auto; padding: 0 15px; display: flex; justify-content: space-between; align-items: center; }
        .header-logo img { max-width: 220px; height: auto; display: block; }
        .back-home-btn { color: var(--ng-green); font-weight: bold; font-size: 14px; }

        /* =========================================
           主容器與 4 分頁 Tabs
           ========================================= */
        .main-container { max-width: 1140px; margin: 30px auto; padding: 0 15px; min-height: 70vh; }
        .page-title { font-size: 20px; color: var(--ng-green); font-weight: bold; letter-spacing: 1px; margin-bottom: 20px; border-left: 5px solid var(--ng-green); padding-left: 12px; }
        
        .tab-nav { display: flex; background-color: var(--bg-gray); border: 1px solid var(--border-color); border-bottom: none; border-radius: 8px 8px 0 0; overflow-x: auto; flex-wrap: nowrap; }
        .tab-nav::-webkit-scrollbar { display: none; }
        .tab-btn { flex: 1 1 auto; text-align: center; padding: 14px 10px; font-size: 15px; font-weight: bold; color: var(--text-muted); background: transparent; border: none; border-right: 1px solid var(--border-color); cursor: pointer; white-space: nowrap; transition: 0.2s; }
        .tab-btn:last-child { border-right: none; }
        .tab-btn:hover { color: var(--ng-green); }
        .tab-btn.active { background-color: #ffffff; color: var(--ng-green); border-top: 3px solid var(--ng-green); }

        .tab-content-area { border: 1px solid var(--border-color); border-top: none; padding: 20px 15px; background: #ffffff; border-radius: 0 0 8px 8px; }
        .tab-pane { display: none; animation: fadeIn 0.3s; }
        .tab-pane.active { display: block; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

        /* 次級篩選標籤 */
        .sub-filters { display: flex; gap: 10px; margin-bottom: 25px; overflow-x: auto; padding-bottom: 5px; }
        .sub-filters::-webkit-scrollbar { display: none; }
        .filter-btn { padding: 6px 18px; border: 1px solid var(--ng-green); border-radius: 50px; background-color: #ffffff; color: var(--ng-green); font-size: 13px; font-weight: bold; cursor: pointer; white-space: nowrap; transition: 0.2s; }
        .filter-btn:hover, .filter-btn.active { background-color: var(--ng-green); color: #ffffff; }

        /* =========================================
           區塊 1: 新聞列表
           ========================================= */
        .news-list { display: flex; flex-direction: column; }
        .news-item { padding: 15px 0; border-bottom: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 8px; }
        .news-item:last-child { border-bottom: none; }
        .news-meta { display: flex; align-items: center; gap: 10px; }
        .news-tag { background-color: var(--ng-green); color: #ffffff; font-size: 12px; padding: 3px 8px; border-radius: 3px; flex-shrink: 0; }
        .news-tag.media-report { background-color: var(--ng-orange); }
        .news-date { color: var(--text-muted); font-size: 13px; }
        .news-title { font-size: 15px; color: var(--text-main); font-weight: bold; line-height: 1.4; }
        .news-title:hover { color: var(--ng-orange); }
        .news-summary { font-size: 13px; color: var(--text-muted); line-height: 1.6; text-align: justify; }
        .news-content { display: flex; flex-direction: column; gap: 6px; }
        .news-loading { color: var(--text-muted); font-size: 14px; text-align: center; padding: 20px 0; }
        
        /* =========================================
           區塊 2: 機構刊物
           ========================================= */
        .doc-list { display: flex; flex-direction: column; gap: 15px; }
        .doc-item { display: flex; flex-direction: column; border: 1px solid var(--border-color); background-color: var(--bg-gray); padding: 20px; border-radius: 6px; transition: 0.3s; }
        .doc-item:hover { background-color: #ffffff; border-color: var(--ng-green); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
        .doc-cover { width: 160px; height: 220px; object-fit: contain; align-self: center; flex-shrink: 0; margin-bottom: 16px; }
        .doc-cover[hidden] { display: none; }
        .doc-content { min-width: 0; overflow-wrap: anywhere; }
        .doc-unavailable { font-size: 13px; color: var(--text-muted); }
        .doc-action .btn-outline-orange { min-height: 44px; box-sizing: border-box; display: inline-flex; align-items: center; }
        .doc-action a:focus-visible { outline: 3px solid var(--ng-green); outline-offset: 3px; }
        .doc-header { margin-bottom: 12px; }
        .doc-category { font-size: 12px; font-weight: bold; color: var(--ng-orange); margin-bottom: 5px; }
        .doc-title { font-size: 17px; font-weight: bold; color: var(--ng-green); }
        .doc-summary { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 15px; text-align: justify; }
        .btn-outline-orange { display: inline-block; border: 1px solid var(--ng-orange); color: var(--ng-orange); border-radius: 50px; padding: 8px 24px; font-size: 13px; font-weight: bold; text-align: center; }
        .btn-outline-orange:hover { background-color: var(--ng-orange); color: #ffffff; }

        /* =========================================
           區塊 3: 社交媒體 
           ========================================= */
        
        /* 🌟 App 專屬大型下載按鈕 */
        .app-banner {
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: linear-gradient(135deg, var(--ng-green) 0%, #046a2e 100%);
            color: #ffffff;
            padding: 20px 25px;
            border-radius: 8px;
            margin-bottom: 35px;
            text-decoration: none;
            transition: 0.3s;
            box-shadow: 0 4px 15px rgba(6, 143, 63, 0.2);
        }
        .app-banner:hover {
            transform: translateY(-3px);
            box-shadow: 0 6px 20px rgba(6, 143, 63, 0.3);
            color: #ffffff;
        }
        .app-banner-content { display: flex; align-items: center; }
        .app-banner-icon { font-size: 36px; margin-right: 20px; }
        .app-banner-text-main { font-size: 18px; font-weight: bold; margin-bottom: 4px; letter-spacing: 1px; }
        .app-banner-text-sub { font-size: 14px; opacity: 0.9; }
        .app-banner-action {
            background-color: #ffffff;
            color: var(--ng-green);
            padding: 10px 24px;
            border-radius: 50px;
            font-size: 14px;
            font-weight: bold;
            flex-shrink: 0;
            margin-left: 15px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }

        .social-org-section { margin-bottom: 35px; }
        .org-header { display: flex; align-items: center; margin-bottom: 15px; border-bottom: 2px solid var(--border-color); padding-bottom: 10px; }
        .org-title { font-size: 16px; color: var(--text-main); font-weight: bold; border-left: 4px solid var(--ng-green); padding-left: 10px; }
        
        .social-clean-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
        .clean-btn { display: flex; align-items: center; background-color: #ffffff; border: 1px solid var(--border-color); padding: 12px; border-radius: 6px; font-size: 13px; font-weight: bold; color: var(--text-main); transition: 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.02); }
        .clean-btn:hover { border-color: var(--ng-green); box-shadow: 0 4px 8px rgba(0,0,0,0.05); transform: translateY(-1px); }
        
        .brand-icon { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #ffffff; font-size: 12px; font-weight: bold; margin-right: 10px; flex-shrink: 0; }
        .icon-fb { background-color: #1877F2; }
        .icon-ig { background: linear-gradient(45deg, #f09433, #dc2743, #bc1888); }
        .icon-wechat { background-color: #07C160; }
        .icon-douyin { background-color: #1c1c1c; }
        .icon-xhs { background-color: #ff2442; }
        .icon-yt { background-color: #FF0000; }
        .icon-wa { background-color: #25D366; }
        .icon-wa-channel { background: linear-gradient(135deg, #25D366, #128C7E); }

        .club-grid { display: grid; grid-template-columns: 1fr; gap: 15px; }
        .club-card { display: flex; align-items: flex-start; background: #ffffff; border: 1px solid var(--border-color); border-radius: 8px; padding: 18px; transition: 0.3s; }
        .club-card:hover { border-color: var(--ng-green); box-shadow: 0 4px 15px rgba(0,0,0,0.06); }
        .club-logo { width: 65px; height: 65px; object-fit: contain; margin-right: 15px; flex-shrink: 0; border-radius: 6px; background-color: #ffffff; }
        .club-info { flex: 1; min-width: 0; overflow-wrap: anywhere; }
        .club-name { font-size: 15px; font-weight: bold; color: var(--ng-green); margin-bottom: 6px; }
        .club-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
        .club-actions { display: flex; align-items: center; gap: 10px; }
        .club-link-btn { display: inline-block; padding: 4px 14px; font-size: 12px; font-weight: bold; color: var(--ng-orange); border: 1px solid var(--ng-orange); border-radius: 50px; transition: 0.2s; }
        .club-link-btn:hover { background: var(--ng-orange); color: #ffffff; }
        .club-ig-btn { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: linear-gradient(45deg, #f09433, #dc2743, #bc1888); color: #ffffff; border-radius: 50%; font-size: 11px; font-weight: bold; }

        /* =========================================
           屬會 IG 帖文嵌入
           ========================================= */
        /* 含 IG 帖文的卡片改為縱向排列：上方為 logo+資訊列，下方為 IG 嵌入區塊 */
        .club-card.has-ig-embed { flex-direction: column; min-width: 0; }
        /* 還原卡片頂部的 logo + 資訊橫向排列 */
        .club-card.has-ig-embed .club-card-row { display: flex; align-items: flex-start; width: 100%; }
        /* IG 嵌入容器：佔滿整張卡片寬度，覆寫 Instagram embed.js 的預設最小寬度 */
        .club-ig-post { position: relative; margin-top: 15px; width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; }
        .club-ig-post iframe, .club-ig-post .instagram-media { position: relative !important; max-width: 100% !important; min-width: 0 !important; width: 100% !important; margin: 0 !important; }

        /* =========================================
           區塊 4: 回顧影片
           ========================================= */
        /* 手機優先：封面、日期、標題及觀看入口直向排列；
           桌面版於下方 @media (min-width: 768px) 改為橫向排列。 */
        .album-list { display: flex; flex-direction: column; gap: 15px; }
        .album-item { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; border: 1px solid var(--border-color); background-color: #ffffff; padding: 15px; border-radius: 6px; transition: 0.2s; }
        .album-item:hover { border-color: var(--ng-green); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
        .album-cover { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 4px; background: var(--bg-gray); color: var(--ng-green); flex-shrink: 0; }
        .album-cover-placeholder { position: absolute; inset: 0; display: grid; place-items: center; font-weight: bold; }
        .album-cover img { position: relative; display: block; width: 100%; height: 100%; object-fit: cover; }
        .album-cover img[hidden] { display: none; }
        .album-play { position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #046a2e; color: #fff; font-size: 16px; }
        .album-content { display: flex; flex-direction: column; gap: 10px; min-width: 0; width: 100%; overflow-wrap: anywhere; }
        .album-cover:focus-visible, .album-btn:focus-visible { outline: 3px solid var(--ng-green); outline-offset: 3px; }
        .album-date { font-size: 13px; color: var(--text-muted); font-weight: bold; }
        .album-title { font-size: 15px; font-weight: bold; color: var(--text-main); line-height: 1.5; }
        .album-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; box-sizing: border-box; padding: 6px 16px; background-color: var(--bg-gray); color: var(--ng-green); border: 1px solid var(--border-color); border-radius: 4px; font-size: 13px; font-weight: bold; align-self: flex-start; text-align: center; transition: 0.2s; }
        .album-item:hover .album-btn { background-color: var(--ng-green); color: #ffffff; border-color: var(--ng-green); }

        /* =========================================
           企業級頁腳 (Corporate Footer)
           ========================================= */
        .corporate-footer { background-color: #f8f9fa; border-top: 4px solid var(--ng-green); padding: 50px 20px 0; color: var(--text-main); font-size: 14px; margin-top: 60px; }
        .footer-container { max-width: 1140px; margin: 0 auto; display: grid; grid-template-columns: 1fr; gap: 40px; padding-bottom: 40px; }
        .footer-col-title { font-size: 16px; font-weight: bold; color: var(--ng-green); margin-bottom: 20px; letter-spacing: 1px; }
        
        .footer-list { list-style: none; padding: 0; margin: 0; }
        .footer-list li { margin-bottom: 12px; color: var(--text-muted); display: flex; align-items: flex-start; line-height: 1.5; }
        .footer-links li a { color: var(--text-muted); transition: color 0.2s; }
        .footer-links li a:hover { color: var(--ng-orange); text-decoration: underline; }
        
        .footer-brand-desc { color: var(--text-muted); line-height: 1.6; margin-bottom: 15px; text-align: justify; }
        .footer-charity-badge { display: inline-block; background-color: var(--border-color); color: var(--text-muted); font-size: 12px; padding: 4px 10px; border-radius: 4px; font-weight: bold; }
        .footer-bottom-bar { background-color: #e5e7eb; padding: 20px; text-align: center; color: var(--text-muted); font-size: 12px; margin: 0 -20px; }

        /* =========================================
           響應式佈局 (Mobile & Desktop)
           ========================================= */
        @media (max-width: 480px) {
            /* 手機版 App Banner 直向排列 */
            .app-banner { flex-direction: column; text-align: center; padding: 20px; }
            .app-banner-content { flex-direction: column; margin-bottom: 15px; }
            .app-banner-icon { margin-right: 0; margin-bottom: 10px; font-size: 45px; }
            .app-banner-action { margin-left: 0; width: 100%; }
        }

        @media (min-width: 768px) {
            .header-inner { padding: 0 20px; }
            .header-logo img { max-width: 280px; }
            .tab-btn { font-size: 16px; padding: 16px 20px; flex: 1; }
            .tab-content-area { padding: 40px; }
            
            .news-item { flex-direction: row; align-items: flex-start; gap: 20px; padding: 20px 0; }
            .news-meta { width: 180px; flex-shrink: 0; padding-top: 2px; }
            .news-content { flex: 1; }
            .news-title { font-size: 16px; }
            
            .doc-item { flex-direction: row; align-items: flex-start; justify-content: space-between; padding: 25px; }
            .doc-content { flex: 1; padding-right: 16px; }
            .doc-cover { align-self: flex-start; margin: 0 24px 0 0; }
            .doc-action { width: 120px; flex-shrink: 0; text-align: right; margin-top: 25px; }
            
            .social-clean-grid { grid-template-columns: repeat(4, 1fr); gap: 15px; }
            .clean-btn { font-size: 14px; padding: 15px; }
            .club-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
            
            .album-item { flex-direction: row; align-items: center; gap: 24px; padding: 20px; }
            .album-cover { width: 240px; }
            .album-date { font-size: 14px; }
            .album-title { font-size: 16px; }
            .album-btn { flex-shrink: 0; }

            .footer-container { grid-template-columns: 2fr 1.5fr 1fr; gap: 60px; }
        }
/* 首頁及內容頁共用導覽、閱讀層級及鍵盤焦點。 */
:root { --ng-action: #046a2e; }
.tab-nav { border-radius: 0; border: 0; border-bottom: 1px solid var(--border-color); background: white; gap: 24px; scrollbar-width: thin; }
.tab-btn { flex: 0 0 auto; border: 0; border-bottom: 3px solid transparent; padding: 14px 4px; min-height: 48px; }
.tab-btn.active, .tab-btn[aria-current=page] { border-top: 0; border-bottom-color: var(--ng-green); background: transparent; color: var(--ng-action); }
.tab-content-area { border: 0; border-radius: 0; padding: 28px 0; }
.content-title { font-size: clamp(24px, 3vw, 32px); line-height: 1.4; color: var(--ng-action); margin-bottom: 16px; text-wrap: balance; }
.page-intro { max-width: 65ch; color: var(--text-muted); margin-bottom: 32px; }
.breadcrumb { display:flex; flex-wrap:wrap; gap:8px; color:var(--text-muted); font-size:13px; margin-bottom:20px; }
.breadcrumb a { text-decoration:underline; text-underline-offset:4px; }
.reading-link { display:inline-flex; align-items:center; min-height:44px; color:var(--ng-action); font-weight:600; text-decoration:underline; text-underline-offset:5px; }
.reading-link:hover { text-decoration-thickness:2px; }
.site-heading { font-size:17px; line-height:1.6; }
.site-heading a:hover { color:var(--ng-action); text-decoration:underline; }
.pagination { display:flex; flex-wrap:wrap; gap:4px; margin:32px 0; padding-top:20px; border-top:1px solid var(--border-color); }
.pagination a { display:inline-flex; align-items:center; justify-content:center; min-width:44px; min-height:44px; border-bottom:2px solid transparent; color:var(--text-muted); }
.pagination [aria-current=page] { border-bottom-color:var(--ng-green); color:var(--ng-action); font-weight:700; }
.editorial,.topic-card { margin:32px 0; padding:24px 0; border-top:1px solid var(--border-color); }
.editorial h2,.topic-card h2 { font-size:21px; margin-bottom:12px; color:var(--ng-action); }
.editorial p,.topic-card p { max-width:65ch; margin:12px 0; }
.contents { white-space:pre-line; line-height:1.9; margin:16px 0; }
.publication-detail { display:grid; grid-template-columns:minmax(180px,280px) minmax(0,1fr); gap:48px; align-items:start; padding:8px 0 32px; }
.publication-cover { width:100%; height:auto; display:block; }
.publication-detail h2 { font-size:20px; color:var(--ng-action); }
.return-link { border-top:1px solid var(--border-color); padding-top:20px; }
.return-link a { display:inline-flex; min-height:44px; align-items:center; color:var(--ng-action); text-decoration:underline; text-underline-offset:4px; }
.video-player { aspect-ratio:16/9; background:#111; }
.video-player iframe { width:100%; height:100%; border:0; }
.site-footer { text-align:center; padding:32px 16px; border-top:1px solid var(--border-color); color:var(--text-muted); font-size:13px; }
.skip-link { position:absolute; left:-10000px; }
.skip-link:focus { left:12px; top:12px; z-index:200; background:white; padding:12px; }
a:focus-visible,button:focus-visible { outline:3px solid #8b4500; outline-offset:3px; }
.doc-content,.album-content,.news-content { min-width:0; }
p,h1,h2,a { overflow-wrap:anywhere; }
.news-image { max-width:100%; height:auto; max-height:320px; object-fit:contain; }
.tab-content-area > .album-item,.tab-content-area > .doc-item { margin-bottom:16px; }
@media(max-width:600px) {
 .tab-nav { gap:18px; }
 .tab-btn { font-size:14px; }
 .tab-content-area { padding:24px 0; }
 .publication-detail { grid-template-columns:1fr; gap:24px; }
 .publication-cover { width:min(65%,220px); margin:0 auto; }
 .header-logo img { max-width:180px; }
 .breadcrumb { font-size:12px; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; transition:none!important; } }

@media(min-width:768px) { .news-meta { flex-direction:column; align-items:flex-start; gap:6px; } }
.news-date { white-space:nowrap; }

/* 刊物目錄逐項編號；簡介保留完整段落。 */
.publication-contents { padding-left:1.7em; margin:12px 0; text-align:left; }
.publication-contents li { padding-left:4px; margin:5px 0; line-height:1.7; }
.publication-intro p { margin:0 0 12px; line-height:1.8; text-align:left; }
.doc-summary { -webkit-line-clamp:unset; display:block; }
.topic-source { margin-bottom:24px; }

/* 搜尋保持與閱讀列表同一視覺層級。 */
.site-search { display:grid; grid-template-columns:2fr 1fr 1fr 1.4fr; gap:12px; padding:20px 0; border-top:1px solid var(--border-color); border-bottom:1px solid var(--border-color); }
.site-search label { display:flex; flex-direction:column; gap:6px; font-size:14px; min-width:0; }
.site-search input,.site-search select { width:100%; min-height:44px; padding:8px; font:inherit; border:1px solid #87998e; border-radius:4px; background:white; color:var(--text-main); }
.search-actions { display:flex; gap:12px; grid-column:1/-1; }
.search-actions button,.search-pagination button { min-height:44px; padding:8px 20px; border:1px solid var(--ng-action); border-radius:4px; background:white; color:var(--ng-action); font:inherit; cursor:pointer; }
.search-actions button[type=submit] { background:var(--ng-action); color:white; }
#search-status { margin:16px 0; color:var(--text-muted); font-size:14px; }
.search-pagination { display:flex; gap:12px; margin:24px 0; }
.contents-more summary { cursor:pointer; color:var(--ng-action); min-height:44px; padding:10px 0; }
@media(max-width:600px){.site-search{grid-template-columns:1fr 1fr}.site-search label:first-child{grid-column:1/-1}.site-search label:last-of-type{grid-column:1/-1}}

#collection-results > .doc-item,#collection-results > .album-item { margin-bottom:16px; }
[hidden] { display:none!important; }

#collection-results { scroll-margin-top:130px; }
