/* ============================================================
   极简黑白 · 大字排版
   只有一个样式表，没有框架，没有构建步骤。
   改色板 → 改下面的 :root 变量即可。
   ============================================================ */

:root {
  --bg: #fcfcfa;
  --bg-elev: #f4f3ef;
  --fg: #111110;
  --fg-soft: #33332f;
  --muted: #77776e;
  --line: #e4e3dc;
  --line-strong: #c8c7bd;
  --maxw: 1120px;
  --col: 680px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --sans: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
          "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Source Han Sans SC",
          "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", "Roboto Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

/* 深色：跟随系统，或手动切换 */
:root[data-theme="dark"] {
  --bg: #0b0b0c;
  --bg-elev: #131315;
  --fg: #f1f0ec;
  --fg-soft: #c9c8c2;
  --muted: #8b8b83;
  --line: #232326;
  --line-strong: #3c3c41;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0c;
    --bg-elev: #131315;
    --fg: #f1f0ec;
    --fg-soft: #c9c8c2;
    --muted: #8b8b83;
    --line: #232326;
    --line-strong: #3c3c41;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-kerning: normal;
  font-feature-settings: "kern", "liga", "calt";
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--fg); color: var(--bg); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
  border-radius: 1px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--fg);
  color: var(--bg);
  font-size: 13px;
}
.skip-link:focus { left: 12px; top: 12px; }

.muted { color: var(--muted); }
.sep { color: var(--line-strong); }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}
.wrap-narrow { max-width: 760px; }

/* ───────────────────────── 顶栏 ───────────────────────── */

.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
@supports (backdrop-filter: blur(1px)) {
  .site-head {
    background: color-mix(in srgb, var(--bg) 84%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
  }
}

.head-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg);
  white-space: nowrap;
  transition: opacity .3s var(--ease);
}
.brand:hover { opacity: .55; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
  font-size: 13.5px;
  color: var(--muted);
}
.site-nav a {
  position: relative;
  padding: 4px 0;
  transition: color .25s var(--ease);
  white-space: nowrap;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease);
}
.site-nav a:hover { color: var(--fg); }
.site-nav a:hover::after { transform: scaleX(1); }

.theme-btn {
  appearance: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  transition: color .25s var(--ease), border-color .25s var(--ease), transform .4s var(--ease);
  flex: none;
}
.theme-btn:hover { color: var(--fg); border-color: var(--line-strong); transform: rotate(45deg); }

/* ───────────────────────── 首屏 ───────────────────────── */

.hero {
  padding: clamp(64px, 13vh, 148px) 0 clamp(48px, 9vh, 104px);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 clamp(20px, 3vh, 34px);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow a { color: var(--muted); transition: color .25s var(--ease); }
.eyebrow a:hover { color: var(--fg); }
.eyebrow-mark {
  width: 22px;
  height: 1px;
  background: var(--line-strong);
  display: inline-block;
}

.hero-name {
  margin: 0 0 clamp(20px, 3vh, 30px);
  font-size: clamp(2rem, 7.6vw, 5.6rem);
  line-height: .94;
  letter-spacing: -.04em;
  font-weight: 600;
  text-wrap: balance;
}

.tagline {
  margin: 0;
  max-width: 40ch;
  font-size: clamp(1rem, 1.6vw, 1.28rem);
  line-height: 1.6;
  color: var(--fg-soft);
  text-wrap: pretty;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: clamp(32px, 5vh, 52px);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--muted);
}
.status { display: inline-flex; align-items: center; gap: 7px; }
.pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fg);
  display: inline-block;
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.82); }
}

/* ───────────────────────── 区块 ───────────────────────── */

.section {
  padding: clamp(56px, 9vh, 104px) 0;
  border-bottom: 1px solid var(--line);
}
.section-top { border-bottom: none; padding-top: clamp(48px, 8vh, 88px); }
.section:last-of-type { border-bottom: none; }

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: clamp(28px, 5vh, 52px);
}
.sec-num {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  color: var(--muted);
  flex: none;
  width: 26px;
}
.sec-head h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -.02em;
}
.sec-note, .sec-link {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.sec-link { transition: color .25s var(--ease); }
.sec-link:hover { color: var(--fg); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: clamp(32px, 6vw, 72px);
}
.side { padding-top: 4px; }
.side-label {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  font-size: 12.5px;
  line-height: 1;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--fg-soft);
  transition: border-color .25s var(--ease), color .25s var(--ease);
}
.chip:hover { border-color: var(--line-strong); color: var(--fg); }

/* ───────────────────────── 正文排版 ───────────────────────── */

.prose {
  max-width: var(--col);
  font-size: clamp(1rem, 1.15vw, 1.06rem);
  line-height: 1.86;
  color: var(--fg-soft);
  text-wrap: pretty;
}
.prose > *:first-child { margin-top: 0; }
.prose p { margin: 0 0 1.4em; }
.prose h2, .prose h3, .prose h4 {
  color: var(--fg);
  letter-spacing: -.015em;
  line-height: 1.35;
  text-wrap: balance;
}
.prose h2 { font-size: 1.32rem; margin: 2.4em 0 .7em; font-weight: 600; }
.prose h3 { font-size: 1.1rem; margin: 2em 0 .6em; font-weight: 600; }
.prose h4 { font-size: 1rem; margin: 1.8em 0 .5em; font-weight: 600; }
.prose ul, .prose ol { margin: 0 0 1.4em; padding-left: 1.3em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--muted); }
.prose blockquote {
  margin: 2em 0;
  padding: 2px 0 2px 22px;
  border-left: 2px solid var(--line-strong);
  color: var(--muted);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code {
  font-family: var(--mono);
  font-size: .87em;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: .12em .38em;
  white-space: nowrap;
}
.prose pre {
  margin: 0 0 1.7em;
  padding: 18px 20px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow-x: auto;
  font-size: .85rem;
  line-height: 1.7;
}
.prose pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  white-space: pre;
}
.prose img {
  display: block;
  margin: 2em 0;
  border: 1px solid var(--line);
}
.prose a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  text-decoration-color: var(--line-strong);
  transition: text-decoration-color .25s var(--ease);
}
.prose a:hover { text-decoration-color: currentColor; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.6em 0; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.7em;
  font-size: .93rem;
  font-variant-numeric: tabular-nums;
}
.prose th, .prose td {
  text-align: left;
  padding: .6em .7em;
  border-bottom: 1px solid var(--line);
}
.prose th { color: var(--fg); font-weight: 600; }

/* ───────────────────────── 作品列表 ───────────────────────── */

.proj-list, .post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.proj-item, .post-item { border-bottom: 1px solid var(--line); }

.proj-link {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 24px;
  gap: 18px;
  align-items: start;
  padding: 24px 6px;
  transition: padding-left .4s var(--ease), background .4s var(--ease);
}
.proj-link:not(.is-placeholder):hover { padding-left: 14px; background: var(--bg-elev); }
.proj-link.is-placeholder { cursor: default; }
.proj-link.is-placeholder .proj-title { color: var(--muted); font-weight: 400; }
.proj-link.is-placeholder .proj-desc { color: var(--muted); opacity: .8; }
.proj-year {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  padding-top: 7px;
  letter-spacing: .04em;
}
.proj-main { display: block; min-width: 0; }
.proj-title {
  display: block;
  font-size: clamp(1.08rem, 1.9vw, 1.3rem);
  font-weight: 500;
  letter-spacing: -.015em;
  color: var(--fg);
}
.proj-desc {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: .93rem;
  line-height: 1.7;
  max-width: 60ch;
}
.proj-arrow {
  font-size: 14px;
  color: var(--muted);
  padding-top: 6px;
  transition: transform .4s var(--ease), color .3s var(--ease);
}
.proj-link:hover .proj-arrow { transform: translate(3px, -3px); color: var(--fg); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 3px 6px;
  line-height: 1.2;
}

/* ───────────────────────── 文章列表 ───────────────────────── */

.post-link {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 24px;
  gap: 18px;
  align-items: baseline;
  padding: 20px 6px;
  transition: padding-left .4s var(--ease), background .4s var(--ease);
}
.post-link:hover { padding-left: 14px; background: var(--bg-elev); }
.post-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .03em;
  font-variant-numeric: tabular-nums;
}
.post-main { display: block; min-width: 0; }
.post-title {
  display: block;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--fg);
}
.post-summary {
  display: block;
  margin-top: 5px;
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.65;
  max-width: 64ch;
}
.post-arrow {
  color: var(--muted);
  font-size: 13px;
  transition: transform .4s var(--ease), color .3s var(--ease);
}
.post-link:hover .post-arrow { transform: translateX(4px); color: var(--fg); }

/* ───────────────────────── 相册 ───────────────────────── */

.gal {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.gal figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--bg-elev);
  border: 1px solid var(--line);
}
.gal img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .9s var(--ease), opacity .6s var(--ease);
}
.gal figure:hover img { transform: scale(1.035); }
.gal figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 26px 12px 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, .58), rgba(0, 0, 0, 0));
  opacity: 0;
  transition: opacity .45s var(--ease);
}
.gal figure:hover figcaption { opacity: 1; }

/* ───────────────────────── 友链 ───────────────────────── */

.friends {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.friend {
  background: var(--bg);
  padding: 20px 22px;
  display: block;
  transition: background .3s var(--ease);
}
.friends-empty {
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 22px;
  color: var(--muted);
  font-size: .93rem;
}
.friends-empty a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: .2em;
  text-decoration-color: var(--line-strong);
}
.friends-empty a:hover { text-decoration-color: currentColor; }
.friend:hover { background: var(--bg-elev); }
.friend-name {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  color: var(--fg);
}
.friend-desc {
  display: block;
  margin-top: 4px;
  font-size: .86rem;
  color: var(--muted);
}

/* ───────────────────────── 联系 ───────────────────────── */

.section-contact { padding-bottom: clamp(64px, 12vh, 128px); }
.big-mail {
  display: inline-block;
  font-size: clamp(1.4rem, 4.4vw, 2.9rem);
  letter-spacing: -.03em;
  font-weight: 500;
  line-height: 1.2;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line-strong);
  transition: border-color .35s var(--ease), letter-spacing .5s var(--ease);
  word-break: break-word;
}
.big-mail:hover { border-color: var(--fg); letter-spacing: -.045em; }
.contact-note {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: .94rem;
  max-width: 46ch;
}
.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  margin-top: 34px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.socials a {
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.socials a:hover { color: var(--fg); border-color: var(--line-strong); }

/* ───────────────────────── 文章页 ───────────────────────── */

.post { padding: clamp(48px, 8vh, 92px) 0 clamp(64px, 10vh, 110px); }
.post-head { margin-bottom: clamp(32px, 5vh, 52px); }
.article-title {
  margin: 0 0 18px;
  font-size: clamp(1.9rem, 4.6vw, 3rem);
  line-height: 1.14;
  letter-spacing: -.035em;
  font-weight: 600;
  text-wrap: balance;
}
.post-meta {
  display: flex;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .05em;
  color: var(--muted);
}
.post-body { max-width: 100%; }
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: clamp(48px, 8vh, 80px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.pn-link { display: block; }
.pn-right { text-align: right; }
.pn-label {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.pn-title {
  font-size: .98rem;
  color: var(--fg);
  transition: opacity .25s var(--ease);
}
.pn-link:hover .pn-title { opacity: .6; }

/* ───────────────────────── 404 ───────────────────────── */

.nf-title {
  margin: 0 0 18px;
  font-size: clamp(2.2rem, 7vw, 4.4rem);
  line-height: 1;
  letter-spacing: -.045em;
  font-weight: 600;
}
.nf-actions { margin-top: 34px; }
.btn {
  display: inline-block;
  padding: 11px 20px;
  border: 1px solid var(--fg);
  font-size: 13px;
  letter-spacing: .02em;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.btn:hover { background: var(--fg); color: var(--bg); }

/* ───────────────────────── 页脚 ───────────────────────── */

.site-foot {
  border-top: 1px solid var(--line);
  padding: 26px 0 34px;
}
.foot-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.foot-links { display: flex; gap: 20px; }
.foot-links a { transition: color .25s var(--ease); }
.foot-links a:hover { color: var(--fg); }

/* ───────────────────────── 入场动画 ───────────────────────── */

.js .reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  transition-delay: calc(var(--i, 0) * 45ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .pulse { animation: none; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ───────────────────────── 响应式 ───────────────────────── */

@media (max-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .side { padding-top: 8px; }
}

@media (max-width: 760px) {
  .wrap, .head-inner, .foot-inner { padding-left: 20px; padding-right: 20px; }
  .head-inner { height: auto; padding-top: 11px; padding-bottom: 9px; flex-wrap: wrap; row-gap: 6px; }
  .site-nav {
    order: 3;
    flex-basis: 100%;
    margin-left: 0;
    gap: 18px;
    font-size: 12.5px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .theme-btn { margin-left: auto; }
  html { scroll-padding-top: 108px; }

  .proj-link { grid-template-columns: 1fr 20px; gap: 10px; padding: 20px 4px; }
  .proj-year { grid-column: 1 / -1; padding-top: 0; order: -1; }
  .post-link { grid-template-columns: 1fr; gap: 4px; padding: 18px 4px; }
  .post-arrow { display: none; }
  .gal { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .friends { grid-template-columns: minmax(0, 1fr); }
  .post-nav { grid-template-columns: 1fr; gap: 20px; }
  .pn-right { text-align: left; }
  .sec-head { gap: 12px; }
  .sec-num { width: 18px; }
}

@media (max-width: 420px) {
  .gal { grid-template-columns: 1fr; }
  .meta-row { font-size: 11px; }
}

/* ───────────────────────── 打印 ───────────────────────── */

@media print {
  .site-head, .site-foot, .post-nav, .theme-btn, .skip-link { display: none; }
  body { background: #fff; color: #000; }
  .section, .hero { border: 0; padding: 18px 0; }
  .reveal { opacity: 1; transform: none; }
  a { text-decoration: underline; }
}
