
    /* 1. Main Container */
    #board-container {
        background-color: var(--bg-main, #ffffff);
        color: var(--text-main, #1a1a1a);
        width: 100%;
        position: relative;
        z-index: 50;
        padding-bottom: 80px;
        transition: background-color 0.3s, color 0.3s;
    }
    body.theme-dark #board-container, 
    body.theme-midnight #board-container {
        background-color: var(--bg-main, #050505) !important;
        color: var(--text-main, #e5e5e5) !important;
    }

/* [수정] 2. Masonry Layout - 아이템 겹침 및 꽉 참 방지 */
.masonry-grid {
    display: block !important;
    width: 100% !important;
    position: relative;
}

.masonry-item {
    /* [핵심] Macy가 계산하기 전에도 6줄/2줄 너비를 대략적으로 유지하게 함 */
    width: 48%; /* 모바일 2줄 기준 (간격 제외) */
    margin-bottom: 16px;
    display: inline-block;
    vertical-align: top;
    break-inside: avoid;
    
    /* [애니메이션] 배치될 때 부드럽게 나타나도록 */
    opacity: 0; 
    transition: opacity 0.3s ease-in;
}

/* PC 너비 강제 (6줄 기준 약 15~16%) */
@media (min-width: 1200px) {
    .masonry-item {
        width: 15.8%; 
    }
}

/* Macy에 의해 위치가 잡히면 투명도 해제 */
.masonry-item {
    opacity: 1;
}

.gallery-img-box img, .forum-card img {
    width: 100% !important;
    height: auto !important;
    display: block;
    /* 이미지 로딩 전 빈 공간 확보 (겹침 방지 보조) */
    min-height: 100px; 
    background-color: rgba(0,0,0,0.05);
}

    /* 3. Cards */
    .store-card {
        background-color: var(--bg-island, #ffffff);
        border-radius: 24px;
        overflow: hidden;
        display: flex; flex-direction: column;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        box-shadow: 0 4px 20px rgba(0,0,0,0.04);
        border: 1px solid rgba(0,0,0,0.02);
    }
    body.theme-dark .store-card, body.theme-midnight .store-card {
        background-color: var(--bg-island, #111111);
        box-shadow: 0 4px 20px rgba(0,0,0,0.3);
        border: 1px solid rgba(255,255,255,0.05);
    }
    .store-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 30px rgba(0,0,0,0.1);
    }



    /* [수정됨] 4. Gallery Card Style (Overlay Design) */
    .gallery-card {
        border-radius: 20px;
        overflow: hidden;
        position: relative;
        /* 패딩을 주어 액자 느낌 */
        padding: 6px; 
        background-color: var(--bg-island);
        box-shadow: 0 4px 15px rgba(0,0,0,0.03);
        transition: transform 0.2s;
    }
    .gallery-img-box {
        position: relative;
        border-radius: 16px;
        overflow: hidden;
    }
    .gallery-card img {
        width: 100%; display: block;
        transition: transform 0.5s ease;
    }
    /* 오버레이 효과 제거, 단순히 이미지만 확대 */
    .gallery-card:hover img { transform: scale(1.05); }

/* [수정됨] 갤러리 내부 정보 오버레이 (왼쪽 하단 캡슐형) */
    .gallery-info-overlay {
        position: absolute;
        bottom: 8px; 
        left: 8px;
        right: auto; /* 오른쪽 고정 해제 -> 너비 100% 방지 */
        
        width: fit-content; /* 내용물만큼만 크기 차지 */
        max-width: 90%; /* 너무 긴 닉네임 방지 */
        
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(4px);
        padding: 5px 10px; /* 작고 슬림하게 */
        border-radius: 99px; /* 완전히 둥근 캡슐 모양 */
        
        display: flex; 
        align-items: center; 
        gap: 8px; /* 아이템 간 간격 */
        
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
        z-index: 10;
        pointer-events: none; /* 클릭은 부모(카드)가 받도록 통과 */
    }


.gallery-img-box, .forum-card img {
    min-height: 150px; /* 대략적인 최소 높이 */
    background-color: rgba(0,0,0,0.05); /* 로딩 전 배경색 */
    transition: min-height 0.3s ease;
}

/* 다크모드 대응 */
body.theme-dark .gallery-img-box, 
body.theme-dark .forum-card img {
    background-color: rgba(255,255,255,0.05);
}

.masonry-item {
    /* 초기 렌더링 시 겹침 방지를 위해 투명도 조절 */
    transition: opacity 0.4s ease-in-out;
}

    /* 다크모드 오버레이 */
    body.theme-dark .gallery-info-overlay, 
    body.theme-midnight .gallery-info-overlay {
        background: rgba(0, 0, 0, 0.6);
        border: 1px solid rgba(255,255,255,0.1);
    }

    .forum-card {
        background-color: var(--bg-island, #ffffff);
        border-radius: 20px;
        overflow: hidden;
        box-shadow: 0 4px 15px rgba(0,0,0,0.03);
        display: flex; 
        flex-direction: column;
        border: 1px solid rgba(0,0,0,0.02);
    }
    body.theme-dark .forum-card, body.theme-midnight .forum-card {
        background-color: var(--bg-island, #111111);
        border-color: rgba(255,255,255,0.05);
        box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    }

    .forum-meta-bar {
        background-color: rgba(0, 0, 0, 0.01);
        padding: 16px;
        margin-top: auto;
        font-size: 0.7rem;
        color: var(--text-dim);
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    body.theme-dark .forum-meta-bar, body.theme-midnight .forum-meta-bar {
        background-color: rgba(255, 255, 255, 0.03);
        border-top-color: rgba(255,255,255,0.03);
    }

    .nav-icon-btn { 
        width: 44px; height: 44px; font-size: 22px; 
        color: var(--text-dim, #888); background: transparent; 
        border-radius: 14px; display: flex; align-items: center; justify-content: center;
        transition: all 0.2s;
    }
    .nav-icon-btn.active { 
        color: var(--text-main, #000); 
        background: var(--bg-island, rgba(0,0,0,0.05)); transform: scale(1.05); 
    }

 /* [수정됨] 5. Category & Search Bar (너비 고정) */
    .cat-nav-container {
        background: var(--bg-island);
        box-shadow: 0 4px 20px rgba(0,0,0,0.04);
        border-radius: 9999px;
        height: 56px; /* 높이 약간 증가 */
        
        display: flex; 
        align-items: center;
        justify-content: center;
        position: relative;
        overflow: hidden;
        transition: all 0.3s ease;
        margin: 0 auto;

        /* [중요] 너비를 고정하여 모드 전환 시 크기 변화 방지 */
        width: 100%; 
        max-width: 620px; 
    }
    
    /* 스크롤 영역 */
    .cat-scroll-area {
        display: flex; align-items: center; gap: 8px;
        padding: 0 16px;
        width: 100%; height: 100%;
        overflow-x: auto;
        white-space: nowrap;
        opacity: 1; transition: opacity 0.2s;
    }
    .cat-nav-container.search-mode .cat-scroll-area { display: none; }

    /* 검색 입력 영역 */
    .search-input-area {
        display: none; width: 100%; height: 100%;
        align-items: center; padding: 0 20px;
    }
    .cat-nav-container.search-mode .search-input-area { display: flex; animation: fadeIn 0.3s ease; }

    /* 아이콘 버튼 */
    .cat-icon-btn {
        width: 42px; height: 42px; font-size: 1.25rem;
        border-radius: 50%; flex-shrink: 0;
        color: var(--text-dim, #6b7280); background: transparent;
        display: flex; align-items: center; justify-content: center;
        transition: all 0.2s;
    }
    .cat-icon-btn:hover { background-color: rgba(127,127,127, 0.1); color: var(--text-main, #111); }
    .cat-icon-btn.active {
        background-color: var(--text-main, #111);
        color: var(--bg-main, #fff);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }


    /* 6. Modal */
    .modal-box { 
        background-color: var(--bg-island, #ffffff); 
        color: var(--text-main, #111); 
        box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    }
    .input-field { 
        background-color: var(--bg-main, #f3f4f6); 
        color: var(--text-main, #111); 
        border: 1px solid transparent; 
    }
    body.theme-dark .input-field, body.theme-midnight .input-field { 
        border-color: rgba(255,255,255,0.05) !important; 
    }
    .cat-opt {
        min-width: 60px; flex-shrink: 0;
        display: flex; flex-direction: column; align-items: center;
        padding: 8px; border-radius: 12px; cursor: pointer; transition: all 0.2s;
    }
    .cat-opt.selected { background: var(--text-main, #111); color: var(--bg-main, #fff); }
    
    .txt-primary { color: var(--text-main, #111); }
    .txt-sub { color: var(--text-dim, #6b7280); }

.custom-scrollbar::-webkit-scrollbar {
    height: 4px; /* 스크롤바 높이 (얇게) */
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent; /* 트랙 배경 투명 */
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2); /* 스크롤바 색상 (연한 회색) */
    border-radius: 10px; /* 둥근 모서리 */
}
/* 다크모드 대응 */
body.theme-dark .custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
}