:root {
  color-scheme: light;
  --sans: "Noto Sans CJK SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --serif: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --mono: "JetBrains Mono", "SFMono-Regular", "Cascadia Code", "Liberation Mono", monospace;
  --page: #ffffff;
  --surface: #ffffff;
  --ink: #171b21;
  --muted: #5f6873;
  --faint: #8d96a0;
  --line: #d8e0e8;
  --accent: #0563c1;
  --accent-strong: #004b98;
  --header-height: 62px;
  font-family: var(--sans);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 28px);
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
p, h1, h2, h3, ol { margin: 0; }

.scroll-progress {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
}

.scroll-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

.site-header {
  position: sticky;
  z-index: 90;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--header-height);
  padding: 0 clamp(20px, 4vw, 58px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
  background: color-mix(in srgb, #ffffff 94%, transparent);
  backdrop-filter: blur(16px);
}

.site-brand {
  justify-self: start;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.site-brand span { color: var(--accent); padding: 0 0.15em; }

.theme-nav {
  display: flex;
  gap: 28px;
  align-items: center;
  font-size: 12px;
}

.theme-nav a {
  position: relative;
  color: var(--muted);
  transition: color 180ms ease;
}

.theme-nav a::after {
  position: absolute;
  right: 0;
  bottom: -7px;
  left: 0;
  height: 1px;
  background: var(--accent);
  content: "";
  opacity: 0;
  transform: scaleX(0.35);
  transition: opacity 180ms ease, transform 180ms ease;
}

.theme-nav a:hover,
.theme-nav a.is-current { color: var(--ink); }
.theme-nav a.is-current::after { opacity: 1; transform: scaleX(1); }

.header-download {
  justify-self: end;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.header-download span {
  display: inline-block;
  margin-left: 5px;
  color: var(--accent);
  transition: transform 180ms ease;
}

.header-download:hover span { transform: translateY(3px); }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 156px;
  grid-template-areas:
    "content visual"
    "contact visual";
  gap: 20px 48px;
  width: min(1080px, calc(100% - 48px));
  min-height: 0;
  margin: 0 auto;
  padding: 72px 0 46px;
  border-bottom: 1px solid var(--line);
  overflow: visible;
}

.hero-visual {
  position: relative;
  grid-area: visual;
  align-self: start;
  width: 132px;
  height: 176px;
  min-height: 0;
  margin-left: auto;
  overflow: visible;
}

.portrait-frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #eef3f8;
}

.portrait-frame img { width: 100%; height: 100%; object-fit: cover; }
.hero-mark { display: none; }

.hero-content {
  position: relative;
  z-index: 2;
  grid-area: content;
  align-self: center;
  max-width: none;
  padding: 0;
}

.hero-kicker {
  margin-bottom: 15px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.hero h1 {
  display: flex;
  flex-direction: column;
  font-size: clamp(46px, 6vw, 68px);
  font-weight: 760;
  letter-spacing: -0.05em;
  line-height: 1;
}

.hero h1 small {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  line-height: 1.4;
  text-transform: uppercase;
}

.hero-identity {
  margin-top: 18px;
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0.03em;
}

.hero-statement {
  max-width: 720px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.hero-actions { display: flex; gap: 10px; margin-top: 22px; }

.primary-link,
.secondary-link {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 17px;
  border: 1px solid var(--accent);
  font-size: 12px;
  font-weight: 700;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.primary-link { background: var(--accent); color: #ffffff; }
.secondary-link { color: var(--accent); }
.primary-link:hover, .secondary-link:hover { transform: translateY(-2px); }
.secondary-link:hover { background: var(--accent); color: #ffffff; }

.hero-contact {
  position: static;
  grid-area: contact;
  display: flex;
  gap: 22px;
  align-self: end;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.hero-contact a:hover { color: var(--accent); }

.overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.overview div {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: center;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
}

.overview div:last-child { border-right: 0; }
.overview span { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; }
.overview strong { font-family: var(--mono); font-size: 18px; line-height: 1; }

.resume-layout {
  display: block;
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
  padding: 68px 0 110px;
}

.resume-content { min-width: 0; }
.resume-section { margin-bottom: 74px; }
.resume-section:last-child { margin-bottom: 0; }

.section-heading {
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: end;
  margin-bottom: 27px;
  padding-bottom: 7px;
  border-bottom: 1.5px solid var(--accent);
}

.section-heading::after {
  position: absolute;
  right: 0;
  bottom: -1.5px;
  width: 72%;
  height: 1.5px;
  background: var(--accent);
  content: "";
  transform: scaleX(0);
  transform-origin: right;
}

.section-heading.is-visible::after { animation: rule-in 700ms 120ms cubic-bezier(0.22, 1, 0.36, 1) forwards; }

.section-index {
  padding-bottom: 2px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
}

.section-heading p { display: none; }
.section-heading h2 { color: var(--accent); font-size: 22px; letter-spacing: -0.02em; line-height: 1.2; }

.education-entry {
  display: grid;
  grid-template-columns: minmax(250px, 0.42fr) minmax(0, 0.58fr);
  gap: 48px;
}

.education-period, .education-major {
  margin-bottom: 7px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
}

.education-entry h3 { margin-bottom: 5px; font-size: 21px; }
.education-entry p { color: var(--muted); font-size: 13px; }
.education-courses { line-height: 1.9; }
.education-courses strong { display: block; margin-bottom: 5px; color: var(--ink); font-size: 13px; }

.honor-list { border-top: 1px solid var(--line); }
.honor-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 0.3fr) 82px;
  gap: 20px;
  align-items: baseline;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.honor-entry h3 { font-size: 14px; font-weight: 500; }
.honor-entry strong { font-size: 13px; }
.honor-entry time { color: var(--muted); font-family: var(--mono); font-size: 10px; text-align: right; }

.entry { position: relative; padding: 0 0 34px; margin-bottom: 34px; border-bottom: 1px solid var(--line); }
.entry:last-child { margin-bottom: 0; }
.entry-head h3 { max-width: 900px; font-size: 20px; letter-spacing: -0.015em; line-height: 1.42; }

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.entry-meta time { margin-left: auto; font-family: var(--mono); }
.place-link { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
.place-link:hover { color: var(--accent); text-decoration-color: currentColor; }
.entry-lead { max-width: 900px; margin-top: 15px; font-size: 14px; font-weight: 650; line-height: 1.75; }
.entry-body { max-width: 960px; margin-top: 13px; color: var(--muted); font-size: 13px; }
.entry-body p + p { margin-top: 8px; }
.inline-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.contribution {
  display: flex;
  gap: 12px;
  max-width: 960px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 12px;
}

.contribution strong { flex: 0 0 auto; color: var(--accent); }
.entry-actions { display: flex; gap: 22px; align-items: baseline; justify-content: space-between; margin-top: 14px; }
.entry-actions .contribution { margin-top: 0; }
.entry-links { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 13px; }

.text-link {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.text-link span { transition: transform 180ms ease; }
.text-link:hover span { transform: translate(3px, -3px); }
.contribution-entry > p { max-width: 960px; margin-top: 13px; color: var(--muted); font-size: 13px; }

.practice-list { border-top: 1px solid var(--line); }
.compact-entry {
  display: grid;
  grid-template-columns: minmax(220px, 0.34fr) minmax(0, 0.56fr) 105px;
  gap: 28px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.compact-entry h3 { font-size: 14px; }
.compact-entry > div p, .compact-entry > p { margin-top: 3px; color: var(--muted); font-size: 12px; }
.compact-entry time { color: var(--muted); font-family: var(--mono); font-size: 10px; text-align: right; }

.skill-list { padding: 0; border-top: 1px solid var(--line); list-style: none; }
.skill-list li { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.skill-list span { color: var(--accent); font-family: var(--mono); font-size: 10px; }
.skill-list p { font-size: 13px; }

.evaluation-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px; }
.evaluation-list article { padding-top: 13px; border-top: 2px solid var(--accent); }
.evaluation-list h3 { margin-bottom: 8px; font-size: 15px; }
.evaluation-list p { color: var(--muted); font-size: 13px; }

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px;
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
  padding: 54px 0 32px;
  border-top: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.site-footer > div:first-child p { color: var(--muted); font-size: 13px; }
.site-footer h2 { margin-top: 4px; color: var(--accent); font-size: 38px; letter-spacing: -0.04em; line-height: 1.15; }
.footer-links { align-self: end; display: flex; flex-direction: column; gap: 7px; min-width: 230px; font-family: var(--mono); font-size: 10px; }
.footer-links a:hover { color: var(--accent); }
.footer-links a span { margin-left: 5px; }
.footer-note { grid-column: 1 / -1; margin-top: 34px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--faint); font-family: var(--mono); font-size: 9px; }

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 520ms cubic-bezier(0.22, 1, 0.36, 1), transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible { opacity: 1; transform: translateY(0); }

@keyframes rule-in { to { transform: scaleX(1); } }

@media (max-width: 780px) {
  :root { --header-height: 58px; }
  .site-header { grid-template-columns: 1fr auto; padding: 0 18px; }
  .theme-nav { display: none; }
  .hero {
    grid-template-columns: 1fr 88px;
    gap: 14px 20px;
    width: min(100% - 36px, 620px);
    padding: 42px 0 28px;
  }
  .hero-visual { width: 82px; height: 110px; }
  .hero-kicker { margin-bottom: 9px; }
  .hero h1 { font-size: clamp(40px, 13vw, 58px); }
  .hero-identity { margin-top: 14px; font-size: 12px; }
  .hero-statement { font-size: 13px; }
  .hero-actions { margin-top: 17px; }
  .hero-contact { grid-column: 1 / -1; flex-wrap: wrap; gap: 5px 14px; }
  .hero-contact span { display: none; }
  .overview { grid-template-columns: repeat(2, 1fr); width: min(100% - 36px, 620px); }
  .overview div { justify-content: flex-start; padding: 14px 10px; }
  .overview div:nth-child(2) { border-right: 0; }
  .overview div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .resume-layout { width: min(100% - 36px, 620px); padding: 52px 0 80px; }
  .resume-section { margin-bottom: 62px; }
  .section-heading { grid-template-columns: 28px 1fr; }
  .section-heading h2 { font-size: 20px; }
  .education-entry { grid-template-columns: 1fr; gap: 22px; }
  .honor-entry { grid-template-columns: 1fr auto; gap: 4px 14px; }
  .honor-entry h3 { grid-column: 1 / -1; }
  .entry-meta time { width: 100%; margin-left: 0; }
  .entry-actions { align-items: flex-start; flex-direction: column; }
  .contribution { flex-direction: column; gap: 3px; }
  .compact-entry { grid-template-columns: 1fr; gap: 5px; }
  .compact-entry time { text-align: left; }
  .evaluation-list { grid-template-columns: 1fr; gap: 24px; }
  .site-footer { grid-template-columns: 1fr; width: min(100% - 36px, 620px); padding-top: 42px; }
  .footer-links { min-width: 0; }
}

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

@media print {
  .site-header, .scroll-progress, .site-footer, .hero-actions { display: none !important; }
  body { background: #ffffff; color: #000000; }
  .hero, .overview, .resume-layout { width: 100%; }
  .hero { break-after: page; }
  .resume-layout { padding: 0; }
  .resume-section { break-inside: avoid; margin-bottom: 38px; }
  .reveal { opacity: 1; transform: none; }
}
