body { font-family: 'Noto Sans KR', 'Nanum Gothic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', Arial, 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif; margin:0; background: #f8fafc; }
.container { max-width: 1400px; margin: 0 auto; padding: 1rem; overflow-x: hidden; box-sizing: border-box; }

/* 보드 레이아웃 */
.board-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.sidebar {
    flex: 0 0 220px;
    min-width: 0;
    max-width: calc(100vw - 2rem - 40px);
    width: 220px;
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 1rem;
    transition: flex 0.3s ease, padding 0.3s ease, width 0.3s ease;
    overflow-x: hidden;
    overflow-y: visible;
    box-sizing: border-box;
}

.sidebar.collapsed {
    flex: 0 0 60px;
    width: 60px;
    max-width: 60px;
    padding: 1rem 0.75rem;
    box-sizing: border-box;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.sidebar-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 400;
    color: #1e293b;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.sidebar.collapsed .sidebar-title {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: #64748b;
    font-size: 0.875rem;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.sidebar-toggle:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.2s ease;
}

.category-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem 0.75rem 0.5rem;
    color: #64748b;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    font-size: 0.9375rem;
    white-space: nowrap;
}

.category-item:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.category-item.active {
    background: #0f172a;
    color: #fff;
    font-weight: 500;
}

.category-icon {
    flex-shrink: 0;
    font-size: 1rem;
    width: 1.25rem;
    text-align: center;
}

.category-text {
    opacity: 1;
    transition: opacity 0.2s ease;
    overflow: hidden;
}

.sidebar.collapsed .category-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar.collapsed .category-item {
    justify-content: center;
    padding: 0.75rem;
}

.main-content {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.main-content h2 {
    margin: 0;
    color: #1e293b;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* 간소화된 리스트 테이블 스타일 */
.post-list-table {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    overflow-y: visible;
    width: 100%;
    max-width: 100%;
}

.post-table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    min-width: 600px;
}

.post-table thead {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.post-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 400;
    font-size: 0.875rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.post-table th.col-category {
    width: 110px;
}

.post-table th.col-title {
    width: auto;
}

.post-table th.col-date {
    width: 120px;
    text-align: right;
}

.post-row {
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.2s;
}

.post-row:hover {
    background: #f8fafc;
}

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

.post-table td {
    padding: 1rem;
    vertical-align: middle;
}

.col-category {
    width: 110px;
    min-width: 80px;
}

.col-title {
    width: auto;
    min-width: 200px;
}

.col-date {
    width: 120px;
    min-width: 100px;
    text-align: right;
    color: #64748b;
    font-size: 0.875rem;
}

.post-category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #eef2ff;
    color: #6366f1;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.post-status-draft-small {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.post-title-link {
    color: #1e293b;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: color 0.2s;
    display: block;
}

.post-title-link:hover {
    color: #6366f1;
}

.col-date time {
    color: #64748b;
    font-size: 0.875rem;
}

.btn-create-post {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    background: #0f172a;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: background 0.2s, transform 0.2s;
}

.btn-create-post:hover {
    background: #1e293b;
    transform: translateY(-1px);
}

/* 메뉴 관리 링크 */
.category-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 0.75rem 0;
}

.category-manage {
    background: #f8fafc !important;
    border: 1px dashed #cbd5e1;
    white-space: nowrap;
    min-width: 120px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.category-manage:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8;
}

.category-manage.active {
    background: #0f172a !important;
    border-color: #0f172a;
}
.site-header { 
    background: #0f172a; 
    color: #fff; 
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding-bottom: 15px;
}
.site-header .nav { 
    display: flex; 
    align-items: flex-end; 
    justify-content: space-between; 
    position: relative;
    z-index: 2;
    padding-bottom: 1rem;
    min-height: 80px;
}
.site-header a { 
    color: #fff; 
    text-decoration: none; 
    margin-right: 1rem; 
    text-shadow: 
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        0 0 2px #000,
        0 0 4px rgba(0, 0, 0, 0.5);
}
.logo a { 
    font-weight: 400; 
    font-size: 1.25rem;
    text-shadow: 
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        0 0 2px #000,
        0 0 4px rgba(0, 0, 0, 0.5);
}

/* 상단 탭 메뉴 스타일 */
.site-header .container.top-nav {
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    overflow-x: hidden;
    width: 100%;
    max-width: 1400px;
    box-sizing: border-box;
}

.top-nav {
    position: relative;
    z-index: 2;
    padding-top: 0;
    padding-bottom: 0;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.top-nav-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.top-nav-tabs::-webkit-scrollbar {
    height: 4px;
}

.top-nav-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.top-nav-tabs::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.top-nav-tabs::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.top-nav-tab {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 400;
    border: none;
    background: transparent;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    text-shadow: 
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        0 0 2px #000,
        0 0 4px rgba(0, 0, 0, 0.5);
    margin-bottom: -2px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    box-sizing: border-box;
}

.top-nav-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.top-nav-tab.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.25);
    border-bottom-color: #fff;
    font-weight: 500;
    text-shadow: 
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        0 0 3px #000,
        0 0 6px rgba(0, 0, 0, 0.7);
}

/* 모바일에서 탭 메뉴 반응형 */
@media (max-width: 640px) {
    .top-nav-tab {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
}

/* 헤더 배경 타입: 색상만 */
.site-header[data-header-bg-type="color"] {
    background-color: var(--header-bg-color, #0f172a);
    background-image: none;
}

/* 헤더 배경 타입: 이미지만 */
.site-header[data-header-bg-type="image"] {
    background-color: transparent;
}

.site-header[data-header-bg-type="image"][data-header-image-display="original"] {
    background-size: auto;
    background-repeat: no-repeat;
}

.site-header[data-header-bg-type="image"][data-header-image-display="repeat"] {
    background-size: auto 100%;
    background-repeat: repeat;
}

/* 헤더 배경 타입: 색상+이미지 */
.site-header[data-header-bg-type="both"] {
    background-color: var(--header-bg-color, #0f172a);
    background-size: contain, auto;
    background-position: center, center;
    background-repeat: no-repeat, no-repeat;
}

/* 그라데이션 범위 설정 */
.site-header[data-header-bg-type="both"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .site-header[data-header-mobile-fullwidth="true"][data-header-bg-type="image"],
    .site-header[data-header-mobile-fullwidth="true"][data-header-bg-type="both"] {
        background-size: cover;
        background-position: center;
    }
    
    .site-header[data-header-mobile-fullwidth="true"][data-header-bg-type="both"]::before {
        display: none;
    }
}
.post-list { list-style: none; padding-left: 0; }
.post-list li { padding: .5rem 0; border-bottom: 1px solid #eee; }
.post .content img { max-width: 100%; height: auto; }

/* 상세 페이지 스타일 */
.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.post-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-edit {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #0f172a;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}

.btn-delete {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #dc2626;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
    margin-left: 0.5rem;
}

.btn-delete:hover {
    background: #b91c1c;
}

.btn-edit:hover {
    background: #1e293b;
}

.post article,
.main-content .post {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.post h1 {
    margin: 0;
    color: #1e293b;
}

.post .meta {
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.draft-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 400;
    color: #dc2626;
    background: #fee2e2;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* 이미지 게시판 스타일 */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.post-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.post-card-list {
    display: flex;
    align-items: center;
    padding: 1rem;
}

.post-card-list .post-content {
    flex: 1;
    padding: 0;
}

.post-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.post-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f1f5f9;
    position: relative;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.3s;
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 3rem;
}

.post-content {
    padding: 1rem;
}

.post-category-wrapper {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.post-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 400;
    color: #6366f1;
    background: #eef2ff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.post-status-draft {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 400;
    color: #dc2626;
    background: #fee2e2;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.post-title {
    font-size: 1.125rem;
    font-weight: 400;
    color: #1e293b;
    margin: 0.5rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-preview {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0.5rem 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
}

.post-meta time {
    font-size: 0.75rem;
    color: #94a3b8;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #64748b;
}

@media (max-width: 1024px) {
    .container {
        padding: 1rem;
    }
    
    .board-layout {
        gap: 1rem;
    }
    
    .sidebar {
        flex: 0 0 180px;
        width: 180px;
        max-width: calc(100vw - 2rem - 20px);
        padding: 1rem;
        box-sizing: border-box;
    }
    
    .sidebar.collapsed {
        width: 60px;
        max-width: 60px;
    }
    
    .post-table {
        width: 100%;
        max-width: 100%;
        min-width: 500px;
    }
    
    .col-title {
        width: auto;
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0.75rem;
    }
    
    .board-layout {
        flex-direction: column;
        gap: 1rem;
    }
    
    .sidebar {
        flex: none;
        width: 100%;
        max-width: 100%;
        position: static;
        box-sizing: border-box;
    }
    
    .sidebar.collapsed {
        width: 60px;
        max-width: 60px;
        align-self: flex-start;
        box-sizing: border-box;
    }
    
    .sidebar-header {
        flex-direction: row-reverse;
        justify-content: space-between;
    }
    
    .category-nav {
        flex-direction: row;
        flex-wrap: wrap;
        overflow-x: visible;
    }
    
    .sidebar.collapsed .category-nav {
        flex-direction: column;
    }
    
    .category-item {
        flex: 0 1 auto;
        min-width: 0;
        max-width: 100%;
        text-align: center;
        white-space: normal;
        word-break: break-word;
    }
    
    .category-manage {
        min-width: 120px;
        white-space: nowrap;
        flex-shrink: 0;
        box-sizing: border-box;
    }
    
    .category-text {
        white-space: normal;
        word-break: break-word;
    }
    
    .sidebar.collapsed .category-item {
        min-width: auto;
        flex: none;
    }
    
    .post-table {
        width: 100%;
        max-width: 100%;
        min-width: 400px;
    }
    
    .post-table th,
    .post-table td {
        padding: 0.75rem;
    }
    
    .post-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0.5rem;
    }
    
    .board-layout {
        gap: 0.75rem;
    }
    
    .sidebar {
        width: 100%;
        max-width: 100%;
        padding: 0.75rem;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    .sidebar.collapsed {
        width: 60px;
        max-width: 60px;
        box-sizing: border-box;
    }
    
    .category-nav {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .category-item {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: 100px;
        max-width: calc(50% - 0.25rem);
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem 0.5rem 0.5rem;
    }
    
    .category-manage {
        min-width: 120px;
        max-width: 100%;
        white-space: nowrap;
        flex-shrink: 0;
        box-sizing: border-box;
    }
    
    .main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .main-header h2 {
        font-size: 1.25rem;
    }
    
    .post-table {
        width: 100%;
        max-width: 100%;
        min-width: 350px;
        font-size: 0.875rem;
    }
    
    .post-table th,
    .post-table td {
        padding: 0.5rem;
    }
    
    .col-category {
        min-width: 70px;
    }
    
    .col-title {
        min-width: 150px;
    }
    
    .col-date {
        min-width: 80px;
    }
}

@media (max-width: 480px) {
    .post-grid {
        grid-template-columns: 1fr;
    }
    
    .category-nav {
        flex-direction: column;
        flex-wrap: nowrap;
    }
    
    .category-item {
        flex: 1 1 100%;
        max-width: 100%;
        width: 100%;
        min-width: 0;
    }
    
    .category-text {
        white-space: normal;
        overflow: visible;
    }
}

/* 페이징 스타일 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 1rem;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    background: #fff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.pagination-btn:hover:not(.disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.pagination-page {
    padding: 0.5rem 0.75rem;
    background: #fff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    min-width: 2.5rem;
    text-align: center;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.pagination-page:hover:not(.active) {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.pagination-page.active {
    background: #0f172a;
    color: #fff;
    border-color: #0f172a;
    cursor: default;
}

.pagination-ellipsis {
    padding: 0.5rem;
    color: #64748b;
    font-size: 0.875rem;
}

@media (max-width: 640px) {
    .pagination {
        gap: 0.25rem;
    }
    
    .pagination-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .pagination-page {
        padding: 0.5rem;
        min-width: 2rem;
        font-size: 0.8125rem;
    }
}
