:root {
  --ink: #202124;
  --muted: #656b70;
  --line: #d9ded8;
  --paper: #fbfaf6;
  --panel: #fffdf9;
  --soft: #eef2ed;
  --accent: #276b5f;
  --accent-dark: #164a42;
  --gold: #b9862d;
  --shadow: 0 24px 70px rgba(31, 38, 34, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Noto Sans TC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(20px, 5vw, 72px);
  background: rgba(251, 250, 246, 0.94);
  border-bottom: 1px solid rgba(217, 222, 216, 0.9);
  backdrop-filter: blur(16px);
}

.site-header.is-scrolled {
  box-shadow: 0 12px 30px rgba(31, 38, 34, 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.brand-mark {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  background: var(--accent-dark);
  border-radius: 50%;
  font-family: "Source Serif 4", Georgia, serif;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
  color: var(--muted);
  font-size: 0.95rem;
}

.nav a {
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}

.nav a:hover,
.nav a:focus-visible,
.nav a[aria-current="page"] {
  color: var(--accent-dark);
  border-color: var(--gold);
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  align-items: start;
  gap: clamp(28px, 5vw, 78px);
  padding: clamp(34px, 5vw, 64px) clamp(20px, 5vw, 72px) 42px;
}

.home-hero-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  line-height: 1.12;
}

h1 {
  font-size: clamp(2.8rem, 5.6vw, 5.4rem);
}

h2 {
  font-size: clamp(1.55rem, 2.4vw, 2.15rem);
}

p {
  margin: 0;
}

.hero-lede {
  max-width: 610px;
  margin-top: 16px;
  color: var(--muted);
  font-size: clamp(1.04rem, 1.4vw, 1.18rem);
}

.hero-role {
  margin-top: 18px;
  color: var(--accent-dark);
  font-weight: 700;
}

.hero-contact {
  margin-top: 14px;
  color: var(--accent-dark);
  font-weight: 700;
}

.hero-contact a {
  text-decoration: underline;
  text-decoration-color: rgba(39, 107, 95, 0.28);
  text-underline-offset: 4px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 18px;
  border: 1px solid var(--accent-dark);
  border-radius: 6px;
  font-weight: 700;
}

.button.primary {
  color: #fff;
  background: var(--accent-dark);
}

.button.secondary {
  color: var(--accent-dark);
  background: transparent;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.home-hero-media {
  margin: 0;
}

.home-hero-media img {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.home-paths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.path-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 220px;
  padding: clamp(26px, 4vw, 46px);
  background: var(--panel);
  border-right: 1px solid var(--line);
}

.path-card:last-child {
  border-right: 0;
}

.path-card span {
  color: var(--gold);
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 700;
}

.path-card p {
  color: var(--muted);
}

.path-card:hover,
.path-card:focus-visible {
  background: var(--soft);
}

.page-main {
  padding: clamp(52px, 7vw, 90px) clamp(20px, 5vw, 72px) clamp(70px, 9vw, 120px);
}

.page-intro {
  max-width: 860px;
  margin-bottom: clamp(38px, 6vw, 72px);
}

.page-intro h1 {
  font-size: clamp(3.2rem, 7vw, 6.4rem);
}

.page-intro p {
  max-width: 720px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.08rem;
}

.content-list {
  display: grid;
  gap: 1px;
  max-width: 980px;
  border: 1px solid var(--line);
  background: var(--line);
}

.content-list article {
  display: grid;
  grid-template-columns: minmax(180px, 0.38fr) minmax(0, 0.62fr);
  gap: 24px;
  padding: clamp(24px, 4vw, 38px);
  background: var(--panel);
}

.content-list p {
  color: var(--muted);
}

.course-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 980px;
}

.course-item {
  padding: clamp(22px, 4vw, 34px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.course-item h2,
.course-item h3 {
  margin: 0;
  font-family: "Noto Sans TC", system-ui, sans-serif;
  font-size: clamp(1.2rem, 2vw, 1.45rem);
}

.course-item p {
  margin-top: 8px;
  color: var(--muted);
}

.teaching-note {
  max-width: 980px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.875rem;
}

.research-section {
  max-width: 1040px;
  margin-top: clamp(46px, 7vw, 82px);
}

.research-section:first-of-type {
  margin-top: 0;
}

.research-section > h2 {
  margin-bottom: 18px;
}

.publication-list {
  display: grid;
  gap: 14px;
}

.publication-item,
.grant-item {
  padding: clamp(22px, 4vw, 34px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.publication-item h3,
.grant-item h3 {
  margin: 0;
  font-size: clamp(1.12rem, 2vw, 1.35rem);
  line-height: 1.35;
}

.publication-item h3 a {
  color: var(--accent-dark);
  text-decoration: underline;
  text-decoration-color: rgba(39, 107, 95, 0.3);
  text-underline-offset: 4px;
}

.pub-meta {
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pub-authors,
.pub-venue,
.pub-translation {
  margin-top: 8px;
  color: var(--muted);
}

.pub-translation {
  font-style: italic;
}

.section-note {
  max-width: 760px;
  margin: -6px 0 20px;
  color: var(--muted);
}

.section-note a {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(39, 107, 95, 0.28);
  text-underline-offset: 4px;
}

.grant-list {
  display: grid;
  gap: 12px;
}

details {
  margin-top: 16px;
  color: var(--muted);
}

summary {
  width: max-content;
  cursor: pointer;
  color: var(--accent-dark);
  font-weight: 700;
}

details p {
  max-width: 850px;
  margin-top: 10px;
}

.lab-preview {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 1.15fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  max-width: 1180px;
  padding: clamp(28px, 5vw, 48px);
  color: #f7f3ea;
  background: #183f3a;
  border-radius: 8px;
}

.lab-preview p {
  margin-top: 14px;
  color: rgba(247, 243, 234, 0.78);
}

.lab-panel {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: #0f2e2a;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.panel-bar {
  display: flex;
  gap: 7px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.panel-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e5bd66;
}

.panel-bar span:nth-child(2) {
  background: #d98072;
}

.panel-bar span:nth-child(3) {
  background: #86b7a9;
}

.lab-panel ol {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 16px;
  list-style-position: inside;
}

.lab-panel li {
  padding: 12px 14px;
  color: rgba(247, 243, 234, 0.8);
  background: rgba(255, 255, 255, 0.045);
  border-radius: 6px;
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
}

.footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 36px clamp(20px, 5vw, 72px);
  color: var(--muted);
  background: var(--panel);
  border-top: 1px solid var(--line);
}

.footer p {
  margin-top: 6px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links a,
.footer-links span {
  color: var(--accent-dark);
  font-weight: 700;
}

@media (max-width: 920px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    flex-wrap: wrap;
  }

  .home-hero,
  .lab-preview {
    grid-template-columns: 1fr;
  }

  .home-hero {
    min-height: auto;
  }

  .home-hero-media {
    order: -1;
  }

  .home-paths {
    grid-template-columns: 1fr;
  }

  .path-card {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .path-card:last-child {
    border-bottom: 0;
  }

  .content-list article {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .course-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .brand {
    width: 100%;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
    gap: 8px 14px;
    font-size: 0.88rem;
  }

  h1,
  .page-intro h1 {
    font-size: 2.6rem;
  }

  .hero-actions,
  .footer,
  .footer-links {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .lab-panel li {
    font-size: 0.78rem;
    overflow-wrap: anywhere;
  }
}
