:root {
  --bg: #fbfbfa;
  --ink: #161616;
  --muted: #686868;
  --soft: #a2a2a2;
  --line: #e4e2de;
  --accent: #8e1f1f;
  --panel: #ffffff;
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", "Songti SC", "SimSun", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-sans);
  letter-spacing: 0;
}

body[data-language="cn"] [data-i18n-lang="en"],
body[data-language="en"] [data-i18n-lang="cn"] {
  display: none;
}

body[data-language="en"] [data-i18n-lang="en"] {
  font-family: "Times New Roman", Times, serif;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.language-toggle {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--soft);
  background: rgba(251, 251, 250, 0.86);
  box-shadow: 0 10px 28px rgba(22, 22, 22, 0.08);
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(14px);
}

.language-toggle:hover,
.language-toggle:focus-visible {
  color: var(--accent);
}

body[data-language="cn"] .language-toggle [data-toggle-lang="cn"],
body[data-language="en"] .language-toggle [data-toggle-lang="en"] {
  color: var(--ink);
}

.site-frame {
  display: grid;
  grid-template-columns: 280px minmax(0, 720px);
  gap: 74px;
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 56px 0 42px;
}

.sidebar {
  position: sticky;
  top: 44px;
  align-self: start;
  min-height: calc(100vh - 88px);
  display: flex;
  flex-direction: column;
  gap: 34px;
  padding-right: 30px;
  border-right: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 10px 28px rgba(22, 22, 22, 0.08);
}

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

.portrait-wrap {
  width: 132px;
  height: 132px;
  margin-bottom: 24px;
  border-radius: 50%;
  background: var(--panel);
  box-shadow: 0 22px 56px rgba(22, 22, 22, 0.1);
}

.portrait {
  display: block;
  width: 132px;
  height: 132px;
  border: 3px solid rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 35%;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: 42px;
  line-height: 1;
  font-weight: 900;
}

.english-name {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 22px;
  line-height: 1.18;
  font-weight: 780;
}

.role {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 720;
}

.side-nav {
  display: grid;
  gap: 12px;
  width: fit-content;
}

.side-nav a {
  color: var(--muted);
  font-size: 15px;
  font-weight: 760;
  text-decoration: none;
}

.side-nav a:hover {
  color: var(--accent);
}

.mini-contact {
  display: grid;
  gap: 8px;
  margin-top: auto;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.mini-contact a {
  color: var(--ink);
  font-weight: 760;
}

.content {
  min-width: 0;
  padding-top: 82px;
}

.intro {
  padding-bottom: 68px;
}

.intro-copy {
  max-width: 650px;
  color: var(--muted);
  font-size: 21px;
  font-weight: 690;
  line-height: 1.62;
}

.intro-copy .latin {
  font-family: "Times New Roman", Times, serif;
  font-weight: 700;
}

.intro-copy h2 {
  margin-bottom: 22px;
  color: var(--ink);
  font-size: 34px;
  line-height: 1.1;
  font-weight: 880;
}

.intro-copy p {
  margin-bottom: 18px;
}

.intro-copy .name-line {
  color: var(--ink);
  font-size: 24px;
  font-weight: 720;
}

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

.section-head {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 24px;
  align-items: baseline;
  margin-bottom: 8px;
}

.section-head h2 {
  margin-bottom: 0;
  font-family: var(--font-serif);
  font-size: 27px;
  line-height: 1.2;
  font-weight: 700;
}

.section-title-button {
  display: inline;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.section-kicker-button {
  display: inline-block;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.section-kicker-button:hover,
.section-kicker-button:focus-visible,
.section-title-button:hover,
.section-title-button:focus-visible {
  color: var(--accent);
}

.link-list,
.text-list {
  display: grid;
}

.collapsible-section.is-collapsed .collapsible-body {
  display: none;
}

.link-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.55fr) minmax(220px, 1fr);
  gap: 22px;
  align-items: center;
  min-height: 58px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.link-row b {
  font-size: 22px;
  line-height: 1.2;
}

.link-row span:last-child {
  justify-self: end;
  color: var(--soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  font-weight: 760;
  overflow-wrap: anywhere;
  text-align: right;
}

.link-row:hover b,
.link-row:hover span:last-child {
  color: var(--accent);
}

.link-row.pending {
  cursor: default;
}

.link-row.pending:hover b {
  color: var(--ink);
}

.link-row.pending:hover span:last-child {
  color: var(--soft);
}

.text-row {
  display: grid;
  grid-template-columns: minmax(190px, 0.55fr) minmax(0, 1fr);
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.text-row h3 {
  margin-bottom: 0;
  font-size: 19px;
  line-height: 1.42;
  font-weight: 850;
}

.text-row p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.72;
}

.text-row time {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  font-weight: 850;
}

.project-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.5;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.project-link:hover,
.project-link:focus-visible {
  color: var(--accent);
}

.project-meta-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.5;
}

.education-row,
.experience-row {
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 28px;
}

.experience-row {
  grid-template-columns: 144px minmax(0, 1fr);
}

.experience-row time {
  white-space: nowrap;
}

.education-row h3,
.experience-row h3 {
  margin-bottom: 12px;
}

.education-row p,
.experience-row p {
  max-width: 620px;
  font-size: 15px;
  line-height: 1.86;
}

.education-extra {
  display: grid;
  gap: 4px;
  margin-top: 18px;
  max-width: 620px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.76;
}

.education-extra p {
  margin-bottom: 4px;
  font-size: inherit;
  line-height: inherit;
}

.education-extra b {
  color: var(--ink);
  font-weight: 850;
}

.certificate-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
  padding-top: 10px;
}

.certificate-list p {
  display: inline;
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 880;
  line-height: 1.72;
  white-space: nowrap;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
  color: var(--soft);
  font-size: 14px;
  font-weight: 720;
}

.site-footer a {
  text-decoration: none;
}

@media (max-width: 860px) {
  .language-toggle {
    top: 18px;
    right: 18px;
  }

  .site-frame {
    grid-template-columns: 1fr;
    gap: 0;
    width: min(100% - 32px, 720px);
    padding-top: 24px;
  }

  .sidebar {
    position: static;
    min-height: auto;
    gap: 22px;
    padding: 0 0 26px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    margin-bottom: 18px;
  }

  .profile {
    display: block;
  }

  .portrait-wrap,
  .portrait {
    width: 108px;
    height: 108px;
  }

  .portrait-wrap {
    margin-bottom: 18px;
  }

  h1 {
    font-size: 36px;
  }

  .english-name {
    font-size: 20px;
  }

  .side-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
  }

  .mini-contact {
    margin-top: 0;
  }

  .content {
    padding-top: 40px;
  }

  .intro {
    padding-bottom: 48px;
  }

  .intro-copy h2 {
    font-size: 30px;
    margin-bottom: 18px;
  }

  .intro-copy {
    font-size: 18px;
    line-height: 1.68;
  }

  .intro-copy .name-line {
    font-size: 20px;
  }

  .section-head,
  .link-row,
  .text-row {
    grid-template-columns: 1fr;
  }

  .section-head {
    gap: 4px;
    margin-bottom: 12px;
  }

  .link-row {
    gap: 6px;
  }

  .link-row span:last-child {
    justify-self: start;
    text-align: left;
  }

  .text-row {
    gap: 8px;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .site-frame {
    width: min(100% - 28px, 720px);
  }

  .brand span {
    font-size: 14px;
  }

  .intro-copy h2 {
    font-size: 28px;
  }

  .intro-copy {
    font-size: 17px;
  }

  .link-row b {
    font-size: 20px;
  }
}
