@charset "UTF-8";

/* ==========================================================================
   1. CSS 변수 (디자인 토큰)
   ========================================================================== */
:root {
  /* === 색상 팔레트 === */
  --color-primary: #6C63FF;
  --color-primary-light: #8B83FF;
  --color-primary-dark: #5A52E0;
  
  --color-korean: #FF6B6B;
  --color-korean-light: #FF8E8E;
  --color-math: #4ECDC4;
  --color-math-light: #7EDDD7;
  --color-english: #45B7D1;
  --color-english-light: #74CCE0;
  --color-science: #96CEB4;
  --color-science-light: #B5DFCC;
  --color-social: #FFD93D;
  --color-social-light: #FFE474;
  --color-tools: #DDA0DD;
  --color-tools-light: #E8BFE8;
  --color-parent: #FF8C42;
  --color-parent-light: #FFA76E;
  
  --color-success: #27AE60;
  --color-danger: #E74C3C;
  --color-warning: #F39C12;
  --color-info: #3498DB;
  
  --color-bg: #F5F7FB;
  --color-bg-card: #FFFFFF;
  --color-bg-header: #FFFFFF;
  --color-text: #2D3436;
  --color-text-secondary: #636E72;
  --color-text-muted: #B2BEC3;
  --color-border: #E8ECF1;
  --color-shadow: rgba(0, 0, 0, 0.08);
  --color-shadow-hover: rgba(0, 0, 0, 0.12);
  --color-overlay: rgba(0, 0, 0, 0.5);
  
  /* === 타이포그래피 === */
  --font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-size-xs: 12px;
  --font-size-sm: 14px;
  --font-size-base: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 22px;
  --font-size-2xl: 28px;
  --font-size-3xl: 36px;
  
  /* === 간격 === */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  
  /* === 둥근 모서리 === */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 50%;
  
  /* === 그림자 === */
  --shadow-sm: 0 2px 8px var(--color-shadow);
  --shadow-md: 0 4px 20px var(--color-shadow);
  --shadow-lg: 0 8px 30px var(--color-shadow-hover);
  --shadow-xl: 0 12px 40px var(--color-shadow-hover);
  
  /* === 전환 === */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  /* === 레이아웃 === */
  --header-height: 64px;
  --sidebar-width: 220px;
  --bottom-nav-height: 64px;
  --content-max-width: 1200px;
  --ad-bottom-height: 60px;
}

/* 다크모드 변수 적용 */


/* 다크모드 시스템 설정 감지 */


/* 글자 크기 옵션 */
:root[data-fontsize="small"] { 
  --font-size-base: 14px !important; 
  --font-size-lg: 16px !important; 
  --font-size-xl: 20px !important; 
  --font-size-2xl: 24px !important; 
  --font-size-3xl: 32px !important;
}
:root[data-fontsize="large"] { 
  --font-size-base: 20px !important; 
  --font-size-lg: 24px !important; 
  --font-size-xl: 32px !important; 
  --font-size-2xl: 40px !important; 
  --font-size-3xl: 56px !important;
}

/* ==========================================================================
   2. 리셋 및 기본 스타일
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 선택 영역 스타일 */
::selection {
  background-color: var(--color-primary-light);
  color: #fff;
}

/* 스크롤바 커스터마이징 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--color-text-muted);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-secondary);
}

/* 접근성 링 */
*:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}



/* ==========================================================================
   3. 유틸리티 클래스
   ========================================================================== */
.hidden { display: none !important; }
.visible { display: block; }

/* 텍스트 정렬 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* 텍스트 크기 */
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }

/* 텍스트 색상 */
.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }
.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-info { color: var(--color-info); }

/* 폰트 두께 */
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }

/* 마진 (margin) */
.mt-1 { margin-top: var(--space-2); }
.mt-2 { margin-top: var(--space-3); }
.mt-3 { margin-top: var(--space-4); }
.mt-4 { margin-top: var(--space-5); }

.mb-1 { margin-bottom: var(--space-2); }
.mb-2 { margin-bottom: var(--space-3); }
.mb-3 { margin-bottom: var(--space-4); }
.mb-4 { margin-bottom: var(--space-5); }
.mb-5 { margin-bottom: var(--space-6); }

.ml-1 { margin-left: var(--space-2); }
.ml-2 { margin-left: var(--space-3); }

.mr-1 { margin-right: var(--space-2); }
.mr-2 { margin-right: var(--space-3); }

.mx-auto { margin-left: auto; margin-right: auto; }

/* 패딩 (padding) */
.p-1 { padding: var(--space-2); }
.p-2 { padding: var(--space-3); }
.p-3 { padding: var(--space-4); }
.p-4 { padding: var(--space-5); }
.py-2 { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.px-2 { padding-left: var(--space-3); padding-right: var(--space-3); }

/* 디스플레이 (Flex / Grid) */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-column { display: flex; flex-direction: column; }
.flex-wrap { display: flex; flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }

.gap-1 { gap: var(--space-2); }
.gap-2 { gap: var(--space-3); }
.gap-3 { gap: var(--space-4); }
.gap-4 { gap: var(--space-5); }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* 시각적 유틸 */
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }
.shadow { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }

.divider {
  height: 1px;
  background-color: var(--color-border);
  margin: var(--space-4) 0;
  width: 100%;
}

.container {
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* 배지 & 태그 */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 700;
  background-color: var(--color-border);
  color: var(--color-text-secondary);
}
.badge-primary { background-color: var(--color-primary); color: white; }
.badge-success { background-color: var(--color-success); color: white; }
.badge-warning { background-color: var(--color-warning); color: white; }
.badge-new { background-color: var(--color-danger); color: white; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  background-color: var(--color-bg);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 500;
}

/* 빈 상태 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-7) var(--space-4);
  text-align: center;
  color: var(--color-text-muted);
}
.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--space-3);
}

/* ==========================================================================
