/* Base reset + tokens + theme overrides */
:root {
    --main-purple: #8572EE;
    --header-height: 64px;
    --rank-icon-start: #8a7cf6;
    --rank-icon-end: #b9a9ff;
    --success-green: #2ecc71;
    --border-gray: #e5e5e5;
    --text-gray: #888;
    --text-primary: #222;
    --icon-color: #555;
    --background-white: #fff;
    --background-page: #f4f4f4;
    --background-dim: rgba(0, 0, 0, 0.5);
    --purple-hover: rgba(133, 114, 238, 0.06);
    --text-read: #a0a0a0; /* 라이트 모드 읽은 글 제목 색상 변경 */
    --notice-bg: #EDEBFE; /* 라이트 모드 공지사항 배경 색상 변경 */
    --content-font-scale: 1; /* 본문 및 목록 폰트 스케일 (헤더 제외) */
    /* Let UA widgets adapt to theme */
    color-scheme: light dark;
}
/* Support early-boot class on <html> for FOIT prevention */
:root.dark-mode,
body.dark-mode {
    --border-gray: #2f2f34;
    --text-gray: #a7a7ad;
    --text-primary: #e6e6e9;
    --icon-color: #bdbdc2;
    --background-white: #17181c;
    --background-page: #0f1115;
    --purple-hover: rgba(133, 114, 238, 0.14);
    --rank-icon-start: #b9a9ff;
    --rank-icon-end: #ded6ff;
    --success-green: #27ae60;
    --text-read: #8a8a8a; /* 다크 모드 읽은 글 제목 색상 변경 */
    --notice-bg: #2D2B4A; /* 다크 모드 공지사항 배경 색상 변경 */
    color-scheme: dark;
}
* { margin: 0; padding: 0; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
/* Smooth theme transitions (colors only) */
*, *::before, *::after {
    transition: background-color 0.24s ease, color 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
input, textarea, select { font-size: 16px; }
body { background-color: var(--background-page); }
body.modal-open { overflow: hidden; }
/* iOS: 더블탭 확대 방지 (상호작용 요소) */
a, button { touch-action: manipulation; }
/* Sidebar open 시 배경 스크롤 잠금(모바일 Safar 포함 고정) */
body.sidebar-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}
