.events-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 0;
}

/* --- 活動卡片：基礎樣式 (白色模式) --- */
.event-card {
    background: rgb(var(--light-card));
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: row;
    align-items: center;
    border: 1px solid rgb(var(--light-border));
    min-height: 140px;
    height: auto;
    color: #24292f;
}

.event-image {
    width: 240px;
    height: 100%;
    position: relative;
}

.event-image::before {
    content: "\f073"; /* FontAwesome 日曆圖示代碼 */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: 10px;
    left: 10px;
    width: 32px;  /* 固定寬度 */
    height: 32px; /* 固定高度，與寬度相同即為正方形 */
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05); /* 輕微深色背景 */
    backdrop-filter: blur(8px); /* 霧面玻璃效果 */
    -webkit-backdrop-filter: blur(8px); /* 相容性 */
    color: #333;
    border-radius: 6px;
    font-size: 14px;
    z-index: 1;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.event-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #f6f8fa;
}

.event-body {
    padding: 16px;
    flex-grow: 1;
}

.event-body h3 {
    margin: 0 0 8px 0;
    font-size: 1.25rem;
    font-weight: bold;
    color: inherit;
}

.event-body p {
    font-size: 1rem;
    color: #4b5563;
    line-height: 1.5;
    margin-bottom: 15px;
}

.event-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    gap: 38px;
    min-width: 160px;
    background: #eef2f6; /* 白色模式下的深色背景 */
    height: 100%;
    position: relative;
    border-left: 1px solid rgb(var(--light-border));
}

.event-status-group {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.status-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
    border: 1px solid; /* 加上邊框 */
    background: transparent; /* 背景透明 */
}

.status-tag.upcoming {
    border-color: #2ea043;
    color: #2ea043;
}

.status-tag.finished, .status-tag.tentative {
    border-color: #ff4d4f;
    color: #ff4d4f;
}

.event-btn {
    display: block;
    text-align: center;
    padding: 8px 16px;
    background: #58a6ff;
    color: #fff;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 500;
    font-size: 14px;
}

.event-btn:hover {
    filter: brightness(0.9);
}

/* --- 活動卡片：深色模式覆寫 --- */
.dark .event-card {
    background: rgb(var(--dark-card));
    border-color: rgb(var(--dark-border));
    color: #c9d1d9;
}

.dark .event-action {
    background: #1f242d;
    border-left: 1px solid rgb(var(--dark-border));
}

.dark .event-body p {
    color: #c9d1d9;
    opacity: 0.8;
}

.dark .event-image::before {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark .event-image img {
    background-color: #0d1117;
}

/* 通用滑鼠懸浮效果 */
.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* 響應式調整：手機板佈局 */
@media (max-width: 768px) {
    .event-card {
        flex-direction: column;
        height: auto;
        min-height: 400px;
    }

    .event-image {
        width: 100%;
        height: 200px;
    }

    .event-body {
        width: 100%;
        padding: 20px;
        text-align: center;
    }

    .event-action {
        width: 100%;
        min-width: unset;
        padding: 20px;
        border-left: none;
        border-top: 1px solid rgb(var(--light-border));
    }
    
    .dark .event-action {
        border-top: 1px solid rgb(var(--dark-border));
    }

    .status-tag {
        position: relative;
        bottom: unset;
        right: unset;
        margin-top: 10px;
        display: inline-block;
    }
}
