:root {
    --primary: #4f46e5;        /* 品牌靛蓝 */
    --primary-dark: #3730a3;   /* 深色 */
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --max-width: 800px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  line-height: 1.7;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #333;
  background: #fafafa;
}

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

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.content-wrapper {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.content-main {
  flex: 1;
  min-width: 0;
  max-width: 740px;
}

.sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 1.5rem;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.widget {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.25rem;
}

.widget-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f3f4f6;
}

.widget-list {
  list-style: none;
  margin: 0;
}

.widget-list li {
  padding: 0.3rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid #fafafa;
}

.widget-list li:last-child {
  border-bottom: none;
}

.widget-list a {
  color: #4b5563;
}

.widget-list a:hover {
  color: #2563eb;
}

.widget-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.widget-tags .tag {
  font-size: 0.78rem;
}

.site-header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 1.5rem 0;
}

.site-title {
  font-size: 1.75rem;
  font-weight: 700;
}

.site-title a {
  color: #111;
}

.site-title a:hover {
  text-decoration: none;
  color: #2563eb;
}

.site-subtitle {
  color: #6b7280;
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.site-nav {
  margin-top: 0.75rem;
}

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.site-nav a {
  color: #6b7280;
  font-size: 0.925rem;
}

.site-nav a:hover {
  color: #2563eb;
  text-decoration: none;
}

.site-content {
  padding: 2.5rem 0;
}

.post-item {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.post-title {
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.4;
}

.post-title a {
  color: #111;
}

.post-title a:hover {
  text-decoration: none;
  color: #2563eb;
}

.post-meta {
  color: #9ca3af;
  font-size: 0.85rem;
  margin-top: 0.4rem;
}

.post-meta a.category {
  color: #2563eb;
}

.post-summary {
  margin-top: 0.75rem;
  color: #4b5563;
  line-height: 1.7;
}

.read-more {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.pagination a {
  padding: 0.4rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.9rem;
}

.pagination a:hover {
  background: #f3f4f6;
  text-decoration: none;
}

.page-info {
  color: #9ca3af;
  font-size: 0.85rem;
}

.post-full, .page-full {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 2rem;
}

.post-header, .page-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.post-header h1, .page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
}

.post-tags {
  margin-top: 0.75rem;
}

.tag {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  margin: 0.2rem 0.15rem;
  background: #f3f4f6;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #6b7280;
}

.tag:hover {
  background: #e5e7eb;
  text-decoration: none;
}

.post-content, .page-content {
  font-size: 1rem;
  line-height: 1.85;
}

.post-content h2, .page-content h2 {
  font-size: 1.4rem;
  margin: 1.5rem 0 0.75rem;
}

.post-content h3, .page-content h3 {
  font-size: 1.2rem;
  margin: 1.25rem 0 0.6rem;
}

.post-content p, .page-content p {
  margin-bottom: 1rem;
}

.post-content img, .page-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.post-content pre, .page-content pre {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.post-content code, .page-content code {
  background: #f3f4f6;
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  font-size: 0.875em;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.post-content pre code, .page-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

.post-content blockquote, .page-content blockquote {
  border-left: 4px solid #2563eb;
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  background: #f8fafc;
  color: #6b7280;
}

.post-content ul, .post-content ol, .page-content ul, .page-content ol {
  margin: 0 0 1rem 1.5rem;
}

.post-content li, .page-content li {
  margin-bottom: 0.3rem;
}

.post-content a, .page-content a {
  color: #2563eb;
  text-decoration: underline;
}

.post-content table, .page-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.post-content th, .post-content td, .page-content th, .page-content td {
  border: 1px solid #e5e7eb;
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.post-content th, .page-content th {
  background: #f9fafb;
  font-weight: 600;
}

.related-posts {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.related-posts h3 {
  margin-bottom: 0.75rem;
}

.related-posts ul {
  list-style: none;
  margin: 0;
}

.related-posts li {
  margin-bottom: 0.4rem;
}

.archive-list {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
}

.archive-list dt {
  color: #9ca3af;
  font-size: 0.85rem;
  font-family: "SFMono-Regular", Consolas, monospace;
  margin-top: 0.75rem;
}

.archive-list dt:first-child {
  margin-top: 0;
}

.archive-list dd {
  margin: 0.15rem 0 0 0;
}

.archive h1, .period-archive h1, .categories h1, .tags h1, .authors h1, .category-page h1, .tag-page h1, .author-page h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.category-list, .author-list {
  list-style: none;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
}

.category-list li, .author-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid #f3f4f6;
}

.category-list li:last-child, .author-list li:last-child {
  border-bottom: none;
}

.tag-cloud {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
  line-height: 2.2;
}

.tag-cloud .tag {
  margin: 0.2rem 0.3rem;
}

.site-footer {
  border-top: 1px solid #e5e7eb;
  padding: 1.5rem 0;
  text-align: center;
  color: #9ca3af;
  font-size: 0.85rem;
}

.site-footer a {
  color: #6b7280;
}

@media (max-width: 860px) {
  .content-wrapper {
    flex-direction: column;
  }
  .content-main {
    max-width: none;
  }
  .sidebar {
    width: 100%;
    position: static;
  }
}

@media (max-width: 640px) {
  html { font-size: 15px; }
  .site-header { padding: 1rem 0; }
  .site-content { padding: 1.5rem 0; }
  .post-item { padding: 1.25rem; }
  .post-full, .page-full { padding: 1.25rem; }
  .post-header h1, .page-header h1 { font-size: 1.4rem; }
  .site-nav ul { gap: 0.9rem; }
}
