/* ========================================
   PUZNIX HOMEPAGE - 蓝天白云主题
   ======================================== */

/* CSS 变量 */
:root {
  --sky-start: #87CEEB;
  --sky-mid: #B4E0FA;
  --sky-end: #E0F4FF;
  --gold: #FFD700;
  --coral: #FF7F50;
  --text-dark: #2C3E50;
  --text-light: rgba(44, 62, 80, 0.7);
  --white: #FFFFFF;
  --off-white: #F5F5F5;
  --card-bg: rgba(255, 255, 255, 0.85);
  --card-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  --section-padding: 80px 20px;
  --cloud-drift-distance: 300px;
}

/* 基础样式重置 */
.homepage {
  margin: 0;
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--text-dark);
  background: linear-gradient(180deg, var(--sky-start) 0%, var(--sky-mid) 30%, var(--sky-end) 70%, var(--white) 100%);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ========================================
   动态云朵背景
   ======================================== */
.cloud-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.cloud {
  position: absolute;
  background: white;
  border-radius: 100px;
  opacity: 0.9;
  filter: blur(1px);
}

.cloud::before,
.cloud::after {
  content: '';
  position: absolute;
  background: white;
  border-radius: 50%;
}

/* 云朵1 - 左上 */
.cloud-1 {
  width: 200px;
  height: 60px;
  top: 8%;
  left: -100px;
  animation: drift-slow 80s linear infinite;
}
.cloud-1::before {
  width: 80px;
  height: 80px;
  top: -40px;
  left: 30px;
}
.cloud-1::after {
  width: 100px;
  height: 100px;
  top: -50px;
  left: 80px;
}

/* 云朵2 - 右上 */
.cloud-2 {
  width: 250px;
  height: 70px;
  top: 15%;
  right: -150px;
  animation: drift-reverse 100s linear infinite;
  opacity: 0.8;
}
.cloud-2::before {
  width: 90px;
  height: 90px;
  top: -45px;
  left: 40px;
}
.cloud-2::after {
  width: 120px;
  height: 120px;
  top: -60px;
  left: 100px;
}

/* 云朵3 - 中左 */
.cloud-3 {
  width: 180px;
  height: 55px;
  top: 35%;
  left: -80px;
  animation: drift-slow 90s linear infinite;
  animation-delay: -20s;
  opacity: 0.7;
}
.cloud-3::before {
  width: 70px;
  height: 70px;
  top: -35px;
  left: 25px;
}
.cloud-3::after {
  width: 85px;
  height: 85px;
  top: -42px;
  left: 70px;
}

/* 云朵4 - 中右 */
.cloud-4 {
  width: 220px;
  height: 65px;
  top: 45%;
  right: -120px;
  animation: drift-reverse 110s linear infinite;
  animation-delay: -30s;
  opacity: 0.6;
}
.cloud-4::before {
  width: 85px;
  height: 85px;
  top: -42px;
  left: 35px;
}
.cloud-4::after {
  width: 105px;
  height: 105px;
  top: -52px;
  left: 90px;
}

/* 云朵5 - 下左 */
.cloud-5 {
  width: 160px;
  height: 50px;
  top: 60%;
  left: -60px;
  animation: drift-slow 70s linear infinite;
  animation-delay: -40s;
  opacity: 0.5;
}
.cloud-5::before {
  width: 60px;
  height: 60px;
  top: -30px;
  left: 20px;
}
.cloud-5::after {
  width: 75px;
  height: 75px;
  top: -37px;
  left: 60px;
}

/* 云朵6 - 下右 */
.cloud-6 {
  width: 190px;
  height: 58px;
  top: 70%;
  right: -90px;
  animation: drift-reverse 85s linear infinite;
  animation-delay: -50s;
  opacity: 0.4;
}
.cloud-6::before {
  width: 75px;
  height: 75px;
  top: -37px;
  left: 30px;
}
.cloud-6::after {
  width: 90px;
  height: 90px;
  top: -45px;
  left: 75px;
}

@keyframes drift-slow {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(100vw + var(--cloud-drift-distance))); }
}

@keyframes drift-reverse {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-100vw - var(--cloud-drift-distance))); }
}

/* ========================================
   导航栏
   ======================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: all 0.3s ease;
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
  padding: 12px 0;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: contain;
}

.nav-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--coral);
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--coral) 0%, #ff9068 100%);
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  border-radius: 50px;
  box-shadow: 0 8px 24px rgba(255, 127, 80, 0.35);
  transition: all 0.3s ease;
}

.nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(255, 127, 80, 0.45);
}

/* 移动端菜单按钮 */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* 移动端菜单 */
.mobile-menu {
  display: none;
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 20px;
  flex-direction: column;
  gap: 16px;
  z-index: 99;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  transform: translateY(-100%);
  opacity: 0;
  transition: all 0.3s ease;
}

.mobile-menu.active {
  transform: translateY(0);
  opacity: 1;
}

.mobile-link {
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--coral) 0%, #ff9068 100%);
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  border-radius: 50px;
  margin-top: 8px;
}

/* ========================================
   首屏 Hero
   ======================================== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 120px 20px 80px;
  position: relative;
  z-index: 1;
  text-align: center;
}

.hero-content {
  max-width: 700px;
  margin-bottom: 48px;
}

.hero-title {
  font-size: clamp(36px, 8vw, 64px);
  font-weight: 900;
  line-height: 1.2;
  margin: 0 0 24px;
  color: var(--text-dark);
  text-shadow: 0 2px 20px rgba(255, 255, 255, 0.5);
}

.hero-subtitle {
  font-size: clamp(16px, 3vw, 20px);
  color: var(--text-light);
  margin: 0 0 40px;
  line-height: 1.6;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 36px;
  background: linear-gradient(135deg, var(--coral) 0%, #ff9068 100%);
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
  border-radius: 60px;
  box-shadow: 0 12px 40px rgba(255, 127, 80, 0.4);
  transition: all 0.3s ease;
}

.hero-cta svg {
  width: 22px;
  height: 22px;
  transition: transform 0.3s ease;
}

.hero-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 50px rgba(255, 127, 80, 0.5);
}

.hero-cta:hover svg {
  transform: translateX(6px);
}

/* 拼图预览视觉 */
.hero-visual {
  width: 100%;
  max-width: 400px;
  perspective: 1000px;
}

.puzzle-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 16px;
  background: var(--card-bg);
  border-radius: 24px;
  box-shadow: var(--card-shadow);
  transform: rotateX(5deg) rotateY(-5deg);
  transition: transform 0.5s ease;
}

.puzzle-preview:hover {
  transform: rotateX(0) rotateY(0);
}

.puzzle-piece {
  aspect-ratio: 1;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--sky-start), var(--sky-end));
  position: relative;
  overflow: hidden;
  animation: piece-float 3s ease-in-out infinite;
}

.puzzle-piece::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse 30px 20px at 30% 40%, rgba(255,255,255,0.9), transparent 70%),
    radial-gradient(ellipse 25px 15px at 70% 60%, rgba(255,255,255,0.7), transparent 70%);
}

.piece-1 { animation-delay: 0s; }
.piece-2 { animation-delay: 0.1s; transform: translate(2px, -2px); opacity: 0.95; }
.piece-3 { animation-delay: 0.2s; }
.piece-4 { animation-delay: 0.3s; transform: translate(-2px, 2px); opacity: 0.9; }
.piece-5 { animation-delay: 0.4s; }
.piece-6 { animation-delay: 0.5s; transform: translate(3px, 0); opacity: 0.85; }
.piece-7 { animation-delay: 0.6s; }
.piece-8 { animation-delay: 0.7s; transform: translate(0, 3px); opacity: 0.9; }
.piece-9 { animation-delay: 0.8s; transform: translate(-3px, -3px); }

@keyframes piece-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ========================================
   通用区块样式
   ======================================== */
.section-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--section-padding);
}

.section-title {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 900;
  text-align: center;
  margin: 0 0 12px;
  color: var(--text-dark);
}

.section-subtitle {
  font-size: 18px;
  color: var(--text-light);
  text-align: center;
  margin: 0 0 48px;
}

/* ========================================
   功能特色区
   ======================================== */
.features {
  background: rgba(255, 255, 255, 0.4);
  position: relative;
  z-index: 1;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 24px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.6);
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}

.cloud-card {
  position: relative;
}

.cloud-card::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 40px;
  background: white;
  border-radius: 40px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cloud-card:hover::before {
  opacity: 0.5;
}

.feature-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--sky-start), var(--sky-end));
  border-radius: 20px;
}

.feature-icon svg {
  width: 32px;
  height: 32px;
  color: var(--text-dark);
}

.feature-card h3 {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 12px;
  color: var(--text-dark);
}

.feature-card p {
  font-size: 15px;
  color: var(--text-light);
  margin: 0;
  line-height: 1.6;
}

/* ========================================
   奖励阶梯区
   ======================================== */
.rewards {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, rgba(135,206,235,0.2) 100%);
}

.rewards-ladder {
  max-width: 800px;
  margin: 0 auto;
}

.ladder-track {
  position: relative;
  padding-left: 60px;
}

.ladder-line {
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--sky-start), var(--coral), #9B59B6, var(--gold));
  border-radius: 4px;
}

.ladder-step {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 24px 0;
  position: relative;
}

.step-marker {
  position: absolute;
  left: -60px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-cloud {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.low-cloud {
  background: linear-gradient(135deg, #ffffff, var(--sky-end));
}

.sunset-cloud {
  background: linear-gradient(135deg, #FFB6C1, var(--coral));
}

.starry-cloud {
  background: linear-gradient(135deg, #9B59B6, #3498DB);
}

.golden-cloud {
  background: linear-gradient(135deg, var(--gold), #FFA500);
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
}

.step-content {
  flex: 1;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 24px 28px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.6);
  transition: all 0.3s ease;
}

.step-content:hover {
  transform: translateX(8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.step-badge {
  display: inline-block;
  padding: 6px 16px;
  background: linear-gradient(135deg, var(--sky-start), var(--sky-end));
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.badge-coral {
  background: linear-gradient(135deg, var(--coral), #ff9068);
  color: white;
}

.badge-purple {
  background: linear-gradient(135deg, #9B59B6, #8E44AD);
  color: white;
}

.badge-gold {
  background: linear-gradient(135deg, var(--gold), #FFA500);
  color: #5D4E1E;
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.3);
}

.step-content h4 {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--text-dark);
}

.step-content p {
  font-size: 14px;
  color: var(--text-light);
  margin: 0;
}

/* ========================================
   用户评价区
   ======================================== */
.testimonials {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.5);
}

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.testimonial-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 24px;
  padding: 32px 28px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.6);
  transition: all 0.3s ease;
}

.testimonial-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.12);
}

.testimonial-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--coral), #ff9068);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  box-shadow: 0 6px 20px rgba(255, 127, 80, 0.3);
}

.testimonial-avatar span {
  font-size: 22px;
  font-weight: 800;
  color: white;
}

.testimonial-text {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-dark);
  margin: 0 0 16px;
  font-style: italic;
}

.testimonial-author {
  font-size: 14px;
  color: var(--text-light);
  font-weight: 600;
}

/* ========================================
   底部CTA区
   ======================================== */
.cta-section {
  position: relative;
  z-index: 1;
}

.cta-card {
  background: linear-gradient(135deg, var(--sky-start), #5DA8D1);
  border-radius: 32px;
  padding: 60px 40px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(93, 168, 209, 0.3);
  position: relative;
  overflow: hidden;
}

.cta-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(ellipse 100px 60px at 20% 30%, rgba(255,255,255,0.3), transparent 70%),
    radial-gradient(ellipse 80px 50px at 70% 60%, rgba(255,255,255,0.2), transparent 70%),
    radial-gradient(ellipse 120px 70px at 50% 80%, rgba(255,255,255,0.25), transparent 70%);
  animation: cloud-float 20s ease-in-out infinite;
}

@keyframes cloud-float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, -10px); }
}

.cta-card h2 {
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 900;
  color: white;
  margin: 0 0 16px;
  position: relative;
}

.cta-card p {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 32px;
  position: relative;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 40px;
  background: white;
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
  border-radius: 60px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  position: relative;
}

.cta-btn svg {
  width: 22px;
  height: 22px;
  transition: transform 0.3s ease;
}

.cta-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.2);
}

.cta-btn:hover svg {
  transform: translateX(6px);
}

/* ========================================
   页脚
   ======================================== */
.footer {
  background: white;
  padding: 48px 20px 32px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.footer-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: contain;
}

.footer-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-dark);
}

.footer-tagline {
  font-size: 15px;
  color: var(--text-light);
  margin: 0 0 24px;
}

.footer-copyright {
  font-size: 13px;
  color: var(--text-light);
  margin: 0;
  padding-top: 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 768px) {
  :root {
    --section-padding: 60px 16px;
  }
  
  .nav-links {
    display: none;
  }
  
  .nav-toggle {
    display: flex;
  }
  
  .mobile-menu {
    display: flex;
  }
  
  .hero {
    padding: 100px 16px 60px;
  }
  
  .hero-visual {
    max-width: 320px;
  }
  
  .puzzle-preview {
    padding: 12px;
    gap: 4px;
  }
  
  .ladder-track {
    padding-left: 50px;
  }
  
  .ladder-line {
    left: 20px;
    width: 3px;
  }
  
  .step-marker {
    left: -50px;
    width: 44px;
    height: 44px;
  }
  
  .step-cloud {
    width: 40px;
    height: 40px;
  }
  
  .step-content {
    padding: 20px 22px;
  }
  
  /* 移动端云朵动画优化 - 更轻量 */
  .cloud {
    opacity: 0.6;
  }
  
  .cloud::before,
  .cloud::after {
    opacity: 0.8;
  }
  
  /* 使用 CSS 变量减少动画距离 */
  .cloud-bg {
    --cloud-drift-distance: 200px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 32px;
  }
  
  .hero-cta {
    padding: 16px 28px;
    font-size: 16px;
  }
  
  .feature-card {
    padding: 24px 20px;
  }
  
  .testimonial-card {
    padding: 24px 20px;
  }
  
  .cta-card {
    padding: 40px 24px;
    border-radius: 24px;
  }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  .cloud,
  .puzzle-piece,
  .cta-card::before {
    animation: none;
  }
  
  .feature-card:hover,
  .step-content:hover,
  .testimonial-card:hover,
  .hero-cta:hover,
  .nav-btn:hover,
  .cta-btn:hover {
    transform: none;
  }
}

/* 大屏幕优化 */
@media (min-width: 1440px) {
  .section-container {
    max-width: 1400px;
  }
  
  .cloud-1 { width: 280px; height: 80px; }
  .cloud-1::before { width: 110px; height: 110px; top: -55px; }
  .cloud-1::after { width: 140px; height: 140px; top: -70px; }
  
  .cloud-2 { width: 320px; height: 90px; }
  .cloud-2::before { width: 120px; height: 120px; top: -60px; }
  .cloud-2::after { width: 160px; height: 160px; top: -80px; }
}
