/* ============================================================
   💎 琉急式 16.0 - 官方色終極專業版 (Fluid & No Cropping)
   ============================================================ */

:root {
    --liuqiu: #006994;
    --liuqiu-light: #e6f4f9;
    --liuqiu-dark: #004d6e;
    --liuqiu-navy: #1e293b;
    --bg: #f8fafc;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-muted: #64748b;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ── 基礎設置 ── */
* { box-sizing: border-box; }
body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Inter', 'Noto Sans TC', sans-serif;
    margin: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ── 容器 ── */
.app-container { max-width: 1200px; margin: 0 auto; padding-bottom: 100px; }

/* ── 頁面標頭 ── */
.page-header { background: #fff; padding: 110px 20px 50px; border-bottom: 1px solid var(--border); text-align: center; }
.badge-tag { font-size: 0.75rem; font-weight: 800; color: var(--liuqiu); letter-spacing: 2px; padding: 5px 14px; background: var(--liuqiu-light); border-radius: 50px; display: inline-block; margin-bottom: 15px; }
.page-header h1 { font-size: 2.4rem; font-weight: 900; margin: 0; color: var(--text); }
.page-header h1 span { color: var(--liuqiu); }
.page-header p { color: var(--text-muted); font-size: 1.05rem; margin-top: 10px; }

/* ── 工具列 (搜尋與 Chip) ── */
.toolbar-section { padding: 35px 20px; }
.search-input-wrap { position: relative; width: 100%; margin-bottom: 20px; }
.search-input-wrap i { position: absolute; left: 20px; top: 18px; color: var(--text-muted); }
.search-input-wrap input { 
    width: 100%; padding: 16px 20px 16px 55px; border: 2px solid var(--border); 
    border-radius: 16px; font-size: 1rem; outline: none; transition: 0.2s; background: #fff;
}
.search-input-wrap input:focus { border-color: var(--liuqiu); box-shadow: 0 0 0 4px rgba(0, 105, 148, 0.1); }

.chip-container { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.chip-container::-webkit-scrollbar { display: none; }
.chip { 
    padding: 10px 22px; border: 1.5px solid var(--border); border-radius: 50px; 
    background: #fff; cursor: pointer; white-space: nowrap; font-size: 0.9rem; 
    font-weight: 700; color: var(--text-muted); transition: 0.2s; 
}
.chip.active { background: var(--liuqiu); color: #fff; border-color: var(--liuqiu); box-shadow: 0 4px 10px rgba(0, 105, 148, 0.2); }

/* ── 雙欄排版 ── */
.content-split-grid { display: grid; grid-template-columns: 1fr; gap: 35px; padding: 0 20px; }
@media (min-width: 1024px) {
    .content-split-grid { grid-template-columns: 350px 1fr; align-items: start; }
    .sticky-sidebar { position: sticky; top: 100px; }
}

/* ── 日曆卡片 (加大點點) ── */
.calendar-card { background: #fff; border: 1px solid var(--border); border-radius: 28px; padding: 30px; box-shadow: var(--shadow); }
.cal-nav-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.cal-nav-row h2 { font-size: 1.2rem; font-weight: 900; color: var(--liuqiu); margin: 0; }
.nav-arrow { background: var(--bg); border: none; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; color: var(--text-muted); transition: 0.2s; }
.nav-arrow:hover { color: var(--liuqiu); background: var(--liuqiu-light); }

.week-days-labels { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 0.8rem; font-weight: 800; color: var(--text-muted); margin-bottom: 15px; }
.days-grid-layout { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }

.day-item { 
    aspect-ratio: 1; border-radius: 12px; display: flex; align-items: center; 
    justify-content: center; cursor: pointer; position: relative; font-weight: 700; 
    font-size: 0.95rem; transition: 0.2s; color: var(--text); border: 1.5px solid transparent;
}
.day-item:hover { background: var(--liuqiu-soft); color: var(--liuqiu); }
.day-item.selected { background: var(--liuqiu); color: #fff !important; }
.day-item.today { border-color: var(--liuqiu); color: var(--liuqiu); }

/* 🌟 點點強化 (7px) - 採用最精準的 50% 位移置中法 */
.dots-container { 
    display: flex; 
    gap: 3px; 
    position: absolute; 
    bottom: 1px;           /* 距離底部距離微調 */
    left: 50%;             /* 從父層寬度 50% 處開始 */
    transform: translateX(-50%); /* 往左回推自身寬度的一半，達成完美置中 */
    justify-content: center; 
    align-items: center;
    width: 100%;           /* 確保容器能涵蓋多個點點的情況 */
    pointer-events: none;  /* 點點不干擾滑鼠點擊 */
}

.dot-s { 
    width: 8px; 
    height: 8px; 
    border-radius: 50%; 
    flex-shrink: 0;        /* 防止點點被擠壓變形 */
}

/* 額外優化日期文字位置：讓數字稍微上移，幫點點留出視覺空間 */
.day-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 5px;   /* 增加底部內距，讓數字視覺上更居中於圓框 */
}

.calendar-footer-dynamic { margin-top: 30px; border-top: 1px solid var(--border); padding-top: 20px; }
.legend-list { display: flex; flex-wrap: wrap; gap: 12px 18px; margin-bottom: 15px; }
.leg-item { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 700; color: var(--text-muted); }
.leg-dot { width: 9px; height: 9px; border-radius: 50%; }

.status-tips { display: flex; gap: 20px; font-size: 0.75rem; font-weight: 800; color: var(--text-muted); }
.st-today { width: 12px; height: 12px; border: 2px solid var(--liuqiu); border-radius: 3px; display: inline-block; vertical-align: middle; }
.st-sel { width: 12px; height: 12px; background: var(--liuqiu); border-radius: 3px; display: inline-block; vertical-align: middle; }

/* ── 活動清單 ── */
.activity-feed { min-width: 0; }
.feed-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; flex-wrap: wrap; gap: 15px; }
.title-meta { display: flex; align-items: center; gap: 12px; }
.title-meta h3 { font-size: 1.4rem; font-weight: 900; margin: 0; }
#resultsBadge { background: var(--liuqiu); color: #fff; padding: 3px 14px; border-radius: 20px; font-size: 0.85rem; font-weight: 800; }

.ctrl-btns { display: flex; gap: 12px; }
.btn-ghost-ui { background: transparent; border: 1.5px solid var(--border); padding: 10px 20px; border-radius: 12px; cursor: pointer; font-size: 0.7rem; font-weight: 700; color: var(--text-muted); transition: 0.2s; }
.btn-ghost-ui:hover { border-color: var(--liuqiu); color: var(--liuqiu); }
.btn-submit-action { background: var(--liuqiu); color: #fff; border: none; padding: 10px 20px; border-radius: 12px; cursor: pointer; font-weight: 900; font-size: 0.9rem; transition: 0.2s; box-shadow: 0 4px 12px rgba(0, 105, 148, 0.2); }
.btn-submit-action:hover { background: var(--liuqiu-dark); transform: translateY(-2px); }


/* ── 活動卡片外層 ── */
.event-card { 
    background: #fff; 
    border: 1px solid var(--border); 
    border-radius: 28px; 
    margin-bottom: 25px; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    transition: transform 0.2s, box-shadow 0.2s;
}

.event-card:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 15px 30px -10px rgba(0,0,0,0.1); 
}

/* ── 圖片容器 (白底、絕對不裁切) ── */
.card-img-box { 
    position: relative;
    height: 250px;           /* 📱 手機版高度 */
    width: 100%;
    background: #ffffff;     /* 🏆 白色底 */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

/* 🏆 前景圖片：核心修正 🏆 */
.card-img-box img { 
    max-width: 100% !important;  /* 強制不超過寬度 */
    max-height: 100% !important; /* 強制不超過高度 */
    width: auto !important;      /* 自動寬度，不拉伸 */
    height: auto !important;     /* 自動高度，不拉伸 */
    object-fit: contain !important; /* 核心：完整縮放，不裁切 */
    display: block;
}

/* ── 文字內容區 ── */
.card-body-content { 
    padding: 25px 30px; 
    flex-grow: 1; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
}

/* ── 電腦版排版調整 ── */
@media (min-width: 768px) {
    .event-card.with-img { 
        flex-direction: row; 
        min-height: 280px;
    }
    
    .card-img-box { 
        width: 320px;        /* 💻 電腦版左側固定寬度 */
        height: auto;        /* 高度隨右側文字自動撐開 */
        border-right: 1px solid var(--border);
    }

    .card-img-box img {
        width: 100% !important;
        height: 100% !important;
    }
}


.card-img-box img { width: 100%; height: 100%; object-fit: cover; display: block; }

.card-body-content { padding: 35px; flex-grow: 1; display: flex; flex-direction: column; }
.tag-type { font-size: 0.75rem; font-weight: 800; letter-spacing: 1px; margin-bottom: 10px; text-transform: uppercase; }
.card-body-content h2 { font-size: 1.6rem; font-weight: 900; margin: 0 0 15px; color: var(--text); line-height: 1.3; }

.meta-flex { display: flex; flex-wrap: wrap; gap: 10px 25px; margin-bottom: 20px; font-size: 0.9rem; color: var(--text-muted); font-weight: 600; }
.meta-flex div { display: flex; align-items: center; gap: 8px; }
.meta-flex i { color: var(--liuqiu); font-size: 0.85rem; }

.event-summary { font-size: 1rem; line-height: 1.7; color: #334155; margin: 0; }

.card-footer { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--bg); display: flex; justify-content: space-between; align-items: center; }
.status-label { font-size: 0.85rem; font-weight: 800; color: var(--liuqiu); }
.btn-details { text-decoration: none; font-weight: 900; color: var(--text); font-size: 0.95rem; transition: 0.2s; display: flex; align-items: center; gap: 6px; }
.btn-details:hover { color: var(--liuqiu); }

/* ── Modal 彈窗 ── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(8px); z-index: 10000; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop.active { display: flex; }
/* ── Modal 彈窗容器 ── */
.modal-container { 
    background: #fff; 
    width: 100%; 
    max-width: 680px; 
    border-radius: 35px; 
    padding: 45px; 
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.3); 
    max-height: 90vh; 
    overflow-y: auto; 
    position: relative;

    /* 🏆 隱藏捲軸指令 🏆 */
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* IE/Edge */
}

/* 🏆 針對 Chrome, Safari, Edge 隱藏捲軸 🏆 */
.modal-container::-webkit-scrollbar { 
    display: none; 
}.modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 35px; }
.modal-header h2 { margin: 0; font-size: 2rem; font-weight: 900; color: var(--liuqiu); }
.btn-modal-close { background: var(--bg); border: none; width: 45px; height: 45px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; transition: 0.2s; }
.btn-modal-close:hover { background: #fee2e2; color: #ef4444; }

.form-body { display: flex; flex-direction: column; gap: 25px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }
@media (max-width: 600px) { .form-grid-2 { grid-template-columns: 1fr; } }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-size: 0.9rem; font-weight: 800; color: var(--text-muted); }
.form-group input, .form-group textarea { padding: 15px 20px; border: 2px solid var(--border); border-radius: 14px; font-size: 1rem; outline: none; transition: 0.2s; font-family: inherit; }
.form-group input:focus, .form-group textarea:focus { border-color: var(--liuqiu); box-shadow: 0 0 0 4px rgba(0, 105, 148, 0.1); }
.form-group.full-row { grid-column: 1 / -1; }
.btn-form-submit { background: var(--liuqiu); color: #fff; border: none; padding: 18px; border-radius: 50px; font-size: 1.1rem; font-weight: 900; cursor: pointer; transition: 0.3s; margin-top: 10px; }
.btn-form-submit:hover { background: var(--liuqiu-dark); transform: scale(1.02); }

/* 讓活動簡介預設只顯示三行 */
.event-summary {
    position: relative;
    max-height: 4.5em; /* 約三行的高度 */
    overflow: hidden;
    line-height: 1.5;
    transition: max-height 0.3s ease;
    margin-bottom: 10px;
}

/* 展開後的狀態 */
.event-summary.expanded {
    max-height: 2000px; /* 足夠大的高度讓文字完全顯示 */
}

/* 閱讀更多按鈕樣式 */
.read-more-btn {
    background: none;
    border: none;
    color: var(--liuqiu);
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.read-more-btn:hover {
    text-decoration: underline;
}

/* ============================================================
   📱 手機版全面縮小與比例優化 (Media Queries)
   ============================================================ */

@media (max-width: 768px) {
    /* 1. 頁面標頭縮小 */
    .page-header {
        padding: 80px 15px 30px; /* 原本 110px 縮小 */
    }
    .page-header h1 {
        font-size: 1.8rem;      /* 原本 2.4rem */
    }
    .page-header p {
        font-size: 0.9rem;
    }

    /* 2. 搜尋框與按鈕縮小 */
    .toolbar-section {
        padding: 20px 15px;
    }
    .search-input-wrap input {
        padding: 12px 15px 12px 45px;
        font-size: 0.9rem;
        border-radius: 12px;
    }
    .search-input-wrap i {
        top: 15px;
        left: 18px;
    }
    .chip {
        padding: 8px 16px;
        font-size: 0.8rem;
    }

    /* 3. 日曆縮小 */
    .calendar-card {
        padding: 20px;          /* 原本 30px */
        border-radius: 20px;    /* 原本 28px */
    }
    .day-item {
        font-size: 0.85rem;
    }
    .week-days-labels {
        font-size: 0.75rem;
    }

    /* 4. 活動列表卡片縮小 */
    .activity-feed {
        padding: 0 15px;
    }
    .event-card {
        border-radius: 20px;
    }
    .card-body-content {
        padding: 20px;          /* 原本 35px */
    }
    .card-body-content h2 {
        font-size: 1.3rem;      /* 原本 1.6rem */
    }
    .card-img-box {
        height: 200px;          /* 強制圖片高度縮小 */
    }

    /* 5. 🏆 活動投稿彈窗 (Modal) 重點縮小 🏆 */
    .modal-container {
        padding: 25px 20px;     /* 原本 45px 縮小一倍，解決被切掉的問題 */
        border-radius: 20px;
        width: 95%;             /* 讓寬度貼近邊緣但不死貼 */
    }
    .modal-header {
        margin-bottom: 20px;
    }
    .modal-header h2 {
        font-size: 1.5rem;      /* 字體變小 */
    }
    .btn-modal-close {
        width: 35px;
        height: 35px;
    }

    .form-body {
        gap: 15px;              /* 縮小間隙 */
    }
    .form-group label {
        font-size: 0.8rem;      /* 標籤變小 */
    }
    .form-group input, 
    .form-group textarea {
        padding: 10px 15px;     /* 輸入框變矮 */
        font-size: 0.9rem;
        border-radius: 10px;
    }
    .btn-form-submit {
        padding: 14px;
        font-size: 1rem;
    }

    /* 控制日曆與內容的間距 */
    .content-split-grid {
        gap: 20px;
    }
}

/* 針對超小螢幕 (iPhone SE 等) 的微調 */
@media (max-width: 380px) {
    .page-header h1 {
        font-size: 1.5rem;
    }
    .modal-container {
        padding: 20px 15px;
    }
}

/* ── 琉急式圖片放大燈箱 (Lightbox) ── */
.lightbox-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 20000;
    display: none; /* 預設隱藏 */
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    padding: 20px;
    transition: opacity 0.3s ease;
}

.lightbox-backdrop.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 95%;
    max-height: 95%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox-backdrop.active img {
    transform: scale(1);
}

/* 關閉按鈕 */
.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
}

/* 提示活動卡片的圖片可以點擊 */
.card-img-box img {
    cursor: zoom-in;
}