* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* 상단 바 */
.top-bar {
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar h1 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

.burger-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 101;
}

.burger-btn span {
    width: 24px;
    height: 2px;
    background: #262626;
    transition: all 0.3s;
    border-radius: 2px;
}

.burger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.burger-btn.active span:nth-child(2) {
    opacity: 0;
}

.burger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.top-bar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #595959;
    text-decoration: none;
    transition: all 0.2s;
}

.nav-link:hover {
    background: #f5f5f5;
    color: #1890ff;
}

.nav-link:active {
    background: #e6f7ff;
}

.btn-logout {
    margin-left: 8px;
    background: #ffffff;
    border: 1px solid #d9d9d9;
    color: #595959;
}

.btn-logout:hover {
    background: #fff1f0;
    border-color: #ffccc7;
    color: #ff4d4f;
}

/* 메인 패널 */
.main-panel {
    max-width: 1400px;
    margin: 32px auto;
    padding: 0 32px;
}

.panel-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* 갤러리 탭 선택 */
.gallery-selector {
    margin-bottom: 20px;
}

.gallery-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.gallery-tab {
    padding: 10px 20px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background: #ffffff;
    font-size: 14px;
    font-weight: 500;
    color: #595959;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.gallery-tab:hover {
    border-color: #1890ff;
    color: #1890ff;
    background: #e6f7ff;
}

.gallery-tab.active {
    background: #1890ff;
    color: #ffffff;
    border-color: #1890ff;
}

.gallery-tab .tab-count {
    font-size: 12px;
    background: rgba(0,0,0,0.08);
    padding: 2px 8px;
    border-radius: 10px;
}

.gallery-tab.active .tab-count {
    background: rgba(255,255,255,0.25);
}

.gallery-tab .tab-rank {
    font-size: 11px;
    color: #999;
}

.gallery-tab.active .tab-rank {
    color: rgba(255,255,255,0.7);
}

/* 검색 바 영역 */
.search-section {
    padding: 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.result-count {
    font-size: 13px;
    color: #595959;
    font-weight: 500;
    white-space: nowrap;
}

.limit-select {
    padding: 8px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 13px;
    color: #595959;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.limit-select:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

/* 버튼 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: #1890ff;
    color: white;
}

.btn-primary:hover {
    background: #0077ea;
}

.btn-icon {
    padding: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    color: #595959;
}

.btn-icon:hover {
    background: #f5f5f5;
    color: #1890ff;
}

.btn-icon.delete:hover {
    background: #fff1f0;
    color: #ff4d4f;
}

.btn-default {
    background: #ffffff;
    color: #595959;
    border: 1px solid #d9d9d9;
}

.btn-default:hover {
    background: #fafafa;
    border-color: #1890ff;
    color: #1890ff;
}

/* 게시글 목록 */
.post-list {
    list-style: none;
}

.post-item {
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s;
}

.post-item:last-child {
    border-bottom: none;
}

.post-item-link {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
}

.post-item-link:hover {
    background: #fafafa;
}

.post-item-num {
    font-size: 13px;
    color: #999;
    font-weight: 500;
    min-width: 48px;
    text-align: center;
}

.post-item-title {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: #262626;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* 아이콘 */
.icon {
    width: 18px;
    height: 18px;
}

/* 로딩 */
.loading {
    padding: 40px;
    text-align: center;
    color: #595959;
}

/* 빈 상태 */
.empty-state {
    padding: 60px 24px;
    text-align: center;
    color: #595959;
}

/* 모달 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.modal-body {
    padding: 24px;
}

.access-denied-msg {
    font-size: 15px;
    color: #595959;
    text-align: center;
    line-height: 1.6;
}

/* 패널 하단 */
.panel-footer {
    padding: 24px;
    display: flex;
    justify-content: center;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
}

.btn-add {
    padding: 12px 32px;
    font-size: 15px;
}

/* 페이지네이션 */
.pagination {
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.pagination-numbers {
    display: flex;
    gap: 4px;
    align-items: center;
}

.pagination-btn {
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: #595959;
    min-width: 40px;
}

.pagination-btn:hover:not(:disabled) {
    border-color: #1890ff;
    color: #1890ff;
}

.pagination-btn:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.pagination-btn.active {
    background: #1890ff;
    color: white;
    border-color: #1890ff;
}

.pagination-ellipsis {
    padding: 8px 4px;
    color: #595959;
    font-size: 14px;
}

/* 토스트 */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.3s;
    max-width: 360px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-info { background: #1890ff; }
.toast-success { background: #52c41a; }
.toast-error { background: #ff4d4f; }

/* ── 반응형 ── */

@media (max-width: 1024px) {
    .top-bar { padding: 0 24px; }
    .top-bar-nav { gap: 6px; }
    .nav-link { padding: 8px 12px; font-size: 13px; }
    .main-panel { padding: 0 24px; margin: 24px auto; }
    .gallery-tab { padding: 9px 16px; font-size: 13px; }
}

@media (max-width: 768px) {
    .top-bar {
        height: 64px;
        padding: 0 20px;
        position: relative;
    }

    .burger-btn {
        display: flex;
    }

    .top-bar-nav {
        position: fixed;
        top: 64px;
        right: -100%;
        width: 280px;
        height: calc(100vh - 64px);
        background: #ffffff;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 20px;
        box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        overflow-y: auto;
    }

    .top-bar-nav.active {
        right: 0;
    }

    .nav-link {
        width: 100%;
        text-align: left;
        padding: 14px 16px;
        font-size: 15px;
        border-radius: 8px;
        margin-bottom: 8px;
    }

    .btn-logout {
        width: 100%;
        margin-left: 0;
        margin-top: 12px;
        justify-content: center;
        padding: 14px 16px;
    }

    .main-panel {
        padding: 0 16px;
        margin: 20px auto;
    }

    .gallery-tabs {
        gap: 8px;
    }

    .gallery-tab {
        padding: 8px 14px;
        font-size: 13px;
    }

    .search-section {
        padding: 20px;
        gap: 12px;
    }

    .post-item-link {
        padding: 16px;
        gap: 12px;
    }

    .post-item-num {
        min-width: 36px;
        font-size: 12px;
    }

    .post-item-title {
        font-size: 14px;
    }

    .pagination {
        padding: 20px;
    }
}

@media (max-width: 640px) {
    .top-bar {
        padding: 0 16px;
    }

    .top-bar h1 {
        font-size: 16px;
    }

    .top-bar-nav {
        width: 260px;
    }

    .main-panel {
        margin: 16px auto;
    }

    .search-section {
        padding: 16px;
        flex-direction: column;
    }

    .search-input {
        width: 100%;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .gallery-tabs {
        flex-direction: column;
    }

    .gallery-tab {
        width: 100%;
        justify-content: space-between;
    }

    .post-item-link {
        padding: 14px;
    }

    .pagination {
        padding: 16px;
    }

    .pagination-btn {
        min-width: 38px;
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .top-bar h1 {
        font-size: 15px;
    }

    .post-item-num {
        display: none;
    }

    .post-item-title {
        font-size: 13px;
    }

    .pagination-btn {
        font-size: 13px;
        min-width: 34px;
        padding: 6px 8px;
    }

    .modal-content {
        width: 95%;
    }

    .toast { max-width: calc(100vw - 48px); }
}
