* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html,
body {
  overflow-x: hidden;
  width: 100%;
}
html {
  background: var(--color-bg-main);
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 var(--header-padding-x);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 80px;
}
.header-btn {
  padding: 0 16px;
  /* width: 134px; */
  height: 44px;
  background: var(--color-black);
  border-radius: 4px;
  color: var(--color-text-white);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-base);
}
.header-btn:hover {
  transform: scale(1.1) !important;
}
.desktop-logo {
  height: 35px;
}
.title-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--header-padding-x);
  margin-bottom: var(--pc-gap);
}
.title-container .title-main {
  font-size: var(--font-size-title-main);
  color: var(--color-text-main);
  margin-bottom: 12px;
  font-family: var(--font-black);
  font-weight: bold;
}
.title-container .title-sub {
  font-weight: 500;
  font-size: var(--font-size-title-sub);
  color: var(--color-text-main);
}
.title-container .btns {
  text-align: center;
}
.title-container .btns .localized-btn {
  width: 430px;
  height: 72px;
  background: var(--gradient-btn);
  border-radius: var(--btn-radius);
  color: var(--color-text-sub);
  font-size: var(--font-size-btn);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-bottom: 35px;
  border: none;
  box-shadow: #ffbc00 0px 0px 0px 0px;
  animation: pulse 2s ease infinite;
  position: relative;
  font-family: var(--font-bold);
}
.localized-btn img {
  position: absolute;
  right: 20px;
}
.waterfall-container {
  margin-bottom: var(--pc-gap);
  width: 100%;
  overflow: hidden;
  position: relative;
}

.waterfall-wrapper {
  display: flex;
  width: max-content;
  animation: waterfallScroll 60s linear infinite;
}

.waterfall-container img {
  height: 789px;
  width: auto;
  display: block;
  margin-right: 35px;
}

@keyframes waterfallScroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-33.333333%);
  }
}

.carousel-container {
  background-color: var(--color-bg-dark);
  background-image: url("../img/new_carousel_texture.webp");
  background-repeat: no-repeat;
  background-size: cover;
  padding: 100px 0 97px 0;
}
.carousel-container .title {
  color: var(--color-text-white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-bottom: 100px;
}
.carousel-container .title .title-main {
  font-size: var(--font-size-title-main);
  margin-bottom: 12px;
  text-align: center;
  font-family: var(--font-black);
  font-weight: bold;
}
.carousel-container .title .title-sub {
  font-size: var(--font-size-title-sub);
  padding: 0 16px;
  font-weight: 500;
  text-align: center;
}
.carousel-container .content {
  position: relative;
  width: 100%;
  height: 852px;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.carousel-item {
  position: absolute;
  width: 400px;
  height: 700px;
  transition: var(--transition-smooth);
  border-radius: var(--item-radius);
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  cursor: pointer;
  box-shadow: var(--shadow-item);
}
.carousel-item .item-title {
  width: 400px;
  height: 310px;
  background: var(--gradient-overlay);
  position: absolute;
  bottom: 0px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 50px;
  font-style: italic;
  color: var(--color-text-white);
  text-align: center;
  font-family: var(--font-black);
  white-space: nowrap; /* 不换行 */
  font-weight: bold;
}
.carousel-item .item-title span {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
}
.carousel-item.pos-center {
  z-index: 5;
  transform: translateX(-50%) scale(1);
  opacity: 1;
}

.carousel-item.pos-left-1 {
  z-index: 4;
  transform: translateX(-160%) scale(0.9);
  opacity: 1;
}

.carousel-item.pos-right-1 {
  z-index: 4;
  transform: translateX(60%) scale(0.9);
  opacity: 1;
}

.carousel-item.pos-left-2 {
  z-index: 3;
  transform: translateX(-260%) scale(0.8);
  opacity: 1;
}

.carousel-item.pos-right-2 {
  z-index: 3;
  transform: translateX(160%) scale(0.8);
  opacity: 1;
}

.carousel-item.pos-hidden {
  z-index: 1;
  opacity: 0;
  transform: translateX(-50%) scale(0.5);
  visibility: hidden;
  pointer-events: none;
}

.carousel-controls {
  position: absolute;
  bottom: 3px;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
}

.carousel-dots {
  display: flex;
  gap: 12px;
  margin-bottom: 36px;
}

.carousel-dot {
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition-base);
}

.carousel-dot.active {
  width: 18px;
  height: 12px;
  background: var(--color-white);
  border-radius: 6px;
}

.carousel-btns {
  display: flex;
  gap: 140px;
}

.carousel-btn {
  width: 68px;
  height: 68px;
  cursor: pointer;
  transition: var(--transition-base);
  user-select: none;
}

.carousel-btn.disabled {
  cursor: not-allowed !important;
}
.cards-container {
  padding: 100px 180px;
}
.cards-container .title {
  color: var(--color-text-main);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-bottom: 100px;
}
.cards-container .title .title-main {
  font-size: var(--font-size-title-main);
  margin-bottom: 12px;
  text-align: center;
  font-family: var(--font-black);
  font-weight: bold;
}
.cards-container .title .title-sub {
  font-size: var(--font-size-title-sub);
  padding: 0 16px;
  font-weight: 500;
  text-align: center;
}
.cards {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cards-item {
  width: 480px;
  height: 498px;
  background: var(--color-bg-card);
  box-shadow: var(--shadow-card);
  border-radius: var(--card-radius);
  transition: var(--transition-smooth);
  cursor: pointer;
}

.cards-item:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-card-hover);
}

.cards-item img {
  width: 480px;
  height: 285px;
  position: relative;
  top: -21px;
  transition: transform 0.3s ease-in-out;
}

.cards-item .detail {
  padding: 0 24px;
}
.cards-item .detail .detail-title {
  color: var(--color-text-sub);
  font-size: var(--font-size-card-title);
  display: flex;
  margin-bottom: 24px;
  font-family: var(--font-black);
  font-weight: bold;
}
.cards-item .detail .detail-desc {
  color: var(--color-text-main);
  font-size: var(--font-size-card-desc);
}

.download-btns :first-child {
  margin-right: 17px;
}
.download-btns img {
  height: 69px;
  transition: var(--transition-base);
}
.download-btns img:hover {
  transform: scale(1.1);
}

.join-container {
  background-color: var(--color-bg-dark);
  background-image: url("../img/new_carousel_texture.webp");
  background-repeat: no-repeat;
  background-size: cover;
  padding: 100px 0;
}

.join-container .title {
  color: var(--color-text-white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-bottom: 206px;
}
.join-container .title .title-main {
  font-size: var(--font-size-title-main);
  margin-bottom: 12px;
  text-align: center;
  font-family: var(--font-black);
  font-weight: bold;
}
.join-container .title .title-sub {
  font-size: var(--font-size-title-sub);
  padding: 0 16px;
  font-weight: 500;
  text-align: center;
}
.join-container .content {
  position: relative;
  width: 100%;
  height: 523px;
  display: flex;
  justify-content: center;
  overflow: visible; /* Allow items to be seen */
}

.join-item {
  position: absolute;
  width: 900px;
  height: 360px;
  background: transparent; /* Container is transparent */
  transition: var(--transition-smooth);
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  cursor: pointer;
  display: flex;
  align-items: center;
}

/* Reuse carousel pos logic but adapted if needed */
.join-item.pos-center {
  z-index: 10;
  transform: translateX(-50%) scale(1);
  opacity: 1;
}

.join-item.pos-right-1 {
  z-index: 9;
  transform: translateX(calc(-50% + 835px)) scale(0.9); /* Shift to right with 60px visual gap */
  opacity: 1; /* Visible as per design */
}

/* Hidden items logic */
.join-item.pos-left-1 {
  z-index: 9;
  transform: translateX(calc(-50% - 835px)) scale(0.9); /* Shift to left */
  opacity: 0; /* Hidden or visible depending on desired loop effect */
  visibility: hidden;
}

.join-item.pos-right-2 {
  z-index: 8;
  transform: translateX(calc(-50% + 1670px)) scale(0.9);
  opacity: 0;
  visibility: hidden;
}

.join-item.pos-left-2,
.join-item.pos-hidden {
  z-index: 1;
  opacity: 0;
  transform: translateX(-50%) scale(0.5);
  visibility: hidden;
  pointer-events: none;
}

.join-item .avatar {
  width: 360px;
  height: 360px;
  position: absolute;
  left: 0;
  bottom: 76px;
  z-index: 2;
}

.join-item .comment-info {
  margin-left: 120px; /* Overlap starts */
  width: 700px;
  height: 300px;
  background: var(--color-bg-card);
  border-radius: 36px;
  padding: 36px 30px 0 274px; /* Left padding clears the image */
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-info);
}

.join-item .comment-info .marks {
  z-index: 2;
  position: absolute;
  top: 24px;
  right: 34px;
}
.join-item .comment-item-name {
  font-size: 24px;
  color: var(--color-text-sub);
  margin-bottom: 34px;
  font-family: var(--font-black);
  font-weight: bold;
}

.join-item .comment-item-text {
  font-size: 20px;
  color: var(--color-text-main);
}

.join-container .carousel-controls {
  position: absolute;
  bottom: 48px;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 20;
}

.join-container .carousel-dots {
  display: flex;
  gap: 12px;
  margin-bottom: 36px;
}

.join-container .carousel-dot {
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition-base);
}

.join-container .carousel-dot.active {
  width: 18px;
  height: 12px;
  background: var(--color-white);
  border-radius: 6px;
  transform: none;
}

.join-container .carousel-btns {
  display: flex;
  gap: 140px; /* Matched to design */
}

.join-container .carousel-btn {
  width: 68px;
  height: 68px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-base);
  user-select: none;
}

/* Use images for buttons */
.join-container .carousel-btn.prev {
  background-size: contain;
  background-repeat: no-repeat;
  color: transparent; /* Hide text */
}

.join-container .carousel-btn.next {
  background-size: contain;
  background-repeat: no-repeat;
  color: transparent; /* Hide text */
}

.line {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.25);
}

.footer {
  padding: 60px 240px;
  display: flex;
  justify-content: space-between;
}
.footer img {
  width: 240px;
  height: 35px;
}
.menu {
  text-align: right;
  font-size: 18px;
  color: var(--color-text-white);
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.menu span {
  cursor: pointer;
  transition: var(--transition-base);
}
.menu span:hover {
  transform: scale(1.1);
  color: rgba(255, 255, 255, 0.8);
}

@keyframes pulse {
  100% {
    box-shadow: transparent 0px 0px 0px 14px;
  }
}

.sticky-btn {
  display: none;
  position: fixed;
  top: 16px;
  z-index: 1000;
  width: 430px;
  height: 72px;
  background: var(--gradient-btn);
  border-radius: var(--btn-radius);
  color: var(--color-text-sub);
  font-size: var(--font-size-btn);
  font-weight: 800;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  box-shadow: #ffbc00 0px 0px 0px 0px;
  animation: pulse 2s ease infinite;
}
.sticky-btn img {
  position: absolute;
  right: 20px;
}
.sticky-btn.visible {
  display: flex;
}

/* Apple-style Initialization Animation */
@keyframes appleReveal {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
    filter: blur(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.init-animate {
  opacity: 0; /* Start invisible */
  animation: appleReveal 1.2s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

/* Restore transition behavior for download buttons after animation */
.download-btns:not(.init-animate) img {
  transition: var(--transition-base);
}

.delay-100 {
  animation-delay: 0.1s !important;
}
.delay-200 {
  animation-delay: 0.2s !important;
}
.delay-300 {
  animation-delay: 0.3s !important;
}
.delay-400 {
  animation-delay: 0.4s !important;
}
.delay-500 {
  animation-delay: 0.5s !important;
}
.delay-600 {
  animation-delay: 0.6s !important;
}
.delay-700 {
  animation-delay: 0.7s !important;
}
.delay-800 {
  animation-delay: 0.8s !important;
}
.delay-900 {
  animation-delay: 0.9s !important;
}
.delay-1000 {
  animation-delay: 1s !important;
}

/* Combined animation for the main button to preserve pulse */
.title-container .btns .localized-btn.init-animate,
.localized-btn.init-animate {
  animation:
    appleReveal 1.2s cubic-bezier(0.19, 1, 0.22, 1) forwards,
    pulse 2s ease infinite;
  /* Delays will be handled by the utility class applying to both, or we can hardcode here if needed.
     With .delay-400, both start at 0.4s. appleReveal takes 1.2s. Pulse runs concurrently. 
     Since pulse only affects shadow, it's fine. */
}

/* Image Fade-in Transition */
img.lazy-load {
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

img.lazy-load.loaded {
  opacity: 1;
}

/* Waterfall Wrapper Container Fade-in */
.waterfall-wrapper {
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.waterfall-wrapper.loaded {
  opacity: 1;
}
