.cat-card, .exam-card { 
    background: #ffffff; border: 1px solid #e0eee0; border-bottom: 5px solid #2d6a4f; 
    padding: 30px; border-radius: 12px; text-decoration: none; color: #1b4332; 
    display: block; transition: 0.3s; height: 100%;
}
.cat-card:hover, .exam-card:hover {
    transform: translateY(-8px); background: #1b4332; color: white !important;
    border-bottom-color: #ff7b00;
}

/* ========== 從 front_index.html 提取的 inline CSS ========== */

body {
    background-color: #f8f9fa;
    font-family: "Microsoft JhengHei", "微軟正黑體", sans-serif;
}

.top-bar {
    background: #1b4332;
    padding: 8px 0;
}

.top-bar .container {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.top-bar a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 14px;
}

.top-bar a:hover {
    color: white;
}

.navbar {
    background: white !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 0;
}

.navbar-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

.navbar-brand {
    font-weight: 900;
    font-size: 2.2rem;
    color: #1b4332;
    text-decoration: none;
    letter-spacing: 1px;
}

.navbar-brand:hover {
    color: #1b4332;
}

.nav-categories {
    background: white;
    width: 100%;
    border-bottom: 3px solid #1b4332;
}

.nav-categories .container {
    display: flex;
    justify-content: flex-start;
    gap: 0;
}

.nav-cat-link {
    color: #333;
    text-decoration: none;
    padding: 18px 28px;
    display: inline-block;
    font-weight: 500;
    font-size: 18px;
    transition: all 0.2s;
    position: relative;
}

.nav-cat-link:first-child {
    padding-left: 0;
}

.nav-cat-link:hover {
    color: #1b4332;
    background: #f8f9fa;
}

.nav-cat-link:hover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #ff7b00;
}

.breadcrumb-nav {
    background: white;
    padding: 15px 25px;
    margin: 20px auto;
    max-width: 1200px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.breadcrumb {
    margin-bottom: 0;
    background: transparent;
    padding: 0;
}

.breadcrumb-item {
    font-size: 0.95rem;
}

.breadcrumb-item a {
    color: #198754;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.breadcrumb-item a:hover {
    color: #145a3a;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #6c757d;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "\203A";
    color: #6c757d;
    font-weight: bold;
}

.category-cards {
    margin: 30px auto;
    max-width: 1200px;
}

.category-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.category-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.category-title {
    font-size: 1.3rem;
    font-weight: 900;
    color: #1b4332;
    margin-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.exam-type-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.exam-type-link {
    display: inline-block;
    padding: 8px 16px;
    background: #f8f9fa;
    color: #333;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.exam-type-link:hover {
    background: #198754;
    color: white;
    border-color: #198754;
}

.mode-section {
    margin: 30px auto 40px;
    max-width: 1200px;
}

.ad-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    margin: 40px auto 60px;
    max-width: 1200px;
    border-radius: 10px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    min-height: 300px;
}

.ad-content {
    color: #333;
}

.ad-content h2 {
    color: #1b4332;
}

.ad-content .lead {
    color: #495057;
}

.mode-card {
    background: white;
    border-radius: 10px;
    padding: 40px 30px;
    text-align: center;
    text-decoration: none;
    color: #333;
    display: block;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    height: 100%;
    border-bottom: 4px solid #198754;
}

.mode-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    color: #198754;
    border-bottom-color: #ff7b00;
}

.mode-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.mode-title {
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 10px;
}

.mode-desc {
    color: #6c757d;
    font-size: 0.95rem;
}

/* ========== 會員頭像下拉選單 ========== */
.user-avatar-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s;
}

.user-avatar-btn:hover {
    transform: scale(1.05);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2d6a4f 0%, #1b4332 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.2s;
}

.user-avatar-btn:hover .user-avatar {
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.user-dropdown-menu {
    min-width: 220px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border: none;
    padding: 8px 0;
    margin-top: 8px;
}

.user-dropdown-menu .dropdown-header {
    padding: 12px 20px;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.user-dropdown-menu .dropdown-item {
    padding: 10px 20px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.user-dropdown-menu .dropdown-item:hover {
    background: #f0fdf4;
    color: #198754;
    padding-left: 24px;
}

.user-dropdown-menu .dropdown-item.text-danger:hover {
    background: #ffe0e0;
    color: #dc3545 !important;
}

/* ========== 手機版 RWD 優化 ========== */
@media (max-width: 768px) {
    /* 頂部導航列 - 手機版隱藏 */
    .top-bar {
        display: none;
    }

    /* Logo 品牌 */
    .navbar-brand {
        font-size: 1.6rem !important;
        letter-spacing: 0;
    }

    .navbar-main {
        padding: 12px 0;
    }

    /* 分類導航 - 手機版改為水平捲動 */
    .nav-categories {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;  /* Firefox */
    }

    .nav-categories::-webkit-scrollbar {
        display: none;  /* Chrome/Safari */
    }

    .nav-categories .container {
        padding-left: 12px;
        padding-right: 12px;
        white-space: nowrap;
        display: flex;
        flex-wrap: nowrap;
        gap: 0;
    }

    .nav-cat-link {
        padding: 12px 14px;
        font-size: 15px;
        flex-shrink: 0;
    }

    .nav-cat-link:first-child {
        padding-left: 12px;
    }

    /* 麵包屑導航 */
    .breadcrumb-nav {
        padding: 10px 15px;
        margin: 15px 10px;
    }

    .breadcrumb-item {
        font-size: 0.85rem;
    }

    /* 分類卡片 */
    .category-cards {
        margin: 20px 10px;
        padding: 0;
    }

    .category-card {
        padding: 20px 15px;
        margin-bottom: 15px;
    }

    .category-title {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }

    /* 考試類型連結 */
    .exam-type-links {
        gap: 8px;
    }

    .exam-type-link {
        padding: 6px 12px;
        font-size: 14px;
    }

    /* 模式選擇區塊 - 手機版三大按鈕優化 */
    .mode-section {
        margin: 30px 15px 40px;
        padding: 0;
    }

    .mode-card {
        padding: 40px 25px;
        margin-bottom: 20px;
        border-radius: 16px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.12);
        border-bottom-width: 5px;
    }

    .mode-card:active {
        transform: scale(0.98);
    }

    .mode-icon {
        font-size: 3.5rem;
        margin-bottom: 20px;
    }

    .mode-title {
        font-size: 1.4rem;
        margin-bottom: 12px;
        font-weight: 900;
    }

    .mode-desc {
        font-size: 1rem;
        line-height: 1.6;
        color: #495057;
    }

    /* 廣告區塊 - 手機版隱藏 */
    .ad-section {
        display: none;
    }

    /* Bootstrap 欄位調整 */
    .col-md-4 {
        margin-bottom: 15px;
    }

    /* 容器內距調整 */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* 小手機優化 (iPhone SE 等) */
@media (max-width: 375px) {
    .navbar-brand {
        font-size: 1.3rem !important;
    }

    .nav-cat-link {
        padding: 10px 12px;
        font-size: 14px;
    }

    .category-title {
        font-size: 1rem;
    }

    .exam-type-link {
        padding: 5px 10px;
        font-size: 13px;
    }

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

    .mode-title {
        font-size: 1.1rem;
    }
}