/* CircularCarousel — native custom element, no dependencies. */
circular-carousel {
  display: block;
  width: 100%;
}
circular-carousel[hidden] { display: none !important; }
circular-carousel [hidden] { display: none !important; }

.cc {
  --cc-paper: var(--paper, #f7f5ef);
  --cc-ink: var(--ink, #191919);
  --cc-orange: var(--orange, #f26a35);
  --cc-soft: var(--soft, #ece7dc);
  --cc-muted: var(--muted, #5d574f);
  --cc-rule: var(--rule, rgba(25, 25, 25, 0.18));
  --cc-rule-strong: var(--rule-strong, rgba(25, 25, 25, 0.42));
  --cc-display: var(--display, "Bricolage Grotesque", "PingFang SC", "Microsoft YaHei", sans-serif);
  --cc-body: var(--body, "Bricolage Grotesque", "PingFang SC", "Microsoft YaHei", sans-serif);
  --cc-pixel: var(--pixel, "Silkscreen", "Courier New", monospace);
  --cc-card-width: 220px;
  --cc-ratio: 1;
  --cc-stage-height: clamp(380px, 30vw, 420px);
  position: relative;
  width: 100%;
  color: var(--cc-ink);
}

.cc-stage {
  position: relative;
  width: 100%;
  max-width: 860px;
  height: var(--cc-stage-height);
  margin: 0 auto;
  overflow: hidden;
  perspective: 1180px;
  perspective-origin: 50% 47%;
  touch-action: pan-y;
  user-select: none;
  cursor: grab;
}
.cc-stage.is-dragging { cursor: grabbing; }
.cc[data-preset="flat"] .cc-stage {
  perspective: none;
  cursor: grab;
}

.cc-ring {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}
.cc[data-preset="flat"] .cc-ring { transform: none; }

.cc-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(190px, min(var(--cc-card-width), 30vw), var(--cc-card-width));
  aspect-ratio: var(--cc-ratio);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--cc-ink);
  text-align: left;
  cursor: pointer;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  will-change: transform, opacity;
}
.cc-card:focus-visible { outline: none; }
.cc-card:focus-visible .cc-face {
  outline: 2px solid var(--cc-orange);
  outline-offset: 4px;
}

.cc-card-scale,
.cc-intro,
.cc-flip {
  position: absolute;
  inset: 0;
  display: block;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}
.cc-card-scale {
  transition: transform 0.36s cubic-bezier(0.2, 0.75, 0.2, 1);
}
.cc-card.is-active .cc-card-scale { transform: scale(1.06); }
.cc[data-preset="flat"] .cc-card.is-active .cc-card-scale { transform: none; }

.cc-intro { opacity: 1; }
.cc[data-intro="rise"] .cc-intro {
  animation: cc-rise 0.82s cubic-bezier(0.2, 0.75, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 58ms);
}
.cc[data-intro="fade"] .cc-intro {
  animation: cc-fade 0.58s ease both;
  animation-delay: calc(var(--i, 0) * 46ms);
}
@keyframes cc-rise {
  from { opacity: 0; transform: translateY(44px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes cc-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cc-flip {
  transition: transform 0.62s cubic-bezier(0.2, 0.75, 0.2, 1);
}
.cc-card.is-flipped .cc-flip { transform: rotateY(180deg); }

.cc-face {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  border: 1px solid var(--cc-rule-strong);
  background: var(--cc-soft);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.cc-face-front { background: var(--cc-soft); }
.cc-card.is-image-error .cc-face-front {
  display: grid;
  place-items: center;
  padding: 18px;
}
.cc-card.is-image-error .cc-face-front::after {
  content: "IMAGE / 读取失败";
  color: var(--cc-muted);
  font-family: var(--cc-pixel);
  font-size: 8px;
  line-height: 1.5;
  text-align: center;
}
.cc-card.is-image-error .cc-face-front img { display: none; }
.cc-face-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.6s cubic-bezier(0.2, 0.75, 0.2, 1);
  -webkit-user-drag: none;
  user-select: none;
}
@media (hover: hover) {
  .cc-card:hover .cc-face-front img { transform: scale(1.025); }
}

.cc-face-back {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(15px, 2.8vw, 24px);
  border-color: var(--cc-ink);
  background: var(--cc-soft);
  transform: rotateY(180deg);
}
.cc-back-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--cc-muted);
  font-family: var(--cc-pixel);
  font-size: 8px;
  line-height: 1.4;
  letter-spacing: 0.025em;
}
.cc-back-index { color: var(--cc-ink); }
.cc-back-copy { min-width: 0; }
.cc-back-title {
  display: block;
  font-family: var(--cc-display);
  font-size: clamp(1.4rem, 2.5vw, 2.15rem);
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}
.cc-back-subtitle {
  display: block;
  margin-top: 9px;
  color: var(--cc-muted);
  font-family: var(--cc-body);
  font-size: 11px;
  line-height: 1.4;
}
.cc-back-mark {
  display: block;
  width: 14px;
  height: 14px;
  background: var(--cc-orange);
  flex: none;
}

.cc-arrow {
  position: absolute;
  top: 50%;
  z-index: 8;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--cc-ink);
  border-radius: 0;
  background: var(--cc-paper);
  color: var(--cc-ink);
  transform: translateY(-50%);
  transition: background-color 0.2s ease, color 0.2s ease;
}
.cc-arrow:hover { background: var(--cc-ink); color: var(--cc-paper); }
.cc-arrow svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: square;
  stroke-linejoin: miter;
}
.cc-prev { left: 8px; }
.cc-next { right: 8px; }

.cc-caption {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 22px;
  width: 100%;
  max-width: 860px;
  min-height: 70px;
  margin: 0 auto;
  padding: 11px 0 13px;
  border-top: 1px solid var(--cc-ink);
  border-bottom: 1px solid var(--cc-rule);
}
.cc-caption-copy { min-width: 0; }
.cc-kicker {
  color: var(--cc-muted);
  font-family: var(--cc-pixel);
  font-size: 8px;
  line-height: 1.4;
  letter-spacing: 0.025em;
}
.cc-caption h3 {
  margin-top: 5px;
  font-family: var(--cc-display);
  font-size: clamp(1.45rem, 2.35vw, 2rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.032em;
}
.cc-caption h3 span {
  margin-left: 10px;
  color: var(--cc-muted);
  font-family: var(--cc-body);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.01em;
}
.cc-open {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--cc-rule-strong);
  color: var(--cc-muted);
  font-family: var(--cc-pixel);
  font-size: 8px;
  line-height: 1.4;
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.cc-open:hover { color: var(--cc-ink); border-color: var(--cc-ink); }
.cc-open span { color: var(--cc-orange); }

.cc-index {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  width: 100%;
  max-width: 860px;
  margin: 8px auto 0;
}
.cc-index-button {
  width: 32px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--cc-muted);
  font-family: var(--cc-pixel);
  font-size: 8px;
  line-height: 1;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.cc-index-button:hover { border-color: var(--cc-rule); color: var(--cc-ink); }
.cc-index-button[aria-current="true"] {
  border-color: var(--cc-ink);
  background: var(--cc-ink);
  color: var(--cc-paper);
}

.cc[data-captions="false"] .cc-caption { display: none; }
.cc[data-captions="false"] .cc-index { margin-top: 12px; }

.cc-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cc-empty {
  padding: 24px 0;
  color: var(--cc-muted);
  font-size: 12px;
}

@media (max-width: 960px) {
  .cc-stage { perspective: 1080px; }
  .cc-arrow { display: none; }
}

@media (max-width: 720px) {
  .cc { --cc-stage-height: 380px; }
  .cc-stage { perspective: 980px; }
  .cc-caption { gap: 14px; min-height: 68px; }
  .cc-caption h3 { font-size: clamp(1.25rem, 4.8vw, 1.6rem); }
  .cc-caption h3 span { display: block; margin: 4px 0 0; font-size: 10px; }
  .cc-index { justify-content: space-between; gap: 0; }
  .cc-index-button { width: 30px; height: 27px; font-size: 7px; }
}

@media (max-width: 480px) {
  .cc-card { width: min(var(--cc-card-width), 58vw); }
  .cc-caption { grid-template-columns: 1fr; gap: 9px; padding: 11px 0 13px; }
  .cc-open { justify-self: start; }
  .cc-face-back { padding: 14px; }
  .cc-back-title { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-intro { animation: none !important; }
  .cc-card-scale,
  .cc-flip,
  .cc-face-front img,
  .cc-arrow,
  .cc-open { transition-duration: 0.001ms !important; }
}
