@font-face {
  font-family: "Nanxi Chuxia Song";
  src: url("assets/fonts/nanxi-chuxia-song.ttf") format("truetype");
  font-display: block;
}

@font-face {
  font-family: "Houzun Song";
  src: url("assets/fonts/houzun-song.woff") format("woff");
  font-display: block;
}

@font-face {
  font-family: "DIN Portfolio";
  src: url("assets/fonts/din-next-medium.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Alibaba PuHuiTi Portfolio";
  src: url("assets/fonts/alibaba-puhuiti-medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --white: rgba(246, 246, 246, 0.94);
  --soft: rgba(246, 246, 246, 0.66);
  --line: rgba(255, 255, 255, 0.72);
  --track: rgba(255, 255, 255, 0.2);
  --panel: rgba(215, 215, 215, 0.38);
  --shadow: rgba(0, 0, 0, 0.36);
  --frame-x: clamp(20px, 1.7vw, 34px);
  --content-x: clamp(48px, 3.4vw, 68px);
  --puhui: "Alibaba PuHuiTi Portfolio", "Alibaba PuHuiTi", "Alibaba PuHuiTi 3.0", "AlibabaPuHuiTi",
    MiSans, "Microsoft YaHei", system-ui, sans-serif;
  font-family: var(--puhui);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: #111;
}

body {
  overflow: hidden;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.portfolio {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 680px;
  overflow: hidden;
  color: var(--white);
  background: #171717;
  isolation: isolate;
}

.hero-video {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #121212;
  transform: translateX(0) scale(1.01);
  transform-origin: center center;
}

.hero-video.is-standby {
  opacity: 0;
  visibility: hidden;
}

.hero-video.is-active,
.hero-video.is-incoming,
.hero-video.is-outgoing {
  opacity: 1;
  visibility: visible;
}

.video-dim {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.42);
}

.topbar {
  position: absolute;
  top: 0;
  left: var(--frame-x);
  right: var(--frame-x);
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 88px;
  padding-inline: calc(var(--content-x) - var(--frame-x));
  border-bottom: 1px solid var(--line);
}

.top-name,
.top-role {
  font-family: "Nanxi Chuxia Song", "Songti SC", SimSun, serif;
  font-size: clamp(28px, 2.5vw, 46px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.02em;
  color: #f5f5f5;
  transform: scaleX(1.5);
  transform-origin: left center;
  text-shadow: 0 8px 24px var(--shadow);
}

.top-role {
  justify-self: end;
  transform-origin: right center;
}

.top-title {
  font-family: "Houzun Song", "Times New Roman", serif;
  font-size: clamp(34px, 3vw, 54px);
  line-height: 1;
  letter-spacing: 1px;
  color: #f5f5f5;
  transform: scale(1.2, 0.85);
  text-shadow: 0 8px 24px var(--shadow);
}

.hero-copy {
  position: absolute;
  top: clamp(116px, 12vh, 150px);
  left: var(--content-x);
  z-index: 4;
  width: max-content;
  max-width: none;
  pointer-events: none;
}

#videoTitle,
#videoSubtitle {
  display: block;
  width: max-content;
  max-width: none;
}

h1 {
  margin: 0;
  color: transparent;
  font-family: "Nanxi Chuxia Song", "Songti SC", SimSun, serif;
  font-size: clamp(86px, 7.8vw, 146px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.02em;
  background: linear-gradient(
    180deg,
    #f5f5f5 0%,
    #f5f5f5 56%,
    rgba(245, 245, 245, 0.86) 78%,
    rgba(245, 245, 245, 0.56) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 58%, rgba(0, 0, 0, 0.78) 82%, rgba(0, 0, 0, 0.42) 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 58%, rgba(0, 0, 0, 0.78) 82%, rgba(0, 0, 0, 0.42) 100%);
  transform: scaleX(1.5);
  transform-origin: left center;
  text-shadow: none;
  white-space: nowrap;
}

.subtitle {
  margin: 10px 0 0;
  color: transparent;
  font-family: "Houzun Song", "Times New Roman", serif;
  font-size: clamp(36px, 3vw, 58px);
  line-height: 1;
  letter-spacing: 1px;
  background: linear-gradient(
    180deg,
    rgba(245, 245, 245, 0.56) 0%,
    rgba(245, 245, 245, 0.56) 56%,
    rgba(245, 245, 245, 0.42) 78%,
    rgba(245, 245, 245, 0.24) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 56%, rgba(0, 0, 0, 0.74) 80%, rgba(0, 0, 0, 0.42) 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 56%, rgba(0, 0, 0, 0.74) 80%, rgba(0, 0, 0, 0.42) 100%);
  transform: scale(1.2, 0.85);
  transform-origin: left center;
  text-shadow: none;
  white-space: nowrap;
}

.platform-links {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  pointer-events: auto;
}

.platform-link {
  display: inline-grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

.platform-link:hover,
.platform-link:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.96);
  background: rgba(255, 255, 255, 0.68);
}

.platform-link img {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.platform-link[hidden] {
  display: none;
}

.metric {
  position: absolute;
  left: var(--content-x);
  bottom: clamp(108px, 11.5vh, 138px);
  z-index: 4;
}

.metric-label,
.watch-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  gap: 8px;
  color: rgba(245, 245, 245, 0.92);
  font-size: clamp(24px, 1.7vw, 34px);
  font-family: var(--puhui);
  font-weight: 500;
  line-height: 1;
}

.metric-label b {
  font-weight: 500;
}

.metric-label span {
  display: block;
  width: 2px;
  height: 34px;
  border-radius: 999px;
  background: rgba(245, 245, 245, 0.92);
}

.watch-link {
  padding: 8px 30px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(8px);
}

.watch-arrow {
  font-weight: 500;
}

.metric-number {
  display: flex;
  align-items: flex-start;
  margin-top: 16px;
  color: rgba(246, 246, 246, 0.86);
  font-family: "DIN Portfolio", "DIN Alternate", Impact, sans-serif;
  font-size: clamp(86px, 7.8vw, 150px);
  font-weight: 500;
  line-height: 0.86;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  text-shadow: none;
}

.view-char {
  display: inline-block;
  min-width: 0;
  line-height: 0.92;
  vertical-align: top;
  background: transparent;
  box-shadow: none;
  flex: 0 0 auto;
}

.view-digit {
  width: 0.47em;
  text-align: center;
}

.view-static {
  min-width: 0;
  margin-inline: -0.015em;
}

.view-slot {
  height: 0.92em;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
}

.view-stack {
  display: block;
  transform: translateY(0);
}

.view-stack span {
  display: block;
  height: 0.92em;
}

.view-stack.is-settled {
  transform: translateY(-0.92em);
}

.is-counting .view-stack {
  animation: slotRoll 880ms cubic-bezier(0.18, 0.88, 0.2, 1) both;
  animation-delay: var(--delay, 0ms);
  will-change: transform;
}

.is-counting .view-static {
  animation: softPop 660ms ease both;
  animation-delay: var(--delay, 0ms);
}

.is-switching .hero-video.is-incoming {
  animation: incomingVideoSlide 880ms cubic-bezier(0.22, 0.82, 0.18, 1) both;
}

.is-switching .hero-video.is-outgoing {
  animation: outgoingVideoSlide 880ms cubic-bezier(0.22, 0.82, 0.18, 1) both;
}

.is-switching .hero-copy,
.is-switching .metric,
.is-switching .watch-link {
  animation: copySlide 780ms cubic-bezier(0.22, 0.82, 0.18, 1) both;
}

.slide-from-right {
  --slide-start: 100vw;
  --slide-exit: -100vw;
}

.slide-from-left {
  --slide-start: -100vw;
  --slide-exit: 100vw;
}

@keyframes incomingVideoSlide {
  0% {
    opacity: 1;
    transform: translateX(var(--slide-start, 100vw)) scale(1.01);
  }

  100% {
    opacity: 1;
    transform: translateX(0) scale(1.01);
  }
}

@keyframes outgoingVideoSlide {
  0% {
    opacity: 1;
    transform: translateX(0) scale(1.01);
  }

  100% {
    opacity: 1;
    transform: translateX(var(--slide-exit, -100vw)) scale(1.01);
  }
}

@keyframes copySlide {
  0% {
    opacity: 0.72;
    transform: translateX(var(--slide-start, 100vw));
  }

  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slotRoll {
  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(-0.92em);
  }
}

@keyframes softPop {
  0% {
    opacity: 0.32;
    transform: translateY(0.12em);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.watch-link {
  position: absolute;
  right: clamp(28px, 2.2vw, 46px);
  bottom: clamp(148px, 15.6vh, 188px);
  z-index: 6;
  min-height: 50px;
  padding-inline: 28px;
  color: #f5f5f5;
  text-decoration: none;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

.watch-link .watch-arrow,
.watch-link span {
  color: #f5f5f5;
}

.all-works-link,
.all-works-link .watch-arrow,
.all-works-link span {
  color: rgba(18, 18, 18, 0.94);
}

.all-works-link {
  gap: 16px;
  min-width: 230px;
  background: rgba(235, 235, 235, 0.74);
  font-size: clamp(22px, 1.55vw, 30px);
  box-shadow: none;
}

.all-works-link .watch-arrow {
  font-size: 1.35em;
  line-height: 0.7;
}

.watch-link:hover,
.watch-link:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.95);
  background: rgba(215, 215, 215, 0.5);
}

.watch-link.is-disabled {
  cursor: default;
  opacity: 0.45;
  pointer-events: auto;
}

.watch-link.is-disabled:hover,
.watch-link.is-disabled:focus-visible {
  transform: none;
  border-color: rgba(255, 255, 255, 0.66);
  background: var(--panel);
}

.video-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  z-index: 7;
  padding: 0 var(--frame-x);
}

.timeline {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(18px, 1.9vw, 36px);
}

.video-tab {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px 0 8px;
  border: 0;
  color: rgba(255, 255, 255, 0.52);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition:
    color 180ms ease,
    opacity 180ms ease,
    transform 180ms ease;
}

.video-tab:hover,
.video-tab.is-active {
  color: rgba(255, 255, 255, 0.9);
  transform: translateY(-3px);
}

.video-tab:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.86);
  outline-offset: 6px;
}

.tab-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--puhui);
  font-size: clamp(17px, 1.25vw, 24px);
  font-weight: 500;
  line-height: 1.2;
}

.tab-track {
  position: relative;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.tab-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.32);
}

.side-button {
  position: absolute;
  top: 118px;
  bottom: 248px;
  z-index: 8;
  display: flex;
  width: 18vw;
  min-width: 160px;
  height: auto;
  align-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.side-button span {
  position: absolute;
  width: clamp(42px, 3.8vw, 62px);
  height: 2px;
  border-radius: 999px;
  background: rgba(245, 245, 245, 0.72);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}

.side-button-left span {
  left: clamp(36px, 4vw, 70px);
  transform-origin: left center;
}

.side-button-left span:first-child {
  transform: rotate(-48deg);
}

.side-button-left span:last-child {
  transform: rotate(48deg);
}

.side-button-right span {
  right: clamp(36px, 4vw, 70px);
  transform-origin: right center;
}

.side-button-right span:first-child {
  transform: rotate(48deg);
}

.side-button-right span:last-child {
  transform: rotate(-48deg);
}

.side-button:hover,
.side-button:focus-visible,
.portfolio.show-left .side-button-left,
.portfolio.show-right .side-button-right {
  opacity: 0.82;
}

.side-button-left {
  left: 0;
  justify-content: flex-start;
  padding-left: clamp(38px, 4.4vw, 76px);
}

.side-button-right {
  right: 0;
  justify-content: flex-end;
  padding-right: clamp(38px, 4.4vw, 76px);
}

.side-button-left:hover,
.side-button-left:focus-visible,
.portfolio.show-left .side-button-left {
  transform: translateX(-8px);
}

.side-button-right:hover,
.side-button-right:focus-visible,
.portfolio.show-right .side-button-right {
  transform: translateX(8px);
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .portfolio {
    min-height: 100svh;
  }

  .video-dim {
    background: rgba(0, 0, 0, 0.48);
  }

  .topbar {
    left: 12px;
    right: 12px;
    height: 68px;
  }

  .top-name,
  .top-role {
    font-size: 24px;
  }

  .top-title {
    font-size: 28px;
  }

  .hero-copy {
    top: 94px;
    left: 20px;
    width: calc(100vw - 40px);
  }

  h1 {
    font-size: clamp(54px, 17vw, 78px);
  }

  .subtitle {
    font-size: clamp(23px, 7.5vw, 34px);
  }

  .metric {
    left: 20px;
    bottom: 128px;
  }

  .metric-label,
  .watch-link {
    min-height: 38px;
    font-size: 18px;
  }

  .watch-link {
    padding: 7px 16px;
    border-radius: 10px;
  }

  .metric-number {
    margin-top: 12px;
    font-size: clamp(58px, 20vw, 86px);
  }

  .watch-link {
    right: 18px;
    bottom: 156px;
  }

  .video-nav {
    overflow-x: auto;
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: 6px;
    scrollbar-width: none;
  }

  .timeline {
    grid-auto-flow: column;
    grid-auto-columns: minmax(178px, 54vw);
    grid-template-columns: none;
    gap: 18px;
    min-width: max-content;
  }

  .video-nav::-webkit-scrollbar {
    display: none;
  }

  .side-button {
    display: none;
  }
}

.works-body {
  overflow: auto;
  background: #0e0e0e;
}

.works-page {
  position: relative;
  min-height: 100vh;
  padding: 118px var(--frame-x) 42px;
  color: rgba(245, 245, 245, 0.9);
  background:
    radial-gradient(circle at 74% 18%, rgba(255, 255, 255, 0.08), transparent 28%),
    linear-gradient(135deg, #171717 0%, #101010 46%, #080808 100%);
  overflow: hidden;
}

.works-page::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.28);
}

.works-page > * {
  position: relative;
  z-index: 1;
}

.works-topbar {
  height: 78px;
}

.works-heading {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-left: calc(var(--content-x) - var(--frame-x));
}

.works-heading h1 {
  margin: 0;
  color: rgba(245, 245, 245, 0.72);
  font-family: "Nanxi Chuxia Song", "Songti SC", SimSun, serif;
  font-size: clamp(42px, 3.8vw, 72px);
  line-height: 1;
  letter-spacing: 0;
  background: none;
  -webkit-text-fill-color: currentColor;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-mask-image: none;
  mask-image: none;
  transform: none;
}

.works-heading p {
  margin: 0;
  color: rgba(245, 245, 245, 0.26);
  font-family: "Houzun Song", "Times New Roman", serif;
  font-size: 22px;
}

.works-heading span {
  display: block;
  margin-left: auto;
  color: rgba(245, 245, 245, 0.56);
  font-family: var(--puhui);
  font-size: 18px;
}

.works-close {
  position: absolute;
  top: 132px;
  right: var(--content-x);
  display: inline-flex;
  align-items: center;
  gap: 18px;
  color: rgba(245, 245, 245, 0.78);
  text-decoration: none;
  font-family: var(--puhui);
  font-size: 22px;
}

.works-close span {
  position: absolute;
  left: 0;
  width: 24px;
  height: 2px;
  background: rgba(245, 245, 245, 0.78);
}

.works-close span:first-child {
  transform: rotate(45deg);
}

.works-close span:nth-child(2) {
  transform: rotate(-45deg);
}

.works-close b {
  margin-left: 34px;
  font-weight: 500;
}

.works-sidebar {
  position: absolute;
  left: var(--content-x);
  top: 230px;
  bottom: 52px;
  width: 280px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 34px;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  padding-right: 34px;
}

.all-filter,
.category-filter {
  width: 100%;
  display: flex;
  justify-content: space-between;
  border: 0;
  color: rgba(245, 245, 245, 0.66);
  background: transparent;
  font-family: var(--puhui);
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
}

.all-filter {
  padding: 16px 20px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 22px;
}

.all-filter.is-active,
.category-filter.is-active,
.all-filter:hover,
.category-filter:hover {
  color: rgba(245, 245, 245, 0.94);
}

.filter-block p {
  margin: 8px 0 24px;
  color: rgba(245, 245, 245, 0.32);
  font-family: var(--puhui);
  font-size: 18px;
}

.category-filters {
  display: grid;
  gap: 20px;
}

.back-home {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 78px;
  padding: 16px 20px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 6px;
  color: rgba(245, 245, 245, 0.78);
  text-decoration: none;
  font-family: var(--puhui);
  transition:
    transform 180ms ease,
    background 180ms ease;
}

.back-home:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
}

.back-home-icon {
  display: grid;
  width: 36px;
  height: 36px;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.back-home-icon::before,
.back-home-icon::after {
  content: "";
}

.back-home-icon,
.back-home-icon::before,
.back-home-icon::after {
  border: 2px solid rgba(245, 245, 245, 0.72);
  border-radius: 2px;
}

.back-home b,
.back-home small {
  display: block;
}

.back-home b {
  font-size: 20px;
  font-weight: 500;
}

.back-home small {
  margin-top: 4px;
  color: rgba(245, 245, 245, 0.42);
  font-size: 13px;
}

.works-list {
  margin-left: calc(var(--content-x) + 300px);
  margin-top: 72px;
  width: min(760px, 40vw);
}

.works-list-head {
  display: flex;
  gap: 56px;
  margin-bottom: 22px;
}

.works-list-head button {
  border: 0;
  color: rgba(245, 245, 245, 0.55);
  background: transparent;
  font-family: var(--puhui);
  font-size: 16px;
}

.work-row {
  display: grid;
  grid-template-columns: 76px 190px minmax(0, 1fr) 58px 34px;
  gap: 24px;
  align-items: center;
  width: 100%;
  min-height: 118px;
  padding: 14px 18px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(245, 245, 245, 0.62);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.work-row.is-active,
.work-row:hover {
  color: rgba(245, 245, 245, 0.94);
  background: rgba(255, 255, 255, 0.1);
}

.work-number {
  color: rgba(245, 245, 245, 0.28);
  font-family: "DIN Portfolio", Impact, sans-serif;
  font-size: 48px;
  line-height: 1;
}

.work-row video {
  width: 190px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  background: #111;
}

.work-info {
  min-width: 0;
}

.work-info b,
.work-info small,
.work-info em {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-style: normal;
}

.work-info b {
  font-size: 22px;
  font-weight: 500;
}

.work-info small,
.work-info em,
.work-duration {
  margin-top: 8px;
  color: rgba(245, 245, 245, 0.44);
  font-size: 15px;
}

.work-play {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  font-size: 14px;
}

.works-detail {
  position: absolute;
  top: 206px;
  right: var(--content-x);
  width: min(680px, 35vw);
}

.preview-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: #070707;
}

.preview-frame iframe,
.preview-frame video {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

.detail-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 32px;
}

.detail-main h2 {
  margin: 0;
  color: rgba(245, 245, 245, 0.86);
  font-size: clamp(28px, 2vw, 38px);
  font-weight: 500;
}

.detail-main p,
.works-detail article p,
.detail-stats dt {
  color: rgba(245, 245, 245, 0.5);
}

.detail-links {
  display: flex;
  gap: 10px;
}

.detail-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  color: rgba(245, 245, 245, 0.8);
  text-decoration: none;
  font-family: var(--puhui);
}

.detail-links img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.works-detail article {
  margin-top: 28px;
}

.works-detail h3 {
  margin: 0 0 10px;
  color: rgba(245, 245, 245, 0.78);
  font-size: 18px;
}

.works-detail article p {
  margin: 0;
  line-height: 1.8;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.detail-tags span {
  padding: 6px 12px;
  border-radius: 4px;
  color: rgba(245, 245, 245, 0.68);
  background: rgba(255, 255, 255, 0.09);
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin: 34px 0 0;
}

.detail-stats div,
.detail-stats dt,
.detail-stats dd {
  margin: 0;
}

.detail-stats dd {
  margin-top: 8px;
  color: rgba(245, 245, 245, 0.78);
  font-size: 18px;
}

@media (max-width: 1200px) {
  .works-page {
    overflow: auto;
  }

  .works-sidebar,
  .works-detail {
    position: static;
    width: auto;
  }

  .works-sidebar {
    margin-top: 32px;
    border-right: 0;
    padding-right: 0;
  }

  .works-list {
    width: auto;
    margin-left: 0;
  }

  .works-detail {
    margin-top: 34px;
  }
}

/* Refined home arrow hit areas */
.platform-links {
  position: relative;
  z-index: 12;
}

.side-button {
  top: calc(50% - 110px);
  bottom: auto;
  width: 112px;
  min-width: 112px;
  height: 220px;
}

.side-button-left {
  padding-left: 28px;
}

.side-button-right {
  padding-right: 28px;
}

.side-button-left span {
  left: 34px;
}

.side-button-right span {
  right: 34px;
}

/* Works page refinement */
.works-body {
  overflow: hidden;
}

.works-page {
  width: 100vw;
  height: 100vh;
  min-height: 680px;
  overflow: hidden;
  padding: 0;
  background: #0c0c0c;
}

.works-page::before {
  background:
    linear-gradient(rgba(20, 20, 20, 0.9), rgba(10, 10, 10, 0.94)),
    radial-gradient(circle at 74% 24%, rgba(255, 255, 255, 0.08), transparent 30%);
}

.works-topbar {
  height: 88px;
}

.works-heading,
.works-close,
.works-sidebar,
.works-list,
.works-detail {
  animation: worksFadeUp 620ms cubic-bezier(0.2, 0.82, 0.2, 1) both;
}

.works-heading {
  position: absolute;
  top: 124px;
  left: var(--content-x);
  margin: 0;
  width: 430px;
  display: grid;
  gap: 6px;
  animation-delay: 40ms;
}

.works-heading h1 {
  color: transparent;
  font-family: "Nanxi Chuxia Song", "Songti SC", SimSun, serif;
  font-size: clamp(46px, 3.6vw, 68px);
  font-weight: 400;
  line-height: 0.95;
  background: linear-gradient(
    180deg,
    rgba(245, 245, 245, 0.72) 0%,
    rgba(245, 245, 245, 0.62) 58%,
    rgba(245, 245, 245, 0.34) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  transform: scaleX(1.34);
  transform-origin: left center;
  white-space: nowrap;
}

.works-heading p {
  position: static;
  margin-top: 0;
  color: rgba(245, 245, 245, 0.28);
  font-family: "Houzun Song", "Times New Roman", serif;
  font-size: 20px;
  line-height: 1;
  transform: scale(1.2, 0.85);
  transform-origin: left center;
  white-space: nowrap;
}

.works-heading span {
  margin: 0;
  color: rgba(245, 245, 245, 0.54);
  font-size: 15px;
}

.works-close {
  display: none;
  top: 130px;
  right: var(--content-x);
  animation-delay: 80ms;
}

.works-sidebar {
  top: 254px;
  left: var(--content-x);
  bottom: 52px;
  width: 232px;
  gap: 30px;
  padding-right: 24px;
  animation-delay: 120ms;
}

.all-filter {
  min-height: 48px;
  padding: 10px 16px;
  font-size: 18px;
}

.filter-block p {
  margin-bottom: 20px;
  font-size: 16px;
}

.category-filters {
  gap: 18px;
}

.category-filter {
  font-size: 16px;
}

.back-home {
  justify-content: center;
  min-height: 46px;
  width: 172px;
  padding: 8px 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 14px;
  color: rgba(20, 20, 20, 0.92);
  background: rgba(235, 235, 235, 0.74);
  gap: 0;
}

.back-home:hover {
  background: rgba(245, 245, 245, 0.86);
}

.back-home-icon,
.back-home small {
  display: none;
}

.back-home b {
  color: rgba(20, 20, 20, 0.92);
  font-size: 21px;
}

.back-home b::before {
  content: "← ";
}

.works-list {
  position: absolute;
  top: 188px;
  left: calc(var(--content-x) + 268px);
  width: min(590px, 30vw);
  height: calc(100vh - 228px);
  margin: 0;
  animation-delay: 180ms;
}

.works-list-head {
  height: 36px;
  margin: 0 0 8px;
  align-items: center;
}

.works-list-head button {
  font-size: 15px;
}

.works-scroll {
  height: calc(100% - 44px);
  overflow-y: auto;
  padding-right: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.35) rgba(255, 255, 255, 0.08);
}

.works-scroll::-webkit-scrollbar {
  width: 6px;
}

.works-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
}

.works-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.34);
  border-radius: 999px;
}

.work-row {
  grid-template-columns: 56px 138px minmax(0, 1fr) 44px;
  min-height: 90px;
  gap: 14px;
  padding: 10px 12px;
}

.work-row video {
  width: 138px;
}

.work-number {
  font-size: 38px;
}

.work-info b {
  font-size: 17px;
}

.work-info small,
.work-info em,
.work-duration {
  margin-top: 6px;
  font-size: 13px;
}

.work-play {
  display: none;
}

.works-detail {
  top: 200px;
  right: var(--content-x);
  width: min(820px, 43vw);
  animation-delay: 240ms;
}

.detail-main {
  margin-top: 28px;
}

.detail-main h2 {
  font-size: clamp(24px, 1.7vw, 32px);
}

.works-detail article {
  margin-top: 24px;
}

.detail-stats {
  display: none;
  margin-top: 28px;
}

.detail-link-bili img {
  filter: invert(1) brightness(2);
  opacity: 0.9;
}

@keyframes worksFadeUp {
  0% {
    opacity: 0;
    transform: translateY(24px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Final responsive and scale polish */
.topbar,
.works-topbar {
  height: 76px;
}

.top-name,
.top-role {
  font-size: clamp(24px, 2.05vw, 38px);
}

.top-title {
  font-size: clamp(29px, 2.55vw, 46px);
}

.hero-copy {
  top: clamp(98px, 10.2vh, 126px);
}

.hero-copy h1 {
  font-size: clamp(68px, 6.55vw, 124px);
}

.subtitle {
  font-size: clamp(28px, 2.7vw, 48px);
}

.platform-link {
  width: 58px;
  height: 58px;
  border-radius: 13px;
}

.platform-link img {
  width: 39px;
  height: 39px;
}

.metric-label {
  margin-left: clamp(8px, 0.65vw, 14px);
}

.metric-number {
  font-size: clamp(76px, 7.05vw, 132px);
}

.all-works-link {
  min-width: 206px;
  min-height: 48px;
  padding: 9px 22px;
  font-size: clamp(18px, 1.25vw, 24px);
}

.side-button {
  width: 82px;
  height: 152px;
}

.side-button span {
  width: clamp(30px, 2.7vw, 44px);
  height: 2px;
  opacity: 0.68;
}

.portfolio.show-left .side-button-left,
.portfolio.show-right .side-button-right,
.side-button:hover,
.side-button:focus-visible {
  opacity: 0.62;
}

.work-cover {
  display: block;
  width: 138px;
  height: 78px;
  object-fit: cover;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
}

.work-row video.work-cover {
  width: 138px;
}

.works-heading h1 {
  font-size: clamp(42px, 3.15vw, 60px);
}

.works-heading p {
  font-size: 18px;
}

.works-heading span {
  font-size: 14px;
}

.works-sidebar {
  width: 214px;
}

.works-list {
  left: calc(var(--content-x) + 250px);
  width: min(550px, 28vw);
}

.works-detail {
  width: min(880px, 46vw);
}

.detail-links a {
  min-height: 48px;
  padding: 9px 18px;
  font-size: 18px;
}

.detail-links img {
  width: 27px;
  height: 27px;
}

.detail-link-bili img {
  filter: invert(1) brightness(2.2);
  opacity: 1;
}

@media (max-width: 1100px) {
  .video-nav {
    overflow: visible;
    padding: 0 16px;
    bottom: 14px;
  }

  .timeline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-flow: row;
    grid-auto-columns: auto;
    min-width: 0;
    gap: 14px 18px;
  }

  .video-tab {
    min-width: 0;
  }

  .tab-name {
    font-size: 15px;
  }

  .metric {
    bottom: 146px;
  }
}

@media (max-width: 680px) {
  .topbar,
  .works-topbar {
    height: 64px;
  }

  .top-name,
  .top-role {
    font-size: 20px;
  }

  .top-title {
    font-size: 25px;
  }

  .hero-copy h1 {
    font-size: clamp(46px, 15vw, 72px);
  }

  .subtitle {
    font-size: clamp(20px, 6vw, 30px);
  }

  .platform-link {
    width: 48px;
    height: 48px;
  }

  .platform-link img {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 1240px) {
  .works-heading {
    top: 104px;
    width: 300px;
  }

  .works-sidebar {
    top: 224px;
    width: clamp(184px, 21vw, 214px);
  }

  .works-list {
    top: 224px;
    left: calc(var(--content-x) + clamp(220px, 25vw, 260px));
    right: var(--content-x);
    width: auto;
    height: calc(46vh - 72px);
  }

  .works-detail {
    top: calc(46vh + 178px);
    left: var(--content-x);
    right: var(--content-x);
    width: auto;
    display: grid;
    grid-template-columns: minmax(360px, 1.05fr) minmax(300px, 0.95fr);
    gap: 20px 28px;
    align-items: start;
  }

  .preview-frame {
    grid-row: 1 / span 4;
  }

  .detail-main,
  .works-detail article,
  .detail-tags {
    margin-top: 0;
  }
}

@media (max-width: 860px) {
  html,
  body,
  .works-page {
    overflow-x: hidden;
  }

  .works-body {
    overflow: auto;
  }

  .works-page {
    height: auto;
    min-height: 100vh;
    overflow: hidden;
    padding-bottom: 32px;
  }

  .works-heading,
  .works-sidebar,
  .works-list,
  .works-detail {
    position: relative;
    inset: auto;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    width: calc(100% - 40px);
    margin-left: 20px;
    margin-right: 20px;
  }

  .works-heading {
    margin-top: 92px;
  }

  .works-sidebar {
    height: auto;
    padding-right: 0;
    gap: 20px;
    margin-top: 22px;
  }

  .works-list {
    height: 44vh;
    min-height: 300px;
    margin-top: 18px;
  }

  .works-scroll {
    overflow-x: hidden;
  }

  .works-detail {
    display: block;
    margin-top: 22px;
  }

  .work-row {
    grid-template-columns: 42px 112px minmax(0, 1fr) 38px;
    gap: 10px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .work-cover,
  .work-row video.work-cover {
    width: 112px;
    height: 63px;
  }

  .work-info b,
  .work-info small,
  .work-info em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.topbar,
.works-topbar {
  height: 66px;
}

.hero-copy {
  top: clamp(88px, 9.2vh, 112px);
}

@media (max-width: 680px) {
  .topbar,
  .works-topbar {
    height: 58px;
  }

  .hero-copy {
    top: 76px;
  }
}

/* Works page layout cleanup */
.works-page {
  --frame-x: clamp(18px, 2vw, 36px);
}

.works-topbar {
  left: var(--frame-x);
  right: var(--frame-x);
  width: auto;
}

.works-heading {
  display: flex;
  align-items: baseline;
  gap: 14px;
  width: auto;
}

.works-heading h1 {
  font-size: clamp(40px, 3vw, 56px);
}

.works-heading p {
  font-size: 18px;
  transform: scale(1.05, 0.85);
}

.works-heading span {
  display: none;
}

.all-filter,
.category-filter {
  min-height: 44px;
  padding: 9px 14px;
  border-radius: 5px;
  transition:
    background 180ms ease,
    color 180ms ease,
    opacity 180ms ease;
}

.category-filter.is-active,
.category-filter:hover {
  background: rgba(255, 255, 255, 0.11);
}

.all-filter.is-active,
.all-filter:hover {
  background: rgba(255, 255, 255, 0.16);
}

.work-row {
  grid-template-columns: 56px 138px minmax(0, 1fr) 44px;
  min-height: 82px;
  padding: 8px 12px;
}

.work-info b {
  margin-bottom: 6px;
}

.work-info em {
  display: none;
}

.work-info small,
.work-duration {
  margin-top: 0;
}

.work-cover.is-contain {
  object-fit: contain;
  background: #070707;
}

.preview-frame.is-contain video {
  object-fit: contain;
  background: #070707;
}

@media (max-width: 860px) {
  .works-heading {
    display: flex;
    width: calc(100% - 40px);
  }
}

/* Works page compact pass */
.works-page {
  --works-top: 112px;
}

.works-topbar {
  left: clamp(28px, 3vw, 58px);
  right: clamp(54px, 4vw, 86px);
}

.works-topbar .top-role {
  transform-origin: right center;
}

.works-heading,
.works-list-head {
  display: none;
}

.works-sidebar {
  top: var(--works-top);
  bottom: 40px;
  gap: 22px;
}

.filter-block p {
  margin-bottom: 12px;
}

.category-filters {
  gap: 8px;
}

.category-filter {
  min-height: 38px;
  padding-top: 7px;
  padding-bottom: 7px;
}

.works-list {
  top: var(--works-top);
  height: calc(100vh - var(--works-top) - 42px);
}

.works-scroll {
  height: 100%;
}

.works-detail {
  top: var(--works-top);
}

@media (max-width: 1240px) {
  .works-sidebar,
  .works-list,
  .works-detail {
    top: var(--works-top);
  }

  .works-list {
    height: calc(46vh - 26px);
  }

  .works-detail {
    top: calc(46vh + 132px);
  }
}

@media (max-width: 860px) {
  .works-sidebar {
    margin-top: 88px;
  }

  .works-list {
    height: 46vh;
  }
}

/* Stacked works layout for narrow viewports */
@media (max-width: 1180px) {
  body.works-body {
    overflow-y: auto;
  }

  .works-page {
    height: auto;
    min-height: 100vh;
    overflow-y: visible;
    padding-bottom: 56px;
  }

  .works-sidebar,
  .works-list,
  .works-detail {
    position: relative;
    inset: auto;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    width: calc(100vw - 64px);
    margin-left: 32px;
    margin-right: 32px;
  }

  .works-sidebar {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
    gap: 18px 28px;
    margin-top: 104px;
    padding-right: 0;
    height: auto;
    border-right: 0;
  }

  .all-filter {
    grid-column: 1;
    align-self: start;
  }

  .filter-block {
    grid-column: 2;
  }

  .filter-block p {
    margin-top: 0;
  }

  .category-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .back-home {
    grid-column: 1;
    margin-top: 0;
  }

  .works-list {
    margin-top: 22px;
    height: min(48vh, 430px);
    min-height: 300px;
  }

  .works-scroll {
    height: 100%;
    padding-right: 10px;
  }

  .works-detail {
    display: block;
    margin-top: 30px;
  }

  .preview-frame {
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
  }

  .detail-main,
  .works-detail article,
  .detail-tags {
    width: min(920px, 100%);
    margin-left: auto;
    margin-right: auto;
  }

  .detail-main {
    margin-top: 22px;
  }

  .works-detail article {
    margin-top: 24px;
  }
}

@media (max-width: 720px) {
  .works-sidebar,
  .works-list,
  .works-detail {
    width: calc(100vw - 36px);
    margin-left: 18px;
    margin-right: 18px;
  }

  .works-sidebar {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .all-filter,
  .filter-block,
  .back-home {
    grid-column: 1;
  }

  .category-filters {
    grid-template-columns: 1fr;
  }

  .works-list {
    height: 48vh;
  }
}

/* Keep works header identical to home header */
.works-page {
  --frame-x: clamp(20px, 1.7vw, 34px);
  --content-x: clamp(48px, 3.4vw, 68px);
}

.works-topbar {
  left: var(--frame-x);
  right: var(--frame-x);
  padding-inline: calc(var(--content-x) - var(--frame-x));
  width: auto;
  overflow: hidden;
}

.works-topbar .top-role {
  justify-self: end;
  max-width: 100%;
  transform-origin: right center;
  margin-right: clamp(28px, 3.2vw, 64px);
}

/* Prevent embedded previews from stretching the works page wider than the viewport */
html,
body.works-body {
  max-width: 100vw;
  overflow-x: hidden;
}

.works-page {
  width: 100vw;
  max-width: 100vw;
  overflow-x: hidden;
}

.works-topbar {
  left: clamp(20px, 1.7vw, 34px) !important;
  right: clamp(20px, 1.7vw, 34px) !important;
  width: auto !important;
  box-sizing: border-box;
}

.works-topbar .top-role {
  margin-right: 0;
  padding-right: 0;
}

/* Final viewport-locked header for works page */
body.works-body .works-topbar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100vw !important;
  height: 66px !important;
  padding-inline: clamp(48px, 3.4vw, 68px) !important;
  border-bottom: 0 !important;
  box-sizing: border-box;
  z-index: 50;
}

body.works-body .works-topbar::after {
  content: "";
  position: absolute;
  left: clamp(20px, 1.7vw, 34px);
  right: clamp(20px, 1.7vw, 34px);
  bottom: 0;
  height: 1px;
  background: var(--line);
}

body.works-body .works-topbar .top-role {
  margin-right: 0 !important;
}
