:root {
    --tag-0: #f5cab3;
    --tag-1: #fbc687;
    --tag-2: #f4f7c5;
    --tag-3: #a7e9af;
    --tag-4: #9de3d0;
    --tag-5: #8ac6d1;
    --tag-6: #a6b1e1;
}

body {
    font-family: "Microsoft JhengHei", sans-serif;
    background: linear-gradient(-45deg, #fdf6e3, #faf0e6, #fff8f0, #f5f0eb);
    background-size: 400% 400%;
    animation: gradientFlow 20s ease infinite;
}

@keyframes gradientFlow {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 強制漢堡選單永遠顯示 */
.custom-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 10px;
    background: white;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 1030;
}

/* 分類標籤區 (Toolbar 下方) */
.category-toolbar {
    padding: 10px 0;
    background: white;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.category-toolbar .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.btn-tag {
    border-radius: 50px;
    padding: 6px 20px;
    border: 1px solid rgba(0,0,0,0.15);
    font-size: 0.9rem;
    text-decoration: none;
    color: #333;
    display: inline-block;
    transition: all 0.2s;
}
.btn-tag:hover { opacity: 0.8; transform: translateY(-2px); }

.tag-0 { background-color: var(--tag-0); }
.tag-1 { background-color: var(--tag-1); }
.tag-2 { background-color: var(--tag-2); }
.tag-3 { background-color: var(--tag-3); }
.tag-4 { background-color: var(--tag-4); }
.tag-5 { background-color: var(--tag-5); }
.tag-6 { background-color: var(--tag-6); }

/* 卡片設計 */
.project-card {
    border: none;
    border-top: 1px solid rgba(0,0,0,0.05);
    border-left: 1px solid rgba(0,0,0,0.05);
    border-right: 1px solid rgba(0,0,0,0.05);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.project-card .card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* 讓最後一個 div (組員區塊) 自動推到底部 */
.project-card .card-body > div:last-child {
    margin-top: auto;
}

.medal-icon { width: 40px; margin-right: 8px; }
.member-pill {
    background-color: #f0f0f0;
    border-radius: 14px;
    padding: 4px 12px;
    font-size: 0.8rem;
    margin-right: 4px;
    white-space: nowrap;
    display: inline-block;
    margin-bottom: 6px;
}

.card-footer-links {
    padding: 0;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    display: flex;
    overflow: hidden;
}

.card-footer-links a { 
    text-decoration: none; 
    color: #444; 
    font-size: 0.9rem; 
    /* font-weight: bold; */
    flex: 1;
    text-align: center;
    padding: 12px 2px;
    transition: all 0.3s ease;
}

.card-footer-links a:last-child {
    border-right: none;
}

.card-footer-links a:hover {
    background-color: rgba(255,255,255,0.4);
    color: #000;
}

/* 顯示邏輯：桌機隱藏非活動區，手機全顯示 */
@media (min-width: 768px) {
    .category-section { display: none; }
    .category-section.active { display: block; }
}

/* 導覽列文字大小設定 */
.navbar-title { font-size: 1.75rem; }
.navbar-history-link { font-size: 0.9rem; }

@media (max-width: 767px) {
    .category-section { display: block; margin-bottom: 40px; }
    /* 小裝置時隱藏發表領域標題 */
    .category-toolbar { display: none; }
    
    /* 手機版縮小導覽列文字 */
    .navbar-title { font-size: 1.1rem; }
    .navbar-history-link { font-size: 0.75rem; }
}

/* 隱藏下拉選單的小箭頭 */
.no-caret::after {
    display: none !important;
}

/* 黑色選單的細節微調 */
.dropdown-menu-dark {
    background-color: #1a1a1a; /* 純深黑 */
    border: 1px solid #333;
}

.dropdown-menu-dark .dropdown-item {
    padding: 10px 20px;
    font-size: 0.9rem;
}

.dropdown-menu-dark .dropdown-item:hover {
    background-color: #333; /* 懸浮時的深灰色 */
}

/* 讓漢堡按鈕在點擊時不要有藍色外框 */
.btn:focus {
    box-shadow: none;
}

/* ========================================= */
/* 背景照片與流體動畫 (Moved from year.php) */
/* ========================================= */

#background-snapshots {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -10; 
    overflow: hidden;
    pointer-events: none;
}

.snapshot-item {
    position: absolute;
    transition: all 1.5s ease-in-out;
    opacity: 0;
    animation: fadeIn 1s forwards;
}

@keyframes fadeIn {
    to { opacity: 0.6; }
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: scale(0.95); }
    10% { opacity: 1; transform: scale(1); }
    90% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.05); }
}

@keyframes float {
    0% { margin-top: 0px; }
    100% { margin-top: -15px; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 
    前景遮罩 - 稍微模糊背景，讓文字清楚
*/
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.4); 
    backdrop-filter: blur(2px);
    z-index: -5;
    pointer-events: none;
}

/* 讓卡片有點透明，可以透出背景 */
.card, .project-card, .custom-navbar, .category-toolbar, .dropdown-menu {
    background-color: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* 避免 footer 顏色太重 */
.card-footer-links {
    opacity: 0.9;
}
