:root {
  --page-width: 210mm;
  --page-height: 297mm;
  --effective-scale: 1;
  --page-gap: 18px;
  --stage-width: 210mm;
  --stage-height: 297mm;
  --canvas-bg: #eef2f7;
  --paper-bg: #ffffff;
  --text-main: #1f2937;
  --text-soft: #5b6472;
  --line-soft: #dbe3ec;
  --accent: #2563eb;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
  --font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --fs-body: 12.5px;
  --fs-meta: 12px;
  --fs-h1: 30px;
  --fs-h2: 14px;
  --fs-h3: 14px;
  --lh-body: 1.5;
  --page-padding: 14mm;
  --radius: 20px;
  --header-gap: 20px;
  --meta-column-gap: 34px;
  --avatar-width: 112px;
  --avatar-height: 112px;
  --avatar-offset-top: -4px;
  --mobile-header-aside-width: 78px;
  --space-section-top: 12px;
  --space-heading-gap: 10px;
  --space-heading-bottom: 8px;
  --space-item-gap: 14px;
  --space-item-head-gap: 16px;
  --space-item-head-bottom: 8px;
  --space-subtitle-top: 4px;
  --space-list-top: 8px;
  --space-tag-gap: 6px;
  --space-tag-top: 8px;
  --space-tag-bottom: 6px;
  --space-after-banner: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-width: 0;
  font-family: var(--font-family);
  color: var(--text-main);
  background: linear-gradient(180deg, #f7f9fc 0%, var(--canvas-bg) 100%);
  scrollbar-gutter: stable;
}

body {
  line-height: var(--lh-body);
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.7) rgba(226, 232, 240, 0.72);
}

button,
h1,
h2,
h3,
p,
ul {
  margin: 0;
}

ul {
  padding-left: 18px;
}

li + li {
  margin-top: 4px;
}

.page-shell {
  min-height: 100vh;
  width: 100%;
  padding: 40px 32px 88px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

body::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

body::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.7);
  border-radius: 999px;
}

body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.92), rgba(100, 116, 139, 0.88));
  border: 2px solid rgba(226, 232, 240, 0.86);
  border-radius: 999px;
}

body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(100, 116, 139, 0.95), rgba(71, 85, 105, 0.95));
}

.resume-stage {
  width: var(--stage-width);
  max-width: 100%;
  min-width: min(var(--stage-width), 100%);
  min-height: var(--stage-height);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  transition: width 180ms ease, min-height 180ms ease;
}

.resume-document {
  width: var(--page-width);
  transform: scale(var(--effective-scale));
  transform-origin: top center;
}

html.js .resume-document[data-js-ready="false"] {
  visibility: hidden;
}

.resume-source,
.resume-page {
  width: var(--page-width);
  min-height: var(--page-height);
  font-size: var(--fs-body);
  padding: var(--page-padding);
  background: var(--paper-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.resume-source {
  display: block;
}

.resume-pages {
  display: none;
}

.resume-document[data-js-ready="true"]:not([data-layout-mode="mobile"]) .resume-source {
  display: none;
}

.resume-document[data-js-ready="true"]:not([data-layout-mode="mobile"]) .resume-pages {
  display: grid;
  gap: var(--page-gap);
}

.resume-page {
  display: flex;
  flex-direction: column;
  height: var(--page-height);
  overflow: hidden;
}

.resume-page-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.resume-page--continuation {
  padding-top: 12mm;
}

.resume-page-banner {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}

.resume-page-banner span {
  font-size: var(--fs-meta);
  color: var(--text-soft);
}

.resume-page--continuation .resume-page-content > .resume-section:first-child {
  margin-top: var(--space-after-banner);
}

.resume-page-content > .resume-section:first-child {
  margin-top: 2px;
}

.resume-header {
  display: grid;
  grid-template-columns: 1fr auto var(--avatar-width);
  align-items: flex-start;
  column-gap: var(--header-gap);
  row-gap: 8px;
  padding-bottom: 4px;
  border-bottom: 0;
}

.resume-header > :first-child {
  grid-column: 1 / 3;
}

.resume-header h1 {
  margin-top: 0;
  font-size: var(--fs-h1);
  line-height: 1.15;
  color: #000000;
}

.identity-meta {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  column-gap: var(--meta-column-gap);
  row-gap: 6px;
  font-size: var(--fs-meta);
  text-align: left;
  color: var(--text-soft);
  white-space: nowrap;
  justify-content: start;
}

.identity-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.identity-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.identity-action:hover {
  color: #1d4ed8;
}

.identity-action:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
  border-radius: 4px;
}

.identity-meta svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  fill: currentColor;
}

.resume-avatar {
  grid-column: 3;
  grid-row: 1 / span 2;
  width: var(--avatar-width);
  height: var(--avatar-height);
  border-radius: 4px;
  align-self: start;
  margin-top: var(--avatar-offset-top);
  background-image: var(--avatar-image);
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-user-drag: none;
}

.resume-section {
  margin-top: var(--space-section-top);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: var(--space-heading-gap);
  margin-bottom: var(--space-heading-bottom);
}

.section-heading::before {
  content: "";
  width: 4px;
  height: 14px;
  border-radius: 999px;
  background: var(--accent);
}

.section-heading h2 {
  font-size: var(--fs-h2);
  letter-spacing: 0.06em;
}

.summary {
  font-size: 1em;
  line-height: var(--lh-body);
  color: var(--text-main);
}

.timeline-item li {
  font-size: 1em;
  line-height: var(--lh-body);
}

.timeline-item {
  max-width: 100%;
  break-inside: avoid;
  page-break-inside: avoid;
}

.timeline-item + .timeline-item {
  margin-top: var(--space-item-gap);
}

.item-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-item-head-gap);
  align-items: flex-start;
  margin-bottom: var(--space-item-head-bottom);
}

.timeline-item h3 {
  letter-spacing: -0.01em;
  font-size: var(--fs-h3);
  line-height: 1.4;
}

.item-subtitle,
.item-time {
  font-size: var(--fs-meta);
  color: var(--text-soft);
}

.item-head .item-subtitle:not(.tag-list) {
  margin-top: var(--space-subtitle-top);
}

.item-subtitle.tag-list {
  margin-top: var(--space-tag-top);
  margin-bottom: var(--space-tag-bottom);
}

.timeline-item ul {
  margin-top: var(--space-list-top);
}

.tag-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-tag-gap);
}

.tag-list li {
  margin: 0;
  padding: 4px 8px;
  border: 1px solid #d7e3ff;
  border-radius: 999px;
  color: #1849b8;
  background: #f3f7ff;
  font-size: 11px;
  line-height: 1.35;
}

.floating-toolbar {
  position: fixed;
  right: 28px;
  bottom: 28px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
}

.tool-button {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 14px;
  background: #f8fafc;
  color: var(--text-main);
  font-size: 22px;
  cursor: pointer;
  transition: transform 140ms ease, background-color 140ms ease, color 140ms ease;
}

.tool-button:hover {
  background: #e8efff;
  color: var(--accent);
  transform: translateY(-1px);
}

.tool-button:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.tool-button:disabled {
  cursor: not-allowed;
  color: #9aa4b2;
  background: #f1f5f9;
  transform: none;
}

.reset-button {
  width: 72px;
  font-size: 14px;
  font-weight: 700;
}

@media (max-width: 1280px) {
  .page-shell {
    padding-left: 20px;
    padding-right: 96px;
  }
}

@media (max-width: 1024px) {
  :root {
    --fs-h1: 24px;
    --header-gap: 18px;
    --meta-column-gap: 20px;
    --avatar-width: 96px;
    --avatar-height: 96px;
  }

  .page-shell {
    padding: 28px 20px 88px;
  }

  .floating-toolbar {
    right: 20px;
    bottom: 20px;
  }
}

@media (max-width: 767px) {
  :root {
    --fs-body: 10px;
    --fs-meta: 8.5px;
    --fs-h1: 16px;
    --fs-h2: 11px;
    --fs-h3: 10.5px;
    --lh-body: 1.5;
    --page-padding: 10px;
    --radius: 12px;
    --meta-column-gap: 10px;
    --avatar-width: 60px;
    --avatar-height: 60px;
    --avatar-offset-top: 0;
    --space-heading-gap: 8px;
    --space-heading-bottom: 7px;
    --space-item-gap: 10px;
    --space-item-head-gap: 10px;
    --space-item-head-bottom: 6px;
    --space-list-top: 5px;
    --space-tag-gap: 4px;
    --space-tag-top: 4px;
    --space-tag-bottom: 4px;
    --space-after-banner: 14px;
  }

  .page-shell {
    width: 100%;
    padding: 10px 8px 18px;
    display: block;
  }

  .resume-stage {
    width: 100%;
    min-width: 0;
    min-height: auto;
    display: block;
  }

  .resume-document {
    width: 100%;
    transform: none;
  }

  .resume-source,
  .resume-page {
    width: 100%;
    min-height: auto;
    height: auto;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.12);
  }

  .resume-source {
    display: block;
  }

  .resume-page--continuation {
    padding-top: var(--page-padding);
  }

  .resume-page-banner {
    padding-bottom: 6px;
  }

  ul {
    padding-left: 14px;
  }

  .resume-header {
    position: relative;
    display: block;
    padding-right: var(--mobile-header-aside-width);
    padding-bottom: 4px;
    border-bottom: 0;
  }

  .resume-header > :first-child {
    grid-column: auto;
  }

  .resume-header h1 {
    line-height: 1.15;
  }

  .resume-avatar {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    margin-top: 0;
  }

  .identity-meta {
    grid-template-columns: repeat(2, max-content);
    row-gap: 4px;
    justify-content: start;
    max-width: calc(100% - var(--mobile-header-aside-width));
    margin-top: 6px;
  }

  .identity-meta svg {
    width: 10px;
    height: 10px;
    flex-basis: 10px;
  }

  .identity-action {
    gap: 4px;
  }

  .section-heading::before {
    width: 3px;
    height: 12px;
  }

  .tag-list li {
    padding: 2px 6px;
    font-size: 8px;
    line-height: 1.25;
  }

  .floating-toolbar {
    display: none;
  }
}

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

  html,
  body {
    min-width: auto;
    background: #ffffff;
  }

  .page-shell {
    width: auto;
    padding: 0;
    display: block;
  }

  .resume-stage {
    width: var(--page-width);
    min-width: 0;
    min-height: auto;
    display: block;
  }

  .resume-document {
    width: var(--page-width);
    transform: none;
  }

  .resume-source {
    display: none;
  }

  .resume-pages {
    display: grid;
    gap: 0;
  }

  .resume-page {
    height: var(--page-height);
    border-radius: 0;
    box-shadow: none;
    break-after: page;
    page-break-after: always;
  }

  .resume-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .floating-toolbar {
    display: none;
  }
}
