/* 基礎設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', 'Microsoft JhengHei', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    padding-top: 80px; /* 增加 padding 來抵消固定導航欄高度 */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 導航列 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.logo-img {
    max-height: 48px;
    width: auto;
    display: block;
}

.logo-text {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 漢堡選單按鈕 */
.hamburger-menu {
    display: none;
    background: transparent;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    flex-direction: column;
    gap: 4px;
    width: 32px;
    height: 24px;
    align-items: center;
    justify-content: center;
}

.hamburger-menu span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* 漢堡選單按鈕 hover 效果 */
.hamburger-menu:hover {
    background: rgba(37, 99, 235, 0.1);
}

.hamburger-menu:hover span {
    background: var(--primary-color);
}

/* 手機版顯示漢堡選單 */
@media (max-width: 1024px) {
    .navbar {
        padding: 0.7rem 1rem;
        gap: 1rem;
    }

    .hamburger-menu {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(12px);
        flex-direction: column;
        align-items: center;
        padding: 0;
        gap: 0;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
        z-index: 999;
    }

    .nav-menu.open {
        max-height: 600px;
        opacity: 1;
        padding: 1rem;
        gap: 0.3rem;
    }

    .nav-link {
        text-align: center;
        font-size: 1rem;
        padding: 0.85rem 1.2rem;
        min-height: auto;
        border-radius: 10px;
        width: 90%;
    }

    .nav-link:hover {
        background: rgba(37, 99, 235, 0.08);
    }

    .hero {
        padding: 85px 1.2rem 55px;
    }

    .hero-title {
        font-size: clamp(2rem, 5vw, 3.5rem);
        line-height: 1.15;
    }

    .hero-subtitle {
        font-size: clamp(1.5rem, 4.2vw, 2.5rem);
        line-height: 1.3;
    }

    .section-title {
        font-size: 1.65rem;
    }

    .facebook-card {
        padding: 1.6rem 1rem;
    }

    .facebook-card h3 {
        font-size: 1.45rem;
    }

    .process-step {
        flex-direction: column;
        gap: 1.3rem;
    }

    .step-number {
        width: 60px;
        height: 60px;
        font-size: 1.45rem;
        min-width: 60px;
    }

    .step-content h3 {
        font-size: 1.25rem;
    }

    .reasons-section, #why-us {
        padding-top: 2.8rem;
    }

    .reasons-grid {
        grid-template-columns: 1fr;
        gap: 1.6rem;
    }

    .reason-item {
        padding: 1.8rem;
    }

    .reason-item h3 {
        font-size: 1.2rem;
    }

    .feature-card {
        padding: 1.5rem;
    }

    .feature-card h3 {
        font-size: 1.15rem;
    }

    .cta-button {
        padding: 1rem 2rem;
        font-size: 1rem;
        min-width: 180px;
        border-radius: 999px;
    }

    .courses-grid,
    .vehicles-grid,
    .medical-grid,
    .videos-grid,
    .facebook-gallery {
        grid-template-columns: 1fr;
    }

    .feature-card {
        padding: 1.3rem;
    }

    .feature-card h3 {
        font-size: 1.05rem;
    }

    .reasons-section, #why-us {
        padding-top: 2.5rem;
    }

    .reason-item {
        padding: 1.6rem;
    }

    .reason-item h3 {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    /* === 考試流程 — 手機版卡片式佈局 === */
    .exam-process {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .process-step {
        padding: 1.5rem;
        background: var(--bg-white);
        border-radius: 1rem;
        box-shadow: var(--shadow-md);
        margin-bottom: 1rem;
    }

    /* 表格 wrapper — 移除 overflow，讓卡片自然堆疊 */
    .exam-table-wrapper {
        display: block;
        overflow-x: visible;
        margin-top: 1rem;
    }

    /* 把整個 table → tbody → tr → td 全部轉成 block 佈局 */
    .exam-table,
    .exam-table tbody,
    .exam-table thead {
        display: block;
        min-width: auto !important;
    }

    /* 隱藏表頭 */
    .exam-table thead {
        display: none;
    }

    /* 每個 tr 變成一張卡片 — 用 grid 控制欄位 */
    .exam-table tbody tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        background: var(--bg-white);
        border-radius: 0.75rem;
        padding: 1rem;
        margin-bottom: 1rem;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
        border: 1px solid rgba(15, 23, 42, 0.08);
        gap: 0;
    }

    /* td/th 全部變成 block */
    .exam-table td,
    .exam-table th {
        display: block;
        width: auto;
        box-sizing: border-box;
        border: none;
        padding: 0.4rem 0;
        text-align: left;
    }

    /* 科目名稱 — 卡片標題，跨滿全寬 */
    .exam-table tr th:first-child,
    .exam-table tr td:first-child {
        grid-column: 1 / -1;
        font-size: 1.15rem;
        font-weight: 700;
        color: var(--secondary-color);
        padding-bottom: 0.6rem;
        margin-bottom: 0.6rem;
        border-bottom: 2px solid var(--secondary-color);
    }

    /* 詳細說明 — 跨滿全寬 */
    .exam-table tr th + td,
    .exam-table tr td:nth-child(2) {
        grid-column: 1 / -1;
        font-size: 0.9rem;
        line-height: 1.7;
        color: var(--text-light);
        padding-bottom: 0.8rem;
        margin-bottom: 0.8rem;
        border-bottom: 1px dashed rgba(15, 23, 42, 0.1);
    }

    /* 圖片欄位 — 各佔一半，並排顯示 */
    .exam-table tr td:nth-child(3),
    .exam-table tr td:nth-child(4) {
        padding: 0;
        border-bottom: none;
    }

    /* 表格內的 img 全寬顯示 */
    .exam-table tr td:nth-child(3) img,
    .exam-table tr td:nth-child(4) img {
        width: 100%;
        height: 120px;
        object-fit: cover;
        border-radius: 0.5rem;
        display: block;
        border: 1px solid rgba(15, 23, 42, 0.08);
    }

    /* exam-thumb-row（流程步驟內的圖片列） */
    .exam-thumb-row {
        display: flex;
        gap: 0.5rem;
        margin-top: 0.75rem;
        flex-wrap: wrap;
    }

    .exam-thumb {
        width: calc(50% - 0.25rem);
        height: 120px;
        object-fit: cover;
        border-radius: 0.5rem;
        border: 1px solid rgba(15, 23, 42, 0.08);
    }

    .step-number {
        width: 55px;
        height: 55px;
        font-size: 1.35rem;
    }
}

@media (max-width: 540px) {
    .navbar {
        padding: 0.6rem 1rem;
    }

    .nav-menu {
        width: 100%;
        justify-content: center;
        gap: 0.35rem;
    }

    .nav-link {
        font-size: 0.88rem;
        padding: 0.65rem 0.75rem;
        min-height: 46px;
        border-radius: 6px;
    }

    .hero-title {
        font-size: clamp(1.7rem, 4.2vw, 2.8rem);
        line-height: 1.1;
    }

    .hero-subtitle {
        font-size: clamp(1.25rem, 3.2vw, 2rem);
        line-height: 1.25;
    }

    .cta-button {
        padding: 1rem 2rem;
        font-size: 1rem;
        min-width: 180px;
        border-radius: 999px;
    }

    .courses-grid,
    .vehicles-grid,
    .medical-grid,
    .videos-grid,
    .facebook-gallery {
        grid-template-columns: 1fr;
    }

    .feature-card {
        padding: 1.3rem;
    }

    .feature-card h3 {
        font-size: 1.05rem;
    }

    .reasons-section, #why-us {
        padding-top: 2.5rem;
    }

    .reason-item {
        padding: 1.6rem;
    }

    .reason-item h3 {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    /* 測驗項目 — 小螢幕手機優化 */
    .exam-table tr th:first-child,
    .exam-table tr td:first-child {
        font-size: 1rem;
    }

    .exam-table tr th + td,
    .exam-table tr td:nth-child(2) {
        font-size: 0.85rem;
    }

    .exam-table tr td:nth-child(3) img,
    .exam-table tr td:nth-child(4) img {
        height: 90px;
        border-radius: 0.4rem;
    }

    .exam-thumb-row {
        display: flex;
        gap: 0.4rem;
        margin-top: 0.6rem;
        flex-wrap: wrap;
    }

    .exam-thumb {
        width: calc(50% - 0.2rem);
        height: 90px;
        object-fit: cover;
        border-radius: 0.4rem;
        border: 1px solid rgba(15, 23, 42, 0.08);
    }

    .step-number {
        width: 55px;
        height: 55px;
        font-size: 1.35rem;
    }
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-left: 0;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    padding: 0.65rem 1rem;
    border-radius: 999px;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.92rem;
}

.nav-link:hover {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.2);
}

/* 頁面區塊 */
.page-section {
    min-height: 100vh;
    padding: 100px 0 60px;
    display: none;
}

.page-section.active {
    display: block;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    position: relative;
}

.section-title::after {
    content: '';
    width: 80px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    position: absolute;
    left: 0;
    bottom: -12px;
}

/* 首頁 Hero 區域 */
.hero {
    position: relative;
    background: linear-gradient(rgba(10, 10, 10, 0.45), rgba(10, 10, 10, 0.45)), url('images/home.jpg') center / cover no-repeat;
    color: #f8fafc;
    padding: 100px 20px 60px;
    text-align: center;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 680px;
    height: 680px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0) 60%);
    pointer-events: none;
    opacity: 0.45;
}

.hero-content {
    position: relative;
    max-width: 780px;
    margin: 0 auto;
    z-index: 1;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
    color: #ffffff;
    text-shadow: 2px 10px 30px rgba(0, 0, 0, 0.45);
}

.hero-subtitle {
    font-size: clamp(2rem, 6vw, 3.5rem);
    margin-bottom: 2rem;
    color: #f5f7fb;
    opacity: 1;
    text-shadow: 2px 8px 25px rgba(0, 0, 0, 0.45);
    font-weight: 700;
}

.cta-button {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    padding: 1rem 2.2rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.line-button {
    background: #00b900;
    font-size: 1rem;
}

.line-button:hover {
    background: #00a600;
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* 特色卡片 */
.features {
    padding: 4rem 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.12);
}

/* 首頁資訊卡片 */
.features-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 4rem 0;
}

.info-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2.5rem;
    border-radius: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.info-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.info-card p {
    line-height: 1.8;
    opacity: 0.95;
}

/* 特色圖示 */
.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--text-light);
}

/* 安駕技術照片區塊 */
.safety-training-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.safety-training-img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.safety-training-img:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15);
}

.about-text h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.85rem;
}

.about-text p {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.about-images {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.about-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 0.75rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    transition: transform 0.25s ease;
    cursor: zoom-in;
}

.about-img:hover {
    transform: scale(1.05);
}

.map-section {
    padding-bottom: 4rem;
}

.map-section h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.75rem;
}

.map-container iframe {
    width: 100%;
    min-height: 420px;
    border: 0;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
}

/* 課程介紹 */
.courses-grid,
.vehicles-grid,
.exam-process,
.medical-grid,
.videos-grid,
.facebook-gallery {
    display: grid;
    gap: 2rem;
    padding: 4rem 0;
}

.courses-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.vehicles-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.videos-grid {
    grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
}

.video-card {
    padding: 3rem;
    border-left: 4px solid var(--primary-color);
    min-height: 400px;
}

.exam-process {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 4rem 0;
}

.medical-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.videos-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.course-card,
.vehicle-card,
.exam-card,
.medical-card,
.video-card,
.gallery-item,
.contact-item {
    background: var(--bg-white);
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.course-card:hover,
.vehicle-card:hover,
.exam-card:hover,
.medical-card:hover,
.video-card:hover,
.gallery-item:hover,
.contact-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.course-card {
    padding: 2rem;
    border-left: 4px solid var(--primary-color);
}

.course-card h3,
.vehicle-card h3,
.exam-card h3,
.medical-card h3,
.video-card h3 {
    margin-bottom: 1rem;
    font-size: 1.35rem;
}

.course-card p,
.vehicle-card p,
.video-card p,
.medical-card p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.course-card ul,
.exam-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.course-card li,
.exam-card li {
    padding: 0.65rem 0;
    color: var(--text-light);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.course-card li:last-child,
.exam-card li:last-child {
    border-bottom: none;
}

.vehicle-card {
    padding: 2rem;
    border-top: 4px solid var(--primary-color);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.vehicle-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.vehicle-card:hover .vehicle-image {
    transform: scale(1.05);
}

.vehicle-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.vehicle-card p {
    color: var(--text-light);
}

.exam-card {
    padding: 2rem;
    border-left: 4px solid var(--accent-color);
}

.exam-card h3 {
    color: var(--accent-color);
}

/* 考試流程步驟樣式 */
.process-step {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    background: var(--bg-white);
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    align-items: flex-start;
}

.process-step:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.step-number {
    min-width: 60px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.35rem;
}

.step-content > p {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.step-content ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
}

.exam-detail {
    margin-bottom: 1.5rem;
}

.exam-detail h4 {
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
    color: var(--secondary-color);
}

.exam-note {
    color: var(--text-dark);
    font-weight: 600;
    margin-top: 0.75rem;
    display: inline-block;
}

.exam-table-wrapper {
    overflow-x: auto;
    margin-top: 1rem;
}

.exam-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.exam-table th,
.exam-table td {
    padding: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    vertical-align: top;
}

.exam-table th {
    background: rgba(37, 99, 235, 0.08);
    color: var(--text-dark);
    font-weight: 700;
    text-align: left;
}

.exam-table tbody tr:nth-child(even) {
    background: rgba(249, 250, 251, 1);
}

.exam-table .subject {
    width: 170px;
    font-weight: 700;
    color: var(--secondary-color);
}

.exam-table .details {
    color: var(--text-light);
    line-height: 1.6;
}

.exam-thumb-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.exam-thumb {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 0.75rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    transition: transform 0.25s ease;
    cursor: zoom-in;
}

.image-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.78);
    z-index: 2200;
    padding: 1rem;
}

.image-modal.open {
    display: flex;
}

.image-modal img {
    max-width: 95%;
    max-height: 95%;
    border-radius: 1rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.image-modal .modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    color: #ffffff;
    font-size: 2.2rem;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
}

.image-modal.open .modal-close {
    display: block;
}

.step-content li {
    padding: 0.65rem 0;
    color: var(--text-light);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    padding-left: 1.5rem;
    position: relative;
}

.step-content li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.step-content li:last-child {
    border-bottom: none;
}

.medical-card {
    padding: 2rem;
    border-left: 4px solid var(--secondary-color);
}

.medical-card h3 {
    color: var(--secondary-color);
}

.medical-card p {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.video-card {
    padding: 2rem;
    border-left: 4px solid var(--primary-color);
}

.video-card h3 {
    color: var(--primary-color);
}

.video-card p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.video-card iframe {
    width: 100% !important;
    height: 315px !important;
    border-radius: 0.5rem;
    display: block;
}

.youtube-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    color: white;
    padding: 1.25rem 2rem;
    border-radius: 0.75rem;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 8px 20px rgba(255, 0, 0, 0.2);
}

.youtube-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(255, 0, 0, 0.3);
}

.youtube-link .arrow {
    transition: transform 0.3s ease;
}

.youtube-link:hover .arrow {
    transform: translateX(5px);
}

.video-placeholder {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 0.75rem;
    text-align: center;
    font-size: 2rem;
}

/* FB 粉絲專頁 */
.facebook-section {
    padding: 4rem 0;
}

.facebook-card {
    background: linear-gradient(135deg, #1877f2, #0d5ab9);
    color: white;
    padding: 3rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.facebook-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.facebook-icon {
    width: 32px;
    height: 32px;
    fill: white;
}

.facebook-card h3 {
    font-size: 1.8rem;
}

.facebook-card p {
    margin-bottom: 2rem;
    opacity: 0.9;
}

.facebook-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    color: #1877f2;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.facebook-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.facebook-arrow {
    transition: transform 0.3s ease;
}

.facebook-button:hover .facebook-arrow {
    transform: translateX(5px);
}

.facebook-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.gallery-item {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 0.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.gallery-placeholder {
    font-size: 2rem;
    color: var(--text-light);
}

/* 聯絡資訊 */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 4rem 0;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-white);
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
}

.contact-icon {
    font-size: 2rem;
}

.contact-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.contact-item a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}

.contact-item p {
    color: var(--text-light);
}

/* 手機版聯絡資訊優化 */
@media (max-width: 1024px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 3rem 0;
    }

    .contact-info {
        gap: 1.25rem;
    }

    .contact-item {
        padding: 1.25rem;
        gap: 0.75rem;
    }

    .contact-icon {
        font-size: 1.75rem;
    }

    .contact-item h3 {
        font-size: 1.1rem;
    }

    .contact-item p {
        font-size: 0.95rem;
    }

    .contact-map iframe {
        min-height: 350px;
    }
}

@media (max-width: 540px) {
    .contact-grid {
        padding: 2rem 0;
    }

    .contact-info {
        gap: 1rem;
    }

    .contact-item {
        padding: 1rem;
        gap: 0.6rem;
    }

    .contact-icon {
        font-size: 1.5rem;
    }

    .contact-item h3 {
        font-size: 1rem;
    }

    .contact-item p {
        font-size: 0.9rem;
    }

    .contact-map iframe {
        min-height: 300px;
    }
}

/* 頁尾 */
.footer {
    background: #0f172a;
    color: white;
    padding: 2.5rem 0;
    text-align: center;
}

.footer p {
    margin-bottom: 0.5rem;
    opacity: 0.75;
}

/* 漢堡選單按鈕 */
.hamburger-menu {
    display: none;
    background: transparent;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    cursor: pointer;
    padding: 0.4rem;
    z-index: 1001;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    transition: background 0.3s ease, color 0.3s ease;
}

.hamburger-menu svg {
    width: 24px;
    height: 24px;
}

.hamburger-line {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 漢堡選單按鈕 hover 效果 */
.hamburger-menu:hover {
    background: rgba(37, 99, 235, 0.1);
}

/* 開啟狀態 — SVG 動畫：三線變 X */
.hamburger-menu.open .line-top {
    transform-origin: 12px 6px;
    transform: translateY(6px) rotate(45deg);
}

.hamburger-menu.open .line-mid {
    opacity: 0;
    transform: scaleX(0);
    transform-origin: 12px 12px;
}

.hamburger-menu.open .line-bot {
    transform-origin: 12px 18px;
    transform: translateY(-6px) rotate(-45deg);
}

.hamburger-menu.open {
    background: rgba(37, 99, 235, 0.15);
}

/* 手機版顯示漢堡選單 */
@media (max-width: 1024px) {
    .navbar {
        padding: 0.7rem 1rem;
        gap: 1rem;
    }

    .hamburger-menu {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(12px);
        flex-direction: column;
        align-items: center;
        padding: 0;
        gap: 0;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
        z-index: 999;
    }

    .nav-menu.open {
        max-height: 600px;
        opacity: 1;
        padding: 1rem;
        gap: 0.3rem;
    }

    .nav-link {
        text-align: center;
        font-size: 1rem;
        padding: 0.85rem 1.2rem;
        min-height: auto;
        border-radius: 10px;
        width: 90%;
    }

    .nav-link:hover {
        background: rgba(37, 99, 235, 0.08);
    }

    .hero {
        padding: 85px 1.2rem 55px;
    }

    .hero-title {
        font-size: clamp(2rem, 5vw, 3.5rem);
        line-height: 1.15;
    }

    .hero-subtitle {
        font-size: clamp(1.5rem, 4.2vw, 2.5rem);
        line-height: 1.3;
    }

    .section-title {
        font-size: 1.65rem;
    }

    .facebook-card {
        padding: 1.6rem 1rem;
    }

    .facebook-card h3 {
        font-size: 1.45rem;
    }

    .process-step {
        flex-direction: column;
        gap: 1.3rem;
    }

    .step-number {
        width: 60px;
        height: 60px;
        font-size: 1.45rem;
        min-width: 60px;
    }

    .step-content h3 {
        font-size: 1.25rem;
    }

    .reasons-section, #why-us {
        padding-top: 2.8rem;
    }

    .reasons-grid {
        grid-template-columns: 1fr;
        gap: 1.6rem;
    }

    .reason-item {
        padding: 1.8rem;
    }

    .reason-item h3 {
        font-size: 1.2rem;
    }

    .feature-card {
        padding: 1.5rem;
    }

    .feature-card h3 {
        font-size: 1.15rem;
    }

    .cta-button {
        padding: 1rem 2rem;
        font-size: 1rem;
        min-width: 180px;
        border-radius: 999px;
    }

    .courses-grid,
    .vehicles-grid,
    .medical-grid,
    .videos-grid,
    .facebook-gallery {
        grid-template-columns: 1fr;
    }

    .feature-card {
        padding: 1.3rem;
    }

    .feature-card h3 {
        font-size: 1.05rem;
    }

    .reasons-section, #why-us {
        padding-top: 2.5rem;
    }

    .reason-item {
        padding: 1.6rem;
    }

    .reason-item h3 {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .exam-table-wrapper {
        overflow-x: auto;
    }

    .exam-table th,
    .exam-table td {
        padding: 0.7rem 0.5rem;
        font-size: 0.85rem;
    }

    /* 手機版考試流程卡片式佈局 */
    @media (max-width: 1024px) {
        .exam-process {
            display: flex;
            flex-direction: column;
            gap: 2rem;
        }

        .process-step {
            padding: 1.5rem;
            background: var(--bg-white);
            border-radius: 1rem;
            box-shadow: var(--shadow-md);
            margin-bottom: 1rem;
        }

        .exam-table-wrapper {
            overflow-x: auto;
            margin-top: 1rem;
        }

        .exam-table th,
        .exam-table td {
            padding: 0.7rem 0.5rem;
            font-size: 0.85rem;
        }

        /* 將表格改為卡片式佈局 */
        .exam-table-wrapper {
            display: grid;
            gap: 1rem;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        }

        .exam-table th,
        .exam-table td {
            display: block;
            width: 100%;
            box-sizing: border-box;
        }

        .exam-table tr {
            background: var(--bg-white);
            border-radius: 0.75rem;
            padding: 1rem;
            margin-bottom: 0.5rem;
            box-shadow: var(--shadow-sm);
        }

        .exam-table th,
        .exam-table td {
            display: block;
            width: 100%;
            border: none;
            padding: 0.5rem 0;
        }

        .exam-table th {
            font-weight: 700;
            color: var(--primary-color);
            margin-bottom: 0.25rem;
            text-transform: uppercase;
            font-size: 0.8rem;
            letter-spacing: 0.05em;
        }

        .exam-table td {
            padding-left: 0;
            border-bottom: 1px dashed rgba(15, 23, 42, 0.06);
        }

        .exam-table td:last-child {
            border-bottom: none;
        }

        /* 科目名稱特別處理 */
        .exam-table tr .subject {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--secondary-color);
            margin-bottom: 0.5rem;
            padding-bottom: 0.5rem;
            border-bottom: 2px solid var(--secondary-color);
        }

        /* 圖片縮圖改為單欄 */
        .exam-thumb-row {
            display: flex;
            gap: 0.75rem;
            margin-top: 1rem;
            flex-wrap: wrap;
        }

        .exam-thumb {
            width: calc(50% - 0.375rem);
            height: 120px;
            object-fit: cover;
            border-radius: 0.5rem;
            border: 1px solid rgba(15, 23, 42, 0.08);
        }
    }

    @media (max-width: 540px) {
        .exam-table-wrapper {
            display: block;
            overflow-x: auto;
        }

        .exam-table th,
        .exam-table td {
            padding: 0.6rem 0.4rem;
            font-size: 0.8rem;
        }

        .exam-thumb-row {
            display: flex;
            gap: 0.5rem;
            margin-top: 0.75rem;
            flex-wrap: wrap;
        }

        .exam-thumb {
            width: calc(33.33% - 0.25rem);
            height: 100px;
            object-fit: cover;
            border-radius: 0.5rem;
            border: 1px solid rgba(15, 23, 42, 0.08);
        }

        .exam-table tr {
            padding: 0.75rem;
        }

        .exam-table th {
            font-size: 0.75rem;
        }

        .exam-table td {
            font-size: 0.75rem;
        }

        .exam-table tr .subject {
            font-size: 1rem;
        }
    }

    .step-number {
        width: 55px;
        height: 55px;
        font-size: 1.35rem;
    }
}

@media (max-width: 540px) {
    .navbar {
        padding: 0.6rem 1rem;
    }

    .nav-menu {
        width: 100%;
        justify-content: center;
        gap: 0.35rem;
    }

    .nav-link {
        font-size: 0.88rem;
        padding: 0.65rem 0.75rem;
        min-height: 46px;
        border-radius: 6px;
    }

    .hero-title {
        font-size: clamp(1.7rem, 4.2vw, 2.8rem);
        line-height: 1.1;
    }

    .hero-subtitle {
        font-size: clamp(1.25rem, 3.2vw, 2rem);
        line-height: 1.25;
    }

    .cta-button {
        padding: 1rem 2rem;
        font-size: 1rem;
        min-width: 180px;
        border-radius: 999px;
    }

    .courses-grid,
    .vehicles-grid,
    .medical-grid,
    .videos-grid,
    .facebook-gallery {
        grid-template-columns: 1fr;
    }

    .feature-card {
        padding: 1.3rem;
    }

    .feature-card h3 {
        font-size: 1.05rem;
    }

    .reasons-section, #why-us {
        padding-top: 2.5rem;
    }

    .reason-item {
        padding: 1.6rem;
    }

    .reason-item h3 {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .exam-table-wrapper {
        overflow-x: auto;
    }

    .exam-table th,
    .exam-table td {
        padding: 0.7rem 0.5rem;
        font-size: 0.85rem;
    }

    .step-number {
        width: 55px;
        height: 55px;
        font-size: 1.35rem;
    }
}