/* ============================================
   StudyByAI - 沉浸式英语 Official Website
   Design System: Matching Immersive English App
   ============================================ */

/* --- CSS Variables --- */
:root {
  /* Colors */
  --color-primary: #6d4cff;
  --color-primary-dark: #5c46e6;
  --color-primary-light: #9e8bff;
  --color-primary-bg: #f5f6fb;
  --color-primary-gradient: linear-gradient(135deg, #6d4cff, #9e8bff);
  --color-hero-gradient: linear-gradient(130deg, #edf0ff, #e3ddff 55%, #ddd2ff);
  --color-card-bg: #ffffff;
  --color-bg: #f8fafc;
  --color-text: #111827;
  --color-text-secondary: #1e293b;
  --color-text-muted: #64748b;
  --color-text-light: #94a3b8;
  --color-border: #e5e7eb;
  --color-border-light: rgba(113, 92, 187, 0.1);
  --color-shadow: 0 10px 24px rgba(70, 51, 138, 0.06);
  --color-shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.12);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --container-max: 1200px;
  --section-padding: 100px 0;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;

  /* Transitions */
  --transition: 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

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

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

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-primary-dark);
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 700;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(109, 76, 255, 0.35);
}

.btn--primary:hover {
  background: var(--color-primary-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(109, 76, 255, 0.45);
}

.btn--outline {
  background: transparent;
  color: var(--color-text-secondary);
  border: 2px solid var(--color-border);
}

.btn--outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(109, 76, 255, 0.04);
}

.btn--white {
  background: #fff;
  color: var(--color-primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.btn--white:hover {
  background: #faf9ff;
  color: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn--sm {
  padding: 8px 18px;
  font-size: 13px;
}

.btn--lg {
  padding: 14px 32px;
  font-size: 16px;
}

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

.section-head__label {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(109, 76, 255, 0.08);
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}

.section-head__title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 900;
  color: var(--color-text);
  line-height: 1.25;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.section-head__desc {
  font-size: 17px;
  color: var(--color-text-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ============================================
   HEADER
   ============================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 246, 251, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.6);
}

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

.header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.header__logo-img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: block;
  object-fit: cover;
}

.header__logo-dot {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--color-primary-gradient);
  display: block;
}

.header__brand {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

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

.header__link {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

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

.header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  background: var(--color-hero-gradient);
  padding: 80px 0 60px;
  overflow: hidden;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero__content {
  max-width: 560px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: rgba(109, 76, 255, 0.1);
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-full);
  margin-bottom: 24px;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5.2vw, 56px);
  font-weight: 900;
  color: var(--color-text);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero__highlight {
  background: var(--color-primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__desc {
  font-size: 17px;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: 32px;
}

.hero__cta {
  display: flex;
  gap: 14px;
  margin-bottom: 48px;
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 440px;
}

.hero__stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-md);
  border: 1px solid rgba(113, 92, 187, 0.1);
}

.hero__stat strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--color-text);
}

.hero__stat span {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* Hero Visual / Carousel */
.hero__visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__carousel {
  position: relative;
}

.carousel-phone {
  position: relative;
}

.carousel-phone__frame {
  position: relative;
  width: 300px;
  height: 600px;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(109, 76, 255, 0.18), 0 4px 12px rgba(0, 0, 0, 0.06);
  border: 3px solid #e8e4f8;
  background: #f5f6fb;
}

.carousel-phone__img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.carousel-phone__img.active {
  opacity: 1;
  pointer-events: auto;
}

.carousel-phone__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(109, 76, 255, 0.25);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s ease;
}

.carousel-dot:hover {
  background: rgba(109, 76, 255, 0.5);
}

.carousel-dot.active {
  width: 24px;
  border-radius: 4px;
  background: var(--color-primary);
}

/* Floating badges */
.hero__float {
  position: absolute;
  padding: 8px 16px;
  background: #fff;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-secondary);
  box-shadow: 0 4px 16px rgba(109, 76, 255, 0.1);
}

.hero__float--1 {
  top: 20px;
  right: 10px;
  color: var(--color-primary);
}

.hero__float--2 {
  bottom: 40px;
  left: 0;
}

.hero__float--3 {
  bottom: 80px;
  right: -20px;
}

.hero__wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  color: var(--color-bg);
  line-height: 0;
}

.hero__wave svg {
  width: 100%;
  height: 60px;
}

/* ============================================
   FEATURES
   ============================================ */
.features {
  padding: var(--section-padding);
  background: var(--color-bg);
}

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

.feature-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--color-shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--color-shadow-lg);
}

.feature-card__icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.feature-card__icon--purple { background: #ede9fe; color: #7c3aed; }
.feature-card__icon--green { background: #dcfce7; color: #16a34a; }
.feature-card__icon--orange { background: #ffedd5; color: #f97316; }
.feature-card__icon--blue { background: #dbeafe; color: #2563eb; }
.feature-card__icon--pink { background: #fce7f3; color: #db2777; }
.feature-card__icon--cyan { background: #cffafe; color: #0891b2; }

.feature-card__title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 10px;
  line-height: 1.3;
}

.feature-card__desc {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: 18px;
}

.feature-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.feature-card__tags li {
  padding: 4px 12px;
  background: rgba(109, 76, 255, 0.06);
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-full);
}

/* ============================================
   HOW IT WORKS
   ============================================ */
.how-it-works {
  padding: var(--section-padding);
  background: #fff;
}

.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.step {
  flex: 1;
  text-align: center;
  padding: 32px 24px;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--color-shadow);
}

.step__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--color-primary-gradient);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 18px;
}

.step__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 8px;
}

.step__desc {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.65;
}

.step__connector {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* ============================================
   AUDIENCE
   ============================================ */
.audience {
  padding: var(--section-padding);
  background: var(--color-bg);
}

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

.audience-card {
  text-align: center;
  padding: 36px 20px;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--color-shadow);
  transition: transform var(--transition);
}

.audience-card:hover {
  transform: translateY(-3px);
}

.audience-card__emoji {
  font-size: 40px;
  margin-bottom: 14px;
}

.audience-card__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 10px;
}

.audience-card__desc {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* ============================================
   ADVANTAGES
   ============================================ */
.advantages {
  padding: 60px 0;
  background: #fff;
}

.advantages__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  text-align: center;
}

.advantage-item__icon {
  font-size: 32px;
  margin-bottom: 10px;
}

.advantage-item h4 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 6px;
}

.advantage-item p {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ============================================
   FAQ
   ============================================ */
.faq {
  padding: var(--section-padding);
  background: var(--color-bg);
}

.faq__list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--color-shadow);
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.faq-item[open] {
  box-shadow: var(--color-shadow-lg);
}

.faq-item__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.faq-item__question::-webkit-details-marker {
  display: none;
}

.faq-item__question::marker {
  display: none;
  content: '';
}

.faq-item__icon {
  flex-shrink: 0;
  color: var(--color-text-light);
  transition: transform var(--transition);
}

.faq-item[open] .faq-item__icon {
  transform: rotate(180deg);
  color: var(--color-primary);
}

.faq-item__answer {
  padding: 0 24px 20px;
  font-size: 15px;
  color: var(--color-text-muted);
  line-height: 1.7;
}

.faq-item__answer a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: underline;
}

/* ============================================
   CTA
   ============================================ */
.cta {
  padding: 80px 0;
  background: var(--color-bg);
}

.cta__card {
  position: relative;
  text-align: center;
  padding: 64px 40px;
  background: var(--color-primary-gradient);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.cta__card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.1) 0%, transparent 50%);
}

.cta__title {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 900;
  color: #fff;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.cta__desc {
  position: relative;
  font-size: 17px;
  color: rgba(255, 255, 255, 0.85);
  max-width: 520px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.cta__actions {
  position: relative;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: #fff;
  border-top: 1px solid var(--color-border);
  padding: 56px 0 0;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--color-border);
}

.footer__brand {
  max-width: 280px;
}

.footer__logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--color-text);
  text-decoration: none;
  margin-bottom: 14px;
}

.footer__logo-img {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: block;
  object-fit: cover;
}

.footer__logo-dot {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--color-primary-gradient);
}

.footer__tagline {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.65;
}

.footer__links {
  display: flex;
  gap: 60px;
}

.footer__col h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer__col a {
  display: block;
  font-size: 14px;
  color: var(--color-text-muted);
  text-decoration: none;
  margin-bottom: 10px;
  transition: color var(--transition);
}

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

.footer__bottom {
  padding: 20px 0;
}

.footer__bottom p {
  font-size: 13px;
  color: var(--color-text-light);
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Large desktops (1400px+) */
@media (min-width: 1400px) {
  .container {
    max-width: 1280px;
  }
}

/* Tablets / Small laptops (768px - 1024px) */
@media (max-width: 1024px) {
  :root {
    --section-padding: 72px 0;
  }

  .hero__inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero__visual {
    order: -1;
  }

  .hero__content {
    max-width: 100%;
    text-align: center;
  }

  .hero__cta {
    justify-content: center;
  }

  .hero__stats {
    max-width: 100%;
    grid-template-columns: repeat(4, 1fr);
  }

  .features__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .audience__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .advantages__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .steps {
    flex-direction: column;
    gap: 20px;
  }

  .step__connector {
    transform: rotate(90deg);
  }

  .footer__inner {
    flex-direction: column;
    gap: 32px;
  }

  .footer__brand {
    max-width: 100%;
  }
}

/* Mobile (below 768px) */
@media (max-width: 768px) {
  :root {
    --section-padding: 56px 0;
  }

  .header__nav {
    display: none;
  }

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

  .hero__title {
    font-size: 30px;
  }

  .hero__stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .hero__float {
    display: none;
  }

  .features__grid {
    grid-template-columns: 1fr;
  }

  .audience__grid {
    grid-template-columns: 1fr;
  }

  .advantages__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .carousel-phone__frame {
    width: 260px;
    height: 520px;
  }

  .cta__card {
    padding: 40px 24px;
  }

  .footer__links {
    flex-direction: column;
    gap: 28px;
  }
}

/* Small mobile (below 480px) */
@media (max-width: 480px) {
  .carousel-phone__frame {
    width: 220px;
    height: 440px;
  }

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

  .hero__stats {
    grid-template-columns: 1fr;
  }

  .advantages__grid {
    grid-template-columns: 1fr;
  }
}

/* --- Accessibility --- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Focus styles --- */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Print styles --- */
@media print {
  .header,
  .footer,
  .cta,
  .hero__visual,
  .hero__float,
  .step__connector {
    display: none;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }
}
