/* ===================================
   Life in Beta - Tistory Skin
   Life in Beta blog skin
   =================================== */

/* === 폰트 === */
@import url('https://cdn.jsdelivr.net/npm/pretendard@1.3.9/dist/web/static/pretendard.min.css');

/* === CSS 변수 (라이트 테마) === */
:root {
  --font-sans: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* 색상 - 라이트 */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f1f3f5;
  --bg-code: #f6f8fa;

  --text-primary: #212529;
  --text-secondary: #333d4b;
  --text-tertiary: #8a8a8a;
  --text-inverse: #ffffff;

  --border-color: #e8e8e8;
  --border-light: #f0f0f0;

  --accent: #3182f6;
  --accent-hover: #1b64da;
  --accent-light: #e8f0fe;

  --tag-bg: #f1f3f5;
  --tag-text: #5a5a5a;

  /* 헤더 */
  --header-bg: rgba(255, 255, 255, 0.85);
  --header-border: rgba(0, 0, 0, 0.06);
  --header-height: 60px;

  /* 본문 칸 최대 폭 (넓은 화면 글 상세는 아래 고정 목차 자리만큼 줄어든다) */
  --content-max: 860px;

  /* 사이드바 */
  --sidebar-width: 260px;
  --sidebar-bg: #ffffff;
  --sidebar-border: #e8e8e8;

  /* 그림자 */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);

  /* 타이포그래피 */
  --font-size-base: 17px;
  --line-height-base: 1.6;
  --letter-spacing-base: normal;

  /* 전환 */
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color-scheme: light;
  color-scheme: only light;
}

/* === 다크 테마 === */
[data-theme="dark"] {
  color-scheme: dark;
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --bg-code: #161b22;

  --text-primary: #f0f6fc;
  --text-secondary: #cdd9e5;
  --text-tertiary: #9198a1;
  --text-inverse: #0d1117;

  --border-color: #30363d;
  --border-light: #21262d;

  --accent: #58a6ff;
  --accent-hover: #79b8ff;
  --accent-light: #1f3a5e;

  --tag-bg: #21262d;
  --tag-text: #8b949e;

  --header-bg: rgba(13, 17, 23, 0.85);
  --header-border: rgba(255, 255, 255, 0.06);

  --sidebar-bg: #0d1117;
  --sidebar-border: #30363d;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
}

/* === 리셋 & 기본 === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  letter-spacing: var(--letter-spacing-base);
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-break: keep-all;
  overflow-wrap: break-word;
  transition: background var(--transition), color var(--transition);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; background: none; border: none; padding: 0; font-family: inherit; }

/* === 읽기 진행바 === */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  box-shadow: 0 0 8px var(--accent);
  z-index: 9999;
  transition: width 0.1s linear;
  border-radius: 0 99px 99px 0;
}
[data-theme="dark"] .reading-progress {
  box-shadow: 0 0 12px var(--accent), 0 0 4px var(--accent);
}

/* === 헤더 === */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--header-border);
  z-index: 1000;
  transition: height var(--transition), background var(--transition), backdrop-filter var(--transition), box-shadow var(--transition);
}
.site-header.scrolled {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 12px rgba(0,0,0,0.08);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

/* 햄버거 버튼 */
.sidebar-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  border-radius: 6px;
  transition: background var(--transition);
}
.sidebar-toggle:hover { background: var(--bg-tertiary); }
.sidebar-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* 사이드바 열렸을 때 햄버거 X 변환 */
.sidebar-open .sidebar-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sidebar-open .sidebar-toggle span:nth-child(2) { opacity: 0; }
.sidebar-open .sidebar-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  white-space: nowrap;
}

/* 메인 네비게이션 */
.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.nav-link {
  position: relative;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}
.nav-link:hover::after { transform: scaleX(1); opacity: 0.4; }
.nav-link.active { color: var(--accent); }
.nav-link.active::after { transform: scaleX(1); opacity: 1; }

/* 날씨/시간 위젯 */
.header-status {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
  cursor: default;
  user-select: none;
}
.header-status:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.header-status-weather { font-size: 14px; letter-spacing: 0.01em; }
.header-status-sep { width: 1px; height: 10px; background: currentColor; opacity: 0.3; }
.header-status-time { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

/* 태블릿: 시간 숨김 */
@media (max-width: 768px) {
  .header-status-sep,
  .header-status-time { display: none; }
  .header-status { padding: 4px 8px; }
}
/* 모바일: 완전히 숨김 */
@media (max-width: 480px) {
  .header-status { display: none; }
}
/* 태블릿 (2026-12-05 반응형): 메뉴, 날씨, 아이콘이 한 줄에 다 들어가지 않아 오른쪽 테마 단추가 화면 밖으로 나갔다.
   1080px 이하는 날씨 칸을, 900px 이하는 메뉴 줄을 숨긴다(왼쪽 메뉴 단추로 연다) */
@media (max-width: 1080px) {
  .header-status { display: none; }
}
@media (max-width: 900px) {
  .main-nav { display: none; }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto; /* 메뉴 줄을 숨긴 좁은 화면에서도 오른쪽 끝에 (2026-12-05) */
}

/* 검색/테마 버튼 */
.search-btn, .theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--text-secondary);
  transition: color var(--transition), background var(--transition);
}
.search-btn:hover, .theme-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

/* 테마 아이콘 토글 */
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* 검색 오버레이 */
.search-overlay {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 20px;
  z-index: 999;
  display: none;
  box-shadow: var(--shadow-md);
}
.search-overlay.open { display: block; }

.search-box {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-input {
  flex: 1;
  height: 44px;
  padding: 0 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 15px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--transition);
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-tertiary); }

.search-submit {
  width: 44px;
  height: 44px;
  background: var(--accent);
  color: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.search-submit:hover { background: var(--accent-hover); }

.search-close {
  font-size: 18px;
  color: var(--text-tertiary);
  padding: 8px;
  transition: color var(--transition);
}
.search-close:hover { color: var(--text-primary); }

/* === 사이드바 === */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.sidebar-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  z-index: 1200;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}
.sidebar.open { transform: translateX(0); }

.sidebar-inner {
  padding: 20px 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* 사이드바 날씨/시간 위젯 (모바일 전용) */
.sidebar-status {
  display: none; /* 데스크탑은 헤더에 있으므로 숨김 */
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 0 12px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 4px;
}
.sidebar-status-weather {
  font-size: 22px;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}
.sidebar-status-time {
  font-size: 13px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}
@media (max-width: 480px) {
  .sidebar-status { display: flex; }
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 24px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 8px;
}

.profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

.profile-info { display: flex; flex-direction: column; gap: 2px; }
.profile-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.profile-desc { font-size: 12px; color: var(--text-tertiary); }

.sidebar-nav { flex: 1; padding: 0 10px; }

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-section-title {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 0 10px;
  margin-bottom: 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition), background var(--transition);
}
.sidebar-link:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}
.sidebar-link svg { opacity: 0.6; flex-shrink: 0; }

/* 내 다른 블로그 링크 */
.sidebar-blog { padding-top: 7px; padding-bottom: 7px; }
.sidebar-blog-badge {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
}
.sidebar-blog-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.sidebar-blog-name { font-size: 14px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-blog-desc { font-size: 12px; font-weight: 400; color: var(--text-tertiary); }
.sidebar-blog svg { opacity: 0; transition: opacity var(--transition); }
.sidebar-blog:hover svg { opacity: 0.6; }

/* 카테고리 — JS로 재구성된 nav 스타일 */
.sidebar-category { padding: 0; }
.category-nav { display: flex; flex-direction: column; }

/* 공통 링크 — sidebar-link 동일 스타일 */
.category-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition), background var(--transition);
  text-decoration: none;
}
.category-link:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

/* 전체보기 링크 — 약간 더 연하게 */
.category-root {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}

/* 글수 */
.category-count {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-left: 4px;
  flex-shrink: 0;
}

/* 2단계 서브카테고리 */
.category-sub {
  padding-left: 14px;
  margin-bottom: 2px;
}
.category-child {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-tertiary);
  padding: 6px 10px;
}
.category-child:hover {
  color: var(--text-secondary);
  background: var(--bg-tertiary);
}

/* 태그 클라우드 */
.sidebar-tags .revenue_list_area { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 10px; }
.sidebar-tags a {
  padding: 3px 10px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border-radius: 20px;
  font-size: 12px;
  transition: background var(--transition), color var(--transition);
}
.sidebar-tags a:hover { background: var(--accent-light); color: var(--accent); }

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 16px;
}

.sidebar-social {
  color: var(--text-tertiary);
  transition: color var(--transition);
}
.sidebar-social:hover { color: var(--text-primary); }

/* === 메인 콘텐츠 === */
.main-content {
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

.content-wrapper {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* === 글 목록 (인덱스) === */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.post-card {
  border-bottom: 1px solid var(--border-light);
  padding: 32px 0;
  opacity: 0;
}
.post-card.is-visible {
  animation: fadeSlideUp 0.4s ease both;
}
.post-card:hover .post-title a { color: var(--accent); }
.post-card:hover .post-thumbnail img { transform: scale(1.04); }

/* 첫 글: 대형 피처 카드 */
.post-list .post-card:first-child {
  padding: 0 0 40px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border-light);
}
.post-list .post-card:first-child .post-card-inner {
  flex-direction: column;
  gap: 18px;
}
.post-list .post-card:first-child .post-thumbnail {
  width: 100%;
  height: auto;
  aspect-ratio: 1.85;
  border-radius: 14px;
  position: relative;
}
.post-list .post-card:first-child .post-thumbnail img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.post-list .post-card:first-child .post-thumbnail::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.24), transparent 42%);
  border-radius: inherit;
  pointer-events: none;
}
.post-list .post-card:first-child .post-title {
  font-size: 28px;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}
.post-list .post-card:first-child .post-summary {
  font-size: 16px;
  -webkit-line-clamp: 3;
  margin-bottom: 18px;
}

.post-card-inner {
  display: flex;
  flex-direction: row-reverse; /* 글이 먼저 읽히도록 썸네일은 오른쪽 */
  gap: 28px;
  align-items: center;
}

.post-thumbnail {
  flex-shrink: 0;
  width: 148px;
  height: 100px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
}
.post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.post-thumbnail:hover img { transform: scale(1.04); }

.post-card-content { flex: 1; min-width: 0; }

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.post-category {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.post-date {
  font-size: 13px;
  color: var(--text-tertiary);
}

.post-title {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.42;
  letter-spacing: -0.4px;
  margin-bottom: 8px;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.post-title a {
  color: var(--text-primary);
  transition: color var(--transition);
}
.post-title a:hover { color: var(--accent); }

.post-summary {
  font-size: 15px;
  color: color-mix(in srgb, var(--text-secondary) 78%, var(--bg-primary));
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}

.post-footer {
  display: flex;
  align-items: center;
  gap: 16px;
}

.post-comment {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1;
}
.post-comment.is-zero { display: none; }

/* 페이지네이션 */
/* s_paging: [##_paging_rep_link_num_##]는 <span class="selected">2</span> 형태로 나온다 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 48px;
}
#tt-body-page .pagination { display: none; }
.post-card:last-child {
  border-bottom: none;
}
.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 8px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-tertiary);
  transition: background var(--transition), color var(--transition);
}
.pagination a:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.pagination a:has(.selected),
.pagination .on {
  background: var(--text-primary);
  color: var(--bg-primary);
  font-weight: 700;
}
.pagination .page-prev,
.pagination .page-next { color: var(--text-secondary); }
.pagination .no-more-prev,
.pagination .no-more-next { opacity: 0.3; pointer-events: none; }

/* 카테고리, 태그, 검색 목록 머리글 (script.js initListHeader) */
.list-header {
  padding: 8px 0 28px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border-color);
}
.list-header-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
}
.list-header-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1.25;
  color: var(--text-primary);
  word-break: keep-all;
}
.list-header-count {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.list-header + .post-list .post-card:first-child { padding-top: 32px; }

/* === 글 상세 === */
.post-detail { max-width: 100%; }

.post-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}

.post-header-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-bottom: 16px;
}
/* 수정 일시는 칸 사이 간격(gap)으로 띄운다. 글자 안 여백(margin-left)이면 휴대폰에서 다음 줄로 내려갈 때 들여 써졌다 (2026-12-05) */
.post-header-meta .post-updated { margin-left: 0 !important; }

.post-category-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity var(--transition);
}
.post-category-badge:hover { opacity: 0.8; }

a.post-category {
  text-decoration: none;
  transition: color var(--transition);
}
a.post-category:hover { color: var(--accent); }

.post-detail-title {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.8px;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.post-author-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.post-author {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.post-stats {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-tertiary);
}
/* 읽는 시간 값은 script.js의 initPostReadingTools가 계산한다 (본문 한글 500자당 1분, 코드 한 줄 3초) */
.reading-time {
  color: var(--text-secondary);
}

/* 목차 */
.toc-wrapper {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 28px;
  display: none; /* JS에서 헤딩 있으면 표시 */
}
.toc-wrapper.visible { display: block; }

.toc-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}
.toc-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.toc-label::before {
  content: '';
  width: 3px;
  height: 13px;
  border-radius: 99px;
  background: linear-gradient(180deg, var(--accent), var(--accent-hover));
}
.toc-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.toc-count {
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  color: var(--bg-primary);
  background: var(--text-tertiary);
  border-radius: 999px;
  padding: 4px 7px;
  min-width: 20px;
  text-align: center;
}
[data-theme="dark"] .toc-count { background: var(--text-secondary); }
.toc-top,
.toc-toggle {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-tertiary);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.toc-top:hover,
.toc-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.toc-wrapper.collapsed .toc { display: none; }
.toc-wrapper.collapsed .toc-toggle svg { transform: rotate(180deg); }

.toc { list-style: none; }
.toc a {
  position: relative;
  display: block;
  padding: 6px 10px 6px 20px;
  margin: 1px 0;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.4;
  word-break: keep-all;
  transition: color var(--transition), background var(--transition);
}
.toc a::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%) scale(0);
  box-shadow: 0 0 6px var(--accent);
  transition: transform var(--transition);
}
.toc a:hover {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.toc a.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  font-weight: 600;
}
.toc a.active::before { transform: translateY(-50%) scale(1); }
.toc .toc-h3 { padding-left: 36px; font-size: 13px; }
.toc .toc-h4 { padding-left: 50px; font-size: 12px; color: var(--text-tertiary); }

.toc-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 0 99px 99px 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-hover));
  transform: scaleY(0);
  transform-origin: top;
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 55%, transparent);
  opacity: 0.9;
  pointer-events: none;
  display: none; /* 넓은 데스크톱에서만 표시 */
}

/* 모바일 전용 UI — 데스크톱/태블릿에서는 숨김 */
.toc-fab,
.toc-sheet,
.toc-sheet-backdrop {
  display: none;
}

@keyframes tocEntrance {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes headingFlash {
  0% { background: color-mix(in srgb, var(--accent) 22%, transparent); border-radius: 6px; }
  100% { background: transparent; }
}
.post-body h2.heading-flash,
.post-body h3.heading-flash,
.post-body h4.heading-flash {
  animation: headingFlash 1.3s ease 0.1s;
}

@media (prefers-reduced-motion: reduce) {
  .toc-wrapper.visible,
  .toc-fab,
  .toc-sheet,
  .toc-sheet-backdrop {
    animation: none !important;
    transition: none !important;
  }
}

/* === 본문 타이포그래피 === */
.post-body {
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  letter-spacing: var(--letter-spacing-base);
  color: var(--text-primary);
}

.post-body h1 {
  font-size: 48px;
  font-weight: 700;
  line-height: 60px;
  letter-spacing: normal;
  margin: 56px 0 20px;
  color: var(--text-primary);
}

.post-body h2 {
  position: relative;
  font-size: 30px;
  font-weight: 700;
  line-height: 46.5px;
  letter-spacing: normal;
  margin: 48px 0 16px;
  color: var(--text-primary);
  scroll-margin-top: calc(var(--header-height) + 16px);
}

.post-body h3 {
  position: relative;
  font-size: 24px;
  font-weight: 700;
  line-height: 38.4px;
  letter-spacing: normal;
  margin: 36px 0 12px;
  color: var(--text-primary);
  scroll-margin-top: calc(var(--header-height) + 16px);
}

.post-body h4 {
  position: relative;
  font-size: 16px;
  font-weight: 600;
  margin: 28px 0 10px;
  scroll-margin-top: calc(var(--header-height) + 16px);
}
.has-heading-anchor {
  padding-right: 32px;
}
.heading-anchor {
  position: absolute;
  top: 50%;
  right: 0;
  width: 26px;
  height: 26px;
  transform: translateY(-50%);
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-tertiary);
  opacity: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity var(--transition), color var(--transition), background var(--transition);
}
.has-heading-anchor:hover .heading-anchor,
.heading-anchor:focus-visible {
  opacity: 1;
}
.heading-anchor:hover {
  color: var(--accent);
  background: var(--accent-light);
}

.post-body p {
  color: var(--text-secondary);
  margin-bottom: 12px;
}
/* 에디터에서 빈 줄로 넣은 <p>&nbsp;</p>는 한 줄 높이 대신 간격만 남긴다 (script.js에서 is-blank 표시) */
.post-body p.is-blank {
  height: 12px;
  margin: 0;
  overflow: hidden;
}
/* 티스토리 uselessPMargin.css가 본문 p의 여백을 !important로 0으로 만들어서 한 단계 더 구체적으로 덮는다 */
.post-body .tt_article_useless_p_margin p { margin-bottom: 12px !important; }
.post-body .tt_article_useless_p_margin p.is-blank,
.post-body .tt_article_useless_p_margin p:last-child { margin-bottom: 0 !important; }

.post-body p:last-child { margin-bottom: 0; }

.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: opacity var(--transition);
}
.post-body a:hover { opacity: 0.75; }

.post-body strong { font-weight: 700; color: var(--text-primary); }
.post-body em { font-style: italic; }

.post-body ul, .post-body ol {
  padding-left: 24px;
  margin-bottom: 24px;
}
.post-body li {
  margin-bottom: 8px;
  line-height: 1.7;
}
.post-body ul li { list-style-type: disc; }
.post-body ol li { list-style-type: decimal; }

/* 인용구 */
.post-body blockquote {
  margin: 28px 0;
  padding: 18px 22px;
  border-left: 4px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-secondary));
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.75;
  text-align: left !important;
}
[data-theme="dark"] .post-body blockquote {
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-tertiary));
  color: #e6edf3;
  border-left-color: var(--accent);
}
.post-body blockquote,
.post-body blockquote * {
  text-align: left !important;
}
.post-body blockquote p {
  margin: 0 0 10px;
}
.post-body blockquote p:last-child {
  margin-bottom: 0;
}

/* 구분선 */
.post-body hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 24px 0;
}

/* 이미지 */
.post-body img {
  border-radius: 8px;
  margin: 16px auto;
}

/* 인라인 코드 */
.post-body code:not(pre code) {
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 2px 6px;
  background: var(--bg-code);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: #e5534b;
}
[data-theme="dark"] .post-body code:not(pre code) { color: #f47067; }

/* 코드블록 */
.post-body pre {
  margin: 28px 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  background: #f8fafc;
  border: 1px solid var(--border-light);
  position: relative;
}
[data-theme="dark"] .post-body pre {
  box-shadow: 0 16px 40px rgba(0,0,0,0.34);
  background: #111827;
  border-color: rgba(255,255,255,0.08);
}
.post-body pre code {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  padding: 14px 0 16px;
  display: block;
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
  counter-reset: line;
  background: transparent !important;
  color: #383a42;
}
[data-theme="dark"] .post-body pre code { color: #e4e8f0; }
.post-body pre.is-wrapped code {
  overflow-x: hidden;
  white-space: pre-wrap;
}
/* 라인넘버 (JS에서 추가) */
.code-line {
  display: block;
  padding: 0 16px 0 4.4em;
  position: relative;
  min-height: 1.65em;
  white-space: pre;
}
.post-body pre.is-wrapped .code-line {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.code-line::before {
  counter-increment: line;
  content: counter(line);
  position: absolute;
  left: 0;
  width: 3.3em;
  text-align: right;
  color: rgba(15,23,42,0.34);
  font-size: 11px;
  line-height: 1.65;
  user-select: none;
  pointer-events: none;
}
[data-theme="dark"] .code-line::before { color: rgba(255,255,255,0.34); }
/* 코드블럭 상단 바 (dots + 언어 + 복사) */
.code-toolbar {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: rgba(15,23,42,0.04);
  border-bottom: 1px solid var(--border-light);
  gap: 8px;
}
[data-theme="dark"] .code-toolbar { background: rgba(255,255,255,0.04); border-bottom-color: rgba(255,255,255,0.08); }
.code-dots {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.code-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.code-dot.red { background: #ff5f57; }
.code-dot.yellow { background: #febc2e; }
.code-dot.green { background: #28c840; }
.code-lang-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(15,23,42,0.52);
  font-family: var(--font-sans);
  margin-left: auto;
}
[data-theme="dark"] .code-lang-tag { color: rgba(255,255,255,0.52); }
.code-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
/* 코드블럭 복사/줄바꿈 버튼 */
.code-copy-btn,
.code-wrap-btn {
  padding: 4px 9px;
  background: #fff;
  border: 1px solid rgba(15,23,42,0.12);
  border-radius: 6px;
  color: rgba(15,23,42,0.66);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  flex-shrink: 0;
}
.code-copy-btn:hover,
.code-wrap-btn:hover,
.code-wrap-btn.active {
  background: var(--accent-light);
  border-color: color-mix(in srgb, var(--accent) 26%, transparent);
  color: var(--accent);
}
.code-copy-btn.copied { color: #16a34a; }
[data-theme="dark"] .code-copy-btn,
[data-theme="dark"] .code-wrap-btn {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.68);
}
[data-theme="dark"] .code-copy-btn:hover,
[data-theme="dark"] .code-wrap-btn:hover,
[data-theme="dark"] .code-wrap-btn.active {
  background: rgba(88,166,255,0.14);
  border-color: rgba(88,166,255,0.32);
  color: #58a6ff;
}
[data-theme="dark"] .code-copy-btn.copied { color: #4ade80; }

/* 표
   티스토리 content.css가 에디터 표 스타일(data-ke-style)마다 칸 배경을 직접 칠한다.
   (style12~15: #9b9b9b 첫 줄, #dcdddd 첫 칸, #f0f0f0 홀수 줄 / style4~7: 짝수 줄)
   다크모드에서는 글자만 밝아져 배경에 묻히므로 배경, 글자, 선을 모두 테마 색으로 다시 칠한다.
   인라인으로 칠한 칸 색과 border="1" 속성도 같이 덮어야 해서 !important를 쓴다. */
.post-body .table-scroll {
  margin: 28px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-primary);
}
.post-body table:not(.another_category table) {
  width: 100%;
  margin: 28px 0 !important; /* #tt-body-page table[data-ke-style]의 margin-bottom: 20px보다 우선 */
  border-collapse: collapse;
  border: 1px solid var(--border-color) !important;
  background: var(--bg-primary);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.post-body .table-scroll > table:not(.another_category table) {
  margin: 0 !important;
  border: 0 !important;
}
.post-body table:not(.another_category table) th,
.post-body table:not(.another_category table) td {
  padding: 11px 16px !important;
  text-align: left;
  vertical-align: top;
  word-break: keep-all;
  overflow-wrap: anywhere;
  color: inherit !important;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid var(--border-light) !important;
}
.post-body table:not(.another_category table) tr > * + * {
  border-left: 1px solid var(--border-light) !important;
}
.post-body table:not(.another_category table) tr:last-child > * {
  border-bottom: 0 !important;
}
.post-body table:not(.another_category table) tbody tr:hover > td {
  background: color-mix(in srgb, var(--accent) 5%, transparent) !important;
}
/* 첫 칸에 색을 칠하는 표 스타일(style12~15)은 첫 칸을 옅게 구분 */
.post-body table:is([data-ke-style="style12"], [data-ke-style="style13"], [data-ke-style="style14"], [data-ke-style="style15"]) tr > td:first-child {
  background: color-mix(in srgb, var(--bg-secondary) 70%, transparent) !important;
  color: var(--text-primary) !important;
}
/* 첫 줄은 머리글로 (thead가 있으면 thead, 없으면 첫 tbody의 첫 줄) */
.post-body table:not(.another_category table) thead tr > *,
.post-body table:not(.another_category table):not(:has(thead)) > tbody:first-of-type > tr:first-child > * {
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color) !important;
}
.post-body table:not(.another_category table) b,
.post-body table:not(.another_category table) strong {
  color: inherit;
}

/* 태그 */
.post-tags {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.post-tags:empty {
  display: none;
  margin: 0;
  padding: 0;
  border: none;
}
.post-tags a, .post-tags .revenue_list_area a {
  padding: 5px 14px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
}
.post-tags a:hover { background: var(--accent-light); color: var(--accent); }

/* 공유/공감 통합 액션 바 */
.post-share {
  margin-top: 20px;
  padding: 24px 0;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.post-share .share-btn svg { width: 18px; height: 18px; stroke: var(--text-secondary); }
.post-share .share-btn:hover svg { stroke: var(--accent); }
/* 공유 레이어 팝업 */

/* 이전/다음 글 */
.post-navigation {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0;
}
.post-navigation:empty {
  display: none;
  margin: 0;
  padding: 0;
  border: none;
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  transition: border-color var(--transition);
}
.post-nav-link:hover { border-color: var(--accent); }
.post-nav-link.next { text-align: right; }

.nav-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.nav-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* === 티스토리 자동 삽입 요소 정리 === */
/* container_postbtn — post-share 밖에 있을 때만 숨김 */
body > .container_postbtn,
.post-detail > .container_postbtn,
.post-body > .container_postbtn { position: fixed !important; left: -9999px !important; top: -9999px !important; opacity: 0 !important; }
/* post-share 안으로 이동된 container_postbtn */
.post-share .container_postbtn {
  position: static !important;
  left: auto !important;
  top: auto !important;
  opacity: 1 !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
/* === 아이콘 버튼 공통 === */
.post-share .icon-btn,
.post-share .container_postbtn button.btn_post,
.post-share #post_button_group button.btn_post,
.post-share .container_postbtn button.btn_etc1,
.post-share #post_button_group button.btn_etc1 {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  padding: 0 !important;
  background: var(--bg-secondary) !important;
  background-image: none !important;
  border: 1px solid var(--border-light) !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  overflow: visible !important;
  flex-shrink: 0 !important;
  color: transparent !important;
  font-size: 0 !important;
  line-height: 1 !important;
}
.post-share .icon-btn:hover,
.post-share .container_postbtn button.btn_post:hover,
.post-share #post_button_group button.btn_post:hover,
.post-share .container_postbtn button.btn_etc1:hover,
.post-share #post_button_group button.btn_etc1:hover {
  background: var(--accent-light) !important;
  border-color: var(--accent) !important;
}
/* 내부 텍스트/스프라이트 숨김 */
.post-share .container_postbtn .ico_postbtn,
.post-share #post_button_group .ico_postbtn {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
}
/* 좋아요 버튼 내부 div.uoc-icon 리셋 */
.post-share button.uoc-icon > .uoc-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  overflow: visible !important;
  position: static !important;
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  color: transparent !important;
  font-size: 0 !important;
}
/* ::after 아이콘 공통 — btn_post, btn_etc1 */
.post-share .container_postbtn button.btn_post::after,
.post-share #post_button_group button.btn_post::after,
.post-share .container_postbtn button.btn_etc1::after,
.post-share #post_button_group button.btn_etc1::after {
  content: '' !important;
  display: block !important;
  width: 20px !important;
  height: 20px !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  pointer-events: none !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 20px 20px !important;
}
/* 좋아요 하트 아이콘 (빈 하트) */
.post-share button.uoc-icon::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z'/%3E%3C/svg%3E") !important;
}
/* 좋아요 눌린 상태 (채워진 하트) — 내부 div.like_on 타겟 */
.post-share button.uoc-icon.on::after,
.post-share button.uoc-icon[data-reaction-selected="true"]::after,
.post-share button.uoc-icon > .uoc-icon.like_on::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='%23e74c3c' stroke='%23e74c3c' stroke-width='2'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z'/%3E%3C/svg%3E") !important;
}
/* 좋아요 내부 div에도 ::after 기본 속성 */
.post-share button.uoc-icon > .uoc-icon::after {
  content: '' !important;
  display: none !important;
  width: 20px !important;
  height: 20px !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  pointer-events: none !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 20px 20px !important;
}
.post-share button.uoc-icon > .uoc-icon.like_on::after {
  display: block !important;
}
/* 통계 버튼 아이콘 — 실제 DOM: btn_post + ico_statistics span */
.post-share button.btn_post:has(.ico_statistics)::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='20' x2='18' y2='10'/%3E%3Cline x1='12' y1='20' x2='12' y2='4'/%3E%3Cline x1='6' y1='20' x2='6' y2='14'/%3E%3C/svg%3E") !important;
}
[data-theme="dark"] .post-share button.btn_post:has(.ico_statistics)::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='20' x2='18' y2='10'/%3E%3Cline x1='12' y1='20' x2='12' y2='4'/%3E%3Cline x1='6' y1='20' x2='6' y2='14'/%3E%3C/svg%3E") !important;
}
/* 공유하기 아이콘 */
.post-share button.btn_share::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3Ccircle cx='6' cy='12' r='3'/%3E%3Ccircle cx='18' cy='19' r='3'/%3E%3Cline x1='8.59' y1='13.51' x2='15.42' y2='17.49'/%3E%3Cline x1='15.41' y1='6.51' x2='8.59' y2='10.49'/%3E%3C/svg%3E") !important;
}
/* 게시글 관리 아이콘 (⋯) — 실제 DOM: btn_post btn_etc1 */
.post-share button.btn_etc1::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='%23666'%3E%3Ccircle cx='5' cy='12' r='2'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Ccircle cx='19' cy='12' r='2'/%3E%3C/svg%3E") !important;
}
/* 신고 버튼 (비로그인) — btn_etc2: 깃발 아이콘 */
.post-share .container_postbtn button.btn_etc2,
.post-share #post_button_group button.btn_etc2 {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 50% !important;
  background: var(--bg-primary) !important;
  cursor: pointer !important;
  overflow: visible !important;
  color: transparent !important;
  font-size: 0 !important;
}
.post-share .container_postbtn button.btn_etc2:hover,
.post-share #post_button_group button.btn_etc2:hover {
  background: var(--accent-light) !important;
  border-color: var(--accent) !important;
}
.post-share .container_postbtn button.btn_etc2 *,
.post-share #post_button_group button.btn_etc2 * {
  display: none !important;
}
.post-share button.btn_etc2::after {
  content: '' !important;
  display: block !important;
  width: 20px !important;
  height: 20px !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z'/%3E%3Cline x1='4' y1='22' x2='4' y2='15'/%3E%3C/svg%3E") !important;
}
[data-theme="dark"] .post-share button.btn_etc2::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z'/%3E%3Cline x1='4' y1='22' x2='4' y2='15'/%3E%3C/svg%3E") !important;
}
/* 다크모드 아이콘 색상 */
[data-theme="dark"] .post-share button.uoc-icon::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z'/%3E%3C/svg%3E") !important; }
[data-theme="dark"] .post-share button.btn_share::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3Ccircle cx='6' cy='12' r='3'/%3E%3Ccircle cx='18' cy='19' r='3'/%3E%3Cline x1='8.59' y1='13.51' x2='15.42' y2='17.49'/%3E%3Cline x1='15.41' y1='6.51' x2='8.59' y2='10.49'/%3E%3C/svg%3E") !important; }
[data-theme="dark"] .post-share button.btn_etc1::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='%238b949e'%3E%3Ccircle cx='5' cy='12' r='2'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Ccircle cx='19' cy='12' r='2'/%3E%3C/svg%3E") !important; }
/* 공감 숫자 — 버튼 아래 */
.post-share .container_postbtn .uoc-count,
.post-share #post_button_group .uoc-count {
  position: absolute !important;
  bottom: -18px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  font-size: 11px !important;
  color: var(--text-tertiary) !important;
  white-space: nowrap !important;
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
  clip: auto !important;
}
/* postbtn_like / wrapper 초기화 */
.post-share .container_postbtn .postbtn_like,
.post-share #post_button_group .postbtn_like {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  width: auto !important;
  padding: 0 !important;
  background: none !important;
  border: none !important;
}
/* wrap_btn: position relative로 레이어 기준점 */
.post-share .container_postbtn .wrap_btn,
.post-share .container_postbtn .wrap_btn_share,
.post-share .container_postbtn .wrap_btn_etc {
  display: inline-flex !important;
  position: relative !important;
  float: none !important;
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
  flex-shrink: 0 !important;
}
.post-share .container_postbtn,
.post-share #post_button_group {
  position: static !important;
  left: auto !important;
  top: auto !important;
  opacity: 1 !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
/* 공유/관리 드롭다운 레이어 */
/* 위치(top/bottom/left/right)는 티스토리 JS가 인라인으로 주입 → 여기서 override 안 함 */
.post-share .layer_post,
#tistorySnsLayer,
#tistoryEtcLayer {
  position: absolute !important;
  z-index: 10000 !important;
  /* height/overflow는 JS에서 인라인으로 강제 처리 */
  width: auto !important;
  min-width: 160px !important;
  background: var(--bg-primary) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px !important;
  box-shadow: var(--shadow-md) !important;
  padding: 6px 0 !important;
}
/* bundle_post: 세로 나열 */
.post-share .layer_post .bundle_post,
#tistorySnsLayer .bundle_post,
#tistoryEtcLayer .bundle_post {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  width: 100% !important;
}
/* 레이어 내부 버튼 — bundle_post>button.btn_mark 구조 */
.post-share .layer_post .btn_mark,
#tistorySnsLayer .btn_mark,
#tistoryEtcLayer .btn_mark {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  height: auto !important;
  min-height: 36px !important;
  padding: 8px 16px !important;
  border-radius: 0 !important;
  overflow: visible !important;
  color: var(--text-primary) !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  background: none !important;
  border: none !important;
  cursor: pointer !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  text-align: left !important;
}
.post-share .layer_post .btn_mark:hover,
#tistorySnsLayer .btn_mark:hover,
#tistoryEtcLayer .btn_mark:hover {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}
/* btn_mark::after 아이콘 오버라이드 방지 */
.post-share .layer_post .btn_mark::after,
#tistorySnsLayer .btn_mark::after,
#tistoryEtcLayer .btn_mark::after {
  display: none !important;
  content: none !important;
}
.post-share .layer_post .ico_postbtn {
  position: static !important;
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
  clip: auto !important;
}
/* 구독 숨김 */
.post-share .container_postbtn .btn_subscription,
.post-share #post_button_group .btn_subscription { display: none !important; }
/* 로그인 시 이름/비밀번호 숨김 */
.hidden-for-login { display: none !important; }
/* SNS 아이콘/텍스트 */
.post-share .layer_post .txt_sns,
#tistorySnsLayer .txt_sns,
#tistoryEtcLayer .txt_sns {
  font-size: 13px !important;
  color: var(--text-primary) !important;
  line-height: 1 !important;
}
.post-share .layer_post .ico_sns,
#tistorySnsLayer .ico_sns {
  width: 20px !important;
  height: 20px !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
}
.post-share .layer_post .ico_arrbt,
#tistorySnsLayer .ico_arrbt { display: none !important; }

/* 카테고리의 다른 글 */
.another_category {
  margin-top: 20px;
  padding: 0;
  background: none;
  border: none;
}
.another_category h4,
.another_category .tit_category {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
  padding: 0;
  border: none;
}
.another_category table { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.another_category tr { transition: all 0.15s; }
.another_category td {
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: none;
  vertical-align: middle;
}
.another_category tr td:first-child { border-radius: 10px 0 0 10px; }
.another_category tr td:last-child { border-radius: 0 10px 10px 0; }
.another_category tr:only-child td,
.another_category tr td:first-child:last-child { border-radius: 10px; }
.another_category tr:hover td { background: var(--accent-light); }
.another_category a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.15s;
}
.another_category a:hover { color: var(--accent); }
.another_category .on a {
  color: var(--accent);
  font-weight: 600;
}
.another_category .on td { background: var(--accent-light); }
/* 날짜 셀 배경색 제거 */
.another_category td[style*="background"],
.another_category td.date { background: none !important; }
.another_category td:last-child { color: var(--text-tertiary); font-size: 12px; text-align: right; background: transparent !important; }
/* 불필요한 구분선 제거 */
.comments-section > hr,
.post-detail > hr,
.post-body + hr { display: none !important; }

/* 블로그 소개 카드 (namecard) */
.tt_box_namecard {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-light) !important;
  border-radius: 12px !important;
  padding: 16px 20px !important;
  margin: 16px 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
}
.tt_box_namecard .tt_cont { flex: 1; }
.tt_box_namecard .tt_tit_cont {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  display: block !important;
  margin-bottom: 4px !important;
}
.tt_box_namecard .tt_desc {
  font-size: 13px !important;
  color: var(--text-tertiary) !important;
}
.tt_box_namecard .tt_wrap_thumb {
  width: 48px !important;
  height: 48px !important;
  flex-shrink: 0;
}
.tt_box_namecard .tt_thumb_g {
  width: 48px !important;
  height: 48px !important;
  border-radius: 50% !important;
  display: block !important;
  background-size: cover !important;
}
.tt_box_namecard .tt_btn_subscribe {
  background: var(--accent) !important;
  color: white !important;
  border-radius: 20px !important;
  padding: 6px 16px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  border: none !important;
}
.tt_box_namecard .tt_btn_subscribe:hover { background: var(--accent-hover) !important; }

/* 댓글 */
.comments-section {
  margin-top: 20px;
  padding: 0;
}

.comments-header {
  margin-bottom: 24px;
}
.comments-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.comment-count {
  font-weight: 400;
  color: var(--text-tertiary);
  margin-left: 4px;
}

/* 댓글 입력 폼 (상단) */
.comment-form {
  margin-bottom: 24px;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-light);
}
.comment-form-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.comment-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

/* 댓글 목록 */
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* 댓글 아이템 */
.comment-item {
  padding: 20px;
  margin-bottom: 12px;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-light);
  transition: box-shadow var(--transition);
}
.comment-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,.06); }
/* 대댓글 컨테이너 */
.comment-replies {
  margin-top: 8px;
}
/* 대댓글 아이템 */
.comment-item.comment-reply {
  margin-left: 32px;
  margin-top: 6px;
  margin-bottom: 6px;
  padding: 14px 16px;
  border-left: none;
  border-radius: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  position: relative;
}
.comment-item.comment-reply::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 20px;
  width: 14px;
  height: 14px;
  border-left: 2px solid var(--border-color);
  border-bottom: 2px solid var(--border-color);
  border-radius: 0 0 0 4px;
}
.comment-reply-icon {
  display: none;
}

.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.comment-author-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.comment-author {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.comment-author a { color: var(--text-primary); text-decoration: none; }
.comment-author a:hover { color: var(--accent); }
.comment-date {
  font-size: 12px;
  color: var(--text-tertiary);
}
.comment-date a[href*="abuseReport"],
.gb-date a[href*="abuseReport"] { display: none; }
.comment-date a { color: var(--text-tertiary); text-decoration: none; }
.comment-body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  word-break: break-word;
}

/* 댓글 액션 (답글/삭제) */
.comment-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition);
}
.comment-item:hover .comment-actions { opacity: 1; }
.comment-action-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: all var(--transition);
}
.comment-action-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.comment-delete-btn:hover { color: #e53e3e; background: rgba(229,62,62,0.08); }
.comment-reply-btn:hover { color: var(--accent); background: rgba(49,130,246,0.08); }

/* 인라인 답글 폼 */
.inline-reply-form {
  margin-top: 12px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}
.inline-reply-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.inline-reply-meta .gb-input {
  flex: 1;
  min-width: 0;
}
.inline-reply-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  resize: vertical;
  outline: none;
}
.inline-reply-textarea:focus { border-color: var(--accent); }
.inline-reply-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}
.inline-reply-submit {
  padding: 6px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.inline-reply-submit:hover { background: var(--accent-hover); }
.inline-reply-cancel {
  padding: 6px 14px;
  background: transparent;
  color: var(--text-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.inline-reply-cancel:hover { background: var(--bg-tertiary); }

/* 댓글 수정 버튼 hover */
.comment-modify-btn:hover { color: var(--accent); background: rgba(49,130,246,0.08); }

/* 댓글 수정 폼 */
.comment-edit-form {
  margin-top: 10px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}
.comment-edit-form .comment-edit-pw {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 8px;
}
.comment-edit-form .comment-edit-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  resize: vertical;
  outline: none;
}
.comment-edit-form .comment-edit-textarea:focus { border-color: var(--accent); }

/* 인라인 삭제 확인 UI */
.inline-delete-confirm {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(229,62,62,0.06);
  border: 1px solid rgba(229,62,62,0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.inline-delete-msg {
  font-size: 13px;
  color: var(--text-secondary);
  flex: 1 1 auto;
}
.inline-delete-pw {
  width: 130px;
  padding: 5px 10px;
  font-size: 13px;
}
.inline-delete-btns {
  display: flex;
  gap: 6px;
}
.inline-delete-ok {
  padding: 5px 14px;
  background: #e53e3e;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.inline-delete-ok:hover { background: #c53030; }
.inline-delete-cancel {
  padding: 5px 12px;
  background: transparent;
  color: var(--text-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.inline-delete-cancel:hover { background: var(--bg-tertiary); }

/* === 빈 글 목록 (게시글 없음) === */
.empty-posts {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-tertiary);
}
.empty-posts-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}
.empty-posts-icon svg {
  width: 64px;
  height: 64px;
  stroke: var(--text-tertiary);
  opacity: 0.4;
}
.empty-posts h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.empty-posts p {
  font-size: 14px;
  color: var(--text-tertiary);
}

/* === 홈 히어로 (군중 일러스트) === */
.home-hero {
  width: 100%;
  padding: 0;
  border-bottom: none;
  background: #ffffff;
  overflow: visible;
  position: relative;
  z-index: 1;
}
[data-theme="dark"] .home-hero {
  background: var(--bg-primary);
}
.home-hero-illustration {
  width: 100%;
  height: 520px;
  position: relative;
  overflow: hidden;
  background: transparent;
}
.hero-walker {
  position: absolute;
  bottom: 0;
  transform: translateZ(0);
}
.hero-walker img {
  display: block;
  pointer-events: none;
  user-select: none;
}
.hero-walker.hero-building {
  opacity: 0;
  transition: opacity 1s ease;
  will-change: transform;
}
.hero-walker.hero-building.loaded {
  opacity: 1;
}
/* 군중 — 행별 밝기는 JS inline filter로 적용, 로드 전 숨김 → fade-in */
.hero-walker.hero-crowd {
  opacity: 0;
  transition: opacity 0.6s ease;
  will-change: transform;
}
.hero-walker.hero-crowd.loaded {
  opacity: 1;
}
/* 히어로 중앙 문구 */
.hero-tagline {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  text-align: center;
  pointer-events: none;
  user-select: none;
  padding: 24px 48px;
  background: none;
  border: none;
  box-shadow: none;
}
.hero-tagline h2 {
  font-size: 3.6rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin: 0;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 1.5px rgba(255,255,255,0.45);
  text-shadow:
    0 1px 0 rgba(255,255,255,0.5),
    0 -1px 0 rgba(255,255,255,0.12),
    0 4px 16px rgba(0,0,0,0.55),
    0 0 40px rgba(200,180,255,0.18);
  filter: drop-shadow(0 2px 10px rgba(0,0,0,0.40));
}
.hero-tagline p {
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0.3rem 0 0;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,0.30);
  text-shadow:
    0 1px 0 rgba(255,255,255,0.30),
    0 2px 8px rgba(0,0,0,0.50);
  letter-spacing: 0.04em;
}
[data-theme="dark"] .hero-tagline h2 {
  -webkit-text-stroke: 1.5px rgba(255,255,255,0.60);
  text-shadow:
    0 0 8px rgba(255,255,255,0.40),
    0 0 24px rgba(200,210,255,0.25),
    0 2px 10px rgba(0,0,0,0.35);
  filter: none;
}
[data-theme="dark"] .hero-tagline p {
  -webkit-text-stroke: 1px rgba(255,255,255,0.45);
  text-shadow:
    0 0 6px rgba(255,255,255,0.30),
    0 2px 6px rgba(0,0,0,0.30);
}
/* 배너 하단 물결 2겹 — 배너 아래로 삐져나와 자연스럽게 연결 */
.hero-wave {
  position: absolute;
  bottom: -60px;
  left: 0;
  width: 100%;
  height: 160px;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  animation: heroWaveFadeIn 1s ease 0.3s forwards;
}
.hero-wave svg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 100%;
}
.hero-wave-back {
  will-change: transform;
  animation: heroWaveScroll 7s linear infinite;
}
.hero-wave-front {
  will-change: transform;
  animation: heroWaveScrollReverse 4.5s linear infinite;
}
.wave-path-back {
  fill: var(--bg-primary);
  opacity: 0.5;
}
.wave-path-front {
  fill: var(--bg-primary);
}
@keyframes heroWaveScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes heroWaveScrollReverse {
  0%   { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}
@keyframes heroWaveFadeIn {
  to { opacity: 1; }
}
/* "나" — 군중 속 자연스럽게, 컬러 유지 + 은은한 글로우 */
.hero-walker.hero-me {
  opacity: 0;
  transition: opacity 0.6s ease;
  filter:
    saturate(1.12)
    drop-shadow(0 0 5px rgba(49, 130, 246, 0.42))
    drop-shadow(0 0 18px rgba(49, 130, 246, 0.28))
    drop-shadow(0 8px 18px rgba(49, 130, 246, 0.12));
  will-change: transform;
}
.hero-walker.hero-me.loaded {
  opacity: 1;
}
[data-theme="dark"] .hero-walker.hero-me {
  filter:
    saturate(1.18)
    drop-shadow(0 0 6px rgba(99, 170, 255, 0.52))
    drop-shadow(0 0 22px rgba(99, 170, 255, 0.34))
    drop-shadow(0 8px 20px rgba(99, 170, 255, 0.16));
}
@keyframes heroWalkRight {
  from { transform: translateX(-1600px); }
  to { transform: translateX(calc(100vw + 1600px)); }
}
@keyframes heroWalkLeft {
  from { transform: translateX(calc(100vw + 1600px)); }
  to { transform: translateX(-1600px); }
}
@media (max-width: 768px) {
  .home-hero-illustration { height: 400px; }
  .hero-tagline h2 { font-size: 2.4rem; }
  .hero-tagline p { font-size: 0.95rem; }
}
/* 가운데 제목 칸은 left: 50% 인 절대 위치라 쓸 수 있는 폭이 화면 절반으로 줄어, 휴대폰에서 한 단어씩 세로로 쪼개졌다.
   폭은 글 길이에 맞추고 화면 폭 안으로만 줄인다 (2026-12-05 반응형) */
.hero-tagline { width: max-content; max-width: calc(100% - 32px); }
@media (max-width: 480px) {
  .hero-tagline { padding: 20px 12px; }
  .hero-tagline h2 { font-size: 2.1rem; }
}

/* 글쓰기 버튼 */
.write-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--text-secondary);
  transition: color var(--transition), background var(--transition);
}
.write-btn:hover {
  color: var(--accent);
  background: var(--bg-tertiary);
}

/* === 티스토리 관리 툴바 스타일 오버라이드 === */
.btn_tool {
  display: flex;
  align-items: center;
}
/* 관리메뉴 — JS가 header-right로 이동시킨 후 inline 표시 */
.menu_toolbar {
  position: static !important;
  z-index: auto !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  height: auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}
/* header-right 안에 있을 때만 표시, 아직 body에 있으면 숨김 */
body > .menu_toolbar {
  position: fixed !important;
  top: -9999px !important;
  left: -9999px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.header-right > .menu_toolbar,
.header-right .menu_toolbar {
  position: static !important;
  top: auto !important;
  left: auto !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
.btn_menu_toolbar {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 8px !important;
  color: var(--text-secondary) !important;
  background: none !important;
  border: none !important;
  cursor: pointer !important;
  padding: 0 !important;
}
.btn_menu_toolbar:hover {
  color: var(--text-primary) !important;
  background: var(--bg-tertiary) !important;
}
.ico_tistory_sign {
  font-size: 0 !important;
  width: 18px !important;
  height: 18px !important;
  display: block !important;
  background: none !important;
  background-image: none !important;
}
.ico_tistory_sign::after {
  content: '' !important;
  display: block !important;
  width: 18px !important;
  height: 18px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z'/%3E%3C/svg%3E") !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
}
[data-theme="dark"] .ico_tistory_sign::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z'/%3E%3C/svg%3E") !important;
}
/* 관리메뉴 드롭다운 */
.header_layer { border-radius: 12px !important; box-shadow: 0 4px 20px rgba(0,0,0,.12) !important; }
/* 구독 버튼 — 티스토리 자동 생성 (.btn_subscription) 숨김 */
.btn_subscription {
  display: none !important;
  gap: 4px !important;
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  border-radius: 8px !important;
  background: none !important;
  border: none !important;
  cursor: pointer !important;
  color: var(--text-secondary) !important;
  transition: color var(--transition), background var(--transition) !important;
}
.btn_subscription:hover {
  color: var(--text-primary) !important;
  background: var(--bg-tertiary) !important;
}
.btn_subscription .txt_tool_id { display: none !important; }
.btn_subscription .txt_state { display: none !important; }
.btn_subscription .ico_check_type1 { display: none !important; }
/* 구독 아이콘 스타일 */
.btn_subscription .ico_tool {
  width: 18px !important;
  height: 18px !important;
}

/* === 방명록 === */

/* 히어로 */
.gb-hero {
  text-align: center;
  padding: 40px 0 30px;
}
.guestbook-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.gb-subtitle {
  font-size: 15px;
  color: var(--text-tertiary);
  margin: 0;
}

/* 방명록 Lottie 고양이 */
dotlottie-player {
  pointer-events: none;
  user-select: none;
}

.guestbook-form {
  margin-bottom: 40px;
}
.guestbook-form-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.gb-input {
  flex: 1;
  min-width: 0; /* 입력란 기본 폭(size=20)보다 좁은 휴대폰에서도 줄어들게 */
  height: 40px;
  padding: 0 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--transition);
}
.gb-input:focus { border-color: var(--accent); }
.gb-input::placeholder { color: var(--text-tertiary); }

.gb-textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  font-family: var(--font-sans);
  outline: none;
  resize: vertical;
  transition: border-color var(--transition);
}
.gb-textarea:focus { border-color: var(--accent); }
.gb-textarea::placeholder { color: var(--text-tertiary); }

.guestbook-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.gb-secret {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-tertiary);
  cursor: pointer;
}
.gb-submit {
  padding: 8px 20px;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-sans);
  transition: background var(--transition);
}
.gb-submit:hover { background: var(--accent-hover); }

.guestbook-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.guestbook-list:empty { display: none; }
.guestbook .pagination { border: none; }
.guestbook .pagination:empty { display: none; }

/* 방명록 카드 */
.gb-item {
  padding: 20px;
  margin-bottom: 12px;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-light);
  transition: box-shadow var(--transition);
}
.gb-item:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.gb-item-main { }
.gb-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.gb-author-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gb-author {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.gb-author a {
  color: var(--text-primary);
  text-decoration: none;
}
.gb-author a:hover { color: var(--accent); }
.gb-date {
  font-size: 12px;
  color: var(--text-tertiary);
}
.gb-date a { color: var(--text-tertiary); font-size: 12px; }
.gb-body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  word-break: break-word;
}

/* 답글/삭제 버튼 */
.gb-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition);
}
.gb-item:hover .gb-item-actions,
.gb-reply:hover .gb-item-actions {
  opacity: 1;
}
.gb-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}
.gb-action-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.gb-delete-btn:hover {
  color: #e53e3e;
  background: rgba(229, 62, 62, 0.08);
}
.gb-reply-btn:hover {
  color: var(--accent);
  background: rgba(59, 130, 246, 0.08);
}

/* 답글 영역 */
.gb-replies {
  margin-top: 16px;
  padding-top: 12px;
  padding-left: 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gb-reply {
  position: relative;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border-radius: 10px;
  border-left: 3px solid var(--accent);
}
/* 들여쓰기 화살표 */
.gb-reply::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 16px;
  width: 14px;
  height: 14px;
  border-left: 2px solid var(--border-color);
  border-bottom: 2px solid var(--border-color);
  border-radius: 0 0 0 5px;
}
.gb-reply-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 8px;
}
.gb-reply .gb-author-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
/* 답글 작성자 — accent 색으로 강조 */
.gb-reply .gb-author {
  font-weight: 600;
  font-size: 13px;
  color: var(--accent);
}
.gb-reply .gb-date {
  font-size: 12px;
  color: var(--text-tertiary);
}
.gb-reply .gb-body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  word-break: break-word;
}
/* 답글 삭제 버튼 */
.gb-reply .gb-item-actions {
  opacity: 0;
  transition: opacity var(--transition);
}
.gb-reply:hover .gb-item-actions {
  opacity: 1;
}

/* 비밀글 배지 — 날짜 옆에 표시 */
.secret-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 8px;
  padding: 2px 8px;
  background: var(--bg-tertiary);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  vertical-align: middle;
}
.secret-badge svg {
  opacity: 0.5;
  flex-shrink: 0;
}
/* 방명록 수정 버튼 hover */
.gb-modify-btn:hover {
  color: var(--accent);
  background: rgba(59, 130, 246, 0.08);
}

/* 방명록 인라인 답글 폼 — 댓글 섹션의 .inline-reply-form 스타일 위에 방명록용 조정 */
.guestbook .inline-reply-form {
  background: var(--bg-primary);
  border-color: var(--border-light);
  border-radius: 10px;
}
.guestbook .inline-reply-meta .gb-input {
  padding: 7px 10px;
  font-size: 13px;
}
.guestbook .inline-reply-textarea {
  font-size: 13px;
  padding: 8px 10px;
  min-height: 72px;
}
.guestbook .inline-reply-actions {
  justify-content: space-between;
}
.guestbook .inline-reply-actions .gb-secret {
  font-size: 12px;
  color: var(--text-tertiary);
  cursor: pointer;
  user-select: none;
}
.guestbook .inline-reply-actions .gb-secret input {
  margin-right: 4px;
  vertical-align: middle;
}

/* 방명록 수정 폼 */
.gb-inline-edit-form {
  margin-top: 10px;
}
.gb-inline-edit-form .comment-edit-textarea {
  font-size: 14px;
  min-height: 80px;
}
.gb-inline-edit-form .inline-reply-actions {
  justify-content: flex-end;
  gap: 8px;
}

/* 로그인 사용자 — 이름/비밀번호 필드 숨김 (JS에서 .logged-in 추가) */
.logged-in .comment-form-meta,
.logged-in .guestbook-form-meta { display: none; }


/* 프로필 레이어 트리거 숨김 */
.tistoryProfileLayerTrigger { display: none !important; }

/* === 푸터 === */
.site-footer {
  border-top: 1px solid var(--border-light);
  padding: 48px 24px 40px;
  margin-top: 40px;
  background: var(--bg-secondary);
}

.footer-inner {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.footer-links {
  display: flex;
  gap: 20px;
}
.footer-links a {
  font-size: 13px;
  color: var(--text-tertiary);
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--text-primary); }

/* === 스크롤 탑 === */
.scroll-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition), color var(--transition), border-color var(--transition);
  z-index: 500;
}
.scroll-top.visible {
  opacity: 1;
  pointer-events: all;
  transform: scale(1);
}
.scroll-top:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,0.12));
}

/* === 보호글 === */
.protected-post {
  text-align: center;
  padding: 80px 20px;
}
.protected-icon {
  margin-bottom: 20px;
  color: var(--text-tertiary);
}
.protected-post h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  word-break: keep-all;
}
.protected-post h2 a { color: inherit; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.protected-post p {
  color: var(--text-tertiary);
  font-size: 14px;
  margin-bottom: 24px;
}
.protected-form {
  display: flex;
  gap: 8px;
  max-width: 320px;
  margin: 0 auto;
}
.protected-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}
.protected-input:focus { border-color: var(--accent); }
.protected-submit {
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.protected-submit:hover { background: var(--accent-hover); }

/* === 티스토리 콘텐츠 요소 === */
/* 파일 첨부 */
.post-body .fileblock {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin: 16px 0;
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color var(--transition);
}
.post-body .fileblock:hover { border-color: var(--accent); }
.post-body .fileblock .filename { font-weight: 500; }
.post-body .fileblock .size { color: var(--text-tertiary); font-size: 13px; }

/* 오픈그래프 링크 카드 */
.post-body .og-container,
.post-body figure.og_container,
.post-body .tt-og {
  display: block;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  margin: 20px 0;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.post-body .og-container:hover,
.post-body figure.og_container:hover,
.post-body .tt-og:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

/* 이미지 블록 (figure) */
.post-body figure {
  margin: 20px 0;
}
.post-body figure img {
  border-radius: 8px;
}
.post-body figcaption,
.post-body .imageblock .cap1 {
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 8px;
}

/* 티스토리 인용구 변형 */
.post-body blockquote[data-ke-style="style1"] { border-left-color: var(--accent); }
.post-body blockquote[data-ke-style="style2"] {
  border-left: none;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-align: left !important;
  font-style: italic;
}
.post-body blockquote[data-ke-style="style3"] {
  border-left: none;
  background: none;
  padding: 20px 0;
  border-top: 2px solid var(--border-color);
  border-bottom: 2px solid var(--border-color);
  border-radius: 0;
  text-align: left !important;
}

/* === 반응형 === */
/* 넓은 데스크톱: 우측 여백에 따라오는 고정 목차 (본문과 겹치지 않음)
   본문 오른쪽 끝 + 간격 32px + 목차 248px + 여백 24px이 화면 안에 들어가야 한다.
   본문 860px이면 1468px부터 들어가므로, 1348~1467px 글 상세에서는 본문을 화면 폭 - 608px(740~859px)로 줄인다. */
@media (min-width: 1348px) and (max-width: 1467px) {
  #tt-body-page { --content-max: calc(100vw - 608px); }
}
@media (min-width: 1348px) {
  .post-detail {
    position: relative;
  }
  .post-detail .toc-wrapper.visible {
    position: fixed;
    top: calc(var(--header-height) + 64px);
    right: max(24px, calc((100vw - var(--content-max)) / 2 - 280px));
    width: 248px;
    max-height: calc(100vh - var(--header-height) - 108px);
    overflow: hidden;
    margin: 0;
    padding: 16px 14px 14px;
    z-index: 60;
    background: color-mix(in srgb, var(--bg-primary) 88%, transparent);
    backdrop-filter: blur(18px) saturate(1.15);
    -webkit-backdrop-filter: blur(18px) saturate(1.15);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.28s ease 0.05s, transform 0.28s ease 0.05s, box-shadow var(--transition);
    animation: tocEntrance 0.4s cubic-bezier(0.16, 1, 0.3, 1) backwards;
  }
  .post-detail .toc-wrapper.visible::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 55%);
    pointer-events: none;
  }
  .post-detail .toc-wrapper.visible.toc-hidden {
    opacity: 0;
    transform: translateX(12px);
    pointer-events: none;
  }
  .post-detail .toc-wrapper.visible .toc-progress {
    display: block;
  }
  .post-detail .toc {
    max-height: calc(100vh - var(--header-height) - 176px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
    padding-right: 4px;
  }
  /* 접힌 상태: 우측 가장자리에 붙는 얇은 탭 */
  .post-detail .toc-wrapper.collapsed {
    width: 46px;
    height: 46px;
    padding: 0;
    display: flex;
    align-items: center;
    border-radius: 14px;
    overflow: hidden;
    right: 24px;
  }
  .post-detail .toc-wrapper.collapsed .toc-label,
  .post-detail .toc-wrapper.collapsed .toc-top,
  .post-detail .toc-wrapper.collapsed .toc-count,
  .post-detail .toc-wrapper.collapsed .toc,
  .post-detail .toc-wrapper.collapsed .toc-progress {
    display: none;
  }
  .post-detail .toc-wrapper.collapsed .toc-title {
    margin: 0;
    justify-content: center;
    width: 100%;
  }
  .post-detail .toc-wrapper.collapsed .toc-toggle {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
  }
}

/* 모바일/태블릿: 플로팅 "목차" 버튼 + 바텀 시트 */
@media (max-width: 1347px) {
  .toc-wrapper.visible { display: none; }

  body.toc-sheet-open { overflow: hidden; }

  .toc-fab {
    position: fixed;
    right: 16px;
    bottom: 100px;
    z-index: 1200;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg-primary) 90%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition), color var(--transition), border-color var(--transition);
  }
  .toc-fab.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .toc-fab:hover {
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: var(--shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.12));
  }

  .toc-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1490;
    display: block;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .toc-sheet-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .toc-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    max-height: 74vh;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.18);
    transform: translateY(105%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0.24, 1);
  }
  .toc-sheet.open { transform: translateY(0); }
  .toc-sheet::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    width: 38px;
    height: 4px;
    border-radius: 99px;
    background: var(--border-color);
    transform: translateX(-50%);
  }
  .toc-sheet-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 18px 18px 10px;
  }
  .sheet-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
  }
  .sheet-count {
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    color: var(--bg-primary);
    background: var(--text-tertiary);
    border-radius: 999px;
    padding: 4px 8px;
  }
  [data-theme="dark"] .sheet-count { background: var(--text-secondary); }
  .sheet-close {
    margin-left: auto;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    color: var(--text-secondary);
    transition: color var(--transition), background var(--transition);
  }
  .sheet-close:hover {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
  }
  .toc-sheet .toc {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    padding: 2px 10px 24px;
    max-height: 62vh;
  }
  .toc-sheet .toc a {
    padding: 11px 12px 11px 24px;
    font-size: 15px;
    border-radius: 10px;
  }
}

/* 모바일 전역 레이아웃 (기존 브레이크포인트 유지) */
@media (max-width: 768px) {
  :root { --font-size-base: 16px; }

  .main-nav { display: none; }

  .content-wrapper { padding: 28px 16px 60px; }

  /* 모바일 목록: 썸네일은 오른쪽에 작게, 첫 글만 크게 */
  .post-card { padding: 24px 0; }
  .post-card-inner { flex-direction: row-reverse; gap: 16px; align-items: flex-start; }
  .post-thumbnail { width: 92px; height: 68px; border-radius: 10px; }
  .post-title { font-size: 18px; margin-bottom: 6px; }
  .post-summary { font-size: 14px; margin-bottom: 10px; }
  .post-list .post-card:first-child .post-title { font-size: 23px; }
  .list-header-title { font-size: 26px; }

  .footer-copy { justify-content: center; }

  .post-detail-title { font-size: 26px; }

  .post-navigation { grid-template-columns: 1fr; }

  .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
}

/* =====================================================
   1. 이미지 라이트박스
   ===================================================== */
#lightboxOverlay {
  position: fixed;
  inset: 0;
  z-index: 99990;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--transition);
}
#lightboxOverlay.active {
  opacity: 1;
  pointer-events: all;
}
.lightbox-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.lightbox-img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  transform: scale(1);
  transition: transform 0.15s ease;
  cursor: zoom-in;
  user-select: none;
  box-shadow: 0 8px 48px rgba(0,0,0,0.6);
}
.lightbox-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 99991;
}
.lightbox-close:hover { background: rgba(255,255,255,0.28); }

/* post-body 이미지에 클릭 가능 힌트 */
#postBody img:not([src=""]):not([src^="data:"]) {
  cursor: zoom-in;
  transition: opacity var(--transition), transform var(--transition);
}
#postBody img:not([src=""]):not([src^="data:"]):hover {
  opacity: 0.88;
}

/* =====================================================
   2. 글 공유 버튼 개선
   ===================================================== */
.share-kakao { color: #3a1d1d; }
[data-theme="dark"] .share-kakao { color: #f9e000; }
.share-kakao svg { fill: #3c1e1e; }
[data-theme="dark"] .share-kakao svg { fill: #f9e000; }
.share-twitter { color: var(--text-secondary); }
.share-copy { color: var(--text-secondary); }

/* =====================================================
   3. 방문자 환영 메시지 — showToast 공통 스타일로 처리
   ===================================================== */

/* =====================================================
   4. 검색 최근 검색어 드롭다운
   ===================================================== */
.recent-searches-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 1010;
  overflow: hidden;
  animation: fadeSlideDown 0.18s ease;
}
.recent-searches-dropdown.open { display: block; }

@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.recent-searches-header {
  padding: 10px 16px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.recent-search-item {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  cursor: pointer;
  transition: background var(--transition);
}
.recent-search-item:hover { background: var(--bg-secondary); }

.recent-search-term {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-search-delete {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-tertiary);
  background: none;
  border: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.recent-search-delete:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* =====================================================
   5. 다크모드 전환 ripple 레이어
   ===================================================== */
#themeRipple {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 99998;
  pointer-events: none;
  clip-path: circle(0px at 50% 50%);
}

/* =====================================================
   6. 포스트 카드 hover 툴팁
   ===================================================== */
.card-tooltip {
  position: absolute;
  width: 240px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
  box-shadow: var(--shadow-md);
  z-index: 900;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.card-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}
@media (pointer: coarse) {
  .card-tooltip { display: none !important; }
}

/* ==========================================================================
   2026-12 개편: 카테고리 색, 홈 타임라인, 글 표지, 본문 글꼴 정리
   --cat(카테고리 색)은 script.js의 catColor()가 카드와 글 상세에 넣어 준다.
   ========================================================================== */
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

/* --- 홈 머리말 --- */
.home-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  font: 600 12.5px/1 var(--font-sans);
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}
.home-eyebrow::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: lbPulse 2.4s ease-in-out infinite;
}
@keyframes lbPulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, #22c55e 24%, transparent); }
  50% { box-shadow: 0 0 0 7px color-mix(in srgb, #22c55e 0%, transparent); }
}
.home-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
}
.home-section-head h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text-primary);
}
.home-section-meta {
  font: 500 13px var(--font-mono);
  color: var(--text-tertiary);
}

/* --- 최신 글 (홈 첫 페이지 첫 카드) --- */
.is-timeline .post-feature {
  padding: 0 0 8px;
  margin-bottom: 52px;
  border-bottom: 0;
}
.is-timeline .post-feature .post-card-inner {
  flex-direction: column;
  align-items: stretch;
  gap: 22px;
}
.is-timeline .post-feature .post-thumbnail {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 1.85;
  border-radius: 20px;
  border: 1px solid var(--border-light);
  box-shadow: 0 24px 48px -30px color-mix(in srgb, var(--cat, var(--accent)) 75%, transparent);
}
.is-timeline .post-feature .post-thumbnail img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.is-timeline .post-feature .post-title {
  font-size: 30px;
  line-height: 1.34;
  letter-spacing: -0.7px;
  margin-bottom: 12px;
  text-wrap: balance;
}
.is-timeline .post-feature .post-summary {
  font-size: 16px;
  -webkit-line-clamp: 3;
}

/* --- 최신 글 세 편 (홈 첫 페이지, 2026-12-05 큰 카드 한 장 대신) --- */
.home-latest {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin: 0 0 52px;
}
.post-list .home-latest .post-card.latest-card {
  padding: 0;
  margin: 0;
  border: 0;
}
.post-list .home-latest .post-card.latest-card .post-card-inner {
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}
.post-list .home-latest .post-card.latest-card .post-thumbnail {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  border: 1px solid var(--border-light);
}
.post-list .home-latest .post-card.latest-card .post-thumbnail img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.post-list .home-latest .post-card.latest-card .post-thumbnail::after { display: none; }
.post-list .home-latest .post-thumbnail.is-empty {
  display: flex;
  align-items: flex-end;
  padding: 14px 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--cat, var(--accent)) 22%, var(--bg-secondary)), color-mix(in srgb, var(--cat, var(--accent)) 6%, var(--bg-secondary)));
  color: var(--cat, var(--accent));
  font: 700 14px/1.3 var(--font-sans);
  text-decoration: none;
}
.post-list .home-latest .post-card.latest-card .post-meta { margin-bottom: 8px; gap: 8px; flex-wrap: wrap; }
.post-list .home-latest .post-card.latest-card .post-title {
  font-size: 17px;
  line-height: 1.45;
  letter-spacing: -0.3px;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.post-list .home-latest .post-card.latest-card .post-summary,
.post-list .home-latest .post-card.latest-card .post-footer { display: none; }
@media (max-width: 760px) {
  /* 휴대폰은 옆으로 넘겨 본다 */
  .home-latest {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 74%;
    gap: 14px;
    margin: 0 -16px 40px;
    padding: 0 16px 4px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 16px;
    scrollbar-width: none;
  }
  .home-latest::-webkit-scrollbar { display: none; }
  .home-latest .post-card { scroll-snap-align: start; }
  .post-list .home-latest .post-card.latest-card .post-title { font-size: 16px; }
}

/* 목록 카드의 카테고리는 카테고리 색으로 */
.is-timeline .post-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cat, var(--accent));
}
.is-timeline .post-category::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: currentColor;
  transform: rotate(45deg);
}

/* --- 카테고리 칸 --- */
.home-branches { margin: 0 0 56px; }
.branch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr; /* 줄마다 높이가 달라지지 않게 모든 칸을 가장 높은 칸에 맞춘다 */
  gap: 12px;
}
/* 카테고리가 홀수 개면 마지막 칸이 혼자 남지 않게 두 칸 폭을 다 쓴다 */
.branch-grid > .branch-tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
.branch-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--cat) 11%, var(--bg-primary)), var(--bg-primary) 72%);
  border: 1px solid color-mix(in srgb, var(--cat) 20%, var(--border-light));
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.branch-tile::after {
  content: '';
  position: absolute;
  right: -30px;
  top: -30px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 16px solid color-mix(in srgb, var(--cat) 10%, transparent);
  pointer-events: none;
  transition: transform 0.4s ease;
}
.branch-tile:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--cat) 48%, var(--border-light));
  box-shadow: 0 16px 32px -20px color-mix(in srgb, var(--cat) 80%, transparent);
}
.branch-tile:hover::after { transform: scale(1.18); }
.branch-main {
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
}
.branch-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.branch-main::before {
  content: '';
  position: absolute;
  inset: 0;
}
.branch-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--cat);
  background: color-mix(in srgb, var(--cat) 15%, transparent);
}
.branch-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}
.branch-count {
  font-size: 13px;
  color: var(--text-tertiary);
}
.branch-count b {
  margin-right: 2px;
  font: 700 13px var(--font-mono);
  color: var(--cat);
}
.branch-subs {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.branch-subs a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.branch-subs a i {
  font: normal 600 11px var(--font-mono);
  color: var(--text-tertiary);
}
.branch-subs a:hover {
  color: var(--cat);
  border-color: color-mix(in srgb, var(--cat) 45%, transparent);
}
.branch-subs a.is-empty { opacity: 0.55; }
.branch-tile.is-empty .branch-icon { filter: saturate(0.5); }

/* --- 연도별 타임라인 --- */
.is-timeline .timeline-year {
  position: relative;
  padding: 18px 0 4px 40px;
}
.is-timeline .timeline-year::before,
.is-timeline .timeline-item::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-light);
}
[data-theme="dark"] .is-timeline .timeline-year::before,
[data-theme="dark"] .is-timeline .timeline-item::before { background: var(--border-color); }
.is-timeline > .timeline-year:first-child::before,
.is-timeline .home-section-head + .timeline-year::before { top: 31px; }
.is-timeline .timeline-year span {
  position: relative;
  display: inline-block;
  padding: 6px 11px;
  border-radius: 999px;
  font: 700 12px/1 var(--font-mono);
  letter-spacing: 0.1em;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
}
.is-timeline .timeline-year span::before {
  content: '';
  position: absolute;
  left: -33px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-radius: 3px;
  background: var(--text-tertiary);
  transform: rotate(45deg);
}
.is-timeline .timeline-item {
  position: relative;
  padding: 22px 0 22px 40px;
  border-bottom: 0;
}
.is-timeline .timeline-item::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 33px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-sizing: border-box;
  background: var(--bg-primary);
  border: 2.5px solid var(--cat, var(--accent));
  transition: background 0.2s ease, transform 0.2s ease;
}
.is-timeline .timeline-item:hover::after {
  background: var(--cat, var(--accent));
  transform: scale(1.2);
}
.is-timeline .timeline-item:last-child::before { bottom: auto; height: 39px; }
.is-timeline .timeline-item .post-card-inner {
  align-items: flex-start;
  margin: -14px -16px;
  padding: 14px 16px;
  border-radius: 16px;
  transition: background 0.2s ease;
}
.is-timeline .timeline-item:hover .post-card-inner { background: var(--bg-secondary); }
.is-timeline .timeline-item .post-title { font-size: 19px; }
.is-timeline .timeline-item .post-summary { margin-bottom: 4px; }
.is-timeline .timeline-item .post-footer:not(:has(.post-comment:not(.is-zero))) { display: none; }

/* --- 글 상세 표지 --- */
.post-header.lb-cover {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 0 0 40px;
  padding: 38px 32px 28px;
  border-radius: 22px;
  border: 1px solid var(--border-light);
  background:
    radial-gradient(540px 260px at 100% 0%, color-mix(in srgb, var(--cat) 22%, transparent), transparent 70%),
    radial-gradient(380px 220px at 0% 100%, color-mix(in srgb, var(--cat) 9%, transparent), transparent 70%),
    var(--bg-secondary);
}
.lb-cover::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(color-mix(in srgb, var(--text-primary) 14%, transparent) 1px, transparent 1.3px);
  background-size: 16px 16px;
  -webkit-mask-image: linear-gradient(205deg, #000 8%, transparent 55%);
  mask-image: linear-gradient(205deg, #000 8%, transparent 55%);
}
.lb-cover::after {
  content: 'β';
  position: absolute;
  right: 22px;
  bottom: -58px;
  z-index: -1;
  font: 800 220px/1 var(--font-sans);
  color: var(--cat);
  opacity: 0.08;
  pointer-events: none;
}
.lb-cover .post-header-meta {
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.lb-cover .post-category-badge {
  padding: 4px 12px;
  font-size: 12.5px;
  color: var(--cat);
  background: color-mix(in srgb, var(--cat) 13%, var(--bg-primary));
  border: 1px solid color-mix(in srgb, var(--cat) 30%, transparent);
}
[data-theme="dark"] .lb-cover .post-category-badge { color: color-mix(in srgb, var(--cat) 65%, #fff); }
.crumb-sep {
  margin: 0 6px;
  font-style: normal;
  opacity: 0.45;
}
.lb-cover .post-date {
  font: 500 13px var(--font-mono);
  color: var(--text-tertiary);
}
.post-number {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 7px;
  border: 1px dashed var(--border-color);
  font: 600 12px var(--font-mono);
  color: var(--text-tertiary);
}
.lb-cover .post-detail-title {
  font-size: 38px;
  line-height: 1.28;
  letter-spacing: -1px;
  margin-bottom: 24px;
  text-wrap: balance;
}
.lb-cover .post-author-row {
  padding-top: 16px;
  border-top: 1px dashed color-mix(in srgb, var(--text-primary) 15%, transparent);
}
@media (min-width: 900px) {
  .post-header.lb-cover { margin: 0 -36px 44px; padding: 44px 36px 30px; }
}

/* --- 본문 글꼴 --- */
/* 티스토리 content.css가 #tt-body-page h2[data-ke-size]의 굵기를 normal로 덮어서 !important로 되돌린다 */
#tt-body-page .post-body { counter-reset: lb-h2; }
#tt-body-page .post-body h2,
#tt-body-page .post-body h2[data-ke-size] {
  font-size: 26px !important;
  font-weight: 800 !important;
  line-height: 1.4 !important;
  letter-spacing: -0.5px;
  margin: 64px 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}
#tt-body-page .post-body h2::before {
  counter-increment: lb-h2;
  content: counter(lb-h2, decimal-leading-zero);
  display: block;
  margin-bottom: 9px;
  font: 700 12px/1 var(--font-mono);
  letter-spacing: 0.16em;
  color: var(--cat, var(--accent));
}
#tt-body-page .post-body h3,
#tt-body-page .post-body h3[data-ke-size] {
  font-size: 21px !important;
  font-weight: 750 !important;
  line-height: 1.45 !important;
  letter-spacing: -0.3px;
  margin: 44px 0 12px;
}
#tt-body-page .post-body h3::before {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 12px;
  border-radius: 2px;
  background: var(--cat, var(--accent));
  transform: translateY(-3px) rotate(45deg);
}
#tt-body-page .post-body h4,
#tt-body-page .post-body h4[data-ke-size] {
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 1.5 !important;
  color: var(--text-primary);
  margin: 32px 0 10px;
}
/* h2 없이 h3로 단락을 나눈 글 (script.js가 sections-h3를 붙인다) */
#tt-body-page .post-body.sections-h3 h3,
#tt-body-page .post-body.sections-h3 h3[data-ke-size] {
  font-size: 24px !important;
  font-weight: 800 !important;
  line-height: 1.4 !important;
  letter-spacing: -0.5px;
  margin: 60px 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}
#tt-body-page .post-body.sections-h3 h3::before {
  counter-increment: lb-h2;
  content: counter(lb-h2, decimal-leading-zero);
  display: block;
  width: auto;
  height: auto;
  margin: 0 0 9px;
  border-radius: 0;
  background: none;
  transform: none;
  font: 700 12px/1 var(--font-mono);
  letter-spacing: 0.16em;
  color: var(--cat, var(--accent));
}
#tt-body-page .post-body.sections-h3 h4::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 11px;
  border-radius: 2px;
  background: var(--cat, var(--accent));
  transform: translateY(-2px) rotate(45deg);
}
#tt-body-page .post-body hr + :is(h2, h3) { margin-top: 0; }
#tt-body-page .post-body p { line-height: 1.8; }
#tt-body-page .post-body p.lb-lead {
  font-size: 19px;
  line-height: 1.78;
  letter-spacing: -0.2px;
  color: var(--text-primary);
}

/* 목록 표시 */
#tt-body-page .post-body ul > li {
  position: relative;
  list-style: none !important;
  line-height: 1.8;
}
#tt-body-page .post-body ul > li::before {
  content: '';
  position: absolute;
  left: -17px;
  top: calc(0.9em - 3px);
  width: 6px;
  height: 6px;
  border-radius: 1.5px;
  background: var(--cat, var(--accent));
  transform: rotate(45deg);
}
#tt-body-page .post-body ul ul > li::before {
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid var(--cat, var(--accent));
  box-sizing: border-box;
  transform: none;
}
#tt-body-page .post-body ol > li { line-height: 1.8; }
#tt-body-page .post-body ol > li::marker {
  font-family: var(--font-mono);
  font-size: 0.88em;
  font-weight: 700;
  color: var(--cat, var(--accent));
}

/* 인용구: 에디터 스타일과 상관없이 같은 모양으로 */
#tt-body-page .post-body blockquote,
#tt-body-page .post-body blockquote[data-ke-style] {
  position: relative;
  margin: 32px 0 !important;
  padding: 20px 24px 20px 56px !important;
  border: 0 !important;
  border-left: 3px solid var(--cat, var(--accent)) !important;
  border-radius: 4px 14px 14px 4px !important;
  background: color-mix(in srgb, var(--cat, var(--accent)) 7%, var(--bg-secondary)) !important;
  font-size: 16px !important;
  font-style: normal !important;
  line-height: 1.75 !important;
  color: var(--text-primary) !important;
}
#tt-body-page .post-body blockquote::before {
  content: '\201C';
  position: absolute;
  left: 18px;
  top: 12px;
  font: 800 40px/1 Georgia, 'Times New Roman', serif;
  color: var(--cat, var(--accent));
  opacity: 0.55;
}
#tt-body-page .post-body blockquote[data-ke-style="style3"] {
  padding-left: 24px !important;
  border: 1px dashed color-mix(in srgb, var(--cat, var(--accent)) 40%, var(--border-color)) !important;
  border-radius: 14px !important;
}
#tt-body-page .post-body blockquote[data-ke-style="style3"]::before { content: none; }
[data-theme="dark"] #tt-body-page .post-body blockquote,
[data-theme="dark"] #tt-body-page .post-body blockquote[data-ke-style] {
  background: color-mix(in srgb, var(--cat, var(--accent)) 12%, var(--bg-tertiary)) !important;
}
#tt-body-page .post-body blockquote p { font-size: inherit !important; color: inherit !important; }

/* 구분선: 에디터 구분선 그림 대신 가는 선과 β */
#tt-body-page .post-body hr,
#tt-body-page .post-body hr[data-ke-style] {
  position: relative;
  overflow: visible;
  width: 100% !important;
  height: 1px !important;
  margin: 52px auto !important;
  border: 0 !important;
  background: linear-gradient(90deg, transparent, var(--border-color) 18%, var(--border-color) 82%, transparent) !important;
}
#tt-body-page .post-body hr::after {
  content: 'β';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -52%);
  padding: 0 14px;
  background: var(--bg-primary);
  font: 700 15px/1 var(--font-sans);
  color: var(--cat, var(--accent));
}

/* 이미지 */
#tt-body-page .post-body figure img,
#tt-body-page .post-body .imageblock img {
  border-radius: 14px;
}
#tt-body-page .post-body figure.imageblock:not(:has(figcaption)) img {
  box-shadow: 0 0 0 1px var(--border-light);
}

/* --- 블로그 소개 카드 --- */
.author-card {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin: 28px 0 10px;
  padding: 22px 24px;
  border-radius: 18px;
  border: 1px solid var(--border-light);
  background: linear-gradient(135deg, color-mix(in srgb, var(--cat, var(--accent)) 10%, var(--bg-secondary)), var(--bg-secondary) 62%);
}
.author-card-avatar {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  margin: 0 !important;
  border-radius: 14px;
}
.author-card-body { min-width: 0; }
.author-card-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}
.author-card-desc {
  margin: 3px 0 12px;
  font-size: 14px;
  color: var(--text-secondary);
}
.author-card-desc:empty { display: none; }
.author-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.author-card-links a {
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.author-card-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* 티스토리가 댓글 위에 넣는 블로그 명함은 위 소개 카드와 내용이 같아서 숨긴다 */
.comments-section .tt_box_namecard { display: none !important; }
/* 태그 치환자가 태그 사이에 넣는 쉼표 글자 숨김 */
.post-tags { font-size: 0; }

/* --- 이전/다음 글 --- */
.post-navigation { margin-top: 18px; gap: 12px; }
.post-nav-link {
  padding: 18px 22px;
  border-radius: 16px;
  background: var(--bg-primary);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.post-nav-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border-color));
}
.post-nav-link.prev .nav-label::before { content: '\2190  '; }
.post-nav-link.next .nav-label::after { content: '  \2192'; }
.post-nav-link .nav-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text-primary);
}

/* --- 푸터 --- */
.site-footer { padding: 44px 24px 28px; }
.site-footer .footer-inner {
  max-width: var(--content-max);
  flex-wrap: wrap;
  gap: 20px 24px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer-brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}
.footer-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}
.footer-desc {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-tertiary);
}
.footer-bottom {
  max-width: var(--content-max);
  margin: 26px auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
}
.footer-bottom .footer-copy { justify-content: space-between; }

/* --- 모바일 --- */
@media (max-width: 768px) {
  .home-branches { margin-bottom: 44px; }
  .branch-grid { gap: 10px; }
  .branch-tile { padding: 14px; border-radius: 16px; gap: 12px; }
  .branch-main { flex-direction: column; align-items: flex-start; gap: 10px; }
  .branch-icon { width: 34px; height: 34px; }
  .branch-name { font-size: 16px; }
  .branch-subs { gap: 5px; }
  .branch-subs a { padding: 2px 8px; font-size: 11.5px; }
  #tt-body-page .post-body.sections-h3 h3,
  #tt-body-page .post-body.sections-h3 h3[data-ke-size] { font-size: 21px !important; margin-top: 52px; }
  .is-timeline .post-feature { margin-bottom: 44px; }
  .is-timeline .post-feature .post-thumbnail { border-radius: 16px; }
  .is-timeline .post-feature .post-title { font-size: 23px; }
  .is-timeline .timeline-year { padding-left: 30px; }
  .is-timeline .timeline-year::before,
  .is-timeline .timeline-item::before { left: 7px; }
  .is-timeline .timeline-year span::before { left: -27px; }
  .is-timeline .timeline-item { padding: 18px 0 18px 30px; }
  .is-timeline .timeline-item::after { left: 2px; top: 29px; }
  .is-timeline .timeline-item:last-child::before { height: 35px; }
  .is-timeline .timeline-item .post-card-inner { margin: -10px -10px; padding: 10px; gap: 14px; }
  .is-timeline .timeline-item .post-title { font-size: 17px; }
  .is-timeline .timeline-item .post-thumbnail { width: 84px; height: 62px; border-radius: 10px; }
  .post-header.lb-cover { padding: 28px 20px 22px; border-radius: 18px; margin-bottom: 32px; }
  .lb-cover::after { font-size: 150px; bottom: -40px; right: 10px; }
  .lb-cover .post-detail-title { font-size: 27px; letter-spacing: -0.6px; }
  #tt-body-page .post-body h2,
  #tt-body-page .post-body h2[data-ke-size] { font-size: 22px !important; margin-top: 52px; }
  #tt-body-page .post-body h3,
  #tt-body-page .post-body h3[data-ke-size] { font-size: 19px !important; }
  #tt-body-page .post-body p.lb-lead { font-size: 17.5px; }
  #tt-body-page .post-body blockquote,
  #tt-body-page .post-body blockquote[data-ke-style] { padding: 18px 18px 18px 48px !important; }
  #tt-body-page .post-body blockquote::before { left: 14px; }
  .author-card { padding: 18px; gap: 14px; }
  .author-card-avatar { width: 44px; height: 44px; border-radius: 12px; }
  .site-footer .footer-inner { justify-content: center; }
  .footer-brand { flex-direction: column; text-align: center; }
  .footer-bottom .footer-copy { justify-content: center; }
}
/* 움직임 줄이기 설정이어도 히어로 캐릭터는 script.js에서 절반 속도로 걷게 한다 (멈추면 원격 데스크톱 등에서 서 있기만 함) */
@media (prefers-reduced-motion: reduce) {
  .home-eyebrow::before { animation: none; }
  .branch-tile, .branch-tile::after, .post-nav-link { transition: none; }
}
