:root {
  color-scheme: light;
  --zoom: 1;
  --toolbar-space: 292px;
  --accent: #165b7d;
  --ink: #17242d;
  --line: #dbe3e8;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #edf2f5;
  color: var(--ink);
  font-family: "Microsoft JhengHei", "Noto Sans TC", Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

img {
  -webkit-user-drag: none;
  user-drag: none;
}

button,
a {
  font: inherit;
}

.viewer-toolbar {
  position: fixed;
  top: 50%;
  right: 24px;
  transform: translateY(-50%);
  z-index: 10;
  width: 236px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 6px 18px rgba(18, 75, 104, 0.08);
}

.viewer-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.viewer-title strong,
.viewer-title span {
  display: block;
}

.viewer-title strong {
  overflow: hidden;
  color: #124b68;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-title span {
  margin-top: 2px;
  font-size: 12px;
}

.zoom-tools {
  width: 100%;
  display: grid;
  grid-template-columns: 52px minmax(72px, 1fr) 52px;
  align-items: stretch;
  gap: 10px;
}

.zoom-tools button {
  width: 100%;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
  font-size: 24px;
  font-weight: 700;
  white-space: nowrap;
}

.zoom-tools button:hover,
.zoom-tools button:focus-visible {
  border-color: #8bb5c7;
  outline: 2px solid #d7e9f0;
}

.zoom-tools button[data-zoom="out"],
.zoom-tools button[data-zoom="in"] {
  width: 52px;
  padding: 0;
  font-size: 24px;
}

.zoom-tools output {
  width: 100%;
  min-height: 52px;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
}

.resume-stage {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 34px;
  padding: 20px var(--toolbar-space) 32px 24px;
  overflow: auto;
}

.resume-page {
  position: relative;
  width: calc(794px * var(--zoom));
  line-height: 0;
  background: #ffffff;
  box-shadow: 0 20px 55px rgba(15, 23, 42, 0.2);
}

.resume-page img {
  display: block;
  width: 100%;
  height: auto;
}

.gallery-hotspot {
  position: absolute;
  z-index: 2;
  min-width: 20px;
  min-height: 20px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: zoom-in;
}

.gallery-hotspot:hover,
.gallery-hotspot:focus-visible {
  outline: 2px solid rgba(22, 91, 125, 0.72);
  outline-offset: 3px;
  background: rgba(219, 227, 232, 0.18);
}

.image-lightbox {
  width: auto;
  max-width: 94vw;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  overflow: visible;
}

.image-lightbox::backdrop {
  background: rgba(13, 27, 36, 0.78);
  backdrop-filter: blur(3px);
}

.lightbox-frame {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 280px;
  min-height: 180px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(4, 17, 24, 0.3);
}

.lightbox-frame img {
  display: block;
  max-width: calc(94vw - 48px);
  max-height: calc(92vh - 48px);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: -18px;
  right: -18px;
  z-index: 2;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #b8c8d0;
  border-radius: 50%;
  background: #ffffff;
  color: var(--ink);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 6px 18px rgba(4, 17, 24, 0.18);
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  border-color: var(--accent);
  outline: 3px solid #d7e9f0;
}

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

body.lightbox-open {
  overflow: hidden;
}

footer {
  display: none;
}

@media (max-width: 980px) {
  :root {
    --toolbar-space: 288px;
  }

  .viewer-toolbar {
    right: 10px;
    width: 236px;
  }

  .resume-stage {
    padding: 12px var(--toolbar-space) 20px 12px;
  }
}

@media print {
  .viewer-toolbar,
  footer {
    display: none;
  }

  body,
  .resume-stage {
    background: #ffffff;
  }

  .resume-stage {
    display: block;
    padding: 0;
  }

  .resume-page {
    width: 210mm;
    box-shadow: none;
    break-after: page;
  }
}
