/* Global Reset & Typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: "Microsoft JhengHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
a {
    text-decoration: none;
    color: inherit;
}

/* --- Header Section --- */
header {
    background-color: #fff;
    border-top: 5px solid #004b97;
    padding: 15px 0;
}
.header-container {
    width: 1100px;
    max-width: 95%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo-text {
    display: flex;
    flex-direction: column;
}
.logo-text h1 {
    color: #004b97;
    font-size: 24px;
    margin-bottom: 5px;
    letter-spacing: 1px;
}
.logo-text span {
    color: #666;
    font-size: 14px;
    font-weight: normal;
}
.top-links {
    font-size: 13px;
    color: #666;
}
.top-links a {
    margin-left: 10px;
    color: #666;
}
.top-links a:hover {
    color: #004b97;
}

/* --- Navigation Bar --- */
nav {
    background-color: #004b97;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.nav-container {
    width: 1100px;
    max-width: 95%;
    margin: 0 auto;
}
.nav-menu {
    list-style: none;
    display: flex;
}
.nav-menu li {
    position: relative;
}
.nav-menu li a {
    display: block;
    padding: 15px 20px;
    color: #fff;
    font-weight: bold;
    font-size: 15px;
    transition: background 0.3s;
}
.nav-menu li a:hover {
    background-color: #003366;
}

/* --- Main Layout (Sidebar + Content) --- */
.main-container {
    width: 1100px;
    max-width: 95%;
    margin: 20px auto;
    display: flex;
    flex-grow: 1;
    gap: 20px;
}

/* Sidebar Styling */
aside {
    width: 250px;
    flex-shrink: 0;
}
.sidebar-box {
    background: #fff;
    border: 1px solid #ddd;
    margin-bottom: 20px;
    border-radius: 4px;
    overflow: hidden;
}
.sidebar-header {
    background-color: #f1f8ff;
    color: #004b97;
    padding: 12px 15px;
    font-weight: bold;
    border-bottom: 1px solid #cce0f5;
    border-left: 4px solid #004b97;
}
.sidebar-menu {
    list-style: none;
}
.sidebar-menu li a {
    display: block;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    color: #555;
    font-size: 14px;
    transition: all 0.2s;
}
.sidebar-menu li a:hover {
    background-color: #f9f9f9;
    color: #004b97;
    padding-left: 20px;
}
.sidebar-menu li a.active {
    color: #d9534f;
    font-weight: bold;
    background-color: #fff5f5;
}

/* Main Content Styling */
main {
    flex-grow: 1;
    background: #fff;
    padding: 30px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.breadcrumb {
    font-size: 13px;
    color: #888;
    margin-bottom: 20px;
    border-bottom: 1px dotted #ccc;
    padding-bottom: 10px;
}
.breadcrumb span {
    color: #004b97;
}

/* Content Typography */
h2.page-title {
    color: #333;
    font-size: 22px;
    margin-bottom: 25px;
    padding-left: 10px;
    border-left: 5px solid #d9534f;
}
h3 {
    color: #004b97;
    margin-top: 30px;
    margin-bottom: 15px;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
}
p {
    margin-bottom: 15px;
    text-align: justify;
}
ul.custom-list {
    list-style: none;
    margin-bottom: 20px;
}
ul.custom-list li {
    padding-left: 20px;
    position: relative;
    margin-bottom: 8px;
}
ul.custom-list li::before {
    content: "■";
    color: #d9534f;
    font-size: 10px;
    position: absolute;
    left: 0;
    top: 4px;
}

/* Timeline Style for History */
.timeline {
    border-left: 2px solid #ddd;
    margin-left: 10px;
    padding-left: 20px;
}
.timeline-item {
    margin-bottom: 20px;
    position: relative;
}
.timeline-item::before {
    content: "";
    width: 10px;
    height: 10px;
    background: #004b97;
    border-radius: 50%;
    position: absolute;
    left: -26px;
    top: 6px;
}
.timeline-date {
    font-weight: bold;
    color: #004b97;
    display: block;
    margin-bottom: 5px;
}

/* Table Style */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 14px;
}
.data-table th, .data-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}
.data-table th {
    background-color: #f1f8ff;
    color: #004b97;
}
.data-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Footer */
footer {
    background-color: #333;
    color: #ccc;
    padding: 40px 0;
    margin-top: auto;
    font-size: 13px;
}
.footer-container {
    width: 1100px;
    max-width: 95%;
    margin: 0 auto;
    text-align: center;
}
.footer-container p {
    text-align: center;
    margin-bottom: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    aside {
        width: 100%;
    }
    .header-container {
        flex-direction: column;
        text-align: center;
    }
    .top-links {
        margin-top: 10px;
    }
    .nav-menu {
        flex-wrap: wrap;
    }
    .nav-menu li {
        flex: 1 1 50%;
        text-align: center;
    }
}


/* --- Facility Image Gallery --- */
.facility-gallery {
    display: grid;
    /* 這裡設定自動排版，畫面寬的時候並排，窄的時候自動換行 */
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
    margin-top: 15px;
}
.gallery-item img {
    width: 100%;
    height: 160px; /* 固定高度讓照片看起來整齊 */
    object-fit: cover; /* 讓照片填滿且不變形 */
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}
.gallery-item img:hover {
    transform: scale(1.03); /* 滑鼠游標移過去時微放大的特效 */
}
.features-list li {
    margin-bottom: 15px !important;
    text-align: justify;
}


/* --- Home Page & Carousel Styles --- */
.welcome-section {
    text-align: center;
    padding: 20px 0 30px 0;
}
.welcome-section h2 {
    color: #004b97;
    font-size: 28px;
    margin-bottom: 15px;
}
.welcome-section p {
    color: #555;
    font-size: 16px;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

/* Carousel Container */
.carousel-container {
    max-width: 1000px;
    position: relative;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Hide the images by default */
.carousel-slide {
    display: none;
}
.carousel-slide img {
    vertical-align: middle;
    width: 100%;
    height: 450px;
    object-fit: cover;
}

/* Next & previous buttons */
.carousel-prev, .carousel-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 24px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0,0,0,0.3);
}
.carousel-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}
.carousel-prev:hover, .carousel-next:hover {
    background-color: rgba(0,0,0,0.8);
}

/* Caption text  首頁  */
.carousel-caption {
    color: #f2f2f2;
    font-size: 18px;
    font-weight: bold;
    padding: 15px 20px;
    position: absolute;
    bottom: 0;
    width: 100%;
    text-align: center;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
}

/* The dots/bullets/indicators */
.dot-container {
    text-align: center;
    padding: 15px;
}
.dot {
    cursor: pointer;
    height: 12px;
    width: 12px;
    margin: 0 5px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.6s ease;
}
.dot.active, .dot:hover {
    background-color: #004b97;
}

/* Fading animation */
.fade-anim {
    animation-name: fade;
    animation-duration: 1.5s;
}
@keyframes fade {
    from {opacity: .4} 
    to {opacity: 1}
}

/* --- Contact Us Cards Styles ---  聯絡我們 */
.single-contact-wrapper {
    display: flex;
    justify-content: center; /* 水平置中 */
    align-items: center;
    padding: 20px 0 60px 0;
}
.single-contact-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: 8px solid #004b97; /* 加粗的頂部藍色邊框 */
    border-radius: 10px;
    padding: 50px 60px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    text-align: center;
    width: 100%;
    max-width: 700px; /* 限制卡片最大寬度，讓它保持在畫面中間 */
}
.single-contact-card h3 {
    color: #d2691e;
    font-size: 36px; /* 大大的標題 */
    margin-bottom: 10px;
}
.single-contact-card h4 {
    color: #555;
    font-size: 24px; /* 大大的副標題 */
    margin-bottom: 40px;
    font-weight: normal;
    border-bottom: 2px solid #eee;
    padding-bottom: 20px;
}
.single-contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-block; /* 讓清單在卡片內也能置中對齊 */
    text-align: left; /* 保持文字向左對齊，閱讀起來較舒服 */
}
.single-contact-list li {
    margin-bottom: 25px;
    font-size: 22px; /* 大大的聯絡資訊字體 */
    color: #333;
    display: flex;
    align-items: flex-start;
}
.single-contact-list li strong {
    color: #004b97;
    width: 120px; /* 固定標籤寬度，讓後面的資料對齊 */
    flex-shrink: 0;
}


/* --- Departments Grid & Sidebar Styles --- 科系 */
.sidebar-header.dept-header {
    background-color: #d2691e; /* 配合圖片的橘色 */
    color: #fff;
    border-bottom: 1px solid #b85b1a;
    text-align: center;
}
.sidebar-menu.dept-menu li a {
    text-align: center;
    background-color: #f0f0f0;
    border-bottom: 1px dotted #ccc;
    font-size: 15px;
}
.sidebar-menu.dept-menu li a:hover {
    background-color: #e0e0e0;
    color: #004b97;
}

/* 卡片排版 */
.dept-grid {
    display: grid;
    grid-template-columns: 1fr; 
    gap: 20px;
}
.dept-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: 4px solid #004b97;
    border-radius: 5px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}
.dept-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}
.dept-card h3 {
    color: #004b97;
    font-size: 18px;
    margin-top: 0;
    margin-bottom: 5px;
    border-bottom: none;
    padding-bottom: 0;
}
.dept-card .cht-name {
    display: block;
    font-size: 14px;
    color: #888;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}
.new-badge {
    background-color: #d9534f;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 12px;
    margin-left: 8px;
    vertical-align: middle;
    font-weight: normal;
}


/* --- Honors List Styles --- 榮譽榜 */
.honor-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-left: 6px solid #d9534f; /* 榮譽榜使用紅色左邊框強調 */
    border-radius: 6px;
    padding: 20px 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center; /* 讓圖片跟文字垂直置中對齊 */
    transition: transform 0.2s;
}
.honor-card:hover {
    transform: translateX(5px); /* 滑鼠游標移過去時，卡片會微微向右滑動 */
}
.honor-content {
    flex: 1 1 400px; /* 文字區塊設定彈性，沒有圖片時會自動填滿 */
}
.honor-year {
    display: inline-block;
    background-color: #004b97; /* 學校主色調的年份標籤 */
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 12px;
}
.honor-title {
    font-size: 18px;
    color: #333;
    font-weight: bold;
    margin-bottom: 8px;
    line-height: 1.4;
}
.honor-desc {
    color: #666;
    font-size: 15px;
}
.honor-image {
    flex: 0 0 250px; /* 如果有圖片，限制圖片區塊寬度約為 250px */
}
.honor-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}