:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-strong: #f0f3f8;
  --text: #18202f;
  --muted: #5f6b7a;
  --line: #d9dee8;
  --accent: #c73646;
  --accent-2: #007d8a;
  --accent-3: #244b8f;
  --shadow: 0 22px 70px rgba(24, 32, 47, 0.11);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11141a;
  --surface: #191f29;
  --surface-strong: #202836;
  --text: #edf1f7;
  --muted: #a5afbf;
  --line: #323b49;
  --accent: #ff6a7a;
  --accent-2: #3dc2cf;
  --accent-3: #86a8ff;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 6vw;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(20px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 760;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-size: 14px;
}

.nav a {
  text-decoration: none;
}

.nav a:hover,
.nav a.active {
  color: var(--text);
}

.theme-toggle,
.button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.theme-toggle {
  padding: 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  width: min(1120px, 88vw);
  min-height: calc(100svh - 72px);
  margin: 0 auto;
  padding: 64px 0 80px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(3.8rem, 8vw, 7.8rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.name-cn {
  margin: 18px 0 0;
  color: var(--accent);
  font-size: 1.25rem;
  font-weight: 800;
}

.lead {
  max-width: 760px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 2vw, 1.28rem);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 116px;
  padding: 0 18px;
  text-decoration: none;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.profile-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.avatar {
  display: block;
  width: 176px;
  height: 176px;
  margin: 30px auto 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-strong);
  object-fit: cover;
}

.profile-meta {
  padding: 0 28px 24px;
  text-align: center;
}

.profile-meta p {
  margin: 0;
}

.meta-label {
  color: var(--accent-3);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
}

.profile-grid div {
  min-height: 104px;
  padding: 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.profile-grid div:nth-child(2n) {
  border-right: 0;
}

.profile-grid div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.profile-grid span,
.contact-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-grid strong,
.contact-grid strong {
  display: block;
  margin-top: 6px;
  line-height: 1.35;
}

.section {
  width: min(1120px, 88vw);
  margin: 0 auto;
  padding: 82px 0;
}

.intro-strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: clamp(1.25rem, 3vw, 2rem);
  line-height: 1.35;
}

.intro-strip p {
  max-width: 1040px;
  margin: 0;
}

.section-heading {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 30px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
  letter-spacing: 0;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.project,
.timeline-item,
.education-card,
.contact-grid a {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.project {
  display: flex;
  min-height: 330px;
  flex-direction: column;
  padding: 24px;
}

.project.featured {
  border-top: 4px solid var(--accent);
}

.project-topline,
.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.project h3,
.timeline-item h3,
.education-card h3 {
  margin: 22px 0 8px;
  font-size: 1.24rem;
  line-height: 1.2;
}

.project p,
.timeline-item p,
.education-card p {
  margin: 0;
  color: var(--muted);
}

.project a {
  margin-top: auto;
  color: var(--accent-3);
  font-weight: 800;
}

.link-row {
  margin-top: auto;
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline-item,
.education-card {
  padding: 24px;
}

.date {
  display: inline-block;
  color: var(--accent);
  font-size: 13px;
  font-weight: 820;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.education-card {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.education-card h3 {
  margin-top: 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.contact-grid a {
  padding: 24px;
  text-decoration: none;
}

.contact-grid a:hover,
.project:hover,
.timeline-item:hover,
.education-card:hover {
  border-color: color-mix(in srgb, var(--accent-2) 55%, var(--line));
}

.site-footer {
  width: min(1120px, 88vw);
  margin: 0 auto;
  padding: 32px 0 46px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 920px) {
  .site-header {
    gap: 16px;
  }

  .nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 56px;
  }

  .profile-panel {
    max-width: 430px;
  }

  .section-heading {
    grid-template-columns: 1fr;
    gap: 8px;
  }

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

@media (max-width: 620px) {
  .site-header {
    min-height: 64px;
    padding: 0 20px;
  }

  .brand span:last-child {
    display: none;
  }

  .hero,
  .section,
  .site-footer {
    width: min(100% - 40px, 1120px);
  }

  h1 {
    font-size: clamp(3.1rem, 17vw, 5.2rem);
  }

  .profile-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .profile-grid div,
  .profile-grid div:nth-child(2n),
  .profile-grid div:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .profile-grid div:last-child {
    border-bottom: 0;
  }

  .education-card {
    flex-direction: column;
  }
}
