/* 
   亞洲大學人文社會科學研究中心網頁 樣樣式系統 (v1.3.9)
   設計規範：現代學術專業風格，主題色 #22B5D0
*/

:root {
    /* 色彩變數 */
    --primary-color: #22B5D0;
    --primary-hover: #1ba0b8;
    --bg-white: #ffffff;
    --bg-light: #f5f5f5;
    --text-dark: #333333;
    --text-muted: #666666;
    --text-white: #ffffff;
    --border-color: #e0e0e0;

    /* 字體規範 */
    --font-serif: "Playfair Display", "Times New Roman", "標楷體", serif;
    --font-sans: "Inter", "Microsoft JhengHei", "微軟正黑體", sans-serif;

    /* 間距與佈局 */
    --container-width: 1200px;
    --header-height: 80px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-white);
    overflow-x: hidden;
}

/* 輔助工具類 */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* 頁首樣式 */
header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo img {
    height: 60px;
    width: auto;
}

.header-utils {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lang-switch a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.lang-switch a:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

/* 導覽列與搜尋整合 */
nav {
    background: var(--primary-color);
    position: relative;
    z-index: 999;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
    flex-grow: 1;
}

.nav-links li a {
    display: block;
    padding: 15px 20px;
    color: var(--text-white);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.nav-links li a:hover {
    background: rgba(255,255,255,0.1);
}

/* 導覽列內的搜尋框 */
.nav-search-item {
    padding-right: 15px;
}

.search-bar {
    display: flex;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    padding: 4px 12px;
    background: rgba(255,255,255,0.1);
    transition: var(--transition-smooth);
}

.search-bar:focus-within {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
}

.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    color: white;
    font-size: 0.9rem;
}

.search-bar input::placeholder {
    color: rgba(255,255,255,0.7);
}

.search-btn {
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 3px 12px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: bold;
    transition: var(--transition-smooth);
}

.search-btn:hover {
    background: var(--bg-light);
    transform: scale(1.05);
}

/* 漢堡選單開關 */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    padding: 0;
    margin: 15px 0;
}

.menu-toggle .bar {
    height: 3px;
    width: 100%;
    background-color: var(--text-white);
    border-radius: 10px;
    transition: var(--transition-smooth);
}

/* 手機版樣式 (Mobile Styles) */
@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 15px 10px;
    }

    .header-utils {
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }

    .lang-switch {
        display: flex;
        gap: 10px;
        justify-content: center;
    }

    .search-bar {
        width: 100%;
        max-width: 400px;
        justify-content: space-between;
    }

    .search-bar input {
        flex: 1;
        width: 100%;
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .news-card {
        width: 100%;
        min-width: 0; /* 關鍵：防止內容撐開寬度 */
    }

    .logo img {
        height: 45px; /* 再稍微縮小一點點 */
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .nav-container {
        justify-content: flex-end;
        padding: 0 20px;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--primary-color);
        max-height: 0;
        overflow-y: auto; /* 內容過長可捲動 */
        overflow-x: hidden;
        transition: max-height 0.4s ease-in-out;
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
    }

    .nav-links.active {
        max-height: 85vh; /* 動態調整最大高度 */
        padding-bottom: 30px; /* 底部預留空間 */
    }

    .nav-links li {
        width: 100%;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .nav-links li a {
        padding: 15px 30px;
    }

    .nav-search-item {
        padding: 20px 30px; /* 手機版增加間距 */
    }

    /* 手機版下拉選單調整 */
    .dropdown-menu {
        position: static;
        width: 100%;
        display: none;
        box-shadow: none;
        background: rgba(0,0,0,0.05);
        border-top: none;
    }

    .nav-links li.active .dropdown-menu {
        display: block;
    }

    .dropdown-menu li a {
        padding-left: 50px !important;
        color: var(--text-white) !important;
    }

    /* 漢堡選單動畫 */
    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.active .bar:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    .menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
}

/* 麵包屑 */
.breadcrumbs {
    padding: 15px 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--primary-color);
    text-decoration: none;
}

/* 輪播圖 (Slider) */
.hero-slider {
    position: relative;
    height: 500px;
    overflow: hidden;
    margin-bottom: 50px;
}

.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    background-size: cover;
    background-position: center;
}

.slide.active {
    opacity: 1;
}

.slider-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
}

.slider-overlay h2 {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

/* 輪播圖導覽圓點 */
.slider-dots {
    position: absolute;
    bottom: 30px;
    right: 40px;
    display: flex;
    gap: 12px;
    z-index: 100;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.dot:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.dot.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(34, 181, 208, 0.5);
    transform: scale(1.2);
}

/* 最新消息區塊 */
.news-section {
    padding-bottom: 80px;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    border-left: 5px solid var(--primary-color);
    padding-left: 15px;
    margin-bottom: 30px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.news-card {
    background: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: var(--transition-smooth);
    border: 1px solid var(--border-color);
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.news-content {
    padding: 20px;
}

.news-date {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.9rem;
}

.news-h3 {
    margin: 10px 0;
    font-size: 1.2rem;
}

.learn-more {
    display: inline-block;
    margin-top: 15px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.learn-more::after {
    content: " →";
    transition: var(--transition-smooth);
}

.learn-more:hover::after {
    padding-left: 5px;
}

/* 頁尾 */
footer {
    background: #222;
    color: white;
    padding: 60px 0;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 50px;
}

.footer-info h4 {
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.contact-details p {
    margin-bottom: 10px;
    color: #ccc;
}

/* 導覽下拉選單 */
.nav-links li {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 200%;
    background: var(--bg-white);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: none;
    list-style: none;
    z-index: 1001;
    border-radius: 0 0 4px 4px;
    border-top: 3px solid var(--primary-color);
}

.nav-links li:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu li a {
    color: var(--text-dark) !important;
    padding: 12px 20px !important;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-menu li a:hover {
    background: var(--bg-light) !important;
    color: var(--primary-color) !important;
    padding-left: 25px !important;
}

/* 內頁專用 Banner */
.page-header {
    background: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    padding: 60px 0;
    color: white;
    text-align: center;
    margin-bottom: 40px;
}

.page-header h1 {
    font-family: var(--font-serif);
    font-size: 2.8rem;
    margin-bottom: 10px;
}

/* 內頁內容排版 - 改為單欄置中 */
.main-content {
    padding-bottom: 80px;
}

.content-wrapper {
    display: block;
}

.page-body {
    background: var(--bg-white);
    max-width: 900px;
    margin: 0 auto;
}

.page-body p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: var(--text-dark);
}

/* 側邊導覽列 (內頁) */
.sidebar {
    background: var(--bg-light);
    padding: 25px;
    border-radius: 8px;
    height: fit-content;
}

.sidebar h3 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.side-links {
    list-style: none;
}

.side-links li a {
    display: block;
    padding: 10px 0;
    color: var(--text-dark);
    text-decoration: none;
    transition: var(--transition-smooth);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.side-links li a:hover, .side-links li.active a {
    color: var(--primary-color);
    padding-left: 10px;
}

/* 團隊成員卡片系統 */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.team-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.team-card:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.team-img {
    height: 250px;
    background: #eef9fb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-img-placeholder {
    font-size: 5rem;
    color: var(--primary-color);
    opacity: 0.3;
}

.team-info {
    padding: 25px;
    border-top: 4px solid var(--primary-color);
}

.team-title {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.team-name {
    font-size: 1.4rem;
    font-family: var(--font-serif);
    margin-bottom: 15px;
}

.team-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.team-meta i {
    width: 20px;
}

/* 相關連結列表 */
.link-list {
    list-style: none;
    margin-top: 20px;
}

.link-item {
    background: var(--bg-light);
    margin-bottom: 15px;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-smooth);
}

.link-item:hover {
    background: #eef9fb;
    transform: translateX(10px);
}

.link-item a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
}

.search-result-card {
    text-decoration: none !important;
    color: inherit !important;
}

.link-url {
    font-size: 0.9rem;
    color: var(--primary-color);
}

/* 回應式設計修正 */
@media (max-width: 992px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    .sidebar {
        order: -1;
    }
}

/* 條列式團隊清單 (無照片版本) */
.team-list {
    margin-top: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    overflow: hidden;
}

.team-row {
    display: grid;
    grid-template-columns: 150px 120px 1fr 120px;
    padding: 25px 30px;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    transition: var(--transition-smooth);
}

.team-row:last-child {
    border-bottom: none;
}

.team-row:hover {
    background: var(--bg-light);
    transform: translateX(5px);
}

.team-row .team-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.team-row .team-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
}

.team-row .team-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text-muted);
    font-size: 1rem;
}

.member-contact {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.member-position {
    color: var(--text-dark);
    font-size: 1.05rem;
    line-height: 1.4;
}

.team-action {
    text-align: right;
}

.btn-detail {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary-color);
    color: white !important;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition-smooth);
    border-bottom: none !important;
    box-shadow: 0 4px 12px rgba(34, 181, 208, 0.2);
}

.btn-detail:hover {
    background: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(34, 181, 208, 0.4);
}

/* 全站主要內容區連結一致性優化 (v1.2.4) */
.page-body a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-smooth);
    border-bottom: 1px solid transparent;
}

.page-body a:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* 團隊成員列表樣式微調 (繼承自通用樣式) */
.team-row a {
    font-weight: 500;
}

@media (max-width: 768px) {
    .team-row {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 10px;
    }
    .team-row:hover {
        transform: none;
    }
    .team-row .team-meta {
        background: var(--bg-light);
        padding: 15px;
        border-radius: 6px;
        gap: 12px;
    }
    .member-contact {
        gap: 15px;
    }
    .team-action {
        text-align: left;
        margin-top: 10px;
    }
    .btn-detail {
        width: 100%;
        text-align: center;
    }
}
