/*
 * 2 号板块独立预览样式。
 * 所有视觉规则都限定在 data-section02-flipper 内，避免影响正式页其他板块。
 */

[data-section02-flipper] {
  --section02-ink: #171717;
  --section02-line: #e5e5e5;
  position: relative;
  scroll-margin-top: 57px;
  min-height: 0;
  padding: 34px 20px 30px;
  overflow: hidden;
  isolation: isolate;
  background: #fff;
}

[data-section02-flipper] [data-section02-grid] {
  width: min(960px, 100%);
  min-height: 0;
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 24px;
  background: #fff;
  opacity: 1;
  transform: none;
}

[data-section02-flipper]:not(.section02-is-ready) [data-section02-grid] {
  opacity: 0;
}

[data-section02-flipper] .section02-slot {
  position: relative;
  height: 36px;
  min-width: 0;
  min-height: 0;
  display: block;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  perspective: 760px;
  contain: layout paint;
}

[data-section02-flipper] .section02-slot:nth-child(n + 5) {
  display: none;
}

[data-section02-flipper] .section02-face {
  position: absolute;
  inset: 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 8px;
  color: var(--section02-ink);
  font-size: 19px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.01em;
  opacity: 0;
  transform: rotateX(100deg);
  transform-origin: 50% 50%;
  backface-visibility: hidden;
  will-change: transform, opacity;
  transition:
    opacity 500ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 500ms cubic-bezier(0.4, 0, 0.2, 1);
  transition-delay: calc(var(--section02-order) * 50ms);
}

[data-section02-flipper] .section02-face.section02-is-current {
  opacity: 1;
  transform: rotateX(0deg);
}

[data-section02-flipper] .section02-face.section02-is-exiting {
  opacity: 0;
  transform: rotateX(-100deg);
}

[data-section02-flipper] .section02-face svg,
[data-section02-flipper] .section02-face i {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  color: var(--section02-ink);
  stroke-width: 1.75;
}

[data-section02-flipper] .section02-face strong {
  min-width: 0;
  overflow: hidden;
  color: var(--section02-ink);
  font: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-section02-flipper] .section02-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 640px) {
  [data-section02-flipper] [data-section02-grid] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    padding-inline: 0;
  }

  [data-section02-flipper] .section02-slot:nth-child(n + 5) {
    display: block;
  }

  [data-section02-flipper] .section02-slot:nth-child(n + 7) {
    display: none;
  }
}

@media (min-width: 768px) {
  [data-section02-flipper] [data-section02-grid] {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 24px;
    padding-inline: 0;
  }

  [data-section02-flipper] .section02-slot:nth-child(n + 7) {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-section02-flipper] .section02-face {
    transition: none;
  }
}
