/*
======================================================================
                     INDEX.CSS - 首頁專用樣式
======================================================================
此檔案包含首頁特有的樣式：
- 輪播圖 (Hero Slider)
- 介紹區塊 (Intro Section)
- 技能區塊 (Skills Section)
- 教育時間軸 (Education Timeline)
- 影片輪播 (Video Carousel)
- 最新活動 (Recent Events)
- 座右銘 (Motto)
- 友善連結 (Link Showcase)
- 合作夥伴 (Partnership)
- 聯絡區塊 (Contact)
======================================================================
*/

/* --- 1. Hero Slider --- */
.hero-slider {
    width: 100%;
    height: 100dvh;
    position: relative;
}

.swiper {
    width: 100%;
    height: 100%;
}

.swiper-slide {
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    height: 100%;
}

.swiper-button-next,
.swiper-button-prev {
    color: var(--tech-cyan);
    top: 50%;
    transform: translateY(-50%);
}

.swiper-pagination {
    position: absolute;
    bottom: 1dvh !important;
    left: 0;
    width: 100%;
    text-align: center;
}

.swiper-pagination-bullet-active {
    background: var(--tech-cyan);
}

.slide-content {
    text-align: center;
    color: #ffffff;
    padding: 2rem 3rem;
    background: rgba(13, 17, 23, 0.6);
    border-radius: 12px;
    max-width: 80%;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.slide-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
    color: #fff;
}

.slide-content p {
    font-size: 1.25rem;
    font-weight: 300;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

.swiper-slide-active .slide-content {
    animation: fadeInUp 0.8s ease-out 0.3s forwards;
    opacity: 0;
}

.scroll-down-arrow {
    position: absolute;
    bottom: 4vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: 50px;
    height: 50px;
    border: 2px solid var(--tech-cyan);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
    animation: bounce 2.5s infinite ease-in-out;
    text-decoration: none;
}

.scroll-down-arrow i {
    color: var(--tech-cyan);
    font-size: 18px;
    transition: color 0.3s ease;
}

.scroll-down-arrow:hover {
    background-color: rgba(100, 210, 255, 0.2);
}

.scroll-down-arrow:hover i {
    color: #fff;
}

/* --- 2. Intro Section --- */
.intro-section {
    display: flex;
    align-items: center;
    gap: 3rem;
    margin-bottom: 4rem;
}

.intro-text {
    flex: 1;
}

.intro-text p {
    font-size: 1.1rem;
    text-align: justify;
    line-height: 1.8;
    color: rgb(166, 213, 255);
}

.intro-image {
    flex-basis: 300px;
    flex-shrink: 0;
    text-align: center;
    overflow: hidden;
    border-radius: 16px;
    width: 300px;
    height: 300px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: var(--light-bg);
}

.intro-image img {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    object-fit: cover;
    animation: slideUpImage 0.8s ease-out;
    transition: inherit;
    display: block;
}

.intro-image:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

/* --- 4. Education Timeline --- */
.education-section {
    padding: 9rem 0 4rem 0;
    background-color: var(--dark-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    width: 100vw;
}

.education-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.education-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--tech-cyan);
    text-align: center;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.timeline-wrapper {
    position: relative;
    padding: 2rem 0;
}

.timeline-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 100%;
    background-color: #30363d;
    transition: left 0.4s ease;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    transition: padding 0.4s ease;
}

.timeline-item:nth-child(odd) { left: 0; }
.timeline-item:nth-child(even) { left: 50%; }

.timeline-icon {
    position: absolute;
    top: 25px;
    z-index: 10;
    width: 50px;
    height: 50px;
    background: var(--light-bg);
    border: 3px solid var(--tech-cyan);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--tech-cyan);
    transition: all 0.4s ease;
}

.timeline-item:nth-child(odd) .timeline-icon { right: -25px; }
.timeline-item:nth-child(even) .timeline-icon { left: -25px; }

.timeline-content {
    padding: 1.5rem;
    background: var(--light-bg);
    border: 1px solid #30363d;
    border-radius: 12px;
    position: relative;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.timeline-content:hover {
    transform: translateY(-5px);
    border-color: var(--tech-cyan);
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.1);
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 30px;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    transition: all 0.4s ease;
}

.timeline-item:nth-child(odd) .timeline-content { text-align: right; }
.timeline-item:nth-child(odd) .timeline-content::before { right: -20px; border-left-color: #30363d; }
.timeline-item:nth-child(even) .timeline-content::before { left: -20px; border-right-color: #30363d; }

.timeline-date {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #8b949e;
    background-color: rgba(139, 148, 158, 0.08);
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(139, 148, 158, 0.15);
    transition: all 0.3s ease;
}

.timeline-date[data-contains-present="true"] {
    border-color: var(--text-color);
    color: var(--text-color);
    background-color: rgba(201, 209, 217, 0.1);
    font-weight: 600;
    box-shadow: 0 0 6px rgba(201, 209, 217, 0.2);
}

.timeline-gpa {
    display: inline-block;
    font-size: 0.85rem !important;
    font-weight: 500;
    color: #8b949e;
    background-color: rgba(139, 148, 158, 0.08);
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(139, 148, 158, 0.15);
    transition: all 0.3s ease;
}

.timeline-gpa:hover {
    color: var(--text-color);
    background-color: rgba(139, 148, 158, 0.12);
    border-color: rgba(139, 148, 158, 0.25);
}

.timeline-content h3 {
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

/* 奇數項目（第1、3、5...個）科系名稱靠右對齊 */
.timeline-item:nth-child(odd) .timeline-content h3 {
    text-align: right;
}

/* 偶數項目（第2、4、6...個）科系名稱靠左對齊 */
.timeline-item:nth-child(even) .timeline-content h3 {
    text-align: left;
}

.timeline-school-name {
    font-size: 1rem;
    color: var(--text-color);
    font-style: italic;
    margin-bottom: 1.25rem;
    opacity: 0.9;
}

/* 奇數項目（第1、3、5...個）靠右對齊 */
.timeline-item:nth-child(odd) .timeline-school-name {
    text-align: right;
}

/* 偶數項目（第2、4、6...個）靠左對齊 */
.timeline-item:nth-child(even) .timeline-school-name {
    text-align: left;
}



/* --- 5. Video Carousel Section --- */
.video-carousel-section {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft JhengHei", Roboto, sans-serif;
    text-align: center;
    padding: 40px 0;
    overflow: visible;
    background-color: var(--dark-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.video-carousel-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--tech-cyan);
    text-align: center;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.video-carousel-section .text-muted {
    font-size: 1.2rem;
    color: rgba(201, 209, 217, 0.8);
    margin: 0;
    font-style: italic;
    max-width: 800px;
    margin: 0 auto;
}

.video-carousel-display {
    position: relative;
    overflow: visible;
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1500px;
    padding: 0 50px;
}

.video-carousel-container {
    position: relative;
    width: 800px;
    height: 300px;
    transform-style: preserve-3d;
    transition: transform 0.5s ease-in-out;
}

.video-carousel-slide {
    position: absolute;
    width: 280px;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    background-color: rgba(13, 17, 23, 0.8);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.8s ease-in-out;
    transform-origin: center center;
}

.video-carousel-slide[data-position="0"] {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) translateZ(100px) scale(1.2);
    z-index: 5;
    border: 2px solid var(--tech-cyan);
    box-shadow: 0 15px 35px rgba(100, 210, 255, 0.3);
}

.video-carousel-slide[data-position="1"] {
    left: 80%;
    top: 50%;
    transform: translate(-50%, -50%) translateZ(50px) scale(1.0);
    z-index: 4;
    opacity: 0.8;
}

.video-carousel-slide[data-position="2"] {
    left: 105%;
    top: 50%;
    transform: translate(-50%, -50%) translateZ(0px) scale(0.8);
    z-index: 3;
    opacity: 0.6;
}

.video-carousel-slide[data-position="3"] {
    left: -5%;
    top: 50%;
    transform: translate(-50%, -50%) translateZ(0px) scale(0.8);
    z-index: 3;
    opacity: 0.6;
}

.video-carousel-slide[data-position="4"] {
    left: 20%;
    top: 50%;
    transform: translate(-50%, -50%) translateZ(50px) scale(1.0);
    z-index: 4;
    opacity: 0.8;
}

.video-iframe-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(13, 17, 23, 0.9), rgba(88, 166, 255, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-iframe-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    object-fit: contain;
    border-radius: inherit;
}

.video-carousel-prev,
.video-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(13, 17, 23, 0.8);
    color: #ffffff;
    border: 1px solid #30363d;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.3rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.video-carousel-prev:hover,
.video-carousel-next:hover {
    background-color: rgba(35, 41, 49, 0.9);
    border-color: var(--tech-cyan);
    color: var(--tech-cyan);
    transform: translateY(-50%) scale(1.1);
}

.video-carousel-prev:disabled,
.video-carousel-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.video-carousel-prev { left: calc(50% - 400px - 144px);  }
.video-carousel-next { right: calc(50% - 400px - 144px); }

.video-carousel-more {
    display: inline-block;
    margin-top: 30px;
    padding: 10px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    background-color: var(--dark-bg);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.video-carousel-more:hover {
    background: linear-gradient(90deg, var(--tech-blue), var(--tech-cyan));
    color: var(--dark-bg);
    border-color: var(--tech-cyan);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 162, 255, 0.2);
}

/* --- 6. Recent Events Section --- */
.recent-events-section {
    padding: 80px 0;
    background-color: #0d1117;
    color: #c9d1d9;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.events-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.events-header {
    text-align: center;
    margin-bottom: 50px;
}

.events-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--tech-cyan);
    text-align: center;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.events-header .text-muted {
    font-size: 1.2rem;
    color: rgba(201, 209, 217, 0.8);
    margin: 0;
    font-style: italic;
    max-width: 800px;
    margin: 0 auto;
}

.events-carousel-container {
    position: relative;
    padding: 0 15px; /* 減少 padding，讓按鈕更靠近內容 */
    overflow: hidden;
}

.events-grid {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.event-card-wrapper {
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 0 12.5px;
}

.event-card {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    aspect-ratio: 4 / 3;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #30363d;
    width: 100%;
    height: 100%;
}

.event-card:hover {
    box-shadow: 0 8px 25px rgba(100, 210, 255, 0.2);
    border-color: var(--tech-cyan);
}

.event-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    border-radius: inherit;
    transform-origin: center center;
}

.event-card:hover img {
    transform: scale(1.05);
}

.event-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0) 100%);
    color: #ffffff;
    padding: 40px 20px 20px 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    text-align: left;
}

.event-card:hover .event-info {
    opacity: 1;
    transform: translateY(0);
}

.event-info h3 {
    font-size: 1.2rem;
    margin: 0 0 5px 0;
    font-weight: 600;
    color: #fff;
}

.event-info p {
    font-size: 0.9rem;
    margin: 0;
    color: var(--text-color);
    line-height: 1.4;
    transition: font-size 0.3s ease;
}

.event-info p.text-fit {
    font-size: 0.75rem;
    line-height: 1.3;
}

.event-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(13, 17, 23, 0.8);
    color: #ffffff;
    border: 1px solid #30363d;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.3rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.event-nav-btn:hover {
    background-color: rgba(35, 41, 49, 0.9);
    border-color: var(--tech-cyan);
    color: var(--tech-cyan);
    transform: translateY(-50%) scale(1.1);
}

#prev-event { left: calc(50% - 400px - 144px);  }
#next-event { right: calc(50% - 400px - 144px); }

/* === 字體定義 === */
/* Google Fonts 下載的 TTF 文件名稱 */
@font-face {
    font-family: 'Playfair Display';
    src: url('./fonts/PlayfairDisplay/PlayfairDisplay-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

/* 如果需要正體字重 */
@font-face {
    font-family: 'Playfair Display';
    src: url('./fonts/PlayfairDisplay/PlayfairDisplay-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* 如果想要更好的性能，可以將 TTF 轉換成 WOFF2 */

@font-face {
    font-family: 'Playfair Display';
    src: url('./fonts/PlayfairDisplay/PlayfairDisplay-Italic.woff2') format('woff2'),
         url('./fonts/PlayfairDisplay/PlayfairDisplay-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

/* === 7. Motto Section === */
.motto-section {
    width: 100%;
    margin: 2rem 0 3rem 0;
    text-align: center;
    position: relative;
    padding-bottom: 4rem;
}

.motto {
    position: relative;
    width: 100%;
    margin: 0;
    padding-top: 2rem;
    text-align: center;
    
    /* 使用 Playfair Display 字體 */
    font-family: 'Playfair Display', 'Times New Roman', Times, serif;
    font-weight: 400;
    font-style: italic;
    font-size: 1.2rem;
    letter-spacing: 0.3px;
    line-height: 1.5;
    
    /* 漸層文字效果 - 修正瀏覽器相容性 */
    background: linear-gradient(90deg, #58a6ff 0%, #0a84ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    
    /* 修正：某些瀏覽器需要這個 */
    color: transparent;
    
    /* subtle 光暈效果 */
    text-shadow: 0 0 4px rgba(88, 166, 255, 0.3);
    
    display: inline-block;
    animation: motto-subtle-glow 3s ease-in-out infinite alternate;
}

/* 分隔線 */
.motto::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    max-width: 500px;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.25);
}

/* 動畫效果 */
@keyframes motto-subtle-glow {
    0% {
        text-shadow: 0 0 4px rgba(88, 166, 255, 0.3);
        filter: brightness(1);
    }
    100% {
        text-shadow: 0 0 6px rgba(88, 166, 255, 0.4);
        filter: brightness(1.1);
    }
}

/* === 瀏覽器相容性版本 === */
/* 如果漸層文字有問題，可以用這個替代方案 */
.motto-fallback {
    position: relative;
    width: 100%;
    margin: 0;
    padding-top: 2rem;
    text-align: center;
    
    font-family: 'Playfair Display', 'Times New Roman', Times, serif;
    font-weight: 400;
    font-style: italic;
    font-size: 1.2rem;
    letter-spacing: 0.3px;
    line-height: 1.5;
    
    /* 純色版本，更穩定 */
    color: #58a6ff;
    text-shadow: 0 0 4px rgba(88, 166, 255, 0.3);
    
    display: inline-block;
    animation: motto-brightness-glow 3s ease-in-out infinite alternate;
}

@keyframes motto-brightness-glow {
    0% {
        filter: brightness(1);
        text-shadow: 0 0 4px rgba(88, 166, 255, 0.3);
    }
    100% {
        filter: brightness(1.15);
        text-shadow: 0 0 6px rgba(88, 166, 255, 0.4);
    }
}

/* === 滾動箭頭 === */
.motto-scroll-arrow {
    position: absolute;
    bottom: -2.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--tech-cyan);
    opacity: 0.7;
    transition: opacity 0.3s ease, transform 0.3s ease;
    animation: bounce-down 2s ease-in-out infinite;
    z-index: 10;
    padding: 0.5rem;
    border-radius: 50%;
}

.motto-scroll-arrow:hover {
    opacity: 1;
    background-color: rgba(100, 210, 255, 0.1);
}

.motto-scroll-arrow:active {
    transform: translateX(-50%) translateY(8px);
}

.motto-scroll-arrow.clicked {
    animation: slide-down-click 0.6s ease-out;
}

@keyframes slide-down-click {
    0% {
        transform: translateX(-50%) translateY(0);
    }
    30% {
        transform: translateX(-50%) translateY(15px);
        opacity: 0.4;
    }
    60% {
        transform: translateX(-50%) translateY(25px);
        opacity: 0.2;
    }
    100% {
        transform: translateX(-50%) translateY(0);
        opacity: 0.7;
    }
}

@keyframes bounce-down {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-8px);
    }
    60% {
        transform: translateX(-50%) translateY(-4px);
    }
}

/* === 響應式設計 === */
@media (max-width: 768px) {
    .motto,
    .motto-fallback {
        font-size: 1rem;
        letter-spacing: 0.2px;
    }
    
    .motto::before {
        width: 80%;
    }
}

@media (max-width: 480px) {
    .motto,
    .motto-fallback {
        font-size: 0.95rem;
        padding-top: 1.5rem;
    }
}

/* === 如果字體載入失敗的後備方案 === */
@supports not (font-display: swap) {
    .motto,
    .motto-fallback {
        font-family: Georgia, 'Times New Roman', Times, serif;
    }
}

/* --- Connect with Me - 確保三列布局 --- */
.connect-showcase-section {
    padding: 4rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, 
        rgba(13, 17, 23, 0.95) 0%, 
        rgba(22, 27, 34, 0.98) 50%, 
        rgba(13, 17, 23, 0.95) 100%);
}

.connect-showcase-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(100, 210, 255, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(10, 132, 255, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.connect-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

.connect-header {
    text-align: center;
    margin-bottom: 4rem;
}

.connect-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--tech-cyan);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.connect-subtitle {
    font-size: 1.2rem;
    color: rgba(201, 209, 217, 0.8);
    margin: 0;
    font-style: italic;
}

.connect-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 強制三列 */
    gap: 2rem;
    max-width: 1300px;
    margin: 0 auto;
}

/* 強制三列顯示，即使在較小屏幕上 */
@media (min-width: 992px) {
    .connect-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

.connect-category {
    background: linear-gradient(135deg, 
        rgba(22, 27, 34, 0.8) 0%, 
        rgba(30, 35, 42, 0.6) 100%);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    border: 1px solid rgba(100, 210, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    min-height: 400px; /* 確保卡片高度一致 */
    display: flex;
    flex-direction: column;
}

.connect-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--tech-blue), var(--tech-cyan));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.connect-category:hover {
    transform: translateY(-8px);
    border-color: rgba(100, 210, 255, 0.3);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.connect-category:hover::before {
    transform: scaleX(1);
}

.category-icon {
    width: 55px;
    height: 55px;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--tech-blue), var(--tech-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem auto;
    font-size: 1.4rem;
    color: white;
    transition: transform 0.3s ease;
}

.connect-category:hover .category-icon {
    transform: scale(1.1) rotate(5deg);
}

.category-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    text-align: center;
}

.connect-links {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1; /* 讓連結區域填滿剩餘空間 */
}

.connect-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.connect-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(100, 210, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.connect-link:hover {
    transform: translateX(6px);
    background: rgba(100, 210, 255, 0.1);
    border-color: var(--tech-cyan);
    color: #fff;
}

.connect-link:hover::before {
    left: 100%;
}

.connect-link i {
    font-size: 1.1rem;
    width: 18px;
    text-align: center;
    color: var(--tech-cyan);
    transition: color 0.3s ease;
}

.connect-link:hover i {
    color: #fff;
}

/* --- 響應式設計 - 只在小屏幕改變布局 --- */
@media (max-width: 991px) {
    .connect-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2rem;
    }
    
    .connect-category {
        padding: 2rem 1.5rem;
        min-height: 350px;
    }
}

@media (max-width: 768px) {
    .connect-header h2 {
        font-size: 2.2rem;
    }
    
    .connect-subtitle {
        font-size: 1.1rem;
    }
    
    .connect-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
    
    .connect-category {
        padding: 1.8rem 1.3rem;
        min-height: 320px;
    }
}

@media (max-width: 600px) {
    .connect-container {
        padding: 0 1rem;
    }
    
    .connect-header h2 {
        font-size: 2rem;
    }
    
    .connect-category {
        padding: 1.5rem 1rem;
        min-height: 300px;
    }
    
    .category-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    .category-title {
        font-size: 1.2rem;
    }
    
    .connect-link {
        padding: 0.7rem 0.9rem;
        font-size: 0.85rem;
    }
}



.partner-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    
}

.partner-showcase-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--tech-cyan);
    text-align: center;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.partner-showcase-section .text-muted {
    font-size: 1.2rem;
    color: rgba(201, 209, 217, 0.8);
    margin: 0;
    font-style: italic;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.partner-carousel-container {
    position: relative;
    padding: 3rem 60px 3rem 60px; /* 增加上方padding為懸停效果留空間 */
    overflow: visible; /* 確保懸停效果不被遮擋 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.partner-carousel-wrapper {
    width: 1120px; /* 5個LOGO的寬度: 5 * (200px + 24px) - 24px = 1096px + 24px margin */
    overflow: hidden;
    position: relative;
}

.partner-carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    gap: 24px;
    will-change: transform;
}

.partner-logo {
    width: 250px;
    height: 150px;
    flex-shrink: 0;
    padding: 15px;
    box-sizing: border-box;
    background-color: rgba(30, 58, 95, 0.3);
    border: 1px solid rgba(127, 175, 224, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    cursor: pointer;
}

.partner-logo:hover {
    background-color: rgba(48, 80, 130, 0.5);
    border-color: rgba(127, 175, 224, 0.4);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.partner-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(100%) opacity(60%);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.partner-logo:hover img {
    filter: grayscale(0%) opacity(100%);
    transform: translateY(-8px) scale(1.05);
}

.partner-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(13, 17, 23, 0.8);
    color: #ffffff;
    border: 1px solid #30363d;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.3rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.partner-nav-btn:hover {
    background-color: rgba(35, 41, 49, 0.9);
    border-color: var(--tech-cyan);
    color: var(--tech-cyan);
    transform: translateY(-50%) scale(1.1);
}

.partner-prev {
    left: calc(50% - 400px - 144px);
}

.partner-next {
    right: calc(50% - 400px - 144px);
}

.partner-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    margin-top: 60px;
    margin-bottom: 60px;
}

/* --- 響應式設計 --- */
@media (max-width: 1200px) {
    .partner-carousel-container {
        padding: 3rem 50px 3rem 50px;
    }
    
    .partner-carousel-wrapper {
        width: 920px;
    }
    
    .partner-logo {
        width: 170px;
        height: 85px;
    }
}

@media (max-width: 1024px) {

    .partner-carousel-container {
        padding: 3rem 40px 3rem 40px;
    }
    
    .partner-carousel-wrapper {
        width: 820px;
    }
    
    .partner-logo {
        width: 150px;
        height: 75px;
    }
    
    .partner-nav-btn {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    .partner-showcase-section .text-muted {
        margin-bottom: 3rem;
    }

}

@media (max-width: 768px) {
    .partner-carousel-container {
        padding: 3rem 30px 3rem 30px;
    }
    
    .partner-carousel-wrapper {
        width: 700px;
    }
    
    .partner-logo {
        width: 130px;
        height: 65px;
    }
    
    .partner-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .partner-prev {
        left: -10px;
    }
    
    .partner-next {
        right: -10px;
    }
}

@media (max-width: 600px) {
    .partner-carousel-container {
        padding: 3rem 20px 2rem 20px;
    }
    
    .partner-carousel-wrapper {
        width: 600px;
    }
    
    .partner-logo {
        width: 110px;
        height: 55px;
        padding: 8px;
    }
    
    .partner-carousel-track {
        gap: 16px;
    }
}

/* --- Contact Form Section - 新的表單樣式 --- */
.contact-section {
    background-color: var(--light-bg);
    padding: 5rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.contact-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 30%, rgba(100, 210, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(10, 132, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.contact-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.contact-header {
    text-align: center;
    margin-bottom: 3rem;
}

.contact-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--tech-cyan);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.contact-header p {
    font-size: 1.2rem;
    color: rgba(201, 209, 217, 0.8);
    margin: 0;
    font-style: italic;
    max-width: 800px;
    margin: 0 auto;
}

.contact-form {
    background: rgba(13, 17, 23, 0.6);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid rgba(100, 210, 255, 0.1);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--tech-cyan);
    box-shadow: 0 0 0 3px rgba(100, 210, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-submit-btn {
    width: 100%;
    padding: 1.2rem 2rem;
    background: linear-gradient(135deg, var(--tech-blue), var(--tech-cyan));
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.contact-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(10, 132, 255, 0.3);
}

.contact-submit-btn:active {
    transform: translateY(0);
}

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.form-message {
    margin-top: 1.5rem;
    padding: 1rem 1.2rem;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
}

.form-message.success {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: #28a745;
}

.form-message.error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #dc3545;
}

/* --- 響應式設計 --- */
@media (max-width: 1024px) {
    .partner-carousel-container {
        padding: 0 30px;
    }
    
    .partner-logo {
        width: 180px;
        height: 90px;
    }
}

@media (max-width: 768px) {
    .contact-form {
        padding: 2rem 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .partner-carousel-container {
        padding: 0 15px;
    }
    
    .partner-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .partner-prev {
        left: -10px;
    }
    
    .partner-next {
        right: -10px;
    }
    
    .partner-logo {
        width: 160px;
        height: 80px;
    }
}

@media (max-width: 600px) {
    .contact-section {
        padding: 3rem 1rem;
    }
    
    .contact-form {
        padding: 1.5rem 1rem;
    }
    
    .contact-section h2 {
        font-size: 2rem;
    }
    
    .partner-carousel-track {
        gap: 16px;
        padding: 1rem 0;
    }
    
    .partner-logo {
        width: 140px;
        height: 70px;
        padding: 10px;
    }
}

/* --- 11. Responsive Styles --- */
@media (min-width: 1201px) {
    .button-container {
        max-width: 1200px;
        margin: 0 auto;
        justify-content: center;
        gap: 16px;
    }
    
    .link-button {
        padding: 12px 24px;
        font-size: 1rem;
        font-weight: 600;
    }
}

@media (min-width: 1400px) {
    .link-button {
        padding: 14px 28px;
        font-size: 1.1rem;
        font-weight: 600;
    }
    
    .button-container {
        gap: 18px;
    }
}

@media (min-width: 993px) and (max-width: 1200px) {
    .link-button {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
    
    .button-container {
        gap: 14px;
    }
}

@media (min-width: 1600px) {
    .education-container {
        max-width: 1400px;
    }
}

@media (min-width: 1400px) {
    .education-container {
        max-width: 1300px;
    }
}

@media (min-width: 1200px) {
    .education-container {
        max-width: 1200px;
    }
}

@media (max-width: 1199px) {
    .education-container {
        max-width: 1000px;
    }
}

@media (max-width: 1024px) {
    .events-carousel-container { 
        padding: 0 10px; 
    }
    
    .event-nav-btn { 
        width: 45px; 
        height: 45px; 
        font-size: 1.2rem; 
    }
    
    #prev-event { 
        left: 10px; 
    }
    
    #next-event { 
        right: 10px; 
    }
    
    .video-carousel-prev,
    .video-carousel-next {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    .partner-prev,
    .video-carousel-prev { 
        left: 22px; 
    }
    
    .partner-nav-btn,
    .video-carousel-next { 
        right: 22px; 
    }
}

@media (max-width: 992px) {
    .intro-image {
        width: 280px;
        height: 280px;
        flex-basis: 280px;
        border-radius: 16px;
        overflow: hidden;
        background-color: var(--light-bg);
    }

    .timeline-wrapper::before {
        left: 25px;
        transform: none;
    }

    .timeline-item {
        width: 100%;
        padding-left: 65px;
        padding-right: 15px;
        left: 0 !important;
    }

    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        text-align: left;
    }

    .timeline-icon {
        left: 25px !important;
        right: auto !important;
        transform: translateX(-50%) !important;
    }

    .timeline-content::before {
        left: -20px !important;
        right: auto !important;
        border-left-color: transparent !important;
        border-right-color: #30363d !important;
    }

    .timeline-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        border-width: 2px;
    }

    .education-container {
        max-width: 800px;
    }
}

@media (max-width: 768px) {
    .slide-content {
        padding: 2.5rem;
        max-width: 90%;
    }

    .slide-content h1 {
        font-size: 2.2rem;
    }

    .slide-content p {
        font-size: 1rem;
    }

    .intro-section {
        flex-direction: column;
        text-align: center;
        gap: 2.5rem;
    }

    .intro-image {
        width: 250px;
        height: 250px;
        flex-basis: 250px;
        order: -1;
        margin: 0 auto;
        border-radius: 16px;
        overflow: hidden;
        background-color: var(--light-bg);
    }

    .intro-text h1 {
        text-align: center;
        font-size: 2.5rem;
    }

    .intro-text p {
        text-align: justify;
    }

    .motto-section {
        margin: 2rem 0 3rem 0;
    }

    .motto {
        font-size: 1rem;
        padding-top: 1.5rem;
    }

    .motto::before {
        width: 80%;
    }

    .video-carousel-section {
        padding: 30px 15px;
    }

    .section-title,
    .education-section h2,
    .events-header h2,
    .video-carousel-title,
    .link-showcase-section h2,
    .partner-showcase-section h2,
    .contact-section h2 {
        font-size: 2.2rem;
        margin-bottom: 1.8rem;
        line-height: 1.2;
    }

    .skills-text-center .text-muted,
    .events-header .text-muted,
    .video-carousel-section .text-muted,
    .link-showcase-section p,
    .partner-showcase-section p {
        font-size: 1rem;
        margin-bottom: 2rem;
        padding: 0 10px;
    }

    .events-carousel-container {
        padding: 0 5px;
    }
    
    .event-nav-btn { 
        width: 30px; 
        height: 30px; 
        font-size: 1.1rem; 
    }
    
    .video-carousel-title {
        margin-top: 3rem;
    }

    .video-carousel-section .text-muted {
        margin: 1rem 0;
        padding: 0 10px;
    }

    .video-carousel-display {
        height: 250px;
        padding: 0 10px;
    }

    .video-carousel-slide {
        flex: 0 0 280px;
        height: 157px;
        overflow: hidden;
    }

    .video-carousel-slide.active {
        transform: scale(1.02);
    }

    .video-carousel-prev,
    .video-carousel-next {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .video-carousel-prev { 
        left: -5px; 
    }
    
    .video-carousel-next { 
        right: -5px; 
    }

    .skills-col {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .education-container {
        max-width: 700px;
        padding: 0 1.5rem;
    }

    .intro-text h1 {
        font-size: 2rem !important;
        margin-bottom: 1.5rem;
    }

    .event-nav-btn { 
        width: 40px; 
        height: 40px; 
        font-size: 1rem; 
    }
    
    .event-nav-btn #prev-event { 
        left: 2px; 
    }
    
    .event-nav-btn #next-event { 
        right: 2px; 
    }

}

@media (max-width: 600px) {
    .events-carousel-container {
        padding: 0;
    }
    
    .event-nav-btn { 
        width: 40px; 
        height: 40px; 
        font-size: 0.9rem; 
    }
    
    #prev-event { 
        left: 2px; 
    }
    
    #next-event { 
        right: 2px; 
    }

    .events-header h2 {
        font-size: 2.5rem;
        margin-bottom: 1.5rem;
    }

    .video-carousel-prev { 
        left: -5px; 
    }
    
    .video-carousel-next { 
        right: -5px; 
    }

    .intro-image {
        width: 200px;
        height: 200px;
        margin: 0 auto;
        border-radius: 16px;
        overflow: hidden;
        background-color: var(--light-bg);
    }

    .section-title,
    .education-section h2,
    .events-header h2,
    .video-carousel-title,
    .link-showcase-section h2,
    .partner-showcase-section h2,
    .contact-section h2 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
        line-height: 1.2;
        padding: 0 10px;
    }

    .skills-text-center .text-muted,
    .events-header .text-muted,
    .video-carousel-section .text-muted,
    .link-showcase-section p,
    .partner-showcase-section p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .video-carousel-section {
        padding: 20px 10px;
    }

    .video-carousel-prev,
    .video-carousel-next {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .video-carousel-prev { 
        left: 10px;
    }
    
    .video-carousel-next { 
        right: 10px;
    }

    .intro-image {
        width: 200px;
        height: 200px;
        flex-basis: 200px;
        margin: 0 auto;
        border-radius: 16px;
        overflow: hidden;
        background-color: var(--light-bg);
    }

    .section-title,
    .education-section h2,
    .events-header h2,
    .video-carousel-title,
    .link-showcase-section h2,
    .partner-showcase-section h2,
    .contact-section h2 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
        line-height: 1.3;
        padding: 0 10px;
    }

    .skills-text-center .text-muted,
    .events-header .text-muted,
    .video-carousel-section .text-muted,
    .link-showcase-section p,
    .partner-showcase-section p {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
        padding: 0 5px;
        line-height: 1.5;
    }

    .video-carousel-title {
        line-height: 1.3;
    }

    .video-carousel-section .text-muted {
        font-size: 1.1rem;
        padding: 0 5px;
    }

    .video-carousel-display {
        height: 220px;
        padding: 0 10px;
        overflow: visible;
        max-width: 100vw;
    }

    .video-carousel-container {
        width: 100%;
        max-width: 320px;
        height: 180px;
        margin: 0 auto;
    }

    .video-carousel-slide {
        flex: 0 0 auto;
        width: 200px;
        height: 130px;
        max-width: calc(100vw - 100px);
        aspect-ratio: 4 / 3;
        border-width: 1px;
        border-radius: 8px;
        overflow: hidden;
    }

    .video-carousel-prev,
    .video-carousel-next {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .video-carousel-prev { 
        left: 5px;
    }

    .video-carousel-next { 
        right: 5px;
    }

    .education-container {
        max-width: 100%;
        padding: 0 1rem;
    }
}

@media (max-width: 414px) {
    .video-carousel-section {
        padding: 30px 15px;
        overflow-x: hidden;
    }

    .video-carousel-display {
        height: 280px;
        padding: 0 10px;
        width: 100%;
        max-width: 100vw;
        overflow: visible;
    }

    .video-carousel-container {
        width: 100%;
        max-width: 350px;
        height: 220px;
        margin: 0 auto;
    }

    .video-carousel-slide {
        width: 240px;
        height: 160px;
        border-radius: 8px;
    }

    .video-carousel-slide[data-position="0"] {
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%) translateZ(80px) scale(1.1);
        z-index: 5;
        border: 2px solid var(--tech-cyan);
        box-shadow: 0 10px 25px rgba(100, 210, 255, 0.3);
    }

    .video-carousel-slide[data-position="1"] {
        left: 75%;
        top: 50%;
        transform: translate(-50%, -50%) translateZ(40px) scale(0.85);
        z-index: 4;
        opacity: 0.7;
    }

    .video-carousel-slide[data-position="2"] {
        left: 95%;
        top: 50%;
        transform: translate(-50%, -50%) translateZ(0px) scale(0.6);
        z-index: 2;
        opacity: 0.4;
    }

    .video-carousel-slide[data-position="3"] {
        left: 5%;
        top: 50%;
        transform: translate(-50%, -50%) translateZ(0px) scale(0.6);
        z-index: 2;
        opacity: 0.4;
    }

    .video-carousel-slide[data-position="4"] {
        left: 25%;
        top: 50%;
        transform: translate(-50%, -50%) translateZ(40px) scale(0.85);
        z-index: 4;
        opacity: 0.7;
    }

    .video-carousel-prev,
    .video-carousel-next {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }

    .video-carousel-prev { 
        left: 10px;
    }

    .video-carousel-next { 
        right: 10px;
    }
}

@media (max-width: 360px) {
    .video-carousel-display {
        height: 250px;
        padding: 0 5px;
    }

    .video-carousel-container {
        max-width: 320px;
        height: 200px;
    }

    .video-carousel-slide {
        width: 220px;
        height: 140px;
    }

    .video-carousel-slide[data-position="0"] {
        transform: translate(-50%, -50%) translateZ(60px) scale(1.05);
    }

    .video-carousel-slide[data-position="1"],
    .video-carousel-slide[data-position="4"] {
        transform: translate(-50%, -50%) translateZ(30px) scale(0.8);
    }

    .video-carousel-prev,
    .video-carousel-next {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }

    .video-carousel-prev { 
        left: 5px;
    }

    .video-carousel-next { 
        right: 5px;
    }
}

/* === Enhanced Research Interests Section with Connect Effects === */
.research-interests-section {
    padding: 80px 0;
    background-color: #0d1117;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.research-interests-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 25% 25%, rgba(100, 210, 255, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(10, 132, 255, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.research-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

.research-header {
    text-align: center;
    margin-bottom: 4rem;
}

.research-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--tech-cyan);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.research-subtitle {
    font-size: 1.2rem;
    color: rgba(201, 209, 217, 0.8);
    margin: 0;
    font-style: italic;
    max-width: 800px;
    margin: 0 auto;
}

.research-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.research-category {
    border-radius: 20px;
    padding: 2rem 1.5rem;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

/* === 四個不同配色主題 === */

/* 第一個類別 - Machine Intelligence (科技藍色系) */
.research-category:nth-child(1) {
    border: 1px solid rgba(0, 210, 211, 0.3);
    background: linear-gradient(135deg, 
        rgba(22, 27, 34, 0.85) 0%, 
        rgba(30, 35, 42, 0.7) 50%,
        rgba(0, 210, 211, 0.12) 100%);
}

.research-category:nth-child(1)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #00d2d3, #0099cc, #58a6ff, #0084ff);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
    box-shadow: 0 2px 10px rgba(0, 210, 211, 0.3);
}

.research-category:nth-child(1):hover {
    transform: translateY(-8px);
    border-color: rgba(0, 210, 211, 0.5);
    box-shadow: 0 20px 50px rgba(0, 210, 211, 0.25);
    background: linear-gradient(135deg, 
        rgba(22, 27, 34, 0.9) 0%, 
        rgba(30, 35, 42, 0.7) 50%,
        rgba(0, 210, 211, 0.12) 100%);
}

.research-category:nth-child(1) .category-icon {
    background: linear-gradient(135deg, #00d2d3 0%, #0099cc 30%, #58a6ff 70%, #0084ff 100%);
    box-shadow: 0 8px 25px rgba(0, 210, 211, 0.3);
}

.research-category:nth-child(1) .research-item i {
    color: #58a6ff;
    text-shadow: 0 0 8px rgba(88, 166, 255, 0.5);
}

.research-category:nth-child(1) .research-item:hover {
    background: linear-gradient(135deg, rgba(0, 210, 211, 0.15), rgba(88, 166, 255, 0.08));
    border-color: #58a6ff;
}

.research-category:nth-child(1) .research-item::before {
    background: linear-gradient(90deg, transparent, rgba(0, 210, 211, 0.2), rgba(88, 166, 255, 0.15), transparent);
}

/* 第二個類別 - Connected Systems (綠色系) */
.research-category:nth-child(2) {
    border: 1px solid rgba(46, 213, 115, 0.3);
    background: linear-gradient(135deg, 
        rgba(22, 27, 34, 0.85) 0%, 
        rgba(30, 35, 42, 0.7) 50%,
        rgba(46, 213, 115, 0.12) 100%);
}

.research-category:nth-child(2)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #11998e, #2ed573, #7bed9f, #70e000);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
    box-shadow: 0 2px 10px rgba(46, 213, 115, 0.3);
}

.research-category:nth-child(2):hover {
    transform: translateY(-8px);
    border-color: rgba(46, 213, 115, 0.5);
    box-shadow: 0 20px 50px rgba(46, 213, 115, 0.25);
    background: linear-gradient(135deg, 
        rgba(22, 27, 34, 0.9) 0%, 
        rgba(30, 35, 42, 0.7) 50%,
        rgba(46, 213, 115, 0.12) 100%);
}

.research-category:nth-child(2) .category-icon {
    background: linear-gradient(135deg, #11998e 0%, #2ed573 30%, #7bed9f 70%, #70e000 100%);
    box-shadow: 0 8px 25px rgba(46, 213, 115, 0.3);
}

.research-category:nth-child(2) .research-item i {
    color: #7bed9f;
    text-shadow: 0 0 8px rgba(123, 237, 159, 0.5);
}

.research-category:nth-child(2) .research-item:hover {
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.15), rgba(123, 237, 159, 0.08));
    border-color: #7bed9f;
}

.research-category:nth-child(2) .research-item::before {
    background: linear-gradient(90deg, transparent, rgba(46, 213, 115, 0.2), rgba(123, 237, 159, 0.15), transparent);
}

/* 第三個類別 - Smart Mobility (橙粉色系) */
.research-category:nth-child(3) {
    border: 1px solid rgba(255, 159, 67, 0.3);
    background: linear-gradient(135deg, 
        rgba(22, 27, 34, 0.85) 0%, 
        rgba(30, 35, 42, 0.7) 50%,
        rgba(255, 159, 67, 0.12) 100%);
}

.research-category:nth-child(3)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6b6b, #ff9f43, #feca57, #ff7675);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
    box-shadow: 0 2px 10px rgba(255, 159, 67, 0.3);
}

.research-category:nth-child(3):hover {
    transform: translateY(-8px);
    border-color: rgba(255, 159, 67, 0.5);
    box-shadow: 0 20px 50px rgba(255, 159, 67, 0.25);
    background: linear-gradient(135deg, 
        rgba(22, 27, 34, 0.9) 0%, 
        rgba(30, 35, 42, 0.7) 50%,
        rgba(255, 159, 67, 0.12) 100%);
}

.research-category:nth-child(3) .category-icon {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff9f43 30%, #feca57 70%, #ff7675 100%);
    box-shadow: 0 8px 25px rgba(255, 159, 67, 0.3);
}

.research-category:nth-child(3) .research-item i {
    color: #feca57;
    text-shadow: 0 0 8px rgba(254, 202, 87, 0.5);
}

.research-category:nth-child(3) .research-item:hover {
    background: linear-gradient(135deg, rgba(255, 159, 67, 0.15), rgba(254, 202, 87, 0.08));
    border-color: #feca57;
}

.research-category:nth-child(3) .research-item::before {
    background: linear-gradient(90deg, transparent, rgba(255, 159, 67, 0.2), rgba(254, 202, 87, 0.15), transparent);
}

/* 第四個類別 - Human-Centered Tech (紫粉色系) */
.research-category:nth-child(4) {
    border: 1px solid rgba(240, 147, 251, 0.3);
    background: linear-gradient(135deg, 
        rgba(22, 27, 34, 0.85) 0%, 
        rgba(30, 35, 42, 0.7) 50%,
        rgba(240, 147, 251, 0.12) 100%);
}

.research-category:nth-child(4)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #f093fb, #f5576c, #a8edea, #fed6e3);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
    box-shadow: 0 2px 10px rgba(240, 147, 251, 0.3);
}

.research-category:nth-child(4):hover {
    transform: translateY(-8px);
    border-color: rgba(240, 147, 251, 0.5);
    box-shadow: 0 20px 50px rgba(240, 147, 251, 0.25);
    background: linear-gradient(135deg, 
        rgba(22, 27, 34, 0.9) 0%, 
        rgba(30, 35, 42, 0.7) 50%,
        rgba(240, 147, 251, 0.12) 100%);
}

.research-category:nth-child(4) .category-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 30%, #a8edea 70%, #fed6e3 100%);
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.3);
}

.research-category:nth-child(4) .research-item i {
    color: #f093fb;
    text-shadow: 0 0 8px rgba(240, 147, 251, 0.5);
}

.research-category:nth-child(4) .research-item:hover {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.15), rgba(240, 147, 251, 0.08));
    border-color: #f093fb;
}

.research-category:nth-child(4) .research-item::before {
    background: linear-gradient(90deg, transparent, rgba(240, 147, 251, 0.2), rgba(240, 147, 251, 0.15), transparent);
}

/* === 通用懸停效果 === */
.research-category:hover::before {
    transform: scaleX(1);
}

.category-header {
    text-align: center;
}

.category-icon {
    width: 70px;
    height: 70px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem auto;
    font-size: 1.8rem;
    color: white;
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    opacity: 0.2;
    border-radius: inherit;
}

.research-category:hover .category-icon {
    transform: scale(1.1) rotate(5deg);
}

.category-title {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    line-height: 1.3;
    text-align: center;
    min-height: 2.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
}

.research-items {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    flex: 1;
}

.research-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.research-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    transition: left 0.5s ease;
}

.research-item:hover {
    transform: translateX(8px);
    color: #fff;
}

.research-item:hover::before {
    left: 100%;
}

.research-item i {
    font-size: 1rem;
    width: 16px;
    text-align: center;
    transition: color 0.3s ease;
    flex-shrink: 0;
}

.research-item:hover i {
    color: #fff;
}

.justify-content-between {
    margin-bottom: 0.3rem;
}

/* === 響應式設計 === */
@media (max-width: 1400px) {
    .research-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .research-category {
        min-height: 380px;
    }
    
    .category-title {
        font-size: 1.1rem;
    }
    
    .research-item {
        font-size: 0.8rem;
        padding: 0.8rem 1rem;
    }
    
    .research-item i {
        font-size: 1.1rem;
        width: 18px;
    }
}

@media (max-width: 768px) {
    .research-interests-section {
        padding: 60px 0;
    }
    
    .research-header h2 {
        font-size: 2.2rem;
    }
    
    .research-subtitle {
        font-size: 1.1rem;
        padding: 0 1rem;
    }
    
    .research-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .research-category {
        padding: 1.8rem 1.3rem;
        min-height: 400px;
    }
    
    .category-icon {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
    }
    
    .category-title {
        font-size: 1.2rem;
    }
}

@media (max-width: 600px) {
    .research-container {
        padding: 0 1rem;
    }
    
    .research-header h2 {
        font-size: 2rem;
    }
    
    .research-category {
        padding: 1.5rem 1rem;
        min-height: 280px;
    }
    
    .category-icon {
        width: 55px;
        height: 55px;
        font-size: 1.5rem;
    }
    
    .category-title {
        font-size: 1.2rem;
    }
    
    .research-item {
        padding: 0.9rem 1rem;
        font-size: 0.9rem;
    }
    
    .research-item i {
        font-size: 1.1rem;
    }
}

/* --- Connect with Me - 三個不同配色主題 --- */
.connect-showcase-section {
    padding: 4rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 第一個分類 - Communication (通訊綠 - 更明顯的漸層) */
.connect-category:nth-child(1) {
    border-color: rgba(46, 213, 115, 0.25);
    background: linear-gradient(135deg, 
        rgba(22, 27, 34, 0.8) 0%, 
        rgba(30, 35, 42, 0.6) 50%,
        rgba(46, 213, 115, 0.08) 100%);
}

.connect-category:nth-child(1)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #00d2d3, #2ed573, #7bed9f, #70e000);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
    box-shadow: 0 2px 10px rgba(46, 213, 115, 0.3);
}

.connect-category:nth-child(1):hover {
    transform: translateY(-8px);
    border-color: rgba(46, 213, 115, 0.5);
    box-shadow: 0 20px 50px rgba(46, 213, 115, 0.25);
    background: linear-gradient(135deg, 
        rgba(22, 27, 34, 0.9) 0%, 
        rgba(30, 35, 42, 0.7) 50%,
        rgba(46, 213, 115, 0.12) 100%);
}

.connect-category:nth-child(1) .category-icon {
    background: linear-gradient(135deg, #00d2d3 0%, #2ed573 30%, #7bed9f 70%, #70e000 100%);
    box-shadow: 0 8px 25px rgba(46, 213, 115, 0.3);
}

.connect-category:nth-child(1) .connect-link i {
    color: #7bed9f;
    text-shadow: 0 0 8px rgba(123, 237, 159, 0.5);
}

.connect-category:nth-child(1) .connect-link:hover {
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.15), rgba(123, 237, 159, 0.08));
    border-color: #7bed9f;
}

.connect-category:nth-child(1) .connect-link::before {
    background: linear-gradient(90deg, transparent, rgba(46, 213, 115, 0.2), rgba(123, 237, 159, 0.15), transparent);
}

/* 第二個分類 - Content & Code (程式橙 - 更明顯的漸層) */
.connect-category:nth-child(2) {
    border-color: rgba(255, 159, 67, 0.25);
    background: linear-gradient(135deg, 
        rgba(22, 27, 34, 0.8) 0%, 
        rgba(30, 35, 42, 0.6) 50%,
        rgba(255, 159, 67, 0.08) 100%);
}

.connect-category:nth-child(2)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6b6b, #ff9f43, #feca57, #ff7675);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
    box-shadow: 0 2px 10px rgba(255, 159, 67, 0.3);
}

.connect-category:nth-child(2):hover {
    transform: translateY(-8px);
    border-color: rgba(255, 159, 67, 0.5);
    box-shadow: 0 20px 50px rgba(255, 159, 67, 0.25);
    background: linear-gradient(135deg, 
        rgba(22, 27, 34, 0.9) 0%, 
        rgba(30, 35, 42, 0.7) 50%,
        rgba(255, 159, 67, 0.12) 100%);
}

.connect-category:nth-child(2) .category-icon {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff9f43 30%, #feca57 70%, #ff7675 100%);
    box-shadow: 0 8px 25px rgba(255, 159, 67, 0.3);
}

.connect-category:nth-child(2) .connect-link i {
    color: #feca57;
    text-shadow: 0 0 8px rgba(254, 202, 87, 0.5);
}

.connect-category:nth-child(2) .connect-link:hover {
    background: linear-gradient(135deg, rgba(255, 159, 67, 0.15), rgba(254, 202, 87, 0.08));
    border-color: #feca57;
}

.connect-category:nth-child(2) .connect-link::before {
    background: linear-gradient(90deg, transparent, rgba(255, 159, 67, 0.2), rgba(254, 202, 87, 0.15), transparent);
}

/* 第三個分類 - Research (學術藍 - 更明顯的漸層) */
.connect-category:nth-child(3) {
    border-color: rgba(116, 185, 255, 0.25);
    background: linear-gradient(135deg, 
        rgba(22, 27, 34, 0.8) 0%, 
        rgba(30, 35, 42, 0.6) 50%,
        rgba(116, 185, 255, 0.08) 100%);
}

.connect-category:nth-child(3)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #00cec9, #74b9ff, #0984e3, #6c5ce7);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
    box-shadow: 0 2px 10px rgba(116, 185, 255, 0.3);
}

.connect-category:nth-child(3):hover {
    transform: translateY(-8px);
    border-color: rgba(116, 185, 255, 0.5);
    box-shadow: 0 20px 50px rgba(116, 185, 255, 0.25);
    background: linear-gradient(135deg, 
        rgba(22, 27, 34, 0.9) 0%, 
        rgba(30, 35, 42, 0.7) 50%,
        rgba(116, 185, 255, 0.12) 100%);
}

.connect-category:nth-child(3) .category-icon {
    background: linear-gradient(135deg, #00cec9 0%, #74b9ff 30%, #0984e3 70%, #6c5ce7 100%);
    box-shadow: 0 8px 25px rgba(116, 185, 255, 0.3);
}

.connect-category:nth-child(3) .connect-link i {
    color: #74b9ff;
    text-shadow: 0 0 8px rgba(116, 185, 255, 0.5);
}

.connect-category:nth-child(3) .connect-link:hover {
    background: linear-gradient(135deg, rgba(116, 185, 255, 0.15), rgba(116, 185, 255, 0.08));
    border-color: #74b9ff;
}

.connect-category:nth-child(3) .connect-link::before {
    background: linear-gradient(90deg, transparent, rgba(116, 185, 255, 0.2), rgba(116, 185, 255, 0.15), transparent);
}

/* 通用懸停效果 */
.connect-category:hover::before {
    transform: scaleX(1);
}

.connect-category:hover .category-icon {
    transform: scale(1.1) rotate(5deg);
}

.category-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.5rem;
    text-align: center;
}

.connect-links {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1; /* 讓連結區域填滿剩餘空間 */
}

.connect-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.connect-link:hover {
    transform: translateX(6px);
    color: #fff;
}

.connect-link:hover::before {
    left: 100%;
}

.connect-link i {
    font-size: 1.1rem;
    width: 18px;
    text-align: center;
    transition: color 0.3s ease;
}

.connect-link:hover i {
    color: #fff;
}

/* 強制三列顯示，即使在較小屏幕上 */
@media (min-width: 992px) {
    .connect-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

.connect-category {
    background: linear-gradient(135deg, 
        rgba(22, 27, 34, 0.8) 0%, 
        rgba(30, 35, 42, 0.6) 100%);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    border: 1px solid rgba(100, 210, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    min-height: 400px; /* 確保卡片高度一致 */
    display: flex;
    flex-direction: column;
}

.connect-category::before {
    content: '';
    position: absolute;
}

.section-title,
.research-header h2,
.education-section h2,
.events-header h2,
.video-carousel-title,
.link-showcase-section h2,
.partner-showcase-section h2,
.connect-header h2,
.contact-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    background: linear-gradient(
        45deg,
        #58a6ff,
        #00d2d3,
        #2ed573,
        #f093fb,
        #58a6ff
    );
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientFlow 4s ease-in-out infinite;
    text-align: center;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}