/* ==========================================================================
   Dev Blog - Modern Tech Blog Design
   ========================================================================== */

/* 기본 변수 설정 */
:root {
    /* 색상 팔레트 (칙칙함 개선 및 전문성 유지) */
    --primary-color: #5A67D8;
    --primary-hover: #4C51BF;
    
    /* 새로운 Primary 색상 (고급스러운 느낌) */
    --primary-color-new: #4A55A2;
    --primary-hover-new: #3B4483;

    --secondary-color: #A0AEC0;
    --accent-color: #E53E3E; 
    --success-color: #38A169;
    --warning-color: #D69E2E;
    --error-color: var(--accent-color);
    
    /* RGB 값 */
    --primary-rgb: 90, 103, 216;
    --primary-rgb-new: 74, 85, 162;
    --accent-rgb: 229, 62, 62;
    --bg-secondary-rgb: 45, 55, 72;
    --border-light-rgb: 107, 114, 128;

    /* 배경색 */
    --bg-primary: #1F2937;  
    --bg-secondary: #2D3748;
    --bg-tertiary: #4A5568;  
    --bg-card: #2D3748;
    --bg-modal: rgba(31, 41, 55, 0.9);
    --bg-hover: #4A5568;
    
    /* 텍스트 색상 */
    --text-primary: #F3F4F6;  
    --text-secondary: #D1D5DB;
    --text-tertiary: #9CA3AF; 
    --text-accent: var(--primary-color); 
    
    /* 경계선 */
    --border-color: #4B5563;
    --border-light: #6B7280;  
    
    /* 그림자 (이전보다 미세하게 조정) */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.07), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    --shadow-inner: inset 0 2px 4px 0 rgba(0,0,0,0.03);

    /* 폰트 (기존 유지) */
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Cascadia Code', monospace;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    
    /* 크기 (기존 유지) */
    --header-height: 60px;
    --sidebar-width: 250px;
    --container-max: 1280px;
    
    /* 애니메이션 (기존 유지) */
    --transition-duration: 0.25s;
    --transition-timing-function: ease-in-out;
    --transition-fast: 0.15s var(--transition-timing-function);
    --transition-normal: var(--transition-duration) var(--transition-timing-function);
    --transition-slow: 0.5s var(--transition-timing-function);
}

/* 기본 스타일 초기화 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.65;
    overflow-x: hidden;
    font-size: 15px;
}

/* 커스텀 스크롤바 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* ==========================================================================
   레이아웃 구조
   ========================================================================== */

.blog-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* 헤더 */
.blog-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(var(--bg-secondary-rgb, 45, 55, 72), 0.8);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    box-shadow: var(--shadow-md);
}

.blog-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-duration) var(--transition-timing-function);
}

.blog-logo:hover {
    color: var(--primary-color);
}

.blog-logo i {
    font-size: 1.3rem;
    color: var(--primary-color);
}

/* 네비게이션 */
.blog-nav {
    display: flex;
    align-items: center;
    margin-left: auto;
    gap: 1rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: background var(--transition-duration) var(--transition-timing-function), color var(--transition-duration) var(--transition-timing-function);
    font-weight: 500;
    font-size: 0.875rem;
}

.nav-item a:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* 인증 상태 */
.auth-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border-color);
}

.auth-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-right: 0.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.55rem 1rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-duration) var(--transition-timing-function);
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: var(--primary-color-new);
    color: white;
    border-color: var(--primary-color-new);
}

.btn-primary:hover {
    background: var(--primary-hover-new);
    border-color: var(--primary-hover-new);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--primary-color-new);
    color: white;
    border-color: var(--primary-color-new);
}

/* 사이드바 */
.blog-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 1.5rem 0;
    position: fixed;
    top: var(--header-height);
    left: 0;
    height: calc(100vh - var(--header-height));
    z-index: 999;
    box-shadow: var(--shadow-lg);
    transform: translateX(0);
    transition: transform 0.3s ease-in-out;
}

/* 사이드바 섹션 */
.sidebar-section {
    padding: 0 1.25rem;
    margin-bottom: 1.5rem;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-title {
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-title i {
    font-size: 0.75rem;
    color: var(--text-accent);
}

/* 새로 추가된 사이드바 포트폴리오 버튼 스타일 */
.sidebar-portfolio-btn {
    width: 100%;
    justify-content: center;
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    box-shadow: var(--shadow-md);
}

.sidebar-portfolio-btn i {
    font-size: 1rem; /* 아이콘 크기 조정 */
}

/* 프로필 섹션 */
.blog-profile {
    text-align: center;
    padding: 2rem 1.5rem;
    background: linear-gradient(145deg, var(--primary-color), var(--accent-color));
    border-radius: 0;
    margin-bottom: 2rem;
    color: white;
}

.profile-avatar {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.25);
}

.profile-avatar i {
    font-size: 1.5rem;
}

.profile-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
}

.profile-description {
    font-size: 0.8rem;
    line-height: 1.5;
    opacity: 0.9;
}

/* 통계 스타일 개선 */
.blog-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all var(--transition-duration);
}

.stat-item:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.stat-icon {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon i {
    color: white;
    font-size: 0.9rem;
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-number {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 카테고리 스타일 개선 */
.categories-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0.9rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-duration);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.category-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.category-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.category-item i {
    margin-right: 0.5rem;
    font-size: 0.75rem;
}

.post-count {
    background: rgba(255, 255, 255, 0.1);
    color: inherit;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.category-item:not(.active) .post-count {
    background: var(--bg-secondary);
    color: var(--text-tertiary);
}

/* 관리 도구 스타일 개선 */
.admin-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-actions .btn {
    width: 100%;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0.8rem;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.85rem;
}

.admin-actions .btn i {
    font-size: 0.875rem;
}

/* 메인 콘텐츠 영역 */
.blog-main {
    margin-left: var(--sidebar-width);
    padding: calc(var(--header-height) + 1.5rem) 0 1.5rem 0;
    min-height: 100vh;
    background: var(--bg-primary);
    width: calc(100% - var(--sidebar-width));
    box-sizing: border-box;
    transition: margin-left var(--transition-duration) var(--transition-timing-function);
}

.main-content {
    max-width: none;
    margin: 0;
    padding: 0 2rem;
}

/* 콘텐츠 툴바 */
.content-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 1.25rem 0;
    background: transparent;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.content-toolbar::before {
    content: none;
}

.toolbar-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

@supports not (background-clip: text) {
    .toolbar-title {
        background: none;
        -webkit-text-fill-color: var(--text-primary);
        color: var(--text-primary);
    }
}

.toolbar-actions {
    display: flex;
    gap: 1rem;
}

.toolbar-actions .btn {
    padding: 0.875rem 1.25rem;
    border-radius: 12px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
}

/* 게시글 그리드 */
.posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

/* 게시글 카드 */
.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all var(--transition-duration) var(--transition-timing-function), border-color var(--transition-duration) var(--transition-timing-function);
    position: relative;
    overflow: visible;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    transform: scaleY(0);
    transform-origin: center;
    transition: transform var(--transition-duration) cubic-bezier(0.23, 1, 0.32, 1);
    opacity: 0;
    border-radius: 4px 0 0 4px;
}

.post-card:hover::before {
    transform: scaleY(1);
    opacity: 1;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

.post-title {
    font-size: 1.1rem;
    line-height: 1.45;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    order: 2;
}

.post-status {
    position: absolute;
    top: -0.5rem;
    right: 1rem;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    z-index: 1;
    order: 1;
    box-shadow: var(--shadow-sm);
    border: 1px solid transparent;
}

.post-status.published {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-hover);
}

.post-status.draft {
    background: var(--warning-color);
    color: white;
    border-color: var(--warning-color);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.8rem;
    order: 4;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(var(--border-light-rgb), 0.3);
}

.post-meta span {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
}

.post-meta i {
    font-size: 0.6rem;
    color: var(--text-tertiary);
    margin-right: 0.25rem;
}

.post-excerpt {
    line-height: 1.55;
    font-size: 0.8rem;
    -webkit-line-clamp: 2;
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    order: 3;
}

/* 빈 상태 */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin: 0;
    min-height: calc(100vh - var(--header-height) - 10rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-inner);
}

.empty-state i {
    font-size: 4.5rem;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 1.6rem;
}

.empty-state p {
    font-size: 1rem;
}

/* 페이지네이션 */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 3rem;
    padding: 2rem;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-duration);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

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

.page-info {
    padding: 0.7rem 1.2rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 500;
}

/* ==========================================================================
   모달
   ========================================================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-modal);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn var(--transition-normal);
}

.modal.show {
    display: flex !important;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    max-width: 700px; /* 기본 모달 너비 (글쓰기, 카테고리 관리 등) */
    width: 90vw; /* 화면 너비의 90%를 넘지 않도록 */
    max-height: 90vh;
    overflow: hidden;
    animation: slideUp var(--transition-normal);
    position: relative;
    margin: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 140px); 
}

#post-detail-modal .modal-body {
    padding: 2rem 2.5rem;
}

/* 폼 스타일 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.65rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

.form-textarea {
    resize: vertical;
    min-height: 150px;
    font-family: var(--font-mono);
    line-height: 1.6;
}

.form-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

/* ==========================================================================
   로딩 및 애니메이션
   ========================================================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.loading-content {
    text-align: center;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-tertiary);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   반응형 디자인 - 아기자기 & 포트폴리오 스타일
   ========================================================================== */

/* 기본 (Desktop First) 스타일은 이미 위에서 정의됨 */

/* 태블릿 (가로) 및 작은 노트북 (예: iPad Pro Landscape, ~1024px) */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 220px; /* 사이드바 너비 살짝 줄임 */
    }

    .blog-main {
        margin-left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
    }

    .main-content {
        padding: 0 1.5rem; /* 메인 콘텐츠 좌우 패딩 조정 */
    }

    #post-detail-modal .modal-content {
        max-width: 90vw; /* 상세 모달 너비 조정 */
    }
    .post-content { font-size: 0.95rem; } /* 상세 모달 본문 폰트 살짝 줄임 */
    .post-content h1 { font-size: 1.8rem; }
    .post-content h2 { font-size: 1.5rem; }
    .post-content h3 { font-size: 1.2rem; }
}

/* 태블릿 (세로) 및 큰 모바일 (예: iPad Mini/Air Portrait, ~768px) */
@media (max-width: 768px) {
    :root {
        --header-height: 55px;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .blog-header {
        padding: 0 1rem;
        justify-content: flex-start; /* 모바일에서는 왼쪽부터 정렬 */
    }

    #hamburger-btn {
        display: block !important;
        font-size: 1.5rem;
        color: var(--text-primary);
        background: none;
        border: none;
        cursor: pointer;
        order: 1; /* 가장 왼쪽 */
        margin-right: 1rem; /* 다음 요소와의 간격 */
        z-index: 9999 !important;
    }
    
    /* .portfolio-link-header 는 .blog-nav 안에 있으므로 .blog-nav 순서 조정 */

    .blog-logo {
        font-size: 1rem; 
        order: 3;
        margin-left: 0;
    }
    .blog-logo i { font-size: 1.2rem; }

    .blog-nav {
        display: contents;
    }
    
    .portfolio-link-header {
        display: flex !important; /* 보이도록 !important 추가 */
        order: 2; /* 햄버거 다음 */
        margin-right: 1rem; /* 로고와의 간격 */
    }

    .auth-status {
        order: 4; /* 로고 다음, 가장 오른쪽으로 */
        margin-left: auto; /* 오른쪽 끝으로 밀기 */
        padding-left: 0.5rem; 
        border-left: none; 
    }

    .nav-menu { 
        display: none !important; 
    } 

    #post-detail-modal .modal-content {
        width: 95vw;
        max-height: 90vh;
    }
    #post-detail-modal .modal-body { padding: 1.5rem; }
    .post-content { font-size: 0.9rem; }
    .post-content h1 { font-size: 1.6rem; }
    .post-content h2 { font-size: 1.3rem; }
    .post-content h3 { font-size: 1.1rem; }

    .blog-sidebar {
        position: fixed;
        left: 0;
        top: 0; /* 헤더 높이만큼 내리지 않고 화면 맨 위부터 시작 */
        height: 100%;
        width: 280px; /* 사이드바 너비 */
        transform: translateX(-100%); /* 기본적으로 화면 왼쪽에 숨김 */
        transition: transform 0.3s ease-in-out;
        z-index: 2000; /* 오버레이보다는 위, 헤더의 일부 요소보다는 낮을 수 있음. 헤더와 겹치지 않도록 padding-top 조절 */
        padding-top: var(--header-height); /* 헤더 높이만큼 내부 패딩으로 공간 확보 */
        box-shadow: var(--shadow-xl);
        background-color: var(--bg-secondary); 
    }
    .blog-sidebar.open {
        transform: translateX(0); /* .open 클래스가 있으면 나타남 */
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
        z-index: 1999; /* 사이드바 바로 아래 */
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .blog-main {
        margin-left: 0; /* 사이드바가 닫혀있을 때 메인 콘텐츠가 화면 전체 사용 */
        width: 100%;
        padding-top: calc(var(--header-height) + 1rem);
    }
}

/* 모바일 (예: 일반 스마트폰, ~600px) */
@media (max-width: 600px) {
    .profile-name { font-size: 1.1rem; }
    .profile-description { font-size: 0.75rem; }

    .stat-item { flex-direction: column; text-align: center; gap: 0.5rem; }
    .stat-icon { margin: 0 auto; }
    .stat-number { font-size: 1.2rem; }

    .post-title { font-size: 0.95rem; }
    .post-excerpt { font-size: 0.75rem; }
    .post-meta span { font-size: 0.6rem; }

    .pagination-btn, .page-info { padding: 0.6rem 1rem; font-size: 0.8rem; }

    .modal-header h2 { font-size: 1rem; }
    .form-group { margin-bottom: 1rem; }

    #post-detail-modal .post-meta { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}

/* 매우 작은 모바일 화면 (선택적) */
@media (max-width: 380px) {
    body { font-size: 13px; }
    .blog-logo span { display: none; }
    .post-card { padding: 0.75rem; }
}

/* 카테고리 관리 */
.category-management-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: var(--transition-fast);
}

.category-management-item:hover {
    background: var(--border-light);
}

.category-management-item span {
    color: var(--text-primary);
    font-weight: 500;
}

.btn-danger {
    background: var(--error-color);
    color: white;
    border: 1px solid var(--error-color);
}

.btn-danger:hover {
    background: #C53030;
    border-color: #C53030;
    transform: translateY(-1px);
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* 게시글 상세 콘텐츠 */
.post-content {
    color: var(--text-secondary);
    line-height: 1.75;
    font-size: 1rem;
}

.post-content h1, .post-content h2, .post-content h3,
.post-content h4, .post-content h5, .post-content h6 {
    color: var(--text-primary); 
    margin: 2.5rem 0 1.25rem 0;
    font-weight: 700;
    line-height: 1.45;
}

.post-content h1 { font-size: 2rem; }
.post-content h2 { font-size: 1.6rem; }
.post-content h3 { font-size: 1.3rem; }
.post-content h4 { font-size: 1.1rem; }

.post-content p {
    margin: 1.25rem 0;
    color: var(--text-secondary);
}

.post-content ul, .post-content ol {
    padding-left: 2.2rem;
    margin: 1.25rem 0;
}

.post-content li {
    margin: 0.6rem 0;
    color: var(--text-secondary);
}

.post-content li::marker {
    color: var(--text-tertiary);
}

.post-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.post-content em {
    color: var(--text-primary);
    font-style: italic;
}

.post-content a {
    color: var(--accent-color);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    font-weight: 500;
    transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

.post-content a:hover {
    color: rgba(var(--accent-rgb), 0.8);
    text-decoration-color: rgba(var(--accent-rgb), 0.5);
}

.post-content pre {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    overflow-x: auto;
    margin: 2rem 0;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
}

.post-content pre code {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
    display: block;
    text-shadow: none !important;
}

/* PrismJS 토큰(span)에 적용될 수 있는 모든 테두리 제거 */
.post-content pre code span.token {
    border: none !important;
    background-image: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.post-content code {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
}

.post-content blockquote {
    border-left: 5px solid var(--primary-color);
    padding: 1.25rem 1.75rem;
    margin: 2rem 0;
    color: var(--text-secondary);
    font-style: italic;
    background: rgba(var(--bg-secondary-rgb), 0.4);
    border-radius: 0 8px 8px 0;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 2rem auto;
    display: block;
    box-shadow: var(--shadow-lg);
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: transparent;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.post-content th,
.post-content td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}
.post-content th:last-child,
.post-content td:last-child {
    border-right: none;
}

.post-content th {
    background: rgba(var(--bg-secondary-rgb), 0.7);
    color: var(--text-primary);
    font-weight: 600;
}

/* 모달 내 메타 정보 (제목 위) */
#post-detail-modal .post-meta {
    font-size: 0.8rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(var(--border-light-rgb), 0.3);
    gap: 0.75rem 1.25rem;
}

#post-detail-modal .post-meta span {
    color: var(--text-tertiary);
}

#post-detail-modal .post-meta i {
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.posts-grid.no-posts {
    margin-top: 0;
    margin-bottom: 0;
}

.content-toolbar.hidden-by-empty-state {
    display: none !important; /* JavaScript에서 직접 제어하므로 important 사용 가능 */
}

/* 카테고리 이름 부분에 대한 스타일 추가 */
.category-item-name {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 0.5rem;
}

/* 게시글 상세 모달 특별 스타일 */
#post-detail-modal .modal-content {
    max-width: 95vw;
    width: 95vw;
    height: 90vh; 
    max-height: 90vh;
    border-radius: 10px; 
    margin: auto;
    position: relative;
    transform: translateY(0);
}

#post-detail-modal {
    display: flex;
    align-items: center;
    justify-content: center;
}

#post-detail-modal.show {
    display: flex !important;
}

#post-detail-modal .modal-body {
    padding: 2rem 2.5rem;
    max-height: calc(90vh - 120px);
    -webkit-overflow-scrolling: touch; 
}

/* 햄버거 메뉴 기본 스타일 */
#hamburger-btn {
    display: none; 
    font-size: 1.5rem;
    color: var(--text-primary);
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1600;
}

/* 메인 환영 섹션 스타일 */
.main-welcome-section {
    padding: 5rem 2rem;
    text-align: center;
    background: 
        linear-gradient(135deg, rgba(var(--primary-rgb), 0.15) 0%, rgba(var(--accent-rgb), 0.05) 70%, rgba(var(--bg-secondary-rgb), 0.1) 100%),
        var(--bg-primary);
    border-radius: 20px;
    margin-bottom: 3rem; 
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

/* 반짝이는 별 효과 (선택적 추가) */
.main-welcome-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        radial-gradient(circle at 15% 25%, rgba(255,255,255,0.07) 0%, transparent 20%),
        radial-gradient(circle at 80% 10%, rgba(255,255,255,0.05) 0%, transparent 15%),
        radial-gradient(circle at 50% 70%, rgba(255,255,255,0.04) 0%, transparent 10%);
    animation: subtleShine 15s infinite alternate ease-in-out;
    z-index: 0;
}

@keyframes subtleShine {
    0% { opacity: 0.5; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.05); }
}

.main-welcome-section > * {
    position: relative;
    z-index: 1;
}

.main-welcome-section h2 {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.2rem;
    line-height: 1.3;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.main-welcome-section p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.welcome-actions .btn {
    padding: 0.9rem 2rem;
    font-size: 1.05rem;
    border-radius: 10px;
    box-shadow: var(--shadow-md);
}

/* 소셜 링크 카드 섹션 */
.social-cards-container {
    margin-top: 4rem;
    padding-top: 2.5rem;
    border-top: 1px solid rgba(var(--border-light-rgb), 0.3);
}

.social-cards-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2.5rem;
    text-align: center;
}

.social-card-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.social-card {
    background-color: rgba(var(--bg-secondary-rgb), 0.7);
    backdrop-filter: blur(5px); 
    border-radius: 16px; 
    padding: 2rem 1.5rem;
    width: calc(33.333% - 1rem); 
    min-width: 220px; 
    text-decoration: none;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal), background-color var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.social-card:hover {
    transform: translateY(-8px) scale(1.03); /* 호버 효과 강화 */
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
    color: var(--text-primary);
    background-color: rgba(var(--primary-rgb), 0.15);
}

.social-card i {
    font-size: 2.5rem; /* 아이콘 크기 증가 */
    margin-bottom: 1.2rem;
    color: var(--primary-color); 
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.social-card:hover i {
    color: var(--accent-color); 
    transform: scale(1.1);
}

.social-card span {
    font-size: 1.15rem; /* 크기 증가 */
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
}

.social-card p {
    font-size: 0.85rem; /* 크기 약간 증가 */
    line-height: 1.55;
    color: var(--text-tertiary);
    margin-bottom: 0; 
}

/* 소셜 카드 반응형 */
@media (max-width: 992px) { 
    .social-card {
        width: calc(50% - 0.75rem);
    }
}

@media (max-width: 600px) {
    .social-card {
        width: 100%;
    }
    .social-cards-title {
        font-size: 1.4rem;
    }
    .social-card i {
        font-size: 2rem;
    }
    .social-card span {
        font-size: 1rem;
    }
}

/* 카테고리 새 게시글 버튼 스타일 */
.category-new-post-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-duration);
    opacity: 0;
    font-size: 0.7rem;
    z-index: 2;
}

.category-new-post-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-50%) scale(1.1);
}

.category-item {
    position: relative;
}

.empty-state-btn {
    margin-top: 1.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-duration);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.empty-state-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.empty-state-btn i {
    font-size: 0.8rem;
} 