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

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

.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;
}

.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);
}

.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;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.category-card {
    background: white;
    border-radius: 15px;
    padding: 40px 30px;
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-bottom: 5px solid #198754;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #198754, #2d6a4f);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.category-card:hover::before {
    transform: scaleX(1);
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.15);
    color: #198754;
    border-bottom-color: #ff7b00;
}

.category-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
}

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

.category-desc {
    color: #6c757d;
    font-size: 0.95rem;
    margin-bottom: 0;
}

.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;
}

/* 手機版 RWD */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.5rem !important;
    }

    /* 分類導航 - 手機版水平捲動 */
    .nav-categories {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .nav-categories::-webkit-scrollbar { display: none; }
    .nav-categories .container {
        padding-left: 12px;
        padding-right: 12px;
        white-space: nowrap;
        flex-wrap: nowrap;
    }

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

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

    .ad-section {
        margin: 30px 10px 40px;
        padding: 40px 20px;
        min-height: 200px;
    }

    .category-card {
        padding: 30px 20px;
    }

    .category-icon {
        font-size: 3rem;
    }

    .category-name {
        font-size: 1.3rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
