:root {
  --bg: #f8fafc; --card: #ffffff; --text: #0f172a; --muted: #64748b;
  --border: #e2e8f0; --accent: #0284c7; --code-bg: #0f172a; --code-text: #e2e8f0;
}
[data-theme="dark"] {
  --bg: #0b1120; --card: #111827; --text: #e2e8f0; --muted: #94a3b8;
  --border: #1f2937; --accent: #38bdf8; --code-bg: #020617; --code-text: #e2e8f0;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.75; transition: background .2s, color .2s;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 820px; margin: 0 auto; padding: 0 20px; }
header {
  position: sticky; top: 0; background: var(--card); border-bottom: 1px solid var(--border); z-index: 10;
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-weight: 700; font-size: 1.08rem; color: var(--text); display: flex; align-items: center; gap: 10px; }
.brand img { width: 26px; height: 26px; }
.links { display: flex; align-items: center; gap: 18px; font-size: 0.95rem; }
.btn {
  border: 1px solid var(--border); background: transparent; color: var(--text);
  padding: 5px 10px; border-radius: 8px; cursor: pointer; font-size: 0.85rem;
}
main { padding: 28px 0 60px; }
.hero { width: 100%; border-radius: 14px; display: block; margin-bottom: 24px; border: 1px solid var(--border); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.search {
  flex: 1; min-width: 200px; padding: 9px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card); color: var(--text); font-size: 0.95rem;
}
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.8rem;
  border: 1px solid var(--border); background: var(--card); color: var(--muted); cursor: pointer;
}
.tag.active, .tag:hover { border-color: var(--accent); color: var(--accent); }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px 22px; margin-bottom: 16px;
}
.card h2 { margin: 0 0 8px; font-size: 1.2rem; }
.meta { font-size: 0.84rem; color: var(--muted); margin-bottom: 8px; display: flex; gap: 12px; flex-wrap: wrap; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
article { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 28px; }
article h1 { margin-top: 0; font-size: 1.65rem; line-height: 1.35; }
article h2 { margin-top: 28px; font-size: 1.2rem; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
pre {
  background: var(--code-bg); color: var(--code-text); padding: 14px 16px; border-radius: 10px;
  overflow-x: auto; font-size: 0.88rem; position: relative;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
p code, li code { background: var(--border); padding: 2px 6px; border-radius: 5px; }
footer { border-top: 1px solid var(--border); padding: 24px 0; font-size: 0.86rem; color: var(--muted); text-align: center; }
