:root {
  --paper: #fff;
  --ink: #202124;
  --muted: #5f6368;
  --line: #e5e7eb;
  --accent: #2563eb;
  --shell: 900px;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible,
.skip-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 10;
  padding: 0.45rem 0.7rem;
  color: var(--paper);
  background: var(--ink);
  text-decoration: none;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  width: min(var(--shell), calc(100% - 40px));
  margin: 0 auto;
}

.hero-section {
  padding: 4.5rem 0 3.4rem;
}

.hero-section > h1 {
  margin: 0;
  font-size: clamp(2.25rem, 4.5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.1;
  text-align: center;
}

.name-cn {
  color: var(--muted);
  font-size: 0.85em;
  font-weight: 400;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.hero-grid {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 3.2rem;
  align-items: start;
  margin-top: 2.2rem;
}

.portrait-wrap {
  margin: 0;
}

.portrait-frame {
  overflow: hidden;
  aspect-ratio: 0.75;
  background: #f3f4f6;
}

.portrait-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.intro-copy {
  max-width: 620px;
}

.intro-copy > p {
  margin: 0 0 1rem;
  font-size: 1rem;
  line-height: 1.65;
}

.intro-copy strong {
  font-weight: 600;
}

.intro-copy a,
.contact-link,
.card-links a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.intro-note {
  color: var(--muted);
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.15rem;
  align-items: center;
  margin-top: 1.5rem;
  font-size: 0.86rem;
}

.inactive-link {
  color: var(--muted);
}

.inactive-link small {
  margin-left: 0.2rem;
  font-size: 0.75rem;
}

.contact-link {
  cursor: pointer;
}

button.contact-link {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
}

.email-menu {
  position: relative;
}

.email-toggle::after {
  display: inline-block;
  margin-left: 0.25rem;
  color: var(--muted);
  content: "+";
  text-decoration: none;
}

.email-toggle[aria-expanded="true"]::after {
  content: "−";
}

.email-panel {
  position: absolute;
  top: calc(100% + 0.65rem);
  left: 0;
  z-index: 5;
  display: grid;
  width: min(330px, calc(100vw - 40px));
  gap: 0.55rem;
  padding: 0.7rem;
  border: 1px solid var(--line);
  background: var(--paper);
}

.email-panel--footer {
  top: auto;
  bottom: calc(100% + 0.65rem);
}

.email-panel[hidden] {
  display: none;
}

.email-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.email-address {
  min-width: 0;
  color: var(--ink);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.copy-button {
  flex: 0 0 auto;
  padding: 0.18rem 0.42rem;
  border: 1px solid var(--line);
  color: var(--accent);
  background: var(--paper);
  font: inherit;
  font-size: 0.74rem;
  cursor: pointer;
}

.copy-button:hover {
  border-color: var(--accent);
}

.wechat-dialog {
  width: min(360px, calc(100vw - 32px));
  padding: 1.1rem;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--paper);
}

.wechat-dialog::backdrop {
  background: rgba(32, 33, 36, 0.28);
}

.wechat-dialog h2 {
  margin: 0 0 0.9rem;
  font-size: 1.2rem;
  font-weight: 600;
}

.wechat-dialog img {
  display: block;
  width: min(100%, 300px);
  height: auto;
  margin: 0 auto;
}

.wechat-close {
  float: right;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.wechat-close:hover {
  color: var(--ink);
}

.section-block {
  margin-top: 3.9rem;
}

.section-heading {
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.7rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.project-card,
.publication-card {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 1.8rem;
  align-items: start;
  margin-top: 1.5rem;
  padding-bottom: 1.8rem;
  border-bottom: 1px solid var(--line);
}

.project-visual {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #f3f4f6;
}

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

.publication-media {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #f3f4f6;
}

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

.card-content {
  min-width: 0;
}

.card-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.status-tag {
  color: var(--accent);
}

.card-content h3 {
  max-width: 650px;
  margin: 0.65rem 0 0.45rem;
  font-size: clamp(1.125rem, 1.8vw, 1.25rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.publication-authors,
.card-description {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.author--first {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.card-description {
  margin-top: 0.75rem;
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.15rem;
  margin-top: 0.9rem;
  font-size: 0.86rem;
}

.affiliation-list {
  margin-top: 1.3rem;
}

.affiliation-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.affiliation-mark {
  display: flex;
  width: 48px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-align: center;
}

.affiliation-mark--logo {
  height: 48px;
  border: 0;
  background: #fff;
}

.affiliation-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.affiliation-mark--polytechnique .affiliation-logo {
  object-position: left center;
}

.affiliation-details h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
}

.affiliation-org,
.affiliation-field,
.affiliation-years {
  margin: 0;
}

.affiliation-org {
  margin-top: 0.18rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

.affiliation-org a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.affiliation-note {
  margin: 0.28rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.affiliation-note a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.affiliation-field {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.affiliation-years {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 1.4rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 700px) {
  .page-shell {
    width: min(var(--shell), calc(100% - 32px));
  }

  .hero-section {
    padding: 3rem 0 2.8rem;
  }

  .hero-section > h1 {
    font-size: 2.25rem;
  }

  .name-cn {
    display: inline-block;
  }

  .hero-grid,
  .project-card,
  .publication-card {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    gap: 1.8rem;
    margin-top: 1.8rem;
  }

  .portrait-wrap {
    width: 150px;
  }

  .section-block {
    margin-top: 3.2rem;
  }

  .project-visual,
  .publication-media {
    width: min(100%, 300px);
  }

  .affiliation-item {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 0.9rem;
  }

  .affiliation-mark {
    width: 44px;
    min-height: 44px;
  }

  .affiliation-mark--logo {
    height: 44px;
  }

  .affiliation-years {
    grid-column: 2;
    margin-top: -0.55rem;
  }

  .email-panel {
    width: min(330px, calc(100vw - 32px));
    left: 50%;
    transform: translateX(-50%);
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.2rem;
  }
}

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