:root {
  --accent: #2f6f8f;
  --accent-dark: #24526a;
  --accent-soft: #d9edf4;
  --text: #343a40;
  --muted: #6c757d;
  --line: #dee2e6;
  --bg: #ffffff;
  --sidebar: #23506b;
  --sidebar-2: #1b4158;
  --bar-1: #2f6f8f;
  --bar-2: #5fa8c7;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

html[lang="zh-CN"] body {
  font-family: "Open Sans", "Noto Sans SC", "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

html[lang="zh-CN"] h2,
html[lang="zh-CN"] h3,
html[lang="zh-CN"] .site-nav a,
html[lang="zh-CN"] .item-subtitle {
  font-family: "Open Sans", "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  letter-spacing: 0;
}

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

a:hover,
a:focus {
  color: var(--accent-dark);
  text-decoration: underline;
}

a[aria-disabled="true"] {
  color: var(--muted);
  cursor: not-allowed;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 1000;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--line);
}

.skip-link:focus {
  top: 12px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.side-header {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 17rem;
  min-height: 100vh;
  padding: 2rem 1rem;
  background:
    linear-gradient(rgba(35, 80, 107, 0.93), rgba(27, 65, 88, 0.96)),
    url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=900&q=80") center / cover;
}

.brand {
  display: block;
  color: #fff;
  text-align: center;
}

.brand:hover,
.brand:focus {
  color: #fff;
  text-decoration: none;
}

.brand-mobile {
  display: none;
  font-family: "Saira Extra Condensed", sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-image {
  display: block;
  width: 10.5rem;
  height: 10.5rem;
  padding: 0.45rem;
  margin-bottom: 1.75rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 0.5rem solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 1rem 2.4rem rgba(0, 0, 0, 0.2);
}

.brand-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.side-nav-wrap {
  width: 100%;
}

.site-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  align-items: center;
}

.site-nav a {
  display: block;
  width: 100%;
  padding: 0.35rem 0.75rem;
  color: rgba(255, 255, 255, 0.72);
  font-family: "Saira Extra Condensed", sans-serif;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
  transition: color 160ms ease, transform 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus,
.site-nav a.is-active {
  color: #fff;
  text-decoration: none;
  transform: translateX(3px);
}

.nav-toggle {
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: transparent;
  color: #fff;
  padding: 0.45rem 0.75rem;
  font: inherit;
}

.language-switcher {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 60;
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid rgba(47, 111, 143, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 0.5rem 1.6rem rgba(33, 37, 41, 0.1);
  backdrop-filter: blur(10px);
}

.lang-button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #45505a;
  padding: 0.35rem 0.7rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.lang-button.is-active {
  background: var(--accent);
  color: #fff;
}

main,
.site-footer {
  margin-left: 17rem;
}

.resume-section {
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding: 4.8rem 3rem;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.section-content {
  width: min(100%, 1200px);
}

.resume-section:not(.is-visible) .section-content {
  opacity: 0;
  transform: translateY(26px);
}

.resume-section .section-content {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 650ms ease, transform 650ms ease;
}

.hero-section {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.9) 58%, rgba(255, 255, 255, 0.52) 100%),
    url("https://images.unsplash.com/photo-1439405326854-014607f694d7?auto=format&fit=crop&w=1800&q=80") center / cover fixed;
}

.eyebrow,
.subheading,
.item-subtitle,
.item-meta,
.stack {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: "Saira Extra Condensed", sans-serif;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.1;
  text-transform: uppercase;
}

.subheading {
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: none !important;
}

.subheading a {
  text-transform: none !important;
}

h1 {
  margin: 0;
  color: #212529;
  font-size: clamp(4.7rem, 9vw, 6.4rem);
  font-weight: 800;
}

h1 span {
  color: var(--accent);
}

h2 {
  margin: 0 0 2.7rem;
  color: #343a40;
  font-size: clamp(3rem, 7vw, 4.25rem);
}

h3 {
  margin: 0;
  color: #343a40;
  font-size: 1.55rem;
}

.subheading {
  margin: 0 0 2.7rem;
  font-size: 1.35rem;
}

.lead {
  max-width: 760px;
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: 1.2rem;
  font-weight: 300;
}

.bio-block {
  max-width: 820px;
  margin-top: 2.4rem;
  color: #4a5056;
}

.social-row,
.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.social-row a,
.pub-links a,
.pub-links span,
.project-card a,
.project-card span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.3rem;
  padding: 0.28rem 0.78rem;
  border-radius: 2rem;
  background: #e9ecef;
  color: #45505a;
  font-size: 0.9rem;
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.social-row a:hover,
.pub-links a:hover,
.project-card a:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

.timeline {
  display: grid;
  gap: 2rem;
}

.timeline-item {
  display: flex;
  gap: 2rem;
}

.timeline-item > div:last-child {
  flex: 1 1 auto;
}

.item-meta {
  flex: 0 0 10.8rem;
  padding-top: 0.2rem;
  color: var(--accent);
  font-size: 0.96rem;
  text-align: right;
}

.item-subtitle {
  margin: 0.2rem 0 0.8rem;
  font-family: "Saira Extra Condensed", sans-serif;
  font-size: 1.22rem;
  font-weight: 500;
  line-height: 1.2;
  text-transform: uppercase;
}

p {
  margin: 0 0 1rem;
}

[data-i18n$=".body"] {
  white-space: pre-line;
}

.topic-list,
.compact-list {
  margin: 0;
  padding-left: 1.2rem;
}

.topic-list li,
.compact-list li {
  margin-bottom: 0.7rem;
}

.publication-list {
  display: grid;
  gap: 1.4rem;
}

.publication {
  padding-left: 1.25rem;
  border-left: 3px solid var(--accent-soft);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 1.2rem;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 0.75rem 1.8rem rgba(33, 37, 41, 0.07);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 1rem 2.2rem rgba(33, 37, 41, 0.11);
}

.project-card a,
.project-card span {
  align-self: flex-start;
  margin-top: auto;
}

.project-card a + a {
  margin-top: 0.5rem;
}

.skill-bars {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.skillbar {
  display: grid;
  grid-template-columns: 12.5rem minmax(8rem, 1fr) 6.5rem;
  gap: 0;
  min-height: 2.35rem;
  overflow: hidden;
  border-radius: 0.15rem;
  background: #e9ecef;
}

.skillbar-title,
.skillbar-level {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
}

.skillbar-title {
  background: var(--accent-dark);
}

.skillbar-level {
  justify-content: flex-end;
  background: #eef3f5;
  color: #495057;
}

.skillbar-track {
  position: relative;
  background: #dce6eb;
}

.skillbar-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--bar-1), var(--bar-2));
  transition: width 1100ms ease;
}

.skillbar.is-filled .skillbar-bar {
  width: var(--target-width, 0%);
}

.skills-grid,
.award-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.skills-grid article {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.todo {
  color: var(--muted);
  font-style: italic;
}

.photo-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.photo-strip figure {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 0.75rem 1.8rem rgba(33, 37, 41, 0.07);
}

.photo-strip img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.88);
  transition: filter 180ms ease, transform 180ms ease;
}

.photo-strip .contain-image {
  object-fit: contain;
  padding: 0.25rem;
  background: #eef3f5;
}

.photo-strip figure:hover img {
  filter: saturate(1.08);
  transform: scale(1.02);
}

.photo-strip figcaption {
  position: absolute;
  left: 0.55rem;
  bottom: 0.45rem;
  padding: 0.18rem 0.5rem;
  background: rgba(20, 37, 48, 0.72);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}

address {
  font-style: normal;
}

.site-footer {
  padding: 1.5rem 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.back-to-top {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 40;
  display: none;
  border: 0;
  border-radius: 2rem;
  background: var(--accent);
  color: #fff;
  padding: 0.55rem 0.8rem;
  font: inherit;
  font-weight: 700;
  box-shadow: 0 0.5rem 1.4rem rgba(33, 37, 41, 0.2);
  cursor: pointer;
}

.back-to-top.is-visible {
  display: inline-flex;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }

  .hero-section {
    background-attachment: scroll;
  }
}

@media (max-width: 992px) {
  .side-header {
    position: sticky;
    top: 0;
    inset: auto;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    min-height: 0;
    padding: 0.8rem 1rem;
  }

  .brand-mobile {
    display: block;
  }

  .brand-image {
    display: none;
  }

  .side-nav-wrap {
    width: auto;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: none;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0;
    padding: 0.8rem 1rem;
    background: var(--sidebar-2);
    border-top: 1px solid rgba(255, 255, 255, 0.18);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    width: auto;
    padding: 0.35rem 0.7rem;
    text-align: left;
  }

  main,
  .site-footer {
    margin-left: 0;
  }

  .resume-section {
    min-height: auto;
    padding: 4.5rem 1.5rem;
  }

  .hero-section {
    min-height: calc(100vh - 4rem);
    background-attachment: scroll;
  }
}

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

  h1 {
    font-size: clamp(3.8rem, 18vw, 5.2rem);
  }

  h2 {
    margin-bottom: 1.7rem;
    font-size: clamp(2.6rem, 15vw, 3.5rem);
  }

  .timeline-item {
    display: block;
  }

  .item-meta {
    text-align: left;
    margin-bottom: 0.25rem;
  }

  .card-grid,
  .skills-grid,
  .award-columns,
  .photo-strip {
    grid-template-columns: 1fr;
  }

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

  .skillbar-title,
  .skillbar-level {
    min-height: 2rem;
  }

  .skillbar-track {
    min-height: 0.85rem;
  }

  .social-row a,
  .pub-links a,
  .pub-links span {
    flex: 1 1 auto;
  }
}
/* 首页简介正文区域单独加宽 */
#about .section-content {
  width: 100%;
  max-width: 2800px;
}

#about .lead {
  max-width: 1750px;
}

@media (min-width: 993px) {
  html {
    scroll-behavior: smooth;
  }

  .resume-section {
    min-height: 100vh;
  }
}
/* Hide language switcher 
.language-switcher {
  display: none;
}*/