:root {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --border: #e5e7eb;
  --text: #0f172a;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-soft: #e6efff;
  --radius: 16px;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

body {
  margin: 0;
  background: radial-gradient(circle at 20% 20%, #ffffff, #f4f6fb 40%),
              radial-gradient(circle at 80% 0%, #f1f5f9, #f7f8fa 45%),
              var(--bg);
  font-family: 'Manrope', 'Segoe UI', sans-serif;
  color: var(--text);
}

.page {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.brand-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  box-shadow: 0 0 0 6px #e5edff;
}

.brand-title { font-weight: 700; letter-spacing: 0.4px; }
.brand-sub { color: var(--muted); font-size: 14px; }

.github-link {
  color: var(--muted);
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
  text-decoration: none;
}

.github-link:hover {
  color: var(--text);
}

.github-link svg {
  display: block;
}

.search input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  color: var(--text);
}

.search { margin-bottom: 10px; }

.post-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-right: 6px;
}

.filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.filter-chip {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
}

.filter-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.18);
}


.post-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.post-item:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.post-item.active { border-color: var(--accent); box-shadow: var(--shadow); }

.post-item .title { font-weight: 600; margin: 0; }
.post-item .meta { color: var(--muted); font-size: 13px; margin-top: 4px; display: flex; gap: 8px; align-items: center; }

.reader {
  padding: 40px 48px 60px;
  overflow: auto;
}

.reader-header {
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}

.reader-header > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pill {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  border: 1px solid #c7dbff;
}

h1 {
  margin: 10px 0 8px;
  font-family: 'Manrope', 'Segoe UI', sans-serif;
  font-size: 34px;
}

.summary { margin: 0 0 12px; color: var(--muted); }

.tag-list { display: flex; gap: 8px; flex-wrap: wrap; }

.tag {
  padding: 6px 10px;
  border-radius: 10px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 12px;
  border: 1px solid #e0e7ff;
}

.content {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  line-height: 1.65;
}

.content h2, .content h3, .content h4 {
  margin-top: 28px;
  font-family: 'Manrope', 'Segoe UI', sans-serif;
}

.content p { margin: 12px 0; }
.content ul { padding-left: 22px; }
.content code { background: #f3f4f6; padding: 2px 6px; border-radius: 6px; }
.content pre { background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 10px; overflow: auto; }

.nav-buttons { display: flex; gap: 10px; align-items: center; }
.nav-buttons button {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
}
.nav-buttons button:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.nav-buttons button:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; transform: none; }

@media (max-width: 1100px) {
  .page { grid-template-columns: 260px 1fr; }
}

@media (max-width: 860px) {
  .page { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .reader { padding: 24px; }
}
