:root {
  color-scheme: light;
  --ink: #161616;
  --muted: #5f6368;
  --paper: #fbfaf7;
  --surface: #ffffff;
  --line: #d9d5ca;
  --accent: #0f766e;
  --accent-dark: #134e4a;
  --code: #20242a;
  --code-bg: #f0eee7;
  --shadow: 0 24px 70px rgba(30, 28, 20, 0.08);
  font-family:
    "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Source Han Sans SC",
    Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(22, 22, 22, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 22, 22, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 36px 36px;
}

a {
  color: inherit;
  text-decoration-color: rgba(15, 118, 110, 0.35);
  text-underline-offset: 4px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 247, 0.9);
  backdrop-filter: blur(14px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 24px;
}

.brand {
  font-family: "Georgia", "Noto Serif SC", "SimSun", serif;
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 22px;
  color: var(--muted);
  font-size: 14px;
}

.nav-links a {
  text-decoration: none;
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 44px;
  min-height: calc(100vh - 76px);
  align-items: center;
  padding: 72px 0 44px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Georgia", "Noto Serif SC", "SimSun", serif;
  line-height: 1.18;
}

h1 {
  max-width: 780px;
  font-size: clamp(42px, 7vw, 82px);
  font-weight: 760;
}

h2 {
  font-size: 34px;
}

h3 {
  font-size: 21px;
}

.hero-text {
  max-width: 720px;
  margin: 24px 0 0;
  color: #3e403f;
  font-size: 18px;
  line-height: 1.85;
}

.profile-photo {
  display: none;
  width: min(180px, 42vw);
  aspect-ratio: 1;
  margin: 0 0 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.profile-photo.is-visible {
  display: block;
}

.profile-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  border-radius: 6px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.button.primary {
  color: #fff;
  background: var(--ink);
}

.button.ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
}

.paper-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.paper-line {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.paper-line span {
  color: var(--muted);
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  font-size: 12px;
}

pre {
  overflow: auto;
  border-radius: 8px;
  padding: 18px;
  background: var(--code-bg);
  color: var(--code);
  line-height: 1.65;
}

code {
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

.section {
  border-top: 1px solid var(--line);
  padding: 64px 0;
}

.two-column {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 40px;
}

.prose {
  font-size: 16px;
  line-height: 1.9;
}

.prose p {
  margin: 0 0 18px;
}

.prose h1,
.prose h2,
.prose h3 {
  margin: 34px 0 16px;
}

.prose img {
  max-width: 100%;
  border-radius: 8px;
}

.prose blockquote {
  margin: 24px 0;
  border-left: 3px solid var(--accent);
  padding-left: 18px;
  color: #404342;
}

.compact-list {
  padding-left: 20px;
}

.blog-shell {
  min-height: 620px;
}

.blog-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.status {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.7);
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  font-size: 12px;
}

.blog-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
  overflow: hidden;
}

.post-list {
  border-right: 1px solid var(--line);
  background: rgba(250, 249, 245, 0.82);
}

.post-button {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 18px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.post-button:hover,
.post-button.active {
  background: #fff;
}

.post-button strong {
  display: block;
  margin-bottom: 6px;
  font-family: "Georgia", "Noto Serif SC", "SimSun", serif;
  font-size: 17px;
}

.post-button span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.post-button em {
  display: block;
  margin-top: 8px;
  color: #4a4d4b;
  font-size: 13px;
  font-style: normal;
  line-height: 1.55;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
}

.tag {
  border: 1px solid rgba(15, 118, 110, 0.25);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--accent-dark);
  background: rgba(15, 118, 110, 0.07);
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  font-size: 12px;
}

.post-view {
  min-width: 0;
  padding: 30px;
  background: #fffefa;
}

.document-header {
  border-bottom: 1px solid var(--line);
  margin: 0 0 28px;
  padding: 0 0 22px;
}

.document-header h1 {
  margin-top: 0;
}

.document-type,
.document-date {
  margin: 0 0 8px;
  color: var(--muted);
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  font-size: 12px;
}

.pdf-frame,
.html-frame {
  width: 100%;
  min-height: 760px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.html-frame {
  min-height: 820px;
}

.footnote-ref {
  font-size: 0.78em;
  margin-left: 2px;
}

.footnotes {
  border-top: 1px solid var(--line);
  margin-top: 42px;
  padding-top: 22px;
  color: #3f4241;
  font-size: 14px;
}

.footnotes h2 {
  font-size: 22px;
}

.footnotes li {
  margin-bottom: 12px;
}

.footnote-backref {
  margin-left: 8px;
  text-decoration: none;
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.project-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.74);
}

.project-card span {
  color: var(--accent-dark);
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  font-size: 12px;
}

.project-card p {
  color: var(--muted);
  line-height: 1.7;
}

.paper-list {
  display: grid;
  gap: 14px;
  margin: 24px 0;
}

.paper-item {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 16px;
}

.paper-item h3 {
  font-size: 18px;
}

.paper-item p {
  margin: 4px 0;
  color: var(--muted);
}

.footer {
  max-width: 1120px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 32px 24px 48px;
  color: var(--muted);
}

@media (max-width: 840px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: 14px;
  }

  .hero,
  .two-column,
  .blog-layout,
  .project-grid,
  .project-list {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 48px;
  }

  h1 {
    font-size: 42px;
  }

  .post-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .post-view {
    padding: 22px;
  }
}
