* { box-sizing: border-box; }

body {
    font-family: "PingFang TC", "Microsoft JhengHei", sans-serif;
    background-color: #f1f5f9;
    margin: 0;
    padding: 0;
}

/* 網頁兩側留白 */
.page-wrapper {
    max-width: 1550px;
    margin: 40px auto;
    padding: 0 50px;
}

.layout-container {
    display: flex;
    align-items: flex-start;
    gap: 30px;
}

/* ---左側篩選欄--- */
.sidebar {
    width: 380px; 
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.sidebar-title {
    margin: 0 0 20px 0;
    font-size: 1.2rem;
    font-weight: bold;
    color: #1e293b;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 12px;
}

.filter-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
    user-select: none;
    white-space: nowrap;
}

.filter-item:hover { background-color: #f8fafc; }

.type-text {
    font-size: 1rem;
    font-weight: bold;
    color: #334155;
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
}

/* --- 方形打勾按鈕 --- */
.checkbox-wrapper { margin-right: 15px; display: flex; align-items: center; }
.square-check {
    width: 20px; height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    position: relative;
    display: inline-block;
}

#ctrl-corp:checked ~ .layout-container [for="ctrl-corp"] .square-check,
#ctrl-visit:checked ~ .layout-container [for="ctrl-visit"] .square-check,
#ctrl-lecture:checked ~ .layout-container [for="ctrl-lecture"] .square-check,
#ctrl-fair:checked ~ .layout-container [for="ctrl-fair"] .square-check {
    background-color: #3b82f6; border-color: #3b82f6;
}

#ctrl-corp:checked ~ .layout-container [for="ctrl-corp"] .square-check::after,
#ctrl-visit:checked ~ .layout-container [for="ctrl-visit"] .square-check::after,
#ctrl-lecture:checked ~ .layout-container [for="ctrl-lecture"] .square-check::after,
#ctrl-fair:checked ~ .layout-container [for="ctrl-fair"] .square-check::after {
    content: ""; position: absolute; left: 6px; top: 1px;
    width: 5px; height: 10px; border: solid white;
    border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}

/* --- CSS 篩選邏輯 --- */
#ctrl-corp:not(:checked) ~ .layout-container .type-corp { display: none; }
#ctrl-visit:not(:checked) ~ .layout-container .type-visit { display: none; }
#ctrl-lecture:not(:checked) ~ .layout-container .type-lecture { display: none; }
#ctrl-fair:not(:checked) ~ .layout-container .type-fair { display: none; }

/* --- 右側表格內容 --- */
.main-content {
    flex-grow: 1;
    background: white;
    padding: 35px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.main-title { margin: 0; font-size: 2.2rem; font-weight: bold; color: #0f172a; }
.legend-info { color: #64748b; font-size: 1rem; margin-top: 5px; font-weight: bold; }

.calendar-table {
    width: 100%;
    margin-top: 25px;
    border-collapse: collapse;
    table-layout: fixed;
}

.calendar-table th {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    color: #475569;
}

.calendar-table td {
    border: 1px solid #e2e8f0;
    height: 160px;
    vertical-align: top;
    padding: 12px;
}


.bg-light-gray {
    background-color: #f3f4f6;
}


.date-num {
    display: block;
    text-align: center;
    font-weight: 900;
    font-size: 1.35rem;
    color: #1e293b;
    margin-bottom: 12px;
}

/* 活動卡片樣式 */
.event-card {
    padding: 10px 8px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 5px solid rgba(0,0,0,0.1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.event-name {
    font-size: 1.05rem;
    font-weight: bold;
    margin-bottom: 2px;
}

.sub-info {
    font-size: 0.85rem;
    font-weight: bold;
    color: inherit;
    opacity: 0.9;
}

.type-corp { background-color: #dbeafe; color: #1e40af; border-color: #3b82f6; }
.type-visit { background-color: #fef9c3; color: #854d0e; border-color: #eab308; }
.type-lecture { background-color: #f3e8ff; color: #6b21a8; border-color: #a855f7; }
.type-fair { background-color: #dcfce7; color: #166534; border-color: #22c55e; }

/* 顏色標記點 */
.bg-corp { background-color: #3b82f6; }
.bg-visit { background-color: #eab308; }
.bg-lecture { background-color: #a855f7; }
.bg-fair { background-color: #22c55e; }