:root {
  /* 字体替换入口：默认全部使用本机字体，不联网加载。 */
  --font-profile-cn: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  --font-profile-en: Georgia, "Times New Roman", serif;
  --font-western-title: Rockwell, "Roboto Slab", Georgia, serif;

  --ink: #2b1509;
  --ink-soft: #593518;
  --parchment: #d7aa6a;
  --parchment-light: #e6c48d;
  --brass: #d59328;
  --brass-light: #f6c55b;
  --wood: #241307;
  --teal: #164e4b;
  --safe-top: max(14px, env(safe-area-inset-top));
  --safe-bottom: max(14px, env(safe-area-inset-bottom));
}

/* 如需使用本地字体：把字体文件放进 assets/fonts，然后取消注释并修改文件名。
@font-face {
  font-family: "PortfolioCN";
  src: url("assets/fonts/your-cn-font.woff2") format("woff2");
  font-display: swap;
}
*/

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: #120a04;
}

body {
  margin: 0;
  color: var(--ink);
  background: #120a04;
  font-family: var(--font-profile-cn);
}

button,
a {
  font: inherit;
}

.screen {
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #120a04;
}

.visual-frame {
  position: relative;
  width: min(100vw, calc(100svh * 16 / 9));
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.stage-image,
.hero-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-frame {
  background: #070402;
}

.hero-video {
  object-fit: contain;
}

.profile-screen {
  position: relative;
  background: #120a04;
}

.profile-editor-toolbar {
  position: absolute;
  z-index: 20;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  max-width: calc(100% - 20px);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  border: 1px solid #9b672d;
  border-radius: 8px;
  color: #f2dbaf;
  background: rgb(32 17 7 / 94%);
  box-shadow: 0 8px 28px rgb(0 0 0 / 40%);
  backdrop-filter: blur(4px);
}

.profile-image-toolbar {
  position: absolute;
  z-index: 20;
  top: max(10px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  max-width: calc(100% - 20px);
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #9b672d;
  border-radius: 8px;
  color: #f2dbaf;
  background: rgb(32 17 7 / 94%);
  box-shadow: 0 8px 28px rgb(0 0 0 / 40%);
  backdrop-filter: blur(4px);
}

.editor-hint {
  padding-inline: 5px;
  color: #caa46c;
  font-size: 12px;
  white-space: nowrap;
}

.editor-control {
  min-height: 34px;
  padding: 4px 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgb(221 171 90 / 28%);
  border-radius: 5px;
  font-size: 12px;
  white-space: nowrap;
}

.editor-control input[type="color"] {
  width: 28px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.editor-control input[type="range"] {
  width: 82px;
  accent-color: #d99a3c;
}

.editor-control output {
  min-width: 20px;
  text-align: right;
}

.editor-button {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #a66a1d;
  border-radius: 5px;
  color: #f5deb1;
  background: linear-gradient(#6f421b, #4b280f);
  cursor: pointer;
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
}

.editor-button:hover,
.editor-button:focus-visible {
  border-color: #e4ad4d;
  background: linear-gradient(#865323, #5b3214);
}

.export-button {
  border-color: #d59632;
  background: linear-gradient(#a36b21, #704211);
  font-weight: 800;
}

.profile-stage {
  container-type: inline-size;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 18% 14%, rgb(161 94 36 / 20%), transparent 25%),
    repeating-linear-gradient(2deg, rgb(255 255 255 / 2%) 0 2px, transparent 2px 14px),
    linear-gradient(90deg, #271306, #4a2710 21%, #2b1508 48%, #512b11 74%, #241105);
  isolation: isolate;
  touch-action: pan-y;
}

.profile-sheet {
  position: absolute;
  z-index: -1;
  left: 9.7%;
  top: 4.7%;
  width: 80.6%;
  height: 90.5%;
  background:
    radial-gradient(circle at 20% 25%, rgb(255 245 206 / 23%) 0 1px, transparent 2px),
    repeating-linear-gradient(0deg, transparent 0 6px, rgb(103 54 18 / 3%) 7px),
    linear-gradient(135deg, #e7c68b, #d5a667 48%, #e3be82);
  border: max(2px, 0.24cqw) solid #6e3a15;
  box-shadow:
    0 1.2cqw 2.5cqw rgb(0 0 0 / 55%),
    inset 0 0 0 max(2px, 0.22cqw) rgb(248 220 164 / 42%),
    inset 0 0 2.5cqw rgb(100 51 15 / 30%);
}

.profile-sheet::before,
.profile-sheet::after {
  content: "";
  position: absolute;
  inset: 2%;
  border: max(1px, 0.11cqw) solid rgb(96 49 16 / 55%);
  pointer-events: none;
}

.profile-sheet::after {
  inset: 3%;
  border-style: double;
}

.profile-corner {
  position: absolute;
  z-index: 3;
  width: 10.3%;
  height: 18.8%;
  display: grid;
  place-items: center;
  color: #e4a646;
  background: linear-gradient(135deg, #8a4a1f, #4a230d 70%);
  border: max(1px, 0.18cqw) solid #d0903b;
  font-size: clamp(10px, 2.1cqw, 36px);
  text-shadow: 0 1px 2px #2b1305;
}

.corner-tl { left: 9.7%; top: 4.7%; clip-path: polygon(0 0, 100% 0, 0 100%); place-items: start; padding: 13% 0 0 15%; }
.corner-tr { right: 9.7%; top: 4.7%; clip-path: polygon(0 0, 100% 0, 100% 100%); place-items: start end; padding: 13% 15% 0 0; }
.corner-bl { left: 9.7%; bottom: 4.8%; clip-path: polygon(0 0, 0 100%, 100% 100%); place-items: end start; padding: 0 0 13% 15%; }
.corner-br { right: 9.7%; bottom: 4.8%; clip-path: polygon(100% 0, 0 100%, 100% 100%); place-items: end; padding: 0 15% 13% 0; }

.profile-wanted {
  position: absolute;
  z-index: 2;
  left: 24.1%;
  top: 7.2%;
  width: 51.8%;
  height: 16.8%;
  display: grid;
  place-content: center;
  text-align: center;
  background: linear-gradient(#e6c185, #d4a363);
  border: max(2px, 0.28cqw) double #653313;
  box-shadow: inset 0 0 1.2cqw rgb(105 53 17 / 25%);
}

.profile-wanted::before,
.profile-wanted::after {
  content: "★";
  position: absolute;
  top: 38%;
  color: #754116;
  font-size: clamp(10px, 1.8cqw, 31px);
}

.profile-wanted::before { left: 4.5%; }
.profile-wanted::after { right: 4.5%; }

.profile-wanted h2 {
  margin: 0;
  font-family: var(--font-western-title);
  font-size: clamp(18px, 5.2cqw, 88px);
  line-height: 0.82;
  letter-spacing: 0.09em;
  text-shadow: 0.08em 0.08em 0 rgb(112 60 20 / 30%);
}

.profile-wanted p {
  margin: 0.85em 0 0;
  font-family: var(--font-profile-en), var(--font-profile-cn);
  font-size: clamp(7px, 1.18cqw, 20px);
  font-weight: 800;
  letter-spacing: 0.09em;
}

.avatar-frame {
  position: absolute;
  z-index: 2;
  left: 18.85%;
  top: 26.6%;
  width: 21%;
  height: 38.6%;
  overflow: hidden;
  background: #a7a7a7;
  border: max(3px, 0.5cqw) double #663514;
  border-radius: 48% 48% 0 0 / 31% 31% 0 0;
  box-shadow:
    0 0 0 max(2px, 0.45cqw) #d6a361,
    0 0 0 max(3px, 0.64cqw) #754016;
  cursor: grab;
  touch-action: none;
}

.avatar-frame.is-dragging {
  cursor: grabbing;
}

.avatar-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 0.45em;
  color: #555;
  background:
    linear-gradient(135deg, transparent 49.6%, rgb(84 84 84 / 22%) 50%, transparent 50.4%),
    linear-gradient(45deg, transparent 49.6%, rgb(84 84 84 / 22%) 50%, transparent 50.4%),
    #b9b9b9;
  text-align: center;
}

.avatar-placeholder strong {
  font-size: clamp(9px, 1.45cqw, 25px);
}

.avatar-placeholder span {
  font-size: clamp(6px, 0.78cqw, 13px);
}

.avatar-frame img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  transform: translate(calc(-50% + var(--avatar-x, 0px)), calc(-50% + var(--avatar-y, 0px))) scale(var(--avatar-scale, 1));
  transform-origin: center;
  user-select: none;
  pointer-events: none;
}

.image-zoom-control {
  position: static;
  width: auto;
  min-width: 150px;
  padding: 4px 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #f3deb9;
  background: transparent;
  font-size: 12px;
}

.image-zoom-control input {
  min-width: 0;
  flex: 1;
  accent-color: #d99a3c;
}

.editable-text {
  cursor: text;
  outline: none;
}

.editable-text:hover {
  box-shadow: inset 0 -1px rgb(109 58 18 / 35%);
}

.editable-text:focus {
  box-shadow: 0 0 0 max(1px, 0.11cqw) #1c6962, inset 0 0 0 max(1px, 0.08cqw) rgb(255 255 255 / 30%);
  background-color: rgb(255 245 215 / 18%);
}

.profile-field {
  position: absolute;
  z-index: 2;
  left: 43.1%;
  width: 41.55%;
  height: 6.8%;
  display: grid;
  grid-template-columns: minmax(0, 45%) minmax(0, 55%);
  align-items: center;
  gap: 1.2%;
  padding: 0.35% 1.2%;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgb(230 194 137 / 97%), rgb(210 160 96 / 97%)),
    repeating-linear-gradient(0deg, transparent 0 3px, rgb(93 51 17 / 5%) 4px);
  border: max(1px, 0.12cqw) solid rgb(91 47 17 / 72%);
  border-radius: 1.1cqw 0.45cqw 1.1cqw 0.45cqw;
  box-shadow:
    inset 0 0 0 max(1px, 0.12cqw) rgb(250 219 164 / 32%),
    inset 0 0 1.1cqw rgb(112 58 18 / 20%);
  font-size: clamp(8px, 1.28cqw, 23px);
  line-height: 1.12;
  user-select: text;
}

.profile-field::after {
  content: "✦";
  position: absolute;
  right: 1.2%;
  color: rgb(97 50 18 / 64%);
  font-size: 0.7em;
}

.profile-field strong {
  min-width: 0;
  max-width: 95%;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.field-label {
  min-width: 0;
  font-weight: 800;
  white-space: nowrap;
}

.field-label::first-letter {
  color: var(--teal);
}

.field-label b {
  font-family: var(--font-profile-en);
  letter-spacing: 0.02em;
}

.field-name { top: 28.05%; }
.field-role { top: 36.45%; }
.field-experience { top: 44.75%; }
.field-location { top: 52.95%; }
.field-strength { top: 60.95%; }

.profile-intro {
  position: absolute;
  z-index: 2;
  left: 46.55%;
  top: 69.6%;
  width: 38.35%;
  height: 18.6%;
  margin: 0;
  padding: 0.65% 2.25% 0.65% 2.65%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--ink);
  background:
    linear-gradient(rgb(229 193 135 / 98%), rgb(214 167 104 / 98%)),
    repeating-linear-gradient(0deg, transparent 0 4px, rgb(88 47 17 / 5%) 5px);
  border: max(1px, 0.14cqw) solid rgb(91 47 17 / 75%);
  box-shadow:
    inset 0 0 0 max(1px, 0.17cqw) rgb(248 215 158 / 30%),
    inset 0 0 1.3cqw rgb(92 47 15 / 23%);
  user-select: text;
  overflow: hidden;
}

.profile-intro h2 {
  flex: 0 0 auto;
  margin: 0 0 0.3em;
  text-align: center;
  font-family: var(--font-profile-cn);
  font-size: clamp(8px, 1.3cqw, 23px);
  line-height: 1;
}

.profile-intro h2 span {
  font-family: var(--font-western-title);
  letter-spacing: 0.04em;
}

.profile-intro p {
  margin: 0;
  font-size: clamp(6px, 0.92cqw, 16px);
  font-weight: 650;
  line-height: 1.38;
  text-align: justify;
  overflow-wrap: anywhere;
}

.profile-tag {
  position: absolute;
  z-index: 2;
  top: 70.8%;
  width: 7.7%;
  height: 15.5%;
  display: grid;
  place-content: center;
  gap: 0.15em;
  text-align: center;
  color: var(--ink);
  background: radial-gradient(ellipse, #e7c384 0 54%, #c78638 56% 61%, #734015 63% 68%, transparent 70%);
  font-weight: 800;
  user-select: text;
  pointer-events: auto;
}

.profile-tag strong {
  font-family: var(--font-western-title);
  font-size: clamp(8px, 1.6cqw, 28px);
  line-height: 1;
}

.profile-tag span {
  font-size: clamp(6px, 0.95cqw, 17px);
  line-height: 1.1;
}

.tag-one { left: 16.8%; }
.tag-two { left: 26.65%; }
.tag-three { left: 36.55%; }

.profile-footer {
  position: absolute;
  z-index: 2;
  left: 20.3%;
  top: 89.4%;
  width: 57.2%;
  padding: 0.35% 1%;
  overflow: hidden;
  border: max(1px, 0.11cqw) solid rgb(96 48 15 / 62%);
  font-family: var(--font-western-title);
  font-size: clamp(6px, 1.18cqw, 20px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
  text-align: center;
  white-space: nowrap;
}

/* 第二屏默认逐像素显示用户原图。下面的HTML仅在主动编辑后覆盖对应区域。 */
.profile-original {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.profile-sheet,
.profile-corner,
.profile-footer {
  display: none;
}

.profile-wanted {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.profile-wanted::before,
.profile-wanted::after {
  display: none;
}

.profile-wanted .editable-text,
.profile-field .editable-text,
.profile-intro .editable-text,
.profile-tag .editable-text {
  color: transparent;
  text-shadow: none;
}

.profile-wanted .editable-text.is-edited,
.profile-field .editable-text.is-edited,
.profile-intro .editable-text.is-edited,
.profile-tag.has-edits .editable-text {
  color: var(--ink);
}

.profile-wanted .editable-text.is-edited {
  background: linear-gradient(90deg, #dfb87c, #d5a464 50%, #dfb87c);
}

.profile-field {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.profile-field::after {
  display: none;
}

.profile-field .editable-text.is-edited {
  align-self: stretch;
  min-width: 0;
  padding-inline: 1.5%;
  display: flex;
  align-items: center;
  background: linear-gradient(90deg, #dfb67a, #d7a768);
}

.profile-intro {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.profile-intro .editable-text.is-edited {
  background: linear-gradient(90deg, #dfb679, #d8aa6d 55%, #dfb679);
}

.profile-intro p.editable-text.is-edited {
  min-height: 76%;
}

.profile-tag {
  background: transparent;
}

.profile-tag.has-edits {
  background: radial-gradient(ellipse, #e4bd7f 0 53%, transparent 54%);
}

.avatar-frame {
  left: 19.2%;
  top: 28.95%;
  width: 19.68%;
  height: 35.15%;
  background: transparent;
  border: 0;
  border-radius: 50% 50% 0 0 / 31% 31% 0 0;
  box-shadow: none;
}

.avatar-frame.has-image {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.avatar-frame img {
  width: 108%;
  height: 108%;
}

.editable-text:not(.is-edited):hover {
  outline: max(1px, 0.08cqw) dashed rgb(21 94 87 / 55%);
  outline-offset: 1px;
}

.map-screen {
  background: #0e0803;
}

.map-stage {
  background: #6b3e1b;
  transform: translateZ(0);
  isolation: isolate;
}

.map-image {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.map-building {
  position: absolute;
  z-index: 2;
  padding: 0;
  border: 0;
  appearance: none;
  cursor: default;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
  transform: translateY(0) scale(1);
  transform-origin: 50% 72%;
  transition: transform 250ms cubic-bezier(0.22, 0.78, 0.28, 1), filter 250ms ease, opacity 250ms ease;
  will-change: transform, filter;
}

.map-building-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  transition: filter 250ms ease;
}

.map-building.is-hovered,
.map-building:focus-visible {
  z-index: 3;
  cursor: pointer;
  transform: translateY(-1.4%) scale(1.04);
}

.map-stage.has-building-hover .map-building {
  cursor: pointer;
}

.map-building.is-hovered .map-building-image,
.map-building:focus-visible .map-building-image {
  filter:
    brightness(1.09)
    saturate(1.12)
    drop-shadow(0 0 0.18vw rgb(255 230 152 / 85%))
    drop-shadow(0 0 0.75vw rgb(222 146 43 / 66%))
    drop-shadow(0 0.7vw 0.55vw rgb(45 20 5 / 52%));
}

.map-building:focus-visible {
  outline: clamp(2px, 0.15vw, 3px) solid #ffd777;
  outline-offset: 2px;
}

.map-building-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.building-character {
  left: 12.56%;
  top: 5.31%;
  width: 25.72%;
  aspect-ratio: 1089 / 937;
}

.building-motion {
  left: 39.35%;
  top: 4.04%;
  width: 22.73%;
  aspect-ratio: 928 / 723;
}

.building-merch {
  left: 64.11%;
  top: 11.37%;
  width: 25.72%;
  aspect-ratio: 1109 / 966;
}

.building-illustration {
  left: 13.16%;
  top: 48.78%;
  width: 26.32%;
  aspect-ratio: 1313 / 1050;
}

.building-product {
  left: 58.43%;
  top: 49.2%;
  width: 28.11%;
  aspect-ratio: 1313 / 1004;
}

.map-stage.has-active .map-building:not(.is-active) {
  opacity: 0.74;
  filter: brightness(0.72) saturate(0.8);
}

.map-building.is-active {
  z-index: 6;
  pointer-events: none;
  animation: building-sticker-pop 800ms cubic-bezier(0.2, 0.84, 0.25, 1) forwards;
}

.map-building.is-active .map-building-image {
  filter:
    brightness(1.08)
    saturate(1.08)
    drop-shadow(1px 0 0 #f7efd9)
    drop-shadow(-1px 0 0 #f7efd9)
    drop-shadow(0 1px 0 #f7efd9)
    drop-shadow(0 -1px 0 #f7efd9)
    drop-shadow(0 0 0.35vw rgb(255 242 204 / 92%))
    drop-shadow(0 1vw 0.75vw rgb(37 16 4 / 62%));
}

.building-particles {
  position: absolute;
  z-index: 7;
  inset: -6%;
  pointer-events: none;
}

.map-particle {
  position: absolute;
  left: var(--particle-x);
  top: var(--particle-y);
  display: block;
  opacity: 0;
  animation: map-particle-burst 620ms ease-out var(--particle-delay) forwards;
}

.map-particle.is-star {
  width: clamp(5px, 0.7vw, 13px);
  aspect-ratio: 1;
  background: #ffd777;
  clip-path: polygon(50% 0, 61% 36%, 100% 50%, 61% 64%, 50% 100%, 39% 64%, 0 50%, 39% 36%);
  filter: drop-shadow(0 0 0.28vw rgb(255 197 69 / 95%));
}

.map-particle.is-dust {
  width: clamp(4px, 0.45vw, 9px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgb(234 184 105 / 78%);
  box-shadow: 0 0 0.45vw rgb(233 165 67 / 65%);
}

.route-node {
  position: absolute;
  z-index: 5;
  width: 1.55%;
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.65);
  background: #ffe59c;
  box-shadow: 0 0 0 0 rgb(255 210 91 / 82%), 0 0 1vw rgb(255 192 51 / 95%);
}

.route-node-original { left: 34.4%; top: 43.3%; }
.route-node-motion { left: 56.6%; top: 31.1%; }
.route-node-merch { left: 67.4%; top: 39.3%; }
.route-node-illustration { left: 36.2%; top: 80%; }
.route-node-product { left: 61.9%; top: 80.8%; }

.route-node.is-flashing {
  animation: route-node-flash 700ms ease-out 80ms forwards;
}

@keyframes building-sticker-pop {
  0% { transform: translateY(0) scale(1); }
  38% { transform: translateY(-3.2%) scale(1.14); }
  68% { transform: translateY(-1.4%) scale(1.065); }
  100% { transform: translateY(-1.8%) scale(1.08); }
}

@keyframes map-particle-burst {
  0% { opacity: 0; transform: translate(0, 0) scale(0.45) rotate(0); }
  28% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--particle-dx), var(--particle-dy)) scale(1.15) rotate(90deg); }
}

@keyframes route-node-flash {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.65); box-shadow: 0 0 0 0 rgb(255 210 91 / 82%); }
  30% { opacity: 1; transform: translate(-50%, -50%) scale(1.25); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 0 1.5vw rgb(255 210 91 / 0%); }
}

/* PDF viewer */
.viewer-page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 50% -20%, #6f421d 0, transparent 48%),
    repeating-linear-gradient(90deg, rgb(255 255 255 / 2%) 0 1px, transparent 1px 11px),
    #211106;
  color: #f0d5a1;
}

.viewer-header {
  min-height: 92px;
  padding: var(--safe-top) clamp(14px, 2.2vw, 38px) 12px;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(240px, 1.4fr) minmax(260px, 1fr);
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid rgb(218 159 68 / 38%);
  background: rgb(25 12 4 / 88%);
}

.viewer-heading {
  min-width: 0;
  text-align: center;
}

.viewer-kicker {
  color: #bf8841;
  font-family: var(--font-profile-en);
  font-size: 11px;
  letter-spacing: 0.22em;
}

.viewer-heading h1 {
  margin: 0.18em 0 0;
  overflow: hidden;
  color: #f1d7a5;
  font-family: var(--font-western-title), var(--font-profile-cn);
  font-size: clamp(20px, 2.1vw, 34px);
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.brass-button {
  min-height: 40px;
  padding: 9px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #a66a1d;
  border-radius: 5px;
  color: #f5deb1;
  background: linear-gradient(#6f421b, #4b280f);
  box-shadow: inset 0 1px rgb(255 220 147 / 23%);
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.brass-button:hover,
.brass-button:focus-visible {
  border-color: #e4ad4d;
  background: linear-gradient(#865323, #5b3214);
}

.brass-button:active {
  transform: translateY(1px);
}

.brass-button.is-disabled {
  opacity: 0.46;
  cursor: not-allowed;
  pointer-events: none;
}

.brass-button:focus-visible {
  outline: 2px solid #f1c367;
  outline-offset: 2px;
}

.viewer-main {
  min-height: 0;
  flex: 1;
  padding: clamp(10px, 1.6vw, 24px);
}

.pdf-shell {
  width: min(100%, 1500px);
  height: 100%;
  min-height: 60svh;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgb(205 146 56 / 52%);
  border-radius: 8px;
  background: #e2c18a;
  box-shadow: 0 22px 70px rgb(0 0 0 / 42%);
}

.pdf-shell:fullscreen {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: #302012;
}

.pdf-state {
  min-height: 60svh;
  height: 100%;
  padding: 30px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 20%, rgb(255 255 255 / 20%), transparent 26%),
    repeating-linear-gradient(0deg, transparent 0 6px, rgb(93 51 17 / 3%) 7px),
    #dfbb7e;
}

.pdf-state[hidden],
#pdf-frame[hidden] {
  display: none;
}

.pdf-state h2 {
  margin: 8px 0;
  font-size: clamp(24px, 3vw, 44px);
}

.pdf-state p {
  max-width: 540px;
  margin: 0;
  line-height: 1.7;
}

.state-mark {
  color: #8e4e12;
  font-size: 40px;
}

#pdf-frame {
  width: 100%;
  height: 100%;
  min-height: 60svh;
  border: 0;
  background: white;
}

.pdf-source-note {
  width: min(100%, 1500px);
  min-height: 1.5em;
  margin: 8px auto 0;
  color: #cba56d;
  font-size: 12px;
  text-align: right;
}

.viewer-nav {
  padding: 12px clamp(14px, 2.2vw, 38px) var(--safe-bottom);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  border-top: 1px solid rgb(218 159 68 / 38%);
  background: rgb(25 12 4 / 9%);
}

.viewer-nav > :first-child { justify-self: start; }
.viewer-nav > :last-child { justify-self: end; }

#project-counter {
  color: #c79652;
  font-family: var(--font-profile-en);
  letter-spacing: 0.12em;
}

@media (max-width: 760px) {
  .screen {
    min-height: auto;
  }

  .visual-frame {
    width: 100%;
  }

  .profile-screen {
    padding-top: 72px;
    overflow: visible;
    background: #211106;
  }

  .profile-editor-toolbar {
    position: absolute;
    top: 52px;
    left: 8px;
    right: 8px;
    max-width: none;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .profile-image-toolbar {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    max-width: none;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .editor-hint {
    display: none;
  }

  .profile-stage {
    align-self: start;
  }

  .viewer-header {
    grid-template-columns: 1fr auto;
    min-height: 0;
  }

  .viewer-heading {
    grid-column: 1 / -1;
    grid-row: 1;
    padding-bottom: 4px;
  }

  .back-button { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
  .viewer-actions { grid-column: 1 / -1; grid-row: 3; justify-content: flex-start; flex-wrap: wrap; }

  .viewer-actions .brass-button {
    padding-inline: 10px;
    font-size: 13px;
  }

  .viewer-nav {
    gap: 8px;
  }

  .viewer-nav .brass-button {
    padding-inline: 10px;
    font-size: 13px;
  }
}

@media (max-width: 470px) {
  .viewer-actions {
    gap: 6px;
  }

  .viewer-actions .brass-button,
  .viewer-nav .brass-button {
    min-height: 38px;
    font-size: 12px;
  }

  #project-counter {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .map-stage,
  .map-building,
  .map-building-image,
  .route-node,
  .map-particle,
  .brass-button {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

/* 二级页面：仅调整PDF查看区域，顶部和底部原有界面保持不变 */
.viewer-page {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
}

.viewer-header,
.viewer-nav {
  flex: 0 0 auto;
}

.viewer-main {
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
  padding: 0;
  overflow: hidden;
}

.pdf-shell {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  background: #302012;
}

.pdf-pages {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  background: #302012;
}

.pdf-pages[hidden],
.pdf-state[hidden] {
  display: none;
}

.pdf-page {
  width: 100%;
  flex: 0 0 auto;
  overflow: hidden;
  line-height: 0;
  background: #dfbb7e;
}

.pdf-canvas {
  width: 100% !important;
  height: auto !important;
  display: block;
}

.pdf-state {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.pdf-source-note {
  position: absolute;
  right: 12px;
  bottom: 6px;
  z-index: 3;
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 3px 6px;
  border-radius: 3px;
  color: #e0bb7c;
  background: rgb(25 12 4 / 68%);
  pointer-events: none;
}

.pdf-source-note:empty {
  display: none;
}

.pdf-shell:fullscreen {
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
}

.pdf-shell:fullscreen .pdf-pages {
  height: 100dvh;
}


/* ===== 求职上线模式 =====
   默认是纯展示版；网址添加 ?edit=1 后恢复本地编辑工具。 */
body:not(.edit-mode) .profile-image-toolbar,
body:not(.edit-mode) .profile-editor-toolbar,
body:not(.edit-mode) .viewer-actions label[for="pdf-import"],
body:not(.edit-mode) #download-button,
body:not(.edit-mode) .pdf-source-note {
  display: none !important;
}

/* 公开模式下头像不可拖动，避免HR误操作。 */
body:not(.edit-mode) #avatar-frame {
  pointer-events: none;
}


/* ===== 手机端 PDF 兼容修复 =====
   iOS Safari、微信/QQ内置浏览器等对 iframe + Blob PDF 支持不稳定。
   手机端改为直接打开真实 PDF 地址，桌面端继续内嵌阅读。 */
.mobile-pdf-open {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 28px 22px;
  text-align: center;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 20%, rgb(255 255 255 / 20%), transparent 26%),
    repeating-linear-gradient(0deg, transparent 0 6px, rgb(93 51 17 / 3%) 7px),
    #dfbb7e;
}

.mobile-pdf-open[hidden] {
  display: none !important;
}

.mobile-pdf-open h2 {
  margin: 0;
  font-size: clamp(24px, 7vw, 36px);
}

.mobile-pdf-open p {
  max-width: 520px;
  margin: 0;
  line-height: 1.7;
}

.mobile-pdf-button {
  min-width: min(86vw, 320px);
  margin-top: 6px;
  font-size: 16px;
}

@media (min-width: 761px) {
  .mobile-pdf-open {
    display: none !important;
  }
}
