:root {
  --bg: #0d1117;
  --bg-soft: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --text-dim: #8b949e;
  --accent: #58a6ff;
  --accent-soft: rgba(88,166,255,.12);
  --code-bg: #010409;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.8;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 24px; }

header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(13,17,23,.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 60px; }

/* 返回按钮（常驻，显眼） */
.nav-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; padding: 6px 13px 6px 11px;
  color: var(--text); background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: 8px;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
  white-space: nowrap;
}
.back-btn:hover {
  text-decoration: none; color: var(--accent);
  border-color: rgba(88,166,255,.5);
  background: var(--accent-soft);
}
.back-btn svg { width: 13px; height: 13px; flex: none; }
.nav-sep { color: var(--border); font-size: 13px; }

.brand { font-weight: 600; font-size: 16px; letter-spacing: .3px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand span { color: var(--accent); }
.nav-links { display: flex; gap: 28px; font-size: 14px; }
.nav-links a { color: var(--text-dim); }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* 文章 */
.post { padding: 64px 24px 80px; }
.post-head { margin-bottom: 40px; padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.post-head h1 {
  font-size: 32px; line-height: 1.4; font-weight: 600;
  letter-spacing: -.3px; margin-bottom: 18px;
}
.post-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--text-dim); }
.post-meta span { padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; }

/* 项目状态徽章 */
.badge-local {
  color: #d29922 !important;
  background: rgba(210,153,34,.12);
  border-color: rgba(210,153,34,.35) !important;
}
.badge-learn {
  color: #3fb950 !important;
  background: rgba(63,185,80,.12);
  border-color: rgba(63,185,80,.32) !important;
}

/* 相关笔记提示块 */
.callout-note {
  margin-top: 32px; padding: 16px 20px;
  border: 1px dashed var(--border); border-radius: var(--radius);
  background: var(--bg-soft);
}
.callout-note p { margin: 0; font-size: 14.5px; color: var(--text-dim); }
.callout-note a { color: var(--accent); }

.lead {
  font-size: 17px; color: var(--text-dim);
  padding: 20px 22px; margin-bottom: 40px;
  background: var(--bg-soft); border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.post h2 {
  font-size: 22px; font-weight: 600; margin: 48px 0 18px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
  letter-spacing: -.2px;
}
.post h3 { font-size: 17px; font-weight: 600; margin: 32px 0 14px; }
.post p { margin-bottom: 18px; color: #c9d1d9; }
.post strong { color: var(--text); font-weight: 600; }
.post em { color: var(--accent); font-style: normal; }
.post ul, .post ol { margin: 0 0 20px 24px; color: #c9d1d9; }
.post li { margin-bottom: 10px; }
.post li::marker { color: var(--text-dim); }

code {
  font-family: "SF Mono", "Cascadia Code", Consolas, "Liberation Mono", monospace;
  font-size: 14px; padding: 2px 6px;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 5px;
}
pre {
  background: var(--code-bg);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 22px; overflow-x: auto;
}
pre code { background: none; color: #c9d1d9; padding: 0; font-size: 13.5px; line-height: 1.7; }

.table-wrap { overflow-x: auto; margin-bottom: 24px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-weight: 600; font-size: 13px; letter-spacing: .5px; }
td { color: #c9d1d9; }
tbody tr:hover { background: var(--bg-soft); }
td.up { color: #3fb950; font-weight: 600; }
td.dim { color: var(--text-dim); }

.callout {
  background: var(--accent-soft);
  border: 1px solid rgba(88,166,255,.25);
  border-radius: var(--radius);
  padding: 18px 22px; margin-bottom: 24px;
}
.callout p { margin: 0; color: var(--text); font-size: 15px; }

.quote {
  border-left: 3px solid var(--border);
  padding: 4px 0 4px 22px; margin: 28px 0;
}
.quote p { color: var(--text-dim); font-style: italic; margin-bottom: 8px; }
.quote cite { font-size: 13px; color: var(--text-dim); font-style: normal; }

.post-foot {
  margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--border);
}
.post-foot a {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14.5px; padding: 10px 20px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg-soft); color: var(--text);
  transition: border-color .16s ease, color .16s ease, background .16s ease;
}
.post-foot a:hover {
  text-decoration: none; color: var(--accent);
  border-color: rgba(88,166,255,.5); background: var(--accent-soft);
}

footer { border-top: 1px solid var(--border); padding: 36px 0 48px; }
footer .wrap { display: flex; flex-direction: column; gap: 10px; }
footer .beian { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
footer .beian span, footer .beian a { color: var(--text-dim); font-size: 13px; }
footer .beian a:hover { color: var(--text); }

@media (max-width: 600px) {
  .post { padding: 40px 20px 60px; }
  .post-head h1 { font-size: 24px; }
  .post h2 { font-size: 19px; margin-top: 36px; }
  .nav-links { gap: 18px; font-size: 13px; }
  .nav-left { gap: 10px; }
  .back-btn { font-size: 13px; padding: 5px 10px 5px 9px; }
  .brand { font-size: 15px; }
  .nav-sep { display: none; }
  .lead { font-size: 15.5px; padding: 16px 18px; }
  .table-wrap table { font-size: 13px; }
  th, td { padding: 9px 10px; }
}
