:root {
  --bg: #f7fafc;
  --surface: #ffffff;
  --surface-soft: #eaf1f7;
  --ink: #14232c;
  --muted: #48545e;
  --line: #d8e4ec;
  --accent: #4f7f99;
  --accent-strong: #2f5d73;
  --gold: #b7791f;
  --shadow: 0 14px 36px rgba(20, 35, 44, 0.08);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 12px max(18px, calc((100% - 1240px) / 2));
  border-bottom: 1px solid rgba(216, 228, 236, 0.9);
  background: rgba(247, 250, 252, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-block;
  min-width: max-content;
  color: var(--muted);
  font-size: clamp(0.78rem, 2.6vw, 0.95rem);
  font-weight: 400;
  text-decoration: none;
  transform: translateX(4px);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.site-nav a {
  padding: clamp(4px, 1.4vw, 8px) clamp(5px, 2vw, 10px);
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: clamp(0.78rem, 2.6vw, 0.95rem);
  white-space: nowrap;
}

.site-nav a:hover {
  background: var(--surface-soft);
  color: var(--accent-strong);
}

main {
  width: 100%;
  scroll-margin-top: 96px;
}

.section-band {
  width: min(1240px, calc(100% - 36px));
  margin-inline: auto;
}

.section-band {
  margin-top: 28px;
  scroll-margin-top: 96px;
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.intro {
  display: grid;
  grid-template-columns: 285px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 56px);
  align-items: start;
}

.intro-main {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
}

.intro-copy {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0;
  max-width: 100%;
  padding-top: 6px;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  color: var(--accent-strong);
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.name-english {
  display: inline-block;
  transform: translateX(-0.07em);
}

.name-chinese {
  display: inline-block;
  color: var(--accent-strong);
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 650;
  transform: translateY(-0.13em);
}

h2 {
  margin: 0;
  color: var(--accent-strong);
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.15;
  letter-spacing: 0;
  transform: translateX(-0.04em);
}

h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: 0;
}

.role {
  width: 100%;
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 650;
  overflow-wrap: normal;
  word-break: normal;
}

.role-part {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: normal;
}

.role a {
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
}

.role a:hover {
  color: inherit;
  text-decoration: none;
}

.intro-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  max-width: 100%;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.intro-contact span {
  max-width: 100%;
}

.inline-icon {
  width: 1em;
  height: 1em;
  object-fit: contain;
  opacity: 0.64;
  vertical-align: -0.12em;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  max-width: 100%;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.link-row a {
  color: var(--accent-strong);
}

.link-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.28rem;
  white-space: nowrap;
}

.link-icon {
  width: 1em;
  height: 1em;
  object-fit: contain;
  flex: 0 0 auto;
  filter: grayscale(1);
  opacity: 0.64;
  transform: translateY(0.12em);
}

.link-icon--darker {
  opacity: 0.78;
}

.link-icon--github {
  opacity: 0.7;
}

.summary {
  max-width: 760px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  text-align: justify;
  text-align-last: left;
}

.summary-keyword {
  color: var(--accent-strong);
  font-weight: 700;
}

.publication-note,
.highlight-emphasis {
  color: var(--accent-strong);
  font-weight: 700;
}

.profile-panel {
  align-self: start;
  grid-column: 1;
  grid-row: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.profile-panel img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center 28%;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 24px;
}

.section-heading h2 + p,
.section-heading p + h2 {
  margin-top: 4px;
}

.background-layout,
.background-stack {
  display: grid;
}

.background-layout {
  gap: 14px;
}

.background-stack {
  gap: 21px;
}

.contact-section p {
  margin: 0;
  color: var(--muted);
}

.research-subsection {
  margin-top: 0;
}

.research-subsection + .research-subsection {
  margin-top: 24px;
}

.research-subsection .section-heading {
  margin-bottom: 18px;
}

.research-section > .section-heading {
  max-width: none;
}

.background-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.background-stack {
  align-content: start;
}

.background-card {
  padding: 0;
}

.background-honors {
  align-self: stretch;
}

.ordered-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 1.4rem;
}

.ordered-list li::marker {
  color: var(--accent);
  font-weight: 800;
}

.citation-list {
  list-style: none;
  counter-reset: citation-item;
  padding-left: 1.85rem;
  color: var(--muted);
}

.citation-list li {
  position: relative;
  counter-increment: citation-item;
  text-align: justify;
  text-align-last: left;
}

.citation-list li::before {
  content: counter(citation-item) ".";
  position: absolute;
  left: -1.85rem;
  width: 1.55rem;
  color: var(--muted);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.citation-title {
  color: var(--accent-strong);
}

.citation-title a {
  color: inherit;
  text-decoration: none;
}

.citation-title a:hover {
  text-decoration: underline;
}

.author-self {
  color: inherit;
  font-weight: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.citation-list em {
  color: inherit;
}

.equal-contribution {
  white-space: nowrap;
}

.citation-list a {
  color: inherit;
  overflow-wrap: anywhere;
}

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

.research-section .plain-list li {
  text-align: justify;
  text-align-last: left;
}

.plain-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
}

.honor-list li {
  display: list-item;
}

.honor-year {
  display: inline-block;
  min-width: 3.2rem;
  color: inherit;
  font-weight: 400;
}

.experience-list li {
  display: list-item;
}

.experience-row {
  display: grid;
  grid-template-columns: 16ch minmax(0, 1fr);
  column-gap: 0.65rem;
  align-items: baseline;
}

.experience-list .date-range {
  display: inline-block;
  white-space: nowrap;
}

.contact-section {
  margin-bottom: 28px;
}

.contact-copy {
  display: grid;
  gap: 14px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(1240px, calc(100% - 36px));
  margin: 0 auto;
  padding: 24px 0 36px;
  color: var(--muted);
  font-size: clamp(0.76rem, 2.5vw, 0.92rem);
}

.footer-brand {
  transform: translateX(4px);
}

.footer-updated {
  transform: translateX(-4px);
}

@media (max-width: 980px) {
  .intro {
    grid-template-columns: 1fr;
  }

  .intro-main,
  .intro-copy,
  .profile-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .intro-main {
    display: contents;
  }

  .intro-copy {
    order: 1;
  }

  .profile-panel {
    order: 2;
  }

  .profile-panel {
    width: min(360px, 100%);
  }

  .background-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 660px) {
  .site-header {
    position: static;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-height: auto;
    padding-block: 10px;
    padding-inline: 12px;
  }

  .brand {
    display: none;
  }

  .site-nav {
    justify-content: center;
    width: 100%;
  }

  .section-band,
  .site-footer {
    width: min(100% - 24px, 1240px);
  }

  .section-band {
    scroll-margin-top: 16px;
    padding: 20px;
  }

  main {
    scroll-margin-top: 16px;
  }

  .background-layout {
    grid-template-columns: 1fr;
  }

  .intro-copy {
    order: 2;
  }

  .profile-panel {
    order: 1;
    width: 100%;
  }

  .profile-panel img {
    max-height: 520px;
  }

  .site-footer {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
  }

  .footer-brand,
  .footer-updated {
    transform: none;
  }
}
