@charset "UTF-8";

/* === VS Code 색상 시스템 === */
:root {
  /* Dark Theme Colors */
  --vscode-bg-main: #1e1e1e;
  --vscode-bg-sidebar: #252526;
  --vscode-bg-activity: #333333;
  --vscode-bg-tabs: #2d2d2d;
  --vscode-bg-statusbar: #007acc;
  --vscode-bg-tab-active: #1e1e1e;
  
  /* Border Colors */
  --vscode-border: #3e3e42;
  --vscode-border-light: #454545;
  
  /* Text Colors */
  --vscode-text-primary: #cccccc;
  --vscode-text-secondary: #858585;
  --vscode-text-accent: #4ec9b0;
  --vscode-text-bright: #ffffff;
  
  /* Editor/Paper Colors */
  --editor-bg: #ffffff;
  --editor-text: #24292f;
  --editor-text-muted: #57606a;
  --editor-border: #d0d7de;
  --editor-hover-bg: #f6f8fa;
  
  /* Accent Colors */
  --accent-blue: #007acc;
  --accent-green: #4ec9b0;
  --accent-orange: #ce9178;
  --accent-purple: #c586c0;
  --accent-red: #f48771;
  
  /* Fonts */
  --font-code: 'Fira Code', 'Consolas', 'Monaco', monospace;
  --font-ui: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  
  /* Layout */
  --sidebar-width: 280px;
  --activity-width: 48px;
  --content-max: 860px;
  --status-height: 22px;
  --tabs-height: 35px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-medium: 0.25s ease;
}

/* === Reset & Base === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100vh; /* 화면 꽉 채우기 */
  overflow: hidden; /* 전체 스크롤 방지 */
  margin: 0;
}

body {
  background: var(--vscode-bg-main);
  color: var(--vscode-text-primary);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.6;
  display: flex;
  flex-direction: column; /* 세로 배치 (앱 + 상태바) */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

ul, li {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* Scrollbar Styling (Global) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #424242;
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background-color: #4e4e4e;
}

/* Utilities */
.mt-10 { margin-top: 10px; }
.pl-10 { padding-left: 10px; }
.pl-20 { padding-left: 20px; }
.pr-20 { padding-right: 20px; }
.ml-15 { margin-left: 15px; }

/* === Mobile Header === */
#mobile-header { display: none; }
#sidebar-overlay { display: none; }
.mobile-only { display: none; }

/* === Layout Structure (PC) === */
#vscode-app { 
  display: flex;
  flex: 1; /* 남은 높이 모두 차지 */
  height: calc(100vh - var(--status-height)); /* 상태바 제외한 높이 */
  overflow: hidden; /* 내부 스크롤 방지 */
  position: relative;
}

/* === Activity Bar === */
#activity-bar {
  width: var(--activity-width);
  background: var(--vscode-bg-activity);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  flex-shrink: 0;
  border-right: 1px solid var(--vscode-border);
  z-index: 10;
}

.activity-top, .activity-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 4px;
}

.activity-icon {
  font-size: 24px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  cursor: pointer;
  color: var(--vscode-text-bright);
  transition: opacity var(--transition-fast);
  position: relative;
}

.activity-icon:hover, .activity-icon.active { opacity: 1; }
.activity-icon.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--vscode-text-bright);
}

/* === Sidebar === */
#sidebar {
  width: var(--sidebar-width);
  background: var(--vscode-bg-sidebar);
  border-right: 1px solid var(--vscode-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  color: var(--vscode-text-primary);
  z-index: 9;
}

.sidebar-header {
  padding: 0 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--vscode-text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: 0.5px;
  height: 35px; /* 높이 고정 */
  text-transform: uppercase;
  flex-shrink: 0;
}

/* 사이드바 내부 스크롤 */
.sidebar-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  font-size: 13px;
  font-family: var(--font-ui);
  padding-bottom: 20px;
}

/* Sidebar Sections */
.section-group { margin-bottom: 2px; }
.section-title {
  font-weight: 700; font-size: 11px; color: var(--vscode-text-primary);
  padding: 4px 20px 4px 8px; cursor: pointer; display: flex; align-items: center;
  text-transform: uppercase; letter-spacing: 0.3px; user-select: none;
  transition: background var(--transition-fast);
}
.section-title:hover { background: rgba(255, 255, 255, 0.05); }
.chevron { margin-right: 6px; font-size: 10px; transition: transform var(--transition-fast); color: var(--vscode-text-secondary); }
.section-group.closed .chevron { transform: rotate(-90deg); }
.section-group.closed .section-item { display: none; }

/* Profile */
.profile-area { display: flex; align-items: center; padding: 12px 20px; gap: 12px; }
.profile-img { width: 32px; height: 32px; border-radius: 4px; border: 2px solid var(--accent-blue); flex-shrink: 0; }
.blog-title { color: var(--vscode-text-bright); font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Search */
.search-box { padding: 8px 20px !important; }
.search-box input {
  width: 100%; background: var(--vscode-bg-main); border: 1px solid var(--vscode-border);
  color: var(--vscode-text-primary); padding: 6px 10px; border-radius: 2px;
  font-size: 13px; font-family: var(--font-ui); transition: border-color var(--transition-fast);
}
.search-box input:focus { border-color: var(--accent-blue); outline: none; }
.search-box input::placeholder { color: var(--vscode-text-secondary); }

/* Category Tree - VS Code Style */
.tree-view { padding: 0 !important; }
.tree-view ul, .tree-view li { list-style: none !important; margin: 0 !important; padding: 0 !important; }
.tree-view img { display: none !important; }

/* Parent Category */
.tree-view > ul > li { margin: 0 !important; }
.tree-view > ul > li > a {
  display: flex !important; align-items: center; padding: 4px 20px 4px 8px !important;
  font-weight: 400 !important; color: var(--vscode-text-primary) !important; cursor: pointer;
  transition: background var(--transition-fast); position: relative;
}
.tree-view > ul > li > a:hover { background: rgba(255, 255, 255, 0.05) !important; }
.tree-view > ul > li > a::before {
  content: '▸' !important; display: inline-block !important; width: 16px !important;
  font-size: 10px !important; text-align: center !important; color: var(--vscode-text-secondary) !important;
  transition: transform var(--transition-fast); margin-right: 6px;
}
.tree-view > ul > li:not(.folder-closed) > a::before { transform: rotate(90deg) !important; }
.tree-view li.folder-closed > ul { display: none !important; }

/* Child Categories */
.tree-view ul li ul {
  margin-left: 20px !important; padding-left: 0 !important;
  border-left: 1px solid var(--vscode-border) !important;
}
.tree-view ul li ul li a {
  display: flex !important; align-items: center; padding: 3px 20px 3px 16px !important;
  font-size: 13px !important; font-weight: 400 !important;
  color: var(--vscode-text-secondary) !important; transition: all var(--transition-fast);
}
.tree-view ul li ul li a:hover {
  background: rgba(255, 255, 255, 0.05) !important; color: var(--vscode-text-primary) !important;
}
.tree-view ul li ul li a::before { display: none !important; }
.tree-view .c_cnt {
  font-size: 11px !important; color: var(--vscode-text-secondary) !important; margin-left: auto !important;
  font-weight: 400 !important; background: rgba(255, 255, 255, 0.05); padding: 1px 6px; border-radius: 10px;
}

/* File List Items */
.file-list { padding: 0 8px !important; }
.file-list li { margin: 0 !important; }
.file-link {
  color: var(--vscode-text-primary); display: flex; align-items: center; font-size: 13px;
  padding: 4px 12px; transition: background var(--transition-fast); border-radius: 2px;
}
.file-list li:hover .file-link { background: rgba(255, 255, 255, 0.05); color: var(--vscode-text-bright); }
.file-icon { margin-right: 8px; font-size: 14px; flex-shrink: 0; }
.mini-thumb { width: 18px; height: 18px; border-radius: 2px; margin-right: 8px; object-fit: cover; flex-shrink: 0; }
.file-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.count {
  color: var(--vscode-text-secondary); font-size: 11px; margin-left: 6px;
  background: rgba(255, 255, 255, 0.05); padding: 1px 6px; border-radius: 10px;
}

/* Tag Cloud */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 20px; }
.sidebar-tag {
  font-size: 11px; background: rgba(255, 255, 255, 0.05); color: var(--vscode-text-primary);
  padding: 3px 8px; border-radius: 2px; transition: all var(--transition-fast); border: 1px solid transparent;
}
.sidebar-tag:hover { background: var(--accent-blue); color: var(--vscode-text-bright); border-color: var(--accent-blue); }

/* === Main Content Area === */
#main-wrapper { 
  flex: 1; 
  display: flex; 
  flex-direction: column; 
  background-color: var(--bg-app-area); 
  min-width: 0;
  height: 100%; /* 부모 높이 상속 */
  overflow: hidden; /* 래퍼 자체는 스크롤 금지 */
}

/* Tabs Header */
#tabs-header {
  height: var(--tabs-height);
  background: var(--vscode-bg-tabs);
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid var(--vscode-border);
  flex-shrink: 0; /* 크기 줄어들지 않음 */
}
#tabs-header::-webkit-scrollbar { height: 0; }

.tab {
  background: var(--vscode-bg-tab-active); color: var(--vscode-text-bright);
  padding: 0 16px; font-size: 13px; display: flex; align-items: center;
  border-top: 1px solid var(--accent-blue); border-right: 1px solid var(--vscode-border);
  min-width: 150px; position: relative; font-family: var(--font-ui);
}
.tab .icon-file-code { margin-right: 8px; font-size: 16px; }
.tab .close-tab {
  margin-left: auto; cursor: pointer; font-size: 16px; margin-left: 12px;
  color: var(--vscode-text-secondary); opacity: 0; transition: opacity var(--transition-fast); padding: 2px 4px;
}
.tab:hover .close-tab { opacity: 1; }
.tab .close-tab:hover { color: var(--vscode-text-bright); }

/* Breadcrumbs */
#breadcrumbs-bar {
  height: 30px; background: var(--vscode-bg-main); display: flex; align-items: center;
  padding-left: 20px; font-size: 13px; font-family: var(--font-ui);
  color: var(--vscode-text-secondary); flex-shrink: 0; border-bottom: 1px solid var(--vscode-border);
}
.path-segment { color: var(--vscode-text-secondary); transition: color var(--transition-fast); cursor: pointer; }
.path-segment:hover { color: var(--vscode-text-primary); }
.active-segment { color: var(--vscode-text-primary); font-weight: 500; }
.separator { margin: 0 6px; color: var(--vscode-text-secondary); font-size: 10px; }

/* === Editor Area (Main Scroll) === */
#editor-area { 
  flex: 1; /* 남은 공간 모두 차지 */
  padding: 0 20px; 
  overflow-y: auto; /* ★ 여기가 핵심: 여기만 스크롤 됨 ★ */
  overflow-x: hidden;
  height: 100%;
}

.paper-container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 30px 0 80px;
}

/* Paper Card Base */
.white-paper {
  background: var(--editor-bg);
  border: 1px solid var(--editor-border);
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  margin-bottom: 24px;
  color: var(--editor-text);
}
.hover-effect { transition: all var(--transition-medium); }
.hover-effect:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  border-color: var(--accent-blue);
}

/* Post Card (List View) */
.post-card-link { display: flex; flex-direction: row; height: 100%; color: inherit; }
.card-thumb {
  width: 260px; min-height: 200px; flex-shrink: 0; border-right: 1px solid var(--editor-border);
  background: #f6f8fa; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--transition-medium); }
.post-card:hover .card-thumb img { transform: scale(1.05); }
.card-body { padding: 30px; display: flex; flex-direction: column; justify-content: center; flex: 1; min-width: 0; }
.card-meta {
  font-size: 13px; margin-bottom: 12px; font-family: var(--font-ui);
  color: var(--editor-text-muted); display: flex; align-items: center; gap: 8px;
}
.category-badge { color: var(--accent-blue); font-weight: 600; }
.separator { color: var(--editor-text-muted); }
.card-title {
  font-size: 24px; font-weight: 700; margin-bottom: 12px; color: var(--editor-text);
  line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-summary {
  color: var(--editor-text-muted); font-size: 15px; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* Post Detail (Permalink) */
.entry-post.permalink { padding: 50px 60px; }
.post-header-paper { text-align: center; margin-bottom: 40px; }
.meta-info {
  font-size: 13px; color: var(--editor-text-muted); margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.meta-info .category-link { color: var(--accent-blue); font-weight: 600; cursor: pointer; transition: color var(--transition-fast); }
.meta-info .category-link:hover { color: #005a9e; }
.tit_post { font-size: 42px; font-weight: 800; color: var(--editor-text); line-height: 1.25; margin-bottom: 16px; letter-spacing: -0.5px; }
.author { font-size: 14px; color: var(--editor-text-muted); font-family: var(--font-code); }
.paper-divider { border: 0; height: 1px; background: linear-gradient(to right, transparent, var(--editor-border), transparent); margin: 0 auto 40px; width: 120px; }

/* Post Content Styling */
.paper-style { font-size: 17px; line-height: 1.8; color: var(--editor-text); word-break: break-word; }
.paper-style p { margin-bottom: 24px; }
.paper-style a { color: var(--accent-blue); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color var(--transition-fast); }
.paper-style a:hover { border-bottom-color: var(--accent-blue); }
.paper-style h2 {
  font-size: 28px; margin: 50px 0 20px; border-bottom: 1px solid var(--editor-border);
  padding-bottom: 12px; color: var(--editor-text); font-weight: 700; letter-spacing: -0.3px;
}
.paper-style h3 { font-size: 22px; margin: 40px 0 16px; color: var(--editor-text); font-weight: 600; }
.paper-style h4 { font-size: 19px; margin: 30px 0 12px; color: var(--editor-text); font-weight: 600; }
.paper-style ul, .paper-style ol { margin-bottom: 24px; padding-left: 28px; }
.paper-style ul li { list-style: disc; margin-bottom: 8px; color: var(--editor-text); }
.paper-style ol li { list-style: decimal; margin-bottom: 8px; color: var(--editor-text); }
.paper-style pre {
  background: #f6f8fa; border: 1px solid var(--editor-border); border-radius: 6px;
  padding: 20px; margin: 30px 0; overflow-x: auto; font-family: var(--font-code);
  font-size: 14px; line-height: 1.5; color: var(--editor-text);
}
.paper-style code {
  background: #f6f8fa; padding: 3px 6px; border-radius: 3px; color: #e36209;
  font-family: var(--font-code); font-size: 0.9em; border: 1px solid var(--editor-border);
}
.paper-style pre code { background: transparent; padding: 0; border: none; color: var(--editor-text); }
.paper-style blockquote {
  border-left: 3px solid var(--accent-blue); background: var(--editor-hover-bg);
  padding: 16px 24px; margin: 30px 0; color: var(--editor-text-muted); border-radius: 0 4px 4px 0;
}
.paper-style img { max-width: 100%; border-radius: 6px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); margin: 30px auto; }

/* Tags */
.tag-area-paper { margin-top: 60px; font-family: var(--font-ui); font-size: 14px; text-align: center; }
.tag-icon { color: var(--accent-blue); font-weight: 600; margin-right: 8px; }
.tag-area-paper a {
  display: inline-block; background: var(--editor-hover-bg); color: var(--editor-text);
  padding: 6px 14px; border-radius: 16px; margin: 0 4px 8px; border: 1px solid var(--editor-border);
  transition: all var(--transition-fast); font-size: 13px;
}
.tag-area-paper a:hover {
  background: var(--accent-blue); color: white; border-color: var(--accent-blue); transform: translateY(-1px);
}

/* Comments */
.comments-area-paper { margin-top: 60px; padding-top: 40px; border-top: 1px solid var(--editor-border); }
.comment-title { font-size: 20px; font-weight: 700; color: var(--editor-text); margin-bottom: 20px; }

/* Pagination */
.pagination-paper {
  display: flex; justify-content: center; align-items: center; margin-top: 60px; gap: 8px; font-family: var(--font-ui);
}
.page-btn { 
  padding: 10px 20px; background: #ffffff; border: 1px solid #ddd; border-radius: 4px;
  font-size: 14px; color: #555; cursor: pointer;
}
.page-btn:hover:not(.no_more_prev):not(.no_more_next) {
  background: var(--editor-hover-bg); border-color: var(--accent-blue);
}
.page-num { 
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 4px; cursor: pointer; color: #555; 
}
.page-num:hover { background: var(--editor-hover-bg); border-color: var(--editor-border); }
.page-num.selected { background: var(--accent-blue); color: white; font-weight: 600; border-color: var(--accent-blue); }

/* Notice & Protected Cards */
.notice-card, .protected-card { padding: 30px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.badge.notice {
  background: var(--accent-orange); color: white; padding: 4px 12px; border-radius: 4px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}

/* === Status Bar === */
#status-bar {
  height: var(--status-height);
  background: var(--vscode-bg-statusbar);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  font-size: 12px;
  font-family: var(--font-ui);
  z-index: 100;
  flex-shrink: 0;
}
.status-left, .status-right { display: flex; align-items: center; gap: 15px; }
.remote-icon {
  background: #16825d; padding: 0 8px; height: var(--status-height); line-height: var(--status-height);
  margin-left: -12px; margin-right: 5px; color: white; font-weight: 600; cursor: pointer;
  transition: background var(--transition-fast);
}
.remote-icon:hover { background: #1a9d6c; }
.visitor-count { display: flex; gap: 12px; color: white; font-size: 12px; }
.errors, .warnings { display: flex; align-items: center; gap: 4px; }
.prettier { font-family: var(--font-code); font-size: 11px; }

/* === Mobile Responsive === */
@media screen and (max-width: 768px) {
  :root { --sidebar-width: 85%; }
  
  html, body {
    height: auto; /* 모바일은 자연스러운 스크롤 */
    overflow: auto;
  }

  #activity-bar, .mobile-hide { display: none; }

  #vscode-app { 
    display: flex; flex: 1; min-height: 100vh; height: auto; position: relative;
  }
  
  /* Mobile Header */
  #mobile-header {
    display: flex; align-items: center; height: 50px; background: var(--vscode-bg-sidebar);
    padding: 0 16px; border-bottom: 1px solid var(--vscode-border); position: sticky; top: 0; z-index: 90;
  }
  #menu-toggle {
    background: none; border: none; color: var(--vscode-text-bright); cursor: pointer;
    margin-right: 16px; padding: 8px; display: flex; align-items: center; justify-content: center;
  }
  .mobile-title { color: var(--vscode-text-bright); font-weight: 600; font-size: 15px; }

  /* Mobile Sidebar */
  #sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-width); max-width: 320px;
    transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 200; box-shadow: 2px 0 16px rgba(0, 0, 0, 0.3);
  }
  #sidebar.active { transform: translateX(0); }
  .mobile-only {
    display: block; background: none; border: none; color: var(--vscode-text-bright);
    font-size: 28px; cursor: pointer; position: absolute; right: 16px; top: 8px; padding: 4px 8px; line-height: 1;
  }
  #sidebar-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.6);
    z-index: 150; display: none; backdrop-filter: blur(2px);
  }
  #sidebar-overlay.active { display: block; }

  /* Main Content Mobile */
  #main-wrapper { height: auto; width: 100%; display: block; }
  #tabs-header { display: none; }
  #breadcrumbs-bar {
    padding-left: 16px; border-top: 1px solid var(--editor-border);
    background: var(--editor-bg); color: var(--editor-text-muted);
  }
  #editor-area { 
    padding: 0 10px; 
    overflow: visible; /* 모바일은 내부 스크롤 해제 */
    height: auto;
  }
  .paper-container { padding: 20px 0 60px; width: 100%; }

  /* Post Cards Mobile */
  .white-paper { border-radius: 8px; margin-bottom: 20px; }
  .post-card-link { flex-direction: column; }
  .card-thumb { width: 100%; height: 200px; border-right: none; border-bottom: 1px solid var(--editor-border); }
  .card-body { padding: 20px 16px; }
  .card-title { font-size: 20px; }
  .card-summary { font-size: 14px; -webkit-line-clamp: 2; }

  /* Post Detail Mobile */
  .entry-post.permalink { padding: 30px 20px; }
  .tit_post { font-size: 28px; }
  .paper-style { font-size: 16px; }
  .paper-style h2 { font-size: 24px; }
  .paper-style h3 { font-size: 20px; }

  /* Status Bar Mobile */
  #status-bar { position: fixed; bottom: 0; width: 100%; font-size: 11px; }
  .status-left, .status-right { gap: 8px; }
}

/* === Dark Mode Support === */
@media (prefers-color-scheme: dark) { /* Already optimized for dark mode */ }

/* === Print Styles === */
@media print {
  #activity-bar, #sidebar, #tabs-header, #breadcrumbs-bar, #status-bar, #mobile-header { display: none !important; }
  #main-wrapper { background: white; }
  .white-paper { box-shadow: none; border: none; }
}