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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 리치 텍스트 에디터 스타일 */
[contenteditable="true"] {
  outline: none;
}

[contenteditable="true"]:focus {
  border-color: #4f46e5;
}

/* 에디터 기본 텍스트 색상 (검은색) */
#page-editor {
  color: #000000;
}

/* 에디터 내부의 모든 일반 텍스트는 검은색 */
#page-editor * {
  color: inherit;
}

/* 대화상자, 나레이션 박스는 흰색 유지 */
#page-editor .dialogue-box,
#page-editor .narration-box {
  color: white !important;
}

#page-editor .dialogue-box *,
#page-editor .narration-box * {
  color: white !important;
}

/* 혼자 생각 박스는 검은색 */
#page-editor .thought-box {
  color: #000000 !important;
}

#page-editor .thought-box * {
  color: #000000 !important;
}

/* 미리보기에서 복구 버튼(X) 숨기기 */
.prose .dialogue-box button,
.prose .thought-box button,
.prose .narration-box button {
  display: none !important;
}

/* 대화상자와 나레이션의 텍스트는 흰색으로 강제 (에디터에서도) */
#page-editor .dialogue-box div[contenteditable="true"],
#page-editor .dialogue-box div[contenteditable="true"] *,
#page-editor .narration-box div[contenteditable="true"],
#page-editor .narration-box div[contenteditable="true"] * {
  color: white !important;
}

/* 에디터의 대화상자와 나레이션 모든 텍스트 흰색 */
#page-editor .dialogue-box,
#page-editor .dialogue-box *,
#page-editor .narration-box,
#page-editor .narration-box * {
  color: white !important;
}

/* 미리보기(뷰어)에서도 대화상자와 나레이션은 흰색 - 최우선 */
.prose .dialogue-box,
.prose .dialogue-box div,
.prose .dialogue-box span,
.prose .dialogue-box *,
.prose .narration-box,
.prose .narration-box div,
.prose .narration-box span,
.prose .narration-box * {
  color: white !important;
}

/* 프로스 스타일 (e북 뷰어) */
.prose {
  color: #374151;
  line-height: 1.75;
}

.prose p {
  margin-bottom: 1.25em;
}

.prose h1 {
  font-size: 2.25em;
  margin-top: 0;
  margin-bottom: 0.8888889em;
  font-weight: 800;
  line-height: 1.1111111;
}

.prose h2 {
  font-size: 1.5em;
  margin-top: 2em;
  margin-bottom: 1em;
  font-weight: 700;
  line-height: 1.3333333;
}

.prose h3 {
  font-size: 1.25em;
  margin-top: 1.6em;
  margin-bottom: 0.6em;
  font-weight: 600;
  line-height: 1.6;
}

.prose ul, .prose ol {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
  padding-left: 1.625em;
}

.prose li {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

.prose img {
  margin-top: 2em;
  margin-bottom: 2em;
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

.prose a {
  color: #4f46e5;
  text-decoration: underline;
  font-weight: 500;
}

.prose strong {
  font-weight: 600;
  color: #111827;
}

.prose em {
  font-style: italic;
}

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

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* 애니메이션 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

/* 보안: 개발자 도구 경고 (콘솔) */
console.log('%c⚠️ 경고!', 'color: red; font-size: 40px; font-weight: bold;');
console.log('%c이 콘솔 창을 사용하여 악의적인 코드를 실행하지 마세요. 보안에 위험할 수 있습니다.', 'font-size: 20px;');
