:root {
  --ink: #1e2025;
  --muted: #6f7177;
  --paper: #f8f8f6;
  --pill: #e9e9e7;
  --line: #e2e2de;
  --blue: #2878ff;
  --code-bg: #1d1f24;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 20px; }
body {
  margin: 0; color: var(--ink); background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px; line-height: 1.8;
}
a { color: inherit; }
img { max-width: 100%; height: auto; }

/* header */
.top {
  width: min(1040px, calc(100% - 40px)); height: 72px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 760; letter-spacing: -.02em; text-decoration: none; }
.brand svg { width: 22px; height: 22px; }
.pill {
  display: inline-block; padding: 8px 15px; border-radius: 999px; background: var(--pill);
  font-size: 14px; font-weight: 620; text-decoration: none; line-height: 1.4;
  transition: transform .25s var(--ease), background .25s;
}
.pill:hover { transform: translateY(-2px); background: #dfdfdc; }

/* home */
.home { width: min(1040px, calc(100% - 40px)); margin: 0 auto; padding-bottom: 40px; }
.hero { padding: 36px 0 30px; }
.hero h1 { font-size: clamp(30px, 5vw, 44px); letter-spacing: -.03em; margin: 0 0 8px; line-height: 1.2; }
.hero p { margin: 0; color: var(--muted); font-size: 17px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 18px;
  overflow: hidden; text-decoration: none; transition: transform .3s var(--ease), box-shadow .3s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(31, 32, 38, .10); }
.cover { aspect-ratio: 16 / 9; background: #eeeeea; overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; }
.card-body { padding: 16px 18px 18px; }
.card h2 { font-size: 18px; line-height: 1.45; margin: 0 0 6px; letter-spacing: -.01em; }
.card p { margin: 0 0 10px; color: var(--muted); font-size: 14.5px; line-height: 1.65; }
.card .meta { margin: 0; }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; }
.tag { padding: 1px 9px; border-radius: 999px; background: var(--pill); font-size: 12.5px; color: #55575d; }

/* post */
.post { width: min(760px, calc(100% - 40px)); margin: 0 auto; padding: 6px 0 40px; }
.back { display: inline-block; color: var(--muted); font-size: 14px; text-decoration: none; margin-bottom: 14px; }
.back:hover { color: var(--ink); }
.post h1 { font-size: clamp(26px, 4.4vw, 36px); line-height: 1.3; letter-spacing: -.025em; margin: 0 0 12px; }
.lede { font-size: 17.5px; color: #44464c; margin: 14px 0 22px; }
.toc { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 18px 12px; margin: 0 0 26px; font-size: 14.5px; }
.toc p { margin: 0 0 4px; font-weight: 650; }
.toc ol { margin: 0; padding-left: 20px; }
.toc a { text-decoration: none; color: #44464c; }
.toc a:hover { color: var(--blue); }

.prose h2 { font-size: 23px; line-height: 1.4; margin: 42px 0 12px; letter-spacing: -.015em; }
.prose h3 { font-size: 18.5px; margin: 28px 0 8px; }
.prose p, .prose li { color: #2a2c31; }
.prose a { color: var(--blue); text-decoration: none; border-bottom: 1px solid rgba(40, 120, 255, .3); }
.prose a:hover { border-bottom-color: var(--blue); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: 4px 0; }
.prose strong { font-weight: 680; }
.prose :not(pre) > code {
  font-family: "SF Mono", Menlo, Consolas, monospace; font-size: .88em;
  background: var(--pill); border-radius: 6px; padding: 1px 6px; word-break: break-word;
}
.prose pre {
  position: relative; background: var(--code-bg); color: #e3e5ea; border-radius: 12px;
  padding: 16px 18px; overflow-x: auto; font-size: 14px; line-height: 1.65; margin: 16px 0 20px;
}
.prose pre code { font-family: "SF Mono", Menlo, Consolas, monospace; white-space: pre; }
.copy {
  position: absolute; top: 9px; right: 9px; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .1); color: #d7d9de; font: 600 12px/1 -apple-system, "PingFang SC", sans-serif;
  padding: 6px 10px; border-radius: 999px; transition: background .2s;
}
.copy:hover { background: rgba(255, 255, 255, .2); }

figure { margin: 20px 0 26px; }
figure img {
  display: block; margin: 0 auto; border-radius: 12px; cursor: zoom-in;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 10px 26px rgba(31, 32, 38, .10);
}
figcaption { text-align: center; color: var(--muted); font-size: 13.5px; margin-top: 10px; line-height: 1.6; }

blockquote { margin: 18px 0; padding: 12px 16px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
blockquote p { margin: 4px 0; }
blockquote.callout.tip { background: #eef5ff; border-color: #d3e3ff; }
blockquote.callout.warn { background: #fdf6e8; border-color: #f3e1bb; }
blockquote.callout strong:first-child { margin-right: 6px; }

.table-wrap { overflow-x: auto; margin: 16px 0 20px; }
table { border-collapse: collapse; font-size: 14.5px; min-width: 60%; }
th, td { border: 1px solid var(--line); padding: 7px 12px; text-align: left; vertical-align: top; }
th { background: #f0f0ed; font-weight: 650; }
td { background: #fff; }

/* footer */
.foot { width: min(1040px, calc(100% - 40px)); margin: 20px auto 0; padding: 26px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
.foot p { margin: 2px 0; }

/* image zoom */
.zoom { position: fixed; inset: 0; background: rgba(20, 21, 25, .86); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 50; cursor: zoom-out; }
.zoom[hidden] { display: none; }
.zoom img { max-width: 100%; max-height: 100%; border-radius: 10px; }

@media (max-width: 600px) {
  body { font-size: 15.5px; }
  .top { height: 60px; }
  .hero { padding: 18px 0 22px; }
  .prose pre { font-size: 13px; padding: 14px; border-radius: 10px; margin-left: -6px; margin-right: -6px; }
  figure { margin-left: -6px; margin-right: -6px; }
}
