/* Contact details are intentionally displayed as plain text. */
.about-contact-links .plain-contact {
  cursor: text !important;
  pointer-events: none !important;
  border-bottom-color: transparent !important;
  text-decoration: none !important;
}

/* Keep the two detail actions on one baseline with identical dimensions. */
.detail-action-stop {
  align-items: center !important;
}

.detail-action-button,
.detail-action-stop .back-to-top {
  box-sizing: border-box !important;
  height: 42px !important;
  min-height: 42px !important;
  line-height: 1 !important;
  transition: color 0.18s ease, border-color 0.18s ease,
    background-color 0.18s ease, box-shadow 0.18s ease,
    transform 0.18s ease !important;
}

.detail-action-stop .back-to-top {
  box-shadow: 0 10px 26px #102f492e !important;
}

/* Project actions now share one physical container and therefore one movement rule. */
.project-page .detail-action-stop .back-to-top {
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

.project-page .detail-action-cluster .xiaogu-cluster-top {
  flex: 0 0 auto !important;
  min-width: 82px !important;
  height: 42px !important;
  min-height: 42px !important;
  margin: 0 !important;
  padding: 9px 10px !important;
  border: 0 !important;
  border-left: 1px solid #ffffff4d !important;
  border-radius: 0 8px 8px 0 !important;
  color: #fff !important;
  background: transparent !important;
  box-shadow: none !important;
  white-space: nowrap !important;
}

.detail-action-stop .back-to-top,
.back-to-top-wrap .back-to-top,
.xiaogu-home-top-stop .back-to-top {
  box-sizing: border-box !important;
  width: 96px !important;
  height: 52px !important;
  min-height: 52px !important;
  padding: 0 14px !important;
  border: 1px solid #9fb2bf !important;
  border-radius: 11px !important;
  color: #173b55 !important;
  background: #eef4f7f2 !important;
  box-shadow: 0 10px 26px #102f4926 !important;
  backdrop-filter: blur(9px) !important;
  white-space: nowrap !important;
}

.detail-action-button,
.detail-action-stop .back-to-top,
.back-to-top-wrap .back-to-top {
  font-size: 12px !important;
}

.back-to-top.xiaogu-floating-top {
  position: fixed !important;
  bottom: auto !important;
  top: var(--xiaogu-action-top, auto) !important;
  left: var(--xiaogu-action-left, auto) !important;
  right: var(--xiaogu-action-right, auto) !important;
  z-index: 72;
  width: var(--xiaogu-action-width, 96px) !important;
  height: var(--xiaogu-action-height, 52px) !important;
  min-height: var(--xiaogu-action-height, 52px) !important;
  margin: 0 !important;
  will-change: top, left;
}

.back-to-top.xiaogu-floating-top.xiaogu-top-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(8px) !important;
}

.back-to-top-wrap .back-to-top.xiaogu-floating-top {
  width: var(--xiaogu-action-width, auto) !important;
  box-shadow: 0 10px 26px #102f492e !important;
}

.xiaogu-top-placeholder {
  flex: none;
  margin-left: auto;
  visibility: hidden;
  pointer-events: none;
}

.back-to-top-wrap .xiaogu-top-placeholder {
  display: block;
}

.detail-action-button:hover,
.detail-action-stop .back-to-top:hover,
.project-page .detail-action-cluster .xiaogu-cluster-top:hover {
  transform: translateY(-1px);
}

.xiaogu-home-top-stop {
  position: relative;
}

/* The first tap works even during the brief client-side startup window. */
.xiaogu-mobile-nav-panel {
  z-index: 120;
  position: fixed;
  top: max(72px, calc(env(safe-area-inset-top) + 62px));
  left: 10px;
  right: 10px;
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid #102f4917;
  border-radius: 12px;
  background: #fbfcfbfa;
  box-shadow: 0 18px 42px #102f492e;
  backdrop-filter: blur(16px);
}

.xiaogu-mobile-nav-panel button {
  width: 100%;
  padding: 13px 14px;
  border: 0;
  border-radius: 8px;
  color: #102f49;
  background: transparent;
  text-align: left;
  font-size: 15px;
  font-weight: 600;
}

.xiaogu-mobile-nav-panel button:active,
.xiaogu-mobile-nav-panel button:hover {
  color: #2e76bc;
  background: #eaf2f7;
}

/* Custom video controls avoid the full-screen dimming used by mobile browsers. */
.film-overlay video[data-xiaogu-player="ready"]::-webkit-media-controls {
  display: none !important;
}

.xiaogu-film-controls {
  z-index: 8;
  position: absolute;
  left: 50%;
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 12px));
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border: 1px solid #ffffff3d;
  border-radius: 14px;
  background: #07121bbf;
  box-shadow: 0 8px 22px #0005;
  backdrop-filter: blur(10px);
  transform: translateX(-50%);
}

.xiaogu-film-controls button,
.xiaogu-film-sound {
  display: grid;
  place-items: center;
  height: 38px;
  border: 1px solid #ffffff42;
  border-radius: 10px;
  color: #fff;
  background: #ffffff12;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.xiaogu-film-controls button {
  width: 54px;
}

.xiaogu-film-controls .xiaogu-film-toggle {
  width: 42px;
  background: #f5f8f9;
  color: #102f49;
  font-size: 17px;
}

.xiaogu-film-controls button:hover,
.xiaogu-film-sound:hover {
  background: #2e76bce6;
  color: #fff;
}

.xiaogu-film-sound {
  z-index: 8;
  position: absolute;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 18px));
  width: 52px;
}

.film-overlay:has(video[data-xiaogu-player="ready"]) .film-title {
  bottom: max(82px, calc(env(safe-area-inset-bottom) + 76px));
}

/* Keep the current image fully opaque while a color variant is replaced. */
.project-page .zoomable-project-image,
.project-card .project-image {
  opacity: 1 !important;
  filter: none !important;
  transition: none !important;
}

.xiaogu-color-switching .zoomable-project-image,
.xiaogu-color-switching .project-image {
  opacity: 1 !important;
  filter: none !important;
}

.material-dots button[aria-busy="true"] {
  cursor: progress;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2e76bc !important;
}

.xiaogu-color-swap-cover {
  z-index: 65;
  position: fixed !important;
  display: block;
  margin: 0 !important;
  pointer-events: none !important;
  opacity: 1;
  transition: opacity 0.16s ease !important;
}

.xiaogu-color-swap-cover.is-ready {
  opacity: 0;
}

/* All image viewers use one shared bottom control bar. */
.image-lightbox-controls,
.xiaogu-practice-zoom {
  overflow: visible;
  border: 1px solid #ffffff26 !important;
  border-radius: 12px !important;
  background: #102f49b8 !important;
  box-shadow: 0 8px 24px #0005 !important;
  backdrop-filter: blur(10px) !important;
}

.xiaogu-lightbox-nav,
.xiaogu-practice-page {
  position: static;
  flex: none;
  width: 36px;
  height: 36px;
  border: 1px solid #ffffff63;
  border-radius: 9px;
  color: #fff;
  background: #ffffff14;
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  transform: none;
}

.xiaogu-lightbox-nav:hover,
.xiaogu-practice-page:hover {
  background: #2e76bce6;
}

.xiaogu-page-indicator {
  position: absolute;
  left: 50%;
  top: calc(100% + 5px);
  min-width: 48px;
  padding: 2px 7px;
  border-radius: 7px;
  color: #fff;
  background: #102f49df;
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.xiaogu-page-indicator.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.practice-overlay .viewer-controls {
  display: none !important;
}

.practice-overlay:has(.viewer-controls) .xiaogu-practice-zoom {
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
}

.image-lightbox-stage {
  touch-action: none !important;
  cursor: grab !important;
}

.image-lightbox-stage:active {
  cursor: grabbing !important;
}

.image-lightbox-stage img,
.practice-viewer-minimal .practice-overlay-gallery img {
  pointer-events: none;
}

/* Restore the supplied software icons while blending their white canvases. */
.software-grid i img {
  mix-blend-mode: multiply;
}

.software-grid i img.seedance-icon {
  mix-blend-mode: normal;
}

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

.experience-company-link:hover,
.experience-company-link:focus-visible {
  color: #2e76bc;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

/* Keep the About hero and cards on the same page-wide alignment grid. */
@media screen and (min-width: 801px) {
  .xiaogu-mobile-nav-panel {
    display: none !important;
  }

  .about-page {
    padding-top: 10px !important;
  }

  .about-page .about-hero {
    margin-inline: 2.7% !important;
    padding-inline: 2.7% !important;
  }

  .about-page > .profile-statement,
  .about-page > .about-block,
  .about-page > .about-bottom-grid {
    margin-inline: 2.7% !important;
  }

  .about-page > .profile-statement,
  .about-page > .about-block {
    padding-inline: 2.7% !important;
  }
}

/* Creative Exploration viewer: always fit the whole image before zooming. */
.practice-viewer-minimal,
.practice-viewer-minimal .practice-overlay-gallery {
  min-width: 0 !important;
  min-height: 0 !important;
}

.practice-viewer-minimal .practice-overlay-gallery {
  position: absolute !important;
  inset: 16px !important;
  width: auto !important;
  height: auto !important;
  overflow: hidden !important;
  touch-action: none;
  cursor: grab;
}

.practice-viewer-minimal .practice-overlay-gallery:active {
  cursor: grabbing;
}

.practice-viewer-minimal .practice-overlay-gallery img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  transform-origin: 50% 50%;
  will-change: transform;
  user-select: none;
}

.xiaogu-practice-zoom {
  z-index: 18;
  position: absolute;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: #102f49d9;
  backdrop-filter: blur(9px);
  transform: translateX(-50%);
  box-shadow: 0 8px 24px #0005;
}

.xiaogu-practice-zoom button {
  width: 36px;
  height: 36px;
  border: 1px solid #ffffff4d;
  border-radius: 9px;
  color: #fff;
  background: #ffffff14;
  font-size: 18px;
}

.xiaogu-practice-zoom span {
  min-width: 48px;
  color: #fff;
  text-align: center;
  font-size: 11px;
}

.practice-overlay:has(.viewer-controls) .xiaogu-practice-zoom {
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
}

/* Only group images keep the existing paging control. */
.practice-overlay:not(:has(.viewer-controls)) .xiaogu-group-only {
  display: none !important;
}

@media screen and (max-width: 800px),
  screen and (device-width <= 800px),
  (hover: none) and (pointer: coarse) {
  .detail-action-button,
  .detail-action-stop .back-to-top {
    height: 40px !important;
    min-height: 40px !important;
  }

  .project-page .detail-action-cluster {
    gap: 4px !important;
    max-width: calc(100vw - 28px) !important;
  }

  .project-page .detail-action-cluster .xiaogu-cluster-top {
    min-width: 72px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 8px 7px !important;
    font-size: 10px !important;
  }

  .detail-action-stop .back-to-top,
  .back-to-top-wrap .back-to-top,
  .xiaogu-home-top-stop .back-to-top {
    width: 92px !important;
    height: 48px !important;
    min-height: 48px !important;
    padding-inline: 12px !important;
  }

  .detail-action-button,
  .detail-action-stop .back-to-top,
  .back-to-top-wrap .back-to-top {
    font-size: 10px !important;
  }

  .xiaogu-lightbox-nav,
  .xiaogu-practice-page {
    width: 34px;
    height: 34px;
    font-size: 21px;
  }

  .practice-viewer-minimal .practice-overlay-gallery {
    inset: 10px !important;
  }

  .xiaogu-practice-zoom {
    bottom: max(10px, env(safe-area-inset-bottom));
  }

  .xiaogu-film-controls {
    bottom: max(12px, calc(env(safe-area-inset-bottom) + 8px));
    gap: 5px;
    padding: 5px 6px;
  }

  .xiaogu-film-controls button {
    width: 48px;
    height: 36px;
  }

  .xiaogu-film-controls .xiaogu-film-toggle {
    width: 40px;
  }

  .xiaogu-film-sound {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(17px, calc(env(safe-area-inset-bottom) + 13px));
    width: 46px;
    height: 36px;
    font-size: 10px;
  }

  .film-overlay:has(video[data-xiaogu-player="ready"]) .film-title {
    left: max(14px, env(safe-area-inset-left));
    bottom: max(68px, calc(env(safe-area-inset-bottom) + 62px));
  }

  .about-page .about-hero {
    margin-inline: 10px !important;
    padding-inline: 10px !important;
  }

  .about-page {
    padding-top: 16px !important;
  }

  .about-page > .profile-statement,
  .about-page > .about-block,
  .about-page > .about-bottom-grid {
    margin-inline: 10px !important;
  }

  .about-page > .profile-statement,
  .about-page > .about-block {
    padding-inline: 18px !important;
  }
}

@media screen and (max-width: 360px), screen and (device-width <= 360px) {
  .project-page .detail-action-cluster {
    left: 10px !important;
    gap: 3px !important;
    padding: 4px !important;
    max-width: calc(100vw - 20px) !important;
  }

  .project-page .detail-action-cluster .detail-back-button {
    min-width: 74px !important;
    padding-inline: 7px !important;
    font-size: 9px !important;
  }

  .project-page .detail-action-colors .material-dots {
    gap: 3px !important;
    padding: 4px 5px !important;
  }

  .project-page .detail-action-colors .material-dots button {
    width: 11px !important;
    height: 11px !important;
  }

  .project-page .detail-action-cluster .xiaogu-cluster-top {
    min-width: 64px !important;
    padding-inline: 5px !important;
    font-size: 9px !important;
  }
}

/* Leave enough room below paged viewers for the transient image counter. */
.image-lightbox-controls:has(.xiaogu-page-indicator),
.xiaogu-practice-zoom:has(.xiaogu-page-indicator) {
  bottom: max(36px, calc(env(safe-area-inset-bottom) + 30px)) !important;
}
