/* ==========================================
   共用樣式 - 臺北大學永續中心網站
   所有頁面共用的基礎樣式
   ========================================== */

/* ==========================================
   CSS 變數定義 - 配色方案選擇
   使用方法：註解掉當前方案，取消註解想測試的方案，儲存後按 F5 重新整理
   ========================================== */

/* 海洋薄荷綠配色 */
:root {
    --header-height: 80px;
    --primary-dark: #f0f7f4;
    --primary-blue: #00796b;
    --accent-mint: #26a69a;
    --accent-light-mint: #4db6ac;
    --text-light: #004d40;
    --text-gray: #00695c;
    --bg-light: #ffffff;
    --border-light: #b2dfdb;
}

/* 全域重置 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

/* 基礎樣式 */
body {
    font-family: 'Noto Sans TC', system-ui, -apple-system, 'Microsoft JhengHei', 'PingFang TC', sans-serif;
    color: var(--text-light);
    background: var(--primary-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.font-serif {
    font-family: 'Noto Serif TC', 'Playfair Display', 'Microsoft JhengHei', 'PingFang TC', serif;
}

/* 容器 */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ==========================================
   Header 樣式
   ========================================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-light);
}

header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 10px rgba(0, 121, 107, 0.1);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    letter-spacing: 1px;
}

/* Logo 圖片樣式 */
header img[alt="北大永續中心"] {
    height: 4rem;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

header img[alt="北大永續中心"]:hover {
    transform: scale(1.05);
}

/* 導覽列 */
.nav-link {
    position: relative;
    padding: 0.75rem 0.75rem;
    color: #212121;
    font-weight: 400;
    font-size: 0.875rem;
    transition: color 0.3s ease;
    white-space: nowrap;
    text-decoration: none;
}

.nav-link:hover {
    color: var(--primary-blue);
}

/* 下拉選單 */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 121, 107, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 0.875rem 1.5rem;
    color: #212121;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9375rem;
    text-decoration: none;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background: rgba(0, 121, 107, 0.08);
    color: var(--primary-blue);
    padding-left: 2rem;
}

/* 手機選單 */
.mobile-menu-button {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-button span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--text-light);
    transition: all 0.3s ease;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 121, 107, 0.15);
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    border-top: 1px solid var(--border-light);
}

.mobile-menu.active {
    display: block;
}

.mobile-nav-link {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--text-light);
    border-bottom: 1px solid var(--border-light);
    font-weight: 400;
    text-decoration: none;
}

.mobile-dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-dropdown-content {
    display: none;
    background: rgba(0, 0, 0, 0.3);
}

.mobile-dropdown-content.active {
    display: block;
}

.mobile-dropdown-content a {
    padding: 0.875rem 1.5rem 0.875rem 2.5rem;
    font-size: 0.9375rem;
}

/* ==========================================
   通用組件樣式
   ========================================== */

/* 段落區塊 */
.section {
    padding: 6rem 0;
    background: var(--primary-dark);
}

.section-light {
    background: #ffffff;
}

/* 全域文字對比修正 - 確保在淺色背景下清晰可讀 */
.section .text-gray-400,
.section .text-gray-300 {
    color: var(--text-gray) !important;
}

.section .text-red-400 {
    color: var(--accent-mint) !important;
}

.section h2,
.section h3 {
    color: var(--text-light) !important;
}

.section p,
.section .info-text {
    color: var(--text-light) !important;
    opacity: 0.9;
}

/* 內容盒子樣式 */
.content-box {
    background: white;
    padding: 2.5rem;
    border-radius: 14px;
    margin-bottom: 2rem;
    box-shadow:
        0 1px 2px rgba(0, 77, 64, 0.04),
        0 4px 12px rgba(0, 77, 64, 0.03),
        0 8px 24px rgba(0, 77, 64, 0.02);
    border: 1px solid var(--border-light);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.content-box:hover {
    border-color: var(--accent-light-mint);
    box-shadow:
        0 1px 2px rgba(0, 77, 64, 0.06),
        0 6px 16px rgba(0, 77, 64, 0.05),
        0 12px 32px rgba(0, 77, 64, 0.03);
}

.content-box h2 {
    color: var(--primary-blue) !important;
}

.content-box h3 {
    color: var(--accent-mint) !important;
}

.content-box p {
    color: var(--text-light) !important;
    opacity: 0.9;
}

/* 聯絡資訊卡片 */
.campus-card {
    background: white;
    padding: 2rem;
    border-radius: 14px;
    margin-bottom: 2rem;
    box-shadow:
        0 1px 2px rgba(0, 77, 64, 0.04),
        0 4px 12px rgba(0, 77, 64, 0.03),
        0 8px 24px rgba(0, 77, 64, 0.02);
    border: 1px solid var(--border-light);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.campus-card:hover {
    border-color: var(--accent-light-mint);
    box-shadow:
        0 1px 2px rgba(0, 77, 64, 0.06),
        0 6px 16px rgba(0, 77, 64, 0.05),
        0 12px 32px rgba(0, 77, 64, 0.03);
}

.campus-name {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--primary-blue) !important;
    margin-bottom: 1.5rem;
}

.contact-info {
    background: white;
    padding: 2.5rem;
    border-radius: 14px;
    margin-top: 2rem;
    box-shadow:
        0 1px 2px rgba(0, 77, 64, 0.04),
        0 4px 12px rgba(0, 77, 64, 0.03),
        0 8px 24px rgba(0, 77, 64, 0.02);
    border: 1px solid var(--border-light);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-info:hover {
    border-color: var(--accent-light-mint);
    box-shadow:
        0 1px 2px rgba(0, 77, 64, 0.06),
        0 6px 16px rgba(0, 77, 64, 0.05),
        0 12px 32px rgba(0, 77, 64, 0.03);
}

.info-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.info-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.info-text {
    color: var(--text-light) !important;
    opacity: 0.9;
}

/* 頁面標題 */
.page-header {
    margin-top: var(--header-height);
    padding: 6rem 0 4rem;
    background: linear-gradient(135deg, var(--primary-dark) 0%, #e0f2f1 100%);
    border-bottom: 1px solid var(--border-light);
}

.page-header .text-gray-400 {
    color: var(--text-gray) !important;
}

.page-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: 1px;
    color: var(--primary-blue) !important;
}

.page-subtitle {
    font-size: 1rem;
    color: var(--text-gray);
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 300;
}

/* 按鈕 */
.btn-primary {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--primary-blue);
    color: white;
    font-weight: 500;
    border-radius: 10px;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    font-size: 1rem;
    box-shadow: 0 2px 6px rgba(0, 77, 64, 0.15);
}

.btn-primary:hover {
    background: #00695c;
    box-shadow: 0 4px 14px rgba(0, 77, 64, 0.25);
}

.btn-outline {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: transparent;
    color: var(--primary-blue);
    font-weight: 500;
    border: 2px solid var(--primary-blue);
    border-radius: 10px;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    text-decoration: none;
    font-size: 1rem;
}

.btn-outline:hover {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

/* ==========================================
   響應式設計
   ========================================== */
@media (max-width: 1200px) {
    .desktop-nav {
        display: none;
    }

    .mobile-menu-button {
        display: flex;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 3rem 0;
    }

    /* 手機版 Logo 縮小 */
    header img[alt="北大永續中心"] {
        height: 3rem;
    }
}

/* 表單蜜罐（honeypot）隱藏欄位 */
.form-honeypot { display: none; }
