:root {
  color-scheme: light;
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-alt: #f4f4f5;
  --ink: #09090b;
  --muted: #71717a;
  --line: #e4e4e7;
  --accent: #09090b;
  --accent-2: #0f766e;
  --dark: #0d1715;
  --dark-line: #21423c;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html[data-current-language="zh"] {
  font-size: 17px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  min-height: 72px;
  padding: 0 max(24px, calc((100vw - 1380px) / 2 + 24px));
  border-bottom: 1px solid rgba(228, 228, 231, 0.72);
  background: rgba(250, 250, 250, 0.86);
  backdrop-filter: blur(16px);
}

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

.brand-mark {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-size: 0.72rem;
  font-weight: 900;
}

.nav-links {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.nav-links a,
.language-toggle,
.button,
.text-link {
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
}

.nav-links a {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 1rem;
}

.nav-links a:hover {
  color: var(--ink);
  background: var(--surface-alt);
}

.language-toggle {
  min-width: 64px;
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
  min-height: 76vh;
  padding: clamp(64px, 9vw, 112px) clamp(20px, 5vw, 72px) 64px;
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  max-width: 880px;
}

.personal-hero h1 {
  font-size: clamp(4.4rem, 10vw, 8rem);
  line-height: 0.88;
}

.eyebrow,
.date {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 880px;
  margin-bottom: 22px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.7rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.3rem;
  line-height: 1.22;
}

p {
  color: var(--muted);
  line-height: 1.62;
}

.lead {
  max-width: 760px;
  font-size: clamp(1.08rem, 1.8vw, 1.34rem);
}

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

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--line);
  background: var(--surface);
}

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

.button.quiet {
  color: var(--accent);
}

.signal-board {
  display: grid;
  gap: 12px;
}

.signal-board div {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.signal-board span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.signal-board strong {
  font-size: 1rem;
  line-height: 1.35;
}

.profile-card {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.profile-mark {
  display: grid;
  min-height: 260px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(15, 118, 110, 0.88), rgba(17, 24, 39, 0.9)),
    repeating-linear-gradient(135deg, transparent 0, transparent 18px, rgba(255, 255, 255, 0.14) 20px);
  color: white;
  font-size: clamp(4rem, 10vw, 7rem);
  font-weight: 950;
  line-height: 1;
}

.profile-lines {
  display: grid;
  gap: 12px;
}

.profile-lines div {
  display: grid;
  gap: 6px;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
}

.profile-lines div:first-child {
  padding-top: 0;
  border-top: 0;
}

.profile-lines span,
.quick-card span,
.project-meta span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-lines strong {
  font-size: 1rem;
  line-height: 1.35;
}

.home-main {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

.home-main .reference-hero {
  grid-template-columns: 420px minmax(0, 1fr);
  gap: clamp(56px, 7vw, 112px);
  align-items: start;
  min-height: auto;
  padding: 72px 0 82px;
  border-bottom: 0;
}

.reference-hero .hero-copy {
  max-width: 700px;
}

.reference-hero h1 {
  font-size: clamp(2.2rem, 3.4vw, 3rem);
  line-height: 1.08;
}

.reference-hero .lead {
  max-width: 700px;
  font-size: 1.16rem;
}

.reference-hero .hero-copy p {
  color: var(--ink);
}

.profile-school-link,
.institution-line a {
  color: inherit;
  text-decoration: none;
}

.about-school-link,
.about-unit {
  color: #0f6fb8;
  text-decoration: none;
}

.about-school-link:hover,
.about-unit:hover,
.profile-school-link:hover,
.institution-line a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.reference-hero p:not(.lead) {
  max-width: 700px;
  font-size: 1.16rem;
}

.portrait-card {
  display: grid;
  gap: 18px;
  max-width: 420px;
  text-align: center;
}

.portrait-placeholder {
  display: grid;
  min-height: 400px;
  place-items: center;
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 24%, rgba(15, 118, 110, 0.28), transparent 36%),
    linear-gradient(180deg, #f7f7f7 0%, #e9eeec 50%, #dfe7e4 100%);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4.5rem, 9vw, 7rem);
  font-weight: 700;
  box-shadow: 0 18px 40px rgba(9, 9, 11, 0.14);
}

.portrait-photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 24px;
  object-fit: cover;
  object-position: center center;
  box-shadow: 0 18px 40px rgba(9, 9, 11, 0.14);
}

.portrait-meta {
  display: grid;
  gap: 8px;
  padding: 4px 2px 0;
}

.portrait-meta strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.15rem;
  line-height: 1.05;
}

.portrait-meta span {
  color: #0f6fb8;
  font-size: 1.25rem;
  font-weight: 800;
}

.profile-icons {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 14px 0 0;
}

.profile-icons a {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #4b5563;
  text-decoration: none;
}

.profile-icons svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.profile-icons a:hover {
  color: var(--ink);
}

.portrait-meta p {
  margin-bottom: 0;
  color: #4b5563;
  font-size: 1.1rem;
  line-height: 1.35;
}

.work-type {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.profile-stack {
  display: grid;
  gap: 40px;
}

.content-section {
  padding: 60px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 104px;
}

.content-section:first-of-type {
  border-top: 0;
}

.experience-section + .project-section {
  border-top: 0;
}

.content-section > h2,
.content-section .section-heading {
  margin-bottom: 24px;
}

.content-section .section-heading p {
  max-width: 680px;
  margin-top: 12px;
}

.work-list {
  display: grid;
  gap: 0;
}

.work-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: start;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.work-item:first-child {
  border-top: 0;
}

.work-item h3 {
  margin-bottom: 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
}

.work-item h3 a {
  text-decoration: none;
  text-underline-offset: 5px;
  text-decoration-thickness: 2px;
}

.work-item h3 a:hover,
.work-item h3 a:focus-visible {
  text-decoration: underline;
}

.work-copy {
  max-width: 1040px;
}

.work-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
  min-width: 150px;
}

.work-actions .text-link {
  display: inline-grid;
  width: 150px;
  min-height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: center;
  text-decoration: none;
}

.work-actions .text-link:hover,
.work-actions .text-link:focus-visible {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.work-tags span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.two-column-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 6vw, 80px);
}

.two-column-section h2 {
  margin-bottom: 18px;
}

.experience-section {
  display: grid;
  gap: 52px;
}

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

.resume-list {
  display: grid;
  gap: 0;
}

.resume-item {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  padding: 30px 0;
  border-top: 1px solid var(--line);
}

.resume-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.resume-meta {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 12px;
}

.date-pill {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 0 12px;
  border-radius: 6px;
  background: var(--ink);
  color: white;
  font-size: 1rem;
  font-weight: 900;
}

.location-line {
  position: relative;
  color: var(--ink);
  font-size: 1.04rem;
  line-height: 1.35;
}

.location-line::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 10px;
  border: 3px solid #4b5563;
  border-radius: 999px;
  vertical-align: 1px;
}

.resume-body {
  display: grid;
  gap: 12px;
}

.resume-body h3 {
  margin-bottom: 0;
  font-size: 1.45rem;
  line-height: 1.2;
}

.institution-line {
  margin-bottom: 0;
  color: #0f6fb8;
  font-size: 1.25rem;
  line-height: 1.35;
}

.detail-list {
  display: grid;
  gap: 8px;
  margin: 2px 0 0;
  padding-left: 1.35em;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.55;
  list-style: circle;
}

.contact-list {
  display: grid;
  gap: 10px;
}

.contact-list a {
  display: flex;
  min-height: 54px;
  align-items: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.section {
  padding: 72px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 92px;
}

.split {
  display: grid;
  grid-template-columns: minmax(240px, 0.78fr) minmax(0, 1.22fr);
  gap: clamp(28px, 6vw, 88px);
}

.section-body {
  max-width: 780px;
}

.section-body p {
  font-size: 1.05rem;
}

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

.compact-heading {
  max-width: 820px;
}

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

.quick-card {
  display: grid;
  gap: 12px;
  min-height: 230px;
  align-content: start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.quick-card h3 {
  max-width: 340px;
  font-size: 1.55rem;
}

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

.project-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.project-visual {
  min-height: 310px;
  padding: 22px;
}

.console-preview {
  display: grid;
  gap: 18px;
  background:
    linear-gradient(rgba(13, 23, 21, 0.92), rgba(13, 23, 21, 0.96)),
    repeating-linear-gradient(90deg, transparent 0, transparent 92px, rgba(52, 211, 153, 0.11) 94px),
    repeating-linear-gradient(0deg, transparent 0, transparent 64px, rgba(52, 211, 153, 0.08) 66px);
  color: #e6f4ee;
}

.console-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #50e3c2;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
}

.console-topline b {
  padding: 6px 8px;
  border: 1px solid #2fb982;
  border-radius: 8px;
  color: #80f2b1;
}

.console-title {
  max-width: 420px;
  font-size: clamp(2.3rem, 5.8vw, 4.4rem);
  font-weight: 950;
  line-height: 0.92;
}

.mini-table {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border: 1px solid var(--dark-line);
}

.mini-table span,
.mini-table strong {
  padding: 10px;
  border-bottom: 1px solid var(--dark-line);
}

.mini-table span:nth-last-child(-n + 2),
.mini-table strong:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.mini-table strong {
  border-left: 1px solid var(--dark-line);
  color: #f3d375;
}

.comparison-preview {
  display: grid;
  align-content: space-between;
  gap: 18px;
  background: linear-gradient(135deg, #fbf7ef, #e7f3f1);
}

.prompt-line {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-weight: 800;
}

.comparison-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.comparison-cols div {
  min-height: 142px;
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.comparison-cols span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.comparison-cols strong {
  font-size: 1.8rem;
}

.metric-strip {
  padding: 14px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-weight: 900;
}

.project-copy {
  display: grid;
  align-content: space-between;
  gap: 18px;
  padding: 24px;
}

.text-link {
  width: fit-content;
  color: var(--ink);
  font-weight: 800;
  text-underline-offset: 4px;
}

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

.timeline article,
.compact-list article {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.timeline article:first-child,
.compact-list article:first-child {
  padding-top: 0;
  border-top: 0;
}

.education-skills {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 6vw, 88px);
}

.skills-rows {
  display: grid;
  margin-top: 22px;
}

.skills-section {
  border-top: 0;
}

.skills-section .skills-rows,
.skills-section .skill-row {
  border: 0;
}

.skill-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 28px;
  padding: 18px 0;
}

.skill-row strong {
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.5;
}

.skill-row p {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.5;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 26px clamp(20px, 5vw, 72px);
}

.site-footer a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.project-page {
  padding: 64px clamp(20px, 5vw, 72px);
}

.project-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(300px, 1.05fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
  min-height: 68vh;
  padding-bottom: 56px;
}

.project-hero h1 {
  font-size: clamp(2.8rem, 6vw, 5.2rem);
}

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

.project-meta div,
.detail-block,
.workflow-step,
.demo-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.project-meta div {
  display: grid;
  gap: 8px;
  min-height: 118px;
  align-content: center;
  padding: 16px;
}

.project-meta span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

.detail-block {
  padding: 24px;
}

.detail-block ul {
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.workflow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.workflow-step {
  min-height: 150px;
  padding: 18px;
}

.workflow-step span {
  color: var(--accent);
  font-weight: 900;
}

.demo-shell {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 0;
  overflow: hidden;
}

.demo-panel {
  padding: 22px;
  border-right: 1px solid var(--line);
}

.demo-panel:last-child {
  border-right: 0;
}

.demo-input,
.demo-output {
  min-height: 190px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9f7f1;
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  line-height: 1.55;
  white-space: pre-wrap;
}

.life-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(260px, 0.55fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: start;
  min-height: 70vh;
  padding: 72px clamp(20px, 5vw, 72px);
}

.life-note {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.life-preview,
.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(28px, 6vw, 88px);
  align-items: start;
}

.personal-note {
  display: grid;
  gap: 18px;
  max-width: 780px;
}

.personal-note p {
  font-size: 1.08rem;
}

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

.contact-panel a {
  display: flex;
  min-height: 96px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
  font-weight: 900;
  text-decoration: none;
}

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

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .language-toggle {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .nav-links {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .hero,
  .split,
  .project-grid,
  .education-skills,
  .project-hero,
  .detail-grid,
  .demo-shell,
  .life-layout,
  .home-map,
  .life-preview,
  .contact-section,
  .home-main .reference-hero,
  .two-column-section,
  .resume-item,
  .skill-row,
  .work-item {
    grid-template-columns: 1fr;
  }

  .resume-item {
    gap: 18px;
  }

  .home-main .reference-hero {
    min-height: auto;
    padding-top: 40px;
  }

  .portrait-card {
    max-width: 460px;
  }

  .workflow,
  .project-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .demo-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .demo-panel:last-child {
    border-bottom: 0;
  }
}

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

  .nav-links a {
    padding-inline: 8px;
  }

  .nav-links {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  h1 {
    font-size: clamp(2.35rem, 13vw, 3.6rem);
  }

  .personal-hero h1 {
    font-size: clamp(4.2rem, 21vw, 5.8rem);
  }

  .hero {
    min-height: auto;
    padding-top: 48px;
  }

  .workflow,
  .project-meta,
  .comparison-cols,
  .contact-panel {
    grid-template-columns: 1fr;
  }

  .portrait-placeholder {
    min-height: 300px;
  }

  .project-card {
    min-height: auto;
  }
}
