/*
Theme Name: 亞洲人類圖學院
Theme URI: humandesignasia.org, humandesign.org.cn
Author: John Tam
Description: 以亮橙色為主調，Bootstrap 5 架構的清新活力主題
Version: 1.8
Text Domain: asian-hd-academy
Last Modified: 2026/01/04
*/

/* #region 全站優化 (保留您原有的優化設定) */
body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
    font-size: 17px; 
    line-height: 1.75;
    color: #333333;
    letter-spacing: 0.04em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #fff;
    text-underline-position: under;
    padding-top: var(--header-height);
}

@media (min-width: 992px) {
    body {
        font-size: 18px; 
    }
}

a { 
    text-decoration: none; 
    transition: all 0.3s ease; 
}

/* WP Admin Bar Fix */
body.admin-bar .sticky-top,
body.admin-bar .fixed-top {
    top: 32px !important;
}

@media screen and (max-width: 782px) {
    body.admin-bar .sticky-top,
    body.admin-bar .fixed-top {
        top: 46px !important;
    }
}

.rank-math-breadcrumb, .rank-math-breadcrumb a {
    color: #fff;
}
/* #endregion 全站優化 */

/* #region 首頁選單 */
/* 1. 預設樣式：適用於手機 (sm) 與 平板 (md) */
.site-logo {
    height: 60px;       /* 設定高度為 60px */
    width: auto;        /* 寬度自動，保持圖片比例 */
    transition: height 0.3s ease; /* (選用) 加入這行會讓變大變小時有滑順動畫 */
}

/* 2. 電腦版樣式：當螢幕寬度大於 992px (Bootstrap 的 lg 斷點) 時 */
@media (min-width: 992px) {
    .site-logo {
        height: 80px;   /* 在大螢幕改回 80px */
    }
}
.nav-item a:hover { 
    text-decoration: underline; 
    color: var(--bs-primary);
    transition: all 0.3s ease; 
}
.nav-item .btn-outline-primary:hover {
    text-decoration: none; 
    color: #fff
}
/* 1. Modal Slide-Up Effect (由下往上滑入動畫) */
/* 覆蓋 Bootstrap 預設的 Fade/Slide Down */
.modal-slide-up .modal-dialog {
    transform: translate(0, 100%); /* 初始位置：螢幕下方 */
    transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1); /* iOS 風格緩動曲線 */
}

/* 當 Modal 顯示時 */
.modal-slide-up.show .modal-dialog {
    transform: translate(0, 0); /* 滑入原位 */
}

/* 確保背景可以滾動但選單置頂 */
.mobile-menu-body {
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa; /* 稍微帶點灰，區分層次 */
    min-height: 100%;
}

/* 2. Menu Card (外層卡片) */
.menu-card {
    background-color: #fff;
    border: 0; 
    border-radius: 16px; /* 更圓潤 */
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03); /* 極輕微陰影 */
    height: 100%;
}

/* 點擊時的縮放效果 (Touch Feedback) */
.menu-card:active {
    transform: scale(0.97);
}

/* 3. Menu Button (觸發按鈕) */
.menu-btn {
    width: 100%;
    border: none;
    background: transparent;
    padding: 1.5rem 1rem;
    color: var(--bs-dark);
    line-height: 1.4;
    min-height: 130px; /* 增加高度，讓視覺更寬鬆 */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    font-weight: 500;
}

/* 4. 展開狀態 (Active) */
.menu-btn[aria-expanded="true"] {
    background-color: #fff; /* 保持白色 */
    color: var(--bs-primary);
    font-weight: 700;
}

/* 展開時，圖示跟著變色 */
.menu-btn[aria-expanded="true"] i {
    color: var(--bs-primary) !important;
    opacity: 1 !important;
}

/* 5. Sub Menu (子選單內容) */
.sub-menu-body {
    background-color: #fff;
    margin: 0;
    padding: 0;
}

/* 6. Sub Link (子選單連結) */
.sub-link {
    display: block;
    padding: 12px 20px;
    color: var(--bs-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s;
    background-color: #fcfcfc; /* 微微的灰，區分層級 */
}

.sub-link:hover,
.sub-link:active {
    background-color: #fff;
    color: var(--bs-primary);
    padding-left: 25px; /* 懸停時向右滑動 */
}

.sub-link:last-child {
    border-bottom: none;
}

/* 7. 圓形關閉按鈕 (底部) */
.btn-circle-close {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #fff;
    color: var(--bs-secondary);
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-circle-close:active {
    transform: scale(0.9);
    background-color: var(--bs-light);
}

/* 8. 依序進場動畫 (Staggered Animation) */
/* 預設隱藏並向下偏移 */
.modal.show .stagger-item {
    animation: slideUpFade 0.5s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

/* 設定延遲，製造流水般的進場感 */
.modal.show .stagger-item:nth-child(1) { animation-delay: 0.1s; }
.modal.show .stagger-item:nth-child(2) { animation-delay: 0.15s; }
.modal.show .stagger-item:nth-child(3) { animation-delay: 0.2s; }
.modal.show .stagger-item:nth-child(4) { animation-delay: 0.25s; }
.modal.show .stagger-item:nth-child(5) { animation-delay: 0.3s; }
.modal.show .stagger-item:nth-child(6) { animation-delay: 0.35s; }
.modal.show .stagger-item:nth-child(7) { animation-delay: 0.4s; }
.modal.show .stagger-item:nth-child(8) { animation-delay: 0.45s; }
.modal.show .stagger-item:nth-child(9) { animation-delay: 0.5s; }

@keyframes slideUpFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* #endregion 首頁選單 */

/* #region 首頁輪播 (Mobile Optimized) */

/* 1. 輪播容器 */
.hero-slider-section {
    width: 100%;
    margin-top: 0 !important;
    padding-top: 0 !important;
    position: relative;
    overflow: hidden;
    background-color: #000; /* 預載背景色 */
}

/* 2. 單一 Slide 高度設定 (關鍵優化) */
.hero-slide-item {
    position: relative;
    width: 100%;
    overflow: hidden;
    
    /* 電腦版高度 */
    height: 90vh; 
    min-height: 600px;
}

/* 3. 背景圖片與動畫 (Ken Burns Effect) */
.hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    background-size: cover;
    background-position: center center; /* 預設置中 */
    background-repeat: no-repeat;
    z-index: 1;
    
    /* 初始狀態 */
    transform: scale(1);
    transition: transform 8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 當 Slide 啟動時，背景圖緩慢放大 */
.hero-slide-item.active .hero-bg-image {
    transform: scale(1.12);
}

/* 4. 影片層 (保持不變) */
.video-foreground {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 56.25vw; /* 16:9 */
    min-height: 100%; 
    min-width: 177.77vh;
    z-index: 2;
    pointer-events: none;
    opacity: 0.8; /* 稍微調暗影片以免搶戲 */
}
.video-foreground iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* 5. 遮罩層 (Scrim Gradient) - 提升文字可讀性 */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
    
    /* 漸層說明：
       0-40%: 透明 (露出上方人臉/主題)
       40-100%: 黑色漸層變濃 (襯托下方文字)
    */
    background: linear-gradient(to bottom, 
        rgba(0,0,0,0) 0%, 
        rgba(0,0,0,0) 40%, 
        rgba(0,0,0,0.5) 70%, 
        rgba(0,0,0,0.85) 100%
    );
}

/* 6. Caption 定位與排版 */
#heroCarousel .carousel-caption {
    z-index: 10;
    padding-bottom: 5rem; /* 預設底部留白 */
    text-shadow: 0 2px 15px rgba(0,0,0,0.5); /* 提升對比 */
}

/* 7. 響應式字體 (使用 clamp 讓字體隨寬度無段縮放) */
.hero-title {
    /* 最小值 1.75rem, 理想值 4vw, 最大值 3.5rem */
    font-size: clamp(1.75rem, 4vw, 3.5rem); 
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.hero-desc {
    /* 最小值 1rem, 理想值 1.5vw, 最大值 1.25rem */
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.6;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* 8. 按鈕優化 (Mobile Friendly) */
.btn-hero {
    padding: 0.75rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-width: 2px;
    transition: all 0.3s ease;
}

.btn-hero:hover {
    transform: translateY(-3px);
}

/* 9. 手機版專屬微調 */
@media (max-width: 768px) {
    /* 使用 svh 避免網址列跳動問題 */
    .hero-slide-item {
        height: 85svh; 
        min-height: 500px;
    }

    /* 背景圖對齊調整：通常手機直式照片，重點在上方或中間 */
    .hero-bg-image {
        background-position: center top; 
    }

    /* 調整遮罩濃度，手機版需要更深的底色來確保小字清楚 */
    .hero-overlay {
        background: linear-gradient(to bottom, 
            rgba(0,0,0,0) 30%, 
            rgba(0,0,0,0.6) 60%, 
            rgba(0,0,0,0.9) 100%
        );
    }

    /* 調整內容位置，留出底部空間給手指操作 */
    #heroCarousel .carousel-caption {
        padding-bottom: 6rem; 
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    /* 手機版按鈕設定 */
    .btn-hero {
        width: 100%; /* 按鈕滿版，方便大拇指點擊 */
        padding: 0.8rem;
        margin-bottom: 0.5rem; /* 按鈕間距 */
        font-size: 1rem;
    }
    
    /* 修正手機版按鈕容器排列 */
    .carousel-caption .d-flex.gap-3 {
        gap: 0.5rem !important;
        flex-direction: column; /* 垂直堆疊按鈕 */
        width: 100%;
    }
}
/* #endregion Slider 輪播設定 */

/* #region 人類圖核心概念區塊 (Mobile Horizontal Scroll Optimized) */

.section-concept {
    background-color: #F8F9FA; 
    position: relative;
    /* overflow: hidden;  <-- 移除此行，避免切掉手機版陰影 */
}

/* 裝飾背景圓 (調整大小與位置) */
.section-concept::before {
    content: '';
    position: absolute;
    top: -5%;
    right: -5%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(var(--bs-primary-rgb), 0.08) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

/* ----------------------------------
   卡片本體設計
   ---------------------------------- */
a.concept-card {
    display: block; 
    text-decoration: none; 
    background: #fff;
    border: none;
    border-radius: 20px; /* 手機版更圓潤一點 */
    padding: 2rem 1.5rem;
    height: 100%;
    position: relative;
    overflow: hidden;
    /* 預設陰影 */
    box-shadow: 0 8px 20px rgba(0,0,0,0.04); 
    z-index: 1;
    border-bottom: 4px solid transparent; /* 預留位置給 active 狀態 */
    
    /* 動畫設定 */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 桌機版 Hover 效果 */
@media (min-width: 992px) {
    a.concept-card:hover {
        transform: translateY(-10px);
        box-shadow: 0 20px 40px rgba(var(--bs-primary-rgb), 0.15);
        border-bottom-color: var(--bs-primary);
    }
}

/* 手機版 Active (按壓) 效果 */
a.concept-card:active {
    transform: scale(0.98);
    background-color: #fffbf5; /* 微微的暖色背景回饋 */
    border-bottom-color: var(--bs-primary);
}

/* ----------------------------------
   手機版橫向捲動 (Horizontal Snap Scroll)
   ---------------------------------- */
/* 容器設定 */
.scrolling-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch; /* iOS 慣性捲動 */
    scroll-snap-type: x mandatory; /* 關鍵：強制吸附 */
    padding-bottom: 20px; /* 預留空間給陰影 */
    padding-left: 0.75rem; /* 對齊 container padding */
    
    /* 隱藏捲軸 (Chrome/Safari/Opera) */
    &::-webkit-scrollbar {
        display: none;
    }
    /* 隱藏捲軸 (IE/Edge/Firefox) */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 單張卡片吸附設定 */
.card-snap {
    scroll-snap-align: center; /* 滑動停止時，卡片會置中 */
    display: inline-block; /* 配合 flex-nowrap */
    white-space: normal; /* 卡片內文字正常換行 */
}

/* ----------------------------------
   Icon 與裝飾
   ---------------------------------- */
.concept-icon-wrapper {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    transition: all 0.3s ease;
}

.concept-icon-wrapper i {
    font-size: 1.75rem;
    color: var(--bs-primary);
    z-index: 2;
}

/* 桌機 Hover 時 Icon 變化 */
@media (min-width: 992px) {
    a.concept-card:hover .concept-icon-wrapper {
        background-color: var(--bs-primary);
        transform: scale(1.1);
    }
    a.concept-card:hover .concept-icon-wrapper i {
        color: #fff;
    }
}

/* 浮水印背景 Icon */
.watermark-icon {
    position: absolute;
    bottom: -15px;
    right: -15px;
    font-size: 6rem;
    color: rgba(0,0,0,0.03);
    transform: rotate(-15deg);
    transition: all 0.4s ease;
    z-index: 0;
    pointer-events: none;
}

@media (min-width: 992px) {
    a.concept-card:hover .watermark-icon {
        transform: rotate(0deg) scale(1.2);
        color: rgba(var(--bs-primary-rgb), 0.08);
    }
}

/* ----------------------------------
   文字排版
   ---------------------------------- */
.concept-card-title {
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--bs-dark);
    font-size: 1.2rem;
    position: relative;
    z-index: 2;
}

.concept-card-text {
    font-size: 0.95rem;
    color: #6c757d;
    line-height: 1.6;
    position: relative;
    z-index: 2;
}

/* 標題分隔線 */
.title-divider-modern {
    width: 50px;
    height: 4px;
    background: var(--bs-primary);
    margin: 1rem auto;
    border-radius: 2px;
}

/* 呼吸動畫 (用於手機版提示) */
@keyframes pulse-opacity {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}
.animate-pulse {
    animation: pulse-opacity 2s infinite ease-in-out;
}

/* 字距微調 */
.letter-spacing-2 {
    letter-spacing: 2px;
}

/* #endregion 人類圖核心概念區塊 */

/* #region Footer 頁尾樣式優化 */

/* 1. 頁尾連結互動 */
.footer-link {
    transition: all 0.2s ease-in-out;
}

/* Hover 時變為品牌主色 (亮橙色) 並稍微右移，增加互動感 */
.footer-link:hover {
    color: var(--bs-primary) !important; /* 使用 boot.css 定義的變數 */
    padding-left: 5px;
}

/* 2. 社群按鈕互動 */
.social-icon-btn {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.social-icon-btn:hover {
    background-color: var(--bs-primary) !important; /* 背景變橘 */
    color: #fff !important; /* 圖示變白 */
    transform: translateY(-3px); /* 輕微上浮 */
}


/* #endregion Footer 頁尾樣式優化 */

/* #region Page 頁面 (Mobile Reading Optimized) */

/* 1. Hero 區塊設定 */
.page-hero-section {
    width: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    
    /* 手機版高度：使用 svh 避免網址列跳動 */
    height: 40svh; 
    min-height: 300px;
}

/* 桌機版高度調整 */
@media (min-width: 992px) {
    .page-hero-section {
        height: 55vh;
        background-attachment: fixed; /* 視差滾動效果，增加質感 */
    }
}

/* 2. 漸層遮罩 (加強版) */
.hero-bottom-gradient {
    background: linear-gradient(to bottom, 
        rgba(0,0,0,0) 0%, 
        rgba(0,0,0,0.2) 50%, 
        rgba(0,0,0,0.6) 80%, 
        rgba(0,0,0,0.85) 100%
    );
    pointer-events: none;
}

/* 3. 響應式標題 (關鍵優化) */
.page-hero-title {
    /* 最小值 1.75rem (手機), 理想值 4vw, 最大值 3.5rem (桌機) */
    font-size: clamp(1.75rem, 4vw, 3.5rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* 4. 文字陰影 */
.text-shadow-lg {
    text-shadow: 0 2px 4px rgba(0,0,0,0.5), 0 8px 16px rgba(0,0,0,0.3);
}

/* 5. 內容排版優化 (Editor Content) */
.editor-content {
    font-size: 1.125rem; /* 18px，提升閱讀舒適度 */
    line-height: 1.8;
    color: #444;
    letter-spacing: 0.02em;
}

/* H2 - 主標題 */
.editor-content h2 { 
    color: var(--bs-primary); 
    font-weight: 700; 
    margin-top: 3rem; 
    margin-bottom: 1.5rem;
    font-size: 1.75rem; 
    line-height: 1.4;
}

/* H3 - 副標題 (帶裝飾) */
.editor-content h3 { 
    color: var(--bs-dark); 
    font-weight: 700; 
    margin-top: 2.5rem; 
    margin-bottom: 1rem;
    font-size: 1.4rem;
    padding-left: 1rem;
    border-left: 4px solid var(--bs-warning); 
}

/* H4 - 小標題 */
.editor-content h4 {
    color: var(--bs-secondary);
    font-weight: 600;
    margin-top: 2rem;
    font-size: 1.25rem;
}

/* 列表優化 */
.editor-content ul, 
.editor-content ol {
    padding-left: 1.5rem; 
    margin-bottom: 1.5rem;
}

.editor-content li {
    margin-bottom: 0.5rem;
}

/* 圖片優化 */
.editor-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px; 
    margin: 2rem 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

/* 6. 嵌入內容防護 (防止手機版破版) */
/* 表格響應式捲動 */
.editor-content table {
    display: block;
    width: 100%;
    overflow-x: auto; /* 讓過寬的表格可以左右滑動 */
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

/* 影片嵌入響應式 */
.editor-content iframe,
.editor-content object,
.editor-content embed {
    max-width: 100%;
    /* 自動維持 16:9 比例，避免高度塌陷或過高 */
    aspect-ratio: 16/9; 
}

/* 7. 雜誌感元素：首字放大 (Drop Cap) */
/* 僅針對第一個段落，增加設計感 */
.editor-content > p:first-of-type::first-letter {
    float: left;
    font-size: 3.2rem;
    line-height: 0.85;
    font-weight: 700;
    color: var(--bs-primary);
    padding-right: 0.75rem;
    padding-top: 0.25rem;
}

/* 8. 引用樣式 */
.editor-content blockquote {
    background-color: var(--bs-light);
    border-left: 4px solid var(--bs-primary);
    padding: 1.5rem;
    margin: 2rem 0;
    font-size: 1.1rem;
    font-style: italic;
    color: var(--bs-secondary);
    border-radius: 0 8px 8px 0;
}

/* 桌機版微調 */
@media (min-width: 992px) {
    .editor-content h2 { font-size: 2rem; }
    .editor-content h3 { font-size: 1.6rem; }
}
/* #endregion Page 頁面 */

/* #region Human Design Chart Plugin Styles */

/* 1. Form 表單優化 */
.select2-container--default .select2-selection--single {
    border-color: #dee2e6 !important;
    height: 50px !important; /* 加高按鈕，方便手指點擊 */
    display: flex !important;
    align-items: center !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 48px !important;
}

/* Select2 焦點狀態 (品牌色) */
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25) !important;
}

/* 選項被選取時的顏色 */
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--bs-primary) !important;
    color: white !important;
}

/* 2. Result 結果頁優化 (Grid Layout) */
.hd-result-card {
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    overflow: hidden;
}

.hd-data-item {
    background-color: var(--bs-light);
    border-radius: 12px;
    padding: 1rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: transform 0.2s;
    border: 1px solid rgba(0,0,0,0.03);
}

.hd-data-item:hover {
    background-color: #fff;
    border-color: var(--bs-primary);
    box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), 0.1);
    transform: translateY(-2px);
}

.hd-data-label {
    font-size: 0.85rem;
    color: var(--bs-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.hd-data-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--bs-dark);
    line-height: 1.3;
}

/* 3. 圖片區塊 */
.hd-chart-img-wrapper {
    background-color: #fafafa;
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 手機版微調 */
@media (max-width: 768px) {
    .hd-data-value {
        font-size: 1rem; /* 手機字稍微縮小防爆版 */
    }
}
/* #endregion Human Design Chart Plugin Styles */

/* #region Archive 分類頁面樣式 */

/* 1. 麵包屑導覽列 (Hero 區塊內 - Dark Mode) */
.archive-breadcrumb {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}
.archive-breadcrumb a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
    position: relative; 
    z-index: 20; /* 確保連結可點擊 */
}
.archive-breadcrumb a:hover {
    color: #fff;
    border-bottom-color: #fff;
}
.archive-breadcrumb .separator {
    margin: 0 8px;
    opacity: 0.5;
}
.archive-breadcrumb .last {
    color: #fff; 
    font-weight: 700;
}

/* 2. 子分類導覽條 (Pills - 有文章時顯示) */
section.sub-nav-wrapper.sticky-top {
    top: var(--header-height); /* 黏在 Header 下方 */
    z-index: 1020; 
    background: rgba(255,255,255,0.95); 
    backdrop-filter: blur(5px);
}
.archive-sub-nav { 
    overflow-x: auto; 
    white-space: nowrap; 
    padding-bottom: 5px; 
}
/* 隱藏捲軸 */
.archive-sub-nav::-webkit-scrollbar { display: none; }

.nav-pill-custom {
    display: inline-block; 
    padding: 0.5rem 1.25rem;
    border: 1px solid #eee; 
    border-radius: 50rem;
    color: var(--bs-secondary); 
    font-size: 0.95rem; 
    margin-right: 0.5rem;
    transition: all 0.2s ease;
    text-decoration: none;
}
.nav-pill-custom:hover {
    background-color: #fff;
    border-color: var(--bs-primary);
    color: var(--bs-primary);
}
.nav-pill-custom.active {
    background-color: var(--bs-primary); 
    border-color: var(--bs-primary); 
    color: #fff;
}

/* 3. 子分類大卡片 (Cards - 沒文章時顯示) */
.sub-cat-card {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid transparent;
    cursor: pointer;
}
.sub-cat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1) !important;
    border-color: rgba(var(--bs-primary-rgb), 0.3);
}
.sub-cat-card:hover .sub-cat-icon {
    transform: scale(1.1);
    background-color: rgba(var(--bs-primary-rgb), 0.1) !important;
    color: var(--bs-primary);
}
.sub-cat-icon {
    transition: transform 0.3s ease;
}
/* 手機點擊回饋 */
.sub-cat-card:active {
    transform: scale(0.96);
    background-color: #fafafa !important;
}

/* 4. 文章卡片 (Article Card) */
.article-card {
    transition: transform 0.3s ease;
    border: 1px solid rgba(0,0,0,0.03);
}
.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08) !important;
}
/* =========================================
   Archive 頁面 - 手機點擊優化
   ========================================= */

/* 文章卡片互動 */
.article-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.03);
    cursor: pointer; /* 讓電腦版游標變手型 */
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08) !important;
}

/* 手機版點擊回饋 (Touch Feedback) */
.article-card:active {
    transform: scale(0.98);
    background-color: #fafafa !important;
    border-color: var(--bs-primary);
}

/* 讓 stretched-link 覆蓋層級正確 */
.stretched-link {
    z-index: 5; 
}

/* 分類標籤稍微浮起，避免被誤認不可點 (雖然被 stretched-link 蓋住) */
.category-badge {
    z-index: 6; /* 若希望分類標籤可單獨點擊，需 > stretched-link，但這會導致卡片部分區域無法點擊進文章。
                   建議：Archive 頁面通常希望點哪都進文章，所以保持被覆蓋或不做連結 */
    pointer-events: none; /* 讓點擊穿透到下層的 stretched-link，確保整張卡片都能點 */
}

/* 確保圖片容器有背景色，避免圖片載入前是白的 */
.card-img-wrapper {
    background-color: #f8f9fa;
}
/* #endregion Archive 分類頁面樣式 */

/* #region Single Post 文章內頁樣式 */

/* 1. 麵包屑 (白底模式 - 用於文章內頁) */
/* 注意：這跟 archive-breadcrumb 不同，這是深色字 */
.single-breadcrumb {
    font-size: 0.9rem;
    color: var(--bs-secondary);
    margin-bottom: 1rem;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 5px;
}
.single-breadcrumb a {
    color: var(--bs-secondary);
    text-decoration: none;
    transition: color 0.2s;
}
.single-breadcrumb a:hover {
    color: var(--bs-primary);
}
.single-breadcrumb .separator {
    margin: 0 0.5rem;
    color: #ccc;
}
/* 隱藏卷軸 */
.single-breadcrumb::-webkit-scrollbar { display: none; }

/* 2. 閱讀進度條 (Progress Bar) */
.progress-container {
    width: 100%;
    height: 4px;
    background: transparent;
    position: fixed;
    top: 0; 
    left: 0;
    z-index: 2000; /* 確保在 Header 之上 */
}
.progress-bar {
    height: 100%;
    background: var(--bs-primary);
    width: 0%;
    transition: width 0.1s linear;
}

/* 3. 相關文章 Hover 特效 */
.hover-up:hover .transition-transform {
    transform: scale(1.05);
}
.transition-transform {
    transition: transform 0.5s ease;
}

/* 4. 手機版黏性分享列 */
.mobile-sticky-share {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid #eee;
    padding: 12px 20px;
    display: flex;
    justify-content: center; /* 置中 */
    align-items: center;
    z-index: 1050; /* 確保浮在最上層 */
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
}
/* 桌機版隱藏 */
@media (min-width: 992px) {
    .mobile-sticky-share { display: none; }
}
/* #endregion Single Post 文章內頁樣式 */

/* #region Archive Courses 課程列表樣式 */

/* 課程 Meta 資訊 (日期/老師) */
.course-meta {
    line-height: 1.5;
}
.course-meta i {
    opacity: 0.8;
}

/* 確保課程卡片與文章卡片高度一致 */
.article-card {
    height: 100%;
}

/* 課程標籤顏色微調 (Bootstrap 預設顏色加強) */
.bg-info.text-white {
    background-color: #0dcaf0 !important; /* 確保 Online 是亮藍色 */
}
.bg-success.text-white {
    background-color: #198754 !important; /* 確保 Offline 是綠色 */
}

/* 針對課程卡片的空狀態圖示 */
.empty-state-icon {
    font-size: 3rem; /* 調整圖示大小 */
}
/* #endregion Archive Courses 課程列表樣式 */

/* #region Archive Teachers 師資列表樣式 */

/* 1. 卡片本體 */
.teacher-circle-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.02);
}

.teacher-circle-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08) !important;
}

/* 手機版點擊回饋 */
.teacher-circle-card:active {
    transform: scale(0.98);
    background-color: #fafafa !important;
}

/* 2. 圓形頭像容器 */
.teacher-avatar-wrapper {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #fff; /* 白框 */
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); /* 輕微浮起 */
    flex-shrink: 0; /* 防止被擠壓 */
    transition: border-color 0.3s ease;
    margin-left: auto;
    margin-right: auto;
}

/* Hover 時框線變色 */
.teacher-circle-card:hover .teacher-avatar-wrapper {
    border-color: rgba(var(--bs-primary-rgb), 0.2);
}

/* 頭像圖片 */
.teacher-avatar-img,
.teacher-avatar-placeholder {
    width: 100%;
    height: 100%;
}

.teacher-avatar-placeholder i {
    font-size: 3rem;
}

/* 3. 文字排版 */
.teacher-nickname {
    font-size: 1.25rem;
    line-height: 1.3;
}

.teacher-subname {
    font-size: 0.85rem;
    opacity: 0.7;
}

.teacher-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3; /* 限制最多顯示 3 行，保持整齊 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0.75;
    line-height: 1.5;
}

.letter-spacing-1 {
    letter-spacing: 1px;
}

/* 4. 底部裝飾條 */
.teacher-card-bar {
    width: 30px;
    height: 4px;
    background-color: var(--bs-light);
    border-radius: 2px;
    transition: background-color 0.3s ease, width 0.3s ease;
}

.teacher-circle-card:hover .teacher-card-bar {
    background-color: var(--bs-primary);
    width: 50px;
}

/* 5. 手機版微調 (Mobile Optimization) */
@media (max-width: 768px) {
    /* 縮小頭像以適應雙欄 */
    .teacher-avatar-wrapper {
        width: 90px;
        height: 90px;
        border-width: 3px;
    }
    
    /* 調整內距 */
    .teacher-circle-card {
        padding: 1rem !important;
    }

    /* 字體調整 */
    .teacher-nickname {
        font-size: 1.1rem;
    }
    
    .teacher-subname {
        font-size: 0.75rem;
        margin-bottom: 0.5rem !important;
    }

    /* 手機版摘要字數減少或行數減少 */
    .teacher-excerpt {
        font-size: 0.8rem;
        -webkit-line-clamp: 2; /* 手機版只顯示 2 行 */
    }
}
/* #endregion Archive Teachers 師資列表樣式 */

/* #region Single Course 課程內頁樣式 */

/* 1. 禁用首字放大 (Disable Drop Cap) */
/* 使用 .disable-drop-cap 類別強制重置所有首字屬性 */
.editor-content.disable-drop-cap > p:first-of-type::first-letter {
    float: none !important;
    font-size: inherit !important;
    line-height: inherit !important;
    font-weight: inherit !important;
    color: inherit !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* 2. 課程資訊區塊 */
.course-info-box {
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

/* 3. 師資圓形卡片 (Course Page Teacher Card) */
/* 卡片連結樣式 */
.teacher-card-link {
    display: block;
    height: 100%;
}

.teacher-card-course {
    background-color: #fff;
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.02);
}

/* Hover 效果：上浮 + 邊框色 */
.teacher-card-link:hover .teacher-card-course {
    transform: translateY(-5px);
    border-color: rgba(var(--bs-primary-rgb), 0.2);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08) !important;
}

/* 師資圓形頭像 */
.teacher-avatar-circle {
    width: 100px; /* 大圓 */
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #f8f9fa; /* 淺灰框 */
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    position: relative;
    transition: border-color 0.3s ease;
}

.teacher-avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hover 時頭像框變色 */
.teacher-card-link:hover .teacher-avatar-circle {
    border-color: rgba(var(--bs-primary-rgb), 0.1);
}

/* 頭像上的 Hover 遮罩 (選用，增加可點擊感) */
.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.teacher-card-link:hover .avatar-overlay {
    opacity: 1;
}

/* 預設頭像佔位符 */
.teacher-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 2rem;
    background-color: #f1f3f5;
}

/* 4. 側邊欄報名框 */
.course-sidebar-wrapper {
    transition: top 0.3s;
}

/* 手機版 Sticky Bar */
.mobile-enroll-bar {
    z-index: 1040; /* 高於 footer 但低於 modal */
}

/* 5. 麵包屑文字顏色 (Hero 深色背景) */
.single-breadcrumb.text-white a {
    color: rgba(255,255,255,0.8);
}
.single-breadcrumb.text-white a:hover {
    color: #fff;
    text-decoration: underline;
}
.single-breadcrumb.text-white .text-muted {
    color: rgba(255,255,255,0.6) !important;
}

/* #endregion Single Course 課程內頁樣式 */

/* #region Single Teacher 老師個人頁樣式 */

/* 1. 老師個人卡片 (Sidebar Card) */
.teacher-profile-card {
    /* 讓卡片有點上浮覆蓋 Hero 區塊的感覺 */
    border: 1px solid rgba(0,0,0,0.03);
}

/* 2. 圓形頭像設定 (Circular Avatar) */
.single-teacher-avatar {
    width: 200px;  /* 電腦版尺寸 */
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 6px solid #fff; /* 白框 */
    margin-top: -80px; /* 負邊距：讓頭像往上凸出，蓋住 Hero */
    background-color: #fff;
    position: relative;
    z-index: 2;
}

/* 手機版頭像調整 */
@media (max-width: 991px) {
    .single-teacher-avatar {
        width: 160px;
        height: 160px;
        margin-top: -60px; /* 手機版凸出少一點 */
        border-width: 4px;
    }
    
    /* 調整卡片本身的上邊距，避免太擠 */
    .teacher-profile-card {
        padding-top: 0 !important; /* 因為頭像是負邊距 */
        margin-bottom: 2rem;
    }
}

/* 3. 學經歷文字排版 */
.teacher-bio-text {
    line-height: 1.8;
}

/* 4. 人類圖放大顯示 (Chart) */
.teacher-chart-section .chart-wrapper {
    position: relative;
    transition: transform 0.3s ease;
}

.teacher-chart-section .chart-wrapper:hover {
    transform: translateY(-3px); /* 輕微互動回饋 */
}

/* 圖片本體 */
.teacher-chart-img {
    max-height: 80vh; /* 避免過高超出螢幕 */
    width: auto;
    max-width: 100%; /* 響應式 */
    /* 讓圖片在容器中稍微大一點 */
    min-width: 60%; 
}

/* 手機版讓圖佔滿寬度 */
@media (max-width: 768px) {
    .teacher-chart-img {
        width: 100%;
        min-width: 100%;
    }
}

/* 5. 內容區塊微調 */
.editor-content h3 {
    font-size: 1.5rem;
    margin-top: 0;
}

/* 修正：在 single-teacher 頁面，麵包屑的顏色 */
.single-breadcrumb.text-white a {
    color: rgba(255,255,255,0.8);
}
.single-breadcrumb.text-white a:hover {
    color: #fff;
}

/* #endregion Single Teacher 老師個人頁樣式 */

/* #region Search Page 搜尋結果頁樣式 */

/* 1. 搜尋結果卡片 */
.search-result-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}

.search-result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08) !important;
}

/* 點擊回饋 (Mobile) */
.search-result-card:active {
    transform: scale(0.98);
}

/* 2. 圖片容器 */
.search-img-container {
    background-color: var(--bs-light);
}

/* 3. 老師專屬樣式 */
/* 背景模糊層 */
.search-blur-bg {
    filter: blur(20px);
    opacity: 0.3;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

/* 圓形頭像 */
.search-teacher-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    z-index: 2; /* 浮在模糊背景之上 */
    background: #fff;
}

/* 4. 關鍵字高亮 */
/* 在 PHP 中生成的 span class */
.text-primary.bg-warning {
    padding: 0 2px;
    border-radius: 2px;
}

/* 5. 分頁導航微調 (若 boot.css 未覆蓋) */
.pagination .page-numbers {
    border-radius: 50%;
    margin: 0 4px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 600;
}
.pagination .current {
    background-color: var(--bs-primary);
    color: #fff;
}
/* #endregion Search Page 搜尋結果頁樣式 */

/* #region 404 Error Page 樣式 */
/* 1. 404 數字特效 */
.error-code-404 {
    /* 增加文字陰影，提升層次感 */
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    
    /* 漸層文字效果 */
    background: -webkit-linear-gradient(top, #ffffff 0%, var(--bs-primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    /* 若瀏覽器不支援 background-clip，則回退顯示橘色 */
    color: var(--bs-primary); 
    
    /* 確保在部分瀏覽器文字透明 */
    -webkit-text-fill-color: transparent;
}

/* 2. 搜尋框優化 */
.page-hero-section .input-group {
    box-shadow: 0 10px 30px rgba(0,0,0,0.25) !important;
}

.page-hero-section .form-control:focus {
    box-shadow: none; /* 移除預設藍暈，保持乾淨 */
}

/* 3. 快速導航按鈕 (Hover) */
.page-hero-section .btn-outline-light:hover {
    background-color: #fff;
    color: var(--bs-primary);
    border-color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.page-hero-section .btn-outline-light {
    transition: all 0.3s ease;
}

/* 4. 手機版字體與間距微調 */
@media (max-width: 768px) {
    /* 手機版 404 字稍微小一點，避免撐爆 */
    .error-code-404 {
        margin-bottom: 0.5rem !important;
        -webkit-text-fill-color: var(--bs-primary); /* 手機版可能漸層支援度不一，直接用單色亦可，或保持漸層 */
    }
    
    .page-hero-section h2 {
        font-size: 1.5rem;
    }
    
    .page-hero-section .lead {
        font-size: 1rem;
        margin-bottom: 2rem !important;
    }

    /* 手機版搜尋框間距縮小 */
    .page-hero-section .row.justify-content-center.mb-5 {
        margin-bottom: 2rem !important;
    }
}
/* #endregion 404 Error Page 樣式 */

/* #region 首頁跑圖 */
/* 1. 區塊容器設定 */
#home_chart {
    padding: 5rem 0;
    position: relative;
    border-top: 1px solid rgba(0,0,0,0.03);
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

/* 標題區域微調 (覆寫 form.php 預設 padding) */
#home_chart .py-5 {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* 2. 表單容器優化 */
#chart_form {
    background: #fff;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.06); /* 柔和且深邃的陰影 */
    border: 1px solid rgba(0,0,0,0.02);
}

/* 手機版內距調整 */
@media (max-width: 768px) {
    #chart_form {
        padding: 1.5rem;
        border-radius: 16px;
    }
}

/* 3. 輸入框與標籤 */
#chart_form .form-label {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: var(--bs-secondary); /* 藍灰色，比純黑柔和 */
}

#chart_form .form-control,
#chart_form .form-select {
    height: 50px; /* 加高，方便點擊 */
    border-radius: 10px;
    border: 1px solid #dee2e6;
    padding-left: 1rem;
    font-size: 1rem;
    transition: all 0.2s ease-in-out;
    background-color: #fcfcfc;
}

/* 焦點狀態：品牌色光暈 */
#chart_form .form-control:focus,
#chart_form .form-select:focus {
    border-color: var(--bs-primary);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), 0.1);
}

/* 輔助文字 (form-text) */
#chart_form .form-text {
    font-size: 0.85rem;
    margin-top: 0.4rem;
    color: #999;
}

/* 4. Select2 下拉選單深度客製化 (與 Bootstrap 風格統一) */
/* 容器本身 */
#chart_form .select2-container--default .select2-selection--single {
    height: 50px !important;
    border-radius: 10px !important;
    border: 1px solid #dee2e6 !important;
    background-color: #fcfcfc !important;
    display: flex !important;
    align-items: center !important;
}

/* 焦點狀態 */
#chart_form .select2-container--default.select2-container--focus .select2-selection--single,
#chart_form .select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--bs-primary) !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), 0.1) !important;
}

/* 文字部分 */
#chart_form .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 1rem !important;
    color: #212529 !important;
    font-size: 1rem !important;
    line-height: normal !important;
}

/* 箭頭部分 */
#chart_form .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 48px !important;
    right: 10px !important;
}
#chart_form .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #999 transparent transparent transparent !important;
    border-width: 6px 5px 0 5px !important;
}
#chart_form .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent var(--bs-primary) transparent !important;
    border-width: 0 5px 6px 5px !important;
}

/* 下拉選單列表 (Dropdown) */
.select2-dropdown {
    border-radius: 10px !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
    overflow: hidden !important;
    z-index: 1050 !important; /* 確保浮在最上層 */
}

/* 選項樣式 */
.select2-container--default .select2-results__option {
    padding: 10px 15px !important;
    font-size: 0.95rem !important;
}

/* 選項 Hover / Selected */
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--bs-primary) !important;
    color: #fff !important;
}
.select2-container--default .select2-results__option--selected {
    background-color: #f0f0f0 !important;
    color: #333 !important;
    font-weight: 600 !important;
}

/* 5. 搜尋框 (Select2 Search) */
.select2-search--dropdown .select2-search__field {
    border-radius: 6px !important;
    border: 1px solid #ddd !important;
    padding: 8px !important;
}
.select2-search--dropdown .select2-search__field:focus {
    outline: none !important;
    border-color: var(--bs-primary) !important;
}

/* 6. 送出按鈕 (CTA) */
#chart_form button[type="submit"] {
    width: 100%;
    padding: 1rem !important;
    font-size: 1.2rem !important;
    border-radius: 50rem !important; /* Pill Shape */
    background-color: var(--bs-primary);
    border: none;
    box-shadow: 0 4px 15px rgba(var(--bs-primary-rgb), 0.3); /* 發光效果 */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#chart_form button[type="submit"]:hover {
    background-color: #e67a00; /* 深一點的橘色 */
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(var(--bs-primary-rgb), 0.4);
}

#chart_form button[type="submit"]:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(var(--bs-primary-rgb), 0.3);
}

/* 7. Turnstile 驗證置中 */
#chart_form .turnstile-container {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
}
/* #endregion 首頁跑圖 */

/* #region 首頁最新文章 */
/* 1. 卡片本體 */
.home-article-card {
    background: #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.03) !important;
}

/* Hover 效果 */
.home-article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08) !important;
    border-color: rgba(var(--bs-primary-rgb), 0.2) !important;
}

/* 手機版點擊回饋 */
.home-article-card:active {
    transform: scale(0.98);
    background-color: #fafafa;
}

/* 2. 圖片與特效 */
/* 外層容器 */
.card-img-wrapper {
    position: relative;
    /* 這裡不需要 overflow hidden，因為標籤要浮在上面，
       但如果有圓角需求，可以加在 .card-img-wrapper 上 */
    border-radius: 0; 
}

/* 圖片放大特效 */
.transition-transform {
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.home-article-card:hover .transition-transform {
    transform: scale(1.08);
}

/* 3. 分類標籤 (位置修正) */
.article-cat-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10; /* 確保浮在最上層 */
    
    /* 外觀設定 */
    background-color: rgba(33, 37, 41, 0.85); /* 深色背景 */
    color: #fff;
    font-size: 0.75rem; /* 字體 12px */
    padding: 6px 12px;
    border-radius: 50rem;
    
    /* 確保寬度正確 */
    display: inline-flex;
    align-items: center;
    width: auto;      /* 自動寬度，修正被撐大的問題 */
    max-width: 90%;   /* 避免太長 */
    
    /* 特效 */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    
    /* 禁止選取 */
    pointer-events: none; 
}

/* 4. 文字排版限制 */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 5. 底部連結互動 */
.link-hover-effect {
    transition: opacity 0.2s;
}

.transform-move {
    display: inline-block;
    transition: transform 0.2s ease;
}

.home-article-card:hover .transform-move {
    transform: translateX(4px);
}

/* 6. 手機版優化 */
@media (max-width: 768px) {
    .section-home-articles {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .home-article-card .card-title {
        font-size: 1.15rem;
    }
    
    /* 手機版摘要行數減少 */
    .line-clamp-3 {
        -webkit-line-clamp: 2;
    }
    
    /* 手機版標籤稍微縮小 */
    .article-cat-badge {
        top: 10px;
        right: 10px;
        font-size: 0.7rem;
        padding: 4px 10px;
    }
}
/* #endregion 首頁最新文章 */
