@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.8/dist/web/static/pretendard.css');
@import url('https://cdn.rawgit.com/moonspam/NanumSquare/master/nanumsquare.css');
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@200;300;400;500;600;700;900&display=swap');

@font-face {
    font-family: 'KerisKeduLine';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2601-3@1.0/KERISKEDU_Line.woff2') format('woff2');
    font-weight: normal;
    font-display: swap;
}

/* --- Postype Layout & Design System (Merged) --- */

/* Global Variables */
:root {
    --pt-bg-color: #ffffff;
    --pt-border-color: #e6e6e6;
    /* Lighter, subtle border */
    --pt-text-primary: #121212;
    --pt-text-secondary: #7d7d7d;
    --pt-text-tertiary: #b2b2b2;
    --pt-accent-color: #000000;
    --pt-bg-hover: #f7f7f7;
}

/* Header Specifics */
.header-inner.postype-header {
    max-width: 1400px !important;
    margin: 0 auto !important;
    /* Wider header */
    height: 72px !important;
    padding: 0 40px !important;
    display: grid !important;
    grid-template-columns: 240px 1fr auto !important;
    /* Fixed Logo, Flex Search, Auto-width Controls */
    align-items: center !important;
    gap: 24px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.nav-left {
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    min-width: 0 !important;
}

.logo-icon {
    width: 40px !important;
    height: 40px !important;
    object-fit: contain !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
}

.nav-center {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
}

.search-bar-rounded {
    width: 100%;
    max-width: 480px;
    height: 48px;
    background-color: #f7f7f7;
    border: 1px solid transparent;
    border-radius: 24px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.search-bar-rounded:focus-within {
    background-color: #ffffff;
    border-color: #000000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    height: 100%;
    font-size: 16px;
    color: var(--pt-text-primary);
    outline: none;
}

.search-icon,
.nav-center svg {
    color: var(--pt-text-secondary);
    font-size: 18px;
}

/* Postype Layout Grid */
.postype-container {
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 32px 40px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 60px !important;
    /* Spacious gap */
    flex: 1 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.pt-sidebar-left {
    width: 240px !important;
    min-width: 240px !important;
    flex-shrink: 0 !important;
    position: sticky !important;
    top: 100px !important;
    height: fit-content !important;
    box-sizing: border-box !important;
    display: block !important;
}

.pt-main-feed {
    flex: 1 !important;
    max-width: 720px !important;
    min-width: 0 !important;
    /* Prevent flex overflow */
    box-sizing: border-box !important;
    width: 100% !important;
    display: block !important;
}

.pt-sidebar-right {
    width: 280px !important;
    min-width: 280px !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    display: block !important;
}

/* Navigation Links */
.pt-nav-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pt-nav-item {
    display: flex;
    align-items: center;
    height: 48px;
    padding: 0 16px;
    border-radius: 8px;
    color: var(--pt-text-primary);
    text-decoration: none;
    font-size: 18px;
    /* Slightly larger text */
    font-weight: 600;
    transition: background 0.2s;
}

.pt-nav-item:hover,
.pt-nav-item.active {
    background-color: var(--pt-bg-hover);
}

.pt-nav-item i,
.pt-nav-item svg {
    width: 28px;
    margin-right: 12px;
    font-size: 20px;
}

.pt-footer-links {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--pt-border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.pt-footer-link {
    font-size: 12px;
    color: var(--pt-text-tertiary);
    text-decoration: none;
}

/* Card Style - Postype Feed */
.pt-feed-card {
    display: flex;
    flex-direction: column;
    margin-bottom: 64px;
    /* Generous spacing between posts */
    border-bottom: 1px solid var(--pt-border-color);
    padding-bottom: 32px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease;
}

.pt-feed-card:last-child {
    border-bottom: none;
}

.pt-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.pt-author-link-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    cursor: pointer;
}

.pt-author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.pt-author-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.pt-author-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--pt-text-primary);
    line-height: 1.4;
    display: inline-block;
}

.pt-post-date {
    font-size: 13px;
    color: var(--pt-text-tertiary);
    margin-left: 8px;
}

.pt-post-date::before {
    content: '·';
    margin-right: 8px;
}

.pt-card-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pt-card-content {
    order: 2;
    /* Image first? No, Title first usually */
}

/* Modify order if image exists */
.pt-card-has-image .pt-card-image-wrapper {
    width: 100%;
    height: 360px;
    /* Large image */
    border-radius: 4px;
    overflow: hidden;
    background-color: #f0f0f0;
    order: 1;
    /* Image first on Postype? */
    /* Checking screenshot... Postype cards are usually Title/Text then Image or Image Main.
       Based on analysis: Author -> Title -> Tags -> Snippet -> Image -> Interaction.
    */
    order: 3;
    margin-top: 16px;
}

.pt-card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pt-card-title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--pt-text-primary);
    margin-bottom: 8px;
    order: 1;
}

.pt-card-snippet {
    font-size: 16px;
    line-height: 1.6;
    color: var(--pt-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    order: 2;
}

.pt-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    order: 2;
}

.pt-tag {
    font-size: 12px;
    color: var(--pt-text-secondary);
    background-color: #f2f2f2;
    padding: 4px 10px;
    border-radius: 12px;
}

.pt-card-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    order: 4;
}

.pt-interaction-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--pt-text-tertiary);
}

.pt-interaction-item i,
.pt-interaction-item svg {
    font-size: 16px;
}

/* Right Sidebar Widgets */
.pt-widget {
    margin-bottom: 40px;
}

.pt-widget-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--pt-text-secondary);
    margin-bottom: 16px;
}

.pt-promo-card {
    display: block;
    margin-bottom: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    text-decoration: none;
    transition: background 0.2s;
}

.pt-promo-card:hover {
    background: #f0f0f0;
}

/* Buttons (Overrides) */
.btn-postype-black {
    background-color: #000000;
    color: #ffffff;
    font-weight: 600;
    border-radius: 20px;
    padding: 8px 18px;
}

.btn-postype-black:hover {
    background-color: #333333;
}

.btn-postype-outline {
    background-color: transparent;
    border: 1px solid #e0e0e0;
    color: #121212;
    font-weight: 500;
    border-radius: 20px;
    padding: 8px 18px;
}

.btn-postype-outline:hover {
    border-color: #000000;
}

/* Responsive */
@media (max-width: 1200px) {
    .header-inner.postype-header {
        grid-template-columns: auto 1fr auto !important;
        padding: 0 24px !important;
        gap: 16px !important;
        max-width: 100% !important;
    }

    .postype-container {
        padding: 24px !important;
        gap: 32px !important;
    }

    .pt-sidebar-right {
        display: none !important;
        /* Hide right sidebar on smaller desktop */
    }
}

@media (max-width: 900px) {
    .pt-sidebar-left {
        display: none !important;
        /* Hide left sidebar on tablet/mobile */
        /* Normally we'd turn it into a hamburger menu */
    }

    .header-inner.postype-header {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0 16px !important;
        gap: 12px !important;
    }

    .nav-left {
        flex-shrink: 0 !important;
    }

    .nav-center .search-bar-rounded {
        display: none !important;
        /* Hide complex search on mobile or minimalize */
    }

    .pt-main-feed {
        max-width: 100% !important;
    }
}

@font-face {
    font-family: 'Ridibatang';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_twelve@1.0/RIDIBatang.woff') format('woff');
    font-weight: normal;
    font-display: swap;
}

@font-face {
    font-family: 'JoseonGulim';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_20-04@1.0/ChosunGu.woff') format('woff');
    font-weight: normal;
    font-display: swap;
}

/* 기본 스타일 리셋 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: auto;
    min-height: 100%;
}

body {
    height: auto;
    min-height: 100%;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

/* 콘텐츠 영역만 컬러 유지 (필터 제외) */
img,
img.emoji,
.emoji,
.twemoji,
.reaction-emoji,
.emoji-option img,
.editor-image-container img,
.editor-block-image img,
.viewer-content img,
.mobile-viewer-content img,
.editor-textarea,
.viewer-content,
.mobile-viewer-content,
video,
iframe,
.editor-textarea *,
.viewer-content *,
.mobile-viewer-content * {
    filter: none !important;
    -webkit-filter: none !important;
    -moz-filter: none !important;
    -ms-filter: none !important;
    -o-filter: none !important;
}

/* 앱 컨테이너 */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: white;
    width: 100%;
    box-sizing: border-box;
}

/* 에디터 페이지에서는 스크롤 가능 */
body.editor-page .app {
    height: 100vh;
    overflow: hidden;
}


/* 버튼 스타일 */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.btn-primary {
    background-color: #000000;
    color: white;
}

.btn-primary:hover {
    background-color: #333333;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-secondary.published {
    background-color: #cccccc;
}

.btn-secondary.published:hover {
    background-color: #555555;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    min-width: auto;
    width: auto;
    background: none;
    border: none;
    color: #adb5bd;
    transition: color 0.2s ease;
}

.btn-small:hover {
    background: none;
    border: none;
    color: #6c757d;
}

.btn-small i {
    font-size: 0.8rem;
}

/* 메인 컨텐츠 */
.main {
    flex: 1;
    padding: 0;
    max-width: 100%;
    margin: 0;
    width: 100%;
    background-color: white;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    align-items: stretch;
}

/* 에디터 페이지: 툴바 공간 확보는 HTML 요소로 처리 */

/* 에디터 컨테이너 - 전체 화면 */
.editor-container-full {
    display: flex;
    height: 100%;
    background-color: white;
    width: 100%;
    padding: 0;
    margin: 0;
}

.editor-area-full {
    background: white;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: visible;
    padding: 0 !important;
    margin: 0 auto !important;
    min-height: 100vh;
    min-width: 0;
    width: 100%;
    max-width: 1400px;
}

.editor-toolbar-container {
    display: flex;
    justify-content: center;
}

.editor-content-container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: visible;
}



/* 사이드바 */
.sidebar {
    background: white;
    border-radius: 0;
    padding: 1rem;
    box-shadow: none;
    border-right: 1px solid #e9ecef;
    transition: transform 0.3s ease;
    will-change: transform;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 280px;
    min-width: 280px;
    flex-shrink: 0;
    transform: translateX(var(--sidebar-offset));
}

.sidebar.collapsed {
    /* 너비 0으로 즉시 접히는 과거 방식 제거: 부드럽게 슬라이드만 적용 */
    transform: translateX(var(--sidebar-offset));
}

/* 데스크톱 사이드바 토글 버튼 */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 50%;
    left: calc(280px + var(--sidebar-offset));
    transform: translateY(-50%);
    z-index: 1001;
    background: white;
    border: 1px solid #e9ecef;
    border-left: none;
    border-radius: 0 8px 8px 0;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    box-shadow: none;
    width: 20px;
    height: 60px;
    transition: left 0.3s ease;
}

/* 오버레이가 활성화될 때 사이드바 토글 버튼을 뒤로 보내기 */
body.modal-active .sidebar-toggle,
body.overlay-active .sidebar-toggle {
    z-index: 500;
    opacity: 0.3;
}

/* 데스크톱: 사이드바와 동일한 타이밍으로 함께 슬라이드 */
/* 변수 기반 이동으로 접힘 상태에서도 자동 동기화 */

.sidebar-toggle svg {
    width: 12px;
    height: 12px;
    transform: rotate(0deg);
    transition: transform 0.3s ease;
}

.sidebar-toggle.open svg {
    transform: rotate(180deg);
}

/* 모바일 스와이프 영역 */
.swipe-area {
    display: none;
    position: fixed;
    top: 3rem;
    left: 0;
    width: 20px;
    height: calc(100vh - 3rem);
    z-index: 999;
    background: transparent;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.header-buttons {
    display: flex;
    gap: 0.5rem;
}

/* 통합 사이드바 목록 */
.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem;
}

/* 사이드바 아이템 공통 */
.sidebar-item {
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* 드롭 인디케이터 */
.sidebar-item.drop-before::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #000000;
    z-index: 10;
}

.sidebar-item.drop-after::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #000000;
    z-index: 10;
}

.sidebar-item.drop-into {
    background-color: rgba(0, 0, 0, 0.1);
    border: 2px dashed #000000;
    border-radius: 8px;
}

/* 드래그 중 */
.sidebar-item.dragging {
    opacity: 0.4 !important;
}

/* 사이드바 전체 드롭 영역 - 배경/테두리 제거 */
.sidebar-list.drag-over-root {
    /* 배경과 테두리를 표시하지 않음 */
    min-height: 100px;
}

/* 폴더 목록 - 더 이상 사용하지 않음 (통합됨) */
.folder-list {
    display: none;
}

.folder-item {
    margin-bottom: 0.25rem;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    transition: all 0.2s ease;
}

.folder-item.drag-over-folder {
    background-color: #e0e0e0;
    border-radius: 8px;
}

.folder-item.drag-over-folder .folder-header {
    border: 2px dashed #000000;
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.05);
}

/* 폴더 리스트 전체를 드롭 타겟으로 (최상위 폴더로 이동) */
#folderList.drag-over-root {
    background-color: rgba(0, 0, 0, 0.05);
    border: 2px dashed #000000;
    border-radius: 8px;
    min-height: 50px;
}

.folder-header {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.folder-header:active {
    cursor: grabbing;
}

.folder-header:hover {
    background-color: #f8f9fa;
    border-color: #e9ecef;
}

.folder-header.active {
    background-color: #e0e0e0;
    border-color: #000000;
}

.folder-header.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
    z-index: 1000;
}

/* 폴더 토글 아이콘 - 펼침 상태에서 회전 */
.folder-item.open .folder-toggle-icon {
    transform: rotate(90deg);
}

.folder-toggle-icon {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
    color: #6c757d;
    margin-right: 0.5rem;
    cursor: pointer;
    flex-shrink: 0;
}

.folder-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.folder-icon {
    width: 16px;
    height: 16px;
    color: #6c757d;
}

.folder-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
}

.folder-count {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 400;
    background-color: #e9ecef;
    padding: 0.125rem 0.375rem;
    border-radius: 0.75rem;
}

.folder-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.folder-header:hover .folder-actions {
    opacity: 1;
}

.folder-action-btn {
    width: 20px;
    height: 20px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    transition: background-color 0.2s ease;
}

.folder-action-btn:hover {
    background-color: #e9ecef;
    color: #495057;
}

.folder-action-btn svg {
    width: 12px;
    height: 12px;
}

.folder-posts {
    margin-left: 1.5rem;
    margin-top: 0.25rem;
    transition: all 0.3s ease;
    overflow: hidden;
}

/* 폴더 내 하위 항목들 스타일 */
.folder-posts .folder-item,
.folder-posts .folder-post-item {
    margin-bottom: 0.25rem;
}

/* 폴더 내 폴더(하위 폴더) 스타일 */
.folder-posts .folder-item .folder-header {
    padding: 0.375rem 0.5rem;
}

.folder-posts.collapsed {
    max-height: 0;
    margin-top: 0;
    opacity: 0;
}

.folder-post-item {
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    background: #f8f9fa;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: grab;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 2.25rem;
}

.folder-post-item:before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 50%;
    width: 0.75rem;
    height: 1px;
    background-color: #e9ecef;
    transform: translateY(-50%);
}

.folder-post-item:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.folder-post-item:hover .post-delete-btn {
    opacity: 1;
}

.folder-post-content {
    flex: 1;
    min-width: 0;
}

.folder-post-item:active {
    cursor: grabbing;
}

.folder-post-item.dragging {
    opacity: 0.5;
    transform: rotate(1deg);
    z-index: 1000;
}

/* 드래그 오버 스타일 (배경 강조 제거) */
.drag-over {
    background-color: transparent !important;
    border-color: transparent !important;
    transform: none;
    transition: none;
}

/* 폴더 드롭 영역 강조 - 텍스트 피드백 제거 */
.folder-header.drag-over {
    background-color: #f8f9fa !important;
    border-color: #dee2e6 !important;
    border-width: 1px !important;
}

.folder-posts.drag-over {
    background-color: transparent !important;
    border: none !important;
    min-height: 20px;
}

/* 빈 글 목록 스타일 */
.empty-post-list {
    padding: 2rem;
    text-align: center;
    color: #6c757d;
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    margin: 1rem 0;
    background-color: #f8f9fa;
}

.empty-message {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #495057;
}

.empty-hint {
    font-size: 0.875rem;
    color: #6c757d;
    opacity: 0.8;
}

.post-item:active {
    cursor: grabbing;
}

.post-item.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* 드래그 중 불필요한 트랜지션/호버 효과 끔 */
.is-dragging * {
    transition: none !important;
    animation: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

/* 드랍 직후 잠깐 모든 전환 억제하여 깜빡임 방지 */
.suppress-transitions * {
    transition: none !important;
    animation: none !important;
}

.is-dragging .post-item:hover,
.is-dragging .folder-item:hover,
.is-dragging .folder-post-item:hover {
    background: none !important;
    border-color: transparent !important;
}

/* 커서를 따라다니는 드래그 미러 */
.drag-mirror {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    background: white;
    transform: translate(-50%, -50%);
    pointer-events: none !important;
    will-change: transform, left, top;
}

/* 드래그 중 레이아웃 튐 방지: 높이 고정 느낌 제공 */
.is-dragging .post-item,
.is-dragging .folder-post-item {
    will-change: transform;
}

/* 글 박스에 드롭 오버 효과 제거 */
.post-item.drag-over-top {
    outline: 2px solid rgba(33, 150, 243, 0.0);
}

.post-item.drag-over-bottom {
    outline: 2px solid rgba(33, 150, 243, 0.0);
}

/* 드롭 위치 표시 */
.drop-indicator {
    height: 2px;
    background-color: #000000;
    margin: 2px 0;
    border-radius: 1px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.drop-indicator.active {
    opacity: 1;
}

.drop-indicator.top {
    margin-top: -1px;
}

.drop-indicator.bottom {
    margin-bottom: -1px;
}

/* 드래그 플레이스홀더: 현재 위치를 차지하는 더미 박스 */
.drag-placeholder {
    background: rgba(0, 0, 0, 0.08);
    border: 1px dashed rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    margin: 4px 0;
}

/* 드롭 오버 시 글 아이템 스타일 제거 */
.post-item.drag-over-top {
    outline: 2px solid rgba(33, 150, 243, 0.0);
}

.post-item.drag-over-bottom {
    outline: 2px solid rgba(33, 150, 243, 0.0);
}

.folder-post-item.drag-over-top {
    outline: 2px solid rgba(33, 150, 243, 0.0);
}

.folder-post-item.drag-over-bottom {
    outline: 2px solid rgba(33, 150, 243, 0.0);
}

.folder-item:hover {
    background-color: transparent;
    border-color: transparent;
}

.folder-item.active {
    background-color: #e0e0e0;
    border-color: #000000;
}

.folder-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.folder-icon {
    width: 16px;
    height: 16px;
    color: #6c757d;
}

.folder-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
}

.folder-count {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 400;
}

.folder-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.folder-item:hover .folder-actions {
    opacity: 1;
}

.folder-action-btn {
    width: 20px;
    height: 20px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    transition: background-color 0.2s ease;
}

.folder-action-btn:hover {
    background-color: #e9ecef;
    color: #495057;
}

.folder-action-btn svg {
    width: 12px;
    height: 12px;
}

.sidebar-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.last-save-time {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 400;
    white-space: nowrap;
    min-height: 1rem;
    padding: 0.25rem 0;
    visibility: visible;
    opacity: 1;
    margin-right: 0.5rem;
}

.sidebar-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
}

/* 글 목록 - 더 이상 사용하지 않음 (통합됨) */
.post-list {
    display: none;
}

.post-item {
    padding: 0.375rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.post-item:active {
    cursor: grabbing;
    /* 드래그 중 커서 */
}

.post-item.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
    z-index: 1000;
}

/* 드래그 중 원본 숨김으로 레이아웃 고정 */
.hidden-during-drag {
    opacity: 0 !important;
}

.post-item:hover {
    background-color: #f8f9fa;
    border-color: #e9ecef;
}

.post-item:hover .post-delete-btn {
    opacity: 1;
}

.post-item.active {
    background-color: #e0e0e0;
    border-color: #000000;
}

.post-item-content {
    flex: 1;
    min-width: 0;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.25rem;
}

.post-date {
    font-size: 0.6875rem;
    color: #adb5bd;
}

.post-folder {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background-color: #e0e0e0;
    color: #000000;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 500;
}

.folder-icon-small {
    width: 12px;
    height: 12px;
}

.post-delete-btn {
    background: none;
    border: none;
    color: #000000;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 3px;
    opacity: 0;
    transition: all 0.2s ease;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.post-delete-btn:hover {
    background-color: #000000;
    color: white;
    opacity: 1;
}

.post-delete-btn svg {
    width: 14px;
    height: 14px;
}

.post-title {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0;
    font-size: 0.8rem;
}

.post-preview {
    font-size: 0.7rem;
    color: #6c757d;
    line-height: 1.3;
    display: none;
    /* 미리보기 숨기기 */
    /* display: -webkit-box;
    -webkit-line-clamp: 2; */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-date {
    font-size: 0.65rem;
    color: #adb5bd;
    margin-top: 0.25rem;
}

/* 에디터 영역 */
.editor-area {
    background: white;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    flex: 1;
    min-width: 0;
}

.editor-header {
    padding: 1rem 0 1rem 0;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.title-inputs {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.title-input {
    border: none;
    font-size: 2rem;
    font-weight: 700;
    color: #495057;
    background: transparent;
    outline: none;
    padding: 1rem 0 0.25rem 0;
    line-height: 1.3;
}

.title-input::placeholder {
    color: #adb5bd;
}

.subtitle-input {
    border: none;
    font-size: 1.1rem;
    font-weight: 400;
    color: #6c757d;
    background: transparent;
    outline: none;
    padding: 0 0 0.5rem 0;
    line-height: 1.5;
}

.subtitle-input::placeholder {
    color: #adb5bd;
}

/* 에디터 툴바 컨테이너 */
.editor-toolbar-container {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    background: white;
    border-bottom: none;
    position: relative;
    top: 64px;
    z-index: 900;
    display: block;
    padding: 0;
}

.editor-toolbar-container::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: #e9ecef;
}

/* 에디터 툴바 (2줄 구조) */
.editor-toolbar {
    display: flex;
    flex-direction: column;
    /* 세로 배치 */
    gap: 0;
    padding: 0 1rem;
    background-color: white;
    width: auto;
    max-width: 1400px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* 툴바 행 */
.toolbar-row {
    gap: 0.25rem;
    flex-wrap: nowrap;
    justify-content: flex-start;
}

.toolbar-row-top {
    height: 40px;
    /* 첫 줄 높이 40px */
    padding: 0;
    border-bottom: none;
    display: flex;
    align-items: center;
    position: relative;
}

.toolbar-row-top::after {
    content: '';
    position: absolute;
    left: calc(-50vw + 50%);
    width: 100vw;
    bottom: 0;
    height: 1px;
    background: #e9ecef;
}

.toolbar-row-bottom {
    height: 40px;
    /* 두 번째 줄 높이 40px */
    padding: 0;
    display: flex;
    align-items: center;
}

/* 툴바 구분선 */
.toolbar-separator {
    width: 1px;
    height: 32px;
    background: #dee2e6;
    margin: 0 0.5rem;
    flex-shrink: 0;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    padding-right: 0;
}

/* 모든 드롭다운은 아래로 열림 (위로 열릴 때 잘림 현상 방지) */

/* 작은 화면에서 가로 스크롤 */
@media (max-width: 850px) {
    .editor-toolbar-container {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .editor-toolbar {
        min-width: 100%;
    }

    .toolbar-row {
        flex-wrap: nowrap;
        min-width: max-content;
        width: max-content;
    }
}

/* 폰트 선택 드롭다운 */
.font-family-dropdown {
    position: relative;
    display: inline-block;
}

.font-family-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: transparent;
    border: none;
    border-radius: 0;
    font-size: 0.875rem;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
    justify-content: space-between;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.font-family-trigger:hover {
    background-color: transparent;
}

.font-family-trigger svg {
    transition: transform 0.2s ease;
}

.font-family-dropdown.open .font-family-trigger svg {
    transform: rotate(180deg);
}

.font-family-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    margin-top: 0.25rem;
}

.font-family-dropdown.open .font-family-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.font-family-option {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: #495057;
    cursor: pointer;
    transition: background-color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.font-family-option:hover {
    background-color: #f8f9fa;
}

.font-family-option.active {
    background-color: #e0e0e0;
    color: #333333;
    font-weight: 500;
}

.font-family-option.active::after {
    content: "✓";
    color: #333333;
    font-weight: bold;
}

/* 각 폰트별 미리보기 스타일 */
.font-family-option[data-family="Pretendard"] {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.font-family-option[data-family="Ridibatang"] {
    font-family: 'Ridibatang', serif;
}

.font-family-option[data-family="NanumSquare"] {
    font-family: 'NanumSquare', sans-serif;
}

.font-family-option[data-family="JoseonGulim"] {
    font-family: 'JoseonGulim', serif;
}

.font-family-option[data-family="Noto Serif KR"] {
    font-family: 'Noto Serif KR', serif;
}

/* 폰트 드롭다운 구분선 */
.font-family-divider {
    height: 1px;
    background-color: #e9ecef;
    margin: 0.25rem 0;
}

/* 폰트 업로드 옵션 */
.font-upload-option {
    color: #6c757d !important;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.font-upload-option:hover {
    background-color: #f8f9fa;
    color: #495057 !important;
}

.font-upload-option svg {
    opacity: 0.7;
}

/* 입력 커서가 에디터 외부에 나타나지 않도록 설정 */
* {
    caret-color: transparent;
}

.editor-textarea {
    caret-color: auto;
    spellcheck: false;
}

/* 다른 입력 요소들도 커서 표시 */
input,
textarea,
select,
button {
    caret-color: auto;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 에디터 내부 모든 요소에서 커서 표시 */
.editor-textarea * {
    caret-color: auto;
}

/* 텍스트 색상 드롭다운 */
.text-color-dropdown {
    position: relative;
    display: inline-block;
}

.text-color-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
}

.text-color-trigger:hover {
    background-color: transparent;
}

.color-preview {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #e9ecef;
    flex-shrink: 0;
}

.text-color-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    z-index: 2000;
    min-width: 320px;
    padding: 0.75rem;
    display: none;
    flex-direction: row;
    gap: 0.75rem;
}

.text-color-menu.show {
    display: flex;
}

.color-tabs {
    display: flex;
    flex-direction: column;
    gap: 0.120rem;
    justify-content: flex-start;
    min-width: 40px;
}

.color-tab {
    padding: 0.125rem 0.375rem;
    background: none;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.625rem;
    color: #6c757d;
    transition: all 0.15s ease;
    text-align: center;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-tab:hover {
    background-color: #f8f9fa;
    color: #495057;
}

.color-tab.active {
    background-color: #000000;
    color: white;
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 0.35rem;
    max-height: 120px;
    overflow-y: auto;
    flex: 1;
    padding: 2px;
}

.color-option {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    position: relative;
}

.color-option:hover {
    border-color: #000000;
}

.color-option.selected {
    border-color: #e0e0e0;
    box-shadow: none;
}

.color-option.selected::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
    font-weight: bold;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

/* 에디터용 MS-DOS 스타일 코드박스 */
.editor-codebox {
    background-color: #000000;
    border: 2px solid #c0c0c0;
    border-radius: 0;
    margin: 1rem 0;
    font-family: 'HBIOS-SYS', 'Courier New', monospace;
    overflow: hidden;
    overflow-y: hidden;
    position: relative;
    min-height: 200px;
    height: auto;
    display: flex;
    flex-direction: column;
}

.editor-codebox:hover {
    border-color: #808080;
}

.codebox-header {
    background-color: #c0c0c0;
    padding: 4px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #808080;
    font-size: 11px;
    font-weight: bold;
    color: #000000;
}

.codebox-title-input {
    background: transparent;
    border: none;
    outline: none;
    font-size: 11px;
    font-weight: bold;
    color: #000000;
    font-family: 'Courier New', monospace;
    padding: 2px 4px;
    /* 더 넉넉한 표시 영역 */
    width: 220px;
    max-width: calc(100% - 44px);
    /* 닫기 버튼 영역 제외 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 에디터에서 도스 박스 제목은 드래그/선택/포인터 동작 비활성화 */
/* 에디터에서 도스 박스 전체를 하나의 블록처럼: 텍스트 선택 금지 */
.editor-codebox,
.editor-codebox * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    cursor: default;
}

/* 제목 인풋은 클릭 이벤트를 부모로 버블링시키기 위해 포인터는 유지 */
.editor-codebox .codebox-title-input,
.editor-codebox .codebox-title-input[disabled] {
    caret-color: transparent;
}

.codebox-title-input:focus {
    background-color: #ffffff;
    border: 1px solid #000000;
}

.codebox-delete {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
}

.codebox-delete:hover {
    background-color: #000000;
    color: #ffffff;
}

.codebox-content {
    padding: 8px;
    background-color: #000000;
    color: #ffffff;
    font-size: 14px;
    line-height: 1.9;
    min-height: 150px;
    height: auto;
    flex: 1;
    outline: none;
    cursor: text;
    resize: none;
    overflow: hidden;
    overflow-y: hidden;
    font-family: 'HBIOS-SYS', 'Courier New', monospace;
}

.codebox-content:focus {
    outline: none;
}

.editor-codebox.focused {
    border-color: #000000;
}

.codebox-prompt {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.codebox-path {
    color: #ffffff;
    font-weight: bold;
}

.codebox-cursor {
    color: #ffffff;
    animation: blink 1s infinite;
    margin-left: 2px;
}

.codebox-output {
    font-family: 'HBIOS-SYS', 'Courier New', monospace;
}

.codebox-line {
    margin-bottom: 2px;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #ffffff;
    line-height: 1.9;
    min-height: 16px;
    display: block;
    font-family: 'HBIOS-SYS', 'Courier New', monospace;
}

.codebox-line:last-child {
    margin-bottom: 0;
}

/* 코드박스 내부 편집 가능한 영역 */
.editor-codebox[contenteditable="true"] .codebox-content {
    outline: none;
}

.editor-codebox[contenteditable="true"]:focus {
    border-color: #000000;
}

/* 코드박스 내부 텍스트 선택 시 */
.editor-codebox .codebox-line:focus {
    background-color: rgba(255, 255, 255, 0.1);
    outline: none;
}

/* MS-DOS 박스 오버레이 높이 자동 조정 */
.dos-box-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
    padding: 20px;
    box-sizing: border-box;
}

.dos-box-container {
    width: 80%;
    max-width: 800px;
    height: auto;
    min-height: 200px;
    max-height: 80vh;
    background-color: #000000;
    border: 2px solid #c0c0c0;
    border-radius: 0;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    font-family: 'HBIOS-SYS', 'Courier New', monospace;
    overflow: hidden;
}

.dos-box-header {
    background-color: #c0c0c0;
    padding: 4px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #808080;
    font-size: 11px;
    font-weight: bold;
    color: #000000;
}

.dos-box-title {
    color: #000000;
}

.dos-box-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dos-box-close:hover {
    background-color: #000000;
    color: #ffffff;
}

.dos-box-content {
    flex: 1;
    padding: 8px;
    overflow-y: auto;
    background-color: #000000;
    color: #666666;
    font-size: 14px;
    line-height: 1.9;
    min-height: 150px;
    height: auto;
    font-family: 'HBIOS-SYS', 'Courier New', monospace;
}

.dos-prompt {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.dos-path {
    color: #666666;
    font-weight: bold;
    font-family: 'HBIOS-SYS', 'Courier New', monospace;
}

.dos-cursor {
    color: #666666;
    animation: blink 1s infinite;
    margin-left: 2px;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

.dos-output {
    font-family: 'HBIOS-SYS', 'Courier New', monospace;
}

.dos-line {
    margin-bottom: 2px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'HBIOS-SYS', 'Courier New', monospace;
}

.dos-line:last-child {
    margin-bottom: 0;
}

/* 스크롤바 스타일링 */
.dos-box-content::-webkit-scrollbar {
    width: 12px;
}

.dos-box-content::-webkit-scrollbar-track {
    background: #000000;
}

.dos-box-content::-webkit-scrollbar-thumb {
    background: #404040;
    border: 1px solid #808080;
}

.dos-box-content::-webkit-scrollbar-thumb:hover {
    background: #606060;
}

/* MS-DOS 박스 애니메이션 */
.dos-box-overlay.show {
    animation: dosBoxFadeIn 0.3s ease-out;
}

.dos-box-container.show {
    animation: dosBoxSlideIn 0.3s ease-out;
}

@keyframes dosBoxFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes dosBoxSlideIn {
    from {
        transform: scale(0.8) translateY(-50px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* MS-DOS 박스 아이콘 스타일 */
#dosBoxBtn {
    position: relative;
}

#dosBoxBtn:hover {
    background-color: #e9ecef;
}

#dosBoxBtn:active {
    background-color: #dee2e6;
}

/* 폰트 업로드 오버레이 */
.font-upload-content {
    max-width: 600px;
    width: 90%;
}

.font-upload-area {
    text-align: center;
    padding: 2rem;
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.font-upload-area:hover {
    border-color: #000000;
    background-color: #e0e0e0;
}

.font-upload-area.dragover {
    border-color: #000000;
    background-color: #e0e0e0;
    transform: scale(1.02);
}

.upload-icon {
    color: #6c757d;
    margin-bottom: 1rem;
}

.font-upload-area h4 {
    margin-bottom: 0.5rem;
    color: #495057;
}

.font-upload-area p {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

.upload-btn {
    background-color: #000000;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.upload-btn:hover {
    background-color: #333333;
}

/* 폰트 미리보기 영역 */
.font-preview-area {
    margin-top: 1.5rem;
}

.font-preview-area h4 {
    margin-bottom: 1rem;
    color: #495057;
}

.font-preview-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 1rem;
    background-color: #f8f9fa;
}

.font-preview-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    background-color: white;
    margin-bottom: 0.5rem;
}

.font-preview-item:last-child {
    margin-bottom: 0;
}

.font-preview-info {
    flex: 1;
}

.font-preview-name {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.25rem;
}

.font-preview-sample {
    font-size: 1.25rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.font-preview-file {
    font-size: 0.75rem;
    color: #adb5bd;
}

.font-preview-remove {
    background: none;
    border: none;
    color: #000000;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease;
}

.font-preview-remove:hover {
    background-color: #f8d7da;
}

.font-upload-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

/* 폰트 크기 드롭다운 */
.font-size-dropdown {
    position: relative;
    display: inline-block;
}

.font-size-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: transparent;
    border: none;
    border-radius: 0;
    font-size: 0.875rem;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
    justify-content: space-between;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.font-size-trigger:hover {
    background-color: transparent;
}

.font-size-trigger svg {
    transition: transform 0.2s ease;
}

.font-size-dropdown.open .font-size-trigger svg {
    transform: rotate(180deg);
}

.font-size-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    margin-top: 0.25rem;
}

.font-size-dropdown.open .font-size-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.font-size-option {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: #495057;
    cursor: pointer;
    transition: background-color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.font-size-option:hover {
    background-color: #f8f9fa;
}

.font-size-option.active {
    background-color: #e0e0e0;
    color: #333333;
    font-weight: 500;
}

.font-size-option.active::after {
    content: "✓";
    color: #333333;
    font-weight: bold;
}

/* 폰트 굵기 드롭다운 메뉴 */
.font-weight-dropdown {
    position: relative;
    display: inline-block;
}

.font-weight-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: transparent;
    border: none;
    border-radius: 0;
    font-size: 0.875rem;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
    justify-content: space-between;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.font-weight-trigger:hover {
    background-color: transparent;
}

.font-weight-trigger svg {
    transition: transform 0.2s ease;
}

.font-weight-dropdown.open .font-weight-trigger svg {
    transform: rotate(180deg);
}

.font-weight-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    margin-top: 0.25rem;
}

.font-weight-dropdown.open .font-weight-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.font-weight-option {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: #495057;
    cursor: pointer;
    transition: background-color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.font-weight-option:hover {
    background-color: #f8f9fa;
}

.font-weight-option.active {
    background-color: #e0e0e0;
    color: #333333;
    font-weight: 500;
}

.font-weight-option.active::after {
    content: "✓";
    color: #333333;
    font-weight: bold;
}

/* 각 굵기별 미리보기 스타일 */
.font-weight-option[data-weight="100"] {
    font-weight: 100;
}

.font-weight-option[data-weight="200"] {
    font-weight: 200;
}

.font-weight-option[data-weight="300"] {
    font-weight: 300;
}

.font-weight-option[data-weight="400"] {
    font-weight: 400;
}

.font-weight-option[data-weight="500"] {
    font-weight: 500;
}

.font-weight-option[data-weight="600"] {
    font-weight: 600;
}

.font-weight-option[data-weight="700"] {
    font-weight: 700;
}

.font-weight-option[data-weight="800"] {
    font-weight: 800;
}

.font-weight-option[data-weight="900"] {
    font-weight: 900;
}

.toolbar-btn {
    padding: 0.25rem 0.375rem;
    border: 1px solid transparent;
    border-radius: 3px;
    background: transparent;
    color: #495057;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toolbar-btn:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.toolbar-btn.active {
    background-color: #000000;
    color: white;
    border-color: #000000;
}

/* 폰트 크기 조절 컨트롤 */
.font-size-control {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 0.25rem;
}


.editor-content {
    flex: 1;
    padding: 1rem 0 3rem 0;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 300px);
    overflow: visible;
}

.editor-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.editor-textarea {
    width: 100%;
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.05rem;
    line-height: var(--editor-line-height, 1.8);
    letter-spacing: -0.003em;
    color: #1a1a1a;
    background: transparent;
    padding: 1rem 0;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

/* 문단 간격 적용 - 타이피(Typy) 방식 */
.editor-textarea {
    --paragraph-spacing: 1.8em;
    /* 기본값 */
    --editor-line-height: 1.8;
    /* 기본값 */
}

/* p/div 태그에 margin-bottom 적용 - 타이피 방식 */
/* 직접 자식만이 아니라 모든 블록 레벨 요소에 적용 */
.editor-textarea p:not(.quote-style):not(.editor-codebox):not(.editor-image-container):not(.editor-audio-container):not(.editor-block-image):not(.editor-block-audio):not(.editor-block-divider):not(.editor-block-paywall):not(.paywall-divider):not(.paywall-notice):not(.ms-dos-box),
.editor-textarea div:not(.quote-style):not(.editor-codebox):not(.editor-image-container):not(.editor-audio-container):not(.editor-block-image):not(.editor-block-audio):not(.editor-block-divider):not(.editor-block-paywall):not(.paywall-divider):not(.paywall-notice):not(.ms-dos-box):not(.codebox-container):not(.editor-table-wrapper):not(.editor-audio-wrapper) {
    margin-top: 0 !important;
    margin-bottom: var(--paragraph-spacing, 1.8em) !important;
}

/* 마지막 자식 요소는 하단 간격 제거 */
.editor-textarea>*:last-child {
    margin-bottom: 0 !important;
}

/* br 태그 방식 (단순 줄바꿈으로 복원) */
.editor-textarea br {
    display: inline !important;
    margin: 0 !important;
}

/* 기본 텍스트 요소에 행간 적용 - 인라인 스타일이 없는 경우에만 */
.editor-textarea span:not([style*="line-height"]),
.editor-textarea text,
.editor-textarea strong:not([style*="line-height"]),
.editor-textarea em:not([style*="line-height"]),
.editor-textarea u:not([style*="line-height"]),
.editor-textarea a:not([style*="line-height"]),
.editor-textarea b:not([style*="line-height"]),
.editor-textarea i:not([style*="line-height"]),
.editor-textarea mark:not([style*="line-height"]) {
    line-height: var(--editor-line-height, 1.8) !important;
    display: inline !important;
}

/* contenteditable=false 요소는 블록으로 표시 */
.editor-textarea [contenteditable="false"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 오디오 컨테이너와 플레이어 강제 표시 */
.editor-textarea .editor-audio-container,
#contentTextarea .editor-audio-container {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    margin: 1rem auto !important;
}

.editor-textarea .editor-audio-wrapper,
#contentTextarea .editor-audio-wrapper {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    max-width: 600px !important;
}

.editor-textarea .editor-audio-player,
#contentTextarea .editor-audio-player {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    height: 40px !important;
}

.editor-textarea:empty::before {
    content: attr(placeholder);
    color: #adb5bd;
    pointer-events: none;
}

/* 인용문 텍스트 크기 강제 설정 */
.editor-textarea div.quote-style {
    font-size: 16px !important;
    line-height: 1.5 !important;
}

.editor-textarea .quote-style p {
    font-size: 16px !important;
    line-height: 1.5 !important;
}

/* 폰트 크기 변경 시 행간 일정하게 유지 */

/* 커서 크기 동적 조정 */
.editor-textarea {
    caret-color: auto;
}

/* 폰트 크기에 따른 커서 크기 조정 - 브라우저가 자동으로 처리 */

/* 폰트 크기별 커서 높이 조정 */
.editor-textarea span[style*="font-size: 12px"] {
    line-height: 1.1 !important;
}

.editor-textarea span[style*="font-size: 14px"] {
    line-height: 1.1 !important;
}

.editor-textarea span[style*="font-size: 16px"] {
    line-height: 1.1 !important;
}

.editor-textarea span[style*="font-size: 18px"] {
    line-height: 1.1 !important;
}

.editor-textarea span[style*="font-size: 20px"] {
    line-height: 1.1 !important;
}

.editor-textarea span[style*="font-size: 24px"] {
    line-height: 1.1 !important;
}

.editor-textarea span[style*="font-size: 28px"] {
    line-height: 1.1 !important;
}

.editor-textarea span[style*="font-size: 32px"] {
    line-height: 1.1 !important;
}

.editor-textarea span[style*="font-size: 36px"] {
    line-height: 1.1 !important;
}

.editor-textarea span[style*="font-size: 40px"] {
    line-height: 1.1 !important;
}

.editor-textarea span[style*="font-size: 48px"] {
    line-height: 1.1 !important;
}

.editor-textarea span[style*="font-size: 56px"] {
    line-height: 1.1 !important;
}

.editor-textarea span[style*="font-size: 64px"] {
    line-height: 1.1 !important;
}

.editor-textarea span[style*="font-size: 72px"] {
    line-height: 1.1 !important;
}

/* 각 폰트 굵기별 스타일 */
.editor-textarea span[style*="font-weight: 100"] {
    font-weight: 100 !important;
}

.editor-textarea span[style*="font-weight: 200"] {
    font-weight: 200 !important;
}

.editor-textarea span[style*="font-weight: 300"] {
    font-weight: 300 !important;
}

.editor-textarea span[style*="font-weight: 400"] {
    font-weight: 400 !important;
}

.editor-textarea span[style*="font-weight: 500"] {
    font-weight: 500 !important;
}

.editor-textarea span[style*="font-weight: 600"] {
    font-weight: 600 !important;
}

.editor-textarea span[style*="font-weight: 700"] {
    font-weight: 700 !important;
}

.editor-textarea span[style*="font-weight: 800"] {
    font-weight: 800 !important;
}

.editor-textarea span[style*="font-weight: 900"] {
    font-weight: 900 !important;
}

/* 에디터 내부 서식 스타일 */
.editor-textarea strong,
.editor-textarea b {
    font-weight: 600;
}

.editor-textarea em,
.editor-textarea i {
    font-style: italic;
}

.editor-textarea u {
    text-decoration: underline;
}

.editor-textarea h1,
.editor-textarea h2,
.editor-textarea h3,
.editor-textarea h4,
.editor-textarea h5,
.editor-textarea h6 {
    font-weight: 700;
    margin-top: 2.5em;
    margin-bottom: 1.2em;
    line-height: 1.35;
    letter-spacing: -0.02em;
}

.editor-textarea h1 {
    font-size: 2rem;
}

.editor-textarea h2 {
    font-size: 1.6rem;
}

.editor-textarea h3 {
    font-size: 1.3rem;
}

/* blockquote-type6 (구버전) 제거됨 - 7100라인 부근 최신 정의 사용 */

.editor-textarea blockquote,
.viewer-content blockquote,
.mobile-viewer-content blockquote,
.post-content blockquote {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border-left: 4px solid #000000;
    background-color: #f8f9fa;
    font-style: normal;
    /* 이탤릭체 제거 */
}

/* 인용서식1 - 중앙 큰 따옴표 (blockquote-type1 + 레거시 .quote-style) */
.editor-textarea blockquote.blockquote-type1,
.viewer-content blockquote.blockquote-type1,
.mobile-viewer-content blockquote.blockquote-type1,
.post-content blockquote.blockquote-type1,
.editor-textarea .quote-style,
.viewer-content .quote-style,
.mobile-viewer-content .quote-style,
.post-content .quote-style {
    margin: 2rem 0;
    padding: 2rem 1rem 1rem 1rem;
    text-align: center;
    position: relative;
    background-color: transparent;
    border: none;
    border-left: none;
    font-size: 16px !important;
    line-height: 1.5;
}

.editor-textarea blockquote.blockquote-type1::before,
.viewer-content blockquote.blockquote-type1::before,
.mobile-viewer-content blockquote.blockquote-type1::before,
.post-content blockquote.blockquote-type1::before,
.editor-textarea .quote-style::before,
.viewer-content .quote-style::before,
.mobile-viewer-content .quote-style::before,
.post-content .quote-style::before {
    content: "\201C";
    display: block;
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 32px;
    font-family: Georgia, Times, serif;
    font-size: 68px;
    line-height: 1;
    text-align: center;
    pointer-events: none;
    color: #000;
}

/* 인용서식2 - 좌측 큰 따옴표 */
.editor-textarea blockquote.blockquote-type2,
.viewer-content blockquote.blockquote-type2,
.mobile-viewer-content blockquote.blockquote-type2,
.post-content blockquote.blockquote-type2 {
    margin: 1.5rem 0;
    padding: 0.5rem 1rem 0.5rem 2.25rem;
    position: relative;
    background: transparent;
    border: none;
    border-left: none;
    font-style: normal;
}

.editor-textarea blockquote.blockquote-type2::before,
.viewer-content blockquote.blockquote-type2::before,
.mobile-viewer-content blockquote.blockquote-type2::before,
.post-content blockquote.blockquote-type2::before {
    content: "\201C";
    position: absolute;
    left: 0.4rem;
    top: -0.15rem;
    font-family: Georgia, Times, serif;
    font-size: 56px;
    line-height: 1;
    color: #000;
    pointer-events: none;
}

/* 인용서식3 - 좌측 라인 */
.editor-textarea blockquote.blockquote-type3,
.viewer-content blockquote.blockquote-type3,
.mobile-viewer-content blockquote.blockquote-type3,
.post-content blockquote.blockquote-type3 {
    margin: 1rem 0;
    padding: 0.25rem 0 0.25rem 1rem;
    background: transparent;
    border: none;
    border-left: 3px solid #e5e7eb;
    font-style: normal;
}

/* 인용서식4 - 박스 */
.editor-textarea blockquote.blockquote-type4,
.viewer-content blockquote.blockquote-type4,
.mobile-viewer-content blockquote.blockquote-type4,
.post-content blockquote.blockquote-type4 {
    margin: 1rem 0;
    padding: 1rem 1.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #ffffff;
    font-style: normal;
}

/* blockquote-type5 (구버전) 제거됨 - 7100라인 부근 최신 정의 사용 */

/* 다크모드: 큰 따옴표 색상 */
body.dark-mode .viewer-content blockquote.blockquote-type1::before,
body.dark-mode .viewer-content .quote-style::before,
body.dark-mode .viewer-content blockquote.blockquote-type2::before,
body.theme-dark .mobile-viewer-content blockquote.blockquote-type1::before,
body.theme-dark .mobile-viewer-content .quote-style::before,
body.theme-dark .mobile-viewer-content blockquote.blockquote-type2::before {
    color: #ffffff;
}

/* 다크모드: 박스/필 배경 */
body.dark-mode .viewer-content blockquote.blockquote-type4,
body.theme-dark .mobile-viewer-content blockquote.blockquote-type4 {
    background: #111;
    border-color: #333;
}

/* 다크모드 구버전 무력화 */
body.dark-mode .viewer-content blockquote.blockquote-type5,
body.theme-dark .mobile-viewer-content blockquote.blockquote-type5 {
    background: transparent;
}


.editor-textarea code {
    background-color: #f1f3f4;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
}

.editor-textarea pre {
    background-color: #1e1e1e;
    border: 1px solid #333333;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    color: #d4d4d4;
}

/* 에디터 내부 코드 구문 강조 */
.editor-textarea pre .variable {
    color: #9cdcfe;
}

.editor-textarea pre .string {
    color: #ce9178;
}

.editor-textarea pre .comment {
    color: #6a9955;
    font-style: italic;
}

.editor-textarea pre .keyword {
    color: #569cd6;
}

.editor-textarea ul,
.editor-textarea ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.editor-textarea li {
    margin-bottom: 0.25rem;
}

/* 모달 및 오버레이 */
.modal,
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show,
.overlay.show {
    display: flex;
}

.modal-content,
.overlay-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header,
.overlay-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3,
.overlay-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #495057;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.close-btn:hover {
    background-color: #f8f9fa;
}

.modal-body,
.overlay-body {
    padding: 1.5rem 2rem;
}

.post-list-modal {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* 폼 그룹 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
    font-size: 0.875rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.08);
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #6c757d;
    line-height: 1.4;
}

/* 오버레이 액션 버튼 */
.overlay-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

/* 발행 오버레이: 액션 버튼을 2열 그리드 전체 너비로 확장 */
.publish-grid .overlay-actions {
    grid-column: 1 / -1;
}

/* 이미지 업로드 탭 */
.image-upload-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.tab-btn {
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    color: #6c757d;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-btn.active {
    color: #000000;
    border-bottom-color: #000000;
}

.tab-btn:hover {
    color: #495057;
}

.tab-content {
    margin-top: 1rem;
}

/* 파일 업로드 영역 */
.file-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #f8f9fa;
}

.file-upload-area:hover {
    border-color: #000000;
    background-color: #e0e0e0;
}

.file-upload-area.dragover {
    border-color: #000000;
    background-color: #e0e0e0;
    transform: scale(1.02);
}

.upload-icon {
    color: #6c757d;
    margin-bottom: 1rem;
}

.file-upload-area p {
    color: #6c757d;
    font-size: 0.875rem;
    margin: 0;
}

.file-upload-area.has-file {
    border-color: #666666;
    background-color: #d4edda;
}

.file-upload-area.has-file .upload-icon {
    color: #666666;
}

.file-upload-area.has-file p {
    color: #666666;
    font-weight: 500;
}

/* 데스크톱에서 사이드바 토글 버튼 표시 */
@media (min-width: 769px) {
    .sidebar-toggle {
        display: block;
    }

    /* 데스크톱: 사이드바를 흐름에서 분리하고 컨테이너로 레이아웃 보정 */
    .editor-container {
        position: relative;
        padding-left: calc(280px + var(--sidebar-offset));
        transition: padding-left 0.3s ease;
    }

    .sidebar {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
    }
}

/* 빈 상태 */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
}

.empty-state h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.875rem;
}

/* 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-item {
    animation: none;
}

/* 스크롤바 스타일링 */
.sidebar::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 에디터 내 이미지 컨테이너 */
.editor-image-container {
    display: block;
    position: relative;
    margin: 1.5rem auto;
    text-align: center;
    max-width: 100%;
    user-select: none;
    clear: both;
    overflow: visible;
}

.editor-image-container.selected {
    /* 선택 시 테두리 제거 */
    border: none;
}

.editor-image-container img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    cursor: move;
}

/* 삭제 버튼 */
.editor-image-wrapper .editor-image-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(100, 100, 100, 0.6);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
    z-index: 10;
    pointer-events: auto;
}

.editor-image-wrapper:hover .editor-image-delete,
.editor-block-image.focused .editor-image-delete {
    display: flex;
}

.editor-image-wrapper .editor-image-delete:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* 이미지 래퍼 (핸들을 이미지 높이에 맞추기 위한 wrapper) */
.editor-image-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
    margin: 0 auto;
    overflow: visible;
}

.editor-image-wrapper img {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* 리사이즈 핸들 */
.editor-image-wrapper .editor-image-resize-handle {
    position: absolute;
    width: 6px;
    height: 60px;
    background: rgba(180, 180, 180, 0.7);
    border-radius: 3px;
    cursor: ew-resize;
    display: none;
    z-index: 10;
    top: 50%;
    transform: translateY(-50%);
    transition: background 0.2s;
    pointer-events: auto;
}

.editor-image-wrapper .editor-image-resize-handle:hover {
    background: rgba(150, 150, 150, 0.9);
}

.editor-image-wrapper:hover .editor-image-resize-handle,
.editor-block-image.focused .editor-image-resize-handle {
    display: block;
}

.editor-image-wrapper .editor-image-resize-handle.left {
    left: 12px;
}

.editor-image-wrapper .editor-image-resize-handle.right {
    right: 12px;
}

/* 리사이즈 중 커서 */
body.resizing-image {
    cursor: ew-resize !important;
    user-select: none;
}

/* 오디오 플레이어 스타일 - 이미지 컨테이너와 유사한 방식 */
.editor-audio-container {
    display: block !important;
    position: relative;
    margin: 1rem auto;
    text-align: center;
    max-width: 100%;
    user-select: none;
    clear: both;
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
    visibility: visible !important;
    opacity: 1 !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

/* 에디터 내부에서 오디오 컨테이너 표시 */
#contentTextarea .editor-audio-container,
.editor-textarea .editor-audio-container {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    margin: 1rem auto !important;
}

.editor-audio-wrapper {
    position: relative;
    display: inline-block !important;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    background: transparent !important;
    border: none !important;
    border-radius: 0;
    min-width: 300px;
    width: 100%;
    max-width: 600px;
    box-sizing: border-box;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 에디터 내부에서 오디오 래퍼 표시 */
#contentTextarea .editor-audio-wrapper,
.editor-textarea .editor-audio-wrapper {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    max-width: 600px !important;
}

.editor-audio-player {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 300px;
    height: 40px !important;
    outline: none;
    border-radius: 0;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* 에디터 내부에서 오디오 플레이어 표시 */
#contentTextarea .editor-audio-player,
.editor-textarea .editor-audio-player {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 40px !important;
}

/* 에디터에서만 삭제 버튼 표시 */
.editor-audio-wrapper .editor-audio-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.85);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    font-size: 16px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000 !important;
    pointer-events: auto !important;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
}

/* 에디터 내부에서만 삭제 버튼 표시 (호버 시) */
#contentTextarea .editor-audio-wrapper:hover .editor-audio-delete,
.editor-textarea .editor-audio-wrapper:hover .editor-audio-delete {
    display: flex !important;
}

/* 에디터 내부에서만 삭제 버튼 표시 */
#contentTextarea .editor-audio-wrapper .editor-audio-delete,
.editor-textarea .editor-audio-wrapper .editor-audio-delete {
    pointer-events: auto;
}

.editor-audio-wrapper .editor-audio-delete:hover {
    background: rgba(0, 0, 0, 1);
    transform: scale(1.1);
}

/* 뷰어에서 삭제 버튼 완전히 숨기기 (모든 경우) */
.viewer-content .editor-audio-delete,
.viewer-content .editor-audio-wrapper:hover .editor-audio-delete,
.viewer-content .editor-audio-wrapper .editor-audio-delete {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* 뷰어에서 오디오 플레이어 스타일 */
.viewer-content .editor-audio-container {
    margin: 1.5rem auto;
    max-width: 100%;
}

.viewer-content .editor-audio-player {
    width: 100%;
    max-width: 100%;
    height: 40px;
}

/* 다크모드 스타일 */
body.theme-dark .editor-audio-wrapper {
    background: transparent !important;
    border: none !important;
    border-radius: 0;
    padding: 0 !important;
}

body.theme-dark .editor-audio-player {
    filter: invert(1) hue-rotate(180deg);
}

body.theme-dark .editor-audio-wrapper .editor-audio-delete {
    background: rgba(0, 0, 0, 0.9);
}

.viewer-content body.theme-dark .editor-audio-wrapper {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

/* 에디터 블록 공통 스타일 */
.element-editor-container {
    display: block;
    position: relative;
    margin: 1.5rem auto;
    user-select: none;
}

.editor-block-image,
.editor-block-audio,
.editor-block-divider,
.editor-block-paywall,
.editor-block-youtube {
    display: block;
    position: relative;
    margin: 1.5rem auto;
    user-select: none;
    cursor: move;
    /* 드래그 가능한 커서 */
}

.editor-block-image.dragging,
.editor-block-audio.dragging,
.editor-block-divider.dragging,
.editor-block-paywall.dragging,
.editor-block-youtube.dragging {
    opacity: 0.5;
}

/* 블록 포커스 표시 */
.editor-block-image.focused,
.editor-block-audio.focused,
.editor-block-divider.focused,
.editor-block-paywall.focused,
.editor-block-youtube.focused {
    outline: 2px solid #000000;
    outline-offset: 4px;
    border-radius: 4px;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
    transition: outline 0.15s ease, box-shadow 0.15s ease;
}

/* 블록 내부 모든 요소는 드래그 불가 (특정 페이지 제외 - data-page 속성 사용) */
body:not([data-page="posts-page"]):not([data-page="series-page"]):not([data-page="series-view-page"]):not(.editor-page) .editor-block-image>*,
body:not([data-page="posts-page"]):not([data-page="series-page"]):not([data-page="series-view-page"]):not(.editor-page) .editor-block-audio>*,
body:not([data-page="posts-page"]):not([data-page="series-page"]):not([data-page="series-view-page"]):not(.editor-page) .editor-block-divider>*,
body:not([data-page="posts-page"]):not([data-page="series-page"]):not([data-page="series-view-page"]):not(.editor-page) .editor-block-paywall>*,
body:not([data-page="posts-page"]):not([data-page="series-page"]):not([data-page="series-view-page"]):not(.editor-page) .editor-block-youtube>* {
    -webkit-user-drag: none !important;
    -khtml-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    user-drag: none !important;
    pointer-events: auto;
    /* 클릭은 가능하지만 드래그는 불가 */
    cursor: default;
}

/* 블록 내부 요소를 클릭해도 외곽 블록처럼 커서 표시 */
.editor-block-image:hover,
.editor-block-audio:hover,
.editor-block-divider:hover,
.editor-block-paywall:hover,
.editor-block-youtube:hover {
    cursor: move;
}

.editor-block-image:hover>*,
.editor-block-audio:hover>*,
.editor-block-divider:hover>*,
.editor-block-paywall:hover>*,
.editor-block-youtube:hover>* {
    cursor: move;
}

/* 삭제 버튼과 리사이즈 핸들은 예외 */
.editor-block-image:hover .editor-image-delete,
.editor-block-image:hover .editor-image-resize-handle,
.editor-block-audio:hover .editor-audio-delete,
.editor-block-paywall:hover .paywall-delete-btn,
.editor-block-youtube:hover .editor-image-delete {
    cursor: pointer;
}

/* 유튜브 비디오 컨테이너 (16:9 반응형) */
.youtube-video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
}

.youtube-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.editor-block-youtube.focused .editor-image-delete {
    display: flex;
}

/* 블록 내부 컨테이너는 margin 제거 */
.editor-block-image .editor-image-container,
.editor-block-audio .editor-audio-container,
.editor-block-divider .hr-block,
.editor-block-paywall .paywall-divider {
    margin: 0;
}

/* 블록 내부 래퍼 스타일 */
.editor-image-inner,
.editor-audio-inner,
.editor-divider-inner,
.editor-paywall-inner {
    display: block;
    width: 100%;
}

/* 내부 요소들은 드래그 불가 (특정 페이지 제외 - data-page 속성 사용) */
body:not([data-page="posts-page"]):not([data-page="series-page"]):not([data-page="series-view-page"]):not(.editor-page) .editor-block-image img,
body:not([data-page="posts-page"]):not([data-page="series-page"]):not([data-page="series-view-page"]):not(.editor-page) .editor-block-audio audio,
body:not([data-page="posts-page"]):not([data-page="series-page"]):not([data-page="series-view-page"]):not(.editor-page) .editor-block-divider hr {
    -webkit-user-drag: none !important;
    -moz-user-drag: none !important;
    user-drag: none !important;
    cursor: default;
}

/* 드래그 중 스타일 (하위 호환) */
.editor-audio-container.dragging {
    opacity: 0.5;
}

body.resizing-image * {
    cursor: ew-resize !important;
}

/* 폰트 굵기 - data attribute 방식 */
[data-font-weight="100"],
b[data-font-weight="100"] {
    font-weight: 100 !important;
}

[data-font-weight="200"],
b[data-font-weight="200"] {
    font-weight: 200 !important;
}

[data-font-weight="300"],
b[data-font-weight="300"] {
    font-weight: 300 !important;
}

[data-font-weight="400"],
b[data-font-weight="400"] {
    font-weight: 400 !important;
}

[data-font-weight="500"],
b[data-font-weight="500"] {
    font-weight: 500 !important;
}

[data-font-weight="600"],
b[data-font-weight="600"] {
    font-weight: 600 !important;
}

[data-font-weight="700"],
b[data-font-weight="700"] {
    font-weight: 700 !important;
}

[data-font-weight="800"],
b[data-font-weight="800"] {
    font-weight: 800 !important;
}

[data-font-weight="900"],
b[data-font-weight="900"] {
    font-weight: 900 !important;
}

/* 발행 오버레이 전용 개선 */
.publish-overlay-content {
    max-width: 560px;
}

.publish-overlay-content .overlay-body {
    padding: 1.25rem 1.5rem;
}

.publish-overlay-content .form-group>label {
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

.publish-overlay-content .form-group label input[type="checkbox"],
.publish-overlay-content .form-group label input[type="radio"] {
    margin-right: 8px;
}

.publish-overlay-content .form-group label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.publish-overlay-content .form-group .inline-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
}

.password-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pw-input {
    flex: 1;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
}

.icon-btn i {
    font-size: 16px;
}

.icon-btn:hover {
    background: #e9ecef;
}

#scheduleStartWrap input,
#scheduleRangeWrap input {
    height: 40px;
    padding: 0 8px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.cover-uploader {
    display: flex;
    align-items: center;
}

.cover-box {
    width: 120px;
    height: 120px;
    border: 2px dashed #ced4da;
    border-radius: 8px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.cover-plus {
    font-size: 28px;
    color: #adb5bd;
    line-height: 1;
}

.cover-box:hover {
    background: #f1f3f5;
}

#coverThumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-box {
    position: relative;
}

.cover-remove {
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    opacity: 0.9;
}

.publish-grid {
    display: grid;
    grid-template-columns: 160px 1fr;
    column-gap: 16px;
    row-gap: 16px;
}

.publish-row {
    display: contents;
}

.publish-label {
    grid-column: 1;
    align-self: center;
    color: #495057;
    font-weight: 600;
    min-height: 40px;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.price-label {
    align-self: flex-start;
    padding-top: 8px;
}

.schedule-row .publish-label {
    align-self: flex-start;
    height: auto;
    padding-top: 2px;
}

.publish-control {
    grid-column: 2;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.price-control {
    align-items: flex-start;
}

.publish-select {
    width: 260px;
    height: 40px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0 10px;
    background: #fff;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.publish-date {
    width: 220px;
    height: 40px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0 8px;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* toggle switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #dee2e6;
    transition: .2s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .2s;
    border-radius: 50%;
}

.switch input:checked+.slider {
    background-color: #000000;
}

.switch input:checked+.slider:before {
    transform: translateX(20px);
}

.password-inline-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.password-inline-wrap .password-row {
    margin: 0;
}

.schedule-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.schedule-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 범위 예약일 때는 세로 정렬 (시작/종료 한 줄씩) */
#scheduleRangeWrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#scheduleRangeWrap>div {
    display: block;
}

/* 다크모드 기본 스타일 (뷰어 전용) */
body.dark-mode {
    background-color: #121212;
    color: #e9ecef;
}

/* 뷰어에서만 다크모드 적용, 에디터는 항상 라이트모드 유지 */
body.dark-mode .viewer-container,
body.dark-mode .viewer-content,
body.dark-mode .viewer-title,
body.dark-mode .viewer-subtitle {
    background-color: #121212;
    color: #e9ecef;
}

body.dark-mode .viewer-content h1,
body.dark-mode .viewer-content h2,
body.dark-mode .viewer-content h3,
body.dark-mode .viewer-content h4,
body.dark-mode .viewer-content h5,
body.dark-mode .viewer-content h6 {
    color: #ffffff;
}

body.dark-mode .viewer-content blockquote {
    background-color: #1a1a1a;
    border-left-color: #3b82f6;
}

body.dark-mode .viewer-header-bar {
    background: rgba(26, 26, 26, 0.95);
    border-bottom-color: #404040;
}

/* 주석 스타일 */
.editor-comment {
    position: relative;
    display: inline-block;
    border-bottom: 2px dotted #000000;
    cursor: pointer;
    transition: all 0.2s ease;
}

.editor-comment:hover {
    background-color: rgba(0, 123, 255, 0.1);
    border-radius: 3px;
}

.editor-comment::before {
    content: attr(data-comment);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    max-width: 200px;
    word-wrap: break-word;
    white-space: normal;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.editor-comment::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    border: 4px solid transparent;
    border-top-color: #333;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.editor-comment:hover::before,
.editor-comment:hover::after {
    opacity: 1;
    visibility: visible;
}

/* 주석 편집 모드 */
.editor-comment.editing {
    background-color: rgba(0, 123, 255, 0.2);
    border-radius: 3px;
}

/* 주석 삭제 버튼 */
.editor-comment .comment-delete {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 16px;
    height: 16px;
    background-color: #000000;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 10px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.editor-comment:hover .comment-delete {
    display: flex;
}

.editor-comment .comment-delete:hover {
    background-color: #cc0000;
}

/* 주석 오버레이 스타일 */
#commentOverlay .form-group {
    margin-bottom: 1rem;
}

#commentOverlay label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

#commentOverlay textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    min-height: 80px;
}

#commentOverlay textarea:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.08);
}

/* 인라인 주석 입력창 스타일 */
.inline-comment-input {
    position: absolute;
    z-index: 10000;
    animation: fadeInUp 0.2s ease-out;
}

.comment-input-content {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    padding: 12px;
    min-width: 200px;
    max-width: 300px;
}

.comment-text-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 14px;
    padding: 8px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.comment-text-input:focus {
    border-bottom-color: #000000;
}

.comment-input-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.comment-save-btn,
.comment-cancel-btn {
    padding: 4px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.comment-save-btn {
    background-color: #000000;
    color: white;
}

.comment-save-btn:hover {
    background-color: #333333;
}

.comment-cancel-btn {
    background-color: #6c757d;
    color: white;
}

.comment-cancel-btn:hover {
    background-color: #545b62;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 루비 스타일 주석 */
.ruby-comment {
    position: relative;
    display: inline-block;
    vertical-align: baseline;
    line-height: 1;
}

.ruby-base {
    display: inline;
    font-size: inherit;
    line-height: inherit;
}

.ruby-comment::before {
    content: attr(data-comment);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    display: block;
    font-size: 0.6em;
    line-height: 1;
    text-align: center;
    color: #666;
    margin-bottom: 2px;
    padding: 0px;
    background-color: transparent;
    border-radius: 0;
    border: none;
    white-space: nowrap;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    pointer-events: none;
    z-index: 1000;
}

/* 루비 스타일 입력창 */
.ruby-comment-input {
    position: absolute;
    z-index: 10000;
    animation: fadeInUp 0.2s ease-out;
}

.ruby-input-content {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    padding: 12px;
    min-width: 200px;
    max-width: 300px;
}

.ruby-input-header {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.ruby-selected-text {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.ruby-text-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 14px;
    padding: 8px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.ruby-text-input:focus {
    border-bottom-color: #000000;
}

.ruby-input-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.ruby-save-btn,
.ruby-cancel-btn {
    padding: 4px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ruby-save-btn {
    background-color: #000000;
    color: white;
}

.ruby-save-btn:hover {
    background-color: #333333;
}

.ruby-cancel-btn {
    background-color: #6c757d;
    color: white;
}

.ruby-cancel-btn:hover {
    background-color: #545b62;
}

/* 자간 드롭다운 */
.letter-spacing-dropdown {
    position: relative;
    display: inline-block;
}

.letter-spacing-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 80px;
    padding: 0.5rem 0.75rem;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.letter-spacing-trigger:hover {
    background-color: #f8f9fa;
    border-color: #000000;
}

.letter-spacing-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    z-index: 2000;
    min-width: 80px;
    display: none;
    overflow: hidden;
}

.letter-spacing-menu.show {
    display: block;
    animation: fadeInUp 0.2s ease-out;
}

.letter-spacing-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.875rem;
}

.letter-spacing-option:last-child {
    border-bottom: none;
}

.letter-spacing-option:hover {
    background-color: #f8f9fa;
}

.letter-spacing-option.active {
    background-color: #000000;
    color: white;
}

.letter-spacing-option.active:hover {
    background-color: #333333;
}

/* 본문 폭 조절 드롭다운 */
.content-width-dropdown {
    position: relative;
    display: inline-block;
}

.content-width-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 80px;
    padding: 0.5rem 0.75rem;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.content-width-trigger:hover {
    background-color: #f8f9fa;
    border-color: #000000;
}

.content-width-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    z-index: 2000;
    min-width: 80px;
    display: none;
    overflow: hidden;
}

.content-width-menu.show {
    display: block;
    animation: fadeInUp 0.2s ease-out;
}

.content-width-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.875rem;
}

.content-width-option:last-child {
    border-bottom: none;
}

.content-width-option:hover {
    background-color: #f8f9fa;
}

.content-width-option.active {
    background-color: #000000;
    color: white;
}

.content-width-option.active:hover {
    background-color: #333333;
}

.line-height-dropdown {
    position: relative;
    display: inline-block;
}

.line-height-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 80px;
    padding: 0.5rem 0.75rem;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.line-height-trigger:hover {
    background-color: #f8f9fa;
    border-color: #000000;
}

.line-height-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    z-index: 2000;
    min-width: 80px;
    display: none;
    overflow: hidden;
}

.line-height-menu.show {
    display: block;
    animation: fadeInUp 0.2s ease-out;
}

.line-height-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.875rem;
}

.line-height-option:last-child {
    border-bottom: none;
}

.line-height-option:hover {
    background-color: #f8f9fa;
}

/* 문단 간격 드롭다운 */
.paragraph-spacing-dropdown {
    position: relative;
    display: inline-block;
}

.paragraph-spacing-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    min-width: 36px;
    height: 36px;
}

.paragraph-spacing-trigger:hover {
    background-color: #f8f9fa;
    border-color: #000000;
}

.paragraph-spacing-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    min-width: 80px;
    display: none;
    overflow: hidden;
}

.paragraph-spacing-menu.show {
    display: block;
    animation: fadeInUp 0.2s ease-out;
}

.paragraph-spacing-option {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.paragraph-spacing-option:last-child {
    border-bottom: none;
}

.paragraph-spacing-option:hover {
    background-color: #f8f9fa;
}

.paragraph-spacing-option.active {
    background-color: #000000;
    color: white;
}

.line-height-option.active {
    background-color: #000000;
    color: white;
}

.line-height-option.active:hover {
    background-color: #333333;
}

.alignment-dropdown {
    position: relative;
    display: inline-block;
}

.alignment-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: transparent !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
    box-shadow: none !important;
}

.alignment-trigger:hover {
    background-color: #f8f9fa;
}

.alignment-trigger::before,
.alignment-trigger::after {
    display: none !important;
    content: none !important;
}

/* alignment-trigger와 관련된 요소에서 원형 배경 제거 (드롭다운 메뉴 제외) */
.alignment-trigger,
.alignment-trigger svg,
#alignmentBtn,
#alignmentIcon {
    border-radius: 4px !important;
    background: transparent !important;
    box-shadow: none !important;
}

.alignment-trigger svg,
#alignmentIcon {
    background: none !important;
    border-radius: 0 !important;
}

/* alignment-trigger에 toolbar-btn 스타일이 적용되지 않도록 방지 */
.alignment-trigger.toolbar-btn,
#alignmentBtn.toolbar-btn {
    border-radius: 4px !important;
    background: transparent !important;
}

/* toolbar-group이나 alignment-dropdown에서 원형 배경 제거 (드롭다운 메뉴는 제외) */
.toolbar-group .alignment-dropdown,
.alignment-dropdown,
.alignment-dropdown::before,
.alignment-dropdown::after {
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* alignment-trigger만 배경 제거 (메뉴는 제외) */
.toolbar-group .alignment-dropdown>.alignment-trigger,
.alignment-dropdown>.alignment-trigger {
    border-radius: 4px !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* alignment-trigger 주변의 모든 요소에서 원형 배경 완전 제거 */
.toolbar-group:has(.alignment-trigger),
.toolbar-group:has(#alignmentBtn) {
    border-radius: 0 !important;
    background: transparent !important;
}

/* alignment-trigger에 toolbar-btn.active 스타일이 적용되지 않도록 방지 */
.alignment-trigger.toolbar-btn.active,
#alignmentBtn.toolbar-btn.active,
.alignment-trigger.active,
#alignmentBtn.active {
    border-radius: 4px !important;
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

/* 드롭다운 메뉴 스타일 */
.alignment-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    z-index: 2000 !important;
    min-width: 40px !important;
    display: none;
    overflow: hidden !important;
}

.alignment-menu.show {
    display: block !important;
}

.alignment-option {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 40px !important;
    height: 40px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    border-bottom: 1px solid #f0f0f0 !important;
    background: white !important;
    color: #333 !important;
}

.alignment-option:last-child {
    border-bottom: none !important;
}

.alignment-option:hover {
    background-color: #f8f9fa !important;
}

.alignment-option.active {
    background-color: #000000 !important;
    color: white !important;
}

.alignment-option * {
    background: transparent !important;
}

.alignment-option.active * {
    color: white !important;
    background: transparent !important;
}

.dropdown-input-content {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    padding: 12px;
    min-width: 200px;
    max-width: 300px;
}

.dropdown-input-header {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.dropdown-selected-text {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.dropdown-text-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 14px;
    padding: 8px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.dropdown-text-input:focus {
    border-bottom-color: #000000;
}

.dropdown-input-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.dropdown-add-btn,
.dropdown-update-btn {
    padding: 4px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #000000;
    color: white;
}

.dropdown-add-btn:hover,
.dropdown-update-btn:hover {
    background-color: #333333;
}

.dropdown-remove-btn {
    padding: 4px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #000000;
    color: white;
}

.dropdown-remove-btn:hover {
    background-color: #c82333;
}

.dropdown-cancel-btn {
    padding: 4px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #6c757d;
    color: white;
}

.dropdown-cancel-btn:hover {
    background-color: #545b62;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #000000;
        color: #e0e0e0;
    }

    .app {
        background-color: #000000;
    }

    .header,
    .top-header {
        background: #111;
        border-bottom: 1px solid #222;
    }

    .logo {
        color: #fff;
    }

    .nav-link {
        color: #b0b0b0;
    }

    .nav-link:hover {
        color: #fff;
    }

    .nav-link.active {
        color: #fff;
        background-color: #1a1a1a;
    }

    .header-btn.primary {
        background-color: #000000;
        color: #fff;
    }

    .header-btn.primary:hover {
        background-color: #333333;
    }

    .profile-button {
        background-color: #222;
        color: #e0e0e0;
    }

    .profile-button .profile-image {
        width: 100%;
        height: 100%;
        border-radius: 50%;
        object-fit: cover;
        position: absolute;
        top: 0;
        left: 0;
    }

    .profile-button i {
        position: relative;
        z-index: 1;
    }

    .profile-button:hover {
        background-color: #2a2a2a;
    }

    .profile-menu {
        background: #1a1a1a;
        border: 1px solid #333;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    }

    .profile-menu-item {
        color: #e0e0e0;
    }

    .profile-menu-item:hover {
        background-color: #222;
    }

    .editor-area,
    .editor-area-full {
        background-color: #000000;
    }

    .title-input,
    .subtitle-input,
    .editor-textarea {
        background-color: #000000;
        color: #e0e0e0;
        border-color: #222;
    }

    .title-input::placeholder,
    .subtitle-input::placeholder,
    .editor-textarea::placeholder {
        color: #555;
    }

    .editor-toolbar {
        background-color: transparent;
    }

    .toolbar-btn {
        color: #b0b0b0;
        background-color: transparent;
    }

    .toolbar-btn:hover {
        background-color: #1a1a1a;
        color: #fff;
    }

    .toolbar-btn.active {
        background-color: #222;
        color: #000000;
    }

    .btn {
        background-color: #222;
        color: #e0e0e0;
        border-color: #333;
    }

    .btn:hover {
        background-color: #2a2a2a;
    }

    .btn-primary {
        background-color: #000000;
        color: #fff;
    }

    .btn-primary:hover {
        background-color: #333333;
    }

    .btn-secondary {
        background-color: #333;
        color: #e0e0e0;
    }

    .btn-secondary:hover {
        background-color: #3a3a3a;
    }

    /* Overlay */
    .overlay {
        background: rgba(0, 0, 0, 0.85);
    }

    .overlay-content {
        background: #1a1a1a;
        border: 1px solid #333;
    }

    .overlay-header {
        border-bottom: 1px solid #333;
    }

    .overlay-title {
        color: #fff;
    }

    .close-btn {
        color: #b0b0b0;
    }

    .close-btn:hover {
        color: #fff;
    }

    .form-group label {
        color: #b0b0b0;
    }

    .form-input,
    .form-select,
    .form-textarea {
        background-color: #111;
        color: #e0e0e0;
        border: 1px solid #333;
    }

    .form-input:focus,
    .form-select:focus,
    .form-textarea:focus {
        border-color: #000000;
        background-color: #000000;
    }

    .checkbox-label {
        color: #e0e0e0;
    }

    /* Posts Page */
    .posts-page {
        background-color: #000000;
    }

    .page-title {
        color: #fff;
    }

    .tabs {
        border-bottom: 1px solid #222;
    }

    .tab {
        color: #b0b0b0;
    }

    .tab:hover {
        color: #fff;
        background-color: #1a1a1a;
    }

    .tab.active {
        color: #000000;
        border-bottom-color: #000000;
    }

    .post-card,
    .series-card {
        background: #111;
        border: 1px solid #222;
    }

    .post-card:hover,
    .series-card:hover {
        border-color: #333;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    }

    .post-title,
    .series-title {
        color: #fff;
    }

    .post-excerpt,
    .series-description {
        color: #888;
    }

    .post-meta {
        color: #666;
    }

    .status-badge {
        background-color: #222;
        color: #e0e0e0;
    }

    .status-badge.published {
        background-color: #1a5928;
        color: #7ceb9c;
    }

    .status-badge.scheduled {
        background-color: #4a3a1a;
        color: #cccccc;
    }

    /* Series Page */
    .series-page {
        background-color: #000000;
    }

    /* Viewer */
    .viewer-container {
        background-color: #000000;
    }

    .viewer-title {
        color: #fff;
    }

    .viewer-subtitle {
        color: #888;
    }

    .viewer-meta {
        color: #666;
    }

    .viewer-divider {
        background: #222;
    }

    .viewer-content {
        color: #d0d0d0;
    }

    .viewer-content h1,
    .viewer-content h2,
    .viewer-content h3,
    .viewer-content h4,
    .viewer-content h5,
    .viewer-content h6 {
        color: #fff;
    }

    .viewer-content a {
        color: #5b9eff;
    }

    .viewer-content a:hover {
        color: #999999;
    }

    .viewer-content blockquote {
        border-left-color: #333;
        background-color: #111;
        color: #b0b0b0;
    }

    .viewer-content code {
        background-color: #1a1a1a;
        color: #000000;
    }

    .viewer-content pre {
        background-color: #111;
        border: 1px solid #222;
    }

    .viewer-content pre code {
        color: #d0d0d0;
    }

    .viewer-content table {
        border-color: #222;
    }

    .viewer-content th {
        background-color: #1a1a1a;
        border-color: #222;
        color: #fff;
    }

    .viewer-content td {
        border-color: #222;
    }

    .share-button {
        color: #b0b0b0;
    }

    .share-button:hover {
        color: #fff;
    }

    .share-overlay {
        background: #1a1a1a;
        border: 1px solid #333;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    }

    .share-option {
        color: #e0e0e0;
        border-bottom: 1px solid #222;
    }

    .share-option:hover {
        background-color: #222;
    }

    /* Blog Main */
    .blog-main {
        background-color: #000000;
    }

    .section-title {
        color: #fff;
    }

    .post-item {
        background: #111;
        border: 1px solid #222;
    }

    .post-item:hover {
        border-color: #333;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    }

    .post-item-content h3 {
        color: #fff;
    }

    .post-item-excerpt {
        color: #888;
    }

    .post-item-meta {
        color: #666;
    }

    /* Dropdown */
    .dropdown-content {
        background: #1a1a1a;
        border: 1px solid #333;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    }

    .dropdown-option,
    .alignment-option {
        color: #e0e0e0;
        border-bottom: 1px solid #222;
    }

    .dropdown-option:hover,
    .alignment-option:hover {
        background-color: #222;
    }

    .dropdown-option.active,
    .alignment-option.active {
        background-color: #000000;
        color: #fff;
    }

    .dropdown-input-content {
        background: #1a1a1a;
        border: 1px solid #333;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    }

    .dropdown-input-header {
        border-bottom: 1px solid #333;
    }

    .dropdown-selected-text {
        color: #888;
    }

    .dropdown-text-input {
        background-color: #111;
        color: #e0e0e0;
        border-bottom: 1px solid #333;
    }

    .dropdown-text-input:focus {
        border-bottom-color: #000000;
    }
}

/* ==================== 다운로드 드롭다운 ==================== */
.download-dropdown {
    position: relative;
    display: inline-block;
}

.download-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #495057;
    transition: all 0.2s ease;
    min-width: 100px;
    justify-content: space-between;
}

.download-trigger:hover {
    background: #f8f9fa;
    border-color: #000000;
}

.download-trigger.active {
    background: #000000;
    color: white;
    border-color: #000000;
}

.download-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 180px;
    display: none;
    margin-top: 2px;
}

.download-menu.show {
    display: block;
}

.download-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #495057;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f8f9fa;
}

.download-option:last-child {
    border-bottom: none;
}

.download-option:hover {
    background: #f8f9fa;
}

.download-option svg {
    color: #6c757d;
    flex-shrink: 0;
}

.download-option:hover svg {
    color: #000000;
}

.editor-table-wrapper {
    margin: 1.5rem 0;
    overflow-x: auto;
}

.editor-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.875rem;
}

.editor-table th,
.editor-table td {
    border: 1px solid #e0e0e0;
    padding: 0.5rem 0.75rem;
    text-align: left;
    position: relative;
    min-width: 100px;
}

.editor-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.editor-table td {
    background: white;
    color: #212529;
}

.editor-table td:focus,
.editor-table th:focus {
    outline: 2px solid #000000;
    outline-offset: -2px;
    background: #f0f7ff;
}

.editor-table td:hover,
.editor-table th:hover {
    background: #f8f9fa;
}

/* 표 컨트롤 버튼 */
.table-controls {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
    justify-content: flex-end;
}

.table-control-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.2s ease;
}

.table-control-btn:hover {
    background: #f8f9fa;
    border-color: #000000;
    color: #000000;
}

/* 다크 모드 */
@media (prefers-color-scheme: dark) {
    .download-trigger {
        background: #1a1a1a;
        border-color: #333;
        color: #e9ecef;
    }

    .download-trigger:hover {
        background: #2a2a2a;
        border-color: #000000;
    }

    .download-trigger.active {
        background: #000000;
        color: white;
        border-color: #000000;
    }

    .download-menu {
        background: #1a1a1a;
        border-color: #333;
    }

    .download-option {
        color: #e9ecef;
        border-bottom-color: #333;
    }

    .download-option:hover {
        background: #2a2a2a;
    }

    .download-option svg {
        color: #6c757d;
    }

    .download-option:hover svg {
        color: #000000;
    }

    .editor-table {
        background: #0a0a0a;
    }

    .editor-table th,
    .editor-table td {
        border-color: #333;
    }

    .editor-table th {
        background: #1a1a1a;
        color: #e0e0e0;
    }

    .editor-table td {
        background: #0a0a0a;
        color: #e0e0e0;
    }

    .editor-table td:focus,
    .editor-table th:focus {
        outline-color: #000000;
        background: #1a2332;
    }

    .editor-table td:hover,
    .editor-table th:hover {
        background: #1a1a1a;
    }

    .table-control-btn {
        background: #1a1a1a;
        border-color: #495057;
        color: #adb5bd;
    }

    .table-control-btn:hover {
        background: #222;
        border-color: #000000;
        color: #000000;
    }
}

/* ==================== 원고 노트 패널 ==================== */
.notes-panel {
    position: fixed;
    right: -320px;
    top: 64px;
    width: 320px;
    height: calc(100vh - 64px);
    background: #fff;
    border-left: 1px solid #e9ecef;
    transition: right 0.3s ease;
    z-index: 999;
    display: flex;
    flex-direction: column;
}

.notes-panel.open {
    right: 0;
}

/* 노트 패널이 열릴 때 에디터 영역이 가려지지 않도록 우측 여백 확보 */
body.notes-open .editor-container-full {
    padding-right: 100px !important;
}

body.notes-open .editor-area-full {
    padding-right: 0 !important;
}

/* 본문과 툴바 내부도 우측 여백 확보 */
body.notes-open .editor-content-container {
    padding-right: 100px !important;
}

body.notes-open .editor-toolbar {
    padding-right: 100px !important;
}

/* ==================== 포스트 정보 패널 ==================== */
.info-panel {
    position: fixed;
    right: -280px;
    top: 64px;
    width: 280px;
    height: calc(100vh - 64px);
    background: #fff;
    border-left: 1px solid #e9ecef;
    transition: right 0.3s ease;
    z-index: 998;
    display: flex;
    flex-direction: column;
}

.info-panel.open {
    right: 0;
}

.info-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.info-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #212529;
}

.info-close-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.info-close-btn:hover {
    background: #f8f9fa;
    color: #212529;
}

.info-body {
    flex: 1;
    overflow: auto;
    padding: 1rem 1.25rem;
}

.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0;
}

.info-label {
    color: #6c757d;
    font-size: 0.9rem;
}

.info-value {
    color: #212529;
    font-weight: 600;
}

.info-divider {
    height: 1px;
    background: #f1f3f5;
    margin: 0.5rem 0 0.75rem;
}

/* 포스트 정보 패널 열림 시 레이아웃 보정 (사용자 조정 폭 반영: 100px) */
body.postinfo-open .editor-container-full {
    padding-right: 100px !important;
}

body.postinfo-open .editor-content-container {
    padding-right: 100px !important;
}

/* 입력 영역만 좌측 보정 (노트와 동일 기준 80px) */
body.postinfo-open .editor-content-container {
    transform: translateX(-80px);
    transition: transform 0.3s ease;
}

@media (max-width: 1024px) {
    body.postinfo-open .editor-content-container {
        transform: none;
    }
}

/* 노트 패널이 열릴 때 입력 영역과 툴바를 좌측으로 이동해 시각적 중심 보정 */
body.notes-open .editor-content-container {
    transform: translateX(-80px);
    transition: transform 0.3s ease;
}

@media (max-width: 1024px) {
    body.notes-open .editor-content-container {
        transform: none;
    }
}

.notes-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notes-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.notes-header-actions {
    display: flex;
    gap: 0.5rem;
}

.notes-add-btn,
.notes-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
}

.notes-add-btn:hover,
.notes-close-btn:hover {
    background: #f8f9fa;
    color: #212529;
}

.notes-body {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.notes-body::-webkit-scrollbar {
    width: 6px;
}

.notes-body::-webkit-scrollbar-track {
    background: transparent;
}

.notes-body::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 3px;
}

.notes-body::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* 개별 노트 아이템 */
.note-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    position: relative;
    transition: all 0.2s ease;
}

.note-item:hover {
    border-color: #dee2e6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.note-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.note-item-date {
    font-size: 0.75rem;
    color: #6c757d;
}

.note-item-delete {
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: #000000;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transition: all 0.2s ease;
}

.note-item:hover .note-item-delete {
    opacity: 1;
}

.note-item-delete:hover {
    background: #000000;
    color: #fff;
}

.note-item-content {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #212529;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 빈 상태 */
.notes-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #adb5bd;
    text-align: center;
    padding: 2rem;
}

.notes-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.notes-empty p {
    font-size: 0.875rem;
    margin: 0;
}

/* 노트 입력 영역 */
.notes-input-area {
    border-top: 1px solid #e9ecef;
    padding: 1rem;
    background: #fff;
}

.notes-input-textarea {
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.75rem;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
    resize: none;
    outline: none;
    transition: border-color 0.2s ease;
}

.notes-input-textarea:focus {
    border-color: #000000;
}

.notes-input-textarea::placeholder {
    color: #adb5bd;
}

.notes-input-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.notes-input-cancel,
.notes-input-save {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notes-input-cancel {
    background: transparent;
    color: #6c757d;
}

.notes-input-cancel:hover {
    background: #f8f9fa;
    color: #212529;
}

.notes-input-save {
    background: #000000;
    color: #fff;
}

.notes-input-save:hover {
    background: #333333;
}

.btn-icon {
    background: transparent;
    border: 1px solid #dee2e6;
    color: #495057;
    min-width: auto;
    padding: 0.5rem 0.75rem;
    margin-right: 0.5rem;
}

.btn-icon:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.btn-icon.active {
    background: #e9ecef;
    border-color: #495057;
    color: #212529;
}

/* 다크 모드 */
@media (prefers-color-scheme: dark) {
    .notes-panel {
        background: #0a0a0a;
        border-left-color: #222;
    }

    .notes-header {
        border-bottom-color: #222;
    }

    .notes-header h3 {
        color: #e0e0e0;
    }

    .notes-close-btn {
        color: #adb5bd;
    }

    .notes-close-btn:hover {
        background: #1a1a1a;
        color: #fff;
    }

    .notes-textarea {
        background: #0a0a0a;
        color: #e0e0e0;
    }

    .notes-textarea::placeholder {
        color: #6c757d;
    }

    .notes-footer {
        border-top-color: #222;
    }

    .notes-save-status {
        color: #adb5bd;
    }

    .btn-icon {
        background: transparent;
        border-color: #495057;
        color: #adb5bd;
    }

    .btn-icon:hover {
        background: #1a1a1a;
        border-color: #6c757d;
    }

    .btn-icon.active {
        background: #1a1a1a;
        border-color: #adb5bd;
        color: #fff;
    }
}

/* 구분선 드롭다운 */
.hr-dropdown {
    position: relative;
    display: inline-block;
}

.hr-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    z-index: 2000;
    width: 150px;
    display: none;
    overflow: hidden;
    margin-top: 4px;
}

.hr-menu.show {
    display: block;
    animation: fadeInUp 0.2s ease-out;
}

.hr-option {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.hr-option:last-child {
    border-bottom: none;
}

.hr-option:hover {
    background-color: #f8f9fa;
}

.hr-preview {
    width: 100%;
    height: 1px;
    background: #6c757d;
}

/* 인용문 드롭다운 */
.quote-dropdown {
    position: relative;
    display: inline-block;
}

.quote-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    z-index: 2000;
    width: 150px;
    display: none;
    overflow: hidden;
    margin-top: 4px;
}

.quote-menu.show {
    display: block;
    animation: fadeInUp 0.2s ease-out;
}

.quote-option {
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.quote-option:last-child {
    border-bottom: none;
}

.quote-option:hover {
    background-color: #f8f9fa;
}

/* 구분선 스타일 */
.solid-hr {
    height: 1px;
    background: #6c757d;
}

.short-solid-hr {
    height: 1px;
    background: #6c757d;
    width: 50px;
    margin: 0 auto;
}

.short-bold-solid-hr {
    height: 2px;
    background: #000000;
    width: 50px;
    margin: 0 auto;
}

.short-dash-hr {
    height: 1px;
    background: repeating-linear-gradient(to right,
            #6c757d 0,
            #6c757d 8px,
            transparent 8px,
            transparent 16px);
}

.slash-hr {
    width: 10px;
    height: 10px;
    margin: 20px auto;
    background: transparent;
    border: 1px solid #6c757d;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.dots-hr {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #6c757d;
    margin-left: 50%;
    transform: translateX(-50%);
    box-shadow:
        -13px 0 0 0 #6c757d,
        13px 0 0 0 #6c757d;
    border: none;
}

.long-dash-hr {
    height: 1px;
    background: repeating-linear-gradient(to right,
            #6c757d 0,
            #6c757d 12px,
            transparent 12px,
            transparent 18px);
}

/* 구분선 블록 스타일 */
.hr-block {
    margin: 32px 0;
    padding: 8px 0;
    transition: all 0.2s ease;
    cursor: move;
    user-select: none;
}

.hr-block:hover {
    background: rgba(0, 123, 255, 0.05);
    border-radius: 4px;
}

.hr-block[draggable="true"] {
    cursor: move;
}

.hr-block[draggable="true"]:hover {
    box-shadow: 0 0 0 1px rgba(0, 123, 255, 0.3);
}

.hr-block hr {
    margin: 0;
    border: none;
    background: #e9ecef;
    height: 2px;
}

/* ==================== Site Header (Merged from header.php) ==================== */
.site-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    background: #ffffffcc !important;
    backdrop-filter: saturate(150%) blur(6px) !important;
    border-bottom: 1px solid #eef0f3 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Studio Header Styles */
.studio-header {
    background: white !important;
    border-bottom: 1px solid #e5e7eb !important;
}

.studio-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    padding: 0 1.5rem;
    max-width: 100%;
}

.studio-header-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.studio-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #000;
}

.studio-logo-icon {
    width: 32px;
    height: 32px;
    background: #000;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.studio-logo-text {
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.studio-logo-name {
    font-size: 1rem;
    font-weight: 600;
    color: #000;
}

.studio-header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
}

.studio-page-title {
    font-size: 1rem;
    font-weight: 500;
    color: #000;
    margin: 0;
    padding: 0;
    line-height: 1;
}

.studio-header-right {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    flex-shrink: 0 !important;
}

.studio-icon-btn {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    position: relative;
    border-radius: 50%;
    transition: background 0.2s;
}

.studio-icon-btn:hover {
    background: #f3f4f6;
}

.studio-icon-btn i {
    font-size: 1.125rem;
}

.studio-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    padding: 0 4px;
    border: 2px solid white;
}

.studio-badge-blue {
    background: #3b82f6;
}

.studio-badge-red {
    background: #ef4444;
}

.studio-profile-btn {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.studio-profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.studio-profile-placeholder {
    width: 100%;
    height: 100%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

.studio-profile-placeholder i {
    font-size: 1.25rem;
}

.studio-btn-outline,
.studio-btn-black {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.studio-btn-outline {
    border: 1px solid #e5e7eb;
    color: #374151;
    background: white;
}

.studio-btn-outline:hover {
    background: #f9fafb;
}

.studio-btn-black {
    background: #000;
    color: white;
    border: none;
}

.studio-btn-black:hover {
    background: #333;
}

.logo {
    font-weight: 500 !important;
    color: #373737 !important;
    text-decoration: none !important;
    font-family: 'GabiaDun', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    white-space: nowrap !important;
}

.logo-text {
    display: inline-block;
    margin-top: 8px;
    font-size: 1.5rem;
    font-weight: 900 !important;
    font-family: 'KerisKeduLine', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.nav-right {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

.nav-right>* {
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
}

.nav-right .btn-postype-black,
.nav-right .btn-postype-outline {
    margin: 0 !important;
}

/* Notification Icon Styles */
.notification-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.notification-btn {
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    box-sizing: border-box;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    transition: all 0.2s ease;
    position: relative;
    line-height: 1;
}

.notification-btn:hover {
    background: #f3f4f6;
    color: #111827;
}

.notification-btn i {
    font-size: 24px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 1px;
    background: #000000;
    color: white;
    border-radius: 10px;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0 6px;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Notification Dropdown Style */
.notification-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 360px;
    max-height: 480px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 9999;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notification-icon-wrapper.is-open .notification-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-header {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: white;
}

.notification-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.notification-mark-all-read {
    background: transparent;
    border: 0;
    color: #6b7280;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    line-height: 1.5;
}

.notification-mark-all-read:hover {
    background: #f3f4f6;
    color: #374151;
}

.notification-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    max-height: 400px;
}

.notification-list::-webkit-scrollbar {
    width: 6px;
}

.notification-list::-webkit-scrollbar-track {
    background: #f9fafb;
}

.notification-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.notification-list::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.notification-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
    position: relative;
}

.notification-item:hover {
    background: #f9fafb;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.unread {
    background: #f0f9ff;
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #3b82f6;
}

.notification-item.unread:hover {
    background: #e0f2fe;
}

.notification-item-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    border: 1px solid #e5e7eb;
}

.notification-item-avatar-fallback {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    color: #6c757d;
    font-size: 1.125rem;
    border: 1px solid #dee2e6;
}

.notification-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.notification-item-message {
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal !important;
    /* Force wrapping */
}

.notification-item-content-text {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.4;
    margin-top: 0.125rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal !important;
    /* Force wrapping */
}

.notification-item-time {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.125rem;
}

.notification-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: #6b7280;
}

.notification-empty p {
    margin: 0;
    font-size: 0.875rem;
}

.notification-loading {
    padding: 2rem 1.5rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Profile Dropdown Style */
.dropdown {
    position: relative !important;
    display: inline-block !important;
}

.profile-btn {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    cursor: pointer !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    border: 1px solid #e5e7eb !important;
    transform: translateY(4px) !important;
}

.avatar {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
}

.profile-menu {
    position: absolute !important;
    top: calc(100% + 0.5rem) !important;
    right: 0 !important;
    background: white !important;
    border: 1px solid #e9ecef !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    min-width: 200px !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    transition: all 0.3s ease !important;
    z-index: 9999 !important;
    padding: 8px 0 !important;
    margin-top: 0 !important;
}

.dropdown.is-open .profile-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

.profile-menu-item {
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
    padding: 0 !important;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f8f9fa;
    width: 100%;
    box-sizing: border-box;
    min-height: 48px;
}

.profile-menu-item i,
.profile-menu-item img {
    width: 40px !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
    margin: 0 !important;
}

.profile-menu-item img {
    padding: 11px !important;
    /* SVG 이미지가 너무 커 보이지 않도록 패딩으로 크기 조절 */
    box-sizing: border-box !important;
    object-fit: contain;
}

.profile-menu-item i {
    font-size: 18px;
    /* 아이콘 크기 명시적 지정으로 통일감 부여 */
}

.profile-menu-item span {
    flex: 1;
    text-align: left !important;
    padding-left: 0;
}

/* 링크 구조가 있는 경우 (내 채널 등) */
.profile-menu-item a {
    display: flex !important;
    align-items: center !important;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.profile-menu-item a i,
.profile-menu-item a img {
    width: 40px !important;
    flex-shrink: 0;
}

.profile-menu-item:last-child {
    border-bottom: none;
}

.profile-menu-item:hover {
    background: #f8f9fa;
}

/* Header Buttons Adjustments */
.btn-postype-black,
.btn-postype-outline {
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

/* Dark Mode Overrides for Header */
body.theme-dark .site-header {
    background: #0f0f10cc;
    border-bottom-color: #1e1e22;
}

body.theme-dark .logo,
body.theme-dark .logo-text {
    color: #e6e6e6;
}

body.theme-dark .notification-dropdown,
body.theme-dark .profile-menu {
    background: #111317;
    border-color: #1f232a;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

body.theme-dark .notification-header {
    background: #111317;
    border-bottom-color: #1f232a;
}

body.theme-dark .notification-header h3 {
    color: #e5e7eb;
}

body.theme-dark .notification-mark-all-read {
    color: #9ca3af;
}

body.theme-dark .notification-mark-all-read:hover {
    background: #1a1f26;
    color: #d1d5db;
}

body.theme-dark .notification-list {
    background: #111317;
}

body.theme-dark .notification-list::-webkit-scrollbar-track {
    background: #0f0f10;
}

body.theme-dark .notification-list::-webkit-scrollbar-thumb {
    background: #2d2d35;
}

body.theme-dark .notification-list::-webkit-scrollbar-thumb:hover {
    background: #3d3d45;
}

body.theme-dark .notification-item {
    border-bottom-color: #1f232a;
    color: #e5e7eb;
}

body.theme-dark .notification-item:hover {
    background: #1a1f26;
}

body.theme-dark .notification-item.unread {
    background: #0f1a2a;
}

body.theme-dark .notification-item.unread::before {
    background: #3b82f6;
}

body.theme-dark .notification-item.unread:hover {
    background: #1a2a3a;
}

body.theme-dark .notification-item-avatar {
    border-color: #2d2d35;
}

body.theme-dark .notification-item-avatar-fallback {
    background: #1f232a;
    color: #9ca3af;
    border-color: #2d2d35;
}

body.theme-dark .notification-item-message {
    color: #e5e7eb;
}

body.theme-dark .notification-item-content-text {
    color: #9ca3af;
}

body.theme-dark .notification-item-time {
    color: #6b7280;
}

body.theme-dark .notification-empty {
    color: #9ca3af;
}

body.theme-dark .notification-loading {
    color: #9ca3af;
}

body.theme-dark .profile-menu-item {
    color: #e5e7eb;
    border-bottom-color: #171a20;
}

body.theme-dark .profile-menu-item:hover {
    background: #1a1f26;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .header-inner.postype-header {
        grid-template-columns: auto 1fr auto !important;
        /* Allow logo to shrink if needed */
        padding: 0 24px !important;
        gap: 16px !important;
        max-width: 100% !important;
    }
}

@media (max-width: 640px) {
    .header-inner.postype-header {
        padding: 8px 12px !important;
        gap: 8px !important;
    }

    .nav-right {
        gap: 8px !important;
    }

    .logo-text {
        display: none !important;
    }

    .logo-icon {
        width: 32px !important;
        height: 32px !important;
    }

    .notification-dropdown {
        width: calc(100vw - 2rem);
        max-width: 360px;
        right: -0.5rem;
    }

    .notification-item {
        padding: 0.75rem;
    }

    .notification-item-avatar,
    .notification-item-avatar-fallback {
        width: 36px;
        height: 36px;
    }

    .notification-item-message {
        font-size: 0.8125rem;
    }
}

/* 말풍선 인용구 스타일 (Type 5, 6 - Pure CSS) - 최적화 버전 */
.editor-textarea blockquote.blockquote-type5,
.viewer-content blockquote.blockquote-type5,
.mobile-viewer-content blockquote.blockquote-type5,
blockquote[class*="blockquote-type5"] {
    background-color: #e5e5ea !important;
    color: #000 !important;
    border: none !important;
    border-left: none !important;
    border-radius: 18px !important;
    padding: 12px 20px !important;
    position: relative !important;
    margin: 1.5em 0 1.5em 10px !important;
    font-style: normal !important;
    max-width: 80% !important;
    align-self: flex-start !important;
    display: inline-block !important;
    clear: both !important;
    background-image: none !important;
    line-height: 1.5 !important;
}

/* 말풍선 내부 문단 간격 강제 초기화 */
.viewer-content blockquote[class*="blockquote-type"] p,
.editor-textarea blockquote[class*="blockquote-type"] p {
    margin: 0 !important;
    padding: 0 !important;
    line-height: inherit !important;
}

/* 받는 메시지 꼬리 (왼쪽) */
blockquote[class*="blockquote-type5"]::before,
.blockquote-type5::before {
    content: "" !important;
    position: absolute !important;
    bottom: 0 !important;
    left: -7px !important;
    width: 20px !important;
    height: 20px !important;
    background-color: #e5e5ea !important;
    border-bottom-right-radius: 15px !important;
    z-index: 0 !important;
    display: block !important;
}

blockquote[class*="blockquote-type5"]::after,
.blockquote-type5::after {
    content: "" !important;
    position: absolute !important;
    bottom: 0 !important;
    left: -10px !important;
    width: 10px !important;
    height: 20px !important;
    background-color: var(--pt-bg-color, #fff) !important;
    border-bottom-right-radius: 10px !important;
    z-index: 1 !important;
    display: block !important;
}

.editor-textarea blockquote.blockquote-type6,
.viewer-content blockquote.blockquote-type6,
.mobile-viewer-content blockquote.blockquote-type6,
blockquote[class*="blockquote-type6"] {
    background-color: #067ffe !important;
    color: #fff !important;
    border: none !important;
    border-left: none !important;
    border-radius: 18px !important;
    padding: 12px 20px !important;
    position: relative !important;
    margin: 1.5em 10px 1.5em auto !important;
    font-style: normal !important;
    max-width: 80% !important;
    align-self: flex-end !important;
    display: block !important;
    width: fit-content !important;
    background-image: none !important;
    text-align: left !important;
    overflow: visible !important;
    clear: both !important;
    line-height: 1.5 !important;
}

/* 보내는 메시지 꼬리 (오른쪽) - Quote 6 */
blockquote[class*="blockquote-type6"]::before,
.blockquote-type6::before {
    content: "" !important;
    position: absolute !important;
    bottom: 0 !important;
    right: -7px !important;
    width: 20px !important;
    height: 20px !important;
    background-color: #067ffe !important;
    border-bottom-left-radius: 15px !important;
    z-index: 0 !important;
    display: block !important;
}

blockquote[class*="blockquote-type6"]::after,
.blockquote-type6::after {
    content: "" !important;
    position: absolute !important;
    bottom: 0 !important;
    right: -10px !important;
    width: 10px !important;
    height: 20px !important;
    background-color: var(--pt-bg-color, #fff) !important;
    border-bottom-left-radius: 10px !important;
    z-index: 1 !important;
    display: block !important;
}

/* 다크모드 대응 (테마 배경색 적용) */
body.theme-dark blockquote[class*="blockquote-type5"]::after,
body.theme-dark .blockquote-type5::after,
body.theme-dark blockquote[class*="blockquote-type6"]::after,
body.theme-dark .blockquote-type6::after {
    background-color: #000 !important;
    /* view.php의 다크모드 배경색 */
}

/* PC 에디터 모달 z-index 충돌 해결 (툴바 1500보다 높게 설정) */
.overlay,
.modal,
.modal-overlay,
.publish-overlay,
#publishOverlay,
#linkOverlay,
#imageOverlay,
#youtubeOverlay,
#tableOverlay,
#msdosOverlay,
#fontUploadOverlay,
#commentOverlay,
#publishSuccessOverlay {
    z-index: 2200 !important;
}