/* 기본 설정 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-color: #fafafa;
  --content-bg: #ffffff;
  --text-color: #202122;
  --text-secondary: #54595d;
  --header-bg: #ffffff;
  --header-border: #e8e8e8;
  --sidebar-bg: #ffffff;
  --border-color: #e8e8e8;
  --link-color: #0645ad;
  --link-hover: #0b0080;
  --hover-bg: #f8f9fa;
  --code-bg: #f6f8fa;
  --code-border: #e8e8e8;
}

body.dark-mode {
  --bg-color: #0d1117;
  --content-bg: #0d1117;
  --text-color: #e6edf3;
  --text-secondary: #8b949e;
  --header-bg: #161b22;
  --header-border: #30363d;
  --sidebar-bg: #0d1117;
  --border-color: #30363d;
  --link-color: #4493f8;
  --link-hover: #79c0ff;
  --hover-bg: #161b22;
  --code-bg: #161b22;
  --code-border: #30363d;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-color);
  background-color: var(--bg-color);
  transition: background-color 0.3s, color 0.3s;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 헤더 */
.header {
  background-color: var(--header-bg);
  color: var(--text-color);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--header-border);
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.95);
}

body.dark-mode .header {
  background-color: rgba(22, 27, 34, 0.95);
}

.header-content {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 48px; /* 헤더 높이 고정으로 정렬 보장 */
  max-width: 100%;
  overflow-x: auto;
}

.logo a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.search-box {
  flex: 1;
  max-width: 500px;
  position: relative;
}

.search-box form {
  display: flex;
  gap: 5px;
}

.search-box input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  background-color: var(--content-bg);
  color: var(--text-color);
  transition: border-color 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--link-color);
}

.search-box button {
  padding: 8px 15px;
  border: 1px solid var(--border-color);
  background-color: var(--content-bg);
  color: var(--text-color);
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.search-box button:hover {
  background-color: var(--hover-bg);
}

.theme-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  font-size: 20px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-btn:hover {
  background-color: var(--hover-bg);
}

/* 로그인 버튼 스타일 */
.login-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  font-size: 16px;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  cursor: pointer;
}

.login-btn:hover {
  background-color: var(--hover-bg);
}

/* 메인 레이아웃 */
.main-wrapper {
  display: grid;
  grid-template-columns: 250px minmax(0, 900px) 250px;
  gap: 20px;
  max-width: 1400px;
  margin: 20px auto;
  padding: 0 20px;
}

/* 사이드바 */
.sidebar {
  background-color: transparent;
  padding: 20px 15px;
  height: fit-content;
  position: sticky;
  top: 80px;
}

.sidebar h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.sidebar ul {
  list-style: none;
  margin-bottom: 24px;
}

.sidebar li {
  margin: 4px 0;
}

.sidebar a {
  color: var(--text-color);
  text-decoration: none;
  display: block;
  padding: 6px 10px;
  border-radius: 4px;
  transition: background-color 0.2s;
  font-size: 14px;
}

.sidebar a:hover {
  background-color: var(--hover-bg);
  color: var(--link-color);
}

.sidebar .tag-list {
  list-style: none;
  margin-bottom: 16px;
}

.sidebar .tag-list li {
  margin: 6px 0;
}

.sidebar .tag-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 10px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.sidebar .tag-link:hover {
  background-color: var(--hover-bg);
}

.sidebar .tag-name {
  color: var(--text-color);
  font-size: 14px;
}

.sidebar .tag-count {
  color: var(--text-secondary);
  font-size: 12px;
}

.sidebar .view-all-tags {
  padding: 0 10px;
  margin-top: 8px;
}

.sidebar .view-all-tags a {
  color: var(--link-color);
  font-size: 13px;
  text-decoration: none;
  padding: 0;
}

.sidebar .view-all-tags a:hover {
  text-decoration: underline;
  background: none;
}

/* 메인 콘텐츠 */
.content {
  background-color: var(--content-bg);
  padding: 40px 50px;
  border-radius: 0;
  border: 1px solid var(--border-color);
  min-height: 600px;
}

.wiki-article h1 {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 8px;
  padding-bottom: 0;
  border-bottom: none;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.article-meta {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  color: var(--text-secondary);
}

.wiki-article h2 {
  font-size: 24px;
  font-weight: 600;
  margin-top: 40px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  border-left: none;
  padding-left: 0;
  letter-spacing: -0.02em;
}

.wiki-article h3 {
  font-size: 20px;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.wiki-article h4 {
  font-size: 17px;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 10px;
}

.wiki-article p {
  margin: 16px 0;
  line-height: 1.7;
}

.wiki-article a {
  color: var(--link-color);
  text-decoration: none;
}

.wiki-article a:hover {
  text-decoration: underline;
  color: var(--link-hover);
}

.wiki-article ul, .wiki-article ol {
  margin: 16px 0;
  padding-left: 32px;
}

.wiki-article li {
  margin: 6px 0;
}

/* 중첩된 리스트 간격 조정 */
.wiki-article li > ul,
.wiki-article li > ol {
  margin: 4px 0;
  padding-left: 24px;
}

.wiki-article li li {
  margin: 2px 0;
}

.wiki-article code {
  background-color: var(--code-bg);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--code-border);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Courier New', monospace;
  font-size: 0.875em;
}

.wiki-article pre {
  background-color: var(--code-bg);
  padding: 16px;
  border-radius: 6px;
  border: 1px solid var(--code-border);
  overflow-x: auto;
  margin: 16px 0;
}

.wiki-article pre code {
  background: none;
  border: none;
  padding: 0;
}

.wiki-article img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 15px 0;
  border-radius: 4px;
}

.wiki-article video {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 15px 0;
  border-radius: 4px;
}

.wiki-article table {
  max-width: 100%;
  overflow-x: auto;
  display: block;
}

/* 목차 */
.toc {
  background-color: transparent;
  padding: 20px 15px;
  height: fit-content;
  position: sticky;
  top: 80px;
}

.toc h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.toc ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

/* 중첩된 ul에 들여쓰기 적용 */
.toc ul ul {
  padding-left: 16px;
  margin-top: 4px;
  margin-bottom: 4px;
}

.toc ul ul ul {
  padding-left: 32px;
}

.toc li {
  margin: 0;
}

.toc a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  display: block;
  padding: 4px 0;
  transition: color 0.2s;
  line-height: 1.4;
}

/* h2 레벨 링크 */
.toc > div > ul > li > a {
  font-weight: 500;
}

/* h3 이하 레벨 링크 - 약간 작고 연하게 */
.toc ul ul a {
  font-size: 12px;
  opacity: 0.85;
}

.toc a:hover {
  color: var(--link-color);
}

.toc a.active {
  color: var(--link-color);
  font-weight: 600;
}

/* 검색 자동완성 */
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--content-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-top: 8px;
  max-height: 500px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  display: none;
  z-index: 1000;
}

body.dark-mode .search-results {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.search-results.active {
  display: block;
}

.search-results a {
  display: block;
  padding: 12px 16px;
  color: var(--text-color);
  text-decoration: none;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s;
}

.search-results a:last-child {
  border-bottom: none;
}

.search-results a:hover {
  background-color: var(--hover-bg);
}

.search-result-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
  color: var(--link-color);
}

.search-result-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.search-result-category {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.search-result-tags {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.search-result-tag {
  background: var(--hover-bg);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--link-color);
}

.search-results-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

/* 검색 결과 페이지 */
.search-results-list {
  margin-top: 30px;
}

.search-result-item {
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin-bottom: 12px;
  transition: border-color 0.2s;
  background-color: var(--content-bg);
}

.search-result-item:hover {
  border-color: var(--link-color);
}

.search-result-item h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
}

.result-excerpt {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 14px;
}

.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

/* 버튼 */
.cta-buttons {
  display: flex;
  gap: 12px;
  margin-top: 30px;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s;
  border: 1px solid var(--border-color);
}

.btn-primary {
  background-color: var(--link-color);
  color: white !important;
  border-color: var(--link-color);
}

.btn-primary:hover {
  background-color: var(--link-hover);
  border-color: var(--link-hover);
  color: white !important;
  text-decoration: none;
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--hover-bg);
  text-decoration: none;
}

/* 푸터 */
.footer {
  background-color: transparent;
  padding: 30px 0;
  text-align: center;
  margin-top: 60px;
  border-top: 1px solid var(--border-color);
  font-size: 13px;
  color: var(--text-secondary);
}

/* 헤더 버튼 스타일 */
.header a[href="/wiki/create"],
.header a[href="/login"] {
  padding: 6px 14px !important;
  background: transparent !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 6px !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  font-size: 14px !important;
  transition: all 0.2s !important;
  color: var(--text-color) !important;
  margin-left: 10px !important;
}

.header a[href="/wiki/create"]:hover,
.header a[href="/login"]:hover {
  background-color: var(--hover-bg) !important;
}

.header a[href="/wiki/create"] {
  background-color: var(--link-color) !important;
  border-color: var(--link-color) !important;
  color: white !important;
}

.header a[href="/wiki/create"]:hover {
  background-color: var(--link-hover) !important;
  border-color: var(--link-hover) !important;
}

.header span {
  color: var(--text-secondary) !important;
  font-size: 13px !important;
  margin-left: 15px !important;
}

/* ==========================================================================
   반응형 디자인 (모바일 최적화)
   ========================================================================== */

/* 햄버거 메뉴 버튼 (데스크탑에서는 숨김) */
.mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 20px;
  color: var(--text-color);
  transition: background-color 0.2s;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.mobile-menu-btn:hover {
  background-color: var(--hover-bg);
}

/* 플로팅 TOC 버튼 (데스크탑에서는 숨김) */
.floating-toc-btn {
  display: none; /* 기본적으로 숨김 */
  position: fixed;
  right: 20px;
  bottom: 80px;
  width: 56px;
  height: 56px;
  background: var(--link-color);
  color: white;
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  font-size: 24px;
  cursor: pointer;
  z-index: 999;
  transition: all 0.3s;
}

.floating-toc-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* TOC가 있는 페이지에서만 표시 */
.has-toc .floating-toc-btn {
  display: none; /* 일단 숨김, 모바일에서만 표시 */
}

/* 오프캔버스 사이드바 오버레이 */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* TOC 바텀시트 오버레이 */
.toc-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s;
}

.toc-overlay.active {
  display: block;
  opacity: 1;
}

/* 태블릿 가로 (최대 1199px) */
@media (max-width: 1199px) {
  .main-wrapper {
    grid-template-columns: 220px minmax(0, 1fr) 220px;
    gap: 15px;
  }

  .content {
    padding: 30px 35px;
  }
}

/* 태블릿 세로 / 작은 노트북 (최대 992px) */
@media (max-width: 992px) {
  /* 레이아웃을 1단으로 변경 */
  .main-wrapper {
    grid-template-columns: 1fr;
  }

  /* 사이드바를 오프캔버스로 전환 */
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    z-index: 999;
    overflow-y: auto;
    transition: left 0.3s ease-in-out;
    padding: 80px 20px 20px;
  }

  .sidebar.active {
    left: 0;
  }

  /* 모바일에서는 TOC 완전히 숨김 */
  .toc {
    display: none;
  }

  /* 햄버거 메뉴 버튼 표시 */
  .mobile-menu-btn {
    display: block;
  }

  /* 모바일에서는 플로팅 TOC 버튼 숨김 */
  .has-toc .floating-toc-btn {
    display: none;
  }

  /* 콘텐츠 패딩 축소 */
  .content {
    padding: 25px 20px;
  }

  /* 헤더 검색창 축소 */
  .search-box {
    max-width: 300px;
  }
}

/* 스마트폰 가로 / 큰 스마트폰 (최대 768px) */
@media (max-width: 768px) {
  /* 컨테이너 패딩 축소 */
  .container {
    padding: 0 12px;
  }

  /* 헤더 레이아웃 조정 */
  .header-content {
    gap: 4px;
    height: 44px; /* 모바일에서 높이 약간 축소 */
    overflow-x: visible;
  }

  .logo {
    flex-shrink: 0;
  }

  .logo a {
    font-size: 18px;
    display: flex;
    align-items: center;
  }

  /* 모바일에서 로고 텍스트 숨김 */
  .logo-text {
    display: none;
  }

  /* 모바일에서 로그인 텍스트 숨김 */
  .login-text {
    display: none;
  }

  /* 헤더 버튼들 정렬 */
  .header a,
  .header button {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  /* 검색창 모바일 최적화 */
  .search-box {
    flex: 1;
    min-width: 0; /* flex 아이템이 축소될 수 있게 */
    max-width: none;
    position: relative;
  }

  .search-box form {
    display: flex;
    gap: 4px;
  }

  .search-box input {
    flex: 1;
    min-width: 80px; /* 최소 너비 보장 */
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
  }

  .search-box button {
    padding: 8px 12px;
    font-size: 16px;
    flex-shrink: 0;
  }

  .theme-btn,
  .login-btn {
    flex-shrink: 0;
  }

  /* 콘텐츠 패딩 더 축소 */
  .content {
    padding: 20px 16px;
    border-radius: 0;
    border-left: none;
    border-right: none;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* 제목 크기 조정 */
  .wiki-article h1 {
    font-size: 26px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .wiki-article h2 {
    font-size: 20px;
  }

  .wiki-article h3 {
    font-size: 17px;
  }

  /* 버튼 터치 친화적 크기 */
  .btn {
    padding: 12px 20px;
    font-size: 15px;
    min-height: 44px;
  }

  /* 테이블 가로 스크롤 */
  .wiki-article table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  /* 코드블록 스크롤 개선 */
  .wiki-article pre {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 플로팅 버튼 위치 조정 */
  .floating-toc-btn {
    right: 16px;
    bottom: 70px;
    width: 52px;
    height: 52px;
    font-size: 22px;
  }
}

/* 스마트폰 세로 (최대 480px) */
@media (max-width: 480px) {
  /* 헤더 더 압축 */
  .header {
    padding: 10px 0;
  }

  .header-content {
    gap: 6px;
  }

  .logo a {
    font-size: 16px;
  }

  /* 테마 버튼 축소 */
  .theme-btn {
    padding: 6px 8px;
    font-size: 18px;
  }

  /* 검색창 입력 필드 폰트 크기 */
  .search-box input {
    font-size: 13px;
  }

  /* 콘텐츠 패딩 최소화 */
  .content {
    padding: 16px 12px;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* 제목 더 축소 */
  .wiki-article h1 {
    font-size: 22px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .wiki-article h2 {
    font-size: 18px;
  }

  .wiki-article h3 {
    font-size: 16px;
  }

  /* 본문 폰트 크기 조정 */
  body {
    font-size: 14px;
  }

  /* 버튼 그리드 세로 배치 */
  .cta-buttons {
    flex-direction: column;
  }

  .cta-buttons .btn {
    width: 100%;
  }

  /* 댓글 폼 세로 배치 */
  .comment-form-row {
    grid-template-columns: 1fr;
  }

  /* 플로팅 버튼 더 작게 */
  .floating-toc-btn {
    right: 12px;
    bottom: 60px;
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  /* 사이드바 너비 축소 */
  .sidebar {
    width: 260px;
    left: -260px;
  }

  /* 검색 결과 자동완성 위치 조정 */
  .search-results {
    left: 0;
    right: 0;
    max-height: 300px;
    margin-top: 4px;
  }
}

/* 태블릿/모바일에서 검색 결과 전체 너비 */
@media (max-width: 992px) {
  .search-results {
    left: 0;
    right: 0;
    width: 100%;
  }
}

/* ========== 최신 변경 페이지 스타일 ========== */

.recent-page h1 {
  margin-bottom: 30px;
  color: var(--text-color);
}

/* 탭 네비게이션 */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 2px solid var(--border-color);
}

.tabs .tab {
  padding: 12px 24px;
  text-decoration: none;
  color: var(--text-secondary);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  font-weight: 500;
}

.tabs .tab:hover {
  color: var(--text-color);
  background-color: var(--hover-bg);
}

.tabs .tab.active {
  color: var(--link-color);
  border-bottom-color: var(--link-color);
}

/* 최신 문서 목록 */
.recent-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.recent-item {
  padding: 20px;
  background-color: var(--content-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: all 0.2s;
}

.recent-item:hover {
  border-color: var(--link-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.recent-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 20px;
}

.recent-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-color);
  text-decoration: none;
  flex: 1;
}

.recent-title:hover {
  color: var(--link-color);
}

.recent-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

.category-badge {
  padding: 4px 12px;
  background-color: var(--link-color);
  color: white;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.time-badge {
  padding: 4px 12px;
  background-color: var(--hover-bg);
  color: var(--text-secondary);
  border-radius: 12px;
  font-size: 12px;
  white-space: nowrap;
}

/* 태그 목록 */
.recent-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.recent-tags .tag {
  padding: 4px 10px;
  background-color: var(--hover-bg);
  color: var(--text-color);
  border-radius: 4px;
  font-size: 13px;
  text-decoration: none;
  transition: all 0.2s;
}

.recent-tags .tag:hover {
  background-color: var(--link-color);
  color: white;
}

/* 통계 정보 */
.recent-stats {
  display: flex;
  gap: 15px;
  font-size: 14px;
  color: var(--text-secondary);
}

.recent-stats .stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 빈 상태 */
.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 16px;
}

/* 모바일 대응 */
@media (max-width: 768px) {
  .recent-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .recent-meta {
    width: 100%;
    justify-content: space-between;
  }

  .tabs .tab {
    padding: 10px 16px;
    font-size: 14px;
  }

  .recent-title {
    font-size: 16px;
  }
}

/* 터치 디바이스 최적화 */
@media (hover: none) and (pointer: coarse) {
  /* 터치 타겟 최소 크기 보장 (44x44px) */
  .sidebar a,
  .toc a,
  button,
  .btn {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* 호버 효과 제거 (터치에서 불필요) */
  .sidebar a:hover,
  .toc a:hover {
    background-color: transparent;
  }

  /* 탭 하이라이트 색상 */
  * {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  }

  /* 스크롤 관성 추가 */
  .sidebar,
  .toc,
  .content {
    -webkit-overflow-scrolling: touch;
  }
}