.portfolioCategoryRail {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

.portfolioCategoryRail::after {
  content: "";
  flex: 0 0 14px;
}

.portfolioCategoryRail::-webkit-scrollbar { display: none; }

.portfolioCategoryTag {
  --tab-image: none;
  position: relative;
  flex: 0 0 142px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 7px;
  background: #171717;
  color: rgba(255, 255, 255, .9);
  cursor: pointer;
  font: 600 13px/1.2 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: .5px;
  text-decoration: none;
  white-space: nowrap;
}

.portfolioCategoryTag::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(rgba(4, 4, 4, .62), rgba(4, 4, 4, .74)), var(--tab-image) center / cover;
}

.portfolioCategoryTag > span {
  position: relative;
  z-index: 1;
}

.portfolioCategoryTag .tabIcon {
  color: var(--gold);
  font-size: 15px;
}

.portfolioCategoryTag:hover { border-color: rgba(var(--gold-rgb, 203, 176, 122), .7); }
.portfolioCategoryTag:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.projectGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px 20px;
}

.projectCard { min-width: 0; }
.projectCard[hidden] { display: none; }
.projectCard a { display: block; }
.projectImage { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 10; background: #111; }
.projectImage img { display: block; width: 100%; height: 100%; object-fit: cover; filter: saturate(.86); outline: 1px solid oklch(0 0 0 / .1); outline-offset: -1px; }
.projectImagePortrait img { object-position: center 27%; }
.projectHoverPrompt {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(5, 6, 6, .7);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  opacity: 0;
  pointer-events: none;
}
.projectHoverArrow { color: var(--gold); font-size: 17px; line-height: 1; }
.projectBody { display: block; padding: 18px 2px 0; }
.projectInfo { display: block; min-width: 0; }
.projectBody strong { display: block; font-family: var(--title-font, "Songti SC", STSong, serif); font-size: 23px; font-weight: 500; line-height: 1.3; letter-spacing: 1px; text-wrap: balance; overflow-wrap: break-word; }
.projectCategory { display: block; margin-top: 8px; color: var(--gold-dark); font-size: 12px; line-height: 1.4; letter-spacing: 1px; }
.projectCard a:hover .projectImage img,
.projectCard a:focus-visible .projectImage img { filter: saturate(1); }
.projectCard a:hover .projectHoverPrompt,
.projectCard a:focus-visible .projectHoverPrompt { opacity: 1; }
.projectCard a:focus-visible { outline: 2px solid var(--gold-dark); outline-offset: 6px; }

@media (max-width: 900px) {
  .portfolioCategoryTag { flex-basis: 122px; height: 48px; font-size: 12px; }
  .projectGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .projectGrid { grid-template-columns: 1fr; gap: 38px; }
  .projectImage { aspect-ratio: 4 / 3; }
  .projectBody strong { font-size: 21px; }
}

@media (prefers-reduced-motion: no-preference) {
  .portfolioCategoryTag { transition-property: border-color, transform; transition-duration: 200ms; transition-timing-function: ease-out; }
  .portfolioCategoryTag::before { transition-property: transform, filter; transition-duration: 400ms, 300ms; transition-timing-function: ease-out; }
  .portfolioCategoryTag:hover { transform: translateY(-1px); }
  .portfolioCategoryTag:hover::before { transform: scale(1.05); }
  .portfolioCategoryTag:active { transform: scale(.96); }
  .projectImage img { transition-property: transform, filter; transition-duration: 650ms, 350ms; transition-timing-function: cubic-bezier(.2,.65,.3,1), ease-out; }
  .projectHoverPrompt { transition-property: opacity; transition-duration: 140ms; transition-timing-function: ease-out; }
  .projectCard a:hover .projectImage img,
  .projectCard a:focus-visible .projectImage img { transform: scale(1.025); }
}


@media (hover: none) {
  .projectHoverPrompt { display: none; }
}
