/* 只針對首頁加背景 */
.home-page {
    position: relative;
}
.home-page::before {
    content: "";
    position: fixed;
    top: 10px;
    left: 0;
    width: 100%;
    height: 100%;    
    background: url("../images/index_bg.png") repeat right top;
    background-size: 850px auto;    
    opacity: 0.2;
    z-index: -1;
}

/* Banner區塊 */
.banner-wrapper {
    position: relative;
    height: 550px;
    margin-bottom: 30px;
}
.banner {
    position: absolute;
    right: 0;
    width: 75%;
    height: 100%;
    background: url('../images/ncu_bg.jpg') no-repeat center center;
    background-size: cover;
    border-bottom-left-radius: 40px;
    overflow: hidden;
}
.banner::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(21, 99, 172, 0.466);
    mix-blend-mode: multiply;
    pointer-events: none;
}

/* Search區塊 */
.search-box {
    position: absolute;
    top: 50%;
    left: 25%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 5px;
    width: 650px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 10;
    transition: all 0.3s ease;
}
.search-header {
    background: #0b5e63;
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    border: 1px solid #ccc;
}
#cloud_content {
    width: 100% !important;
    height: 100% !important;
}
.search-body {
    padding: 20px;
    background: rgb(129, 169, 171);
    border: 1px solid #ccc;
    border-top: none;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
}
.search-input-group {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 10px;
    overflow: hidden;
}
.search-input-group input {
    flex: 1;
    border: 1px solid #ccc;
    border-radius: 5px 0 0 5px;
    outline: none;
    padding: 8px 12px;
    font-size: 14px;
    background-color: white;
}
.search-input-group .search-button {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background-color: #d4edda;
    border: 1px solid #ccc;
    border-left: none;
    border-radius: 0 5px 5px 0;
    color: #1b5e20;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}
.popular-search {
    font-size: 13px;
    color: #333;
    margin-top: 10px;
    width: 100%;
    display: block;
    text-align: left;
    margin-top: 10px;
}
.search-input-group,
.popular-search {
    margin-left: 0;
}

/* 教師卡片 */
.teacher-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 15px;
    margin-top: 30px;
    text-align: center;
    height: 380px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}
.teacher-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.teacher-card .photo-area {
    width: 100%;
    height: 200px;
    margin-top: -30px;
    border-radius: 10px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0px 3px rgba(0, 0, 0, 0.2);
    position: relative; 
    overflow: hidden;
    padding-top: 0;
}
.photo-area.portrait {
    width: 60%;
    margin-left: auto;
    margin-right: auto;
}
.photo-area.landscape {
    width: 100%;
}
.teacher-card .photo-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    position: absolute;
    top: 0;
    left: 0;
    transition: object-position 0.3s ease;
}
.teacher-card .photo-area i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 80px;
    color: #6c757d;
}
.teacher-info-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100px;
    justify-content: flex-start;
    flex: 1;
    overflow-y: auto; 
    padding-right: 5px;
}
.teacher-info,
.teacher-email,
.teacher-research {
    padding: 0rem 0.5rem;
    font-size: 0.9rem;
    text-align: left;
}
.teacher-info {
    font-size: 14px;
    color: #666;
    margin-top: 65px;
}
.teacher-email {
    font-size: 14px;
    color: #007bff;
    margin-top: 5px;
}
.teacher-research {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #555;
    margin-top: 5px;
}
.teacher-research a {
    font-size: 13px;
    color: #555;
    margin-top: 5px;
    overflow-wrap: break-word;
}
.row > div:nth-child(odd) .teacher-email,
.row > div:nth-child(odd) .teacher-email a {
    color: #bc9fa9 !important;
    text-decoration: none;
}
.row > div:nth-child(even) .teacher-email,
.row > div:nth-child(even) .teacher-email a {
    color: #81a9ab !important;
    text-decoration: none;
}

/* 職稱區塊 */
.teacher-title-block {
    position: absolute;
    top: 150px;
    right: 0px;
    max-width: 100%; 
    min-width: 45%;
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.4;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center; 
    align-items: flex-start;
    text-align: left;
    background: #81a9ab;
    color: white;
    font-size: 16px;
    font-weight: bold;
    padding: 10px 15px;
    border-radius: 8px 0 0 8px;
    z-index: 2;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
html[lang="zh-TW"] .teacher-title-block,
html[lang="zh-CN"] .teacher-title-block {
    min-width: 40%;
    max-width: 60%;    
}
html[lang="en"] .teacher-title-block {
    width: auto;
    min-width: 50%;
    max-width: 90%;
}
.teacher-title-block span:first-child {
    font-size: clamp(14px, 2vw, 16px);
    font-weight: 700;
    margin-top: 3px;
    padding-left: 0;
    font-style: italic;
}
.teacher-title-block span:last-child {
    font-size: 18px;
    opacity: 0.9;
    padding-left: 2ch;
}
.teacher-title-block span:last-child a {
    color: #fff !important;
    text-decoration: none;
}
.row > div:nth-child(odd) .teacher-title-block span:first-child {
    color: #4b2c3b;
}
.row > div:nth-child(even) .teacher-title-block span:first-child {
    color: #102b3d;
}
.row > div:nth-child(odd) .teacher-title-block {
    background-color: #bc9fa9;
}
.row > div:nth-child(even) .teacher-title-block {
    background-color: #81a9ab;
}
.teacher-title-container  { /*職稱、姓名置中*/
    margin-left:auto;
    margin-right:auto;
}
.teacher-title-container > *:not(:last-child) {
    margin-bottom: 5px;
}

/* jQCloud */
.jqcloud-word a {
    color: #e4e2e2 !important;
}

/* RWD */
@media (max-width: 1315px) {
    .teacher-card {
        height: 420px;
    }
    .teacher-info-wrapper {
        margin-top: 10px;
        flex: 1;
        overflow-y: auto; 
        padding-right: 5px;
    }
}
@media (max-width: 1310px) and (min-width: 993px) {
    .search-box {
        left: 35%;
        transform: translate(-50%, -50%);
    }
}
@media (max-width: 992px) {
    .banner-wrapper {
        height: 50vh;
        min-height: 300px;
    }
    .banner {
        position: relative;
        width: 100%;
        border-bottom-left-radius: 0;
        overflow: visible;
    }
    .search-box {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 650px;
    }
    .search-header {
        height: 230px;
    }
    .teacher-card {
        height: auto; 
        padding-top: 0; 
        margin-left: 10px;
        margin-right: 10px;
    }
    .teacher-title-block {
        top: 160px;
    }
    .teacher-card .photo-area {
        position: relative;
        overflow: hidden;
        margin-top: 0;
        height: 200px;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        padding-top: 10px; 
    }
    .teacher-card .photo-area img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center top;
    }    
    .teacher-title-block {
        top: 160px;
    }
}

@media (max-width: 767px) {
    .teacher-card .photo-area.portrait {
        width: 60%;
        height: 200px;
        margin: 0 auto;
        border-radius: 8px;
        overflow: hidden;
    }
    .teacher-card .photo-area.portrait img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center top;
    }
}

@media (max-width: 575px) {
    .teacher-card .photo-area.portrait {
        width: 45%; 
        height: 200px;
        margin-left: auto;
        margin-right: auto;
    }
    .teacher-card .photo-area.portrait img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center top;
    }
    .teacher-card .photo-area.landscape {
        width: 100%;
        height: 200px;
        margin-left: auto;
        margin-right: auto;
    }
    .teacher-card .photo-area.landscape img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center center;
    }
}

@media (max-width: 375px) {
    .teacher-card .photo-area.portrait {
        width: 70%; 
    }
}

/* 教師卡片Details*/
.page-wrapper {
    max-width: 90%;
    margin: 0 auto;
}
/* 教師資訊 */
.teacher-info-card {
    background: #fff;
    border-radius: 15px;
    border: 1px solid #e5e5e5;
    transition: all 0.3s ease;
    margin-top: 20px;
}
.teacher-info-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
/* 照片 */
.teacher-photo {
    width: 130px;
    height: 130px;
    object-fit: cover;
    border: 4px solid #f0f0f0;
}
/* email */
.email-link {
    color: #086474;
    font-size: 0.95rem;
    text-decoration: none;
    font-weight: 500;
}
.email-link:hover {
    text-decoration: underline;
}
/* 專長 */
.text-ncu {
    color: #086474;
}
.bg-ncu {
    background-color: #086474;
    color: #fff;
}
.bg-ncu-light {
    background-color: #b7ecec;
    color: #000;
}
/* 關鍵字 */
.keyword-link {
    display: inline-block;
    margin: 2px 6px;
    font-size: 0.9rem;
    color: #333;
    text-decoration: none;
}
.keyword-link:hover {
    color: #086474;
    text-decoration: underline;
}
/* Tabs */
.nav .nav-tabs .teacher-tabs {
    margin-left: auto;
    margin-right: auto;
    border-bottom: 2px solid #e5e5e5;
}
.teacher-tabs .nav-link {
    border: none;
    border-bottom: 4px solid transparent;
    color: #555;
    font-size: 16px;
    font-weight: 700;
    padding: 10px 18px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.teacher-tabs .nav-link i {
    color: #999;
    transition: color 0.3s ease;
}
.teacher-tabs .nav-link:hover {
    color: #086474;
    background-color: #f0f0f0;
}
.teacher-tabs .nav-link.active {
    color: #086474;
    background-color: #eef8f8;
    border-bottom: 4px solid #086474;
    font-size: 16px;
    font-weight: 700;
}
.teacher-tabs .nav-link.active i {
    color: #086474;
}

/* Tab內容 */
.teacher-tab-content {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* 個人資料及領域 */
.profile-card {
    transition: transform 0.2s, box-shadow 0.2s;
}
.profile-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.profile-card .card-title {
    font-size: 1.25rem;
    color: #0a6ebd;
    border-bottom: 2px solid #0a6ebd;
    padding-bottom: 5px;
}
.profile-card ul li a {
    text-decoration: none;
    transition: color 0.2s;
}
.profile-card ul li a:hover {
    text-decoration: underline;
    color: #0a6ebd;
}
.expertise-list {
    display: flex;
    flex-direction: column; 
    gap: 6px;
}
.expertise-item {
    padding: 6px 10px;
    border-radius: 6px;
    background: #f8f9fa;
    color: #333;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}
.expertise-item:hover {
    background: #e2f0e9;
    transform: translateX(4px); 
}
.expertise-short {
    padding-top: 6px;
    color: #333 !important;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

/* 計畫及著作概覽 */
/* 標題 */
#nav-plan h5,
#nav-publication h5 {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  color: #0a6ebd;
  border-bottom: 2px solid #0a6ebd;
  padding-bottom: 5px;
}
#nav-plan h5 i,
#nav-publication h5 i {
  color: #0a6ebd;
  margin-right: 8px;
  font-size: 1.2rem;
}
/* 清單 */
#nav-plan ul,
#nav-publication ul {
  list-style: none;
  padding-left: 0;
}
#nav-plan ul li,
#nav-publication ul li {
  background: #f8f9fa;
  border-left: 4px solid #0ca678;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#nav-plan ul li:hover,
#nav-publication ul li:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
/* 清單標題 */
#nav-plan ul li h6,
#nav-publication ul li h6 {
  margin: 0;
  line-height: 1.4;
}
#nav-plan .text-info,
#nav-publication .text-info {
  font-size: 1rem;
  color: #0d6efd !important; 
}
/* 日期及註解 */
#nav-plan .small,
#nav-publication .small {
  color: #6c757d;
  font-size: 0.875rem;
}
/* 關鍵字區 */
#nav-plan .font-italic,
#nav-publication .font-italic {
  color: #495057;
  background: #e9f7f1;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
}

#cloud-content a:hover {
    opacity: 0.7;
}