:root {
  --accent: #0f5b46;
  --ink: #111317;
  --muted: #686d72;
  --contact: #3f4549;
  --hairline: #c9cdd0;
  --paper: #ffffff;
  --workspace: #edf0f1;
  --ui-font: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--workspace);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0)) 0 0 / 100% 180px no-repeat,
    var(--workspace);
  font-family: var(--ui-font);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

.preview-shell {
  display: grid;
  min-height: 100vh;
  place-items: start center;
  padding: 38px 180px 72px 32px;
}

.resume {
  width: 210mm;
  min-height: 297mm;
  padding: 18mm 18mm 14mm;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 18px 50px rgba(22, 29, 31, 0.14), 0 1px 4px rgba(22, 29, 31, 0.1);
}

.resume-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12mm;
  align-items: end;
  padding-bottom: 6mm;
  border-bottom: 0.45mm solid var(--accent);
}

.identity h1 {
  margin: 0 0 1.8mm;
  font-size: 23pt;
  font-weight: 650;
  letter-spacing: 0.08em;
  line-height: 1;
}

.identity p {
  margin: 0;
  color: var(--ink);
  font-size: 10pt;
  font-weight: 500;
  letter-spacing: 0.025em;
}

.identity p span {
  margin-inline: 1.4mm;
  color: var(--accent);
}

.contact-list {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 1.4mm 5mm;
  margin: 0;
  color: var(--contact);
  font-size: 8.2pt;
  font-style: normal;
  font-weight: 500;
  line-height: 1.45;
  text-align: right;
}

.contact-list a,
.contact-list span {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.contact-list a:hover,
.contact-list a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.placeholder {
  border-bottom: 0.2mm dotted currentColor;
}

.statement {
  max-width: 148mm;
  margin: 10mm 0 12mm 29mm;
}

.statement p {
  margin: 0 0 2mm;
  font-size: 9.6pt;
  font-weight: 420;
  letter-spacing: 0.01em;
  line-height: 1.7;
}

.numbered-section {
  display: grid;
  grid-template-columns: 20mm 0.3mm 1fr;
  column-gap: 8mm;
  margin-top: 9mm;
}

.section-index {
  color: var(--ink);
  font-size: 34pt;
  font-weight: 250;
  letter-spacing: -0.07em;
  line-height: 0.9;
}

.section-rail {
  min-height: 100%;
  background: var(--hairline);
}

.section-content {
  min-width: 0;
}

.role-meta {
  display: flex;
  min-height: 4.5mm;
  align-items: baseline;
  justify-content: space-between;
  gap: 5mm;
  margin-bottom: 2mm;
  color: var(--muted);
  font-size: 8pt;
  letter-spacing: 0.03em;
}

.role-meta span {
  text-align: right;
}

.section-content h2 {
  margin: 0;
  font-size: 19pt;
  font-weight: 650;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.role-title {
  display: flex;
  align-items: center;
  gap: 3mm;
  margin: 2.5mm 0 5mm;
  font-size: 9pt;
  font-weight: 550;
  line-height: 1.4;
}

.contribution-list,
.compact-list {
  display: grid;
  gap: 3.8mm;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contribution-list li,
.compact-list li {
  position: relative;
  margin: 0;
  padding-left: 5mm;
  font-size: 9pt;
  letter-spacing: 0.005em;
  line-height: 1.7;
}

.contribution-list li::before,
.compact-list li::before {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--accent);
  content: "—";
}

.experience-previous {
  margin-top: 12mm;
}

.experience-previous .section-content h2 {
  font-size: 13.5pt;
}

.experience-previous .role-title {
  margin-bottom: 3mm;
}

.compact-list {
  gap: 1.8mm;
}

.compact-list li {
  font-size: 8.5pt;
  line-height: 1.6;
}

.skills {
  margin-top: 11mm;
}

.skills .section-index {
  font-size: 30pt;
}

.skills .section-content {
  align-self: center;
}

.practice-list {
  display: grid;
  gap: 1.1mm;
  margin: 0;
  font-size: 7.9pt;
  line-height: 1.45;
}

.practice-list > div {
  display: grid;
  grid-template-columns: 20mm 1fr;
  gap: 3mm;
}

.practice-list dt {
  color: var(--accent);
  font-weight: 620;
}

.practice-list dd {
  margin: 0;
  color: var(--ink);
  font-weight: 460;
}

.education {
  position: relative;
  display: flex;
  gap: 3mm;
  align-items: baseline;
  margin-top: 12mm;
  padding-top: 4mm;
  border-top: 0.3mm solid var(--hairline);
  color: var(--muted);
  font-size: 7.7pt;
  letter-spacing: 0.025em;
}

.education > span:not(:last-child)::after,
.education time::after {
  margin-left: 3mm;
  color: var(--hairline);
  content: "/";
}

.tweak-panel {
  position: fixed;
  z-index: 10;
  top: 38px;
  right: 28px;
  width: 132px;
  border: 1px solid rgba(17, 19, 23, 0.16);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 35px rgba(22, 29, 31, 0.1);
  backdrop-filter: blur(14px);
}

.tweak-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px 9px 12px;
  border-bottom: 1px solid rgba(17, 19, 23, 0.09);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.panel-toggle {
  display: grid;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  place-items: center;
}

.panel-toggle:hover,
.panel-toggle:focus-visible {
  color: var(--accent);
  outline: 1px solid currentColor;
  outline-offset: 1px;
}

.tweak-body {
  padding: 11px 12px 12px;
}

.tweak-body > p {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 11px;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(4, 20px);
  gap: 8px;
}

.swatch {
  position: relative;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--swatch);
  cursor: pointer;
}

.swatch::after {
  position: absolute;
  inset: -4px;
  border: 1px solid transparent;
  border-radius: 50%;
  content: "";
}

.swatch:hover::after,
.swatch:focus-visible::after,
.swatch.is-active::after {
  border-color: var(--swatch);
}

.custom-color {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.custom-color input {
  width: 20px;
  height: 20px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.print-button {
  width: 100%;
  margin-top: 12px;
  padding: 8px 6px;
  border: 1px solid var(--accent);
  color: #fff;
  background: var(--accent);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.print-button:hover,
.print-button:focus-visible {
  color: var(--accent);
  background: #fff;
  outline: none;
}

.tweak-body small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.tweak-panel.is-collapsed {
  width: 110px;
}

.tweak-panel.is-collapsed .tweak-body {
  display: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  .preview-shell {
    padding: 24px 16px 160px;
  }

  .tweak-panel {
    top: auto;
    right: 12px;
    bottom: 12px;
    width: 132px;
  }
}

@media (max-width: 720px) {
  .preview-shell {
    display: block;
    padding: 12px 12px 152px;
  }

  .resume {
    width: 100%;
    min-height: auto;
    padding: 28px 24px 30px;
  }

  .resume-header {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .identity h1 {
    font-size: 30px;
  }

  .identity p {
    font-size: 13px;
  }

  .contact-list {
    grid-template-columns: 1fr;
    gap: 5px;
    font-size: 12px;
    text-align: left;
  }

  .statement {
    margin: 30px 0;
  }

  .statement p {
    font-size: 14px;
    line-height: 1.75;
  }

  .numbered-section {
    grid-template-columns: 42px 1px 1fr;
    column-gap: 16px;
    margin-top: 34px;
  }

  .section-index {
    font-size: 38px;
  }

  .section-content h2 {
    font-size: 24px;
  }

  .role-meta {
    flex-direction: column;
    gap: 3px;
    font-size: 11px;
  }

  .role-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0 18px;
    font-size: 13px;
  }

  .contribution-list li,
  .compact-list li {
    padding-left: 20px;
    font-size: 13px;
    line-height: 1.7;
  }

  .experience-previous .section-content h2 {
    font-size: 19px;
  }

  .practice-list {
    gap: 7px;
    font-size: 12px;
  }

  .practice-list > div {
    grid-template-columns: 78px 1fr;
    gap: 10px;
  }

  .education {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    margin-top: 34px;
    font-size: 11px;
  }

  .education > span:not(:last-child)::after,
  .education time::after {
    content: none;
  }
}

@page {
  size: A4;
  margin: 0;
}

@media print {
  html,
  body {
    width: 210mm;
    height: 297mm;
    background: #fff !important;
  }

  body {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .tweak-panel {
    display: none !important;
  }

  .preview-shell {
    display: block;
    min-height: 0;
    padding: 0;
  }

  .resume {
    width: 210mm;
    min-height: 297mm;
    max-height: 297mm;
    padding: 18mm 18mm 14mm;
    box-shadow: none;
  }
}
