/* ============================================
   SmartSchool 打卡营 - 高效英语学习平台
   Style: Clean & Professional
   ============================================ */

/* --- CSS Variables --- */
:root {
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-light: #EEF2FF;
  --primary-50: #E0E7FF;

  --text: #111827;
  --text-secondary: #4B5563;
  --text-muted: #9CA3AF;

  --bg: #FFFFFF;
  --bg-section: #F9FAFB;
  --border: #E5E7EB;
  --border-light: #F3F4F6;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --font: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  --max-width: 1120px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 图片加载占位符 */
.img-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(110deg, #f0f0f0 8%, #e0e0e0 18%, #f0f0f0 33%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  z-index: 1;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 图片加载完成后隐藏占位符 */
.img-placeholder.hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* 图片加载过渡效果 */
.screenshot-item img,
.phone-screen img {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.screenshot-item img.loaded,
.phone-screen img.loaded {
  opacity: 1;
}

/* Hero 图片特殊处理 - 立即显示 */
.phone-screen img {
  position: relative;
  z-index: 2;
}

/* 截图容器相对定位 */
.screenshot-item {
  position: relative;
}

.screenshot-item img {
  position: relative;
  z-index: 2;
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transition: box-shadow 0.2s;
}

.header.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.875rem;
}

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

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.15s;
}

.nav-links a:hover {
  color: var(--primary);
}

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-section);
  border-radius: 50px;
  padding: 4px;
  border: 1px solid var(--border);
}

.lang-btn {
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font);
}

.lang-btn:hover {
  color: var(--primary);
}

.lang-btn.active {
  background: var(--primary);
  color: white;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  border-color: #D1D5DB;
  box-shadow: var(--shadow);
}

.btn-white {
  background: white;
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-md);
}

.btn-white:hover {
  box-shadow: var(--shadow-lg);
}

/* --- Download Dropdown --- */
.download-dropdown {
  position: relative;
  display: inline-block;
}

.download-trigger {
  cursor: pointer;
}

.dropdown-arrow {
  transition: transform 0.2s ease;
  margin-left: 4px;
}

.download-dropdown.active .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  min-width: 180px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 1000;
}

.download-dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  transition: all 0.15s ease;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-decoration: none;
  font-family: var(--font);
}

.dropdown-item:hover:not(.dropdown-item-disabled) {
  background: var(--primary-light);
  color: var(--primary);
}

.dropdown-item-disabled {
  opacity: 0.6;
  cursor: not-allowed;
  position: relative;
}

.coming-soon-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: linear-gradient(135deg, #FF6B6B 0%, #4ECDC4 100%);
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  border-radius: 50px;
  white-space: nowrap;
  margin-left: auto;
}

/* --- Hero --- */
.hero {
  padding: 80px 0 96px;
  background: linear-gradient(180deg, var(--primary-light) 0%, var(--bg) 100%);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: white;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.8rem;
  border-radius: 50px;
  border: 1px solid var(--primary-50);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.hero-title {
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  color: var(--text);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-title span {
  color: var(--primary);
}

/* Global Badge Capsule */
.global-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: linear-gradient(135deg, #FF6B6B 0%, #4ECDC4 100%);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 50px;
  white-space: nowrap;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(78, 205, 196, 0.3);
  animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(78, 205, 196, 0.3);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.4);
  }
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 460px;
  margin-bottom: 32px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.hero-stats {
  display: flex;
  gap: 40px;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  display: block;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Phone Mockup */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.phone-mockup {
  position: relative;
  width: 280px;
  height: 580px;
  background: #1A1A2E;
  border-radius: 40px;
  padding: 8px;
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 32px;
  overflow: hidden;
  background: white;
}

.phone-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.phone-notch {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 28px;
  background: #1A1A2E;
  border-radius: 0 0 18px 18px;
  z-index: 2;
}

/* --- Section Shared --- */
.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.8rem;
  border-radius: 50px;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.section-title span {
  color: var(--primary);
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

/* --- Features --- */
.features {
  padding: 96px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  padding: 28px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
  background: var(--bg);
}

.feature-card:hover {
  border-color: var(--primary-50);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- Screenshots --- */
.screenshots {
  padding: 96px 0;
  background: var(--bg-section);
}

.screenshots-scroll {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.screenshot-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: white;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.screenshot-item:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.screenshot-item img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
}

.screenshot-label {
  padding: 10px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  border-top: 1px solid var(--border-light);
}

/* --- How It Works --- */
.how-it-works {
  padding: 96px 0;
}

.steps-grid {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  justify-content: center;
}

.step-card {
  flex: 1;
  max-width: 320px;
  text-align: center;
  padding: 32px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
}

.step-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.step-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.step-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.step-connector {
  flex-shrink: 0;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-top: 60px;
}

/* --- Download CTA --- */
.download-cta {
  padding: 96px 0;
  background: var(--bg-section);
}

.cta-card {
  background: var(--primary);
  border-radius: var(--radius-xl);
  padding: 64px 40px;
  text-align: center;
  position: relative;
  overflow: visible;
}

.cta-card::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  top: -200px;
  right: -100px;
}

.cta-card::after {
  content: '';
  position: absolute;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  bottom: -100px;
  left: -50px;
}

.cta-content {
  position: relative;
  z-index: 10;
}

.cta-content h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: white;
  margin-bottom: 12px;
}

.cta-content p {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.8);
  max-width: 460px;
  margin: 0 auto 28px;
}

.cta-hint {
  display: block;
  margin-top: 14px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

/* --- Footer --- */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border-light);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- Scroll Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.feature-card.fade-in:nth-child(2) { transition-delay: 0.06s; }
.feature-card.fade-in:nth-child(3) { transition-delay: 0.12s; }
.feature-card.fade-in:nth-child(4) { transition-delay: 0.18s; }
.feature-card.fade-in:nth-child(5) { transition-delay: 0.24s; }
.feature-card.fade-in:nth-child(6) { transition-delay: 0.30s; }

.screenshot-item.fade-in:nth-child(2) { transition-delay: 0.06s; }
.screenshot-item.fade-in:nth-child(3) { transition-delay: 0.12s; }
.screenshot-item.fade-in:nth-child(4) { transition-delay: 0.18s; }
.screenshot-item.fade-in:nth-child(5) { transition-delay: 0.24s; }
.screenshot-item.fade-in:nth-child(6) { transition-delay: 0.30s; }
.screenshot-item.fade-in:nth-child(7) { transition-delay: 0.36s; }
.screenshot-item.fade-in:nth-child(8) { transition-delay: 0.42s; }

.step-card.fade-in:nth-child(2) { transition-delay: 0.06s; }
.step-card.fade-in:nth-child(3) { transition-delay: 0.12s; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .screenshots-scroll {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-actions {
    gap: 8px;
  }

  .lang-switcher {
    padding: 2px;
  }

  .lang-btn {
    padding: 4px 8px;
    font-size: 0.7rem;
  }

  .hero {
    padding: 48px 0 64px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
  }

  .hero-visual {
    order: -1;
  }

  .phone-mockup {
    width: 220px;
    height: 460px;
  }

  .features-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
    margin: 0 auto;
  }

  .screenshots-scroll {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .steps-grid {
    flex-direction: column;
    align-items: center;
  }

  .step-connector {
    transform: rotate(90deg);
    margin-top: 0;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  /* Dropdown responsive */
  .dropdown-menu {
    min-width: 160px;
    left: auto;
    right: 0;
    transform: translateY(-10px);
  }

  .download-dropdown.active .dropdown-menu {
    transform: translateY(0);
  }

  .hero-actions .dropdown-menu {
    left: 50%;
    right: auto;
    transform: translateX(-50%) translateY(-10px);
  }

  .hero-actions .download-dropdown.active .dropdown-menu {
    transform: translateX(-50%) translateY(0);
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .global-badge {
    font-size: 0.65rem;
    padding: 4px 10px;
  }

  .btn-lg {
    padding: 12px 20px;
    font-size: 0.9rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .hero-stats {
    flex-direction: column;
    gap: 12px;
  }

  .phone-mockup {
    width: 200px;
    height: 420px;
  }

  .cta-card {
    padding: 48px 24px;
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
