:root {
  --bg: #ffffff;
  --card: #ffffff;
  --text: #333;
  --border: #eaeaea;
  --primary: #1e88e5;
  --radius: 8px;
  --topH: 60px;
}
[data-theme="dark"] {
  --bg: #121212;
  --card: #1d1d1d;
  --text: #e0e0e0;
  --border: #333;
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background .3s, color .3s;
}
a {
  color: var(--primary);
  text-decoration: none;
}
img {
  max-width: 100%;
}
/* 顶部栏 */
.top-bar {
  position: sticky;
  top: 0;
  height: var(--topH);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
}
.logo a {
  font-size: 22px;
  font-weight: 600;
}
.tag-nav {
  display: flex;
  gap: 10px;
}
.tag-nav span {
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--radius);
  background: var(--border);
  font-size: 14px;
}
.tag-nav span.active {
  background: var(--primary);
  color: #fff;
}
.dark-toggle {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
}
/* 三栏布局 */
.container {
  display: grid;
  grid-template-columns: 220px 1fr 260px;
  gap: 20px;
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 20px;
}
.side-left,
.side-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .05);
}
.author {
  text-align: center;
}
.author img {
  width: 80px;
  border-radius: 50%;
  margin-bottom: 10px;
}
.social {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}
/* 文章列表 */
.post-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.post-item h2 {
  margin: 0 0 10px;
  font-size: 24px;
}
.post-item .meta {
  font-size: 14px;
  color: #999;
  margin-bottom: 10px;
}
.post-item .tag {
  display: inline-block;
  font-size: 12px;
  background: var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 6px;
}
/* 代码块 */
pre {
  overflow: auto;
  background: #2d2d2d !important;
  padding: 16px;
  border-radius: var(--radius);
}
/* 底部 */
.footer {
  text-align: center;
  padding: 20px;
  font-size: 14px;
  color: #999;
}
/* 响应式 */
@media (max-width: 900px) {
  .container {
    grid-template-columns: 1fr;
  }
  .side-left,
  .side-right {
    flex-direction: row;
    flex-wrap: wrap;
  }
}