@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/source-sans-3-latin-wght-300-700.woff2") format("woff2");
}

@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/cinzel-latin-600.woff2") format("woff2");
}

@font-face {
  font-family: "Noto Serif SC Name";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/noto-serif-sc-subset-wuzeqi-600.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --page-bg: #fdfdfc;
  --surface: #f5f8fb;
  --surface-strong: #edf3f8;
  --text: #17191c;
  --text-soft: #56616d;
  --text-faint: #68727d;
  --accent: #0875db;
  --accent-strong: #075faf;
  --accent-soft: rgba(8, 117, 219, 0.1);
  --line: #dce3e9;
  --line-strong: #b9c8d5;
  --header-bg: rgba(253, 253, 252, 0.9);
  --shadow: 0 16px 40px rgba(34, 60, 80, 0.08);
  --content-width: 800px;
  --font-sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", "Songti SC", serif;
  --font-brand: "Cinzel", "Noto Serif SC Name", "Songti SC", "Times New Roman", serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #181a1d;
  --surface: #20242a;
  --surface-strong: #272d34;
  --text: #eef1f4;
  --text-soft: #b7c0c9;
  --text-faint: #929da8;
  --accent: #54b5d3;
  --accent-strong: #79c9e1;
  --accent-soft: rgba(84, 181, 211, 0.13);
  --line: #343b43;
  --line-strong: #4a5661;
  --header-bg: rgba(24, 26, 29, 0.9);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
}

html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
  transition:
    color 240ms ease,
    background-color 280ms ease,
    border-color 280ms ease,
    box-shadow 280ms ease,
    fill 280ms ease,
    opacity 200ms ease,
    stroke 280ms ease,
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page-bg: #181a1d;
    --surface: #20242a;
    --surface-strong: #272d34;
    --text: #eef1f4;
    --text-soft: #b7c0c9;
    --text-faint: #929da8;
    --accent: #54b5d3;
    --accent-strong: #79c9e1;
    --accent-soft: rgba(84, 181, 211, 0.13);
    --line: #343b43;
    --line-strong: #4a5661;
    --header-bg: rgba(24, 26, 29, 0.9);
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
  }
}

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

html {
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: var(--page-bg);
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 380;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--accent-strong);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

::selection {
  color: var(--text);
  background: var(--accent-soft);
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.45rem 0.75rem;
  color: var(--page-bg);
  background: var(--text);
  border-radius: 4px;
  transform: translateY(-180%);
}

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

.site-shell {
  width: min(calc(100% - 2rem), var(--content-width));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.header-inner {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-brand {
  flex: 0 0 auto;
  color: var(--text);
  font-family: var(--font-brand);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  line-height: 1;
  text-decoration: none;
}

.site-brand:hover {
  color: var(--text);
  text-decoration: none;
}

.brand-cjk {
  font-family: "Noto Serif SC Name", "Songti SC", serif;
  letter-spacing: 0.01em;
}

.header-actions,
.site-nav,
.nav-links {
  display: flex;
  align-items: center;
}

.header-actions {
  gap: 0.6rem;
}

.nav-links {
  gap: 1.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  position: relative;
  display: inline-flex;
  padding: 0.35rem 0;
  color: var(--text-soft);
  font-size: 0.93rem;
  font-weight: 470;
  line-height: 1.2;
  text-decoration: none;
}

.nav-link::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 150ms ease;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  color: var(--accent);
  text-decoration: none;
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

.icon-button,
.nav-toggle {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  cursor: pointer;
}

.icon-button:hover,
.nav-toggle:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.icon-button {
  position: relative;
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.theme-icon-moon,
.theme-icon-sun {
  position: absolute;
  top: 50%;
  left: 50%;
  transition:
    opacity 200ms ease,
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.theme-icon-moon {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

.theme-icon-sun {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-35deg) scale(0.72);
}

:root[data-theme="dark"] .theme-icon-moon {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(35deg) scale(0.72);
}

:root[data-theme="dark"] .theme-icon-sun {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon-moon {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(35deg) scale(0.72);
  }

  :root:not([data-theme="light"]) .theme-icon-sun {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
  }
}

:root[data-theme="light"] .theme-icon-moon {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

:root[data-theme="light"] .theme-icon-sun {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-35deg) scale(0.72);
}

.nav-toggle {
  display: none;
  position: relative;
}

.nav-toggle-lines,
.nav-toggle-lines::before,
.nav-toggle-lines::after {
  width: 18px;
  height: 1.5px;
  display: block;
  background: currentColor;
  border-radius: 2px;
  transition:
    transform 210ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 160ms ease;
}

.nav-toggle-lines {
  position: relative;
}

.nav-toggle-lines::before,
.nav-toggle-lines::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-lines::before {
  top: -5px;
}

.nav-toggle-lines::after {
  top: 5px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-lines {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-lines::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-lines::after {
  top: 0;
  transform: rotate(-45deg);
}

.site-main {
  flex: 1 0 auto;
  padding-block: clamp(3.5rem, 8vw, 5.2rem) 5.5rem;
}

.page-header {
  margin-bottom: 2.6rem;
}

.page-title {
  margin: 0;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: clamp(2.15rem, 6vw, 3rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.page-intro {
  max-width: 38rem;
  margin: 0.9rem 0 0;
  color: var(--text-soft);
  font-size: 1.05rem;
}

.home-main {
  padding-top: clamp(4.5rem, 10vw, 7rem);
}

.home-main > .site-shell {
  width: min(calc(100% - 2rem), 44rem);
}

.hero {
  max-width: 46rem;
}

.hero-title {
  max-width: 44rem;
  margin: 0;
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4.35vw, 2.4rem);
  font-style: italic;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.03;
}

.hero-rule {
  width: 72px;
  height: 3px;
  margin: 1.8rem 0 2.15rem;
  background: var(--accent);
  border: 0;
  border-radius: 2px;
}

.hero-lead {
  max-width: 44rem;
  margin: 0;
  color: var(--text);
  font-size: 1em;
  line-height: 1.62;
}

.home-details {
  margin-top: 2.8rem;
  display: grid;
  grid-template-columns: minmax(0, 44rem);
  gap: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.detail-heading {
  margin: 0 0 0.65rem;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-copy {
  margin: 0;
  color: var(--text);
  font-size: 1em;
}

.contact-block {
  display: grid;
  gap: 0.65rem;
}

.contact-email {
  width: fit-content;
  color: var(--text);
  font-size: 1em;
  font-weight: 520;
  text-decoration: none;
}

.contact-email,
.inline-link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.18em;
  color: var(--text);
  font-size: 1em;
  font-weight: 480;
  text-decoration: none;
}

.contact-email {
  font-weight: 400;
}

.contact-email:hover,
.inline-link:hover {
  color: var(--accent);
}

.external-mark {
  color: var(--accent);
  font-size: 0.82em;
}

.content-section + .content-section {
  margin-top: 3.4rem;
}

.section-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--accent);
}

.section-heading {
  margin: 0;
  font-size: 1.34rem;
  font-weight: 640;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.publication {
  padding: 1.55rem 0 1.65rem;
  border-bottom: 1px solid var(--line);
}

.publication-title {
  margin: 0;
  font-size: 1.17rem;
  font-weight: 630;
  letter-spacing: -0.01em;
  line-height: 1.34;
}

.publication-title a {
  color: var(--text);
  text-decoration: none;
}

.publication-title a:hover {
  color: var(--accent);
}

.publication-authors,
.publication-venue {
  margin: 0.35rem 0 0;
  color: var(--text);
  font-size: 0.92em;
  line-height: 1.48;
}

.publication-authors strong {
  color: var(--text);
  font-weight: 590;
}

.publication-authors a {
  color: inherit;
  text-decoration: none;
}

.publication-authors a:hover,
.publication-authors a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.publication-venue {
  color: var(--text);
}

.publication-venue em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
}

.publication-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.action-link,
.abstract-toggle {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.62rem;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 560;
  letter-spacing: 0.015em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.action-link:hover,
.abstract-toggle[aria-expanded="true"],
.abstract-toggle:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: var(--accent);
  text-decoration: none;
}

.abstract-toggle {
  font-family: inherit;
}

.abstract-toggle::after {
  content: "";
  width: 0.38rem;
  height: 0.38rem;
  margin-left: 0.5rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-0.1rem) rotate(45deg);
  transition: transform 160ms ease;
}

.abstract-toggle[aria-expanded="true"]::after {
  transform: translateY(0.1rem) rotate(225deg);
}

.abstract-panel {
  order: 2;
  flex-basis: 100%;
  margin: 0.55rem 0 0;
  padding: 1rem 1.1rem;
  color: var(--text-soft);
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 5px 5px 0;
  font-size: 0.91rem;
  line-height: 1.58;
}

.abstract-panel .katex {
  color: inherit;
  font-size: 1.04em;
}

.abstract-panel .katex-display {
  max-width: 100%;
  margin: 0.7em 0;
  padding-block: 0.1rem;
  overflow-x: auto;
  overflow-y: hidden;
}

.talk-year + .talk-year {
  margin-top: 3.25rem;
}

.year-label {
  margin: 0 0 0.25rem;
  padding-bottom: 0.65rem;
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: 0.025em;
}

.talk-item {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.45rem 0;
  border-bottom: 1px solid var(--line);
}

.talk-date {
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.025em;
}

.talk-title {
  margin: 0;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 610;
  line-height: 1.35;
}

.talk-location {
  margin: 0.35rem 0 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.talk-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.talk-slide-link {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 0.88rem;
}

.cv-topline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}

.primary-button {
  flex: 0 0 auto;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.8rem;
  color: var(--page-bg);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 5px;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-decoration: none;
}

.primary-button:hover {
  color: var(--page-bg);
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  text-decoration: none;
}

.cv-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  margin-top: 1rem;
  color: var(--text-soft);
  font-size: 1em;
}

.cv-contact a {
  text-decoration: none;
}

.cv-contact-label {
  color: var(--text);
  font-weight: 560;
}

.cv-section + .cv-section {
  margin-top: 3.35rem;
}

.cv-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem 2rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line);
}

.cv-role {
  margin: 0 0 0.25rem;
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 520;
}

.cv-institution {
  margin: 0;
  color: var(--text);
  font-size: 1em;
  font-weight: 600;
  line-height: 1.3;
}

.cv-institution a,
.cv-department a {
  color: inherit;
  text-decoration: none;
}

.cv-institution a:hover,
.cv-department a:hover {
  color: var(--accent);
}

.cv-department {
  margin: 0.35rem 0 0;
  color: var(--text-soft);
  font-size: 0.94rem;
}

.cv-date {
  padding-top: 0.1rem;
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}

.plain-list,
.paired-list {
  margin: 0;
  padding: 1.2rem 0 0;
  list-style: none;
}

.plain-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0;
}

.plain-list li:not(:last-child)::after {
  content: "·";
  margin-inline: 0.65rem;
  color: var(--accent);
}

.paired-list {
  display: grid;
  gap: 0.7rem;
}

.paired-list li {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 1rem;
}

.paired-key {
  color: var(--text-soft);
  font-weight: 520;
}

.site-footer {
  flex: 0 0 auto;
  padding-block: 0.95rem 1.1rem;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  color: var(--text-faint);
  font-size: 0.84rem;
}

.footer-inner p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem 1rem;
}

.footer-links a {
  color: var(--text-faint);
  text-decoration: none;
}

.footer-links a::after {
  content: "↗";
  display: inline-block;
  margin-left: 0.2em;
  font-size: 0.82em;
  line-height: 1;
  transform: translateY(-0.08em);
}

.footer-links a:hover {
  color: var(--accent);
}

@media (max-width: 720px) {
  html {
    scrollbar-gutter: auto;
  }

  body {
    font-size: 17px;
  }

  .publication-authors,
  .publication-venue {
    font-size: 0.95em;
  }

  .header-inner {
    position: relative;
    min-height: 60px;
  }

  .site-brand {
    font-size: 0.92rem;
  }

  .js .nav-toggle {
    display: inline-grid;
  }

  .js .site-nav {
    position: absolute;
    top: calc(100% - 0.15rem);
    right: 0;
    left: auto;
    width: min(11rem, calc(100vw - 1.5rem));
    display: block;
    padding: 0.4rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: var(--surface);
    border: 0;
    border-radius: 7px;
    box-shadow: 0 12px 28px rgba(34, 60, 80, 0.12);
    transform: translateY(-0.45rem) scale(0.985);
    transform-origin: top right;
    will-change: opacity, transform;
    transition:
      opacity 190ms ease,
      transform 240ms cubic-bezier(0.16, 1, 0.3, 1),
      visibility 0s linear 240ms;
  }

  .js .site-nav[data-open="true"] {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    transition-delay: 0s;
  }

  .nav-links {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .nav-link {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    padding: 0.56rem 0.7rem;
    border-left: 2px solid transparent;
    border-radius: 0;
  }

  .nav-link::after {
    display: none;
  }

  .nav-link[aria-current="page"] {
    color: var(--accent);
    background: transparent;
    border-left-color: var(--accent);
    font-weight: 610;
  }

  .site-main {
    padding-block: 3.25rem 4.5rem;
  }

  .home-main {
    padding-top: 4rem;
  }

  .home-details {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .page-header {
    margin-bottom: 2.2rem;
  }

  .talk-item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
    padding: 1.25rem 0;
  }

  .cv-entry {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .cv-date {
    grid-row: 1;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.55rem;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .site-shell {
    width: min(calc(100% - 2rem), var(--content-width));
  }

  .site-brand .brand-comma {
    display: none;
  }

  .site-brand .brand-given {
    margin-left: 0.2em;
  }

  .hero-title {
    font-size: clamp(1.65rem, 7.875vw, 1.95rem);
  }

  .cv-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .primary-button {
    align-self: flex-start;
  }

  .paired-list li {
    grid-template-columns: 1fr;
    gap: 0.05rem;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
