/* 라이트/다크 모드 공통 색상 변수 */
:root {
    --page-bg-color: #f8f9fa;
    --container-bg-color: #ffffff;
    --text-color: #333333;
    --meta-text-color: #888888;
    --link-color: #007AFF;
    --border-color: #eeeeee;
    --pagination-hover-bg: #f0f0f0;
    --switch-bg: #e9e9e9;
    --note-link-color: #616161;
}

/* body.dark-mode 클래스가 있을 때 적용될 다크 모드 색상 변수 */
body.dark-mode {
    --page-bg-color: #3a3a3a;
    --container-bg-color: #2c2c2c;
    --text-color: #dddddd;
    --meta-text-color: #aaaaaa;
    --link-color: #5ac8fa;
    --border-color: #444444;
    --pagination-hover-bg: #404040;
    --switch-bg: #555;
    --note-link-color: #bdbdbd;
}

/* 공통 스타일 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    background-color: var(--page-bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

.editor-container, .container {
    max-width: 800px;
    width: 100%;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    background: var(--container-bg-color);
    position: relative;
    transition: background-color 0.3s;
}

/* 글 제목 스타일 */
.file-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 15px;
    padding: 0px 15px;
    width: 100%;
    background: transparent;
}

/* 구분선 */
.thin-line::before {
    content: "";
    display: block;
    width: 100%;
    height: 1px;
    background-color: var(--border-color);
    margin: 10px 0;
}

/* 포스트 본문(#editor) 스타일 */
#editor {
    padding: 15px;
    min-height: 250px;
    outline: none;
    font-size: 16px;
    line-height: 1.6;
}

#editor p {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

#editor a {
    color: var(--note-link-color);
    text-decoration: none;
    font-weight: 800;
    transition: all 0.2s ease-in-out;
    border-bottom: 2px solid transparent;
}

#editor a:hover {
    border-bottom: 2px solid var(--note-link-color);
    color: var(--note-link-color);
}

#editor a::before {
    content: "🔗";
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px 0;
    border-radius: 12px;
}

/* 포스트 본문 내 텍스트/하이라이트 색상 (editor.html에서 가져옴) */
span[style*="--note-text-color-1"] { color: #000000; }
body.dark-mode span[style*="--note-text-color-1"] { color: #FAFAFA; }
span[style*="--note-text-color-2"] { color: #FF3B30; }
span[style*="--note-text-color-3"] { color: #FF9500; }
span[style*="--note-text-color-4"] { color: #FFCC00; }
span[style*="--note-text-color-5"] { color: #4CD964; }
span[style*="--note-text-color-6"] { color: #5AC8FA; }
span[style*="--note-text-color-7"] { color: #007AFF; }
span[style*="--note-text-color-8"] { color: #5856D6; }

span[style*="--note-highlight-color-1"] { background-color: #FCECEC; }
span[style*="--note-highlight-color-2"] { background-color: #FFECEB; }
span[style*="--note-highlight-color-3"] { background-color: #FFF8E1; }
span[style*="--note-highlight-color-4"] { background-color: #F1FAE5; }
span[style*="--note-highlight-color-5"] { background-color: #E6F9F0; }
span[style*="--note-highlight-color-6"] { background-color: #E8F0FE; }
span[style*="--note-highlight-color-7"] { background-color: #E7F0FF; }
span[style*="--note-highlight-color-8"] { background-color: #F3E8FF; }

body.dark-mode span[style*="--note-highlight-color-1"] { background-color: hsl(0 50% 30%); }
body.dark-mode span[style*="--note-highlight-color-2"] { background-color: hsl(30 50% 30%); }
body.dark-mode span[style*="--note-highlight-color-3"] { background-color: hsl(45 50% 30%); }
body.dark-mode span[style*="--note-highlight-color-4"] { background-color: hsl(120 50% 30%); }
body.dark-mode span[style*="--note-highlight-color-5"] { background-color: hsl(240 70% 40%); }
body.dark-mode span[style*="--note-highlight-color-6"] { background-color: hsl(300 70% 40%); }
body.dark-mode span[style*="--note-highlight-color-7"] { background-color: hsl(240 50% 30%); }
body.dark-mode span[style*="--note-highlight-color-8"] { background-color: hsl(330 50% 30%); }

footer {
    text-align: center;
    margin-top: 20px;
    color: var(--meta-text-color);
}