/* 开发学习笔记 —— 纸张底色、克制的排版,首页一块抽象代码编辑器插画。系统字体(国内访问不了 Google Fonts)。 */
:root {
  --bg: #f5f3ee;
  --paper: #fffdf9;
  --ink: #1d1c1a;
  --muted: #75716a;
  --line: #e5e0d6;
  --accent: #3f6f9f;
  --accent-soft: #e3ebf3;
  --code-bg: #22252b;
  --code-ink: #e6e4df;
  --inline-code: #ebe6dc;
  --c-blue: #3f6f9f;
  --c-teal: #2f8a83;
  --c-amber: #c98a2b;
  --c-rose: #b9545a;
  --shadow: 0 1px 2px rgba(40, 32, 20, 0.04), 0 10px 28px rgba(40, 32, 20, 0.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --paper: #1c1c1a;
    --ink: #ecebe6;
    --muted: #9b968e;
    --line: #2d2c29;
    --accent: #8db4da;
    --accent-soft: #233140;
    --code-bg: #0f1012;
    --inline-code: #292825;
    --c-blue: #8db4da;
    --c-teal: #6cc1b8;
    --c-amber: #e0b062;
    --c-rose: #e08a8f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.8 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* 顶栏 */
.topbar { padding: 22px 0; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: 0.02em;
}
.brand-mark {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 700; letter-spacing: -0.02em;
}
.topbar nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
.topbar nav a:hover { color: var(--ink); }

/* 首页头图 */
.hero {
  display: grid; grid-template-columns: 1fr auto; gap: 36px; align-items: center;
  padding: 36px 0 48px;
}
.hero .eyebrow { font-size: 13px; color: var(--accent); letter-spacing: 0.08em; margin: 0 0 10px; }
.hero h1 { font-size: 40px; line-height: 1.2; margin: 0 0 14px; letter-spacing: 0.01em; }
.hero p.lead { margin: 0; color: var(--muted); font-size: 16px; max-width: 28em; }
.hero .art { width: 280px; height: auto; display: block; filter: drop-shadow(0 12px 24px rgba(30, 30, 40, 0.12)); }
@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; gap: 26px; padding: 16px 0 36px; }
  .hero h1 { font-size: 32px; }
  .hero .art { width: 100%; max-width: 320px; }
}

/* 小节标题 */
.section-title {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; letter-spacing: 0.12em; color: var(--muted); margin: 0 0 16px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* 文章卡片 */
.posts { display: grid; gap: 14px; padding: 0; margin: 0 0 24px; list-style: none; }
.card {
  display: block; padding: 22px 24px 20px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  color: inherit; text-decoration: none; transition: transform 0.15s ease, border-color 0.15s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card h2 { font-size: 19px; line-height: 1.45; margin: 10px 0 6px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.card .meta { margin-top: 12px; }
.tag {
  display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  padding: 2px 10px; border-radius: 6px; color: var(--t, var(--accent));
  background: color-mix(in srgb, var(--t, var(--accent)) 12%, transparent);
}
.tag.backend { --t: var(--c-blue); }
.tag.security { --t: var(--c-rose); }
.tag.flutter { --t: var(--c-teal); }
.meta { color: var(--muted); font-size: 13px; }
.meta span + span::before { content: "/"; margin: 0 8px; opacity: 0.6; }

/* 文章页 */
.article-head { padding: 24px 0 4px; }
.article-head h1 { font-size: 32px; line-height: 1.35; margin: 12px 0 10px; }
article.post {
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); padding: 12px 40px 30px; margin: 20px 0 28px;
}
@media (max-width: 640px) {
  .article-head h1 { font-size: 26px; }
  article.post { padding: 4px 18px 20px; border-radius: 12px; }
}
article.post h2 { position: relative; font-size: 20px; margin: 38px 0 10px; padding-left: 16px; }
article.post h2::before {
  content: ""; position: absolute; left: 0; top: 0.3em; bottom: 0.3em; width: 4px; border-radius: 2px;
  background: var(--accent);
}
article.post p, article.post li { font-size: 16px; }
article.post ul { padding-left: 1.3em; }
article.post li { margin: 4px 0; }
article.post li::marker { color: var(--muted); }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em;
  background: var(--inline-code); padding: 2px 6px; border-radius: 5px;
}
pre {
  background: var(--code-bg); color: var(--code-ink); border-radius: 12px;
  padding: 38px 18px 16px; overflow-x: auto; font-size: 13.5px; line-height: 1.65; position: relative;
}
pre::before {
  content: attr(data-lang); position: absolute; top: 10px; left: 18px;
  font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.08em;
  color: #8b8f98; text-transform: uppercase;
}
pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.back { display: inline-block; margin: 4px 0 8px; color: var(--muted); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--ink); }

/* 页脚 */
footer.site {
  margin-top: 48px; padding: 28px 0 40px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px; text-align: center;
}
footer.site .row { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; }
footer.site a { color: var(--muted); text-decoration: none; }
footer.site a:hover { color: var(--ink); text-decoration: underline; }
