:root {
  --bg: #fbfcfe;
  --surface: #ffffff;
  --border: #e7ebf0;
  --text: #1f2733;
  --text-soft: #5b6675;
  --text-faint: #8a94a3;
  --brand: #2f6fed;
  --brand-soft: #eaf1ff;
  --accent: #0fae8e;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px rgba(16, 24, 40, .06);
  --radius: 14px;
  --maxw: 920px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.brand-name { font-size: 17px; letter-spacing: .5px; }
.site-nav { display: flex; gap: 26px; }
.site-nav a {
  color: var(--text-soft);
  font-size: 15px;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color .15s ease;
}
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a.active { color: var(--brand); border-bottom-color: var(--brand); }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 18px;
  padding: 4px 10px;
  cursor: pointer;
  color: var(--text);
}

/* ---------- Hero ---------- */
.hero {
  padding: 56px 0 30px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 30px;
}
.hero h1 { font-size: 34px; margin: 0 0 12px; line-height: 1.25; }
.hero p { color: var(--text-soft); font-size: 17px; margin: 0; max-width: 640px; }

.section-title {
  font-size: 20px;
  margin: 8px 0 18px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.section-title .count { font-size: 13px; color: var(--text-faint); font-weight: 500; }

/* ---------- Post list ---------- */
.post-list { display: grid; gap: 18px; }
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(16, 24, 40, .1);
  border-color: #d6deea;
}
.post-card h2 { margin: 0 0 8px; font-size: 20px; }
.post-card h2 a { color: var(--text); }
.post-card h2 a:hover { color: var(--brand); text-decoration: none; }
.post-meta { color: var(--text-faint); font-size: 13px; margin-bottom: 10px; display: flex; gap: 12px; flex-wrap: wrap; }
.post-excerpt { color: var(--text-soft); margin: 0 0 14px; font-size: 15px; }

/* ---------- Tags ---------- */
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-block;
  font-size: 12.5px;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s ease;
}
.tag:hover { background: #dbe7ff; text-decoration: none; }
.tag.active { background: var(--brand); color: #fff; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 12px; }
.tag-cloud .tag { font-size: 14px; padding: 6px 14px; }
.tag-count { opacity: .7; font-size: 12px; margin-left: 4px; }

/* ---------- Article detail ---------- */
.article { padding: 30px 0 50px; }
.article-header { margin-bottom: 22px; }
.article-header h1 { font-size: 30px; line-height: 1.3; margin: 0 0 12px; }
.back-link { display: inline-block; margin-bottom: 18px; color: var(--text-soft); font-size: 14px; }
.back-link:hover { color: var(--brand); }
.article-body { font-size: 16px; }
.article-body h1, .article-body h2, .article-body h3 { line-height: 1.35; margin: 1.6em 0 .6em; }
.article-body h2 { font-size: 23px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.article-body h3 { font-size: 19px; }
.article-body p { margin: 1em 0; }
.article-body ul, .article-body ol { padding-left: 1.4em; }
.article-body li { margin: .35em 0; }
.article-body blockquote {
  margin: 1.2em 0;
  padding: 10px 18px;
  border-left: 4px solid var(--brand);
  background: var(--brand-soft);
  color: var(--text-soft);
  border-radius: 0 8px 8px 0;
}
.article-body img { max-width: 100%; border-radius: 10px; }
.article-body code {
  background: #f1f4f9;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 14px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
.article-body pre {
  background: #0d1117;
  color: #e6edf3;
  padding: 16px 18px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 1.2em 0;
  line-height: 1.6;
}
.article-body pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: 13.5px;
}
.article-body table { border-collapse: collapse; width: 100%; margin: 1.2em 0; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.article-body th { background: #f6f8fb; }

/* ---------- About ---------- */
.about { padding: 30px 0 50px; }
.about h1 { font-size: 28px; margin: 0 0 6px; }
.about .lead { color: var(--text-soft); font-size: 17px; margin-bottom: 26px; }
.about-section { margin-bottom: 28px; }
.about-section h2 { font-size: 19px; margin: 0 0 12px; }
.skill-list { display: flex; flex-wrap: wrap; gap: 10px; }
.skill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 14px;
  box-shadow: var(--shadow);
}
.link-list { display: flex; flex-wrap: wrap; gap: 14px; }
.link-list a {
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}
.link-list a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 26px 0;
  color: var(--text-faint);
  font-size: 13px;
}
.site-footer p { margin: 2px 0; }
.footer-sub { font-size: 12px; }

/* ---------- Empty state ---------- */
.empty { text-align: center; color: var(--text-faint); padding: 60px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 680px) {
  .site-nav { display: none; gap: 18px; }
  .site-nav.open {
    display: flex;
    position: absolute;
    top: 62px; left: 0; right: 0;
    flex-direction: column;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
  }
  .nav-toggle { display: block; }
  .hero h1 { font-size: 27px; }
  .article-header h1 { font-size: 24px; }
}
