/* ============================================================
   全站共用樣式（common.css）
   引用者：index / trtc / tmrt / bus / tra / 404 —— 每頁 <head> 皆有
   <link rel="stylesheet" href="/common.css">。
   涵蓋：基底重置與背景、版面框架、navbar（navbar.php 為純標記）。
   四個程式介紹頁另外共用的卡片／下載區樣式在 content.css；
   各頁專屬樣式仍寫在各頁自身的 <style>。
   ============================================================ */

/* ---- 基底重置與背景 ---- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    /* 恆顯捲軸軌道：避免長短頁面因捲軸有無造成視口寬度不同、背景置中偏移 */
    overflow-y: scroll;
}
body {
    font-family: 'Microsoft JhengHei', Arial, sans-serif;
    line-height: 1.6;
    font-size: 1.1rem;
    min-height: 100vh;
}
/* 背景用固定定位圖層：background-attachment: fixed 在 iOS 不支援（會被放大到
   整份文件高度、各頁裁切不一），固定圖層在所有平台都以視口為準、各頁一致 */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: url('/image.jpg');
    background-size: cover;
    background-position: center;
}

/* ---- 版面框架 ---- */
.main-content {
    padding-top: 150px;
    padding-bottom: 40px;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.page-title {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    font-size: 2.5rem;
}

/* ---- navbar（標記在 navbar.php）---- */
.navbar {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 1.2rem 2rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: bold;
    text-decoration: none;
}
.nav-links {
    display: flex;
    gap: 2rem;
}
.nav-links a {
    color: #2c3e50;
    text-decoration: none;
    font-size: 1.3rem;
    transition: color 0.3s;
    font-weight: 500;
}
.nav-links a:hover {
    color: #3498db;
}
.navbar a:focus-visible {
    outline: 3px solid #3498db;
    outline-offset: 4px;
    border-radius: 4px;
}

/* ---- 手機版 ----
   .page-title 的手機版間距各頁不同（首頁 22px、內容頁 24px），留在各頁自理 */
@media (max-width: 600px) {
    .main-content {
        padding-top: 135px;
        padding-bottom: 24px;
    }
    .container {
        padding: 0 12px;
    }
    .navbar {
        padding: 0.85rem 1rem;
    }
    .navbar-container {
        flex-direction: column;
        gap: 0.55rem;
    }
    .logo {
        font-size: 1.45rem;
        line-height: 1.2;
    }
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.45rem 1.25rem;
    }
    .nav-links a {
        font-size: 1rem;
    }
}
@media (prefers-reduced-motion: reduce) {
    .nav-links a {
        transition: none;
    }
}
