/* 通用樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', 'Noto Sans', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f8f8;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: #1a73e8;
    transition: color 0.3s;
}

a:hover {
    color: #0c52a9;
}

ul {
    list-style: none;
}

/* 頭部樣式 */
header {
    background: transparent;
    box-shadow: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    transition: all 0.3s ease;
}

header.scrolled {
    background-color: #0c52a9;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding:  10px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo h1 {
    font-size: 24px;
    font-weight: 500;
    color: #ffffff;
    transition: color 0.3s ease;
}


/* 修改導航樣式為水平展開 */
.main-nav {
    display: block;
    position: static;
    width: 50%;
    height: auto;
    background-color: transparent;
    box-shadow: none;
    padding: 0;
    overflow: visible;
}

.main-nav ul {
    display: flex;
    flex-direction: row;
    gap: 20px;
}

.main-nav li {
    margin: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.main-nav a {
    color: #fff;
    font-weight: 500;
    padding: 5px 10px;
    display: block;
    font-size: 16px;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: #e5e5e5;
    border-bottom: 2px solid #fff;
}

.main-nav .active a {
    color: #fff;
    font-weight: 700;
    border-bottom: 2px solid #fff;
}

/* 移除漢堡菜單按鈕 */
.menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 24px;
    color: #fff;
    background: none;
    border: none;
    padding: 5px;
    z-index: 101;
}

.menu-toggle .material-icons {
    font-size: 28px;
}

/* 調整主體內容的邊距，以適應固定導航欄 */
main {
    padding-top: 80px;
}

/* 頁面標題樣式，移除頂部間距 */
.page-header {
    margin-top: -80px;
}

/* 英雄區塊樣式 */
.hero {
    position: relative;
    color: white;
    text-align: center;
    min-height: 400px;
    overflow: hidden;
    margin-top: 0;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;   /* 這行是關鍵，讓圖片等比例填滿容器，多餘的部分會裁切 */
    object-position: center;
    position: absolute;
    top: 0;
    left: 0;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.4));
    z-index: 2;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 170px 20px 0;
    position: relative;
    z-index: 3;
}

.hero h2 {
    font-size: 36px;
    margin-bottom: 20px;
    font-weight: 500;
}

.hero p {
    font-size: 18px;
    margin-bottom: 30px;
}

.hero-text {
    font-size: 20px;
    line-height: 1.5;
}

/* 介紹區塊樣式 */
.introduction {
    padding: 60px 0;
    background-color: white;
}

.introduction h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #1a73e8;
    font-weight: 500;
}

.introduction p {
    margin-bottom: 30px;
    font-size: 16px;
    line-height: 1.8;
}

.research-directions, .research-topics {
    margin-bottom: 40px;
}

.research-directions ul, .research-topics ul {
    padding-left: 20px;
}

.research-directions li, .research-topics li {
    margin-bottom: 12px;
    position: relative;
    padding-left: 20px;
    line-height: 1.6;
}

.research-directions li:before, .research-topics li:before {
    content: '•';
    color: #1a73e8;
    position: absolute;
    left: 0;
    font-size: 20px;
    line-height: 1;
}

/* 特色研究樣式 */
.featured-research {
    padding: 60px 0;
    background-color: #f8f8f8;
}

.featured-research h3 {
    font-size: 24px;
    margin-bottom: 30px;
    color: #1a73e8;
    font-weight: 500;
    text-align: center;
}

.research-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    align-items: stretch;
}

.research-item {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.research-item:hover {
    transform: translateY(-5px);
}

.research-image {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 360px;
}

.research-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background: #fff;
}

.research-item:hover .research-image img {
    transform: none;
}

.research-caption {
    padding: 15px;
}

.research-caption p {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* 最近出版物樣式 */
.recent-publications {
    padding: 60px 0;
    background-color: white;
}

.recent-publications h3 {
    font-size: 24px;
    margin-bottom: 30px;
    color: #1a73e8;
    font-weight: 500;
}

.publication-list {
    margin-bottom: 30px;
}

.publication-list li {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.publication-list li:last-child {
    border-bottom: none;
}

.publication-list p {
    font-size: 15px;
    line-height: 1.6;
}

.publication-list strong {
    font-weight: 700;
}

.publication-list em {
    font-style: italic;
}

.view-more {
    text-align: center;
    margin-top: 20px;
}

.view-more a {
    display: inline-block;
    padding: 10px 20px;
    background-color: #1a73e8;
    color: white;
    border-radius: 5px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.view-more a:hover {
    background-color: #0c52a9;
}

/* 研究頁面樣式 */
.research-section {
    padding: 60px 0;
    background-color: white;
}

.research-intro {
    margin-bottom: 50px;
}

.research-intro p {
    font-size: 17px;
    line-height: 1.8;
    max-width: 900px;
    margin: 0 auto;
}

.research-area {
    margin-bottom: 60px;
    border-bottom: 1px solid #eee;
    padding-bottom: 40px;
}

.research-area:last-child {
    border-bottom: none;
}

.research-area h3 {
    font-size: 26px;
    color: #1a73e8;
    margin-bottom: 25px;
    font-weight: 500;
}

.research-content {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: flex-start;
}

.research-image {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
}

.research-image img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: block;
}

.research-details {
    flex: 2;
    min-width: 300px;
}

.research-details p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.research-details h4 {
    margin: 25px 0 15px;
    font-size: 18px;
    color: #333;
    font-weight: 500;
}

.research-details ul {
    padding-left: 20px;
}

.research-details li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 20px;
}

.research-details li:before {
    content: '•';
    color: #1a73e8;
    position: absolute;
    left: 0;
    font-size: 20px;
}

/* 頁面標題樣式 */
.page-header {
    background-color: #1a73e8;
    color: white;
    padding: 30px 0;
    text-align: center;
}

.page-header h2 {
    font-size: 32px;
    font-weight: 500;
}

/* 成員頁面樣式 */
.people-section {
    padding: 60px 0;
    background-color: white;
}

/* 新的人員區塊樣式 */
.person-block {
    display: flex;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.person-block:last-child {
    border-bottom: none;
}

.person-block .person-image {
    width: 250px;
    height: 250px;
    margin-right: 30px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
}

.person-block .person-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.person-block .person-info {
    flex: 1;
}

.person-block .person-info a{
    text-decoration: underline;
}


.person-block .person-info h4 {
    font-size: 20px;
    margin-bottom: 12px;
    color: #1a73e8;
    font-weight: 500;
}

.person-block .person-info h5 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #1a73e8;
    font-weight: 500;
}

.person-block .person-info p {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* 頁腳樣式 */
footer {
    background-color: #333;
    color: white;
    padding: 40px 0;
    text-align: center;
    font-size: 14px;
}

footer p {
    margin-bottom: 10px;
}

footer a {
    color: white;
    text-decoration: none;
    -webkit-text-size-adjust: 100%;
    word-wrap: break-word;
    font-variant-ligatures: none;
    font-style: inherit;
    font-weight: 400;
    font-family: Lato, sans-serif;
    line-height: 1.2;
    text-align: center;
    box-sizing: border-box;
    font-size: 14px;
    vertical-align: baseline;
    text-decoration: underline
}

footer a:hover {
    color: white;
}

/* 響應式設計 */
@media (max-width: 992px) {
    .hero h2 {
        font-size: 32px;
    }
    
    .hero-text {
        font-size: 18px;
    }
    
    .research-content {
        flex-direction: column;
        gap: 25px;
    }
    
    .research-image {
        margin-bottom: 0;
        max-width: 100%;
        align-self: center;
    }
    
    .research-details {
        min-width: 100%;
    }
    
    .research-showcase {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 10px 10px ;
        width: 100%;
    }
    
    /* 顯示漢堡菜單按鈕 */
    .menu-toggle {
        display: block;
    }
    
    /* 修改導航欄樣式為垂直下拉 */
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background-color: #0c52a9;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        padding: 80px 20px 20px;
        overflow-y: auto;
        transition: right 0.3s ease;
        z-index: 99;
    }
    
    .main-nav.active {
        right: 0;
    }
    
    .main-nav ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .main-nav li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-bottom: 10px;
    }
    
    .main-nav a {
        font-size: 16px;
        padding: 8px 0;
        width: 100%;
        display: block;
    }
    
    .person-block {
        flex-direction: column;
    }
    
    .person-block .person-image {
        width: 100%;
        max-width: 250px;
        height: auto;
        aspect-ratio: 1;
        margin: 0 auto 20px;
    }
    
    .person-block .person-info {
        text-align: center;
    }
    
    .people-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .hero {
        padding: 80px 0;
    }
    
    .hero h2 {
        font-size: 28px;
    }
    
    .hero p {
        font-size: 16px;
    }
    
    .hero-text {
        font-size: 16px;
    }
    
    .introduction, .featured-research, .recent-publications, .research-section {
        padding: 40px 0;
    }
    
    .research-area h3 {
        font-size: 22px;
    }
    
    .research-content {
        gap: 20px;
    }
    
    .research-image {
        max-width: 100%;
        margin: 0 auto;
    }
    
    .research-showcase {
        grid-template-columns: 1fr;
    }
    
    /* 確保圖片和影片在手機尺寸時每排只有一個並置中 */
    .gallery-container {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
        gap: 15px;
    }
    
    .gallery-item {
        max-width: 100%;
        height: 220px; /* 手機版稍微小一點 */
    }
    
    .gallery-image {
        width: 100%;
        height: 100%;
    }
    
    /* YouTube 影片響應式設計 */
    iframe {
        max-width: 100%;
        height: auto;
        display: block;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .hero h2 {
        font-size: 24px;
    }
    
    .hero p {
        font-size: 14px;
    }
    
    .hero-text {
        font-size: 14px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .research-item {
        margin-bottom: 20px;
    }
    
    .research-content {
        gap: 15px;
    }
    
    .research-image {
        max-width: 100%;
        margin: 0 auto 15px;
    }
    
    .research-area {
        margin-bottom: 30px;
    }
    
    .research-area h3 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .main-nav ul {
        gap: 5px;
    }
    
    .main-nav a {
        font-size: 13px;
        padding: 4px 6px;
    }
    
    /* 更好的移動裝置體驗 */
    .gallery-container {
        gap: 15px;
        grid-template-columns: 1fr;
        max-width: 400px;
    }
    
    .gallery-item {
        height: 200px; /* 小螢幕版本更小一點 */
    }
    
    .gallery-image {
        width: 100%;
        height: 100%;
    }
    
    .video-wrapper {
        padding: 0 10px;
    }
}

/* 校友和訪客區塊樣式 */
.alumni-section, .visitors-section {
   
    border-radius: 6px;
    padding: 32px 40px 32px 40px;
    margin: 40px 0;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.alumni-section h3, .visitors-section h3 {
    color: #222;
    font-size: 22px;
    font-weight: bold;
    text-align: left;
    margin-bottom: 32px;
    background: none;
    padding: 0;
    border-radius: 0;
}

.alumni-category, .visitors-section .alumni-category {
    margin-bottom: 28px;
}

.alumni-category h4, .visitors-section .alumni-category h4 {
    font-size: 18px;
    color: #222;
    font-weight: 600;
    margin-bottom: 8px;
    margin-top: 18px;
    border: none;
    padding: 0;
}

.alumni-list, .visitors-section .alumni-list {
    list-style-type: none;
    padding-left: 1.5em;
    margin-bottom: 0;
}

.alumni-list li, .visitors-section .alumni-list li {
    margin-bottom: 6px;
    padding-left: 0.8em;
    text-indent: -0.8em;
    position: relative;
    font-size: 16px;
    line-height: 1.7;
}

.alumni-list li:before, .visitors-section .alumni-list li:before {
    content: "•";
    color: #b08a4f;
    font-size: 1em;
    position: absolute;
    left: 0;
}

@media (max-width: 900px) {
    .alumni-section, .visitors-section {
        padding: 24px 10px;
    }
}

body main {
    padding-top: 0;
}

.alumni-section {
    margin: 40px 0;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

.alumni-section h3 {
    
    border-radius: 6px;
    padding: 24px 0 24px 0;
    color: #222;
    font-size: 22px;
    font-weight: bold;
    text-align: left;
    margin-bottom: 32px;
    margin-top: 0;
    width: 100%;
}

.alumni-category {
    margin-bottom: 28px;
    max-width: 900px;
    margin-left: 0;
}

.alumni-category h4 {
    font-size: 18px;
    color: #222;
    font-weight: 600;
    margin-bottom: 8px;
    margin-top: 18px;
    border: none;
    padding: 0;
}

.alumni-list {
    list-style-type: none;
    padding-left: 1.5em;
    margin-bottom: 0;
}

.alumni-list li {
    margin-bottom: 6px;
    padding-left: 0.8em;
    text-indent: -0.8em;
    position: relative;
    font-size: 16px;
    line-height: 1.7;
}

.alumni-list li:before {
    content: "•";
    color: #b08a4f;
    font-size: 1em;
    position: absolute;
    left: 0;
}

@media (max-width: 900px) {
    .alumni-section h3 {
        padding: 16px 0;
    }
    .alumni-section {
        padding-left: 10px;
        padding-right: 10px;
    }
    .alumni-category {
        max-width: 100%;
    }
}

.section-intro {
    background: #3c60ad;
}

.section-intro-container {
   
    height: 60px;
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-intro-span{
        -webkit-text-size-adjust: 100%;
    word-wrap: break-word;
    font-variant-ligatures: none;
    font-style: inherit;
    font-size: 12pt;
    line-height: 1.56;
    color: rgba(255,255,255,1);
    box-sizing: border-box;
    font-family: Lato, Arial;
    font-weight: 700;

}

/* 出版物頁面樣式 */
.publications-section {
    padding: 60px 0;
    background-color: white;
}

.publications-section h3 {
    font-size: 24px;
    margin: 40px 0 20px;
    color: #1a73e8;
    font-weight: 500;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.publications-section h3:first-child {
    margin-top: 0;
}

/* 加入我們頁面樣式 */
.join-us-section {
    padding: 60px 0;
    background-color: white;
}

.join-us-section h3 {
    font-size: 24px;
    margin: 40px 0 20px;
    color: #1a73e8;
    font-weight: 500;
}

.join-introduction {
    margin-bottom: 40px;
}

.join-introduction p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.position-item, .visiting-section, .funding-section, .lab-environment {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.position-item:last-child, .lab-environment {
    border-bottom: none;
}

.position-item h4, .visiting-section h4, .funding-section h4, .lab-environment h4 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #333;
    font-weight: 500;
}

.position-item p, .visiting-section p, .funding-section p, .lab-environment p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.position-item ul, .funding-section ul, .lab-environment ul {
    margin-bottom: 20px;
    padding-left: 20px;
}

.position-item li, .funding-section li, .lab-environment li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 15px;
}

.position-item li:before, .funding-section li:before, .lab-environment li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #1a73e8;
}

/* 照片頁面樣式 */
.gallery-section {
    padding: 60px 0;
    background-color: white;
}

.gallery-description {
    margin-bottom: 40px;
}

.gallery-description p {
    line-height: 1.6;
}

/* 照片集相關樣式 */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
    align-items: start;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    /* 設定固定高度讓所有照片大小一致 */
    height: 300px;
    background-color: #fff;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
    display: block;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.05);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 15px;
    color: white;
    font-size: 14px;
    opacity: 1; /* 永遠顯示，不透明 */
    transform: translateY(0); /* 永遠在正確位置 */
    transition: all 0.3s ease;
}

.gallery-item:hover .gallery-caption {
    /* 移除hover效果，因為現在永遠顯示 */
    opacity: 1;
    transform: translateY(0);
}

.gallery-category {
    margin-top: 60px;
    margin-bottom: 20px;
}

.gallery-category h3 {
    color: #1a73e8;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 500;
}

/* 聯絡頁面樣式 */
.contact-section {
    padding: 60px 0;
    background-color: white;
}

.contact-intro {
    margin-bottom: 40px;
}

.contact-intro p {
    line-height: 1.6;
}

.transportation-info {
    margin-top: 60px;
}

.transportation-info h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #1a73e8;
    font-weight: 500;
}

.transportation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.transportation-item h4 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
    font-weight: 500;
}

.transportation-item ul {
    padding-left: 20px;
}

.transportation-item li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 5px;
    line-height: 1.5;
}

.transportation-item strong {
    color: #1a73e8;
}

@media (max-width: 768px) {
    .transportation-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.video-wrapper {
    max-width: 800px;         /* 最大寬度限制，可依需要調整 */
    margin: 0 ;           /* 左右置中 */
    padding: 0 16px;          /* RWD 留白，防止太靠邊 */
    box-sizing: border-box;
    position: relative;
    padding-bottom: 56.25%;   /* 16:9 比例 */
    height: 0;
    overflow: hidden;
  }
  
  .responsive-video {
    width: 100%;              /* 讓影片隨容器寬度伸縮 */
    height: 100%;             /* 保持影片比例 */
    display: block;           /* 避免底下有空白 */
    border-radius: 8px;       /* 可選：加點圓角美化 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);  /* 可選：陰影 */
    position: absolute;
    top: 0;
    left: 0;
  }

/* 菜單遮罩 */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 98;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (min-width: 769px) {
    .menu-overlay {
        display: none;
    }
    
    .main-nav {
        display: block !important;
        position: static !important;
        width: auto !important;
        height: auto !important;
        background-color: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
        overflow: visible !important;
        right: 0 !important;
    }
    
    .main-nav ul {
        display: flex !important;
        flex-direction: row !important;
        gap: 20px !important;
    }
    
    .main-nav li {
        width: auto !important;
        border-bottom: none !important;
        padding-bottom: 0 !important;
    }
    
    .main-nav a {
        color: #fff !important;
        font-weight: 500 !important;
        padding: 5px 10px !important;
        display: block !important;
        font-size: 16px !important;
        transition: color 0.3s !important;
        width: auto !important;
    }
}

@media (max-width: 480px) {
    header{
        background-color: #0c52a9;
    }
    .menu-toggle .material-icons {
        font-size: 24px;
    }
    
    .main-nav {
        width: 50%;
    }
}

/* 燈箱樣式 */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: lightboxFadeIn 0.3s ease-out;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: color 0.3s ease;
}

.lightbox-close:hover {
    color: #ccc;
}

.lightbox-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    max-width: 80%;
    text-align: center;
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 讓gallery圖片可點擊 */
.gallery-image {
    cursor: pointer;
}

@media (max-width: 768px) {
    .lightbox-close {
        font-size: 30px;
        top: 15px;
        right: 20px;
    }
    
    .lightbox-caption {
        font-size: 14px;
        bottom: 15px;
        padding: 8px 15px;
    }
}

.link-icon {
    width: 24px;
    height: 24px;
    margin-left: 6px;
}
