/* OptiPick 详情页首屏，由 optipick-hero.js 驱动。宽屏文案在左、照片墙在右侧露出；
   980px 以下墙只在上方露出两行，文案接在下面。--cols 同时决定墙的列数和窄屏文案的起始高度。 */
/* 缓动供首屏与下方示意图（optipick-flow.css）共用 */
.photoclean-detail {
  --pc-ease: cubic-bezier(0.215, 0.61, 0.355, 1);
  --pc-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pc-hero {
  --cols: 12;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: max(640px, calc(100vh - 84px));
  min-height: max(640px, calc(100svh - 84px));
  padding: 96px 0 92px;
}
@supports (transition-timing-function: linear(0, 1)) {
  /* 欠阻尼弹簧 stiffness 380 / damping 18：约 0.6 秒收敛，峰值过冲约 19% */
  .photoclean-detail {
    --pc-spring: linear(0, 0.099, 0.329, 0.6, 0.848, 1.034, 1.147, 1.192, 1.186, 1.147, 1.095, 1.044, 1.004, 0.977, 0.964, 0.963, 0.968, 0.978, 0.988, 0.997, 1.003, 1.006, 1.007, 1.007, 1);
  }
}
@media (max-width: 1200px) {
  .pc-hero {
    --cols: 10;
  }
}

.pc-wall {
  position: absolute;
  z-index: 0;
  inset: -8px;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 6px;
  align-content: start;
  pointer-events: none;
}
.pc-tile {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 10px;
  background: var(--surface2);
  transition: transform 0.6s var(--pc-spring), box-shadow 0.3s ease;
}
.pc-ph {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: center / cover no-repeat;
  opacity: 0;
  transition: opacity 0.7s var(--pc-ease), transform 0.5s var(--pc-ease);
}
.pc-wall.ready .pc-ph {
  opacity: 1;
}
.pc-wall.intro .pc-ph {
  transition-delay: var(--d, 0ms);
}

/* 三种瑕疵各对应一个原因标签；「分辨率更低」「闭眼」是另画的图，不靠滤镜 */
.v-blur .pc-ph {
  inset: -5px;
  filter: blur(2.2px);
}
.v-dark .pc-ph {
  filter: brightness(0.48) saturate(0.8);
}
.v-similar .pc-ph {
  background-size: 122%;
  background-position: 28% 38%;
}

/* 连拍：格子先闪一下白，像快门 */
.pc-tile.shoot {
  background: var(--text);
}
.pc-tile.shoot .pc-ph {
  animation: pc-shoot 0.45s var(--pc-ease) both;
}
@keyframes pc-shoot {
  from {
    opacity: 0;
    transform: scale(1.08);
  }
}

.pc-group {
  position: absolute;
  z-index: 3;
  border-radius: 16px;
  box-shadow:
    0 0 0 2px rgba(var(--accent-rgb), 0.9),
    0 0 0 8px rgba(var(--accent-rgb), 0.1),
    0 18px 40px rgba(11, 11, 10, 0.35);
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.3s ease, transform 0.6s var(--pc-spring);
}
.pc-group.on {
  opacity: 1;
  transform: none;
}
.pc-group::before {
  content: attr(data-label);
  position: absolute;
  left: 12px;
  top: -12px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.6;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pc-tile.best {
  z-index: 2;
  transform: scale(1.05);
  box-shadow:
    0 0 0 3px var(--gold),
    0 14px 30px rgba(11, 11, 10, 0.5);
}
.pc-tile.best::before {
  content: "★ " attr(data-best);
  position: absolute;
  z-index: 1;
  left: 6px;
  top: 6px;
  padding: 2px 7px;
  border-radius: 7px;
  background: var(--gold);
  color: var(--gold-ink);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
  animation: pc-pop 0.6s var(--pc-spring) both;
}
@keyframes pc-pop {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
}
.pc-tile.drop .pc-ph {
  opacity: 0.3;
}
.pc-tile.drop::after {
  content: attr(data-reason);
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 6px;
  width: max-content;
  max-width: calc(100% - 8px);
  padding: 3px 7px;
  border-radius: 8px;
  background: rgba(21, 21, 21, 0.82);
  color: var(--text);
  font-size: 10.5px;
  font-weight: 560;
  line-height: 1.3;
  text-align: center;
  transform: translateX(-50%);
  animation: pc-rise 0.35s var(--pc-ease) both;
}
@keyframes pc-rise {
  from {
    opacity: 0;
    transform: translate(-50%, 6px);
  }
}
.pc-tile.gone .pc-ph {
  opacity: 0;
  transform: scale(0.7);
}

.pc-scan {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  left: 0;
  width: 38%;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0), rgba(var(--accent-rgb), 0.16) 70%, rgba(var(--accent-rgb), 0.34) 96%, rgba(var(--text-rgb), 0.7) 99.5%, rgba(var(--accent-rgb), 0));
  mix-blend-mode: screen;
  transform: translateX(-100%);
}
.pc-scan.go {
  animation: pc-scan 1.6s cubic-bezier(0.45, 0.05, 0.3, 1) both;
}
@keyframes pc-scan {
  0% {
    opacity: 0;
    transform: translateX(-100%);
  }
  12%,
  88% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(265%);
  }
}

/* 遮罩跟着文案列走：--edge 是 .wrap 的左边缘，文案最宽 560px，之后渐渐露出墙 */
.pc-scrim {
  --edge: max(32px, 50% - 600px);
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(var(--bg-rgb), 0.6) 0, rgba(var(--bg-rgb), 0) 15%, rgba(var(--bg-rgb), 0) 72%, var(--bg) 100%),
    linear-gradient(90deg, rgba(var(--bg-rgb), 0.97) 0, rgba(var(--bg-rgb), 0.94) calc(var(--edge) + 520px), rgba(var(--bg-rgb), 0.3) calc(var(--edge) + 660px), rgba(var(--bg-rgb), 0.06) calc(var(--edge) + 840px));
}

.pc-crumb {
  position: absolute;
  z-index: 3;
  top: 26px;
  left: 0;
  right: 0;
}
.pc-crumb .breadcrumb {
  margin: 0;
}
.pc-main {
  position: relative;
  z-index: 3;
}
.pc-hero-in {
  max-width: 560px;
}
.pc-title {
  margin: 24px 0 18px;
  font-size: clamp(40px, 4.6vw, 62px);
  font-weight: 730;
  line-height: 1.18;
  letter-spacing: -0.045em;
  text-wrap: balance;
  text-shadow: 0 4px 32px rgba(var(--bg-rgb), 0.6);
}
.pc-title em {
  color: var(--gold);
  font-style: normal;
}
.pc-title .nw {
  white-space: nowrap;
}
.pc-ink {
  display: inline-block;
  white-space: nowrap;
}
.pc-ink > span {
  display: inline-block;
  animation: pc-ink 90ms cubic-bezier(0.215, 0.61, 0.355, 1) both;
}
@keyframes pc-ink {
  from {
    opacity: 0;
    filter: blur(6px);
  }
}
/* 深色底上白字显胖，正文字重降一档 */
.pc-hero .lead {
  max-width: 30em;
  margin: 0 0 30px;
  color: rgba(var(--text-rgb), 0.8);
  font-size: 17px;
  font-weight: 360;
  line-height: 1.85;
  text-wrap: pretty;
}
.pc-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px clamp(22px, 3vw, 40px);
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}
.pc-stats:not(.on) {
  visibility: hidden;
}
.pc-stats b {
  display: block;
  min-width: 3ch;
  color: var(--text);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.pc-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 360;
}
.pc-stats .pc-confirm {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 11px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.12);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.25s ease, transform 0.6s var(--pc-spring);
}
.pc-confirm.on {
  opacity: 1;
  transform: none;
}
.pc-stats .pc-confirm span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pc-confirm .icon {
  width: 17px;
  height: 17px;
  color: var(--accent);
}
.pc-hero .store-note {
  margin-top: 22px;
}
.pc-wall-note {
  position: absolute;
  z-index: 3;
  bottom: 22px;
  left: 0;
  right: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
}
.pc-pause {
  flex: none;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(var(--text-rgb), 0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 560;
  transition: background 0.2s;
}
.pc-pause:hover {
  background: rgba(var(--text-rgb), 0.14);
}
.pc-wall-note a {
  color: var(--mint);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.pc-wall-note p {
  flex: 1 1 320px;
  max-width: 560px;
  color: rgba(var(--text-rgb), 0.5);
  font-size: 11px;
  font-weight: 360;
  line-height: 1.7;
  text-wrap: pretty;
}

@media (max-width: 980px) {
  .pc-hero {
    --cols: 8;
    --strip: calc((100vw - 16px - (var(--cols) - 1) * 6px) / var(--cols) * 2 + 28px);
    display: block;
    min-height: 0;
    padding: calc(var(--strip) + 26px) 0 56px;
  }
  /* 顶上留 22px：第一行连拍组的「N 张相似」标签挂在框外上方，不留会被首屏裁掉 */
  .pc-wall {
    inset: 22px 8px auto;
  }
  .pc-scrim {
    background: linear-gradient(180deg, rgba(var(--bg-rgb), 0.3) 0, rgba(var(--bg-rgb), 0.04) 40px, rgba(var(--bg-rgb), 0.04) calc(var(--strip) - 36px), rgba(var(--bg-rgb), 0.92) calc(var(--strip) + 18px), rgba(var(--bg-rgb), 0.95) 100%);
  }
  .pc-crumb,
  .pc-wall-note {
    position: relative;
    top: auto;
    bottom: auto;
  }
  .pc-crumb .breadcrumb {
    margin-bottom: 20px;
  }
  .pc-hero-in {
    max-width: 640px;
  }
  .pc-wall-note {
    margin-top: 30px;
  }
}
@media (max-width: 720px) {
  .pc-hero {
    --cols: 6;
  }
}
@media (max-width: 560px) {
  .pc-hero {
    --cols: 4;
  }
}
@media (max-width: 480px) {
  .pc-title {
    font-size: 36px;
  }
  .pc-hero .lead {
    font-size: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pc-hero *,
  .pc-hero *::before,
  .pc-hero *::after {
    animation: none !important;
    transition: none !important;
  }
}
