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

html {
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
  color: #1a1a1a;
  background: #fff;
}

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  color: #1d4ed8;
}

/* ===== Layout ===== */
.layout {
  display: flex;
  max-width: 1100px;
  margin: 0 auto;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  border-right: 1px solid #e5e7eb;
  background: #fafafa;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  height: 100vh;
}

.sidebar-inner {
  padding: 32px 20px 40px;
}

.blog-title h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #1a1a1a;
  line-height: 1.3;
}

.blog-title a {
  color: inherit;
}

.blog-title a:hover {
  color: inherit;
}

.blog-subtitle {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
  letter-spacing: 0.02em;
}

/* ===== Nav ===== */
.nav {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.nav-link {
  font-size: 13px;
  color: #4b5563;
  padding: 6px 0;
  display: block;
}

.nav-link:hover {
  color: #1a1a1a;
}

.nav-link.active {
  color: #1a1a1a;
  font-weight: 600;
}

/* ===== Sidebar Sections ===== */
.sidebar-section {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.sidebar-heading {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  margin-bottom: 10px;
}

.article-list {
  list-style: none;
}

.article-list li {
  margin-bottom: 0;
}

.article-link {
  display: flex;
  gap: 6px;
  align-items: baseline;
  padding: 3px 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.35;
}

.article-link:hover {
  color: #1a1a1a;
}

.article-date {
  font-size: 10px;
  color: #9ca3af;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  flex-shrink: 0;
  width: 34px;
}

.article-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-list {
  list-style: none;
}

.archive-list li {
  margin-bottom: 4px;
}

.archive-list a {
  font-size: 12px;
  color: #6b7280;
}

.archive-list a:hover {
  color: #1a1a1a;
}

/* ===== Content ===== */
.content {
  flex: 1;
  margin-left: 260px;
  padding: 40px 48px 80px;
  max-width: calc(720px + 96px);
}

/* ===== Page Header ===== */
.page-header {
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1a1a1a;
}

.page-desc {
  font-size: 13px;
  color: #9ca3af;
  margin-top: 4px;
}

/* ===== Article Index (Homepage / Category) ===== */
.article-index {
  display: flex;
  flex-direction: column;
}

.article-card {
  padding: 18px 0;
  border-bottom: 1px solid #f0f0f0;
}

.article-card:first-child {
  padding-top: 0;
}

.article-card:last-child {
  border-bottom: none;
}

.article-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.article-card-date {
  font-size: 12px;
  color: #9ca3af;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
}

.article-card-tag {
  font-size: 11px;
  color: #6b7280;
  letter-spacing: 0.02em;
}

.article-card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.article-card-title a {
  color: #1a1a1a;
}

.article-card-title a:hover {
  color: #2563eb;
}

.article-card-summary {
  font-size: 13px;
  line-height: 1.6;
  color: #6b7280;
}

/* ===== Category Nav ===== */
.category-nav {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
  font-size: 13px;
  color: #9ca3af;
}

.category-nav-label {
  color: #9ca3af;
}

.category-nav-link {
  color: #6b7280;
  margin-right: 16px;
}

.category-nav-link:hover {
  color: #2563eb;
}

/* ===== Article Detail ===== */
.article-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e5e7eb;
}

.article-breadcrumb {
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 16px;
}

.article-breadcrumb a {
  color: #9ca3af;
}

.article-breadcrumb a:hover {
  color: #2563eb;
}

.breadcrumb-sep {
  margin: 0 6px;
  color: #d1d5db;
}

.article-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: #1a1a1a;
}

.article-meta {
  margin-top: 12px;
  font-size: 13px;
  color: #6b7280;
}

.meta-sep {
  margin: 0 8px;
  color: #d1d5db;
}

/* ===== Article Body ===== */
.article-body {
  font-size: 15px;
  line-height: 1.75;
  color: #1a1a1a;
}

.article-body p {
  margin-bottom: 16px;
}

.article-body h2 {
  font-size: 18px;
  font-weight: 600;
  margin-top: 36px;
  margin-bottom: 16px;
  color: #1a1a1a;
  letter-spacing: -0.01em;
}

.article-body h3 {
  font-size: 16px;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 12px;
  color: #1a1a1a;
}

.article-body ul,
.article-body ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.article-body li {
  margin-bottom: 6px;
}

.article-body code {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 13px;
  background: #f3f4f6;
  padding: 2px 5px;
  border-radius: 2px;
}

.article-body pre {
  margin-bottom: 20px;
  padding: 16px 20px;
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  overflow-x: auto;
  line-height: 1.55;
}

.article-body pre code {
  background: none;
  padding: 0;
  font-size: 13px;
  border-radius: 0;
}

.article-body strong {
  font-weight: 600;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 14px;
}

.article-body th,
.article-body td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid #e5e7eb;
}

.article-body th {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  border-bottom: 2px solid #e5e7eb;
}

.article-body tbody tr:hover {
  background: #fafafa;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }

  .sidebar-inner {
    padding: 20px 16px;
  }

  .layout {
    flex-direction: column;
  }

  .content {
    margin-left: 0;
    padding: 24px 16px 60px;
    max-width: 100%;
  }

  .article-title {
    font-size: 20px;
  }

  .article-card-title {
    font-size: 15px;
  }
}
