:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --paper: #ffffff;
  --paper-2: #eef3f7;
  --ink: #17202a;
  --muted: #667789;
  --line: #d9e2ea;
  --blue: #1d5c83;
  --teal: #168070;
  --coral: #d95f4b;
  --amber: #c88719;
  --code: #101820;
  --radius: 8px;
  --content: 76ch;
  font-family: "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background:
    linear-gradient(90deg, rgba(29, 92, 131, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(29, 92, 131, 0.045) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  font-size: 17px;
  line-height: 1.78;
  margin: 0;
  min-height: 100vh;
}

a { color: var(--blue); text-underline-offset: 0.2em; }
a:hover { color: var(--coral); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--teal) 70%, white);
  outline-offset: 3px;
}
img { height: auto; max-width: 100%; }

.skip-link {
  background: var(--ink);
  color: white;
  left: 1rem;
  padding: 0.6rem 0.8rem;
  position: fixed;
  top: 1rem;
  transform: translateY(-150%);
  z-index: 10;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  align-items: center;
  background: rgba(246, 248, 251, 0.92);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 1rem;
  grid-template-columns: auto 1fr;
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(12px);
}
.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  font-weight: 850;
  gap: 0.7rem;
  text-decoration: none;
}
.brand-mark {
  align-items: center;
  background: var(--ink);
  border-radius: 50%;
  box-shadow: inset -6px -8px 0 rgba(255,255,255,0.13), 0 0 0 4px var(--paper);
  color: white;
  display: inline-flex;
  font-size: 0.8rem;
  height: 2.4rem;
  justify-content: center;
  width: 2.4rem;
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: flex-end;
}
.site-nav a {
  border-radius: 999px;
  color: var(--muted);
  min-height: 40px;
  padding: 0.32rem 0.7rem;
  text-decoration: none;
}
.site-nav a:hover, .site-nav a[aria-current="page"] {
  background: var(--paper);
  color: var(--blue);
  box-shadow: 0 0 0 1px var(--line);
}

.page-main {
  flex: 1 0 auto;
  margin: 0 auto;
  max-width: 1180px;
  padding: clamp(1.4rem, 4vw, 3rem) clamp(1rem, 4vw, 2.5rem) 4rem;
  width: 100%;
}
.page-title, .article-title, .hero h1 {
  font-family: "Microsoft YaHei UI", "Noto Sans SC", system-ui, sans-serif;
  letter-spacing: 0;
  line-height: 1.16;
  margin: 0;
}
.page-title, .article-title { font-size: clamp(2rem, 5vw, 3.8rem); }
.lead {
  color: var(--muted);
  font-size: 1.15rem;
  margin: 1rem 0 0;
  max-width: 62ch;
}
.post-list {
  display: grid;
  gap: 0.9rem;
  max-width: var(--content);
}
.post-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.post-card h2, .post-card h3 { line-height: 1.35; margin: 0 0 0.35rem; }
.post-card h2 a, .post-card h3 a { color: var(--ink); text-decoration: none; }
.post-meta, .article-meta { color: var(--muted); font-size: 0.92rem; }
.post-card p { margin: 0.45rem 0; }
.tag-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag-row a, .pill {
  background: var(--paper-2);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.86rem;
  padding: 0.12rem 0.55rem;
  text-decoration: none;
}
.table-wrap {
  overflow-x: auto;
}
.prose table {
  border-collapse: collapse;
  min-width: 36rem;
  width: 100%;
}
.prose th,
.prose td {
  border: 1px solid var(--line);
  overflow-wrap: anywhere;
  padding: 0.5rem 0.65rem;
  text-align: left;
  vertical-align: top;
}
.prose th {
  background: var(--paper-2);
}
.site-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  font-size: 0.92rem;
  gap: 0.8rem;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1180px;
  padding: 1.4rem clamp(1rem, 4vw, 2.5rem) 2rem;
}
.footer-identity,
.footer-records,
.footer-links,
.psb-record {
  align-items: center;
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  min-width: 0;
  white-space: nowrap;
}
.footer-records::before {
  content: "·";
}
.psb-record {
  gap: 0.25rem;
}
.psb-record img {
  flex: 0 0 auto;
  height: 1rem;
  width: 1rem;
}

@media (max-width: 760px) {
  .site-header { grid-template-columns: 1fr; }
  .site-nav { justify-content: flex-start; }
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
  .footer-identity,
  .footer-records,
  .footer-links {
    flex-wrap: wrap;
    white-space: normal;
  }
}
