/* ============================================
   Responsive Design - 优先移动端
   ============================================ */

/* Tablet: 768-1023px */
@media (max-width: 1023px) {
  .features-grid,
  .tests-grid,
  .listing-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-title {
    font-size: var(--text-4xl);
  }

  .stat-number {
    font-size: var(--text-3xl);
  }
}

/* Mobile: <768px */
@media (max-width: 767px) {
  /* --- 导航栏 --- */
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: var(--header-height);
    right: 0;
    bottom: 0;
    width: 65%;
    max-width: 280px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-4);
    background: var(--color-bg);
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
    height: calc(100vh - var(--header-height));
    transform: translateX(100%);
    transition: transform var(--transition-base);
    overflow-y: auto;
    z-index: 99;
  }

  .nav-menu.is-open {
    transform: translateX(0);
  }

  .nav-link {
    padding: var(--space-4);
    font-size: var(--text-lg);
    text-align: right;
    border-bottom: 1px solid var(--color-border-light);
  }

  /* --- Hero --- */
  .hero-section {
    padding: var(--space-12) 0;
  }

  .hero-title {
    font-size: var(--text-3xl);
  }

  .hero-subtitle {
    font-size: var(--text-base);
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-actions .btn-primary {
    animation: cta-pulse 3s ease-in-out infinite;
  }

  .hero-stats {
    gap: var(--space-6);
  }

  .stat-number {
    font-size: var(--text-2xl);
  }

  /* --- Grids 单列 --- */
  .features-grid,
  .tests-grid,
  .listing-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  /* --- 间距 --- */
  .features-section,
  .tests-section {
    padding: var(--space-10) 0;
  }

  .cta-section {
    padding: var(--space-12) 0;
  }

  .section-header {
    margin-bottom: var(--space-8);
  }

  .section-title {
    font-size: var(--text-2xl);
  }

  /* --- 页面标题 --- */
  .page-title {
    font-size: var(--text-3xl);
  }

  .page-header {
    padding: var(--space-8) var(--space-4) var(--space-6);
  }

  /* --- 页脚 --- */
  .footer-links {
    gap: var(--space-8);
    flex-direction: column;
  }

  .site-footer {
    padding: var(--space-8) 0 var(--space-6);
  }

  /* --- 容器 --- */
  .container,
  .container-narrow {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  /* --- 测试界面移动端适配 --- */
  .test-container {
    padding: var(--space-4) !important;
  }

  .question-text {
    font-size: var(--text-base) !important;
  }

  .option-item {
    padding: var(--space-4) var(--space-4) !important;
    min-height: 56px !important;
    border-radius: var(--radius-lg) !important;
  }

  .option-label {
    font-size: var(--text-base) !important;
  }

  .quiz-nav {
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .quiz-nav .btn {
    flex: 1;
    min-width: 0;
    font-size: var(--text-sm);
    padding: var(--space-3) var(--space-4);
  }

  .question-counter {
    order: -1;
    width: 100%;
    text-align: center;
  }

  .question-text {
    font-size: var(--text-lg) !important;
  }

  .result-score {
    font-size: var(--text-4xl) !important;
  }

  .share-buttons {
    gap: var(--space-2);
    justify-content: center;
  }

  .share-btn {
    min-width: 56px;
    padding: var(--space-2) var(--space-2);
    height: 56px;
  }

  .share-btn-label {
    font-size: 10px;
  }

  /* Make the native share button more prominent */
  .share-btn-native {
    background: var(--color-primary-bg);
    border-color: var(--color-primary-light);
    min-width: 64px;
  }

  .result-description {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
  }

  /* Stepper dots on mobile */
  .question-stepper {
    gap: var(--space-1);
    padding: var(--space-1) 0;
    margin-bottom: var(--space-4);
  }

  .stepper-dot {
    width: 8px;
    min-width: 8px;
    height: 8px;
  }

  /* Celebration on mobile */
  .test-celebration {
    padding: var(--space-8) var(--space-4);
  }
  .celebration-icon {
    font-size: 3rem;
  }
  .celebration-text {
    font-size: var(--text-xl);
  }
}

/* Small mobile: <420px */
@media (max-width: 419px) {
  .hero-title {
    font-size: var(--text-2xl);
  }

  .hero-stats {
    flex-direction: column;
    gap: var(--space-4);
  }

  .stat-number {
    font-size: var(--text-xl);
  }
}

/* Print */
@media print {
  .site-header,
  .site-footer,
  .theme-toggle,
  .nav-toggle {
    display: none !important;
  }

  .main-content {
    padding-top: 0;
  }

  body {
    background: white;
    color: black;
  }
}

/* ====== CTA pulse animation (mobile hero button) ====== */
@keyframes cta-pulse {
  0%, 100% { box-shadow: 0 4px 14px rgb(124 58 237 / 0.3); }
  50% { box-shadow: 0 4px 24px rgb(124 58 237 / 0.5), 0 0 40px rgb(124 58 237 / 0.15); }
}
