/* =========================
   Base
========================= */
html, body {
    height: 100%;
    margin: 0;
    font-family: "Inter", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
    background-color: #f5f6f8;
    color: #334155;
    line-height: 1.7;
    letter-spacing: 0.2px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.wrapper {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* =========================
   Banner Carousel
========================= */

.banner {
    position: relative;
    width: 100%;
    height: 700px;
    overflow: hidden;
    background: #020617;
}

.banner-track {
    width: 100%;
    height: 100%;
    position: relative;
}

.banner-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity .6s ease;
}

    .banner-slide.active {
        opacity: 1;
    }

.banner-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15,23,42,.6);
    color: white;
    border: none;
    font-size: 30px;
    padding: 12px 16px;
    cursor: pointer;
    z-index: 2;
    transition: background .3s;
}

    .banner-nav:hover {
        background: rgba(15,23,42,.9);
    }

    .banner-nav.prev {
        left: 12px;
    }

    .banner-nav.next {
        right: 12px;
    }

/* =========================
   Page Header (No Banner)
========================= */
.page-header {
    background: linear-gradient(90deg, #F8FAFC, #E2E8F0);
    padding: 56px 40px;
    border-bottom: 1px solid #CBD5E1;
}

    .page-header h1 {
        margin: 0;
        font-size: 36px;
        color: #020617;
    }

    .page-header .breadcrumb {
        margin-top: 8px;
        font-size: 14px;
        color: #64748B;
    }

/* =========================
   GAI Page Header
========================= */
.g-header {
    position: relative;
    background: radial-gradient(circle at 20% 20%, #0F172A, #020617);
    padding: 72px 40px 64px;
    overflow: hidden;
}

    /* 科技感流動線 */
    .g-header::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient( 120deg, transparent 40%, rgba(56,189,248,.08), transparent 60% );
        animation: scan 6s linear infinite;
    }

    /* 底部光線 */
    .g-header::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 50%;
        width: 60%;
        height: 1px;
        background: linear-gradient(90deg, transparent, #38BDF8, transparent);
        transform: translateX(-50%);
    }

/* 內容 */
.g-header-inner {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    animation: fadeUp .6s ease both;
}

.g-title {
    margin: 0;
    font-size: 40px;
    font-weight: 700;
    color: #E6F6FF; 

    letter-spacing: .6px;
}

.g-subtitle {
    margin-top: 8px;
    font-size: 15px;
    color: #A5C7DB;
    letter-spacing: .6px;
}

/* 動畫 */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scan {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* =========================
   Loading
========================= */

    #loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #020617; 
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.dots span {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin: 0 5px;
    background-color: #38BDF8;
    border-radius: 50%;
    animation: bounce 1s infinite;
}

.dots span:nth-child(2) {
    animation-delay: 0.2s;
}
.dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}


/* =========================
   Header / Nav
========================= */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(90deg, #0F172A, #020617);
    padding: 16px 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    margin: 0; /* 移除外距 */
    padding: 0; /* 移除內距 */
    line-height: 1.1; /* 行距縮小 */
    font-weight: 700;
    color: #38BDF8;
    letter-spacing: 0.5px;
}

    .logo span {
        display: block;
        margin: 0;
    }

    .logo .title {
        font-size: 22px;
    }

    .logo .subtitle {
        font-size: 13px;
        font-weight: 400;
        color: #dae5f2;
        margin-top: 3px; 
    }

nav a {
    margin-left: 24px;
    color: #CBD5E1;
    text-decoration: none;
    font-size: 15px;
    position: relative;
    transition: color .3s;
}

    nav a:hover,
    nav a.active {
        color: #38BDF8;
    }

    nav a::after {
        content: '';
        position: absolute;
        left: 0;
        bottom: -6px;
        width: 0%;
        height: 2px;
        background: #38BDF8;
        transition: width .3s;
    }

    nav a:hover::after,
    nav a.active::after {
        width: 100%;
    }

/* Dropdown container */
.dropdown {
    position: relative;
    display: inline-block;
}

/* Dropdown button (Professor) */
.dropbtn {
    cursor: pointer;
    color: #CBD5E1;
    text-decoration: none;
    font-size: 15px;
    margin-left: 24px;
    position: relative;
    transition: color .3s;
}

/* Dropdown content (子選單) */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #0F172A;
    min-width: 160px;
    z-index: 1001;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

    /* 子選單項目 */
    .dropdown-content a {
        color: #CBD5E1;
        padding: 10px 16px;
        text-decoration: none;
        display: block;
        font-size: 14px;
        transition: background .3s, color .3s;
    }

        .dropdown-content a:hover {
            background-color: #38BDF8;
            color: #020617;
        }

/* hover 展開 */
.dropdown:hover .dropdown-content {
    display: block;
}

/* Professor hover color */
.dropdown:hover > .dropbtn {
    color: #38BDF8;
}

/* =========================
   Professor Tags
========================= */
.prof-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

    /* tag 本體 */
    .prof-tags .tag {
        display: inline-block;
        padding: 6px 12px;
        font-size: 13px;
        font-weight: 500;
        color: #0369A1;
        background: rgba(56,189,248,0.12);
        border: 1px solid rgba(56,189,248,0.25);
        border-radius: 999px;
        transition: all .25s ease;
        cursor: default;
    }

        /* hover 效果（輕微升級科技感） */
        .prof-tags .tag:hover {
            background: rgba(56,189,248,0.22);
            transform: translateY(-2px);
        }
/* =========================
   Layout
========================= */
main {
    flex: 1; 
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 40px;
}

.page {
    display: none;
    animation: fadeIn .4s ease;
}

    .page.active {
        display: block;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================
   Typography
========================= */
h1 {
    font-size: 42px;
    margin-bottom: 12px;
    color: #020617;
}

.subtitle {
    color: #64748B;
    font-size: 18px;
    margin-bottom: 48px;
}

h2 {
    font-size: 26px;
    color: #0F172A;
    border-left: 4px solid #38BDF8;
    padding-left: 12px;
    margin-bottom: 24px;
}



/* =========================
   Content
========================= */
p {
    font-size: 16px;
    margin-bottom: 16px;
}

/* =========================
   Publications
========================= */
.pub-list li {
    margin-bottom: 12px;
}

#togglePub {
    margin-top: 12px;
    padding: 8px 18px;
    background: #38BDF8;
    color: #020617;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
    transition: all .3s;
}

    #togglePub:hover {
        background: #22D3EE;
    }

/* =========================
   Lab Members
========================= */
.lab-members-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 60px 40px;
}

    .lab-members-page h1 {
        font-size: 36px;
        margin-bottom: 24px;
        color: #0F172A;
    }

    .lab-members-page p {
        font-size: 16px;
        margin-bottom: 32px;
        line-height: 1.6;
    }

/* 網格 */
.lab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

/* 成員卡片 */
.member-card {
    background: #FFFFFF;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(15,23,42,.08);
    text-align: center;
    transition: transform .3s, box-shadow .3s;
}

    .member-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 18px 40px rgba(15,23,42,.15);
    }

    .member-card h3 {
        font-size: 20px;
        margin-top: 12px;
        color: #0F172A;
    }

    .member-card p {
        font-size: 14px;
        color: #555;
        margin-top: 4px;
    }

/* 成員班級 */
.member-class {
    font-size: 14px;
    color: #64748B;
    margin-top: 4px;
}

/* Tag 樣式 */
.member-tags {
    margin-top: 8px;
}
    .member-tags .tag {
        display: inline-block;
        background-color: #38BDF8; 
        color: #fff;
        font-size: 12px;
        padding: 4px 10px;
        border-radius: 12px;
        margin: 4px 4px 0 0;
        transition: background-color 0.25s ease, transform 0.2s ease;
    }

        .member-tags .tag:hover {
            background-color: #0369A1; 
            cursor: pointer;
            transform: translateY(-1px); 
        }

.member-section {
    margin-top: 60px;
}

    .member-section h2 {
        font-size: 22px;
        margin-bottom: 20px;
        border-left: 5px solid #38BDF8;
        padding-left: 12px;
        color: #0f172a;
    }

    /* Alumni 可以淡一點，表示已畢業 */
    .member-section.alumni {
        opacity: 0.85;
    }

/* 成員照片 */
.member-photo {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 auto;
}


/* =========================
   Footer
========================= */
.footer {
    background: #020617;
    color: #94A3B8;
    text-align: center;
    padding: 24px;
    font-size: 14px;
}

/* =========================
   Professor page
========================= */

.professor-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 80px 40px;
}

.professor-container {
    display: flex;
    gap: 40px;
    flex-wrap: wrap; /* 手機版自動換行 */
}

/* 左側 Sidebar */
.professor-sidebar {
    flex: 0 0 250px;
    text-align: center;
}

.professor-photo {
    width: 200px; /* 寬度 */
    object-fit: cover; /* 保持圖片填滿，不變形 */
    margin-bottom: 16px;
}

.professor-name {
    font-size: 24px;
    color: #0F172A;
}

/* 中間資訊 */
.professor-info {
    flex: 1;
}

    .professor-info h3 {
        font-size: 28px;
        margin-bottom: 16px;
        color: #0F172A;
    }

.info-list {
    list-style: none;
    padding: 0;
}

    .info-list li {
        font-size: 16px;
        margin-bottom: 12px;
        line-height: 1.6;
    }

    .info-list strong {
        color: #38BDF8;
    }

    /* 內部子列表 */
    .info-list li ul {
        margin-top: 4px;
        margin-left: 20px;
        list-style: disc;
    }

/* 響應式 */
@media (max-width: 768px) {
    .professor-container {
        flex-direction: column;
        align-items: center;
    }

    .professor-sidebar {
        flex: none;
    }

    .professor-info {
        width: 100%;
    }
}

/* =========================
   iframe
========================= */

.pub-iframe {
    width: 100%;
    height: 800px; 
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(15,23,42,.15);
    background: #fff;
}

/* =========================
   map
========================= */

.office-info {
    margin-top: 20px;
    text-align: center;
}

.office-title {
    font-size: 14px;
    font-weight: 600;
    color: #0F172A;
    margin-bottom: 8px;
}

.office-map {
    width: 100%;
    margin-top: 12px;
    text-align: center;
}

    .office-map iframe {
        width: 100%;
        height: 160px;
        border: 0;
        border-radius: 8px;
    }

.office-address {
    font-size: 14px;
    color: #555;
    margin-top: 6px;
    line-height: 1.4;
}

/* =========================
   主畫面影片card
========================= */
.media {
    margin-top: 30px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* 卡片 */
.media-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

    .media-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    }

    /* iframe 比例 */
    .media-card iframe {
        width: 100%;
        height: 200px;
        display: block;
    }

/* 文字區 */
.media-info {
    padding: 15px;
}

    .media-info h4 {
        margin: 0 0 8px;
        font-size: 16px;
    }

    .media-info p {
        margin: 0;
        color: #666;
        font-size: 14px;
    }

/* 連結按鈕 */
.btn-link {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 14px;
    background: #007bff;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

    .btn-link:hover {
        background: #0056b3;
    }

/* 純連結卡片 */
.link-card {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}


/* =========================
   Engagements Page (Refactored)
========================= */

/* 頁面基礎 */
.Engagements-page {
    margin-top: 40px;
    font-size: 18px; /* 全域放大 */
    line-height: 1.8;
    color: #0f172a;
}

    /* 標題 */
    .Engagements-page h2 {
        font-size: 34px;
        margin-bottom: 20px;
        font-weight: 700;
    }

/* =========================
   Controls（搜尋區）
========================= */
.engagement-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

    .engagement-controls input,
    .engagement-controls select {
        padding: 10px 14px;
        border-radius: 10px;
        border: 1px solid #e2e8f0;
        font-size: 15px;
        background: #fff;
        transition: all .2s ease;
    }

        .engagement-controls input:focus,
        .engagement-controls select:focus {
            outline: none;
            border-color: #38BDF8;
            box-shadow: 0 0 0 2px rgba(56,189,248,.2);
        }

/* =========================
   Table Wrapper
========================= */
.table-container {
    margin-top: 20px;
    overflow-x: auto;
}

/* =========================
   Table
========================= */
.engagement-table {
    width: max-content; 
    max-width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

    /* 表頭 */
    .engagement-table thead {
        background: #f1f5f9;
    }

    .engagement-table th {
        text-align: left;
        padding: 16px 18px;
        font-weight: 600;
        font-size: 16px; 
        color: #0F172A;
        letter-spacing: 0.3px;
        white-space: nowrap;
    }

    /* 內容 */
    .engagement-table td {
        padding: 16px 18px;
        font-size: 16px; 
        color: #334155;
        border-top: 1px solid #e2e8f0;
        vertical-align: top;
    }

    /* hover */
    .engagement-table tbody tr:hover {
        background: #f8fafc;
    }

    /* =========================
   Column Styling
========================= */

    /* 日期欄 */
    .engagement-table td:first-child {
        width: 120px;
        color: #64748B;
        font-size: 14px;
        white-space: nowrap;
    }

    /* 身分欄 */
    .engagement-table td:nth-child(2) {
        font-weight: 600;
        color: #38BDF8;
        white-space: nowrap;
    }

    .engagement-table td:nth-child(3) {
        min-width: 500px;
        line-height: 1.7;
    }

/* =========================
   Role Tag
========================= */
.role-tag {
    display: inline-block;
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 999px;
    background: rgba(56,189,248,0.15);
    color: #0369A1;
    font-weight: 500;
}