/* ============================================================
   반월고 3학년 6반 커뮤니티 - 메인 스타일시트
   Primary: #03C75A (네이버 그린)
   ============================================================ */

/* ── CSS 변수 (라이트/다크 모드) ──────────────────────────── */
:root {
  --primary: #03C75A;
  --primary-dark: #02a44c;
  --primary-light: #e8f9ef;
  --primary-hover: #02b350;

  --bg-main: #F5F6F7;
  --bg-card: #FFFFFF;
  --bg-sidebar: #FFFFFF;
  --bg-header: #FFFFFF;
  --bg-input: #FFFFFF;
  --bg-hover: #f8f9fa;
  --bg-code: #f4f4f4;

  --text-primary: #222222;
  --text-secondary: #666666;
  --text-muted: #999999;
  --text-placeholder: #aaaaaa;

  --border-color: #e5e8eb;
  --border-light: #f0f2f4;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.12);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.16);

  --danger: #ff4040;
  --warning: #ff9800;
  --info: #2196f3;
  --success: #03C75A;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  --header-height: 56px;
  --sidebar-width: 220px;
  --content-max: 1100px;

  --transition: all 0.2s ease;
  --font-main: -apple-system, 'Malgun Gothic', '맑은 고딕', sans-serif;
}

/* 다크모드 */
[data-theme="dark"] {
  --bg-main: #1a1a1a;
  --bg-card: #252525;
  --bg-sidebar: #252525;
  --bg-header: #1f1f1f;
  --bg-input: #2e2e2e;
  --bg-hover: #2e2e2e;
  --bg-code: #333333;

  --text-primary: #e8e8e8;
  --text-secondary: #aaaaaa;
  --text-muted: #777777;
  --text-placeholder: #666666;

  --border-color: #3a3a3a;
  --border-light: #2e2e2e;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.5);
}

/* ── 기본 리셋 ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  outline: none;
}
img { max-width: 100%; height: auto; }
ul, ol { list-style: none; }

/* ── 로딩 스크린 ───────────────────────────────────────────── */
.loading-screen {
  position: fixed; inset: 0;
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.loading-content { text-align: center; }
.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}
.loading-text { color: var(--text-secondary); font-size: 13px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 헤더 ──────────────────────────────────────────────────── */
#header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  height: 100%;
  display: flex; align-items: center; gap: 16px;
  padding: 0 16px;
}
.header-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 18px; font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
}
.header-logo span { color: var(--text-primary); font-size: 13px; font-weight: 500; }
.header-nav {
  display: flex; align-items: center; gap: 2px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.header-nav::-webkit-scrollbar { display: none; }
.header-nav-item {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: var(--transition);
}
.header-nav-item:hover, .header-nav-item.active {
  color: var(--primary);
  background: var(--primary-light);
}
.header-actions {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.btn-header {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  transition: var(--transition);
}
.btn-login {
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.btn-login:hover { border-color: var(--primary); color: var(--primary); }
.btn-register {
  background: var(--primary);
  color: white;
}
.btn-register:hover { background: var(--primary-hover); }
.btn-user-menu {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 13px; color: var(--text-primary);
}
.btn-user-menu:hover { border-color: var(--primary); }
.user-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.btn-theme {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 15px;
  transition: var(--transition);
}
.btn-theme:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ── 메인 레이아웃 ─────────────────────────────────────────── */
#main-wrapper {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: calc(var(--header-height) + 16px) 16px 80px;
  display: flex; gap: 16px;
}
#sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--header-height) + 16px);
  height: fit-content;
  max-height: calc(100vh - var(--header-height) - 32px);
  overflow-y: auto;
}
#content { flex: 1; min-width: 0; }

/* ── 사이드바 ───────────────────────────────────────────────── */
.sidebar-section {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  overflow: hidden;
}
.sidebar-title {
  padding: 12px 16px;
  font-size: 12px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-light);
}
.sidebar-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  border-left: 3px solid transparent;
  transition: var(--transition);
  cursor: pointer;
}
.sidebar-nav-item:hover { color: var(--primary); background: var(--primary-light); }
.sidebar-nav-item.active {
  color: var(--primary);
  background: var(--primary-light);
  border-left-color: var(--primary);
}
.sidebar-nav-item i { width: 16px; text-align: center; font-size: 13px; }

/* ── 카드 ────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}
.card-title {
  font-size: 15px; font-weight: 700;
  color: var(--text-primary);
}
.card + .card { margin-top: 12px; }

/* ── 게시글 목록 (네이버 카페 스타일) ─────────────────────── */
.post-list { }
.post-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition);
}
.post-item:last-child { border-bottom: none; }
.post-item:hover { background: var(--bg-hover); margin: 0 -16px; padding: 12px 16px; }
.post-item-category {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
}
.post-item-title {
  flex: 1;
  font-size: 13px; font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.post-item-title .new-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  background: var(--danger);
  color: white;
  border-radius: var(--radius-full);
  font-size: 10px; font-weight: 700;
}
.post-item-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--text-muted);
  flex-shrink: 0;
}
.post-item-meta span { display: flex; align-items: center; gap: 3px; }

/* ── 버튼 ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; border: 1px solid var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-danger { background: var(--danger); color: white; border: 1px solid var(--danger); }
.btn-danger:hover { background: #cc0000; }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-color); }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 24px; font-size: 15px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── 입력 폼 ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px; font-weight: 600;
  color: var(--text-primary);
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  transition: var(--transition);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(3,199,90,0.1);
}
.form-textarea { resize: vertical; min-height: 100px; line-height: 1.6; }
.form-hint { margin-top: 4px; font-size: 12px; color: var(--text-muted); }
.form-error { margin-top: 4px; font-size: 12px; color: var(--danger); }

/* ── 배지 ────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600;
}
.badge-student { background: #e8f4fd; color: #1565c0; }
.badge-student_admin { background: #e8f9ef; color: #1b5e20; }
.badge-teacher_admin { background: #fff8e1; color: #e65100; }
.badge-dev_admin { background: #fce4ec; color: #880e4f; }
.badge-dev_student { background: #ede7f6; color: #4527a0; }
.badge-super_admin { background: linear-gradient(135deg, #03C75A, #00a8cc); color: white; }
.badge-pending { background: #fff3e0; color: #e65100; }
.badge-suspended { background: #ffebee; color: #c62828; }
.badge-approved { background: #e8f9ef; color: #2e7d32; }

/* ── 탭 ─────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 16px;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-item {
  padding: 10px 16px;
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: var(--transition);
  cursor: pointer;
}
.tab-item:hover { color: var(--primary); }
.tab-item.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── 페이지 헤더 ────────────────────────────────────────────── */
.page-header {
  margin-bottom: 16px;
}
.page-title {
  font-size: 18px; font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── 토스트 ─────────────────────────────────────────────────── */
#toast-container {
  position: fixed; top: calc(var(--header-height) + 12px); right: 16px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  min-width: 240px; max-width: 360px;
  font-size: 13px;
  animation: slideIn 0.3s ease;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info { border-left: 3px solid var(--info); }
.toast-icon { font-size: 15px; flex-shrink: 0; }
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--info); }
.toast-msg { flex: 1; color: var(--text-primary); }
.toast-close { color: var(--text-muted); font-size: 13px; cursor: pointer; flex-shrink: 0; }
.toast-close:hover { color: var(--text-primary); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ── 모달 ────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}
.modal-lg { max-width: 640px; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 16px;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-body { padding: 20px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
}

/* ── 공개 홈페이지 영역 ────────────────────────────────────── */
.hero-section {
  background: linear-gradient(135deg, var(--primary) 0%, #00a8cc 100%);
  color: white;
  padding: 48px 24px;
  border-radius: var(--radius-xl);
  text-align: center;
  margin-bottom: 20px;
}
.hero-title {
  font-size: 26px; font-weight: 900;
  margin-bottom: 8px;
  line-height: 1.3;
}
.hero-subtitle {
  font-size: 14px; opacity: 0.9;
  margin-bottom: 24px;
}
.hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn-hero-primary {
  background: white; color: var(--primary);
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-size: 14px; font-weight: 700;
  transition: var(--transition);
}
.btn-hero-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.btn-hero-outline {
  background: transparent; color: white;
  border: 2px solid rgba(255,255,255,0.7);
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-size: 14px; font-weight: 700;
  transition: var(--transition);
}
.btn-hero-outline:hover { background: rgba(255,255,255,0.1); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.feature-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.feature-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin: 0 auto 10px;
}
.feature-name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.feature-desc { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* ── 공지사항 스타일 ──────────────────────────────────────── */
.notice-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
}
.notice-item:last-child { border-bottom: none; }
.notice-pin { color: var(--danger); font-size: 12px; flex-shrink: 0; margin-top: 2px; }
.notice-title { font-size: 13px; font-weight: 500; color: var(--text-primary); flex: 1; }
.notice-title:hover { color: var(--primary); }
.notice-date { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.notice-badge {
  display: inline-block; padding: 1px 6px;
  background: #e8f9ef; color: var(--primary);
  border-radius: var(--radius-full); font-size: 10px; font-weight: 700;
  margin-right: 6px; flex-shrink: 0;
}
.notice-public-badge {
  background: #fff3cd; color: #856404;
}

/* ── 로그인/회원가입 페이지 ───────────────────────────────── */
.auth-container {
  min-height: calc(100vh - var(--header-height));
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.auth-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-md);
}
.auth-logo {
  text-align: center;
  margin-bottom: 24px;
}
.auth-logo-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-lg);
  background: var(--primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; margin: 0 auto 10px;
}
.auth-logo-title { font-size: 18px; font-weight: 800; color: var(--text-primary); }
.auth-logo-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0;
}
.auth-divider hr { flex: 1; border: none; border-top: 1px solid var(--border-color); }
.auth-divider span { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}
.auth-switch a { color: var(--primary); font-weight: 600; cursor: pointer; }
.auth-switch a:hover { text-decoration: underline; }

/* ── 공부 타이머 ──────────────────────────────────────────── */
.timer-display {
  font-size: 56px; font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  text-align: center;
  letter-spacing: -2px;
  line-height: 1;
  margin: 16px 0;
}
.timer-display.running { color: var(--primary); }
.timer-display.warning { color: var(--warning); }
.timer-progress {
  height: 6px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 8px 0 16px;
}
.timer-progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width 1s linear;
}
.subject-select-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.subject-btn {
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 12px; font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}
.subject-btn.selected {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}

/* ── 랭킹 ───────────────────────────────────────────────────── */
.ranking-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.ranking-item:last-child { border-bottom: none; }
.rank-number {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
  flex-shrink: 0;
}
.rank-1 { background: #FFD700; color: #7a5a00; }
.rank-2 { background: #C0C0C0; color: #555; }
.rank-3 { background: #CD7F32; color: #fff; }
.rank-other { background: var(--border-color); color: var(--text-secondary); font-size: 12px; }
.rank-name { flex: 1; font-size: 13px; font-weight: 600; }
.rank-time { font-size: 13px; font-weight: 700; color: var(--primary); }
.rank-student-num { font-size: 11px; color: var(--text-muted); }

/* ── 갤러리 그리드 ──────────────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.gallery-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-hover);
}
.gallery-item:hover { transform: scale(1.02); box-shadow: var(--shadow-md); }
.gallery-thumb {
  width: 100%; aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.gallery-thumb-placeholder {
  width: 100%; aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-hover);
  color: var(--text-muted);
  font-size: 32px;
}
.gallery-info { padding: 8px; }
.gallery-title { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery-date { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── 이벤트/타임라인 ───────────────────────────────────────── */
.timeline-event {
  display: flex; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.timeline-event:last-child { border-bottom: none; }
.event-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.event-body { flex: 1; }
.event-title { font-size: 13px; font-weight: 600; }
.event-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── 관리자 대시보드 ─────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
}
.stat-value { font-size: 26px; font-weight: 900; color: var(--primary); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── 집중 체크 오버레이 ────────────────────────────────────── */
.focus-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.focus-overlay.hidden { display: none; }
.focus-box {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  text-align: center;
  max-width: 320px; width: 100%;
  box-shadow: var(--shadow-lg);
}
.focus-emoji { font-size: 52px; margin-bottom: 12px; }
.focus-title { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.focus-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.focus-timer { font-size: 36px; font-weight: 900; color: var(--danger); margin-bottom: 20px; font-variant-numeric: tabular-nums; }

/* ── 페이지네이션 ────────────────────────────────────────── */
.pagination {
  display: flex; justify-content: center; align-items: center; gap: 4px;
  margin-top: 20px;
}
.page-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  cursor: pointer;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: white; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── 공개 섹션 구분선 ───────────────────────────────────── */
.section-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 24px 0 16px;
}
.section-divider-title {
  font-size: 15px; font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
}
.section-divider-line { flex: 1; border-top: 1px solid var(--border-color); }
.section-more {
  font-size: 12px; color: var(--text-muted);
  white-space: nowrap; cursor: pointer;
}
.section-more:hover { color: var(--primary); }

/* ── 모바일 바텀 내비게이션 ─────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 60px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  z-index: 900;
}
.mobile-nav-inner {
  display: flex; height: 100%;
}
.mobile-nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  font-size: 10px; font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.mobile-nav-item.active { color: var(--primary); }
.mobile-nav-item i { font-size: 18px; }

/* ── 스크롤바 ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── 유틸리티 ────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-primary-color { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.fw-bold { font-weight: 700; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.w-full { width: 100%; }
.divider { border: none; border-top: 1px solid var(--border-light); margin: 12px 0; }
.skeleton {
  background: linear-gradient(90deg, var(--border-color) 25%, var(--border-light) 50%, var(--border-color) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
}
.empty-state i { font-size: 40px; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 14px; }

/* ── 댓글 ────────────────────────────────────────────────── */
.comment-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.comment-item:last-child { border-bottom: none; }
.comment-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.comment-author { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.comment-date { font-size: 11px; color: var(--text-muted); }
.comment-body { font-size: 13px; color: var(--text-primary); line-height: 1.6; }
.comment-reply { margin-left: 24px; margin-top: 8px; border-left: 2px solid var(--border-color); padding-left: 12px; }

/* ── 반응형 ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  #sidebar { display: none; }
  #main-wrapper { padding-bottom: 70px; gap: 0; }
  .mobile-nav { display: block; }
  .hero-title { font-size: 20px; }
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .header-nav { display: none; }
  .auth-box { padding: 24px 20px; }
}

@media (max-width: 480px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .timer-display { font-size: 44px; }
}

/* ── 게시글 본문 ────────────────────────────────────────── */
.post-content {
  font-size: 14px; line-height: 1.8;
  color: var(--text-primary);
  white-space: pre-wrap; word-break: break-all;
}
.post-content a { color: var(--primary); text-decoration: underline; }

/* ── 프로필 ──────────────────────────────────────────────── */
.profile-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0;
}
.profile-avatar-lg {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800;
  flex-shrink: 0;
}
.profile-name { font-size: 14px; font-weight: 700; }
.profile-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── 개발자 크레딧 ──────────────────────────────────────── */
.credit-card {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: white;
  border-radius: var(--radius-xl);
  padding: 20px;
  text-align: center;
}
.credit-badge {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px; font-weight: 700;
  margin-bottom: 8px;
}
.credit-name { font-size: 20px; font-weight: 800; }
.credit-number { font-size: 13px; opacity: 0.7; margin-top: 4px; }
.credit-desc { font-size: 12px; opacity: 0.6; margin-top: 8px; }

/* ── 학습 메모 ──────────────────────────────────────────── */
.memo-box {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 13px; line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

/* ── 인증 컴포넌트 ───────────────────────────────────────── */
.guard-message {
  text-align: center;
  padding: 48px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
}
.guard-icon { font-size: 48px; margin-bottom: 16px; color: var(--text-muted); }
.guard-title { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.guard-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
