:root {
  --bg: #f5f7f7;
  --surface: #ffffff;
  --surface-strong: #fdfefe;
  --ink: #17212b;
  --muted: #68737d;
  --muted-soft: #77838d;
  --line: #d7dfdf;
  --accent: #14665f;
  --accent-dark: #0d443f;
  --warm: #a45f1b;
  --soft: #e8f0ef;
  --shadow: 0 18px 45px rgba(23, 33, 43, 0.08);
  --shadow-tight: 0 10px 28px rgba(23, 33, 43, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(232, 240, 239, 0.86) 0, rgba(245, 247, 247, 0) 360px),
    linear-gradient(90deg, rgba(20, 102, 95, 0.055), rgba(164, 95, 27, 0.04) 52%, rgba(245, 247, 247, 0)),
    var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.68;
  text-rendering: optimizeLegibility;
}

body.zh {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

a {
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
}

a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 70px;
  padding: 0 7vw;
  background: rgba(245, 247, 247, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.nav {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 8px;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 4px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav a:hover,
.nav a.active {
  background: var(--soft);
  border-color: rgba(20, 102, 95, 0.14);
  color: var(--ink);
  text-decoration: none;
}

.nav a:active,
.links a:active {
  transform: translateY(1px);
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 860px);
  gap: clamp(30px, 5vw, 76px);
  align-items: start;
  max-width: 1280px;
  margin: 0 auto;
  padding: 64px 7vw 36px;
}

.single-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 64px 7vw 36px;
}

.profile-card {
  position: sticky;
  top: 104px;
  overflow: hidden;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)),
    #15232b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  box-shadow: 0 22px 58px rgba(21, 35, 43, 0.18);
  color: #f7fbfb;
}

.profile-card::before {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  margin-bottom: 20px;
  background: var(--warm);
  border-radius: 8px;
}

.portrait {
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
  margin: 0 auto 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: #22343d;
}

.profile-card h1 {
  margin: 0;
  font-size: clamp(1.55rem, 2.8vw, 2.05rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.profile-card h1 span {
  display: block;
  color: rgba(247, 251, 251, 0.68);
  font-size: 1rem;
  font-weight: 700;
}

.nickname,
.role {
  margin: 8px 0 0;
  color: rgba(247, 251, 251, 0.68);
  font-weight: 600;
}

.role {
  color: #f7fbfb;
}

.quick-facts {
  display: grid;
  gap: 8px;
  padding: 18px 0 0;
  margin: 18px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(247, 251, 251, 0.76);
  list-style: none;
}

.quick-facts li::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--warm);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.links a {
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #f7fbfb;
  font-size: 0.9rem;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.links a:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  text-decoration: none;
}

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

.section:first-child {
  padding-top: 0;
}

.section:last-child {
  border-bottom: 0;
}

.hero h1,
.hero h2 {
  max-width: 900px;
  margin: 0 0 20px;
  font-size: clamp(2.25rem, 4.5vw, 4.35rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.hero.compact h1 {
  font-size: clamp(2.15rem, 3.35vw, 3.55rem);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--warm);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.zh .eyebrow {
  letter-spacing: 0;
  text-transform: none;
}

.lead {
  max-width: 68ch;
  color: #34424a;
  font-size: clamp(1.05rem, 1.45vw, 1.22rem);
  line-height: 1.62;
}

.markdown-content > h2 {
  padding-top: 38px;
  margin-top: 38px;
  border-top: 1px solid var(--line);
}

.markdown-content > h2:first-of-type {
  margin-top: 38px;
}

.markdown-content > h2 + p,
.markdown-content > h2 + dl,
.markdown-content > h2 + ul,
.markdown-content > h2 + ol,
.markdown-content > h2 + table {
  margin-top: 0;
}

.section h2 {
  margin: 0 0 16px;
  font-size: clamp(1.42rem, 2.05vw, 1.95rem);
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.section h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  letter-spacing: -0.012em;
}

.markdown-content h3 {
  margin: 22px 0 8px;
  color: var(--ink);
  font-size: 1.05rem;
  letter-spacing: -0.012em;
}

.section p {
  max-width: 76ch;
  margin: 0 0 16px;
}

.markdown-content p {
  max-width: 76ch;
  margin: 0 0 16px;
}

.markdown-content > p:last-child {
  margin-bottom: 0;
}

.fact-grid,
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.project-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.fact-grid article,
.project-grid article {
  min-width: 0;
  padding: 20px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-tight);
}

.fact-grid article p,
.project-grid article p {
  color: var(--muted);
  font-size: 0.96rem;
}

.info-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.markdown-content dl {
  display: grid;
  grid-template-columns: minmax(128px, 0.32fr) minmax(0, 1fr);
  column-gap: 20px;
  margin: 0;
  border-top: 1px solid var(--line);
}

.info-list article {
  display: grid;
  grid-template-columns: minmax(128px, 0.32fr) minmax(0, 1fr);
  gap: 20px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.info-list h3 {
  margin: 0;
  color: var(--ink);
}

.markdown-content dt {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-weight: 800;
}

.markdown-content dd {
  min-width: 0;
  margin: 0;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.markdown-content dd p:last-child,
.markdown-content dd ul:last-child {
  margin-bottom: 0;
}

.info-list p {
  max-width: 78ch;
  margin: 0;
  color: var(--muted);
}

.info-body {
  max-width: 78ch;
  color: var(--muted);
}

.info-body p:last-child,
.info-body ul:last-child {
  margin-bottom: 0;
}

.paper-list {
  display: grid;
  gap: 12px;
  max-width: 78ch;
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.paper-list li {
  padding-left: 2px;
}

.markdown-content dd ul {
  display: grid;
  gap: 12px;
  max-width: 78ch;
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.markdown-content dd li {
  padding-left: 2px;
}

.markdown-content dd li > a:first-child {
  display: block;
}

.paper-title {
  display: block;
}

.paper-meta {
  display: block;
  margin-top: 3px;
  color: var(--muted-soft);
  font-size: 0.94rem;
}

.paper-meta strong {
  color: var(--ink);
  font-weight: 700;
}

.post-list {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.post-card {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.post-card:last-child {
  border-bottom: 1px solid var(--line);
}

.post-card h3 {
  margin: 6px 0 8px;
  font-size: 1.18rem;
}

.post-card h3 a {
  color: var(--ink);
}

.post-card h3 a:hover {
  color: var(--accent);
}

.post-card p {
  max-width: 72ch;
  margin: 0;
  color: var(--muted);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  color: var(--muted-soft);
  font-size: 0.92rem;
  font-weight: 700;
}

.post-meta time {
  color: var(--warm);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.post-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid rgba(20, 102, 95, 0.16);
  border-radius: 8px;
  background: rgba(20, 102, 95, 0.07);
  color: var(--accent-dark);
  font-size: 0.82rem;
  line-height: 1.25;
}

.post-page {
  max-width: 920px;
  margin: 0 auto;
}

.back-to-blog {
  position: sticky;
  top: 88px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin: 0 0 24px;
  padding: 5px 11px;
  border: 1px solid rgba(20, 102, 95, 0.18);
  border-radius: 8px;
  background: rgba(245, 247, 247, 0.88);
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.2;
  box-shadow: 0 10px 24px rgba(23, 33, 43, 0.08);
  backdrop-filter: blur(12px);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.back-to-blog::before {
  content: "<";
  margin-right: 7px;
  color: var(--warm);
  font-weight: 900;
}

.back-to-blog:hover {
  border-color: rgba(20, 102, 95, 0.32);
  background: var(--surface);
  color: var(--accent-dark);
  text-decoration: none;
}

.back-to-blog:active {
  transform: translateY(1px);
}

.post-header {
  position: relative;
  padding: 8px 0 34px;
  border-bottom: 1px solid var(--line);
}

.post-header::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 132px;
  height: 2px;
  background: var(--accent);
}

.post-header h1 {
  max-width: 880px;
  margin: 0 0 16px;
  font-size: clamp(2.28rem, 4vw, 4.2rem);
  line-height: 1.03;
  letter-spacing: -0.045em;
}

.post-deck {
  max-width: 72ch;
  margin: 0 0 20px;
  color: #34424a;
  font-size: clamp(1.06rem, 1.5vw, 1.22rem);
  line-height: 1.6;
}

.post-page .markdown-content {
  max-width: 74ch;
  padding-top: 36px;
  color: #26343d;
  font-size: 1.035rem;
  line-height: 1.78;
}

.post-page .markdown-content > p:first-of-type {
  color: #203039;
  font-size: 1.08rem;
  line-height: 1.78;
}

.post-section {
  margin-top: 42px;
  padding-top: 30px;
  border-top: 1px solid rgba(215, 223, 223, 0.82);
}

.post-section h2 {
  max-width: 18ch;
  margin: 0 0 18px;
  color: var(--ink);
  font-size: clamp(1.62rem, 2.3vw, 2.28rem);
  line-height: 1.16;
  letter-spacing: -0.03em;
}

.post-page .markdown-content h3 {
  margin: 30px 0 10px;
  color: var(--ink);
  font-size: 1.18rem;
  line-height: 1.32;
}

.post-page .markdown-content p,
.post-page .markdown-content li {
  overflow-wrap: anywhere;
}

.post-page .markdown-content p {
  max-width: 74ch;
  margin: 0 0 20px;
}

.post-page .markdown-content ul,
.post-page .markdown-content ol {
  display: grid;
  gap: 8px;
  max-width: 72ch;
  margin: 0 0 22px;
  padding-left: 1.35rem;
}

.post-page .markdown-content li::marker {
  color: var(--warm);
  font-weight: 800;
}

.post-page .markdown-content a {
  text-decoration: underline;
  text-decoration-color: rgba(20, 102, 95, 0.28);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.post-page .markdown-content a:hover {
  text-decoration-color: currentColor;
}

.post-page .markdown-content code {
  padding: 0.12em 0.34em;
  border: 1px solid rgba(20, 102, 95, 0.14);
  border-radius: 5px;
  background: rgba(232, 240, 239, 0.75);
  color: var(--accent-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
}

.post-page pre {
  position: relative;
  overflow-x: auto;
  max-width: min(100%, 920px);
  margin: 24px 0;
  padding: 18px 20px;
  border: 1px solid rgba(20, 102, 95, 0.16);
  border-radius: 8px;
  background: #14232b;
  box-shadow: 0 16px 36px rgba(20, 35, 43, 0.14);
}

.post-page pre[data-language]::before {
  content: attr(data-language);
  display: block;
  margin: 0 0 10px;
  color: rgba(247, 251, 251, 0.62);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-page pre code {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: #eef7f6;
  font-size: 0.9rem;
  line-height: 1.7;
}

.post-page blockquote {
  max-width: 78ch;
  margin: 0 0 26px;
  padding: 18px 20px;
  border: 1px solid rgba(20, 102, 95, 0.16);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(20, 102, 95, 0.08), rgba(20, 102, 95, 0)),
    var(--surface);
  box-shadow: var(--shadow-tight);
}

.post-page blockquote p {
  margin: 0;
  color: #35434c;
  font-size: 0.96rem;
  line-height: 1.65;
}

.post-page img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 26px auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fdfefe;
  box-shadow: 0 18px 42px rgba(23, 33, 43, 0.1);
}

.author-position {
  display: inline-flex;
  align-items: center;
  min-height: 1.45em;
  padding: 0 0.38em;
  border: 1px solid rgba(20, 102, 95, 0.2);
  border-radius: 5px;
  background: rgba(20, 102, 95, 0.08);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  vertical-align: 0.08em;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-tight);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.markdown-content table {
  display: block;
  overflow-x: auto;
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-tight);
}

.ecosystem-table {
  min-width: 900px;
  table-layout: fixed;
}

.ecosystem-table th:nth-child(1),
.ecosystem-table td:nth-child(1) {
  width: 19%;
  white-space: nowrap;
}

.ecosystem-table th:nth-child(2),
.ecosystem-table td:nth-child(2) {
  width: 17%;
  white-space: nowrap;
}

.ecosystem-table th:nth-child(3),
.ecosystem-table td:nth-child(3) {
  width: 38%;
}

.ecosystem-table th:nth-child(4),
.ecosystem-table td:nth-child(4) {
  width: 26%;
}

th,
td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--soft);
  color: var(--ink);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

tr:last-child td {
  border-bottom: 0;
}

.note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.93rem;
}

.timeline,
.plain-list,
.talk-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline {
  display: grid;
  gap: 0;
}

.timeline li,
.talk-list li {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 18px;
  align-items: baseline;
}

.timeline li {
  position: relative;
  padding: 12px 0 12px 22px;
  border-left: 1px solid var(--line);
}

.timeline li::before {
  content: "";
  position: absolute;
  top: 1.58em;
  left: -4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}

.timeline span {
  color: #35434c;
}

.timeline time,
.talk-list time {
  color: var(--warm);
  font-weight: 800;
  font-size: 0.92rem;
}

.talk-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.talk-list li {
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.talk-list a {
  color: var(--ink);
}

.talk-list a:hover {
  color: var(--accent);
}

.plain-list {
  display: grid;
  gap: 12px;
}

.markdown-content > .plain-list {
  margin-top: 0;
}

.plain-list.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.plain-list li {
  padding-left: 18px;
  position: relative;
}

.plain-list li::before {
  content: "";
  position: absolute;
  top: 0.75em;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warm);
}

blockquote {
  margin: 0 0 18px;
  padding: 20px 22px;
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  box-shadow: var(--shadow-tight);
}

blockquote cite {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.93rem;
  font-style: normal;
  font-weight: 700;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 18px;
  padding: 28px 7vw 42px;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 980px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .nav {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .page-shell {
    grid-template-columns: 1fr;
    padding-top: 34px;
  }

  .single-page {
    padding-top: 34px;
  }

  .profile-card {
    position: static;
    display: grid;
    grid-template-columns: 148px minmax(0, 1fr);
    gap: 10px 22px;
    align-items: center;
  }

  .profile-card::before {
    grid-column: 1 / -1;
    margin-bottom: 6px;
  }

  .portrait {
    grid-row: span 5;
    max-width: 148px;
    margin: 0;
  }

  .quick-facts,
  .links {
    grid-column: 1 / -1;
  }

  .fact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 15px;
  }

  .site-header,
  .page-shell,
  .single-page,
  .site-footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .brand {
    white-space: normal;
  }

  .nav a {
    padding-left: 9px;
    padding-right: 9px;
  }

  .profile-card,
  .project-grid,
  .plain-list.two-col {
    grid-template-columns: 1fr;
  }

  .portrait {
    grid-row: auto;
    max-width: 180px;
  }

  .timeline li,
  .talk-list li,
  .info-list article,
  .markdown-content dl {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .back-to-blog {
    top: 12px;
  }
}
