:root {
  --bg: #f4f4ef;
  --surface: #ffffff;
  --ink: #171a1b;
  --muted: #686d6c;
  --line: #cbd0cb;
  --dark: #131a1c;
  --cyan: #25c2d1;
  --green: #c8f05a;
  --coral: #ff755f;
  --yellow: #f3c94c;
  --shadow: 0 18px 50px rgba(20, 26, 28, 0.09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  line-height: 1.6;
  letter-spacing: 0;
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg { width: 1.1em; height: 1.1em; stroke-width: 1.8; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 10px 14px;
  background: var(--surface);
  transform: translateY(-140%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 76px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 clamp(24px, 4vw, 72px);
  color: #f5f7f4;
  transition: background .25s ease, color .25s ease, box-shadow .25s ease;
}
.site-header.scrolled {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--line);
  backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; width: fit-content; font-weight: 700; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  aspect-ratio: 1;
  color: #121819;
  background: var(--green);
  font-size: 12px;
  font-weight: 900;
}
.desktop-nav { display: flex; gap: 34px; font-size: 14px; }
.desktop-nav a { position: relative; opacity: .72; }
.desktop-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -8px;
  height: 2px;
  background: var(--cyan);
  transition: right .2s ease;
}
.desktop-nav a:hover, .desktop-nav a.active { opacity: 1; }
.desktop-nav a:hover::after, .desktop-nav a.active::after { right: 0; }
.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid currentColor;
  color: inherit;
  background: transparent;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.icon-button:hover { transform: translateY(-2px); background: var(--cyan); color: #101617; }
.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  color: var(--bg);
  background: var(--ink);
  cursor: pointer;
  font-weight: 700;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.button:hover { transform: translateY(-2px); box-shadow: 5px 5px 0 var(--cyan); }
.button-small { min-height: 40px; padding: 0 15px; border-color: var(--green); color: #101617; background: var(--green); font-size: 13px; }
.text-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-bottom: 1px solid currentColor;
  padding: 8px 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.hero {
  min-height: min(860px, 100svh);
  padding: 132px clamp(24px, 6vw, 108px) 0;
  overflow: hidden;
  color: #f3f5f1;
  background: var(--dark);
}
.hero-grid {
  width: min(1240px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(330px, .75fr);
  gap: clamp(48px, 8vw, 120px);
  align-items: end;
}
.hero-copy { padding-bottom: 52px; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: #cad0cd; font-size: 14px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(200, 240, 90, .12); }
.hero h1 { margin: 28px 0 0; font-size: clamp(84px, 10vw, 156px); line-height: .92; font-weight: 800; }
.hero-role { margin: 16px 0 0; color: var(--cyan); font-size: clamp(24px, 3vw, 42px); font-weight: 700; }
.hero-intro { max-width: 620px; margin: 22px 0 0; color: #b8c0bd; font-size: clamp(16px, 1.5vw, 20px); }
.hero-actions { display: flex; align-items: center; gap: 24px; margin-top: 34px; }
.hero .button { color: #101617; background: var(--green); border-color: var(--green); }
.hero-facts { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 630px; margin: 52px 0 0; border-top: 1px solid #3c4545; }
.hero-facts div { padding: 18px 10px 0 0; }
.hero-facts dt { color: #7f8b88; font-size: 12px; }
.hero-facts dd { margin: 4px 0 0; font-size: 14px; }
.hero-visual { position: relative; align-self: stretch; display: flex; align-items: end; }
.portrait-frame { position: relative; width: min(420px, 100%); margin-left: auto; }
.portrait-frame::before {
  content: "";
  position: absolute;
  inset: -18px 18px 18px -18px;
  border: 1px solid #4b5654;
  z-index: 0;
}
.portrait-frame img { position: relative; width: 100%; height: min(620px, 68vh); object-fit: cover; object-position: center 18%; filter: saturate(.78) contrast(1.03); }
.portrait-index { position: absolute; right: 0; top: 0; z-index: 2; padding: 9px 12px; color: #111819; background: var(--cyan); font: 700 11px ui-monospace, monospace; }
.hero-signal { position: absolute; left: -48px; bottom: 34px; width: 154px; padding: 16px; color: #141a1b; background: var(--green); box-shadow: var(--shadow); }
.hero-signal span { display: block; font: 700 10px ui-monospace, monospace; opacity: .65; }
.hero-signal strong { display: block; margin: 3px 0 14px; font: 800 26px ui-monospace, monospace; }
.hero-ticker {
  width: calc(100% + 216px);
  margin-left: -108px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 30px;
  color: #101617;
  background: var(--cyan);
  font: 800 13px ui-monospace, monospace;
}
.hero-ticker span::before { content: "+"; margin-right: 30px; }

.section { padding: clamp(88px, 10vw, 150px) clamp(24px, 6vw, 108px); }
.section-heading, .about-layout, .project-list, .contact-inner, .journey .timeline { width: min(1240px, 100%); margin-inline: auto; }
.section-index { margin: 0 0 22px; color: var(--muted); font: 700 12px ui-monospace, monospace; text-transform: uppercase; }
.section-index.light { color: #8e9996; }
.section h2, .contact h2 { margin: 0; font-size: clamp(38px, 5vw, 72px); line-height: 1.12; }
.section-heading.horizontal { display: flex; align-items: end; justify-content: space-between; gap: 30px; }

.about { background: var(--surface); }
.about-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(50px, 9vw, 130px); margin-top: 72px; }
.about-copy p { margin: 0 0 24px; color: #424746; font-size: 18px; }
.skill-groups { border-top: 1px solid var(--line); }
.skill-group { display: grid; grid-template-columns: 48px 1fr; gap: 22px; padding: 25px 0; border-bottom: 1px solid var(--line); }
.skill-icon { width: 44px; height: 44px; display: grid; place-items: center; color: #0c1718; background: var(--cyan); }
.skill-icon.accent-green { background: var(--green); }
.skill-icon.accent-coral { background: var(--coral); }
.skill-icon.accent-yellow { background: var(--yellow); }
.skill-group h3 { margin: 0 0 4px; font-size: 17px; }
.skill-group p { margin: 0; color: var(--muted); font-size: 14px; }

.projects { background: var(--bg); }
.project-filters { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.filter-button { padding: 9px 14px; border: 1px solid var(--line); color: var(--muted); background: transparent; cursor: pointer; }
.filter-button:hover, .filter-button.active { color: #121819; background: var(--green); border-color: var(--green); }
.project-list { margin-top: 64px; border-top: 1px solid var(--ink); }
.project-card {
  display: grid;
  grid-template-columns: 50px minmax(0, 1.4fr) minmax(210px, .55fr) 48px;
  gap: 24px;
  align-items: start;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
  transition: opacity .25s ease;
}
.project-card[hidden] { display: none; }
.project-number { color: var(--muted); font: 700 13px ui-monospace, monospace; }
.project-meta { display: flex; gap: 18px; color: var(--muted); font: 700 11px ui-monospace, monospace; text-transform: uppercase; }
.project-main h3 { margin: 9px 0 8px; font-size: clamp(23px, 2.3vw, 34px); line-height: 1.25; }
.project-main > p { max-width: 680px; margin: 0; color: var(--muted); }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.tag-list span { padding: 4px 9px; color: #255052; background: #dff4f2; font: 700 10px ui-monospace, monospace; }
.project-result { min-height: 120px; padding: 20px; color: #111819; background: var(--cyan); }
.project-result .result-label, .project-result > span { display: block; font-size: 11px; }
.project-result > strong { display: block; margin: 8px 0; font-size: 27px; line-height: 1.1; }
.metrics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: var(--green); }
.metrics-grid div { display: flex; flex-direction: column; }
.metrics-grid strong { font-size: 21px; line-height: 1.15; }
.metrics-grid span { margin-top: 7px; font-size: 10px; color: #4a522d; }
.project-toggle { color: var(--ink); }
.project-card.open .project-toggle svg { transform: rotate(45deg); }
.project-toggle svg { transition: transform .25s ease; }
.project-details {
  grid-column: 2 / 5;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .45s ease, opacity .3s ease, padding .3s ease;
}
.project-card.open .project-details { max-height: 450px; padding: 26px 0 8px; opacity: 1; }
.project-details h4 { margin: 0 0 10px; font-size: 13px; }
.project-details p, .project-details li { color: var(--muted); font-size: 14px; }
.project-details ul { margin: 0; padding-left: 20px; }
.empty-state { display: none; width: min(1240px, 100%); margin: 32px auto 0; color: var(--muted); }
.empty-state.visible { display: block; }

.lab { display: grid; grid-template-columns: minmax(260px, .65fr) minmax(540px, 1.35fr); gap: clamp(50px, 8vw, 120px); color: #eef2ef; background: #182123; }
.lab-copy { align-self: center; }
.lab-copy > p:not(.section-index) { color: #9eaaa7; }
.button-light { color: #121819; background: var(--green); border-color: var(--green); }
.lab .button { margin-top: 24px; }
.test-console { min-width: 0; border: 1px solid #3b4645; background: #101719; box-shadow: 18px 18px 0 #222e30; }
.console-topbar { min-height: 48px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 16px; border-bottom: 1px solid #33403f; color: #8d9996; font: 11px ui-monospace, monospace; }
.console-topbar > :last-child { justify-self: end; color: var(--green); }
.window-dots { display: flex; gap: 6px; }
.window-dots span { width: 8px; height: 8px; border-radius: 50%; background: #55605e; }
.window-dots span:nth-child(1) { background: var(--coral); }
.window-dots span:nth-child(2) { background: var(--yellow); }
.window-dots span:nth-child(3) { background: var(--green); }
.console-summary { display: grid; grid-template-columns: repeat(3, 1fr); padding: 28px 30px 22px; }
.console-summary div { border-right: 1px solid #34403e; }
.console-summary div:last-child { border-right: 0; padding-left: 20px; }
.console-summary div:nth-child(2) { padding-left: 20px; }
.console-summary span { display: block; color: #73807d; font-size: 11px; }
.console-summary strong { display: block; margin-top: 4px; font: 800 32px ui-monospace, monospace; }
.progress-track { height: 3px; margin: 0 30px; background: #2d3837; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--green); transition: width .35s ease; }
.test-list { padding: 18px 30px 24px; }
.test-row { min-height: 50px; display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 12px; border-bottom: 1px solid #273231; color: #c8cfcc; font-size: 13px; }
.test-row code { color: #697774; font-size: 10px; }
.test-state { display: grid; place-items: center; color: #5d6a67; }
.test-row.running .test-state { color: var(--yellow); animation: pulse .7s infinite alternate; }
.test-row.passed .test-state { color: var(--green); }
.console-log { min-height: 48px; display: flex; align-items: center; gap: 8px; padding: 0 30px; border-top: 1px solid #33403f; color: #778481; font: 11px ui-monospace, monospace; }
.prompt { color: var(--cyan); }
.cursor { width: 7px; height: 14px; background: var(--green); animation: blink 1s steps(1) infinite; }
@keyframes pulse { to { opacity: .35; } }
@keyframes blink { 50% { opacity: 0; } }

.journey { background: var(--surface); }
.timeline { margin-top: 70px; border-top: 1px solid var(--ink); }
.timeline article { display: grid; grid-template-columns: minmax(180px, .35fr) 1fr; gap: 30px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.timeline time { color: var(--muted); font: 700 12px ui-monospace, monospace; }
.timeline h3 { margin: 0 0 5px; font-size: 22px; }
.timeline p { margin: 0; color: var(--muted); }
.timeline span { display: block; margin-top: 10px; color: #8a8f8d; font-size: 13px; }

.contact { padding: clamp(88px, 10vw, 150px) clamp(24px, 6vw, 108px); color: #f1f4ef; background: #111718; }
.contact-inner { position: relative; }
.contact h2 { font-size: clamp(54px, 8vw, 116px); }
.contact-links { display: flex; flex-wrap: wrap; gap: 15px 32px; margin: 45px 0 35px; color: #a8b2af; }
.contact-links a, .contact-links span { display: inline-flex; align-items: center; gap: 8px; }
.contact-links a:hover { color: var(--cyan); }
footer { min-height: 72px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 clamp(24px, 6vw, 108px); border-top: 1px solid #303838; color: #89928f; background: #111718; font-size: 12px; }
footer a { justify-self: end; display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #4b5553; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; padding: 12px 18px; color: #111819; background: var(--green); font-weight: 700; transform: translateY(140%); transition: transform .25s ease; box-shadow: var(--shadow); }
.toast.visible { transform: translateY(0); }
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

body.light-theme {
  --bg: #f4f4ef;
  --surface: #ffffff;
}
body.light-theme .hero { color: var(--ink); background: #e9f0ed; }
body.light-theme .hero-intro, body.light-theme .eyebrow { color: #596260; }
body.light-theme .hero-facts { border-color: #b8c3bf; }
body.light-theme .hero-facts dt { color: #68716f; }
body.light-theme .site-header:not(.scrolled) { color: var(--ink); }
body.light-theme .portrait-frame::before { border-color: #9ba8a4; }

@media (max-width: 960px) {
  .site-header { grid-template-columns: 1fr auto; }
  .desktop-nav { display: none; }
  .hero { min-height: auto; }
  .hero-grid { grid-template-columns: 1fr .72fr; gap: 36px; }
  .hero h1 { font-size: 82px; }
  .portrait-frame img { height: 520px; }
  .about-layout { grid-template-columns: 1fr; }
  .project-card { grid-template-columns: 40px minmax(0, 1fr) 48px; }
  .project-result { grid-column: 2; min-height: auto; }
  .project-toggle { grid-column: 3; grid-row: 1; }
  .project-details { grid-column: 2 / 4; }
  .lab { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .site-header { height: 64px; padding-inline: 18px; }
  .brand > span:last-child, .header-actions .button { display: none; }
  .hero { padding: 104px 20px 0; }
  .hero-grid { display: flex; flex-direction: column; align-items: stretch; gap: 36px; }
  .hero-copy { padding-bottom: 0; }
  .hero h1 { margin-top: 22px; font-size: 74px; }
  .hero-role { font-size: 26px; }
  .hero-intro { font-size: 16px; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 12px; }
  .hero-facts { margin-top: 36px; gap: 14px; }
  .hero-facts dd { font-size: 12px; }
  .hero-visual { justify-content: flex-end; }
  .portrait-frame { width: 78%; margin: 0 0 0 auto; }
  .portrait-frame img { height: 390px; }
  .hero-signal { left: -55px; bottom: 24px; }
  .hero-ticker { width: calc(100% + 40px); margin-left: -20px; overflow: hidden; justify-content: flex-start; padding-left: 10px; }
  .hero-ticker span:nth-child(n+5) { display: none; }
  .section { padding: 82px 20px; }
  .section h2 { font-size: 40px; }
  .section-heading.horizontal { align-items: flex-start; flex-direction: column; }
  .project-filters { justify-content: flex-start; }
  .project-list { margin-top: 42px; }
  .project-card { grid-template-columns: 32px 1fr 42px; gap: 12px; }
  .project-main h3 { font-size: 22px; }
  .project-meta { flex-direction: column; gap: 2px; }
  .project-result { grid-column: 2 / 4; }
  .project-details { grid-column: 2 / 4; grid-template-columns: 1fr; gap: 20px; }
  .project-card.open .project-details { max-height: 720px; }
  .lab { padding-inline: 20px; }
  .test-console { box-shadow: 8px 8px 0 #222e30; }
  .console-topbar { grid-template-columns: 1fr auto; }
  .console-topbar .window-dots { display: none; }
  .console-summary, .test-list { padding-inline: 16px; }
  .progress-track { margin-inline: 16px; }
  .test-row { grid-template-columns: 22px 1fr; }
  .test-row code { display: none; }
  .timeline article { grid-template-columns: 1fr; gap: 10px; }
  .contact { padding: 82px 20px; }
  .contact h2 { font-size: 56px; }
  .contact-links { flex-direction: column; }
  footer { grid-template-columns: 1fr auto; padding: 18px 20px; }
  footer > span:nth-child(2) { display: none; }
}

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