:root {
  --bg: #0d1117;
  --bg-soft: #11161d;
  --card: #161b22;
  --border: #2a313c;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #4f8cff;
  --accent-2: #2dd4bf;
  --radius: 14px;
  --maxw: 860px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
[data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --card: #ffffff;
  --border: #d8dee4;
  --text: #1f2328;
  --muted: #656d76;
  --accent: #1f6feb;
  --accent-2: #0d9488;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ===== 顶部导航 ===== */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 13px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { font-weight: 700; font-size: 16px; color: var(--text); letter-spacing: .3px; }
.brand b { color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-links { display: flex; gap: 16px; }
.nav-links a { color: var(--muted); font-size: 14px; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.theme-btn {
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  border-radius: 9px; padding: 6px 11px; cursor: pointer; font-size: 13px; line-height: 1;
  transition: border-color .15s, color .15s;
}
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ===== 容器 ===== */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ===== 首页 Hero ===== */
.hero { padding: 64px 20px 40px; text-align: center; }
.hero .avatar {
  width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 18px;
  display: grid; place-items: center; font-size: 34px; font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 28px -8px var(--accent);
}
.hero h1 { font-size: 30px; margin: 0 0 10px; letter-spacing: .5px; }
.hero .tagline { color: var(--muted); font-size: 16px; margin: 0 auto; max-width: 560px; }
.hero .meta { margin-top: 18px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.chip {
  font-size: 13px; color: var(--muted); border: 1px solid var(--border);
  background: var(--bg-soft); border-radius: 999px; padding: 5px 13px;
}

/* ===== 区块标题 ===== */
.section-title {
  display: flex; align-items: baseline; gap: 10px;
  margin: 44px 0 18px; font-size: 20px; font-weight: 700;
}
.section-title .count { color: var(--muted); font-size: 14px; font-weight: 500; }

/* ===== 文章卡片列表 ===== */
.posts { display: grid; gap: 16px; }
.post-card {
  display: block; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.post-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; box-shadow: 0 10px 30px -16px var(--accent); }
.post-card .date { font-size: 13px; color: var(--muted); font-family: var(--mono); }
.post-card h3 { margin: 6px 0 8px; font-size: 18px; color: var(--text); }
.post-card p { margin: 0 0 12px; color: var(--muted); font-size: 14.5px; }
.post-card .tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  font-size: 12px; color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 12%, transparent);
  border-radius: 6px; padding: 3px 9px;
}

/* ===== 关于 ===== */
.about {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px; margin-top: 16px;
}
.about p { margin: 0 0 12px; color: var(--text); font-size: 15px; }
.about p:last-child { margin-bottom: 0; }
.about a { font-weight: 600; }

/* ===== 页脚 ===== */
.footer {
  border-top: 1px solid var(--border); margin-top: 56px; padding: 26px 20px 40px;
  text-align: center; color: var(--muted); font-size: 13px;
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--accent); }

/* ===== 文章页 ===== */
.article { padding: 40px 0 20px; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.article h1 { font-size: 28px; margin: 0 0 10px; line-height: 1.35; }
.article .post-meta { color: var(--muted); font-size: 14px; font-family: var(--mono); margin-bottom: 8px; }
.article .post-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 28px; }
.article h2 { font-size: 22px; margin: 38px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.article h3 { font-size: 18px; margin: 28px 0 10px; }
.article p { margin: 0 0 16px; }
.article ul, .article ol { margin: 0 0 16px; padding-left: 22px; }
.article li { margin: 6px 0; }
.article code {
  font-family: var(--mono); font-size: 13.5px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 6px; color: var(--accent-2);
}
.article pre {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px; overflow-x: auto; margin: 0 0 18px;
}
.article pre code { background: none; border: none; padding: 0; color: var(--text); font-size: 13px; line-height: 1.6; }
.article blockquote {
  margin: 0 0 18px; padding: 10px 16px; border-left: 3px solid var(--accent);
  background: var(--bg-soft); border-radius: 0 8px 8px 0; color: var(--muted);
}
.back-link { display: inline-block; margin-top: 30px; font-weight: 600; }

@media (max-width: 600px) {
  .hero { padding: 44px 16px 28px; }
  .hero h1 { font-size: 25px; }
  .nav-links { display: none; }
}
