:root {
  --print-width: 210mm;
  --print-height: 297mm;
  --screen-width: 1080px;
  --accent: #2563eb;
  --accent-soft: #eaf1ff;
  --rust: #d97757;
  --ink: #141414;
  --muted: #667085;
  --hairline: #dbe2ea;
  --panel: #f7f9fc;
  --screen-bg: #eef2f7;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    linear-gradient(180deg, #eef2f7 0%, #f8fafc 46%, #eef2f7 100%);
  color: var(--ink);
  font-family: "Noto Sans CJK SC", "Microsoft YaHei", "PingFang SC", "Heiti SC", Arial, sans-serif;
  line-height: 1.2;
}

.icon-sprite {
  display: none;
}

.icon,
.section-icon {
  display: inline-block;
  fill: none;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.icon {
  height: 16px;
  width: 16px;
}

.toolbar {
  align-items: center;
  backdrop-filter: blur(12px);
  background: rgba(238, 242, 247, 0.92);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin: 0 auto;
  padding: 12px 0;
  position: sticky;
  top: 0;
  width: min(var(--screen-width), calc(100% - 24px));
  z-index: 100;
}

.print-button,
.source-link {
  align-items: center;
  background: #101828;
  border: 1px solid #101828;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  height: 38px;
  justify-content: center;
  padding: 0 16px;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.print-button:hover,
.source-link:hover {
  box-shadow: 0 10px 22px rgba(16, 24, 40, 0.14);
  transform: translateY(-1px);
}

.source-link {
  background: #fff;
  border-color: var(--hairline);
  color: #101828;
}

.home-link span {
  font-size: 18px;
  line-height: 1;
}

.page {
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.14);
  margin: 0 auto 32px;
  min-height: 1120px;
  overflow: visible;
  padding: 38px 46px 46px;
  width: min(calc(100vw - 48px), var(--screen-width));
}

.resume-header {
  align-items: stretch;
  background: #fff;
  border: 1px solid #dbe2ea;
  border-radius: 4px;
  border-top: 4px solid #111827;
  display: grid;
  gap: 26px;
  grid-template-columns: 124px minmax(0, 1fr);
  margin-bottom: 24px;
  padding: 22px 24px 24px;
  text-align: left;
}

.photo-frame {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 4px;
  box-shadow: none;
  display: flex;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}

.profile-photo {
  aspect-ratio: 2 / 3;
  background: #dbeafe;
  border-radius: 4px;
  display: block;
  height: 156px;
  object-fit: contain;
  object-position: center;
  width: 104px;
}

.profile-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.eyebrow {
  color: #475467;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  line-height: 1.2;
  margin: 0 0 7px;
  text-transform: uppercase;
}

.name-row {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 18px;
}

.resume-header h1 {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.05;
  margin: 0;
}

.identity-line {
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 4px;
}

.contact-line {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  font-size: 14.5px;
  gap: 9px;
  justify-content: flex-start;
  letter-spacing: 0;
  margin: 0;
}

.contact-line a,
.contact-line span {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #dbe2ea;
  border-radius: 4px;
  color: #1f2937;
  display: inline-flex;
  gap: 8px;
  min-height: 32px;
  padding: 5px 10px;
  text-decoration: none;
  width: auto;
}

.contact-line a {
  color: #1f2937;
}

.contact-line a:hover {
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--accent);
}

.project-link {
  color: inherit;
  text-decoration: none;
}

.project-link:hover {
  text-decoration: underline;
}

.section {
  margin-top: 22px;
}

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

.section h2 {
  align-items: center;
  color: #101828;
  display: flex;
  font-size: 19px;
  font-weight: 800;
  gap: 9px;
  line-height: 1.05;
  margin: 0 0 12px;
  position: relative;
}

.section h2::after {
  background: linear-gradient(90deg, var(--accent) 0%, rgba(37, 99, 235, 0.12) 100%);
  content: "";
  flex: 1;
  height: 2px;
  margin-left: 4px;
}

.section-icon {
  background: var(--accent-soft);
  border-radius: 8px;
  color: var(--accent);
  height: 28px;
  padding: 6px;
  width: 28px;
}

.education-grid {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  display: grid;
  font-size: 16px;
  grid-template-columns: 1.25fr 1.1fr 1fr;
  line-height: 1.45;
  margin-bottom: 10px;
  padding: 10px 14px;
  row-gap: 4px;
}

.education-grid div:nth-child(3n) {
  color: var(--muted);
  font-weight: 700;
  text-align: right;
}

.info-line {
  font-size: 16px;
  line-height: 1.15;
  margin: 5px 0 0;
}

.info-line strong {
  font-size: 16px;
  font-weight: 800;
}

.experience {
  border-left: 3px solid var(--accent-soft);
  margin-top: 18px;
  padding-left: 16px;
  position: relative;
}

.experience::before {
  background: var(--accent);
  border: 3px solid #fff;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
  content: "";
  height: 9px;
  left: -6px;
  position: absolute;
  top: 4px;
  width: 9px;
}

.experience:first-of-type {
  margin-top: 0;
}

.entry-head {
  align-items: start;
  display: grid;
  font-size: 16px;
  grid-template-columns: 1.25fr 1.1fr 1fr;
  line-height: 1.2;
  margin-bottom: 10px;
}

.entry-head strong {
  font-weight: 800;
}

.project-head {
  grid-template-columns: minmax(0, 1fr) auto;
}

.company-title {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.company-logo {
  display: block;
  flex: 0 0 auto;
  height: 24px;
  object-fit: contain;
  width: 24px;
}

.entry-head span {
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.project-head span {
  text-align: right;
}

.project-title {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.project-title img {
  height: 22px;
  width: 22px;
}

.experience h3 {
  color: #1f2937;
  font-size: 16.5px;
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 6px;
}

.project-stat {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  color: #9a3412;
  display: inline-block;
  font-size: 0.82em;
  font-weight: 700;
  margin-left: 8px;
  padding: 2px 8px;
}

.summary {
  font-size: 15.5px;
  line-height: 1.32;
  margin: 0 0 4px;
  text-align: justify;
}

.experience ul {
  font-size: 15.5px;
  line-height: 1.32;
  list-style-position: outside;
  margin: 0;
  padding-left: 21px;
}

.experience li {
  margin: 5px 0 0;
  padding-left: 3px;
}

.experience li::marker {
  color: var(--accent);
  font-size: 0.9em;
}

.experience li strong {
  font-weight: 800;
}

.skills-section {
  margin-top: 20px;
}

.skills-list {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  columns: 2;
  column-gap: 28px;
  font-size: 15.5px;
  line-height: 1.35;
  list-style: none;
  margin: 0;
  padding: 12px 14px;
}

.skills-list li {
  break-inside: avoid;
  margin-top: 4px;
  padding-left: 13px;
  position: relative;
}

.skills-list li::before {
  background: var(--rust);
  border-radius: 999px;
  content: "";
  height: 5px;
  left: 0;
  position: absolute;
  top: 8px;
  width: 5px;
}

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

@media screen and (max-width: 760px) {
  .toolbar {
    padding: 10px 0;
  }

  .page {
    border: 0;
    box-shadow: none;
    min-height: 0;
    padding: 28px 20px 34px;
    width: 100vw;
  }

  .resume-header {
    border-top-width: 3px;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 18px;
    text-align: center;
  }

  .photo-frame {
    margin: 0 auto;
    width: max-content;
  }

  .profile-photo {
    height: 148px;
    width: 99px;
  }

  .name-row {
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
  }

  .contact-line a,
  .contact-line span {
    justify-content: center;
  }

  .education-grid,
  .entry-head {
    grid-template-columns: 1fr;
    row-gap: 3px;
  }

  .education-grid div:nth-child(3n),
  .entry-head span {
    text-align: left;
  }

  .contact-line {
    gap: 7px;
    justify-content: center;
  }

  .skills-list {
    columns: 1;
  }
}

@media print {
  html,
  body {
    background: #fff;
    min-height: var(--print-height);
    width: var(--print-width);
  }

  .toolbar {
    display: none;
  }

  .page {
    border: 0;
    box-shadow: none;
    min-height: var(--print-height);
    margin: 0;
    overflow: visible;
    padding: 11mm 9mm 9mm;
    width: var(--print-width);
  }

  .resume-header {
    background: #fff;
    border-color: #d7dde6;
    border-radius: 0;
    border-top: 2px solid #111827;
    gap: 12px;
    grid-template-columns: 58px 1fr;
    margin-bottom: 12px;
    padding: 8mm 0 5mm;
  }

  .photo-frame {
    border-radius: 4px;
    box-shadow: none;
    padding: 0;
  }

  .profile-photo {
    border-radius: 2px;
    height: 72px;
    width: 48px;
  }

  .resume-header h1 {
    font-size: 24px;
  }

  .eyebrow {
    font-size: 9px;
    margin-bottom: 4px;
  }

  .identity-line {
    font-size: 12px;
    margin-bottom: 1px;
  }

  .name-row {
    gap: 8px;
    margin-bottom: 7px;
  }

  .contact-line {
    font-size: 11px;
    gap: 4px;
  }

  .contact-line a,
  .contact-line span {
    border: 0;
    min-height: 0;
    padding: 0;
  }

  .section h2 {
    font-size: 16px;
    margin-bottom: 7px;
  }

  .section-icon {
    height: 20px;
    padding: 4px;
    width: 20px;
  }

  .education-grid,
  .skills-list {
    background: #fff;
    border-color: #d7dde6;
    border-radius: 0;
  }

  .education-grid,
  .entry-head,
  .info-line,
  .info-line strong {
    font-size: 14px;
  }

  .experience h3 {
    font-size: 15px;
  }

  .summary,
  .experience ul,
  .skills-list {
    font-size: 13px;
  }

  .section {
    margin-top: 12px;
  }

  .experience {
    border-left-color: #dbeafe;
    margin-top: 11px;
    padding-left: 10px;
  }

  .experience::before {
    height: 6px;
    left: -5px;
    width: 6px;
  }

  .project-title img {
    height: 16px;
    width: 16px;
  }

  .company-logo {
    height: 16px;
    width: 16px;
  }

  .skills-list {
    columns: 2;
    padding: 7px 8px;
  }
}

/* ══ 王林曦：收紧到一页（内容比模板 demo 多一个项目）══════
   只动尺寸与间距，不改配色与结构。要回到模板默认，删掉本段即可。 */
.page { padding: 30px 40px 34px; }
.section + .section { margin-top: 14px; }
.section h2 { font-size: 18px; margin-bottom: 9px; }
.experience { margin-top: 10px; }
.experience:first-of-type { margin-top: 0; }
.experience h3 { font-size: 15.5px; margin-bottom: 4px; }
.experience li,
.summary { font-size: 14.6px; line-height: 1.52; }
.summary { margin-bottom: 3px; }
.experience li + li { margin-top: 2px; }
.info-line { font-size: 14.6px; line-height: 1.5; margin-top: 3px; }
.skills-list li { font-size: 14.6px; line-height: 1.5; }
.education-grid { row-gap: 3px; font-size: 14.8px; }
.resume-header { padding-bottom: 12px; }
.duty { margin: 2px 0 4px; font-size: 14.6px; line-height: 1.5; color: var(--ink); }
.duty strong { color: var(--ink); }

/* 避免孤行：最后一行只剩一两个字时，自动把上一行的字挤下来 */
.summary, .effect, .duty, .info-line,
.experience li, .skills-list li, .education-grid div {
  text-wrap: pretty;
}

/* 加粗标签整体不断行，避免「目标」被拆成「目 / 标」 */
.summary > strong, .effect > strong, .duty > strong, .info-line > strong,
.experience li > strong, .skills-list li > strong { white-space: nowrap; }

/* 背景 / 目标 / 效果 三行等距，行距与正文一致 */
.summary, .goal, .effect { margin: 0; font-size: 14.6px; line-height: 1.52; color: var(--ink, #141414); }
.summary { margin-top: 6px; }
.goal strong, .effect strong { color: var(--ink, #141414); }
.summary > strong, .goal > strong, .effect > strong { white-space: nowrap; }

/* 我的职责与上面三行同高同距 */
.duty { margin: 0; font-size: 14.6px; line-height: 1.52; }
.experience ul { margin-top: 4px; }

.nb { white-space: nowrap; }

/* ══ 屏幕端连续响应式缩放（打印规格保持独立）════════════
   桌面宽度变化时所有字号、头像、控件、间距同步变化；
   760px 以下再转为单列，避免把正文机械缩到不可阅读。 */
@media screen {
  :root {
    --screen-width: clamp(1080px, 78vw, 1320px);
    --resume-caption: clamp(11px, calc(10px + .18vw), 13.5px);
    --resume-small: clamp(13px, calc(11.8px + .18vw), 15.5px);
    --resume-body: clamp(14.2px, calc(13px + .18vw), 16.4px);
    --resume-heading: clamp(16.5px, calc(14.5px + .28vw), 20px);
    --resume-name: clamp(32px, calc(26px + 1vw), 45px);
    --resume-page-x: clamp(24px, 3.2vw, 52px);
    --resume-page-y: clamp(24px, 2.5vw, 38px);
    --resume-gap: clamp(8px, .8vw, 12px);
    --resume-radius: clamp(5px, .65vw, 10px);
  }

  body { overflow-x: hidden; }

  .toolbar {
    gap: clamp(8px, .75vw, 12px);
    padding: clamp(9px, .8vw, 13px) 0;
    width: min(var(--screen-width), calc(100% - clamp(24px, 4vw, 56px)));
  }

  .print-button,
  .source-link {
    gap: clamp(6px, .5vw, 9px);
    height: clamp(34px, calc(29px + .65vw), 40px);
    padding-inline: clamp(12px, 1vw, 18px);
    font-size: var(--resume-small);
  }

  .icon { width: clamp(14px, 1.05vw, 17px); height: clamp(14px, 1.05vw, 17px); }
  .home-link span { font-size: clamp(16px, 1.2vw, 20px); }

  .page {
    width: min(calc(100vw - clamp(32px, 4vw, 72px)), var(--screen-width));
    min-height: 0;
    margin-bottom: clamp(22px, 2.2vw, 36px);
    padding: var(--resume-page-y) var(--resume-page-x) clamp(30px, 2.8vw, 44px);
  }

  .resume-header {
    grid-template-columns: clamp(108px, 9vw, 142px) minmax(0, 1fr);
    gap: clamp(18px, 1.8vw, 28px);
    margin-bottom: clamp(18px, 1.6vw, 26px);
    padding: clamp(18px, 1.5vw, 24px) clamp(18px, 1.7vw, 26px) clamp(16px, 1.5vw, 24px);
    border-radius: clamp(3px, .35vw, 5px);
    border-top-width: clamp(3px, .28vw, 4px);
  }

  .profile-photo {
    width: clamp(92px, 7.2vw, 118px);
    height: auto;
    border-radius: clamp(3px, .35vw, 5px);
  }

  .eyebrow { margin-bottom: clamp(5px, .45vw, 8px); font-size: var(--resume-caption); }
  .name-row { gap: clamp(9px, .9vw, 16px); margin-bottom: clamp(13px, 1.2vw, 18px); }
  .resume-header h1 { font-size: var(--resume-name); }
  .identity-line { font-size: clamp(14px, calc(12.5px + .24vw), 17px); }
  .contact-line { gap: clamp(6px, .65vw, 10px); font-size: var(--resume-small); }
  .contact-line a,
  .contact-line span {
    gap: clamp(6px, .5vw, 9px);
    min-height: clamp(29px, 2.2vw, 34px);
    padding: clamp(4px, .35vw, 6px) clamp(8px, .65vw, 11px);
    border-radius: clamp(3px, .3vw, 5px);
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .section { margin-top: clamp(15px, 1.45vw, 22px); }
  .section + .section { margin-top: clamp(12px, 1.15vw, 18px); }
  .section h2 { gap: clamp(7px, .65vw, 10px); margin-bottom: clamp(7px, .75vw, 11px); font-size: var(--resume-heading); }
  .section-icon {
    width: clamp(24px, 1.9vw, 29px);
    height: clamp(24px, 1.9vw, 29px);
    padding: clamp(5px, .4vw, 6px);
    border-radius: clamp(6px, .55vw, 9px);
  }

  .education-grid {
    padding: clamp(8px, .75vw, 11px) clamp(10px, 1vw, 15px);
    margin-bottom: clamp(8px, .7vw, 11px);
    row-gap: clamp(3px, .28vw, 5px);
    border-radius: var(--resume-radius);
    font-size: clamp(14.2px, calc(13px + .2vw), 16.8px);
  }
  .info-line,
  .info-line strong,
  .summary,
  .goal,
  .effect,
  .duty,
  .experience li,
  .skills-list li { font-size: var(--resume-body); }
  .info-line { margin-top: clamp(2px, .25vw, 4px); }

  .experience {
    margin-top: clamp(8px, .8vw, 12px);
    padding-left: clamp(12px, 1.15vw, 17px);
    border-left-width: clamp(2px, .2vw, 3px);
  }
  .experience::before {
    width: clamp(7px, .65vw, 10px);
    height: clamp(7px, .65vw, 10px);
    left: clamp(-6px, -.42vw, -4px);
  }
  .entry-head {
    margin-bottom: clamp(7px, .65vw, 10px);
    font-size: clamp(14.2px, calc(13px + .2vw), 16.8px);
  }
  .experience h3 { margin-bottom: clamp(3px, .35vw, 5px); font-size: clamp(14.8px, calc(13.6px + .2vw), 17.2px); }
  .project-stat { margin-left: clamp(5px, .5vw, 8px); padding: clamp(1px, .18vw, 3px) clamp(6px, .5vw, 9px); }
  .summary { margin-top: clamp(4px, .42vw, 6px); }
  .experience ul { margin-top: clamp(3px, .35vw, 5px); padding-left: clamp(18px, 1.5vw, 22px); }
  .experience li { margin-top: clamp(2px, .3vw, 5px); }
  .experience li + li { margin-top: clamp(1px, .18vw, 3px); }

  .company-logo { width: clamp(20px, 1.6vw, 24px); height: clamp(20px, 1.6vw, 24px); }
  .project-title img { width: clamp(19px, 1.5vw, 23px); height: clamp(19px, 1.5vw, 23px); }

  .skills-section { margin-top: clamp(16px, 1.5vw, 22px); }
  .skills-list {
    column-gap: clamp(20px, 2vw, 30px);
    padding: clamp(9px, .85vw, 13px) clamp(10px, 1vw, 15px);
    border-radius: var(--resume-radius);
    font-size: var(--resume-body);
  }
  .skills-list li { margin-top: clamp(2px, .3vw, 5px); padding-left: clamp(11px, .9vw, 14px); }
}

@media screen and (max-width: 760px) {
  :root {
    --resume-page-x: clamp(17px, 4.8vw, 28px);
    --resume-page-y: clamp(22px, 4.6vw, 30px);
  }
  .toolbar { width: calc(100% - 24px); }
  .page { width: 100%; margin-bottom: 0; border: 0; box-shadow: none; }
  .resume-header {
    grid-template-columns: 1fr;
    gap: clamp(13px, 2.8vw, 17px);
    padding: clamp(15px, 3.5vw, 20px);
    text-align: center;
  }
  .photo-frame { width: max-content; margin-inline: auto; }
  .profile-photo { width: clamp(86px, 18vw, 100px); }
  .name-row { align-items: center; justify-content: center; }
  .contact-line { justify-content: center; }
  .contact-line a,
  .contact-line span { justify-content: center; }
  .education-grid,
  .entry-head { grid-template-columns: 1fr; row-gap: clamp(2px, .7vw, 4px); }
  .education-grid div:nth-child(3n),
  .entry-head span { text-align: left; }
  .skills-list { columns: 1; }
}

@media screen and (max-width: 480px) {
  :root {
    --resume-caption: 11px;
    --resume-small: clamp(12.4px, 3.3vw, 13px);
    --resume-body: clamp(13.6px, 3.6vw, 14.2px);
    --resume-heading: clamp(15.5px, 4vw, 16.5px);
    --resume-name: clamp(30px, 8.5vw, 34px);
  }
  .toolbar { flex-wrap: wrap; }
  .print-button,
  .source-link { min-width: 0; white-space: nowrap; }
  .page { padding-inline: clamp(15px, 4.5vw, 20px); }
  .resume-header { padding-inline: clamp(13px, 4vw, 18px); }
  .profile-photo { width: clamp(84px, 24vw, 96px); }
  .identity-line { font-size: clamp(13px, 3.7vw, 14px); line-height: 1.45; }
  .contact-line { align-items: stretch; }
  .contact-line a,
  .contact-line span { width: 100%; justify-content: flex-start; }
  .project-head span { text-align: left; }
  .project-stat { white-space: nowrap; }
  .project-link { overflow-wrap: anywhere; }
}
