:root {
  --ink: #20201d;
  --muted: #76756e;
  --paper: #f4f2ec;
  --paper-deep: #e8e6df;
  --cream: #eeede5;
  --dark: #252624;
  --dark-soft: #363733;
  --accent: #d55635;
  --line: rgba(32, 32, 29, 0.18);
  --sidebar-line: rgba(238, 237, 229, 0.2);
  --shadow: 0 32px 90px rgba(42, 40, 33, 0.16);
  --sans: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

@font-face {
  font-family: "Material Symbols Outlined";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("assets/fonts/MaterialSymbolsOutlined.ttf?v=2") format("truetype");
}

* { box-sizing: border-box; }

html { background: #d9dad5; scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(255,255,255,.5), transparent 25rem),
    #d9dad5;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

.site-chrome {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #4d4d48;
}

.section-eyebrow,
.section-index,
.item-label,
.item-period,
.hero-topline,
.portrait-index {
  font-family: var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.error-tip code { font-family: var(--mono); color: var(--accent); }
.chrome-actions { display: flex; align-items: center; gap: 24px; }
.chrome-actions { margin-left: auto; }
.language-switch { display: inline-flex; align-items: center; gap: 3px; height: 36px; padding: 2px; border: 1px solid rgba(32,32,29,.28); }
.language-switch > span { color: #9b9a92; font: 700 10px var(--mono); }
.language-option { height: 30px; padding: 4px 7px; border: 0; color: var(--muted); background: transparent; font: 700 10px var(--mono); letter-spacing: .08em; cursor: pointer; }
.language-option.is-active { color: var(--paper); background: var(--ink); }
.language-option:disabled { opacity: .45; cursor: not-allowed; }
.print-button { font: 700 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.print-button { height: 36px; padding: 5px 14px; border: 1px solid rgba(32,32,29,.28); color: var(--ink); background: transparent; cursor: pointer; transition: .2s ease; }
.print-button:hover { background: var(--ink); color: var(--paper); }
.material-symbols-outlined {
  display: inline-block;
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "liga";
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20;
}
.print-button .material-symbols-outlined { margin-left: 3px; font-size: 15px; vertical-align: -3px; }

.app-shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto 72px; }

.resume-sheet {
  display: grid;
  grid-template-columns: 302px minmax(0, 1fr);
  min-height: 1480px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.sidebar {
  display: grid;
  grid-template-columns: 42px 1fr;
  color: var(--cream);
  background: var(--dark);
}

.sidebar-rail {
  min-height: 100%;
  padding: 32px 0 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 19px;
  border-right: 1px solid var(--sidebar-line);
  color: rgba(238,237,229,.52);
  font: 8px var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.sidebar-content { padding: 60px 26px 12px 24px; }

.portrait-wrap { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 26px; }
.portrait-frame { position: relative; width: 138px; aspect-ratio: 1; overflow: hidden; background: #c9c8c0; }
.portrait-frame::before { content: ""; position: absolute; z-index: 2; inset: 10px; border: 1px solid rgba(32,32,29,.42); pointer-events: none; }
.portrait-frame img { display: block; width: 100%; height: 100%; object-fit: cover; filter: none; }
.portrait-fallback { display: none; place-items: center; position: absolute; inset: 0; color: var(--dark); font-size: 32px; font-weight: 700; letter-spacing: -.08em; }
.portrait-index { color: rgba(238,237,229,.45); font-size: 9px; }
.sidebar-intro { padding-bottom: 16px; border-bottom: 1px solid var(--sidebar-line); }
.sidebar-intro p { margin: 0; color: rgba(238,237,229,.72); font-size: 11px; line-height: 1.55; }
.sidebar-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 10px; }
.sidebar-fact { display: grid; gap: 4px; min-width: 0; color: rgba(238,237,229,.45); font: 8px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.sidebar-fact strong { color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .08em; }

.sidebar-section { padding: 21px 0; border-bottom: 1px solid var(--sidebar-line); }
.sidebar-section:last-child { border-bottom: 0; }
.sidebar-section h2 { margin: 0 0 16px; color: var(--cream); font: 700 9px var(--mono); letter-spacing: .13em; text-transform: uppercase; }
.contact-list, .education-list, .language-list, .skill-list, .interest-list { margin: 0; padding: 0; list-style: none; }
.contact-list { display: grid; gap: 13px; }
.contact-item { display: flex; gap: 10px; align-items: flex-start; }
.contact-icon { flex: 0 0 13px; padding-top: 2px; color: var(--accent); }
.contact-icon .material-symbols-outlined { display: block; font-size: 14px; }
.contact-item > span:last-child { min-width: 0; display: grid; gap: 3px; }
.item-label { color: rgba(238,237,229,.42); font-size: 8px; }
.contact-item a { overflow-wrap: anywhere; color: rgba(238,237,229,.82); font-size: 10px; line-height: 1.35; text-decoration: none; }
.contact-item a:hover { color: var(--cream); }
.education-list { display: grid; gap: 14px; }
.education-item { display: grid; gap: 3px; color: rgba(238,237,229,.56); font-size: 9px; line-height: 1.3; }
.education-item strong { color: rgba(238,237,229,.9); font-size: 10px; font-weight: 600; }
.item-period { color: var(--accent); font-size: 8px; }
.skill-group + .skill-group { margin-top: 15px; }
.skill-group h3 { margin: 0 0 10px; color: rgba(238,237,229,.47); font: 8px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.skill-list { display: grid; gap: 8px; }
.skill-list li { display: grid; gap: 5px; color: rgba(238,237,229,.8); font-size: 9px; }
.skill-track { display: block; width: 100%; height: 2px; background: rgba(238,237,229,.18); }
.skill-track span { display: block; width: var(--skill-level); height: 100%; background: var(--accent); }
.language-list { display: grid; gap: 7px; }
.language-list li { display: flex; justify-content: space-between; gap: 12px; color: rgba(238,237,229,.78); font-size: 10px; }
.language-list li span:last-child { color: var(--accent); font-size: 9px; }
.interest-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.interest-item { display: flex; align-items: center; gap: 9px; color: rgba(238,237,229,.78); font-size: 10px; line-height: 1.35; }
.interest-icon { flex: 0 0 15px; color: var(--accent); }
.interest-icon .material-symbols-outlined { display: block; font-size: 15px; }

.resume-content { min-width: 0; padding: 64px 65px 20px; }
.resume-hero { padding-bottom: 24px; }
.hero-topline { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 9px; }
.hero-status { display: inline-grid; gap: 7px; min-width: 0; text-align: left; }
.hero-status-item { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.hero-status-item i { flex: 0 0 7px; width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #85b285; box-shadow: 0 0 0 4px rgba(133,178,133,.13); }
.resume-hero h1 { margin: 25px 0 19px; color: var(--ink); font-size: clamp(56px, 6.5vw, 88px); font-weight: 700; letter-spacing: -.105em; line-height: .72; }
.resume-hero h1 em { color: var(--accent); font-style: normal; }
.hero-bottomline { display: grid; grid-template-columns: 1fr 1.5fr; gap: 25px; align-items: end; }
.hero-role { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -.02em; }
.hero-intro { max-width: 390px; margin: 0; color: #5f5e58; font-size: 12px; line-height: 1.45; }
.content-rule { display: flex; gap: 7px; height: 1px; margin-bottom: 32px; background: var(--line); }
.content-rule span { display: block; width: 6px; height: 6px; margin-top: -2px; border-radius: 50%; background: var(--accent); }
.content-rule span:first-child { margin-left: auto; }

.content-section { padding-bottom: 32px; }
.section-heading-row { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 22px; }
.section-index { margin: 0 0 10px; color: var(--accent); font-size: 9px; }
.section-heading-row h2 { margin: 0; font-size: 28px; letter-spacing: -.06em; line-height: 1; }
.section-aside { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; text-align: right; }

.experience-list { border-top: 1px solid var(--line); }
.experience-item { display: grid; grid-template-columns: 38px minmax(0,1fr); gap: 18px; padding: 18px 0 19px; border-bottom: 1px solid var(--line); }
.experience-marker { position: relative; display: flex; justify-content: center; }
.experience-marker::after { content: ""; position: absolute; top: 26px; bottom: -20px; width: 1px; background: var(--line); }
.experience-item:last-child .experience-marker::after { display: block; bottom: -20px; }
.experience-marker span { position: relative; z-index: 1; width: 23px; height: 23px; display: grid; place-items: center; border: 1px solid var(--accent); border-radius: 50%; color: var(--accent); background: var(--paper); font: 8px var(--mono); }
.experience-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.experience-heading h3 { margin: 5px 0 2px; font-size: 16px; letter-spacing: -.04em; }
.section-eyebrow { margin: 0; color: var(--muted); font-size: 8px; line-height: 1.4; }
.dot { color: var(--accent); }
.company { margin: 0; color: var(--accent); font-size: 10px; font-weight: 600; }
.current-tag { flex: 0 0 auto; padding: 5px 7px; color: var(--accent); border: 1px solid rgba(213,86,53,.45); font: 8px var(--mono); letter-spacing: .07em; text-transform: uppercase; }
.experience-summary { max-width: 540px; margin: 10px 0 8px; color: #5f5e58; font-size: 11px; line-height: 1.45; }
.highlight-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.highlight-list li { position: relative; padding-left: 15px; color: #494842; font-size: 10px; line-height: 1.4; }
.highlight-list li::before { content: ""; position: absolute; top: .55em; left: 0; width: 5px; height: 5px; background: var(--accent); }

.recognitions-section { padding-top: 10px; padding-bottom: 24px; }
.recognition-list { border-top: 1px solid var(--line); }
.recognition-item { display: grid; grid-template-columns: 70px minmax(0,1fr) auto; gap: 18px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.recognition-year { color: var(--accent); font: 9px var(--mono); }
.recognition-item h3 { margin: 0 0 3px; font-size: 13px; letter-spacing: -.03em; }
.recognition-item p { margin: 0; color: var(--muted); font-size: 9px; }
.recognition-detail { color: var(--accent); font: 8px var(--mono); letter-spacing: .03em; }

.resume-footer { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-top: 5px; padding-top: 20px; border-top: 1px solid var(--line); }
.footer-note { max-width: 275px; margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -.06em; line-height: 1.05; }
.footer-link { display: inline-flex; align-items: center; gap: 17px; color: var(--accent); font: 700 9px var(--mono); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; }
.footer-link .footer-arrow { font-size: 18px; font-weight: 400; }
.footer-link:hover span:first-child { text-decoration: underline; text-underline-offset: 4px; }

.loading-state { padding: 120px 30px; color: var(--muted); font: 11px var(--mono); text-align: center; }
.error-state { max-width: 680px; margin: 90px auto; padding: 56px; background: var(--paper); box-shadow: var(--shadow); }
.error-state h1 { margin: 20px 0; font-size: 46px; letter-spacing: -.08em; line-height: .95; }
.error-state h1 em { color: var(--accent); font-style: normal; }
.error-state > p:not(.section-eyebrow) { max-width: 480px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.error-tip { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.noscript-message { margin: 32px auto; width: min(680px, calc(100% - 48px)); color: var(--ink); font: 12px var(--mono); }

@media (max-width: 900px) {
  .resume-sheet { grid-template-columns: 260px minmax(0,1fr); }
  .resume-content { padding: 64px 38px 20px; }
  .resume-hero h1 { font-size: clamp(54px, 8vw, 78px); }
  .hero-bottomline { grid-template-columns: 1fr; gap: 13px; }
}

@media (max-width: 700px) {
  .site-chrome, .app-shell { width: min(100% - 28px, 560px); }
  .site-chrome { align-items: flex-start; padding: 20px 0 17px; }
  .chrome-actions { gap: 12px; }
  .resume-sheet { display: block; min-height: 0; }
  .sidebar { display: block; }
  .sidebar-rail { display: none; }
  .sidebar-content { padding: 40px 27px 15px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 25px; }
  .portrait-wrap, .sidebar-intro { grid-column: 1 / -1; }
  .portrait-wrap { margin-bottom: 23px; }
  .sidebar-section { min-width: 0; }
  .interests-section { grid-column: 1 / -1; }
  .contact-list, .education-list, .skill-list { gap: 10px; }
  .languages-section { grid-column: 1 / -1; }
  .resume-content { padding: 50px 27px 24px; }
  .resume-hero h1 { margin: 26px 0 20px; font-size: clamp(54px, 15vw, 78px); }
  .hero-topline { font-size: 8px; }
  .content-rule { margin-bottom: 38px; }
  .section-heading-row { align-items: start; }
  .section-aside { display: none; }
  .experience-item { grid-template-columns: 26px minmax(0,1fr); gap: 12px; }
  .experience-marker span { width: 21px; height: 21px; }
  .experience-heading { display: block; }
  .current-tag { display: inline-block; margin-top: 10px; }
  .resume-footer { align-items: start; flex-direction: column; gap: 24px; }
  .footer-note { font-size: 24px; }
}

@media print {
  @page { size: A4; margin: 0; }
  html, body { width: 210mm; min-height: 297mm; background: white; }
  body { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .site-chrome { display: none; }
  /*
   * The browser's print viewport is narrower than the desktop canvas. Without
   * an A4-specific scale, the content column wraps more and the document
   * becomes unexpectedly tall. The layout canvas below is scaled to exactly
   * 210mm wide, which keeps the screen proportions and fits the current
   * content on one A4 sheet.
   */
  .app-shell {
    width: 244.186mm;
    margin: 0;
    zoom: .86;
  }
  .resume-sheet {
    grid-template-columns: 215px minmax(0, 1fr);
    min-height: 345.35mm;
    box-shadow: none;
  }
  .sidebar { grid-template-columns: 28px 1fr; }
  .sidebar-rail { padding: 22px 0; font-size: 7px; }
  .sidebar-content { padding: 42px 17px 8px; }
  .portrait-wrap { margin-bottom: 17px; }
  .portrait-frame { width: 108px; }
  .sidebar-intro { padding-bottom: 12px; }
  .sidebar-intro p { font-size: 8.5px; line-height: 1.35; }
  .sidebar-facts { gap: 10px; margin-top: 7px; }
  .sidebar-fact { gap: 3px; font-size: 7px; }
  .sidebar-fact strong { font-size: 10px; }
  .sidebar-section { padding: 13px 0; }
  .sidebar-section h2 { margin-bottom: 9px; font-size: 8px; }
  .contact-list { gap: 8px; }
  .contact-item { gap: 7px; }
  .contact-icon { flex-basis: 12px; }
  .contact-icon .material-symbols-outlined { font-size: 12px; }
  .item-label { font-size: 7px; }
  .contact-item a { font-size: 8px; line-height: 1.25; }
  .education-list { gap: 9px; }
  .education-item { gap: 2px; font-size: 8px; line-height: 1.25; }
  .education-item strong { font-size: 9px; }
  .item-period { font-size: 7px; }
  .skill-group + .skill-group { margin-top: 10px; }
  .skill-group h3 { margin-bottom: 6px; font-size: 7px; }
  .skill-list { gap: 6px; }
  .skill-list li { gap: 4px; font-size: 8px; }
  .language-list { gap: 5px; }
  .language-list li { font-size: 8px; }
  .language-list li span:last-child { font-size: 7px; }
  .interest-list { gap: 6px 8px; }
  .interest-item { gap: 6px; font-size: 8px; }
  .interest-icon { flex-basis: 12px; }
  .interest-icon .material-symbols-outlined { font-size: 12px; }
  .resume-content { padding: 48px 42px 8px; }
  .resume-hero { padding-bottom: 16px; }
  .hero-topline { font-size: 7px; }
  .hero-status { gap: 5px; }
  .hero-status-item { gap: 6px; }
  .hero-status-item i { flex-basis: 5px; width: 5px; height: 5px; box-shadow: 0 0 0 3px rgba(133,178,133,.13); }
  .resume-hero h1 { margin: 16px 0 12px; font-size: 62px; line-height: .68; }
  .hero-bottomline { gap: 16px; }
  .hero-role { font-size: 11px; }
  .hero-intro { font-size: 9px; line-height: 1.3; }
  .content-rule { margin-bottom: 22px; }
  .content-section { padding-bottom: 18px; }
  .section-heading-row { margin-bottom: 14px; }
  .section-index { margin-bottom: 6px; font-size: 7px; }
  .section-heading-row h2 { font-size: 22px; }
  .section-aside { font-size: 8px; }
  .experience-item { grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 12px 0; }
  .experience-marker::after { top: 23px; bottom: -12px; }
  .experience-item:last-child .experience-marker::after { bottom: -12px; }
  .experience-marker span { width: 20px; height: 20px; font-size: 7px; }
  .experience-heading { gap: 8px; }
  .experience-heading h3 { margin: 3px 0 1px; font-size: 13px; }
  .section-eyebrow { font-size: 7px; line-height: 1.25; }
  .company { font-size: 9px; }
  .current-tag { padding: 3px 5px; font-size: 7px; }
  .experience-summary { margin: 7px 0 5px; font-size: 9px; line-height: 1.3; }
  .highlight-list { gap: 2px; }
  .highlight-list li { padding-left: 12px; font-size: 8.5px; line-height: 1.3; }
  .highlight-list li::before { width: 4px; height: 4px; }
  .resume-footer { padding-top: 14px; }
  .experience-item, .recognition-item { break-inside: avoid; }

  /* Chinese copy is denser and shorter, so it uses more of the A4 canvas. */
  html[lang="zh-CN"] .app-shell {
    width: 228.261mm;
    zoom: .92;
  }
  html[lang="zh-CN"] .resume-sheet { min-height: 322.826mm; }
  html[lang="zh-CN"] .sidebar-intro p { line-height: 1.5; }
  html[lang="zh-CN"] .contact-item a,
  html[lang="zh-CN"] .education-item { line-height: 1.4; }
  html[lang="zh-CN"] .experience-summary { line-height: 1.45; }
  html[lang="zh-CN"] .highlight-list { gap: 3px; }
  html[lang="zh-CN"] .highlight-list li { line-height: 1.42; }
}
