/* From Uiverse.io by Ashon-G - 作用域限定在 richness-content 内 */
.richness-content {
  position: relative;
  width: 100%;
  height: 500px;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1200px;
}

.richness-content .orbit-icon {
  width: 1.6em;
  height: 1.6em;
  line-height: 1.6em;
  font-size: 1.2em;
  border-radius: 50%;
  display: block;
  object-fit: contain;
}

.richness-content .orbit-wrap {
  height: 40em;
  list-style: none;
  font-size: 1.3em;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.richness-content .orbit-wrap > li {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.richness-content .orbit-wrap > li:hover ul {
  border-width: 2px;
  border-color: #fff;
}

.richness-content .orbit-wrap > li:hover ~ li ul {
  border-color: rgba(255, 255, 255, 0.2);
}

.richness-content .orbit-wrap > li:hover ~ li ul li {
  opacity: 0.4;
}

.richness-content ul[class^=ring] {
  transition: all 300ms ease-in-out;
}

.richness-content ul[class^=ring] li {
  transition: all 300ms ease-in-out;
}

.richness-content .ring-0 {
  width: 25em;
  height: 25em;
  animation: clockwiseRotate 35s linear infinite;
}

.richness-content .ring-0 img {
  animation: counterClockwiseRotate 35s linear infinite;
}

.richness-content .ring-0 > *:nth-of-type(1) {
  transform: rotate(95deg) translate(12.5em) rotate(-95deg);
}

.richness-content .ring-0 > *:nth-of-type(2) {
  transform: rotate(190deg) translate(12.5em) rotate(-190deg);
}

.richness-content .ring-0 > *:nth-of-type(3) {
  transform: rotate(285deg) translate(12.5em) rotate(-285deg);
}

.richness-content .ring-0 > *:nth-of-type(4) {
  transform: rotate(380deg) translate(12.5em) rotate(-380deg);
}

.richness-content .ring-1 {
  width: 20em;
  height: 20em;
  animation: clockwiseRotate 30s linear infinite;
}

.richness-content .ring-1 img {
  animation: counterClockwiseRotate 30s linear infinite;
}

.richness-content .ring-1 > *:nth-of-type(1) {
  transform: rotate(126.6666666667deg) translate(10em) rotate(-126.6666666667deg);
}

.richness-content .ring-1 > *:nth-of-type(2) {
  transform: rotate(253.3333333333deg) translate(10em) rotate(-253.3333333333deg);
}

.richness-content .ring-1 > *:nth-of-type(3) {
  transform: rotate(380deg) translate(10em) rotate(-380deg);
}

.richness-content .ring-2 {
  width: 15em;
  height: 15em;
  animation: clockwiseRotate 25s linear infinite;
}

.richness-content .ring-2 img {
  animation: counterClockwiseRotate 25s linear infinite;
}

.richness-content .ring-2 > *:nth-of-type(1) {
  transform: rotate(47.5deg) translate(7.5em) rotate(-47.5deg);
}

.richness-content .ring-2 > *:nth-of-type(2) {
  transform: rotate(95deg) translate(7.5em) rotate(-95deg);
}

.richness-content .ring-2 > *:nth-of-type(3) {
  transform: rotate(142.5deg) translate(7.5em) rotate(-142.5deg);
}

.richness-content .ring-2 > *:nth-of-type(4) {
  transform: rotate(190deg) translate(7.5em) rotate(-190deg);
}

.richness-content .ring-2 > *:nth-of-type(5) {
  transform: rotate(237.5deg) translate(7.5em) rotate(-237.5deg);
}

.richness-content .ring-2 > *:nth-of-type(6) {
  transform: rotate(285deg) translate(7.5em) rotate(-285deg);
}

.richness-content .ring-2 > *:nth-of-type(7) {
  transform: rotate(332.5deg) translate(7.5em) rotate(-332.5deg);
}

.richness-content .ring-2 > *:nth-of-type(8) {
  transform: rotate(380deg) translate(7.5em) rotate(-380deg);
}

.richness-content .ring-3 {
  width: 10em;
  height: 10em;
  animation: clockwiseRotate 20s linear infinite;
}

.richness-content .ring-3 img {
  animation: counterClockwiseRotate 20s linear infinite;
}

.richness-content .ring-3 > *:nth-of-type(1) {
  transform: rotate(126.6666666667deg) translate(5em) rotate(-126.6666666667deg);
}

.richness-content .ring-3 > *:nth-of-type(2) {
  transform: rotate(253.3333333333deg) translate(5em) rotate(-253.3333333333deg);
}

.richness-content .ring-3 > *:nth-of-type(3) {
  transform: rotate(380deg) translate(5em) rotate(-380deg);
}

.richness-content ul[class^=ring] {
  border: solid 1px rgba(33, 150, 243, 0.8);
  position: relative;
  padding: 0;
  border-radius: 50%;
  list-style: none;
  box-sizing: content-box;
}

.richness-content ul[class^=ring] li {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.6em;
  height: 1.6em;
  margin: -0.8em;
}

.richness-content .orbit-center {
  z-index: 5;
  font-size: 2em;
  width: 1.8em;
  height: 1.8em;
  line-height: 1.8em;
  text-align: center;
  background: hotpink;
  border-radius: 50%;
}

.richness-content .orbit-center:hover .orbit-center__icon {
  transform: rotateZ(0deg);
}

.richness-content .orbit-center__icon {
  transform: rotateZ(-360deg);
  transition: all 300ms ease-in-out;
  border-radius: 50%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.richness-content .orbit-wrap > li.orbit-center:hover ~ li > ul {
  width: 0;
  height: 0;
}

.richness-content .orbit-wrap > li.orbit-center:hover ~ li > ul * {
  transform: translate(0, 0);
}

/* ============================================
   3D 视图模式
   ============================================ */
.richness-content.view-3d .orbit-wrap {
  transform: rotateX(65deg) rotateZ(-20deg);
  transform-style: preserve-3d;
}

.richness-content.view-3d ul[class^=ring] {
  transform-style: preserve-3d;
  border-color: rgba(33, 150, 243, 0.4);
  box-shadow: 0 0 15px rgba(33, 150, 243, 0.15);
}

.richness-content.view-3d ul[class^=ring] li {
  transform-style: preserve-3d;
}

.richness-content.view-3d .orbit-icon {
  transform: rotateX(-65deg) rotateZ(20deg);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.richness-content.view-3d .orbit-center__icon {
  transform: rotateX(-65deg) rotateZ(20deg);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.richness-content.view-3d .ring-0 {
  animation: clockwiseRotate3d 35s linear infinite;
}

.richness-content.view-3d .ring-0 img {
  animation: counterClockwiseRotate3d 35s linear infinite;
}

.richness-content.view-3d .ring-1 {
  animation: clockwiseRotate3d 30s linear infinite;
}

.richness-content.view-3d .ring-1 img {
  animation: counterClockwiseRotate3d 30s linear infinite;
}

.richness-content.view-3d .ring-2 {
  animation: clockwiseRotate3d 25s linear infinite;
}

.richness-content.view-3d .ring-2 img {
  animation: counterClockwiseRotate3d 25s linear infinite;
}

.richness-content.view-3d .ring-3 {
  animation: clockwiseRotate3d 20s linear infinite;
}

.richness-content.view-3d .ring-3 img {
  animation: counterClockwiseRotate3d 20s linear infinite;
}

@keyframes clockwiseRotate3d {
  from {
    transform: rotateX(0deg) rotateZ(0deg);
  }
  to {
    transform: rotateX(0deg) rotateZ(360deg);
  }
}

@keyframes counterClockwiseRotate3d {
  0% {
    transform: rotateX(-65deg) rotateZ(20deg);
  }
  100% {
    transform: rotateX(-65deg) rotateZ(-340deg);
  }
}

/* ============================================
   3D/2D 切换按钮
   ============================================ */
.orbit-view-toggle {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(80, 80, 80, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50px;
  padding: 6px 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
  margin: 0 auto 12px;
  width: fit-content;
}

.orbit-view-toggle:hover {
  background: rgba(80, 80, 80, 0.35);
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
}

.orbit-view-toggle:active {
  transform: scale(0.95);
}

.orbit-view-toggle-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.5px;
}

.orbit-view-toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 13px;
  transition: background 0.4s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.orbit-view-toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.orbit-view-toggle.active .orbit-view-toggle-switch {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-color: rgba(102, 126, 234, 0.5);
}

.orbit-view-toggle.active .orbit-view-toggle-switch::after {
  left: 24px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.orbit-view-toggle-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orbit-view-toggle-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 暗色模式适配 */
.dark-mode .orbit-view-toggle {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .orbit-view-toggle:hover {
  background: rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.2);
}

.dark-mode .orbit-view-toggle-label {
  color: rgba(255, 255, 255, 0.75);
}

.dark-mode .orbit-view-toggle-icon svg {
  stroke: rgba(255, 255, 255, 0.75);
}

/* 3D模式下轨道发光效果 */
.richness-content.view-3d .ring-0 {
  box-shadow: 0 0 20px rgba(33, 150, 243, 0.2), inset 0 0 20px rgba(33, 150, 243, 0.05);
}

.richness-content.view-3d .ring-1 {
  box-shadow: 0 0 18px rgba(33, 150, 243, 0.18), inset 0 0 18px rgba(33, 150, 243, 0.04);
}

.richness-content.view-3d .ring-2 {
  box-shadow: 0 0 15px rgba(33, 150, 243, 0.15), inset 0 0 15px rgba(33, 150, 243, 0.03);
}

.richness-content.view-3d .ring-3 {
  box-shadow: 0 0 12px rgba(33, 150, 243, 0.12), inset 0 0 12px rgba(33, 150, 243, 0.02);
}

/* 切换时的过渡动画 */
.richness-content .orbit-wrap {
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.richness-content ul[class^=ring] {
  transition: border-color 0.8s ease, box-shadow 0.8s ease;
}

@keyframes clockwiseRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes counterClockwiseRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(-360deg);
  }
}

/* ============================================
   移动端 3D 模式优化
   ============================================ */
@media (max-width: 768px) {
  .richness-content {
    height: 500px;
    perspective: 1200px;
  }

  .richness-content .orbit-wrap {
    font-size: 0.9em;
    height: 40em;
  }

  .richness-content .ring-0 {
    animation-duration: 45s;
  }
  .richness-content .ring-0 img {
    animation-duration: 45s;
  }

  .richness-content .ring-1 {
    animation-duration: 40s;
  }
  .richness-content .ring-1 img {
    animation-duration: 40s;
  }

  .richness-content .ring-2 {
    animation-duration: 35s;
  }
  .richness-content .ring-2 img {
    animation-duration: 35s;
  }

  .richness-content .ring-3 {
    animation-duration: 30s;
  }
  .richness-content .ring-3 img {
    animation-duration: 30s;
  }

  .richness-content.view-3d .orbit-wrap {
    transform: rotateX(55deg) rotateZ(-15deg);
  }

  .richness-content.view-3d .orbit-icon {
    transform: rotateX(-55deg) rotateZ(15deg);
  }

  .richness-content.view-3d .orbit-center__icon {
    transform: rotateX(-55deg) rotateZ(15deg);
  }

  .richness-content.view-3d .ring-0 {
    animation-duration: 45s;
  }
  .richness-content.view-3d .ring-0 img {
    animation-duration: 45s;
  }
  .richness-content.view-3d .ring-1 {
    animation-duration: 40s;
  }
  .richness-content.view-3d .ring-1 img {
    animation-duration: 40s;
  }
  .richness-content.view-3d .ring-2 {
    animation-duration: 35s;
  }
  .richness-content.view-3d .ring-2 img {
    animation-duration: 35s;
  }
  .richness-content.view-3d .ring-3 {
    animation-duration: 30s;
  }
  .richness-content.view-3d .ring-3 img {
    animation-duration: 30s;
  }

  @keyframes counterClockwiseRotate3d {
    0% {
      transform: rotateX(-55deg) rotateZ(15deg);
    }
    100% {
      transform: rotateX(-55deg) rotateZ(-345deg);
    }
  }

  .richness-content.view-3d ul[class^=ring] {
    box-shadow: 0 0 10px rgba(33, 150, 243, 0.1);
  }

  .richness-content .orbit-icon {
    width: 1.6em;
    height: 1.6em;
  }
}
