/* 夜航 · Lux032 Blog
   设计依据：.impeccable/mocks/seminar/kimi/（研讨会选定方案） */

:root {
  --ink: #0F1420;
  --surface: #161C2B;
  --raise: #1C2334;
  --code-bg: #0B0F18;
  --line: rgba(213, 225, 247, 0.11);
  --line-soft: rgba(213, 225, 247, 0.07);
  --text: #E9EEF7;
  --dim: #AAB5C9;
  --faint: #8FA1BC;
  --star: #93C5E8;
  --star-hover: #BCDAF2;
  --moon: #E4B25F;
  --serif: "Spectral", "Noto Serif SC", "Songti SC", "STSong", serif;
  --kai: "LXGW WenKai Screen", "Noto Serif SC", "Kaiti SC", serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
  --ease-out: cubic-bezier(0.22, 0.7, 0.24, 1);
  --head-h: 64px;
  color-scheme: dark;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h) + 20px); -webkit-text-size-adjust: 100%; scrollbar-color: #2A3349 var(--ink); }
body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: lining-nums;
  overflow-wrap: break-word;
}
::selection { background: rgba(228, 178, 95, 0.34); color: #FFF6E3; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: #2A3349; border-radius: 6px; border: 2px solid var(--ink); }
::-webkit-scrollbar-thumb:hover { background: #3A4560; }
a { color: var(--star); text-decoration: none; text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { color: var(--star-hover); }
:focus-visible { outline: 2px solid var(--moon); outline-offset: 3px; border-radius: 3px; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.linklike { color: var(--star); padding: 0; }
.linklike:hover { color: var(--star-hover); }
time { font-variant-numeric: tabular-nums; }

.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--moon); color: var(--ink); padding: 8px 14px; border-radius: 6px; }
.skip:focus { top: 12px; color: var(--ink); }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 36px; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 30;
  background: var(--ink);
  border-bottom: 1px solid var(--line-soft);
  padding: 16px 0;
}
.site-head.is-overlay { position: absolute; left: 0; right: 0; background: transparent; border-bottom: 0; padding: 22px 0; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.wordmark { font-size: 20px; font-weight: 700; letter-spacing: 0.01em; color: var(--text); white-space: nowrap; }
.wordmark em { font-style: normal; font-weight: 400; color: var(--dim); margin-left: 8px; font-size: 15px; letter-spacing: 0.08em; }
.wordmark:hover { color: var(--text); }
.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a {
  color: var(--dim); font-size: 14.5px; letter-spacing: 0.06em;
  padding: 2px 0; border-bottom: 1px solid transparent;
}
.is-overlay .site-nav a, .is-overlay .wordmark { color: #C9D3E4; text-shadow: 0 1px 10px rgba(8, 11, 18, 0.75); }
.is-overlay .wordmark { color: var(--text); }
.site-nav a:hover, .site-nav a.current { color: var(--text); border-bottom-color: var(--moon); }
.search-btn { display: inline-flex; padding: 4px; color: var(--dim); border-radius: 6px; }
.is-overlay .search-btn { color: #C9D3E4; }
.search-btn:hover { color: var(--text); }
.search-btn svg { width: 18px; height: 18px; }

/* ---------- hero ---------- */
.hero { position: relative; height: min(52vh, 540px); min-height: 420px; overflow: hidden; }
.hero-img { position: absolute; inset: 0; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; animation: heroIn 1.6s var(--ease-out) both; }
.hero-veil {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(15,20,32,0.68) 0%, rgba(15,20,32,0) 150px),
    linear-gradient(180deg, rgba(15,20,32,0.30) 0%, rgba(15,20,32,0) 26%, rgba(15,20,32,0) 50%, rgba(15,20,32,0.86) 88%, var(--ink) 100%);
}
.hero-text { position: absolute; left: 0; right: 0; bottom: 0; padding-bottom: 44px; }
.hero-text h1 {
  font-size: clamp(40px, 5.4vw, 62px); font-weight: 700; letter-spacing: 0.015em; line-height: 1.14;
  text-shadow: 0 2px 24px rgba(8, 11, 18, 0.55);
  animation: riseIn 1s 0.25s var(--ease-out) both;
}
.hero-text .motto {
  font-family: var(--kai); font-size: 18px; color: #C9D4E8; margin-top: 14px; letter-spacing: 0.1em;
  text-shadow: 0 1px 14px rgba(8, 11, 18, 0.6);
  animation: riseIn 1s 0.42s var(--ease-out) both;
}
.hero-text .intro {
  margin-top: 10px; font-size: 14.5px; color: var(--dim); letter-spacing: 0.03em; max-width: 46em;
  text-shadow: 0 1px 12px rgba(8, 11, 18, 0.7);
  animation: riseIn 1s 0.55s var(--ease-out) both;
}
@keyframes heroIn { from { opacity: 0; transform: scale(1.035); } to { opacity: 1; transform: scale(1); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- shared meta ---------- */
.meta {
  margin-top: 14px; font-size: 13.5px; color: var(--faint); letter-spacing: 0.04em;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px;
}
.meta svg { width: 14px; height: 14px; vertical-align: -2px; }
.meta .mi { white-space: nowrap; color: var(--faint); }
.meta a.mi:hover { color: var(--star-hover); }
.meta .dot { color: var(--faint); margin-right: 8px; }
.meta .pin-tag { color: var(--moon); display: inline-flex; align-items: center; gap: 5px; letter-spacing: 0.06em; white-space: nowrap; }

/* ---------- pinned feature ---------- */
.pinned { margin-top: 56px; }
.pinned + .pinned { margin-top: 28px; }
.pinned-inner {
  display: grid; grid-template-columns: 7fr 5fr;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  box-shadow: 0 28px 60px -28px rgba(3, 6, 12, 0.65);
}
.pinned-media { position: relative; min-height: 340px; overflow: hidden; }
.pinned-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease-out); }
.pinned-inner:hover .pinned-media img { transform: scale(1.03); }
.pinned-body { padding: 40px 42px 38px; display: flex; flex-direction: column; justify-content: center; }
.pinned-body h2 { font-size: 27px; font-weight: 700; line-height: 1.42; text-wrap: balance; }
.pinned-body h2 a { color: var(--text); }
.pinned-body h2 a:hover { color: var(--star-hover); }
.pinned-body .excerpt {
  margin-top: 18px; font-size: 15.5px; line-height: 1.85; color: var(--dim);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.read-link { margin-top: 24px; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; letter-spacing: 0.04em; align-self: flex-start; }
.read-link svg { width: 16px; height: 16px; transition: transform 0.25s ease; }
.read-link:hover svg { transform: translateX(4px); }

/* ---------- home grid ---------- */
.main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 72px; margin-top: 84px; }
.lane { margin-bottom: 72px; }
.lane-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 10px; }
.lane-head h2 { font-size: 22px; font-weight: 600; letter-spacing: 0.02em; }
.lane-head .count { font-size: 13px; color: var(--faint); letter-spacing: 0.06em; }
.lane-head::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); align-self: center; }
.lane-desc { font-size: 13.5px; color: var(--faint); margin-bottom: 8px; letter-spacing: 0.02em; }

.entry {
  display: grid; grid-template-columns: minmax(0, 1fr) 116px; gap: 26px;
  padding: 26px 0; border-bottom: 1px solid var(--line-soft); align-items: center;
}
.entry.no-thumb { grid-template-columns: minmax(0, 1fr); }
.lane > .entry:last-of-type { border-bottom: none; }
.entry h3 { font-size: 19px; font-weight: 600; line-height: 1.5; }
.entry h3 a { color: var(--text); }
.entry h3 a:hover { color: var(--star-hover); }
.entry .meta { margin-top: 7px; }
.entry .excerpt {
  margin-top: 10px; font-size: 14.5px; line-height: 1.8; color: var(--dim);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.entry .thumb { width: 116px; height: 116px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.entry .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease-out); }
.entry .thumb img.contain { object-fit: contain; background: #F2F3F5; padding: 16px; }
.entry:hover .thumb img { transform: scale(1.05); }

.fig-strip { margin: 6px 0 10px; }
.fig-strip .strip-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.fig-strip .strip-grid a { display: block; height: 228px; overflow: hidden; border-radius: 12px; border: 1px solid var(--line); }
.fig-strip .strip-grid a.wide { grid-column: span 3; }
.fig-strip .strip-grid a.tall { grid-column: span 2; }
.fig-strip .strip-grid img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 26%; transition: transform 0.5s var(--ease-out); }
.fig-strip .strip-grid a:hover img { transform: scale(1.045); }
.fig-strip figcaption { margin-top: 12px; text-align: center; font-family: var(--kai); font-size: 13.5px; color: var(--faint); letter-spacing: 0.04em; }

.notes-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 44px; }
.notes-list a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 18px;
  padding: 13px 0; border-bottom: 1px solid var(--line-soft); color: var(--dim); font-size: 14.5px; line-height: 1.6;
}
.notes-list a:hover { color: var(--star-hover); }
.notes-list a .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-list a time { font-size: 12.5px; color: var(--faint); letter-spacing: 0.05em; flex-shrink: 0; }
.lane-foot { margin-top: 20px; font-size: 14px; }
.lane-foot a { display: inline-flex; align-items: center; gap: 6px; }
.lane-foot svg { width: 15px; height: 15px; transition: transform 0.25s ease; }
.lane-foot a:hover svg { transform: translateX(3px); }
.all-posts { margin-top: -24px; }

/* ---------- rail ---------- */
.rail section { padding-bottom: 30px; margin-bottom: 30px; border-bottom: 1px solid var(--line-soft); }
.rail section:last-child { border-bottom: none; }
.rail h2.rail-h { font-size: 15px; font-weight: 600; letter-spacing: 0.1em; color: var(--dim); margin-bottom: 16px; }
.author-head { display: flex; align-items: center; gap: 18px; }
.author-head img { width: 72px; height: 72px; border-radius: 50%; border: 1px solid var(--line); flex-shrink: 0; object-fit: cover; }
.s-author .name { font-size: 18px; font-weight: 600; }
.s-author .sign { font-family: var(--kai); font-size: 14.5px; color: var(--moon); margin-top: 4px; letter-spacing: 0.06em; }
.s-author p.bio { font-size: 13.5px; color: var(--faint); margin-top: 14px; line-height: 1.8; }
.socials { margin-top: 14px; font-size: 13.5px; line-height: 2; }
.socials a { color: var(--dim); }
.socials a:hover { color: var(--star-hover); }
.socials .sep { color: var(--faint); margin: 0 7px; }
.rail .prose { font-size: 14px; line-height: 1.9; color: var(--dim); }
.rail .prose a { text-decoration: underline; text-decoration-color: rgba(147,197,232,0.4); }
.friends a { display: block; padding: 9px 0; font-size: 14.5px; color: var(--text); }
.friends a span { display: block; font-size: 12.5px; color: var(--faint); margin-top: 1px; }
.friends a:hover { color: var(--star-hover); }
.friends .lane-foot { margin-top: 12px; }
.friends .lane-foot a { display: inline-flex; padding: 0; color: var(--star); font-size: 14px; }
.pages { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; }
.pages a, .pages .linklike { color: var(--dim); font-size: 14px; }
.pages a:hover, .pages .linklike:hover { color: var(--star-hover); }

/* ---------- footer ---------- */
.site-foot { margin-top: 96px; border-top: 1px solid var(--line-soft); padding: 40px 0 52px; }
.site-foot .wrap { display: flex; justify-content: space-between; align-items: baseline; gap: 12px 24px; flex-wrap: wrap; }
.site-foot .motto { font-family: var(--kai); font-size: 15px; color: var(--dim); letter-spacing: 0.1em; }
.site-foot .legal { font-size: 13px; color: var(--faint); letter-spacing: 0.04em; }
.site-foot .legal a { color: var(--faint); text-decoration: underline; text-decoration-color: rgba(143,161,188,0.4); }
.site-foot .legal a:hover { color: var(--star-hover); }

/* ---------- post ---------- */
.post-wrap { display: grid; grid-template-columns: minmax(0, 700px) 248px; gap: 80px; justify-content: center; margin-top: 72px; }
.post-wrap.no-toc { grid-template-columns: minmax(0, 700px); }
.post-head h1 { font-size: 34px; font-weight: 700; line-height: 1.42; letter-spacing: 0.01em; text-wrap: balance; }
.post-head .meta { margin-top: 18px; }
.post-head .meta .cat { color: var(--dim); }

.outdate {
  margin-top: 26px; padding: 14px 18px; font-size: 14px; line-height: 1.7; color: var(--dim);
  background: var(--surface); border: 1px solid rgba(228, 178, 95, 0.28); border-radius: 10px;
}
.outdate::before { content: "旧文提醒　"; color: var(--moon); font-weight: 600; }

.post-cover { margin-top: 34px; }
.post-cover img { width: 100%; border-radius: 14px; border: 1px solid var(--line); }

.series { margin-top: 30px; padding: 18px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.series-h { font-size: 13.5px; color: var(--faint); letter-spacing: 0.06em; margin-bottom: 8px; }
.series ol { list-style: none; counter-reset: s; }
.series li { counter-increment: s; font-size: 14.5px; line-height: 1.7; padding: 3px 0; display: flex; gap: 10px; }
.series li::before { content: counter(s, decimal-leading-zero); color: var(--faint); font-size: 12.5px; min-width: 20px; padding-top: 2px; font-variant-numeric: tabular-nums; }
.series li.here { color: var(--text); }
.series li.here::before { color: var(--moon); }
.series li a { color: var(--dim); }
.series li a:hover { color: var(--star-hover); }

.toc-mobile { display: none; }

/* 正文 */
.post-body { margin-top: 44px; font-size: 17px; line-height: 1.88; }
.post-body > :first-child { margin-top: 0; }
.post-body p { margin: 1.35em 0; }
.post-body h2 { font-size: 24px; font-weight: 700; line-height: 1.5; margin: 2.5em 0 0.9em; text-wrap: balance; }
.post-body h3 { font-size: 20px; font-weight: 600; line-height: 1.5; margin: 2.1em 0 0.7em; text-wrap: balance; }
.post-body h4, .post-body h5, .post-body h6 { font-size: 17px; font-weight: 600; margin: 1.8em 0 0.6em; }
.post-body h1 { font-size: 26px; font-weight: 700; line-height: 1.45; margin: 2.4em 0 0.9em; }
.post-body .headerlink { display: none; }
.post-body .chap { color: var(--moon); font-weight: 600; }
.post-body a { text-decoration: underline; text-decoration-color: rgba(147, 197, 232, 0.4); }
.post-body a:hover { text-decoration-color: currentColor; }
.post-body strong { font-weight: 600; color: #F4F7FC; }
.post-body em { font-style: italic; }
.post-body ul, .post-body ol { margin: 1.2em 0; padding-left: 1.6em; }
.post-body li { margin: 0.4em 0; }
.post-body li::marker { color: var(--faint); }
.post-body li > p { margin: 0.4em 0; }
.post-body hr { border: 0; height: 1px; background: var(--line); margin: 2.8em auto; width: 40%; }
.post-body blockquote {
  margin: 2em 0; padding: 4px 0 4px 22px; border-left: 1px solid var(--line);
  font-family: var(--kai); font-size: 17.5px; color: var(--dim); line-height: 1.9;
}
.post-body blockquote p { margin: 0.6em 0; }
.post-body center { display: block; }
.post-body span[style*="font-size"] { font-size: inherit !important; }
.post-body h3 span[style*="font-size"], .post-body h2 span[style*="font-size"] { font-size: inherit !important; }

/* 图片 */
.post-body figure { margin: 2.2em 0; }
.post-body img { border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.post-body figure img { width: 100%; }
.post-body figure.fig-portrait { max-width: 400px; margin-left: auto; margin-right: auto; }
.post-body figure.fig-square { max-width: 520px; margin-left: auto; margin-right: auto; }
.post-body figure.fig-medium { max-width: 560px; margin-left: auto; margin-right: auto; }
.post-body .fig-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 2.2em 0; align-items: start; }
.post-body .fig-duo figure { margin: 0; }
.post-body .fig-duo figcaption { font-size: 12.5px; }
.post-body .img-missing { margin: 0; padding: 22px 20px; text-align: center; font-size: 14px; color: var(--faint); border: 1px dashed var(--line); border-radius: 12px; }
figcaption { margin-top: 12px; text-align: center; font-family: var(--kai); font-size: 13.5px; color: var(--faint); letter-spacing: 0.04em; line-height: 1.6; }

/* 视频 */
.post-body iframe { display: block; width: 100%; max-width: 100%; height: auto; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: 12px; margin: 1.6em 0; background: var(--surface); }
.post-body li iframe { margin: 0.8em 0; }

/* 表格 */
.table-wrap { overflow-x: auto; margin: 1.8em 0; border: 1px solid var(--line); border-radius: 10px; }
.post-body table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.7; }
.post-body th, .post-body td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.post-body th { color: var(--dim); font-weight: 600; background: var(--surface); }
.post-body tr:last-child td { border-bottom: 0; }

/* 代码 */
.post-body code { font-family: var(--mono); font-size: 0.86em; background: var(--raise); border: 1px solid var(--line-soft); padding: 2px 6px; border-radius: 5px; }
.post-body pre {
  position: relative; margin: 1.8em 0; padding: 18px 20px; overflow-x: auto;
  background: var(--code-bg); border: 1px solid var(--line-soft); border-radius: 10px;
  font-size: 13.5px; line-height: 1.7; tab-size: 2;
}
.post-body pre code { background: none; border: none; padding: 0; color: #C9D3E4; font-size: inherit; white-space: pre; }
.post-body pre.line-numbers { padding-left: 3.6em; counter-reset: linenumber; }
.post-body pre .line-numbers-rows {
  position: absolute; top: 18px; left: 0; width: 2.8em; text-align: right; pointer-events: none; user-select: none;
  border-right: 1px solid var(--line-soft); padding-right: 0.6em; color: #4F5B73; font-family: var(--mono);
}
.post-body pre .line-numbers-rows > span { display: block; counter-increment: linenumber; }
.post-body pre .line-numbers-rows > span::before { content: counter(linenumber); }
.post-body pre[data-language]::after {
  content: attr(data-language); position: absolute; top: 8px; right: 12px;
  font-family: var(--mono); font-size: 11.5px; color: var(--faint); letter-spacing: 0.04em;
}
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #6B7891; font-style: italic; }
.token.punctuation, .token.operator { color: #8C98AE; }
.token.property, .token.tag, .token.constant, .token.symbol, .token.deleted, .token.key, .token.atrule { color: #93C5E8; }
.token.boolean, .token.number { color: #E9B97A; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: #A8D4A0; }
.token.entity, .token.url, .token.variable { color: #D8C7F0; }
.token.function, .token.class-name { color: #F0D49A; }
.token.keyword, .token.important, .token.regex { color: #C9A8F0; }

.end-mark { margin: 56px 0 0; text-align: center; font-family: var(--kai); font-size: 14px; color: var(--faint); letter-spacing: 0.5em; }

.post-tags { margin-top: 44px; display: flex; flex-wrap: wrap; gap: 10px; }
.post-tags a { font-size: 13px; color: var(--dim); letter-spacing: 0.04em; border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; }
.post-tags a:hover { color: var(--star-hover); border-color: rgba(147, 197, 232, 0.4); }

.post-nav {
  margin-top: 52px; padding: 26px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
}
.post-nav .dir { font-size: 12.5px; color: var(--faint); letter-spacing: 0.1em; margin-bottom: 8px; }
.post-nav a { display: block; font-size: 15.5px; font-weight: 600; color: var(--text); line-height: 1.6; }
.post-nav a:hover { color: var(--star-hover); }
.post-nav .none { font-size: 14px; color: var(--faint); line-height: 1.6; }
.post-nav .next { text-align: right; }

.comments { margin-top: 60px; }
.comments h2 { font-size: 20px; font-weight: 600; margin-bottom: 18px; }
.giscus-slot { min-height: 120px; }
.giscus-note { font-size: 14px; color: var(--faint); padding: 26px 0; }
.giscus-slot.is-loaded .giscus-note { display: none; }
.giscus-slot iframe { color-scheme: normal; }

/* 目录 */
.toc-rail { position: relative; }
.toc-inner { position: sticky; top: calc(var(--head-h) + 32px); max-height: calc(100vh - var(--head-h) - 64px); overflow-y: auto; scrollbar-width: thin; padding-right: 4px; }
.toc-h { font-size: 13px; font-weight: 600; letter-spacing: 0.12em; color: var(--faint); margin-bottom: 14px; }
.toc-list { list-style: none; }
.toc-list li { border-top: 1px solid var(--line-soft); }
.toc-list li.lv3 { border-top: 0; }
.toc-list li a { display: block; padding: 10px 0; font-size: 13.5px; line-height: 1.65; color: var(--dim); transition: color 0.2s ease; }
.toc-list li.lv3 a { padding: 2px 0 8px 1.2em; font-size: 13px; color: var(--faint); }
.toc-list li a .no { color: var(--faint); margin-right: 8px; font-size: 12.5px; }
.toc-list li a:hover { color: var(--star-hover); }
.toc-list li.here > a { color: var(--text); }
.toc-list li.here > a .no { color: var(--moon); }
.toc-back { margin-top: 18px; font-size: 13px; }
.toc-back a { color: var(--faint); display: inline-flex; align-items: center; gap: 6px; }
.toc-back a:hover { color: var(--star-hover); }
.toc-back svg { width: 14px; height: 14px; }

/* ---------- pages ---------- */
.page-banner { position: relative; height: 300px; overflow: hidden; }
.page-banner img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.page-banner-veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,20,32,0.25) 0%, rgba(15,20,32,0.2) 40%, rgba(15,20,32,0.85) 85%, var(--ink) 100%); }
.page { max-width: 820px; margin: 72px auto 0; }
.page.has-banner { margin-top: -84px; position: relative; }
.page.page-bangumi { max-width: 960px; }
.page-head h1 { font-size: 34px; font-weight: 700; line-height: 1.35; letter-spacing: 0.01em; text-shadow: 0 2px 18px rgba(8, 11, 18, 0.6); }
.page-lede { margin-top: 14px; font-size: 15px; color: var(--dim); line-height: 1.85; max-width: 40em; }
.page-lede a { text-decoration: underline; text-decoration-color: rgba(147,197,232,0.4); }
.page > .post-body { margin-top: 36px; }
.notfound p { color: var(--dim); }

/* 归档 */
.year { margin-top: 52px; }
.year h2 { display: flex; align-items: baseline; gap: 14px; font-size: 26px; font-weight: 700; letter-spacing: 0.02em; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.year h2 .count, .cat-list h2 .count { font-size: 13px; font-weight: 400; color: var(--faint); letter-spacing: 0.06em; }
.timeline { list-style: none; }
.timeline li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 20px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.timeline time { font-size: 14px; color: var(--faint); letter-spacing: 0.04em; }
.timeline a { color: var(--text); font-size: 16.5px; line-height: 1.6; }
.timeline a:hover { color: var(--star-hover); }
.timeline .cat { font-size: 13px; color: var(--faint); white-space: nowrap; }
.pager { margin-top: 40px; display: flex; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.pager .page-number, .pager .extend, .pager .space { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--dim); }
.pager .current { color: var(--ink); background: var(--moon); border-color: var(--moon); }

/* 标签云 / 分类 */
.tag-cloud { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; }
.tag-cloud a { display: inline-flex; align-items: baseline; gap: 8px; font-size: 15px; color: var(--dim); border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px; }
.tag-cloud a .count { font-size: 12.5px; color: var(--faint); }
.tag-cloud a:hover { color: var(--star-hover); border-color: rgba(147, 197, 232, 0.4); }
.cat-list { list-style: none; margin-top: 28px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
.cat-list > li { padding: 26px 0; border-bottom: 1px solid var(--line-soft); min-width: 0; }
.cat-list h2 { display: flex; align-items: baseline; gap: 12px; font-size: 21px; font-weight: 600; }
.cat-list h2 a { color: var(--text); }
.cat-list h2 a:hover { color: var(--star-hover); }
.cat-list ul { list-style: none; margin-top: 10px; }
.cat-list ul li { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; font-size: 14.5px; line-height: 1.6; }
.cat-list ul li a { min-width: 0; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-list ul li a:hover { color: var(--star-hover); }
.cat-list ul li time { color: var(--faint); font-size: 12.5px; flex-shrink: 0; }
.cat-list .lane-foot { margin-top: 8px; font-size: 13.5px; }

/* 友链 */
.link-group { margin-top: 48px; }
.link-group h2 { font-size: 22px; font-weight: 600; letter-spacing: 0.02em; }
.link-desc { font-size: 13.5px; color: var(--faint); margin-top: 4px; }
.link-list { list-style: none; margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.link-list a { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); color: var(--text); }
.link-list img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); background: var(--raise); flex-shrink: 0; }
.link-list .ln { min-width: 0; }
.link-list .n { display: block; font-size: 16px; font-weight: 600; line-height: 1.5; }
.link-list .d { display: block; font-size: 13.5px; color: var(--faint); line-height: 1.6; }
.link-list a:hover .n { color: var(--star-hover); }

/* 追番（hexo-bilibili-bangumi 生成的内容，换成夜航配色） */
.bangumi-host .bangumi-container {
  --bangumi-bg: var(--surface); --bangumi-surface: var(--raise); --bangumi-surface-strong: #252D41;
  --bangumi-text: var(--text); --bangumi-muted: var(--faint); --bangumi-border: var(--line);
  --bangumi-accent: var(--moon); --bangumi-accent-strong: var(--moon); --bangumi-accent-soft: rgba(228, 178, 95, 0.12);
  --bangumi-shadow: rgba(3, 6, 12, 0.35);
  color-scheme: dark; font-family: var(--serif);
}
.bangumi-host .bangumi-quote { border-left-width: 1px; background: var(--surface); box-shadow: none; font-family: var(--kai); }
.bangumi-host .bangumi-quote::before { display: none; }
.bangumi-host .bangumi-quote, .bangumi-host .bangumi-quote > p { padding-left: 0; }
.bangumi-host .bangumi-quote { padding: 14px 20px; }
.bangumi-host .bangumi-tabs { position: sticky; top: calc(var(--head-h) + 8px); z-index: 5; }
.bangumi-host .bangumi-tab { font-size: 15px; }
.bangumi-host .bangumi-active { box-shadow: none; border: 1px solid rgba(228, 178, 95, 0.35); }
.bangumi-host .bangumi-item { box-shadow: none; border-radius: 12px; }
.bangumi-host .bangumi-picture img { border-radius: 8px; box-shadow: 0 10px 22px -10px rgba(0, 0, 0, 0.6); border: 0; }
.bangumi-host .bangumi-title a { text-decoration: none; }
.bangumi-host .bangumi-info-item { border-radius: 8px; }
.bangumi-host .bangumi-info-item em, .bangumi-host .bangumi-info-total { font-variant-numeric: tabular-nums; }
.bangumi-host .bangumi-summary, .bangumi-host .bangumi-comments { font-size: 13.5px; }
.bangumi-host .bangumi-button, .bangumi-host .bangumi-pagenum { text-decoration: none; }

/* ---------- search ---------- */
.search {
  margin: 12vh auto 0; width: min(640px, calc(100vw - 32px)); max-height: 72vh;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 14px;
  padding: 0; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
}
.search::backdrop { background: rgba(6, 9, 16, 0.72); }
.search[open] { display: flex; flex-direction: column; animation: riseIn 0.25s var(--ease-out); }
.search-box { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.search-box svg { width: 18px; height: 18px; color: var(--faint); flex-shrink: 0; }
.search-box input { flex: 1; min-width: 0; background: none; border: 0; color: var(--text); font: inherit; font-size: 16px; padding: 6px 0; outline: none; }
.search-box input::placeholder { color: var(--faint); }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-close { font-size: 13px; color: var(--faint); border: 1px solid var(--line); border-radius: 6px; padding: 3px 10px; }
.search-close:hover { color: var(--text); }
.search-state { padding: 12px 20px 4px; font-size: 13px; color: var(--faint); }
.search-results { list-style: none; overflow-y: auto; padding: 4px 8px 12px; }
.search-results a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--text); }
.search-results a:hover, .search-results a:focus-visible { background: var(--raise); }
.search-results .t { display: block; font-size: 15.5px; font-weight: 600; line-height: 1.5; }
.search-results .s { display: block; margin-top: 4px; font-size: 13.5px; color: var(--dim); line-height: 1.7; }
.search-results mark { background: rgba(228, 178, 95, 0.25); color: #FFF6E3; border-radius: 2px; padding: 0 1px; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .main { display: flex; flex-direction: column; gap: 0; margin-top: 72px; }
  .rail { display: contents; }
  .rail .s-author { order: -2; }
  .rail .s-bangumi { order: -1; }
  .rail .s-friends { order: 1; }
  .rail .s-pages { order: 2; }
}
@media (max-width: 1060px) {
  .post-wrap { grid-template-columns: minmax(0, 700px); gap: 0; }
  .toc-rail { display: none; }
  .toc-mobile { display: block; margin-top: 30px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
  .toc-mobile summary { cursor: pointer; padding: 14px 20px; font-size: 14px; font-weight: 600; color: var(--dim); letter-spacing: 0.06em; list-style: none; display: flex; align-items: center; justify-content: space-between; }
  .toc-mobile summary::-webkit-details-marker { display: none; }
  .toc-mobile summary svg { width: 16px; height: 16px; color: var(--faint); transition: transform 0.2s ease; }
  .toc-mobile[open] summary svg { transform: rotate(180deg); }
  .toc-mobile .toc-list { padding: 0 20px 12px; }
  .toc-mobile .toc-list li a { padding: 8px 0; }
}
@media (max-width: 760px) {
  :root { --head-h: 96px; }
  .wrap { padding: 0 20px; }
  .site-head { padding: 12px 0; }
  .site-head.is-overlay { padding: 16px 0; }
  .site-head .wrap { flex-direction: column; align-items: flex-start; gap: 8px; }
  .site-nav { gap: 6px 18px; flex-wrap: wrap; }
  .site-nav a { font-size: 14px; }
  .is-home .site-head.is-overlay::before { content: ""; position: absolute; inset: 0 0 -30px; background: linear-gradient(180deg, rgba(15,20,32,0.7), rgba(15,20,32,0)); z-index: -1; }
  .hero { height: auto; min-height: 0; }
  .hero-img { position: relative; }
  .hero-img img { height: auto; aspect-ratio: 16 / 9; object-position: 62% 30% !important; }
  .hero-veil { background: linear-gradient(180deg, rgba(15,20,32,0) 60%, rgba(15,20,32,0.55) 85%, var(--ink) 100%); }
  .hero-text { position: static; padding: 18px 0 4px; }
  .hero-text h1 { font-size: 34px; text-shadow: none; }
  .hero-text .motto { font-size: 15.5px; text-shadow: none; }
  .hero-text .intro { font-size: 13.5px; text-shadow: none; }
  .pinned { margin-top: 36px; }
  .pinned-inner { grid-template-columns: 1fr; }
  .pinned-media { min-height: 0; aspect-ratio: 16 / 9; }
  .pinned-body { padding: 24px 22px 26px; }
  .pinned-body h2 { font-size: 21px; }
  .main { margin-top: 48px; }
  .lane { margin-bottom: 52px; }
  .entry { grid-template-columns: minmax(0, 1fr) 84px; gap: 16px; padding: 20px 0; }
  .entry.no-thumb { grid-template-columns: minmax(0, 1fr); }
  .entry .thumb { width: 84px; height: 84px; }
  .entry h3 { font-size: 16.5px; }
  .entry .excerpt { font-size: 14px; }
  .fig-strip .strip-grid { display: flex; overflow-x: auto; gap: 10px; scroll-snap-type: x mandatory; padding: 0 20px 6px; margin: 0 -20px; scrollbar-width: none; }
  .fig-strip .strip-grid::-webkit-scrollbar { display: none; }
  .fig-strip .strip-grid a { flex: 0 0 64%; height: 200px; scroll-snap-align: start; }
  .notes-list { grid-template-columns: 1fr; }
  .notes-list a:nth-child(n+5) { display: none; }
  .notes-list a .t { white-space: normal; }
  .all-posts { margin-top: -12px; }
  .site-foot { margin-top: 64px; padding: 32px 0 40px; }

  .post-wrap { margin-top: 36px; }
  .post-head h1 { font-size: 25px; }
  .post-body { font-size: 16.5px; margin-top: 32px; }
  .post-body h2 { font-size: 20px; }
  .post-body h3 { font-size: 18px; }
  .post-body figure.fig-portrait { max-width: 78%; }
  .post-body figure.fig-square, .post-body figure.fig-medium { max-width: 100%; }
  .post-body .fig-duo { gap: 10px; }
  .post-body pre { margin-left: -20px; margin-right: -20px; border-radius: 0; border-left: 0; border-right: 0; }
  .post-nav { grid-template-columns: 1fr; gap: 20px; }
  .post-nav .next { text-align: left; }

  .page { margin-top: 40px; }
  .page.has-banner { margin-top: -60px; }
  .page-banner { height: 200px; }
  .page-head h1 { font-size: 27px; }
  .timeline li { grid-template-columns: 52px minmax(0, 1fr); gap: 4px 14px; }
  .timeline .cat { grid-column: 2; }
  .cat-list, .link-list { grid-template-columns: 1fr; }
  .bangumi-host .bangumi-item { padding: 14px; gap: 14px; }
  .bangumi-host .bangumi-picture { flex-basis: 84px; width: 84px; margin-left: 0; }
  .bangumi-host .bangumi-picture img { width: 84px !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
