:root {
  --ivory: #fffcf6;
  --paper: #f4f2ec;
  --ink: #1b1e28;
  --mute: #667085;
  --line: #e6e1d8;
  --indigo: #2a3d7a;
  --indigo-2: #3b5296;
  --footer: #d9deea;
  --footer-text: #2a3d7a;
  --footer-mute: #4d5d86;
  --max: 1160px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--gh-font-body, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif);
}
h1, h2, h3, h4, h5, .logo {
  font-family: var(--gh-font-heading, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif);
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--indigo); }
:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}
.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 50;
  background: var(--indigo);
  color: #fff;
  padding: 8px 12px;
}
.skip:focus { left: 8px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.wrap { width: min(var(--max), calc(100% - 36px)); margin: 0 auto; }

.site-head { background: var(--ivory); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.nav-inner { height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 28px; position: relative; min-width: 0; }
.logo { font-weight: 700; letter-spacing: 0.16em; font-size: 18px; color: var(--indigo); display: inline-flex; align-items: center; flex-shrink: 0; }
.nav-right { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; }
.logo img { height: 28px; width: auto; display: block; }
.menu { margin-right: auto; font-size: 14px; }
.menu ul { display: flex; gap: 22px; list-style: none; }
.menu .nav-current a,
.menu .on { color: var(--indigo); font-weight: 600; }
.icon-btn, .btn, .burger {
  border: 1px solid var(--line);
  background: var(--ivory);
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink);
  font-family: inherit;
}
.btn { background: var(--indigo); color: #fff; border-color: var(--indigo); }
.btn:hover { color: #fff; opacity: 0.92; }
.btn.block { display: block; text-align: center; margin-top: 10px; }
.burger {
  display: none;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  gap: 5px;
}
.burger span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--indigo);
}
body.nav-open { overflow: hidden; }
body.nav-open .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .burger span:nth-child(2) { opacity: 0; }
body.nav-open .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.burger span { transition: transform 0.15s ease, opacity 0.15s ease; }

.slider { position: relative; margin: 22px auto 8px; overflow: hidden; border-radius: 16px; }
.slides { position: relative; min-height: 420px; }
.slide { display: none; position: relative; min-height: 420px; }
.slide.is-on { display: block; }
.slide-img { position: absolute; inset: 0; background: #cfc8bc; }
.slide-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.slide-img::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,24,40,0.15) 20%, rgba(20,24,40,0.72) 100%);
}
.slide-txt {
  position: relative; z-index: 1;
  min-height: 420px;
  padding: 48px 56px;
  display: flex; flex-direction: column; justify-content: flex-end;
  max-width: 720px;
  color: #fffcf6;
}
.slide-txt span { color: #d5def2; font-size: 12px; letter-spacing: 0.14em; font-weight: 600; }
.slide-txt h2 { font-size: 32px; line-height: 1.28; margin: 10px 0 12px; color: #fff; }
.slide-txt p { color: rgba(255,252,246,0.86); font-size: 15px; margin-bottom: 16px; }
.slide-txt a { color: #fff; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,0.55); padding-bottom: 2px; width: max-content; }
.arr {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; background: rgba(255,252,246,0.92);
  font-size: 22px; cursor: pointer; color: var(--indigo);
}
.prev { left: 12px; } .next { right: 12px; }
.dots { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 6px; }
.dots button { width: 8px; height: 8px; border-radius: 50%; border: 0; background: #c9c3b8; cursor: pointer; }
.dots button.on { background: var(--indigo); }
.slider.is-single .arr,
.slider.is-single .dots { display: none; }

.body { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 24px; padding: 24px 0 64px; align-items: start; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.card { background: var(--ivory); border: 1px solid var(--line); display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; }
.thumb {
  height: 170px;
  background: #d5cfc4 center/cover no-repeat;
  display: block;
  position: relative;
  overflow: hidden;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pad { padding: 14px 16px 16px; }
.pad b { display: block; color: var(--indigo); font-size: 11px; letter-spacing: 0.12em; margin-bottom: 6px; }
.pad h3 { font-size: 16px; line-height: 1.4; }
.pad p { color: var(--mute); font-size: 13px; margin: 8px 0; }
.pad small { color: var(--mute); font-size: 12px; }
.empty { grid-column: 1 / -1; color: var(--mute); padding: 24px 4px; }

.aside { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; }
.box { background: var(--ivory); border: 1px solid var(--line); padding: 16px 16px 12px; border-radius: 16px; }
.box h4 { font-size: 13px; letter-spacing: 0.16em; color: var(--indigo); margin-bottom: 10px; }
.cats { list-style: none; }
.cats a, .box ul a { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.cats li:first-child a { border-top: 0; }
.cats em { color: var(--mute); font-style: normal; font-size: 12px; }
.hot { list-style: none; counter-reset: n; }
.hot li { counter-increment: n; }
.hot a { display: block; padding: 8px 0 8px 28px; border-top: 1px solid var(--line); font-size: 14px; position: relative; }
.hot li:first-child a { border-top: 0; }
.hot a::before { content: counter(n, decimal-leading-zero); position: absolute; left: 0; color: var(--indigo); font-size: 12px; top: 10px; }
.follow { font-size: 13px; color: var(--mute); }

.archive-head { grid-column: 1 / -1; margin-bottom: 4px; }
.archive-head .cat { color: var(--indigo); font-size: 12px; letter-spacing: 0.14em; }
.archive-head h1 { font-size: 32px; margin: 6px 0 10px; }
.archive-head p { color: var(--mute); font-size: 15px; }
.author-pic {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 12px;
}

.site-footer { background: transparent; color: var(--footer-text); margin-top: 8px; position: relative; }
.foot-wave { display: block; width: 100%; height: 130px; margin-bottom: -2px; }
.foot-wave path { fill: var(--footer); }
.foot-panel { background: var(--footer); }
.foot-top {
  display: grid;
  grid-template-columns: 1.2fr 1.3fr 1.1fr;
  gap: 36px;
  padding: 6px 0 48px;
  align-items: start;
}
.site-footer .logo { color: var(--indigo); letter-spacing: 0.08em; font-size: 22px; margin-bottom: 14px; }
.site-footer p { font-size: 13px; line-height: 1.7; margin-bottom: 14px; color: var(--footer-text); }
.site-footer h5 { color: var(--indigo); font-size: 15px; letter-spacing: 0.02em; margin-bottom: 16px; font-weight: 700; }
.site-footer ul { list-style: none; }
.site-footer li { padding: 4px 0; }
.site-footer a { color: var(--footer-text); }
.site-footer a:hover { color: var(--indigo); }
.mini { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center; margin-bottom: 12px; font-size: 13px; color: var(--indigo); }
.mini img, .mini i { display: block; width: 64px; height: 48px; object-fit: cover; background: #b7c0d6; }
.mini em { color: var(--footer-mute); font-style: normal; font-size: 12px; }
.social { letter-spacing: 0.06em; }
.sub { display: flex; margin-top: 8px; }
.sub input { flex: 1; border: 1px solid #b7c0d6; padding: 8px 10px; font-size: 13px; background: #fffcf6; color: #1b1e28; font-family: inherit; }
.sub button { border: 0; background: var(--indigo); color: #fffcf6; padding: 8px 12px; cursor: pointer; font-weight: 600; font-family: inherit; }
.site-footer small { display: block; margin-top: 8px; font-size: 11px; color: var(--footer-mute); }
.sub-msg { display: none; font-size: 13px; margin-top: 8px; color: var(--indigo); }
form.success .sub-msg.success,
form.error .sub-msg.error { display: block; }
form.success input,
form.success button { display: none; }
.foot-bot { border-top: 1px solid #c5ccdb; background: var(--footer); }
.foot-bot .wrap { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0 20px; font-size: 12px; }
.foot-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 0 2px; }
.icp { color: var(--footer-mute); }

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  padding: 24px 0 12px;
  align-items: start;
}
.detail.has-toc {
  grid-template-columns: minmax(0, 1fr) 300px;
}
.detail:not(.has-toc) .aside { display: none; }
.article-wrap { padding: 24px 0 64px; }
.article-wrap .story { max-width: 760px; }
.story { padding: 28px 32px 36px; }
.crumb { font-size: 13px; color: var(--mute); margin-bottom: 14px; }
.cat-label { display: inline-block; color: var(--indigo); font-size: 12px; letter-spacing: 0.14em; margin-bottom: 10px; }
.toc { position: relative; padding-bottom: 16px; }
.toc h4 { margin-bottom: 14px; }
.toc-track {
  position: absolute; left: 16px; top: 52px; bottom: 48px;
  width: 2px; background: var(--line);
}
.toc-track i {
  display: block; width: 2px; height: 25%; background: var(--indigo);
}
.toc ol { list-style: none; padding-left: 14px; }
.toc ol a {
  display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: baseline;
  padding: 10px 0; font-size: 14px; line-height: 1.4; border: 0;
}
.toc ol a em { font-style: normal; font-size: 11px; color: var(--mute); letter-spacing: 0.06em; }
.toc ol a.on, .toc ol a:hover { color: var(--indigo); }
.toc ol a.on em { color: var(--indigo); font-weight: 700; }
.toc-top { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--mute); }
.story h1 { font-size: 32px; line-height: 1.28; font-weight: 700; margin-bottom: 14px; }
.byline { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--mute); margin-bottom: 18px; }
.lead-fig { margin: 0 0 20px; }
.lead-pic {
  display: block;
  width: 100%;
  height: 360px;
  object-fit: cover;
  border-radius: 12px;
  background: #cfc8bc;
}
.cap { font-size: 12px; color: var(--mute); margin: 8px 0 0; }
.dek { font-size: 18px; line-height: 1.7; color: #2c3140; margin-bottom: 18px; }
.gh-content {
  font-size: 16px;
  line-height: 1.9;
  color: #2a2d34;
}
.gh-content > * { margin-bottom: 1em; }
.gh-content h2 { font-size: 20px; margin: 28px 0 10px; color: var(--indigo); scroll-margin-top: 84px; }
.gh-content h3 { font-size: 17px; margin: 22px 0 8px; }
.gh-content a { color: var(--indigo); text-decoration: underline; }
.gh-content img,
.gh-content video { max-width: 100%; height: auto; }
.gh-content figure { margin: 1.4em 0; }
.gh-content figcaption { font-size: 12px; color: var(--mute); margin-top: 8px; }
.gh-content blockquote {
  border-left: 3px solid var(--indigo);
  padding: 4px 0 4px 16px;
  color: #2c3140;
}
.gh-content ul, .gh-content ol { padding-left: 1.4em; }
.gh-content li { margin: 0.3em 0; }
.gh-content code {
  font-size: 0.9em;
  background: var(--paper);
  padding: 0.1em 0.35em;
}
.gh-content pre,
.kg-code-card pre {
  background: #1b1e28;
  color: #e8ecf4;
  padding: 16px 18px;
  overflow: auto;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.55;
  margin: 1.2em 0 1.4em;
}
.gh-content pre code,
.kg-code-card pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata { color: #8b93a7; font-style: italic; }
.token.punctuation { color: #c5cce0; }
.token.keyword,
.token.operator,
.token.boolean { color: #9db4ff; }
.token.function { color: #7ec8b8; }
.token.string,
.token.attr-value,
.token.char { color: #d4b483; }
.token.number,
.token.constant { color: #e0a87a; }
.token.class-name,
.token.maybe-class-name { color: #c5b4ff; }
.token.builtin,
.token.decorator,
.token.annotation,
.token.atrule { color: #e8c07a; }
.token.property,
.token.attr-name { color: #9db4ff; }
.token.regex,
.token.important { color: #e0a87a; }
.gh-content hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.kg-width-wide {
  width: calc(100% + 48px);
  max-width: none;
  margin-left: -24px;
  margin-right: -24px;
}
.kg-width-full {
  width: 100vw;
  max-width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}
.kg-width-full img { width: 100%; }
.comments { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tags a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--indigo);
}
.related { padding: 8px 0 48px; }
.related h2 { font-size: 16px; letter-spacing: 0.12em; color: var(--indigo); margin-bottom: 14px; }
.cards.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.pager { display: flex; gap: 8px; align-items: center; padding: 8px 0 4px; grid-column: 1 / -1; }
.pager a, .pager span {
  min-width: 36px; height: 36px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px;
  display: grid; place-items: center; font-size: 13px; background: var(--ivory);
}
.pager a:hover { background: var(--indigo); color: #fffcf6; border-color: var(--indigo); }

.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 30;
  width: 48px; height: 48px; color: var(--indigo);
  opacity: 0.4;
}
.to-top svg { position: absolute; inset: 0; width: 48px; height: 48px; transform: rotate(-90deg); }
.to-top .track { fill: none; stroke: #d5d8e2; stroke-width: 3; }
.to-top .prog { fill: none; stroke: var(--indigo); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 113; stroke-dashoffset: 113; }
.to-top span {
  position: absolute; inset: 6px; border-radius: 50%;
  background: var(--ivory); display: grid; place-items: center;
  border: 1px solid var(--line); font-size: 16px;
}

.error-box {
  min-height: 50vh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 16px;
  padding: 64px 0;
}
.error-box h1 { font-size: 64px; color: var(--indigo); }
.error-box p { color: var(--mute); }
.error-stack { padding-bottom: 48px; font-size: 14px; color: var(--mute); }

@media (max-width: 900px) {
  .burger { display: grid; }
  .menu {
    display: none;
    position: absolute;
    top: 68px;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    background: var(--ivory);
    border-bottom: 1px solid var(--line);
    padding: 8px 18px 16px;
    margin: 0;
  }
  body.nav-open .menu { display: block; }
  .menu ul { flex-direction: column; gap: 0; }
  .menu a { display: block; padding: 10px 0; border-top: 1px solid var(--line); }
  .menu li:first-child a { border-top: 0; }
  .body, .cards, .foot-top, .detail, .cards.three { grid-template-columns: 1fr; }
  .slide, .slide-txt { min-height: 280px; }
  .slide-txt { padding: 28px 24px; }
  .aside { position: static; }
  .story { padding: 20px 18px 28px; }
  .lead-pic { height: 220px; }
  .foot-bot .wrap { flex-direction: column; }
  .nav-inner { gap: 8px; }
  .logo { letter-spacing: 0.04em; font-size: 16px; }
  .nav-right { margin-left: 0; }
  .nav-right .btn { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .burger span { transition: none; }
}
