:root {
  --paper: #f6eeda;
  --paper-card: #fbf5e6;
  --ink: #3b3226;
  --ink-soft: #6f6350;
  --ink-faint: #9a8b72;
  --line: #dfd0ae;
  --line-strong: #cdbb93;
  --accent: #9b623a;
  --seal: #aa4435;
  --shadow: rgba(90, 66, 30, .11);
  --nav-height: 60px;
  --display: "ZCOOL QingKe HuangYou", "STKaiti", "KaiTi", "Microsoft YaHei", sans-serif;
  --body: "LXGW WenKai", "STKaiti", "KaiTi", "Songti SC", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--body);
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image: radial-gradient(rgba(120, 85, 40, .055) 1px, transparent 1px);
  background-size: 22px 22px;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 249, 232, .58), transparent 66%),
    radial-gradient(ellipse at 50% 100%, rgba(190, 150, 90, .10), transparent 60%);
}

a { color: inherit; }
button, input, textarea, select { font: inherit; }
::selection { background: rgba(155, 98, 58, .22); }
.wrap { width: min(980px, calc(100% - 56px)); margin: 0 auto; }
h1, h2, h3, .logo { font-family: var(--display); font-weight: 400; }

.site-nav, .page-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--nav-height);
  border-bottom: 1px solid var(--line);
  background: rgba(246, 238, 218, .90);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.nav-inner { min-height: var(--nav-height); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo { color: var(--ink); font-size: 17px; letter-spacing: .28em; text-decoration: none; white-space: nowrap; }
.logo b { color: var(--accent); font-weight: 400; }
.compact-logo { color: var(--ink-soft); font-size: 14px; letter-spacing: .2em; }
.nav-links { display: flex; align-items: center; gap: 25px; }
.nav-links a, .back-link {
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: .16em;
  text-decoration: none;
  transition: color .25s ease;
}
.nav-links a:hover, .nav-links a:focus-visible, .back-link:hover, .back-link:focus-visible { color: var(--accent); outline: none; }

.fade { opacity: 0; transform: translateY(16px); animation: rise .85s ease forwards; }
.delay-1 { animation-delay: .1s; }
.delay-2 { animation-delay: .2s; }
.delay-3 { animation-delay: .3s; }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 56px;
  padding: 96px 0 72px;
  border-bottom: 1px solid var(--line);
}
.hero-text { flex: 1; min-width: 0; }
.kicker {
  margin: 0 0 29px;
  color: var(--ink-faint);
  font-size: 13px;
  letter-spacing: .32em;
}
.hero h1 {
  margin: 0;
  font-size: clamp(44px, 6vw, 64px);
  letter-spacing: .075em;
  line-height: 1.15;
}
.role { margin: 18px 0 0; color: var(--accent); font-size: 16px; letter-spacing: .18em; }
.intro { max-width: 570px; margin: 28px 0 0; color: var(--ink-soft); font-size: 15.5px; }
.hero-art { flex: 0 0 172px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.avatar {
  display: block;
  width: 150px;
  height: 150px;
  object-fit: cover;
  border: 1px solid rgba(155, 98, 58, .18);
  border-radius: 50%;
  box-shadow: 0 14px 34px var(--shadow);
  transition: transform .45s ease;
}
.avatar:hover { transform: translateY(-5px) rotate(1deg); }
.seal-image { display: block; width: 88px; height: 88px; object-fit: cover; border-radius: 50%; transform: rotate(-7deg); }

.article-section { padding: 72px 0; }
.section-heading { display: flex; align-items: center; gap: 16px; margin-bottom: 40px; }
.section-number { color: var(--ink-faint); font-size: 13px; letter-spacing: .2em; }
.section-heading h2 { margin: 0; font-size: 24px; letter-spacing: .3em; white-space: nowrap; }
.section-line { flex: 1; min-width: 24px; height: 1px; background: var(--line); }
.view-all-link {
  color: var(--accent);
  border-bottom: 1px solid rgba(155, 98, 58, .38);
  font-size: 13px;
  letter-spacing: .15em;
  text-decoration: none;
  white-space: nowrap;
}
.view-all-link:hover, .view-all-link:focus-visible { border-color: var(--accent); outline: none; }

.work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.work-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 280px;
  padding: 28px 26px;
  flex-direction: column;
  color: var(--ink);
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  transition: transform .32s ease, box-shadow .32s ease, border-color .32s ease, opacity .45s ease;
}
.work-card.loaded { animation: card-in .48s ease both; }
@keyframes card-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
.work-card:hover, .work-card:focus-visible {
  transform: translateY(-6px);
  border-color: rgba(155, 98, 58, .48);
  box-shadow: 0 18px 40px var(--shadow);
  outline: none;
}
.work-card .year { margin-bottom: 14px; color: var(--ink-faint); font-size: 12.5px; letter-spacing: .1em; }
.work-card h3 { margin: 0 0 9px; font-size: clamp(18px, 2.2vw, 22px); letter-spacing: .035em; line-height: 1.5; }
.work-card .tag {
  align-self: flex-start;
  margin: 4px 0 14px;
  padding: 2px 12px;
  color: var(--accent);
  border: 1px solid rgba(155, 98, 58, .38);
  border-radius: 999px;
  font-size: 11.5px;
  letter-spacing: .13em;
}
.work-card p { flex: 1; margin: 0; color: var(--ink-soft); font-size: 14px; }
.work-card .more { margin-top: 18px; color: var(--accent); font-size: 13px; letter-spacing: .16em; }
.work-card .more span { display: inline-block; margin-left: 4px; font-size: 18px; transition: transform .25s ease; }
.work-card:hover .more span, .work-card:focus-visible .more span { transform: translateX(5px); }
.empty-state { grid-column: 1 / -1; padding: 40px 0; color: var(--ink-faint); text-align: center; }

.load-more-wrap { display: grid; place-items: center; padding: 34px 0 0; }
.load-more-button {
  min-width: 210px;
  min-height: 48px;
  padding: 0 24px;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .18em;
  cursor: pointer;
  transition: color .25s ease, background .25s ease, border-color .25s ease;
}
.load-more-button:hover, .load-more-button:focus-visible { color: var(--paper-card); background: var(--accent); border-color: var(--accent); outline: none; }
.load-more-button:disabled { color: var(--ink-faint); background: transparent; border-color: var(--line); cursor: default; opacity: .7; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.archive-header { padding: 86px 0 58px; border-bottom: 1px solid var(--line); }
.archive-header h1 { margin: 0; font-size: clamp(42px, 6vw, 62px); letter-spacing: .08em; }
.archive-header > p:last-child { margin: 20px 0 0; color: var(--ink-soft); }
.archive-section { padding-top: 60px; }

.reading-progress { position: fixed; top: 0; left: 0; z-index: 80; width: 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--seal)); }
.article-shell { max-width: 820px; }
.article-shell > article { padding: 64px 0 36px; }
.article-header { padding-bottom: 42px; }
.work-meta { margin: 0 0 23px; color: var(--ink-faint); font-size: 13px; letter-spacing: .18em; }
.article-header h1 { margin: 0 0 14px; font-size: clamp(30px, 4.8vw, 44px); letter-spacing: .045em; line-height: 1.4; }
.tagline { margin: 0; color: var(--accent); font-size: 14.5px; letter-spacing: .13em; }
.article-content { padding-top: 44px; color: var(--ink-soft); border-top: 1px solid var(--line); font-size: 16px; overflow-wrap: anywhere; }
.article-content > :first-child { margin-top: 0; }
.article-content h1, .article-content h2, .article-content h3, .article-content h4 { color: var(--ink); font-family: var(--display); font-weight: 400; line-height: 1.45; }
.article-content h2 { display: flex; align-items: center; gap: 12px; margin: 42px 0 14px; font-size: 22px; letter-spacing: .08em; }
.article-content h2::before { content: ""; width: 18px; height: 1px; flex: 0 0 18px; background: var(--accent); }
.article-content h3 { margin: 34px 0 12px; font-size: 19px; letter-spacing: .06em; }
.article-content p, .article-content ul, .article-content ol, .article-content blockquote, .article-content table, .article-content pre, .article-content figure { margin: 1.15em 0; }
.article-content p { text-align: justify; }
.article-content a { color: var(--accent); text-underline-offset: .2em; }
.article-content .article-download {
  margin: 1.8em 0;
  padding: 20px 22px;
  text-align: left;
  border: 1px solid rgba(31, 88, 91, .28);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: rgba(255, 255, 255, .34);
  box-shadow: 0 12px 30px rgba(68, 52, 29, .07);
}
.article-content .article-download a { font-weight: 800; }
.article-content ul, .article-content ol { padding-left: 1.5em; }
.article-content img, .article-content video { display: block; max-width: 100%; height: auto; margin: 1.7em auto; border: 1px solid var(--line); border-radius: 8px; }
.article-content blockquote { padding: 10px 0 10px 24px; color: var(--ink-faint); border-left: 3px solid var(--seal); background: linear-gradient(90deg, rgba(170, 68, 53, .05), transparent); }
.article-content pre, .article-content code { font-family: "Cascadia Code", Consolas, monospace; }
.article-content code { padding: .12em .35em; border: 1px solid var(--line); border-radius: 4px; background: rgba(255, 255, 255, .24); font-size: .88em; }
.article-content pre { max-width: 100%; padding: 18px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, .28); font-size: 14px; line-height: 1.7; }
.article-content pre code { padding: 0; border: 0; background: transparent; }
.article-content table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 14px; }
.article-content th, .article-content td { min-width: 110px; padding: 10px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.article-content th { color: var(--ink); background: rgba(255, 255, 255, .28); }
.article-content hr { margin: 3em 0; border: 0; border-top: 1px solid var(--line); }
.article-footer { margin-top: 54px; padding-top: 30px; border-top: 1px solid var(--line); }
.article-footer a { color: var(--accent); font-size: 14px; letter-spacing: .13em; text-decoration: none; border-bottom: 1px dashed var(--line-strong); }

.article-resources { margin-top: 54px; padding-top: 38px; border-top: 1px solid var(--line); }
.compact-section-heading { margin-bottom: 24px; }
.compact-section-heading h2 { font-size: 22px; }
.resource-list { display: grid; gap: 16px; }
.resource-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-card);
  box-shadow: 0 10px 28px rgba(90, 66, 30, .06);
}
.resource-card > div { min-width: 0; }
.resource-card h3 { margin: 0; color: var(--ink); font-size: 20px; letter-spacing: .035em; }
.resource-card p { margin: 8px 0; color: var(--ink-soft); font-size: 14px; }
.resource-card small { display: block; color: var(--ink-faint); font-size: 12px; line-height: 1.7; }
.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 112px;
  min-height: 42px;
  padding: 0 16px;
  color: var(--paper-card);
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  font-size: 13px;
  letter-spacing: .1em;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}
.download-button:hover, .download-button:focus-visible { transform: translateY(-2px); box-shadow: 0 8px 20px var(--shadow); outline: none; }
.public-resource-list { gap: 20px; }
.public-resource-list .resource-card { padding: 28px; }
.related-article { display: block; margin-top: 10px; color: var(--accent); font-size: 13px; text-decoration: none; }
.resource-hash { display: block; max-width: 100%; margin-top: 10px; overflow: hidden; color: var(--ink-faint); background: none; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.site-footer { padding: 52px 0 74px; color: var(--ink-faint); border-top: 1px solid var(--line); font-size: 13px; letter-spacing: .12em; text-align: center; }
.site-footer p { margin: 0; }
.site-footer .quote { margin-bottom: 20px; color: var(--ink-soft); font-size: 14px; }
.contact { display: flex; justify-content: center; gap: 10px 28px; margin-top: 18px; flex-wrap: wrap; color: var(--ink-soft); }
.copyright { margin-top: 24px !important; font-size: 11.5px; letter-spacing: .08em; }
.icp { margin-top: 10px !important; font-size: 11.5px; letter-spacing: .05em; }
.icp a { color: var(--ink-faint); text-decoration: none; }
.icp a:hover, .icp a:focus-visible { color: var(--accent); outline: none; }
.article-site-footer { margin-top: 16px; }
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 55;
  min-width: 84px;
  min-height: 42px;
  padding: 0 16px;
  color: var(--ink-soft);
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 8px 20px var(--shadow);
  font-size: 12px;
  letter-spacing: .1em;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  cursor: pointer;
  transition: opacity .25s ease, transform .25s ease, color .25s ease, border-color .25s ease;
}
.to-top.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.to-top:hover, .to-top:focus-visible { color: var(--accent); border-color: var(--accent); outline: none; }

.not-found { display: grid; min-height: 100vh; place-content: center; padding: 24px; text-align: center; }
.not-found .eyebrow { margin: 0; color: var(--accent); letter-spacing: .2em; }
.not-found h1 { margin: 12px 0; font-size: clamp(42px, 8vw, 72px); letter-spacing: .08em; }
.not-found p:not(.eyebrow) { color: var(--ink-soft); }
.not-found a { justify-self: center; margin-top: 18px; color: var(--accent); }

@media (max-width: 900px) {
  .wrap { width: min(720px, calc(100% - 48px)); }
  .hero { padding: 78px 0 58px; gap: 34px; }
  .hero-art { flex-basis: 142px; }
  .avatar { width: 124px; height: 124px; }
  .seal-image { width: 74px; height: 74px; }
}

@media (max-width: 620px) {
  .wrap { width: calc(100% - 40px); }
  .nav-links { display: none; }
  .hero { flex-direction: column-reverse; align-items: flex-start; gap: 26px; padding: 58px 0 48px; }
  .hero-art { align-self: flex-end; flex-basis: auto; flex-direction: row; margin-bottom: -8px; }
  .avatar { width: 96px; height: 96px; }
  .seal-image { width: 62px; height: 62px; }
  .hero h1 { font-size: 40px; }
  .kicker { margin-bottom: 22px; letter-spacing: .22em; }
  .role { font-size: 14px; letter-spacing: .12em; }
  .intro { font-size: 15px; }
  .article-section { padding: 56px 0; }
  .section-heading { gap: 11px; margin-bottom: 30px; }
  .section-heading h2 { font-size: 21px; letter-spacing: .22em; }
  .view-all-link { letter-spacing: .08em; }
  .work-grid { grid-template-columns: 1fr; }
  .work-card { min-height: 250px; padding: 24px 22px; }
  .work-card h3 { font-size: 21px; }
  .archive-header { padding: 62px 0 46px; }
  .article-shell > article { padding: 48px 0 28px; }
  .article-header { padding-bottom: 34px; }
  .article-content { padding-top: 34px; font-size: 15.5px; }
  .article-content h2 { font-size: 20px; }
  .resource-card { align-items: stretch; flex-direction: column; padding: 21px; }
  .download-button { width: 100%; }
  .site-footer { padding: 44px 0 62px; letter-spacing: .08em; }
  .contact { flex-direction: column; }
  .to-top { right: 16px; bottom: 16px; min-width: 76px; min-height: 40px; }
  .back-link { letter-spacing: .08em; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .fade, .reveal { opacity: 1; transform: none; }
}
