/* --- 1. Swiper 外部容器與高度控制 --- */
.mySwiper {
    width: 100%;
    height: 720px; /* ⭐稍微縮減總高度，讓佈局更緊湊 */
    margin: 20px auto 0 auto; /* 底部邊距歸零 */
    position: relative;
    padding: 0; 
    overflow: hidden; 
}

/* --- 2. Swiper 軌道與 Slide 比例 (Grid 模式) --- */
.swiper-slide {
    /* ⭐關鍵修正：僅減去中間的 20px 間距，讓卡片徹底貼齊上下邊緣 */
    height: calc((100% - 20px) / 2) !important; 
    display: flex;
    justify-content: center;
}

/* --- 3. 活動卡片本體 --- */
.activity-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden; 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    width: 100%; 
    height: 100%; 
    margin: 0;
}

.activity-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* 4. 卡片內容與標籤 */
.card-content {
    padding: 15px; 
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.card-tag {
    background-color: #0000FF; 
    color: #fff;              
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 2px;
    margin-bottom: 8px;
    display: inline-block;
}

.card-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
    margin: 0 0 8px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2; /* ⭐補上標準屬性 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-desc {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.5;
    margin: 0;
    height: 3.8rem;
    overflow: hidden;
}

/* --- 5. 卡片頂部圖片區塊 --- */
.card-thumb {
    position: relative;
    width: 100%;
    height: 160px; 
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    background-color: #f0f0f0;
}

.mini-track {
    display: flex;
    height: 100%;
    width: 100%;
    transition: transform 0.4s ease-in-out;
}

.card-thumb img {
    width: 100%;
    min-width: 100%; 
    flex-shrink: 0; 
    height: 100%;
    object-fit: cover;
    display: block;
    transition: object-fit 0.3s ease, background-color 0.3s ease;
}

.activity-card:hover .card-thumb img {
    object-fit: contain;
    background-color: #000;
}

/* 迷你輪播按鈕 */
.mini-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-thumb:hover .mini-btn { opacity: 1; }
.mini-btn:hover { background-color: rgba(0, 0, 0, 0.8); }
.mini-prev { left: 10px; }
.mini-next { right: 10px; }

/* --- 6. Swiper 主導航箭頭 (左右透明灰色) --- */
.swiper-button-next, 
.swiper-button-prev {
    display: flex !important;
    width: 50px !important;
    height: 100% !important; 
    top: 0 !important;
    margin-top: 0 !important;
    background: linear-gradient(to right, rgba(0,0,0,0.1), transparent);
    color: #fff !important;
    transition: background 0.3s ease;
    z-index: 10;
}

.swiper-button-next {
    right: 0 !important;
    background: linear-gradient(to left, rgba(0,0,0,0.1), transparent);
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
    background: rgba(0, 0, 0, 0.3) !important;
}

.swiper-button-next:after, 
.swiper-button-prev:after {
    font-size: 24px !important;
}

.swiper-button-prev { left: 0 !important; }

/* --- 7. Swiper 分頁導航 (貼齊底部樣式) --- */
.swiper-pagination {
    bottom: 0 !important; /* ⭐貼齊盒子最下方 */
    z-index: 15;
    background: linear-gradient(to top, rgba(255,255,255,0.8), transparent); /* 底端漸層背景，讓點點更清晰 */
    padding: 10px 0 5px 0; /* 給點點一點呼吸空間 */
    width: 100% !important;
    left: 0 !important;
}

.swiper-pagination-bullet {
    width: 8px !important;
    height: 8px !important;
    background: #888 !important; /* 改為灰色，在白色背景下較清楚 */
    opacity: 0.5 !important;
    margin: 0 5px !important;
    transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
    background: #0000ff !important;
    width: 20px !important;
    border-radius: 4px !important;
    opacity: 1 !important;
}
