:root {
  --fg: #1f2937; --muted: #6b7280; --faint: #9ca3af;
  --line: #e5e7eb; --link: #2563eb; --accent: #2563eb;
  --bg: #fbfbfc; --card: #ffffff; --chip: #eef2ff;
  --code-bg: #f3f4f6; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --shadow-hover: 0 8px 24px rgba(16,24,40,.10);
}
@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e5e7eb; --muted: #9ca3af; --faint: #6b7280;
    --line: #262b33; --link: #60a5fa; --accent: #3b82f6;
    --bg: #0b0e13; --card: #12161d; --chip: #1c2740;
    --code-bg: #171c24; --shadow: none; --shadow-hover: 0 8px 24px rgba(0,0,0,.45);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--fg); background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  line-height: 1.8; font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 0 22px; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* header */
.site-header {
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: 16px 0; margin-bottom: 40px;
}
.header-in { display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--fg); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 11px; background: var(--accent);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 21px; font-weight: 700; flex: none;
}
.brand-text { font-size: 19px; font-weight: 700; line-height: 1.25; display: flex; flex-direction: column; }
.brand-text small { font-size: 12.5px; font-weight: 400; color: var(--muted); }
.site-header nav a { margin-left: 20px; color: var(--muted); font-size: 15px; }
.site-header nav a:hover { color: var(--link); text-decoration: none; }

/* hero */
.hero { padding: 10px 0 6px; }
.hero h1 { font-size: 34px; margin: 0 0 8px; letter-spacing: .5px; }
.hero p { color: var(--muted); margin: 0; max-width: 34em; }

.section-title {
  font-size: 19px; margin: 38px 0 16px; padding-bottom: 8px;
  border-bottom: 2px solid var(--line); position: relative;
}
.section-title::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 56px; height: 2px; background: var(--accent);
}

/* cards */
.cards { display: grid; gap: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px 22px; box-shadow: var(--shadow);
  transition: box-shadow .18s ease, transform .18s ease;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; color: var(--faint); margin-bottom: 6px; }
.card h3 { margin: 2px 0 6px; font-size: 20px; line-height: 1.45; }
.card h3 a { color: var(--fg); }
.card h3 a:hover { color: var(--link); text-decoration: none; }
.card-sum { color: var(--muted); margin: 0 0 10px; font-size: 15px; line-height: 1.7; }
.readmore { font-size: 14.5px; }

.chip {
  display: inline-block; background: var(--chip); color: var(--link);
  border-radius: 999px; padding: 1px 10px; font-size: 12.5px; line-height: 1.7;
}
.chip:hover { text-decoration: none; filter: brightness(.97); }
.chip-lg { font-size: 13.5px; padding: 3px 13px; margin: 0 8px 10px 0; }
.chip-lg span { color: var(--faint); font-size: 12px; }
.tagcloud { margin: 4px 0 0; }

/* archive list */
.year-title { font-size: 17px; color: var(--muted); margin: 26px 0 6px; }
.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { padding: 9px 2px; border-bottom: 1px dashed var(--line); display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.post-list time { color: var(--faint); font-size: 14px; font-variant-numeric: tabular-nums; flex: none; }
.post-list > li > a { color: var(--fg); font-size: 16.5px; }
.post-list > li > a:hover { color: var(--link); text-decoration: none; }
.list-tags { margin-left: auto; display: flex; gap: 6px; }

/* post page */
.post h1 { font-size: 30px; line-height: 1.4; margin: 4px 0 10px; }
.post-meta { color: var(--faint); font-size: 14px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 0 0 26px; }
.meta-tags { display: flex; gap: 6px; }
.content { font-size: 16.5px; }
.content p { margin: 16px 0; }
.content h2 { font-size: 22px; margin: 32px 0 10px; }
.content h3 { font-size: 18.5px; margin: 26px 0 8px; }
.content ul, .content ol { padding-left: 1.5em; }
.content li { margin: 5px 0; }
.content code {
  background: var(--code-bg); padding: 2px 6px; border-radius: 5px; font-size: 88%;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.content pre {
  background: #111827; color: #e5e7eb; padding: 16px 18px; border-radius: 10px;
  overflow-x: auto; line-height: 1.65;
}
.content pre code { background: none; padding: 0; color: inherit; }
.content blockquote {
  margin: 18px 0; padding: 4px 18px; border-left: 3px solid var(--accent); color: var(--muted);
}
.content img { max-width: 100%; border-radius: 8px; }

.post-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; }
.post-nav a {
  flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 17px; color: var(--fg); font-size: 15px; box-shadow: var(--shadow);
}
.post-nav a:hover { text-decoration: none; border-color: var(--accent); }
.post-nav a span { display: block; color: var(--faint); font-size: 13px; margin-bottom: 3px; }
.post-nav .nav-next { text-align: right; }

/* footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 64px; padding: 20px 0 34px; color: var(--faint); font-size: 14px; }
.footer-in { display: flex; gap: 8px; flex-wrap: wrap; }
.site-footer .dot { opacity: .6; }

@media (max-width: 560px) {
  .hero h1 { font-size: 28px; }
  .post h1 { font-size: 25px; }
  .brand-text small { display: none; }
  .post-nav { flex-direction: column; }
}
