:root {
  --primary: #3273dc;
  --primary-dark: #2366d1;
  --text: #363636;
  --text-light: #7a7a7a;
  --text-muted: #b5b5b5;
  --bg: #f5f5f5;
  --bg-white: #ffffff;
  --border: #dbdbdb;
  --shadow: 0 2px 3px rgba(10, 10, 10, 0.1);
  --shadow-hover: 0 4px 6px rgba(10, 10, 10, 0.15);
  --radius: 4px;
  --sidebar-width: 220px;
  --content-max: 800px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }

/* Navbar */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.navbar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-right: 32px;
}
.navbar-brand:hover { color: var(--primary); }

.navbar-menu {
  display: flex;
  gap: 4px;
  flex: 1;
}

.navbar-item {
  padding: 8px 14px;
  color: var(--text);
  font-size: 0.95rem;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.navbar-item:hover, .navbar-item.active {
  background: var(--bg);
  color: var(--primary);
}

/* Main Layout */
.main-wrapper {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  padding: 72px 20px 40px;
  gap: 20px;
}

/* Left Sidebar */
.sidebar-left {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: 72px;
  height: fit-content;
}

.widget {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}

.widget-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.95rem;
}

.widget-body { padding: 8px 0; }

.menu-list { list-style: none; }

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  color: var(--text);
  transition: all 0.2s;
}

.menu-item:hover {
  background: var(--bg);
  color: var(--primary);
}

.menu-item.active {
  background: var(--primary);
  color: white;
}

/* Center Content */
.content-main {
  flex: 1;
  max-width: var(--content-max);
  min-width: 0;
}

/* Article Cards */
.article-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.article-card:hover { box-shadow: var(--shadow-hover); }

.article-body { padding: 20px; }

.article-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.4;
}

.article-title a { color: var(--text); }
.article-title a:hover { color: var(--primary); }

.article-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.tag {
  padding: 4px 10px;
  background: #e8f4fd;
  color: var(--primary);
  font-size: 0.8rem;
  border-radius: var(--radius);
}

.tag:hover {
  background: var(--primary);
  color: white;
}

.article-excerpt {
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Article Page */
.article-page {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

.article-page-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.article-page-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.4;
}

.article-page-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--text-light);
  font-size: 0.9rem;
}

.article-content {
  font-size: 1rem;
  line-height: 1.8;
}

.article-content h1 { font-size: 1.5rem; margin: 32px 0 16px; font-weight: 600; }
.article-content h2 { font-size: 1.3rem; margin: 28px 0 14px; font-weight: 600; border-bottom: none; padding-bottom: 0; }
.article-content h3 { font-size: 1.15rem; margin: 24px 0 12px; font-weight: 600; }
.article-content p { margin: 16px 0; }
.article-content a { border-bottom: 1px solid transparent; }
.article-content a:hover { border-bottom-color: var(--primary); }

.article-content pre {
  background: #2d2d2d;
  color: #f8f8f2;
  padding: 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.9rem;
  margin: 20px 0;
}

.article-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
}

.article-content :not(pre) > code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 3px;
  color: #e83e8c;
}

.article-content blockquote {
  border-left: 4px solid var(--primary);
  padding-left: 16px;
  margin: 20px 0;
  color: var(--text-light);
}

.article-content ul, .article-content ol {
  margin: 16px 0;
  padding-left: 24px;
}

.article-content li { margin: 8px 0; }

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.article-content th, .article-content td {
  padding: 12px;
  text-align: left;
  border: 1px solid var(--border);
}

.article-content th { background: var(--bg); font-weight: 600; }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  color: var(--text-light);
  font-size: 0.9rem;
}
.back-btn:hover { color: var(--primary); }

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.pagination a, .pagination span {
  padding: 8px 16px;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  color: var(--text);
}

.pagination a:hover {
  box-shadow: var(--shadow-hover);
  color: var(--primary);
}

.pagination .current {
  background: var(--primary);
  color: white;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Mobile */
@media (max-width: 1024px) {
  .sidebar-left { display: none; }
  .main-wrapper { padding: 72px 16px 40px; }
}

@media (max-width: 640px) {
  .navbar { padding: 0 16px; }
  .navbar-brand { margin-right: 16px; }
  .article-page { padding: 20px; }
}
