.works-page {
  min-height: 100svh;
  overflow-x: hidden;
}

.works-main {
  min-height: 100svh;
  padding: 0 18px 58px;
}

.works-board {
  display: grid;
  width: min(calc(100% - 18px), 1360px);
  min-height: 100svh;
  margin: 0 auto;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(54px, 1fr));
  gap: clamp(10px, 1.25vw, 18px);
  padding: 104px 0 44px;
}

.index-card,
.media-index-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(18, 18, 18, 0.16);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 20px 64px rgba(25, 29, 36, 0.12);
}

.media-index-card {
  display: block;
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  font: inherit;
  cursor: pointer;
  transition: box-shadow 220ms ease, transform 220ms ease;
}

.media-index-card:hover,
.media-index-card:focus-visible,
.other-projects-card:hover,
.other-projects-card:focus-visible,
.center-links a:hover,
.center-links a:focus-visible {
  box-shadow: 0 28px 86px rgba(25, 29, 36, 0.2);
  transform: translateY(-3px);
}

.media-index-card:focus-visible,
.other-projects-card:focus-visible,
.center-links a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.media-index-card img,
.media-index-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-index-card span {
  position: absolute;
  left: 10px;
  bottom: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  padding: 6px 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(18px);
}

.center-card {
  grid-column: 5 / 9;
  grid-row: 3 / 6;
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  gap: 24px;
  border-color: var(--ink);
  padding: clamp(22px, 4vw, 40px);
  text-align: center;
}

.center-card h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(42px, 4.3vw, 64px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: 0;
  white-space: nowrap;
}

.center-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.center-links a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(18, 18, 18, 0.26);
  border-radius: 999px;
  padding: 0 13px;
  background: var(--white);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  transition: box-shadow 220ms ease, transform 220ms ease, background-color 220ms ease, color 220ms ease;
}

.center-links a:hover,
.center-links a:focus-visible {
  background: var(--ink);
  color: var(--white);
}

.other-projects-card {
  grid-column: 9 / 12;
  grid-row: 4 / 6;
  display: grid;
  width: 100%;
  min-width: 0;
  height: 100%;
  place-items: center;
  border-color: var(--ink);
  padding: 18px;
  font: inherit;
  cursor: pointer;
  transition: box-shadow 220ms ease, transform 220ms ease;
}

.other-projects-card span {
  color: var(--ink);
  font-size: clamp(28px, 2.8vw, 42px);
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
}

.work-a {
  grid-column: 1 / 4;
  grid-row: 2 / 5;
}

.work-b {
  grid-column: 9 / 13;
  grid-row: 2 / 4;
}

.work-c {
  grid-column: 2 / 5;
  grid-row: 5 / 8;
}

.work-d {
  grid-column: 4 / 6;
  grid-row: 1 / 3;
}

.work-e {
  grid-column: 7 / 9;
  grid-row: 1 / 3;
}

.work-f {
  grid-column: 6 / 9;
  grid-row: 6 / 9;
}

.work-g {
  grid-column: 10 / 13;
  grid-row: 7 / 9;
}

.works-feed {
  display: grid;
  width: min(calc(100% - 18px), 1360px);
  margin: 0 auto;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(240px, 28vw);
  gap: clamp(10px, 1.25vw, 18px);
  padding: 28px 0 26px;
  border-top: 1px solid var(--line);
}

.works-feed .wide {
  grid-column: span 2;
}

.works-feed .tall {
  grid-row: span 2;
}

.index-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(255, 255, 255, 0.9);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(12px);
  transition: opacity 180ms ease;
}

.index-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.project-detail-card {
  position: relative;
  width: min(1280px, 100%);
  height: min(860px, 88svh);
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  color: #2f58ff;
  isolation: isolate;
  user-select: none;
}

.project-detail-card h2 {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 4;
  margin: 0;
  background: rgba(255, 230, 0, 0.86);
  padding: 4px 10px 5px;
  color: #070707;
  font-family: var(--serif);
  font-size: clamp(18px, 2.1vw, 34px);
  font-style: italic;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0;
  transform: rotate(-3deg);
}

.project-detail-card h2 .index-title-cn {
  margin-left: 0.4em;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.project-orbit-hint {
  position: absolute;
  right: 20px;
  bottom: 18px;
  z-index: 4;
  margin: 0;
  background: rgba(255, 230, 0, 0.82);
  padding: 4px 9px 5px;
  color: #070707;
  font-family: var(--serif);
  font-size: clamp(15px, 1.3vw, 22px);
  font-style: italic;
  line-height: 1;
  transform: rotate(2deg);
}

.project-detail-card::before,
.project-detail-card::after {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  height: 18%;
  content: "";
  pointer-events: none;
}

.project-detail-card::before {
  top: 0;
  background: linear-gradient(#fff 20%, rgba(255, 255, 255, 0));
}

.project-detail-card::after {
  bottom: 0;
  background: linear-gradient(rgba(255, 255, 255, 0), #fff 82%);
}

.project-list {
  --project-duration: 28000ms;
  --project-start-y: 160vh;
  --project-quarter-y: 30vh;
  --project-half-y: -100vh;
  --project-three-quarter-y: -230vh;
  --project-end-y: -360vh;
  --project-tilt: 10deg;
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  outline: 0;
  perspective: 42vh;
  perspective-origin: 54% 48%;
  transform-style: preserve-3d;
  white-space: nowrap;
  text-align: center;
  cursor: grab;
  touch-action: none;
}

.project-list.is-dragging {
  cursor: grabbing;
}

.project-item {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  color: #070707;
  font-family: var(--serif);
  font-size: clamp(22px, calc(70vw / var(--project-length)), 42px);
  font-style: italic;
  font-weight: 400;
  line-height: 1.3;
  text-align: center;
  cursor: inherit;
  pointer-events: none;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transform-origin: center center -260px;
  opacity: 0;
  transform: translateY(100vh);
  animation: project-corkscrew var(--project-duration) linear infinite;
  animation-play-state: paused;
  will-change: transform, opacity;
  transition: color 120ms ease, opacity 120ms ease, filter 120ms ease;
}

.index-modal.is-open .project-item {
  animation-play-state: running;
}

.project-item-label {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.project-item-label::before {
  position: absolute;
  z-index: -1;
  inset: 7% -0.28em 2%;
  background: rgba(255, 230, 0, 0.84);
  content: "";
  transform: rotate(var(--project-marker-rotation, -2deg)) scaleX(var(--project-marker-scale, 1));
  transform-origin: center;
}

.project-item:nth-child(3n + 1) .project-item-label::before {
  --project-marker-rotation: 2deg;
  --project-marker-scale: 1.08;
}

.project-item:nth-child(3n + 2) .project-item-label::before {
  --project-marker-rotation: -4deg;
  --project-marker-scale: 0.94;
}

.project-item:hover,
.project-item:focus-visible {
  color: #0037ff;
  filter: none !important;
}

.project-item.is-active {
  color: #ffffff;
}

.project-item.is-active .project-item-label::before {
  background: #2f58ff;
}

.project-item:focus-visible {
  outline: 0;
}

.project-list:focus-visible .project-item:nth-child(1) .project-item-label::before {
  box-shadow: 0 0 0 2px rgba(47, 88, 255, 0.28);
}

@keyframes project-corkscrew {
  0% {
    opacity: 0;
    transform: rotateY(104deg) translateY(var(--project-start-y)) rotate(var(--project-tilt));
  }

  10% {
    opacity: 0.22;
  }

  25% {
    opacity: 1;
    transform: rotateY(-22deg) translateY(var(--project-quarter-y)) rotate(var(--project-tilt));
  }

  50% {
    opacity: 1;
    transform: rotateY(-148deg) translateY(var(--project-half-y)) rotate(var(--project-tilt));
  }

  75% {
    opacity: 1;
    transform: rotateY(-274deg) translateY(var(--project-three-quarter-y)) rotate(var(--project-tilt));
  }

  90% {
    opacity: 0.16;
  }

  100% {
    opacity: 0;
    transform: rotateY(-400deg) translateY(var(--project-end-y)) rotate(var(--project-tilt));
  }
}

@media (max-width: 980px) {
  .works-board {
    min-height: auto;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: repeat(10, minmax(82px, 12vw));
    padding-top: 92px;
  }

  .center-card {
    grid-column: 2 / 6;
    grid-row: 1 / 4;
  }

  .work-a {
    grid-column: 1 / 4;
    grid-row: 4 / 7;
  }

  .work-b {
    grid-column: 4 / 7;
    grid-row: 4 / 6;
  }

  .work-c {
    grid-column: 1 / 3;
    grid-row: 7 / 10;
  }

  .other-projects-card {
    grid-column: 3 / 7;
    grid-row: 6 / 8;
  }

  .work-d {
    grid-column: 3 / 5;
    grid-row: 8 / 11;
  }

  .work-e {
    grid-column: 5 / 7;
    grid-row: 8 / 11;
  }

  .work-f,
  .work-g {
    display: none;
  }

  .works-feed {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(190px, 40vw);
  }
}

@media (max-width: 640px) {
  .works-main {
    padding: 0 12px 34px;
  }

  .works-board,
  .works-feed {
    width: 100%;
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 12px;
  }

  .works-board {
    display: flex;
    min-height: auto;
    padding-top: 86px;
    flex-direction: column;
  }

  .center-card,
  .other-projects-card,
  .work-a,
  .work-b,
  .work-c,
  .work-d,
  .work-e,
  .work-f,
  .work-g,
  .works-feed .wide,
  .works-feed .tall {
    display: block;
    grid-column: auto;
    grid-row: auto;
  }

  .center-card {
    display: grid;
    min-height: 280px;
    order: 1;
  }

  .work-a {
    order: 2;
  }

  .work-b {
    order: 3;
  }

  .other-projects-card {
    display: grid;
    min-height: 170px;
    order: 4;
  }

  .work-c,
  .work-d,
  .work-e,
  .work-f,
  .work-g {
    order: 5;
  }

  .media-index-card {
    height: auto;
    aspect-ratio: 16 / 11;
  }

  .media-index-card.tall {
    aspect-ratio: 4 / 5;
  }

  .works-feed {
    display: grid;
  }

  .project-detail-card {
    padding: 22px;
  }
}

.works-infinite {
  height: 100svh;
  overflow: hidden;
}

.works-infinite .works-main {
  height: 100svh;
  min-height: 0;
  padding: 0;
}

.works-infinite .works-stage {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--paper);
}

.works-infinite .infinite-viewport,
.works-infinite [data-infinite-canvas] {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  outline: none;
  touch-action: none;
  user-select: none;
}

.works-infinite .infinite-viewport.is-dragging,
.works-infinite [data-infinite-canvas].is-dragging {
  cursor: grabbing;
}

.works-infinite .site-footer {
  position: fixed;
  z-index: 30;
  left: 28px;
  bottom: 24px;
  width: auto;
  margin: 0;
  padding: 0;
  border-top: 0;
}

.works-infinite .filing-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid rgba(18, 18, 18, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 54px rgba(25, 29, 36, 0.1);
  padding: 0 12px;
  backdrop-filter: blur(18px);
}

.infinite-stage {
  position: relative;
  height: 100svh;
  overflow: hidden;
  background: var(--paper);
}

.canvas-hint {
  position: fixed;
  right: 28px;
  bottom: 24px;
  z-index: 30;
  border: 1px solid rgba(18, 18, 18, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 54px rgba(25, 29, 36, 0.1);
  padding: 9px 13px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(18px);
  pointer-events: none;
}

.other-projects-gateway {
  position: fixed;
  z-index: 32;
  top: 50%;
  right: 28px;
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(18, 18, 18, 0.82);
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 18px 54px rgba(25, 29, 36, 0.16);
  padding: 0 16px;
  color: var(--white);
  font-size: 13px;
  font-weight: 800;
  transform: translateY(-50%);
  transition: box-shadow 180ms ease, transform 180ms ease, background-color 180ms ease, color 180ms ease;
  white-space: nowrap;
}

.other-projects-gateway:hover,
.other-projects-gateway:focus-visible {
  background: #ffe600;
  color: var(--ink);
  box-shadow: 0 24px 68px rgba(25, 29, 36, 0.22);
  transform: translateY(calc(-50% - 2px));
}

.other-projects-gateway:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* 位置提示 chip：作品页顶部居中悬浮，告诉王总"中心=排序前列 · 位置固定"
   默认隐藏，只在 body.preview-mode（URL 加 ?preview=admin）下显示 */
.works-position-hint {
  display: none;
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  align-items: center;
  gap: 8px;
  padding: 7px 16px 7px 13px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.02em;
  pointer-events: none;
  box-shadow: 0 6px 22px rgba(25, 29, 36, 0.08);
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  overflow: hidden;
  text-overflow: ellipsis;
}
body.preview-mode .works-position-hint { display: inline-flex; }
.works-position-hint .mobile-text { display: none; }
.works-position-hint .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff4b37;
  animation: works-hint-pulse 2.4s ease-in-out infinite;
  flex: none;
}
@keyframes works-hint-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.1); }
}
@media (max-width: 640px) {
  .works-position-hint {
    font-size: 10px;
    padding: 5px 11px 5px 9px;
    top: 58px;
    right: 14px;
    left: auto;
    transform: none;
    white-space: nowrap;
    max-width: 52vw;
    text-align: left;
    line-height: 1.35;
    border-radius: 999px;
  }
  .works-position-hint .desktop-text { display: none; }
  .works-position-hint .mobile-text { display: inline; }
}

.infinite-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  outline: none;
  touch-action: none;
  user-select: none;
}

.infinite-viewport.is-dragging {
  cursor: grabbing;
}

.infinite-plane {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.canvas-slot {
  position: absolute;
  display: flex;
  width: 424px;
  height: 289px;
  align-items: center;
  justify-content: center;
  margin-left: -212px;
  margin-top: -144.5px;
  user-select: none;
}

.canvas-card {
  position: relative;
  display: block;
  width: 360px;
  height: 225px;
  overflow: hidden;
  border: 1px solid rgba(18, 18, 18, 0.12);
  border-radius: 2px;
  background: #f5f5f2;
  color: var(--ink);
  box-shadow: 0 22px 72px rgba(25, 29, 36, 0.08);
  transform: translate3d(0, 0, 0);
}

.canvas-media-card {
  padding: 0;
  font: inherit;
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.canvas-media-card:hover,
.canvas-media-card:focus-visible {
  border-color: rgba(18, 18, 18, 0.28);
  box-shadow: 0 32px 86px rgba(25, 29, 36, 0.16);
  transform: translate3d(0, -3px, 0);
}

.canvas-media-card:focus-visible,
.canvas-project-card:focus-visible,
.identity-links a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.canvas-media-card img,
.canvas-media-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.canvas-media-card span {
  position: absolute;
  right: 10px;
  bottom: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  padding: 6px 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(16px);
}

.canvas-identity-card,
.canvas-project-card {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 20px;
  border-color: rgba(18, 18, 18, 0.18);
  background: #ffffff;
  text-align: center;
}
/* 🆕 让 inline-logo-editor 的工具条（hover 上方/下方）能逃出卡片边界 */
.canvas-identity-card { overflow: visible; }

.canvas-identity-card h1 {
  margin: 0;
  color: var(--ink);
  font-size: 52px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.canvas-identity-card h1 .brand-mark-logo {
  display: block;
  width: auto;
  height: 220px;
  max-width: 100%;
  object-fit: contain;
  margin: 0 auto;
}

.identity-tagline {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.identity-tagline::before,
.identity-tagline::after {
  content: "—";
  margin: 0 0.6em;
  color: rgba(18, 18, 18, 0.24);
  letter-spacing: 0;
}

.identity-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.identity-links a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(18, 18, 18, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  padding: 0 12px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.identity-links a:hover,
.identity-links a:focus-visible {
  background: var(--ink);
  color: var(--white);
  transform: translateY(-2px);
}

.canvas-project-card {
  width: 360px;
  height: 240px;
  display: block;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  transition: none;
}

.canvas-project-card:hover,
.canvas-project-card:focus-visible {
  box-shadow: none;
  transform: none;
}

.project-card-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 760px) {
  .works-infinite {
    overflow: hidden;
  }

  .canvas-hint {
    right: 14px;
    bottom: 16px;
    padding: 8px 11px;
    font-size: 11px;
  }

  .other-projects-gateway {
    top: auto;
    right: auto;
    bottom: 58px;
    left: 50%;
    min-height: 38px;
    padding: 0 14px;
    font-size: 12px;
    transform: translateX(-50%);
  }

  .other-projects-gateway:hover,
  .other-projects-gateway:focus-visible {
    transform: translate(-50%, -2px);
  }

  .works-infinite .site-footer {
    left: 14px;
    bottom: 16px;
  }

  .works-infinite .filing-link {
    min-height: 29px;
    padding: 0 10px;
    font-size: 11px;
  }

  .canvas-slot {
    width: 336px;
    height: 232px;
    margin-left: -168px;
    margin-top: -116px;
  }

  .canvas-card,
  .canvas-project-card {
    width: 300px;
    height: 188px;
  }

  .canvas-project-card {
    height: 200px;
  }

  .canvas-identity-card h1 {
    max-width: 268px;
    font-size: 40px;
    white-space: normal;
  }

  .canvas-identity-card h1 .brand-mark-logo {
    width: 168px;
  }

  .identity-links {
    gap: 6px;
  }

  .identity-links a {
    min-height: 31px;
    padding: 0 10px;
    font-size: 11px;
  }

  .project-detail-card {
    width: 100%;
    height: 86svh;
  }

  .project-list {
    perspective: 42vh;
    perspective-origin: 54% 48%;
    --project-start-y: 150vh;
    --project-quarter-y: 35vh;
    --project-half-y: -80vh;
    --project-three-quarter-y: -195vh;
    --project-end-y: -310vh;
    --project-tilt: 8deg;
  }

  .project-detail-card h2 {
    top: 12px;
    left: 12px;
    padding: 4px 8px 5px;
    font-size: clamp(17px, 5.4vw, 27px);
  }

  .project-orbit-hint {
    right: 12px;
    bottom: 12px;
    font-size: 14px;
  }

  .project-item {
    font-size: clamp(16px, calc(78vw / var(--project-length)), 27px);
    transform-origin: center center -180px;
  }
}

/* ═══════════════════════ Other Projects · 时间轴 + 联动浮窗 ═══════════════════════ */
.project-timeline-card .project-timeline-hint {
  text-align: center; color: var(--muted); font-size: 13px; margin-top: 8px;
}
.timeline-wrap {
  position: relative; margin-top: 32px;
  display: flex; gap: 28px; align-items: flex-start;
}
.project-list.project-timeline {
  position: relative; inset: auto; z-index: 1; overflow: visible;
  perspective: none; transform-style: flat; white-space: normal;
  text-align: left; cursor: default; list-style: none; padding: 0;
  margin: 0; flex: 1; min-width: 0;
}
.timeline-year {
  display: flex; align-items: baseline; gap: 16px; margin: 32px 0 12px;
}
.timeline-year:first-child { margin-top: 0; }
.timeline-year .ty-num {
  font-family: var(--serif);
  font-size: 36px; font-weight: 700; color: var(--ink);
  letter-spacing: -.02em; font-style: italic;
}
.timeline-year .ty-line { flex: 1; height: 1px; background: var(--line); }
.timeline-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px 12px 22; border-radius: 8px; cursor: pointer;
  transition: background .18s ease, transform .18s ease;
  outline: none;
}
.timeline-item:hover, .timeline-item:focus-visible, .timeline-item.is-active {
  background: var(--soft);
}
.timeline-item:hover .ti-title, .timeline-item:focus-visible .ti-title { color: var(--accent); }
.timeline-item .ti-dot {
  flex: none; width: 8px; height: 8px; border-radius: 999px;
  background: var(--ink); opacity: .25; transition: all .18s ease;
}
.timeline-item:hover .ti-dot, .timeline-item:focus-visible .ti-dot, .timeline-item.is-active .ti-dot {
  background: var(--accent); opacity: 1; transform: scale(1.4);
}
.timeline-item .ti-title {
  font-size: 16px; color: var(--ink); font-weight: 500;
  transition: color .18s ease;
}
.timeline-empty {
  padding: 32px 16px; color: var(--muted); text-align: center; font-size: 14px;
}
.timeline-preview {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
}
.timeline-preview .tp-frame {
  position: absolute; width: 280px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 24px 70px rgba(25,29,36,.16); overflow: hidden;
  opacity: 0; transform: translateY(8px); transition: opacity .18s ease, transform .18s ease;
  pointer-events: auto;
}
.timeline-preview.is-shown .tp-frame {
  opacity: 1; transform: translateY(0);
}
.timeline-preview img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; background: #f4f4f4; }
.timeline-preview .tp-title {
  font-size: 14px; font-weight: 600; padding: 12px 14px 0; margin: 0;
}
.timeline-preview .tp-meta {
  font-size: 12px; color: var(--muted); padding: 4px 14px 12px; margin: 0;
}
.timeline-preview .tp-cloud {
  display: block; padding: 10px 14px; font-size: 12px;
  color: var(--accent); border-top: 1px solid var(--line);
}
.timeline-preview .tp-cloud[hidden] { display: none; }

@media (max-width: 760px) {
  .timeline-wrap { flex-direction: column; gap: 16px; }
  .timeline-preview { position: relative; inset: auto; min-height: 1px; }
  .timeline-preview .tp-frame { position: relative; top: auto !important; left: auto !important; width: 100%; }
  .timeline-year .ty-num { font-size: 28px; }
  .timeline-item .ti-title { font-size: 14px; }
}

/* ═══════════════════════ Project page 头部 ═══════════════════════ */
body.project-page .project-header {
  padding: 96px 24px 24px; background: var(--paper);
  display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: baseline;
  border-bottom: 1px solid var(--line);
}
body.project-page .project-header .ph-title {
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 40px); font-weight: 700; color: var(--ink);
  margin: 0; flex: 1 1 auto;
}
body.project-page .project-header .ph-year {
  font-family: var(--serif); font-style: italic; font-size: 22px;
  color: var(--muted);
}
body.project-page .project-header .ph-back,
body.project-page .project-header .ph-cloud {
  font-size: 13px; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink); background: var(--paper);
  text-decoration: none; transition: all .18s ease;
}
body.project-page .project-header .ph-back:hover,
body.project-page .project-header .ph-cloud:hover {
  background: var(--ink); color: #fff; border-color: var(--ink);
}
body.project-page .project-header .ph-cloud { color: var(--accent); border-color: var(--accent); }
body.project-page .project-header .ph-cloud:hover { background: var(--accent); color: #fff; }

/* ═══════════════════════ Works / Project · Masonry 错落网格 ═══════════════════════
 * CSS columns 实现真正的 masonry：
 *   · 列内高度由原图比例决定，自然错落
 *   · intro 与 Other Projects 用 column-span: all 占整行，节奏更高级
 *   · edge-to-edge 无间距，column-gap: 0
 */
.works-masonry {
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
}

.works-masonry .works-main {
  height: auto;
  min-height: 100svh;
  padding: 0;
}

.works-masonry .site-footer {
  position: relative;
  z-index: 10;
  left: auto;
  bottom: auto;
  width: 100%;
  margin: 0;
  padding: 24px 28px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.works-stage {
  position: relative;
  width: 100%;
  background: var(--paper);
}

.works-grid-viewport {
  width: 100%;
  outline: none;
}

.works-grid-plane {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  column-count: 4;
  column-gap: 0;
  column-fill: balance;
}

.works-grid-card {
  position: relative;
  display: block;
  overflow: hidden;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #f5f5f2;
  cursor: pointer;
  transition: opacity 480ms ease;
}

.works-grid-card img,
.works-grid-card video {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 600ms cubic-bezier(0.2, 0.7, 0.2, 1), opacity 600ms ease;
}

.works-grid-card:hover img,
.works-grid-card:focus-visible img {
  transform: scale(1.04);
}

.works-grid-card .media-type {
  position: absolute;
  right: 12px;
  bottom: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  padding: 6px 11px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  backdrop-filter: blur(16px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 280ms ease, transform 280ms ease;
}

.works-grid-card:hover .media-type,
.works-grid-card:focus-visible .media-type {
  opacity: 1;
  transform: translateY(0);
}

.works-grid-card:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
  z-index: 2;
}

/* 全宽 featured 大图：每 12 张出现一次，打破 4 列网格节奏 */
.works-grid-card.works-grid-wide {
  column-span: all;
  -webkit-column-span: all;
  display: block;
  width: 100%;
}

/* 品牌 intro 卡：占整行（column-span: all）。
   注：column-span 在 display:grid/flex 上不生效，必须 display:block，
   内部内容用一个 absolute 容器做 grid 居中。 */
.works-grid-intro {
  column-span: all;
  -webkit-column-span: all;
  display: block;
  position: relative;
  width: 100%;
  padding: 0;
  min-height: 70vh;
  overflow: visible;
}

.works-grid-intro .intro-inner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 22px;
  width: 100%;
  height: 100%;
  background: #ffffff;
  color: var(--ink);
  text-align: center;
  padding: clamp(60px, 12vh, 140px) clamp(28px, 4vw, 56px);
}

.works-grid-intro h1 {
  margin: 0;
  font-size: clamp(36px, 4.3vw, 64px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.works-grid-intro h1 .brand-mark-logo {
  display: block;
  width: auto;
  height: clamp(120px, 16vw, 220px);
  max-width: 100%;
  object-fit: contain;
  margin: 0 auto;
}

.works-grid-intro .identity-tagline {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.works-grid-intro .identity-tagline::before,
.works-grid-intro .identity-tagline::after {
  content: "—";
  margin: 0 0.6em;
  color: rgba(18, 18, 18, 0.24);
  letter-spacing: 0;
}

.works-grid-intro .identity-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.works-grid-intro .identity-links a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(18, 18, 18, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  padding: 0 12px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.works-grid-intro .identity-links a:hover,
.works-grid-intro .identity-links a:focus-visible {
  background: var(--ink);
  color: var(--white);
  transform: translateY(-2px);
}

/* Other Projects 入口：占整行，原理同上 */
.works-grid-projects {
  column-span: all;
  -webkit-column-span: all;
  display: block;
  position: relative;
  width: 100%;
  padding: 0;
  min-height: 38vh;
  overflow: hidden;
}

.works-grid-projects .projects-inner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: var(--ink);
  color: var(--white);
}

.works-grid-projects span {
  position: relative;
  z-index: 2;
  font-size: clamp(32px, 4.6vw, 76px);
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: 0;
  text-align: center;
}

.works-grid-projects span::after {
  content: " →";
  display: inline-block;
  margin-left: 0.2em;
  transition: transform 320ms ease;
}

.works-grid-projects:hover span::after,
.works-grid-projects:focus-visible span::after {
  transform: translateX(8px);
}

.works-grid-projects img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.08;
  transition: opacity 480ms ease, transform 600ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.works-grid-projects:hover img,
.works-grid-projects:focus-visible img {
  opacity: 0.14;
  transform: scale(1.03);
}

/* 浮动 Other Projects 入口（与旧 gateway 兼容）：
   在 masonry 模式下底部已有全宽 Other Projects 入口，隐藏右侧浮动胶囊避免重复。 */
.works-masonry .works-stage .other-projects-gateway { display: none; }

.works-stage .other-projects-gateway {
  position: fixed;
  z-index: 32;
  top: 50%;
  right: 28px;
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(18, 18, 18, 0.82);
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 18px 54px rgba(25, 29, 36, 0.16);
  padding: 0 16px;
  color: var(--white);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-50%);
  transition: box-shadow 180ms ease, transform 180ms ease, background-color 180ms ease, color 180ms ease;
  white-space: nowrap;
}

.works-stage .other-projects-gateway:hover,
.works-stage .other-projects-gateway:focus-visible {
  background: #ffe600;
  color: var(--ink);
  box-shadow: 0 24px 68px rgba(25, 29, 36, 0.22);
  transform: translateY(calc(-50% - 2px));
}

.works-stage .other-projects-gateway:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* project 页：页头后无间距直接接网格 */
body.project-page .works-stage {
  padding-top: 0;
}

body.project-page .works-grid-plane {
  margin-top: 0;
}

/* 响应式 */
@media (max-width: 1200px) {
  .works-grid-plane { column-count: 3; }
  .works-grid-intro { min-height: 56vh; }
  .works-grid-projects { min-height: 30vh; }
}

@media (max-width: 760px) {
  .works-grid-plane { column-count: 2; }
  .works-grid-intro { min-height: 48vh; }
  .works-grid-projects { min-height: 26vh; }
  .works-stage .other-projects-gateway {
    top: auto;
    right: auto;
    bottom: 58px;
    left: 50%;
    transform: translateX(-50%);
  }
  .works-stage .other-projects-gateway:hover,
  .works-stage .other-projects-gateway:focus-visible {
    transform: translate(-50%, -2px);
  }
}

@media (max-width: 480px) {
  .works-grid-plane { column-count: 1; }
  .works-grid-intro { min-height: 40vh; }
  .works-grid-projects { min-height: 22vh; }
}

/* ========== Featured Case 顶部小 banner（作品画布之上的案例入口，不抢首屏） ========== */
.featured-case {
  position: fixed;
  top: 86px;                                 /* 紧贴导航（top:18 + 56 高 + gap 12）下方 */
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
  width: min(calc(100% - 32px), var(--max));
  min-height: 64px;
  padding: 10px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 28px rgba(20, 20, 20, 0.08);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  color: var(--ink);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.featured-case.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-12px);
}
.featured-case .fc-bg { display: none; }
.featured-case::after { display: none; }
.fc-close {
  position: relative;
  top: auto;
  right: auto;
  margin-left: auto;
  z-index: 3;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease;
}
.fc-close:hover {
  background: rgba(18, 18, 18, 0.06);
}
.fc-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
  flex: 1;
  min-width: 0;
  padding: 0;
}
.fc-inner .ab-kicker { margin-bottom: 0; flex-shrink: 0; }
.fc-inner .ab-kicker .ab-badge {
  font-size: 11px;
  letter-spacing: 1.5px;
  padding: 5px 11px;
  border: 1px solid #c9a35f;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 800;
  background: rgba(255, 255, 255, 0.6);
}
.fc-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(13px, 1.2vw, 15px);
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--muted);
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fc-desc { display: none; }              /* banner 模式不显示描述，节省空间 */
.fc-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.fc-actions .ab-cta {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
  /* color 由 home.css 通用 .ab-cta 提供：红底白字 */
  padding: 11px 22px;        /* banner 内稍小，匹配 64px 高度 */
}
.fc-skip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.18s ease;
}
.fc-skip:hover { background: rgba(18, 18, 18, 0.05); }
@media (max-width: 720px) {
  .featured-case { top: 84px; padding: 8px 14px; min-height: 56px; }
  .fc-title { display: none; }
  .fc-desc { display: none; }
}

