html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: #e9e9e9; /* 看得清楚粒子 */
    scroll-behavior: smooth;
}

#intro-layer {
    position: fixed;
    inset: 0;
    background: black;
    z-index: 10000;
    display: flex;
    transition: opacity 0.8s ease;
}
#intro-layer.fade-out {
    opacity: 0;
    pointer-events: none;
}
.skip-intro #intro-layer {
    display: none !important;
}
#intro-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/*背景粒子*/
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}
canvas {
    display: block !important;
    opacity: 1 !important;
    pointer-events: none;
}
.container{
    width: 75%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background:color-mix(in srgb, var(--clb-color-black) 20%, transparent);
    padding: 0 25px;
}
/*標頭*/
header {
    width: 100%;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.container-up {
    width: 100%;
    height: 100%;
    display: block;
    justify-content: space-between;
    background:color-mix(in srgb, var(--clb-color-black) 20%, transparent);
    align-items: center;
}
.container-head {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    background:color-mix(in srgb, var(--clb-color-black) 20%, transparent);
    align-items: center;
}
.logo{
    align-self: flex-end;
    font-weight: bold;
    font-size: 30px;
    align-items: center;
}
.logo img{
    height:45px;
    width: auto;
    justify-content: center;
}
.container-title{
    font-family: Roboto, sans-serif;
    display:block ;
    margin-top: 10%;
    align-items: center;
    z-index: 3;
}
.webname{
    font-size: 20px;
    font-weight: 500;
    font-style: normal;
    text-align: center;
    color:#ff6435;
}
.slogan{
    font-size: 40px;
    font-weight: 650;
    font-style: normal;
    text-align: center;
    margin-top:0.5%;
    color:rgb(68, 68, 68);
}
.title-gif {
    width: 18px;/* 根據需求調整大小 */
    height: auto;
    vertical-align: middle;
    margin-bottom: 5px;
}
nav{
    font-family: "DM Serif Text", serif;
    display: flex;
    gap: 15px;
    z-index: 5;
}
.navitem{
    display: flex;
    align-items: center;
    font-weight: bold;
    z-index: 5;
}
.navitem a{
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 5;
}
.navitem__text {
    font-size: 18px;
    text-decoration: none;
    color: rgb(91, 91, 91);
    font-weight: 100;
    transition: color 0.3s ease; /* 平滑變色動畫 */
    z-index: 5;
}
.navitem__text:hover {
    color: #000000f0; /* 滑過時變藍色，可改其他顏色 */
}
.submenu {
    display: flex;
    position: fixed;
    top: 100%;
    left: 100%;
    min-width: 150px;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    text-align: center;/* 文字也置中 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 1); /* 半透明白色 */
    z-index: 3;
}
.submenu a {
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
}
.submenu.show{
    display: flex;
}
.submenu a:first-child {
    border-left: none;
}
.submenu a:hover {
    background: rgba(255, 255, 255, 0.75); /* 半透明白色 */
}
.submenu--right {
    min-width: 100%;
    left: 0;       /* 從最左邊展開 */
    top: 45px;     /* 跟 header 高度對齊 */
}
.submenu .back-button {
    display: none !important;
}
/* 漢堡選單按鈕 - 手機版用 */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    width: 25px;
    justify-content: space-between;
    right: 20px;
    z-index: 100;
}
.hamburger div {
    height: 3px;
    border-radius: 2px;
    margin: 4px 0; /* 通常會有間距讓三條線分開 */
    background-color: #ffffff;  /* 一定要有背景色，才看得到 */
    transition: all 0.3s ease;
}
/* 淡出動畫 */
#figma-preview {
    transition: opacity 1s ease;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: white;
    z-index: 9999;
}
#figma-preview.fade-out {
    opacity: 0;
    pointer-events: none;
}

.container-mid{
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
    background: rgba(255, 255, 255, 0.75); /* 半透明白色 */
}
.Professor-place{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    background: rgba(255, 255, 255, 0.75);
}
.container1{
    display: grid;
}
.Professor-info{
    font-family: Roboto, sans-serif;
    height: auto;
    max-width: 475px;
    overflow: hidden;
    border-radius: 0.5rem;
    margin-top: 15px;
    margin-right: 15px;
    margin-left: 15px;
    transition: all 0.3s ease-in-out;
    z-index: 98;
}
.Professor-info h2{
    font-size: 25px;
    margin: 5px;
    text-align: center;/* 文字也置中 */
}
.Professor-info p{
    font-size: 20px;
    margin-left: 5px;
    margin-right: 5px;
    margin-top: 5px;
    margin-bottom: 5px;
}
.Professor-word{
    font-family: Roboto, sans-serif;
    height: auto;
    max-width: 475px;
    overflow: hidden;
    border-radius: 0.5rem;
    margin-bottom: 15px;
    margin-right: 15px;
    margin-left: 15px;
    transition: all 0.3s ease-in-out;
    z-index: 100;
}
.Professor-word h2{
    display: grid;
    font-size: 25px;
    margin: 5px;
    text-align: center;/* 文字也置中 */
}
.Professor-word p{
    font-size: 16px;
    margin: auto;
    margin-left: 5px;
    margin-right: 5px;
}
.Professor-photo{
    margin-left: 15px;
    margin-top: 15px;
    margin-bottom: 15px;
    background: rgb(255, 255, 255);
}
.Professor-Research{
    font-family: Roboto, sans-serif;
    position: relative;
    width: 100%;
    max-width: 475px;
    overflow: hidden;
    border-radius: 0.5rem;
    margin-top: 15px;
    margin-bottom: 15px;
    margin-right: 15px;
    transition: all 0.3s ease-in-out;
    z-index: 100;
}
.Professor-Research h3{
    font-size: 25px;
    margin: 5px;
    text-align: center;
}
.Professor-Research p{
    font-size: 20px;
    margin-top: 15px;
    margin-bottom: 15px;
    margin-left: 5px;
    margin-right: 5px;
    display: flex;
    justify-content: center;
    text-align: center;
}
.Professor-Research p1{
    font-size: 20px;
    margin-top: 15px;
    margin-bottom: 15px;
    margin-left: 5px;
    margin-right: 5px;
    display: flex;
    justify-content: center;
    text-align: center;
}
.container-title1{
    font-family: Roboto, sans-serif;
    display:flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-top: 2%;
    width: 100%;
    z-index: 3;
}
.slogan{
    font-size: 40px;
    font-weight: 650;
    font-style: normal;
    text-align: center;
    margin-top:0.5%;
    color:rgb(68, 68, 68);
}
.Researcher-place{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    background: rgba(255, 255, 255, 0.75);
}
.container2 {
    display: flex;
    flex-wrap: wrap; /* 多行 */
    justify-content: center;
    width: 100%;
    background: rgba(255, 255, 255, 0.75);
    box-sizing: border-box;
}

/* 統一區塊樣式 */
.Researcher-infocard1,
.Researcher-infocard2,
.Researcher-infocard3,
.Researcher-infocard4 {
    flex: 0 0 25%; /* 每個佔 25% */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color:rgba(255, 241, 248, 0.6);
    padding: 10px;
    z-index: 50;
}
.Researcher-infocard1 .Researcher-infocard {
    background: #e3fcef;
}
.Researcher-infocard2 .Researcher-infocard {
    background: #f0f7ff;
}
.Researcher-infocard3 .Researcher-infocard {
    background: #f3f1fa;
}
.Researcher-infocard4 .Researcher-infocard {
    background: #f4f1eb;
}

/* 研究生卡片樣式 */
.Researcher-infocard {
    font-family: Roboto, sans-serif;
    width: 100%;
    margin-top: 12px;
    border-radius: 8px;
    z-index: 50;
}
.Researcher-infocard h1{
    font-size: 18px;
    z-index: 50;
    text-align: center;
}
.Researcher-infocard h2{
    font-size: 18px;
    z-index: 50;
    text-align: center;
}
.Researcher-infocard p{
    font-size: 16px;
    margin-top: 5px;
    margin-bottom: 5px;
    margin-left: 5px;
    margin-right: 5px;
    z-index: 50;
}
/* 手機版樣式 */
@media (max-width: 768px) {
    #particles-js {
        pointer-events: none;
    }
    header {
        justify-content: space-between; /* 左右分散 */
    }
    .logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
    .logo img {
        height: 35px; /* logo 縮小 */
    }
    .container {
        width: 100%;
        justify-content: space-between;
        z-index: 2;
    }
    nav {
        position: fixed;
        top: 45px;
        left: 0;
        width: 100%;
        flex-direction: column;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        background-color: rgba(255, 255, 255);
        text-align: center;
        justify-content: center;
        align-items: center;
        z-index: 9999; 
    }
    nav.open {
        transform: translateX(0);
    }
    .hamburger {
        display: flex;
        position: relative;
        z-index: 10000; /* 確保高於 nav */
    }
    .submenu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.95);
        transform: translateX(100vw);
        transition: transform 0.3s ease;
    }
    .submenu.show {
        transform: translateX(0);
    }
    .submenu .back-button {
        display: block !important;
        font-weight: bold;
        color: #555;
        align-self: flex-start; /* 靠左放（可改 center） */
    }
    .webname{
        font-size: 15px;
        font-weight: 500;
        font-style: normal;
        text-align: center;
        color:#ff6435;
    }
    .slogan{
        font-size: 30px;
        font-weight: 650;
        font-style: normal;
        text-align: center;
        margin-top:0.5%;
        color:rgb(68, 68, 68);
    }
    .sidebar {
        display: none;
    }
    .stage {
        transform: scale(0.8);
    }
}
@media (min-width: 1920px) {
    .card{
        max-width: 440px;
  }
}
@media (max-width: 1024px) {
    .Researcher-infocard1,
    .Researcher-infocard2,
    .Researcher-infocard3,
    .Researcher-infocard4 {
        flex: 0 0 50%; /* 平板變成兩欄 */
    }
}
@media (max-width: 600px) {
    .Researcher-infocard1,
    .Researcher-infocard2,
    .Researcher-infocard3,
    .Researcher-infocard4 {
        flex: 0 0 100%; /* 手機變成單欄 */
    }
}