:root,
html[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f4f6f4;
  --text: #050505;
  --muted: #555b57;
  --line: #050505;
  --soft-line: #d6dbd7;
  --neon: #00df0b;
  --laser: #00a8ff;
  --control-bg: #050505;
  --control-text: #39ff14;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --surface: #071007;
  --text: #39ff14;
  --muted: #79d970;
  --line: #39ff14;
  --soft-line: rgba(57, 255, 20, .32);
  --neon: #39ff14;
  --laser: #00d9ff;
  --control-bg: #050505;
  --control-text: #39ff14;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  transition: background-color .24s ease, color .24s ease;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--laser); outline-offset: 3px; }

.site-header {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #000000;
}

.home-header { height: clamp(440px, 68svh, 760px); min-height: 440px; }
.page-header { height: clamp(210px, 28svh, 300px); min-height: 210px; }

.header-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 50%;
  filter: saturate(1.08) contrast(1.06);
  transition: transform .28s ease, opacity .28s ease;
}

.header-image:hover { transform: scale(1.012); }

.home-header .header-image {
  object-fit: contain;
  object-position: center;
}

.page-header .header-image { object-position: center 44%; }

.identity {
  position: absolute;
  top: clamp(24px, 5vw, 64px);
  left: clamp(20px, 5vw, 72px);
  z-index: 2;
  margin: 0;
  padding: 14px 18px 16px;
  border: 1px solid #39ff14;
  border-bottom: 5px solid var(--laser);
  background: rgba(0, 0, 0, .9);
  color: #39ff14;
  font-size: clamp(30px, 5vw, 72px);
  font-weight: 850;
  line-height: .92;
  text-transform: uppercase;
}

.page-header .identity { font-size: clamp(28px, 4vw, 52px); }

.controls {
  position: absolute;
  top: clamp(20px, 4vw, 48px);
  right: clamp(20px, 4vw, 56px);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-switch {
  display: grid;
  grid-template-columns: repeat(3, 38px);
  height: 40px;
  border: 1px solid #39ff14;
  background: var(--control-bg);
}

.theme-option,
.language-toggle {
  display: grid;
  place-items: center;
  height: 38px;
  padding: 0;
  border: 0;
  background: var(--control-bg);
  color: var(--control-text);
  cursor: pointer;
}

.theme-option {
  width: 38px;
  border-right: 1px solid rgba(57, 255, 20, .35);
  font-size: 16px;
}

.theme-option:last-child { border-right: 0; }
.theme-option:hover,
.theme-option[aria-pressed="true"] { background: #39ff14; color: #000000; }

.language-toggle {
  min-width: 74px;
  padding: 0 12px;
  border: 1px solid #39ff14;
  font-size: 12px;
  font-weight: 800;
}

.language-toggle:hover { border-color: var(--laser); background: var(--laser); color: #000000; }

.global-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  min-height: 70px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.nav-link {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 70px;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  border-right: 1px solid var(--line);
  color: var(--text);
  font-size: clamp(11px, 1.1vw, 14px);
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
  transition: background-color .2s ease, color .2s ease, border-color .24s ease;
}

.nav-link:last-child { border-right: 0; }
.nav-link::after { content: ""; position: absolute; right: 28%; bottom: 16px; left: 28%; height: 2px; background: var(--laser); transform: scaleX(0); transform-origin: center; transition: transform .22s ease; }
.nav-link:hover { color: var(--laser); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link[aria-current="page"] { background: var(--neon); color: #000000; }
.nav-link[aria-current="page"]::after { background: #000000; transform: scaleX(1); }

.blank-canvas { min-height: max(560px, 72svh); background: var(--bg); }

.home-main { background: var(--bg); }

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(340px, 1.1fr);
  gap: clamp(48px, 8vw, 112px);
  align-items: end;
  min-height: 560px;
  padding-top: 92px;
  padding-bottom: 92px;
}

.hero-heading { min-width: 0; }
.hero-name { margin: 0; font-size: clamp(64px, 9vw, 128px); font-weight: 850; line-height: .86; text-wrap: balance; }
.hero-copy { padding-bottom: 5px; }
.hero-role { max-width: 690px; margin: 0; font-size: clamp(25px, 3.4vw, 46px); font-weight: 800; line-height: 1.08; text-wrap: balance; }
.hero-summary { max-width: 650px; margin: 24px 0 0; color: var(--muted); font-size: clamp(16px, 1.7vw, 20px); line-height: 1.7; }
.hero-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }

.home-section,
.projects-section {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 44px;
  padding-top: 72px;
  padding-bottom: 72px;
  border-top: 1px solid var(--line);
}

.home-section-title { max-width: 900px; margin: 0 0 34px; font-size: clamp(30px, 4vw, 52px); line-height: 1.06; text-wrap: balance; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); }
.card { min-height: 260px; padding: 26px; border-right: 1px solid var(--line); background: var(--bg); }
.card:last-child { border-right: 0; }
.card-index { display: block; margin-bottom: 58px; color: var(--laser); font-size: 11px; font-weight: 850; }
.card h3 { margin: 0 0 14px; font-size: clamp(20px, 2vw, 27px); line-height: 1.12; }
.card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }

.featured-project { min-width: 0; padding: 34px; border: 1px solid var(--line); box-shadow: 9px 9px 0 var(--laser); }
.project-status { margin: 0 0 44px; color: var(--laser); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.featured-project h2 { max-width: 850px; margin: 0 0 18px; font-size: clamp(34px, 5vw, 66px); line-height: 1; text-wrap: balance; }
.featured-project > p:not(.project-status) { max-width: 720px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.7; }

.notes-section {
  display: grid;
  grid-template-columns: minmax(0, .75fr) minmax(340px, 1.25fr);
  gap: 44px;
  align-items: end;
  padding-top: 72px;
  padding-bottom: 72px;
  border-top: 1px solid var(--line);
}
.notes-section h2 { margin: 14px 0 0; font-size: clamp(38px, 5vw, 70px); line-height: 1; }
.notes-link { display: flex; min-height: 86px; align-items: center; justify-content: space-between; gap: 24px; padding: 20px 24px; border: 1px solid var(--line); font-size: clamp(16px, 2vw, 22px); font-weight: 800; }
.notes-link:hover { background: var(--laser); color: #000000; }

.personal-hero { min-height: 500px; }

.about-summary,
.highlights-section {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 44px;
  padding-top: 72px;
  padding-bottom: 72px;
  border-top: 1px solid var(--line);
}

.about-copy { max-width: 900px; }
.about-copy h2 { margin: 0 0 30px; font-size: clamp(32px, 4vw, 54px); line-height: 1.05; text-wrap: balance; }
.about-copy p { max-width: 790px; margin: 0; color: var(--muted); font-size: clamp(16px, 1.7vw, 20px); line-height: 1.75; }
.about-copy p + p { margin-top: 15px; }

.highlight-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); }
.highlight-card { min-height: 285px; padding: 26px; border-right: 1px solid var(--line); background: var(--bg); }
.highlight-card:last-child { border-right: 0; }
.highlight-card h3 { margin: 0 0 18px; font-size: clamp(21px, 2vw, 28px); line-height: 1.12; }
.highlight-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.75; }

.resume-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); }
.resume-card { min-height: 330px; padding: clamp(26px, 4vw, 44px); border-right: 1px solid var(--line); }
.resume-card:last-child { border-right: 0; }
.resume-card h2 { margin: 0 0 16px; font-size: clamp(30px, 4vw, 50px); line-height: 1.04; }
.resume-card p { max-width: 500px; min-height: 54px; margin: 0 0 30px; color: var(--muted); line-height: 1.7; }

.contact-section { padding: 0 0 72px; }
.contact-section .contact-list { border: 1px solid var(--line); }
.contact-section .contact-row { grid-template-columns: 180px minmax(0, 1fr); padding: 26px; }
.contact-section .contact-row:last-child { border-bottom: 0; }
.contact-section dd { font-size: clamp(18px, 2vw, 25px); font-weight: 750; }

.profile-home { background: var(--bg); }

.intro-section {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(360px, 1.08fr);
  gap: clamp(54px, 9vw, 130px);
  align-items: end;
  min-height: 570px;
  padding-top: 104px;
  padding-bottom: 104px;
}

.profile-name { margin: 0; font-size: clamp(70px, 10vw, 138px); font-weight: 850; line-height: .86; text-wrap: balance; }
.intro-details { padding-bottom: 4px; }
.profile-degree { max-width: 700px; margin: 0; font-size: clamp(27px, 3.5vw, 48px); font-weight: 800; line-height: 1.08; text-wrap: balance; }
.profile-university { max-width: 670px; margin: 20px 0 0; color: var(--laser); font-size: clamp(16px, 1.8vw, 21px); font-weight: 750; line-height: 1.5; }
.profile-positioning { max-width: 670px; margin: 34px 0 0; color: var(--muted); font-size: clamp(16px, 1.6vw, 19px); line-height: 1.7; }

.profile-section {
  display: grid;
  grid-template-columns: minmax(180px, 250px) minmax(0, 820px);
  gap: clamp(44px, 8vw, 118px);
  justify-content: space-between;
  padding-top: 82px;
  padding-bottom: 82px;
  border-top: 1px solid var(--line);
}

.section-heading { align-self: start; }
.section-number { display: block; margin-bottom: 22px; color: var(--laser); font-size: clamp(16px, 1.4vw, 19px); font-weight: 850; }
.section-heading h2 { margin: 0; font-size: clamp(24px, 2.8vw, 38px); line-height: 1.08; text-wrap: balance; }
.profile-prose { max-width: 820px; }
.profile-prose p { margin: 0; color: var(--muted); font-size: clamp(16px, 1.45vw, 19px); line-height: 1.82; }
.profile-prose p + p { margin-top: 24px; }

.focus-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; max-width: 820px; margin: 0; padding: 0; border-top: 1px solid var(--line); list-style: none; }
.focus-list li { position: relative; min-height: 72px; padding: 23px 22px 20px 42px; border-bottom: 1px solid var(--line); color: var(--text); font-size: clamp(15px, 1.4vw, 18px); font-weight: 700; }
.focus-list li:nth-child(odd) { border-right: 1px solid var(--line); }
.focus-list li::before { content: "/"; position: absolute; left: 18px; color: var(--laser); font-weight: 850; }
.interests-section { background: var(--surface); }

body,
.global-nav,
.profile-section,
.intro-section,
.site-footer,
.resume-card,
.contact-section .contact-list {
  transition: background-color .24s ease, color .24s ease, border-color .24s ease;
}

@keyframes page-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes content-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes name-reveal { from { opacity: 0; transform: translateY(12px); letter-spacing: .025em; } to { opacity: 1; transform: translateY(0); letter-spacing: 0; } }

.site-header { animation: page-fade-in .5s ease-out both; }
.global-nav { animation: page-fade-in .5s .08s ease-out both; }
main > * { animation: content-rise .62s .14s ease-out both; }
main > *:nth-child(2) { animation-delay: .22s; }
main > *:nth-child(3) { animation-delay: .30s; }
main > *:nth-child(4) { animation-delay: .38s; }
main > *:nth-child(5) { animation-delay: .46s; }
.profile-name { animation: name-reveal .64s .18s ease-out both; }
.site-footer { animation: page-fade-in .55s .52s ease-out both; }

.page-shell { width: min(1180px, calc(100% - 64px)); margin: 0 auto; }
.page-intro { padding: 88px 0 72px; }
.eyebrow { margin: 0 0 18px; color: var(--laser); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.page-title { margin: 0; max-width: 960px; font-size: clamp(48px, 8vw, 96px); font-weight: 850; line-height: .96; text-wrap: balance; }
.lead { max-width: 800px; margin: 30px 0 0; color: var(--muted); font-size: clamp(17px, 2vw, 21px); line-height: 1.7; }

.content-section {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 44px;
  padding: 56px 0;
  border-top: 1px solid var(--line);
}

.section-label { margin: 0; color: var(--laser); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.section-label::before { content: "// "; color: var(--neon); }
.section-body { min-width: 0; }
.section-body h2 { margin: 0 0 22px; font-size: clamp(28px, 4vw, 48px); line-height: 1.08; text-wrap: balance; }
.section-body h3 { margin: 0 0 10px; font-size: 20px; }
.section-body p { max-width: 820px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.75; }
.section-body p + p { margin-top: 14px; }

.fact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); }
.fact { min-height: 148px; padding: 22px; border-right: 1px solid var(--line); }
.fact:last-child { border-right: 0; }
.fact strong { display: block; margin-bottom: 12px; color: var(--laser); font-size: 28px; }
.fact span { color: var(--muted); font-size: 14px; line-height: 1.55; }

.entry-list { border-top: 1px solid var(--line); }
.entry {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  padding: 25px 0;
  border-bottom: 1px solid var(--line);
}
.entry-meta { color: var(--laser); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.entry-content h3 { margin: 0 0 8px; }
.entry-content p { max-width: 720px; }
.entry-link { align-self: center; padding: 10px 12px; border: 1px solid var(--line); font-size: 12px; font-weight: 800; }
.entry-link:hover { background: var(--laser); color: #000000; }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.tag { padding: 8px 10px; border: 1px solid var(--line); color: var(--text); font-size: 12px; font-weight: 750; }

.action-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.action-link { display: inline-flex; min-height: 44px; align-items: center; padding: 0 16px; border: 1px solid var(--line); font-size: 13px; font-weight: 800; }
.action-link.primary { background: var(--text); color: var(--bg); }
.action-link:hover { background: var(--laser); color: #000000; }

.contact-list { border-top: 1px solid var(--line); }
.contact-row { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.contact-row dt { color: var(--laser); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.contact-row dd { margin: 0; overflow-wrap: anywhere; }
.contact-row a { text-decoration: underline; text-decoration-color: var(--laser); text-underline-offset: 4px; }

.note { padding: 20px; border-left: 5px solid var(--laser); background: var(--surface); color: var(--muted); line-height: 1.7; }

.site-footer {
  display: flex;
  width: min(1180px, calc(100% - 64px));
  min-height: 110px;
  margin: 72px auto 0;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.footer-brand { color: var(--text); font-weight: 850; text-transform: uppercase; }

[data-lang="zh"] { display: none; }
body.zh [data-lang="en"] { display: none; }
body.zh [data-lang="zh"] { display: revert; }
body.zh .identity[data-lang="zh"] { display: block; }

@media (max-width: 900px) {
  .page-shell, .site-footer { width: min(100% - 36px, 1180px); }
  .global-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .content-section { grid-template-columns: 1fr; gap: 18px; }
  .fact-grid { grid-template-columns: 1fr; }
  .fact { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .fact:last-child { border-bottom: 0; }
  .entry { grid-template-columns: 130px minmax(0, 1fr); }
  .entry-link { grid-column: 2; justify-self: start; }
}

@media (max-width: 620px) {
  .home-header { height: 58svh; min-height: 370px; }
  .page-header { min-height: 190px; }
  .identity { top: 20px; left: 16px; padding: 11px 13px 13px; font-size: clamp(30px, 10vw, 52px); }
  .controls { top: auto; right: 14px; bottom: 14px; }
  .page-intro { padding: 64px 0 52px; }
  .page-title { font-size: clamp(44px, 14vw, 72px); }
  .content-section { padding: 44px 0; }
  .entry { grid-template-columns: 1fr; gap: 10px; }
  .entry-link { grid-column: 1; }
  .contact-row { grid-template-columns: 1fr; gap: 8px; }
  .site-footer { min-height: 140px; flex-direction: column; align-items: flex-start; justify-content: center; }
}

@media (max-width: 900px) {
  .hero-section { grid-template-columns: 1fr; min-height: auto; padding-top: 72px; padding-bottom: 72px; }
  .home-section, .projects-section, .notes-section { grid-template-columns: 1fr; gap: 24px; }
  .about-summary, .highlights-section { grid-template-columns: 1fr; gap: 24px; }
  .card-grid { grid-template-columns: 1fr; }
  .card { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .card:last-child { border-bottom: 0; }
  .card-index { margin-bottom: 34px; }
  .highlight-grid, .resume-grid { grid-template-columns: 1fr; }
  .highlight-card, .resume-card { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .highlight-card:last-child, .resume-card:last-child { border-bottom: 0; }
  .intro-section { grid-template-columns: 1fr; gap: 48px; min-height: auto; padding-top: 80px; padding-bottom: 80px; }
  .profile-section { grid-template-columns: minmax(150px, 190px) minmax(0, 1fr); gap: 42px; }
}

@media (max-width: 620px) {
  .hero-name { font-size: clamp(58px, 20vw, 88px); }
  .hero-role { font-size: clamp(25px, 8vw, 36px); }
  .home-section, .projects-section, .notes-section { padding-top: 54px; padding-bottom: 54px; }
  .about-summary, .highlights-section { padding-top: 54px; padding-bottom: 54px; }
  .featured-project { padding: 26px 22px; box-shadow: 6px 6px 0 var(--laser); }
  .notes-link { min-height: 76px; padding: 18px; }
  .contact-section .contact-row { grid-template-columns: 1fr; gap: 8px; padding: 22px; }
  .intro-section { gap: 38px; padding-top: 64px; padding-bottom: 64px; }
  .profile-name { font-size: clamp(58px, 20vw, 88px); }
  .profile-degree { font-size: clamp(24px, 7.7vw, 34px); }
  .profile-section { grid-template-columns: 1fr; gap: 30px; padding-top: 56px; padding-bottom: 56px; }
  .focus-list { grid-template-columns: 1fr; }
  .focus-list li:nth-child(odd) { border-right: 0; }
  main > * { animation-name: page-fade-in; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transform: none !important; }
}
