.carousel {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 2000px;
}

.card {
  position: absolute;
  width: 350px;
  height: 540px;
  padding: 20px;
  background: #fff;
  border-radius: 24px;
  transform-style: preserve-3d;
  transition: all 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backface-visibility: hidden;
  will-change: transform, opacity;
  transform-origin: center center;
  gap: 16px;
}

.card.active {
  transform: translateX(0) translateZ(0) rotateY(0) scale(1);
  opacity: 1;
  z-index: 5;
}

.card.prev-2 {
  transform: translateX(-140%) translateZ(-500px) rotateY(45deg);
  opacity: 0.4;
  z-index: 2;
  transform-origin: center center;
  filter: blur(2px);
}

.card.prev {
  transform: translateX(-75%) translateZ(-250px) rotateY(35deg);
  opacity: 0.7;
  z-index: 3;
}

.card.next {
  transform: translateX(75%) translateZ(-250px) rotateY(-35deg);
  opacity: 0.7;
  z-index: 3;
}

.card.next-2 {
  transform: translateX(140%) translateZ(-500px) rotateY(-45deg);
  opacity: 0.4;
  z-index: 2;
  transform-origin: center center;
  filter: blur(2px);
}

.card.hidden {
  opacity: 0;
  transform: translateX(0) translateZ(-800px);
  pointer-events: none;
}

.carousel-nav {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  color: #666;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 16px;
  background: rgba(255,255,255,0.8);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, rgba(255,255,255,0.1), rgba(255,255,255,0));
  pointer-events: none;
}

/* 用户卡片样式 */
.user-card img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 20px;
  background: #f5f5f5;
}

.user-card .info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.user-card .name {
  font-size: 24px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
}

.user-card .describe {
  font-size: 16px;
  line-height: 1.6;
  color: #666;
  margin-bottom: 24px;
  transition: opacity 0.5s ease;
}

.user-card .social {
  margin-top: auto;
  display: flex;
  gap: 12px;
}

.user-card .social-icon {
  padding: 10px;
  border-radius: 12px;
  background: #f5f5f5;
  color: #666;
  transition: all 0.3s ease;
}

.user-card .social-icon:hover {
  background: #e0e0e0;
  transform: translateY(-2px);
}

/* 项目卡片样式 */
.project-card img {
  width: calc(100% + 40px);
  height: 240px;
  object-fit: cover;
  margin: -20px -20px 20px -20px;
  background: #f5f5f5;
}

.project-card .info {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 6px;
}

.project-card .name {
  font-size: 22px;
  font-weight: 600;
  color: #333;
  margin-bottom: 16px;
}

.project-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.project-card .tag {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(0,0,0,0.05);
  font-size: 13px;
  font-weight: 500;
  color: #555;
  letter-spacing: 0.5px;
}

.project-card .tag .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  display: inline-block;
  flex-shrink: 0;
}

.project-card .describe {
  font-size: 15px;
  line-height: 1.6;
  color: #666;
  margin-bottom: 20px;
}

.project-card .operate-btn {
  margin-top: auto;
  display: flex;
  gap: 12px;
}

/* 基本按钮样式 */
.project-card .operate-btn a {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
}

/* 查看代码按钮 */
.project-card .operate-btn .btn-code {
  background: #f5f5f5;
  color: #666;
}

/* 立即下载按钮 */
.project-card .operate-btn .btn-demo {
  background: #ff923e;
  color: #fff;
}

/* 按钮悬停效果 */
.project-card .operate-btn a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
  .carousel {
    perspective: 1200px;
  }

  .card {
    width: 280px;  /* 减小卡片宽度 */
    height: 420px; /* 减小卡片高度 */
    padding: 12px;
  }

  /* 调整移动端的卡片位置和角度 */
  .card.active {
    transform: translateX(0) translateZ(0) rotateY(0);
  }

  .card.prev-2 {
    transform: translateX(-120%) translateZ(-300px) rotateY(45deg);
  }

  .card.prev {
    transform: translateX(-60%) translateZ(-150px) rotateY(35deg);
  }

  .card.next {
    transform: translateX(60%) translateZ(-150px) rotateY(-35deg);
  }

  .card.next-2 {
    transform: translateX(120%) translateZ(-300px) rotateY(-45deg);
  }

  /* 调整卡片内容样式 */
  .card .name {
    font-size: 18px !important;
  }

  .card .describe {
    font-size: 14px;
  }

  .card .tags {
    gap: 6px !important;
  }

  .card .tag {
    font-size: 12px !important;
    padding: 3px 6px !important;
  }

  .card .operate-btn {
    gap: 6px !important;
  }

  .card .operate-btn a {
    padding: 8px !important;
    font-size: 14px;
  }

  .card .social-icon {
    padding: 6px !important;
  }

  .user-card img {
    height: 200px;
    margin-bottom: 12px;
  }
  
  .project-card img {
    height: 180px;
  }

  .user-card .social {
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
  }

  .user-card .social-icon {
    padding: 8px !important;
    border-radius: 8px;
    background: rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .user-card .info {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 12px;
  }

  .user-card .describe {
    margin-bottom: 0;
    font-size: 14px;
  }

  .user-card .name {
    font-size: 18px !important;
  }

  .user-card .social-icon svg {
    width: 18px;
    height: 18px;
  }

  /* 优化项目卡片按钮 */
  .project-card .operate-btn {
    gap: 8px !important;
    padding: 0 4px;
  }

  .project-card .operate-btn .btn-code,
  .project-card .operate-btn .btn-demo {
    padding: 10px 8px !important;
    font-size: 12px !important;
  }
}

/* 更小屏幕的适配 */
@media screen and (max-width: 375px) {
  .card {
    width: 260px;
    height: 400px;
    padding: 10px;
  }

  .card.prev-2 {
    transform: translateX(-110%) translateZ(-250px) rotateY(45deg);
  }

  .card.prev {
    transform: translateX(-55%) translateZ(-125px) rotateY(35deg);
  }

  .card.next {
    transform: translateX(55%) translateZ(-125px) rotateY(-35deg);
  }

  .card.next-2 {
    transform: translateX(110%) translateZ(-250px) rotateY(-45deg);
  }

  .user-card img {
    height: 180px;
    margin-bottom: 10px;
  }
  
  .project-card img {
    height: 160px;
  }

  .user-card .social {
    gap: 6px;
  }

  .user-card .social-icon {
    padding: 6px !important;
  }

  .user-card .social-icon svg {
    width: 16px;
    height: 16px;
  }

  .project-card .operate-btn {
    gap: 6px !important;
  }

  .project-card .operate-btn a {
    padding: 8px 6px !important;
    font-size: 11px !important;
  }

  .user-card .info {
    gap: 10px;
  }

  .user-card .describe {
    font-size: 13px;
    line-height: 1.4;
  }
}

/* 添加卡片hover效果 */
.card.active:hover {
  transform: translateX(0) translateZ(50px) rotateY(0) scale(1.02);
  box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

/* 添加指示器样式 */
.carousel-indicators {
  position: absolute;
  bottom: -70px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0,0,0,0.2);
  cursor: pointer;
  transition: all 0.3s ease;
}

.indicator.active {
  width: 24px;
  border-radius: 4px;
  background: #ff923e;
}

.card img {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.card.active img {
  transform: scale(1);
}

.card:not(.active) img {
  transform: scale(0.95);
}

/* 添加内容动画 */
.card.active .info {
  animation: slideUp 0.5s ease forwards;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 优化标签动画 */
.project-card.active .tag {
  animation: fadeIn 0.3s ease forwards;
  animation-delay: calc(var(--tag-index) * 0.1s);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
} 