/* 다크 모드에서 prose 콘텐츠 스타일 */

/* 기본 텍스트 색상 - 가장 높은 우선순위로 설정 */
.dark .prose,
.dark .prose.dark\:prose-invert,
.dark .dark\:prose-invert {
    color: rgb(243 244 246) !important; /* gray-100 */
}

/* 직접 텍스트 노드가 있는 div에 적용 */
.dark div.prose,
.dark div[class*="prose"] {
    color: rgb(243 244 246) !important; /* gray-100 */
}

/* 모든 텍스트 요소 오버라이드 */
.dark .prose p,
.dark .prose div,
.dark .prose span:not(.sir-emoji),
.dark .prose li,
.dark .prose td,
.dark .prose th,
.dark .prose dd,
.dark .prose dt {
    color: rgb(243 244 246) !important; /* gray-100 */
}

/* 제목 요소 */
.dark .prose h1,
.dark .prose h2,
.dark .prose h3,
.dark .prose h4,
.dark .prose h5,
.dark .prose h6 {
    color: rgb(255 255 255) !important; /* white */
}

/* 링크 */
.dark .prose a {
    color: rgb(96 165 250) !important; /* blue-400 */
}

.dark .prose a:hover {
    color: rgb(147 197 253) !important; /* blue-300 */
}

/* 강조 텍스트 */
.dark .prose strong,
.dark .prose b {
    color: rgb(255 255 255) !important; /* white */
    font-weight: bold !important;
}

.dark .prose em,
.dark .prose i {
    color: rgb(243 244 246) !important; /* gray-100 */
}

/* 인용구 */
.dark .prose blockquote {
    color: rgb(209 213 219) !important; /* gray-300 */
    border-left-color: rgb(75 85 99) !important; /* gray-600 */
    background-color: rgb(31 41 55) !important; /* gray-800 */
    padding: 1rem !important;
}

/* 코드 */
.dark .prose code {
    color: rgb(251 191 36) !important; /* amber-400 */
    background-color: rgb(31 41 55) !important; /* gray-800 */
    padding: 0.125rem 0.25rem !important;
    border-radius: 0.25rem !important;
}

.dark .prose pre {
    color: rgb(209 213 219) !important; /* gray-300 */
    background-color: rgb(31 41 55) !important; /* gray-800 */
    padding: 1rem !important;
    border-radius: 0.5rem !important;
}

.dark .prose pre code {
    background-color: transparent !important;
    padding: 0 !important;
}

/* 테이블 */
.dark .prose table {
    color: rgb(243 244 246) !important; /* gray-100 */
}

.dark .prose thead {
    border-bottom-color: rgb(75 85 99) !important; /* gray-600 */
}

.dark .prose tbody tr {
    border-bottom-color: rgb(55 65 81) !important; /* gray-700 */
}

.dark .prose th {
    color: rgb(255 255 255) !important; /* white */
    background-color: rgb(31 41 55) !important; /* gray-800 */
}

.dark .prose td {
    color: rgb(243 244 246) !important; /* gray-100 */
}

/* 리스트 */
.dark .prose ul,
.dark .prose ol {
    color: rgb(243 244 246) !important; /* gray-100 */
}

.dark .prose li {
    color: rgb(243 244 246) !important; /* gray-100 */
}

.dark .prose li::marker {
    color: rgb(156 163 175) !important; /* gray-400 */
}

/* 구분선 */
.dark .prose hr {
    border-color: rgb(55 65 81) !important; /* gray-700 */
}

/* 인라인 스타일 오버라이드 - CKEditor가 생성한 검은색 텍스트 */
.dark .prose [style*="color: rgb(0, 0, 0)"],
.dark .prose [style*="color: black"],
.dark .prose [style*="color:#000000"],
.dark .prose [style*="color:#000"],
.dark .prose [style*="color: #000"],
.dark .prose [style*="color:rgb(0,0,0)"] {
    color: rgb(243 244 246) !important; /* gray-100 */
}

/* 흰색 배경 오버라이드 */
.dark .prose [style*="background-color: rgb(255, 255, 255)"],
.dark .prose [style*="background-color: white"],
.dark .prose [style*="background-color:#ffffff"],
.dark .prose [style*="background-color:#fff"],
.dark .prose [style*="background-color: #fff"],
.dark .prose [style*="background-color:rgb(255,255,255)"] {
    background-color: rgb(31 41 55) !important; /* gray-800 */
}

/* 이모지는 색상 변경 제외 */
.dark .prose .sir-emoji {
    color: initial !important;
    filter: none !important;
}

/* 이미지 */
.dark .prose img:not(.sir-emoji) {
    opacity: 0.9;
}

/* 비디오, iframe */
.dark .prose video,
.dark .prose iframe {
    opacity: 0.9;
}

/* CKEditor로 생성된 특수한 케이스 처리 */
.dark .prose br + *,
.dark .prose br ~ * {
    color: inherit !important;
}

/* 텍스트 노드 직접 처리를 위한 추가 규칙 */
.dark .prose {
    /* 텍스트 노드에 직접 색상 적용 */
    color: rgb(243 244 246) !important;
}

/* prose 클래스가 있는 모든 요소의 직접 텍스트 */
.dark [class*="prose"] {
    color: rgb(243 244 246) !important;
}